// Dailymotion Player Embed v0.146.0 (49bd46a) // License: https://geo.dailymotion.com/static/latest/cdn/dmp.license.f4058b9dceeaa8b3d27cf9c59af17a7e43e25c84.txt // This file is generated dynamically, do not host it yourself // Statically hosting or caching this file will break your integration var _dmpesplayer = (function () { 'use strict'; let e;let t={"criticalMetadata":{},"envFlipper":"prod","envFrontend":"prod","envGeo":"prod","geoip":{"visitorAsNumber":"AS396982","visitorCity":"Washington","visitorContinent":"NA","visitorCountry":"US","visitorRegion":"DC"},"isDmNetwork":false,"player":{"player_id":"xa9e1","profile":{"profile_id":"x2hjpck","organization_id":"x2f8r0"},"endpoints":{"embed_url":"https://geo.dailymotion.com/player/xa9e1.js","iframe_url":"https://geo.dailymotion.com/player/xa9e1.html","lib_url":"https://geo.dailymotion.com/libs/player/xa9e1.js"},"advertising":{"enable_ads":true,"enable_eid_collection":false,"enable_preload":true,"enable_wait_for_custom_config":false,"has_ssai":false,"pressure_mode":"standard","wait_for_custom_config_delay":6},"content":{"enable_profile":true,"enable_profile_link":false,"enable_title":true,"enable_title_link":true},"contextual":{"enable_contextual_content":false,"enable_fallback":true,"enable_freshness":false,"freshness_days":1800,"profiles_sources":[],"source":"channel"},"interface":{"aspect_ratio":"16:9","color":"","enable_ads_controls":true,"enable_attention_peaks":true,"enable_controls":true,"enable_dm_logo":true,"enable_dynamic_thumbnail":false,"enable_keyboard_shortcuts":true,"enable_live_offair_screen":true,"enable_paid_partnership_label":false,"enable_sharing":false,"enable_sharing_url_location":false,"enable_spinner":true,"enable_startscreen_dm_link":false,"enable_subtitles":true,"enable_titles_in_video_cards":false,"enable_watch_now_card":true},"pip":{"enable_google_policy_ui":false,"enable_large_size":false,"enable_legacy_pip":true,"enable_start_pip_expanded":false,"enable_selected_placement":false,"mode":"on","selected_placement":"bottom_right"},"playback":{"autonext_duration":6,"autoskip_duration":10,"autostart_mode":"firstTimeViewable","enable_autonext":true,"enable_autoskip":false,"enable_content_preload":false,"enable_eco_mode":false,"enable_hold_to_fastforward":true,"enable_mute":true,"enable_receive_url_location":true,"has_reached_playback_limits":false,"has_subscription_status_restricted":false},"recommendations":{"enable_automatic":true,"enable_custom":false,"has_from_org_only":false,"optimization_mode":"monetization"},"type":{"enable_inline":false,"mode":"video"},"watermark":{"image_type":"none","image_url":"","link_type":"none","link_url":""}},"playerGatekeepers":["PV5_COOKIE_SYNC_AB_TEST","PV5_IAS_INAPP","PV5_IMA_NATIVE_POC","PV5_OMSDK","PV5_OMSDK_NATIVE","PV5_TEMP_IMA_PAGEURL","PV5_TEMP_IMA_PAGEURL_OFFSITE","PV5_SIMID","PV5_MIDROLL_RETAKE_ONSITE","PV5_MIDROLL_RETAKE_OFFSITE","PV5_ADS_ON_REPLAY_ONSITE","PV5_ADS_ON_REPLAY_OFFSITE","PV5_IMA_COMPANION_AD","PV5_PARALLEL_ADS_CALL","PV5_DYNAMIC_AD_PRESSURE_CC","PV5_PARALLEL_ADS_CALL_ONSITE","PV5_NEW_CDNDIRECTOR_DOMAIN","PV5_AD_SLOT_PREVENT_SAME_CREATIVE_ID_ONSITE","PV5_AD_SLOT_PREVENT_SAME_CREATIVE_ID_OFFSITE","PV5_DISPLAY_CONSECUTIVE_AD_BREAK_INDEX","PV5_PARALLEL_ADS_CALL_PLAYLIST_OFFSITE","PV5_NATIVE_ADS","PV5_TMP_PARALLEL_ADS_CALL_PREMIUM_PARTNER","PV5_ADPODS_ONSITE","PV5_TMP_PARALLEL_ADS_CALL_PREMIUM_PARTNER_PROGRESSIVE_ROLLOUT","PV5_TEMP_PBM_UPDATED","PV5_AD_SDK_WEB","PV5_PRELOADING_CONTENT","PV5_CROSS_POD_RERANKING","PV5_TMP_ORTB_POS","PV5_PARALLEL_ADS_CALL_DISABLE_NON_AUTOPLAY","PV5_BLOCK_EMPTY_EMBEDDER","PV5_GEO_PLAYERS","PV5_BLOCK_DEFAULT_PLAYER","PV5_GEO_RECOMMENDED","PV5_GEO_PLAYLIST","PV5_RESTORE_UNMUTE_CTA"],"trafficSegment":143417,"udger":{"browserOsFamily":"Linux","browserOsName":"Linux","browserUaFamily":"PTST","browserUaName":"PTST 261109.195727","browserUaVersion":261109,"deviceType":"desktop"},"v1st":"deb5fb96-38da-f017-2d95-a3531a436bc4"},a="v0.146.0",n=[{key:"adPressureOptimization",isPublic:!0,trackableKey:"adPressureOptimization"},{key:"aspectRatio",isPublic:!0,trackableKey:"aspectRatio"},{key:"autonextAfter",isPublic:!0,trackableKey:"autonextAfter"},{key:"autoskipAfter",isPublic:!0,trackableKey:"autoskipAfter"},{key:"autostart",isPublic:!0,trackableKey:"autostart"},{key:"color",isPublic:!0,trackableKey:"color"},{key:"contextualContentFreshness",isPublic:!0,trackableKey:"contextualContentDayRange"},{key:"contextualContentSource",isPublic:!0,trackableKey:"contextualContentSource"},{key:"contextualContentSourceChannels",isPublic:!0,trackableKey:null},{key:"enableAdPreload",isPublic:!0,trackableKey:"enableAdPreload"},{key:"enableAds",isPublic:!0,trackableKey:"enableAds"},{key:"enableAdsControls",isPublic:!0,trackableKey:"enableAdsControls"},{key:"enableAttentionPeaks",isPublic:!0,trackableKey:"enableAttentionPeaks"},{key:"enableAutomaticRecommendations",isPublic:!0,trackableKey:"enableAutomaticRecommendations"},{key:"enableAutonext",isPublic:!0,trackableKey:"enableAutonext"},{key:"enableAutoskip",isPublic:!0,trackableKey:"enableAutoskip"},{key:"enableContentPreload",isPublic:!0,trackableKey:"enableContentPreload"},{key:"enableChannelLink",isPublic:!0,trackableKey:"enableChannelLink"},{key:"enableContextualContent",isPublic:!0,trackableKey:"enableContextualContent"},{key:"enableContextualContentFallback",isPublic:!0,trackableKey:"enableContextualContentFallback"},{key:"enableContextualContentFreshness",isPublic:!0,trackableKey:"enableContextualContentDayRange"},{key:"enableCustomRecommendations",isPublic:!0,trackableKey:"enableCustomRecommendations"},{key:"enableDmLogo",isPublic:!0,trackableKey:"enableDmLogo"},{key:"enableDynamicThumbnail",isPublic:!0,trackableKey:"enableDynamicThumbnail"},{key:"enableEcoMode",isPublic:!0,trackableKey:"enableEcoMode"},{key:"enableEidCollection",isPublic:!0,trackableKey:"enableEidCollection"},{key:"enableGooglePolicyUi",isPublic:!0,trackableKey:"enableGooglePolicyUi"},{key:"enableHoldToFastforward",isPublic:!0,trackableKey:"enableHoldToFastforward"},{key:"enableInlinePlayer",isPublic:!1,trackableKey:"enableInlinePlayer"},{key:"enableKeyboardShortcuts",isPublic:!0,trackableKey:"enableKeyboardShortcuts"},{key:"enableLiveOffairScreen",isPublic:!0,trackableKey:"enableLiveOffairScreen"},{key:"enableLegacyPip",isPublic:!0,trackableKey:"enableLegacyPip"},{key:"enableMute",isPublic:!0,trackableKey:"enableMute"},{key:"enablePaidPartnershipLabel",isPublic:!0,trackableKey:"enablePaidPartnershipLabel"},{key:"enablePipLargeSize",isPublic:!0,trackableKey:"enablePipLargeSize"},{key:"enablePipPlacement",isPublic:!0,trackableKey:"enablePipPlacement"},{key:"enablePlaybackControls",isPublic:!0,trackableKey:"enablePlaybackControls"},{key:"enableReceiveUrlLocation",isPublic:!0,trackableKey:"enableReceiveUrlLocation"},{key:"enableSharing",isPublic:!0,trackableKey:"enableSharing"},{key:"enableSharingUrlLocation",isPublic:!0,trackableKey:"enableSharingUrlLocation"},{key:"enableSpinner",isPublic:!0,trackableKey:"enableSpinner"},{key:"enableStartPipExpanded",isPublic:!0,trackableKey:"enableStartPipExpanded"},{key:"enableStartscreenDmLink",isPublic:!0,trackableKey:"enableStartscreenDmLink"},{key:"enableSubtitles",isPublic:!0,trackableKey:"enableSubtitles"},{key:"enableTitlesInVideoCards",isPublic:!0,trackableKey:"enableTitlesInVideoCards"},{key:"enableVideoTitleLink",isPublic:!0,trackableKey:"enableVideoTitleLink"},{key:"enableVideoTitle",isPublic:!0,trackableKey:"enableVideoTitle"},{key:"enableVideoOwner",isPublic:!0,trackableKey:"enableVideoOwner"},{key:"enableWaitForCustomConfig",isPublic:!0,trackableKey:"enableWaitForCustomConfig"},{key:"enableWatchNowCard",isPublic:!0,trackableKey:"enableWatchNowCard"},{key:"hasReachedPlaybackLimits",isPublic:!1,trackableKey:"hasReachedPlaybackLimits"},{key:"hasSubscriptionStatusRestricted",isPublic:!1,trackableKey:"hasSubscriptionStatusRestricted"},{key:"hasRecommendationsFromOrgOnly",isPublic:!1,trackableKey:"hasRecommendationsFromOrgOnly"},{key:"hasSsai",isPublic:!1,trackableKey:"hasSsai"},{key:"id",isPublic:!0,trackableKey:"id"},{key:"ownerId",isPublic:!1,trackableKey:null},{key:"pip",isPublic:!0,trackableKey:"pip"},{key:"pipSelectedPlacement",isPublic:!0,trackableKey:"pipSelectedPlacement"},{key:"recommendationsOptimisation",isPublic:!0,trackableKey:"recommendationsOptimisation"},{key:"status",isPublic:!1,trackableKey:null},{key:"type",isPublic:!1,trackableKey:null},{key:"userChannelOrganization",isPublic:!1,trackableKey:null},{key:"waitForCustomConfigDelay",isPublic:!0,trackableKey:null},{key:"watermarkImageType",isPublic:!0,trackableKey:"watermarkImageType"},{key:"watermarkImageUrl",isPublic:!0,trackableKey:null},{key:"watermarkLinkType",isPublic:!0,trackableKey:"watermarkLinkType"},{key:"watermarkLinkUrl",isPublic:!0,trackableKey:null}],i=e=>{let{player_id:t,error:a,profile:n={},endpoints:i={},advertising:l={},content:r={},contextual:o={},interface:s={},pip:d={},playback:c={},recommendations:_={},type:u={},watermark:b={},status:p}=e;return{id:t,status:a?.code??p??"ok",adPressureOptimization:l.pressure_mode,aspectRatio:s.aspect_ratio,autonextAfter:c.autonext_duration,autoskipAfter:c.autoskip_duration,autostart:c.autostart_mode,color:s.color,contextualContentFreshness:o.freshness_days,contextualContentSource:o.source,contextualContentSourceChannels:o.profiles_sources??o.profile_sources,enableAdPreload:l.enable_preload,enableAds:l.enable_ads,enableAdsControls:s.enable_ads_controls,enableAttentionPeaks:s.enable_attention_peaks,enableAutomaticRecommendations:_.enable_automatic,enableAutonext:c.enable_autonext,enableAutoskip:c.enable_autoskip,enableChannelLink:r.enable_profile_link,enableContentPreload:c.enable_content_preload,enableContextualContent:o.enable_contextual_content,enableContextualContentFallback:o.enable_fallback,enableContextualContentFreshness:o.enable_freshness,enableCustomRecommendations:_.enable_custom,enableDmLogo:s.enable_dm_logo,enableDynamicThumbnail:s.enable_dynamic_thumbnail,enableEcoMode:c.enable_eco_mode,enableEidCollection:l.enable_eid_collection,enableGooglePolicyUi:d.enable_google_policy_ui,enableHoldToFastforward:c.enable_hold_to_fastforward,enableInlinePlayer:u.enable_inline,enableKeyboardShortcuts:s.enable_keyboard_shortcuts,enableLegacyPip:d.enable_legacy_pip,enableLiveOffairScreen:s.enable_live_offair_screen,enableMute:c.enable_mute,enablePaidPartnershipLabel:s.enable_paid_partnership_label,enablePipLargeSize:d.enable_large_size,enablePipPlacement:d.enable_selected_placement,enablePlaybackControls:s.enable_controls,enableReceiveUrlLocation:c.enable_receive_url_location,enableSharing:s.enable_sharing,enableSharingUrlLocation:s.enable_sharing_url_location,enableSpinner:s.enable_spinner,enableStartPipExpanded:d.enable_start_pip_expanded,enableStartscreenDmLink:s.enable_startscreen_dm_link,enableSubtitles:s.enable_subtitles,enableTitlesInVideoCards:s.enable_titles_in_video_cards,enableVideoOwner:r.enable_profile,enableVideoTitle:r.enable_title,enableVideoTitleLink:r.enable_title_link,enableWaitForCustomConfig:l.enable_wait_for_custom_config,enableWatchNowCard:s.enable_watch_now_card,embedHtmlUrl:i.iframe_url,embedScriptUrl:i.embed_url,hasReachedPlaybackLimits:c.has_reached_playback_limits,hasRecommendationsFromOrgOnly:_.has_from_org_only,hasSsai:l.has_ssai,hasSubscriptionStatusRestricted:c.has_subscription_status_restricted,libScriptUrl:i.lib_url,ownerId:n.profile_id,pip:d.mode,pipSelectedPlacement:d.selected_placement,recommendationsOptimisation:_.optimization_mode,type:u.mode,userChannelOrganization:n.organization_id,waitForCustomConfigDelay:l.wait_for_custom_config_delay,watermarkImageType:b.image_type,watermarkImageUrl:b.image_url,watermarkLinkType:b.link_type,watermarkLinkUrl:b.link_url}},l=e=>!e||"object"!=typeof e||e.status&&"ok"!==e.status||void 0===e.player_id?e:i(e),r=e=>t.playerGatekeepers?.includes(e),o=e=>{let t={};return n.forEach(a=>{let{key:n,isPublic:i}=a;i&&(t[n]=e[n])}),t},s=e=>{let t={};return n.forEach(a=>{let{key:n,trackableKey:i}=a;null!==i&&(t[i]=e[n])}),t},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t&&"object"==typeof t&&Object.keys(t).forEach(a=>{n.some(e=>e.key===a)&&u()&&(e[a]=t[a],e.hasOverride=!0)}),e},c=e=>"string"==typeof e?_(e):e,_=e=>{let t={};return new URLSearchParams(e).forEach((e,a)=>{let n=a.match(/([a-zA-Z0-9]+)\[([a-zA-Z0-9]+)\]/);if("true"===e)t[a]=!0;else if("false"===e)t[a]=!1;else if(e.match(/^[0-9]+$/))t[a]=a.match(/color$/i)?e:parseInt(e);else if(n){let[,a,i]=n;t[a]={...t[a],[i]:e}}else t[a]=e}),t},u=()=>(window.location.hostname||window.origin).endsWith(".dailymotion.com"),b={PUBLIC:{AD_CLICK:"ad_click",AD_COMPANIONSREADY:"ad_companions",AD_DURATIONCHANGE:"ad_durationchange",AD_END:"ad_end",AD_ERROR:"ad_error",AD_IMPRESSION:"ad_impression",AD_LOADED:"ad_loaded",AD_PAUSE:"ad_pause",AD_PLAY:"ad_play",AD_READYTOFETCH:"ad_readytofetch",AD_START:"ad_start",AD_TIMECHANGE:"ad_timeupdate",PLAYER_ASPECTRATIOCHANGE:"pes_aspectratiochange",PLAYER_CRITICALPATHREADY:"playback_ready",PLAYER_END:"end",PLAYER_ERROR:"error",PLAYER_HEAVYADSINTERVENTION:"player_heavyadsintervention",PLAYER_PIPEXPANDEDCHANGE:"pes_pipexpandedchange",PLAYER_PLAYBACKPERMISSION:"playback_resolution",PLAYER_PLAYBACKSPEEDCHANGE:"playbackspeedchange",PLAYER_POSTERDISPLAY:"posterdisplay",PLAYER_PRESENTATIONMODECHANGE:"pes_presentationmodechange",PLAYER_RECODISPLAY:"recodisplay",PLAYER_SCALEMODECHANGE:"pes_scalemodechange",PLAYER_START:"start",PLAYER_VIDEOCHANGE:"videochange",PLAYER_VIDEOLISTCHANGE:"videolistchange",PLAYER_VIEWABILITYCHANGE:"pes_viewabilitychange",PLAYER_VOLUMECHANGE:"volumechange",VIDEO_BUFFERING:"waiting",VIDEO_DURATIONCHANGE:"video_durationchange",VIDEO_END:"video_end",VIDEO_PAUSE:"pause",VIDEO_PLAY:"play",VIDEO_PLAYING:"playing",VIDEO_PROGRESS:"progress",VIDEO_QUALITIESREADY:"qualitiesavailable",VIDEO_QUALITYCHANGE:"qualitychange",VIDEO_SEEKEND:"seeked",VIDEO_SEEKSTART:"seeking",VIDEO_START:"video_start",VIDEO_SUBTITLESCHANGE:"subtitlechange",VIDEO_SUBTITLESREADY:"subtitlesavailable",VIDEO_TIMECHANGE:"timeupdate"},PRIVATE:{ALL:"all",BACK_TO_INLINE_DISPLAY_REQUESTED:"pes_pip_back_to_inline_display_requested",CLOSE_PIP_REQUESTED:"pes_pip_close_requested",COLLAPSE_PIP_REQUESTED:"pes_pip_collapse_requested",DISPLAY_POSTER_SOONER:"poster_sooner",EXPAND_PIP_REQUESTED:"pes_pip_expand_requested",PLAYER_APIREADY:"apiready",PLAYER_DRM_TOKEN_REQUEST:"playerDrmTokenRequest",PLAYER_FULLSCREENCHANGE:"fullscreenchange",PLAYER_NATIVEPIPCHANGE:"presentationmodechange",PLAYER_PREVIEW_COMPUTED:"player_preview_computed",PLAYER_STATE:"playerstate",WRITE_UID:"pes_write_uid",LISTEN_EID:"pes_listen_eid",WRITE_V1ST_DM:"pes_write_v1st_dm",GET_PREVIEW:"get_preview"}},p={CANCEL_AUTOSKIP:"cancelAutoskip",CUSTOMCONFIG:"set-ads-config",CUSTOM_RECOMMENDATIONS:"customRecommendations",FULLSCREEN:"fullscreen",GET_PREVIEW:"getPreview",INIT_PIP_IFRAME_CHUNK:"initPesPipChunk",LOAD:"load",LOOP:"loop",NOTIFY_EMBEDDER_URL_CHANGED:"notifyEmbedderURLChanged",NOTIFY_PIP_CHANGED:"notifyPesPipChanged",PAUSE:"pause",PLAY:"play",QUALITY:"quality",PLAYER_VISIBILITY:"notifyPesPlayerVisibility",PRELOAD:"preload",SET_EID:"setEid",SCALE:"scaleMode",SEEK:"seek",SPEED:"speed",STATE:"playerstate",SUBTITLES:"subtitle",DRM_CONFIGURED:"drmConfigured",RESPOND_DRM_TOKEN:"respondDrmToken",UPDATE_NEON_TRACKING_DATA:"updateNeonTrackingData",UPDATE_PARAMS:"updatePesParams",UPDATE_AUTH_TOKEN:"updatePesAuthToken",VIEWPORT_RESIZE:"notifyPesViewportSizeChanged",VOLUME:"volume"},y=(e,t,a,n)=>(e.addEventListener(t,a,n),()=>{e.removeEventListener(t,a,n)}),m=P(),E=m.split(",").includes("pes")||"1"===m;function P(){return new URL(window.location.href).searchParams.get("dmLogger")||""}let w={log:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),n=1;n1?t-1:0),n=1;n2?a-2:0),i=2;iObject.values(b.PUBLIC).includes(e),h=function(e,t){for(var a=arguments.length,n=Array(a>2?a-2:0),i=2;i{window.postMessage(JSON.stringify({event:e,...t}),window.origin)},I=(e,t,a)=>S(e,t,a),D=(e,t)=>S(null,e,t),S=(e,t,a)=>y(window,"message",n=>{let{origin:i,data:l}=n;if((i===window.origin||i===window.dailymotion._do_not_use_03d404c11d1978869851.pesDomain)&&l&&"string"==typeof l)try{let n=JSON.parse(l);if("all"!==t&&t!==n.event||null!==e&&e._do_not_use_03d404c11d1978869851.id!==n.id)return;w.log("api","Received event from iframe",n),a(n)}catch(e){return}}),L={DOM_ELEMENT_ID_NOT_FOUND:"DOM element ID not found",PIP_ALREADY_ENABLED:"PIP is already enabled with another configuration",PIP_IS_DISABLED:"PIP is disabled in the configuration",PLAYER_ALREADY_ATTACHED:"A player instance is already attached to this DOM element",PLAYER_PLACEHOLDER_NODE_OUT_OF_BODY:"The Player Embed Script can't be injected in document head, please use Library Script instead. More details: https://developers.dailymotion.com/guides/getting-started-with-web-sdk/#player-library-script",PLAYER_CONFIG_ID_NOT_FOUND:"The player configuration ID has not been found",PLAYER_CONFIG_ID_DELETED:"The player configuration ID has been deleted",PLAYER_CONFIG_NOT_SPECIFIED:"Several player configurations are imported, please specify a player configuration ID",PLAYER_CONFIG_SERVER_ERROR:"An unexpected error occured when retrieving player configuration",PLAYER_ID_NOT_FOUND:"Player ID not found",PLAYER_ID_REQUIRED:"There are multiple players in the page, please specify an ID",PLAYER_INVALID_OPTIONS:"Player options invalid, please use an object",PLAYER_NOT_FOUND:"No player found in the page"},O=()=>{let e=[],t=new window.Uint16Array(32);return window.crypto.getRandomValues(t),t.forEach(t=>e.push(`000${t.toString(16)}`.slice(-4))),`${e[0]}${e[1]}-${e[2]}-${e[3]}-${e[4]}-${e[5]}${e[6]}${e[7]}`},R=()=>(e||(e=window._dmDynamicImportPolyfill("pes.iframe.539c5d7e.js").then(function(e){return e.i}).then(e=>(window?.dailymotion&&(window.dailymotion._do_not_use_03d404c11d1978869851.iframeMakerLoaded=!0),e))),e),T={events:b.PUBLIC};T.createPlayer=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};w.log("api","Called dailymotion.createPlayer()",e,t);let{settings:a,embedScriptIndex:n,pesUUID:i,pendingPlaceholders:l}=window.dailymotion._do_not_use_03d404c11d1978869851,r=document.querySelector(`#${e}`);if(!r)return Promise.reject(Error(`${L.DOM_ELEMENT_ID_NOT_FOUND} : #${e}`));if(r.classList.contains("dailymotion-player-wrapper")||r.classList.contains("dailymotion-player-root")||l.includes(e))return Promise.reject(Error(`${L.PLAYER_ALREADY_ATTACHED} : #${e}`));if(t&&"object"!=typeof t)return Promise.reject(Error(L.PLAYER_INVALID_OPTIONS));t.player||(1===Object.keys(a).length?t.player=Object.keys(a)[0]:(Object.keys(a).length>1&&console.warn(L.PLAYER_CONFIG_NOT_SPECIFIED),t.player="default")),l.push(e);try{let{iframeMaker:e}=await R(),{drmConfig:a}=t,l=await e.create(r,n,i,"lib",{videoId:t.video,playlistId:t.playlist,podcastId:t.podcast,episodeId:t.episode,playerId:t.player,params:t.params,settings:t.settings,referrerPolicy:t.referrerPolicy,eid:t.eid}),o=await l?.initialize();return o&&a&&o.setDrmConfig(a),o}finally{let t=l.indexOf(e);-1!==t&&l.splice(t,1)}},T.getPlayer=e=>{w.log("api","Called dailymotion.getPlayer()",e);let{players:t,iframeMakerLoaded:a,inlinePlayerReadyPromise:n}=window.dailymotion._do_not_use_03d404c11d1978869851,i=t[e];return 0===Object.keys(t).length?a?n?n.then(()=>T.getPlayer(e)):Promise.reject(Error(L.PLAYER_NOT_FOUND)):new Promise((t,a)=>{setTimeout(()=>{T.getPlayer(e).then(t).catch(a)},0)}):void 0===e?Object.keys(t).length>1?Promise.reject(Error(L.PLAYER_ID_REQUIRED)):Object.values(t)[0]?.initialize():void 0===i?Promise.reject(Error(`${L.PLAYER_ID_NOT_FOUND} : #${e}`)):i?.initialize()},T.getAllPlayers=()=>{w.log("api","Called dailymotion.getAllPlayers()");let{players:e,iframeMakerLoaded:t,inlinePlayerReadyPromise:a}=window.dailymotion._do_not_use_03d404c11d1978869851;if(0===Object.keys(e).length)return t?a?a.then(()=>T.getAllPlayers()):Error(L.PLAYER_NOT_FOUND):new Promise(e=>{setTimeout(()=>{e(T.getAllPlayers())},0)});let n=[];return Object.values(e).forEach(e=>n.push(e?.initialize())),n};let C=()=>{w.log("api","Called disabled PIP method"),console.warn(L.PIP_IS_DISABLED)};T.pipClose=C,T.pipCollapse=C,T.pipExpand=C,T.pipRepaint=C,T.pipResume=C,T.forwardAuthToken=e=>{w.log("api","Called dailymotion.forwardAuthToken()",e),window.dailymotion._do_not_use_03d404c11d1978869851.pesAuthToken=e,Object.values(window.dailymotion._do_not_use_03d404c11d1978869851.players).forEach(t=>{h(t,p.UPDATE_AUTH_TOKEN,e)})},u()&&(T.forwardNeonTrackingData=e=>{w.log("api","Called dailymotion.forwardNeonTrackingData()",e);let{players:t}=window.dailymotion._do_not_use_03d404c11d1978869851,a=Object.keys(t);if(0===a.length){window.dailymotion._do_not_use_03d404c11d1978869851.neonTrackingData=e;return}h(t[a[0]],p.UPDATE_NEON_TRACKING_DATA,e)},T.getEnvironmentInfo=()=>{let{udger:{browserOsFamily:e,browserOsName:a,browserUaFamily:n,browserUaName:i,browserUaVersion:l}={}}=t;return{osFamily:e,osName:a,uaFamily:n,uaName:i,uaVersion:l}}),T._do_not_use_03d404c11d1978869851={api:null,embedScriptIndex:1,iframeIndex:1,neonTrackingData:null,pesAuthToken:null,pesPerf:{requestStart:null,requestEnd:null,initStart:null,initEnd:null,playerRequestStart:null,pageTimeOrigin:null},pesUUID:null,players:{},pendingPlaceholders:[],playerSelectedForPip:null,screenId:O(),settings:{}};let N="dmDevEventBusEnv",v=function(){let{gatekeepers:e,env:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=Array.isArray(e)&&e.includes("PV5_PLAYER_EVENT_BUS"),n="staging"===t;return a?n?"https://player-stg.dm-event.net":"https://player.dm-event.net":n?"https://pebed.stg.dm.gg":"https://pebed.dm-event.net"};function K(){return -6e4*new Date().getTimezoneOffset()}let U=()=>{let e=document.currentScript;if(!e?.src||!window.performance||"number"!=typeof window.performance.timeOrigin)return null;let t=window.performance.getEntriesByType("resource").find(t=>t.name===e.src);return t&&"number"==typeof t.startTime?Math.floor(t.startTime):null},Y=e=>{let t=e=>{if(null===e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},a={};return Object.keys(e).forEach(function(n){let i=e[n];null!=i&&""!==i&&(t(i)?a[n]=Y(i):a[n]=i)}),a},V=()=>{let e=window.performance.getEntriesByType("resource").find(e=>e.name===document.currentScript.src),t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e3;return"number"!=typeof e||Number.isNaN(e)||e<0?null:e>t?t:Math.round(e)};return e?{pes_res:{start_time:t(e.startTime,3e4)},pes_custom:{script_request:t(e.requestStart-e.startTime),script_response_start:t(e.responseStart-e.startTime),script_response_end:t(e.responseEnd-e.startTime)}}:null},{udger:{browserOsFamily:x,browserOsName:F,browserUaFamily:M,browserUaName:G,browserUaVersion:j,deviceType:H},geoip:{visitorAsNumber:B,visitorCity:$,visitorContinent:z,visitorCountry:W,visitorRegion:q},player:Q,envFrontend:J,trafficSegment:Z}=t,X=l(Q),ee=(e,t)=>{let n=window.dailymotion?._do_not_use_03d404c11d1978869851?.pesPerf?.requestStart,i={name:"life_cycle.embedStart",version:"1.0",data:{context:{visitor_group:Math.ceil(Z/1e4)},created_ts:Date.now(),empty_player:t,timestamp:{delta_time_origin_pes:n?Math.floor(window.performance.now()-n):null},info:{browser:{os_family:x,os_name:F,ua_family:M,ua_name:G,ua_version:j,user_agent:window.navigator.userAgent},device:{type:H,width:Math.max(0,window.innerWidth),height:Math.max(0,window.innerHeight)},player:{config:s(X),embedder:document.location.href,embedder_hostname:document.location.hostname,env:J,secure:!0,version:a},visitor:{as_number:B,continent:z,country:W,onsite:u(),referer:document.referer,region:q,timezone_offset:K(),traffic_segment:Z}},perf:V(),settings:{embed_index:e,pubtool:"pes"}}};Q.ownerId&&(i.data.info.publisher={type:"player",xid:Q.ownerId}),en("life_cycle.embedStart",{channel:"player",edward:"1.1",sent_ts:Date.now(),events:[Y(i)],stack_ctx:{player_stack:"noworker"}})},et=e=>{let{settings:t,embedIndex:n,emptyPlayer:i,pesIntegrationType:l}=e,r={name:"ui_action",version:"1.0",data:{created_ts:Date.now(),action:{gesture:"api",ui_element:"pes_get_settings"},context:{visitor_group:Math.ceil(Z/1e4)},empty_player:i,info:{player:{xid:t.id,version:a,pes_uuid:window.dailymotion._do_not_use_03d404c11d1978869851.pesUUID,pes_integration_type:l,embedder_hostname:document.location.hostname,env:J}},settings:{pubtool:"pes",embed_index:n}}};t.ownerId&&(r.data.info.publisher={xid:t.ownerId}),en("ui_action.pesGetSettings",{channel:"player",edward:"1.1",sent_ts:Date.now(),events:[Y(r)],stack_ctx:{player_stack:"noworker"}})},ea=e=>{en("advertising.heavyAdsIntervention",{channel:"player",edward:"1.1",sent_ts:Date.now(),events:e.map(Y),stack_ctx:{player_stack:"noworker"}})},en=async(e,a)=>{try{let n=await window.fetch(v({gatekeepers:t.playerGatekeepers,env:window.dailymotion._do_not_use_03d404c11d1978869851.eventBusEnv}),{method:"POST",body:JSON.stringify(a)});200===n.status?w.log("eventbus",`${e} sent`,a):w.error("eventbus",`${e} failed`,n.status,a)}catch(t){w.error("eventbus",`${e} failed`,t.message,a)}},ei=async e=>{let{name:n,emptyPlayer:i,pesUUID:l,pesIframeIndex:r,pesIntegrationType:o}=e,d=Date.now(),{pesLastEventTs:c}=window.dailymotion._do_not_use_03d404c11d1978869851,_={name:n,version:"1.0",data:{browser:{os_family:x,os_name:F,ua_family:M,ua_name:G,user_agent:window.navigator.userAgent},created_ts:d,device:{type:H,height:Math.max(0,window.screen.height),width:Math.max(0,window.screen.width)},player:{embedder:document.location.href,embedder_hostname:document.location.hostname,pes_uuid:l,pes_iframe_index:r,pes_integration_type:o,is_empty:i,pubtool:"pes",version:a,settings:s(X)},timestamp:{created_event:d,delta_previous_event:c?d-c:0},visitor:{as_number:B,city:$,continent:z,country:W,onsite:u(),referer:document.referer,region:q,timezone_offset:K(),traffic_segment:Z}}};X.ownerId&&(_.data.publisher={xid:X.ownerId}),window.dailymotion._do_not_use_03d404c11d1978869851.pesLastEventTs=d;let b={channel:"player",edward:"1.1",events:[Y(_)],sent_ts:Date.now()};try{let e=await window.fetch(v({gatekeepers:t.playerGatekeepers,env:window.dailymotion._do_not_use_03d404c11d1978869851.eventBusEnv}),{method:"POST",body:JSON.stringify(b),headers:{"content-type":"text/plain; charset=UTF-8"}});200===e.status?w.log("watchtower",n,"sent",b.events[0]):w.error("watchtower",n,"failed",e.status,b.events[0])}catch(e){w.error("watchtower",n,"failed",e.message,b.events[0])}},el=window.__dmChunkNamespaceState;el||(el={},window.__dmChunkNamespaceState=el),window._dmDynamicImportPolyfill=e=>{let t=el[e];if(t?.namespaceValue)return Promise.resolve(t.namespaceValue);if(t?.namespaceKey&&window[t.namespaceKey])return t.namespaceValue=window[t.namespaceKey],Promise.resolve(t.namespaceValue);if(t?.promise)return t.promise;let a=es(e),n=document.querySelector(`script[id="${a}"]`),i=n&&t?.snapshot?t.snapshot:eu("_dmpes"),l=(n?er(n):eo(a,e)).then(()=>{let{key:t,namespace:a}=ed(e,i)||{},n=el[e]||{};return t&&(n.namespaceKey=t),a&&(n.namespaceValue=a),el[e]=n,a}).finally(()=>{let t=el[e];t?.promise===l&&(delete t.promise,delete t.snapshot)});return el[e]={namespaceKey:t?.namespaceKey,namespaceValue:t?.namespaceValue,snapshot:i,promise:l},l};let er=e=>new Promise((t,a)=>{let n=e.getAttribute("load-status");return"loaded"===n?t():"error"===n?a():void(e.addEventListener("load",()=>{e.setAttribute("load-status","loaded"),t()}),e.addEventListener("error",()=>{e.setAttribute("load-status","error"),a()}))}),eo=(e,t)=>{let a=document.createElement("script");a.src=`https://geo.dailymotion.com/static/latest/cdn/${t}`,a.id=e;let n=er(a);return document.body.appendChild(a),n},es=e=>e.replace(/\.js(?:\?.*)?$/,""),ed=(e,t)=>{let a=ec(e);for(let e=0;e{let t=e.split("/").pop();if(!t)return[];let a=t.replace(/\.js$/,""),n=[],i=e=>{if(!e)return;let t=e.split(".");for(let e=0;e{let t=`_dmpes${e_(e)}`;n.includes(t)||n.push(t)};i(a);let r=a.lastIndexOf(".");return r>0&&i(a.slice(0,r)),n},e_=e=>e.split(/[^a-zA-Z0-9]+/).filter(Boolean).map((e,t)=>{let a=e.toLowerCase();return 0===t?a:a.charAt(0).toUpperCase()+a.slice(1)}).join(""),eu=e=>{let t={};return Object.getOwnPropertyNames(window).forEach(a=>{(!e||a.startsWith(e))&&(t[a]=!0)}),t},eb=e=>{if(!e)return null;let t=Object.getOwnPropertyNames(window);for(let a=0;a