@vouchfor/embeds 4.4.1 → 4.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2473,7 +2473,7 @@ vec4 transition(vec2 uv) {
2473
2473
  return mix(a, b, step(0.0+p.y,progress));
2474
2474
  }
2475
2475
  `,author:"Jake Nelson",license:"MIT",createdAt:"Wed, 1 Nov 2017 15:24:36 -0500",updatedAt:"Thu, 2 Nov 2017 18:37:42 -0500"}];const hh=Ea(rv);var dh;function nv(r){if(typeof r=="string"){const[e,t]=r.split(":");return Math.min(parseFloat(e),parseFloat(t))}return r}function sv(r){if(typeof r=="string"){const[e,t]=r.split(":"),i=parseFloat(e),n=parseFloat(t);return i/n}return r}function nl({resolution:r,aspectRatio:e}){const t=nv(r),i=sv(e),n=i>=1,s=Math.min(n?t*i:t/i,t),o=Math.max(n?t*i:t/i,t);return{resolution:t,aspectRatio:i,height:n?s:o,width:n?o:s}}let js;const ov=new Uint8Array(16);function av(){if(!js&&(js=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!js))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return js(ov)}const bt=[];for(let r=0;r<256;++r)bt.push((r+256).toString(16).slice(1));function lv(r,e=0){return bt[r[e+0]]+bt[r[e+1]]+bt[r[e+2]]+bt[r[e+3]]+"-"+bt[r[e+4]]+bt[r[e+5]]+"-"+bt[r[e+6]]+bt[r[e+7]]+"-"+bt[r[e+8]]+bt[r[e+9]]+"-"+bt[r[e+10]]+bt[r[e+11]]+bt[r[e+12]]+bt[r[e+13]]+bt[r[e+14]]+bt[r[e+15]]}const fh={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Av(r,e,t){if(fh.randomUUID&&!r)return fh.randomUUID();r=r||{};const i=r.random||(r.rng||av)();return i[6]=i[6]&15|64,i[8]=i[8]&63|128,lv(i)}function cv(r){return typeof r=="number"?{topLeft:r,topRight:r,bottomRight:r,bottomLeft:r}:{topLeft:(r==null?void 0:r.topLeft)??0,topRight:(r==null?void 0:r.topRight)??0,bottomRight:(r==null?void 0:r.bottomRight)??0,bottomLeft:(r==null?void 0:r.bottomLeft)??0}}function uv(r,e){return typeof r=="number"?{top:r*e,right:r*e,bottom:r*e,left:r*e}:typeof r=="string"?{top:r,right:r,bottom:r,left:r}:{top:typeof r.top=="number"?r.top*e:r.top,right:typeof r.right=="number"?r.right*e:r.right,bottom:typeof r.bottom=="number"?r.bottom*e:r.bottom,left:typeof r.left=="number"?r.left*e:r.left}}function hv(r,e){return typeof r=="number"?{top:r*e,right:r*e,bottom:r*e,left:r*e}:typeof r=="string"?{top:r,right:r,bottom:r,left:r}:{top:(typeof r.top=="number"?r.top*e:r.top)??0,right:(typeof r.right=="number"?r.right*e:r.right)??0,bottom:(typeof r.bottom=="number"?r.bottom*e:r.bottom)??0,left:(typeof r.left=="number"?r.left*e:r.left)??0}}function dv(r,e){return typeof r=="number"?{top:r*e,right:r*e,bottom:r*e,left:r*e}:typeof r=="string"?{top:r,right:r,bottom:r,left:r}:{top:(typeof r.top=="number"?r.top*e:r.top)??0,right:(typeof r.right=="number"?r.right*e:r.right)??0,bottom:(typeof r.bottom=="number"?r.bottom*e:r.bottom)??0,left:(typeof r.left=="number"?r.left*e:r.left)??0}}function fv(r){if(r===null||typeof r!="object")return!1;if(Object.getPrototypeOf(r)===null)return!0;let e=r;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e}function gv(r){return r.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}const pv=$i(()=>Uc.loadYoga());function gh(r,e,{layout:t,scale:i=1}){const{position:n="relative",inset:s,width:o,height:a,minWidth:A,minHeight:l,maxWidth:u,maxHeight:c,flex:h,flexGrow:d,flexShrink:f,gap:g,margin:p,padding:v,direction:B="column",align:y="start",alignSelf:C,justify:x="start"}=t??{},w={static:r.POSITION_TYPE_STATIC,relative:r.POSITION_TYPE_RELATIVE,absolute:r.POSITION_TYPE_ABSOLUTE};if(e.setPositionType(w[n]),s){const{top:M,right:j,bottom:X,left:le}=uv(s,i);typeof M<"u"&&e.setPosition(r.EDGE_TOP,M),typeof j<"u"&&e.setPosition(r.EDGE_RIGHT,j),typeof X<"u"&&e.setPosition(r.EDGE_BOTTOM,X),typeof le<"u"&&e.setPosition(r.EDGE_LEFT,le)}const D={row:r.FLEX_DIRECTION_ROW,column:r.FLEX_DIRECTION_COLUMN,"row-reverse":r.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":r.FLEX_DIRECTION_COLUMN_REVERSE};e.setFlexDirection(D[B]);const F={start:r.ALIGN_FLEX_START,end:r.ALIGN_FLEX_END,center:r.ALIGN_CENTER,stretch:r.ALIGN_STRETCH};e.setAlignItems(F[y]),C&&e.setAlignSelf(F[C]);const O={start:r.JUSTIFY_FLEX_START,end:r.JUSTIFY_FLEX_END,center:r.JUSTIFY_CENTER,"space-between":r.JUSTIFY_SPACE_BETWEEN,"space-around":r.JUSTIFY_SPACE_AROUND,"space-evenly":r.JUSTIFY_SPACE_EVENLY};if(e.setJustifyContent(O[x]),p){const{top:M,right:j,bottom:X,left:le}=hv(p,i);e.setMargin(r.EDGE_TOP,M),e.setMargin(r.EDGE_RIGHT,j),e.setMargin(r.EDGE_BOTTOM,X),e.setMargin(r.EDGE_LEFT,le)}if(v){const{top:M,right:j,bottom:X,left:le}=dv(v,i);e.setPadding(r.EDGE_TOP,M),e.setPadding(r.EDGE_RIGHT,j),e.setPadding(r.EDGE_BOTTOM,X),e.setPadding(r.EDGE_LEFT,le)}typeof d<"u"||typeof f<"u"?(typeof d<"u"&&e.setFlexGrow(d),typeof f<"u"&&e.setFlexShrink(f)):typeof h<"u"&&e.setFlex(h),e.setGap(r.GUTTER_ALL,(g??0)*i),typeof o<"u"&&e.setWidth(typeof o=="number"?o*i:o),typeof a<"u"&&(typeof a=="function"?e.setHeight("100%"):e.setHeight(typeof a=="number"?a*i:a)),typeof A<"u"&&e.setMinWidth(typeof A=="number"?A*i:A),typeof l<"u"&&e.setMinHeight(typeof l=="number"?l*i:l),typeof u<"u"&&e.setMaxWidth(typeof u=="number"?u*i:u),typeof c<"u"&&e.setMaxHeight(typeof c=="number"?c*i:c)}async function ph({id:r,yoga:e,index:t,parent:i,element:n,resolvers:s}){var o,a,A;const{layout:l={},config:u={},options:c={},renderer:h}=n,d=e.Node.create();gh(e,d,{layout:l}),i.insertChild(d,t);let f=null;s&&((h==null?void 0:h.type)==="text"||(h==null?void 0:h.type)==="caption"||(h==null?void 0:h.type)==="image"||(h==null?void 0:h.type)==="video")&&((h==null?void 0:h.type)==="caption"?f=await((o=s.text)==null?void 0:o.call(s,{id:r,config:u,options:c}))??null:f=await((a=s[h.type])==null?void 0:a.call(s,{id:r,config:u,options:c}))??null);const g=[];for await(const[p,v]of((A=n.children)==null?void 0:A.entries())??[])g.push(await ph({id:r,yoga:e,index:p,parent:d,element:v,resolvers:s}));return{node:d,radius:cv(l.radius),element:n,renderer:h,config:u,options:c,dependencies:f,childNodes:g}}function mh(r,e,t=0,i=0){const{top:n,left:s}=r.getComputedLayout(),{top:o,left:a,width:A,height:l}=e.node.getComputedLayout(),u=t+a,c=i+o,h=e.childNodes.map(d=>mh(r,d,u,c));return{...e,x:s+u,y:n+c,width:A,height:l,childNodes:h}}async function Eh(r,e,t){for await(const{node:i,options:n,dependencies:s,renderer:o,childNodes:a}of e){if(o){const{width:A,height:l}=o;if(A&&t){r.calculateLayout();const u=await A({node:i,options:n,dependencies:s,measureCanvas:t});i.setWidth(u)}if(l&&t){r.calculateLayout();const u=await l({node:i,options:n,dependencies:s,measureCanvas:t});i.setHeight(u)}}r.calculateLayout(),await Eh(r,a,t)}}async function Ih({id:r,root:e,resolvers:t,measureCanvas:i}){const n=await pv(),s=n.Node.create();gh(n,s,{layout:e.layout});const o=await ph({id:r,yoga:n,index:0,parent:s,element:e.element,resolvers:t});await Eh(s,[o],i);const{top:a,left:A,width:l,height:u}=s.getComputedLayout(),c={root:{x:A,y:a,width:l,height:u},node:mh(s,o)};return s.freeRecursive(),c}const mv={type:"audio"},Mn=/(?<value>\d+\.?\d*)(?=px)/;function sl({words:r,spaceMetrics:e,strokeWidth:t=0}){return r.reduce((i,n,s)=>{const o=n.metrics.width+t,a=s<r.length-1?e.width:0;return i+o+a},0)}Ds(({context:r,font:e,fontSizes:t,words:i,maxW:n=1/0,strokeWidth:s=0,letterSpacing:o=0})=>{try{r.save(),r.letterSpacing=`${o}px`,r.font=e.replace(Mn,t[0].toString());const a=r.measureText("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");if(i.length<=0)return[];const A=r.measureText(i[0].text);return i.slice(1).reduce((l,u)=>{const c=l[l.length-1],h=r.measureText(u.text),d={...u,metrics:h},f=[...c.words,d],g=sl({strokeWidth:s,words:f,spaceMetrics:c.spaceMetrics});if(g>n){const p=t[l.length%t.length];r.font=e.replace(Mn,p.toString());const v=r.measureText(" "),B=r.measureText(u.text),y=[{...u,metrics:B}],C=r.measureText("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");l=[...l,{allMetrics:C,spaceMetrics:v,lineWidth:sl({strokeWidth:s,spaceMetrics:v,words:y}),font:r.font,words:y,lineHeight:C.actualBoundingBoxAscent+C.actualBoundingBoxDescent+s}]}else l[l.length-1]={...c,lineWidth:g,words:f};return l},[{allMetrics:a,lineWidth:sl({strokeWidth:s,words:[{...i[0],metrics:A}],spaceMetrics:r.measureText(" ")}),lineHeight:a.actualBoundingBoxAscent+a.actualBoundingBoxDescent+s,font:r.font,words:[{...i[0],metrics:A}],spaceMetrics:r.measureText(" ")}])}finally{r.restore()}},{cacheKey:([{font:r,fontSizes:e,words:t,maxW:i,strokeWidth:n,letterSpacing:s}])=>`${r}_${JSON.stringify(e)}_${JSON.stringify(t)}_${i}_${n}_${s}`});const vh={linear:Rm,easeIn:Ra,easeInOut:Lm,easeOut:Dm,circIn:uu,circInOut:km,circOut:hu,backIn:Da,backInOut:Fm,backOut:Mm,anticipate:Nm,bounceIn:Gm,bounceInOut:$m,bounceOut:Ns},ol=Ds((r,e,{clamp:t=!0,ease:i="easeIn",...n}={})=>Sm(r,e,{...n,clamp:t,ease:vh[i]}),{cacheKey:([r,e,t])=>JSON.stringify({from:r,to:e,options:t})}),Ch=[{family:"Noto Arabic",regex:new RegExp("\\p{Script=Arabic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansArabic-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Chinese",regex:new RegExp("\\p{Script=Han}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansSC-VariableFont_wght.woff2",style:"normal"},{family:"Noto Hebrew",regex:new RegExp("\\p{Script=Hebrew}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansHebrew-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Hindi",regex:new RegExp("\\p{Script=Devanagari}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansDevanagari-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Japanese",regex:new RegExp("\\p{Script=Han}|\\p{Script=Katakana}|\\p{Script=Hiragana}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansJP-VariableFont_wght.woff2",style:"normal"},{family:"Noto Korean",regex:new RegExp("\\p{Script=Hangul}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKR-VariableFont_wght.woff2",style:"normal"},{family:"Noto Color Emoji",regex:new RegExp("\\p{Extended_Pictographic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoColorEmoji-Regular.woff2",style:"normal"}];function Ev({text:r,font:e}){let t=e;return Ch.forEach(({family:i,regex:n})=>{n.exec(r)&&(t+=`, ${i}`)}),t}const Iv="caption";Object.keys(vh).map(r=>({label:r.charAt(0).toUpperCase()+r.slice(1),value:r,data:r}));const vv={type:Iv},Cv={type:"image"};function yh({context:r,word:e,maxW:t=1/0}){const i=[],n=r.measureText(e);if(Math.floor(n.width)<=t)return[{text:e,metrics:n}];for(let s=0;s<e.length;s++){const o=i[i.length-1],a=((o==null?void 0:o.text)??"")+e[s],A=r.measureText(a);A.width<t?i[o?i.length-1:0]={text:a,metrics:A}:i.push({text:e[s],metrics:r.measureText(e[s])})}return i}const yv=Ds(({font:r,context:e,fontSizes:t,text:i,maxW:n=1/0,letterSpacing:s=0})=>{try{return e.save(),e.letterSpacing=`${s}px`,e.font=r.replace(Mn,t[0].toString()),i.split(`
