@vouchfor/embeds 2.0.5 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
package/dist/es/embeds.js CHANGED
@@ -196,7 +196,7 @@ class FetcherController {
196
196
  }
197
197
  }
198
198
  const name = "@vouchfor/embeds";
199
- const version = "2.0.5";
199
+ const version = "2.0.6";
200
200
  const license = "MIT";
201
201
  const author = "Aaron Williams";
202
202
  const main = "dist/es/embeds.js";
@@ -238,7 +238,7 @@ const dependencies = {
238
238
  "@a11y/focus-trap": "^1.0.5",
239
239
  "@lit/task": "^1.0.0",
240
240
  "@vouchfor/canvas-video": "^8.0.0",
241
- "@vouchfor/media-player": "^3.0.5",
241
+ "@vouchfor/media-player": "^3.0.6",
242
242
  uuid: "^9.0.1"
243
243
  };
244
244
  const peerDependencies = {
@@ -145,7 +145,7 @@ ${e}`,Ng=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Mg=Objec
145
145
  "src": {{ it._derived?.src }},
146
146
  "playlist": {{ it._derived?.playlist }},
147
147
  "captions": {{ it._derived?.captions }}
148
- }`}],root:"{{ it.outro?.questions?.items }}"}],system:!0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}],meta:{frameRate:30,resolution:720,transitionDuration:1/3},system:!0,default:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};async function tf(){if(typeof window>"u"){const s=await Promise.resolve().then(()=>Vu);return new s.Image}return new Image}const wl=Ii(async function(e){return e?new Promise((t,i)=>{tf().then(r=>{r.onload=()=>{t(r)},r.onerror=n=>{i(n)},r.src=e})}):null});async function bo({element:s,meta:e},t,i){var r,n,o;let a={...s};const{node:A}=s;if((A==null?void 0:A.type)==="video"&&((r=A==null?void 0:A.value)!=null&&r.src||(n=A==null?void 0:A.value)!=null&&n.playlist)){const l=await t(A.value,e);let c;try{c=await wl(A.value.poster)}catch{c=null}a={...a,node:{...A,video:l,poster:c,meta:await i(A.value,l.node,e)}}}if((A==null?void 0:A.type)==="image"&&A.value){let l;try{l=await wl(A.value)}catch{l=null}a={...a,node:{...A,image:l}}}return a.node&&((o=s.node)!=null&&o.elements)&&(a.node.elements=await Promise.all(s.node.elements.map(l=>bo({element:l,meta:e},t,i)))),s.elements&&(a.elements=await Promise.all(s.elements.map(l=>bo({element:l,meta:e},t,i)))),a}async function Zr(){if(typeof window>"u"){const s=await Promise.resolve().then(()=>Vu),e=new s.Canvas;return e.gpu=!1,e}return document.createElement("canvas")}function ir(s=[]){var e;for(const t of s){if(((e=t==null?void 0:t.node)==null?void 0:e.type)==="video")return t.node;const i=ir(t==null?void 0:t.elements);if(i)return i}}function sf(s,e){return s.reduce((t,i,r)=>[...t,i.map(({duration:n},o)=>r===s.length-1&&o===i.length-1?n:n-e)],[])}function rf(s){if(s===null||typeof s!="object")return!1;if(Object.getPrototypeOf(s)===null)return!0;let e=s;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(s)===e}function nf(s){return s.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}function en(s){return s.flatMap(e=>e).reduce((e,t)=>e+t,0)}const of=Ii(()=>cl.loadYoga());Eo.filters.define("parse",s=>typeof s>"u"?null:typeof s=="string"?`"${nf(s)}"`:rf(s)||Array.isArray(s)?JSON.stringify(s):s);const cs=(s,e,t)=>Eo.render(s,e,Eo.getConfig({autoEscape:!1,defaultFilter:"parse",...t}));async function hs({data:s,template:e,burnCaptions:t=!1,debug:i=!1},r,n,o){var a,A,l,c;const h=await of(),u=e??ef;if(!((a=u.templates)!=null&&a.length))throw new Error(`No templates found for template instance: ${u.id}`);let d=u.templates.find(({version:D})=>D===So);if(!d){const D=u.templates.map(({version:G})=>`"${G}"`).join(", ");console.warn(`Template renderer expects template version "${So}" but got ${D}`),d=u.templates[u.templates.length-1]}const g=await Promise.all(d.content.map(async({scenes:D,root:G})=>{const F={...u.options,...s,intro:u.intro,outro:u.outro};async function H(X,J){return Promise.all(D.map(async({layout:W,duration:S,data:R,derived:U,options:x})=>{var w,T,K;const M={...F,_index:J,_root:X,_derived:await r({data:s,rootData:X,index:J})},j=R?JSON.parse(await cs(R,M)):{},ie=U?JSON.parse(await cs(U,M)):{},ce=x?JSON.parse(await cs(x,M)):{},Ae=S?parseFloat(await cs(S,M)):NaN,me=(w=d.layouts.find(ve=>ve.name===W))==null?void 0:w.tree;if(!me)throw new Error(`Layout tree "${W}" not found in template "${d.id}" layouts.`);const Be=JSON.parse(await cs(me,{...j,...ie,...ce})),xe=await Promise.all(Be.flatMap(ve=>bo({element:ve,meta:u.meta},n,o))),re=ir(xe);return{duration:(isNaN(Ae)?null:Ae)??((T=re==null?void 0:re.meta)==null?void 0:T.duration)??0,captions:(K=re==null?void 0:re.meta)==null?void 0:K.captions,elements:xe}}))}if(G){const X=JSON.parse(await cs(G,F));return Array.isArray(X)?(await Promise.all(X.map(async(J,W)=>H(J,W)))).flatMap(J=>J):H(X,null)}return H(s,null)}));if(g.every(D=>D.every(G=>{const F=ir(G.elements);return!(F!=null&&F.value.src)&&!(F!=null&&F.value.playlist)}))){const D=g.flatMap(G=>G.map(F=>{const H=ir(F.elements);return!(H!=null&&H.value.src)&&!(H!=null&&H.value.playlist)&&(H==null?void 0:H.value.id)}).filter(Boolean)).join(", ");throw new Error(`Video(s) with ID ${D} failed to load, video can not be processed`)}if(g.every(D=>D.every(G=>G.duration<=0)))throw new Error("No scenes have any duration, video can not be processed");const v=g.reduce((D,G)=>{const F=G.filter(H=>H.duration>0);return F.length>0&&(D=[...D,F]),D},[]),y=((A=u.meta)==null?void 0:A.frameRate)??30,b=((l=u.meta)==null?void 0:l.resolution)??720,C=((c=u.meta)==null?void 0:c.transitionDuration)??1/3,Q=sf(v,C),B=en(Q);return{scenes:(await Promise.all(v.map((D,G)=>{const F=en(Q[G]),H=en(Q.slice(0,G));return Promise.all(D.map(async({duration:X,captions:J,elements:W},S)=>{var R,U;const x=await Zr(),w=await Zr(),T=await Zr(),K=await Zr(),M=ir(W),j=en([...Q.slice(0,G),...Q[G].slice(0,S)]);return{draw:({canvas:ce,currentTime:Ae})=>{const me=Math.max(0,Ae-H),Be=Math.max(0,Ae-j);Qo({yoga:h,debug:i,canvas:ce,cropCanvas:x,posterCanvas:K,letterboxCanvas:w,elements:W,currentTime:Ae,contentTime:me,sceneTime:Be,totalDuration:B,contentDuration:F,sceneDuration:X}),J&&t&&Zg({canvas:ce,dx:0,dy:0,dw:ce.width,dh:ce.height,vttCaptions:J,sceneTime:Be+((M==null?void 0:M.meta.start)??0)})},duration:X,transitionCanvas:T,start:j,video:M==null?void 0:M.video,videoMeta:M==null?void 0:M.meta,audio:{duration:X,src:(R=M==null?void 0:M.value)==null?void 0:R.src,start:(U=M==null?void 0:M.meta)==null?void 0:U.start}}}))}))).flatMap(D=>D),frameRate:y,resolution:b,transitionDuration:C,fonts:d.fonts??[],duration:B}}const So="3",af={name:"@vouchfor/embeds",version:"2.0.5",license:"MIT",author:"Aaron Williams",main:"dist/es/embeds.js",module:"dist/es/embeds.js",type:"module",types:"dist/es/src/index.d.ts",exports:{".":"./dist/es/embeds.js"},files:["dist","src"],publishConfig:{tag:"latest",access:"public"},engines:{node:">=18.18.0"},scripts:{build:"rm -rf dist && tsc && yarn build:self","build:deps":"yarn --cwd ../media-player build","build:self":"vite build --mode iife && vite build --mode es && node scripts/build.cjs","build:package":"yarn build","build:storybook":"yarn prebuild && storybook build","generate:manifest":"wca src --outFile custom-elements.json",lint:"eslint . --quiet","lint:fix":"eslint . --fix","lint:staged":"lint-staged",prepublishOnly:"yarn build",size:"size-limit",storybook:"yarn prebuild && storybook dev -p 6007",prebuild:"yarn build:deps && yarn generate:manifest",test:"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner","test:ci":"yarn test --config web-test-runner.ci.config.js"},"lint-staged":{"**/*.{ts,tsx,js}":"eslint --fix --quiet","**/*.{md,json,yml}":"prettier --write"},dependencies:{"@a11y/focus-trap":"^1.0.5","@lit/task":"^1.0.0","@vouchfor/canvas-video":"^8.0.0","@vouchfor/media-player":"^3.0.5",uuid:"^9.0.1"},peerDependencies:{lit:"^3.1.2"},devDependencies:{"@esm-bundle/chai":"^4.3.4-fix.0","@open-wc/testing":"^4.0.0","@storybook/addon-essentials":"^8.0.4","@storybook/addon-links":"^8.0.4","@storybook/blocks":"^8.0.4","@storybook/web-components":"^8.0.4","@storybook/web-components-vite":"^8.0.4","@svgr/core":"^8.1.0","@types/flat":"^5.0.5","@types/mocha":"^10.0.6","@vouchfor/eslint-config":"^1.0.1","@vouchfor/prettier-config":"^1.0.1","@vouchfor/video-utils":"^1.0.4","@web/dev-server-esbuild":"^1.0.2","@web/test-runner":"^0.18.1","@web/test-runner-browserstack":"^0.7.1","@web/test-runner-mocha":"^0.9.0","@web/test-runner-playwright":"^0.11.0",glob:"^10.3.10","lint-staged":"^15.2.2",lit:"^3.1.2",lodash:"^4.17.21",react:"^18.2.0","react-dom":"^18.2.0","rollup-plugin-tla":"^0.0.2",sinon:"^17.0.1",storybook:"^8.0.4",svgson:"^5.3.1",typescript:"^5.4.3",vite:"^5.2.2","vite-plugin-commonjs":"^0.10.1","vite-plugin-dts":"^3.7.3","web-component-analyzer":"^2.0.0"}};function Af(s){const{publicApiUrl:e}=_r(s),t=Li();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function lf(s){var n,o,a,A,l,c,h,u,d,g,f,p;if(typeof window>"u")return{client:null,tab:null,request:Li()};let e=(o=(n=window.localStorage)==null?void 0:n.getItem)==null?void 0:o.call(n,"vouch-uid-visitor"),t=(A=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:A.call(a,"vouch-uid-client"),i=(c=(l=window.sessionStorage)==null?void 0:l.getItem)==null?void 0:c.call(l,"vouch-uid-tab");const r=Li();return e||(e=Af(s),(u=(h=window.localStorage)==null?void 0:h.setItem)==null||u.call(h,"vouch-uid-visitor",e)),t||(t=Li(),(g=(d=window.localStorage)==null?void 0:d.setItem)==null||g.call(d,"vouch-uid-client",t)),i||(i=Li(),(p=(f=window.sessionStorage)==null?void 0:f.setItem)==null||p.call(f,"vouch-uid-tab",i)),{client:t,tab:i,request:r,visitor:e}}function cf(s,e){return s&&"vouchId"in s?s.vouchId:(e==null?void 0:e.id)??null}function hf(s="embedded_player"){var r,n;const[e,t]=((n=(r=Intl.DateTimeFormat().resolvedOptions().timeZone)==null?void 0:r.split)==null?void 0:n.call(r,"/"))??[],i={};return[...new URLSearchParams(location.search).entries()].forEach(([o,a])=>{if(/utm/.test(o)){const A=o.toLowerCase().replace(/[-_][a-z0-9]/g,l=>l.slice(-1).toUpperCase());i[A]=a}}),{source:s,time:new Date,region:t,country:e,screenHeight:window.screen.height,screenWidth:window.screen.width,referrer:document.referrer,currentUrl:location.href,embedType:"media-player-embed",embedVersion:af.version,templateVersion:So,...i}}const Rl=1;class uf{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,i)=>{const r=cf(i,this.host.vouch);!r||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...i,vouchId:r,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=_r(this.host.env),{client:i,tab:r,request:n,visitor:o}=lf(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":i,"x-uid-tab":r,"x-uid-request":n,"x-uid-visitor":o,"x-reporting-metadata":hf(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:i}=this._currentlyPlayingVideo;this._streamLatestTime[i]>this._streamStartTime[i]+Rl&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]}},this._handleVouchLoaded=({detail:t})=>{t&&(this._hasLoaded[t]||(this._createTrackingEvent("VOUCH_LOADED",{vouchId:t}),this._hasLoaded[t]=!0))},this._handlePlay=()=>{this._hasPlayed||(this._createTrackingEvent("VIDEO_PLAYED",{streamStart:this.host.currentTime}),this._hasPlayed=!0)},this._handleVideoPlay=({detail:{id:t,key:i}})=>{this._answersViewed[i]||(this._createTrackingEvent("VOUCH_RESPONSE_VIEWED",{answerId:t}),this._answersViewed[i]=!0)},this._handleVideoTimeUpdate=({detail:{id:t,key:i,node:r}})=>{var n,o;!this.host.paused&&t===((o=(n=this.host.scene)==null?void 0:n.video)==null?void 0:o.id)&&(this._currentlyPlayingVideo={id:t,key:i,node:r},this._streamLatestTime[i]=r.currentTime,this._streamStartTime[i]||(this._streamStartTime[i]=r.currentTime,this._streamLatestTime[i]=r.currentTime))},this._handleVideoPause=({detail:{id:t,key:i}})=>{this._streamLatestTime[i]>this._streamStartTime[i]+Rl&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]},this._pageUnloading=()=>{this._streamEnded(),this._sendTrackingEvent()},this._handleVisibilityChange=()=>{document.visibilityState==="hidden"&&this._pageUnloading()},this._handlePageHide=()=>{this._pageUnloading()},this.host=e,e.addController(this)}hostConnected(){requestAnimationFrame(()=>{var e,t,i,r;"onvisibilitychange"in document?document.addEventListener("visibilitychange",this._handleVisibilityChange):window.addEventListener("pagehide",this._handlePageHide),this.host.addEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.addEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.addEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.addEventListener("video:pause",this._handleVideoPause),(r=this.host.mediaPlayer)==null||r.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,i,r;this._pageUnloading(),"onvisibilitychange"in document?document.removeEventListener("visibilitychange",this._handleVisibilityChange):window.removeEventListener("pagehide",this._handlePageHide),this.host.removeEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.removeEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.removeEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.removeEventListener("video:pause",this._handleVideoPause),(r=this.host.mediaPlayer)==null||r.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var wo={exports:{}};(function(s,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Pr<"u"&&Pr,i=function(){function n(){this.fetch=!1,this.DOMException=t.DOMException}return n.prototype=t,new n}();(function(n){(function(o){var a=typeof n<"u"&&n||typeof self<"u"&&self||typeof a<"u"&&a,A={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function l(S){return S&&DataView.prototype.isPrototypeOf(S)}if(A.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(S){return S&&c.indexOf(Object.prototype.toString.call(S))>-1};function u(S){if(typeof S!="string"&&(S=String(S)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(S)||S==="")throw new TypeError('Invalid character in header field name: "'+S+'"');return S.toLowerCase()}function d(S){return typeof S!="string"&&(S=String(S)),S}function g(S){var R={next:function(){var U=S.shift();return{done:U===void 0,value:U}}};return A.iterable&&(R[Symbol.iterator]=function(){return R}),R}function f(S){this.map={},S instanceof f?S.forEach(function(R,U){this.append(U,R)},this):Array.isArray(S)?S.forEach(function(R){this.append(R[0],R[1])},this):S&&Object.getOwnPropertyNames(S).forEach(function(R){this.append(R,S[R])},this)}f.prototype.append=function(S,R){S=u(S),R=d(R);var U=this.map[S];this.map[S]=U?U+", "+R:R},f.prototype.delete=function(S){delete this.map[u(S)]},f.prototype.get=function(S){return S=u(S),this.has(S)?this.map[S]:null},f.prototype.has=function(S){return this.map.hasOwnProperty(u(S))},f.prototype.set=function(S,R){this.map[u(S)]=d(R)},f.prototype.forEach=function(S,R){for(var U in this.map)this.map.hasOwnProperty(U)&&S.call(R,this.map[U],U,this)},f.prototype.keys=function(){var S=[];return this.forEach(function(R,U){S.push(U)}),g(S)},f.prototype.values=function(){var S=[];return this.forEach(function(R){S.push(R)}),g(S)},f.prototype.entries=function(){var S=[];return this.forEach(function(R,U){S.push([U,R])}),g(S)},A.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);function p(S){if(S.bodyUsed)return Promise.reject(new TypeError("Already read"));S.bodyUsed=!0}function v(S){return new Promise(function(R,U){S.onload=function(){R(S.result)},S.onerror=function(){U(S.error)}})}function y(S){var R=new FileReader,U=v(R);return R.readAsArrayBuffer(S),U}function b(S){var R=new FileReader,U=v(R);return R.readAsText(S),U}function C(S){for(var R=new Uint8Array(S),U=new Array(R.length),x=0;x<R.length;x++)U[x]=String.fromCharCode(R[x]);return U.join("")}function Q(S){if(S.slice)return S.slice(0);var R=new Uint8Array(S.byteLength);return R.set(new Uint8Array(S)),R.buffer}function B(){return this.bodyUsed=!1,this._initBody=function(S){this.bodyUsed=this.bodyUsed,this._bodyInit=S,S?typeof S=="string"?this._bodyText=S:A.blob&&Blob.prototype.isPrototypeOf(S)?this._bodyBlob=S:A.formData&&FormData.prototype.isPrototypeOf(S)?this._bodyFormData=S:A.searchParams&&URLSearchParams.prototype.isPrototypeOf(S)?this._bodyText=S.toString():A.arrayBuffer&&A.blob&&l(S)?(this._bodyArrayBuffer=Q(S.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):A.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(S)||h(S))?this._bodyArrayBuffer=Q(S):this._bodyText=S=Object.prototype.toString.call(S):this._bodyText="",this.headers.get("content-type")||(typeof S=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):A.searchParams&&URLSearchParams.prototype.isPrototypeOf(S)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},A.blob&&(this.blob=function(){var S=p(this);if(S)return S;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var S=p(this);return S||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(y)}),this.text=function(){var S=p(this);if(S)return S;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(C(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},A.formData&&(this.formData=function(){return this.text().then(F)}),this.json=function(){return this.text().then(JSON.parse)},this}var _=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function D(S){var R=S.toUpperCase();return _.indexOf(R)>-1?R:S}function G(S,R){if(!(this instanceof G))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');R=R||{};var U=R.body;if(S instanceof G){if(S.bodyUsed)throw new TypeError("Already read");this.url=S.url,this.credentials=S.credentials,R.headers||(this.headers=new f(S.headers)),this.method=S.method,this.mode=S.mode,this.signal=S.signal,!U&&S._bodyInit!=null&&(U=S._bodyInit,S.bodyUsed=!0)}else this.url=String(S);if(this.credentials=R.credentials||this.credentials||"same-origin",(R.headers||!this.headers)&&(this.headers=new f(R.headers)),this.method=D(R.method||this.method||"GET"),this.mode=R.mode||this.mode||null,this.signal=R.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&U)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(U),(this.method==="GET"||this.method==="HEAD")&&(R.cache==="no-store"||R.cache==="no-cache")){var x=/([?&])_=[^&]*/;if(x.test(this.url))this.url=this.url.replace(x,"$1_="+new Date().getTime());else{var w=/\?/;this.url+=(w.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}G.prototype.clone=function(){return new G(this,{body:this._bodyInit})};function F(S){var R=new FormData;return S.trim().split("&").forEach(function(U){if(U){var x=U.split("="),w=x.shift().replace(/\+/g," "),T=x.join("=").replace(/\+/g," ");R.append(decodeURIComponent(w),decodeURIComponent(T))}}),R}function H(S){var R=new f,U=S.replace(/\r?\n[\t ]+/g," ");return U.split("\r").map(function(x){return x.indexOf(`
148
+ }`}],root:"{{ it.outro?.questions?.items }}"}],system:!0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}],meta:{frameRate:30,resolution:720,transitionDuration:1/3},system:!0,default:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};async function tf(){if(typeof window>"u"){const s=await Promise.resolve().then(()=>Vu);return new s.Image}return new Image}const wl=Ii(async function(e){return e?new Promise((t,i)=>{tf().then(r=>{r.onload=()=>{t(r)},r.onerror=n=>{i(n)},r.src=e})}):null});async function bo({element:s,meta:e},t,i){var r,n,o;let a={...s};const{node:A}=s;if((A==null?void 0:A.type)==="video"&&((r=A==null?void 0:A.value)!=null&&r.src||(n=A==null?void 0:A.value)!=null&&n.playlist)){const l=await t(A.value,e);let c;try{c=await wl(A.value.poster)}catch{c=null}a={...a,node:{...A,video:l,poster:c,meta:await i(A.value,l.node,e)}}}if((A==null?void 0:A.type)==="image"&&A.value){let l;try{l=await wl(A.value)}catch{l=null}a={...a,node:{...A,image:l}}}return a.node&&((o=s.node)!=null&&o.elements)&&(a.node.elements=await Promise.all(s.node.elements.map(l=>bo({element:l,meta:e},t,i)))),s.elements&&(a.elements=await Promise.all(s.elements.map(l=>bo({element:l,meta:e},t,i)))),a}async function Zr(){if(typeof window>"u"){const s=await Promise.resolve().then(()=>Vu),e=new s.Canvas;return e.gpu=!1,e}return document.createElement("canvas")}function ir(s=[]){var e;for(const t of s){if(((e=t==null?void 0:t.node)==null?void 0:e.type)==="video")return t.node;const i=ir(t==null?void 0:t.elements);if(i)return i}}function sf(s,e){return s.reduce((t,i,r)=>[...t,i.map(({duration:n},o)=>r===s.length-1&&o===i.length-1?n:n-e)],[])}function rf(s){if(s===null||typeof s!="object")return!1;if(Object.getPrototypeOf(s)===null)return!0;let e=s;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(s)===e}function nf(s){return s.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}function en(s){return s.flatMap(e=>e).reduce((e,t)=>e+t,0)}const of=Ii(()=>cl.loadYoga());Eo.filters.define("parse",s=>typeof s>"u"?null:typeof s=="string"?`"${nf(s)}"`:rf(s)||Array.isArray(s)?JSON.stringify(s):s);const cs=(s,e,t)=>Eo.render(s,e,Eo.getConfig({autoEscape:!1,defaultFilter:"parse",...t}));async function hs({data:s,template:e,burnCaptions:t=!1,debug:i=!1},r,n,o){var a,A,l,c;const h=await of(),u=e??ef;if(!((a=u.templates)!=null&&a.length))throw new Error(`No templates found for template instance: ${u.id}`);let d=u.templates.find(({version:D})=>D===So);if(!d){const D=u.templates.map(({version:G})=>`"${G}"`).join(", ");console.warn(`Template renderer expects template version "${So}" but got ${D}`),d=u.templates[u.templates.length-1]}const g=await Promise.all(d.content.map(async({scenes:D,root:G})=>{const F={...u.options,...s,intro:u.intro,outro:u.outro};async function H(X,J){return Promise.all(D.map(async({layout:W,duration:S,data:R,derived:U,options:x})=>{var w,T,K;const M={...F,_index:J,_root:X,_derived:await r({data:s,rootData:X,index:J})},j=R?JSON.parse(await cs(R,M)):{},ie=U?JSON.parse(await cs(U,M)):{},ce=x?JSON.parse(await cs(x,M)):{},Ae=S?parseFloat(await cs(S,M)):NaN,me=(w=d.layouts.find(ve=>ve.name===W))==null?void 0:w.tree;if(!me)throw new Error(`Layout tree "${W}" not found in template "${d.id}" layouts.`);const Be=JSON.parse(await cs(me,{...j,...ie,...ce})),xe=await Promise.all(Be.flatMap(ve=>bo({element:ve,meta:u.meta},n,o))),re=ir(xe);return{duration:(isNaN(Ae)?null:Ae)??((T=re==null?void 0:re.meta)==null?void 0:T.duration)??0,captions:(K=re==null?void 0:re.meta)==null?void 0:K.captions,elements:xe}}))}if(G){const X=JSON.parse(await cs(G,F));return Array.isArray(X)?(await Promise.all(X.map(async(J,W)=>H(J,W)))).flatMap(J=>J):H(X,null)}return H(s,null)}));if(g.every(D=>D.every(G=>{const F=ir(G.elements);return!(F!=null&&F.value.src)&&!(F!=null&&F.value.playlist)}))){const D=g.flatMap(G=>G.map(F=>{const H=ir(F.elements);return!(H!=null&&H.value.src)&&!(H!=null&&H.value.playlist)&&(H==null?void 0:H.value.id)}).filter(Boolean)).join(", ");throw new Error(`Video(s) with ID ${D} failed to load, video can not be processed`)}if(g.every(D=>D.every(G=>G.duration<=0)))throw new Error("No scenes have any duration, video can not be processed");const v=g.reduce((D,G)=>{const F=G.filter(H=>H.duration>0);return F.length>0&&(D=[...D,F]),D},[]),y=((A=u.meta)==null?void 0:A.frameRate)??30,b=((l=u.meta)==null?void 0:l.resolution)??720,C=((c=u.meta)==null?void 0:c.transitionDuration)??1/3,Q=sf(v,C),B=en(Q);return{scenes:(await Promise.all(v.map((D,G)=>{const F=en(Q[G]),H=en(Q.slice(0,G));return Promise.all(D.map(async({duration:X,captions:J,elements:W},S)=>{var R,U;const x=await Zr(),w=await Zr(),T=await Zr(),K=await Zr(),M=ir(W),j=en([...Q.slice(0,G),...Q[G].slice(0,S)]);return{draw:({canvas:ce,currentTime:Ae})=>{const me=Math.max(0,Ae-H),Be=Math.max(0,Ae-j);Qo({yoga:h,debug:i,canvas:ce,cropCanvas:x,posterCanvas:K,letterboxCanvas:w,elements:W,currentTime:Ae,contentTime:me,sceneTime:Be,totalDuration:B,contentDuration:F,sceneDuration:X}),J&&t&&Zg({canvas:ce,dx:0,dy:0,dw:ce.width,dh:ce.height,vttCaptions:J,sceneTime:Be+((M==null?void 0:M.meta.start)??0)})},duration:X,transitionCanvas:T,start:j,video:M==null?void 0:M.video,videoMeta:M==null?void 0:M.meta,audio:{duration:X,src:(R=M==null?void 0:M.value)==null?void 0:R.src,start:(U=M==null?void 0:M.meta)==null?void 0:U.start}}}))}))).flatMap(D=>D),frameRate:y,resolution:b,transitionDuration:C,fonts:d.fonts??[],duration:B}}const So="3",af={name:"@vouchfor/embeds",version:"2.0.6",license:"MIT",author:"Aaron Williams",main:"dist/es/embeds.js",module:"dist/es/embeds.js",type:"module",types:"dist/es/src/index.d.ts",exports:{".":"./dist/es/embeds.js"},files:["dist","src"],publishConfig:{tag:"latest",access:"public"},engines:{node:">=18.18.0"},scripts:{build:"rm -rf dist && tsc && yarn build:self","build:deps":"yarn --cwd ../media-player build","build:self":"vite build --mode iife && vite build --mode es && node scripts/build.cjs","build:package":"yarn build","build:storybook":"yarn prebuild && storybook build","generate:manifest":"wca src --outFile custom-elements.json",lint:"eslint . --quiet","lint:fix":"eslint . --fix","lint:staged":"lint-staged",prepublishOnly:"yarn build",size:"size-limit",storybook:"yarn prebuild && storybook dev -p 6007",prebuild:"yarn build:deps && yarn generate:manifest",test:"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner","test:ci":"yarn test --config web-test-runner.ci.config.js"},"lint-staged":{"**/*.{ts,tsx,js}":"eslint --fix --quiet","**/*.{md,json,yml}":"prettier --write"},dependencies:{"@a11y/focus-trap":"^1.0.5","@lit/task":"^1.0.0","@vouchfor/canvas-video":"^8.0.0","@vouchfor/media-player":"^3.0.6",uuid:"^9.0.1"},peerDependencies:{lit:"^3.1.2"},devDependencies:{"@esm-bundle/chai":"^4.3.4-fix.0","@open-wc/testing":"^4.0.0","@storybook/addon-essentials":"^8.0.4","@storybook/addon-links":"^8.0.4","@storybook/blocks":"^8.0.4","@storybook/web-components":"^8.0.4","@storybook/web-components-vite":"^8.0.4","@svgr/core":"^8.1.0","@types/flat":"^5.0.5","@types/mocha":"^10.0.6","@vouchfor/eslint-config":"^1.0.1","@vouchfor/prettier-config":"^1.0.1","@vouchfor/video-utils":"^1.0.4","@web/dev-server-esbuild":"^1.0.2","@web/test-runner":"^0.18.1","@web/test-runner-browserstack":"^0.7.1","@web/test-runner-mocha":"^0.9.0","@web/test-runner-playwright":"^0.11.0",glob:"^10.3.10","lint-staged":"^15.2.2",lit:"^3.1.2",lodash:"^4.17.21",react:"^18.2.0","react-dom":"^18.2.0","rollup-plugin-tla":"^0.0.2",sinon:"^17.0.1",storybook:"^8.0.4",svgson:"^5.3.1",typescript:"^5.4.3",vite:"^5.2.2","vite-plugin-commonjs":"^0.10.1","vite-plugin-dts":"^3.7.3","web-component-analyzer":"^2.0.0"}};function Af(s){const{publicApiUrl:e}=_r(s),t=Li();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function lf(s){var n,o,a,A,l,c,h,u,d,g,f,p;if(typeof window>"u")return{client:null,tab:null,request:Li()};let e=(o=(n=window.localStorage)==null?void 0:n.getItem)==null?void 0:o.call(n,"vouch-uid-visitor"),t=(A=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:A.call(a,"vouch-uid-client"),i=(c=(l=window.sessionStorage)==null?void 0:l.getItem)==null?void 0:c.call(l,"vouch-uid-tab");const r=Li();return e||(e=Af(s),(u=(h=window.localStorage)==null?void 0:h.setItem)==null||u.call(h,"vouch-uid-visitor",e)),t||(t=Li(),(g=(d=window.localStorage)==null?void 0:d.setItem)==null||g.call(d,"vouch-uid-client",t)),i||(i=Li(),(p=(f=window.sessionStorage)==null?void 0:f.setItem)==null||p.call(f,"vouch-uid-tab",i)),{client:t,tab:i,request:r,visitor:e}}function cf(s,e){return s&&"vouchId"in s?s.vouchId:(e==null?void 0:e.id)??null}function hf(s="embedded_player"){var r,n;const[e,t]=((n=(r=Intl.DateTimeFormat().resolvedOptions().timeZone)==null?void 0:r.split)==null?void 0:n.call(r,"/"))??[],i={};return[...new URLSearchParams(location.search).entries()].forEach(([o,a])=>{if(/utm/.test(o)){const A=o.toLowerCase().replace(/[-_][a-z0-9]/g,l=>l.slice(-1).toUpperCase());i[A]=a}}),{source:s,time:new Date,region:t,country:e,screenHeight:window.screen.height,screenWidth:window.screen.width,referrer:document.referrer,currentUrl:location.href,embedType:"media-player-embed",embedVersion:af.version,templateVersion:So,...i}}const Rl=1;class uf{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,i)=>{const r=cf(i,this.host.vouch);!r||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...i,vouchId:r,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=_r(this.host.env),{client:i,tab:r,request:n,visitor:o}=lf(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":i,"x-uid-tab":r,"x-uid-request":n,"x-uid-visitor":o,"x-reporting-metadata":hf(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:i}=this._currentlyPlayingVideo;this._streamLatestTime[i]>this._streamStartTime[i]+Rl&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]}},this._handleVouchLoaded=({detail:t})=>{t&&(this._hasLoaded[t]||(this._createTrackingEvent("VOUCH_LOADED",{vouchId:t}),this._hasLoaded[t]=!0))},this._handlePlay=()=>{this._hasPlayed||(this._createTrackingEvent("VIDEO_PLAYED",{streamStart:this.host.currentTime}),this._hasPlayed=!0)},this._handleVideoPlay=({detail:{id:t,key:i}})=>{this._answersViewed[i]||(this._createTrackingEvent("VOUCH_RESPONSE_VIEWED",{answerId:t}),this._answersViewed[i]=!0)},this._handleVideoTimeUpdate=({detail:{id:t,key:i,node:r}})=>{var n,o;!this.host.paused&&t===((o=(n=this.host.scene)==null?void 0:n.video)==null?void 0:o.id)&&(this._currentlyPlayingVideo={id:t,key:i,node:r},this._streamLatestTime[i]=r.currentTime,this._streamStartTime[i]||(this._streamStartTime[i]=r.currentTime,this._streamLatestTime[i]=r.currentTime))},this._handleVideoPause=({detail:{id:t,key:i}})=>{this._streamLatestTime[i]>this._streamStartTime[i]+Rl&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]},this._pageUnloading=()=>{this._streamEnded(),this._sendTrackingEvent()},this._handleVisibilityChange=()=>{document.visibilityState==="hidden"&&this._pageUnloading()},this._handlePageHide=()=>{this._pageUnloading()},this.host=e,e.addController(this)}hostConnected(){requestAnimationFrame(()=>{var e,t,i,r;"onvisibilitychange"in document?document.addEventListener("visibilitychange",this._handleVisibilityChange):window.addEventListener("pagehide",this._handlePageHide),this.host.addEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.addEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.addEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.addEventListener("video:pause",this._handleVideoPause),(r=this.host.mediaPlayer)==null||r.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,i,r;this._pageUnloading(),"onvisibilitychange"in document?document.removeEventListener("visibilitychange",this._handleVisibilityChange):window.removeEventListener("pagehide",this._handlePageHide),this.host.removeEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.removeEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.removeEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.removeEventListener("video:pause",this._handleVideoPause),(r=this.host.mediaPlayer)==null||r.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var wo={exports:{}};(function(s,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Pr<"u"&&Pr,i=function(){function n(){this.fetch=!1,this.DOMException=t.DOMException}return n.prototype=t,new n}();(function(n){(function(o){var a=typeof n<"u"&&n||typeof self<"u"&&self||typeof a<"u"&&a,A={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function l(S){return S&&DataView.prototype.isPrototypeOf(S)}if(A.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(S){return S&&c.indexOf(Object.prototype.toString.call(S))>-1};function u(S){if(typeof S!="string"&&(S=String(S)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(S)||S==="")throw new TypeError('Invalid character in header field name: "'+S+'"');return S.toLowerCase()}function d(S){return typeof S!="string"&&(S=String(S)),S}function g(S){var R={next:function(){var U=S.shift();return{done:U===void 0,value:U}}};return A.iterable&&(R[Symbol.iterator]=function(){return R}),R}function f(S){this.map={},S instanceof f?S.forEach(function(R,U){this.append(U,R)},this):Array.isArray(S)?S.forEach(function(R){this.append(R[0],R[1])},this):S&&Object.getOwnPropertyNames(S).forEach(function(R){this.append(R,S[R])},this)}f.prototype.append=function(S,R){S=u(S),R=d(R);var U=this.map[S];this.map[S]=U?U+", "+R:R},f.prototype.delete=function(S){delete this.map[u(S)]},f.prototype.get=function(S){return S=u(S),this.has(S)?this.map[S]:null},f.prototype.has=function(S){return this.map.hasOwnProperty(u(S))},f.prototype.set=function(S,R){this.map[u(S)]=d(R)},f.prototype.forEach=function(S,R){for(var U in this.map)this.map.hasOwnProperty(U)&&S.call(R,this.map[U],U,this)},f.prototype.keys=function(){var S=[];return this.forEach(function(R,U){S.push(U)}),g(S)},f.prototype.values=function(){var S=[];return this.forEach(function(R){S.push(R)}),g(S)},f.prototype.entries=function(){var S=[];return this.forEach(function(R,U){S.push([U,R])}),g(S)},A.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);function p(S){if(S.bodyUsed)return Promise.reject(new TypeError("Already read"));S.bodyUsed=!0}function v(S){return new Promise(function(R,U){S.onload=function(){R(S.result)},S.onerror=function(){U(S.error)}})}function y(S){var R=new FileReader,U=v(R);return R.readAsArrayBuffer(S),U}function b(S){var R=new FileReader,U=v(R);return R.readAsText(S),U}function C(S){for(var R=new Uint8Array(S),U=new Array(R.length),x=0;x<R.length;x++)U[x]=String.fromCharCode(R[x]);return U.join("")}function Q(S){if(S.slice)return S.slice(0);var R=new Uint8Array(S.byteLength);return R.set(new Uint8Array(S)),R.buffer}function B(){return this.bodyUsed=!1,this._initBody=function(S){this.bodyUsed=this.bodyUsed,this._bodyInit=S,S?typeof S=="string"?this._bodyText=S:A.blob&&Blob.prototype.isPrototypeOf(S)?this._bodyBlob=S:A.formData&&FormData.prototype.isPrototypeOf(S)?this._bodyFormData=S:A.searchParams&&URLSearchParams.prototype.isPrototypeOf(S)?this._bodyText=S.toString():A.arrayBuffer&&A.blob&&l(S)?(this._bodyArrayBuffer=Q(S.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):A.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(S)||h(S))?this._bodyArrayBuffer=Q(S):this._bodyText=S=Object.prototype.toString.call(S):this._bodyText="",this.headers.get("content-type")||(typeof S=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):A.searchParams&&URLSearchParams.prototype.isPrototypeOf(S)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},A.blob&&(this.blob=function(){var S=p(this);if(S)return S;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var S=p(this);return S||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(y)}),this.text=function(){var S=p(this);if(S)return S;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(C(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},A.formData&&(this.formData=function(){return this.text().then(F)}),this.json=function(){return this.text().then(JSON.parse)},this}var _=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function D(S){var R=S.toUpperCase();return _.indexOf(R)>-1?R:S}function G(S,R){if(!(this instanceof G))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');R=R||{};var U=R.body;if(S instanceof G){if(S.bodyUsed)throw new TypeError("Already read");this.url=S.url,this.credentials=S.credentials,R.headers||(this.headers=new f(S.headers)),this.method=S.method,this.mode=S.mode,this.signal=S.signal,!U&&S._bodyInit!=null&&(U=S._bodyInit,S.bodyUsed=!0)}else this.url=String(S);if(this.credentials=R.credentials||this.credentials||"same-origin",(R.headers||!this.headers)&&(this.headers=new f(R.headers)),this.method=D(R.method||this.method||"GET"),this.mode=R.mode||this.mode||null,this.signal=R.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&U)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(U),(this.method==="GET"||this.method==="HEAD")&&(R.cache==="no-store"||R.cache==="no-cache")){var x=/([?&])_=[^&]*/;if(x.test(this.url))this.url=this.url.replace(x,"$1_="+new Date().getTime());else{var w=/\?/;this.url+=(w.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}G.prototype.clone=function(){return new G(this,{body:this._bodyInit})};function F(S){var R=new FormData;return S.trim().split("&").forEach(function(U){if(U){var x=U.split("="),w=x.shift().replace(/\+/g," "),T=x.join("=").replace(/\+/g," ");R.append(decodeURIComponent(w),decodeURIComponent(T))}}),R}function H(S){var R=new f,U=S.replace(/\r?\n[\t ]+/g," ");return U.split("\r").map(function(x){return x.indexOf(`
149
149
  `)===0?x.substr(1,x.length):x}).forEach(function(x){var w=x.split(":"),T=w.shift().trim();if(T){var K=w.join(":").trim();R.append(T,K)}}),R}B.call(G.prototype);function X(S,R){if(!(this instanceof X))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');R||(R={}),this.type="default",this.status=R.status===void 0?200:R.status,this.ok=this.status>=200&&this.status<300,this.statusText=R.statusText===void 0?"":""+R.statusText,this.headers=new f(R.headers),this.url=R.url||"",this._initBody(S)}B.call(X.prototype),X.prototype.clone=function(){return new X(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},X.error=function(){var S=new X(null,{status:0,statusText:""});return S.type="error",S};var J=[301,302,303,307,308];X.redirect=function(S,R){if(J.indexOf(R)===-1)throw new RangeError("Invalid status code");return new X(null,{status:R,headers:{location:S}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(R,U){this.message=R,this.name=U;var x=Error(R);this.stack=x.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function W(S,R){return new Promise(function(U,x){var w=new G(S,R);if(w.signal&&w.signal.aborted)return x(new o.DOMException("Aborted","AbortError"));var T=new XMLHttpRequest;function K(){T.abort()}T.onload=function(){var j={status:T.status,statusText:T.statusText,headers:H(T.getAllResponseHeaders()||"")};j.url="responseURL"in T?T.responseURL:j.headers.get("X-Request-URL");var ie="response"in T?T.response:T.responseText;setTimeout(function(){U(new X(ie,j))},0)},T.onerror=function(){setTimeout(function(){x(new TypeError("Network request failed"))},0)},T.ontimeout=function(){setTimeout(function(){x(new TypeError("Network request failed"))},0)},T.onabort=function(){setTimeout(function(){x(new o.DOMException("Aborted","AbortError"))},0)};function M(j){try{return j===""&&a.location.href?a.location.href:j}catch{return j}}T.open(w.method,M(w.url),!0),w.credentials==="include"?T.withCredentials=!0:w.credentials==="omit"&&(T.withCredentials=!1),"responseType"in T&&(A.blob?T.responseType="blob":A.arrayBuffer&&w.headers.get("Content-Type")&&w.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(T.responseType="arraybuffer")),R&&typeof R.headers=="object"&&!(R.headers instanceof f)?Object.getOwnPropertyNames(R.headers).forEach(function(j){T.setRequestHeader(j,d(R.headers[j]))}):w.headers.forEach(function(j,ie){T.setRequestHeader(ie,j)}),w.signal&&(w.signal.addEventListener("abort",K),T.onreadystatechange=function(){T.readyState===4&&w.signal.removeEventListener("abort",K)}),T.send(typeof w._bodyInit>"u"?null:w._bodyInit)})}return W.polyfill=!0,a.fetch||(a.fetch=W,a.Headers=f,a.Request=G,a.Response=X),o.Headers=f,o.Request=G,o.Response=X,o.fetch=W,o})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=t.fetch?t:i;e=r.fetch,e.default=r.fetch,e.fetch=r.fetch,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,s.exports=e})(wo,wo.exports);var df=wo.exports;const xl=ll(df);async function gf(s){var e;try{if((e=await xl(s,{method:"HEAD"}))!=null&&e.ok)return s}catch{return}}async function Dl({sources:s}){let e=null;const t=s==null?void 0:s.filter(Boolean),i=t==null?void 0:t.find(n=>n.startsWith("blob:")),r=t==null?void 0:t.find(n=>!n.startsWith("http")&&!n.startsWith("blob:"));if(i||r)return i??r;if(t.length>0){const n=t.map(o=>gf(o));e=(await Promise.all(n)).find(Boolean)}return e}async function ff(s){try{return(await xl(s)).text()}catch{return null}}async function pf(s){return s=s.trim(),s.startsWith("http")||s.startsWith("blob:")?ff(s):s}const Ef=Ii(async({original:s,translation:e,originalLanguage:t="",translationLanguage:i=""},{language:r})=>{var n,o;const a={[(n=t==null?void 0:t.split("-"))==null?void 0:n[0]]:s,[(o=i==null?void 0:i.split("-"))==null?void 0:o[0]]:e},A=(r&&a[r])??s;return A?pf(A):null},{cacheKey:([s,{language:e}])=>JSON.stringify({...s,language:e})});async function If(s){var e,t,i,r,n,o;const a=(t=(e=s==null?void 0:s.answer)==null?void 0:e.media)==null?void 0:t.video,A=(r=(i=s==null?void 0:s.answer)==null?void 0:i.media)==null?void 0:r.input,l=(o=(n=s==null?void 0:s.answer)==null?void 0:n.media)==null?void 0:o.playlist;return{src:await Dl({sources:[a,A]}),playlist:await Dl({sources:[l]})}}function mf(s){var e,t,i,r,n,o,a,A,l,c;const h=((t=(e=s==null?void 0:s.answer)==null?void 0:e.contact)==null?void 0:t.name)==="Anonymous"?"":((r=(i=s==null?void 0:s.answer)==null?void 0:i.contact)==null?void 0:r.name)??"",u=((a=(o=(n=s==null?void 0:s.answer)==null?void 0:n.contact)==null?void 0:o.client)==null?void 0:a.name)==="Not Supplied"?"":((c=(l=(A=s==null?void 0:s.answer)==null?void 0:A.contact)==null?void 0:l.client)==null?void 0:c.name)??"",[d,g]=h.split(" ");return{name:h,firstName:d,lastName:g,companyName:u}}async function Ro({rootData:s,index:e},t){var i,r,n,o,a,A,l,c,h,u,d,g,f,p;return{...mf(s),...await If(s),key:`${s==null?void 0:s.id}-${e}`,captions:await Ef({original:((r=(i=s==null?void 0:s.answer)==null?void 0:i.media)==null?void 0:r.captions)??((o=(n=s==null?void 0:s.answer)==null?void 0:n.captions)==null?void 0:o.current),translation:((A=(a=s==null?void 0:s.answer)==null?void 0:a.media)==null?void 0:A.translation)??((c=(l=s==null?void 0:s.answer)==null?void 0:l.captions)==null?void 0:c.translation),originalLanguage:(u=(h=s==null?void 0:s.answer)==null?void 0:h.transcription)==null?void 0:u.language,translationLanguage:(f=(g=(d=s==null?void 0:s.answer)==null?void 0:d.transcription)==null?void 0:g.translation)==null?void 0:f.language},t),answerLabel:((p=s==null?void 0:s.answer)==null?void 0:p.label)??(s==null?void 0:s.title)}}const tn={af:"Afrikaans",sq:"Albanian",am:"Amharic",ar:"Arabic",hy:"Armenian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese (Simplified)",zh_TW:"Chinese (Traditional)",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",fi:"Finnish",fr:"French",fa:"Farsi",tl:"Filipino",ka:"Georgian",de:"German",el:"Greek",gu:"Gujarati",ht:"Haitian Creole",ha:"Hausa",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",kn:"Kannada",kk:"Kazakh",ko:"Korean",lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",ml:"Malayalam",mt:"Maltese",mr:"Marathi",mn:"Mongolian",no:"Norwegian",ps:"Pashto",pl:"Polish",pt:"Portuguese",pa:"Punjabi",ro:"Romanian",ru:"Russian",sr:"Serbian",si:"Sinhala",sk:"Slovak",sl:"Slovenian",so:"Somali",es:"Spanish",sw:"Swahili",sv:"Swedish",ta:"Tamil",te:"Telugu",th:"Thai",tr:"Turkish",uk:"Ukrainian",ur:"Urdu",uz:"Uzbek",vi:"Vietnamese",cy:"Welsh"};function Cf({data:s}){var e,t;return((t=(e=s==null?void 0:s.questions)==null?void 0:e.items)==null?void 0:t.reduce((i,r)=>{var n,o,a,A,l,c,h;const u=(a=(o=(n=r==null?void 0:r.answer)==null?void 0:n.transcription)==null?void 0:o.language)==null?void 0:a.split("-")[0],d=(h=(c=(l=(A=r==null?void 0:r.answer)==null?void 0:A.transcription)==null?void 0:l.translation)==null?void 0:c.language)==null?void 0:h.split("-")[0];return u&&tn[u]&&!i.find(g=>g.value===u)&&i.push({value:u,label:tn[u]}),d&&tn[d]&&!i.find(g=>g.value===d)&&i.push({value:d,label:tn[d]}),i},[]))??[]}/**
150
150
  * @license
151
151
  * Copyright 2018 Google LLC
@@ -183,7 +183,7 @@ ${e}`,Ng=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Mg=Objec
183
183
  * @license
184
184
  * Copyright 2017 Google LLC
185
185
  * SPDX-License-Identifier: BSD-3-Clause
186
- */const Vh=(s,e,t)=>{const i=new Map;for(let r=e;r<=t;r++)i.set(s[r],r);return i},Jh=ls(class extends Js{constructor(s){if(super(s),s.type!==As.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const r=[],n=[];let o=0;for(const a of s)r[o]=i?i(a,o):o,n[o]=t(a,o),o++;return{values:n,keys:r}}render(s,e,t){return this.dt(s,e,t).values}update(s,[e,t,i]){const r=Qd(s),{values:n,keys:o}=this.dt(e,t,i);if(!Array.isArray(r))return this.ut=o,n;const a=this.ut??(this.ut=[]),A=[];let l,c,h=0,u=r.length-1,d=0,g=n.length-1;for(;h<=u&&d<=g;)if(r[h]===null)h++;else if(r[u]===null)u--;else if(a[h]===o[d])A[d]=Ki(r[h],n[d]),h++,d++;else if(a[u]===o[g])A[g]=Ki(r[u],n[g]),u--,g--;else if(a[h]===o[g])A[g]=Ki(r[h],n[g]),Vs(s,A[g+1],r[h]),h++,g--;else if(a[u]===o[d])A[d]=Ki(r[u],n[d]),Vs(s,r[h],r[u]),u--,d++;else if(l===void 0&&(l=Vh(o,d,g),c=Vh(a,h,u)),l.has(a[h]))if(l.has(a[u])){const f=c.get(o[d]),p=f!==void 0?r[f]:null;if(p===null){const v=Vs(s,r[h]);Ki(v,n[d]),A[d]=v}else A[d]=Ki(p,n[d]),Vs(s,r[h],p),r[f]=null;d++}else so(r[u]),u--;else so(r[h]),h++;for(;d<=g;){const f=Vs(s,A[g+1]);Ki(f,n[d]),A[d++]=f}for(;h<=u;){const f=r[h++];f!==null&&so(f)}return this.ut=o,Bd(s,A),$t}});var xt="top",Ot="bottom",Pt="right",Dt="left",xa="auto",cr=[xt,Ot,Pt,Dt],Ss="start",hr="end",KI="clippingParents",Wh="viewport",ur="popper",VI="reference",qh=cr.reduce(function(s,e){return s.concat([e+"-"+Ss,e+"-"+hr])},[]),jh=[].concat(cr,[xa]).reduce(function(s,e){return s.concat([e,e+"-"+Ss,e+"-"+hr])},[]),JI="beforeRead",WI="read",qI="afterRead",jI="beforeMain",XI="main",zI="afterMain",ZI="beforeWrite",em="write",tm="afterWrite",im=[JI,WI,qI,jI,XI,zI,ZI,em,tm];function oi(s){return s?(s.nodeName||"").toLowerCase():null}function Lt(s){if(s==null)return window;if(s.toString()!=="[object Window]"){var e=s.ownerDocument;return e&&e.defaultView||window}return s}function Zi(s){var e=Lt(s).Element;return s instanceof e||s instanceof Element}function Ut(s){var e=Lt(s).HTMLElement;return s instanceof e||s instanceof HTMLElement}function Da(s){if(typeof ShadowRoot>"u")return!1;var e=Lt(s).ShadowRoot;return s instanceof e||s instanceof ShadowRoot}function sm(s){var e=s.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},n=e.elements[t];!Ut(n)||!oi(n)||(Object.assign(n.style,i),Object.keys(r).forEach(function(o){var a=r[o];a===!1?n.removeAttribute(o):n.setAttribute(o,a===!0?"":a)}))})}function rm(s){var e=s.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],n=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=o.reduce(function(A,l){return A[l]="",A},{});!Ut(r)||!oi(r)||(Object.assign(r.style,a),Object.keys(n).forEach(function(A){r.removeAttribute(A)}))})}}const Xh={name:"applyStyles",enabled:!0,phase:"write",fn:sm,effect:rm,requires:["computeStyles"]};function ai(s){return s.split("-")[0]}var es=Math.max,Ln=Math.min,ws=Math.round;function Ta(){var s=navigator.userAgentData;return s!=null&&s.brands&&Array.isArray(s.brands)?s.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function zh(){return!/^((?!chrome|android).)*safari/i.test(Ta())}function Rs(s,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=s.getBoundingClientRect(),r=1,n=1;e&&Ut(s)&&(r=s.offsetWidth>0&&ws(i.width)/s.offsetWidth||1,n=s.offsetHeight>0&&ws(i.height)/s.offsetHeight||1);var o=Zi(s)?Lt(s):window,a=o.visualViewport,A=!zh()&&t,l=(i.left+(A&&a?a.offsetLeft:0))/r,c=(i.top+(A&&a?a.offsetTop:0))/n,h=i.width/r,u=i.height/n;return{width:h,height:u,top:c,right:l+h,bottom:c+u,left:l,x:l,y:c}}function La(s){var e=Rs(s),t=s.offsetWidth,i=s.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:s.offsetLeft,y:s.offsetTop,width:t,height:i}}function Zh(s,e){var t=e.getRootNode&&e.getRootNode();if(s.contains(e))return!0;if(t&&Da(t)){var i=e;do{if(i&&s.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Si(s){return Lt(s).getComputedStyle(s)}function nm(s){return["table","td","th"].indexOf(oi(s))>=0}function Mi(s){return((Zi(s)?s.ownerDocument:s.document)||window.document).documentElement}function _n(s){return oi(s)==="html"?s:s.assignedSlot||s.parentNode||(Da(s)?s.host:null)||Mi(s)}function eu(s){return!Ut(s)||Si(s).position==="fixed"?null:s.offsetParent}function om(s){var e=/firefox/i.test(Ta()),t=/Trident/i.test(Ta());if(t&&Ut(s)){var i=Si(s);if(i.position==="fixed")return null}var r=_n(s);for(Da(r)&&(r=r.host);Ut(r)&&["html","body"].indexOf(oi(r))<0;){var n=Si(r);if(n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].indexOf(n.willChange)!==-1||e&&n.willChange==="filter"||e&&n.filter&&n.filter!=="none")return r;r=r.parentNode}return null}function dr(s){for(var e=Lt(s),t=eu(s);t&&nm(t)&&Si(t).position==="static";)t=eu(t);return t&&(oi(t)==="html"||oi(t)==="body"&&Si(t).position==="static")?e:t||om(s)||e}function _a(s){return["top","bottom"].indexOf(s)>=0?"x":"y"}function gr(s,e,t){return es(s,Ln(e,t))}function am(s,e,t){var i=gr(s,e,t);return i>t?t:i}function tu(){return{top:0,right:0,bottom:0,left:0}}function iu(s){return Object.assign({},tu(),s)}function su(s,e){return e.reduce(function(t,i){return t[i]=s,t},{})}var Am=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,iu(typeof e!="number"?e:su(e,cr))};function lm(s){var e,t=s.state,i=s.name,r=s.options,n=t.elements.arrow,o=t.modifiersData.popperOffsets,a=ai(t.placement),A=_a(a),l=[Dt,Pt].indexOf(a)>=0,c=l?"height":"width";if(!(!n||!o)){var h=Am(r.padding,t),u=La(n),d=A==="y"?xt:Dt,g=A==="y"?Ot:Pt,f=t.rects.reference[c]+t.rects.reference[A]-o[A]-t.rects.popper[c],p=o[A]-t.rects.reference[A],v=dr(n),y=v?A==="y"?v.clientHeight||0:v.clientWidth||0:0,b=f/2-p/2,C=h[d],Q=y-u[c]-h[g],B=y/2-u[c]/2+b,_=gr(C,B,Q),D=A;t.modifiersData[i]=(e={},e[D]=_,e.centerOffset=_-B,e)}}function cm(s){var e=s.state,t=s.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||Zh(e.elements.popper,r)&&(e.elements.arrow=r))}const hm={name:"arrow",enabled:!0,phase:"main",fn:lm,effect:cm,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function xs(s){return s.split("-")[1]}var um={top:"auto",right:"auto",bottom:"auto",left:"auto"};function dm(s,e){var t=s.x,i=s.y,r=e.devicePixelRatio||1;return{x:ws(t*r)/r||0,y:ws(i*r)/r||0}}function ru(s){var e,t=s.popper,i=s.popperRect,r=s.placement,n=s.variation,o=s.offsets,a=s.position,A=s.gpuAcceleration,l=s.adaptive,c=s.roundOffsets,h=s.isFixed,u=o.x,d=u===void 0?0:u,g=o.y,f=g===void 0?0:g,p=typeof c=="function"?c({x:d,y:f}):{x:d,y:f};d=p.x,f=p.y;var v=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),b=Dt,C=xt,Q=window;if(l){var B=dr(t),_="clientHeight",D="clientWidth";if(B===Lt(t)&&(B=Mi(t),Si(B).position!=="static"&&a==="absolute"&&(_="scrollHeight",D="scrollWidth")),B=B,r===xt||(r===Dt||r===Pt)&&n===hr){C=Ot;var G=h&&B===Q&&Q.visualViewport?Q.visualViewport.height:B[_];f-=G-i.height,f*=A?1:-1}if(r===Dt||(r===xt||r===Ot)&&n===hr){b=Pt;var F=h&&B===Q&&Q.visualViewport?Q.visualViewport.width:B[D];d-=F-i.width,d*=A?1:-1}}var H=Object.assign({position:a},l&&um),X=c===!0?dm({x:d,y:f},Lt(t)):{x:d,y:f};if(d=X.x,f=X.y,A){var J;return Object.assign({},H,(J={},J[C]=y?"0":"",J[b]=v?"0":"",J.transform=(Q.devicePixelRatio||1)<=1?"translate("+d+"px, "+f+"px)":"translate3d("+d+"px, "+f+"px, 0)",J))}return Object.assign({},H,(e={},e[C]=y?f+"px":"",e[b]=v?d+"px":"",e.transform="",e))}function gm(s){var e=s.state,t=s.options,i=t.gpuAcceleration,r=i===void 0?!0:i,n=t.adaptive,o=n===void 0?!0:n,a=t.roundOffsets,A=a===void 0?!0:a,l={placement:ai(e.placement),variation:xs(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ru(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:A})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ru(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:A})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const fm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:gm,data:{}};var kn={passive:!0};function pm(s){var e=s.state,t=s.instance,i=s.options,r=i.scroll,n=r===void 0?!0:r,o=i.resize,a=o===void 0?!0:o,A=Lt(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return n&&l.forEach(function(c){c.addEventListener("scroll",t.update,kn)}),a&&A.addEventListener("resize",t.update,kn),function(){n&&l.forEach(function(c){c.removeEventListener("scroll",t.update,kn)}),a&&A.removeEventListener("resize",t.update,kn)}}const Em={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:pm,data:{}};var Im={left:"right",right:"left",bottom:"top",top:"bottom"};function Fn(s){return s.replace(/left|right|bottom|top/g,function(e){return Im[e]})}var mm={start:"end",end:"start"};function nu(s){return s.replace(/start|end/g,function(e){return mm[e]})}function ka(s){var e=Lt(s),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Fa(s){return Rs(Mi(s)).left+ka(s).scrollLeft}function Cm(s,e){var t=Lt(s),i=Mi(s),r=t.visualViewport,n=i.clientWidth,o=i.clientHeight,a=0,A=0;if(r){n=r.width,o=r.height;var l=zh();(l||!l&&e==="fixed")&&(a=r.offsetLeft,A=r.offsetTop)}return{width:n,height:o,x:a+Fa(s),y:A}}function vm(s){var e,t=Mi(s),i=ka(s),r=(e=s.ownerDocument)==null?void 0:e.body,n=es(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=es(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+Fa(s),A=-i.scrollTop;return Si(r||t).direction==="rtl"&&(a+=es(t.clientWidth,r?r.clientWidth:0)-n),{width:n,height:o,x:a,y:A}}function Na(s){var e=Si(s),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function ou(s){return["html","body","#document"].indexOf(oi(s))>=0?s.ownerDocument.body:Ut(s)&&Na(s)?s:ou(_n(s))}function fr(s,e){var t;e===void 0&&(e=[]);var i=ou(s),r=i===((t=s.ownerDocument)==null?void 0:t.body),n=Lt(i),o=r?[n].concat(n.visualViewport||[],Na(i)?i:[]):i,a=e.concat(o);return r?a:a.concat(fr(_n(o)))}function Ma(s){return Object.assign({},s,{left:s.x,top:s.y,right:s.x+s.width,bottom:s.y+s.height})}function ym(s,e){var t=Rs(s,!1,e==="fixed");return t.top=t.top+s.clientTop,t.left=t.left+s.clientLeft,t.bottom=t.top+s.clientHeight,t.right=t.left+s.clientWidth,t.width=s.clientWidth,t.height=s.clientHeight,t.x=t.left,t.y=t.top,t}function au(s,e,t){return e===Wh?Ma(Cm(s,t)):Zi(e)?ym(e,t):Ma(vm(Mi(s)))}function Bm(s){var e=fr(_n(s)),t=["absolute","fixed"].indexOf(Si(s).position)>=0,i=t&&Ut(s)?dr(s):s;return Zi(i)?e.filter(function(r){return Zi(r)&&Zh(r,i)&&oi(r)!=="body"}):[]}function Qm(s,e,t,i){var r=e==="clippingParents"?Bm(s):[].concat(e),n=[].concat(r,[t]),o=n[0],a=n.reduce(function(A,l){var c=au(s,l,i);return A.top=es(c.top,A.top),A.right=Ln(c.right,A.right),A.bottom=Ln(c.bottom,A.bottom),A.left=es(c.left,A.left),A},au(s,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Au(s){var e=s.reference,t=s.element,i=s.placement,r=i?ai(i):null,n=i?xs(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,A;switch(r){case xt:A={x:o,y:e.y-t.height};break;case Ot:A={x:o,y:e.y+e.height};break;case Pt:A={x:e.x+e.width,y:a};break;case Dt:A={x:e.x-t.width,y:a};break;default:A={x:e.x,y:e.y}}var l=r?_a(r):null;if(l!=null){var c=l==="y"?"height":"width";switch(n){case Ss:A[l]=A[l]-(e[c]/2-t[c]/2);break;case hr:A[l]=A[l]+(e[c]/2-t[c]/2);break}}return A}function pr(s,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?s.placement:i,n=t.strategy,o=n===void 0?s.strategy:n,a=t.boundary,A=a===void 0?KI:a,l=t.rootBoundary,c=l===void 0?Wh:l,h=t.elementContext,u=h===void 0?ur:h,d=t.altBoundary,g=d===void 0?!1:d,f=t.padding,p=f===void 0?0:f,v=iu(typeof p!="number"?p:su(p,cr)),y=u===ur?VI:ur,b=s.rects.popper,C=s.elements[g?y:u],Q=Qm(Zi(C)?C:C.contextElement||Mi(s.elements.popper),A,c,o),B=Rs(s.elements.reference),_=Au({reference:B,element:b,strategy:"absolute",placement:r}),D=Ma(Object.assign({},b,_)),G=u===ur?D:B,F={top:Q.top-G.top+v.top,bottom:G.bottom-Q.bottom+v.bottom,left:Q.left-G.left+v.left,right:G.right-Q.right+v.right},H=s.modifiersData.offset;if(u===ur&&H){var X=H[r];Object.keys(F).forEach(function(J){var W=[Pt,Ot].indexOf(J)>=0?1:-1,S=[xt,Ot].indexOf(J)>=0?"y":"x";F[J]+=X[S]*W})}return F}function bm(s,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,n=t.rootBoundary,o=t.padding,a=t.flipVariations,A=t.allowedAutoPlacements,l=A===void 0?jh:A,c=xs(i),h=c?a?qh:qh.filter(function(g){return xs(g)===c}):cr,u=h.filter(function(g){return l.indexOf(g)>=0});u.length===0&&(u=h);var d=u.reduce(function(g,f){return g[f]=pr(s,{placement:f,boundary:r,rootBoundary:n,padding:o})[ai(f)],g},{});return Object.keys(d).sort(function(g,f){return d[g]-d[f]})}function Sm(s){if(ai(s)===xa)return[];var e=Fn(s);return[nu(s),e,nu(e)]}function wm(s){var e=s.state,t=s.options,i=s.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,n=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!0:o,A=t.fallbackPlacements,l=t.padding,c=t.boundary,h=t.rootBoundary,u=t.altBoundary,d=t.flipVariations,g=d===void 0?!0:d,f=t.allowedAutoPlacements,p=e.options.placement,v=ai(p),y=v===p,b=A||(y||!g?[Fn(p)]:Sm(p)),C=[p].concat(b).reduce(function(ie,ce){return ie.concat(ai(ce)===xa?bm(e,{placement:ce,boundary:c,rootBoundary:h,padding:l,flipVariations:g,allowedAutoPlacements:f}):ce)},[]),Q=e.rects.reference,B=e.rects.popper,_=new Map,D=!0,G=C[0],F=0;F<C.length;F++){var H=C[F],X=ai(H),J=xs(H)===Ss,W=[xt,Ot].indexOf(X)>=0,S=W?"width":"height",R=pr(e,{placement:H,boundary:c,rootBoundary:h,altBoundary:u,padding:l}),U=W?J?Pt:Dt:J?Ot:xt;Q[S]>B[S]&&(U=Fn(U));var x=Fn(U),w=[];if(n&&w.push(R[X]<=0),a&&w.push(R[U]<=0,R[x]<=0),w.every(function(ie){return ie})){G=H,D=!1;break}_.set(H,w)}if(D)for(var T=g?3:1,K=function(ce){var Ae=C.find(function(me){var Be=_.get(me);if(Be)return Be.slice(0,ce).every(function(xe){return xe})});if(Ae)return G=Ae,"break"},M=T;M>0;M--){var j=K(M);if(j==="break")break}e.placement!==G&&(e.modifiersData[i]._skip=!0,e.placement=G,e.reset=!0)}}const Rm={name:"flip",enabled:!0,phase:"main",fn:wm,requiresIfExists:["offset"],data:{_skip:!1}};function lu(s,e,t){return t===void 0&&(t={x:0,y:0}),{top:s.top-e.height-t.y,right:s.right-e.width+t.x,bottom:s.bottom-e.height+t.y,left:s.left-e.width-t.x}}function cu(s){return[xt,Pt,Ot,Dt].some(function(e){return s[e]>=0})}function xm(s){var e=s.state,t=s.name,i=e.rects.reference,r=e.rects.popper,n=e.modifiersData.preventOverflow,o=pr(e,{elementContext:"reference"}),a=pr(e,{altBoundary:!0}),A=lu(o,i),l=lu(a,r,n),c=cu(A),h=cu(l);e.modifiersData[t]={referenceClippingOffsets:A,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}const Dm={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:xm};function Tm(s,e,t){var i=ai(s),r=[Dt,xt].indexOf(i)>=0?-1:1,n=typeof t=="function"?t(Object.assign({},e,{placement:s})):t,o=n[0],a=n[1];return o=o||0,a=(a||0)*r,[Dt,Pt].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function Lm(s){var e=s.state,t=s.options,i=s.name,r=t.offset,n=r===void 0?[0,0]:r,o=jh.reduce(function(c,h){return c[h]=Tm(h,e.rects,n),c},{}),a=o[e.placement],A=a.x,l=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=A,e.modifiersData.popperOffsets.y+=l),e.modifiersData[i]=o}const _m={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Lm};function km(s){var e=s.state,t=s.name;e.modifiersData[t]=Au({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Fm={name:"popperOffsets",enabled:!0,phase:"read",fn:km,data:{}};function Nm(s){return s==="x"?"y":"x"}function Mm(s){var e=s.state,t=s.options,i=s.name,r=t.mainAxis,n=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!1:o,A=t.boundary,l=t.rootBoundary,c=t.altBoundary,h=t.padding,u=t.tether,d=u===void 0?!0:u,g=t.tetherOffset,f=g===void 0?0:g,p=pr(e,{boundary:A,rootBoundary:l,padding:h,altBoundary:c}),v=ai(e.placement),y=xs(e.placement),b=!y,C=_a(v),Q=Nm(C),B=e.modifiersData.popperOffsets,_=e.rects.reference,D=e.rects.popper,G=typeof f=="function"?f(Object.assign({},e.rects,{placement:e.placement})):f,F=typeof G=="number"?{mainAxis:G,altAxis:G}:Object.assign({mainAxis:0,altAxis:0},G),H=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,X={x:0,y:0};if(B){if(n){var J,W=C==="y"?xt:Dt,S=C==="y"?Ot:Pt,R=C==="y"?"height":"width",U=B[C],x=U+p[W],w=U-p[S],T=d?-D[R]/2:0,K=y===Ss?_[R]:D[R],M=y===Ss?-D[R]:-_[R],j=e.elements.arrow,ie=d&&j?La(j):{width:0,height:0},ce=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:tu(),Ae=ce[W],me=ce[S],Be=gr(0,_[R],ie[R]),xe=b?_[R]/2-T-Be-Ae-F.mainAxis:K-Be-Ae-F.mainAxis,re=b?-_[R]/2+T+Be+me+F.mainAxis:M+Be+me+F.mainAxis,Ce=e.elements.arrow&&dr(e.elements.arrow),ve=Ce?C==="y"?Ce.clientTop||0:Ce.clientLeft||0:0,ue=(J=H==null?void 0:H[C])!=null?J:0,he=U+xe-ue-ve,ae=U+re-ue,we=gr(d?Ln(x,he):x,U,d?es(w,ae):w);B[C]=we,X[C]=we-U}if(a){var Pe,Te=C==="x"?xt:Dt,ke=C==="x"?Ot:Pt,Ue=B[Q],Le=Q==="y"?"height":"width",be=Ue+p[Te],Ke=Ue-p[ke],je=[xt,Dt].indexOf(v)!==-1,dt=(Pe=H==null?void 0:H[Q])!=null?Pe:0,rt=je?be:Ue-_[Le]-D[Le]-dt+F.altAxis,vt=je?Ue+_[Le]+D[Le]-dt-F.altAxis:Ke,wi=d&&je?am(rt,Ue,vt):gr(d?rt:be,Ue,d?vt:Ke);B[Q]=wi,X[Q]=wi-Ue}e.modifiersData[i]=X}}const Om={name:"preventOverflow",enabled:!0,phase:"main",fn:Mm,requiresIfExists:["offset"]};function Pm(s){return{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}}function Um(s){return s===Lt(s)||!Ut(s)?ka(s):Pm(s)}function Gm(s){var e=s.getBoundingClientRect(),t=ws(e.width)/s.offsetWidth||1,i=ws(e.height)/s.offsetHeight||1;return t!==1||i!==1}function Hm(s,e,t){t===void 0&&(t=!1);var i=Ut(e),r=Ut(e)&&Gm(e),n=Mi(e),o=Rs(s,r,t),a={scrollLeft:0,scrollTop:0},A={x:0,y:0};return(i||!i&&!t)&&((oi(e)!=="body"||Na(n))&&(a=Um(e)),Ut(e)?(A=Rs(e,!0),A.x+=e.clientLeft,A.y+=e.clientTop):n&&(A.x=Fa(n))),{x:o.left+a.scrollLeft-A.x,y:o.top+a.scrollTop-A.y,width:o.width,height:o.height}}function $m(s){var e=new Map,t=new Set,i=[];s.forEach(function(n){e.set(n.name,n)});function r(n){t.add(n.name);var o=[].concat(n.requires||[],n.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var A=e.get(a);A&&r(A)}}),i.push(n)}return s.forEach(function(n){t.has(n.name)||r(n)}),i}function Ym(s){var e=$m(s);return im.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function Km(s){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(s())})})),e}}function Vm(s){var e=s.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var hu={placement:"bottom",modifiers:[],strategy:"absolute"};function uu(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function Jm(s){s===void 0&&(s={});var e=s,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,n=r===void 0?hu:r;return function(a,A,l){l===void 0&&(l=n);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},hu,n),modifiersData:{},elements:{reference:a,popper:A},attributes:{},styles:{}},h=[],u=!1,d={state:c,setOptions:function(v){var y=typeof v=="function"?v(c.options):v;f(),c.options=Object.assign({},n,c.options,y),c.scrollParents={reference:Zi(a)?fr(a):a.contextElement?fr(a.contextElement):[],popper:fr(A)};var b=Ym(Vm([].concat(i,c.options.modifiers)));return c.orderedModifiers=b.filter(function(C){return C.enabled}),g(),d.update()},forceUpdate:function(){if(!u){var v=c.elements,y=v.reference,b=v.popper;if(uu(y,b)){c.rects={reference:Hm(y,dr(b),c.options.strategy==="fixed"),popper:La(b)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(F){return c.modifiersData[F.name]=Object.assign({},F.data)});for(var C=0;C<c.orderedModifiers.length;C++){if(c.reset===!0){c.reset=!1,C=-1;continue}var Q=c.orderedModifiers[C],B=Q.fn,_=Q.options,D=_===void 0?{}:_,G=Q.name;typeof B=="function"&&(c=B({state:c,options:D,name:G,instance:d})||c)}}}},update:Km(function(){return new Promise(function(p){d.forceUpdate(),p(c)})}),destroy:function(){f(),u=!0}};if(!uu(a,A))return d;d.setOptions(l).then(function(p){!u&&l.onFirstUpdate&&l.onFirstUpdate(p)});function g(){c.orderedModifiers.forEach(function(p){var v=p.name,y=p.options,b=y===void 0?{}:y,C=p.effect;if(typeof C=="function"){var Q=C({state:c,name:v,instance:d,options:b}),B=function(){};h.push(Q||B)}})}function f(){h.forEach(function(p){return p()}),h=[]}return d}}var Wm=[Em,Fm,fm,Xh,_m,Rm,Om,hm,Dm],qm=Jm({defaultModifiers:Wm}),jm="tippy-box",du="tippy-content",Xm="tippy-backdrop",gu="tippy-arrow",fu="tippy-svg-arrow",ts={passive:!0,capture:!0},pu=function(){return document.body};function Oa(s,e,t){if(Array.isArray(s)){var i=s[e];return i??(Array.isArray(t)?t[e]:t)}return s}function Pa(s,e){var t={}.toString.call(s);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function Eu(s,e){return typeof s=="function"?s.apply(void 0,e):s}function Iu(s,e){if(e===0)return s;var t;return function(i){clearTimeout(t),t=setTimeout(function(){s(i)},e)}}function zm(s){return s.split(/\s+/).filter(Boolean)}function Ds(s){return[].concat(s)}function mu(s,e){s.indexOf(e)===-1&&s.push(e)}function Zm(s){return s.filter(function(e,t){return s.indexOf(e)===t})}function eC(s){return s.split("-")[0]}function Nn(s){return[].slice.call(s)}function Cu(s){return Object.keys(s).reduce(function(e,t){return s[t]!==void 0&&(e[t]=s[t]),e},{})}function Er(){return document.createElement("div")}function Mn(s){return["Element","Fragment"].some(function(e){return Pa(s,e)})}function tC(s){return Pa(s,"NodeList")}function iC(s){return Pa(s,"MouseEvent")}function sC(s){return!!(s&&s._tippy&&s._tippy.reference===s)}function rC(s){return Mn(s)?[s]:tC(s)?Nn(s):Array.isArray(s)?s:Nn(document.querySelectorAll(s))}function Ua(s,e){s.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function vu(s,e){s.forEach(function(t){t&&t.setAttribute("data-state",e)})}function nC(s){var e,t=Ds(s),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function oC(s,e){var t=e.clientX,i=e.clientY;return s.every(function(r){var n=r.popperRect,o=r.popperState,a=r.props,A=a.interactiveBorder,l=eC(o.placement),c=o.modifiersData.offset;if(!c)return!0;var h=l==="bottom"?c.top.y:0,u=l==="top"?c.bottom.y:0,d=l==="right"?c.left.x:0,g=l==="left"?c.right.x:0,f=n.top-i+h>A,p=i-n.bottom-u>A,v=n.left-t+d>A,y=t-n.right-g>A;return f||p||v||y})}function Ga(s,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){s[i](r,t)})}function yu(s,e){for(var t=e;t;){var i;if(s.contains(t))return!0;t=t.getRootNode==null||(i=t.getRootNode())==null?void 0:i.host}return!1}var Ai={isTouch:!1},Bu=0;function aC(){Ai.isTouch||(Ai.isTouch=!0,window.performance&&document.addEventListener("mousemove",Qu))}function Qu(){var s=performance.now();s-Bu<20&&(Ai.isTouch=!1,document.removeEventListener("mousemove",Qu)),Bu=s}function AC(){var s=document.activeElement;if(sC(s)){var e=s._tippy;s.blur&&!e.state.isVisible&&s.blur()}}function lC(){document.addEventListener("touchstart",aC,ts),window.addEventListener("blur",AC)}var cC=typeof window<"u"&&typeof document<"u",hC=cC?!!window.msCrypto:!1,uC={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},dC={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Jt=Object.assign({appendTo:pu,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},uC,dC),gC=Object.keys(Jt),fC=function(e){var t=Object.keys(e);t.forEach(function(i){Jt[i]=e[i]})};function bu(s){var e=s.plugins||[],t=e.reduce(function(i,r){var n=r.name,o=r.defaultValue;if(n){var a;i[n]=s[n]!==void 0?s[n]:(a=Jt[n])!=null?a:o}return i},{});return Object.assign({},s,t)}function pC(s,e){var t=e?Object.keys(bu(Object.assign({},Jt,{plugins:e}))):gC,i=t.reduce(function(r,n){var o=(s.getAttribute("data-tippy-"+n)||"").trim();if(!o)return r;if(n==="content")r[n]=o;else try{r[n]=JSON.parse(o)}catch{r[n]=o}return r},{});return i}function Su(s,e){var t=Object.assign({},e,{content:Eu(e.content,[s])},e.ignoreAttributes?{}:pC(s,e.plugins));return t.aria=Object.assign({},Jt.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var EC=function(){return"innerHTML"};function Ha(s,e){s[EC()]=e}function wu(s){var e=Er();return s===!0?e.className=gu:(e.className=fu,Mn(s)?e.appendChild(s):Ha(e,s)),e}function Ru(s,e){Mn(e.content)?(Ha(s,""),s.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Ha(s,e.content):s.textContent=e.content)}function $a(s){var e=s.firstElementChild,t=Nn(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(du)}),arrow:t.find(function(i){return i.classList.contains(gu)||i.classList.contains(fu)}),backdrop:t.find(function(i){return i.classList.contains(Xm)})}}function xu(s){var e=Er(),t=Er();t.className=jm,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=Er();i.className=du,i.setAttribute("data-state","hidden"),Ru(i,s.props),e.appendChild(t),t.appendChild(i),r(s.props,s.props);function r(n,o){var a=$a(e),A=a.box,l=a.content,c=a.arrow;o.theme?A.setAttribute("data-theme",o.theme):A.removeAttribute("data-theme"),typeof o.animation=="string"?A.setAttribute("data-animation",o.animation):A.removeAttribute("data-animation"),o.inertia?A.setAttribute("data-inertia",""):A.removeAttribute("data-inertia"),A.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?A.setAttribute("role",o.role):A.removeAttribute("role"),(n.content!==o.content||n.allowHTML!==o.allowHTML)&&Ru(l,s.props),o.arrow?c?n.arrow!==o.arrow&&(A.removeChild(c),A.appendChild(wu(o.arrow))):A.appendChild(wu(o.arrow)):c&&A.removeChild(c)}return{popper:e,onUpdate:r}}xu.$$tippy=!0;var IC=1,On=[],Ya=[];function mC(s,e){var t=Su(s,Object.assign({},Jt,bu(Cu(e)))),i,r,n,o=!1,a=!1,A=!1,l=!1,c,h,u,d=[],g=Iu(he,t.interactiveDebounce),f,p=IC++,v=null,y=Zm(t.plugins),b={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:p,reference:s,popper:Er(),popperInstance:v,props:t,state:b,plugins:y,clearDelayTimeouts:rt,setProps:vt,setContent:wi,show:yt,hide:ui,hideWithInteractivity:di,enable:je,disable:dt,unmount:gi,destroy:It};if(!t.render)return C;var Q=t.render(C),B=Q.popper,_=Q.onUpdate;B.setAttribute("data-tippy-root",""),B.id="tippy-"+C.id,C.popper=B,s._tippy=C,B._tippy=C;var D=y.map(function(Y){return Y.fn(C)}),G=s.hasAttribute("aria-expanded");return Ce(),T(),U(),x("onCreate",[C]),t.showOnCreate&&be(),B.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),B.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&W().addEventListener("mousemove",g)}),C;function F(){var Y=C.props.touch;return Array.isArray(Y)?Y:[Y,0]}function H(){return F()[0]==="hold"}function X(){var Y;return!!((Y=C.props.render)!=null&&Y.$$tippy)}function J(){return f||s}function W(){var Y=J().parentNode;return Y?nC(Y):document}function S(){return $a(B)}function R(Y){return C.state.isMounted&&!C.state.isVisible||Ai.isTouch||c&&c.type==="focus"?0:Oa(C.props.delay,Y?0:1,Jt.delay)}function U(Y){Y===void 0&&(Y=!1),B.style.pointerEvents=C.props.interactive&&!Y?"":"none",B.style.zIndex=""+C.props.zIndex}function x(Y,le,ge){if(ge===void 0&&(ge=!0),D.forEach(function(Se){Se[Y]&&Se[Y].apply(Se,le)}),ge){var Re;(Re=C.props)[Y].apply(Re,le)}}function w(){var Y=C.props.aria;if(Y.content){var le="aria-"+Y.content,ge=B.id,Re=Ds(C.props.triggerTarget||s);Re.forEach(function(Se){var Ve=Se.getAttribute(le);if(C.state.isVisible)Se.setAttribute(le,Ve?Ve+" "+ge:ge);else{var Bt=Ve&&Ve.replace(ge,"").trim();Bt?Se.setAttribute(le,Bt):Se.removeAttribute(le)}})}}function T(){if(!(G||!C.props.aria.expanded)){var Y=Ds(C.props.triggerTarget||s);Y.forEach(function(le){C.props.interactive?le.setAttribute("aria-expanded",C.state.isVisible&&le===J()?"true":"false"):le.removeAttribute("aria-expanded")})}}function K(){W().removeEventListener("mousemove",g),On=On.filter(function(Y){return Y!==g})}function M(Y){if(!(Ai.isTouch&&(A||Y.type==="mousedown"))){var le=Y.composedPath&&Y.composedPath()[0]||Y.target;if(!(C.props.interactive&&yu(B,le))){if(Ds(C.props.triggerTarget||s).some(function(ge){return yu(ge,le)})){if(Ai.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else x("onClickOutside",[C,Y]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||Ae())}}}function j(){A=!0}function ie(){A=!1}function ce(){var Y=W();Y.addEventListener("mousedown",M,!0),Y.addEventListener("touchend",M,ts),Y.addEventListener("touchstart",ie,ts),Y.addEventListener("touchmove",j,ts)}function Ae(){var Y=W();Y.removeEventListener("mousedown",M,!0),Y.removeEventListener("touchend",M,ts),Y.removeEventListener("touchstart",ie,ts),Y.removeEventListener("touchmove",j,ts)}function me(Y,le){xe(Y,function(){!C.state.isVisible&&B.parentNode&&B.parentNode.contains(B)&&le()})}function Be(Y,le){xe(Y,le)}function xe(Y,le){var ge=S().box;function Re(Se){Se.target===ge&&(Ga(ge,"remove",Re),le())}if(Y===0)return le();Ga(ge,"remove",h),Ga(ge,"add",Re),h=Re}function re(Y,le,ge){ge===void 0&&(ge=!1);var Re=Ds(C.props.triggerTarget||s);Re.forEach(function(Se){Se.addEventListener(Y,le,ge),d.push({node:Se,eventType:Y,handler:le,options:ge})})}function Ce(){H()&&(re("touchstart",ue,{passive:!0}),re("touchend",ae,{passive:!0})),zm(C.props.trigger).forEach(function(Y){if(Y!=="manual")switch(re(Y,ue),Y){case"mouseenter":re("mouseleave",ae);break;case"focus":re(hC?"focusout":"blur",we);break;case"focusin":re("focusout",we);break}})}function ve(){d.forEach(function(Y){var le=Y.node,ge=Y.eventType,Re=Y.handler,Se=Y.options;le.removeEventListener(ge,Re,Se)}),d=[]}function ue(Y){var le,ge=!1;if(!(!C.state.isEnabled||Pe(Y)||a)){var Re=((le=c)==null?void 0:le.type)==="focus";c=Y,f=Y.currentTarget,T(),!C.state.isVisible&&iC(Y)&&On.forEach(function(Se){return Se(Y)}),Y.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||o)&&C.props.hideOnClick!==!1&&C.state.isVisible?ge=!0:be(Y),Y.type==="click"&&(o=!ge),ge&&!Re&&Ke(Y)}}function he(Y){var le=Y.target,ge=J().contains(le)||B.contains(le);if(!(Y.type==="mousemove"&&ge)){var Re=Le().concat(B).map(function(Se){var Ve,Bt=Se._tippy,Qt=(Ve=Bt.popperInstance)==null?void 0:Ve.state;return Qt?{popperRect:Se.getBoundingClientRect(),popperState:Qt,props:t}:null}).filter(Boolean);oC(Re,Y)&&(K(),Ke(Y))}}function ae(Y){var le=Pe(Y)||C.props.trigger.indexOf("click")>=0&&o;if(!le){if(C.props.interactive){C.hideWithInteractivity(Y);return}Ke(Y)}}function we(Y){C.props.trigger.indexOf("focusin")<0&&Y.target!==J()||C.props.interactive&&Y.relatedTarget&&B.contains(Y.relatedTarget)||Ke(Y)}function Pe(Y){return Ai.isTouch?H()!==Y.type.indexOf("touch")>=0:!1}function Te(){ke();var Y=C.props,le=Y.popperOptions,ge=Y.placement,Re=Y.offset,Se=Y.getReferenceClientRect,Ve=Y.moveTransition,Bt=X()?$a(B).arrow:null,Qt=Se?{getBoundingClientRect:Se,contextElement:Se.contextElement||J()}:s,Fs={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ns){var Ui=Ns.state;if(X()){var Br=S(),Qr=Br.box;["placement","reference-hidden","escaped"].forEach(function(Ms){Ms==="placement"?Qr.setAttribute("data-placement",Ui.placement):Ui.attributes.popper["data-popper-"+Ms]?Qr.setAttribute("data-"+Ms,""):Qr.removeAttribute("data-"+Ms)}),Ui.attributes.popper={}}}},bt=[{name:"offset",options:{offset:Re}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ve}},Fs];X()&&Bt&&bt.push({name:"arrow",options:{element:Bt,padding:3}}),bt.push.apply(bt,(le==null?void 0:le.modifiers)||[]),C.popperInstance=qm(Qt,B,Object.assign({},le,{placement:ge,onFirstUpdate:u,modifiers:bt}))}function ke(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function Ue(){var Y=C.props.appendTo,le,ge=J();C.props.interactive&&Y===pu||Y==="parent"?le=ge.parentNode:le=Eu(Y,[ge]),le.contains(B)||le.appendChild(B),C.state.isMounted=!0,Te()}function Le(){return Nn(B.querySelectorAll("[data-tippy-root]"))}function be(Y){C.clearDelayTimeouts(),Y&&x("onTrigger",[C,Y]),ce();var le=R(!0),ge=F(),Re=ge[0],Se=ge[1];Ai.isTouch&&Re==="hold"&&Se&&(le=Se),le?i=setTimeout(function(){C.show()},le):C.show()}function Ke(Y){if(C.clearDelayTimeouts(),x("onUntrigger",[C,Y]),!C.state.isVisible){Ae();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(Y.type)>=0&&o)){var le=R(!1);le?r=setTimeout(function(){C.state.isVisible&&C.hide()},le):n=requestAnimationFrame(function(){C.hide()})}}function je(){C.state.isEnabled=!0}function dt(){C.hide(),C.state.isEnabled=!1}function rt(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(n)}function vt(Y){if(!C.state.isDestroyed){x("onBeforeUpdate",[C,Y]),ve();var le=C.props,ge=Su(s,Object.assign({},le,Cu(Y),{ignoreAttributes:!0}));C.props=ge,Ce(),le.interactiveDebounce!==ge.interactiveDebounce&&(K(),g=Iu(he,ge.interactiveDebounce)),le.triggerTarget&&!ge.triggerTarget?Ds(le.triggerTarget).forEach(function(Re){Re.removeAttribute("aria-expanded")}):ge.triggerTarget&&s.removeAttribute("aria-expanded"),T(),U(),_&&_(le,ge),C.popperInstance&&(Te(),Le().forEach(function(Re){requestAnimationFrame(Re._tippy.popperInstance.forceUpdate)})),x("onAfterUpdate",[C,Y])}}function wi(Y){C.setProps({content:Y})}function yt(){var Y=C.state.isVisible,le=C.state.isDestroyed,ge=!C.state.isEnabled,Re=Ai.isTouch&&!C.props.touch,Se=Oa(C.props.duration,0,Jt.duration);if(!(Y||le||ge||Re)&&!J().hasAttribute("disabled")&&(x("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,X()&&(B.style.visibility="visible"),U(),ce(),C.state.isMounted||(B.style.transition="none"),X()){var Ve=S(),Bt=Ve.box,Qt=Ve.content;Ua([Bt,Qt],0)}u=function(){var bt;if(!(!C.state.isVisible||l)){if(l=!0,B.offsetHeight,B.style.transition=C.props.moveTransition,X()&&C.props.animation){var ns=S(),Ns=ns.box,Ui=ns.content;Ua([Ns,Ui],Se),vu([Ns,Ui],"visible")}w(),T(),mu(Ya,C),(bt=C.popperInstance)==null||bt.forceUpdate(),x("onMount",[C]),C.props.animation&&X()&&Be(Se,function(){C.state.isShown=!0,x("onShown",[C])})}},Ue()}}function ui(){var Y=!C.state.isVisible,le=C.state.isDestroyed,ge=!C.state.isEnabled,Re=Oa(C.props.duration,1,Jt.duration);if(!(Y||le||ge)&&(x("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,l=!1,o=!1,X()&&(B.style.visibility="hidden"),K(),Ae(),U(!0),X()){var Se=S(),Ve=Se.box,Bt=Se.content;C.props.animation&&(Ua([Ve,Bt],Re),vu([Ve,Bt],"hidden"))}w(),T(),C.props.animation?X()&&me(Re,C.unmount):C.unmount()}}function di(Y){W().addEventListener("mousemove",g),mu(On,g),g(Y)}function gi(){C.state.isVisible&&C.hide(),C.state.isMounted&&(ke(),Le().forEach(function(Y){Y._tippy.unmount()}),B.parentNode&&B.parentNode.removeChild(B),Ya=Ya.filter(function(Y){return Y!==C}),C.state.isMounted=!1,x("onHidden",[C]))}function It(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),ve(),delete s._tippy,C.state.isDestroyed=!0,x("onDestroy",[C]))}}function is(s,e){e===void 0&&(e={});var t=Jt.plugins.concat(e.plugins||[]);lC();var i=Object.assign({},e,{plugins:t}),r=rC(s),n=r.reduce(function(o,a){var A=a&&mC(a,i);return A&&o.push(A),o},[]);return Mn(s)?n[0]:n}is.defaultProps=Jt,is.setDefaultProps=fC,is.currentInput=Ai,Object.assign({},Xh,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),is.setDefaultProps({render:xu});class li extends Error{constructor(e,t=new Error,i=!1){super(),this.fatal=!1,this.fatal=i,this.stack=t.stack,this.message=[e,t.message].filter(Boolean).join(" - ")}}const CC=5;class vC{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._canvas=ft(),this._controls=ft(),this.host=e}set activeScenes(e){if(e!==this._activeScenes){const t=e[0],i=this._activeScenes[0];this._activeScenes=e,t!==i&&(this.host.dispatchEvent(new CustomEvent("scenechange",{detail:e[0]})),this.host.requestUpdate())}}get activeScenes(){return this._activeScenes}set currentTime(e){var t,i,r,n,o;const a=Math.min(this.host.duration,Math.max(0,e));this._currentTime=a,this.activeScenes=((t=this.host.scenes)==null?void 0:t.filter(({start:c,duration:h})=>a>=c&&a<c+h))??[],this._upcomingScenes=((i=this.host.scenes)==null?void 0:i.filter(({start:c})=>a>=c-CC&&a<c))??[],this.loadScenes(),this.syncVideoState(),(r=this._controls.value)==null||r.setAttribute("currentTime",a.toString());const A=this.activeScenes[0],l=Sl((n=A==null?void 0:A.videoMeta)==null?void 0:n.captions);this.caption=((o=l.find(({start:c,end:h})=>{var u;const d=a-A.start+(((u=A.videoMeta)==null?void 0:u.start)??0);return c&&h&&d>=zr(c)&&d<=zr(h)}))==null?void 0:o.text)??"",this.draw(a),!this.host.paused&&!this.host.loading&&!this.host.processing&&!this.host.waiting&&this.host.dispatchEvent(new CustomEvent("timeupdate",{detail:a}))}get currentTime(){return this._currentTime}set caption(e){e!==this._caption&&(this._caption=e,this.host.requestUpdate())}get caption(){return this._caption}canvas(){return pt(this._canvas)}controls(){return pt(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{var t,i,r;const{start:n,duration:o,video:a,videoMeta:A}=e,l=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused;if(a&&A){const{key:c,hls:h,node:u}=a,{start:d,duration:g}=A,f=this.host.videoState[c];u&&f&&(u.currentTime>=d+g||u.ended||l&&(h?(t=h.startLoadOnce)==null||t.call(h,u.currentTime):f.initialised||(i=u.startLoadOnce)==null||i.call(u)))}else if(l){const c=`${n}-${o}`,h=this.host._sceneController.videoState[c];this.host.duration&&!((r=h==null?void 0:h.buffered)!=null&&r.length)&&(this.host._sceneController.videoState={...this.host._sceneController.videoState,[c]:{...h,buffered:[{start:Math.max(0,n/this.host.duration*100),end:Math.min((n+o)/this.host.duration*100,100)}]}})}})}syncVideoState(){var e;(e=this.host.scenes)==null||e.forEach(t=>{if(t.video){const{key:i,node:r}=t.video,n=this.host.videoState[i],o=this.activeScenes.includes(t);if(r&&n)if(o&&!this.host.waiting&&!this.host.loading&&!this.host.paused){if(r.paused&&n.initialised)try{return r.play()}catch(a){throw new li("Video play error",a,!0)}}else r.paused||r.pause()}})}draw(e=this.currentTime){var t,i;this.host.sceneConfig&&this._canvas.value&&((i=(t=this.host).compilation)==null||i.call(t,{currentTime:e,scenes:this.host.sceneConfig,canvas:this._canvas.value}))}clear(){var e;const t=this._canvas.value;(e=t==null?void 0:t.getContext("2d"))==null||e.clearRect(0,0,t.width,t.height)}}function yC(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function BC(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Ka(s){const{id:e,key:t,src:i,playlist:r,duration:n}=s;return new Promise(o=>{let a=null;const A=document.createElement("video");if(A.playsInline=!0,A.muted=!0,A.loop=!1,r&&!yC()&&bi.isSupported()){let l=!1;a=new bi({autoStartLoad:!0,progressive:!0,fetchSetup:(c,h)=>{let u=c.url;const d=r.split("?")[1];if(u.toString().includes("?")||(u+="?"+d),!l&&u.includes(".ts")){const g=new AbortController,f=g.signal;return g.abort(),new Request(u,{...h,signal:f})}return new Request(u,h)}}),a.on(bi.Events.LEVEL_LOADED,async()=>{l||a==null||a.stopLoad(),o({id:e,key:t,hls:a,config:s,node:A})}),a.loadSource(r),a.attachMedia(A),a.startLoadOnce=(c=-1,h)=>{if(a&&!l){const u=a==null?void 0:a.levels.findIndex(d=>Math.min(d.height,d.width)===h);l=!0,a.startLevel=a.firstLevel,a.startLoad(c),a.currentLevel=u!==-1?u:a.firstLevel}}}else{A.src=i;let l=!1;if(A.startLoadOnce=()=>{l||(A.preload="auto",A.load(),l=!0)},n)A.preload="none",o({id:e,key:t,hls:a,config:s,node:A});else{A.preload="metadata";const c=async()=>{o({id:e,key:t,hls:a,config:s,node:A}),A.removeEventListener("loadedmetadata",c)};A.addEventListener("loadedmetadata",c)}}})}async function Du(s){return s.duration===1/0?new Promise(e=>{s.currentTime=Number.MAX_SAFE_INTEGER,s.ontimeupdate=()=>{s.ontimeupdate=null,e(s.duration),s.currentTime=0}}):s.duration}const QC=Ii(async function(e){return new FontFace(e.name,`url(${e.woff2??e.url})`,{style:e.style,weight:e.weight}).load()},{cacheKey:([s])=>JSON.stringify(s)});let bC=class{constructor(e){this._hasPlayed=!1,this._memoKey=null,this._lastDeps=null,this._duration=0,this._scenes=null,this._videos={},this._videoMeta={},this._videoState={},this._delayProcessing=(t=100)=>{const i=new AbortController,r=setTimeout(()=>{i.signal.aborted||(this.host._processing=!0)},t);return i.signal.addEventListener("abort",()=>{clearTimeout(r)}),i},this._createDataResolver=t=>i=>this.host.dataResolver(i,{language:t}),this._resolveVideo=Ii(async t=>{const{id:i,key:r}=t,n=await Ka(t);n.node.volume=this.host.volume,n.node.playbackRate=this.host.playbackRate;const o={loadeddata:this._handleLoadedData,waiting:this._handleWaiting,canplay:this._handleCanPlay,progress:this._handleProgress,seeking:this._handleSeeking,seeked:this._handleSeeked,play:this._handlePlay,playing:this._handlePlaying,pause:this._handlePause,stalled:this._handleStalled,timeupdate:this._handleTimeUpdate,ended:this._handleEnded,error:this._handleError},a=Object.keys(o).reduce((A,l)=>{const c=l,h=o[c]({id:i,key:r,node:n.node});return A[c]=h,n.node.addEventListener(l,h),A},{});return{...n,listeners:a}},{cacheKey:([{id:t,key:i,src:r,playlist:n}])=>JSON.stringify({id:t,key:i,src:r==null?void 0:r.split("?")[0],playlist:n==null?void 0:n.split("?")[0]})}),this._resolveVideoMeta=Ii(async(t,i)=>{const{id:r,captions:n,duration:o,startOffset:a,endOffset:A}=t,l=o??await Du(i),c=(a??0)*l,h=(1-(A??0))*l;return{id:r,captions:n,start:c,duration:h-c}},{cacheKey:([{id:t,key:i,captions:r,duration:n,startOffset:o,endOffset:a}])=>JSON.stringify({id:t,key:i,captions:r,duration:n,startOffset:o,endOffset:a})}),this._handleLoadedData=({id:t,key:i,node:r})=>()=>{var n,o;const a=this.videoState[i];if(!(a!=null&&a.initialised)){this.videoState={...this.videoState,[i]:{...a,initialised:!0,waiting:!1,buffered:(a==null?void 0:a.buffered)??[]}};const A=(o=(n=this.scenes)==null?void 0:n.scenes)==null?void 0:o.find(({video:l})=>{l==null||l.key});A&&this._setVideoCurrentTime({scene:A,time:this.host.currentTime}),this.host.dispatchEvent(new CustomEvent("video:loadeddata",{detail:{id:t,key:i,node:r}}))}},this._handleWaiting=({key:t})=>()=>{const i=this.videoState[t];i!=null&&i.initialised&&!(i!=null&&i.waiting)&&(this.videoState={...this.videoState,[t]:{...i,waiting:!0}})},this._handleCanPlay=({key:t})=>()=>{const i=this.videoState[t];i!=null&&i.initialised&&(i!=null&&i.waiting)&&(this.videoState={...this.videoState,[t]:{...i,waiting:!1}}),this.host.paused&&this.host.draw()},this._handleProgress=({key:t,node:i})=>()=>{const r=this.videoState[t],n=this._getBufferSegments({key:t,node:i,duration:this.host.duration});this.videoState={...this.videoState,[t]:{...r,buffered:n}}},this._handleSeeking=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:seeking",{detail:{id:t,key:i,node:r}}))},this._handleSeeked=({id:t,key:i,node:r})=>()=>{const n=this.videoState[i];n!=null&&n.initialised&&(this.host.draw(),this.host.dispatchEvent(new CustomEvent("video:seeked",{detail:{id:t,key:i,node:r}})))},this._handlePlay=({id:t,key:i,node:r})=>()=>{this.hasPlayed=!0,this.host.dispatchEvent(new CustomEvent("video:play",{detail:{id:t,key:i,node:r}}))},this._handlePlaying=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:playing",{detail:{id:t,key:i,node:r}}))},this._handlePause=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:pause",{detail:{id:t,key:i,node:r}}))},this._handleStalled=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:stalled",{detail:{id:t,key:i,node:r}}))},this._handleTimeUpdate=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:timeupdate",{detail:{id:t,key:i,node:r}}))},this._handleEnded=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:ended",{detail:{id:t,key:i,node:r}}))},this._handleError=({id:t,key:i,node:r})=>()=>{const n=new li(`Video error - answer ${t} failed to load`);this.host.dispatchEvent(new ErrorEvent("error",{bubbles:!0,composed:!0,error:n,message:n.message})),this.host.dispatchEvent(new CustomEvent("video:error",{detail:{id:t,key:i,node:r}}))},this._cleanupVideo=t=>{var i;const r=this.videos[t];r&&(r.node.pause(),r.node.src="",(i=r.hls)==null||i.destroy(),Object.keys(r.listeners??{}).forEach(n=>{var o,a;if((o=this.videos)!=null&&o[t]){const A=(a=r.listeners)==null?void 0:a[n];A&&r.node.removeEventListener(n,A)}}),delete this.videos[t])},this.host=e,this.host.addController(this)}set hasPlayed(e){e!==this._hasPlayed&&(this._hasPlayed=e,this.host.requestUpdate())}get hasPlayed(){return this._hasPlayed}set duration(e){!isNaN(e)&&e!==this._duration&&(this._duration=e,this.host.requestUpdate(),this.host.dispatchEvent(new CustomEvent("durationchange",{detail:this._duration})))}get duration(){return this._duration}set scenes(e){e!==this._scenes&&(this._scenes=e,this.host.requestUpdate())}get scenes(){return this._scenes}set videos(e){e!==this._videos&&(this._videos=e,this.host.requestUpdate())}get videos(){return this._videos}set videoMeta(e){e!==this._videoMeta&&(this._videoMeta=e,this.host.requestUpdate())}get videoMeta(){return this._videoMeta}set videoState(e){e!==this._videoState&&(this._videoState=e,this.host.requestUpdate())}get videoState(){return this._videoState}_getBufferSegments({key:e,node:t,duration:i}){var r;const n=t==null?void 0:t.buffered,o=[],{start:a,video:A,videoMeta:l}=((r=this.scenes)==null?void 0:r.scenes.find(({video:c})=>e===(c==null?void 0:c.key)))??{};if(t&&n&&A&&l&&typeof a<"u")for(let c=0;c<n.length;c++){const h=n.start(c),u=n.end(c);Math.max(h,l.start)<=Math.min(u,l.start+l.duration)&&o.push({start:Math.max(0,(Math.max(h-l.start,0)+a)/i*100),end:Math.min((Math.min(u-l.start,l.duration)+a)/i*100,100)})}return o}_setupTask(){new Lr(this.host,async([e,t,i,r,n,o,a])=>{var A;const l=this._delayProcessing();try{let c=null;if(this.host._errors=[],this.host._languages=this.host.languageResolver({data:e}),(!n||!this.host._languages.find(({value:h})=>n===h))&&(this.host._language=(A=this.host._languages[0])==null?void 0:A.value),i||e){if(i){let d=null;if(r)try{d=await(await fetch(r,{method:"GET"})).text()}catch(p){const v=new li("Track failed to fetch",p);this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:v,message:v.message}))}const f={questions:{items:[{answer:{id:"source",media:{[i.includes(".m3u8")?"playlist":"video"]:i},captions:{current:d}}}]}};try{this.scenes=await hs({data:f,template:t,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(p){try{this.scenes=await hs({data:f,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(v){throw new li("Fatal source template error",v,!0)}c=new li("Source template error",p)}}else try{this.scenes=await hs({data:e,template:t,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(d){try{this.scenes=await hs({data:e,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(g){throw new li("Fatal data template error",g,!0)}c=new li("Data template error",d)}Object.keys(this.videos).forEach(d=>{this.scenes.scenes.find(({video:g})=>d===(g==null?void 0:g.key))||this._videos[d].node.pause()});const h=this.scenes.scenes.reduce((d,{video:g})=>(g&&(d[g.key]=g),d),{});Object.keys(this.videos).join("|")!==Object.keys(h).join("|")&&this.host.reset(0,!1),this.videos=h,this.videoState={...this.videoState,...this.scenes.scenes.reduce((d,{video:g,start:f,duration:p})=>{var v;const y=(g==null?void 0:g.key)??`${f}-${p}`,b=this._getBufferSegments({key:y,node:g==null?void 0:g.node,duration:this.scenes.duration});return d[y]={initialised:!g,waiting:!!g,...this.videoState[y],buffered:g?b:(v=this.videoState[y])==null?void 0:v.buffered},d},{})},this.videoMeta=this.scenes.scenes.reduce((d,{video:g,videoMeta:f})=>(g&&f&&(d[g.key]=f),d),{}),(await Promise.all(this.scenes.fonts.map(d=>QC(d)))).forEach(d=>{document.fonts.add(d)}),this.duration=this.scenes.duration,this.host.paused&&this.host.reset(this.host.currentTime,!this.host.paused)}c&&this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:c,message:c.message}))}catch(c){this.scenes=null,this.duration=0,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:c,message:c.message}))}finally{l.abort(),this.host._processing=!1}},()=>{const e=JSON.stringify({data:this.host.data,template:this.host.template,src:this.host.src,track:this.host.track,language:this.host.language,burnCaptions:this.host.burnCaptions,debug:this.host.debug});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.data,this.host.template,this.host.src,this.host.track,this.host.language,this.host.burnCaptions,this.host.debug];return this._memoKey=e,this._lastDeps=t,t})}_setVideoCurrentTime({time:e,scene:t}){const{start:i,video:r,videoMeta:n}=t;if(r&&r.node&&n&&typeof i<"u"){const o=e-i;r.node.currentTime=Math.max(n.start,Math.min(n.start+n.duration,o+n.start))}}setVideosCurrentTime(e){var t;(t=this.scenes)==null||t.scenes.forEach(i=>{this._setVideoCurrentTime({time:e,scene:i})})}hostConnected(){this._setupTask()}hostDisconnected(){Object.keys(this.videos).forEach(e=>{this._cleanupVideo(e)}),this.videos={}}};function SC(s){s.requestFullscreen?s.requestFullscreen():s.mozRequestFullScreen?s.mozRequestFullScreen():s.webkitRequestFullscreen?s.webkitRequestFullscreen():s.msRequestFullscreen&&s.msRequestFullscreen()}function wC(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const Va=["progress","play-large","navigation","play","volume","current-time","duration","speed","captions","fullscreen","preview"],RC={id:"captions",event:"captions:click",label:"Closed Captions"},xC={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},Tu={title:"Playback Speed",items:[{id:"playback-rate-0.5",event:"playbackRate:click",label:"0.5x",value:.5},{id:"playback-rate-1",event:"playbackRate:click",label:"1.0x",value:1},{id:"playback-rate-1.5",event:"playbackRate:click",label:"1.5x",value:1.5},{id:"playback-rate-2",event:"playbackRate:click",label:"2.0x",value:2}]},DC={id:"playbackRate",label:"Playback playbackRate",subItems:Tu};class TC extends NA{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==As.ELEMENT)throw new Error("Resize directive must be used in an Element expression")}disconnected(){var e;(e=this.observer)==null||e.disconnect(),this.observer=void 0}reconnected(){var e;this.element&&((e=this.observer)==null||e.observe(this.element))}update(e,[t]){return this.isConnected&&!this.observer&&(this.observer=new ResizeObserver(t),this.element=e.element,this.observer.observe(this.element)),$t}}const Ja=ls(TC),LC=YI(()=>{const s=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),e=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-SemiBold.woff2)",{style:"normal",weight:"600"}),t=new FontFace("Roobert Captions","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),i=yl.map(r=>({load:!1,font:new FontFace(r.family,`url(${r.url})`,{style:r.style})}));return[{load:!0,font:s},{load:!0,font:e},{load:!0,font:t},...i]}),ci={"red-120":"#feeded","red-130":"#fcd5d0","red-400":"#e84a4a","red-500":"#c51c3a","red-700":"#a21c39","red-800":"#850231","red-900":"#580A2D","teal-80":"#f3fafa","teal-100":"#d6f1f1","teal-200":"#ace3e3","teal-300":"#7acace","teal-400":"#4faab2","teal-500":"#358f97","teal-600":"#287179","teal-700":"#22555c","teal-800":"#21484e","teal-900":"#1f3d42","teal-950":"#0d2126","purple-100":"#d7cfff","purple-700":"#5f2fe9","green-200":"#a4d7aa","green-500":"#38b319","green-800":"#2b3c2f","grey-100":"#f0f0f0","light-50":"rgba(255, 255, 255, .05)","light-100":"rgba(255, 255, 255, .1)","light-200":"rgba(255, 255, 255, .2)","light-400":"rgba(255, 255, 255, .4)","light-500":"rgba(255, 255, 255, .5)","light-640":"rgba(255, 255, 255, .64)","light-800":"rgba(255, 255, 255, .8)","light-1000":"#fff","dark-50":"rgba(0, 0, 0, .05)","dark-80":"rgba(0, 0, 0, .08)","dark-100":"rgba(0, 0, 0, .1)","dark-200":"rgba(0, 0, 0, .2)","dark-250":"rgba(0, 0, 0, .25)","dark-400":"rgba(0, 0, 0, .4)","dark-500":"rgba(0, 0, 0, .5)","dark-640":"rgba(0, 0, 0, .64)","dark-800":"rgba(0, 0, 0, .8)","dark-900":"rgba(0, 0, 0, .9)","dark-1000":"#000"},_C={colors:ci,space:{xxs:".25rem",xs:".5rem",small:".75rem",medium:"1rem",large:"1.5rem",xl:"2.5rem"},sizes:{xxs:"1rem",xs:"1.5rem",small:"2rem",medium:"2.5rem",large:"3rem"},fontWeights:{regular:400,semibold:600},lineHeights:{small:1.1,medium:1.25,large:1.4},letterSpacings:{xxs:"-.04rem",xs:"-.03rem",small:"-.02rem",medium:"-.01rem",large:0},fontSizes:{micro:".625rem",small:".75rem",medium:".875rem",large:"1rem",xl:"1.25rem",xxl:"1.5rem",xxxl:"2rem",huge:"2.75rem"},fontFamilies:{sans:'Roobert, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,"Noto Sans", "Noto Color Emoji", sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji"',mono:'"Maison Neue Mono", Menlo, Monaco, Consolas, Liberation Mono, "Courier New", monospace'},borderWidths:{thin:".0625rem"},radii:{small:".25rem",medium:".5rem",large:".75rem",xl:"1rem"},shadows:{small:`.25rem .25rem .25rem ${ci["dark-100"]}`,medium:`0 .125rem .625rem ${ci["dark-100"]}`,large:`0 .25rem 1rem ${ci["dark-50"]}`,xl:`.25rem .25rem 1rem ${ci["dark-250"]}`,xxl:`0 .25rem 2rem ${ci["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${ci["dark-250"]}`,toolbar:`0 -.625rem .625rem ${ci["dark-50"]}`,text:`0 0 .25rem ${ci["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:ci["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},Lu=GI(_C,{delimiter:"-"}),kC=Object.keys(Lu).map(s=>Os(`:host { --${s}: ${Lu[s]}; }`)),Ne=(s=>{const e=class extends s{firstUpdated(){LC().forEach(({load:n,font:o})=>{document.fonts.add(o),n&&o.load()})}};return e.styles=[(s==null?void 0:s.styles)??[],kC,ot`
186
+ */const Vh=(s,e,t)=>{const i=new Map;for(let r=e;r<=t;r++)i.set(s[r],r);return i},Jh=ls(class extends Js{constructor(s){if(super(s),s.type!==As.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const r=[],n=[];let o=0;for(const a of s)r[o]=i?i(a,o):o,n[o]=t(a,o),o++;return{values:n,keys:r}}render(s,e,t){return this.dt(s,e,t).values}update(s,[e,t,i]){const r=Qd(s),{values:n,keys:o}=this.dt(e,t,i);if(!Array.isArray(r))return this.ut=o,n;const a=this.ut??(this.ut=[]),A=[];let l,c,h=0,u=r.length-1,d=0,g=n.length-1;for(;h<=u&&d<=g;)if(r[h]===null)h++;else if(r[u]===null)u--;else if(a[h]===o[d])A[d]=Ki(r[h],n[d]),h++,d++;else if(a[u]===o[g])A[g]=Ki(r[u],n[g]),u--,g--;else if(a[h]===o[g])A[g]=Ki(r[h],n[g]),Vs(s,A[g+1],r[h]),h++,g--;else if(a[u]===o[d])A[d]=Ki(r[u],n[d]),Vs(s,r[h],r[u]),u--,d++;else if(l===void 0&&(l=Vh(o,d,g),c=Vh(a,h,u)),l.has(a[h]))if(l.has(a[u])){const f=c.get(o[d]),p=f!==void 0?r[f]:null;if(p===null){const v=Vs(s,r[h]);Ki(v,n[d]),A[d]=v}else A[d]=Ki(p,n[d]),Vs(s,r[h],p),r[f]=null;d++}else so(r[u]),u--;else so(r[h]),h++;for(;d<=g;){const f=Vs(s,A[g+1]);Ki(f,n[d]),A[d++]=f}for(;h<=u;){const f=r[h++];f!==null&&so(f)}return this.ut=o,Bd(s,A),$t}});var xt="top",Ot="bottom",Pt="right",Dt="left",xa="auto",cr=[xt,Ot,Pt,Dt],Ss="start",hr="end",KI="clippingParents",Wh="viewport",ur="popper",VI="reference",qh=cr.reduce(function(s,e){return s.concat([e+"-"+Ss,e+"-"+hr])},[]),jh=[].concat(cr,[xa]).reduce(function(s,e){return s.concat([e,e+"-"+Ss,e+"-"+hr])},[]),JI="beforeRead",WI="read",qI="afterRead",jI="beforeMain",XI="main",zI="afterMain",ZI="beforeWrite",em="write",tm="afterWrite",im=[JI,WI,qI,jI,XI,zI,ZI,em,tm];function oi(s){return s?(s.nodeName||"").toLowerCase():null}function Lt(s){if(s==null)return window;if(s.toString()!=="[object Window]"){var e=s.ownerDocument;return e&&e.defaultView||window}return s}function Zi(s){var e=Lt(s).Element;return s instanceof e||s instanceof Element}function Ut(s){var e=Lt(s).HTMLElement;return s instanceof e||s instanceof HTMLElement}function Da(s){if(typeof ShadowRoot>"u")return!1;var e=Lt(s).ShadowRoot;return s instanceof e||s instanceof ShadowRoot}function sm(s){var e=s.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},n=e.elements[t];!Ut(n)||!oi(n)||(Object.assign(n.style,i),Object.keys(r).forEach(function(o){var a=r[o];a===!1?n.removeAttribute(o):n.setAttribute(o,a===!0?"":a)}))})}function rm(s){var e=s.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],n=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=o.reduce(function(A,l){return A[l]="",A},{});!Ut(r)||!oi(r)||(Object.assign(r.style,a),Object.keys(n).forEach(function(A){r.removeAttribute(A)}))})}}const Xh={name:"applyStyles",enabled:!0,phase:"write",fn:sm,effect:rm,requires:["computeStyles"]};function ai(s){return s.split("-")[0]}var es=Math.max,Ln=Math.min,ws=Math.round;function Ta(){var s=navigator.userAgentData;return s!=null&&s.brands&&Array.isArray(s.brands)?s.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function zh(){return!/^((?!chrome|android).)*safari/i.test(Ta())}function Rs(s,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=s.getBoundingClientRect(),r=1,n=1;e&&Ut(s)&&(r=s.offsetWidth>0&&ws(i.width)/s.offsetWidth||1,n=s.offsetHeight>0&&ws(i.height)/s.offsetHeight||1);var o=Zi(s)?Lt(s):window,a=o.visualViewport,A=!zh()&&t,l=(i.left+(A&&a?a.offsetLeft:0))/r,c=(i.top+(A&&a?a.offsetTop:0))/n,h=i.width/r,u=i.height/n;return{width:h,height:u,top:c,right:l+h,bottom:c+u,left:l,x:l,y:c}}function La(s){var e=Rs(s),t=s.offsetWidth,i=s.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:s.offsetLeft,y:s.offsetTop,width:t,height:i}}function Zh(s,e){var t=e.getRootNode&&e.getRootNode();if(s.contains(e))return!0;if(t&&Da(t)){var i=e;do{if(i&&s.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Si(s){return Lt(s).getComputedStyle(s)}function nm(s){return["table","td","th"].indexOf(oi(s))>=0}function Mi(s){return((Zi(s)?s.ownerDocument:s.document)||window.document).documentElement}function _n(s){return oi(s)==="html"?s:s.assignedSlot||s.parentNode||(Da(s)?s.host:null)||Mi(s)}function eu(s){return!Ut(s)||Si(s).position==="fixed"?null:s.offsetParent}function om(s){var e=/firefox/i.test(Ta()),t=/Trident/i.test(Ta());if(t&&Ut(s)){var i=Si(s);if(i.position==="fixed")return null}var r=_n(s);for(Da(r)&&(r=r.host);Ut(r)&&["html","body"].indexOf(oi(r))<0;){var n=Si(r);if(n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].indexOf(n.willChange)!==-1||e&&n.willChange==="filter"||e&&n.filter&&n.filter!=="none")return r;r=r.parentNode}return null}function dr(s){for(var e=Lt(s),t=eu(s);t&&nm(t)&&Si(t).position==="static";)t=eu(t);return t&&(oi(t)==="html"||oi(t)==="body"&&Si(t).position==="static")?e:t||om(s)||e}function _a(s){return["top","bottom"].indexOf(s)>=0?"x":"y"}function gr(s,e,t){return es(s,Ln(e,t))}function am(s,e,t){var i=gr(s,e,t);return i>t?t:i}function tu(){return{top:0,right:0,bottom:0,left:0}}function iu(s){return Object.assign({},tu(),s)}function su(s,e){return e.reduce(function(t,i){return t[i]=s,t},{})}var Am=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,iu(typeof e!="number"?e:su(e,cr))};function lm(s){var e,t=s.state,i=s.name,r=s.options,n=t.elements.arrow,o=t.modifiersData.popperOffsets,a=ai(t.placement),A=_a(a),l=[Dt,Pt].indexOf(a)>=0,c=l?"height":"width";if(!(!n||!o)){var h=Am(r.padding,t),u=La(n),d=A==="y"?xt:Dt,g=A==="y"?Ot:Pt,f=t.rects.reference[c]+t.rects.reference[A]-o[A]-t.rects.popper[c],p=o[A]-t.rects.reference[A],v=dr(n),y=v?A==="y"?v.clientHeight||0:v.clientWidth||0:0,b=f/2-p/2,C=h[d],Q=y-u[c]-h[g],B=y/2-u[c]/2+b,_=gr(C,B,Q),D=A;t.modifiersData[i]=(e={},e[D]=_,e.centerOffset=_-B,e)}}function cm(s){var e=s.state,t=s.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||Zh(e.elements.popper,r)&&(e.elements.arrow=r))}const hm={name:"arrow",enabled:!0,phase:"main",fn:lm,effect:cm,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function xs(s){return s.split("-")[1]}var um={top:"auto",right:"auto",bottom:"auto",left:"auto"};function dm(s,e){var t=s.x,i=s.y,r=e.devicePixelRatio||1;return{x:ws(t*r)/r||0,y:ws(i*r)/r||0}}function ru(s){var e,t=s.popper,i=s.popperRect,r=s.placement,n=s.variation,o=s.offsets,a=s.position,A=s.gpuAcceleration,l=s.adaptive,c=s.roundOffsets,h=s.isFixed,u=o.x,d=u===void 0?0:u,g=o.y,f=g===void 0?0:g,p=typeof c=="function"?c({x:d,y:f}):{x:d,y:f};d=p.x,f=p.y;var v=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),b=Dt,C=xt,Q=window;if(l){var B=dr(t),_="clientHeight",D="clientWidth";if(B===Lt(t)&&(B=Mi(t),Si(B).position!=="static"&&a==="absolute"&&(_="scrollHeight",D="scrollWidth")),B=B,r===xt||(r===Dt||r===Pt)&&n===hr){C=Ot;var G=h&&B===Q&&Q.visualViewport?Q.visualViewport.height:B[_];f-=G-i.height,f*=A?1:-1}if(r===Dt||(r===xt||r===Ot)&&n===hr){b=Pt;var F=h&&B===Q&&Q.visualViewport?Q.visualViewport.width:B[D];d-=F-i.width,d*=A?1:-1}}var H=Object.assign({position:a},l&&um),X=c===!0?dm({x:d,y:f},Lt(t)):{x:d,y:f};if(d=X.x,f=X.y,A){var J;return Object.assign({},H,(J={},J[C]=y?"0":"",J[b]=v?"0":"",J.transform=(Q.devicePixelRatio||1)<=1?"translate("+d+"px, "+f+"px)":"translate3d("+d+"px, "+f+"px, 0)",J))}return Object.assign({},H,(e={},e[C]=y?f+"px":"",e[b]=v?d+"px":"",e.transform="",e))}function gm(s){var e=s.state,t=s.options,i=t.gpuAcceleration,r=i===void 0?!0:i,n=t.adaptive,o=n===void 0?!0:n,a=t.roundOffsets,A=a===void 0?!0:a,l={placement:ai(e.placement),variation:xs(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ru(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:A})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ru(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:A})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const fm={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:gm,data:{}};var kn={passive:!0};function pm(s){var e=s.state,t=s.instance,i=s.options,r=i.scroll,n=r===void 0?!0:r,o=i.resize,a=o===void 0?!0:o,A=Lt(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return n&&l.forEach(function(c){c.addEventListener("scroll",t.update,kn)}),a&&A.addEventListener("resize",t.update,kn),function(){n&&l.forEach(function(c){c.removeEventListener("scroll",t.update,kn)}),a&&A.removeEventListener("resize",t.update,kn)}}const Em={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:pm,data:{}};var Im={left:"right",right:"left",bottom:"top",top:"bottom"};function Fn(s){return s.replace(/left|right|bottom|top/g,function(e){return Im[e]})}var mm={start:"end",end:"start"};function nu(s){return s.replace(/start|end/g,function(e){return mm[e]})}function ka(s){var e=Lt(s),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Fa(s){return Rs(Mi(s)).left+ka(s).scrollLeft}function Cm(s,e){var t=Lt(s),i=Mi(s),r=t.visualViewport,n=i.clientWidth,o=i.clientHeight,a=0,A=0;if(r){n=r.width,o=r.height;var l=zh();(l||!l&&e==="fixed")&&(a=r.offsetLeft,A=r.offsetTop)}return{width:n,height:o,x:a+Fa(s),y:A}}function vm(s){var e,t=Mi(s),i=ka(s),r=(e=s.ownerDocument)==null?void 0:e.body,n=es(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=es(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+Fa(s),A=-i.scrollTop;return Si(r||t).direction==="rtl"&&(a+=es(t.clientWidth,r?r.clientWidth:0)-n),{width:n,height:o,x:a,y:A}}function Na(s){var e=Si(s),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function ou(s){return["html","body","#document"].indexOf(oi(s))>=0?s.ownerDocument.body:Ut(s)&&Na(s)?s:ou(_n(s))}function fr(s,e){var t;e===void 0&&(e=[]);var i=ou(s),r=i===((t=s.ownerDocument)==null?void 0:t.body),n=Lt(i),o=r?[n].concat(n.visualViewport||[],Na(i)?i:[]):i,a=e.concat(o);return r?a:a.concat(fr(_n(o)))}function Ma(s){return Object.assign({},s,{left:s.x,top:s.y,right:s.x+s.width,bottom:s.y+s.height})}function ym(s,e){var t=Rs(s,!1,e==="fixed");return t.top=t.top+s.clientTop,t.left=t.left+s.clientLeft,t.bottom=t.top+s.clientHeight,t.right=t.left+s.clientWidth,t.width=s.clientWidth,t.height=s.clientHeight,t.x=t.left,t.y=t.top,t}function au(s,e,t){return e===Wh?Ma(Cm(s,t)):Zi(e)?ym(e,t):Ma(vm(Mi(s)))}function Bm(s){var e=fr(_n(s)),t=["absolute","fixed"].indexOf(Si(s).position)>=0,i=t&&Ut(s)?dr(s):s;return Zi(i)?e.filter(function(r){return Zi(r)&&Zh(r,i)&&oi(r)!=="body"}):[]}function Qm(s,e,t,i){var r=e==="clippingParents"?Bm(s):[].concat(e),n=[].concat(r,[t]),o=n[0],a=n.reduce(function(A,l){var c=au(s,l,i);return A.top=es(c.top,A.top),A.right=Ln(c.right,A.right),A.bottom=Ln(c.bottom,A.bottom),A.left=es(c.left,A.left),A},au(s,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Au(s){var e=s.reference,t=s.element,i=s.placement,r=i?ai(i):null,n=i?xs(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,A;switch(r){case xt:A={x:o,y:e.y-t.height};break;case Ot:A={x:o,y:e.y+e.height};break;case Pt:A={x:e.x+e.width,y:a};break;case Dt:A={x:e.x-t.width,y:a};break;default:A={x:e.x,y:e.y}}var l=r?_a(r):null;if(l!=null){var c=l==="y"?"height":"width";switch(n){case Ss:A[l]=A[l]-(e[c]/2-t[c]/2);break;case hr:A[l]=A[l]+(e[c]/2-t[c]/2);break}}return A}function pr(s,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?s.placement:i,n=t.strategy,o=n===void 0?s.strategy:n,a=t.boundary,A=a===void 0?KI:a,l=t.rootBoundary,c=l===void 0?Wh:l,h=t.elementContext,u=h===void 0?ur:h,d=t.altBoundary,g=d===void 0?!1:d,f=t.padding,p=f===void 0?0:f,v=iu(typeof p!="number"?p:su(p,cr)),y=u===ur?VI:ur,b=s.rects.popper,C=s.elements[g?y:u],Q=Qm(Zi(C)?C:C.contextElement||Mi(s.elements.popper),A,c,o),B=Rs(s.elements.reference),_=Au({reference:B,element:b,strategy:"absolute",placement:r}),D=Ma(Object.assign({},b,_)),G=u===ur?D:B,F={top:Q.top-G.top+v.top,bottom:G.bottom-Q.bottom+v.bottom,left:Q.left-G.left+v.left,right:G.right-Q.right+v.right},H=s.modifiersData.offset;if(u===ur&&H){var X=H[r];Object.keys(F).forEach(function(J){var W=[Pt,Ot].indexOf(J)>=0?1:-1,S=[xt,Ot].indexOf(J)>=0?"y":"x";F[J]+=X[S]*W})}return F}function bm(s,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,n=t.rootBoundary,o=t.padding,a=t.flipVariations,A=t.allowedAutoPlacements,l=A===void 0?jh:A,c=xs(i),h=c?a?qh:qh.filter(function(g){return xs(g)===c}):cr,u=h.filter(function(g){return l.indexOf(g)>=0});u.length===0&&(u=h);var d=u.reduce(function(g,f){return g[f]=pr(s,{placement:f,boundary:r,rootBoundary:n,padding:o})[ai(f)],g},{});return Object.keys(d).sort(function(g,f){return d[g]-d[f]})}function Sm(s){if(ai(s)===xa)return[];var e=Fn(s);return[nu(s),e,nu(e)]}function wm(s){var e=s.state,t=s.options,i=s.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,n=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!0:o,A=t.fallbackPlacements,l=t.padding,c=t.boundary,h=t.rootBoundary,u=t.altBoundary,d=t.flipVariations,g=d===void 0?!0:d,f=t.allowedAutoPlacements,p=e.options.placement,v=ai(p),y=v===p,b=A||(y||!g?[Fn(p)]:Sm(p)),C=[p].concat(b).reduce(function(ie,ce){return ie.concat(ai(ce)===xa?bm(e,{placement:ce,boundary:c,rootBoundary:h,padding:l,flipVariations:g,allowedAutoPlacements:f}):ce)},[]),Q=e.rects.reference,B=e.rects.popper,_=new Map,D=!0,G=C[0],F=0;F<C.length;F++){var H=C[F],X=ai(H),J=xs(H)===Ss,W=[xt,Ot].indexOf(X)>=0,S=W?"width":"height",R=pr(e,{placement:H,boundary:c,rootBoundary:h,altBoundary:u,padding:l}),U=W?J?Pt:Dt:J?Ot:xt;Q[S]>B[S]&&(U=Fn(U));var x=Fn(U),w=[];if(n&&w.push(R[X]<=0),a&&w.push(R[U]<=0,R[x]<=0),w.every(function(ie){return ie})){G=H,D=!1;break}_.set(H,w)}if(D)for(var T=g?3:1,K=function(ce){var Ae=C.find(function(me){var Be=_.get(me);if(Be)return Be.slice(0,ce).every(function(xe){return xe})});if(Ae)return G=Ae,"break"},M=T;M>0;M--){var j=K(M);if(j==="break")break}e.placement!==G&&(e.modifiersData[i]._skip=!0,e.placement=G,e.reset=!0)}}const Rm={name:"flip",enabled:!0,phase:"main",fn:wm,requiresIfExists:["offset"],data:{_skip:!1}};function lu(s,e,t){return t===void 0&&(t={x:0,y:0}),{top:s.top-e.height-t.y,right:s.right-e.width+t.x,bottom:s.bottom-e.height+t.y,left:s.left-e.width-t.x}}function cu(s){return[xt,Pt,Ot,Dt].some(function(e){return s[e]>=0})}function xm(s){var e=s.state,t=s.name,i=e.rects.reference,r=e.rects.popper,n=e.modifiersData.preventOverflow,o=pr(e,{elementContext:"reference"}),a=pr(e,{altBoundary:!0}),A=lu(o,i),l=lu(a,r,n),c=cu(A),h=cu(l);e.modifiersData[t]={referenceClippingOffsets:A,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}const Dm={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:xm};function Tm(s,e,t){var i=ai(s),r=[Dt,xt].indexOf(i)>=0?-1:1,n=typeof t=="function"?t(Object.assign({},e,{placement:s})):t,o=n[0],a=n[1];return o=o||0,a=(a||0)*r,[Dt,Pt].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function Lm(s){var e=s.state,t=s.options,i=s.name,r=t.offset,n=r===void 0?[0,0]:r,o=jh.reduce(function(c,h){return c[h]=Tm(h,e.rects,n),c},{}),a=o[e.placement],A=a.x,l=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=A,e.modifiersData.popperOffsets.y+=l),e.modifiersData[i]=o}const _m={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Lm};function km(s){var e=s.state,t=s.name;e.modifiersData[t]=Au({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Fm={name:"popperOffsets",enabled:!0,phase:"read",fn:km,data:{}};function Nm(s){return s==="x"?"y":"x"}function Mm(s){var e=s.state,t=s.options,i=s.name,r=t.mainAxis,n=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!1:o,A=t.boundary,l=t.rootBoundary,c=t.altBoundary,h=t.padding,u=t.tether,d=u===void 0?!0:u,g=t.tetherOffset,f=g===void 0?0:g,p=pr(e,{boundary:A,rootBoundary:l,padding:h,altBoundary:c}),v=ai(e.placement),y=xs(e.placement),b=!y,C=_a(v),Q=Nm(C),B=e.modifiersData.popperOffsets,_=e.rects.reference,D=e.rects.popper,G=typeof f=="function"?f(Object.assign({},e.rects,{placement:e.placement})):f,F=typeof G=="number"?{mainAxis:G,altAxis:G}:Object.assign({mainAxis:0,altAxis:0},G),H=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,X={x:0,y:0};if(B){if(n){var J,W=C==="y"?xt:Dt,S=C==="y"?Ot:Pt,R=C==="y"?"height":"width",U=B[C],x=U+p[W],w=U-p[S],T=d?-D[R]/2:0,K=y===Ss?_[R]:D[R],M=y===Ss?-D[R]:-_[R],j=e.elements.arrow,ie=d&&j?La(j):{width:0,height:0},ce=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:tu(),Ae=ce[W],me=ce[S],Be=gr(0,_[R],ie[R]),xe=b?_[R]/2-T-Be-Ae-F.mainAxis:K-Be-Ae-F.mainAxis,re=b?-_[R]/2+T+Be+me+F.mainAxis:M+Be+me+F.mainAxis,Ce=e.elements.arrow&&dr(e.elements.arrow),ve=Ce?C==="y"?Ce.clientTop||0:Ce.clientLeft||0:0,ue=(J=H==null?void 0:H[C])!=null?J:0,he=U+xe-ue-ve,ae=U+re-ue,we=gr(d?Ln(x,he):x,U,d?es(w,ae):w);B[C]=we,X[C]=we-U}if(a){var Pe,Te=C==="x"?xt:Dt,ke=C==="x"?Ot:Pt,Ue=B[Q],Le=Q==="y"?"height":"width",be=Ue+p[Te],Ke=Ue-p[ke],je=[xt,Dt].indexOf(v)!==-1,dt=(Pe=H==null?void 0:H[Q])!=null?Pe:0,rt=je?be:Ue-_[Le]-D[Le]-dt+F.altAxis,vt=je?Ue+_[Le]+D[Le]-dt-F.altAxis:Ke,wi=d&&je?am(rt,Ue,vt):gr(d?rt:be,Ue,d?vt:Ke);B[Q]=wi,X[Q]=wi-Ue}e.modifiersData[i]=X}}const Om={name:"preventOverflow",enabled:!0,phase:"main",fn:Mm,requiresIfExists:["offset"]};function Pm(s){return{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}}function Um(s){return s===Lt(s)||!Ut(s)?ka(s):Pm(s)}function Gm(s){var e=s.getBoundingClientRect(),t=ws(e.width)/s.offsetWidth||1,i=ws(e.height)/s.offsetHeight||1;return t!==1||i!==1}function Hm(s,e,t){t===void 0&&(t=!1);var i=Ut(e),r=Ut(e)&&Gm(e),n=Mi(e),o=Rs(s,r,t),a={scrollLeft:0,scrollTop:0},A={x:0,y:0};return(i||!i&&!t)&&((oi(e)!=="body"||Na(n))&&(a=Um(e)),Ut(e)?(A=Rs(e,!0),A.x+=e.clientLeft,A.y+=e.clientTop):n&&(A.x=Fa(n))),{x:o.left+a.scrollLeft-A.x,y:o.top+a.scrollTop-A.y,width:o.width,height:o.height}}function $m(s){var e=new Map,t=new Set,i=[];s.forEach(function(n){e.set(n.name,n)});function r(n){t.add(n.name);var o=[].concat(n.requires||[],n.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var A=e.get(a);A&&r(A)}}),i.push(n)}return s.forEach(function(n){t.has(n.name)||r(n)}),i}function Ym(s){var e=$m(s);return im.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function Km(s){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(s())})})),e}}function Vm(s){var e=s.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var hu={placement:"bottom",modifiers:[],strategy:"absolute"};function uu(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function Jm(s){s===void 0&&(s={});var e=s,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,n=r===void 0?hu:r;return function(a,A,l){l===void 0&&(l=n);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},hu,n),modifiersData:{},elements:{reference:a,popper:A},attributes:{},styles:{}},h=[],u=!1,d={state:c,setOptions:function(v){var y=typeof v=="function"?v(c.options):v;f(),c.options=Object.assign({},n,c.options,y),c.scrollParents={reference:Zi(a)?fr(a):a.contextElement?fr(a.contextElement):[],popper:fr(A)};var b=Ym(Vm([].concat(i,c.options.modifiers)));return c.orderedModifiers=b.filter(function(C){return C.enabled}),g(),d.update()},forceUpdate:function(){if(!u){var v=c.elements,y=v.reference,b=v.popper;if(uu(y,b)){c.rects={reference:Hm(y,dr(b),c.options.strategy==="fixed"),popper:La(b)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(F){return c.modifiersData[F.name]=Object.assign({},F.data)});for(var C=0;C<c.orderedModifiers.length;C++){if(c.reset===!0){c.reset=!1,C=-1;continue}var Q=c.orderedModifiers[C],B=Q.fn,_=Q.options,D=_===void 0?{}:_,G=Q.name;typeof B=="function"&&(c=B({state:c,options:D,name:G,instance:d})||c)}}}},update:Km(function(){return new Promise(function(p){d.forceUpdate(),p(c)})}),destroy:function(){f(),u=!0}};if(!uu(a,A))return d;d.setOptions(l).then(function(p){!u&&l.onFirstUpdate&&l.onFirstUpdate(p)});function g(){c.orderedModifiers.forEach(function(p){var v=p.name,y=p.options,b=y===void 0?{}:y,C=p.effect;if(typeof C=="function"){var Q=C({state:c,name:v,instance:d,options:b}),B=function(){};h.push(Q||B)}})}function f(){h.forEach(function(p){return p()}),h=[]}return d}}var Wm=[Em,Fm,fm,Xh,_m,Rm,Om,hm,Dm],qm=Jm({defaultModifiers:Wm}),jm="tippy-box",du="tippy-content",Xm="tippy-backdrop",gu="tippy-arrow",fu="tippy-svg-arrow",ts={passive:!0,capture:!0},pu=function(){return document.body};function Oa(s,e,t){if(Array.isArray(s)){var i=s[e];return i??(Array.isArray(t)?t[e]:t)}return s}function Pa(s,e){var t={}.toString.call(s);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function Eu(s,e){return typeof s=="function"?s.apply(void 0,e):s}function Iu(s,e){if(e===0)return s;var t;return function(i){clearTimeout(t),t=setTimeout(function(){s(i)},e)}}function zm(s){return s.split(/\s+/).filter(Boolean)}function Ds(s){return[].concat(s)}function mu(s,e){s.indexOf(e)===-1&&s.push(e)}function Zm(s){return s.filter(function(e,t){return s.indexOf(e)===t})}function eC(s){return s.split("-")[0]}function Nn(s){return[].slice.call(s)}function Cu(s){return Object.keys(s).reduce(function(e,t){return s[t]!==void 0&&(e[t]=s[t]),e},{})}function Er(){return document.createElement("div")}function Mn(s){return["Element","Fragment"].some(function(e){return Pa(s,e)})}function tC(s){return Pa(s,"NodeList")}function iC(s){return Pa(s,"MouseEvent")}function sC(s){return!!(s&&s._tippy&&s._tippy.reference===s)}function rC(s){return Mn(s)?[s]:tC(s)?Nn(s):Array.isArray(s)?s:Nn(document.querySelectorAll(s))}function Ua(s,e){s.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function vu(s,e){s.forEach(function(t){t&&t.setAttribute("data-state",e)})}function nC(s){var e,t=Ds(s),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function oC(s,e){var t=e.clientX,i=e.clientY;return s.every(function(r){var n=r.popperRect,o=r.popperState,a=r.props,A=a.interactiveBorder,l=eC(o.placement),c=o.modifiersData.offset;if(!c)return!0;var h=l==="bottom"?c.top.y:0,u=l==="top"?c.bottom.y:0,d=l==="right"?c.left.x:0,g=l==="left"?c.right.x:0,f=n.top-i+h>A,p=i-n.bottom-u>A,v=n.left-t+d>A,y=t-n.right-g>A;return f||p||v||y})}function Ga(s,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){s[i](r,t)})}function yu(s,e){for(var t=e;t;){var i;if(s.contains(t))return!0;t=t.getRootNode==null||(i=t.getRootNode())==null?void 0:i.host}return!1}var Ai={isTouch:!1},Bu=0;function aC(){Ai.isTouch||(Ai.isTouch=!0,window.performance&&document.addEventListener("mousemove",Qu))}function Qu(){var s=performance.now();s-Bu<20&&(Ai.isTouch=!1,document.removeEventListener("mousemove",Qu)),Bu=s}function AC(){var s=document.activeElement;if(sC(s)){var e=s._tippy;s.blur&&!e.state.isVisible&&s.blur()}}function lC(){document.addEventListener("touchstart",aC,ts),window.addEventListener("blur",AC)}var cC=typeof window<"u"&&typeof document<"u",hC=cC?!!window.msCrypto:!1,uC={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},dC={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Jt=Object.assign({appendTo:pu,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},uC,dC),gC=Object.keys(Jt),fC=function(e){var t=Object.keys(e);t.forEach(function(i){Jt[i]=e[i]})};function bu(s){var e=s.plugins||[],t=e.reduce(function(i,r){var n=r.name,o=r.defaultValue;if(n){var a;i[n]=s[n]!==void 0?s[n]:(a=Jt[n])!=null?a:o}return i},{});return Object.assign({},s,t)}function pC(s,e){var t=e?Object.keys(bu(Object.assign({},Jt,{plugins:e}))):gC,i=t.reduce(function(r,n){var o=(s.getAttribute("data-tippy-"+n)||"").trim();if(!o)return r;if(n==="content")r[n]=o;else try{r[n]=JSON.parse(o)}catch{r[n]=o}return r},{});return i}function Su(s,e){var t=Object.assign({},e,{content:Eu(e.content,[s])},e.ignoreAttributes?{}:pC(s,e.plugins));return t.aria=Object.assign({},Jt.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var EC=function(){return"innerHTML"};function Ha(s,e){s[EC()]=e}function wu(s){var e=Er();return s===!0?e.className=gu:(e.className=fu,Mn(s)?e.appendChild(s):Ha(e,s)),e}function Ru(s,e){Mn(e.content)?(Ha(s,""),s.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Ha(s,e.content):s.textContent=e.content)}function $a(s){var e=s.firstElementChild,t=Nn(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(du)}),arrow:t.find(function(i){return i.classList.contains(gu)||i.classList.contains(fu)}),backdrop:t.find(function(i){return i.classList.contains(Xm)})}}function xu(s){var e=Er(),t=Er();t.className=jm,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=Er();i.className=du,i.setAttribute("data-state","hidden"),Ru(i,s.props),e.appendChild(t),t.appendChild(i),r(s.props,s.props);function r(n,o){var a=$a(e),A=a.box,l=a.content,c=a.arrow;o.theme?A.setAttribute("data-theme",o.theme):A.removeAttribute("data-theme"),typeof o.animation=="string"?A.setAttribute("data-animation",o.animation):A.removeAttribute("data-animation"),o.inertia?A.setAttribute("data-inertia",""):A.removeAttribute("data-inertia"),A.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?A.setAttribute("role",o.role):A.removeAttribute("role"),(n.content!==o.content||n.allowHTML!==o.allowHTML)&&Ru(l,s.props),o.arrow?c?n.arrow!==o.arrow&&(A.removeChild(c),A.appendChild(wu(o.arrow))):A.appendChild(wu(o.arrow)):c&&A.removeChild(c)}return{popper:e,onUpdate:r}}xu.$$tippy=!0;var IC=1,On=[],Ya=[];function mC(s,e){var t=Su(s,Object.assign({},Jt,bu(Cu(e)))),i,r,n,o=!1,a=!1,A=!1,l=!1,c,h,u,d=[],g=Iu(he,t.interactiveDebounce),f,p=IC++,v=null,y=Zm(t.plugins),b={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:p,reference:s,popper:Er(),popperInstance:v,props:t,state:b,plugins:y,clearDelayTimeouts:rt,setProps:vt,setContent:wi,show:yt,hide:ui,hideWithInteractivity:di,enable:je,disable:dt,unmount:gi,destroy:It};if(!t.render)return C;var Q=t.render(C),B=Q.popper,_=Q.onUpdate;B.setAttribute("data-tippy-root",""),B.id="tippy-"+C.id,C.popper=B,s._tippy=C,B._tippy=C;var D=y.map(function(Y){return Y.fn(C)}),G=s.hasAttribute("aria-expanded");return Ce(),T(),U(),x("onCreate",[C]),t.showOnCreate&&be(),B.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),B.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&W().addEventListener("mousemove",g)}),C;function F(){var Y=C.props.touch;return Array.isArray(Y)?Y:[Y,0]}function H(){return F()[0]==="hold"}function X(){var Y;return!!((Y=C.props.render)!=null&&Y.$$tippy)}function J(){return f||s}function W(){var Y=J().parentNode;return Y?nC(Y):document}function S(){return $a(B)}function R(Y){return C.state.isMounted&&!C.state.isVisible||Ai.isTouch||c&&c.type==="focus"?0:Oa(C.props.delay,Y?0:1,Jt.delay)}function U(Y){Y===void 0&&(Y=!1),B.style.pointerEvents=C.props.interactive&&!Y?"":"none",B.style.zIndex=""+C.props.zIndex}function x(Y,le,ge){if(ge===void 0&&(ge=!0),D.forEach(function(Se){Se[Y]&&Se[Y].apply(Se,le)}),ge){var Re;(Re=C.props)[Y].apply(Re,le)}}function w(){var Y=C.props.aria;if(Y.content){var le="aria-"+Y.content,ge=B.id,Re=Ds(C.props.triggerTarget||s);Re.forEach(function(Se){var Ve=Se.getAttribute(le);if(C.state.isVisible)Se.setAttribute(le,Ve?Ve+" "+ge:ge);else{var Bt=Ve&&Ve.replace(ge,"").trim();Bt?Se.setAttribute(le,Bt):Se.removeAttribute(le)}})}}function T(){if(!(G||!C.props.aria.expanded)){var Y=Ds(C.props.triggerTarget||s);Y.forEach(function(le){C.props.interactive?le.setAttribute("aria-expanded",C.state.isVisible&&le===J()?"true":"false"):le.removeAttribute("aria-expanded")})}}function K(){W().removeEventListener("mousemove",g),On=On.filter(function(Y){return Y!==g})}function M(Y){if(!(Ai.isTouch&&(A||Y.type==="mousedown"))){var le=Y.composedPath&&Y.composedPath()[0]||Y.target;if(!(C.props.interactive&&yu(B,le))){if(Ds(C.props.triggerTarget||s).some(function(ge){return yu(ge,le)})){if(Ai.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else x("onClickOutside",[C,Y]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||Ae())}}}function j(){A=!0}function ie(){A=!1}function ce(){var Y=W();Y.addEventListener("mousedown",M,!0),Y.addEventListener("touchend",M,ts),Y.addEventListener("touchstart",ie,ts),Y.addEventListener("touchmove",j,ts)}function Ae(){var Y=W();Y.removeEventListener("mousedown",M,!0),Y.removeEventListener("touchend",M,ts),Y.removeEventListener("touchstart",ie,ts),Y.removeEventListener("touchmove",j,ts)}function me(Y,le){xe(Y,function(){!C.state.isVisible&&B.parentNode&&B.parentNode.contains(B)&&le()})}function Be(Y,le){xe(Y,le)}function xe(Y,le){var ge=S().box;function Re(Se){Se.target===ge&&(Ga(ge,"remove",Re),le())}if(Y===0)return le();Ga(ge,"remove",h),Ga(ge,"add",Re),h=Re}function re(Y,le,ge){ge===void 0&&(ge=!1);var Re=Ds(C.props.triggerTarget||s);Re.forEach(function(Se){Se.addEventListener(Y,le,ge),d.push({node:Se,eventType:Y,handler:le,options:ge})})}function Ce(){H()&&(re("touchstart",ue,{passive:!0}),re("touchend",ae,{passive:!0})),zm(C.props.trigger).forEach(function(Y){if(Y!=="manual")switch(re(Y,ue),Y){case"mouseenter":re("mouseleave",ae);break;case"focus":re(hC?"focusout":"blur",we);break;case"focusin":re("focusout",we);break}})}function ve(){d.forEach(function(Y){var le=Y.node,ge=Y.eventType,Re=Y.handler,Se=Y.options;le.removeEventListener(ge,Re,Se)}),d=[]}function ue(Y){var le,ge=!1;if(!(!C.state.isEnabled||Pe(Y)||a)){var Re=((le=c)==null?void 0:le.type)==="focus";c=Y,f=Y.currentTarget,T(),!C.state.isVisible&&iC(Y)&&On.forEach(function(Se){return Se(Y)}),Y.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||o)&&C.props.hideOnClick!==!1&&C.state.isVisible?ge=!0:be(Y),Y.type==="click"&&(o=!ge),ge&&!Re&&Ke(Y)}}function he(Y){var le=Y.target,ge=J().contains(le)||B.contains(le);if(!(Y.type==="mousemove"&&ge)){var Re=Le().concat(B).map(function(Se){var Ve,Bt=Se._tippy,Qt=(Ve=Bt.popperInstance)==null?void 0:Ve.state;return Qt?{popperRect:Se.getBoundingClientRect(),popperState:Qt,props:t}:null}).filter(Boolean);oC(Re,Y)&&(K(),Ke(Y))}}function ae(Y){var le=Pe(Y)||C.props.trigger.indexOf("click")>=0&&o;if(!le){if(C.props.interactive){C.hideWithInteractivity(Y);return}Ke(Y)}}function we(Y){C.props.trigger.indexOf("focusin")<0&&Y.target!==J()||C.props.interactive&&Y.relatedTarget&&B.contains(Y.relatedTarget)||Ke(Y)}function Pe(Y){return Ai.isTouch?H()!==Y.type.indexOf("touch")>=0:!1}function Te(){ke();var Y=C.props,le=Y.popperOptions,ge=Y.placement,Re=Y.offset,Se=Y.getReferenceClientRect,Ve=Y.moveTransition,Bt=X()?$a(B).arrow:null,Qt=Se?{getBoundingClientRect:Se,contextElement:Se.contextElement||J()}:s,Fs={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ns){var Ui=Ns.state;if(X()){var Br=S(),Qr=Br.box;["placement","reference-hidden","escaped"].forEach(function(Ms){Ms==="placement"?Qr.setAttribute("data-placement",Ui.placement):Ui.attributes.popper["data-popper-"+Ms]?Qr.setAttribute("data-"+Ms,""):Qr.removeAttribute("data-"+Ms)}),Ui.attributes.popper={}}}},bt=[{name:"offset",options:{offset:Re}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ve}},Fs];X()&&Bt&&bt.push({name:"arrow",options:{element:Bt,padding:3}}),bt.push.apply(bt,(le==null?void 0:le.modifiers)||[]),C.popperInstance=qm(Qt,B,Object.assign({},le,{placement:ge,onFirstUpdate:u,modifiers:bt}))}function ke(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function Ue(){var Y=C.props.appendTo,le,ge=J();C.props.interactive&&Y===pu||Y==="parent"?le=ge.parentNode:le=Eu(Y,[ge]),le.contains(B)||le.appendChild(B),C.state.isMounted=!0,Te()}function Le(){return Nn(B.querySelectorAll("[data-tippy-root]"))}function be(Y){C.clearDelayTimeouts(),Y&&x("onTrigger",[C,Y]),ce();var le=R(!0),ge=F(),Re=ge[0],Se=ge[1];Ai.isTouch&&Re==="hold"&&Se&&(le=Se),le?i=setTimeout(function(){C.show()},le):C.show()}function Ke(Y){if(C.clearDelayTimeouts(),x("onUntrigger",[C,Y]),!C.state.isVisible){Ae();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(Y.type)>=0&&o)){var le=R(!1);le?r=setTimeout(function(){C.state.isVisible&&C.hide()},le):n=requestAnimationFrame(function(){C.hide()})}}function je(){C.state.isEnabled=!0}function dt(){C.hide(),C.state.isEnabled=!1}function rt(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(n)}function vt(Y){if(!C.state.isDestroyed){x("onBeforeUpdate",[C,Y]),ve();var le=C.props,ge=Su(s,Object.assign({},le,Cu(Y),{ignoreAttributes:!0}));C.props=ge,Ce(),le.interactiveDebounce!==ge.interactiveDebounce&&(K(),g=Iu(he,ge.interactiveDebounce)),le.triggerTarget&&!ge.triggerTarget?Ds(le.triggerTarget).forEach(function(Re){Re.removeAttribute("aria-expanded")}):ge.triggerTarget&&s.removeAttribute("aria-expanded"),T(),U(),_&&_(le,ge),C.popperInstance&&(Te(),Le().forEach(function(Re){requestAnimationFrame(Re._tippy.popperInstance.forceUpdate)})),x("onAfterUpdate",[C,Y])}}function wi(Y){C.setProps({content:Y})}function yt(){var Y=C.state.isVisible,le=C.state.isDestroyed,ge=!C.state.isEnabled,Re=Ai.isTouch&&!C.props.touch,Se=Oa(C.props.duration,0,Jt.duration);if(!(Y||le||ge||Re)&&!J().hasAttribute("disabled")&&(x("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,X()&&(B.style.visibility="visible"),U(),ce(),C.state.isMounted||(B.style.transition="none"),X()){var Ve=S(),Bt=Ve.box,Qt=Ve.content;Ua([Bt,Qt],0)}u=function(){var bt;if(!(!C.state.isVisible||l)){if(l=!0,B.offsetHeight,B.style.transition=C.props.moveTransition,X()&&C.props.animation){var ns=S(),Ns=ns.box,Ui=ns.content;Ua([Ns,Ui],Se),vu([Ns,Ui],"visible")}w(),T(),mu(Ya,C),(bt=C.popperInstance)==null||bt.forceUpdate(),x("onMount",[C]),C.props.animation&&X()&&Be(Se,function(){C.state.isShown=!0,x("onShown",[C])})}},Ue()}}function ui(){var Y=!C.state.isVisible,le=C.state.isDestroyed,ge=!C.state.isEnabled,Re=Oa(C.props.duration,1,Jt.duration);if(!(Y||le||ge)&&(x("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,l=!1,o=!1,X()&&(B.style.visibility="hidden"),K(),Ae(),U(!0),X()){var Se=S(),Ve=Se.box,Bt=Se.content;C.props.animation&&(Ua([Ve,Bt],Re),vu([Ve,Bt],"hidden"))}w(),T(),C.props.animation?X()&&me(Re,C.unmount):C.unmount()}}function di(Y){W().addEventListener("mousemove",g),mu(On,g),g(Y)}function gi(){C.state.isVisible&&C.hide(),C.state.isMounted&&(ke(),Le().forEach(function(Y){Y._tippy.unmount()}),B.parentNode&&B.parentNode.removeChild(B),Ya=Ya.filter(function(Y){return Y!==C}),C.state.isMounted=!1,x("onHidden",[C]))}function It(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),ve(),delete s._tippy,C.state.isDestroyed=!0,x("onDestroy",[C]))}}function is(s,e){e===void 0&&(e={});var t=Jt.plugins.concat(e.plugins||[]);lC();var i=Object.assign({},e,{plugins:t}),r=rC(s),n=r.reduce(function(o,a){var A=a&&mC(a,i);return A&&o.push(A),o},[]);return Mn(s)?n[0]:n}is.defaultProps=Jt,is.setDefaultProps=fC,is.currentInput=Ai,Object.assign({},Xh,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),is.setDefaultProps({render:xu});class li extends Error{constructor(e,t=new Error,i=!1){super(),this.fatal=!1,this.fatal=i,this.stack=t.stack,this.message=[e,t.message].filter(Boolean).join(" - ")}}const CC=5;class vC{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._canvas=ft(),this._controls=ft(),this.host=e}set activeScenes(e){if(e!==this._activeScenes){const t=e[0],i=this._activeScenes[0];this._activeScenes=e,t!==i&&(this.host.dispatchEvent(new CustomEvent("scenechange",{detail:e[0]})),this.host.requestUpdate())}}get activeScenes(){return this._activeScenes}set currentTime(e){var t,i,r,n,o;const a=Math.min(this.host.duration,Math.max(0,e));this._currentTime=a,this.activeScenes=((t=this.host.scenes)==null?void 0:t.filter(({start:c,duration:h})=>a>=c&&a<c+h))??[],this._upcomingScenes=((i=this.host.scenes)==null?void 0:i.filter(({start:c})=>a>=c-CC&&a<c))??[],this.loadScenes(),this.syncVideoState(),(r=this._controls.value)==null||r.setAttribute("currentTime",a.toString());const A=this.activeScenes[0],l=Sl((n=A==null?void 0:A.videoMeta)==null?void 0:n.captions);this.caption=((o=l.find(({start:c,end:h})=>{var u;const d=a-A.start+(((u=A.videoMeta)==null?void 0:u.start)??0);return c&&h&&d>=zr(c)&&d<=zr(h)}))==null?void 0:o.text)??"",this.draw(a),!this.host.paused&&!this.host.loading&&!this.host.processing&&!this.host.waiting&&this.host.dispatchEvent(new CustomEvent("timeupdate",{detail:a}))}get currentTime(){return this._currentTime}set caption(e){e!==this._caption&&(this._caption=e,this.host.requestUpdate())}get caption(){return this._caption}canvas(){return pt(this._canvas)}controls(){return pt(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{var t,i,r;const{start:n,duration:o,video:a,videoMeta:A}=e,l=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused;if(a&&A){const{key:c,hls:h,node:u}=a,{start:d,duration:g}=A,f=this.host.videoState[c];u&&f&&(u.currentTime>=d+g||u.ended||l&&(h?(t=h.startLoadOnce)==null||t.call(h,u.currentTime):f.initialised||(i=u.startLoadOnce)==null||i.call(u)))}else if(l){const c=`${n}-${o}`,h=this.host._sceneController.videoState[c];this.host.duration&&!((r=h==null?void 0:h.buffered)!=null&&r.length)&&(this.host._sceneController.videoState={...this.host._sceneController.videoState,[c]:{...h,buffered:[{start:Math.max(0,n/this.host.duration*100),end:Math.min((n+o)/this.host.duration*100,100)}]}})}})}syncVideoState(){var e;(e=this.host.scenes)==null||e.forEach(t=>{if(t.video){const{key:i,node:r}=t.video,n=this.host.videoState[i],o=this.activeScenes.includes(t);if(r&&n)if(o&&!this.host.waiting&&!this.host.loading&&!this.host.paused){if(r.paused&&n.initialised)try{return r.play()}catch(a){throw new li("Video play error",a,!0)}}else r.paused||r.pause()}})}draw(e=this.currentTime){var t,i;this.host.sceneConfig&&this._canvas.value&&((i=(t=this.host).compilation)==null||i.call(t,{currentTime:e,scenes:this.host.sceneConfig,canvas:this._canvas.value}))}clear(){var e;const t=this._canvas.value;(e=t==null?void 0:t.getContext("2d"))==null||e.clearRect(0,0,t.width,t.height)}}function yC(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function BC(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Ka(s){const{id:e,key:t,src:i,playlist:r,duration:n}=s;return new Promise(o=>{let a=null;const A=document.createElement("video");if(A.playsInline=!0,A.muted=!0,A.loop=!1,r&&!yC()&&bi.isSupported()){let l=!1;a=new bi({autoStartLoad:!0,xhrSetup:c=>{const{open:h}=c,u=r.split("?")[1];c.open=function(d,g,f){g.toString().includes("?")||(g+="?"+u),!(!l&&g.toString().includes(".ts"))&&h.apply(this,[d,g,f])}}}),a.on(bi.Events.LEVEL_LOADED,async()=>{l||a==null||a.stopLoad(),o({id:e,key:t,hls:a,config:s,node:A})}),a.loadSource(r),a.attachMedia(A),a.startLoadOnce=(c=-1,h)=>{if(a&&!l){const u=a==null?void 0:a.levels.findIndex(d=>Math.min(d.height,d.width)===h);l=!0,a.startLevel=a.firstLevel,a.startLoad(c),a.currentLevel=u!==-1?u:a.firstLevel}}}else{A.src=i;let l=!1;if(A.startLoadOnce=()=>{l||(A.preload="auto",A.load(),l=!0)},n)A.preload="none",o({id:e,key:t,hls:a,config:s,node:A});else{A.preload="metadata";const c=async()=>{o({id:e,key:t,hls:a,config:s,node:A}),A.removeEventListener("loadedmetadata",c)};A.addEventListener("loadedmetadata",c)}}})}async function Du(s){return s.duration===1/0?new Promise(e=>{s.currentTime=Number.MAX_SAFE_INTEGER,s.ontimeupdate=()=>{s.ontimeupdate=null,e(s.duration),s.currentTime=0}}):s.duration}const QC=Ii(async function(e){return new FontFace(e.name,`url(${e.woff2??e.url})`,{style:e.style,weight:e.weight}).load()},{cacheKey:([s])=>JSON.stringify(s)});let bC=class{constructor(e){this._hasPlayed=!1,this._memoKey=null,this._lastDeps=null,this._duration=0,this._scenes=null,this._videos={},this._videoMeta={},this._videoState={},this._delayProcessing=(t=100)=>{const i=new AbortController,r=setTimeout(()=>{i.signal.aborted||(this.host._processing=!0)},t);return i.signal.addEventListener("abort",()=>{clearTimeout(r)}),i},this._createDataResolver=t=>i=>this.host.dataResolver(i,{language:t}),this._resolveVideo=Ii(async t=>{const{id:i,key:r}=t,n=await Ka(t);n.node.volume=this.host.volume,n.node.playbackRate=this.host.playbackRate;const o={loadeddata:this._handleLoadedData,waiting:this._handleWaiting,canplay:this._handleCanPlay,progress:this._handleProgress,seeking:this._handleSeeking,seeked:this._handleSeeked,play:this._handlePlay,playing:this._handlePlaying,pause:this._handlePause,stalled:this._handleStalled,timeupdate:this._handleTimeUpdate,ended:this._handleEnded,error:this._handleError},a=Object.keys(o).reduce((A,l)=>{const c=l,h=o[c]({id:i,key:r,node:n.node});return A[c]=h,n.node.addEventListener(l,h),A},{});return{...n,listeners:a}},{cacheKey:([{id:t,key:i,src:r,playlist:n}])=>JSON.stringify({id:t,key:i,src:r==null?void 0:r.split("?")[0],playlist:n==null?void 0:n.split("?")[0]})}),this._resolveVideoMeta=Ii(async(t,i)=>{const{id:r,captions:n,duration:o,startOffset:a,endOffset:A}=t,l=o??await Du(i),c=(a??0)*l,h=(1-(A??0))*l;return{id:r,captions:n,start:c,duration:h-c}},{cacheKey:([{id:t,key:i,captions:r,duration:n,startOffset:o,endOffset:a}])=>JSON.stringify({id:t,key:i,captions:r,duration:n,startOffset:o,endOffset:a})}),this._handleLoadedData=({id:t,key:i,node:r})=>()=>{var n,o;const a=this.videoState[i];if(!(a!=null&&a.initialised)){this.videoState={...this.videoState,[i]:{...a,initialised:!0,waiting:!1,buffered:(a==null?void 0:a.buffered)??[]}};const A=(o=(n=this.scenes)==null?void 0:n.scenes)==null?void 0:o.find(({video:l})=>{l==null||l.key});A&&this._setVideoCurrentTime({scene:A,time:this.host.currentTime}),this.host.dispatchEvent(new CustomEvent("video:loadeddata",{detail:{id:t,key:i,node:r}}))}},this._handleWaiting=({key:t})=>()=>{const i=this.videoState[t];i!=null&&i.initialised&&!(i!=null&&i.waiting)&&(this.videoState={...this.videoState,[t]:{...i,waiting:!0}})},this._handleCanPlay=({key:t})=>()=>{const i=this.videoState[t];i!=null&&i.initialised&&(i!=null&&i.waiting)&&(this.videoState={...this.videoState,[t]:{...i,waiting:!1}}),this.host.paused&&this.host.draw()},this._handleProgress=({key:t,node:i})=>()=>{const r=this.videoState[t],n=this._getBufferSegments({key:t,node:i,duration:this.host.duration});this.videoState={...this.videoState,[t]:{...r,buffered:n}}},this._handleSeeking=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:seeking",{detail:{id:t,key:i,node:r}}))},this._handleSeeked=({id:t,key:i,node:r})=>()=>{const n=this.videoState[i];n!=null&&n.initialised&&(this.host.draw(),this.host.dispatchEvent(new CustomEvent("video:seeked",{detail:{id:t,key:i,node:r}})))},this._handlePlay=({id:t,key:i,node:r})=>()=>{this.hasPlayed=!0,this.host.dispatchEvent(new CustomEvent("video:play",{detail:{id:t,key:i,node:r}}))},this._handlePlaying=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:playing",{detail:{id:t,key:i,node:r}}))},this._handlePause=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:pause",{detail:{id:t,key:i,node:r}}))},this._handleStalled=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:stalled",{detail:{id:t,key:i,node:r}}))},this._handleTimeUpdate=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:timeupdate",{detail:{id:t,key:i,node:r}}))},this._handleEnded=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:ended",{detail:{id:t,key:i,node:r}}))},this._handleError=({id:t,key:i,node:r})=>()=>{const n=new li(`Video error - answer ${t} failed to load`);this.host.dispatchEvent(new ErrorEvent("error",{bubbles:!0,composed:!0,error:n,message:n.message})),this.host.dispatchEvent(new CustomEvent("video:error",{detail:{id:t,key:i,node:r}}))},this._cleanupVideo=t=>{var i;const r=this.videos[t];r&&(r.node.pause(),r.node.src="",(i=r.hls)==null||i.destroy(),Object.keys(r.listeners??{}).forEach(n=>{var o,a;if((o=this.videos)!=null&&o[t]){const A=(a=r.listeners)==null?void 0:a[n];A&&r.node.removeEventListener(n,A)}}),delete this.videos[t])},this.host=e,this.host.addController(this)}set hasPlayed(e){e!==this._hasPlayed&&(this._hasPlayed=e,this.host.requestUpdate())}get hasPlayed(){return this._hasPlayed}set duration(e){!isNaN(e)&&e!==this._duration&&(this._duration=e,this.host.requestUpdate(),this.host.dispatchEvent(new CustomEvent("durationchange",{detail:this._duration})))}get duration(){return this._duration}set scenes(e){e!==this._scenes&&(this._scenes=e,this.host.requestUpdate())}get scenes(){return this._scenes}set videos(e){e!==this._videos&&(this._videos=e,this.host.requestUpdate())}get videos(){return this._videos}set videoMeta(e){e!==this._videoMeta&&(this._videoMeta=e,this.host.requestUpdate())}get videoMeta(){return this._videoMeta}set videoState(e){e!==this._videoState&&(this._videoState=e,this.host.requestUpdate())}get videoState(){return this._videoState}_getBufferSegments({key:e,node:t,duration:i}){var r;const n=t==null?void 0:t.buffered,o=[],{start:a,video:A,videoMeta:l}=((r=this.scenes)==null?void 0:r.scenes.find(({video:c})=>e===(c==null?void 0:c.key)))??{};if(t&&n&&A&&l&&typeof a<"u")for(let c=0;c<n.length;c++){const h=n.start(c),u=n.end(c);Math.max(h,l.start)<=Math.min(u,l.start+l.duration)&&o.push({start:Math.max(0,(Math.max(h-l.start,0)+a)/i*100),end:Math.min((Math.min(u-l.start,l.duration)+a)/i*100,100)})}return o}_setupTask(){new Lr(this.host,async([e,t,i,r,n,o,a])=>{var A;const l=this._delayProcessing();try{let c=null;if(this.host._errors=[],this.host._languages=this.host.languageResolver({data:e}),(!n||!this.host._languages.find(({value:h})=>n===h))&&(this.host._language=(A=this.host._languages[0])==null?void 0:A.value),i||e){if(i){let d=null;if(r)try{d=await(await fetch(r,{method:"GET"})).text()}catch(p){const v=new li("Track failed to fetch",p);this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:v,message:v.message}))}const f={questions:{items:[{answer:{id:"source",media:{[i.includes(".m3u8")?"playlist":"video"]:i},captions:{current:d}}}]}};try{this.scenes=await hs({data:f,template:t,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(p){try{this.scenes=await hs({data:f,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(v){throw new li("Fatal source template error",v,!0)}c=new li("Source template error",p)}}else try{this.scenes=await hs({data:e,template:t,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(d){try{this.scenes=await hs({data:e,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(g){throw new li("Fatal data template error",g,!0)}c=new li("Data template error",d)}Object.keys(this.videos).forEach(d=>{this.scenes.scenes.find(({video:g})=>d===(g==null?void 0:g.key))||this._videos[d].node.pause()});const h=this.scenes.scenes.reduce((d,{video:g})=>(g&&(d[g.key]=g),d),{});Object.keys(this.videos).join("|")!==Object.keys(h).join("|")&&this.host.reset(0,!1),this.videos=h,this.videoState={...this.videoState,...this.scenes.scenes.reduce((d,{video:g,start:f,duration:p})=>{var v;const y=(g==null?void 0:g.key)??`${f}-${p}`,b=this._getBufferSegments({key:y,node:g==null?void 0:g.node,duration:this.scenes.duration});return d[y]={initialised:!g,waiting:!!g,...this.videoState[y],buffered:g?b:(v=this.videoState[y])==null?void 0:v.buffered},d},{})},this.videoMeta=this.scenes.scenes.reduce((d,{video:g,videoMeta:f})=>(g&&f&&(d[g.key]=f),d),{}),(await Promise.all(this.scenes.fonts.map(d=>QC(d)))).forEach(d=>{document.fonts.add(d)}),this.duration=this.scenes.duration,this.host.paused&&this.host.reset(this.host.currentTime,!this.host.paused)}c&&this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:c,message:c.message}))}catch(c){this.scenes=null,this.duration=0,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:c,message:c.message}))}finally{l.abort(),this.host._processing=!1}},()=>{const e=JSON.stringify({data:this.host.data,template:this.host.template,src:this.host.src,track:this.host.track,language:this.host.language,burnCaptions:this.host.burnCaptions,debug:this.host.debug});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.data,this.host.template,this.host.src,this.host.track,this.host.language,this.host.burnCaptions,this.host.debug];return this._memoKey=e,this._lastDeps=t,t})}_setVideoCurrentTime({time:e,scene:t}){const{start:i,video:r,videoMeta:n}=t;if(r&&r.node&&n&&typeof i<"u"){const o=e-i;r.node.currentTime=Math.max(n.start,Math.min(n.start+n.duration,o+n.start))}}setVideosCurrentTime(e){var t;(t=this.scenes)==null||t.scenes.forEach(i=>{this._setVideoCurrentTime({time:e,scene:i})})}hostConnected(){this._setupTask()}hostDisconnected(){Object.keys(this.videos).forEach(e=>{this._cleanupVideo(e)}),this.videos={}}};function SC(s){s.requestFullscreen?s.requestFullscreen():s.mozRequestFullScreen?s.mozRequestFullScreen():s.webkitRequestFullscreen?s.webkitRequestFullscreen():s.msRequestFullscreen&&s.msRequestFullscreen()}function wC(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const Va=["progress","play-large","navigation","play","volume","current-time","duration","speed","captions","fullscreen","preview"],RC={id:"captions",event:"captions:click",label:"Closed Captions"},xC={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},Tu={title:"Playback Speed",items:[{id:"playback-rate-0.5",event:"playbackRate:click",label:"0.5x",value:.5},{id:"playback-rate-1",event:"playbackRate:click",label:"1.0x",value:1},{id:"playback-rate-1.5",event:"playbackRate:click",label:"1.5x",value:1.5},{id:"playback-rate-2",event:"playbackRate:click",label:"2.0x",value:2}]},DC={id:"playbackRate",label:"Playback playbackRate",subItems:Tu};class TC extends NA{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==As.ELEMENT)throw new Error("Resize directive must be used in an Element expression")}disconnected(){var e;(e=this.observer)==null||e.disconnect(),this.observer=void 0}reconnected(){var e;this.element&&((e=this.observer)==null||e.observe(this.element))}update(e,[t]){return this.isConnected&&!this.observer&&(this.observer=new ResizeObserver(t),this.element=e.element,this.observer.observe(this.element)),$t}}const Ja=ls(TC),LC=YI(()=>{const s=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),e=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-SemiBold.woff2)",{style:"normal",weight:"600"}),t=new FontFace("Roobert Captions","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),i=yl.map(r=>({load:!1,font:new FontFace(r.family,`url(${r.url})`,{style:r.style})}));return[{load:!0,font:s},{load:!0,font:e},{load:!0,font:t},...i]}),ci={"red-120":"#feeded","red-130":"#fcd5d0","red-400":"#e84a4a","red-500":"#c51c3a","red-700":"#a21c39","red-800":"#850231","red-900":"#580A2D","teal-80":"#f3fafa","teal-100":"#d6f1f1","teal-200":"#ace3e3","teal-300":"#7acace","teal-400":"#4faab2","teal-500":"#358f97","teal-600":"#287179","teal-700":"#22555c","teal-800":"#21484e","teal-900":"#1f3d42","teal-950":"#0d2126","purple-100":"#d7cfff","purple-700":"#5f2fe9","green-200":"#a4d7aa","green-500":"#38b319","green-800":"#2b3c2f","grey-100":"#f0f0f0","light-50":"rgba(255, 255, 255, .05)","light-100":"rgba(255, 255, 255, .1)","light-200":"rgba(255, 255, 255, .2)","light-400":"rgba(255, 255, 255, .4)","light-500":"rgba(255, 255, 255, .5)","light-640":"rgba(255, 255, 255, .64)","light-800":"rgba(255, 255, 255, .8)","light-1000":"#fff","dark-50":"rgba(0, 0, 0, .05)","dark-80":"rgba(0, 0, 0, .08)","dark-100":"rgba(0, 0, 0, .1)","dark-200":"rgba(0, 0, 0, .2)","dark-250":"rgba(0, 0, 0, .25)","dark-400":"rgba(0, 0, 0, .4)","dark-500":"rgba(0, 0, 0, .5)","dark-640":"rgba(0, 0, 0, .64)","dark-800":"rgba(0, 0, 0, .8)","dark-900":"rgba(0, 0, 0, .9)","dark-1000":"#000"},_C={colors:ci,space:{xxs:".25rem",xs:".5rem",small:".75rem",medium:"1rem",large:"1.5rem",xl:"2.5rem"},sizes:{xxs:"1rem",xs:"1.5rem",small:"2rem",medium:"2.5rem",large:"3rem"},fontWeights:{regular:400,semibold:600},lineHeights:{small:1.1,medium:1.25,large:1.4},letterSpacings:{xxs:"-.04rem",xs:"-.03rem",small:"-.02rem",medium:"-.01rem",large:0},fontSizes:{micro:".625rem",small:".75rem",medium:".875rem",large:"1rem",xl:"1.25rem",xxl:"1.5rem",xxxl:"2rem",huge:"2.75rem"},fontFamilies:{sans:'Roobert, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,"Noto Sans", "Noto Color Emoji", sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji"',mono:'"Maison Neue Mono", Menlo, Monaco, Consolas, Liberation Mono, "Courier New", monospace'},borderWidths:{thin:".0625rem"},radii:{small:".25rem",medium:".5rem",large:".75rem",xl:"1rem"},shadows:{small:`.25rem .25rem .25rem ${ci["dark-100"]}`,medium:`0 .125rem .625rem ${ci["dark-100"]}`,large:`0 .25rem 1rem ${ci["dark-50"]}`,xl:`.25rem .25rem 1rem ${ci["dark-250"]}`,xxl:`0 .25rem 2rem ${ci["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${ci["dark-250"]}`,toolbar:`0 -.625rem .625rem ${ci["dark-50"]}`,text:`0 0 .25rem ${ci["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:ci["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},Lu=GI(_C,{delimiter:"-"}),kC=Object.keys(Lu).map(s=>Os(`:host { --${s}: ${Lu[s]}; }`)),Ne=(s=>{const e=class extends s{firstUpdated(){LC().forEach(({load:n,font:o})=>{document.fonts.add(o),n&&o.load()})}};return e.styles=[(s==null?void 0:s.styles)??[],kC,ot`
187
187
  :host {
188
188
  font-family: var(--fontFamilies-sans);
189
189
  font-size: var(--fontSizes-medium);