;
(self.AMP=self.AMP||[]).push({m:1,v:"2605071401000",n:"amp-dailymotion",ev:"0.1",l:!0,f:function(t,i){(()=>{function i(t,i,n){return i in t?Object.defineProperty(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n,t}function n(t,i){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);i&&(e=e.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.push.apply(n,e)}return n}var{isArray:e}=Array;function s(t){return e(t)?t:[t]}var o,{hasOwnProperty:r,toString:a}=Object.prototype;function h(t){const i=Object.create(null);return t&&Object.assign(i,t),i}function l(t){return"number"==typeof t&&isFinite(t)}function u(t,i,n,e,s,o,r,a,h,l,u){return t}function c(){return o||(o=Promise.resolve(void 0))}var d,f=class{constructor(){this.promise=new Promise(((t,i)=>{this.resolve=t,this.reject=i}))}};function m(t){return new Promise((i=>{i(t())}))}function p(t){const i=Object.getOwnPropertyDescriptor(t,"message");if(null!=i&&i.writable)return t;const{message:n,stack:e}=t,s=new Error(n);for(const i in t)s[i]=t[i];return s.stack=e,s}function v(t){let i=null,n="";for(const t of arguments)t instanceof Error&&!i?i=p(t):(n&&(n+=" "),n+=t);return i?n&&(i.message=n+": "+i.message):i=new Error(n),i}function _(t){var i,n;null===(i=(n=self).__AMP_REPORT_ERROR)||void 0===i||i.call(n,t)}function g(t,...i){try{return t.apply(null,i)}catch(t){!function(t){const i=v.apply(null,arguments);setTimeout((()=>{throw _(i),i}))}(t)}}function P(t){const i=v.apply(null,arguments);return i.expected=!0,i}function b(t,...i){_(P.apply(null,i))}var y=["Webkit","webkit","Moz","moz","ms","O","o"],A={"getPropertyPriority":()=>"","getPropertyValue":()=>""};function w(t,i,n,e,s){const o=function(t,i,n){if(i.startsWith("--"))return i;d||(d=h());let e=d[i];if(!e||n){if(e=i,void 0===t[i]){const n=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}(i),s=function(t,i){for(let n=0;n<y.length;n++){const e=y[n]+i;if(void 0!==t[e])return e}return""}(t,n);void 0!==t[s]&&(e=s)}n||(d[i]=e)}return e}(t.style,i,s);if(!o)return;const r=e?n+e:n;t.style.setProperty(function(t){const i=t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()));return y.some((t=>i.startsWith(t+"-")))?`-${i}`:i}(o),r)}function M(t){return null==t.__AMP_AUTOPLAY&&(t.__AMP_AUTOPLAY=function(t){const i=t.document.createElement("video");var n;return i.setAttribute("muted",""),i.setAttribute("playsinline",""),i.setAttribute("webkit-playsinline",""),i.setAttribute("height","0"),i.setAttribute("width","0"),i.muted=!0,i.playsInline=!0,i.playsinline=!0,i.webkitPlaysinline=!0,function(t,i){for(const n in i)w(t,n,i[n])}(i,{position:"fixed",top:"0",width:"0",height:"0",opacity:"0"}),n=i,m((()=>n.play())).catch((()=>{})),Promise.resolve(!i.paused)}(t)),t.__AMP_AUTOPLAY}function E(t){return t.querySelector("video, iframe")}function R(t,i){const n=m((()=>t.play(!!i)));return n.catch((t=>{b(0,t)})),n}var I=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function T(t,i=""){try{return decodeURIComponent(t)}catch(t){return i}}function V(t){return(t.ownerDocument||t).defaultView}var k={bubbles:!0,cancelable:!0};function O(t){var i;null===(i=t.parentElement)||void 0===i||i.removeChild(t)}function S(t,i,n,e){const s=n||{};u(t.ownerDocument);const{bubbles:o,cancelable:r}=e||k,a=new MessageEvent(i,{data:s,bubbles:o,cancelable:r});t.dispatchEvent(a)}function q(t){let i=!1,n=null,e=t;return(...t)=>(i||(n=e.apply(self,t),i=!0,e=null),n)}self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var C=self.__AMP_LOG;function x(t){return C.user||(C.user=j()),function(t,i){return i&&i.ownerDocument.defaultView!=t}(C.user.win,t)?C.userForEmbed||(C.userForEmbed=j()):C.user}function j(t){return function(t,i){throw new Error("failed to call initLogConstructor")}()}function F(t,i,n,e,s,o,r,a,h,l,u){return t}function $(t,i,n,e,s,o,r,a,h,l,u){return x().assert(t,i,n,e,s,o,r,a,h,l,u)}function z(t,i){return U(t=function(t){return t.__AMP_TOP||(t.__AMP_TOP=t)}(t),i)}function L(t,i){return U(D(N(t)),i)}function Y(t,i){const n=D(N(t));return B(n,i)?U(n,i):null}function N(t){return t.nodeType?(i=V(t),z(i,"ampdoc")).getAmpDoc(t):t;var i}function D(t){const i=N(t);return i.isSingleDoc()?i.win:i}function U(t,i){F(B(t,i));const n=W(t)[i];return n.obj||(F(n.ctor),F(n.context),n.obj=new n.ctor(n.context),F(n.obj),n.context=null,n.resolve&&n.resolve(n.obj)),n.obj}function W(t){let i=t.__AMP_SERVICES;return i||(i=t.__AMP_SERVICES={}),i}function B(t,i){const n=t.__AMP_SERVICES&&t.__AMP_SERVICES[i];return!(!n||!n.ctor)}var H=t=>Y(t,"action"),J=t=>z(t,"platform"),Z=t=>z(t,"preconnect"),G=t=>U(t,"timer"),K=t=>Y(t,"url"),Q=t=>L(t,"viewport");var X,tt,it,nt,et="unstarted",st="apiready",ot="play",rt="pause",at=/vertical/,ht=new WeakMap,lt=new WeakMap,ut=new WeakMap;function ct(t){let i=ht.get(t);return i||(i=new t.ResizeObserver(dt),ht.set(t,i)),i}function dt(t){const i=new Set;for(let n=t.length-1;n>=0;n--){const e=t[n],{target:s}=e;if(i.has(s))continue;i.add(s);const o=lt.get(s);if(o){ut.set(s,e);for(let t=0;t<o.length;t++){const{callback:i,type:n}=o[t];ft(n,i,e)}}}}function ft(t,i,n){if(0==t){const{contentRect:t}=n,{height:e,width:s}=t;g(i,{width:s,height:e})}else if(1==t){const{borderBoxSize:t}=n;let e;if(t)e=t.length>0?t[0]:{inlineSize:0,blockSize:0};else{const{target:t}=n,i=V(t),s=at.test(function(t,i){return t.getComputedStyle(i)||A}(i,t).writingMode),{offsetHeight:o,offsetWidth:r}=t;let a,h;s?(h=r,a=o):(a=r,h=o),e={inlineSize:a,blockSize:h}}g(i,e)}}function mt(t,i,n={}){const{needsRootBounds:e,rootMargin:s,threshold:o}=n,r=function(t){return t.parent&&t.parent!=t}(i)&&(e||s)?i.document:void 0;return new i.IntersectionObserver(t,{threshold:o,root:r,rootMargin:s})}function pt(t){var i;let n=null===(i=X)||void 0===i?void 0:i.get(t);if(!n){const i=function(t){X||(X=new WeakMap,tt=new WeakMap),u(tt);let i=tt.get(t);return i||(i=mt((t=>{const n=new Set;for(let s=t.length-1;s>=0;s--){var e;const{target:o}=t[s];n.has(o)||(n.add(o),u(i),i.unobserve(o),u(X),null===(e=X.get(o))||void 0===e||e.resolve(t[s]),X.delete(o))}}),t,{needsRootBounds:!0}),tt.set(t,i)),i}(V(t));u(X),i.observe(t),n=new f,X.set(t,n)}return n.promise}function vt(t,i,n,e){let s=t,o=n,r=t=>{try{return o(t)}catch(t){var i,n;throw null===(i=(n=self).__AMP_REPORT_ERROR)||void 0===i||i.call(n,t),t}};const a=function(){if(void 0!==it)return it;it=!1;try{const t={get capture(){return it=!0,!1}};self.addEventListener("test-options",null,t),self.removeEventListener("test-options",null,t)}catch(t){}return it}(),h=!(null==e||!e.capture);return s.addEventListener(i,r,a?e:h),()=>{null==s||s.removeEventListener(i,r,a?e:h),o=null,s=null,r=null}}function _t(t,i,n,e){const s={detail:n};return Object.assign(s,e),new t.CustomEvent(i,s)}function gt(t,i,n,e){return vt(t,i,n,e)}function Pt(t){return t.data}function bt(t){const i=t.ownerDocument||t;return nt&&nt.ownerDocument===i||(nt=i.createElement("div")),yt}function yt(t){return function(t,i){if(u(1===i.length),u(Array.isArray(i)||(n=i,r.call(n,"raw"))),self.trustedTypes&&self.trustedTypes.createPolicy){const n=self.trustedTypes.createPolicy("static-template#createNode",{createHTML:function(t){return i[0]}});t.innerHTML=n.createHTML("ignored")}else t.innerHTML=i[0];var n;const e=t.firstElementChild;return u(e),u(!e.nextElementSibling),t.removeChild(e),e}(nt,t)}var At=['<button aria-label="Unmute video" class="i-amphtml-video-mask i-amphtml-fill-content" tabindex=0></button>'],wt=["<i-amphtml-video-icon class=amp-video-eq><div class=amp-video-eq-col><div class=amp-video-eq-filler></div><div class=amp-video-eq-filler></div></div></i-amphtml-video-icon>"];function Mt(t,i,n){if(i[n])return i[n];const e=t.querySelector(`style[${n}], link[${n}]`);return e?(i[n]=e,e):null}function Et(t,i){const n=t.styleSheets;for(let t=0;t<n.length;t++)if(n[t].ownerNode==i)return!0;return!1}var Rt=class{constructor(){this.Yv=!1,this.Xv=new class{constructor(){this.mn=null}add(t){return this.mn||(this.mn=[]),this.mn.push(t),()=>{this.remove(t)}}remove(t){this.mn&&function(t,i){const n=t.indexOf(i);-1!=n&&t.splice(n,1)}(this.mn,t)}removeAll(){this.mn&&(this.mn.length=0)}fire(t){if(this.mn)for(const i of this.mn.slice())i(t)}getHandlerCount(){var t,i;return null!==(t=null===(i=this.mn)||void 0===i?void 0:i.length)&&void 0!==t?t:0}}}onSessionEnd(t){this.Xv.add(t)}beginSession(){this.Yv=!0}endSession(){this.Yv&&this.Xv.fire(),this.Yv=!1}isSessionActive(){return this.Yv}},It={"title":"","artist":"","album":"","artwork":[{"src":""}]},Tt="registered",Vt="load",kt="playing",Ot="pause",St="ended",qt="muted",Ct="unmuted",xt="ad_start",jt="ad_end",Ft="playing_manual",$t="paused",zt="video-play",Lt="user-interacted";function Yt(t){t.signals().signal(Lt)}var Nt="video-manager",Dt=(t,i)=>!!t&&(t.video===i||t.video.element===i);function Ut(t,i){const n=i.top+i.height/2,e=t.getSize().height/2;return Math.abs(n-e)}function Wt(t){return 10*t*5}var Bt=t=>!!t&&!isNaN(t)&&t>1;function Ht(t,i,n){const{video:e}=t;t.getAnalyticsDetails().then((t=>{n&&Object.assign(t,n),S(e.element,i,t)}))}function Jt(t){!function(t,i,n,s){const o=N(t),r=D(o);!function(t,i,n,e,s,o){const r=W(t);let a=r[n];a||(a=r[n]={obj:null,promise:null,resolve:null,reject:null,context:null,ctor:null,sharedInstance:!1}),a.ctor||(a.ctor=e,a.context=i,a.sharedInstance=!1,a.resolve&&U(t,n))}(r,o,i,class{constructor(t){this.ampdoc=t,this.installAutoplayStyles=q((()=>function(t){!function(t,i,n,e,s){const o=t.getHeadNode(),r=function(t,i,n,e){let s=t.__AMP_CSS_SM;s||(s=t.__AMP_CSS_SM=h());const o=!n&&e&&"amp-custom"!=e&&"amp-keyframes"!=e,r=n?"amp-runtime":o?`amp-extension=${e}`:null;if(r){const n=Mt(t,s,r);if(n)return"STYLE"==n.tagName&&n.textContent!==i&&(n.textContent=i),n}const a=(t.ownerDocument||t).createElement("style");a.textContent=i;let l=null;return n?a.setAttribute("amp-runtime",""):o?(a.setAttribute("amp-extension",e||""),l=Mt(t,s,"amp-runtime")):(e&&a.setAttribute(e,""),l=t.lastChild),function(t,i,n=null){if(!n)return void function(t,i){t.insertBefore(i,t.firstChild)}(t,i);const e=n.nextSibling;t.insertBefore(i,e)}(t,a,l),r&&(s[r]=a),a}(o,function(t,i){const n=t.__AMP_CSS_TR;return n?n(i):i}(o,i),e||!1,s||null);if(n){const i=t.getRootNode();if(Et(i,r))return n(r),r;const e=setInterval((()=>{Et(i,r)&&(clearInterval(e),n(r))}),4)}}(t,".i-amphtml-video-mask{display:block;z-index:1;-webkit-appearance:none;appearance:none;background:transparent;border:none}.amp-video-eq{display:none}.i-amphtml-video-interface:not(amp-video) .amp-video-eq,amp-story .amp-video-eq,amp-video[controls] .amp-video-eq{display:-ms-flexbox;display:flex}[noaudio] .amp-video-eq{display:none!important}.amp-video-eq{pointer-events:none!important;-ms-flex-align:end;align-items:flex-end;bottom:7px;height:12px;opacity:0.8;overflow:hidden;position:absolute;right:7px;width:20px;z-index:1}.amp-video-eq-col{-ms-flex:1;flex:1;height:100%;margin-right:1px;position:relative}.amp-video-eq-col div{animation-name:amp-video-eq-animation;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:alternate;background-color:#fafafa;height:100%;position:absolute;width:100%;will-change:transform;animation-play-state:paused}.amp-video-eq-play .amp-video-eq-col div{animation-play-state:running}.amp-video-eq-1-1{animation-duration:0.3s;transform:translateY(60%)}.amp-video-eq-1-2{animation-duration:0.45s;transform:translateY(60%)}.amp-video-eq-2-1{animation-duration:0.5s;transform:translateY(30%)}.amp-video-eq-2-2{animation-duration:0.4s;transform:translateY(30%)}.amp-video-eq-3-1{animation-duration:0.3s;transform:translateY(70%)}.amp-video-eq-3-2{animation-duration:0.35s;transform:translateY(70%)}.amp-video-eq-4-1{animation-duration:0.4s;transform:translateY(50%)}.amp-video-eq-4-2{animation-duration:0.25s;transform:translateY(50%)}@keyframes amp-video-eq-animation{0%{transform:translateY(100%)}to{transform:translateY(0)}}\n/*# sourceURL=/css/video-autoplay.css*/",null,!1,"amp-video-autoplay")}(this.ampdoc))),this.M_=null,this.E_=null,this.R_=null,this.Se=G(t.win),this.V_=H(t.getHeadNode()),this.k_=()=>this.q_(),this.x_=q((()=>new class{constructor(t,i){this.C_=i,this.ji=t,this.S_=null,this.F_=null,this.M_=[],this.L_=[],this.Y_=()=>this.U_(),this.z_=t=>this.J_(t)==Ft,this.B_=(t,i)=>this.D_(t,i),this.W_(),this.H_()}dispose(){this.L_.forEach((t=>t())),this.L_.length=0}register(t){const{video:i}=t,{element:n}=i;this.G_(n)&&(this.M_.push(i),gt(n,Ot,this.Y_),gt(n,kt,this.Y_),gt(n,St,this.Y_),i.signals().whenSignal(Lt).then(this.Y_),this.U_())}H_(){const t=this.ji.getRootNode(),i=()=>this.Z_();this.L_.push(gt(t,"webkitfullscreenchange",i),gt(t,"mozfullscreenchange",i),gt(t,"fullscreenchange",i),gt(t,"MSFullscreenChange",i))}isInLandscape(){return(t=this.ji.win).screen&&"orientation"in t.screen?t.screen.orientation.type.startsWith("landscape"):90==Math.abs(t.orientation);var t}G_(t){if("video"==E(t).tagName.toLowerCase())return!0;const i=J(this.ji.win);return!i.isIos()&&!i.isSafari()||function(t){return!!{"amp-dailymotion":!0,"amp-ima-video":!0}[t.tagName.toLowerCase()]}(t)}Z_(){this.S_=null}W_(){const{win:t}=this.ji,{screen:i}=t;if(i&&"orientation"in i){const t=i.orientation;this.L_.push(gt(t,"change",(()=>this.K_())))}this.L_.push(gt(t,"orientationchange",(()=>this.K_())))}K_(){this.isInLandscape()?null!=this.F_&&this.Q_(this.F_):this.S_&&this.X_(this.S_)}Q_(t){const i=J(this.ji.win);this.S_=t,i.isAndroid()&&i.isChrome()?t.fullscreenEnter():this.tP(t).then((()=>t.fullscreenEnter()))}X_(t){this.S_=null,this.tP(t,"center").then((()=>t.fullscreenExit()))}tP(t,i=null){const{element:n}=t,e=this.iP();return this.nP().then((()=>pt(n))).then((({boundingClientRect:t})=>{const{bottom:s,top:o}=t,r=e.getSize().height;if(o>=0&&s<=r)return c();const a=i||(s>r?"bottom":"top");return e.animateScrollIntoView(n,a)}))}iP(){return Q(this.ji)}nP(){return G(this.ji.win).promise(330)}U_(){if(this.isInLandscape())return Promise.resolve(this.F_);this.F_=null;const t=this.M_.filter(this.z_).map((t=>pt(t.element)));return Promise.all(t).then((t=>{const i=t.sort(this.B_)[0];return i&&i.intersectionRatio>.5?i.target.getImpl().then((t=>this.F_=t)):this.F_}))}D_(t,i){const{boundingClientRect:n,intersectionRatio:e}=t,{boundingClientRect:s,intersectionRatio:o}=i,r=e-o;if(Math.abs(r)>.1)return r;const a=Q(this.ji),h=Ut(a,n),l=Ut(a,s);return h<l||h>l?h-l:n.top-s.top}J_(t){return this.C_.getPlayingState(t)}}(this.ampdoc,this))),this.Se.delay(this.k_,1e3)}dispose(){if(this.x_().dispose(),this.E_.disconnect(),this.E_=null,this.M_)for(let t=0;t<this.M_.length;t++)this.M_[t].dispose()}q_(){for(let t=0;t<this.M_.length;t++){const i=this.M_[t];i.getPlayingState()!==$t&&(Ht(i,"video-seconds-played"),this.eP(i))}this.Se.delay(this.k_,1e3)}eP(t){const i="timeUpdate",n=t.video.getCurrentTime(),e=t.video.getDuration();if(l(n)&&l(e)&&e>0){const s=n/e,o=_t(this.ampdoc.win,`${Nt}.${i}`,{"time":n,"percent":s});this.V_.trigger(t.video.element,i,o,1)}}register(t){F(t);const i=t;if(this.sP(t),!t.supportsPlatform())return;if(this.oP(t))return;if(!this.E_){const t=t=>t.forEach((({isIntersecting:t,target:i})=>{this.rP(i).updateVisibility(t)}));this.E_=mt(t,this.ampdoc.win,{threshold:.5})}this.E_.observe(i.element),gt(i.element,"reloaded",(()=>n.videoLoaded())),this.M_=this.M_||[];const n=new class{constructor(t,i){this.C_=t,this.ji=t.ampdoc,this.video=i,this.aP=!0,this.lP=!1,this.ig=!1,this.hP=!1,this.ps=!1,this.uP=new Rt,this.uP.onSessionEnd((()=>Ht(this,"video-session"))),this.cP=new Rt,this.cP.onSessionEnd((()=>Ht(this,"video-session-visible"))),this.dP=q((()=>new class{constructor(t,i){this.Se=G(t),this.fP=i,this.L_=null,this.mP=0,this.pP=0}start(){const{element:t}=this.fP.video;this.stop(),this.L_=this.L_||[],this.vP()?this._P(this.pP):this.L_.push(function(t,i,n,e){let s=n;const o=vt(t,"loadedmetadata",(t=>{try{s(t)}finally{s=null,o()}}),void 0);return o}(t,0,(()=>{this.vP()&&this._P(this.pP)}))),this.L_.push(gt(t,St,(()=>{this.vP()&&this.PP(100)})))}stop(){if(this.L_){for(;this.L_.length>0;)this.L_.pop()();this.pP++}}vP(){const{video:t}=this.fP,i=t.getDuration();if(!Bt(i))return!1;if(Wt(i)<250){const i=Math.ceil(5);this.gP("This video is too short for `video-percentage-played`. Reports may be inaccurate. For best results, use videos over",i,"seconds long.",t.element)}return!0}gP(...t){x().warn.apply(x(),[Nt].concat(t))}_P(t){if(t!=this.pP)return;const{fP:i,Se:n}=this,{video:e}=i,s=()=>this._P(t);if(i.getPlayingState()==$t)return void n.delay(s,500);const o=e.getDuration();if(!Bt(o))return void n.delay(s,500);const r=(c=Wt(o),u(!0),Math.min(Math.max(c,250),4e3)),a=e.getCurrentTime()/o*100,h=5*Math.floor(a/5);var c;F(l(h)),this.PP(h),n.delay(s,r)}PP(t){t<=0||this.mP!=t&&(this.mP=t,this.AP(t))}AP(t){Ht(this.fP,"video-percentage-played",{"normalizedPercentage":t.toString()})}}(this.ji.win,this))),this.yP=!1,this.bP=!1,this.MP=null,this.dt=!1,this.EP=!1,this.hasAutoplay=i.element.hasAttribute("autoplay"),this.hasAutoplay&&this.C_.installAutoplayStyles(),this.Jv=It,this.IP=()=>{R(this.video,!1)},this.RP=()=>{this.video.pause()},gt(i.element,Vt,(()=>this.videoLoaded())),gt(i.element,Ot,(()=>this.TP())),gt(i.element,"play",(()=>{this.EP=!0,Ht(this,zt)})),gt(i.element,kt,(()=>this.VP())),gt(i.element,qt,(()=>this.dt=!0)),gt(i.element,Ct,(()=>{this.dt=!1,this.C_.pauseOtherVideos(this)})),gt(i.element,"amp:video:tick",(t=>{const i=Pt(t),n=i.eventType;n&&this.wP(n,i.vars)})),gt(i.element,St,(()=>{this.hP=!1,Ht(this,"video-ended")})),gt(i.element,xt,(()=>{this.hP=!0,Ht(this,"video-ad-start")})),gt(i.element,jt,(()=>{this.hP=!1,Ht(this,"video-ad-end")})),i.signals().whenSignal(Tt).then((()=>this.kP())),this.qP=q((()=>{const t="firstPlay",i=_t(this.ji.win,t,{}),{element:n}=this.video;H(n).trigger(n,t,i,1)})),this.xP()}dispose(){this.dP().stop()}wP(t,i){const n={"__amp:eventType":t};Object.keys(i).forEach((t=>{n[`custom_${t}`]=i[t]})),Ht(this,"video-hosted-custom",n)}xP(){this.video.signals().whenSignal("playback-delegated").then((()=>{this.aP=!1,this.ig&&this.video.pause()}))}isMuted(){return this.dt}isPlaybackManaged(){return this.aP}kP(){this.CP()&&this.C_.registerForAutoFullscreen(this),this.hasAutoplay&&this.SP()}CP(){const{element:t}=this.video;return!(this.video.preimplementsAutoFullscreen()||!t.hasAttribute("rotate-to-fullscreen"))&&$(this.video.isInteractive(),"Only interactive videos are allowed to enter fullscreen on rotate. Set the `controls` attribute on %s to enable.",t)}VP(){this.ig=!0,this.getPlayingState()==Ft&&(this.qP(),this.C_.pauseOtherVideos(this));const{video:t}=this,{element:i}=t;t.preimplementsMediaSessionAPI()||i.classList.contains("i-amphtml-disable-mediasession")||(function(t,i){const n=K(t);if(i&&i.artwork){const{artwork:t}=i;F(e(t)),t.forEach((t=>{if(t){const e=(i=t,"[object Object]"===a.call(i)?t.src:t);$(n.isProtocolValid(e))}var i}))}}(i,this.Jv),function(t,i,n,e){const{navigator:s}=t;"mediaSession"in s&&t.MediaMetadata&&(s.mediaSession.metadata=new t.MediaMetadata(It),s.mediaSession.metadata=new t.MediaMetadata(i),s.mediaSession.setActionHandler("play",n),s.mediaSession.setActionHandler("pause",e))}(this.ji.win,this.Jv,this.IP,this.RP)),this.uP.beginSession(),this.ps&&this.cP.beginSession(),this.EP||Ht(this,zt)}TP(){Ht(this,"video-pause"),this.ig=!1,this.bP?this.bP=!1:this.uP.endSession()}videoLoaded(){this.lP=!0,this.MP=E(this.video.element),this.OP(),this.dP().start(),this.ps&&this.FP()}OP(){if(this.video.preimplementsMediaSessionAPI())return;this.video.getMetadata()&&(this.Jv=h(this.video.getMetadata()));const t=this.ji.win.document;if(!this.Jv.artwork||0==this.Jv.artwork.length){const i=function(t){const i=t.querySelector('script[type="application/ld+json"]');if(!i)return;const n=function(t,i){try{return function(t){return JSON.parse(t)}(t)}catch(t){return null==i||i(t),null}}(i.textContent);return n&&n.image?"string"==typeof n.image?n.image:n.image["@list"]&&"string"==typeof n.image["@list"][0]?n.image["@list"][0]:"string"==typeof n.image.url?n.image.url:"string"==typeof n.image[0]?n.image[0]:void 0:void 0}(t)||function(t){const i=t.querySelector('meta[property="og:image"]');return i?i.getAttribute("content"):void 0}(t)||function(t){const i=t.querySelector('link[rel="shortcut icon"]')||t.querySelector('link[rel="icon"]');return i?i.getAttribute("href"):void 0}(t);i&&(this.Jv.artwork=[{"src":i}])}if(!this.Jv.title){const i=this.video.element.getAttribute("title")||this.video.element.getAttribute("aria-label")||this.MP.getAttribute("title")||this.MP.getAttribute("aria-label")||t.title;i&&(this.Jv.title=i)}}$P(){this.lP&&this.FP()}FP(){this.ji.isVisible()&&M(this.ji.win).then((t=>{this.hasAutoplay&&!this.userInteracted()&&t?this.jP():this.LP()}))}SP(){this.video.isInteractive()&&this.video.hideControls(),M(this.ji.win).then((t=>{t||!this.video.isInteractive()?(this.video.mute(),this.YP()):this.video.showControls()}))}YP(){const{video:t}=this,{element:i,win:n}=this.video;if(i.hasAttribute("noaudio")||i.signals().get(Lt))return;const e=function(t,i){const n=bt(i)(wt),e=n.firstElementChild;for(let t=0;t<4;t++){const i=e.cloneNode(!0),s=i.children;for(let i=0;i<s.length;i++)s[i].classList.add(`amp-video-eq-${t+1}-${i+1}`);n.appendChild(i)}return O(e),n}(0,i),s=[e];function o(i){t.mutateElementSkipRemeasure((()=>{s.forEach((t=>{!function(t,i){void 0===i&&(i=t.hasAttribute("hidden")),i?t.removeAttribute("hidden"):t.setAttribute("hidden","")}(t,i)}))}))}function r(i){t.mutateElementSkipRemeasure((()=>e.classList.toggle("amp-video-eq-play",i)))}const a=[gt(i,Ot,(()=>r(!1))),gt(i,kt,(()=>r(!0))),gt(i,xt,(()=>{o(!1),t.showControls()})),gt(i,jt,(()=>{o(!0),t.hideControls()})),gt(i,Ct,(()=>Yt(t)))];if(t.isInteractive()){t.hideControls();const n=function(t,i){const n=bt(t)(At);return i&&i.title&&n.setAttribute("aria-label",i.title),n}(i,this.Jv);s.push(n),a.push(gt(n,"click",(()=>Yt(t))))}t.mutateElementSkipRemeasure((()=>{s.forEach((t=>{i.appendChild(t)}))})),this.hP&&o(!1),t.signals().whenSignal(Lt).then((()=>{this.qP(),t.isInteractive()&&t.showControls(),t.unmute(),a.forEach((t=>{t()})),t.mutateElementSkipRemeasure((()=>{s.forEach((t=>{O(t)}))}))}))}jP(){this.aP&&(this.ps?(this.cP.beginSession(),R(this.video,!0),this.yP=!0):(this.ig&&this.cP.endSession(),this.video.pause(),this.bP=!0))}LP(){this.ps?this.cP.beginSession():this.ig&&this.cP.endSession()}updateVisibility(t){const i=this.ps;this.ps=t,t!=i&&this.$P()}getPlayingState(){return this.ig?this.ig&&this.yP&&!this.userInteracted()?"playing_auto":Ft:$t}isRollingAd(){return this.hP}userInteracted(){return null!=this.video.signals().get(Lt)}getAnalyticsDetails(){const{video:t}=this;return Promise.all([M(this.ji.win),pt(t.element)]).then((i=>{const n=i[0],e=i[1],{height:s,width:o}=e.boundingClientRect,r=this.hasAutoplay&&n,a=t.getPlayedRanges(),h=a.reduce(((t,i)=>t+i[1]-i[0]),0);return{"autoplay":r,"currentTime":t.getCurrentTime(),"duration":t.getDuration(),"height":s,"id":t.element.id,"muted":this.dt,"playedTotal":h,"playedRangesJson":JSON.stringify(a),"state":this.getPlayingState(),"width":o}}))}}(this,t);this.M_.push(n);const{element:s}=n.video;S(s,Tt),function(t){t.classList.add("i-amphtml-media-component")}(s),t.signals().signal(Tt),s.classList.add("i-amphtml-video-interface")}sP(t){n("play",(()=>R(t,!1))),n("pause",(()=>t.pause())),n("mute",(()=>t.mute())),n("unmute",(()=>t.unmute()));const i=()=>t.fullscreenEnter();function n(i,n){t.registerAction(i,(()=>{Yt(t),n()}),1)}n("fullscreenenter",i),n("fullscreen",i)}oP(t){if(Dt(this.R_,t))return this.R_;for(let i=0;this.M_&&i<this.M_.length;i++){const n=this.M_[i];if(Dt(n,t))return this.R_=n,n}return null}rP(t){return F(this.oP(t))}registerForAutoFullscreen(t){this.x_().register(t)}UP(){return this.x_()}getVideoStateProperty(t,i){const n=this.ampdoc.getRootNode(),e=x().assertElement(n.getElementById(t),`Could not find an element with id="${t}" for VIDEO_STATE`),s=this.rP(e);return(s?s.getAnalyticsDetails():c()).then((t=>t?t[i]:""))}getPlayingState(t){return this.rP(t).getPlayingState()}isMuted(t){return this.rP(t).isMuted()}userInteracted(t){return this.rP(t).userInteracted()}isRollingAd(t){return this.rP(t).isRollingAd()}pauseOtherVideos(t){this.M_.forEach((i=>{i.isPlaybackManaged()&&i!==t&&i.getPlayingState()==Ft&&i.video.pause()}))}})}(t,"video-manager")}var Zt=["<iframe frameborder=0 allowfullscreen></iframe>"],Gt="amp-dailymotion",Kt=class extends t.BaseElement{constructor(t){super(t),this.aw=et,this.zv=null,this.Ov=null,this.dt=!1,this.HP=null,this.KP=null,this.hw=null,this.lw=null,this.ZP=!1,this.eg=new class{constructor(t){this.el=t,this.ig=!1,this.sg=!1,this.rg=this.rg.bind(this)}updatePlaying(t){t!==this.ig&&(this.ig=t,t?(this.sg=!1,function(t,i){!function(t,i,n){const e=t.ownerDocument.defaultView;if(!e)return;let s=lt.get(t);if(s||(s=[],lt.set(t,s),ct(e).observe(t)),!s.some((t=>t.callback===n&&1===t.type))){s.push({type:1,callback:n});const i=ut.get(t);i&&setTimeout((()=>ft(1,n,i)))}}(t,0,i)}(this.el,this.rg)):function(t,i){!function(t,i,n){const e=lt.get(t);if(e&&(function(t,i){const e=[];let s=0;for(let i=0;i<t.length;i++){const r=t[i];(o=r).callback===n&&1===o.type?e.push(r):(s<i&&(t[s]=r),s++)}var o;s<t.length&&(t.length=s)}(e),0==e.length)){lt.delete(t),ut.delete(t);const i=t.ownerDocument.defaultView;i&&ct(i).unobserve(t)}}(t,0,i)}(this.el,this.rg))}rg({blockSize:t,inlineSize:i}){const n=i>0&&t>0;if(n===this.sg)return;this.sg=n;const e=this.el;n||e.pause()}}(this.element)}preconnectCallback(t){Z(this.win).url(this.getAmpDoc(),"https://www.dailymotion.com",t),Z(this.win).url(this.getAmpDoc(),"https://static1.dmcdn.net",t)}supportsPlatform(){return!0}isInteractive(){return!0}isLayoutSupported(t){return function(t){return"fixed"==t||"fixed-height"==t||"responsive"==t||"fill"==t||"flex-item"==t||"fluid"==t||"intrinsic"==t}(t)}buildCallback(){var t;this.zv=$(this.element.getAttribute("data-videoid"),"The data-videoid attribute is required for <amp-dailymotion> %s",this.element),Jt(this.element),(t=this.element,L(t,"video-manager")).register(this);const i=new f;this.HP=i.promise,this.KP=i.resolve;const n=new f;this.hw=n.promise,this.lw=n.resolve}layoutCallback(){return F(this.zv),this.Ov=function(t,i,n,e){const{element:o}=t,r=bt(o)(Zt);return function(t,i,n,e){const o=s(["referrerpolicy"]);for(const t of o){const e=i.getAttribute(t);null!==e&&n.setAttribute(t,e)}}(0,t.element,r),r.src=K(o).assertHttpsUrl(i,o),function(t,i){t.classList.add("i-amphtml-fill-content")}(r),o.appendChild(r),r}(this,this.lg()),gt(this.win,"message",this.uw.bind(this)),this.loadPromise(this.Ov)}unlayoutCallback(){const t=this.Ov;return t&&(this.element.removeChild(t),this.Ov=null),this.eg.updatePlaying(!1),!0}uw(t){if(!function(t,i,n){return!(!i||t.source!=i.contentWindow)&&"https://www.dailymotion.com"==t.origin}(t,this.Ov))return;const i=Pt(t);if(!i||!t.type||"message"!=t.type)return;const n=function(t){const i=h();if(!t)return i;let n;for(;n=I.exec(t);){const t=T(n[1],n[1]),e=n[2]?T(n[2].replace(/\+/g," "),n[2]):"";i[t]=e}return i}(i);if(void 0!==n)switch(function(t,i,n){if(null==n[i])return!1;const s=n[i];(e(s)?s:[s]).forEach((i=>{S(t,i)}))}(this.element,n.event,{[st]:Vt,end:[St,Ot],[rt]:Ot,[ot]:kt}),n.event){case st:this.KP(!0);break;case ot:this.aw=n.event,this.eg.updatePlaying(!0);break;case rt:this.aw=n.event,this.eg.updatePlaying(!1);break;case"end":this.aw=rt,this.eg.updatePlaying(!1);break;case"volumechange":const t=0==n.volume||"true"==n.muted;this.aw!=et&&this.dt==t||(this.dt=t,S(this.element,function(t){return t?qt:Ct}(t)));break;case"progress":this.lw(!0);break;case"fullscreenchange":this.ZP="true"==n.fullscreen}}XP(t,i){this.HP.then((()=>{this.Ov&&this.Ov.contentWindow&&this.Ov.contentWindow.postMessage(function(t,i){return JSON.stringify({"command":t,"parameters":i})}(t,i),"https://www.dailymotion.com")}))}lg(){const{"endscreenEnable":t,"info":e,"mute":o,"sharingEnable":r,"start":a,"uiHighlight":h,"uiLogo":l}=this.element.dataset;return function(t,e,o=!1,r=!0,a=!0,h=!1,l=!0,u,c,d=!0,f){return m=`https://www.dailymotion.com/embed/video/${encodeURIComponent(e)}?api=1&html=1&app=amp`,p=function(t){for(var e=1;e<arguments.length;e++){var s=null!=arguments[e]?arguments[e]:{};e%2?n(Object(s),!0).forEach((function(n){i(t,n,s[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):n(Object(s)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(s,i))}))}return t}({"endscreen-enable":r?void 0:r,"info":a?void 0:a,"mute":h||o&&M(t)?1:void 0,"sharing-enable":l?void 0:l,"start":u,"ui-highlight":c,"ui-logo":d?void 0:d},f),function(t,i,n){if(!i)return t;const e=t.split("#",2),s=e[0].split("?",2);let o=s[0]+(s[1]?`?${s[1]}&${i}`:`?${i}`);return o+=e[1]?`#${e[1]}`:"",o}(m,function(t){const i=[];for(const o in t){let r=t[o];if(null!=r){r=s(r);for(let t=0;t<r.length;t++)i.push((n=o,e=r[t],`${encodeURIComponent(n)}=${encodeURIComponent(e)}`))}}var n,e;return i.join("&")}(p));var m,p}(this.win,this.zv,this.element.hasAttribute("autoplay"),"false"!==t,"false"!==e,"true"===o,"false"!==r,a,h,"false"!==l,function(t,i,n){const{dataset:e}=t,s={},o=/^param(.+)/;for(const t in e){const i=t.match(o);i&&(s[i[1][0].toLowerCase()+i[1].substr(1)]=e[t])}return s}(this.element))}pauseCallback(){this.pause()}play(t){this.XP("play"),t&&this.aw!=rt&&this.hw.then((()=>{this.XP("play")}))}pause(){this.XP("pause")}mute(){this.XP("muted",[!0]),this.HP.then((()=>{S(this.element,qt),this.dt=!0}))}unmute(){this.XP("muted",[!1]),this.HP.then((()=>{S(this.element,Ct),this.dt=!1}))}showControls(){this.XP("controls",[!0])}hideControls(){this.XP("controls",[!1])}fullscreenEnter(){const t=J(this.win);if(t.isSafari()||t.isIos())this.XP("fullscreen",[!0]);else{if(!this.Ov)return;!function(t){const i=t.requestFullscreen||t.requestFullScreen||t.webkitRequestFullscreen||t.webkitEnterFullscreen||t.msRequestFullscreen||t.mozRequestFullScreen;i&&i.call(t)}(this.Ov)}}fullscreenExit(){const t=J(this.win);if(t.isSafari()||t.isIos())this.XP("fullscreen",[!1]);else{if(!this.Ov)return;!function(t){const i=t.cancelFullScreen||t.exitFullscreen||t.webkitExitFullscreen||t.webkitCancelFullScreen||t.mozCancelFullScreen||t.msExitFullscreen;if(i)return void i.call(t);const{ownerDocument:n}=t;if(!n)return;const e=n.cancelFullScreen||n.exitFullscreen||n.webkitExitFullscreen||n.webkitCancelFullScreen||n.mozCancelFullScreen||n.msExitFullscreen;e&&e.call(n)}(this.Ov)}}isFullscreen(){const t=J(this.win);return t.isSafari()||t.isIos()?this.ZP:!!this.Ov&&function(t){const{webkitDisplayingFullscreen:i}=t;if(void 0!==i)return i;const{ownerDocument:n}=t;return!!n&&(n.fullscreenElement||n.webkitFullscreenElement||n.mozFullScreenElement||n.webkitCurrentFullScreenElement)==t}(this.Ov)}getMetadata(){}preimplementsMediaSessionAPI(){return!1}preimplementsAutoFullscreen(){return!1}getCurrentTime(){return 0}getDuration(){return 1}getPlayedRanges(){return[]}seekTo(t){this.user().error(Gt,"`seekTo` not supported.")}};t.registerElement(Gt,Kt)})();
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */}});
//# sourceMappingURL=amp-dailymotion-0.1.mjs.map