2476
- `).flatMap(a=>{const A=a.split(" ").filter(Boolean);return A.length?A.slice(1).reduce((l,u,c)=>{const d=`${l[l.length-1].text} ${u}`.trim(),f=e.measureText(d);if(f.width>n)l=[...l,...yh({context:e,word:u,maxW:n})];else{const g=t[c%t.length];e.font=r.replace(Mn,g.toString()),l[l.length-1]={text:d,metrics:f}}return l},yh({context:e,word:A[0],maxW:n})):{text:"",metrics:e.measureText("")}})}finally{e.restore()}},{cacheKey:([{font:r,fontSizes:e,text:t,maxW:i,letterSpacing:n}])=>`${r}_${JSON.stringify(e)}_${t}_${i}_${n}`});Ds(({font:r,text:e,scale:t,context:i,maxW:n,maxH:s,minSize:o,maxSize:a,letterSpacing:A=0})=>{var l,u;let c=0;if(a){c=(o??0)*t;let d=0;for(;a*t>c+1;){c+=1;const f=yv({font:r,context:i,fontSizes:[c],text:e,maxW:n,letterSpacing:A});if(d=f.reduce((g,p)=>(p.metrics.width>g&&(g=p.metrics.width),g),0),d>n||f.length*c>s){c-=1;break}}}else c=parseFloat(((u=(l=r.match(Mn))==null?void 0:l.groups)==null?void 0:u.value)??"0")*t;return c},{cacheKey:([{font:r,text:e,scale:t,maxW:i,maxH:n,minSize:s,maxSize:o,letterSpacing:a}])=>`${r}_${e}_${s}_${o}_${t}_${i}_${n}_${a}`});const Bv={type:"text"},Tv={type:"video"};function Bh(){return document.createElement("canvas")}function Sv(r,e){return Object.keys(r).reduce((t,i)=>(e.includes(i)||(t[i]=r[i]),t),{})}function Vt(r){let e=0;for(const t of r)Array.isArray(t)?e+=Vt(t):e+=t;return e}function Xs(r){return r.map(({type:e,duration:t},i)=>{var n,s,o,a;if(e==="transition"){const A=((n=r[i-2])==null?void 0:n.type)==="transition"?r[i-2]:null,l=((s=r[i-1])==null?void 0:s.duration)??1/0,u=((o=r[i+1])==null?void 0:o.duration)??1/0,c=((a=r[i+2])==null?void 0:a.type)==="transition"?r[i+2]:null;return Math.min(A?l/2:l,t,c?u/2:u)*-1}return t})}function Th(r){var e;return{...r,children:((e=r.children)==null?void 0:e.map(t=>{if(!t.renderer)return Th(t)}).filter(Boolean))??[]}}function Sh(r){const e={box:0,image:0,video:0,text:0,audio:0,gradient:0,caption:0};r.renderer&&(e[r.renderer.type]+=1);for(const t of r.children??[]){const{box:i,image:n,video:s,text:o,audio:a,gradient:A,caption:l}=Sh(t);e.box+=i,e.image+=n,e.video+=s,e.text+=o,e.audio+=a,e.gradient+=A,e.caption+=l}return e}function bv(r){return r.video>0?Tv.type:r.image>0?Cv.type:r.audio>0?mv.type:r.caption>0?vv.type:Bv.type}function bh({node:r,duration:e,parentAnimations:t=[]}){const i=[],n=[...r.element.animations??[],...t];if(r.renderer){const s=Th({...r.element,animations:n,layout:{...r.element.layout?Sv(r.element.layout,["maxWidth","maxHeight"]):{},width:"100%",height:"100%",margin:0}}),o=Sh(s);i.push({type:bv(o),id:Av(),x:r.x,y:r.y,width:r.width,height:r.height,duration:e,root:{element:s}})}for(const s of r.childNodes)i.push(...bh({node:s,duration:e,parentAnimations:n}));return i}Op.filters.define("parse",r=>typeof r>"u"?null:typeof r=="string"?`"${gv(r)}"`:fv(r)||Array.isArray(r)?JSON.stringify(r):r);const xv="3";async function Qv({scene:r,start:e=0}){const{id:t,root:i,duration:n}=r,s=await Ih({id:t,root:i});return{type:r.type,start:e,duration:n,layout:s,id:r.id,config:r}}async function _v({track:r}){const e=Xs(r),t=await Promise.all(r.reduce((s,o,a)=>{if(o.type!=="audio")return s;const A=Vt(e.slice(0,a));return s.push(Qv({scene:o,start:A})),s},[])),i=r.reduce((s,o,a)=>{if(o.type!=="gap")return s;const A=Vt(e.slice(0,a));return s.push({type:o.type,id:o.id,start:A,config:o,duration:o.duration}),s},[]),n=r.map(({id:s})=>t.find(({id:o})=>o===s)??i.find(({id:o})=>o===s)).filter(Boolean);return{type:"audio",scenes:t,gapScenes:i,mergedScenes:n,config:r,duration:Math.max(...n.map(({start:s,duration:o})=>s+o))}}function al(r){return r.type==="fade"}function ll(r){return r.type==="translate"}function Al(r){return r.type==="clip"}async function xh({node:r,canvases:e,sceneTime:t,parentOpacity:i=1,parentTransform:n,debug:s=!1}){var o,a,A;const l=e.sceneCanvas.getContext("2d");if(l){l.save(),l.setTransform(n);const c=(r.element.animations??[]).reduce((g,p)=>(g[p.type]||(g[p.type]=[]),g[p.type].push(p),g),{});let h=((o=r.element.layout)==null?void 0:o.opacity)??1,d={x:0,y:0},f=null;for(const g of Object.keys(c)){const p=c[g].reduce((y,C)=>(C.start<=t&&(y=C),y),null),v=p?c[g].indexOf(p):-1,B=c[g][v+1];p?(al(p)&&(h=p.to),ll(p)&&(d={x:p.to.x,y:p.to.y}),Al(p)&&(f={x:p.to.x,y:p.to.y,width:p.to.width,height:p.to.height})):B&&(al(B)&&(h=B.from),ll(B)&&(d={x:B.from.x,y:B.from.y}),Al(B)&&(f={x:B.from.x,y:B.from.y,width:B.from.width,height:B.from.height}));for(const y of c[g]){const{start:C,duration:x}=y;if(t>=C&&t<C+x){if(al(y)){const{from:w,to:D,easing:F}=y;h=ol([C,C+x],[w,D],{ease:F})(t)}if(ll(y)){const{from:w,to:D,easing:F}=y;d=ol([C,C+x],[w,D],{ease:F})(t)}if(Al(y)){const{from:w,to:D,easing:F}=y;f=ol([C,C+x],[w,D],{ease:F})(t)}}}}if(l.globalAlpha=h*i,l.translate(d.x,d.y),f){l.beginPath();const g={x:r.x+f.x*r.width,y:r.y+f.y*r.height,width:f.width*r.width,height:f.height*r.height};l.rect(g.x,g.y,g.width,g.height),l.clip()}s&&(l.strokeStyle="red",l.strokeRect(r.x,r.y,r.width,r.height)),await((A=(a=r.renderer)==null?void 0:a.render)==null?void 0:A.call(a,{canvases:e,sceneTime:t,dx:r.x,dy:r.y,dw:r.width,dh:r.height,radius:r.radius,options:r.options,dependencies:r.dependencies}));for await(const g of r.childNodes)await xh({debug:s,node:g,canvases:e,sceneTime:t,parentOpacity:l.globalAlpha,parentTransform:l.getTransform()});l.restore()}}async function wv({layout:r,canvases:e,sceneTime:t,debug:i=!1}){const{node:n}=r;await xh({debug:i,node:n,canvases:e,sceneTime:t})}async function zs({debug:r=!1,scene:e,start:t=0,resolvers:i,rootWidth:n,rootHeight:s,canvasFactory:o=Bh}){var a,A;const{id:l,x:u,y:c,width:h,height:d,root:f,duration:g}=e,p=o(),v=o(),B=o(),y=o(),C=o(),x=await Ih({id:l,root:{...f,layout:{...f.layout,width:n,height:s},element:{...f.element,layout:{...f.element.layout,...typeof u=="number"&&typeof c=="number"?{position:"absolute",inset:{top:c,left:u}}:{},width:h??((a=f.element.layout)==null?void 0:a.width),height:d??((A=f.element.layout)==null?void 0:A.height)}}},resolvers:i,measureCanvas:C}),w=async D=>{const F=Math.max(0,D-t);p.width=p.height=0,p.width=n,p.height=s,await wv({debug:r,layout:x,sceneTime:F,canvases:{sceneCanvas:p,cropCanvas:v,letterboxCanvas:B,posterCanvas:y}})};return{id:l,type:e.type,start:t,duration:g,layout:x,sceneCanvas:p,draw:w,config:e,childScenes:bh({node:x.node,duration:g})}}async function Rv({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Xs(e),a=await Promise.all(e.reduce((c,h,d)=>{const f=Vt(o.slice(0,d));return h.type==="caption"&&c.push(zs({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),c},[])),A=e.reduce((c,h,d)=>{if(h.type!=="gap")return c;const f=Vt(o.slice(0,d));return c.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),c},[]),l=e.reduce((c,h,d)=>{if(h.type!=="transition")return c;const f=h.duration,g=Vt(o.slice(0,d))-f;return c.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var v;return p===((v=e[d+1])==null?void 0:v.id)}),from:a.find(({id:p})=>{var v;return p===((v=e[d-1])==null?void 0:v.id)})}),c},[]),u=e.map(({id:c})=>a.find(({id:h})=>h===c)??A.find(({id:h})=>h===c)??l.find(({id:h})=>h===c)).filter(Boolean);return{type:"caption",scenes:a,gapScenes:A,transitions:l,mergedScenes:u,duration:Math.max(...u.map(({start:c,duration:h})=>c+h)),trackCanvas:s()}}async function Dv({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Xs(e),a=await Promise.all(e.reduce((c,h,d)=>{const f=Vt(o.slice(0,d));return h.type==="video"&&c.push(zs({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),h.type==="image"&&c.push(zs({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),c},[])),A=e.reduce((c,h,d)=>{if(h.type!=="gap")return c;const f=Vt(o.slice(0,d));return c.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),c},[]),l=e.reduce((c,h,d)=>{if(h.type!=="transition")return c;const f=h.duration,g=Vt(o.slice(0,d))-f;return c.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var v;return p===((v=e[d+1])==null?void 0:v.id)}),from:a.find(({id:p})=>{var v;return p===((v=e[d-1])==null?void 0:v.id)})}),c},[]),u=e.map(({id:c})=>a.find(({id:h})=>h===c)??A.find(({id:h})=>h===c)??l.find(({id:h})=>h===c)).filter(Boolean);return{type:"picture",scenes:a,gapScenes:A,transitions:l,mergedScenes:u,duration:Math.max(0,...u.map(({start:c,duration:h})=>c+h)),trackCanvas:s()}}async function Lv({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Xs(e),a=await Promise.all(e.reduce((c,h,d)=>{const f=Vt(o.slice(0,d));return h.type==="text"&&c.push(zs({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),c},[])),A=e.reduce((c,h,d)=>{if(h.type!=="gap")return c;const f=Vt(o.slice(0,d));return c.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),c},[]),l=e.reduce((c,h,d)=>{if(h.type!=="transition")return c;const f=h.duration,g=Vt(o.slice(0,d))-f;return c.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var v;return p===((v=e[d+1])==null?void 0:v.id)}),from:a.find(({id:p})=>{var v;return p===((v=e[d-1])==null?void 0:v.id)})}),c},[]),u=e.map(({id:c})=>a.find(({id:h})=>h===c)??A.find(({id:h})=>h===c)??l.find(({id:h})=>h===c)).filter(Boolean);return{type:"text",scenes:a,gapScenes:A,transitions:l,mergedScenes:u,duration:Math.max(...u.map(({start:c,duration:h})=>c+h)),trackCanvas:s()}}function kv(r){return r.some(({type:e})=>e==="text")}function Mv(r){return r.some(({type:e})=>e==="caption")}function Fv(r){return r.some(({type:e})=>e==="audio")}function Nv(r){return r.some(({type:e})=>e==="video"||e==="image")}function Pv(r){return r.type==="audio"}const Ov=(((dh=hh)==null?void 0:dh.default)??hh).reduce((r,e)=>(r[e.name]=e,r),{});function Uv(r,e){return r.has(e)||r.set(e,{buffer:null,transitions:{},fromTexture:null,toTexture:null}),r.get(e)}function Gv({name:r,to:e,from:t,progress:i,width:n,height:s,glContext:o,contextResources:a,returnPixels:A=!0}){var l,u,c;const h=Uv(a,o);if(o.disable(o.DEPTH_TEST),h.buffer?o.bindBuffer(o.ARRAY_BUFFER,h.buffer):(h.buffer=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,h.buffer),o.bufferData(o.ARRAY_BUFFER,new Float32Array([-1,-1,-1,4,4,-1]),o.STATIC_DRAW)),o.viewport(0,0,n,s),h.fromTexture?h.fromTexture.setPixels(t):(h.fromTexture=(((l=Ks)==null?void 0:l.default)??Ks)(o,t),h.fromTexture.minFilter=o.LINEAR,h.fromTexture.magFilter=o.LINEAR),h.toTexture?h.toTexture.setPixels(e):(h.toTexture=(((u=Ks)==null?void 0:u.default)??Ks)(o,e),h.toTexture.minFilter=o.LINEAR,h.toTexture.magFilter=o.LINEAR),h.transitions[r]||(h.transitions[r]=(((c=uh)==null?void 0:c.default)??uh)(o,Ov[r])),h.transitions[r].draw(i,h.fromTexture,h.toTexture,n,s),!A)return o.flush(),new Uint8Array(0);const f=new Uint8Array(n*s*4);return o.readPixels(0,0,n,s,o.RGBA,o.UNSIGNED_BYTE,f),o.flush(),f}function $v(r){for(const[e,t]of r.entries())t.buffer&&e.deleteBuffer(t.buffer),t.fromTexture&&t.fromTexture.dispose(),t.toTexture&&t.toTexture.dispose(),Object.values(t.transitions).forEach(i=>{i.dispose()}),r.delete(e)}function Hv({name:r,to:e,from:t,progress:i,canvas:n,contextResources:s}){const o=n.getContext("webgl",{alpha:!0,depth:!1,antialias:!1,preserveDrawingBuffer:!1});o&&(o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!0),Gv({name:r,to:e,from:t,progress:i,width:n.width,height:n.height,glContext:o,contextResources:s,returnPixels:!1}))}async function Qh({debug:r=!1,config:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s=Bh,drawTransition:o=Hv}){const a=new Map,A=await Promise.all(e.tracks.map(async c=>{if(Nv(c))return{...await Dv({debug:r,track:c,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:c};if(kv(c))return{...await Lv({debug:r,track:c,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:c};if(Mv(c))return{...await Rv({debug:r,track:c,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:c};if(Fv(c))return{...await _v({track:c}),config:c};throw new Error("Unknown track type")}));return{draw:async({canvas:c,currentTime:h})=>{const d=c.getContext("2d");if(d){d.globalAlpha=1,d.globalCompositeOperation="source-over",d.clearRect(0,0,c.width,c.height),d.save(),d.fillStyle="black",d.fillRect(0,0,c.width,c.height),d.restore();for await(const f of A){if(Pv(f))continue;const{scenes:g,transitions:p,trackCanvas:v}=f;v.width=v.height=0,v.width=c.width,v.height=c.height;const B=v.getContext("2d"),y=g.filter(({start:x,duration:w})=>h>=x&&h<x+w);if(!B||y.length<=0)continue;const C=p.find(({start:x,duration:w})=>h>=x&&h<x+w);for await(const{sceneCanvas:x,draw:w}of y)await(w==null?void 0:w(h)),(!C||C&&(!C.to||!C.from))&&B.drawImage(x,0,0,x.width,x.height);if(C&&C.to&&C.from){const{name:x,to:w,from:D,duration:F,transitionCanvas:O}=C;O.width=O.height=0,O.width=v.width,O.height=v.height;const M=Math.min(1,Math.max(0,(h-w.start)/F));await o({name:x,progress:M,contextResources:a,to:w.sceneCanvas,from:D.sceneCanvas,canvas:O}),B.globalCompositeOperation="lighter",B.drawImage(O,0,0,O.width,O.height)}d.drawImage(v,0,0,v.width,v.height)}}},cleanup:()=>{$v(a)},tracks:A,aspectRatio:e.aspectRatio,duration:Math.max(...A.map(({duration:c})=>c))}}const Yv={version:"4.4.1"};function Vv(r){const{publicApiUrl:e}=Bs(r),t=hr();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function Kv(r){var s,o,a,A,l,u,c,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:hr()};let e=(o=(s=window.localStorage)==null?void 0:s.getItem)==null?void 0:o.call(s,"vouch-uid-visitor"),t=(A=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:A.call(a,"vouch-uid-client"),i=(u=(l=window.sessionStorage)==null?void 0:l.getItem)==null?void 0:u.call(l,"vouch-uid-tab");const n=hr();return e||(e=Vv(r),(h=(c=window.localStorage)==null?void 0:c.setItem)==null||h.call(c,"vouch-uid-visitor",e)),t||(t=hr(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),i||(i=hr(),(p=(g=window.sessionStorage)==null?void 0:g.setItem)==null||p.call(g,"vouch-uid-tab",i)),{client:t,tab:i,request:n,visitor:e}}function Wv(r,e){return r&&"vouchId"in r?r.vouchId:(e==null?void 0:e.id)??null}function qv(r="embedded_player"){var n,s;const[e,t]=((s=(n=Intl.DateTimeFormat().resolvedOptions().timeZone)==null?void 0:n.split)==null?void 0:s.call(n,"/"))??[],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:r,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:Yv.version,templateVersion:xv,...i}}const _h=1;class Jv{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,i)=>{const n=Wv(i,this.host.vouch);!n||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...i,vouchId:n,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=Bs(this.host.env),{client:i,tab:n,request:s,visitor:o}=Kv(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":i,"x-uid-tab":n,"x-uid-request":s,"x-uid-visitor":o,"x-reporting-metadata":qv(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:i}=this._currentlyPlayingVideo;this._streamLatestTime[i]>this._streamStartTime[i]+_h&&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:n}})=>{this.host.paused||(this._currentlyPlayingVideo={id:t,key:i,node:n},this._streamLatestTime[i]=n.currentTime,this._streamStartTime[i]||(this._streamStartTime[i]=n.currentTime,this._streamLatestTime[i]=n.currentTime))},this._handleVideoPause=({detail:{id:t,key:i}})=>{this._streamLatestTime[i]>this._streamStartTime[i]+_h&&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,n;"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),(n=this.host.mediaPlayer)==null||n.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,i,n;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),(n=this.host.mediaPlayer)==null||n.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var cl={exports:{}};(function(r,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Gi<"u"&&Gi,i=function(){function s(){this.fetch=!1,this.DOMException=t.DOMException}return s.prototype=t,new s}();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof Gi<"u"&&Gi||{},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(L){return L&&DataView.prototype.isPrototypeOf(L)}if(A.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(L){return L&&u.indexOf(Object.prototype.toString.call(L))>-1};function h(L){if(typeof L!="string"&&(L=String(L)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(L)||L==="")throw new TypeError('Invalid character in header field name: "'+L+'"');return L.toLowerCase()}function d(L){return typeof L!="string"&&(L=String(L)),L}function f(L){var U={next:function(){var J=L.shift();return{done:J===void 0,value:J}}};return A.iterable&&(U[Symbol.iterator]=function(){return U}),U}function g(L){this.map={},L instanceof g?L.forEach(function(U,J){this.append(J,U)},this):Array.isArray(L)?L.forEach(function(U){if(U.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+U.length);this.append(U[0],U[1])},this):L&&Object.getOwnPropertyNames(L).forEach(function(U){this.append(U,L[U])},this)}g.prototype.append=function(L,U){L=h(L),U=d(U);var J=this.map[L];this.map[L]=J?J+", "+U:U},g.prototype.delete=function(L){delete this.map[h(L)]},g.prototype.get=function(L){return L=h(L),this.has(L)?this.map[L]:null},g.prototype.has=function(L){return this.map.hasOwnProperty(h(L))},g.prototype.set=function(L,U){this.map[h(L)]=d(U)},g.prototype.forEach=function(L,U){for(var J in this.map)this.map.hasOwnProperty(J)&&L.call(U,this.map[J],J,this)},g.prototype.keys=function(){var L=[];return this.forEach(function(U,J){L.push(J)}),f(L)},g.prototype.values=function(){var L=[];return this.forEach(function(U){L.push(U)}),f(L)},g.prototype.entries=function(){var L=[];return this.forEach(function(U,J){L.push([J,U])}),f(L)},A.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function p(L){if(!L._noBody){if(L.bodyUsed)return Promise.reject(new TypeError("Already read"));L.bodyUsed=!0}}function v(L){return new Promise(function(U,J){L.onload=function(){U(L.result)},L.onerror=function(){J(L.error)}})}function B(L){var U=new FileReader,J=v(U);return U.readAsArrayBuffer(L),J}function y(L){var U=new FileReader,J=v(U),R=/charset=([A-Za-z0-9_-]+)/.exec(L.type),_=R?R[1]:"utf-8";return U.readAsText(L,_),J}function C(L){for(var U=new Uint8Array(L),J=new Array(U.length),R=0;R<U.length;R++)J[R]=String.fromCharCode(U[R]);return J.join("")}function x(L){if(L.slice)return L.slice(0);var U=new Uint8Array(L.byteLength);return U.set(new Uint8Array(L)),U.buffer}function w(){return this.bodyUsed=!1,this._initBody=function(L){this.bodyUsed=this.bodyUsed,this._bodyInit=L,L?typeof L=="string"?this._bodyText=L:A.blob&&Blob.prototype.isPrototypeOf(L)?this._bodyBlob=L:A.formData&&FormData.prototype.isPrototypeOf(L)?this._bodyFormData=L:A.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)?this._bodyText=L.toString():A.arrayBuffer&&A.blob&&l(L)?(this._bodyArrayBuffer=x(L.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):A.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(L)||c(L))?this._bodyArrayBuffer=x(L):this._bodyText=L=Object.prototype.toString.call(L):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof L=="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(L)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},A.blob&&(this.blob=function(){var L=p(this);if(L)return L;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 L=p(this);return L||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(A.blob)return this.blob().then(B);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var L=p(this);if(L)return L;if(this._bodyBlob)return y(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(M)}),this.json=function(){return this.text().then(JSON.parse)},this}var D=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function F(L){var U=L.toUpperCase();return D.indexOf(U)>-1?U:L}function O(L,U){if(!(this instanceof O))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');U=U||{};var J=U.body;if(L instanceof O){if(L.bodyUsed)throw new TypeError("Already read");this.url=L.url,this.credentials=L.credentials,U.headers||(this.headers=new g(L.headers)),this.method=L.method,this.mode=L.mode,this.signal=L.signal,!J&&L._bodyInit!=null&&(J=L._bodyInit,L.bodyUsed=!0)}else this.url=String(L);if(this.credentials=U.credentials||this.credentials||"same-origin",(U.headers||!this.headers)&&(this.headers=new g(U.headers)),this.method=F(U.method||this.method||"GET"),this.mode=U.mode||this.mode||null,this.signal=U.signal||this.signal||function(){if("AbortController"in a){var k=new AbortController;return k.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&J)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(J),(this.method==="GET"||this.method==="HEAD")&&(U.cache==="no-store"||U.cache==="no-cache")){var R=/([?&])_=[^&]*/;if(R.test(this.url))this.url=this.url.replace(R,"$1_="+new Date().getTime());else{var _=/\?/;this.url+=(_.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}O.prototype.clone=function(){return new O(this,{body:this._bodyInit})};function M(L){var U=new FormData;return L.trim().split("&").forEach(function(J){if(J){var R=J.split("="),_=R.shift().replace(/\+/g," "),k=R.join("=").replace(/\+/g," ");U.append(decodeURIComponent(_),decodeURIComponent(k))}}),U}function j(L){var U=new g,J=L.replace(/\r?\n[\t ]+/g," ");return J.split("\r").map(function(R){return R.indexOf(`
2476
+ `).flatMap(a=>{const A=a.split(" ").filter(Boolean);return A.length?A.slice(1).reduce((l,u,c)=>{const d=`${l[l.length-1].text} ${u}`.trim(),f=e.measureText(d);if(f.width>n)l=[...l,...yh({context:e,word:u,maxW:n})];else{const g=t[c%t.length];e.font=r.replace(Mn,g.toString()),l[l.length-1]={text:d,metrics:f}}return l},yh({context:e,word:A[0],maxW:n})):{text:"",metrics:e.measureText("")}})}finally{e.restore()}},{cacheKey:([{font:r,fontSizes:e,text:t,maxW:i,letterSpacing:n}])=>`${r}_${JSON.stringify(e)}_${t}_${i}_${n}`});Ds(({font:r,text:e,scale:t,context:i,maxW:n,maxH:s,minSize:o,maxSize:a,letterSpacing:A=0})=>{var l,u;let c=0;if(a){c=(o??0)*t;let d=0;for(;a*t>c+1;){c+=1;const f=yv({font:r,context:i,fontSizes:[c],text:e,maxW:n,letterSpacing:A});if(d=f.reduce((g,p)=>(p.metrics.width>g&&(g=p.metrics.width),g),0),d>n||f.length*c>s){c-=1;break}}}else c=parseFloat(((u=(l=r.match(Mn))==null?void 0:l.groups)==null?void 0:u.value)??"0")*t;return c},{cacheKey:([{font:r,text:e,scale:t,maxW:i,maxH:n,minSize:s,maxSize:o,letterSpacing:a}])=>`${r}_${e}_${s}_${o}_${t}_${i}_${n}_${a}`});const Bv={type:"text"},Tv={type:"video"};function Bh(){return document.createElement("canvas")}function Sv(r,e){return Object.keys(r).reduce((t,i)=>(e.includes(i)||(t[i]=r[i]),t),{})}function Vt(r){let e=0;for(const t of r)Array.isArray(t)?e+=Vt(t):e+=t;return e}function Xs(r){return r.map(({type:e,duration:t},i)=>{var n,s,o,a;if(e==="transition"){const A=((n=r[i-2])==null?void 0:n.type)==="transition"?r[i-2]:null,l=((s=r[i-1])==null?void 0:s.duration)??1/0,u=((o=r[i+1])==null?void 0:o.duration)??1/0,c=((a=r[i+2])==null?void 0:a.type)==="transition"?r[i+2]:null;return Math.min(A?l/2:l,t,c?u/2:u)*-1}return t})}function Th(r){var e;return{...r,children:((e=r.children)==null?void 0:e.map(t=>{if(!t.renderer)return Th(t)}).filter(Boolean))??[]}}function Sh(r){const e={box:0,image:0,video:0,text:0,audio:0,gradient:0,caption:0};r.renderer&&(e[r.renderer.type]+=1);for(const t of r.children??[]){const{box:i,image:n,video:s,text:o,audio:a,gradient:A,caption:l}=Sh(t);e.box+=i,e.image+=n,e.video+=s,e.text+=o,e.audio+=a,e.gradient+=A,e.caption+=l}return e}function bv(r){return r.video>0?Tv.type:r.image>0?Cv.type:r.audio>0?mv.type:r.caption>0?vv.type:Bv.type}function bh({node:r,duration:e,parentAnimations:t=[]}){const i=[],n=[...r.element.animations??[],...t];if(r.renderer){const s=Th({...r.element,animations:n,layout:{...r.element.layout?Sv(r.element.layout,["maxWidth","maxHeight"]):{},width:"100%",height:"100%",margin:0}}),o=Sh(s);i.push({type:bv(o),id:Av(),x:r.x,y:r.y,width:r.width,height:r.height,duration:e,root:{element:s}})}for(const s of r.childNodes)i.push(...bh({node:s,duration:e,parentAnimations:n}));return i}Op.filters.define("parse",r=>typeof r>"u"?null:typeof r=="string"?`"${gv(r)}"`:fv(r)||Array.isArray(r)?JSON.stringify(r):r);const xv="3";async function Qv({scene:r,start:e=0}){const{id:t,root:i,duration:n}=r,s=await Ih({id:t,root:i});return{type:r.type,start:e,duration:n,layout:s,id:r.id,config:r}}async function _v({track:r}){const e=Xs(r),t=await Promise.all(r.reduce((s,o,a)=>{if(o.type!=="audio")return s;const A=Vt(e.slice(0,a));return s.push(Qv({scene:o,start:A})),s},[])),i=r.reduce((s,o,a)=>{if(o.type!=="gap")return s;const A=Vt(e.slice(0,a));return s.push({type:o.type,id:o.id,start:A,config:o,duration:o.duration}),s},[]),n=r.map(({id:s})=>t.find(({id:o})=>o===s)??i.find(({id:o})=>o===s)).filter(Boolean);return{type:"audio",scenes:t,gapScenes:i,mergedScenes:n,config:r,duration:Math.max(...n.map(({start:s,duration:o})=>s+o))}}function al(r){return r.type==="fade"}function ll(r){return r.type==="translate"}function Al(r){return r.type==="clip"}async function xh({node:r,canvases:e,sceneTime:t,parentOpacity:i=1,parentTransform:n,debug:s=!1}){var o,a,A;const l=e.sceneCanvas.getContext("2d");if(l){l.save(),l.setTransform(n);const c=(r.element.animations??[]).reduce((g,p)=>(g[p.type]||(g[p.type]=[]),g[p.type].push(p),g),{});let h=((o=r.element.layout)==null?void 0:o.opacity)??1,d={x:0,y:0},f=null;for(const g of Object.keys(c)){const p=c[g].reduce((y,C)=>(C.start<=t&&(y=C),y),null),v=p?c[g].indexOf(p):-1,B=c[g][v+1];p?(al(p)&&(h=p.to),ll(p)&&(d={x:p.to.x,y:p.to.y}),Al(p)&&(f={x:p.to.x,y:p.to.y,width:p.to.width,height:p.to.height})):B&&(al(B)&&(h=B.from),ll(B)&&(d={x:B.from.x,y:B.from.y}),Al(B)&&(f={x:B.from.x,y:B.from.y,width:B.from.width,height:B.from.height}));for(const y of c[g]){const{start:C,duration:x}=y;if(t>=C&&t<C+x){if(al(y)){const{from:w,to:D,easing:F}=y;h=ol([C,C+x],[w,D],{ease:F})(t)}if(ll(y)){const{from:w,to:D,easing:F}=y;d=ol([C,C+x],[w,D],{ease:F})(t)}if(Al(y)){const{from:w,to:D,easing:F}=y;f=ol([C,C+x],[w,D],{ease:F})(t)}}}}if(l.globalAlpha=h*i,l.translate(d.x,d.y),f){l.beginPath();const g={x:r.x+f.x*r.width,y:r.y+f.y*r.height,width:f.width*r.width,height:f.height*r.height};l.rect(g.x,g.y,g.width,g.height),l.clip()}s&&(l.strokeStyle="red",l.strokeRect(r.x,r.y,r.width,r.height)),await((A=(a=r.renderer)==null?void 0:a.render)==null?void 0:A.call(a,{canvases:e,sceneTime:t,dx:r.x,dy:r.y,dw:r.width,dh:r.height,radius:r.radius,options:r.options,dependencies:r.dependencies}));for await(const g of r.childNodes)await xh({debug:s,node:g,canvases:e,sceneTime:t,parentOpacity:l.globalAlpha,parentTransform:l.getTransform()});l.restore()}}async function wv({layout:r,canvases:e,sceneTime:t,debug:i=!1}){const{node:n}=r;await xh({debug:i,node:n,canvases:e,sceneTime:t})}async function zs({debug:r=!1,scene:e,start:t=0,resolvers:i,rootWidth:n,rootHeight:s,canvasFactory:o=Bh}){var a,A;const{id:l,x:u,y:c,width:h,height:d,root:f,duration:g}=e,p=o(),v=o(),B=o(),y=o(),C=o(),x=await Ih({id:l,root:{...f,layout:{...f.layout,width:n,height:s},element:{...f.element,layout:{...f.element.layout,...typeof u=="number"&&typeof c=="number"?{position:"absolute",inset:{top:c,left:u}}:{},width:h??((a=f.element.layout)==null?void 0:a.width),height:d??((A=f.element.layout)==null?void 0:A.height)}}},resolvers:i,measureCanvas:C}),w=async D=>{const F=Math.max(0,D-t);p.width=p.height=0,p.width=n,p.height=s,await wv({debug:r,layout:x,sceneTime:F,canvases:{sceneCanvas:p,cropCanvas:v,letterboxCanvas:B,posterCanvas:y}})};return{id:l,type:e.type,start:t,duration:g,layout:x,sceneCanvas:p,draw:w,config:e,childScenes:bh({node:x.node,duration:g})}}async function Rv({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Xs(e),a=await Promise.all(e.reduce((c,h,d)=>{const f=Vt(o.slice(0,d));return h.type==="caption"&&c.push(zs({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),c},[])),A=e.reduce((c,h,d)=>{if(h.type!=="gap")return c;const f=Vt(o.slice(0,d));return c.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),c},[]),l=e.reduce((c,h,d)=>{if(h.type!=="transition")return c;const f=h.duration,g=Vt(o.slice(0,d))-f;return c.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var v;return p===((v=e[d+1])==null?void 0:v.id)}),from:a.find(({id:p})=>{var v;return p===((v=e[d-1])==null?void 0:v.id)})}),c},[]),u=e.map(({id:c})=>a.find(({id:h})=>h===c)??A.find(({id:h})=>h===c)??l.find(({id:h})=>h===c)).filter(Boolean);return{type:"caption",scenes:a,gapScenes:A,transitions:l,mergedScenes:u,duration:Math.max(...u.map(({start:c,duration:h})=>c+h)),trackCanvas:s()}}async function Dv({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Xs(e),a=await Promise.all(e.reduce((c,h,d)=>{const f=Vt(o.slice(0,d));return h.type==="video"&&c.push(zs({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),h.type==="image"&&c.push(zs({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),c},[])),A=e.reduce((c,h,d)=>{if(h.type!=="gap")return c;const f=Vt(o.slice(0,d));return c.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),c},[]),l=e.reduce((c,h,d)=>{if(h.type!=="transition")return c;const f=h.duration,g=Vt(o.slice(0,d))-f;return c.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var v;return p===((v=e[d+1])==null?void 0:v.id)}),from:a.find(({id:p})=>{var v;return p===((v=e[d-1])==null?void 0:v.id)})}),c},[]),u=e.map(({id:c})=>a.find(({id:h})=>h===c)??A.find(({id:h})=>h===c)??l.find(({id:h})=>h===c)).filter(Boolean);return{type:"picture",scenes:a,gapScenes:A,transitions:l,mergedScenes:u,duration:Math.max(0,...u.map(({start:c,duration:h})=>c+h)),trackCanvas:s()}}async function Lv({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Xs(e),a=await Promise.all(e.reduce((c,h,d)=>{const f=Vt(o.slice(0,d));return h.type==="text"&&c.push(zs({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),c},[])),A=e.reduce((c,h,d)=>{if(h.type!=="gap")return c;const f=Vt(o.slice(0,d));return c.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),c},[]),l=e.reduce((c,h,d)=>{if(h.type!=="transition")return c;const f=h.duration,g=Vt(o.slice(0,d))-f;return c.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var v;return p===((v=e[d+1])==null?void 0:v.id)}),from:a.find(({id:p})=>{var v;return p===((v=e[d-1])==null?void 0:v.id)})}),c},[]),u=e.map(({id:c})=>a.find(({id:h})=>h===c)??A.find(({id:h})=>h===c)??l.find(({id:h})=>h===c)).filter(Boolean);return{type:"text",scenes:a,gapScenes:A,transitions:l,mergedScenes:u,duration:Math.max(...u.map(({start:c,duration:h})=>c+h)),trackCanvas:s()}}function kv(r){return r.some(({type:e})=>e==="text")}function Mv(r){return r.some(({type:e})=>e==="caption")}function Fv(r){return r.some(({type:e})=>e==="audio")}function Nv(r){return r.some(({type:e})=>e==="video"||e==="image")}function Pv(r){return r.type==="audio"}const Ov=(((dh=hh)==null?void 0:dh.default)??hh).reduce((r,e)=>(r[e.name]=e,r),{});function Uv(r,e){return r.has(e)||r.set(e,{buffer:null,transitions:{},fromTexture:null,toTexture:null}),r.get(e)}function Gv({name:r,to:e,from:t,progress:i,width:n,height:s,glContext:o,contextResources:a,returnPixels:A=!0}){var l,u,c;const h=Uv(a,o);if(o.disable(o.DEPTH_TEST),h.buffer?o.bindBuffer(o.ARRAY_BUFFER,h.buffer):(h.buffer=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,h.buffer),o.bufferData(o.ARRAY_BUFFER,new Float32Array([-1,-1,-1,4,4,-1]),o.STATIC_DRAW)),o.viewport(0,0,n,s),h.fromTexture?h.fromTexture.setPixels(t):(h.fromTexture=(((l=Ks)==null?void 0:l.default)??Ks)(o,t),h.fromTexture.minFilter=o.LINEAR,h.fromTexture.magFilter=o.LINEAR),h.toTexture?h.toTexture.setPixels(e):(h.toTexture=(((u=Ks)==null?void 0:u.default)??Ks)(o,e),h.toTexture.minFilter=o.LINEAR,h.toTexture.magFilter=o.LINEAR),h.transitions[r]||(h.transitions[r]=(((c=uh)==null?void 0:c.default)??uh)(o,Ov[r])),h.transitions[r].draw(i,h.fromTexture,h.toTexture,n,s),!A)return o.flush(),new Uint8Array(0);const f=new Uint8Array(n*s*4);return o.readPixels(0,0,n,s,o.RGBA,o.UNSIGNED_BYTE,f),o.flush(),f}function $v(r){for(const[e,t]of r.entries())t.buffer&&e.deleteBuffer(t.buffer),t.fromTexture&&t.fromTexture.dispose(),t.toTexture&&t.toTexture.dispose(),Object.values(t.transitions).forEach(i=>{i.dispose()}),r.delete(e)}function Hv({name:r,to:e,from:t,progress:i,canvas:n,contextResources:s}){const o=n.getContext("webgl",{alpha:!0,depth:!1,antialias:!1,preserveDrawingBuffer:!1});o&&(o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!0),Gv({name:r,to:e,from:t,progress:i,width:n.width,height:n.height,glContext:o,contextResources:s,returnPixels:!1}))}async function Qh({debug:r=!1,config:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s=Bh,drawTransition:o=Hv}){const a=new Map,A=await Promise.all(e.tracks.map(async c=>{if(Nv(c))return{...await Dv({debug:r,track:c,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:c};if(kv(c))return{...await Lv({debug:r,track:c,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:c};if(Mv(c))return{...await Rv({debug:r,track:c,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:c};if(Fv(c))return{...await _v({track:c}),config:c};throw new Error("Unknown track type")}));return{draw:async({canvas:c,currentTime:h})=>{const d=c.getContext("2d");if(d){d.globalAlpha=1,d.globalCompositeOperation="source-over",d.clearRect(0,0,c.width,c.height),d.save(),d.fillStyle="black",d.fillRect(0,0,c.width,c.height),d.restore();for await(const f of A){if(Pv(f))continue;const{scenes:g,transitions:p,trackCanvas:v}=f;v.width=v.height=0,v.width=c.width,v.height=c.height;const B=v.getContext("2d"),y=g.filter(({start:x,duration:w})=>h>=x&&h<x+w);if(!B||y.length<=0)continue;const C=p.find(({start:x,duration:w})=>h>=x&&h<x+w);for await(const{sceneCanvas:x,draw:w}of y)await(w==null?void 0:w(h)),(!C||C&&(!C.to||!C.from))&&B.drawImage(x,0,0,x.width,x.height);if(C&&C.to&&C.from){const{name:x,to:w,from:D,duration:F,transitionCanvas:O}=C;O.width=O.height=0,O.width=v.width,O.height=v.height;const M=Math.min(1,Math.max(0,(h-w.start)/F));await o({name:x,progress:M,contextResources:a,to:w.sceneCanvas,from:D.sceneCanvas,canvas:O}),B.globalCompositeOperation="lighter",B.drawImage(O,0,0,O.width,O.height)}d.drawImage(v,0,0,v.width,v.height)}}},cleanup:()=>{$v(a)},tracks:A,aspectRatio:e.aspectRatio,duration:Math.max(...A.map(({duration:c})=>c))}}const Yv={version:"4.4.2"};function Vv(r){const{publicApiUrl:e}=Bs(r),t=hr();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function Kv(r){var s,o,a,A,l,u,c,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:hr()};let e=(o=(s=window.localStorage)==null?void 0:s.getItem)==null?void 0:o.call(s,"vouch-uid-visitor"),t=(A=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:A.call(a,"vouch-uid-client"),i=(u=(l=window.sessionStorage)==null?void 0:l.getItem)==null?void 0:u.call(l,"vouch-uid-tab");const n=hr();return e||(e=Vv(r),(h=(c=window.localStorage)==null?void 0:c.setItem)==null||h.call(c,"vouch-uid-visitor",e)),t||(t=hr(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),i||(i=hr(),(p=(g=window.sessionStorage)==null?void 0:g.setItem)==null||p.call(g,"vouch-uid-tab",i)),{client:t,tab:i,request:n,visitor:e}}function Wv(r,e){return r&&"vouchId"in r?r.vouchId:(e==null?void 0:e.id)??null}function qv(r="embedded_player"){var n,s;const[e,t]=((s=(n=Intl.DateTimeFormat().resolvedOptions().timeZone)==null?void 0:n.split)==null?void 0:s.call(n,"/"))??[],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:r,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:Yv.version,templateVersion:xv,...i}}const _h=1;class Jv{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,i)=>{const n=Wv(i,this.host.vouch);!n||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...i,vouchId:n,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=Bs(this.host.env),{client:i,tab:n,request:s,visitor:o}=Kv(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":i,"x-uid-tab":n,"x-uid-request":s,"x-uid-visitor":o,"x-reporting-metadata":qv(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:i}=this._currentlyPlayingVideo;this._streamLatestTime[i]>this._streamStartTime[i]+_h&&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:n}})=>{this.host.paused||(this._currentlyPlayingVideo={id:t,key:i,node:n},this._streamLatestTime[i]=n.currentTime,this._streamStartTime[i]||(this._streamStartTime[i]=n.currentTime,this._streamLatestTime[i]=n.currentTime))},this._handleVideoPause=({detail:{id:t,key:i}})=>{this._streamLatestTime[i]>this._streamStartTime[i]+_h&&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,n;"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),(n=this.host.mediaPlayer)==null||n.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,i,n;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),(n=this.host.mediaPlayer)==null||n.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var cl={exports:{}};(function(r,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Gi<"u"&&Gi,i=function(){function s(){this.fetch=!1,this.DOMException=t.DOMException}return s.prototype=t,new s}();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof Gi<"u"&&Gi||{},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(L){return L&&DataView.prototype.isPrototypeOf(L)}if(A.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(L){return L&&u.indexOf(Object.prototype.toString.call(L))>-1};function h(L){if(typeof L!="string"&&(L=String(L)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(L)||L==="")throw new TypeError('Invalid character in header field name: "'+L+'"');return L.toLowerCase()}function d(L){return typeof L!="string"&&(L=String(L)),L}function f(L){var U={next:function(){var J=L.shift();return{done:J===void 0,value:J}}};return A.iterable&&(U[Symbol.iterator]=function(){return U}),U}function g(L){this.map={},L instanceof g?L.forEach(function(U,J){this.append(J,U)},this):Array.isArray(L)?L.forEach(function(U){if(U.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+U.length);this.append(U[0],U[1])},this):L&&Object.getOwnPropertyNames(L).forEach(function(U){this.append(U,L[U])},this)}g.prototype.append=function(L,U){L=h(L),U=d(U);var J=this.map[L];this.map[L]=J?J+", "+U:U},g.prototype.delete=function(L){delete this.map[h(L)]},g.prototype.get=function(L){return L=h(L),this.has(L)?this.map[L]:null},g.prototype.has=function(L){return this.map.hasOwnProperty(h(L))},g.prototype.set=function(L,U){this.map[h(L)]=d(U)},g.prototype.forEach=function(L,U){for(var J in this.map)this.map.hasOwnProperty(J)&&L.call(U,this.map[J],J,this)},g.prototype.keys=function(){var L=[];return this.forEach(function(U,J){L.push(J)}),f(L)},g.prototype.values=function(){var L=[];return this.forEach(function(U){L.push(U)}),f(L)},g.prototype.entries=function(){var L=[];return this.forEach(function(U,J){L.push([J,U])}),f(L)},A.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function p(L){if(!L._noBody){if(L.bodyUsed)return Promise.reject(new TypeError("Already read"));L.bodyUsed=!0}}function v(L){return new Promise(function(U,J){L.onload=function(){U(L.result)},L.onerror=function(){J(L.error)}})}function B(L){var U=new FileReader,J=v(U);return U.readAsArrayBuffer(L),J}function y(L){var U=new FileReader,J=v(U),R=/charset=([A-Za-z0-9_-]+)/.exec(L.type),_=R?R[1]:"utf-8";return U.readAsText(L,_),J}function C(L){for(var U=new Uint8Array(L),J=new Array(U.length),R=0;R<U.length;R++)J[R]=String.fromCharCode(U[R]);return J.join("")}function x(L){if(L.slice)return L.slice(0);var U=new Uint8Array(L.byteLength);return U.set(new Uint8Array(L)),U.buffer}function w(){return this.bodyUsed=!1,this._initBody=function(L){this.bodyUsed=this.bodyUsed,this._bodyInit=L,L?typeof L=="string"?this._bodyText=L:A.blob&&Blob.prototype.isPrototypeOf(L)?this._bodyBlob=L:A.formData&&FormData.prototype.isPrototypeOf(L)?this._bodyFormData=L:A.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)?this._bodyText=L.toString():A.arrayBuffer&&A.blob&&l(L)?(this._bodyArrayBuffer=x(L.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):A.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(L)||c(L))?this._bodyArrayBuffer=x(L):this._bodyText=L=Object.prototype.toString.call(L):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof L=="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(L)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},A.blob&&(this.blob=function(){var L=p(this);if(L)return L;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 L=p(this);return L||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(A.blob)return this.blob().then(B);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var L=p(this);if(L)return L;if(this._bodyBlob)return y(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(M)}),this.json=function(){return this.text().then(JSON.parse)},this}var D=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function F(L){var U=L.toUpperCase();return D.indexOf(U)>-1?U:L}function O(L,U){if(!(this instanceof O))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');U=U||{};var J=U.body;if(L instanceof O){if(L.bodyUsed)throw new TypeError("Already read");this.url=L.url,this.credentials=L.credentials,U.headers||(this.headers=new g(L.headers)),this.method=L.method,this.mode=L.mode,this.signal=L.signal,!J&&L._bodyInit!=null&&(J=L._bodyInit,L.bodyUsed=!0)}else this.url=String(L);if(this.credentials=U.credentials||this.credentials||"same-origin",(U.headers||!this.headers)&&(this.headers=new g(U.headers)),this.method=F(U.method||this.method||"GET"),this.mode=U.mode||this.mode||null,this.signal=U.signal||this.signal||function(){if("AbortController"in a){var k=new AbortController;return k.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&J)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(J),(this.method==="GET"||this.method==="HEAD")&&(U.cache==="no-store"||U.cache==="no-cache")){var R=/([?&])_=[^&]*/;if(R.test(this.url))this.url=this.url.replace(R,"$1_="+new Date().getTime());else{var _=/\?/;this.url+=(_.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}O.prototype.clone=function(){return new O(this,{body:this._bodyInit})};function M(L){var U=new FormData;return L.trim().split("&").forEach(function(J){if(J){var R=J.split("="),_=R.shift().replace(/\+/g," "),k=R.join("=").replace(/\+/g," ");U.append(decodeURIComponent(_),decodeURIComponent(k))}}),U}function j(L){var U=new g,J=L.replace(/\r?\n[\t ]+/g," ");return J.split("\r").map(function(R){return R.indexOf(`
2477
2477
  `)===0?R.substr(1,R.length):R}).forEach(function(R){var _=R.split(":"),k=_.shift().trim();if(k){var K=_.join(":").trim();try{U.append(k,K)}catch(Y){console.warn("Response "+Y.message)}}}),U}w.call(O.prototype);function X(L,U){if(!(this instanceof X))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(U||(U={}),this.type="default",this.status=U.status===void 0?200:U.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=U.statusText===void 0?"":""+U.statusText,this.headers=new g(U.headers),this.url=U.url||"",this._initBody(L)}w.call(X.prototype),X.prototype.clone=function(){return new X(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},X.error=function(){var L=new X(null,{status:200,statusText:""});return L.ok=!1,L.status=0,L.type="error",L};var le=[301,302,303,307,308];X.redirect=function(L,U){if(le.indexOf(U)===-1)throw new RangeError("Invalid status code");return new X(null,{status:U,headers:{location:L}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(U,J){this.message=U,this.name=J;var R=Error(U);this.stack=R.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function oe(L,U){return new Promise(function(J,R){var _=new O(L,U);if(_.signal&&_.signal.aborted)return R(new o.DOMException("Aborted","AbortError"));var k=new XMLHttpRequest;function K(){k.abort()}k.onload=function(){var ie={statusText:k.statusText,headers:j(k.getAllResponseHeaders()||"")};_.url.indexOf("file://")===0&&(k.status<200||k.status>599)?ie.status=200:ie.status=k.status,ie.url="responseURL"in k?k.responseURL:ie.headers.get("X-Request-URL");var he="response"in k?k.response:k.responseText;setTimeout(function(){J(new X(he,ie))},0)},k.onerror=function(){setTimeout(function(){R(new TypeError("Network request failed"))},0)},k.ontimeout=function(){setTimeout(function(){R(new TypeError("Network request timed out"))},0)},k.onabort=function(){setTimeout(function(){R(new o.DOMException("Aborted","AbortError"))},0)};function Y(ie){try{return ie===""&&a.location.href?a.location.href:ie}catch{return ie}}if(k.open(_.method,Y(_.url),!0),_.credentials==="include"?k.withCredentials=!0:_.credentials==="omit"&&(k.withCredentials=!1),"responseType"in k&&(A.blob?k.responseType="blob":A.arrayBuffer&&(k.responseType="arraybuffer")),U&&typeof U.headers=="object"&&!(U.headers instanceof g||a.Headers&&U.headers instanceof a.Headers)){var te=[];Object.getOwnPropertyNames(U.headers).forEach(function(ie){te.push(h(ie)),k.setRequestHeader(ie,d(U.headers[ie]))}),_.headers.forEach(function(ie,he){te.indexOf(he)===-1&&k.setRequestHeader(he,ie)})}else _.headers.forEach(function(ie,he){k.setRequestHeader(he,ie)});_.signal&&(_.signal.addEventListener("abort",K),k.onreadystatechange=function(){k.readyState===4&&_.signal.removeEventListener("abort",K)}),k.send(typeof _._bodyInit>"u"?null:_._bodyInit)})}return oe.polyfill=!0,a.fetch||(a.fetch=oe,a.Headers=g,a.Request=O,a.Response=X),o.Headers=g,o.Request=O,o.Response=X,o.fetch=oe,o})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=t.fetch?t:i;e=n.fetch,e.default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,r.exports=e})(cl,cl.exports);var jv=cl.exports;const wh=Ea(jv);async function Xv(r){var e;try{if((e=await wh(r,{method:"HEAD"}))!=null&&e.ok)return r}catch{return}}async function ul({sources:r}){let e=null;const t=r==null?void 0:r.filter(Boolean),i=t==null?void 0:t.find(s=>s.startsWith("blob:")),n=t==null?void 0:t.find(s=>!s.startsWith("http")&&!s.startsWith("blob:"));if(i||n)return i??n;if(t.length>0){const s=t.map(o=>Xv(o));e=(await Promise.all(s)).find(Boolean)}return e}async function zv(r){try{return(await wh(r)).text()}catch{return null}}async function Zv(r){return r=r.trim(),r.startsWith("http")||r.startsWith("blob:")?zv(r):r}const eC=$i(async({original:r,translation:e,originalLanguage:t="",translationLanguage:i=""},{language:n})=>{var s,o;const a={[(s=i==null?void 0:i.split("-"))==null?void 0:s[0]]:e,[(o=t==null?void 0:t.split("-"))==null?void 0:o[0]]:r},A=(n&&a[n])??r;return A?Zv(A):null},{cacheKey:([r,{language:e}])=>JSON.stringify({...r,language:e})});function tC(r){var e;return((e=r==null?void 0:r.items)==null?void 0:e.map(t=>{var i;return{text:(i=t.alternatives[0])==null?void 0:i.content,start:t.start_time,end:t.end_time}}))??[]}const iC=$i(async r=>{var e,t,i,n,s,o,a,A,l,u,c;const[h,d,f]=await Promise.all([ul({sources:[(t=(e=r==null?void 0:r.answer)==null?void 0:e.media)==null?void 0:t.video,(n=(i=r==null?void 0:r.answer)==null?void 0:i.media)==null?void 0:n.input]}),ul({sources:[(o=(s=r==null?void 0:r.answer)==null?void 0:s.media)==null?void 0:o.playlist]}),ul({sources:[((A=(a=r==null?void 0:r.answer)==null?void 0:a.media)==null?void 0:A.reducedQuality)??((c=(u=(l=r==null?void 0:r.answer)==null?void 0:l.media)==null?void 0:u.videos)==null?void 0:c.xs)]})]);return{src:h,playlist:d,preview:f}},{cacheKey:([r])=>{var e,t,i,n,s,o,a,A,l,u,c;return JSON.stringify({video:(t=(e=r==null?void 0:r.answer)==null?void 0:e.media)==null?void 0:t.video,input:(n=(i=r==null?void 0:r.answer)==null?void 0:i.media)==null?void 0:n.input,playlist:(o=(s=r==null?void 0:r.answer)==null?void 0:s.media)==null?void 0:o.playlist,preview:((A=(a=r==null?void 0:r.answer)==null?void 0:a.media)==null?void 0:A.reducedQuality)??((c=(u=(l=r==null?void 0:r.answer)==null?void 0:l.media)==null?void 0:u.videos)==null?void 0:c.xs)})}});function Rh(r){var e,t,i,n,s,o,a,A,l,u,c,h;const d=((t=(e=r==null?void 0:r.answer)==null?void 0:e.contact)==null?void 0:t.name)==="Anonymous"?"":((s=(n=(i=r==null?void 0:r.answer)==null?void 0:i.contact)==null?void 0:n.name)==null?void 0:s.trim())??"",f=((A=(a=(o=r==null?void 0:r.answer)==null?void 0:o.contact)==null?void 0:a.client)==null?void 0:A.name)==="Not Supplied"?"":((h=(c=(u=(l=r==null?void 0:r.answer)==null?void 0:l.contact)==null?void 0:u.client)==null?void 0:c.name)==null?void 0:h.trim())??"",[g,p]=d.split(" ");return{name:d,firstName:g,lastName:p,companyName:f}}const rC=$i(async(r,e,t)=>{var i,n,s;const o=(i=e==null?void 0:e.answer)==null?void 0:i.id;return((s=(n=r==null?void 0:r.questions)==null?void 0:n.items)==null?void 0:s.reduce((A,l)=>{var u;return((u=l==null?void 0:l.answer)==null?void 0:u.id)===o?(A??0)+1:A},0))<=1?o:`${o}-${t}`},{cacheKey:([r,e,t])=>{var i;return JSON.stringify({index:t,rootData:e,allQuestions:(i=r==null?void 0:r.questions)==null?void 0:i.items})}});async function hl({data:r,rootData:e,index:t},i){var n,s,o,a,A,l,u,c,h,d,f,g,p,v,B,y,C,x,w,D,F,O,M,j;const[X,le,oe]=await Promise.all([rC(r,e,t),iC(e),eC({original:((s=(n=e==null?void 0:e.answer)==null?void 0:n.media)==null?void 0:s.captions)??((a=(o=e==null?void 0:e.answer)==null?void 0:o.captions)==null?void 0:a.current),translation:((l=(A=e==null?void 0:e.answer)==null?void 0:A.media)==null?void 0:l.translation)??((c=(u=e==null?void 0:e.answer)==null?void 0:u.captions)==null?void 0:c.translation),originalLanguage:(d=(h=e==null?void 0:e.answer)==null?void 0:h.transcription)==null?void 0:d.language,translationLanguage:(p=(g=(f=e==null?void 0:e.answer)==null?void 0:f.transcription)==null?void 0:g.translation)==null?void 0:p.language},i)]),L=Rh(e);return{...le,...L,key:X,captions:oe,wordTimings:tC((v=e==null?void 0:e.answer)==null?void 0:v.transcription),answerLabel:((B=e==null?void 0:e.answer)==null?void 0:B.label)??(e==null?void 0:e.title),prevAnswerLabel:t?((w=(x=(C=(y=r==null?void 0:r.questions)==null?void 0:y.items)==null?void 0:C[t-1])==null?void 0:x.answer)==null?void 0:w.label)??((O=(F=(D=r==null?void 0:r.questions)==null?void 0:D.items)==null?void 0:F[t-1])==null?void 0:O.title)??null:null,isFirstInstanceOfName:t?((j=(M=r==null?void 0:r.questions)==null?void 0:M.items)==null?void 0:j.findIndex(U=>Rh(U).name===L.name))===t:!0}}const Zs={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 nC({data:r}){var e,t;return((t=(e=r==null?void 0:r.questions)==null?void 0:e.items)==null?void 0:t.reduce((i,n)=>{var s,o,a,A,l,u,c;const h=(a=(o=(s=n==null?void 0:n.answer)==null?void 0:s.transcription)==null?void 0:o.language)==null?void 0:a.split("-")[0],d=(c=(u=(l=(A=n==null?void 0:n.answer)==null?void 0:A.transcription)==null?void 0:l.translation)==null?void 0:u.language)==null?void 0:c.split("-")[0];return h&&Zs[h]&&!i.find(f=>f.value===h)&&i.push({value:h,label:Zs[h]}),d&&Zs[d]&&!i.find(f=>f.value===d)&&i.push({value:d,label:Zs[d]}),i},[]))??[]}/**
2478
2478
  * @license
2479
2479
  * Copyright 2018 Google LLC
@@ -2525,7 +2525,7 @@ Schedule: ${A.map(d=>Xi(d))}`),u.length&&this.log(`Removed events ${u}`),this.pl
2525
2525
  * @license
2526
2526
  * Copyright 2017 Google LLC
2527
2527
  * SPDX-License-Identifier: BSD-3-Clause
2528
- */const pg=(r,e,t)=>{const i=new Map;for(let n=e;n<=t;n++)i.set(r[n],n);return i},mg=kr(class extends Cn{constructor(r){if(super(r),r.type!==Lr.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const n=[],s=[];let o=0;for(const a of r)n[o]=i?i(a,o):o,s[o]=t(a,o),o++;return{values:s,keys:n}}render(r,e,t){return this.dt(r,e,t).values}update(r,[e,t,i]){const n=lp(r),{values:s,keys:o}=this.dt(e,t,i);if(!Array.isArray(n))return this.ut=o,s;const a=this.ut??(this.ut=[]),A=[];let l,u,c=0,h=n.length-1,d=0,f=s.length-1;for(;c<=h&&d<=f;)if(n[c]===null)c++;else if(n[h]===null)h--;else if(a[c]===o[d])A[d]=ur(n[c],s[d]),c++,d++;else if(a[h]===o[f])A[f]=ur(n[h],s[f]),h--,f--;else if(a[c]===o[f])A[f]=ur(n[c],s[f]),vn(r,A[f+1],n[c]),c++,f--;else if(a[h]===o[d])A[d]=ur(n[h],s[d]),vn(r,n[c],n[h]),h--,d++;else if(l===void 0&&(l=pg(o,d,f),u=pg(a,c,h)),l.has(a[c]))if(l.has(a[h])){const g=u.get(o[d]),p=g!==void 0?n[g]:null;if(p===null){const v=vn(r,n[c]);ur(v,s[d]),A[d]=v}else A[d]=ur(p,s[d]),vn(r,n[c],p),n[g]=null;d++}else ha(n[h]),h--;else ha(n[c]),c++;for(;d<=f;){const g=vn(r,A[f+1]);ur(g,s[d]),A[d++]=g}for(;c<=h;){const g=n[c++];g!==null&&ha(g)}return this.ut=o,ap(r,A),Fi}});var Pt="top",Jt="bottom",jt="right",Ot="left",TA="auto",Jn=[Pt,Jt,jt,Ot],qr="start",jn="end",jS="clippingParents",Eg="viewport",Xn="popper",XS="reference",Ig=Jn.reduce(function(r,e){return r.concat([e+"-"+qr,e+"-"+jn])},[]),vg=[].concat(Jn,[TA]).reduce(function(r,e){return r.concat([e,e+"-"+qr,e+"-"+jn])},[]),zS="beforeRead",ZS="read",e1="afterRead",t1="beforeMain",i1="main",r1="afterMain",n1="beforeWrite",s1="write",o1="afterWrite",a1=[zS,ZS,e1,t1,i1,r1,n1,s1,o1];function pi(r){return r?(r.nodeName||"").toLowerCase():null}function $t(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var e=r.ownerDocument;return e&&e.defaultView||window}return r}function Cr(r){var e=$t(r).Element;return r instanceof e||r instanceof Element}function Xt(r){var e=$t(r).HTMLElement;return r instanceof e||r instanceof HTMLElement}function SA(r){if(typeof ShadowRoot>"u")return!1;var e=$t(r).ShadowRoot;return r instanceof e||r instanceof ShadowRoot}function l1(r){var e=r.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];!Xt(s)||!pi(s)||(Object.assign(s.style,i),Object.keys(n).forEach(function(o){var a=n[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function A1(r){var e=r.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 n=e.elements[i],s=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},{});!Xt(n)||!pi(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(A){n.removeAttribute(A)}))})}}const Cg={name:"applyStyles",enabled:!0,phase:"write",fn:l1,effect:A1,requires:["computeStyles"]};function mi(r){return r.split("-")[0]}var yr=Math.max,Mo=Math.min,Jr=Math.round;function bA(){var r=navigator.userAgentData;return r!=null&&r.brands&&Array.isArray(r.brands)?r.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function yg(){return!/^((?!chrome|android).)*safari/i.test(bA())}function jr(r,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=r.getBoundingClientRect(),n=1,s=1;e&&Xt(r)&&(n=r.offsetWidth>0&&Jr(i.width)/r.offsetWidth||1,s=r.offsetHeight>0&&Jr(i.height)/r.offsetHeight||1);var o=Cr(r)?$t(r):window,a=o.visualViewport,A=!yg()&&t,l=(i.left+(A&&a?a.offsetLeft:0))/n,u=(i.top+(A&&a?a.offsetTop:0))/s,c=i.width/n,h=i.height/s;return{width:c,height:h,top:u,right:l+c,bottom:u+h,left:l,x:l,y:u}}function xA(r){var e=jr(r),t=r.offsetWidth,i=r.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:r.offsetLeft,y:r.offsetTop,width:t,height:i}}function Bg(r,e){var t=e.getRootNode&&e.getRootNode();if(r.contains(e))return!0;if(t&&SA(t)){var i=e;do{if(i&&r.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function wi(r){return $t(r).getComputedStyle(r)}function c1(r){return["table","td","th"].indexOf(pi(r))>=0}function zi(r){return((Cr(r)?r.ownerDocument:r.document)||window.document).documentElement}function Fo(r){return pi(r)==="html"?r:r.assignedSlot||r.parentNode||(SA(r)?r.host:null)||zi(r)}function Tg(r){return!Xt(r)||wi(r).position==="fixed"?null:r.offsetParent}function u1(r){var e=/firefox/i.test(bA()),t=/Trident/i.test(bA());if(t&&Xt(r)){var i=wi(r);if(i.position==="fixed")return null}var n=Fo(r);for(SA(n)&&(n=n.host);Xt(n)&&["html","body"].indexOf(pi(n))<0;){var s=wi(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function zn(r){for(var e=$t(r),t=Tg(r);t&&c1(t)&&wi(t).position==="static";)t=Tg(t);return t&&(pi(t)==="html"||pi(t)==="body"&&wi(t).position==="static")?e:t||u1(r)||e}function QA(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function Zn(r,e,t){return yr(r,Mo(e,t))}function h1(r,e,t){var i=Zn(r,e,t);return i>t?t:i}function Sg(){return{top:0,right:0,bottom:0,left:0}}function bg(r){return Object.assign({},Sg(),r)}function xg(r,e){return e.reduce(function(t,i){return t[i]=r,t},{})}var d1=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,bg(typeof e!="number"?e:xg(e,Jn))};function f1(r){var e,t=r.state,i=r.name,n=r.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=mi(t.placement),A=QA(a),l=[Ot,jt].indexOf(a)>=0,u=l?"height":"width";if(!(!s||!o)){var c=d1(n.padding,t),h=xA(s),d=A==="y"?Pt:Ot,f=A==="y"?Jt:jt,g=t.rects.reference[u]+t.rects.reference[A]-o[A]-t.rects.popper[u],p=o[A]-t.rects.reference[A],v=zn(s),B=v?A==="y"?v.clientHeight||0:v.clientWidth||0:0,y=g/2-p/2,C=c[d],x=B-h[u]-c[f],w=B/2-h[u]/2+y,D=Zn(C,w,x),F=A;t.modifiersData[i]=(e={},e[F]=D,e.centerOffset=D-w,e)}}function g1(r){var e=r.state,t=r.options,i=t.element,n=i===void 0?"[data-popper-arrow]":i;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||Bg(e.elements.popper,n)&&(e.elements.arrow=n))}const p1={name:"arrow",enabled:!0,phase:"main",fn:f1,effect:g1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Xr(r){return r.split("-")[1]}var m1={top:"auto",right:"auto",bottom:"auto",left:"auto"};function E1(r,e){var t=r.x,i=r.y,n=e.devicePixelRatio||1;return{x:Jr(t*n)/n||0,y:Jr(i*n)/n||0}}function Qg(r){var e,t=r.popper,i=r.popperRect,n=r.placement,s=r.variation,o=r.offsets,a=r.position,A=r.gpuAcceleration,l=r.adaptive,u=r.roundOffsets,c=r.isFixed,h=o.x,d=h===void 0?0:h,f=o.y,g=f===void 0?0:f,p=typeof u=="function"?u({x:d,y:g}):{x:d,y:g};d=p.x,g=p.y;var v=o.hasOwnProperty("x"),B=o.hasOwnProperty("y"),y=Ot,C=Pt,x=window;if(l){var w=zn(t),D="clientHeight",F="clientWidth";if(w===$t(t)&&(w=zi(t),wi(w).position!=="static"&&a==="absolute"&&(D="scrollHeight",F="scrollWidth")),w=w,n===Pt||(n===Ot||n===jt)&&s===jn){C=Jt;var O=c&&w===x&&x.visualViewport?x.visualViewport.height:w[D];g-=O-i.height,g*=A?1:-1}if(n===Ot||(n===Pt||n===Jt)&&s===jn){y=jt;var M=c&&w===x&&x.visualViewport?x.visualViewport.width:w[F];d-=M-i.width,d*=A?1:-1}}var j=Object.assign({position:a},l&&m1),X=u===!0?E1({x:d,y:g},$t(t)):{x:d,y:g};if(d=X.x,g=X.y,A){var le;return Object.assign({},j,(le={},le[C]=B?"0":"",le[y]=v?"0":"",le.transform=(x.devicePixelRatio||1)<=1?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",le))}return Object.assign({},j,(e={},e[C]=B?g+"px":"",e[y]=v?d+"px":"",e.transform="",e))}function I1(r){var e=r.state,t=r.options,i=t.gpuAcceleration,n=i===void 0?!0:i,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,A=a===void 0?!0:a,l={placement:mi(e.placement),variation:Xr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Qg(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,Qg(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 v1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:I1,data:{}};var No={passive:!0};function C1(r){var e=r.state,t=r.instance,i=r.options,n=i.scroll,s=n===void 0?!0:n,o=i.resize,a=o===void 0?!0:o,A=$t(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&l.forEach(function(u){u.addEventListener("scroll",t.update,No)}),a&&A.addEventListener("resize",t.update,No),function(){s&&l.forEach(function(u){u.removeEventListener("scroll",t.update,No)}),a&&A.removeEventListener("resize",t.update,No)}}const y1={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:C1,data:{}};var B1={left:"right",right:"left",bottom:"top",top:"bottom"};function Po(r){return r.replace(/left|right|bottom|top/g,function(e){return B1[e]})}var T1={start:"end",end:"start"};function _g(r){return r.replace(/start|end/g,function(e){return T1[e]})}function _A(r){var e=$t(r),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function wA(r){return jr(zi(r)).left+_A(r).scrollLeft}function S1(r,e){var t=$t(r),i=zi(r),n=t.visualViewport,s=i.clientWidth,o=i.clientHeight,a=0,A=0;if(n){s=n.width,o=n.height;var l=yg();(l||!l&&e==="fixed")&&(a=n.offsetLeft,A=n.offsetTop)}return{width:s,height:o,x:a+wA(r),y:A}}function b1(r){var e,t=zi(r),i=_A(r),n=(e=r.ownerDocument)==null?void 0:e.body,s=yr(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=yr(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-i.scrollLeft+wA(r),A=-i.scrollTop;return wi(n||t).direction==="rtl"&&(a+=yr(t.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:A}}function RA(r){var e=wi(r),t=e.overflow,i=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+i)}function wg(r){return["html","body","#document"].indexOf(pi(r))>=0?r.ownerDocument.body:Xt(r)&&RA(r)?r:wg(Fo(r))}function es(r,e){var t;e===void 0&&(e=[]);var i=wg(r),n=i===((t=r.ownerDocument)==null?void 0:t.body),s=$t(i),o=n?[s].concat(s.visualViewport||[],RA(i)?i:[]):i,a=e.concat(o);return n?a:a.concat(es(Fo(o)))}function DA(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function x1(r,e){var t=jr(r,!1,e==="fixed");return t.top=t.top+r.clientTop,t.left=t.left+r.clientLeft,t.bottom=t.top+r.clientHeight,t.right=t.left+r.clientWidth,t.width=r.clientWidth,t.height=r.clientHeight,t.x=t.left,t.y=t.top,t}function Rg(r,e,t){return e===Eg?DA(S1(r,t)):Cr(e)?x1(e,t):DA(b1(zi(r)))}function Q1(r){var e=es(Fo(r)),t=["absolute","fixed"].indexOf(wi(r).position)>=0,i=t&&Xt(r)?zn(r):r;return Cr(i)?e.filter(function(n){return Cr(n)&&Bg(n,i)&&pi(n)!=="body"}):[]}function _1(r,e,t,i){var n=e==="clippingParents"?Q1(r):[].concat(e),s=[].concat(n,[t]),o=s[0],a=s.reduce(function(A,l){var u=Rg(r,l,i);return A.top=yr(u.top,A.top),A.right=Mo(u.right,A.right),A.bottom=Mo(u.bottom,A.bottom),A.left=yr(u.left,A.left),A},Rg(r,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 Dg(r){var e=r.reference,t=r.element,i=r.placement,n=i?mi(i):null,s=i?Xr(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,A;switch(n){case Pt:A={x:o,y:e.y-t.height};break;case Jt:A={x:o,y:e.y+e.height};break;case jt:A={x:e.x+e.width,y:a};break;case Ot:A={x:e.x-t.width,y:a};break;default:A={x:e.x,y:e.y}}var l=n?QA(n):null;if(l!=null){var u=l==="y"?"height":"width";switch(s){case qr:A[l]=A[l]-(e[u]/2-t[u]/2);break;case jn:A[l]=A[l]+(e[u]/2-t[u]/2);break}}return A}function ts(r,e){e===void 0&&(e={});var t=e,i=t.placement,n=i===void 0?r.placement:i,s=t.strategy,o=s===void 0?r.strategy:s,a=t.boundary,A=a===void 0?jS:a,l=t.rootBoundary,u=l===void 0?Eg:l,c=t.elementContext,h=c===void 0?Xn:c,d=t.altBoundary,f=d===void 0?!1:d,g=t.padding,p=g===void 0?0:g,v=bg(typeof p!="number"?p:xg(p,Jn)),B=h===Xn?XS:Xn,y=r.rects.popper,C=r.elements[f?B:h],x=_1(Cr(C)?C:C.contextElement||zi(r.elements.popper),A,u,o),w=jr(r.elements.reference),D=Dg({reference:w,element:y,placement:n}),F=DA(Object.assign({},y,D)),O=h===Xn?F:w,M={top:x.top-O.top+v.top,bottom:O.bottom-x.bottom+v.bottom,left:x.left-O.left+v.left,right:O.right-x.right+v.right},j=r.modifiersData.offset;if(h===Xn&&j){var X=j[n];Object.keys(M).forEach(function(le){var oe=[jt,Jt].indexOf(le)>=0?1:-1,L=[Pt,Jt].indexOf(le)>=0?"y":"x";M[le]+=X[L]*oe})}return M}function w1(r,e){e===void 0&&(e={});var t=e,i=t.placement,n=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,A=t.allowedAutoPlacements,l=A===void 0?vg:A,u=Xr(i),c=u?a?Ig:Ig.filter(function(f){return Xr(f)===u}):Jn,h=c.filter(function(f){return l.indexOf(f)>=0});h.length===0&&(h=c);var d=h.reduce(function(f,g){return f[g]=ts(r,{placement:g,boundary:n,rootBoundary:s,padding:o})[mi(g)],f},{});return Object.keys(d).sort(function(f,g){return d[f]-d[g]})}function R1(r){if(mi(r)===TA)return[];var e=Po(r);return[_g(r),e,_g(e)]}function D1(r){var e=r.state,t=r.options,i=r.name;if(!e.modifiersData[i]._skip){for(var n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!0:o,A=t.fallbackPlacements,l=t.padding,u=t.boundary,c=t.rootBoundary,h=t.altBoundary,d=t.flipVariations,f=d===void 0?!0:d,g=t.allowedAutoPlacements,p=e.options.placement,v=mi(p),B=v===p,y=A||(B||!f?[Po(p)]:R1(p)),C=[p].concat(y).reduce(function(ie,he){return ie.concat(mi(he)===TA?w1(e,{placement:he,boundary:u,rootBoundary:c,padding:l,flipVariations:f,allowedAutoPlacements:g}):he)},[]),x=e.rects.reference,w=e.rects.popper,D=new Map,F=!0,O=C[0],M=0;M<C.length;M++){var j=C[M],X=mi(j),le=Xr(j)===qr,oe=[Pt,Jt].indexOf(X)>=0,L=oe?"width":"height",U=ts(e,{placement:j,boundary:u,rootBoundary:c,altBoundary:h,padding:l}),J=oe?le?jt:Ot:le?Jt:Pt;x[L]>w[L]&&(J=Po(J));var R=Po(J),_=[];if(s&&_.push(U[X]<=0),a&&_.push(U[J]<=0,U[R]<=0),_.every(function(ie){return ie})){O=j,F=!1;break}D.set(j,_)}if(F)for(var k=f?3:1,K=function(he){var fe=C.find(function(_e){var Te=D.get(_e);if(Te)return Te.slice(0,he).every(function(Fe){return Fe})});if(fe)return O=fe,"break"},Y=k;Y>0;Y--){var te=K(Y);if(te==="break")break}e.placement!==O&&(e.modifiersData[i]._skip=!0,e.placement=O,e.reset=!0)}}const L1={name:"flip",enabled:!0,phase:"main",fn:D1,requiresIfExists:["offset"],data:{_skip:!1}};function Lg(r,e,t){return t===void 0&&(t={x:0,y:0}),{top:r.top-e.height-t.y,right:r.right-e.width+t.x,bottom:r.bottom-e.height+t.y,left:r.left-e.width-t.x}}function kg(r){return[Pt,jt,Jt,Ot].some(function(e){return r[e]>=0})}function k1(r){var e=r.state,t=r.name,i=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=ts(e,{elementContext:"reference"}),a=ts(e,{altBoundary:!0}),A=Lg(o,i),l=Lg(a,n,s),u=kg(A),c=kg(l);e.modifiersData[t]={referenceClippingOffsets:A,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:c},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":c})}const M1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:k1};function F1(r,e,t){var i=mi(r),n=[Ot,Pt].indexOf(i)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:r})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[Ot,jt].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function N1(r){var e=r.state,t=r.options,i=r.name,n=t.offset,s=n===void 0?[0,0]:n,o=vg.reduce(function(u,c){return u[c]=F1(c,e.rects,s),u},{}),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 P1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:N1};function O1(r){var e=r.state,t=r.name;e.modifiersData[t]=Dg({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const U1={name:"popperOffsets",enabled:!0,phase:"read",fn:O1,data:{}};function G1(r){return r==="x"?"y":"x"}function $1(r){var e=r.state,t=r.options,i=r.name,n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!1:o,A=t.boundary,l=t.rootBoundary,u=t.altBoundary,c=t.padding,h=t.tether,d=h===void 0?!0:h,f=t.tetherOffset,g=f===void 0?0:f,p=ts(e,{boundary:A,rootBoundary:l,padding:c,altBoundary:u}),v=mi(e.placement),B=Xr(e.placement),y=!B,C=QA(v),x=G1(C),w=e.modifiersData.popperOffsets,D=e.rects.reference,F=e.rects.popper,O=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,M=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),j=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,X={x:0,y:0};if(w){if(s){var le,oe=C==="y"?Pt:Ot,L=C==="y"?Jt:jt,U=C==="y"?"height":"width",J=w[C],R=J+p[oe],_=J-p[L],k=d?-F[U]/2:0,K=B===qr?D[U]:F[U],Y=B===qr?-F[U]:-D[U],te=e.elements.arrow,ie=d&&te?xA(te):{width:0,height:0},he=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Sg(),fe=he[oe],_e=he[L],Te=Zn(0,D[U],ie[U]),Fe=y?D[U]/2-k-Te-fe-M.mainAxis:K-Te-fe-M.mainAxis,pe=y?-D[U]/2+k+Te+_e+M.mainAxis:Y+Te+_e+M.mainAxis,Qe=e.elements.arrow&&zn(e.elements.arrow),Pe=Qe?C==="y"?Qe.clientTop||0:Qe.clientLeft||0:0,Re=(le=j==null?void 0:j[C])!=null?le:0,Ke=J+Fe-Re-Pe,Se=J+pe-Re,Ce=Zn(d?Mo(R,Ke):R,J,d?yr(_,Se):_);w[C]=Ce,X[C]=Ce-J}if(a){var ke,Ue=C==="x"?Pt:Ot,Xe=C==="x"?Jt:jt,Ge=w[x],$e=x==="y"?"height":"width",ye=Ge+p[Ue],et=Ge-p[Xe],ot=[Pt,Ot].indexOf(v)!==-1,Ze=(ke=j==null?void 0:j[x])!=null?ke:0,ze=ot?ye:Ge-D[$e]-F[$e]-Ze+M.altAxis,T=ot?Ge+D[$e]+F[$e]-Ze-M.altAxis:et,m=d&&ot?h1(ze,Ge,T):Zn(d?ze:ye,Ge,d?T:et);w[x]=m,X[x]=m-Ge}e.modifiersData[i]=X}}const H1={name:"preventOverflow",enabled:!0,phase:"main",fn:$1,requiresIfExists:["offset"]};function Y1(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function V1(r){return r===$t(r)||!Xt(r)?_A(r):Y1(r)}function K1(r){var e=r.getBoundingClientRect(),t=Jr(e.width)/r.offsetWidth||1,i=Jr(e.height)/r.offsetHeight||1;return t!==1||i!==1}function W1(r,e,t){t===void 0&&(t=!1);var i=Xt(e),n=Xt(e)&&K1(e),s=zi(e),o=jr(r,n,t),a={scrollLeft:0,scrollTop:0},A={x:0,y:0};return(i||!i&&!t)&&((pi(e)!=="body"||RA(s))&&(a=V1(e)),Xt(e)?(A=jr(e,!0),A.x+=e.clientLeft,A.y+=e.clientTop):s&&(A.x=wA(s))),{x:o.left+a.scrollLeft-A.x,y:o.top+a.scrollTop-A.y,width:o.width,height:o.height}}function q1(r){var e=new Map,t=new Set,i=[];r.forEach(function(s){e.set(s.name,s)});function n(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var A=e.get(a);A&&n(A)}}),i.push(s)}return r.forEach(function(s){t.has(s.name)||n(s)}),i}function J1(r){var e=q1(r);return a1.reduce(function(t,i){return t.concat(e.filter(function(n){return n.phase===i}))},[])}function j1(r){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(r())})})),e}}function X1(r){var e=r.reduce(function(t,i){var n=t[i.name];return t[i.name]=n?Object.assign({},n,i,{options:Object.assign({},n.options,i.options),data:Object.assign({},n.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var Mg={placement:"bottom",modifiers:[],strategy:"absolute"};function Fg(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function z1(r){r===void 0&&(r={});var e=r,t=e.defaultModifiers,i=t===void 0?[]:t,n=e.defaultOptions,s=n===void 0?Mg:n;return function(a,A,l){l===void 0&&(l=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Mg,s),modifiersData:{},elements:{reference:a,popper:A},attributes:{},styles:{}},c=[],h=!1,d={state:u,setOptions:function(v){var B=typeof v=="function"?v(u.options):v;g(),u.options=Object.assign({},s,u.options,B),u.scrollParents={reference:Cr(a)?es(a):a.contextElement?es(a.contextElement):[],popper:es(A)};var y=J1(X1([].concat(i,u.options.modifiers)));return u.orderedModifiers=y.filter(function(C){return C.enabled}),f(),d.update()},forceUpdate:function(){if(!h){var v=u.elements,B=v.reference,y=v.popper;if(Fg(B,y)){u.rects={reference:W1(B,zn(y),u.options.strategy==="fixed"),popper:xA(y)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(M){return u.modifiersData[M.name]=Object.assign({},M.data)});for(var C=0;C<u.orderedModifiers.length;C++){if(u.reset===!0){u.reset=!1,C=-1;continue}var x=u.orderedModifiers[C],w=x.fn,D=x.options,F=D===void 0?{}:D,O=x.name;typeof w=="function"&&(u=w({state:u,options:F,name:O,instance:d})||u)}}}},update:j1(function(){return new Promise(function(p){d.forceUpdate(),p(u)})}),destroy:function(){g(),h=!0}};if(!Fg(a,A))return d;d.setOptions(l).then(function(p){!h&&l.onFirstUpdate&&l.onFirstUpdate(p)});function f(){u.orderedModifiers.forEach(function(p){var v=p.name,B=p.options,y=B===void 0?{}:B,C=p.effect;if(typeof C=="function"){var x=C({state:u,name:v,instance:d,options:y}),w=function(){};c.push(x||w)}})}function g(){c.forEach(function(p){return p()}),c=[]}return d}}var Z1=[y1,U1,v1,Cg,P1,L1,H1,p1,M1],eb=z1({defaultModifiers:Z1}),tb="tippy-box",Ng="tippy-content",ib="tippy-backdrop",Pg="tippy-arrow",Og="tippy-svg-arrow",Br={passive:!0,capture:!0},Ug=function(){return document.body};function LA(r,e,t){if(Array.isArray(r)){var i=r[e];return i??(Array.isArray(t)?t[e]:t)}return r}function kA(r,e){var t={}.toString.call(r);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function Gg(r,e){return typeof r=="function"?r.apply(void 0,e):r}function $g(r,e){if(e===0)return r;var t;return function(i){clearTimeout(t),t=setTimeout(function(){r(i)},e)}}function rb(r){return r.split(/\s+/).filter(Boolean)}function zr(r){return[].concat(r)}function Hg(r,e){r.indexOf(e)===-1&&r.push(e)}function nb(r){return r.filter(function(e,t){return r.indexOf(e)===t})}function sb(r){return r.split("-")[0]}function Oo(r){return[].slice.call(r)}function Yg(r){return Object.keys(r).reduce(function(e,t){return r[t]!==void 0&&(e[t]=r[t]),e},{})}function is(){return document.createElement("div")}function Uo(r){return["Element","Fragment"].some(function(e){return kA(r,e)})}function ob(r){return kA(r,"NodeList")}function ab(r){return kA(r,"MouseEvent")}function lb(r){return!!(r&&r._tippy&&r._tippy.reference===r)}function Ab(r){return Uo(r)?[r]:ob(r)?Oo(r):Array.isArray(r)?r:Oo(document.querySelectorAll(r))}function MA(r,e){r.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function Vg(r,e){r.forEach(function(t){t&&t.setAttribute("data-state",e)})}function cb(r){var e,t=zr(r),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function ub(r,e){var t=e.clientX,i=e.clientY;return r.every(function(n){var s=n.popperRect,o=n.popperState,a=n.props,A=a.interactiveBorder,l=sb(o.placement),u=o.modifiersData.offset;if(!u)return!0;var c=l==="bottom"?u.top.y:0,h=l==="top"?u.bottom.y:0,d=l==="right"?u.left.x:0,f=l==="left"?u.right.x:0,g=s.top-i+c>A,p=i-s.bottom-h>A,v=s.left-t+d>A,B=t-s.right-f>A;return g||p||v||B})}function FA(r,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){r[i](n,t)})}function Kg(r,e){for(var t=e;t;){var i;if(r.contains(t))return!0;t=t.getRootNode==null||(i=t.getRootNode())==null?void 0:i.host}return!1}var Ei={isTouch:!1},Wg=0;function hb(){Ei.isTouch||(Ei.isTouch=!0,window.performance&&document.addEventListener("mousemove",qg))}function qg(){var r=performance.now();r-Wg<20&&(Ei.isTouch=!1,document.removeEventListener("mousemove",qg)),Wg=r}function db(){var r=document.activeElement;if(lb(r)){var e=r._tippy;r.blur&&!e.state.isVisible&&r.blur()}}function fb(){document.addEventListener("touchstart",hb,Br),window.addEventListener("blur",db)}var gb=typeof window<"u"&&typeof document<"u",pb=gb?!!window.msCrypto:!1,mb={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Eb={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},ii=Object.assign({appendTo:Ug,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},mb,Eb),Ib=Object.keys(ii),vb=function(e){var t=Object.keys(e);t.forEach(function(i){ii[i]=e[i]})};function Jg(r){var e=r.plugins||[],t=e.reduce(function(i,n){var s=n.name,o=n.defaultValue;if(s){var a;i[s]=r[s]!==void 0?r[s]:(a=ii[s])!=null?a:o}return i},{});return Object.assign({},r,t)}function Cb(r,e){var t=e?Object.keys(Jg(Object.assign({},ii,{plugins:e}))):Ib,i=t.reduce(function(n,s){var o=(r.getAttribute("data-tippy-"+s)||"").trim();if(!o)return n;if(s==="content")n[s]=o;else try{n[s]=JSON.parse(o)}catch{n[s]=o}return n},{});return i}function jg(r,e){var t=Object.assign({},e,{content:Gg(e.content,[r])},e.ignoreAttributes?{}:Cb(r,e.plugins));return t.aria=Object.assign({},ii.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 yb=function(){return"innerHTML"};function NA(r,e){r[yb()]=e}function Xg(r){var e=is();return r===!0?e.className=Pg:(e.className=Og,Uo(r)?e.appendChild(r):NA(e,r)),e}function zg(r,e){Uo(e.content)?(NA(r,""),r.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?NA(r,e.content):r.textContent=e.content)}function PA(r){var e=r.firstElementChild,t=Oo(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(Ng)}),arrow:t.find(function(i){return i.classList.contains(Pg)||i.classList.contains(Og)}),backdrop:t.find(function(i){return i.classList.contains(ib)})}}function Zg(r){var e=is(),t=is();t.className=tb,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=is();i.className=Ng,i.setAttribute("data-state","hidden"),zg(i,r.props),e.appendChild(t),t.appendChild(i),n(r.props,r.props);function n(s,o){var a=PA(e),A=a.box,l=a.content,u=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"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&zg(l,r.props),o.arrow?u?s.arrow!==o.arrow&&(A.removeChild(u),A.appendChild(Xg(o.arrow))):A.appendChild(Xg(o.arrow)):u&&A.removeChild(u)}return{popper:e,onUpdate:n}}Zg.$$tippy=!0;var Bb=1,Go=[],OA=[];function Tb(r,e){var t=jg(r,Object.assign({},ii,Jg(Yg(e)))),i,n,s,o=!1,a=!1,A=!1,l=!1,u,c,h,d=[],f=$g(Ke,t.interactiveDebounce),g,p=Bb++,v=null,B=nb(t.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:p,reference:r,popper:is(),popperInstance:v,props:t,state:y,plugins:B,clearDelayTimeouts:ze,setProps:T,setContent:m,show:E,hide:Q,hideWithInteractivity:P,enable:ot,disable:Ze,unmount:q,destroy:z};if(!t.render)return C;var x=t.render(C),w=x.popper,D=x.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+C.id,C.popper=w,r._tippy=C,w._tippy=C;var F=B.map(function($){return $.fn(C)}),O=r.hasAttribute("aria-expanded");return Qe(),k(),J(),R("onCreate",[C]),t.showOnCreate&&ye(),w.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),w.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&oe().addEventListener("mousemove",f)}),C;function M(){var $=C.props.touch;return Array.isArray($)?$:[$,0]}function j(){return M()[0]==="hold"}function X(){var $;return!!(($=C.props.render)!=null&&$.$$tippy)}function le(){return g||r}function oe(){var $=le().parentNode;return $?cb($):document}function L(){return PA(w)}function U($){return C.state.isMounted&&!C.state.isVisible||Ei.isTouch||u&&u.type==="focus"?0:LA(C.props.delay,$?0:1,ii.delay)}function J($){$===void 0&&($=!1),w.style.pointerEvents=C.props.interactive&&!$?"":"none",w.style.zIndex=""+C.props.zIndex}function R($,ae,ue){if(ue===void 0&&(ue=!0),F.forEach(function(me){me[$]&&me[$].apply(me,ae)}),ue){var ve;(ve=C.props)[$].apply(ve,ae)}}function _(){var $=C.props.aria;if($.content){var ae="aria-"+$.content,ue=w.id,ve=zr(C.props.triggerTarget||r);ve.forEach(function(me){var nt=me.getAttribute(ae);if(C.state.isVisible)me.setAttribute(ae,nt?nt+" "+ue:ue);else{var Rt=nt&&nt.replace(ue,"").trim();Rt?me.setAttribute(ae,Rt):me.removeAttribute(ae)}})}}function k(){if(!(O||!C.props.aria.expanded)){var $=zr(C.props.triggerTarget||r);$.forEach(function(ae){C.props.interactive?ae.setAttribute("aria-expanded",C.state.isVisible&&ae===le()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function K(){oe().removeEventListener("mousemove",f),Go=Go.filter(function($){return $!==f})}function Y($){if(!(Ei.isTouch&&(A||$.type==="mousedown"))){var ae=$.composedPath&&$.composedPath()[0]||$.target;if(!(C.props.interactive&&Kg(w,ae))){if(zr(C.props.triggerTarget||r).some(function(ue){return Kg(ue,ae)})){if(Ei.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else R("onClickOutside",[C,$]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||fe())}}}function te(){A=!0}function ie(){A=!1}function he(){var $=oe();$.addEventListener("mousedown",Y,!0),$.addEventListener("touchend",Y,Br),$.addEventListener("touchstart",ie,Br),$.addEventListener("touchmove",te,Br)}function fe(){var $=oe();$.removeEventListener("mousedown",Y,!0),$.removeEventListener("touchend",Y,Br),$.removeEventListener("touchstart",ie,Br),$.removeEventListener("touchmove",te,Br)}function _e($,ae){Fe($,function(){!C.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&ae()})}function Te($,ae){Fe($,ae)}function Fe($,ae){var ue=L().box;function ve(me){me.target===ue&&(FA(ue,"remove",ve),ae())}if($===0)return ae();FA(ue,"remove",c),FA(ue,"add",ve),c=ve}function pe($,ae,ue){ue===void 0&&(ue=!1);var ve=zr(C.props.triggerTarget||r);ve.forEach(function(me){me.addEventListener($,ae,ue),d.push({node:me,eventType:$,handler:ae,options:ue})})}function Qe(){j()&&(pe("touchstart",Re,{passive:!0}),pe("touchend",Se,{passive:!0})),rb(C.props.trigger).forEach(function($){if($!=="manual")switch(pe($,Re),$){case"mouseenter":pe("mouseleave",Se);break;case"focus":pe(pb?"focusout":"blur",Ce);break;case"focusin":pe("focusout",Ce);break}})}function Pe(){d.forEach(function($){var ae=$.node,ue=$.eventType,ve=$.handler,me=$.options;ae.removeEventListener(ue,ve,me)}),d=[]}function Re($){var ae,ue=!1;if(!(!C.state.isEnabled||ke($)||a)){var ve=((ae=u)==null?void 0:ae.type)==="focus";u=$,g=$.currentTarget,k(),!C.state.isVisible&&ab($)&&Go.forEach(function(me){return me($)}),$.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||o)&&C.props.hideOnClick!==!1&&C.state.isVisible?ue=!0:ye($),$.type==="click"&&(o=!ue),ue&&!ve&&et($)}}function Ke($){var ae=$.target,ue=le().contains(ae)||w.contains(ae);if(!($.type==="mousemove"&&ue)){var ve=$e().concat(w).map(function(me){var nt,Rt=me._tippy,Dt=(nt=Rt.popperInstance)==null?void 0:nt.state;return Dt?{popperRect:me.getBoundingClientRect(),popperState:Dt,props:t}:null}).filter(Boolean);ub(ve,$)&&(K(),et($))}}function Se($){var ae=ke($)||C.props.trigger.indexOf("click")>=0&&o;if(!ae){if(C.props.interactive){C.hideWithInteractivity($);return}et($)}}function Ce($){C.props.trigger.indexOf("focusin")<0&&$.target!==le()||C.props.interactive&&$.relatedTarget&&w.contains($.relatedTarget)||et($)}function ke($){return Ei.isTouch?j()!==$.type.indexOf("touch")>=0:!1}function Ue(){Xe();var $=C.props,ae=$.popperOptions,ue=$.placement,ve=$.offset,me=$.getReferenceClientRect,nt=$.moveTransition,Rt=X()?PA(w).arrow:null,Dt=me?{getBoundingClientRect:me,contextElement:me.contextElement||le()}:r,nn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(sn){var ir=sn.state;if(X()){var ls=L(),As=ls.box;["placement","reference-hidden","escaped"].forEach(function(on){on==="placement"?As.setAttribute("data-placement",ir.placement):ir.attributes.popper["data-popper-"+on]?As.setAttribute("data-"+on,""):As.removeAttribute("data-"+on)}),ir.attributes.popper={}}}},Lt=[{name:"offset",options:{offset:ve}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!nt}},nn];X()&&Rt&&Lt.push({name:"arrow",options:{element:Rt,padding:3}}),Lt.push.apply(Lt,(ae==null?void 0:ae.modifiers)||[]),C.popperInstance=eb(Dt,w,Object.assign({},ae,{placement:ue,onFirstUpdate:h,modifiers:Lt}))}function Xe(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function Ge(){var $=C.props.appendTo,ae,ue=le();C.props.interactive&&$===Ug||$==="parent"?ae=ue.parentNode:ae=Gg($,[ue]),ae.contains(w)||ae.appendChild(w),C.state.isMounted=!0,Ue()}function $e(){return Oo(w.querySelectorAll("[data-tippy-root]"))}function ye($){C.clearDelayTimeouts(),$&&R("onTrigger",[C,$]),he();var ae=U(!0),ue=M(),ve=ue[0],me=ue[1];Ei.isTouch&&ve==="hold"&&me&&(ae=me),ae?i=setTimeout(function(){C.show()},ae):C.show()}function et($){if(C.clearDelayTimeouts(),R("onUntrigger",[C,$]),!C.state.isVisible){fe();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf($.type)>=0&&o)){var ae=U(!1);ae?n=setTimeout(function(){C.state.isVisible&&C.hide()},ae):s=requestAnimationFrame(function(){C.hide()})}}function ot(){C.state.isEnabled=!0}function Ze(){C.hide(),C.state.isEnabled=!1}function ze(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(s)}function T($){if(!C.state.isDestroyed){R("onBeforeUpdate",[C,$]),Pe();var ae=C.props,ue=jg(r,Object.assign({},ae,Yg($),{ignoreAttributes:!0}));C.props=ue,Qe(),ae.interactiveDebounce!==ue.interactiveDebounce&&(K(),f=$g(Ke,ue.interactiveDebounce)),ae.triggerTarget&&!ue.triggerTarget?zr(ae.triggerTarget).forEach(function(ve){ve.removeAttribute("aria-expanded")}):ue.triggerTarget&&r.removeAttribute("aria-expanded"),k(),J(),D&&D(ae,ue),C.popperInstance&&(Ue(),$e().forEach(function(ve){requestAnimationFrame(ve._tippy.popperInstance.forceUpdate)})),R("onAfterUpdate",[C,$])}}function m($){C.setProps({content:$})}function E(){var $=C.state.isVisible,ae=C.state.isDestroyed,ue=!C.state.isEnabled,ve=Ei.isTouch&&!C.props.touch,me=LA(C.props.duration,0,ii.duration);if(!($||ae||ue||ve)&&!le().hasAttribute("disabled")&&(R("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,X()&&(w.style.visibility="visible"),J(),he(),C.state.isMounted||(w.style.transition="none"),X()){var nt=L(),Rt=nt.box,Dt=nt.content;MA([Rt,Dt],0)}h=function(){var Lt;if(!(!C.state.isVisible||l)){if(l=!0,w.offsetHeight,w.style.transition=C.props.moveTransition,X()&&C.props.animation){var Qr=L(),sn=Qr.box,ir=Qr.content;MA([sn,ir],me),Vg([sn,ir],"visible")}_(),k(),Hg(OA,C),(Lt=C.popperInstance)==null||Lt.forceUpdate(),R("onMount",[C]),C.props.animation&&X()&&Te(me,function(){C.state.isShown=!0,R("onShown",[C])})}},Ge()}}function Q(){var $=!C.state.isVisible,ae=C.state.isDestroyed,ue=!C.state.isEnabled,ve=LA(C.props.duration,1,ii.duration);if(!($||ae||ue)&&(R("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,l=!1,o=!1,X()&&(w.style.visibility="hidden"),K(),fe(),J(!0),X()){var me=L(),nt=me.box,Rt=me.content;C.props.animation&&(MA([nt,Rt],ve),Vg([nt,Rt],"hidden"))}_(),k(),C.props.animation?X()&&_e(ve,C.unmount):C.unmount()}}function P($){oe().addEventListener("mousemove",f),Hg(Go,f),f($)}function q(){C.state.isVisible&&C.hide(),C.state.isMounted&&(Xe(),$e().forEach(function($){$._tippy.unmount()}),w.parentNode&&w.parentNode.removeChild(w),OA=OA.filter(function($){return $!==C}),C.state.isMounted=!1,R("onHidden",[C]))}function z(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),Pe(),delete r._tippy,C.state.isDestroyed=!0,R("onDestroy",[C]))}}function Tr(r,e){e===void 0&&(e={});var t=ii.plugins.concat(e.plugins||[]);fb();var i=Object.assign({},e,{plugins:t}),n=Ab(r),s=n.reduce(function(o,a){var A=a&&Tb(a,i);return A&&o.push(A),o},[]);return Uo(r)?s[0]:s}Tr.defaultProps=ii,Tr.setDefaultProps=vb,Tr.currentInput=Ei,Object.assign({},Cg,{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)}}),Tr.setDefaultProps({render:Zg});function zt(r,e){return`${r}-${e}`}function Ii(r){var e,t;const i=[];return(((e=r.renderer)==null?void 0:e.type)==="video"||((t=r.renderer)==null?void 0:t.type)==="audio")&&i.push({...r.config,...r.options}),i.push(...r.childNodes.flatMap(Ii).filter(Boolean)),i}class $o 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(" - ")}}function Zi(r,e,t){return Math.min(Math.max(e,r),t)}const Sb=5;function bb(r,e){return r.length!==e.length||r.some((t,i)=>t!==e[i])}class xb{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._canvas=xt(),this._controls=xt(),this.host=e}set activeScenes(e){bb(e,this._activeScenes)&&(this._activeScenes=e,this.host.dispatchEvent(new CustomEvent("scenechange",{detail:e})),this.host.requestUpdate())}get activeScenes(){return this._activeScenes}set currentTime(e){var t,i,n;const s=Zi(0,e,this.host.duration);this.activeScenes=((t=this.host.composition)==null?void 0:t.tracks.reduce((a,A)=>a.concat(A.scenes.filter(({start:l,duration:u})=>s>=l&&s<l+u)),[]))??[];const o=s!==this.currentTime;this._currentTime=s,this._upcomingScenes=((i=this.host.composition)==null?void 0:i.tracks.reduce((a,A)=>a.concat(A.scenes.filter(({start:l})=>s>=l-Sb&&s<l)),[]))??[],this.loadScenes(),this.syncMediaState(),(n=this._controls.value)==null||n.setAttribute("currentTime",s.toString()),o&&this.host.dispatchEvent(new CustomEvent("timeupdate",{detail:s})),this.draw(s)}get currentTime(){return this._currentTime}set caption(e){e!==this._caption&&(this._caption=e,this.host.requestUpdate())}get caption(){return this._caption}canvas(){return Qt(this._canvas)}controls(){return Qt(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{Ii(e.layout.node).forEach(({key:i})=>{var n,s,o;const{id:a,start:A,duration:l}=e,u=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused,c=zt(a,i);if(this.host.media[c]){const h=this.host.media[c],{speed:d,volume:f,hls:g,node:p,start:v,duration:B}=h,y=this.host.mediaState[c];p&&y&&(p.currentTime>=v+B||p.ended||u&&(g?(n=g.startLoadOnce)==null||n.call(g,v):y.initialised||(s=p.startLoadOnce)==null||s.call(p),p.volume=Zi(0,this.host.volume*(f??1),1),p.playbackRate=Zi(.1,this.host.playbackRate*(d??1),4)))}else if(u){const h=`${A}-${l}`,d=this.host._sceneController.mediaState[h];this.host.duration&&!((o=d==null?void 0:d.buffered)!=null&&o.length)&&(this.host._sceneController.mediaState={...this.host._sceneController.mediaState,[h]:{...d,buffered:[{start:Math.max(0,A/this.host.duration*100),end:Math.min((A+l)/this.host.duration*100,100)}]}})}})})}syncMediaState(){var e;return Promise.all(((e=this.host.composition)==null?void 0:e.tracks.flatMap(t=>t.scenes.flatMap(i=>Ii(i.layout.node).map(async({key:s})=>{const o=zt(i.id,s);if(this.host.media[o]){const a=this.host.media[o],{node:A}=a,l=this.host.mediaState[o],u=this.activeScenes.includes(i);if(l)if(u&&!this.host.waiting&&!this.host.loading&&!this.host.paused){if(A.paused&&l.initialised)try{await A.play()}catch(c){throw new $o("Video play error",c,!0)}}else A.paused||A.pause()}}))))??[])}draw(e=this.currentTime){this.host.composition&&this._canvas.value&&this.host.composition.draw({currentTime:e,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)}}const Qb=$i(async function(e){const{weight:t,family:i}=e,{client:n,server:s}=i.weights.find(a=>a.weight===t)??{};return!n&&!s?null:new FontFace(e.family.name,`url(${n??s})`,{weight:t,style:"normal"}).load()},{cacheKey:([r])=>JSON.stringify(r)}),_b=$i(async({options:r})=>{const e=await Qb(r.font);return e&&document.fonts.add(e),{font:r.font}}),wb=$i(async({config:r})=>r.src?new Promise((e,t)=>{const i=new Image;i.crossOrigin="anonymous",i.onload=()=>{e({image:i})},i.onerror=n=>{t(n)},i.src=r.src}):{image:null},{cacheKey:([{config:r}])=>JSON.stringify(r)});async function e0(r){return r.duration===1/0?new Promise(e=>{r.currentTime=Number.MAX_SAFE_INTEGER,r.ontimeupdate=()=>{r.ontimeupdate=null,e(r.duration),r.currentTime=0}}):r.duration}function Rb(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Db(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Lb(r){return new Promise(async e=>{let t=null;const{type:i,key:n,src:s,duration:o}=r;i==="video"?(t=document.createElement("video"),t.playsInline=!0):t=document.createElement("audio"),t.muted=!0,t.loop=!1,t.crossOrigin="anonymous",t.src=s;let a=!1;if(t.startLoadOnce=()=>{a||(t.preload="auto",t.load(),a=!0)},i==="video"&&o&&r.aspectRatio)t.preload="none",e({key:n,hls:null,node:t,aspectRatio:r.aspectRatio,totalDuration:o});else{t.preload="metadata";const A=async()=>{const l=await e0(t);e({key:n,hls:null,node:t,totalDuration:l,aspectRatio:t instanceof HTMLVideoElement?t.videoWidth/t.videoHeight:null}),t.removeEventListener("loadedmetadata",A)};t.addEventListener("loadedmetadata",A)}})}function kb({key:r,playlist:e}){return new Promise(t=>{const i=document.createElement("video");i instanceof HTMLVideoElement&&(i.playsInline=!0),i.muted=!0,i.loop=!1,i.crossOrigin="anonymous";let n=!1;const s=new gi({autoStartLoad:!0,xhrSetup:o=>{const{open:a}=o,A=e.split("?")[1];o.open=function(l,u,c){A&&!u.toString().includes("?")&&(u+="?"+A),!(!n&&u.toString().includes(".ts"))&&a.apply(this,[l,u,c])}}});s.on(gi.Events.LEVEL_LOADED,async()=>{n||s==null||s.stopLoad();const o=await e0(i);t({key:r,hls:s,node:i,aspectRatio:s.levels[0].width/s.levels[0].height,totalDuration:o})}),s.loadSource(e),s.attachMedia(i),s.startLoadOnce=(o=-1,a)=>{if(s&&!n){const A=s.levels.findIndex(l=>Math.min(l.height,l.width)===a);n=!0,s.startLevel=s.firstLevel,s.startLoad(o),s.currentLevel=A!==-1?A:s.firstLevel}}})}function Mb(r){const{playlist:e}=r;return e&&!Rb()&&gi.isSupported()?kb({...r,playlist:e}):Lb(r)}let Fb=class{constructor(e){this._hasPlayed=!1,this._duration=0,this._composition=null,this._media={},this._mediaState={},this._compositionController=new AbortController,this._delayProcessing=(t=100)=>{const i=new AbortController,n=setTimeout(()=>{i.signal.aborted||(this.host._processing=!0)},t);return i.signal.addEventListener("abort",()=>{clearTimeout(n)}),i},this._mediaFactory=$i(async(t,i)=>{const{key:n}=i,s=await Mb(i),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 u=l,c=o[u]({id:t,key:n,node:s.node});return A[u]=c,s.node.addEventListener(l,c),A},{});return{media:s,listeners:a,aspectRatio:s.aspectRatio,source:()=>s.node}},{cacheKey:([t,{key:i,src:n,playlist:s}])=>JSON.stringify({id:t,key:i,src:n==null?void 0:n.split("?")[0],playlist:s==null?void 0:s.split("?")[0]})}),this._handleLoadedData=({id:t,key:i,node:n})=>()=>{const s=zt(t,i),o=this.mediaState[s];o!=null&&o.initialised||(this.mediaState={...this.mediaState,[s]:{...o,initialised:!0,waiting:!1,buffered:(o==null?void 0:o.buffered)??[]}},this.setMediaCurrentTime(this.host.currentTime),this.host.dispatchEvent(new CustomEvent("video:loadeddata",{detail:{id:t,key:i,node:n}})))},this._handleWaiting=({id:t,key:i})=>()=>{const n=zt(t,i),s=this.mediaState[n];s!=null&&s.initialised&&!(s!=null&&s.waiting)&&(this.mediaState={...this.mediaState,[n]:{...s,waiting:!0}})},this._handleCanPlay=({id:t,key:i})=>()=>{const n=zt(t,i),s=this.mediaState[n];s!=null&&s.initialised&&(s!=null&&s.waiting)&&(this.mediaState={...this.mediaState,[n]:{...s,waiting:!1}}),this.host.paused&&this.host.draw()},this._handleProgress=()=>()=>{},this._handleSeeking=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:seeking",{detail:{id:t,key:i,node:n}}))},this._handleSeeked=({id:t,key:i,node:n})=>()=>{const s=zt(t,i),o=this.mediaState[s];o!=null&&o.initialised&&(this.host.draw(),this.host.activeScenes.flatMap(a=>Ii(a.layout.node).map(({id:l})=>l)).includes(t)&&this.host.dispatchEvent(new CustomEvent("seeked",{detail:this.host.currentTime})),this.host.dispatchEvent(new CustomEvent("video:seeked",{detail:{id:t,key:i,node:n}})))},this._handlePlay=({id:t,key:i,node:n})=>()=>{this.hasPlayed=!0,this.host.dispatchEvent(new CustomEvent("video:play",{detail:{id:t,key:i,node:n}}))},this._handlePlaying=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:playing",{detail:{id:t,key:i,node:n}}))},this._handlePause=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:pause",{detail:{id:t,key:i,node:n}}))},this._handleStalled=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:stalled",{detail:{id:t,key:i,node:n}}))},this._handleTimeUpdate=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:timeupdate",{detail:{id:t,key:i,node:n}}))},this._handleEnded=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:ended",{detail:{id:t,key:i,node:n}}))},this._handleError=({id:t,key:i,node:n})=>()=>{const s=new $o(`Video error - answer ${t} failed to load`);this.host.dispatchEvent(new ErrorEvent("error",{bubbles:!0,composed:!0,error:s,message:s.message})),this.host.dispatchEvent(new CustomEvent("video:error",{detail:{id:t,key:i,node:n}}))},this._cleanupMedia=t=>{var i;const n=this.media[t];n&&(n.node.pause(),n.node.src="",(i=n.hls)==null||i.destroy(),Object.keys(n.listeners??{}).forEach(s=>{var o,a;if((o=this.media)!=null&&o[t]){const A=(a=n.listeners)==null?void 0:a[s];A&&n.node.removeEventListener(s,A)}}),delete this._media[t],delete this._mediaState[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 composition(e){e!==this._composition&&(this._composition=e,this.host.requestUpdate())}get composition(){return this._composition}set media(e){e!==this._media&&(this._media=e,this.host.requestUpdate())}get media(){return this._media}set mediaState(e){e!==this._mediaState&&(this._mediaState=e,this.host.requestUpdate())}get mediaState(){return this._mediaState}_setupTask(){new Cs(this.host,async([e,t,i,n])=>{var s,o;this._compositionController.abort(),this._compositionController=new AbortController;const a=this._compositionController,A=this._delayProcessing();try{if(this.host._errors=[],(!t||!this.host._languages.find(({value:l})=>t===l))&&(this.host._language=(s=this.host._languages[0])==null?void 0:s.value),e){const{width:l,height:u}=nl({aspectRatio:i,resolution:1080});try{(o=this.composition)==null||o.cleanup();const f=await Qh({debug:n,config:e,resolvers:{text:_b,image:wb,video:async({id:g,config:p,options:v})=>{const{media:B,source:y}=await this._mediaFactory(g,{...p,...v});return{video:y,aspectRatio:B.aspectRatio}}},rootWidth:l,rootHeight:u});if(a.signal.aborted)return;this.composition=f}catch(f){throw new $o("Fatal composition error",f,!0)}this.duration=this.composition.duration;const c={...this.media},h={...this.mediaState},d=[];for(const f of this.composition.tracks)for(const g of f.scenes){const p=Ii(g.layout.node);for(const v of p){const{media:B,listeners:y}=await this._mediaFactory(g.id,v),C=zt(g.id,B.key);d.push(C);const x=(v.startOffset??0)*B.totalDuration,w=(1-(v.endOffset??0))*B.totalDuration;c[C]={...B,listeners:y,start:x,duration:w-x,speed:v.speed??1,volume:v.volume??1},h[C]={initialised:!B,waiting:!!B,...this.mediaState[C]}}}this.media=c,this.mediaState=h,Object.keys(this.media).forEach(f=>{d.includes(f)||this.media[f].node.pause()}),this.host.currentTime>this.duration?this.host.reset(this.duration,!1):this.host.paused?this.host.reset(this.host.currentTime,!this.host.paused):this.setMediaCurrentTime(this.host.currentTime)}this.host.dispatchEvent(new CustomEvent("compositionupdate",{detail:this.composition,bubbles:!0,composed:!0}))}catch(l){this.composition=null,this.duration=0,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:l,message:l.message}))}finally{A.abort(),this.host._processing=!1}},()=>[this.host.config,this.host.language,this.host.aspectRatio,this.host.debug])}_setMediaCurrentTime({time:e,scene:t}){const{id:i,layout:n,start:s}=t;Ii(n.node).forEach(({key:a})=>{const A=zt(i,a);if(this.media[A]){const l=this.media[A],u=(e-s)*l.speed;l.node.currentTime=Zi(l.start,u+l.start,l.start+l.duration)}})}setMediaCurrentTime(e){var t;(t=this.composition)==null||t.tracks.forEach(i=>{i.scenes.forEach(n=>{this._setMediaCurrentTime({time:e,scene:n})})})}hostConnected(){this._setupTask()}hostDisconnected(){Object.keys(this.media).forEach(e=>{this._cleanupMedia(e)}),this.media={}}};function Nb(r){r.requestFullscreen?r.requestFullscreen():r.mozRequestFullScreen?r.mozRequestFullScreen():r.webkitRequestFullscreen?r.webkitRequestFullscreen():r.msRequestFullscreen&&r.msRequestFullscreen()}function Pb(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const UA=["progress","play-large","navigation","play","volume","current-time","duration","speed","captions","fullscreen","preview"],Ob={id:"captions",event:"captions:click",label:"Closed Captions"},Ub={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},t0={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}]},Gb={id:"playbackRate",label:"Playback playbackRate",subItems:t0};class $b extends Rc{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==Lr.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)),Oi}}const GA=kr($b),Hb=JS(()=>{const r=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","url(https://vouch-clients.s3.ap-southeast-2.amazonaws.com/vouch/fonts/Roobert-Bold.woff2",{style:"normal",weight:"700"}),i=new FontFace("Roobert Captions","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),n=Ch.map(s=>({load:!1,font:new FontFace(s.family,`url(${s.url})`,{style:s.style})}));return[{load:!0,font:r},{load:!0,font:e},{load:!0,font:t},{load:!0,font:i},...n]}),vi={"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"},Yb={colors:vi,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 ${vi["dark-100"]}`,medium:`0 .125rem .625rem ${vi["dark-100"]}`,large:`0 .25rem 1rem ${vi["dark-50"]}`,xl:`.25rem .25rem 1rem ${vi["dark-250"]}`,xxl:`0 .25rem 2rem ${vi["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${vi["dark-250"]}`,toolbar:`0 -.625rem .625rem ${vi["dark-50"]}`,text:`0 0 .25rem ${vi["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:vi["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},i0=KS(Yb,{delimiter:"-"}),Vb=Object.keys(i0).map(r=>hn(`:host { --${r}: ${i0[r]}; }`)),Je=(r=>{const e=class extends r{firstUpdated(){Hb().forEach(({load:s,font:o})=>{document.fonts.add(o),s&&o.load()})}};return e.styles=[(r==null?void 0:r.styles)??[],Vb,Bt`
2528
+ */const pg=(r,e,t)=>{const i=new Map;for(let n=e;n<=t;n++)i.set(r[n],n);return i},mg=kr(class extends Cn{constructor(r){if(super(r),r.type!==Lr.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const n=[],s=[];let o=0;for(const a of r)n[o]=i?i(a,o):o,s[o]=t(a,o),o++;return{values:s,keys:n}}render(r,e,t){return this.dt(r,e,t).values}update(r,[e,t,i]){const n=lp(r),{values:s,keys:o}=this.dt(e,t,i);if(!Array.isArray(n))return this.ut=o,s;const a=this.ut??(this.ut=[]),A=[];let l,u,c=0,h=n.length-1,d=0,f=s.length-1;for(;c<=h&&d<=f;)if(n[c]===null)c++;else if(n[h]===null)h--;else if(a[c]===o[d])A[d]=ur(n[c],s[d]),c++,d++;else if(a[h]===o[f])A[f]=ur(n[h],s[f]),h--,f--;else if(a[c]===o[f])A[f]=ur(n[c],s[f]),vn(r,A[f+1],n[c]),c++,f--;else if(a[h]===o[d])A[d]=ur(n[h],s[d]),vn(r,n[c],n[h]),h--,d++;else if(l===void 0&&(l=pg(o,d,f),u=pg(a,c,h)),l.has(a[c]))if(l.has(a[h])){const g=u.get(o[d]),p=g!==void 0?n[g]:null;if(p===null){const v=vn(r,n[c]);ur(v,s[d]),A[d]=v}else A[d]=ur(p,s[d]),vn(r,n[c],p),n[g]=null;d++}else ha(n[h]),h--;else ha(n[c]),c++;for(;d<=f;){const g=vn(r,A[f+1]);ur(g,s[d]),A[d++]=g}for(;c<=h;){const g=n[c++];g!==null&&ha(g)}return this.ut=o,ap(r,A),Fi}});var Pt="top",Jt="bottom",jt="right",Ot="left",TA="auto",Jn=[Pt,Jt,jt,Ot],qr="start",jn="end",jS="clippingParents",Eg="viewport",Xn="popper",XS="reference",Ig=Jn.reduce(function(r,e){return r.concat([e+"-"+qr,e+"-"+jn])},[]),vg=[].concat(Jn,[TA]).reduce(function(r,e){return r.concat([e,e+"-"+qr,e+"-"+jn])},[]),zS="beforeRead",ZS="read",e1="afterRead",t1="beforeMain",i1="main",r1="afterMain",n1="beforeWrite",s1="write",o1="afterWrite",a1=[zS,ZS,e1,t1,i1,r1,n1,s1,o1];function pi(r){return r?(r.nodeName||"").toLowerCase():null}function $t(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var e=r.ownerDocument;return e&&e.defaultView||window}return r}function Cr(r){var e=$t(r).Element;return r instanceof e||r instanceof Element}function Xt(r){var e=$t(r).HTMLElement;return r instanceof e||r instanceof HTMLElement}function SA(r){if(typeof ShadowRoot>"u")return!1;var e=$t(r).ShadowRoot;return r instanceof e||r instanceof ShadowRoot}function l1(r){var e=r.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];!Xt(s)||!pi(s)||(Object.assign(s.style,i),Object.keys(n).forEach(function(o){var a=n[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function A1(r){var e=r.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 n=e.elements[i],s=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},{});!Xt(n)||!pi(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(A){n.removeAttribute(A)}))})}}const Cg={name:"applyStyles",enabled:!0,phase:"write",fn:l1,effect:A1,requires:["computeStyles"]};function mi(r){return r.split("-")[0]}var yr=Math.max,Mo=Math.min,Jr=Math.round;function bA(){var r=navigator.userAgentData;return r!=null&&r.brands&&Array.isArray(r.brands)?r.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function yg(){return!/^((?!chrome|android).)*safari/i.test(bA())}function jr(r,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=r.getBoundingClientRect(),n=1,s=1;e&&Xt(r)&&(n=r.offsetWidth>0&&Jr(i.width)/r.offsetWidth||1,s=r.offsetHeight>0&&Jr(i.height)/r.offsetHeight||1);var o=Cr(r)?$t(r):window,a=o.visualViewport,A=!yg()&&t,l=(i.left+(A&&a?a.offsetLeft:0))/n,u=(i.top+(A&&a?a.offsetTop:0))/s,c=i.width/n,h=i.height/s;return{width:c,height:h,top:u,right:l+c,bottom:u+h,left:l,x:l,y:u}}function xA(r){var e=jr(r),t=r.offsetWidth,i=r.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:r.offsetLeft,y:r.offsetTop,width:t,height:i}}function Bg(r,e){var t=e.getRootNode&&e.getRootNode();if(r.contains(e))return!0;if(t&&SA(t)){var i=e;do{if(i&&r.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function wi(r){return $t(r).getComputedStyle(r)}function c1(r){return["table","td","th"].indexOf(pi(r))>=0}function zi(r){return((Cr(r)?r.ownerDocument:r.document)||window.document).documentElement}function Fo(r){return pi(r)==="html"?r:r.assignedSlot||r.parentNode||(SA(r)?r.host:null)||zi(r)}function Tg(r){return!Xt(r)||wi(r).position==="fixed"?null:r.offsetParent}function u1(r){var e=/firefox/i.test(bA()),t=/Trident/i.test(bA());if(t&&Xt(r)){var i=wi(r);if(i.position==="fixed")return null}var n=Fo(r);for(SA(n)&&(n=n.host);Xt(n)&&["html","body"].indexOf(pi(n))<0;){var s=wi(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function zn(r){for(var e=$t(r),t=Tg(r);t&&c1(t)&&wi(t).position==="static";)t=Tg(t);return t&&(pi(t)==="html"||pi(t)==="body"&&wi(t).position==="static")?e:t||u1(r)||e}function QA(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function Zn(r,e,t){return yr(r,Mo(e,t))}function h1(r,e,t){var i=Zn(r,e,t);return i>t?t:i}function Sg(){return{top:0,right:0,bottom:0,left:0}}function bg(r){return Object.assign({},Sg(),r)}function xg(r,e){return e.reduce(function(t,i){return t[i]=r,t},{})}var d1=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,bg(typeof e!="number"?e:xg(e,Jn))};function f1(r){var e,t=r.state,i=r.name,n=r.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=mi(t.placement),A=QA(a),l=[Ot,jt].indexOf(a)>=0,u=l?"height":"width";if(!(!s||!o)){var c=d1(n.padding,t),h=xA(s),d=A==="y"?Pt:Ot,f=A==="y"?Jt:jt,g=t.rects.reference[u]+t.rects.reference[A]-o[A]-t.rects.popper[u],p=o[A]-t.rects.reference[A],v=zn(s),B=v?A==="y"?v.clientHeight||0:v.clientWidth||0:0,y=g/2-p/2,C=c[d],x=B-h[u]-c[f],w=B/2-h[u]/2+y,D=Zn(C,w,x),F=A;t.modifiersData[i]=(e={},e[F]=D,e.centerOffset=D-w,e)}}function g1(r){var e=r.state,t=r.options,i=t.element,n=i===void 0?"[data-popper-arrow]":i;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||Bg(e.elements.popper,n)&&(e.elements.arrow=n))}const p1={name:"arrow",enabled:!0,phase:"main",fn:f1,effect:g1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Xr(r){return r.split("-")[1]}var m1={top:"auto",right:"auto",bottom:"auto",left:"auto"};function E1(r,e){var t=r.x,i=r.y,n=e.devicePixelRatio||1;return{x:Jr(t*n)/n||0,y:Jr(i*n)/n||0}}function Qg(r){var e,t=r.popper,i=r.popperRect,n=r.placement,s=r.variation,o=r.offsets,a=r.position,A=r.gpuAcceleration,l=r.adaptive,u=r.roundOffsets,c=r.isFixed,h=o.x,d=h===void 0?0:h,f=o.y,g=f===void 0?0:f,p=typeof u=="function"?u({x:d,y:g}):{x:d,y:g};d=p.x,g=p.y;var v=o.hasOwnProperty("x"),B=o.hasOwnProperty("y"),y=Ot,C=Pt,x=window;if(l){var w=zn(t),D="clientHeight",F="clientWidth";if(w===$t(t)&&(w=zi(t),wi(w).position!=="static"&&a==="absolute"&&(D="scrollHeight",F="scrollWidth")),w=w,n===Pt||(n===Ot||n===jt)&&s===jn){C=Jt;var O=c&&w===x&&x.visualViewport?x.visualViewport.height:w[D];g-=O-i.height,g*=A?1:-1}if(n===Ot||(n===Pt||n===Jt)&&s===jn){y=jt;var M=c&&w===x&&x.visualViewport?x.visualViewport.width:w[F];d-=M-i.width,d*=A?1:-1}}var j=Object.assign({position:a},l&&m1),X=u===!0?E1({x:d,y:g},$t(t)):{x:d,y:g};if(d=X.x,g=X.y,A){var le;return Object.assign({},j,(le={},le[C]=B?"0":"",le[y]=v?"0":"",le.transform=(x.devicePixelRatio||1)<=1?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",le))}return Object.assign({},j,(e={},e[C]=B?g+"px":"",e[y]=v?d+"px":"",e.transform="",e))}function I1(r){var e=r.state,t=r.options,i=t.gpuAcceleration,n=i===void 0?!0:i,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,A=a===void 0?!0:a,l={placement:mi(e.placement),variation:Xr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Qg(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,Qg(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 v1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:I1,data:{}};var No={passive:!0};function C1(r){var e=r.state,t=r.instance,i=r.options,n=i.scroll,s=n===void 0?!0:n,o=i.resize,a=o===void 0?!0:o,A=$t(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&l.forEach(function(u){u.addEventListener("scroll",t.update,No)}),a&&A.addEventListener("resize",t.update,No),function(){s&&l.forEach(function(u){u.removeEventListener("scroll",t.update,No)}),a&&A.removeEventListener("resize",t.update,No)}}const y1={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:C1,data:{}};var B1={left:"right",right:"left",bottom:"top",top:"bottom"};function Po(r){return r.replace(/left|right|bottom|top/g,function(e){return B1[e]})}var T1={start:"end",end:"start"};function _g(r){return r.replace(/start|end/g,function(e){return T1[e]})}function _A(r){var e=$t(r),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function wA(r){return jr(zi(r)).left+_A(r).scrollLeft}function S1(r,e){var t=$t(r),i=zi(r),n=t.visualViewport,s=i.clientWidth,o=i.clientHeight,a=0,A=0;if(n){s=n.width,o=n.height;var l=yg();(l||!l&&e==="fixed")&&(a=n.offsetLeft,A=n.offsetTop)}return{width:s,height:o,x:a+wA(r),y:A}}function b1(r){var e,t=zi(r),i=_A(r),n=(e=r.ownerDocument)==null?void 0:e.body,s=yr(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=yr(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-i.scrollLeft+wA(r),A=-i.scrollTop;return wi(n||t).direction==="rtl"&&(a+=yr(t.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:A}}function RA(r){var e=wi(r),t=e.overflow,i=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+i)}function wg(r){return["html","body","#document"].indexOf(pi(r))>=0?r.ownerDocument.body:Xt(r)&&RA(r)?r:wg(Fo(r))}function es(r,e){var t;e===void 0&&(e=[]);var i=wg(r),n=i===((t=r.ownerDocument)==null?void 0:t.body),s=$t(i),o=n?[s].concat(s.visualViewport||[],RA(i)?i:[]):i,a=e.concat(o);return n?a:a.concat(es(Fo(o)))}function DA(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function x1(r,e){var t=jr(r,!1,e==="fixed");return t.top=t.top+r.clientTop,t.left=t.left+r.clientLeft,t.bottom=t.top+r.clientHeight,t.right=t.left+r.clientWidth,t.width=r.clientWidth,t.height=r.clientHeight,t.x=t.left,t.y=t.top,t}function Rg(r,e,t){return e===Eg?DA(S1(r,t)):Cr(e)?x1(e,t):DA(b1(zi(r)))}function Q1(r){var e=es(Fo(r)),t=["absolute","fixed"].indexOf(wi(r).position)>=0,i=t&&Xt(r)?zn(r):r;return Cr(i)?e.filter(function(n){return Cr(n)&&Bg(n,i)&&pi(n)!=="body"}):[]}function _1(r,e,t,i){var n=e==="clippingParents"?Q1(r):[].concat(e),s=[].concat(n,[t]),o=s[0],a=s.reduce(function(A,l){var u=Rg(r,l,i);return A.top=yr(u.top,A.top),A.right=Mo(u.right,A.right),A.bottom=Mo(u.bottom,A.bottom),A.left=yr(u.left,A.left),A},Rg(r,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 Dg(r){var e=r.reference,t=r.element,i=r.placement,n=i?mi(i):null,s=i?Xr(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,A;switch(n){case Pt:A={x:o,y:e.y-t.height};break;case Jt:A={x:o,y:e.y+e.height};break;case jt:A={x:e.x+e.width,y:a};break;case Ot:A={x:e.x-t.width,y:a};break;default:A={x:e.x,y:e.y}}var l=n?QA(n):null;if(l!=null){var u=l==="y"?"height":"width";switch(s){case qr:A[l]=A[l]-(e[u]/2-t[u]/2);break;case jn:A[l]=A[l]+(e[u]/2-t[u]/2);break}}return A}function ts(r,e){e===void 0&&(e={});var t=e,i=t.placement,n=i===void 0?r.placement:i,s=t.strategy,o=s===void 0?r.strategy:s,a=t.boundary,A=a===void 0?jS:a,l=t.rootBoundary,u=l===void 0?Eg:l,c=t.elementContext,h=c===void 0?Xn:c,d=t.altBoundary,f=d===void 0?!1:d,g=t.padding,p=g===void 0?0:g,v=bg(typeof p!="number"?p:xg(p,Jn)),B=h===Xn?XS:Xn,y=r.rects.popper,C=r.elements[f?B:h],x=_1(Cr(C)?C:C.contextElement||zi(r.elements.popper),A,u,o),w=jr(r.elements.reference),D=Dg({reference:w,element:y,placement:n}),F=DA(Object.assign({},y,D)),O=h===Xn?F:w,M={top:x.top-O.top+v.top,bottom:O.bottom-x.bottom+v.bottom,left:x.left-O.left+v.left,right:O.right-x.right+v.right},j=r.modifiersData.offset;if(h===Xn&&j){var X=j[n];Object.keys(M).forEach(function(le){var oe=[jt,Jt].indexOf(le)>=0?1:-1,L=[Pt,Jt].indexOf(le)>=0?"y":"x";M[le]+=X[L]*oe})}return M}function w1(r,e){e===void 0&&(e={});var t=e,i=t.placement,n=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,A=t.allowedAutoPlacements,l=A===void 0?vg:A,u=Xr(i),c=u?a?Ig:Ig.filter(function(f){return Xr(f)===u}):Jn,h=c.filter(function(f){return l.indexOf(f)>=0});h.length===0&&(h=c);var d=h.reduce(function(f,g){return f[g]=ts(r,{placement:g,boundary:n,rootBoundary:s,padding:o})[mi(g)],f},{});return Object.keys(d).sort(function(f,g){return d[f]-d[g]})}function R1(r){if(mi(r)===TA)return[];var e=Po(r);return[_g(r),e,_g(e)]}function D1(r){var e=r.state,t=r.options,i=r.name;if(!e.modifiersData[i]._skip){for(var n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!0:o,A=t.fallbackPlacements,l=t.padding,u=t.boundary,c=t.rootBoundary,h=t.altBoundary,d=t.flipVariations,f=d===void 0?!0:d,g=t.allowedAutoPlacements,p=e.options.placement,v=mi(p),B=v===p,y=A||(B||!f?[Po(p)]:R1(p)),C=[p].concat(y).reduce(function(ie,he){return ie.concat(mi(he)===TA?w1(e,{placement:he,boundary:u,rootBoundary:c,padding:l,flipVariations:f,allowedAutoPlacements:g}):he)},[]),x=e.rects.reference,w=e.rects.popper,D=new Map,F=!0,O=C[0],M=0;M<C.length;M++){var j=C[M],X=mi(j),le=Xr(j)===qr,oe=[Pt,Jt].indexOf(X)>=0,L=oe?"width":"height",U=ts(e,{placement:j,boundary:u,rootBoundary:c,altBoundary:h,padding:l}),J=oe?le?jt:Ot:le?Jt:Pt;x[L]>w[L]&&(J=Po(J));var R=Po(J),_=[];if(s&&_.push(U[X]<=0),a&&_.push(U[J]<=0,U[R]<=0),_.every(function(ie){return ie})){O=j,F=!1;break}D.set(j,_)}if(F)for(var k=f?3:1,K=function(he){var fe=C.find(function(_e){var Te=D.get(_e);if(Te)return Te.slice(0,he).every(function(Fe){return Fe})});if(fe)return O=fe,"break"},Y=k;Y>0;Y--){var te=K(Y);if(te==="break")break}e.placement!==O&&(e.modifiersData[i]._skip=!0,e.placement=O,e.reset=!0)}}const L1={name:"flip",enabled:!0,phase:"main",fn:D1,requiresIfExists:["offset"],data:{_skip:!1}};function Lg(r,e,t){return t===void 0&&(t={x:0,y:0}),{top:r.top-e.height-t.y,right:r.right-e.width+t.x,bottom:r.bottom-e.height+t.y,left:r.left-e.width-t.x}}function kg(r){return[Pt,jt,Jt,Ot].some(function(e){return r[e]>=0})}function k1(r){var e=r.state,t=r.name,i=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=ts(e,{elementContext:"reference"}),a=ts(e,{altBoundary:!0}),A=Lg(o,i),l=Lg(a,n,s),u=kg(A),c=kg(l);e.modifiersData[t]={referenceClippingOffsets:A,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:c},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":c})}const M1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:k1};function F1(r,e,t){var i=mi(r),n=[Ot,Pt].indexOf(i)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:r})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[Ot,jt].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function N1(r){var e=r.state,t=r.options,i=r.name,n=t.offset,s=n===void 0?[0,0]:n,o=vg.reduce(function(u,c){return u[c]=F1(c,e.rects,s),u},{}),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 P1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:N1};function O1(r){var e=r.state,t=r.name;e.modifiersData[t]=Dg({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const U1={name:"popperOffsets",enabled:!0,phase:"read",fn:O1,data:{}};function G1(r){return r==="x"?"y":"x"}function $1(r){var e=r.state,t=r.options,i=r.name,n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!1:o,A=t.boundary,l=t.rootBoundary,u=t.altBoundary,c=t.padding,h=t.tether,d=h===void 0?!0:h,f=t.tetherOffset,g=f===void 0?0:f,p=ts(e,{boundary:A,rootBoundary:l,padding:c,altBoundary:u}),v=mi(e.placement),B=Xr(e.placement),y=!B,C=QA(v),x=G1(C),w=e.modifiersData.popperOffsets,D=e.rects.reference,F=e.rects.popper,O=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,M=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),j=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,X={x:0,y:0};if(w){if(s){var le,oe=C==="y"?Pt:Ot,L=C==="y"?Jt:jt,U=C==="y"?"height":"width",J=w[C],R=J+p[oe],_=J-p[L],k=d?-F[U]/2:0,K=B===qr?D[U]:F[U],Y=B===qr?-F[U]:-D[U],te=e.elements.arrow,ie=d&&te?xA(te):{width:0,height:0},he=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Sg(),fe=he[oe],_e=he[L],Te=Zn(0,D[U],ie[U]),Fe=y?D[U]/2-k-Te-fe-M.mainAxis:K-Te-fe-M.mainAxis,pe=y?-D[U]/2+k+Te+_e+M.mainAxis:Y+Te+_e+M.mainAxis,Qe=e.elements.arrow&&zn(e.elements.arrow),Pe=Qe?C==="y"?Qe.clientTop||0:Qe.clientLeft||0:0,Re=(le=j==null?void 0:j[C])!=null?le:0,Ke=J+Fe-Re-Pe,Se=J+pe-Re,Ce=Zn(d?Mo(R,Ke):R,J,d?yr(_,Se):_);w[C]=Ce,X[C]=Ce-J}if(a){var ke,Ue=C==="x"?Pt:Ot,Xe=C==="x"?Jt:jt,Ge=w[x],$e=x==="y"?"height":"width",ye=Ge+p[Ue],et=Ge-p[Xe],ot=[Pt,Ot].indexOf(v)!==-1,Ze=(ke=j==null?void 0:j[x])!=null?ke:0,ze=ot?ye:Ge-D[$e]-F[$e]-Ze+M.altAxis,T=ot?Ge+D[$e]+F[$e]-Ze-M.altAxis:et,m=d&&ot?h1(ze,Ge,T):Zn(d?ze:ye,Ge,d?T:et);w[x]=m,X[x]=m-Ge}e.modifiersData[i]=X}}const H1={name:"preventOverflow",enabled:!0,phase:"main",fn:$1,requiresIfExists:["offset"]};function Y1(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function V1(r){return r===$t(r)||!Xt(r)?_A(r):Y1(r)}function K1(r){var e=r.getBoundingClientRect(),t=Jr(e.width)/r.offsetWidth||1,i=Jr(e.height)/r.offsetHeight||1;return t!==1||i!==1}function W1(r,e,t){t===void 0&&(t=!1);var i=Xt(e),n=Xt(e)&&K1(e),s=zi(e),o=jr(r,n,t),a={scrollLeft:0,scrollTop:0},A={x:0,y:0};return(i||!i&&!t)&&((pi(e)!=="body"||RA(s))&&(a=V1(e)),Xt(e)?(A=jr(e,!0),A.x+=e.clientLeft,A.y+=e.clientTop):s&&(A.x=wA(s))),{x:o.left+a.scrollLeft-A.x,y:o.top+a.scrollTop-A.y,width:o.width,height:o.height}}function q1(r){var e=new Map,t=new Set,i=[];r.forEach(function(s){e.set(s.name,s)});function n(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var A=e.get(a);A&&n(A)}}),i.push(s)}return r.forEach(function(s){t.has(s.name)||n(s)}),i}function J1(r){var e=q1(r);return a1.reduce(function(t,i){return t.concat(e.filter(function(n){return n.phase===i}))},[])}function j1(r){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(r())})})),e}}function X1(r){var e=r.reduce(function(t,i){var n=t[i.name];return t[i.name]=n?Object.assign({},n,i,{options:Object.assign({},n.options,i.options),data:Object.assign({},n.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var Mg={placement:"bottom",modifiers:[],strategy:"absolute"};function Fg(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function z1(r){r===void 0&&(r={});var e=r,t=e.defaultModifiers,i=t===void 0?[]:t,n=e.defaultOptions,s=n===void 0?Mg:n;return function(a,A,l){l===void 0&&(l=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Mg,s),modifiersData:{},elements:{reference:a,popper:A},attributes:{},styles:{}},c=[],h=!1,d={state:u,setOptions:function(v){var B=typeof v=="function"?v(u.options):v;g(),u.options=Object.assign({},s,u.options,B),u.scrollParents={reference:Cr(a)?es(a):a.contextElement?es(a.contextElement):[],popper:es(A)};var y=J1(X1([].concat(i,u.options.modifiers)));return u.orderedModifiers=y.filter(function(C){return C.enabled}),f(),d.update()},forceUpdate:function(){if(!h){var v=u.elements,B=v.reference,y=v.popper;if(Fg(B,y)){u.rects={reference:W1(B,zn(y),u.options.strategy==="fixed"),popper:xA(y)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(M){return u.modifiersData[M.name]=Object.assign({},M.data)});for(var C=0;C<u.orderedModifiers.length;C++){if(u.reset===!0){u.reset=!1,C=-1;continue}var x=u.orderedModifiers[C],w=x.fn,D=x.options,F=D===void 0?{}:D,O=x.name;typeof w=="function"&&(u=w({state:u,options:F,name:O,instance:d})||u)}}}},update:j1(function(){return new Promise(function(p){d.forceUpdate(),p(u)})}),destroy:function(){g(),h=!0}};if(!Fg(a,A))return d;d.setOptions(l).then(function(p){!h&&l.onFirstUpdate&&l.onFirstUpdate(p)});function f(){u.orderedModifiers.forEach(function(p){var v=p.name,B=p.options,y=B===void 0?{}:B,C=p.effect;if(typeof C=="function"){var x=C({state:u,name:v,instance:d,options:y}),w=function(){};c.push(x||w)}})}function g(){c.forEach(function(p){return p()}),c=[]}return d}}var Z1=[y1,U1,v1,Cg,P1,L1,H1,p1,M1],eb=z1({defaultModifiers:Z1}),tb="tippy-box",Ng="tippy-content",ib="tippy-backdrop",Pg="tippy-arrow",Og="tippy-svg-arrow",Br={passive:!0,capture:!0},Ug=function(){return document.body};function LA(r,e,t){if(Array.isArray(r)){var i=r[e];return i??(Array.isArray(t)?t[e]:t)}return r}function kA(r,e){var t={}.toString.call(r);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function Gg(r,e){return typeof r=="function"?r.apply(void 0,e):r}function $g(r,e){if(e===0)return r;var t;return function(i){clearTimeout(t),t=setTimeout(function(){r(i)},e)}}function rb(r){return r.split(/\s+/).filter(Boolean)}function zr(r){return[].concat(r)}function Hg(r,e){r.indexOf(e)===-1&&r.push(e)}function nb(r){return r.filter(function(e,t){return r.indexOf(e)===t})}function sb(r){return r.split("-")[0]}function Oo(r){return[].slice.call(r)}function Yg(r){return Object.keys(r).reduce(function(e,t){return r[t]!==void 0&&(e[t]=r[t]),e},{})}function is(){return document.createElement("div")}function Uo(r){return["Element","Fragment"].some(function(e){return kA(r,e)})}function ob(r){return kA(r,"NodeList")}function ab(r){return kA(r,"MouseEvent")}function lb(r){return!!(r&&r._tippy&&r._tippy.reference===r)}function Ab(r){return Uo(r)?[r]:ob(r)?Oo(r):Array.isArray(r)?r:Oo(document.querySelectorAll(r))}function MA(r,e){r.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function Vg(r,e){r.forEach(function(t){t&&t.setAttribute("data-state",e)})}function cb(r){var e,t=zr(r),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function ub(r,e){var t=e.clientX,i=e.clientY;return r.every(function(n){var s=n.popperRect,o=n.popperState,a=n.props,A=a.interactiveBorder,l=sb(o.placement),u=o.modifiersData.offset;if(!u)return!0;var c=l==="bottom"?u.top.y:0,h=l==="top"?u.bottom.y:0,d=l==="right"?u.left.x:0,f=l==="left"?u.right.x:0,g=s.top-i+c>A,p=i-s.bottom-h>A,v=s.left-t+d>A,B=t-s.right-f>A;return g||p||v||B})}function FA(r,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){r[i](n,t)})}function Kg(r,e){for(var t=e;t;){var i;if(r.contains(t))return!0;t=t.getRootNode==null||(i=t.getRootNode())==null?void 0:i.host}return!1}var Ei={isTouch:!1},Wg=0;function hb(){Ei.isTouch||(Ei.isTouch=!0,window.performance&&document.addEventListener("mousemove",qg))}function qg(){var r=performance.now();r-Wg<20&&(Ei.isTouch=!1,document.removeEventListener("mousemove",qg)),Wg=r}function db(){var r=document.activeElement;if(lb(r)){var e=r._tippy;r.blur&&!e.state.isVisible&&r.blur()}}function fb(){document.addEventListener("touchstart",hb,Br),window.addEventListener("blur",db)}var gb=typeof window<"u"&&typeof document<"u",pb=gb?!!window.msCrypto:!1,mb={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Eb={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},ii=Object.assign({appendTo:Ug,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},mb,Eb),Ib=Object.keys(ii),vb=function(e){var t=Object.keys(e);t.forEach(function(i){ii[i]=e[i]})};function Jg(r){var e=r.plugins||[],t=e.reduce(function(i,n){var s=n.name,o=n.defaultValue;if(s){var a;i[s]=r[s]!==void 0?r[s]:(a=ii[s])!=null?a:o}return i},{});return Object.assign({},r,t)}function Cb(r,e){var t=e?Object.keys(Jg(Object.assign({},ii,{plugins:e}))):Ib,i=t.reduce(function(n,s){var o=(r.getAttribute("data-tippy-"+s)||"").trim();if(!o)return n;if(s==="content")n[s]=o;else try{n[s]=JSON.parse(o)}catch{n[s]=o}return n},{});return i}function jg(r,e){var t=Object.assign({},e,{content:Gg(e.content,[r])},e.ignoreAttributes?{}:Cb(r,e.plugins));return t.aria=Object.assign({},ii.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 yb=function(){return"innerHTML"};function NA(r,e){r[yb()]=e}function Xg(r){var e=is();return r===!0?e.className=Pg:(e.className=Og,Uo(r)?e.appendChild(r):NA(e,r)),e}function zg(r,e){Uo(e.content)?(NA(r,""),r.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?NA(r,e.content):r.textContent=e.content)}function PA(r){var e=r.firstElementChild,t=Oo(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(Ng)}),arrow:t.find(function(i){return i.classList.contains(Pg)||i.classList.contains(Og)}),backdrop:t.find(function(i){return i.classList.contains(ib)})}}function Zg(r){var e=is(),t=is();t.className=tb,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=is();i.className=Ng,i.setAttribute("data-state","hidden"),zg(i,r.props),e.appendChild(t),t.appendChild(i),n(r.props,r.props);function n(s,o){var a=PA(e),A=a.box,l=a.content,u=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"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&zg(l,r.props),o.arrow?u?s.arrow!==o.arrow&&(A.removeChild(u),A.appendChild(Xg(o.arrow))):A.appendChild(Xg(o.arrow)):u&&A.removeChild(u)}return{popper:e,onUpdate:n}}Zg.$$tippy=!0;var Bb=1,Go=[],OA=[];function Tb(r,e){var t=jg(r,Object.assign({},ii,Jg(Yg(e)))),i,n,s,o=!1,a=!1,A=!1,l=!1,u,c,h,d=[],f=$g(Ke,t.interactiveDebounce),g,p=Bb++,v=null,B=nb(t.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:p,reference:r,popper:is(),popperInstance:v,props:t,state:y,plugins:B,clearDelayTimeouts:ze,setProps:T,setContent:m,show:E,hide:Q,hideWithInteractivity:P,enable:ot,disable:Ze,unmount:q,destroy:z};if(!t.render)return C;var x=t.render(C),w=x.popper,D=x.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+C.id,C.popper=w,r._tippy=C,w._tippy=C;var F=B.map(function($){return $.fn(C)}),O=r.hasAttribute("aria-expanded");return Qe(),k(),J(),R("onCreate",[C]),t.showOnCreate&&ye(),w.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),w.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&oe().addEventListener("mousemove",f)}),C;function M(){var $=C.props.touch;return Array.isArray($)?$:[$,0]}function j(){return M()[0]==="hold"}function X(){var $;return!!(($=C.props.render)!=null&&$.$$tippy)}function le(){return g||r}function oe(){var $=le().parentNode;return $?cb($):document}function L(){return PA(w)}function U($){return C.state.isMounted&&!C.state.isVisible||Ei.isTouch||u&&u.type==="focus"?0:LA(C.props.delay,$?0:1,ii.delay)}function J($){$===void 0&&($=!1),w.style.pointerEvents=C.props.interactive&&!$?"":"none",w.style.zIndex=""+C.props.zIndex}function R($,ae,ue){if(ue===void 0&&(ue=!0),F.forEach(function(me){me[$]&&me[$].apply(me,ae)}),ue){var ve;(ve=C.props)[$].apply(ve,ae)}}function _(){var $=C.props.aria;if($.content){var ae="aria-"+$.content,ue=w.id,ve=zr(C.props.triggerTarget||r);ve.forEach(function(me){var nt=me.getAttribute(ae);if(C.state.isVisible)me.setAttribute(ae,nt?nt+" "+ue:ue);else{var Rt=nt&&nt.replace(ue,"").trim();Rt?me.setAttribute(ae,Rt):me.removeAttribute(ae)}})}}function k(){if(!(O||!C.props.aria.expanded)){var $=zr(C.props.triggerTarget||r);$.forEach(function(ae){C.props.interactive?ae.setAttribute("aria-expanded",C.state.isVisible&&ae===le()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function K(){oe().removeEventListener("mousemove",f),Go=Go.filter(function($){return $!==f})}function Y($){if(!(Ei.isTouch&&(A||$.type==="mousedown"))){var ae=$.composedPath&&$.composedPath()[0]||$.target;if(!(C.props.interactive&&Kg(w,ae))){if(zr(C.props.triggerTarget||r).some(function(ue){return Kg(ue,ae)})){if(Ei.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else R("onClickOutside",[C,$]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||fe())}}}function te(){A=!0}function ie(){A=!1}function he(){var $=oe();$.addEventListener("mousedown",Y,!0),$.addEventListener("touchend",Y,Br),$.addEventListener("touchstart",ie,Br),$.addEventListener("touchmove",te,Br)}function fe(){var $=oe();$.removeEventListener("mousedown",Y,!0),$.removeEventListener("touchend",Y,Br),$.removeEventListener("touchstart",ie,Br),$.removeEventListener("touchmove",te,Br)}function _e($,ae){Fe($,function(){!C.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&ae()})}function Te($,ae){Fe($,ae)}function Fe($,ae){var ue=L().box;function ve(me){me.target===ue&&(FA(ue,"remove",ve),ae())}if($===0)return ae();FA(ue,"remove",c),FA(ue,"add",ve),c=ve}function pe($,ae,ue){ue===void 0&&(ue=!1);var ve=zr(C.props.triggerTarget||r);ve.forEach(function(me){me.addEventListener($,ae,ue),d.push({node:me,eventType:$,handler:ae,options:ue})})}function Qe(){j()&&(pe("touchstart",Re,{passive:!0}),pe("touchend",Se,{passive:!0})),rb(C.props.trigger).forEach(function($){if($!=="manual")switch(pe($,Re),$){case"mouseenter":pe("mouseleave",Se);break;case"focus":pe(pb?"focusout":"blur",Ce);break;case"focusin":pe("focusout",Ce);break}})}function Pe(){d.forEach(function($){var ae=$.node,ue=$.eventType,ve=$.handler,me=$.options;ae.removeEventListener(ue,ve,me)}),d=[]}function Re($){var ae,ue=!1;if(!(!C.state.isEnabled||ke($)||a)){var ve=((ae=u)==null?void 0:ae.type)==="focus";u=$,g=$.currentTarget,k(),!C.state.isVisible&&ab($)&&Go.forEach(function(me){return me($)}),$.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||o)&&C.props.hideOnClick!==!1&&C.state.isVisible?ue=!0:ye($),$.type==="click"&&(o=!ue),ue&&!ve&&et($)}}function Ke($){var ae=$.target,ue=le().contains(ae)||w.contains(ae);if(!($.type==="mousemove"&&ue)){var ve=$e().concat(w).map(function(me){var nt,Rt=me._tippy,Dt=(nt=Rt.popperInstance)==null?void 0:nt.state;return Dt?{popperRect:me.getBoundingClientRect(),popperState:Dt,props:t}:null}).filter(Boolean);ub(ve,$)&&(K(),et($))}}function Se($){var ae=ke($)||C.props.trigger.indexOf("click")>=0&&o;if(!ae){if(C.props.interactive){C.hideWithInteractivity($);return}et($)}}function Ce($){C.props.trigger.indexOf("focusin")<0&&$.target!==le()||C.props.interactive&&$.relatedTarget&&w.contains($.relatedTarget)||et($)}function ke($){return Ei.isTouch?j()!==$.type.indexOf("touch")>=0:!1}function Ue(){Xe();var $=C.props,ae=$.popperOptions,ue=$.placement,ve=$.offset,me=$.getReferenceClientRect,nt=$.moveTransition,Rt=X()?PA(w).arrow:null,Dt=me?{getBoundingClientRect:me,contextElement:me.contextElement||le()}:r,nn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(sn){var ir=sn.state;if(X()){var ls=L(),As=ls.box;["placement","reference-hidden","escaped"].forEach(function(on){on==="placement"?As.setAttribute("data-placement",ir.placement):ir.attributes.popper["data-popper-"+on]?As.setAttribute("data-"+on,""):As.removeAttribute("data-"+on)}),ir.attributes.popper={}}}},Lt=[{name:"offset",options:{offset:ve}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!nt}},nn];X()&&Rt&&Lt.push({name:"arrow",options:{element:Rt,padding:3}}),Lt.push.apply(Lt,(ae==null?void 0:ae.modifiers)||[]),C.popperInstance=eb(Dt,w,Object.assign({},ae,{placement:ue,onFirstUpdate:h,modifiers:Lt}))}function Xe(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function Ge(){var $=C.props.appendTo,ae,ue=le();C.props.interactive&&$===Ug||$==="parent"?ae=ue.parentNode:ae=Gg($,[ue]),ae.contains(w)||ae.appendChild(w),C.state.isMounted=!0,Ue()}function $e(){return Oo(w.querySelectorAll("[data-tippy-root]"))}function ye($){C.clearDelayTimeouts(),$&&R("onTrigger",[C,$]),he();var ae=U(!0),ue=M(),ve=ue[0],me=ue[1];Ei.isTouch&&ve==="hold"&&me&&(ae=me),ae?i=setTimeout(function(){C.show()},ae):C.show()}function et($){if(C.clearDelayTimeouts(),R("onUntrigger",[C,$]),!C.state.isVisible){fe();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf($.type)>=0&&o)){var ae=U(!1);ae?n=setTimeout(function(){C.state.isVisible&&C.hide()},ae):s=requestAnimationFrame(function(){C.hide()})}}function ot(){C.state.isEnabled=!0}function Ze(){C.hide(),C.state.isEnabled=!1}function ze(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(s)}function T($){if(!C.state.isDestroyed){R("onBeforeUpdate",[C,$]),Pe();var ae=C.props,ue=jg(r,Object.assign({},ae,Yg($),{ignoreAttributes:!0}));C.props=ue,Qe(),ae.interactiveDebounce!==ue.interactiveDebounce&&(K(),f=$g(Ke,ue.interactiveDebounce)),ae.triggerTarget&&!ue.triggerTarget?zr(ae.triggerTarget).forEach(function(ve){ve.removeAttribute("aria-expanded")}):ue.triggerTarget&&r.removeAttribute("aria-expanded"),k(),J(),D&&D(ae,ue),C.popperInstance&&(Ue(),$e().forEach(function(ve){requestAnimationFrame(ve._tippy.popperInstance.forceUpdate)})),R("onAfterUpdate",[C,$])}}function m($){C.setProps({content:$})}function E(){var $=C.state.isVisible,ae=C.state.isDestroyed,ue=!C.state.isEnabled,ve=Ei.isTouch&&!C.props.touch,me=LA(C.props.duration,0,ii.duration);if(!($||ae||ue||ve)&&!le().hasAttribute("disabled")&&(R("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,X()&&(w.style.visibility="visible"),J(),he(),C.state.isMounted||(w.style.transition="none"),X()){var nt=L(),Rt=nt.box,Dt=nt.content;MA([Rt,Dt],0)}h=function(){var Lt;if(!(!C.state.isVisible||l)){if(l=!0,w.offsetHeight,w.style.transition=C.props.moveTransition,X()&&C.props.animation){var Qr=L(),sn=Qr.box,ir=Qr.content;MA([sn,ir],me),Vg([sn,ir],"visible")}_(),k(),Hg(OA,C),(Lt=C.popperInstance)==null||Lt.forceUpdate(),R("onMount",[C]),C.props.animation&&X()&&Te(me,function(){C.state.isShown=!0,R("onShown",[C])})}},Ge()}}function Q(){var $=!C.state.isVisible,ae=C.state.isDestroyed,ue=!C.state.isEnabled,ve=LA(C.props.duration,1,ii.duration);if(!($||ae||ue)&&(R("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,l=!1,o=!1,X()&&(w.style.visibility="hidden"),K(),fe(),J(!0),X()){var me=L(),nt=me.box,Rt=me.content;C.props.animation&&(MA([nt,Rt],ve),Vg([nt,Rt],"hidden"))}_(),k(),C.props.animation?X()&&_e(ve,C.unmount):C.unmount()}}function P($){oe().addEventListener("mousemove",f),Hg(Go,f),f($)}function q(){C.state.isVisible&&C.hide(),C.state.isMounted&&(Xe(),$e().forEach(function($){$._tippy.unmount()}),w.parentNode&&w.parentNode.removeChild(w),OA=OA.filter(function($){return $!==C}),C.state.isMounted=!1,R("onHidden",[C]))}function z(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),Pe(),delete r._tippy,C.state.isDestroyed=!0,R("onDestroy",[C]))}}function Tr(r,e){e===void 0&&(e={});var t=ii.plugins.concat(e.plugins||[]);fb();var i=Object.assign({},e,{plugins:t}),n=Ab(r),s=n.reduce(function(o,a){var A=a&&Tb(a,i);return A&&o.push(A),o},[]);return Uo(r)?s[0]:s}Tr.defaultProps=ii,Tr.setDefaultProps=vb,Tr.currentInput=Ei,Object.assign({},Cg,{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)}}),Tr.setDefaultProps({render:Zg});function zt(r,e){return`${r}-${e}`}function Ii(r){var e,t;const i=[];return(((e=r.renderer)==null?void 0:e.type)==="video"||((t=r.renderer)==null?void 0:t.type)==="audio")&&i.push({...r.config,...r.options}),i.push(...r.childNodes.flatMap(Ii).filter(Boolean)),i}class $o 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(" - ")}}function Zi(r,e,t){return Math.min(Math.max(e,r),t)}const Sb=5;function bb(r,e){return r.length!==e.length||r.some((t,i)=>t!==e[i])}class xb{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._canvas=xt(),this._controls=xt(),this.host=e}set activeScenes(e){bb(e,this._activeScenes)&&(this._activeScenes=e,this.host.dispatchEvent(new CustomEvent("scenechange",{detail:e})),this.host.requestUpdate())}get activeScenes(){return this._activeScenes}set currentTime(e){var t,i,n;const s=Zi(0,e,this.host.duration);this.activeScenes=((t=this.host.composition)==null?void 0:t.tracks.reduce((a,A)=>a.concat(A.scenes.filter(({start:l,duration:u})=>s>=l&&s<l+u)),[]))??[];const o=s!==this.currentTime;this._currentTime=s,this._upcomingScenes=((i=this.host.composition)==null?void 0:i.tracks.reduce((a,A)=>a.concat(A.scenes.filter(({start:l})=>s>=l-Sb&&s<l)),[]))??[],this.loadScenes(),this.syncMediaState(),(n=this._controls.value)==null||n.setAttribute("currentTime",s.toString()),o&&this.host.dispatchEvent(new CustomEvent("timeupdate",{detail:s})),this.draw(s)}get currentTime(){return this._currentTime}set caption(e){e!==this._caption&&(this._caption=e,this.host.requestUpdate())}get caption(){return this._caption}canvas(){return Qt(this._canvas)}controls(){return Qt(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{Ii(e.layout.node).forEach(({key:i})=>{var n,s,o;const{id:a,start:A,duration:l}=e,u=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused,c=zt(a,i);if(this.host.media[c]){const h=this.host.media[c],{speed:d,volume:f,hls:g,node:p,start:v,duration:B}=h,y=this.host.mediaState[c];p&&y&&(p.currentTime>=v+B||p.ended||u&&(g?(n=g.startLoadOnce)==null||n.call(g,v):y.initialised||(s=p.startLoadOnce)==null||s.call(p),p.volume=Zi(0,this.host.volume*(f??1),1),p.playbackRate=Zi(.1,this.host.playbackRate*(d??1),4)))}else if(u){const h=`${A}-${l}`,d=this.host._sceneController.mediaState[h];this.host.duration&&!((o=d==null?void 0:d.buffered)!=null&&o.length)&&(this.host._sceneController.mediaState={...this.host._sceneController.mediaState,[h]:{...d,buffered:[{start:Math.max(0,A/this.host.duration*100),end:Math.min((A+l)/this.host.duration*100,100)}]}})}})})}syncMediaState(){var e;return Promise.all(((e=this.host.composition)==null?void 0:e.tracks.flatMap(t=>t.scenes.flatMap(i=>Ii(i.layout.node).map(async({key:s})=>{const o=zt(i.id,s);if(this.host.media[o]){const a=this.host.media[o],{node:A}=a,l=this.host.mediaState[o],u=this.activeScenes.includes(i);if(l)if(u&&!this.host.waiting&&!this.host.loading&&!this.host.paused){if(A.paused&&l.initialised)try{await A.play()}catch(c){throw new $o("Video play error",c,!0)}}else A.paused||A.pause()}}))))??[])}draw(e=this.currentTime){this.host.composition&&this._canvas.value&&this.host.composition.draw({currentTime:e,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)}}const Qb=$i(async function(e){const{weight:t,family:i}=e,{client:n,server:s}=i.weights.find(a=>a.weight===t)??{};return!n&&!s?null:new FontFace(e.family.name,`url(${n??s})`,{weight:t,style:"normal"}).load()},{cacheKey:([r])=>JSON.stringify(r)}),_b=$i(async({options:r})=>{const e=await Qb(r.font);return e&&document.fonts.add(e),{font:r.font}}),wb=$i(async({config:r})=>r.src?new Promise((e,t)=>{const i=new Image;i.crossOrigin="anonymous",i.onload=()=>{e({image:i})},i.onerror=n=>{t(n)},i.src=r.src}):{image:null},{cacheKey:([{config:r}])=>JSON.stringify(r)});async function e0(r){return r.duration===1/0?new Promise(e=>{r.currentTime=Number.MAX_SAFE_INTEGER,r.ontimeupdate=()=>{r.ontimeupdate=null,e(r.duration),r.currentTime=0}}):r.duration}function Rb(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Db(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Lb(r){return new Promise(async e=>{let t=null;const{type:i,key:n,src:s,duration:o}=r;i==="video"?(t=document.createElement("video"),t.playsInline=!0):t=document.createElement("audio"),t.muted=!0,t.loop=!1,t.crossOrigin="anonymous",t.src=s;let a=!1;if(t.startLoadOnce=()=>{a||(t.preload="auto",t.load(),a=!0)},i==="video"&&o&&r.aspectRatio)t.preload="none",e({key:n,hls:null,node:t,aspectRatio:r.aspectRatio,totalDuration:o});else{t.preload="metadata";const A=async()=>{const l=await e0(t);e({key:n,hls:null,node:t,totalDuration:l,aspectRatio:t instanceof HTMLVideoElement?t.videoWidth/t.videoHeight:null}),t.removeEventListener("loadedmetadata",A)};t.addEventListener("loadedmetadata",A)}})}function kb({key:r,playlist:e,duration:t}){return new Promise(i=>{const n=document.createElement("video");n instanceof HTMLVideoElement&&(n.playsInline=!0),n.muted=!0,n.loop=!1,n.crossOrigin="anonymous";let s=!1;const o=new gi({autoStartLoad:!0,xhrSetup:a=>{const{open:A}=a,l=e.split("?")[1];a.open=function(u,c,h){l&&!c.toString().includes("?")&&(c+="?"+l),!(!s&&c.toString().includes(".ts"))&&A.apply(this,[u,c,h])}}});o.on(gi.Events.LEVEL_LOADED,async()=>{s||o==null||o.stopLoad();const a=t??await e0(n);i({key:r,hls:o,node:n,aspectRatio:o.levels[0].width/o.levels[0].height,totalDuration:a})}),o.loadSource(e),o.attachMedia(n),o.startLoadOnce=(a=-1,A)=>{if(o&&!s){const l=o.levels.findIndex(u=>Math.min(u.height,u.width)===A);s=!0,o.startLevel=o.firstLevel,o.startLoad(a),o.currentLevel=l!==-1?l:o.firstLevel}}})}function Mb(r){const{playlist:e}=r;return e&&!Rb()&&gi.isSupported()?kb({...r,playlist:e}):Lb(r)}let Fb=class{constructor(e){this._hasPlayed=!1,this._duration=0,this._composition=null,this._media={},this._mediaState={},this._compositionController=new AbortController,this._delayProcessing=(t=100)=>{const i=new AbortController,n=setTimeout(()=>{i.signal.aborted||(this.host._processing=!0)},t);return i.signal.addEventListener("abort",()=>{clearTimeout(n)}),i},this._mediaFactory=$i(async(t,i)=>{const{key:n}=i,s=await Mb(i),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 u=l,c=o[u]({id:t,key:n,node:s.node});return A[u]=c,s.node.addEventListener(l,c),A},{});return{media:s,listeners:a,aspectRatio:s.aspectRatio,source:()=>s.node}},{cacheKey:([t,{key:i,src:n,playlist:s}])=>JSON.stringify({id:t,key:i,src:n==null?void 0:n.split("?")[0],playlist:s==null?void 0:s.split("?")[0]})}),this._handleLoadedData=({id:t,key:i,node:n})=>()=>{const s=zt(t,i),o=this.mediaState[s];o!=null&&o.initialised||(this.mediaState={...this.mediaState,[s]:{...o,initialised:!0,waiting:!1,buffered:(o==null?void 0:o.buffered)??[]}},this.setMediaCurrentTime(this.host.currentTime),this.host.dispatchEvent(new CustomEvent("video:loadeddata",{detail:{id:t,key:i,node:n}})))},this._handleWaiting=({id:t,key:i})=>()=>{const n=zt(t,i),s=this.mediaState[n];s!=null&&s.initialised&&!(s!=null&&s.waiting)&&(this.mediaState={...this.mediaState,[n]:{...s,waiting:!0}})},this._handleCanPlay=({id:t,key:i})=>()=>{const n=zt(t,i),s=this.mediaState[n];s!=null&&s.initialised&&(s!=null&&s.waiting)&&(this.mediaState={...this.mediaState,[n]:{...s,waiting:!1}}),this.host.paused&&this.host.draw()},this._handleProgress=()=>()=>{},this._handleSeeking=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:seeking",{detail:{id:t,key:i,node:n}}))},this._handleSeeked=({id:t,key:i,node:n})=>()=>{const s=zt(t,i),o=this.mediaState[s];o!=null&&o.initialised&&(this.host.draw(),this.host.activeScenes.flatMap(a=>Ii(a.layout.node).map(({id:l})=>l)).includes(t)&&this.host.dispatchEvent(new CustomEvent("seeked",{detail:this.host.currentTime})),this.host.dispatchEvent(new CustomEvent("video:seeked",{detail:{id:t,key:i,node:n}})))},this._handlePlay=({id:t,key:i,node:n})=>()=>{this.hasPlayed=!0,this.host.dispatchEvent(new CustomEvent("video:play",{detail:{id:t,key:i,node:n}}))},this._handlePlaying=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:playing",{detail:{id:t,key:i,node:n}}))},this._handlePause=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:pause",{detail:{id:t,key:i,node:n}}))},this._handleStalled=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:stalled",{detail:{id:t,key:i,node:n}}))},this._handleTimeUpdate=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:timeupdate",{detail:{id:t,key:i,node:n}}))},this._handleEnded=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:ended",{detail:{id:t,key:i,node:n}}))},this._handleError=({id:t,key:i,node:n})=>()=>{const s=new $o(`Video error - answer ${t} failed to load`);this.host.dispatchEvent(new ErrorEvent("error",{bubbles:!0,composed:!0,error:s,message:s.message})),this.host.dispatchEvent(new CustomEvent("video:error",{detail:{id:t,key:i,node:n}}))},this._cleanupMedia=t=>{var i;const n=this.media[t];n&&(n.node.pause(),n.node.src="",(i=n.hls)==null||i.destroy(),Object.keys(n.listeners??{}).forEach(s=>{var o,a;if((o=this.media)!=null&&o[t]){const A=(a=n.listeners)==null?void 0:a[s];A&&n.node.removeEventListener(s,A)}}),delete this._media[t],delete this._mediaState[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 composition(e){e!==this._composition&&(this._composition=e,this.host.requestUpdate())}get composition(){return this._composition}set media(e){e!==this._media&&(this._media=e,this.host.requestUpdate())}get media(){return this._media}set mediaState(e){e!==this._mediaState&&(this._mediaState=e,this.host.requestUpdate())}get mediaState(){return this._mediaState}_setupTask(){new Cs(this.host,async([e,t,i,n])=>{var s,o;this._compositionController.abort(),this._compositionController=new AbortController;const a=this._compositionController,A=this._delayProcessing();try{if(this.host._errors=[],(!t||!this.host._languages.find(({value:l})=>t===l))&&(this.host._language=(s=this.host._languages[0])==null?void 0:s.value),e){const{width:l,height:u}=nl({aspectRatio:i,resolution:1080});try{(o=this.composition)==null||o.cleanup();const f=await Qh({debug:n,config:e,resolvers:{text:_b,image:wb,video:async({id:g,config:p,options:v})=>{const{media:B,source:y}=await this._mediaFactory(g,{...p,...v});return{video:y,aspectRatio:B.aspectRatio}}},rootWidth:l,rootHeight:u});if(a.signal.aborted)return;this.composition=f}catch(f){throw new $o("Fatal composition error",f,!0)}this.duration=this.composition.duration;const c={...this.media},h={...this.mediaState},d=[];for(const f of this.composition.tracks)for(const g of f.scenes){const p=Ii(g.layout.node);for(const v of p){const{media:B,listeners:y}=await this._mediaFactory(g.id,v),C=zt(g.id,B.key);d.push(C);const x=(v.startOffset??0)*B.totalDuration,w=(1-(v.endOffset??0))*B.totalDuration;c[C]={...B,listeners:y,start:x,duration:w-x,speed:v.speed??1,volume:v.volume??1},h[C]={initialised:!B,waiting:!!B,...this.mediaState[C]}}}this.media=c,this.mediaState=h,Object.keys(this.media).forEach(f=>{d.includes(f)||this.media[f].node.pause()}),this.host.currentTime>this.duration?this.host.reset(this.duration,!1):this.host.paused?this.host.reset(this.host.currentTime,!this.host.paused):this.setMediaCurrentTime(this.host.currentTime)}this.host.dispatchEvent(new CustomEvent("compositionupdate",{detail:this.composition,bubbles:!0,composed:!0}))}catch(l){this.composition=null,this.duration=0,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:l,message:l.message}))}finally{A.abort(),this.host._processing=!1}},()=>[this.host.config,this.host.language,this.host.aspectRatio,this.host.debug])}_setMediaCurrentTime({time:e,scene:t}){const{id:i,layout:n,start:s}=t;Ii(n.node).forEach(({key:a})=>{const A=zt(i,a);if(this.media[A]){const l=this.media[A],u=(e-s)*l.speed;l.node.currentTime=Zi(l.start,u+l.start,l.start+l.duration)}})}setMediaCurrentTime(e){var t;(t=this.composition)==null||t.tracks.forEach(i=>{i.scenes.forEach(n=>{this._setMediaCurrentTime({time:e,scene:n})})})}hostConnected(){this._setupTask()}hostDisconnected(){Object.keys(this.media).forEach(e=>{this._cleanupMedia(e)}),this.media={}}};function Nb(r){r.requestFullscreen?r.requestFullscreen():r.mozRequestFullScreen?r.mozRequestFullScreen():r.webkitRequestFullscreen?r.webkitRequestFullscreen():r.msRequestFullscreen&&r.msRequestFullscreen()}function Pb(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const UA=["progress","play-large","navigation","play","volume","current-time","duration","speed","captions","fullscreen","preview"],Ob={id:"captions",event:"captions:click",label:"Closed Captions"},Ub={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},t0={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}]},Gb={id:"playbackRate",label:"Playback playbackRate",subItems:t0};class $b extends Rc{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==Lr.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)),Oi}}const GA=kr($b),Hb=JS(()=>{const r=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","url(https://vouch-clients.s3.ap-southeast-2.amazonaws.com/vouch/fonts/Roobert-Bold.woff2",{style:"normal",weight:"700"}),i=new FontFace("Roobert Captions","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),n=Ch.map(s=>({load:!1,font:new FontFace(s.family,`url(${s.url})`,{style:s.style})}));return[{load:!0,font:r},{load:!0,font:e},{load:!0,font:t},{load:!0,font:i},...n]}),vi={"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"},Yb={colors:vi,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 ${vi["dark-100"]}`,medium:`0 .125rem .625rem ${vi["dark-100"]}`,large:`0 .25rem 1rem ${vi["dark-50"]}`,xl:`.25rem .25rem 1rem ${vi["dark-250"]}`,xxl:`0 .25rem 2rem ${vi["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${vi["dark-250"]}`,toolbar:`0 -.625rem .625rem ${vi["dark-50"]}`,text:`0 0 .25rem ${vi["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:vi["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},i0=KS(Yb,{delimiter:"-"}),Vb=Object.keys(i0).map(r=>hn(`:host { --${r}: ${i0[r]}; }`)),Je=(r=>{const e=class extends r{firstUpdated(){Hb().forEach(({load:s,font:o})=>{document.fonts.add(o),s&&o.load()})}};return e.styles=[(r==null?void 0:r.styles)??[],Vb,Bt`
2529
2529
  :host {
2530
2530
  font-family: var(--fontFamilies-sans);
2531
2531
  font-size: var(--fontSizes-medium);