@vouchfor/embeds 8.4.5 → 8.4.7
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.
- package/dist/es/embeds.js +6 -5
- package/dist/es/embeds.js.map +1 -1
- package/dist/iife/dialog-embed/embed.iife.js +2 -2
- package/dist/iife/dialog-embed/embed.iife.js.map +1 -1
- package/dist/iife/embeds.iife.js +2 -2
- package/dist/iife/embeds.iife.js.map +1 -1
- package/dist/iife/player-embed/embed.iife.js +2 -2
- package/dist/iife/player-embed/embed.iife.js.map +1 -1
- package/package.json +6 -5
|
@@ -2459,7 +2459,7 @@ vec4 transition(vec2 uv) {
|
|
|
2459
2459
|
return mix(a, b, step(0.0+p.y,progress));
|
|
2460
2460
|
}
|
|
2461
2461
|
`,author:"Jake Nelson",license:"MIT",createdAt:"Wed, 1 Nov 2017 15:24:36 -0500",updatedAt:"Thu, 2 Nov 2017 18:37:42 -0500"}];const Kh=al(kv);var Wh;function Mv(i){if(typeof i=="string"){const[e,t]=i.split(":");return Math.min(parseFloat(e),parseFloat(t))}return i}function Fv(i){if(typeof i=="string"){const[e,t]=i.split(":"),r=parseFloat(e),n=parseFloat(t);return r/n}return i}function Nl({resolution:i,aspectRatio:e}){const t=Mv(i),r=Fv(e),n=r>=1,s=Math.min(n?t*r:t/r,t),o=Math.max(n?t*r:t/r,t);return{resolution:t,aspectRatio:r,height:Math.round(n?s:o),width:Math.round(n?o:s)}}const jh={linear:jm,easeIn:sl,easeInOut:qm,easeOut:Jm,circIn:Hu,circInOut:zm,circOut:$u,backIn:ol,backInOut:Zm,backOut:Xm,anticipate:eE,bounceIn:nE,bounceInOut:sE,bounceOut:co},_o=vu((i,e,{clamp:t=!0,ease:r="easeIn",...n}={})=>Hm(i,e,{...n,clamp:t,ease:jh[r]}),{cacheKey:([i,e,t])=>JSON.stringify({from:i,to:e,options:t})}),Pv={type:"clip",processor:{getTargetState:i=>({clip:{x:i.coordinates.x,y:i.coordinates.y,width:i.dimensions.width,height:i.dimensions.height}}),interpolateState:({value:i,easing:e,progress:t,from:r})=>{const n=r.clip??{x:0,y:0,width:1,height:1},s={x:i.coordinates.x,y:i.coordinates.y,width:i.dimensions.width,height:i.dimensions.height};return{clip:_o([0,1],[n,s],{ease:e})(t)}}}},Do={type:"fade",processor:{getTargetState:i=>({opacity:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({opacity:_o([0,1],[r.opacity,i],{ease:e})(t)})}},Nv={type:"scale",processor:{getTargetState:i=>({scale:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({scale:_o([0,1],[r.scale,i],{ease:e})(t)})}},Jh={type:"translate",processor:{getTargetState:i=>({translation:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({translation:_o([0,1],[r.translation,i],{ease:e})(t)})}},Ov=[{label:"Both",value:"both"},{label:"At start",value:"enter"},{label:"At end",value:"exit"}],Uv=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"},{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],Gv=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"}],Hv=[{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],os={timing:{type:"buttonRadio",name:"timing",label:"Animate",options:Ov},speed:{type:"slider",name:"speed",label:"Speed",min:0,max:100,step:1}},Ol={type:"switch",name:"reverseExit",label:"Reverse exit animation"},$v=.2,Yv=3;function Vv(i,e){const t=i==="both"?e/2:e;return Math.min(Yv,t)}function as({speed:i,timing:e,elementDuration:t}){const r=Vv(e,t),n=Math.min($v,r),s=Math.max(0,Math.min(100,i))/100;return r-s*(r-n)}const Kv="easeOut";function ls(i){return{values:e=>{var t;return{timing:e.timing??"both",speed:[e.speed??50],...((t=i==null?void 0:i.values)==null?void 0:t.call(i,e))??{}}},options:e=>{var t;return{timing:e.timing,speed:e.speed[0],easing:Kv,...((t=i==null?void 0:i.options)==null?void 0:t.call(i,e))??{}}}}}function ur({timing:i,duration:e,elementDuration:t,easing:r,reverseExit:n=!1,enterFrom:s,exitTo:o,restValue:a}){const c=[],l=i==="both"||i==="enter",u=i==="both"||i==="exit",A=Math.max(0,t-e);if(l?(c.push({time:0,value:s,easing:r}),c.push({time:e,value:a,easing:"linear"})):c.push({time:0,value:a,easing:"linear"}),u){A>e&&c.push({time:A,value:a,easing:r});const h=n?s:o;c.push({time:t,value:h,easing:r})}return c}const qh="fade",Wv={type:qh,name:"Fade",options:{...os},transform:ls(),generate:(i,e)=>{const t=as({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration});return{fade:{keyframes:ur({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:Do}}}},zh="pan",Xh=.25,Zh="left";function ed(i,e,t){switch(i){case"left":return{x:e.width*t,y:0};case"right":return{x:-e.width*t,y:0};default:return ed(Zh,e,t)}}function jv(i){return{x:-i.x,y:-i.y}}const Jv={type:zh,name:"Pan",options:{...os,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Gv},distance:{type:"slider",name:"distance",label:"Distance",min:.1,max:1,step:.05,transform:{format:i=>`${(i*100).toFixed(0)}%`}},reverseExit:Ol},transform:ls({values:i=>({direction:i.direction??Zh,distance:[i.distance??Xh],reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,distance:i.distance[0],reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=as({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=i.distance??Xh,n=ed(i.direction,e.elementDimensions,r),s=jv(n);return{fade:{keyframes:ur({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:Do},translate:{keyframes:ur({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:n,exitTo:s,restValue:{x:0,y:0}}),renderer:Jh}}}},td="pop",id=.5,qv={type:td,name:"Pop",options:{...os},transform:ls(),generate:(i,e)=>{const t=as({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration});return{fade:{keyframes:ur({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:Do},scale:{keyframes:ur({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:"backOut",enterFrom:id,exitTo:id,restValue:1}),renderer:Nv}}}},rd="rise",nd=50,zv="up";function Xv(i,e){switch(i){case"down":return{enterY:-e,exitY:e};case"up":default:return{enterY:e,exitY:-e}}}const Zv={type:rd,name:"Rise",options:{...os,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Hv},distance:{type:"slider",name:"distance",label:"Distance",min:5,max:100,step:5,transform:{format:i=>`${i}px`}},reverseExit:Ol},transform:ls({values:i=>({direction:i.direction??zv,distance:[i.distance??nd],reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,distance:i.distance[0],reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=as({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=i.distance??nd,{enterY:n,exitY:s}=Xv(i.direction,r);return{fade:{keyframes:ur({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:Do},translate:{keyframes:ur({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:{x:0,y:n},exitTo:{x:0,y:s},restValue:{x:0,y:0}}),renderer:Jh}}}},sd="wipe",Ul="left";function on(i){switch(i){case"left":return{coordinates:{x:1,y:0},dimensions:{width:0,height:1}};case"right":return{coordinates:{x:0,y:0},dimensions:{width:0,height:1}};case"up":return{coordinates:{x:0,y:1},dimensions:{width:1,height:0}};case"down":return{coordinates:{x:0,y:0},dimensions:{width:1,height:0}};default:return on(Ul)}}function od(i){switch(i){case"left":return on("right");case"right":return on("left");case"up":return on("down");case"down":return on("up");default:return od(Ul)}}const ey={coordinates:{x:0,y:0},dimensions:{width:1,height:1}},ty={type:sd,name:"Wipe",options:{...os,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Uv},reverseExit:Ol},transform:ls({values:i=>({direction:i.direction??Ul,reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=as({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=on(i.direction),n=od(i.direction);return{clip:{keyframes:ur({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:r,exitTo:n,restValue:ey}),renderer:Pv}}}},iy={[qh]:Wv,[rd]:Zv,[td]:qv,[zh]:Jv,[sd]:ty};function ry(i,e){const{type:t,...r}=i,n=iy[t];if(!n)throw new Error(`Unknown preset type: ${t}`);return n.generate(r,e)}function ny({animation:i,sceneTime:e}){const t=i.keyframes;if(!t||t.length===0)return null;const r=[...t].sort((s,o)=>s.time-o.time);if(e<r[0].time)return null;const n=r[r.length-1];if(e>=n.time)return i.renderer.processor.getTargetState(n.value);for(let s=0;s<r.length-1;s++){const o=r[s],a=r[s+1];if(e>=o.time&&e<=a.time){const c=a.time-o.time,l=c===0?0:(e-o.time)/c,u=o.easing||"linear",A=i.renderer.processor.getTargetState(o.value);return i.renderer.processor.interpolateState({easing:u,progress:l,from:A,value:a.value})}}return null}function sy(i,e,t){const{preset:r,...n}=i;if(!r)return n;const s=ry(r,{elementDuration:e,elementDimensions:t});return{...n,...s}}function ad({layout:i,sceneTime:e,animations:t,elementDuration:r=5,elementDimensions:n={width:100,height:100}}){var s,o,a,c,l,u,A,h,d,f,g;let p={clip:null,opacity:((s=i==null?void 0:i.transform)==null?void 0:s.opacity)??1,translation:{x:((a=(o=i==null?void 0:i.transform)==null?void 0:o.translate)==null?void 0:a.x)??0,y:((l=(c=i==null?void 0:i.transform)==null?void 0:c.translate)==null?void 0:l.y)??0},scale:((u=i==null?void 0:i.transform)==null?void 0:u.scale)??1,rotation:((A=i==null?void 0:i.transform)==null?void 0:A.rotation)??0,dimensions:{widthRatio:((d=(h=i==null?void 0:i.transform)==null?void 0:h.dimension)==null?void 0:d.widthRatio)??1,heightRatio:((g=(f=i==null?void 0:i.transform)==null?void 0:f.dimension)==null?void 0:g.heightRatio)??1}};if(!t)return p;const I=sy(t,r,n);for(const C of Object.values(I)){if(!C)continue;const B=ny({animation:C,sceneTime:e});B&&(p={...p,...B})}return p}const oy=[];for(let i=0;i<256;++i)oy.push((i+256).toString(16).slice(1));typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);function ay(i=.4,e=.4){const t=Math.max(.1,Math.min(.8,i)),r=Math.max(.2,Math.min(.6,e)),s=(1-t)/2,a=1-r;return[{x:0,y:s},{x:a,y:s},{x:a,y:0},{x:1,y:.5},{x:a,y:1},{x:a,y:1-s},{x:0,y:1-s}]}const Lo=64;function ly(){const i=[],e={x:.5,y:.5},t=.5;for(let r=0;r<Lo;r++){const n=r/Lo*2*Math.PI,s=e.x+t*Math.cos(n),o=e.y+t*Math.sin(n);i.push({x:s,y:o})}return i}function cy(i=1){const e=[],t={x:.5,y:.5};let r,n;i>=1?(r=.5,n=.5/i):(r=.5*i,n=.5);for(let s=0;s<Lo;s++){const o=s/Lo*2*Math.PI,a=t.x+r*Math.cos(o),c=t.y+n*Math.sin(o);e.push({x:a,y:c})}return e}function Ay(){const i=[];for(let t=0;t<=100;t++){const r=t/100*2*Math.PI,n=16*Math.sin(r)**3,s=-(13*Math.cos(r)-5*Math.cos(2*r)-2*Math.cos(3*r)-Math.cos(4*r)),o=(n+16)/32,a=(s+13)/26;i.push({x:o,y:a})}return i}function ld(i=0,e=1){if(i===0)return[{x:0,y:0},{x:1,y:0},{x:1,y:1},{x:0,y:1}];const t=i*Math.PI/180,r=Math.tan(t)/e;return[{x:Math.max(0,Math.min(1,0+r)),y:0},{x:Math.max(0,Math.min(1,1+r)),y:0},{x:Math.max(0,Math.min(1,1-r)),y:1},{x:Math.max(0,Math.min(1,0-r)),y:1}]}function ko(i){if(i<3)throw new Error("A polygon must have at least 3 sides");const e=[],t=[];for(let l=0;l<i;l++){const u=l*2*Math.PI/i-Math.PI/2,A=Math.cos(u),h=Math.sin(u);t.push({x:A,y:h})}const r=Math.min(...t.map(l=>l.x)),n=Math.max(...t.map(l=>l.x)),s=Math.min(...t.map(l=>l.y)),o=Math.max(...t.map(l=>l.y)),a=n-r,c=o-s;for(const l of t){const u=(l.x-r)/a,A=(l.y-s)/c;e.push({x:u,y:A})}return e}function cd(i=90){const e=i*Math.PI/180,r=.5/Math.tan(e),s=1/(1+Math.abs(r)*2),o=r*s;return[{x:.5+o,y:0},{x:1,y:.5},{x:.5-o,y:1},{x:0,y:.5}]}function uy(i=5,e=.4){const t=[];for(let n=0;n<i*2;n++){const s=n*Math.PI/i-Math.PI/2,o=n%2===0?.5:e,a=.5+o*Math.cos(s),c=.5+o*Math.sin(s);t.push({x:a,y:c})}return t}function hy(i="isosceles",e={}){switch(i){case"equilateral":return dy();case"isosceles":return Ad(e.baseAngle??60);case"right":return fy(e.rightAnglePosition??"bottom-left");case"scalene":return gy(e.angles??[60,60,60])}}function dy(){return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}]}function Ad(i){const e=i*Math.PI/180,t=.5/Math.tan(e),r=Math.max(.1,Math.min(2,t));return[{x:.5,y:1-Math.min(1,r)},{x:0,y:1},{x:1,y:1}]}function fy(i){switch(i){case"top":return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}];case"bottom-left":return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}];case"bottom-right":return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}]}}function gy(i){return Ad(i[0])}function py(i={},e=1){const{type:t="rectangle",customPolygon:r,parallelogram:n,triangle:s,rhombus:o,arrow:a,star:c,regularPolygon:l}=i;switch(t){case"rectangle":return ld(0,e);case"parallelogram":return ld((n==null?void 0:n.angle)??30,e);case"triangle":return hy((s==null?void 0:s.type)??"isosceles",{baseAngle:s==null?void 0:s.baseAngle,angles:s==null?void 0:s.angles,rightAnglePosition:s==null?void 0:s.rightAnglePosition});case"rhombus":return cd((o==null?void 0:o.angle)??90);case"diamond":return cd(90);case"pentagon":return ko(5);case"hexagon":return ko(6);case"octagon":return ko(8);case"star":return uy((c==null?void 0:c.points)??5,(c==null?void 0:c.innerRadius)??.4);case"arrow":return ay((a==null?void 0:a.shaftRatio)??.4,(a==null?void 0:a.headRatio)??.4);case"heart":return Ay();case"circle":return ly();case"ellipse":return cy(e);case"custom-polygon":if(!(r!=null&&r.points)||r.points.length<3)throw new Error("Custom polygon must have at least 3 points");return r.points;default:return ko((l==null?void 0:l.sides)??6)}}function my(i,e){let t=!1;const r=i.x,n=i.y;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s].x,c=e[s].y,l=e[o].x,u=e[o].y;c>n!=u>n&&r<(l-a)*(n-c)/(u-c)+a&&(t=!t)}return t}function Ey(i,e){let t=1,r=0;const n=200;for(let s=0;s<=n;s++){const o=s/n;my({x:o,y:i},e)&&(t=Math.min(t,o),r=Math.max(r,o))}return r>=t?{left:t,right:r}:null}function Iy(i){const e=Math.min(...i.map(c=>c.y)),t=Math.max(...i.map(c=>c.y));let r={x:0,y:0,width:0,height:0},n=0;const s=200,o=(t-e)/s,a=[];for(let c=0;c<=s;c++){const l=e+c*o;a.push({y:l,span:Ey(l,i)})}for(let c=0;c<a.length-1;c++){const l=a[c].y;for(let u=c+1;u<a.length;u++){const h=a[u].y-l;let d=0,f=1,g=!0;const p=Math.min(5,u-c+1);for(let I=0;I<p;I++){const C=c+Math.floor(I/(p-1)*(u-c)),B=a[C].span;if(B){if(d=Math.max(d,B.left),f=Math.min(f,B.right),d>=f){g=!1;break}}else{g=!1;break}}if(g&&f>d){const I=f-d,C=I*h;C>n&&(n=C,r={x:d,y:l,width:I,height:h})}}}return r}function vy(i,e=1){const t=py(i,e);if(t.length<3)return{top:0,right:0,bottom:0,left:0};if(i.type==="rectangle")return{top:0,right:0,bottom:0,left:0};const r=Iy(t),n=r.y,s=r.x,o=1-(r.x+r.width),a=1-(r.y+r.height);return{top:Math.max(0,n),right:Math.max(0,o),bottom:Math.max(0,a),left:Math.max(0,s)}}function ud(i){return i===null||typeof i=="number"&&!Number.isFinite(i)}function yy(i){const e={};for(const[t,r]of Object.entries(i))ud(r)||(typeof r=="object"&&!Array.isArray(r)?e[t]=Object.fromEntries(Object.entries(r).filter(([,n])=>!ud(n))):e[t]=r);return e}function Cy(i){return typeof i=="number"?{topLeft:i,topRight:i,bottomRight:i,bottomLeft:i}:{topLeft:(i==null?void 0:i.topLeft)??0,topRight:(i==null?void 0:i.topRight)??0,bottomRight:(i==null?void 0:i.bottomRight)??0,bottomLeft:(i==null?void 0:i.bottomLeft)??0}}function By(i,e){return typeof i=="number"?{top:i*e,right:i*e,bottom:i*e,left:i*e}:typeof i=="string"?{top:i,right:i,bottom:i,left:i}:{top:typeof i.top=="number"?i.top*e:i.top,right:typeof i.right=="number"?i.right*e:i.right,bottom:typeof i.bottom=="number"?i.bottom*e:i.bottom,left:typeof i.left=="number"?i.left*e:i.left}}function Ty(i,e){return typeof i=="number"?{top:i*e,right:i*e,bottom:i*e,left:i*e}:typeof i=="string"?{top:i,right:i,bottom:i,left:i}:{top:(typeof i.top=="number"?i.top*e:i.top)??0,right:(typeof i.right=="number"?i.right*e:i.right)??0,bottom:(typeof i.bottom=="number"?i.bottom*e:i.bottom)??0,left:(typeof i.left=="number"?i.left*e:i.left)??0}}function by(i,e){return typeof i=="number"?{top:i*e,right:i*e,bottom:i*e,left:i*e}:typeof i=="string"?{top:i,right:i,bottom:i,left:i}:{top:(typeof i.top=="number"?i.top*e:i.top)??0,right:(typeof i.right=="number"?i.right*e:i.right)??0,bottom:(typeof i.bottom=="number"?i.bottom*e:i.bottom)??0,left:(typeof i.left=="number"?i.left*e:i.left)??0}}const Sy=Ti(()=>Yu.loadYoga());function hd(i,e,{layout:t,scale:r=1}){const{position:n="relative",inset:s,width:o,height:a,minWidth:c,minHeight:l,maxWidth:u,maxHeight:A,flex:h,flexGrow:d,flexShrink:f,gap:g,margin:p,padding:I,direction:C="column",align:B="start",alignSelf:y,justify:x="start"}=yy(t??{}),R={static:i.POSITION_TYPE_STATIC,relative:i.POSITION_TYPE_RELATIVE,absolute:i.POSITION_TYPE_ABSOLUTE};if(e.setPositionType(R[n]),typeof s<"u"){const{top:D,right:$,bottom:j,left:ee}=By(s,r);typeof D<"u"&&e.setPosition(i.EDGE_TOP,D),typeof $<"u"&&e.setPosition(i.EDGE_RIGHT,$),typeof j<"u"&&e.setPosition(i.EDGE_BOTTOM,j),typeof ee<"u"&&e.setPosition(i.EDGE_LEFT,ee)}const _={row:i.FLEX_DIRECTION_ROW,column:i.FLEX_DIRECTION_COLUMN,"row-reverse":i.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":i.FLEX_DIRECTION_COLUMN_REVERSE};e.setFlexDirection(_[C]);const F={start:i.ALIGN_FLEX_START,end:i.ALIGN_FLEX_END,center:i.ALIGN_CENTER,stretch:i.ALIGN_STRETCH};e.setAlignItems(F[B]),y&&e.setAlignSelf(F[y]);const P={start:i.JUSTIFY_FLEX_START,end:i.JUSTIFY_FLEX_END,center:i.JUSTIFY_CENTER,"space-between":i.JUSTIFY_SPACE_BETWEEN,"space-around":i.JUSTIFY_SPACE_AROUND,"space-evenly":i.JUSTIFY_SPACE_EVENLY};if(e.setJustifyContent(P[x]),typeof p<"u"){const{top:D,right:$,bottom:j,left:ee}=Ty(p,r);e.setMargin(i.EDGE_TOP,D),e.setMargin(i.EDGE_RIGHT,$),e.setMargin(i.EDGE_BOTTOM,j),e.setMargin(i.EDGE_LEFT,ee)}if(typeof I<"u"){const{top:D,right:$,bottom:j,left:ee}=by(I,r);e.setPadding(i.EDGE_TOP,D),e.setPadding(i.EDGE_RIGHT,$),e.setPadding(i.EDGE_BOTTOM,j),e.setPadding(i.EDGE_LEFT,ee)}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(i.GUTTER_ALL,(g??0)*r),typeof o<"u"&&e.setWidth(typeof o=="number"?o*r:o),typeof a<"u"&&e.setHeight(typeof a=="number"?a*r:a),typeof c<"u"&&e.setMinWidth(typeof c=="number"?c*r:c),typeof l<"u"&&e.setMinHeight(typeof l=="number"?l*r:l),typeof u<"u"&&e.setMaxWidth(typeof u=="number"?u*r:u),typeof A<"u"&&e.setMaxHeight(typeof A=="number"?A*r:A)}async function dd({id:i,yoga:e,index:t,parent:r,element:n,resolvers:s}){var o,a,c;const{layout:l={},config:u={},options:A={},renderer:h}=n,d=e.Node.create();hd(e,d,{layout:l}),r.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:i,config:u,options:A}))??null:f=await((a=s[h.type])==null?void 0:a.call(s,{id:i,config:u,options:A}))??null);const g=[];for await(const[p,I]of((c=n.children)==null?void 0:c.entries())??[])g.push(await dd({id:i,yoga:e,index:p,parent:d,element:I,resolvers:s}));return{node:d,radius:Cy(l.radius),element:n,renderer:h,config:u,options:A,dependencies:f,childNodes:g}}function fd(i,e,t=0,r=0){const{top:n,left:s}=i.getComputedLayout(),{top:o,left:a,width:c,height:l}=e.node.getComputedLayout(),u=t+a,A=r+o,h=e.childNodes.map(d=>fd(i,d,u,A));return{...e,x:s+u,y:n+A,width:c,height:l,childNodes:h}}async function Gl({yoga:i,root:e,tree:t,measureCanvas:r}){for await(const{node:n,options:s,dependencies:o,renderer:a,childNodes:c}of t){if(a){const{width:l,height:u}=a;if(l&&r){e.calculateLayout();const A=await l({node:n,options:s,dependencies:o,measureCanvas:r});A&&n.setWidth(A)}if(u&&r){e.calculateLayout();const A=await u({node:n,options:s,dependencies:o,measureCanvas:r});A&&n.setHeight(A)}if((s==null?void 0:s.format)==="crop"&&(o!=null&&o.aspectRatio)&&(a.type==="video"||a.type==="image")){const A=s.crop;if(!A||A.x===0&&A.y===0&&A.width===1&&A.height===1){e.calculateLayout();const d=n.getComputedWidth(),f=n.getComputedHeight();if(d>0&&f>0){const g=d/f,p=o.aspectRatio;if(Math.abs(g-p)>.001){let I,C;g<p?(I=g/p,C=1):(I=1,C=p/g),s.crop={x:(1-I)/2,y:(1-C)/2,width:I,height:C}}}}}if(await Gl({yoga:i,root:e,tree:c,measureCanvas:r}),s!=null&&s.shape){const A=n.getComputedWidth(),h=n.getComputedHeight(),d=vy(s.shape,A/h);n.setPadding(i.EDGE_TOP,d.top*h),n.setPadding(i.EDGE_RIGHT,d.right*A),n.setPadding(i.EDGE_BOTTOM,d.bottom*h),n.setPadding(i.EDGE_LEFT,d.left*A)}}e.calculateLayout(),await Gl({yoga:i,root:e,tree:c,measureCanvas:r})}}async function gd({id:i,root:e,resolvers:t,measureCanvas:r}){const n=await Sy(),s=n.Node.create();hd(n,s,{layout:e.layout});const o=await dd({id:i,yoga:n,index:0,parent:s,element:e.element,resolvers:t});await Gl({yoga:n,root:s,tree:[o],measureCanvas:r});const{top:a,left:c,width:l,height:u}=s.getComputedLayout(),A={root:{x:c,y:a,width:l,height:u},node:fd(s,o)};return s.freeRecursive(),A}function pd(){var i=function(e){var t={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},r={},n={};r.L=1,n[1]="L",Object.keys(t).forEach(function(ue,Le){r[ue]=1<<Le+1,n[r[ue]]=ue}),Object.freeze(r);var s=r.LRI|r.RLI|r.FSI,o=r.L|r.R|r.AL,a=r.B|r.S|r.WS|r.ON|r.FSI|r.LRI|r.RLI|r.PDI,c=r.BN|r.RLE|r.LRE|r.RLO|r.LRO|r.PDF,l=r.S|r.WS|r.B|s|r.PDI|c,u=null;function A(){if(!u){u=new Map;var ue=function(be){if(t.hasOwnProperty(be)){var le=0;t[be].split(",").forEach(function(ge){var ve=ge.split("+"),Te=ve[0],Ce=ve[1];Te=parseInt(Te,36),Ce=Ce?parseInt(Ce,36):0,u.set(le+=Te,r[be]);for(var Ue=0;Ue<Ce;Ue++)u.set(++le,r[be])})}};for(var Le in t)ue(Le)}}function h(ue){return A(),u.get(ue.codePointAt(0))||r.L}function d(ue){return n[h(ue)]}var f={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function g(ue,Le){var be=36,le=0,ge=new Map,ve=Le&&new Map,Te;return ue.split(",").forEach(function Ce(Ue){if(Ue.indexOf("+")!==-1)for(var T=+Ue;T--;)Ce(Te);else{Te=Ue;var m=Ue.split(">"),E=m[0],w=m[1];E=String.fromCodePoint(le+=parseInt(E,be)),w=String.fromCodePoint(le+=parseInt(w,be)),ge.set(E,w),Le&&ve.set(w,E)}}),{map:ge,reverseMap:ve}}var p,I,C;function B(){if(!p){var ue=g(f.pairs,!0),Le=ue.map,be=ue.reverseMap;p=Le,I=be,C=g(f.canonical,!1).map}}function y(ue){return B(),p.get(ue)||null}function x(ue){return B(),I.get(ue)||null}function R(ue){return B(),C.get(ue)||null}var _=r.L,F=r.R,P=r.EN,D=r.ES,$=r.ET,j=r.AN,ee=r.CS,Z=r.B,k=r.S,O=r.ON,V=r.BN,L=r.NSM,Q=r.AL,M=r.LRO,W=r.RLO,Y=r.LRE,ie=r.RLE,ae=r.PDF,fe=r.LRI,Ee=r.RLI,Pe=r.FSI,we=r.PDI;function Ne(ue,Le){for(var be=125,le=new Uint32Array(ue.length),ge=0;ge<ue.length;ge++)le[ge]=h(ue[ge]);var ve=new Map;function Te(Wt,Bi){var jt=le[Wt];le[Wt]=Bi,ve.set(jt,ve.get(jt)-1),jt&a&&ve.set(a,ve.get(a)-1),ve.set(Bi,(ve.get(Bi)||0)+1),Bi&a&&ve.set(a,(ve.get(a)||0)+1)}for(var Ce=new Uint8Array(ue.length),Ue=new Map,T=[],m=null,E=0;E<ue.length;E++)m||T.push(m={start:E,end:ue.length-1,level:Le==="rtl"?1:Le==="ltr"?0:Ip(E,!1)}),le[E]&Z&&(m.end=E,m=null);for(var w=ie|Y|W|M|s|we|ae|Z,U=function(Wt){return Wt+(Wt&1?1:2)},J=function(Wt){return Wt+(Wt&1?2:1)},X=0;X<T.length;X++){m=T[X];var G=[{_level:m.level,_override:0,_isolate:0}],se=void 0,he=0,Be=0,ye=0;ve.clear();for(var $e=m.start;$e<=m.end;$e++){var ze=le[$e];if(se=G[G.length-1],ve.set(ze,(ve.get(ze)||0)+1),ze&a&&ve.set(a,(ve.get(a)||0)+1),ze&w)if(ze&(ie|Y)){Ce[$e]=se._level;var Bt=(ze===ie?J:U)(se._level);Bt<=be&&!he&&!Be?G.push({_level:Bt,_override:0,_isolate:0}):he||Be++}else if(ze&(W|M)){Ce[$e]=se._level;var Zi=(ze===W?J:U)(se._level);Zi<=be&&!he&&!Be?G.push({_level:Zi,_override:ze&W?F:_,_isolate:0}):he||Be++}else if(ze&s){ze&Pe&&(ze=Ip($e+1,!0)===1?Ee:fe),Ce[$e]=se._level,se._override&&Te($e,se._override);var Tt=(ze===Ee?J:U)(se._level);Tt<=be&&he===0&&Be===0?(ye++,G.push({_level:Tt,_override:0,_isolate:1,_isolInitIndex:$e})):he++}else if(ze&we){if(he>0)he--;else if(ye>0){for(Be=0;!G[G.length-1]._isolate;)G.pop();var Ii=G[G.length-1]._isolInitIndex;Ii!=null&&(Ue.set(Ii,$e),Ue.set($e,Ii)),G.pop(),ye--}se=G[G.length-1],Ce[$e]=se._level,se._override&&Te($e,se._override)}else ze&ae?(he===0&&(Be>0?Be--:!se._isolate&&G.length>1&&(G.pop(),se=G[G.length-1])),Ce[$e]=se._level):ze&Z&&(Ce[$e]=m.level);else Ce[$e]=se._level,se._override&&ze!==V&&Te($e,se._override)}for(var Zt=[],bt=null,ei=m.start;ei<=m.end;ei++){var er=le[ei];if(!(er&c)){var tr=Ce[ei],Ra=er&s,vi=er===we;bt&&tr===bt._level?(bt._end=ei,bt._endsWithIsolInit=Ra):Zt.push(bt={_start:ei,_end:ei,_level:tr,_startsWithPDI:vi,_endsWithIsolInit:Ra})}}for(var Ps=[],xn=0;xn<Zt.length;xn++){var Ft=Zt[xn];if(!Ft._startsWithPDI||Ft._startsWithPDI&&!Ue.has(Ft._start)){for(var wn=[bt=Ft],Jr=void 0;bt&&bt._endsWithIsolInit&&(Jr=Ue.get(bt._end))!=null;)for(var Cr=xn+1;Cr<Zt.length;Cr++)if(Zt[Cr]._start===Jr){wn.push(bt=Zt[Cr]);break}for(var Gi=[],qr=0;qr<wn.length;qr++)for(var Qn=wn[qr],Ns=Qn._start;Ns<=Qn._end;Ns++)Gi.push(Ns);for(var _A=Ce[Gi[0]],_a=m.level,Rn=Gi[0]-1;Rn>=0;Rn--)if(!(le[Rn]&c)){_a=Ce[Rn];break}var Os=Gi[Gi.length-1],DA=Ce[Os],Da=m.level;if(!(le[Os]&s)){for(var _n=Os+1;_n<=m.end;_n++)if(!(le[_n]&c)){Da=Ce[_n];break}}Ps.push({_seqIndices:Gi,_sosType:Math.max(_a,_A)%2?F:_,_eosType:Math.max(Da,DA)%2?F:_})}}for(var Us=0;Us<Ps.length;Us++){var Dn=Ps[Us],Qe=Dn._seqIndices,zr=Dn._sosType,LA=Dn._eosType,ir=Ce[Qe[0]]&1?F:_;if(ve.get(L))for(var Ln=0;Ln<Qe.length;Ln++){var Gs=Qe[Ln];if(le[Gs]&L){for(var Br=zr,kn=Ln-1;kn>=0;kn--)if(!(le[Qe[kn]]&c)){Br=le[Qe[kn]];break}Te(Gs,Br&(s|we)?O:Br)}}if(ve.get(P))for(var Mn=0;Mn<Qe.length;Mn++){var Hs=Qe[Mn];if(le[Hs]&P)for(var Tr=Mn-1;Tr>=-1;Tr--){var hi=Tr===-1?zr:le[Qe[Tr]];if(hi&o){hi===Q&&Te(Hs,j);break}}}if(ve.get(Q))for(var br=0;br<Qe.length;br++){var $s=Qe[br];le[$s]&Q&&Te($s,F)}if(ve.get(D)||ve.get(ee))for(var b=1;b<Qe.length-1;b++){var S=Qe[b];if(le[S]&(D|ee)){for(var N=0,H=0,z=b-1;z>=0&&(N=le[Qe[z]],!!(N&c));z--);for(var te=b+1;te<Qe.length&&(H=le[Qe[te]],!!(H&c));te++);N===H&&(le[S]===D?N===P:N&(P|j))&&Te(S,N)}}if(ve.get(P))for(var oe=0;oe<Qe.length;oe++){var ce=Qe[oe];if(le[ce]&P){for(var de=oe-1;de>=0&&le[Qe[de]]&($|c);de--)Te(Qe[de],P);for(oe++;oe<Qe.length&&le[Qe[oe]]&($|c|P);oe++)le[Qe[oe]]!==P&&Te(Qe[oe],P)}}if(ve.get($)||ve.get(D)||ve.get(ee))for(var Ae=0;Ae<Qe.length;Ae++){var Ie=Qe[Ae];if(le[Ie]&($|D|ee)){Te(Ie,O);for(var _e=Ae-1;_e>=0&&le[Qe[_e]]&c;_e--)Te(Qe[_e],O);for(var je=Ae+1;je<Qe.length&&le[Qe[je]]&c;je++)Te(Qe[je],O)}}if(ve.get(P))for(var lt=0,Ze=zr;lt<Qe.length;lt++){var Pt=Qe[lt],Ot=le[Pt];Ot&P?Ze===_&&Te(Pt,_):Ot&o&&(Ze=Ot)}if(ve.get(a)){var yi=F|P|j,di=yi|_,Xr=[];{for(var rr=[],Fn=0;Fn<Qe.length;Fn++)if(le[Qe[Fn]]&a){var Ys=ue[Qe[Fn]],Ap=void 0;if(y(Ys)!==null)if(rr.length<63)rr.push({char:Ys,seqIndex:Fn});else break;else if((Ap=x(Ys))!==null)for(var Vs=rr.length-1;Vs>=0;Vs--){var kA=rr[Vs].char;if(kA===Ap||kA===x(R(Ys))||y(R(kA))===Ys){Xr.push([rr[Vs].seqIndex,Fn]),rr.length=Vs;break}}}Xr.sort(function(Wt,Bi){return Wt[0]-Bi[0]})}for(var MA=0;MA<Xr.length;MA++){for(var up=Xr[MA],La=up[0],FA=up[1],hp=!1,Ci=0,PA=La+1;PA<FA;PA++){var dp=Qe[PA];if(le[dp]&di){hp=!0;var fp=le[dp]&yi?F:_;if(fp===ir){Ci=fp;break}}}if(hp&&!Ci){Ci=zr;for(var NA=La-1;NA>=0;NA--){var gp=Qe[NA];if(le[gp]&di){var pp=le[gp]&yi?F:_;pp!==ir?Ci=pp:Ci=ir;break}}}if(Ci){if(le[Qe[La]]=le[Qe[FA]]=Ci,Ci!==ir){for(var Ks=La+1;Ks<Qe.length;Ks++)if(!(le[Qe[Ks]]&c)){h(ue[Qe[Ks]])&L&&(le[Qe[Ks]]=Ci);break}}if(Ci!==ir){for(var Ws=FA+1;Ws<Qe.length;Ws++)if(!(le[Qe[Ws]]&c)){h(ue[Qe[Ws]])&L&&(le[Qe[Ws]]=Ci);break}}}}for(var Sr=0;Sr<Qe.length;Sr++)if(le[Qe[Sr]]&a){for(var mp=Sr,OA=Sr,UA=zr,js=Sr-1;js>=0;js--)if(le[Qe[js]]&c)mp=js;else{UA=le[Qe[js]]&yi?F:_;break}for(var Ep=LA,Js=Sr+1;Js<Qe.length;Js++)if(le[Qe[Js]]&(a|c))OA=Js;else{Ep=le[Qe[Js]]&yi?F:_;break}for(var GA=mp;GA<=OA;GA++)le[Qe[GA]]=UA===Ep?UA:ir;Sr=OA}}}for(var ti=m.start;ti<=m.end;ti++){var cQ=Ce[ti],ka=le[ti];if(cQ&1?ka&(_|P|j)&&Ce[ti]++:ka&F?Ce[ti]++:ka&(j|P)&&(Ce[ti]+=2),ka&c&&(Ce[ti]=ti===0?m.level:Ce[ti-1]),ti===m.end||h(ue[ti])&(k|Z))for(var Ma=ti;Ma>=0&&h(ue[Ma])&l;Ma--)Ce[Ma]=m.level}}return{levels:Ce,paragraphs:T};function Ip(Wt,Bi){for(var jt=Wt;jt<ue.length;jt++){var xr=le[jt];if(xr&(F|Q))return 1;if(xr&(Z|_)||Bi&&xr===we)return 0;if(xr&s){var vp=AQ(jt);jt=vp===-1?ue.length:vp}}return 0}function AQ(Wt){for(var Bi=1,jt=Wt+1;jt<ue.length;jt++){var xr=le[jt];if(xr&Z)break;if(xr&we){if(--Bi===0)return jt}else xr&s&&Bi++}return-1}}var pe="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",Me;function We(){if(!Me){var ue=g(pe,!0),Le=ue.map,be=ue.reverseMap;be.forEach(function(le,ge){Le.set(ge,le)}),Me=Le}}function Oe(ue){return We(),Me.get(ue)||null}function Xe(ue,Le,be,le){var ge=ue.length;be=Math.max(0,be==null?0:+be),le=Math.min(ge-1,le==null?ge-1:+le);for(var ve=new Map,Te=be;Te<=le;Te++)if(Le[Te]&1){var Ce=Oe(ue[Te]);Ce!==null&&ve.set(Te,Ce)}return ve}function De(ue,Le,be,le){var ge=ue.length;be=Math.max(0,be==null?0:+be),le=Math.min(ge-1,le==null?ge-1:+le);var ve=[];return Le.paragraphs.forEach(function(Te){var Ce=Math.max(be,Te.start),Ue=Math.min(le,Te.end);if(Ce<Ue){for(var T=Le.levels.slice(Ce,Ue+1),m=Ue;m>=Ce&&h(ue[m])&l;m--)T[m]=Te.level;for(var E=Te.level,w=1/0,U=0;U<T.length;U++){var J=T[U];J>E&&(E=J),J<w&&(w=J|1)}for(var X=E;X>=w;X--)for(var G=0;G<T.length;G++)if(T[G]>=X){for(var se=G;G+1<T.length&&T[G+1]>=X;)G++;G>se&&ve.push([se+Ce,G+Ce])}}}),ve}function Re(ue,Le,be,le){var ge=He(ue,Le,be,le),ve=[].concat(ue);return ge.forEach(function(Te,Ce){ve[Ce]=(Le.levels[Te]&1?Oe(ue[Te]):null)||ue[Te]}),ve.join("")}function He(ue,Le,be,le){for(var ge=De(ue,Le,be,le),ve=[],Te=0;Te<ue.length;Te++)ve[Te]=Te;return ge.forEach(function(Ce){for(var Ue=Ce[0],T=Ce[1],m=ve.slice(Ue,T+1),E=m.length;E--;)ve[T-E]=m[E]}),ve}return e.closingToOpeningBracket=x,e.getBidiCharType=h,e.getBidiCharTypeName=d,e.getCanonicalBracket=R,e.getEmbeddingLevels=Ne,e.getMirroredCharacter=Oe,e.getMirroredCharactersMap=Xe,e.getReorderSegments=De,e.getReorderedIndices=He,e.getReorderedString=Re,e.openingToClosingBracket=y,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return i}const md=Object.freeze(Object.defineProperty({__proto__:null,default:pd},Symbol.toStringTag,{value:"Module"})),xy=typeof md=="function"?md:pd;function wy(i,e){return i==="start"?e==="rtl"?"right":"left":i==="end"?e==="rtl"?"left":"right":i??"left"}const Ed=xy();function Qy(i){var e;if(!i)return"ltr";try{const{paragraphs:t}=Ed.getEmbeddingLevels(i);return(((e=t[0])==null?void 0:e.level)??0)%2===1?"rtl":"ltr"}catch{return"ltr"}}function Ry(i){return{order:i.map((e,t)=>t),directions:i.map(()=>"ltr"),baseDirection:"ltr"}}function _y(i,e){var t;if(!i.length)return{order:[],directions:[],baseDirection:e??"ltr"};try{const r=i.map(({text:d})=>d).join(" "),{levels:n,paragraphs:s}=Ed.getEmbeddingLevels(r,e),o=((t=s[0])==null?void 0:t.level)??0,a=o%2===1?"rtl":"ltr",c=[];let l=0;for(const d of i)c.push(n[l]??o),l+=d.text.length+1;const u=i.map((d,f)=>f),A=Math.max(...c);for(let d=A;d>=1;d--){let f=-1;for(let g=0;g<=u.length;g++){const p=g<u.length&&c[u[g]]>=d;if(p&&f<0)f=g;else if(!p&&f>=0){const I=u.slice(f,g).reverse();u.splice(f,I.length,...I),f=-1}}}const h=c.map(d=>d%2===1?"rtl":"ltr");return{order:u,directions:h,baseDirection:a}}catch{return Ry(i)}}const Dy=500;function Ly(){const i=new Map,e={has:t=>i.has(t),get:t=>i.get(t),set:(t,r)=>{if(i.size>=Dy&&!i.has(t)){const n=i.keys().next();n.done||i.delete(n.value)}i.set(t,r)},delete:t=>i.delete(t),clear:()=>i.clear()};return typeof document<"u"&&"fonts"in document&&document.fonts.addEventListener("loadingdone",()=>e.clear()),e}let Hl;function ky(){return Hl===void 0&&(Hl=typeof Intl<"u"&&typeof Intl.Segmenter=="function"?new Intl.Segmenter(void 0,{granularity:"word"}):null),Hl}const Id=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Thai}\p{Script=Lao}\p{Script=Khmer}\p{Script=Myanmar}]/u;function My(i){return i.split(`
|
|
2462
|
-
`).map(e=>{if(!e)return[];const t=[];for(const r of e.match(/\S+|\s+/g)??[])if(/^\s+$/.test(r))t.push({text:r,logicalIndex:t.length,whitespace:!0,spaceBefore:!1});else if(Id.test(r))for(const n of vd(r))t.push({text:n.text,logicalIndex:t.length,whitespace:!1,spaceBefore:!1});else t.push({text:r,logicalIndex:t.length,whitespace:!1,spaceBefore:!1});return t})}function vd(i){const e=[];let t=!1,r="";const n=ky();if(!n)return[{text:i,spaceBefore:!1}];for(const{segment:s,isWordLike:o}of n.segment(i)){if(!o&&s.trim().length===0){t=e.length>0?!0:t;continue}if(o){e.push({text:s,spaceBefore:t}),t=!1;continue}e.length>0?e[e.length-1].text+=s:r+=s}return r&&e.length>0?e[0].text=r+e[0].text:r&&e.push({text:r,spaceBefore:t}),e}function Fy(i){const e=[];for(const t of i){const n=Id.test(t.text)||/\s/.test(t.text)?vd(t.text):[{text:t.text,spaceBefore:!1}];if(n.length<=1){e.push({text:t.text,logicalIndex:e.length,whitespace:!1,spaceBefore:e.length>0,timing:{id:t.id,start:t.start,end:t.end}});continue}const s=n.reduce((c,l)=>c+[...l.text].length,0),o=t.end-t.start;let a=t.start;n.forEach((c,l)=>{const u=[...c.text].length/s*o,A=a,h=l===n.length-1?t.end:a+u;a=h,e.push({text:c.text,logicalIndex:e.length,whitespace:!1,spaceBefore:l===0?e.length>0:c.spaceBefore,timing:{id:t.id,subIndex:l,start:A,end:h}})})}return e}const Py=/(?<value>\d+\.?\d*)(?=px)/,$l=1;function Ny(i,e){const t=typeof i=="string"?My(i):[Fy(i)];return e?t.map(r=>r.map(n=>({...n,text:n.text.toUpperCase()}))):t}function Oy({context:i,groups:e,appendedFont:t,fontSizes:r,maxW:n,wrap:s,strokeWidth:o,letterSpacing:a,wholeLineMeasure:c}){const l=[],u=h=>{const d=r[h%r.length];return{fontSize:d,font:t.replace(Py,d.toString())}},A=(h,d)=>(i.font=h,i.letterSpacing=`${a}px`,i.measureText(d));for(const h of e){const d=l.length,{fontSize:f,font:g}=u(l.length);let p={items:[],font:g,fontSize:f,lineWidth:0,fontAscent:0,fontDescent:0},I="",C="";const B=()=>{const y=A(p.font,"");p.fontAscent=y.fontBoundingBoxAscent,p.fontDescent=y.fontBoundingBoxDescent,l.push(p);const x=u(l.length);p={items:[],font:x.font,fontSize:x.fontSize,lineWidth:0,fontAscent:0,fontDescent:0},I="",C=""};for(const y of h){if(y.whitespace){C+=y.text;continue}const x=()=>{const F=p.items.length>0&&y.spaceBefore&&!C?" ":C,P=F?A(p.font,F).width:0,D=A(p.font,y.text);return{token:y,metrics:D,width:D.width+o,gapBefore:P,gapText:F}};let R=x();const _=c?A(p.font,I+R.gapText+y.text).width+o*(p.items.length+1):p.lineWidth+R.gapBefore+R.width;if(s&&_>n+$l&&p.items.length>0&&(B(),R=x()),s&&c&&p.items.length===0&&R.width>n+$l){let F=y.text;for(;F.length>0;){let P="";for(const $ of F){const j=A(p.font,P+$).width+o;if(P&&j>n+$l)break;P+=$}F=F.slice(P.length);const D=A(p.font,P);p.items.push({token:{...y,text:P},metrics:D,width:D.width+o,gapBefore:0,gapText:""}),I=P,p.lineWidth=D.width+o*p.items.length,F.length>0&&B()}C="";continue}p.items.push(R),I+=R.gapText+y.text,p.lineWidth=c?A(p.font,I).width+o*p.items.length:p.lineWidth+R.gapBefore+R.width,C=""}c&&C&&(p.items.length>0||l.length===d)&&(I+=C,p.lineWidth=A(p.font,I).width+o*p.items.length),(p.items.length>0||l.length===d)&&B()}return l}const yd=[{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"},{family:"Noto Telugu",regex:new RegExp("\\p{Script=Telugu}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansTelugu-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Tamil",regex:new RegExp("\\p{Script=Tamil}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansTamil-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Kannada",regex:new RegExp("\\p{Script=Kannada}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKannada-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Malayalam",regex:new RegExp("\\p{Script=Malayalam}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansMalayalam-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Bengali",regex:new RegExp("\\p{Script=Bengali}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansBengali-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Gujarati",regex:new RegExp("\\p{Script=Gujarati}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGujarati-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Gurmukhi",regex:new RegExp("\\p{Script=Gurmukhi}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGurmukhi-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Sinhala",regex:new RegExp("\\p{Script=Sinhala}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansSinhala-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Thai",regex:new RegExp("\\p{Script=Thai}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansThai-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Lao",regex:new RegExp("\\p{Script=Lao}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansLao-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Khmer",regex:new RegExp("\\p{Script=Khmer}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKhmer-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Myanmar",regex:new RegExp("\\p{Script=Myanmar}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansMyanmar-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Ethiopic",regex:new RegExp("\\p{Script=Ethiopic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansEthiopic-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Armenian",regex:new RegExp("\\p{Script=Armenian}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansArmenian-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Georgian",regex:new RegExp("\\p{Script=Georgian}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGeorgian-VariableFont_wdth%2Cwght.woff2",style:"normal"}];function Cd({text:i,font:e}){let t=e;return yd.forEach(({family:r,regex:n})=>{n.exec(i)&&(t+=`, ${r}`)}),t}function Bd(i){return Math.max(i??1,.5)}function Uy({measured:i,index:e,lineTop:t,dx:r,dw:n,align:s,direction:o,lineHeight:a,strokeWidth:c}){const{items:l,font:u,fontSize:A,lineWidth:h,fontAscent:d,fontDescent:f}=i;let g=0;s==="center"?g=(n-h)/2:s==="right"&&(g=n-h);const p=Bd(a),I=A*p+c,C=(p-1)*A/2,B=(A+d-f)/2,y=t+C+B+c/2,{order:x,directions:R,baseDirection:_}=_y(l.map(({token:Z})=>({text:Z.text})),o),F=l.map(({gapBefore:Z})=>Z);let P=r+g+c/2;const D=[];x.forEach((Z,k)=>{const O=l[Z];P+=F[k],D.push({...O.token,x:P,baselineY:y,width:O.width,lineIndex:e,direction:R[Z],font:u,metrics:O.metrics}),P+=O.width});const $=[],j=[];D.forEach((Z,k)=>{const O=$[$.length-1];if(O&&O.direction===Z.direction){const V=Math.max(O.x+O.width,Z.x+Z.width);O.tokens.push(Z),O.x=Math.min(O.x,Z.x),O.width=V-O.x,j[j.length-1].push(x[k])}else $.push({text:"",x:Z.x,width:Z.width,direction:Z.direction,tokens:[Z]}),j.push([x[k]])}),$.forEach((Z,k)=>{const O=[...j[k]].sort((V,L)=>V-L);Z.text=O.map((V,L)=>L===0?l[V].token.text:`${l[V].gapText}${l[V].token.text}`).join("")});const ee=o??_;return{index:e,box:{x:r+g,y:t,width:h,height:I},baselineY:y,direction:ee,runs:$,tokens:D}}function Gy(i){const{context:e,text:t,font:r,fontSizes:n,dx:s=0,dy:o=0,maxW:a=1/0,dw:c=a,align:l="left",direction:u,lineHeight:A,lineGap:h=0,letterSpacing:d=0,strokeWidth:f=0,wrap:g=!0,uppercase:p=!1}=i,I=Ny(t,p),C=I.flat().map(({text:R})=>R).join(" "),B=Cd({font:r,text:C}),y=u??Qy(C),x=wy(l,y);try{e.save();const R=Oy({context:e,groups:I,appendedFont:B,fontSizes:n,maxW:a,wrap:g,strokeWidth:f,letterSpacing:d,wholeLineMeasure:typeof t=="string"}),_=[];let F=o;for(let ee=0;ee<R.length;ee++){const Z=Uy({measured:R[ee],index:ee,lineTop:F,dx:s,dw:c,align:x,direction:u,lineHeight:A,strokeWidth:f});_.push(Z),F+=Z.box.height+h}const P=R[R.length-1],D=P?Math.max(0,(P.fontAscent+P.fontDescent-P.fontSize*Bd(A))/2):0,$=_.reduce((ee,{box:Z})=>ee+Z.height,0)+h*Math.max(0,_.length-1)+D,j=_.length?{x:Math.min(..._.map(({box:ee})=>ee.x)),y:Math.min(..._.map(({box:ee})=>ee.y)),width:Math.max(..._.map(({box:ee})=>ee.x+ee.width))-Math.min(..._.map(({box:ee})=>ee.x)),height:Math.max(..._.map(({box:ee})=>ee.y+ee.height))-Math.min(..._.map(({box:ee})=>ee.y))}:{x:s,y:o,width:0,height:0};return{lines:_,totalHeight:$,blockBox:j,direction:y,font:B}}finally{e.restore()}}vu(Gy,{cache:Ly(),cacheKey:([i])=>JSON.stringify([i.text,i.font,i.fontSizes,i.dx,i.dy,i.dw,i.maxW,i.align,i.direction,i.lineHeight,i.lineGap,i.letterSpacing,i.strokeWidth,i.wrap,i.uppercase])});function Hy(i){return i.slice(0,1).toUpperCase()+i.slice(1)}Object.keys(jh).map(i=>({label:Hy(i),value:i,data:i}));function Td(){return document.createElement("canvas")}function ri(i){let e=0;for(const t of i)Array.isArray(t)?e+=ri(t):e+=t;return e}function Mo(i){return i.map(({type:e,duration:t},r)=>{var n,s,o,a;if(e==="transition"){const c=((n=i[r-2])==null?void 0:n.type)==="transition"?i[r-2]:null,l=((s=i[r-1])==null?void 0:s.duration)??1/0,u=((o=i[r+1])==null?void 0:o.duration)??1/0,A=((a=i[r+2])==null?void 0:a.type)==="transition"?i[r+2]:null;return Math.min(c?l/2:l,t,A?u/2:u)*-1}return t})}function $y(i){if(i===null||typeof i!="object")return!1;if(Object.getPrototypeOf(i)===null)return!0;let e=i;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(i)===e}function Yy(i){return i.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}oE.filters.define("parse",i=>typeof i>"u"?null:typeof i=="string"?`"${Yy(i)}"`:$y(i)||Array.isArray(i)?JSON.stringify(i):i);function Vy(i){return i.some(({type:e})=>e==="text")}function Ky(i){return i.some(({type:e})=>e==="caption")}function Wy(i){return i.some(({type:e})=>e==="audio")}function jy(i){return i.some(({type:e})=>e==="video"||e==="image")}function Yl(i){return i.type==="audio"}const Jy="3";async function qy({scene:i,start:e=0}){const{id:t,root:r,duration:n}=i,s=await gd({id:t,root:r});return{type:i.type,start:e,duration:n,layout:s,id:i.id,config:i}}async function zy({track:i}){const e=Mo(i),t=await Promise.all(i.reduce((s,o,a)=>{if(o.type!=="audio")return s;const c=ri(e.slice(0,a));return s.push(qy({scene:o,start:c})),s},[])),r=i.reduce((s,o,a)=>{if(o.type!=="gap")return s;const c=ri(e.slice(0,a));return s.push({type:o.type,id:o.id,start:c,config:o,duration:o.duration}),s},[]),n=i.map(({id:s})=>t.find(({id:o})=>o===s)??r.find(({id:o})=>o===s)).filter(Boolean);return{type:"audio",scenes:t,gapScenes:r,mergedScenes:n,config:i,duration:Math.max(...n.map(({start:s,duration:o})=>s+o))}}async function bd({node:i,canvases:e,sceneTime:t,sceneDuration:r,parentOpacity:n=1,parentTransform:s,debug:o=!1,override:a}){var c,l,u,A,h;const d=e.sceneCanvas.getContext("2d");if(d){d.save(),d.setTransform(s);const f=(a==null?void 0:a.rotation)!=null&&((c=i.element.layout)!=null&&c.transform)?{...i.element.layout,transform:{...i.element.layout.transform,rotation:a.rotation}}:i.element.layout,g=ad({layout:f,sceneTime:t,animations:i.element.animations,elementDuration:r,elementDimensions:{width:i.width,height:i.height}}),{opacity:p,translation:I,scale:C,clip:B,dimensions:y,rotation:x}=g,R=i.width*y.widthRatio,_=i.height*y.heightRatio;if(d.globalAlpha=p*n,(I.x||I.y)&&d.translate(I.x,I.y),(C!==1||x!==0)&&(d.translate(i.x+R/2,i.y+_/2),d.scale(C,C),d.rotate(x*Math.PI/180),d.translate(-(i.x+R/2),-(i.y+_/2))),B){d.beginPath();const D={x:i.x+B.x*R,y:i.y+B.y*_,width:B.width*R,height:B.height*_};d.rect(D.x,D.y,D.width,D.height),d.clip()}if(o){const D=d.globalAlpha;d.globalAlpha=1,d.strokeStyle="red",d.strokeRect(i.x,i.y,R,_),d.globalAlpha=D}const F=(a==null?void 0:a.fontSize)!=null||(a==null?void 0:a.textValue)!=null?{...i.options,...a.textValue!=null?{value:a.textValue}:{},...a.fontSize!=null&&((l=i.options)!=null&&l.font)?{font:{...i.options.font,size:a.fontSize}}:{}}:i.options,P=(a==null?void 0:a.fontSize)!=null&&((u=i.dependencies)!=null&&u.font)?{...i.dependencies,font:{...i.dependencies.font,size:a.fontSize}}:i.dependencies;await((h=(A=i.renderer)==null?void 0:A.render)==null?void 0:h.call(A,{canvases:e,sceneTime:t,dx:i.x,dy:i.y,dw:R,dh:_,radius:i.radius,options:F,dependencies:P}));for await(const D of i.childNodes)await bd({debug:o,node:D,canvases:e,sceneTime:t,sceneDuration:r,parentOpacity:d.globalAlpha,parentTransform:d.getTransform(),override:a});d.restore()}}async function Xy({layout:i,canvases:e,sceneTime:t,sceneDuration:r,debug:n=!1,override:s}){const{node:o}=i;await bd({debug:n,node:o,canvases:e,sceneDuration:r,sceneTime:t,override:s})}async function Fo({debug:i=!1,scene:e,start:t=0,resolvers:r,rootWidth:n,rootHeight:s,canvasFactory:o=Td}){var a,c;const{id:l,x:u,y:A,width:h,height:d,root:f,duration:g}=e,p=o(),I=o(),C=o(),B=o(),y=o(),x=await gd({id:l,root:{...f,layout:{...f.layout,width:n,height:s},element:{...f.element,layout:{...f.element.layout,...typeof u=="number"&&typeof A=="number"?{position:"absolute",inset:{top:A,left:u}}:{},width:h??((a=f.element.layout)==null?void 0:a.width),height:d??((c=f.element.layout)==null?void 0:c.height)}}},resolvers:r,measureCanvas:y}),R=async(_,F)=>{const P=Math.max(0,_-t);p.width=p.height=0,p.width=n,p.height=s,await Xy({debug:i,layout:x,sceneTime:P,sceneDuration:g,canvases:{sceneCanvas:p,cropCanvas:I,letterboxCanvas:C,posterCanvas:B},override:F})};return{id:l,type:e.type,start:t,duration:g,layout:x,sceneCanvas:p,draw:R,config:e,childScenes:[]}}async function Zy({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=Mo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=ri(o.slice(0,d));return h.type==="caption"&&A.push(Fo({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),A},[])),c=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=ri(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),l=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=ri(o.slice(0,d))-f;return A.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var I;return p===((I=e[d+1])==null?void 0:I.id)}),from:a.find(({id:p})=>{var I;return p===((I=e[d-1])==null?void 0:I.id)})}),A},[]),u=e.map(({id:A})=>a.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)??l.find(({id:h})=>h===A)).filter(Boolean);return{type:"caption",scenes:a,gapScenes:c,transitions:l,mergedScenes:u,duration:Math.max(...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}function eC({groups:i,tracks:e}){const t=i.map(s=>new Set(s.sceneIds)),r=i.map((s,o)=>{const a=[];for(let u=0;u<e.length;u++){const A=e[u];Yl(A)||A.scenes.some(h=>s.sceneIds.includes(h.id))&&a.push(u)}let c,l=1/0;for(let u=0;u<i.length;u++){if(o===u)continue;const A=t[u];s.sceneIds.every(d=>A.has(d))&&A.size>t[o].size&&A.size<l&&(c=i[u].id,l=A.size)}return{id:s.id,sceneIds:s.sceneIds,animations:s.animations,bounds:s.bounds,kind:s.kind,topmostTrackIndex:a.length>0?Math.max(...a):-1,parentGroupId:c,depth:0}}),n=new Map(r.map(s=>[s.id,s]));for(const s of r){let o=0,a=s;for(;a!=null&&a.parentGroupId;)o++,a=n.get(a.parentGroupId);s.depth=o}return r}function tC({group:i,currentTime:e,activeMembers:t,fallbackDimensions:r}){if(!i.animations||t.length===0)return null;const n=Math.min(...t.map(A=>A.start)),o=Math.max(...t.map(A=>A.end))-n,a=Math.max(0,e-n),c=i.bounds,l=(c==null?void 0:c.width)??r.width,u=(c==null?void 0:c.height)??r.height;return ad({sceneTime:a,animations:i.animations,elementDuration:o,elementDimensions:{width:l,height:u}})}function Sd({group:i,animationState:e,targetCtx:t,fallbackDimensions:r}){const n=i.bounds,s=(n==null?void 0:n.x)??0,o=(n==null?void 0:n.y)??0,a=(n==null?void 0:n.width)??r.width,c=(n==null?void 0:n.height)??r.height,{opacity:l,translation:u,scale:A,clip:h,rotation:d}=e;if(t.globalAlpha*=l,(u.x||u.y)&&t.translate(u.x,u.y),A!==1||d!==0){const f=s+a/2,g=o+c/2;t.translate(f,g),t.scale(A,A),t.rotate(d*Math.PI/180),t.translate(-f,-g)}h&&(t.beginPath(),t.rect(s+h.x*a,o+h.y*c,h.width*a,h.height*c),t.clip())}async function iC({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=Mo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=ri(o.slice(0,d));return h.type==="video"&&A.push(Fo({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),h.type==="image"&&A.push(Fo({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),A},[])),c=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=ri(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),l=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=ri(o.slice(0,d))-f;return A.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var I;return p===((I=e[d+1])==null?void 0:I.id)}),from:a.find(({id:p})=>{var I;return p===((I=e[d-1])==null?void 0:I.id)})}),A},[]),u=e.map(({id:A})=>a.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)??l.find(({id:h})=>h===A)).filter(Boolean);return{type:"picture",scenes:a,gapScenes:c,transitions:l,mergedScenes:u,duration:Math.max(0,...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}async function rC({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=Mo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=ri(o.slice(0,d));return h.type==="text"&&A.push(Fo({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),A},[])),c=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=ri(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),l=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=ri(o.slice(0,d))-f;return A.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var I;return p===((I=e[d+1])==null?void 0:I.id)}),from:a.find(({id:p})=>{var I;return p===((I=e[d-1])==null?void 0:I.id)})}),A},[]),u=e.map(({id:A})=>a.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)??l.find(({id:h})=>h===A)).filter(Boolean);return{type:"text",scenes:a,gapScenes:c,transitions:l,mergedScenes:u,duration:Math.max(...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}const nC=(((Wh=Kh)==null?void 0:Wh.default)??Kh).reduce((i,e)=>(i[e.name]=e,i),{});function sC(i,e){return i.has(e)||i.set(e,{buffer:null,transitions:{},fromTexture:null,toTexture:null}),i.get(e)}function oC({name:i,to:e,from:t,progress:r,width:n,height:s,glContext:o,contextResources:a,returnPixels:c=!0}){var l,u,A;const h=sC(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=xo)==null?void 0:l.default)??xo)(o,t),h.fromTexture.minFilter=o.LINEAR,h.fromTexture.magFilter=o.LINEAR),h.toTexture?h.toTexture.setPixels(e):(h.toTexture=(((u=xo)==null?void 0:u.default)??xo)(o,e),h.toTexture.minFilter=o.LINEAR,h.toTexture.magFilter=o.LINEAR),h.transitions[i]||(h.transitions[i]=(((A=Vh)==null?void 0:A.default)??Vh)(o,nC[i])),h.transitions[i].draw(r,h.fromTexture,h.toTexture,n,s),!c)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 aC(i){for(const[e,t]of i.entries())t.buffer&&e.deleteBuffer(t.buffer),t.fromTexture&&t.fromTexture.dispose(),t.toTexture&&t.toTexture.dispose(),Object.values(t.transitions).forEach(r=>{r.dispose()}),i.delete(e)}function lC({name:i,to:e,from:t,progress:r,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),oC({name:i,to:e,from:t,progress:r,width:n.width,height:n.height,glContext:o,contextResources:s,returnPixels:!1}))}async function xd({debug:i=!1,config:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s=Td,drawTransition:o=lC}){var a;const c=new Map,l=await Promise.all(e.tracks.map(async I=>{if(jy(I))return{...await iC({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(Vy(I))return{...await rC({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(Ky(I))return{...await Zy({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(Wy(I))return{...await zy({track:I}),config:I};throw new Error("Unknown track type")})),u=(a=e.groups)!=null&&a.length?eC({groups:e.groups,tracks:l}):[],A=new Map,h=[...u].sort((I,C)=>I.depth-C.depth);for(const I of h)for(const C of I.sceneIds)A.set(C,I);const d=new Map(u.map(I=>[I.id,I]));function f(I){const C=[];let B=A.get(I.id);for(;B;)B.animations&&C.push(B),B=B.parentGroupId?d.get(B.parentGroupId):void 0;return C}return{draw:async({canvas:I,currentTime:C,overrides:B,signal:y})=>{const x=I.getContext("2d");if(!x)return;x.globalAlpha=1,x.globalCompositeOperation="source-over",x.clearRect(0,0,I.width,I.height),x.save(),x.fillStyle="black",x.fillRect(0,0,I.width,I.height),x.restore();const R=new Map;for(const D of l)if(!Yl(D))for(const $ of D.scenes){if(C<$.start||C>=$.start+$.duration)continue;const j=$.layout,ee=j==null?void 0:j.node,Z={start:$.start,end:$.start+$.duration,x:(ee==null?void 0:ee.x)??0,y:(ee==null?void 0:ee.y)??0,width:(ee==null?void 0:ee.width)??I.width,height:(ee==null?void 0:ee.height)??I.height};let k=A.get($.id);for(;k;)k.animations&&(R.has(k.id)||R.set(k.id,[]),R.get(k.id).push(Z)),k=k.parentGroupId?d.get(k.parentGroupId):void 0}const _=new Map;function F(D){if(_.has(D.id))return _.get(D.id);const $=tC({group:D,currentTime:C,activeMembers:R.get(D.id)??[],fallbackDimensions:{width:I.width,height:I.height}});return _.set(D.id,$),$}function P(D,$,j){const ee=f({id:j});if(ee.length===0){D.drawImage($,0,0,$.width,$.height);return}D.save();for(let Z=ee.length-1;Z>=0;Z--){const k=ee[Z],O=F(k);O&&Sd({group:k,animationState:O,targetCtx:D,fallbackDimensions:{width:I.width,height:I.height}})}D.drawImage($,0,0,$.width,$.height),D.restore()}for(let D=0;D<l.length;D++){if(y!=null&&y.aborted)return;const $=l[D];if(Yl($))continue;const{scenes:j,transitions:ee,trackCanvas:Z}=$;Z.width=Z.height=0,Z.width=I.width,Z.height=I.height;const k=Z.getContext("2d");if(!k)continue;const O=j.filter(({start:Q,duration:M})=>C>=Q&&C<Q+M);if(O.length===0)continue;const V=ee.find(({start:Q,duration:M})=>C>=Q&&C<Q+M),L=!!(V&&V.to&&V.from&&V.duration>0);for await(const Q of O){if(y!=null&&y.aborted)return;const{sceneCanvas:M,draw:W,id:Y}=Q;if(await(W==null?void 0:W(C,B==null?void 0:B.get(Y))),y!=null&&y.aborted)return;L&&(V.to.id===Y||V.from.id===Y)||P(k,M,Y)}if(L){const{name:Q,to:M,from:W,duration:Y,transitionCanvas:ie}=V;ie.width=ie.height=0,ie.width=Z.width,ie.height=Z.height;const ae=Math.min(1,Math.max(0,(C-M.start)/Y));if(await o({name:Q,progress:ae,contextResources:c,to:M.sceneCanvas,from:W.sceneCanvas,canvas:ie}),y!=null&&y.aborted)return;const fe=new Set(f({id:W.id})),Ee=new Set(f({id:M.id})),we=[...fe].filter(Ne=>Ee.has(Ne)).sort((Ne,pe)=>Ne.depth-pe.depth);if(we.length===0)k.drawImage(ie,0,0,ie.width,ie.height);else{k.save();for(const Ne of we){const pe=F(Ne);pe&&Sd({group:Ne,animationState:pe,targetCtx:k,fallbackDimensions:{width:I.width,height:I.height}})}k.drawImage(ie,0,0,ie.width,ie.height),k.restore()}}x.drawImage(Z,0,0,Z.width,Z.height)}},cleanup:()=>{aC(c)},tracks:l,groups:u,aspectRatio:e.aspectRatio,transcriptions:e.transcriptions,duration:Math.max(...l.map(({duration:I})=>I))}}const cC={name:"@vouchfor/embeds",version:"8.4.5",license:"MIT",author:"Aaron Williams",main:"dist/es/embeds.js",module:"dist/es/embeds.js",type:"module",types:"dist/es/src/index.d.ts",exports:{".":"./dist/es/embeds.js"},files:["dist","src"],publishConfig:{tag:"latest",access:"public"},engines:{node:">=18.18.0"},scripts:{build:"rm -rf dist && tsc && yarn build:self","build:self":"vite build --mode iife && vite build --mode es && node scripts/build.cjs","build:storybook":"turbo run build --filter=@vouchfor/embeds^... && yarn prebuild && storybook build","generate:manifest":"wca src --outFile custom-elements.json",lint:"eslint . --quiet","lint:fix":"eslint . --fix","lint:staged":"lint-staged",prepublishOnly:"yarn build",size:"size-limit",storybook:"yarn prebuild && storybook dev -p 6007",prebuild:"yarn generate:manifest","test:browser":"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner --config web-test-runner.ci.config.js","test:browser:local":"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner","test:watch":"yarn test:browser --watch",typecheck:"tsc --noEmit"},"lint-staged":{"**/*.{ts,tsx,js}":"eslint --fix --quiet","**/*.{md,json,yml}":"prettier --write"},dependencies:{"@a11y/focus-trap":"^1.0.5","@lit/task":"^1.0.2","@vouchfor/canvas-video":"^13.4.3","@vouchfor/media-player":"^9.4.5",uuid:"^9.0.1"},peerDependencies:{lit:"^3.1.2"},devDependencies:{"@esm-bundle/chai":"^4.3.4","@open-wc/testing":"^4.0.0","@storybook/addon-docs":"^10.6.0","@storybook/addon-links":"^10.6.0","@storybook/web-components":"^10.6.0","@storybook/web-components-vite":"^10.6.0","@svgr/core":"^8.1.0","@types/flat":"^5.0.5","@types/mocha":"^10.0.10","@vouchfor/eslint-config":"^1.0.8","@vouchfor/prettier-config":"^1.0.1","@vouchfor/video-utils":"^6.4.3","@web/dev-server-esbuild":"^1.0.4","@web/test-runner":"^0.20.1","@web/test-runner-browserstack":"^0.8.0","@web/test-runner-mocha":"^0.9.0","@web/test-runner-playwright":"^0.11.0",eslint:"^8.57.0",glob:"^10.4.5","lint-staged":"^15.5.1",lit:"^3.3.0",lodash:"^4.17.21",react:"^18.3.1","react-dom":"^18.3.1","rollup-plugin-tla":"^0.0.2",sinon:"^17.0.1",storybook:"^10.6.0",svgson:"^5.3.1",typescript:"^5.8.3",vite:"^5.4.18","vite-plugin-commonjs":"^0.10.4","vite-plugin-dts":"^3.9.1","web-component-analyzer":"^2.0.0"}};function AC(i){const{publicApiUrl:e}=no(i),t=sr();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function uC(i){var s,o,a,c,l,u,A,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:sr()};let e=(o=(s=window.localStorage)==null?void 0:s.getItem)==null?void 0:o.call(s,"vouch-uid-visitor"),t=(c=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:c.call(a,"vouch-uid-client"),r=(u=(l=window.sessionStorage)==null?void 0:l.getItem)==null?void 0:u.call(l,"vouch-uid-tab");const n=sr();return e||(e=AC(i),(h=(A=window.localStorage)==null?void 0:A.setItem)==null||h.call(A,"vouch-uid-visitor",e)),t||(t=sr(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),r||(r=sr(),(p=(g=window.sessionStorage)==null?void 0:g.setItem)==null||p.call(g,"vouch-uid-tab",r)),{client:t,tab:r,request:n,visitor:e}}function hC(i,e){return i&&"vouchId"in i?i.vouchId:(e==null?void 0:e.id)??null}function dC(i="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,"/"))??[],r={};return[...new URLSearchParams(location.search).entries()].forEach(([o,a])=>{if(/utm/.test(o)){const c=o.toLowerCase().replace(/[-_][a-z0-9]/g,l=>l.slice(-1).toUpperCase());r[c]=a}}),{source:i,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:cC.version,templateVersion:Jy,...r}}const wd=1;class fC{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,r)=>{const n=hC(r,this.host.vouch);!n||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...r,senderId:this.host.senderId,vouchId:n,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=no(this.host.env),{client:r,tab:n,request:s,visitor:o}=uC(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":r,"x-uid-tab":n,"x-uid-request":s,"x-uid-visitor":o,"x-reporting-metadata":dC(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:r}=this._currentlyPlayingVideo;this._streamLatestTime[r]>this._streamStartTime[r]+wd&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[r],streamEnd:this._streamLatestTime[r]}),delete this._streamStartTime[r],delete this._streamLatestTime[r]}},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:r}})=>{this._answersViewed[r]||(this._createTrackingEvent("VOUCH_RESPONSE_VIEWED",{answerId:t}),this._answersViewed[r]=!0)},this._handleVideoTimeUpdate=({detail:{id:t,key:r,node:n}})=>{this.host.paused||(this._currentlyPlayingVideo={id:t,key:r,node:n},this._streamLatestTime[r]=n.currentTime,this._streamStartTime[r]||(this._streamStartTime[r]=n.currentTime,this._streamLatestTime[r]=n.currentTime))},this._handleVideoPause=({detail:{id:t,key:r}})=>{this._streamLatestTime[r]>this._streamStartTime[r]+wd&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[r],streamEnd:this._streamLatestTime[r]}),delete this._streamStartTime[r],delete this._streamLatestTime[r]},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,r,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),(r=this.host.mediaPlayer)==null||r.addEventListener("video:pause",this._handleVideoPause),(n=this.host.mediaPlayer)==null||n.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,r,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),(r=this.host.mediaPlayer)==null||r.removeEventListener("video:pause",this._handleVideoPause),(n=this.host.mediaPlayer)==null||n.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var Vl={exports:{}};(function(i,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof lr<"u"&&lr,r=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 lr<"u"&&lr||{},c={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(k){return k&&DataView.prototype.isPrototypeOf(k)}if(c.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],A=ArrayBuffer.isView||function(k){return k&&u.indexOf(Object.prototype.toString.call(k))>-1};function h(k){if(typeof k!="string"&&(k=String(k)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(k)||k==="")throw new TypeError('Invalid character in header field name: "'+k+'"');return k.toLowerCase()}function d(k){return typeof k!="string"&&(k=String(k)),k}function f(k){var O={next:function(){var V=k.shift();return{done:V===void 0,value:V}}};return c.iterable&&(O[Symbol.iterator]=function(){return O}),O}function g(k){this.map={},k instanceof g?k.forEach(function(O,V){this.append(V,O)},this):Array.isArray(k)?k.forEach(function(O){if(O.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+O.length);this.append(O[0],O[1])},this):k&&Object.getOwnPropertyNames(k).forEach(function(O){this.append(O,k[O])},this)}g.prototype.append=function(k,O){k=h(k),O=d(O);var V=this.map[k];this.map[k]=V?V+", "+O:O},g.prototype.delete=function(k){delete this.map[h(k)]},g.prototype.get=function(k){return k=h(k),this.has(k)?this.map[k]:null},g.prototype.has=function(k){return this.map.hasOwnProperty(h(k))},g.prototype.set=function(k,O){this.map[h(k)]=d(O)},g.prototype.forEach=function(k,O){for(var V in this.map)this.map.hasOwnProperty(V)&&k.call(O,this.map[V],V,this)},g.prototype.keys=function(){var k=[];return this.forEach(function(O,V){k.push(V)}),f(k)},g.prototype.values=function(){var k=[];return this.forEach(function(O){k.push(O)}),f(k)},g.prototype.entries=function(){var k=[];return this.forEach(function(O,V){k.push([V,O])}),f(k)},c.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function p(k){if(!k._noBody){if(k.bodyUsed)return Promise.reject(new TypeError("Already read"));k.bodyUsed=!0}}function I(k){return new Promise(function(O,V){k.onload=function(){O(k.result)},k.onerror=function(){V(k.error)}})}function C(k){var O=new FileReader,V=I(O);return O.readAsArrayBuffer(k),V}function B(k){var O=new FileReader,V=I(O),L=/charset=([A-Za-z0-9_-]+)/.exec(k.type),Q=L?L[1]:"utf-8";return O.readAsText(k,Q),V}function y(k){for(var O=new Uint8Array(k),V=new Array(O.length),L=0;L<O.length;L++)V[L]=String.fromCharCode(O[L]);return V.join("")}function x(k){if(k.slice)return k.slice(0);var O=new Uint8Array(k.byteLength);return O.set(new Uint8Array(k)),O.buffer}function R(){return this.bodyUsed=!1,this._initBody=function(k){this.bodyUsed=this.bodyUsed,this._bodyInit=k,k?typeof k=="string"?this._bodyText=k:c.blob&&Blob.prototype.isPrototypeOf(k)?this._bodyBlob=k:c.formData&&FormData.prototype.isPrototypeOf(k)?this._bodyFormData=k:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)?this._bodyText=k.toString():c.arrayBuffer&&c.blob&&l(k)?(this._bodyArrayBuffer=x(k.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(k)||A(k))?this._bodyArrayBuffer=x(k):this._bodyText=k=Object.prototype.toString.call(k):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof k=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var k=p(this);if(k)return k;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 k=p(this);return k||(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(c.blob)return this.blob().then(C);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var k=p(this);if(k)return k;if(this._bodyBlob)return B(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(D)}),this.json=function(){return this.text().then(JSON.parse)},this}var _=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function F(k){var O=k.toUpperCase();return _.indexOf(O)>-1?O:k}function P(k,O){if(!(this instanceof P))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');O=O||{};var V=O.body;if(k instanceof P){if(k.bodyUsed)throw new TypeError("Already read");this.url=k.url,this.credentials=k.credentials,O.headers||(this.headers=new g(k.headers)),this.method=k.method,this.mode=k.mode,this.signal=k.signal,!V&&k._bodyInit!=null&&(V=k._bodyInit,k.bodyUsed=!0)}else this.url=String(k);if(this.credentials=O.credentials||this.credentials||"same-origin",(O.headers||!this.headers)&&(this.headers=new g(O.headers)),this.method=F(O.method||this.method||"GET"),this.mode=O.mode||this.mode||null,this.signal=O.signal||this.signal||function(){if("AbortController"in a){var M=new AbortController;return M.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&V)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(V),(this.method==="GET"||this.method==="HEAD")&&(O.cache==="no-store"||O.cache==="no-cache")){var L=/([?&])_=[^&]*/;if(L.test(this.url))this.url=this.url.replace(L,"$1_="+new Date().getTime());else{var Q=/\?/;this.url+=(Q.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}P.prototype.clone=function(){return new P(this,{body:this._bodyInit})};function D(k){var O=new FormData;return k.trim().split("&").forEach(function(V){if(V){var L=V.split("="),Q=L.shift().replace(/\+/g," "),M=L.join("=").replace(/\+/g," ");O.append(decodeURIComponent(Q),decodeURIComponent(M))}}),O}function $(k){var O=new g,V=k.replace(/\r?\n[\t ]+/g," ");return V.split("\r").map(function(L){return L.indexOf(`
|
|
2462
|
+
`).map(e=>{if(!e)return[];const t=[];for(const r of e.match(/\S+|\s+/g)??[])if(/^\s+$/.test(r))t.push({text:r,logicalIndex:t.length,whitespace:!0,spaceBefore:!1});else if(Id.test(r))for(const n of vd(r))t.push({text:n.text,logicalIndex:t.length,whitespace:!1,spaceBefore:!1});else t.push({text:r,logicalIndex:t.length,whitespace:!1,spaceBefore:!1});return t})}function vd(i){const e=[];let t=!1,r="";const n=ky();if(!n)return[{text:i,spaceBefore:!1}];for(const{segment:s,isWordLike:o}of n.segment(i)){if(!o&&s.trim().length===0){t=e.length>0?!0:t;continue}if(o){e.push({text:s,spaceBefore:t}),t=!1;continue}e.length>0?e[e.length-1].text+=s:r+=s}return r&&e.length>0?e[0].text=r+e[0].text:r&&e.push({text:r,spaceBefore:t}),e}function Fy(i){const e=[];for(const t of i){const n=Id.test(t.text)||/\s/.test(t.text)?vd(t.text):[{text:t.text,spaceBefore:!1}];if(n.length<=1){e.push({text:t.text,logicalIndex:e.length,whitespace:!1,spaceBefore:e.length>0,timing:{id:t.id,start:t.start,end:t.end}});continue}const s=n.reduce((c,l)=>c+[...l.text].length,0),o=t.end-t.start;let a=t.start;n.forEach((c,l)=>{const u=[...c.text].length/s*o,A=a,h=l===n.length-1?t.end:a+u;a=h,e.push({text:c.text,logicalIndex:e.length,whitespace:!1,spaceBefore:l===0?e.length>0:c.spaceBefore,timing:{id:t.id,subIndex:l,start:A,end:h}})})}return e}const Py=/(?<value>\d+\.?\d*)(?=px)/,$l=1;function Ny(i,e){const t=typeof i=="string"?My(i):[Fy(i)];return e?t.map(r=>r.map(n=>({...n,text:n.text.toUpperCase()}))):t}function Oy({context:i,groups:e,appendedFont:t,fontSizes:r,maxW:n,wrap:s,strokeWidth:o,letterSpacing:a,wholeLineMeasure:c}){const l=[],u=h=>{const d=r[h%r.length];return{fontSize:d,font:t.replace(Py,d.toString())}},A=(h,d)=>(i.font=h,i.letterSpacing=`${a}px`,i.measureText(d));for(const h of e){const d=l.length,{fontSize:f,font:g}=u(l.length);let p={items:[],font:g,fontSize:f,lineWidth:0,fontAscent:0,fontDescent:0},I="",C="";const B=()=>{const y=A(p.font,"");p.fontAscent=y.fontBoundingBoxAscent,p.fontDescent=y.fontBoundingBoxDescent,l.push(p);const x=u(l.length);p={items:[],font:x.font,fontSize:x.fontSize,lineWidth:0,fontAscent:0,fontDescent:0},I="",C=""};for(const y of h){if(y.whitespace){C+=y.text;continue}const x=()=>{const F=p.items.length>0&&y.spaceBefore&&!C?" ":C,P=F?A(p.font,F).width:0,D=A(p.font,y.text);return{token:y,metrics:D,width:D.width+o,gapBefore:P,gapText:F}};let R=x();const _=c?A(p.font,I+R.gapText+y.text).width+o*(p.items.length+1):p.lineWidth+R.gapBefore+R.width;if(s&&_>n+$l&&p.items.length>0&&(B(),R=x()),s&&c&&p.items.length===0&&R.width>n+$l){let F=y.text;for(;F.length>0;){let P="";for(const $ of F){const j=A(p.font,P+$).width+o;if(P&&j>n+$l)break;P+=$}F=F.slice(P.length);const D=A(p.font,P);p.items.push({token:{...y,text:P},metrics:D,width:D.width+o,gapBefore:0,gapText:""}),I=P,p.lineWidth=D.width+o*p.items.length,F.length>0&&B()}C="";continue}p.items.push(R),I+=R.gapText+y.text,p.lineWidth=c?A(p.font,I).width+o*p.items.length:p.lineWidth+R.gapBefore+R.width,C=""}c&&C&&(p.items.length>0||l.length===d)&&(I+=C,p.lineWidth=A(p.font,I).width+o*p.items.length),(p.items.length>0||l.length===d)&&B()}return l}const yd=[{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"},{family:"Noto Telugu",regex:new RegExp("\\p{Script=Telugu}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansTelugu-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Tamil",regex:new RegExp("\\p{Script=Tamil}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansTamil-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Kannada",regex:new RegExp("\\p{Script=Kannada}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKannada-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Malayalam",regex:new RegExp("\\p{Script=Malayalam}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansMalayalam-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Bengali",regex:new RegExp("\\p{Script=Bengali}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansBengali-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Gujarati",regex:new RegExp("\\p{Script=Gujarati}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGujarati-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Gurmukhi",regex:new RegExp("\\p{Script=Gurmukhi}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGurmukhi-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Sinhala",regex:new RegExp("\\p{Script=Sinhala}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansSinhala-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Thai",regex:new RegExp("\\p{Script=Thai}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansThai-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Lao",regex:new RegExp("\\p{Script=Lao}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansLao-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Khmer",regex:new RegExp("\\p{Script=Khmer}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKhmer-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Myanmar",regex:new RegExp("\\p{Script=Myanmar}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansMyanmar-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Ethiopic",regex:new RegExp("\\p{Script=Ethiopic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansEthiopic-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Armenian",regex:new RegExp("\\p{Script=Armenian}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansArmenian-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Georgian",regex:new RegExp("\\p{Script=Georgian}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGeorgian-VariableFont_wdth%2Cwght.woff2",style:"normal"}];function Cd({text:i,font:e}){let t=e;return yd.forEach(({family:r,regex:n})=>{n.exec(i)&&(t+=`, ${r}`)}),t}function Bd(i){return Math.max(i??1,.5)}function Uy({measured:i,index:e,lineTop:t,dx:r,dw:n,align:s,direction:o,lineHeight:a,strokeWidth:c}){const{items:l,font:u,fontSize:A,lineWidth:h,fontAscent:d,fontDescent:f}=i;let g=0;s==="center"?g=(n-h)/2:s==="right"&&(g=n-h);const p=Bd(a),I=A*p+c,C=(p-1)*A/2,B=(A+d-f)/2,y=t+C+B+c/2,{order:x,directions:R,baseDirection:_}=_y(l.map(({token:Z})=>({text:Z.text})),o),F=l.map(({gapBefore:Z})=>Z);let P=r+g+c/2;const D=[];x.forEach((Z,k)=>{const O=l[Z];P+=F[k],D.push({...O.token,x:P,baselineY:y,width:O.width,lineIndex:e,direction:R[Z],font:u,metrics:O.metrics}),P+=O.width});const $=[],j=[];D.forEach((Z,k)=>{const O=$[$.length-1];if(O&&O.direction===Z.direction){const V=Math.max(O.x+O.width,Z.x+Z.width);O.tokens.push(Z),O.x=Math.min(O.x,Z.x),O.width=V-O.x,j[j.length-1].push(x[k])}else $.push({text:"",x:Z.x,width:Z.width,direction:Z.direction,tokens:[Z]}),j.push([x[k]])}),$.forEach((Z,k)=>{const O=[...j[k]].sort((V,L)=>V-L);Z.text=O.map((V,L)=>L===0?l[V].token.text:`${l[V].gapText}${l[V].token.text}`).join("")});const ee=o??_;return{index:e,box:{x:r+g,y:t,width:h,height:I},baselineY:y,direction:ee,runs:$,tokens:D}}function Gy(i){const{context:e,text:t,font:r,fontSizes:n,dx:s=0,dy:o=0,maxW:a=1/0,dw:c=a,align:l="left",direction:u,lineHeight:A,lineGap:h=0,letterSpacing:d=0,strokeWidth:f=0,wrap:g=!0,uppercase:p=!1}=i,I=Ny(t,p),C=I.flat().map(({text:R})=>R).join(" "),B=Cd({font:r,text:C}),y=u??Qy(C),x=wy(l,y);try{e.save();const R=Oy({context:e,groups:I,appendedFont:B,fontSizes:n,maxW:a,wrap:g,strokeWidth:f,letterSpacing:d,wholeLineMeasure:typeof t=="string"}),_=[];let F=o;for(let ee=0;ee<R.length;ee++){const Z=Uy({measured:R[ee],index:ee,lineTop:F,dx:s,dw:c,align:x,direction:u,lineHeight:A,strokeWidth:f});_.push(Z),F+=Z.box.height+h}const P=R[R.length-1],D=P?Math.max(0,(P.fontAscent+P.fontDescent-P.fontSize*Bd(A))/2):0,$=_.reduce((ee,{box:Z})=>ee+Z.height,0)+h*Math.max(0,_.length-1)+D,j=_.length?{x:Math.min(..._.map(({box:ee})=>ee.x)),y:Math.min(..._.map(({box:ee})=>ee.y)),width:Math.max(..._.map(({box:ee})=>ee.x+ee.width))-Math.min(..._.map(({box:ee})=>ee.x)),height:Math.max(..._.map(({box:ee})=>ee.y+ee.height))-Math.min(..._.map(({box:ee})=>ee.y))}:{x:s,y:o,width:0,height:0};return{lines:_,totalHeight:$,blockBox:j,direction:y,font:B}}finally{e.restore()}}vu(Gy,{cache:Ly(),cacheKey:([i])=>JSON.stringify([i.text,i.font,i.fontSizes,i.dx,i.dy,i.dw,i.maxW,i.align,i.direction,i.lineHeight,i.lineGap,i.letterSpacing,i.strokeWidth,i.wrap,i.uppercase])});function Hy(i){return i.slice(0,1).toUpperCase()+i.slice(1)}Object.keys(jh).map(i=>({label:Hy(i),value:i,data:i}));function Td(){return document.createElement("canvas")}function ri(i){let e=0;for(const t of i)Array.isArray(t)?e+=ri(t):e+=t;return e}function Mo(i){return i.map(({type:e,duration:t},r)=>{var n,s,o,a;if(e==="transition"){const c=((n=i[r-2])==null?void 0:n.type)==="transition"?i[r-2]:null,l=((s=i[r-1])==null?void 0:s.duration)??1/0,u=((o=i[r+1])==null?void 0:o.duration)??1/0,A=((a=i[r+2])==null?void 0:a.type)==="transition"?i[r+2]:null;return Math.min(c?l/2:l,t,A?u/2:u)*-1}return t})}function $y(i){if(i===null||typeof i!="object")return!1;if(Object.getPrototypeOf(i)===null)return!0;let e=i;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(i)===e}function Yy(i){return i.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}oE.filters.define("parse",i=>typeof i>"u"?null:typeof i=="string"?`"${Yy(i)}"`:$y(i)||Array.isArray(i)?JSON.stringify(i):i);function Vy(i){return i.some(({type:e})=>e==="text")}function Ky(i){return i.some(({type:e})=>e==="caption")}function Wy(i){return i.some(({type:e})=>e==="audio")}function jy(i){return i.some(({type:e})=>e==="video"||e==="image")}function Yl(i){return i.type==="audio"}const Jy="3";async function qy({scene:i,start:e=0}){const{id:t,root:r,duration:n}=i,s=await gd({id:t,root:r});return{type:i.type,start:e,duration:n,layout:s,id:i.id,config:i}}async function zy({track:i}){const e=Mo(i),t=await Promise.all(i.reduce((s,o,a)=>{if(o.type!=="audio")return s;const c=ri(e.slice(0,a));return s.push(qy({scene:o,start:c})),s},[])),r=i.reduce((s,o,a)=>{if(o.type!=="gap")return s;const c=ri(e.slice(0,a));return s.push({type:o.type,id:o.id,start:c,config:o,duration:o.duration}),s},[]),n=i.map(({id:s})=>t.find(({id:o})=>o===s)??r.find(({id:o})=>o===s)).filter(Boolean);return{type:"audio",scenes:t,gapScenes:r,mergedScenes:n,config:i,duration:Math.max(...n.map(({start:s,duration:o})=>s+o))}}async function bd({node:i,canvases:e,sceneTime:t,sceneDuration:r,parentOpacity:n=1,parentTransform:s,debug:o=!1,override:a}){var c,l,u,A,h;const d=e.sceneCanvas.getContext("2d");if(d){d.save(),d.setTransform(s);const f=(a==null?void 0:a.rotation)!=null&&((c=i.element.layout)!=null&&c.transform)?{...i.element.layout,transform:{...i.element.layout.transform,rotation:a.rotation}}:i.element.layout,g=ad({layout:f,sceneTime:t,animations:i.element.animations,elementDuration:r,elementDimensions:{width:i.width,height:i.height}}),{opacity:p,translation:I,scale:C,clip:B,dimensions:y,rotation:x}=g,R=i.width*y.widthRatio,_=i.height*y.heightRatio;if(d.globalAlpha=p*n,(I.x||I.y)&&d.translate(I.x,I.y),(C!==1||x!==0)&&(d.translate(i.x+R/2,i.y+_/2),d.scale(C,C),d.rotate(x*Math.PI/180),d.translate(-(i.x+R/2),-(i.y+_/2))),B){d.beginPath();const D={x:i.x+B.x*R,y:i.y+B.y*_,width:B.width*R,height:B.height*_};d.rect(D.x,D.y,D.width,D.height),d.clip()}if(o){const D=d.globalAlpha;d.globalAlpha=1,d.strokeStyle="red",d.strokeRect(i.x,i.y,R,_),d.globalAlpha=D}const F=(a==null?void 0:a.fontSize)!=null||(a==null?void 0:a.textValue)!=null?{...i.options,...a.textValue!=null?{value:a.textValue}:{},...a.fontSize!=null&&((l=i.options)!=null&&l.font)?{font:{...i.options.font,size:a.fontSize}}:{}}:i.options,P=(a==null?void 0:a.fontSize)!=null&&((u=i.dependencies)!=null&&u.font)?{...i.dependencies,font:{...i.dependencies.font,size:a.fontSize}}:i.dependencies;await((h=(A=i.renderer)==null?void 0:A.render)==null?void 0:h.call(A,{canvases:e,sceneTime:t,dx:i.x,dy:i.y,dw:R,dh:_,radius:i.radius,options:F,dependencies:P}));for await(const D of i.childNodes)await bd({debug:o,node:D,canvases:e,sceneTime:t,sceneDuration:r,parentOpacity:d.globalAlpha,parentTransform:d.getTransform(),override:a});d.restore()}}async function Xy({layout:i,canvases:e,sceneTime:t,sceneDuration:r,debug:n=!1,override:s}){const{node:o}=i;await bd({debug:n,node:o,canvases:e,sceneDuration:r,sceneTime:t,override:s})}async function Fo({debug:i=!1,scene:e,start:t=0,resolvers:r,rootWidth:n,rootHeight:s,canvasFactory:o=Td}){var a,c;const{id:l,x:u,y:A,width:h,height:d,root:f,duration:g}=e,p=o(),I=o(),C=o(),B=o(),y=o(),x=await gd({id:l,root:{...f,layout:{...f.layout,width:n,height:s},element:{...f.element,layout:{...f.element.layout,...typeof u=="number"&&typeof A=="number"?{position:"absolute",inset:{top:A,left:u}}:{},width:h??((a=f.element.layout)==null?void 0:a.width),height:d??((c=f.element.layout)==null?void 0:c.height)}}},resolvers:r,measureCanvas:y}),R=async(_,F)=>{const P=Math.max(0,_-t);p.width=p.height=0,p.width=n,p.height=s,await Xy({debug:i,layout:x,sceneTime:P,sceneDuration:g,canvases:{sceneCanvas:p,cropCanvas:I,letterboxCanvas:C,posterCanvas:B},override:F})};return{id:l,type:e.type,start:t,duration:g,layout:x,sceneCanvas:p,draw:R,config:e,childScenes:[]}}async function Zy({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=Mo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=ri(o.slice(0,d));return h.type==="caption"&&A.push(Fo({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),A},[])),c=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=ri(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),l=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=ri(o.slice(0,d))-f;return A.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var I;return p===((I=e[d+1])==null?void 0:I.id)}),from:a.find(({id:p})=>{var I;return p===((I=e[d-1])==null?void 0:I.id)})}),A},[]),u=e.map(({id:A})=>a.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)??l.find(({id:h})=>h===A)).filter(Boolean);return{type:"caption",scenes:a,gapScenes:c,transitions:l,mergedScenes:u,duration:Math.max(...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}function eC({groups:i,tracks:e}){const t=i.map(s=>new Set(s.sceneIds)),r=i.map((s,o)=>{const a=[];for(let u=0;u<e.length;u++){const A=e[u];Yl(A)||A.scenes.some(h=>s.sceneIds.includes(h.id))&&a.push(u)}let c,l=1/0;for(let u=0;u<i.length;u++){if(o===u)continue;const A=t[u];s.sceneIds.every(d=>A.has(d))&&A.size>t[o].size&&A.size<l&&(c=i[u].id,l=A.size)}return{id:s.id,sceneIds:s.sceneIds,animations:s.animations,bounds:s.bounds,kind:s.kind,topmostTrackIndex:a.length>0?Math.max(...a):-1,parentGroupId:c,depth:0}}),n=new Map(r.map(s=>[s.id,s]));for(const s of r){let o=0,a=s;for(;a!=null&&a.parentGroupId;)o++,a=n.get(a.parentGroupId);s.depth=o}return r}function tC({group:i,currentTime:e,activeMembers:t,fallbackDimensions:r}){if(!i.animations||t.length===0)return null;const n=Math.min(...t.map(A=>A.start)),o=Math.max(...t.map(A=>A.end))-n,a=Math.max(0,e-n),c=i.bounds,l=(c==null?void 0:c.width)??r.width,u=(c==null?void 0:c.height)??r.height;return ad({sceneTime:a,animations:i.animations,elementDuration:o,elementDimensions:{width:l,height:u}})}function Sd({group:i,animationState:e,targetCtx:t,fallbackDimensions:r}){const n=i.bounds,s=(n==null?void 0:n.x)??0,o=(n==null?void 0:n.y)??0,a=(n==null?void 0:n.width)??r.width,c=(n==null?void 0:n.height)??r.height,{opacity:l,translation:u,scale:A,clip:h,rotation:d}=e;if(t.globalAlpha*=l,(u.x||u.y)&&t.translate(u.x,u.y),A!==1||d!==0){const f=s+a/2,g=o+c/2;t.translate(f,g),t.scale(A,A),t.rotate(d*Math.PI/180),t.translate(-f,-g)}h&&(t.beginPath(),t.rect(s+h.x*a,o+h.y*c,h.width*a,h.height*c),t.clip())}async function iC({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=Mo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=ri(o.slice(0,d));return h.type==="video"&&A.push(Fo({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),h.type==="image"&&A.push(Fo({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),A},[])),c=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=ri(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),l=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=ri(o.slice(0,d))-f;return A.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var I;return p===((I=e[d+1])==null?void 0:I.id)}),from:a.find(({id:p})=>{var I;return p===((I=e[d-1])==null?void 0:I.id)})}),A},[]),u=e.map(({id:A})=>a.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)??l.find(({id:h})=>h===A)).filter(Boolean);return{type:"picture",scenes:a,gapScenes:c,transitions:l,mergedScenes:u,duration:Math.max(0,...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}async function rC({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=Mo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=ri(o.slice(0,d));return h.type==="text"&&A.push(Fo({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),A},[])),c=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=ri(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),l=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=ri(o.slice(0,d))-f;return A.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var I;return p===((I=e[d+1])==null?void 0:I.id)}),from:a.find(({id:p})=>{var I;return p===((I=e[d-1])==null?void 0:I.id)})}),A},[]),u=e.map(({id:A})=>a.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)??l.find(({id:h})=>h===A)).filter(Boolean);return{type:"text",scenes:a,gapScenes:c,transitions:l,mergedScenes:u,duration:Math.max(...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}const nC=(((Wh=Kh)==null?void 0:Wh.default)??Kh).reduce((i,e)=>(i[e.name]=e,i),{});function sC(i,e){return i.has(e)||i.set(e,{buffer:null,transitions:{},fromTexture:null,toTexture:null}),i.get(e)}function oC({name:i,to:e,from:t,progress:r,width:n,height:s,glContext:o,contextResources:a,returnPixels:c=!0}){var l,u,A;const h=sC(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=xo)==null?void 0:l.default)??xo)(o,t),h.fromTexture.minFilter=o.LINEAR,h.fromTexture.magFilter=o.LINEAR),h.toTexture?h.toTexture.setPixels(e):(h.toTexture=(((u=xo)==null?void 0:u.default)??xo)(o,e),h.toTexture.minFilter=o.LINEAR,h.toTexture.magFilter=o.LINEAR),h.transitions[i]||(h.transitions[i]=(((A=Vh)==null?void 0:A.default)??Vh)(o,nC[i])),h.transitions[i].draw(r,h.fromTexture,h.toTexture,n,s),!c)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 aC(i){for(const[e,t]of i.entries())t.buffer&&e.deleteBuffer(t.buffer),t.fromTexture&&t.fromTexture.dispose(),t.toTexture&&t.toTexture.dispose(),Object.values(t.transitions).forEach(r=>{r.dispose()}),i.delete(e)}function lC({name:i,to:e,from:t,progress:r,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),oC({name:i,to:e,from:t,progress:r,width:n.width,height:n.height,glContext:o,contextResources:s,returnPixels:!1}))}async function xd({debug:i=!1,config:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s=Td,drawTransition:o=lC}){var a;const c=new Map,l=await Promise.all(e.tracks.map(async I=>{if(jy(I))return{...await iC({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(Vy(I))return{...await rC({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(Ky(I))return{...await Zy({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(Wy(I))return{...await zy({track:I}),config:I};throw new Error("Unknown track type")})),u=(a=e.groups)!=null&&a.length?eC({groups:e.groups,tracks:l}):[],A=new Map,h=[...u].sort((I,C)=>I.depth-C.depth);for(const I of h)for(const C of I.sceneIds)A.set(C,I);const d=new Map(u.map(I=>[I.id,I]));function f(I){const C=[];let B=A.get(I.id);for(;B;)B.animations&&C.push(B),B=B.parentGroupId?d.get(B.parentGroupId):void 0;return C}return{draw:async({canvas:I,currentTime:C,overrides:B,signal:y})=>{const x=I.getContext("2d");if(!x)return;x.globalAlpha=1,x.globalCompositeOperation="source-over",x.clearRect(0,0,I.width,I.height),x.save(),x.fillStyle="black",x.fillRect(0,0,I.width,I.height),x.restore();const R=new Map;for(const D of l)if(!Yl(D))for(const $ of D.scenes){if(C<$.start||C>=$.start+$.duration)continue;const j=$.layout,ee=j==null?void 0:j.node,Z={start:$.start,end:$.start+$.duration,x:(ee==null?void 0:ee.x)??0,y:(ee==null?void 0:ee.y)??0,width:(ee==null?void 0:ee.width)??I.width,height:(ee==null?void 0:ee.height)??I.height};let k=A.get($.id);for(;k;)k.animations&&(R.has(k.id)||R.set(k.id,[]),R.get(k.id).push(Z)),k=k.parentGroupId?d.get(k.parentGroupId):void 0}const _=new Map;function F(D){if(_.has(D.id))return _.get(D.id);const $=tC({group:D,currentTime:C,activeMembers:R.get(D.id)??[],fallbackDimensions:{width:I.width,height:I.height}});return _.set(D.id,$),$}function P(D,$,j){const ee=f({id:j});if(ee.length===0){D.drawImage($,0,0,$.width,$.height);return}D.save();for(let Z=ee.length-1;Z>=0;Z--){const k=ee[Z],O=F(k);O&&Sd({group:k,animationState:O,targetCtx:D,fallbackDimensions:{width:I.width,height:I.height}})}D.drawImage($,0,0,$.width,$.height),D.restore()}for(let D=0;D<l.length;D++){if(y!=null&&y.aborted)return;const $=l[D];if(Yl($))continue;const{scenes:j,transitions:ee,trackCanvas:Z}=$;Z.width=Z.height=0,Z.width=I.width,Z.height=I.height;const k=Z.getContext("2d");if(!k)continue;const O=j.filter(({start:Q,duration:M})=>C>=Q&&C<Q+M);if(O.length===0)continue;const V=ee.find(({start:Q,duration:M})=>C>=Q&&C<Q+M),L=!!(V&&V.to&&V.from&&V.duration>0);for await(const Q of O){if(y!=null&&y.aborted)return;const{sceneCanvas:M,draw:W,id:Y}=Q;if(await(W==null?void 0:W(C,B==null?void 0:B.get(Y))),y!=null&&y.aborted)return;L&&(V.to.id===Y||V.from.id===Y)||P(k,M,Y)}if(L){const{name:Q,to:M,from:W,duration:Y,transitionCanvas:ie}=V;ie.width=ie.height=0,ie.width=Z.width,ie.height=Z.height;const ae=Math.min(1,Math.max(0,(C-M.start)/Y));if(await o({name:Q,progress:ae,contextResources:c,to:M.sceneCanvas,from:W.sceneCanvas,canvas:ie}),y!=null&&y.aborted)return;const fe=new Set(f({id:W.id})),Ee=new Set(f({id:M.id})),we=[...fe].filter(Ne=>Ee.has(Ne)).sort((Ne,pe)=>Ne.depth-pe.depth);if(we.length===0)k.drawImage(ie,0,0,ie.width,ie.height);else{k.save();for(const Ne of we){const pe=F(Ne);pe&&Sd({group:Ne,animationState:pe,targetCtx:k,fallbackDimensions:{width:I.width,height:I.height}})}k.drawImage(ie,0,0,ie.width,ie.height),k.restore()}}x.drawImage(Z,0,0,Z.width,Z.height)}},cleanup:()=>{aC(c)},tracks:l,groups:u,aspectRatio:e.aspectRatio,transcriptions:e.transcriptions,duration:Math.max(...l.map(({duration:I})=>I))}}const cC={name:"@vouchfor/embeds",version:"8.4.7",license:"MIT",author:"Aaron Williams",main:"dist/es/embeds.js",module:"dist/es/embeds.js",type:"module",types:"dist/es/src/index.d.ts",exports:{".":"./dist/es/embeds.js"},files:["dist","src"],publishConfig:{tag:"latest",access:"public"},engines:{node:">=18.18.0"},scripts:{build:"rm -rf dist && tsc && yarn build:self","build:self":"vite build --mode iife && vite build --mode es && node scripts/build.cjs","build:storybook":"yarn prebuild && storybook build","generate:manifest":"wca src --outFile custom-elements.json",lint:"eslint . --quiet","lint:fix":"eslint . --fix","lint:staged":"lint-staged",prepublishOnly:"yarn build",size:"size-limit",storybook:"yarn prebuild && storybook dev -p 6007",prebuild:"yarn generate:manifest","test:browser":"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner --config web-test-runner.ci.config.js","test:browser:local":"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner","test:watch":"yarn test:browser --watch",typecheck:"tsc --noEmit"},"lint-staged":{"**/*.{ts,tsx,js}":"eslint --fix --quiet","**/*.{md,json,yml}":"prettier --write"},dependencies:{"@a11y/focus-trap":"^1.0.5","@lit/task":"^1.0.2","@vouchfor/canvas-video":"^13.4.4","@vouchfor/media-player":"^9.4.7",uuid:"^9.0.1"},peerDependencies:{lit:"^3.1.2"},devDependencies:{"@esm-bundle/chai":"^4.3.4","@open-wc/testing":"^4.0.0","@storybook/addon-docs":"^10.6.0","@storybook/addon-links":"^10.6.0","@storybook/web-components":"^10.6.0","@storybook/web-components-vite":"^10.6.0","@svgr/core":"^8.1.0","@types/flat":"^5.0.5","@types/mocha":"^10.0.10","@vouchfor/eslint-config":"^1.0.8","@vouchfor/prettier-config":"^1.0.1","@vouchfor/video-utils":"^6.4.4","@web/dev-server-esbuild":"^1.0.4","@web/test-runner":"^0.20.1","@web/test-runner-browserstack":"^0.8.0","@web/test-runner-mocha":"^0.9.0","@web/test-runner-playwright":"^0.11.0",dotenv:"^17.4.2",eslint:"^8.57.0",glob:"^10.4.5","lint-staged":"^15.5.1",lit:"^3.3.0",lodash:"^4.17.21",react:"^18.3.1","react-dom":"^18.3.1","rollup-plugin-tla":"^0.0.2",sinon:"^17.0.1",storybook:"^10.6.0",svgson:"^5.3.1",typescript:"^5.8.3",vite:"^5.4.18","vite-plugin-commonjs":"^0.10.4","vite-plugin-dts":"^3.9.1","web-component-analyzer":"^2.0.0"}};function AC(i){const{publicApiUrl:e}=no(i),t=sr();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function uC(i){var s,o,a,c,l,u,A,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:sr()};let e=(o=(s=window.localStorage)==null?void 0:s.getItem)==null?void 0:o.call(s,"vouch-uid-visitor"),t=(c=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:c.call(a,"vouch-uid-client"),r=(u=(l=window.sessionStorage)==null?void 0:l.getItem)==null?void 0:u.call(l,"vouch-uid-tab");const n=sr();return e||(e=AC(i),(h=(A=window.localStorage)==null?void 0:A.setItem)==null||h.call(A,"vouch-uid-visitor",e)),t||(t=sr(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),r||(r=sr(),(p=(g=window.sessionStorage)==null?void 0:g.setItem)==null||p.call(g,"vouch-uid-tab",r)),{client:t,tab:r,request:n,visitor:e}}function hC(i,e){return i&&"vouchId"in i?i.vouchId:(e==null?void 0:e.id)??null}function dC(i="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,"/"))??[],r={};return[...new URLSearchParams(location.search).entries()].forEach(([o,a])=>{if(/utm/.test(o)){const c=o.toLowerCase().replace(/[-_][a-z0-9]/g,l=>l.slice(-1).toUpperCase());r[c]=a}}),{source:i,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:cC.version,templateVersion:Jy,...r}}const wd=1;class fC{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,r)=>{const n=hC(r,this.host.vouch);!n||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...r,senderId:this.host.senderId,vouchId:n,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=no(this.host.env),{client:r,tab:n,request:s,visitor:o}=uC(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":r,"x-uid-tab":n,"x-uid-request":s,"x-uid-visitor":o,"x-reporting-metadata":dC(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:r}=this._currentlyPlayingVideo;this._streamLatestTime[r]>this._streamStartTime[r]+wd&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[r],streamEnd:this._streamLatestTime[r]}),delete this._streamStartTime[r],delete this._streamLatestTime[r]}},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:r}})=>{this._answersViewed[r]||(this._createTrackingEvent("VOUCH_RESPONSE_VIEWED",{answerId:t}),this._answersViewed[r]=!0)},this._handleVideoTimeUpdate=({detail:{id:t,key:r,node:n}})=>{this.host.paused||(this._currentlyPlayingVideo={id:t,key:r,node:n},this._streamLatestTime[r]=n.currentTime,this._streamStartTime[r]||(this._streamStartTime[r]=n.currentTime,this._streamLatestTime[r]=n.currentTime))},this._handleVideoPause=({detail:{id:t,key:r}})=>{this._streamLatestTime[r]>this._streamStartTime[r]+wd&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[r],streamEnd:this._streamLatestTime[r]}),delete this._streamStartTime[r],delete this._streamLatestTime[r]},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,r,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),(r=this.host.mediaPlayer)==null||r.addEventListener("video:pause",this._handleVideoPause),(n=this.host.mediaPlayer)==null||n.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,r,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),(r=this.host.mediaPlayer)==null||r.removeEventListener("video:pause",this._handleVideoPause),(n=this.host.mediaPlayer)==null||n.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var Vl={exports:{}};(function(i,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof lr<"u"&&lr,r=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 lr<"u"&&lr||{},c={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(k){return k&&DataView.prototype.isPrototypeOf(k)}if(c.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],A=ArrayBuffer.isView||function(k){return k&&u.indexOf(Object.prototype.toString.call(k))>-1};function h(k){if(typeof k!="string"&&(k=String(k)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(k)||k==="")throw new TypeError('Invalid character in header field name: "'+k+'"');return k.toLowerCase()}function d(k){return typeof k!="string"&&(k=String(k)),k}function f(k){var O={next:function(){var V=k.shift();return{done:V===void 0,value:V}}};return c.iterable&&(O[Symbol.iterator]=function(){return O}),O}function g(k){this.map={},k instanceof g?k.forEach(function(O,V){this.append(V,O)},this):Array.isArray(k)?k.forEach(function(O){if(O.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+O.length);this.append(O[0],O[1])},this):k&&Object.getOwnPropertyNames(k).forEach(function(O){this.append(O,k[O])},this)}g.prototype.append=function(k,O){k=h(k),O=d(O);var V=this.map[k];this.map[k]=V?V+", "+O:O},g.prototype.delete=function(k){delete this.map[h(k)]},g.prototype.get=function(k){return k=h(k),this.has(k)?this.map[k]:null},g.prototype.has=function(k){return this.map.hasOwnProperty(h(k))},g.prototype.set=function(k,O){this.map[h(k)]=d(O)},g.prototype.forEach=function(k,O){for(var V in this.map)this.map.hasOwnProperty(V)&&k.call(O,this.map[V],V,this)},g.prototype.keys=function(){var k=[];return this.forEach(function(O,V){k.push(V)}),f(k)},g.prototype.values=function(){var k=[];return this.forEach(function(O){k.push(O)}),f(k)},g.prototype.entries=function(){var k=[];return this.forEach(function(O,V){k.push([V,O])}),f(k)},c.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function p(k){if(!k._noBody){if(k.bodyUsed)return Promise.reject(new TypeError("Already read"));k.bodyUsed=!0}}function I(k){return new Promise(function(O,V){k.onload=function(){O(k.result)},k.onerror=function(){V(k.error)}})}function C(k){var O=new FileReader,V=I(O);return O.readAsArrayBuffer(k),V}function B(k){var O=new FileReader,V=I(O),L=/charset=([A-Za-z0-9_-]+)/.exec(k.type),Q=L?L[1]:"utf-8";return O.readAsText(k,Q),V}function y(k){for(var O=new Uint8Array(k),V=new Array(O.length),L=0;L<O.length;L++)V[L]=String.fromCharCode(O[L]);return V.join("")}function x(k){if(k.slice)return k.slice(0);var O=new Uint8Array(k.byteLength);return O.set(new Uint8Array(k)),O.buffer}function R(){return this.bodyUsed=!1,this._initBody=function(k){this.bodyUsed=this.bodyUsed,this._bodyInit=k,k?typeof k=="string"?this._bodyText=k:c.blob&&Blob.prototype.isPrototypeOf(k)?this._bodyBlob=k:c.formData&&FormData.prototype.isPrototypeOf(k)?this._bodyFormData=k:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)?this._bodyText=k.toString():c.arrayBuffer&&c.blob&&l(k)?(this._bodyArrayBuffer=x(k.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(k)||A(k))?this._bodyArrayBuffer=x(k):this._bodyText=k=Object.prototype.toString.call(k):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof k=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var k=p(this);if(k)return k;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 k=p(this);return k||(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(c.blob)return this.blob().then(C);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var k=p(this);if(k)return k;if(this._bodyBlob)return B(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(D)}),this.json=function(){return this.text().then(JSON.parse)},this}var _=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function F(k){var O=k.toUpperCase();return _.indexOf(O)>-1?O:k}function P(k,O){if(!(this instanceof P))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');O=O||{};var V=O.body;if(k instanceof P){if(k.bodyUsed)throw new TypeError("Already read");this.url=k.url,this.credentials=k.credentials,O.headers||(this.headers=new g(k.headers)),this.method=k.method,this.mode=k.mode,this.signal=k.signal,!V&&k._bodyInit!=null&&(V=k._bodyInit,k.bodyUsed=!0)}else this.url=String(k);if(this.credentials=O.credentials||this.credentials||"same-origin",(O.headers||!this.headers)&&(this.headers=new g(O.headers)),this.method=F(O.method||this.method||"GET"),this.mode=O.mode||this.mode||null,this.signal=O.signal||this.signal||function(){if("AbortController"in a){var M=new AbortController;return M.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&V)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(V),(this.method==="GET"||this.method==="HEAD")&&(O.cache==="no-store"||O.cache==="no-cache")){var L=/([?&])_=[^&]*/;if(L.test(this.url))this.url=this.url.replace(L,"$1_="+new Date().getTime());else{var Q=/\?/;this.url+=(Q.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}P.prototype.clone=function(){return new P(this,{body:this._bodyInit})};function D(k){var O=new FormData;return k.trim().split("&").forEach(function(V){if(V){var L=V.split("="),Q=L.shift().replace(/\+/g," "),M=L.join("=").replace(/\+/g," ");O.append(decodeURIComponent(Q),decodeURIComponent(M))}}),O}function $(k){var O=new g,V=k.replace(/\r?\n[\t ]+/g," ");return V.split("\r").map(function(L){return L.indexOf(`
|
|
2463
2463
|
`)===0?L.substr(1,L.length):L}).forEach(function(L){var Q=L.split(":"),M=Q.shift().trim();if(M){var W=Q.join(":").trim();try{O.append(M,W)}catch(Y){console.warn("Response "+Y.message)}}}),O}R.call(P.prototype);function j(k,O){if(!(this instanceof j))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(O||(O={}),this.type="default",this.status=O.status===void 0?200:O.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=O.statusText===void 0?"":""+O.statusText,this.headers=new g(O.headers),this.url=O.url||"",this._initBody(k)}R.call(j.prototype),j.prototype.clone=function(){return new j(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},j.error=function(){var k=new j(null,{status:200,statusText:""});return k.ok=!1,k.status=0,k.type="error",k};var ee=[301,302,303,307,308];j.redirect=function(k,O){if(ee.indexOf(O)===-1)throw new RangeError("Invalid status code");return new j(null,{status:O,headers:{location:k}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(O,V){this.message=O,this.name=V;var L=Error(O);this.stack=L.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function Z(k,O){return new Promise(function(V,L){var Q=new P(k,O);if(Q.signal&&Q.signal.aborted)return L(new o.DOMException("Aborted","AbortError"));var M=new XMLHttpRequest;function W(){M.abort()}M.onload=function(){var ae={statusText:M.statusText,headers:$(M.getAllResponseHeaders()||"")};Q.url.indexOf("file://")===0&&(M.status<200||M.status>599)?ae.status=200:ae.status=M.status,ae.url="responseURL"in M?M.responseURL:ae.headers.get("X-Request-URL");var fe="response"in M?M.response:M.responseText;setTimeout(function(){V(new j(fe,ae))},0)},M.onerror=function(){setTimeout(function(){L(new TypeError("Network request failed"))},0)},M.ontimeout=function(){setTimeout(function(){L(new TypeError("Network request timed out"))},0)},M.onabort=function(){setTimeout(function(){L(new o.DOMException("Aborted","AbortError"))},0)};function Y(ae){try{return ae===""&&a.location.href?a.location.href:ae}catch{return ae}}if(M.open(Q.method,Y(Q.url),!0),Q.credentials==="include"?M.withCredentials=!0:Q.credentials==="omit"&&(M.withCredentials=!1),"responseType"in M&&(c.blob?M.responseType="blob":c.arrayBuffer&&(M.responseType="arraybuffer")),O&&typeof O.headers=="object"&&!(O.headers instanceof g||a.Headers&&O.headers instanceof a.Headers)){var ie=[];Object.getOwnPropertyNames(O.headers).forEach(function(ae){ie.push(h(ae)),M.setRequestHeader(ae,d(O.headers[ae]))}),Q.headers.forEach(function(ae,fe){ie.indexOf(fe)===-1&&M.setRequestHeader(fe,ae)})}else Q.headers.forEach(function(ae,fe){M.setRequestHeader(fe,ae)});Q.signal&&(Q.signal.addEventListener("abort",W),M.onreadystatechange=function(){M.readyState===4&&Q.signal.removeEventListener("abort",W)}),M.send(typeof Q._bodyInit>"u"?null:Q._bodyInit)})}return Z.polyfill=!0,a.fetch||(a.fetch=Z,a.Headers=g,a.Request=P,a.Response=j),o.Headers=g,o.Request=P,o.Response=j,o.fetch=Z,o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var n=t.fetch?t:r;e=n.fetch,e.default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,i.exports=e})(Vl,Vl.exports);var gC=Vl.exports;const Qd=al(gC);async function pC(i){var e;try{if((e=await Qd(i,{method:"HEAD"}))!=null&&e.ok)return i}catch{return}}async function Kl({sources:i}){const e=i==null?void 0:i.filter(Boolean),t=e==null?void 0:e.find(s=>s.startsWith("blob:")),r=e==null?void 0:e.find(s=>!s.startsWith("http")&&!s.startsWith("blob:"));if(t||r)return t??r;let n=e[0];if(e.length>0){const s=e.map(a=>pC(a)),o=(await Promise.all(s)).find(Boolean);o&&(n=o)}return n}async function mC(i){try{return(await Qd(i)).text()}catch{return null}}async function EC(i){return i=i.trim(),i.startsWith("http")||i.startsWith("blob:")?mC(i):i}function IC(i){if(typeof i=="string"){const[e,t]=i.split(":");return parseFloat(e)/parseFloat(t)}return i}const vC=Ti(async({original:i,translation:e,originalLanguage:t="",translationLanguage:r=""},{language:n})=>{var s,o;const a={[(s=r==null?void 0:r.split("-"))==null?void 0:s[0]]:e,[(o=t==null?void 0:t.split("-"))==null?void 0:o[0]]:i},c=(n&&a[n])??i;return c?EC(c):null},{cacheKey:([i,{language:e}])=>JSON.stringify({...i,language:e})});function yC(i){var e;return((e=i==null?void 0:i.items)==null?void 0:e.map(t=>{var r;return{text:(r=t.alternatives[0])==null?void 0:r.content,start:t.start_time,end:t.end_time}}))??[]}const CC=Ti(async i=>{var e,t,r,n,s,o,a,c,l,u,A;const[h,d,f]=await Promise.all([Kl({sources:[(t=(e=i==null?void 0:i.answer)==null?void 0:e.media)==null?void 0:t.video,(n=(r=i==null?void 0:i.answer)==null?void 0:r.media)==null?void 0:n.input]}),Kl({sources:[(o=(s=i==null?void 0:i.answer)==null?void 0:s.media)==null?void 0:o.playlist]}),Kl({sources:[((c=(a=i==null?void 0:i.answer)==null?void 0:a.media)==null?void 0:c.reducedQuality)??((A=(u=(l=i==null?void 0:i.answer)==null?void 0:l.media)==null?void 0:u.videos)==null?void 0:A.xs)]})]);return{src:h,playlist:d,preview:f}},{cacheKey:([i])=>{var e,t,r,n,s,o,a,c,l,u,A;return JSON.stringify({video:(t=(e=i==null?void 0:i.answer)==null?void 0:e.media)==null?void 0:t.video,input:(n=(r=i==null?void 0:i.answer)==null?void 0:r.media)==null?void 0:n.input,playlist:(o=(s=i==null?void 0:i.answer)==null?void 0:s.media)==null?void 0:o.playlist,preview:((c=(a=i==null?void 0:i.answer)==null?void 0:a.media)==null?void 0:c.reducedQuality)??((A=(u=(l=i==null?void 0:i.answer)==null?void 0:l.media)==null?void 0:u.videos)==null?void 0:A.xs)})}});function Rd(i){var e,t,r,n,s,o,a,c,l,u,A,h;const d=((t=(e=i==null?void 0:i.answer)==null?void 0:e.contact)==null?void 0:t.name)==="Anonymous"?"":((s=(n=(r=i==null?void 0:i.answer)==null?void 0:r.contact)==null?void 0:n.name)==null?void 0:s.trim())??"",f=((c=(a=(o=i==null?void 0:i.answer)==null?void 0:o.contact)==null?void 0:a.client)==null?void 0:c.name)==="Not Supplied"?"":((h=(A=(u=(l=i==null?void 0:i.answer)==null?void 0:l.contact)==null?void 0:u.client)==null?void 0:A.name)==null?void 0:h.trim())??"",[g,p]=d.split(" ");return{name:d,firstName:g,lastName:p,companyName:f}}function BC(i){var e,t;const r=(t=(e=i==null?void 0:i.answer)==null?void 0:e.contact)==null?void 0:t.roleTitle,n=r==null?void 0:r.split(" ");return{roleTitle:r,roleWords:n,firstRoleWord:n==null?void 0:n[0],remainingRoleWords:n==null?void 0:n.slice(1).join(" ")}}async function TC(i,e,t){var r,n,s;const o=(r=e==null?void 0:e.answer)==null?void 0:r.id;return((s=(n=i==null?void 0:i.questions)==null?void 0:n.items)==null?void 0:s.reduce((c,l)=>{var u;return((u=l==null?void 0:l.answer)==null?void 0:u.id)===o?(c??0)+1:c},0))<=1?o:`${o}-${t}`}async function Wl({data:i,rootData:e,index:t},r){var n,s,o,a,c,l,u,A,h,d,f,g,p,I,C,B,y,x,R,_,F,P,D,$,j;const ee=(n=e==null?void 0:e.answer)==null?void 0:n.metadata;(ee==null?void 0:ee.aspectRatio)!=null&&(ee.aspectRatio=IC(ee.aspectRatio));const[Z,k,O]=await Promise.all([TC(i,e,t),CC(e),vC({original:((o=(s=e==null?void 0:e.answer)==null?void 0:s.media)==null?void 0:o.captions)??((c=(a=e==null?void 0:e.answer)==null?void 0:a.captions)==null?void 0:c.current),translation:((u=(l=e==null?void 0:e.answer)==null?void 0:l.media)==null?void 0:u.translation)??((h=(A=e==null?void 0:e.answer)==null?void 0:A.captions)==null?void 0:h.translation),originalLanguage:(f=(d=e==null?void 0:e.answer)==null?void 0:d.transcription)==null?void 0:f.language,translationLanguage:(I=(p=(g=e==null?void 0:e.answer)==null?void 0:g.transcription)==null?void 0:p.translation)==null?void 0:I.language},r)]),V=Rd(e),L=BC(e);return{...k,...V,...L,key:Z,captions:O,wordTimings:yC((C=e==null?void 0:e.answer)==null?void 0:C.transcription),answerLabel:((B=e==null?void 0:e.answer)==null?void 0:B.label)??(e==null?void 0:e.title),prevAnswerLabel:t?((_=(R=(x=(y=i==null?void 0:i.questions)==null?void 0:y.items)==null?void 0:x[t-1])==null?void 0:R.answer)==null?void 0:_.label)??((D=(P=(F=i==null?void 0:i.questions)==null?void 0:F.items)==null?void 0:P[t-1])==null?void 0:D.title)??null:null,isFirstInstanceOfName:t?((j=($=i==null?void 0:i.questions)==null?void 0:$.items)==null?void 0:j.findIndex(Q=>Rd(Q).name===V.name))===t:!0}}const Po={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 bC({data:i}){var e,t;return((t=(e=i==null?void 0:i.questions)==null?void 0:e.items)==null?void 0:t.reduce((r,n)=>{var s,o,a,c,l,u,A;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=(A=(u=(l=(c=n==null?void 0:n.answer)==null?void 0:c.transcription)==null?void 0:l.translation)==null?void 0:u.language)==null?void 0:A.split("-")[0];return h&&Po[h]&&!r.find(f=>f.value===h)&&r.push({value:h,label:Po[h]}),d&&Po[d]&&!r.find(f=>f.value===d)&&r.push({value:d,label:Po[d]}),r},[]))??[]}/**
|
|
2464
2464
|
* @license
|
|
2465
2465
|
* Copyright 2018 Google LLC
|
|
@@ -2511,7 +2511,7 @@ Schedule: ${c.map(d=>mr(d))}`),u.length&&this.log(`Removed events ${u}`),this.pl
|
|
|
2511
2511
|
* @license
|
|
2512
2512
|
* Copyright 2017 Google LLC
|
|
2513
2513
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2514
|
-
*/const g0=(i,e,t)=>{const r=new Map;for(let n=e;n<=t;n++)r.set(i[n],n);return r},p0=rn(class extends Kn{constructor(i){if(super(i),i.type!==tn.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);const n=[],s=[];let o=0;for(const a of i)n[o]=r?r(a,o):o,s[o]=t(a,o),o++;return{values:s,keys:n}}render(i,e,t){return this.dt(i,e,t).values}update(i,[e,t,r]){const n=Hp(i),{values:s,keys:o}=this.dt(e,t,r);if(!Array.isArray(n))return this.ut=o,s;const a=this.ut??(this.ut=[]),c=[];let l,u,A=0,h=n.length-1,d=0,f=s.length-1;for(;A<=h&&d<=f;)if(n[A]===null)A++;else if(n[h]===null)h--;else if(a[A]===o[d])c[d]=Lr(n[A],s[d]),A++,d++;else if(a[h]===o[f])c[f]=Lr(n[h],s[f]),h--,f--;else if(a[A]===o[f])c[f]=Lr(n[A],s[f]),Vn(i,c[f+1],n[A]),A++,f--;else if(a[h]===o[d])c[d]=Lr(n[h],s[d]),Vn(i,n[A],n[h]),h--,d++;else if(l===void 0&&(l=g0(o,d,f),u=g0(a,A,h)),l.has(a[A]))if(l.has(a[h])){const g=u.get(o[d]),p=g!==void 0?n[g]:null;if(p===null){const I=Vn(i,n[A]);Lr(I,s[d]),c[d]=I}else c[d]=Lr(p,s[d]),Vn(i,n[A],p),n[g]=null;d++}else Ka(n[h]),h--;else Ka(n[A]),A++;for(;d<=f;){const g=Vn(i,c[f+1]);Lr(g,s[d]),c[d++]=g}for(;A<=h;){const g=n[A++];g!==null&&Ka(g)}return this.ut=o,Gp(i,c),fi}});var $t="top",li="bottom",ci="right",Yt="left",nA="auto",Bs=[$t,li,ci,Yt],En="start",Ts="end",mS="clippingParents",m0="viewport",bs="popper",ES="reference",E0=Bs.reduce(function(i,e){return i.concat([e+"-"+En,e+"-"+Ts])},[]),I0=[].concat(Bs,[nA]).reduce(function(i,e){return i.concat([e,e+"-"+En,e+"-"+Ts])},[]),IS="beforeRead",vS="read",yS="afterRead",CS="beforeMain",BS="main",TS="afterMain",bS="beforeWrite",SS="write",xS="afterWrite",wS=[IS,vS,yS,CS,BS,TS,bS,SS,xS];function Mi(i){return i?(i.nodeName||"").toLowerCase():null}function zt(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function Hr(i){var e=zt(i).Element;return i instanceof e||i instanceof Element}function Ai(i){var e=zt(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function sA(i){if(typeof ShadowRoot>"u")return!1;var e=zt(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function QS(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];!Ai(s)||!Mi(s)||(Object.assign(s.style,r),Object.keys(n).forEach(function(o){var a=n[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function RS(i){var e=i.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(r){var n=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),a=o.reduce(function(c,l){return c[l]="",c},{});!Ai(n)||!Mi(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(c){n.removeAttribute(c)}))})}}const v0={name:"applyStyles",enabled:!0,phase:"write",fn:QS,effect:RS,requires:["computeStyles"]};function Fi(i){return i.split("-")[0]}var $r=Math.max,Ea=Math.min,In=Math.round;function oA(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function y0(){return!/^((?!chrome|android).)*safari/i.test(oA())}function vn(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=i.getBoundingClientRect(),n=1,s=1;e&&Ai(i)&&(n=i.offsetWidth>0&&In(r.width)/i.offsetWidth||1,s=i.offsetHeight>0&&In(r.height)/i.offsetHeight||1);var o=Hr(i)?zt(i):window,a=o.visualViewport,c=!y0()&&t,l=(r.left+(c&&a?a.offsetLeft:0))/n,u=(r.top+(c&&a?a.offsetTop:0))/s,A=r.width/n,h=r.height/s;return{width:A,height:h,top:u,right:l+A,bottom:u+h,left:l,x:l,y:u}}function aA(i){var e=vn(i),t=i.offsetWidth,r=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:r}}function C0(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&sA(t)){var r=e;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Xi(i){return zt(i).getComputedStyle(i)}function _S(i){return["table","td","th"].indexOf(Mi(i))>=0}function Er(i){return((Hr(i)?i.ownerDocument:i.document)||window.document).documentElement}function Ia(i){return Mi(i)==="html"?i:i.assignedSlot||i.parentNode||(sA(i)?i.host:null)||Er(i)}function B0(i){return!Ai(i)||Xi(i).position==="fixed"?null:i.offsetParent}function DS(i){var e=/firefox/i.test(oA()),t=/Trident/i.test(oA());if(t&&Ai(i)){var r=Xi(i);if(r.position==="fixed")return null}var n=Ia(i);for(sA(n)&&(n=n.host);Ai(n)&&["html","body"].indexOf(Mi(n))<0;){var s=Xi(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 Ss(i){for(var e=zt(i),t=B0(i);t&&_S(t)&&Xi(t).position==="static";)t=B0(t);return t&&(Mi(t)==="html"||Mi(t)==="body"&&Xi(t).position==="static")?e:t||DS(i)||e}function lA(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function xs(i,e,t){return $r(i,Ea(e,t))}function LS(i,e,t){var r=xs(i,e,t);return r>t?t:r}function T0(){return{top:0,right:0,bottom:0,left:0}}function b0(i){return Object.assign({},T0(),i)}function S0(i,e){return e.reduce(function(t,r){return t[r]=i,t},{})}var kS=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,b0(typeof e!="number"?e:S0(e,Bs))};function MS(i){var e,t=i.state,r=i.name,n=i.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=Fi(t.placement),c=lA(a),l=[Yt,ci].indexOf(a)>=0,u=l?"height":"width";if(!(!s||!o)){var A=kS(n.padding,t),h=aA(s),d=c==="y"?$t:Yt,f=c==="y"?li:ci,g=t.rects.reference[u]+t.rects.reference[c]-o[c]-t.rects.popper[u],p=o[c]-t.rects.reference[c],I=Ss(s),C=I?c==="y"?I.clientHeight||0:I.clientWidth||0:0,B=g/2-p/2,y=A[d],x=C-h[u]-A[f],R=C/2-h[u]/2+B,_=xs(y,R,x),F=c;t.modifiersData[r]=(e={},e[F]=_,e.centerOffset=_-R,e)}}function FS(i){var e=i.state,t=i.options,r=t.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||C0(e.elements.popper,n)&&(e.elements.arrow=n))}const PS={name:"arrow",enabled:!0,phase:"main",fn:MS,effect:FS,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function yn(i){return i.split("-")[1]}var NS={top:"auto",right:"auto",bottom:"auto",left:"auto"};function OS(i,e){var t=i.x,r=i.y,n=e.devicePixelRatio||1;return{x:In(t*n)/n||0,y:In(r*n)/n||0}}function x0(i){var e,t=i.popper,r=i.popperRect,n=i.placement,s=i.variation,o=i.offsets,a=i.position,c=i.gpuAcceleration,l=i.adaptive,u=i.roundOffsets,A=i.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 I=o.hasOwnProperty("x"),C=o.hasOwnProperty("y"),B=Yt,y=$t,x=window;if(l){var R=Ss(t),_="clientHeight",F="clientWidth";if(R===zt(t)&&(R=Er(t),Xi(R).position!=="static"&&a==="absolute"&&(_="scrollHeight",F="scrollWidth")),R=R,n===$t||(n===Yt||n===ci)&&s===Ts){y=li;var P=A&&R===x&&x.visualViewport?x.visualViewport.height:R[_];g-=P-r.height,g*=c?1:-1}if(n===Yt||(n===$t||n===li)&&s===Ts){B=ci;var D=A&&R===x&&x.visualViewport?x.visualViewport.width:R[F];d-=D-r.width,d*=c?1:-1}}var $=Object.assign({position:a},l&&NS),j=u===!0?OS({x:d,y:g},zt(t)):{x:d,y:g};if(d=j.x,g=j.y,c){var ee;return Object.assign({},$,(ee={},ee[y]=C?"0":"",ee[B]=I?"0":"",ee.transform=(x.devicePixelRatio||1)<=1?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",ee))}return Object.assign({},$,(e={},e[y]=C?g+"px":"",e[B]=I?d+"px":"",e.transform="",e))}function US(i){var e=i.state,t=i.options,r=t.gpuAcceleration,n=r===void 0?!0:r,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,c=a===void 0?!0:a,l={placement:Fi(e.placement),variation:yn(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,x0(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,x0(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const GS={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:US,data:{}};var va={passive:!0};function HS(i){var e=i.state,t=i.instance,r=i.options,n=r.scroll,s=n===void 0?!0:n,o=r.resize,a=o===void 0?!0:o,c=zt(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&l.forEach(function(u){u.addEventListener("scroll",t.update,va)}),a&&c.addEventListener("resize",t.update,va),function(){s&&l.forEach(function(u){u.removeEventListener("scroll",t.update,va)}),a&&c.removeEventListener("resize",t.update,va)}}const $S={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:HS,data:{}};var YS={left:"right",right:"left",bottom:"top",top:"bottom"};function ya(i){return i.replace(/left|right|bottom|top/g,function(e){return YS[e]})}var VS={start:"end",end:"start"};function w0(i){return i.replace(/start|end/g,function(e){return VS[e]})}function cA(i){var e=zt(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function AA(i){return vn(Er(i)).left+cA(i).scrollLeft}function KS(i,e){var t=zt(i),r=Er(i),n=t.visualViewport,s=r.clientWidth,o=r.clientHeight,a=0,c=0;if(n){s=n.width,o=n.height;var l=y0();(l||!l&&e==="fixed")&&(a=n.offsetLeft,c=n.offsetTop)}return{width:s,height:o,x:a+AA(i),y:c}}function WS(i){var e,t=Er(i),r=cA(i),n=(e=i.ownerDocument)==null?void 0:e.body,s=$r(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=$r(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-r.scrollLeft+AA(i),c=-r.scrollTop;return Xi(n||t).direction==="rtl"&&(a+=$r(t.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:c}}function uA(i){var e=Xi(i),t=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+r)}function Q0(i){return["html","body","#document"].indexOf(Mi(i))>=0?i.ownerDocument.body:Ai(i)&&uA(i)?i:Q0(Ia(i))}function ws(i,e){var t;e===void 0&&(e=[]);var r=Q0(i),n=r===((t=i.ownerDocument)==null?void 0:t.body),s=zt(r),o=n?[s].concat(s.visualViewport||[],uA(r)?r:[]):r,a=e.concat(o);return n?a:a.concat(ws(Ia(o)))}function hA(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function jS(i,e){var t=vn(i,!1,e==="fixed");return t.top=t.top+i.clientTop,t.left=t.left+i.clientLeft,t.bottom=t.top+i.clientHeight,t.right=t.left+i.clientWidth,t.width=i.clientWidth,t.height=i.clientHeight,t.x=t.left,t.y=t.top,t}function R0(i,e,t){return e===m0?hA(KS(i,t)):Hr(e)?jS(e,t):hA(WS(Er(i)))}function JS(i){var e=ws(Ia(i)),t=["absolute","fixed"].indexOf(Xi(i).position)>=0,r=t&&Ai(i)?Ss(i):i;return Hr(r)?e.filter(function(n){return Hr(n)&&C0(n,r)&&Mi(n)!=="body"}):[]}function qS(i,e,t,r){var n=e==="clippingParents"?JS(i):[].concat(e),s=[].concat(n,[t]),o=s[0],a=s.reduce(function(c,l){var u=R0(i,l,r);return c.top=$r(u.top,c.top),c.right=Ea(u.right,c.right),c.bottom=Ea(u.bottom,c.bottom),c.left=$r(u.left,c.left),c},R0(i,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function _0(i){var e=i.reference,t=i.element,r=i.placement,n=r?Fi(r):null,s=r?yn(r):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,c;switch(n){case $t:c={x:o,y:e.y-t.height};break;case li:c={x:o,y:e.y+e.height};break;case ci:c={x:e.x+e.width,y:a};break;case Yt:c={x:e.x-t.width,y:a};break;default:c={x:e.x,y:e.y}}var l=n?lA(n):null;if(l!=null){var u=l==="y"?"height":"width";switch(s){case En:c[l]=c[l]-(e[u]/2-t[u]/2);break;case Ts:c[l]=c[l]+(e[u]/2-t[u]/2);break}}return c}function Qs(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=r===void 0?i.placement:r,s=t.strategy,o=s===void 0?i.strategy:s,a=t.boundary,c=a===void 0?mS:a,l=t.rootBoundary,u=l===void 0?m0:l,A=t.elementContext,h=A===void 0?bs:A,d=t.altBoundary,f=d===void 0?!1:d,g=t.padding,p=g===void 0?0:g,I=b0(typeof p!="number"?p:S0(p,Bs)),C=h===bs?ES:bs,B=i.rects.popper,y=i.elements[f?C:h],x=qS(Hr(y)?y:y.contextElement||Er(i.elements.popper),c,u,o),R=vn(i.elements.reference),_=_0({reference:R,element:B,strategy:"absolute",placement:n}),F=hA(Object.assign({},B,_)),P=h===bs?F:R,D={top:x.top-P.top+I.top,bottom:P.bottom-x.bottom+I.bottom,left:x.left-P.left+I.left,right:P.right-x.right+I.right},$=i.modifiersData.offset;if(h===bs&&$){var j=$[n];Object.keys(D).forEach(function(ee){var Z=[ci,li].indexOf(ee)>=0?1:-1,k=[$t,li].indexOf(ee)>=0?"y":"x";D[ee]+=j[k]*Z})}return D}function zS(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,c=t.allowedAutoPlacements,l=c===void 0?I0:c,u=yn(r),A=u?a?E0:E0.filter(function(f){return yn(f)===u}):Bs,h=A.filter(function(f){return l.indexOf(f)>=0});h.length===0&&(h=A);var d=h.reduce(function(f,g){return f[g]=Qs(i,{placement:g,boundary:n,rootBoundary:s,padding:o})[Fi(g)],f},{});return Object.keys(d).sort(function(f,g){return d[f]-d[g]})}function XS(i){if(Fi(i)===nA)return[];var e=ya(i);return[w0(i),e,w0(e)]}function ZS(i){var e=i.state,t=i.options,r=i.name;if(!e.modifiersData[r]._skip){for(var n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!0:o,c=t.fallbackPlacements,l=t.padding,u=t.boundary,A=t.rootBoundary,h=t.altBoundary,d=t.flipVariations,f=d===void 0?!0:d,g=t.allowedAutoPlacements,p=e.options.placement,I=Fi(p),C=I===p,B=c||(C||!f?[ya(p)]:XS(p)),y=[p].concat(B).reduce(function(ae,fe){return ae.concat(Fi(fe)===nA?zS(e,{placement:fe,boundary:u,rootBoundary:A,padding:l,flipVariations:f,allowedAutoPlacements:g}):fe)},[]),x=e.rects.reference,R=e.rects.popper,_=new Map,F=!0,P=y[0],D=0;D<y.length;D++){var $=y[D],j=Fi($),ee=yn($)===En,Z=[$t,li].indexOf(j)>=0,k=Z?"width":"height",O=Qs(e,{placement:$,boundary:u,rootBoundary:A,altBoundary:h,padding:l}),V=Z?ee?ci:Yt:ee?li:$t;x[k]>R[k]&&(V=ya(V));var L=ya(V),Q=[];if(s&&Q.push(O[j]<=0),a&&Q.push(O[V]<=0,O[L]<=0),Q.every(function(ae){return ae})){P=$,F=!1;break}_.set($,Q)}if(F)for(var M=f?3:1,W=function(fe){var Ee=y.find(function(Pe){var we=_.get(Pe);if(we)return we.slice(0,fe).every(function(Ne){return Ne})});if(Ee)return P=Ee,"break"},Y=M;Y>0;Y--){var ie=W(Y);if(ie==="break")break}e.placement!==P&&(e.modifiersData[r]._skip=!0,e.placement=P,e.reset=!0)}}const ex={name:"flip",enabled:!0,phase:"main",fn:ZS,requiresIfExists:["offset"],data:{_skip:!1}};function D0(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function L0(i){return[$t,ci,li,Yt].some(function(e){return i[e]>=0})}function tx(i){var e=i.state,t=i.name,r=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=Qs(e,{elementContext:"reference"}),a=Qs(e,{altBoundary:!0}),c=D0(o,r),l=D0(a,n,s),u=L0(c),A=L0(l);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:A},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":A})}const ix={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:tx};function rx(i,e,t){var r=Fi(i),n=[Yt,$t].indexOf(r)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[Yt,ci].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function nx(i){var e=i.state,t=i.options,r=i.name,n=t.offset,s=n===void 0?[0,0]:n,o=I0.reduce(function(u,A){return u[A]=rx(A,e.rects,s),u},{}),a=o[e.placement],c=a.x,l=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=l),e.modifiersData[r]=o}const sx={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:nx};function ox(i){var e=i.state,t=i.name;e.modifiersData[t]=_0({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const ax={name:"popperOffsets",enabled:!0,phase:"read",fn:ox,data:{}};function lx(i){return i==="x"?"y":"x"}function cx(i){var e=i.state,t=i.options,r=i.name,n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!1:o,c=t.boundary,l=t.rootBoundary,u=t.altBoundary,A=t.padding,h=t.tether,d=h===void 0?!0:h,f=t.tetherOffset,g=f===void 0?0:f,p=Qs(e,{boundary:c,rootBoundary:l,padding:A,altBoundary:u}),I=Fi(e.placement),C=yn(e.placement),B=!C,y=lA(I),x=lx(y),R=e.modifiersData.popperOffsets,_=e.rects.reference,F=e.rects.popper,P=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,D=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),$=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,j={x:0,y:0};if(R){if(s){var ee,Z=y==="y"?$t:Yt,k=y==="y"?li:ci,O=y==="y"?"height":"width",V=R[y],L=V+p[Z],Q=V-p[k],M=d?-F[O]/2:0,W=C===En?_[O]:F[O],Y=C===En?-F[O]:-_[O],ie=e.elements.arrow,ae=d&&ie?aA(ie):{width:0,height:0},fe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:T0(),Ee=fe[Z],Pe=fe[k],we=xs(0,_[O],ae[O]),Ne=B?_[O]/2-M-we-Ee-D.mainAxis:W-we-Ee-D.mainAxis,pe=B?-_[O]/2+M+we+Pe+D.mainAxis:Y+we+Pe+D.mainAxis,Me=e.elements.arrow&&Ss(e.elements.arrow),We=Me?y==="y"?Me.clientTop||0:Me.clientLeft||0:0,Oe=(ee=$==null?void 0:$[y])!=null?ee:0,Xe=V+Ne-Oe-We,De=V+pe-Oe,Re=xs(d?Ea(L,Xe):L,V,d?$r(Q,De):Q);R[y]=Re,j[y]=Re-V}if(a){var He,ue=y==="x"?$t:Yt,Le=y==="x"?li:ci,be=R[x],le=x==="y"?"height":"width",ge=be+p[ue],ve=be-p[Le],Te=[$t,Yt].indexOf(I)!==-1,Ce=(He=$==null?void 0:$[x])!=null?He:0,Ue=Te?ge:be-_[le]-F[le]-Ce+D.altAxis,T=Te?be+_[le]+F[le]-Ce-D.altAxis:ve,m=d&&Te?LS(Ue,be,T):xs(d?Ue:ge,be,d?T:ve);R[x]=m,j[x]=m-be}e.modifiersData[r]=j}}const Ax={name:"preventOverflow",enabled:!0,phase:"main",fn:cx,requiresIfExists:["offset"]};function ux(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function hx(i){return i===zt(i)||!Ai(i)?cA(i):ux(i)}function dx(i){var e=i.getBoundingClientRect(),t=In(e.width)/i.offsetWidth||1,r=In(e.height)/i.offsetHeight||1;return t!==1||r!==1}function fx(i,e,t){t===void 0&&(t=!1);var r=Ai(e),n=Ai(e)&&dx(e),s=Er(e),o=vn(i,n,t),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!t)&&((Mi(e)!=="body"||uA(s))&&(a=hx(e)),Ai(e)?(c=vn(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):s&&(c.x=AA(s))),{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function gx(i){var e=new Map,t=new Set,r=[];i.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 c=e.get(a);c&&n(c)}}),r.push(s)}return i.forEach(function(s){t.has(s.name)||n(s)}),r}function px(i){var e=gx(i);return wS.reduce(function(t,r){return t.concat(e.filter(function(n){return n.phase===r}))},[])}function mx(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function Ex(i){var e=i.reduce(function(t,r){var n=t[r.name];return t[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var k0={placement:"bottom",modifiers:[],strategy:"absolute"};function M0(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function Ix(i){i===void 0&&(i={});var e=i,t=e.defaultModifiers,r=t===void 0?[]:t,n=e.defaultOptions,s=n===void 0?k0:n;return function(a,c,l){l===void 0&&(l=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},k0,s),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},A=[],h=!1,d={state:u,setOptions:function(I){var C=typeof I=="function"?I(u.options):I;g(),u.options=Object.assign({},s,u.options,C),u.scrollParents={reference:Hr(a)?ws(a):a.contextElement?ws(a.contextElement):[],popper:ws(c)};var B=px(Ex([].concat(r,u.options.modifiers)));return u.orderedModifiers=B.filter(function(y){return y.enabled}),f(),d.update()},forceUpdate:function(){if(!h){var I=u.elements,C=I.reference,B=I.popper;if(M0(C,B)){u.rects={reference:fx(C,Ss(B),u.options.strategy==="fixed"),popper:aA(B)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(D){return u.modifiersData[D.name]=Object.assign({},D.data)});for(var y=0;y<u.orderedModifiers.length;y++){if(u.reset===!0){u.reset=!1,y=-1;continue}var x=u.orderedModifiers[y],R=x.fn,_=x.options,F=_===void 0?{}:_,P=x.name;typeof R=="function"&&(u=R({state:u,options:F,name:P,instance:d})||u)}}}},update:mx(function(){return new Promise(function(p){d.forceUpdate(),p(u)})}),destroy:function(){g(),h=!0}};if(!M0(a,c))return d;d.setOptions(l).then(function(p){!h&&l.onFirstUpdate&&l.onFirstUpdate(p)});function f(){u.orderedModifiers.forEach(function(p){var I=p.name,C=p.options,B=C===void 0?{}:C,y=p.effect;if(typeof y=="function"){var x=y({state:u,name:I,instance:d,options:B}),R=function(){};A.push(x||R)}})}function g(){A.forEach(function(p){return p()}),A=[]}return d}}var vx=[$S,ax,GS,v0,sx,ex,Ax,PS,ix],yx=Ix({defaultModifiers:vx}),Cx="tippy-box",F0="tippy-content",Bx="tippy-backdrop",P0="tippy-arrow",N0="tippy-svg-arrow",Yr={passive:!0,capture:!0},O0=function(){return document.body};function dA(i,e,t){if(Array.isArray(i)){var r=i[e];return r??(Array.isArray(t)?t[e]:t)}return i}function fA(i,e){var t={}.toString.call(i);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function U0(i,e){return typeof i=="function"?i.apply(void 0,e):i}function G0(i,e){if(e===0)return i;var t;return function(r){clearTimeout(t),t=setTimeout(function(){i(r)},e)}}function Tx(i){return i.split(/\s+/).filter(Boolean)}function Cn(i){return[].concat(i)}function H0(i,e){i.indexOf(e)===-1&&i.push(e)}function bx(i){return i.filter(function(e,t){return i.indexOf(e)===t})}function Sx(i){return i.split("-")[0]}function Ca(i){return[].slice.call(i)}function $0(i){return Object.keys(i).reduce(function(e,t){return i[t]!==void 0&&(e[t]=i[t]),e},{})}function Rs(){return document.createElement("div")}function Ba(i){return["Element","Fragment"].some(function(e){return fA(i,e)})}function xx(i){return fA(i,"NodeList")}function wx(i){return fA(i,"MouseEvent")}function Qx(i){return!!(i&&i._tippy&&i._tippy.reference===i)}function Rx(i){return Ba(i)?[i]:xx(i)?Ca(i):Array.isArray(i)?i:Ca(document.querySelectorAll(i))}function gA(i,e){i.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function Y0(i,e){i.forEach(function(t){t&&t.setAttribute("data-state",e)})}function _x(i){var e,t=Cn(i),r=t[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function Dx(i,e){var t=e.clientX,r=e.clientY;return i.every(function(n){var s=n.popperRect,o=n.popperState,a=n.props,c=a.interactiveBorder,l=Sx(o.placement),u=o.modifiersData.offset;if(!u)return!0;var A=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-r+A>c,p=r-s.bottom-h>c,I=s.left-t+d>c,C=t-s.right-f>c;return g||p||I||C})}function pA(i,e,t){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){i[r](n,t)})}function V0(i,e){for(var t=e;t;){var r;if(i.contains(t))return!0;t=t.getRootNode==null||(r=t.getRootNode())==null?void 0:r.host}return!1}var Pi={isTouch:!1},K0=0;function Lx(){Pi.isTouch||(Pi.isTouch=!0,window.performance&&document.addEventListener("mousemove",W0))}function W0(){var i=performance.now();i-K0<20&&(Pi.isTouch=!1,document.removeEventListener("mousemove",W0)),K0=i}function kx(){var i=document.activeElement;if(Qx(i)){var e=i._tippy;i.blur&&!e.state.isVisible&&i.blur()}}function Mx(){document.addEventListener("touchstart",Lx,Yr),window.addEventListener("blur",kx)}var Fx=typeof window<"u"&&typeof document<"u",Px=Fx?!!window.msCrypto:!1,Nx={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Ox={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ei=Object.assign({appendTo:O0,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},Nx,Ox),Ux=Object.keys(Ei),Gx=function(e){var t=Object.keys(e);t.forEach(function(r){Ei[r]=e[r]})};function j0(i){var e=i.plugins||[],t=e.reduce(function(r,n){var s=n.name,o=n.defaultValue;if(s){var a;r[s]=i[s]!==void 0?i[s]:(a=Ei[s])!=null?a:o}return r},{});return Object.assign({},i,t)}function Hx(i,e){var t=e?Object.keys(j0(Object.assign({},Ei,{plugins:e}))):Ux,r=t.reduce(function(n,s){var o=(i.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 r}function J0(i,e){var t=Object.assign({},e,{content:U0(e.content,[i])},e.ignoreAttributes?{}:Hx(i,e.plugins));return t.aria=Object.assign({},Ei.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 $x=function(){return"innerHTML"};function mA(i,e){i[$x()]=e}function q0(i){var e=Rs();return i===!0?e.className=P0:(e.className=N0,Ba(i)?e.appendChild(i):mA(e,i)),e}function z0(i,e){Ba(e.content)?(mA(i,""),i.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?mA(i,e.content):i.textContent=e.content)}function EA(i){var e=i.firstElementChild,t=Ca(e.children);return{box:e,content:t.find(function(r){return r.classList.contains(F0)}),arrow:t.find(function(r){return r.classList.contains(P0)||r.classList.contains(N0)}),backdrop:t.find(function(r){return r.classList.contains(Bx)})}}function X0(i){var e=Rs(),t=Rs();t.className=Cx,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var r=Rs();r.className=F0,r.setAttribute("data-state","hidden"),z0(r,i.props),e.appendChild(t),t.appendChild(r),n(i.props,i.props);function n(s,o){var a=EA(e),c=a.box,l=a.content,u=a.arrow;o.theme?c.setAttribute("data-theme",o.theme):c.removeAttribute("data-theme"),typeof o.animation=="string"?c.setAttribute("data-animation",o.animation):c.removeAttribute("data-animation"),o.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?c.setAttribute("role",o.role):c.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&z0(l,i.props),o.arrow?u?s.arrow!==o.arrow&&(c.removeChild(u),c.appendChild(q0(o.arrow))):c.appendChild(q0(o.arrow)):u&&c.removeChild(u)}return{popper:e,onUpdate:n}}X0.$$tippy=!0;var Yx=1,Ta=[],IA=[];function Vx(i,e){var t=J0(i,Object.assign({},Ei,j0($0(e)))),r,n,s,o=!1,a=!1,c=!1,l=!1,u,A,h,d=[],f=G0(Xe,t.interactiveDebounce),g,p=Yx++,I=null,C=bx(t.plugins),B={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:p,reference:i,popper:Rs(),popperInstance:I,props:t,state:B,plugins:C,clearDelayTimeouts:Ue,setProps:T,setContent:m,show:E,hide:w,hideWithInteractivity:U,enable:Te,disable:Ce,unmount:J,destroy:X};if(!t.render)return y;var x=t.render(y),R=x.popper,_=x.onUpdate;R.setAttribute("data-tippy-root",""),R.id="tippy-"+y.id,y.popper=R,i._tippy=y,R._tippy=y;var F=C.map(function(G){return G.fn(y)}),P=i.hasAttribute("aria-expanded");return Me(),M(),V(),L("onCreate",[y]),t.showOnCreate&&ge(),R.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),R.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&Z().addEventListener("mousemove",f)}),y;function D(){var G=y.props.touch;return Array.isArray(G)?G:[G,0]}function $(){return D()[0]==="hold"}function j(){var G;return!!((G=y.props.render)!=null&&G.$$tippy)}function ee(){return g||i}function Z(){var G=ee().parentNode;return G?_x(G):document}function k(){return EA(R)}function O(G){return y.state.isMounted&&!y.state.isVisible||Pi.isTouch||u&&u.type==="focus"?0:dA(y.props.delay,G?0:1,Ei.delay)}function V(G){G===void 0&&(G=!1),R.style.pointerEvents=y.props.interactive&&!G?"":"none",R.style.zIndex=""+y.props.zIndex}function L(G,se,he){if(he===void 0&&(he=!0),F.forEach(function(ye){ye[G]&&ye[G].apply(ye,se)}),he){var Be;(Be=y.props)[G].apply(Be,se)}}function Q(){var G=y.props.aria;if(G.content){var se="aria-"+G.content,he=R.id,Be=Cn(y.props.triggerTarget||i);Be.forEach(function(ye){var $e=ye.getAttribute(se);if(y.state.isVisible)ye.setAttribute(se,$e?$e+" "+he:he);else{var ze=$e&&$e.replace(he,"").trim();ze?ye.setAttribute(se,ze):ye.removeAttribute(se)}})}}function M(){if(!(P||!y.props.aria.expanded)){var G=Cn(y.props.triggerTarget||i);G.forEach(function(se){y.props.interactive?se.setAttribute("aria-expanded",y.state.isVisible&&se===ee()?"true":"false"):se.removeAttribute("aria-expanded")})}}function W(){Z().removeEventListener("mousemove",f),Ta=Ta.filter(function(G){return G!==f})}function Y(G){if(!(Pi.isTouch&&(c||G.type==="mousedown"))){var se=G.composedPath&&G.composedPath()[0]||G.target;if(!(y.props.interactive&&V0(R,se))){if(Cn(y.props.triggerTarget||i).some(function(he){return V0(he,se)})){if(Pi.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else L("onClickOutside",[y,G]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),a=!0,setTimeout(function(){a=!1}),y.state.isMounted||Ee())}}}function ie(){c=!0}function ae(){c=!1}function fe(){var G=Z();G.addEventListener("mousedown",Y,!0),G.addEventListener("touchend",Y,Yr),G.addEventListener("touchstart",ae,Yr),G.addEventListener("touchmove",ie,Yr)}function Ee(){var G=Z();G.removeEventListener("mousedown",Y,!0),G.removeEventListener("touchend",Y,Yr),G.removeEventListener("touchstart",ae,Yr),G.removeEventListener("touchmove",ie,Yr)}function Pe(G,se){Ne(G,function(){!y.state.isVisible&&R.parentNode&&R.parentNode.contains(R)&&se()})}function we(G,se){Ne(G,se)}function Ne(G,se){var he=k().box;function Be(ye){ye.target===he&&(pA(he,"remove",Be),se())}if(G===0)return se();pA(he,"remove",A),pA(he,"add",Be),A=Be}function pe(G,se,he){he===void 0&&(he=!1);var Be=Cn(y.props.triggerTarget||i);Be.forEach(function(ye){ye.addEventListener(G,se,he),d.push({node:ye,eventType:G,handler:se,options:he})})}function Me(){$()&&(pe("touchstart",Oe,{passive:!0}),pe("touchend",De,{passive:!0})),Tx(y.props.trigger).forEach(function(G){if(G!=="manual")switch(pe(G,Oe),G){case"mouseenter":pe("mouseleave",De);break;case"focus":pe(Px?"focusout":"blur",Re);break;case"focusin":pe("focusout",Re);break}})}function We(){d.forEach(function(G){var se=G.node,he=G.eventType,Be=G.handler,ye=G.options;se.removeEventListener(he,Be,ye)}),d=[]}function Oe(G){var se,he=!1;if(!(!y.state.isEnabled||He(G)||a)){var Be=((se=u)==null?void 0:se.type)==="focus";u=G,g=G.currentTarget,M(),!y.state.isVisible&&wx(G)&&Ta.forEach(function(ye){return ye(G)}),G.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||o)&&y.props.hideOnClick!==!1&&y.state.isVisible?he=!0:ge(G),G.type==="click"&&(o=!he),he&&!Be&&ve(G)}}function Xe(G){var se=G.target,he=ee().contains(se)||R.contains(se);if(!(G.type==="mousemove"&&he)){var Be=le().concat(R).map(function(ye){var $e,ze=ye._tippy,Bt=($e=ze.popperInstance)==null?void 0:$e.state;return Bt?{popperRect:ye.getBoundingClientRect(),popperState:Bt,props:t}:null}).filter(Boolean);Dx(Be,G)&&(W(),ve(G))}}function De(G){var se=He(G)||y.props.trigger.indexOf("click")>=0&&o;if(!se){if(y.props.interactive){y.hideWithInteractivity(G);return}ve(G)}}function Re(G){y.props.trigger.indexOf("focusin")<0&&G.target!==ee()||y.props.interactive&&G.relatedTarget&&R.contains(G.relatedTarget)||ve(G)}function He(G){return Pi.isTouch?$()!==G.type.indexOf("touch")>=0:!1}function ue(){Le();var G=y.props,se=G.popperOptions,he=G.placement,Be=G.offset,ye=G.getReferenceClientRect,$e=G.moveTransition,ze=j()?EA(R).arrow:null,Bt=ye?{getBoundingClientRect:ye,contextElement:ye.contextElement||ee()}:i,Zi={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Zt){var bt=Zt.state;if(j()){var ei=k(),er=ei.box;["placement","reference-hidden","escaped"].forEach(function(tr){tr==="placement"?er.setAttribute("data-placement",bt.placement):bt.attributes.popper["data-popper-"+tr]?er.setAttribute("data-"+tr,""):er.removeAttribute("data-"+tr)}),bt.attributes.popper={}}}},Tt=[{name:"offset",options:{offset:Be}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!$e}},Zi];j()&&ze&&Tt.push({name:"arrow",options:{element:ze,padding:3}}),Tt.push.apply(Tt,(se==null?void 0:se.modifiers)||[]),y.popperInstance=yx(Bt,R,Object.assign({},se,{placement:he,onFirstUpdate:h,modifiers:Tt}))}function Le(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function be(){var G=y.props.appendTo,se,he=ee();y.props.interactive&&G===O0||G==="parent"?se=he.parentNode:se=U0(G,[he]),se.contains(R)||se.appendChild(R),y.state.isMounted=!0,ue()}function le(){return Ca(R.querySelectorAll("[data-tippy-root]"))}function ge(G){y.clearDelayTimeouts(),G&&L("onTrigger",[y,G]),fe();var se=O(!0),he=D(),Be=he[0],ye=he[1];Pi.isTouch&&Be==="hold"&&ye&&(se=ye),se?r=setTimeout(function(){y.show()},se):y.show()}function ve(G){if(y.clearDelayTimeouts(),L("onUntrigger",[y,G]),!y.state.isVisible){Ee();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(G.type)>=0&&o)){var se=O(!1);se?n=setTimeout(function(){y.state.isVisible&&y.hide()},se):s=requestAnimationFrame(function(){y.hide()})}}function Te(){y.state.isEnabled=!0}function Ce(){y.hide(),y.state.isEnabled=!1}function Ue(){clearTimeout(r),clearTimeout(n),cancelAnimationFrame(s)}function T(G){if(!y.state.isDestroyed){L("onBeforeUpdate",[y,G]),We();var se=y.props,he=J0(i,Object.assign({},se,$0(G),{ignoreAttributes:!0}));y.props=he,Me(),se.interactiveDebounce!==he.interactiveDebounce&&(W(),f=G0(Xe,he.interactiveDebounce)),se.triggerTarget&&!he.triggerTarget?Cn(se.triggerTarget).forEach(function(Be){Be.removeAttribute("aria-expanded")}):he.triggerTarget&&i.removeAttribute("aria-expanded"),M(),V(),_&&_(se,he),y.popperInstance&&(ue(),le().forEach(function(Be){requestAnimationFrame(Be._tippy.popperInstance.forceUpdate)})),L("onAfterUpdate",[y,G])}}function m(G){y.setProps({content:G})}function E(){var G=y.state.isVisible,se=y.state.isDestroyed,he=!y.state.isEnabled,Be=Pi.isTouch&&!y.props.touch,ye=dA(y.props.duration,0,Ei.duration);if(!(G||se||he||Be)&&!ee().hasAttribute("disabled")&&(L("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,j()&&(R.style.visibility="visible"),V(),fe(),y.state.isMounted||(R.style.transition="none"),j()){var $e=k(),ze=$e.box,Bt=$e.content;gA([ze,Bt],0)}h=function(){var Tt;if(!(!y.state.isVisible||l)){if(l=!0,R.offsetHeight,R.style.transition=y.props.moveTransition,j()&&y.props.animation){var Ii=k(),Zt=Ii.box,bt=Ii.content;gA([Zt,bt],ye),Y0([Zt,bt],"visible")}Q(),M(),H0(IA,y),(Tt=y.popperInstance)==null||Tt.forceUpdate(),L("onMount",[y]),y.props.animation&&j()&&we(ye,function(){y.state.isShown=!0,L("onShown",[y])})}},be()}}function w(){var G=!y.state.isVisible,se=y.state.isDestroyed,he=!y.state.isEnabled,Be=dA(y.props.duration,1,Ei.duration);if(!(G||se||he)&&(L("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,l=!1,o=!1,j()&&(R.style.visibility="hidden"),W(),Ee(),V(!0),j()){var ye=k(),$e=ye.box,ze=ye.content;y.props.animation&&(gA([$e,ze],Be),Y0([$e,ze],"hidden"))}Q(),M(),y.props.animation?j()&&Pe(Be,y.unmount):y.unmount()}}function U(G){Z().addEventListener("mousemove",f),H0(Ta,f),f(G)}function J(){y.state.isVisible&&y.hide(),y.state.isMounted&&(Le(),le().forEach(function(G){G._tippy.unmount()}),R.parentNode&&R.parentNode.removeChild(R),IA=IA.filter(function(G){return G!==y}),y.state.isMounted=!1,L("onHidden",[y]))}function X(){y.state.isDestroyed||(y.clearDelayTimeouts(),y.unmount(),We(),delete i._tippy,y.state.isDestroyed=!0,L("onDestroy",[y]))}}function Vr(i,e){e===void 0&&(e={});var t=Ei.plugins.concat(e.plugins||[]);Mx();var r=Object.assign({},e,{plugins:t}),n=Rx(i),s=n.reduce(function(o,a){var c=a&&Vx(a,r);return c&&o.push(c),o},[]);return Ba(i)?s[0]:s}Vr.defaultProps=Ei,Vr.setDefaultProps=Gx,Vr.currentInput=Pi,Object.assign({},v0,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}}),Vr.setDefaultProps({render:X0});function Vt(i,e){return`${i}-${e}`}function Ni(i){var e,t;const r=[];return(((e=i.renderer)==null?void 0:e.type)==="video"||((t=i.renderer)==null?void 0:t.type)==="audio")&&r.push({...i.config,...i.options}),r.push(...i.childNodes.flatMap(Ni).filter(Boolean)),r}class ba extends Error{constructor(e,t=new Error,r=!1){super(),this.fatal=!1,this.fatal=r,this.stack=t.stack,this.message=[e,t.message].filter(Boolean).join(" - ")}}function Ir(i,e,t){return Math.min(Math.max(e,i),t)}const Kx=5;function Wx(i,e){return i.length!==e.length||i.some((t,r)=>t!==e[r])}class jx{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._canvas=_t(),this._controls=_t(),this._drawAbort=null,this.host=e}set activeScenes(e){Wx(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,r,n;const s=Ir(0,e,this.host.duration);this.activeScenes=((t=this.host.composition)==null?void 0:t.tracks.reduce((a,c)=>a.concat(c.scenes.filter(({start:l,duration:u})=>s>=l&&s<l+u)),[]))??[];const o=s!==this.currentTime;this._currentTime=s,this._upcomingScenes=((r=this.host.composition)==null?void 0:r.tracks.reduce((a,c)=>a.concat(c.scenes.filter(({start:l})=>s>=l-Kx&&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 Dt(this._canvas)}controls(){return Dt(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{Ni(e.layout.node).forEach(({key:r})=>{var n,s,o;const{id:a,start:c,duration:l}=e,u=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused,A=Vt(a,r);if(this.host.media[A]){const h=this.host.media[A],{speed:d,volume:f,hls:g,node:p,start:I,duration:C}=h,B=this.host.mediaState[A];p&&B&&(p.currentTime>=I+C||p.ended||u&&(g?(n=g.startLoadOnce)==null||n.call(g,I):B.initialised||(s=p.startLoadOnce)==null||s.call(p),p.volume=Ir(0,this.host.volume*(f??1),1),p.playbackRate=Ir(.1,this.host.playbackRate*(d??1),4)))}else if(u){const h=`${c}-${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,c/this.host.duration*100),end:Math.min((c+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(r=>Ni(r.layout.node).map(async({key:s})=>{const o=Vt(r.id,s);if(this.host.media[o]){const a=this.host.media[o],{node:c}=a,l=this.host.mediaState[o];if(!this.activeScenes.includes(r))c.paused||c.pause();else if(l&&!this.host.waiting&&!this.host.loading&&!this.host.paused&&c.paused&&!c.ended&&l.initialised)try{await c.play()}catch(A){throw new ba("Video play error",A,!0)}}}))))??[])}draw(e=this.currentTime,t){var r;(r=this._drawAbort)==null||r.abort(),this._drawAbort=new AbortController,this.host.composition&&this._canvas.value&&this.host.composition.draw({currentTime:e,canvas:this._canvas.value,overrides:t,signal:this._drawAbort.signal})}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 Jx=Ti(async i=>{const e=await fetch(i);if(!e.ok)throw new Error(`Failed to fetch font (${e.status}): ${i}`);return e.arrayBuffer()}),Z0=Ti(async(i,e,t)=>new FontFace(i,await Jx(t),{weight:e,style:"normal"}).load(),{cacheKey:([i,e,t])=>`${i}|${e}|${t}`}),qx=Ti(async function(e){const{weight:t,family:r}=e,{client:n,server:s}=r.weights.find(a=>a.weight===t)??{},o=n??s;return o?Z0(r.name,t,o):null},{cacheKey:([i])=>{const{client:e,server:t}=i.family.weights.find(r=>r.weight===i.weight)??{};return`${i.family.name}|${i.weight}|${e??t??""}`}});Ti(async function(e){return(await Promise.all(e.weights.map(async({weight:r,client:n,server:s})=>{const o=n??s;if(!o)return null;const a=Array.from(document.fonts).find(l=>l.family===e.name&&l.weight===r);if(a)return a;const c=await Z0(e.name,r,o);return document.fonts.add(c),c}))).filter(r=>r!==null)},{cacheKey:([i])=>JSON.stringify(i)});const zx=Ti(async({options:i})=>{const e=await qx(i.font);return e&&document.fonts.add(e),{font:i.font}}),Xx=Ti(async({config:i})=>i.src?new Promise((e,t)=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{e({image:r})},r.onerror=n=>{t(n)},r.src=i.src}):{image:null},{cacheKey:([{config:i}])=>JSON.stringify(i)});async function vA(i){return i.duration===1/0?new Promise(e=>{i.currentTime=Number.MAX_SAFE_INTEGER,i.ontimeupdate=()=>{i.ontimeupdate=null,e(i.duration),i.currentTime=0}}):i.duration}function ep(i,e){if(i.type==="video"&&i.alpha)return(e?i.alpha.mov:i.alpha.webm)||void 0}function Zx(i,e){return ep(i,e)??i.src}function yA(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function ew(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function tw({config:i,elementSize:e}){return new Promise(async t=>{let r=null;const{type:n,key:s,duration:o}=i,a=Zx(i,yA());n==="video"?(r=document.createElement("video"),r.playsInline=!0,e&&(r.width=e.width,r.height=e.height)):r=document.createElement("audio"),r.muted=!0,r.loop=!1,r.crossOrigin="anonymous",r.src=a;let c=!1;if(r.startLoadOnce=()=>{c||(r.preload="auto",r.load(),c=!0)},n==="video"&&o&&i.aspectRatio)r.preload="none",t({key:s,hls:null,node:r,aspectRatio:i.aspectRatio,totalDuration:o});else{r.preload="metadata";const l=async()=>{const u=await vA(r),A=r instanceof HTMLVideoElement&&r.videoHeight>0?r.videoWidth/r.videoHeight:null;t({key:s,hls:null,node:r,totalDuration:u,aspectRatio:A}),r.removeEventListener("loadedmetadata",l)};r.addEventListener("loadedmetadata",l)}})}function iw({key:i,playlist:e,duration:t,elementSize:r}){return new Promise(n=>{const s=document.createElement("video");s instanceof HTMLVideoElement&&(r&&(s.width=r.width,s.height=r.height),s.playsInline=!0),s.muted=!0,s.loop=!1,s.crossOrigin="anonymous";let o=!1,a=!1,c=!1;const l=new ai({autoStartLoad:!0,capLevelToPlayerSize:!1,xhrSetup:u=>{const{open:A}=u,h=e.split("?")[1];u.open=function(d,f,g){if(h&&!f.toString().includes("?")&&(f+="?"+h),!o&&f.toString().includes(".ts")){if(a)return;a=!0}A.apply(this,[d,f,g])}}});l.on(ai.Events.BUFFER_CODECS,async(u,A)=>{var h,d;if(c)return;const f=A.video,g=(h=f==null?void 0:f.metadata)==null?void 0:h.width,p=(d=f==null?void 0:f.metadata)==null?void 0:d.height;if(g&&p){c=!0,o||l==null||l.stopLoad();const I=t??await vA(s);n({key:i,hls:l,node:s,aspectRatio:g/p,totalDuration:I})}}),l.on(ai.Events.LEVEL_LOADED,async()=>{setTimeout(async()=>{if(c)return;c=!0,o||l==null||l.stopLoad();const u=t??await vA(s),A=l.levels[l.levels.length-1];n({key:i,hls:l,node:s,aspectRatio:A.width/A.height,totalDuration:u})},2e3)}),r&&l.on(ai.Events.MANIFEST_PARSED,()=>{const u=window.devicePixelRatio||1,A=Math.min(r.width,r.height)*u;let h=0;for(let d=l.levels.length-1;d>=0;d--)if(Math.min(l.levels[d].width,l.levels[d].height)<=A){h=d;break}l.autoLevelCapping=h}),l.loadSource(e),l.attachMedia(s),l.startLoadOnce=(u=-1,A)=>{if(l&&!o){const h=l.levels.findIndex(d=>Math.min(d.height,d.width)===A);o=!0,l.startLoad(u),h!==-1&&(l.currentLevel=h)}}})}function rw({config:i,elementSize:e}){const{playlist:t}=i;return!ep(i,yA())&&t&&!yA()&&ai.isSupported()?iw({key:i.key,playlist:t,duration:i.duration??0,elementSize:e}):tw({config:i,elementSize:e})}let nw=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 r=new AbortController,n=setTimeout(()=>{r.signal.aborted||(this.host._processing=!0)},t);return r.signal.addEventListener("abort",()=>{clearTimeout(n)}),r},this._mediaFactory=Ti(async(t,r)=>{var n,s,o,a;const{key:c}=r,l=((s=(n=this.host.shadowRoot)==null?void 0:n.host)==null?void 0:s.clientWidth)??0,u=((a=(o=this.host.shadowRoot)==null?void 0:o.host)==null?void 0:a.clientHeight)??0,A=await rw({config:r,elementSize:{width:l,height:u}}),h={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},d=Object.keys(h).reduce((f,g)=>{const p=g,I=h[p]({id:t,key:c,node:A.node});return f[p]=I,A.node.addEventListener(g,I),f},{});return{media:A,listeners:d,aspectRatio:A.aspectRatio,source:()=>A.node}},{cacheKey:([t,{key:r,src:n,playlist:s,...o}])=>{const a="alpha"in o&&o.alpha?{webm:o.alpha.webm.split("?")[0],mov:o.alpha.mov.split("?")[0]}:void 0;return JSON.stringify({id:t,key:r,src:n==null?void 0:n.split("?")[0],playlist:s==null?void 0:s.split("?")[0],alpha:a})}}),this._handleLoadedData=({id:t,key:r,node:n})=>()=>{const s=Vt(t,r),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:r,node:n}})))},this._handleWaiting=({id:t,key:r,node:n})=>()=>{const s=Vt(t,r),o=this.mediaState[s];o!=null&&o.initialised&&!(o!=null&&o.waiting)&&(this.mediaState={...this.mediaState,[s]:{...o,waiting:!0}},this.host.dispatchEvent(new CustomEvent("video:waiting",{detail:{id:t,key:r,node:n}})))},this._handleCanPlay=({id:t,key:r})=>()=>{const n=Vt(t,r),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:r,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:seeking",{detail:{id:t,key:r,node:n}}))},this._handleSeeked=({id:t,key:r,node:n})=>()=>{const s=Vt(t,r),o=this.mediaState[s];o!=null&&o.initialised&&(this.host.draw(),this.host.activeScenes.flatMap(a=>Ni(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:r,node:n}})))},this._handlePlay=({id:t,key:r,node:n})=>()=>{this.hasPlayed=!0,this.host.dispatchEvent(new CustomEvent("video:play",{detail:{id:t,key:r,node:n}}))},this._handlePlaying=({id:t,key:r,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:playing",{detail:{id:t,key:r,node:n}}))},this._handlePause=({id:t,key:r,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:pause",{detail:{id:t,key:r,node:n}}))},this._handleStalled=({id:t,key:r,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:stalled",{detail:{id:t,key:r,node:n}}))},this._handleTimeUpdate=({id:t,key:r,node:n})=>()=>{const s=this.media[Vt(t,r)];s!=null&&s.loop&&s.duration>0&&n.currentTime>=s.start+s.duration&&(n.currentTime=s.start,n.paused||n.play()),this.host.dispatchEvent(new CustomEvent("video:timeupdate",{detail:{id:t,key:r,node:n}}))},this._handleEnded=({id:t,key:r,node:n})=>()=>{const s=this.media[Vt(t,r)];if(s!=null&&s.loop){n.currentTime=s.start,this.host.paused||n.play();return}this.host.dispatchEvent(new CustomEvent("video:ended",{detail:{id:t,key:r,node:n}}))},this._handleError=({id:t,key:r,node:n})=>()=>{const s=new ba(`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:r,node:n}}))},this._cleanupMedia=t=>{var r;const n=this.media[t];n&&(n.node.pause(),n.node.src="",(r=n.hls)==null||r.destroy(),Object.keys(n.listeners??{}).forEach(s=>{var o,a;if((o=this.media)!=null&&o[t]){const c=(a=n.listeners)==null?void 0:a[s];c&&n.node.removeEventListener(s,c)}}),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 ro(this.host,async([e,t,r,n])=>{var s,o;this._compositionController.abort(),this._compositionController=new AbortController;const a=this._compositionController,c=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:r,resolution:1080});try{(o=this.composition)==null||o.cleanup();const f=await xd({debug:n,config:e,resolvers:{text:zx,image:Xx,video:async({id:g,config:p,options:I})=>{const{media:C,source:B}=await this._mediaFactory(g,{...p,...I});return{video:B,aspectRatio:C.aspectRatio}}},rootWidth:l,rootHeight:u});if(a.signal.aborted)return;this.composition=f}catch(f){throw new ba("Fatal composition error",f,!0)}this.duration=this.composition.duration;const A={...this.media},h={...this.mediaState},d=[];for(const f of this.composition.tracks)for(const g of f.scenes){const p=Ni(g.layout.node);for(const I of p){const{media:C,listeners:B}=await this._mediaFactory(g.id,I),y=Vt(g.id,C.key);d.push(y);const x=(I.startOffset??0)*C.totalDuration,R=(1-(I.endOffset??0))*C.totalDuration;A[y]={...C,listeners:B,start:x,duration:R-x,speed:I.speed??1,volume:I.volume??1,loop:I.loop??!1},h[y]={initialised:!C,waiting:!!C,...this.mediaState[y]}}}this.media=A,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{c.abort(),this.host._processing=!1}},()=>[this.host.config,this.host.language,this.host.aspectRatio,this.host.debug])}_setMediaCurrentTime({time:e,scene:t}){const{id:r,layout:n,start:s}=t;Ni(n.node).forEach(({key:a})=>{const c=Vt(r,a);if(this.media[c]){const l=this.media[c],u=(e-s)*l.speed,A=l.loop&&l.duration>0?u%l.duration:u;l.node.currentTime=Ir(l.start,A+l.start,l.start+l.duration)}})}setMediaCurrentTime(e){var t;(t=this.composition)==null||t.tracks.forEach(r=>{r.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 sw(i){i.requestFullscreen?i.requestFullscreen():i.mozRequestFullScreen?i.mozRequestFullScreen():i.webkitRequestFullscreen?i.webkitRequestFullscreen():i.msRequestFullscreen&&i.msRequestFullscreen()}function ow(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const CA=["progress","play-large","navigation","play","volume","current-time","duration","levels","speed","captions","fullscreen","preview"],aw={id:"captions",event:"captions:click",label:"Closed Captions"},lw={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},tp={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}]},cw={id:"playbackRate",label:"Playback playbackRate",subItems:tp};class Aw extends uu{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==tn.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)),fi}}const BA=rn(Aw),uw=pS(()=>{const i=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"}),r=new FontFace("Roobert Captions","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),n=yd.map(s=>({load:!1,font:new FontFace(s.family,`url(${s.url})`,{style:s.style})}));return[{load:!0,font:i},{load:!0,font:e},{load:!0,font:t},{load:!0,font:r},...n]}),Oi={"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"},hw={colors:Oi,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 ${Oi["dark-100"]}`,medium:`0 .125rem .625rem ${Oi["dark-100"]}`,large:`0 .25rem 1rem ${Oi["dark-50"]}`,xl:`.25rem .25rem 1rem ${Oi["dark-250"]}`,xxl:`0 .25rem 2rem ${Oi["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${Oi["dark-250"]}`,toolbar:`0 -.625rem .625rem ${Oi["dark-50"]}`,text:`0 0 .25rem ${Oi["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:Oi["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},ip=dS(hw,{delimiter:"-"}),dw=Object.keys(ip).map(i=>Pn(`:host { --${i}: ${ip[i]}; }`)),nt=(i=>{const e=class extends i{firstUpdated(){uw().forEach(({load:s,font:o})=>{document.fonts.add(o),s&&o.load()})}};return e.styles=[(i==null?void 0:i.styles)??[],dw,Et`
|
|
2514
|
+
*/const g0=(i,e,t)=>{const r=new Map;for(let n=e;n<=t;n++)r.set(i[n],n);return r},p0=rn(class extends Kn{constructor(i){if(super(i),i.type!==tn.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);const n=[],s=[];let o=0;for(const a of i)n[o]=r?r(a,o):o,s[o]=t(a,o),o++;return{values:s,keys:n}}render(i,e,t){return this.dt(i,e,t).values}update(i,[e,t,r]){const n=Hp(i),{values:s,keys:o}=this.dt(e,t,r);if(!Array.isArray(n))return this.ut=o,s;const a=this.ut??(this.ut=[]),c=[];let l,u,A=0,h=n.length-1,d=0,f=s.length-1;for(;A<=h&&d<=f;)if(n[A]===null)A++;else if(n[h]===null)h--;else if(a[A]===o[d])c[d]=Lr(n[A],s[d]),A++,d++;else if(a[h]===o[f])c[f]=Lr(n[h],s[f]),h--,f--;else if(a[A]===o[f])c[f]=Lr(n[A],s[f]),Vn(i,c[f+1],n[A]),A++,f--;else if(a[h]===o[d])c[d]=Lr(n[h],s[d]),Vn(i,n[A],n[h]),h--,d++;else if(l===void 0&&(l=g0(o,d,f),u=g0(a,A,h)),l.has(a[A]))if(l.has(a[h])){const g=u.get(o[d]),p=g!==void 0?n[g]:null;if(p===null){const I=Vn(i,n[A]);Lr(I,s[d]),c[d]=I}else c[d]=Lr(p,s[d]),Vn(i,n[A],p),n[g]=null;d++}else Ka(n[h]),h--;else Ka(n[A]),A++;for(;d<=f;){const g=Vn(i,c[f+1]);Lr(g,s[d]),c[d++]=g}for(;A<=h;){const g=n[A++];g!==null&&Ka(g)}return this.ut=o,Gp(i,c),fi}});var $t="top",li="bottom",ci="right",Yt="left",nA="auto",Bs=[$t,li,ci,Yt],En="start",Ts="end",mS="clippingParents",m0="viewport",bs="popper",ES="reference",E0=Bs.reduce(function(i,e){return i.concat([e+"-"+En,e+"-"+Ts])},[]),I0=[].concat(Bs,[nA]).reduce(function(i,e){return i.concat([e,e+"-"+En,e+"-"+Ts])},[]),IS="beforeRead",vS="read",yS="afterRead",CS="beforeMain",BS="main",TS="afterMain",bS="beforeWrite",SS="write",xS="afterWrite",wS=[IS,vS,yS,CS,BS,TS,bS,SS,xS];function Mi(i){return i?(i.nodeName||"").toLowerCase():null}function zt(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function Hr(i){var e=zt(i).Element;return i instanceof e||i instanceof Element}function Ai(i){var e=zt(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function sA(i){if(typeof ShadowRoot>"u")return!1;var e=zt(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function QS(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];!Ai(s)||!Mi(s)||(Object.assign(s.style,r),Object.keys(n).forEach(function(o){var a=n[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function RS(i){var e=i.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(r){var n=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),a=o.reduce(function(c,l){return c[l]="",c},{});!Ai(n)||!Mi(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(c){n.removeAttribute(c)}))})}}const v0={name:"applyStyles",enabled:!0,phase:"write",fn:QS,effect:RS,requires:["computeStyles"]};function Fi(i){return i.split("-")[0]}var $r=Math.max,Ea=Math.min,In=Math.round;function oA(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function y0(){return!/^((?!chrome|android).)*safari/i.test(oA())}function vn(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=i.getBoundingClientRect(),n=1,s=1;e&&Ai(i)&&(n=i.offsetWidth>0&&In(r.width)/i.offsetWidth||1,s=i.offsetHeight>0&&In(r.height)/i.offsetHeight||1);var o=Hr(i)?zt(i):window,a=o.visualViewport,c=!y0()&&t,l=(r.left+(c&&a?a.offsetLeft:0))/n,u=(r.top+(c&&a?a.offsetTop:0))/s,A=r.width/n,h=r.height/s;return{width:A,height:h,top:u,right:l+A,bottom:u+h,left:l,x:l,y:u}}function aA(i){var e=vn(i),t=i.offsetWidth,r=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:r}}function C0(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&sA(t)){var r=e;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Xi(i){return zt(i).getComputedStyle(i)}function _S(i){return["table","td","th"].indexOf(Mi(i))>=0}function Er(i){return((Hr(i)?i.ownerDocument:i.document)||window.document).documentElement}function Ia(i){return Mi(i)==="html"?i:i.assignedSlot||i.parentNode||(sA(i)?i.host:null)||Er(i)}function B0(i){return!Ai(i)||Xi(i).position==="fixed"?null:i.offsetParent}function DS(i){var e=/firefox/i.test(oA()),t=/Trident/i.test(oA());if(t&&Ai(i)){var r=Xi(i);if(r.position==="fixed")return null}var n=Ia(i);for(sA(n)&&(n=n.host);Ai(n)&&["html","body"].indexOf(Mi(n))<0;){var s=Xi(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 Ss(i){for(var e=zt(i),t=B0(i);t&&_S(t)&&Xi(t).position==="static";)t=B0(t);return t&&(Mi(t)==="html"||Mi(t)==="body"&&Xi(t).position==="static")?e:t||DS(i)||e}function lA(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function xs(i,e,t){return $r(i,Ea(e,t))}function LS(i,e,t){var r=xs(i,e,t);return r>t?t:r}function T0(){return{top:0,right:0,bottom:0,left:0}}function b0(i){return Object.assign({},T0(),i)}function S0(i,e){return e.reduce(function(t,r){return t[r]=i,t},{})}var kS=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,b0(typeof e!="number"?e:S0(e,Bs))};function MS(i){var e,t=i.state,r=i.name,n=i.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=Fi(t.placement),c=lA(a),l=[Yt,ci].indexOf(a)>=0,u=l?"height":"width";if(!(!s||!o)){var A=kS(n.padding,t),h=aA(s),d=c==="y"?$t:Yt,f=c==="y"?li:ci,g=t.rects.reference[u]+t.rects.reference[c]-o[c]-t.rects.popper[u],p=o[c]-t.rects.reference[c],I=Ss(s),C=I?c==="y"?I.clientHeight||0:I.clientWidth||0:0,B=g/2-p/2,y=A[d],x=C-h[u]-A[f],R=C/2-h[u]/2+B,_=xs(y,R,x),F=c;t.modifiersData[r]=(e={},e[F]=_,e.centerOffset=_-R,e)}}function FS(i){var e=i.state,t=i.options,r=t.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||C0(e.elements.popper,n)&&(e.elements.arrow=n))}const PS={name:"arrow",enabled:!0,phase:"main",fn:MS,effect:FS,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function yn(i){return i.split("-")[1]}var NS={top:"auto",right:"auto",bottom:"auto",left:"auto"};function OS(i,e){var t=i.x,r=i.y,n=e.devicePixelRatio||1;return{x:In(t*n)/n||0,y:In(r*n)/n||0}}function x0(i){var e,t=i.popper,r=i.popperRect,n=i.placement,s=i.variation,o=i.offsets,a=i.position,c=i.gpuAcceleration,l=i.adaptive,u=i.roundOffsets,A=i.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 I=o.hasOwnProperty("x"),C=o.hasOwnProperty("y"),B=Yt,y=$t,x=window;if(l){var R=Ss(t),_="clientHeight",F="clientWidth";if(R===zt(t)&&(R=Er(t),Xi(R).position!=="static"&&a==="absolute"&&(_="scrollHeight",F="scrollWidth")),R=R,n===$t||(n===Yt||n===ci)&&s===Ts){y=li;var P=A&&R===x&&x.visualViewport?x.visualViewport.height:R[_];g-=P-r.height,g*=c?1:-1}if(n===Yt||(n===$t||n===li)&&s===Ts){B=ci;var D=A&&R===x&&x.visualViewport?x.visualViewport.width:R[F];d-=D-r.width,d*=c?1:-1}}var $=Object.assign({position:a},l&&NS),j=u===!0?OS({x:d,y:g},zt(t)):{x:d,y:g};if(d=j.x,g=j.y,c){var ee;return Object.assign({},$,(ee={},ee[y]=C?"0":"",ee[B]=I?"0":"",ee.transform=(x.devicePixelRatio||1)<=1?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",ee))}return Object.assign({},$,(e={},e[y]=C?g+"px":"",e[B]=I?d+"px":"",e.transform="",e))}function US(i){var e=i.state,t=i.options,r=t.gpuAcceleration,n=r===void 0?!0:r,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,c=a===void 0?!0:a,l={placement:Fi(e.placement),variation:yn(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,x0(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,x0(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const GS={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:US,data:{}};var va={passive:!0};function HS(i){var e=i.state,t=i.instance,r=i.options,n=r.scroll,s=n===void 0?!0:n,o=r.resize,a=o===void 0?!0:o,c=zt(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&l.forEach(function(u){u.addEventListener("scroll",t.update,va)}),a&&c.addEventListener("resize",t.update,va),function(){s&&l.forEach(function(u){u.removeEventListener("scroll",t.update,va)}),a&&c.removeEventListener("resize",t.update,va)}}const $S={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:HS,data:{}};var YS={left:"right",right:"left",bottom:"top",top:"bottom"};function ya(i){return i.replace(/left|right|bottom|top/g,function(e){return YS[e]})}var VS={start:"end",end:"start"};function w0(i){return i.replace(/start|end/g,function(e){return VS[e]})}function cA(i){var e=zt(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function AA(i){return vn(Er(i)).left+cA(i).scrollLeft}function KS(i,e){var t=zt(i),r=Er(i),n=t.visualViewport,s=r.clientWidth,o=r.clientHeight,a=0,c=0;if(n){s=n.width,o=n.height;var l=y0();(l||!l&&e==="fixed")&&(a=n.offsetLeft,c=n.offsetTop)}return{width:s,height:o,x:a+AA(i),y:c}}function WS(i){var e,t=Er(i),r=cA(i),n=(e=i.ownerDocument)==null?void 0:e.body,s=$r(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=$r(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-r.scrollLeft+AA(i),c=-r.scrollTop;return Xi(n||t).direction==="rtl"&&(a+=$r(t.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:c}}function uA(i){var e=Xi(i),t=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+r)}function Q0(i){return["html","body","#document"].indexOf(Mi(i))>=0?i.ownerDocument.body:Ai(i)&&uA(i)?i:Q0(Ia(i))}function ws(i,e){var t;e===void 0&&(e=[]);var r=Q0(i),n=r===((t=i.ownerDocument)==null?void 0:t.body),s=zt(r),o=n?[s].concat(s.visualViewport||[],uA(r)?r:[]):r,a=e.concat(o);return n?a:a.concat(ws(Ia(o)))}function hA(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function jS(i,e){var t=vn(i,!1,e==="fixed");return t.top=t.top+i.clientTop,t.left=t.left+i.clientLeft,t.bottom=t.top+i.clientHeight,t.right=t.left+i.clientWidth,t.width=i.clientWidth,t.height=i.clientHeight,t.x=t.left,t.y=t.top,t}function R0(i,e,t){return e===m0?hA(KS(i,t)):Hr(e)?jS(e,t):hA(WS(Er(i)))}function JS(i){var e=ws(Ia(i)),t=["absolute","fixed"].indexOf(Xi(i).position)>=0,r=t&&Ai(i)?Ss(i):i;return Hr(r)?e.filter(function(n){return Hr(n)&&C0(n,r)&&Mi(n)!=="body"}):[]}function qS(i,e,t,r){var n=e==="clippingParents"?JS(i):[].concat(e),s=[].concat(n,[t]),o=s[0],a=s.reduce(function(c,l){var u=R0(i,l,r);return c.top=$r(u.top,c.top),c.right=Ea(u.right,c.right),c.bottom=Ea(u.bottom,c.bottom),c.left=$r(u.left,c.left),c},R0(i,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function _0(i){var e=i.reference,t=i.element,r=i.placement,n=r?Fi(r):null,s=r?yn(r):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,c;switch(n){case $t:c={x:o,y:e.y-t.height};break;case li:c={x:o,y:e.y+e.height};break;case ci:c={x:e.x+e.width,y:a};break;case Yt:c={x:e.x-t.width,y:a};break;default:c={x:e.x,y:e.y}}var l=n?lA(n):null;if(l!=null){var u=l==="y"?"height":"width";switch(s){case En:c[l]=c[l]-(e[u]/2-t[u]/2);break;case Ts:c[l]=c[l]+(e[u]/2-t[u]/2);break}}return c}function Qs(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=r===void 0?i.placement:r,s=t.strategy,o=s===void 0?i.strategy:s,a=t.boundary,c=a===void 0?mS:a,l=t.rootBoundary,u=l===void 0?m0:l,A=t.elementContext,h=A===void 0?bs:A,d=t.altBoundary,f=d===void 0?!1:d,g=t.padding,p=g===void 0?0:g,I=b0(typeof p!="number"?p:S0(p,Bs)),C=h===bs?ES:bs,B=i.rects.popper,y=i.elements[f?C:h],x=qS(Hr(y)?y:y.contextElement||Er(i.elements.popper),c,u,o),R=vn(i.elements.reference),_=_0({reference:R,element:B,strategy:"absolute",placement:n}),F=hA(Object.assign({},B,_)),P=h===bs?F:R,D={top:x.top-P.top+I.top,bottom:P.bottom-x.bottom+I.bottom,left:x.left-P.left+I.left,right:P.right-x.right+I.right},$=i.modifiersData.offset;if(h===bs&&$){var j=$[n];Object.keys(D).forEach(function(ee){var Z=[ci,li].indexOf(ee)>=0?1:-1,k=[$t,li].indexOf(ee)>=0?"y":"x";D[ee]+=j[k]*Z})}return D}function zS(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,c=t.allowedAutoPlacements,l=c===void 0?I0:c,u=yn(r),A=u?a?E0:E0.filter(function(f){return yn(f)===u}):Bs,h=A.filter(function(f){return l.indexOf(f)>=0});h.length===0&&(h=A);var d=h.reduce(function(f,g){return f[g]=Qs(i,{placement:g,boundary:n,rootBoundary:s,padding:o})[Fi(g)],f},{});return Object.keys(d).sort(function(f,g){return d[f]-d[g]})}function XS(i){if(Fi(i)===nA)return[];var e=ya(i);return[w0(i),e,w0(e)]}function ZS(i){var e=i.state,t=i.options,r=i.name;if(!e.modifiersData[r]._skip){for(var n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!0:o,c=t.fallbackPlacements,l=t.padding,u=t.boundary,A=t.rootBoundary,h=t.altBoundary,d=t.flipVariations,f=d===void 0?!0:d,g=t.allowedAutoPlacements,p=e.options.placement,I=Fi(p),C=I===p,B=c||(C||!f?[ya(p)]:XS(p)),y=[p].concat(B).reduce(function(ae,fe){return ae.concat(Fi(fe)===nA?zS(e,{placement:fe,boundary:u,rootBoundary:A,padding:l,flipVariations:f,allowedAutoPlacements:g}):fe)},[]),x=e.rects.reference,R=e.rects.popper,_=new Map,F=!0,P=y[0],D=0;D<y.length;D++){var $=y[D],j=Fi($),ee=yn($)===En,Z=[$t,li].indexOf(j)>=0,k=Z?"width":"height",O=Qs(e,{placement:$,boundary:u,rootBoundary:A,altBoundary:h,padding:l}),V=Z?ee?ci:Yt:ee?li:$t;x[k]>R[k]&&(V=ya(V));var L=ya(V),Q=[];if(s&&Q.push(O[j]<=0),a&&Q.push(O[V]<=0,O[L]<=0),Q.every(function(ae){return ae})){P=$,F=!1;break}_.set($,Q)}if(F)for(var M=f?3:1,W=function(fe){var Ee=y.find(function(Pe){var we=_.get(Pe);if(we)return we.slice(0,fe).every(function(Ne){return Ne})});if(Ee)return P=Ee,"break"},Y=M;Y>0;Y--){var ie=W(Y);if(ie==="break")break}e.placement!==P&&(e.modifiersData[r]._skip=!0,e.placement=P,e.reset=!0)}}const ex={name:"flip",enabled:!0,phase:"main",fn:ZS,requiresIfExists:["offset"],data:{_skip:!1}};function D0(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function L0(i){return[$t,ci,li,Yt].some(function(e){return i[e]>=0})}function tx(i){var e=i.state,t=i.name,r=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=Qs(e,{elementContext:"reference"}),a=Qs(e,{altBoundary:!0}),c=D0(o,r),l=D0(a,n,s),u=L0(c),A=L0(l);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:A},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":A})}const ix={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:tx};function rx(i,e,t){var r=Fi(i),n=[Yt,$t].indexOf(r)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[Yt,ci].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function nx(i){var e=i.state,t=i.options,r=i.name,n=t.offset,s=n===void 0?[0,0]:n,o=I0.reduce(function(u,A){return u[A]=rx(A,e.rects,s),u},{}),a=o[e.placement],c=a.x,l=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=l),e.modifiersData[r]=o}const sx={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:nx};function ox(i){var e=i.state,t=i.name;e.modifiersData[t]=_0({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const ax={name:"popperOffsets",enabled:!0,phase:"read",fn:ox,data:{}};function lx(i){return i==="x"?"y":"x"}function cx(i){var e=i.state,t=i.options,r=i.name,n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!1:o,c=t.boundary,l=t.rootBoundary,u=t.altBoundary,A=t.padding,h=t.tether,d=h===void 0?!0:h,f=t.tetherOffset,g=f===void 0?0:f,p=Qs(e,{boundary:c,rootBoundary:l,padding:A,altBoundary:u}),I=Fi(e.placement),C=yn(e.placement),B=!C,y=lA(I),x=lx(y),R=e.modifiersData.popperOffsets,_=e.rects.reference,F=e.rects.popper,P=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,D=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),$=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,j={x:0,y:0};if(R){if(s){var ee,Z=y==="y"?$t:Yt,k=y==="y"?li:ci,O=y==="y"?"height":"width",V=R[y],L=V+p[Z],Q=V-p[k],M=d?-F[O]/2:0,W=C===En?_[O]:F[O],Y=C===En?-F[O]:-_[O],ie=e.elements.arrow,ae=d&&ie?aA(ie):{width:0,height:0},fe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:T0(),Ee=fe[Z],Pe=fe[k],we=xs(0,_[O],ae[O]),Ne=B?_[O]/2-M-we-Ee-D.mainAxis:W-we-Ee-D.mainAxis,pe=B?-_[O]/2+M+we+Pe+D.mainAxis:Y+we+Pe+D.mainAxis,Me=e.elements.arrow&&Ss(e.elements.arrow),We=Me?y==="y"?Me.clientTop||0:Me.clientLeft||0:0,Oe=(ee=$==null?void 0:$[y])!=null?ee:0,Xe=V+Ne-Oe-We,De=V+pe-Oe,Re=xs(d?Ea(L,Xe):L,V,d?$r(Q,De):Q);R[y]=Re,j[y]=Re-V}if(a){var He,ue=y==="x"?$t:Yt,Le=y==="x"?li:ci,be=R[x],le=x==="y"?"height":"width",ge=be+p[ue],ve=be-p[Le],Te=[$t,Yt].indexOf(I)!==-1,Ce=(He=$==null?void 0:$[x])!=null?He:0,Ue=Te?ge:be-_[le]-F[le]-Ce+D.altAxis,T=Te?be+_[le]+F[le]-Ce-D.altAxis:ve,m=d&&Te?LS(Ue,be,T):xs(d?Ue:ge,be,d?T:ve);R[x]=m,j[x]=m-be}e.modifiersData[r]=j}}const Ax={name:"preventOverflow",enabled:!0,phase:"main",fn:cx,requiresIfExists:["offset"]};function ux(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function hx(i){return i===zt(i)||!Ai(i)?cA(i):ux(i)}function dx(i){var e=i.getBoundingClientRect(),t=In(e.width)/i.offsetWidth||1,r=In(e.height)/i.offsetHeight||1;return t!==1||r!==1}function fx(i,e,t){t===void 0&&(t=!1);var r=Ai(e),n=Ai(e)&&dx(e),s=Er(e),o=vn(i,n,t),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!t)&&((Mi(e)!=="body"||uA(s))&&(a=hx(e)),Ai(e)?(c=vn(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):s&&(c.x=AA(s))),{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function gx(i){var e=new Map,t=new Set,r=[];i.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 c=e.get(a);c&&n(c)}}),r.push(s)}return i.forEach(function(s){t.has(s.name)||n(s)}),r}function px(i){var e=gx(i);return wS.reduce(function(t,r){return t.concat(e.filter(function(n){return n.phase===r}))},[])}function mx(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function Ex(i){var e=i.reduce(function(t,r){var n=t[r.name];return t[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var k0={placement:"bottom",modifiers:[],strategy:"absolute"};function M0(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function Ix(i){i===void 0&&(i={});var e=i,t=e.defaultModifiers,r=t===void 0?[]:t,n=e.defaultOptions,s=n===void 0?k0:n;return function(a,c,l){l===void 0&&(l=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},k0,s),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},A=[],h=!1,d={state:u,setOptions:function(I){var C=typeof I=="function"?I(u.options):I;g(),u.options=Object.assign({},s,u.options,C),u.scrollParents={reference:Hr(a)?ws(a):a.contextElement?ws(a.contextElement):[],popper:ws(c)};var B=px(Ex([].concat(r,u.options.modifiers)));return u.orderedModifiers=B.filter(function(y){return y.enabled}),f(),d.update()},forceUpdate:function(){if(!h){var I=u.elements,C=I.reference,B=I.popper;if(M0(C,B)){u.rects={reference:fx(C,Ss(B),u.options.strategy==="fixed"),popper:aA(B)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(D){return u.modifiersData[D.name]=Object.assign({},D.data)});for(var y=0;y<u.orderedModifiers.length;y++){if(u.reset===!0){u.reset=!1,y=-1;continue}var x=u.orderedModifiers[y],R=x.fn,_=x.options,F=_===void 0?{}:_,P=x.name;typeof R=="function"&&(u=R({state:u,options:F,name:P,instance:d})||u)}}}},update:mx(function(){return new Promise(function(p){d.forceUpdate(),p(u)})}),destroy:function(){g(),h=!0}};if(!M0(a,c))return d;d.setOptions(l).then(function(p){!h&&l.onFirstUpdate&&l.onFirstUpdate(p)});function f(){u.orderedModifiers.forEach(function(p){var I=p.name,C=p.options,B=C===void 0?{}:C,y=p.effect;if(typeof y=="function"){var x=y({state:u,name:I,instance:d,options:B}),R=function(){};A.push(x||R)}})}function g(){A.forEach(function(p){return p()}),A=[]}return d}}var vx=[$S,ax,GS,v0,sx,ex,Ax,PS,ix],yx=Ix({defaultModifiers:vx}),Cx="tippy-box",F0="tippy-content",Bx="tippy-backdrop",P0="tippy-arrow",N0="tippy-svg-arrow",Yr={passive:!0,capture:!0},O0=function(){return document.body};function dA(i,e,t){if(Array.isArray(i)){var r=i[e];return r??(Array.isArray(t)?t[e]:t)}return i}function fA(i,e){var t={}.toString.call(i);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function U0(i,e){return typeof i=="function"?i.apply(void 0,e):i}function G0(i,e){if(e===0)return i;var t;return function(r){clearTimeout(t),t=setTimeout(function(){i(r)},e)}}function Tx(i){return i.split(/\s+/).filter(Boolean)}function Cn(i){return[].concat(i)}function H0(i,e){i.indexOf(e)===-1&&i.push(e)}function bx(i){return i.filter(function(e,t){return i.indexOf(e)===t})}function Sx(i){return i.split("-")[0]}function Ca(i){return[].slice.call(i)}function $0(i){return Object.keys(i).reduce(function(e,t){return i[t]!==void 0&&(e[t]=i[t]),e},{})}function Rs(){return document.createElement("div")}function Ba(i){return["Element","Fragment"].some(function(e){return fA(i,e)})}function xx(i){return fA(i,"NodeList")}function wx(i){return fA(i,"MouseEvent")}function Qx(i){return!!(i&&i._tippy&&i._tippy.reference===i)}function Rx(i){return Ba(i)?[i]:xx(i)?Ca(i):Array.isArray(i)?i:Ca(document.querySelectorAll(i))}function gA(i,e){i.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function Y0(i,e){i.forEach(function(t){t&&t.setAttribute("data-state",e)})}function _x(i){var e,t=Cn(i),r=t[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function Dx(i,e){var t=e.clientX,r=e.clientY;return i.every(function(n){var s=n.popperRect,o=n.popperState,a=n.props,c=a.interactiveBorder,l=Sx(o.placement),u=o.modifiersData.offset;if(!u)return!0;var A=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-r+A>c,p=r-s.bottom-h>c,I=s.left-t+d>c,C=t-s.right-f>c;return g||p||I||C})}function pA(i,e,t){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){i[r](n,t)})}function V0(i,e){for(var t=e;t;){var r;if(i.contains(t))return!0;t=t.getRootNode==null||(r=t.getRootNode())==null?void 0:r.host}return!1}var Pi={isTouch:!1},K0=0;function Lx(){Pi.isTouch||(Pi.isTouch=!0,window.performance&&document.addEventListener("mousemove",W0))}function W0(){var i=performance.now();i-K0<20&&(Pi.isTouch=!1,document.removeEventListener("mousemove",W0)),K0=i}function kx(){var i=document.activeElement;if(Qx(i)){var e=i._tippy;i.blur&&!e.state.isVisible&&i.blur()}}function Mx(){document.addEventListener("touchstart",Lx,Yr),window.addEventListener("blur",kx)}var Fx=typeof window<"u"&&typeof document<"u",Px=Fx?!!window.msCrypto:!1,Nx={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Ox={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ei=Object.assign({appendTo:O0,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},Nx,Ox),Ux=Object.keys(Ei),Gx=function(e){var t=Object.keys(e);t.forEach(function(r){Ei[r]=e[r]})};function j0(i){var e=i.plugins||[],t=e.reduce(function(r,n){var s=n.name,o=n.defaultValue;if(s){var a;r[s]=i[s]!==void 0?i[s]:(a=Ei[s])!=null?a:o}return r},{});return Object.assign({},i,t)}function Hx(i,e){var t=e?Object.keys(j0(Object.assign({},Ei,{plugins:e}))):Ux,r=t.reduce(function(n,s){var o=(i.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 r}function J0(i,e){var t=Object.assign({},e,{content:U0(e.content,[i])},e.ignoreAttributes?{}:Hx(i,e.plugins));return t.aria=Object.assign({},Ei.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 $x=function(){return"innerHTML"};function mA(i,e){i[$x()]=e}function q0(i){var e=Rs();return i===!0?e.className=P0:(e.className=N0,Ba(i)?e.appendChild(i):mA(e,i)),e}function z0(i,e){Ba(e.content)?(mA(i,""),i.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?mA(i,e.content):i.textContent=e.content)}function EA(i){var e=i.firstElementChild,t=Ca(e.children);return{box:e,content:t.find(function(r){return r.classList.contains(F0)}),arrow:t.find(function(r){return r.classList.contains(P0)||r.classList.contains(N0)}),backdrop:t.find(function(r){return r.classList.contains(Bx)})}}function X0(i){var e=Rs(),t=Rs();t.className=Cx,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var r=Rs();r.className=F0,r.setAttribute("data-state","hidden"),z0(r,i.props),e.appendChild(t),t.appendChild(r),n(i.props,i.props);function n(s,o){var a=EA(e),c=a.box,l=a.content,u=a.arrow;o.theme?c.setAttribute("data-theme",o.theme):c.removeAttribute("data-theme"),typeof o.animation=="string"?c.setAttribute("data-animation",o.animation):c.removeAttribute("data-animation"),o.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?c.setAttribute("role",o.role):c.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&z0(l,i.props),o.arrow?u?s.arrow!==o.arrow&&(c.removeChild(u),c.appendChild(q0(o.arrow))):c.appendChild(q0(o.arrow)):u&&c.removeChild(u)}return{popper:e,onUpdate:n}}X0.$$tippy=!0;var Yx=1,Ta=[],IA=[];function Vx(i,e){var t=J0(i,Object.assign({},Ei,j0($0(e)))),r,n,s,o=!1,a=!1,c=!1,l=!1,u,A,h,d=[],f=G0(Xe,t.interactiveDebounce),g,p=Yx++,I=null,C=bx(t.plugins),B={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:p,reference:i,popper:Rs(),popperInstance:I,props:t,state:B,plugins:C,clearDelayTimeouts:Ue,setProps:T,setContent:m,show:E,hide:w,hideWithInteractivity:U,enable:Te,disable:Ce,unmount:J,destroy:X};if(!t.render)return y;var x=t.render(y),R=x.popper,_=x.onUpdate;R.setAttribute("data-tippy-root",""),R.id="tippy-"+y.id,y.popper=R,i._tippy=y,R._tippy=y;var F=C.map(function(G){return G.fn(y)}),P=i.hasAttribute("aria-expanded");return Me(),M(),V(),L("onCreate",[y]),t.showOnCreate&&ge(),R.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),R.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&Z().addEventListener("mousemove",f)}),y;function D(){var G=y.props.touch;return Array.isArray(G)?G:[G,0]}function $(){return D()[0]==="hold"}function j(){var G;return!!((G=y.props.render)!=null&&G.$$tippy)}function ee(){return g||i}function Z(){var G=ee().parentNode;return G?_x(G):document}function k(){return EA(R)}function O(G){return y.state.isMounted&&!y.state.isVisible||Pi.isTouch||u&&u.type==="focus"?0:dA(y.props.delay,G?0:1,Ei.delay)}function V(G){G===void 0&&(G=!1),R.style.pointerEvents=y.props.interactive&&!G?"":"none",R.style.zIndex=""+y.props.zIndex}function L(G,se,he){if(he===void 0&&(he=!0),F.forEach(function(ye){ye[G]&&ye[G].apply(ye,se)}),he){var Be;(Be=y.props)[G].apply(Be,se)}}function Q(){var G=y.props.aria;if(G.content){var se="aria-"+G.content,he=R.id,Be=Cn(y.props.triggerTarget||i);Be.forEach(function(ye){var $e=ye.getAttribute(se);if(y.state.isVisible)ye.setAttribute(se,$e?$e+" "+he:he);else{var ze=$e&&$e.replace(he,"").trim();ze?ye.setAttribute(se,ze):ye.removeAttribute(se)}})}}function M(){if(!(P||!y.props.aria.expanded)){var G=Cn(y.props.triggerTarget||i);G.forEach(function(se){y.props.interactive?se.setAttribute("aria-expanded",y.state.isVisible&&se===ee()?"true":"false"):se.removeAttribute("aria-expanded")})}}function W(){Z().removeEventListener("mousemove",f),Ta=Ta.filter(function(G){return G!==f})}function Y(G){if(!(Pi.isTouch&&(c||G.type==="mousedown"))){var se=G.composedPath&&G.composedPath()[0]||G.target;if(!(y.props.interactive&&V0(R,se))){if(Cn(y.props.triggerTarget||i).some(function(he){return V0(he,se)})){if(Pi.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else L("onClickOutside",[y,G]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),a=!0,setTimeout(function(){a=!1}),y.state.isMounted||Ee())}}}function ie(){c=!0}function ae(){c=!1}function fe(){var G=Z();G.addEventListener("mousedown",Y,!0),G.addEventListener("touchend",Y,Yr),G.addEventListener("touchstart",ae,Yr),G.addEventListener("touchmove",ie,Yr)}function Ee(){var G=Z();G.removeEventListener("mousedown",Y,!0),G.removeEventListener("touchend",Y,Yr),G.removeEventListener("touchstart",ae,Yr),G.removeEventListener("touchmove",ie,Yr)}function Pe(G,se){Ne(G,function(){!y.state.isVisible&&R.parentNode&&R.parentNode.contains(R)&&se()})}function we(G,se){Ne(G,se)}function Ne(G,se){var he=k().box;function Be(ye){ye.target===he&&(pA(he,"remove",Be),se())}if(G===0)return se();pA(he,"remove",A),pA(he,"add",Be),A=Be}function pe(G,se,he){he===void 0&&(he=!1);var Be=Cn(y.props.triggerTarget||i);Be.forEach(function(ye){ye.addEventListener(G,se,he),d.push({node:ye,eventType:G,handler:se,options:he})})}function Me(){$()&&(pe("touchstart",Oe,{passive:!0}),pe("touchend",De,{passive:!0})),Tx(y.props.trigger).forEach(function(G){if(G!=="manual")switch(pe(G,Oe),G){case"mouseenter":pe("mouseleave",De);break;case"focus":pe(Px?"focusout":"blur",Re);break;case"focusin":pe("focusout",Re);break}})}function We(){d.forEach(function(G){var se=G.node,he=G.eventType,Be=G.handler,ye=G.options;se.removeEventListener(he,Be,ye)}),d=[]}function Oe(G){var se,he=!1;if(!(!y.state.isEnabled||He(G)||a)){var Be=((se=u)==null?void 0:se.type)==="focus";u=G,g=G.currentTarget,M(),!y.state.isVisible&&wx(G)&&Ta.forEach(function(ye){return ye(G)}),G.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||o)&&y.props.hideOnClick!==!1&&y.state.isVisible?he=!0:ge(G),G.type==="click"&&(o=!he),he&&!Be&&ve(G)}}function Xe(G){var se=G.target,he=ee().contains(se)||R.contains(se);if(!(G.type==="mousemove"&&he)){var Be=le().concat(R).map(function(ye){var $e,ze=ye._tippy,Bt=($e=ze.popperInstance)==null?void 0:$e.state;return Bt?{popperRect:ye.getBoundingClientRect(),popperState:Bt,props:t}:null}).filter(Boolean);Dx(Be,G)&&(W(),ve(G))}}function De(G){var se=He(G)||y.props.trigger.indexOf("click")>=0&&o;if(!se){if(y.props.interactive){y.hideWithInteractivity(G);return}ve(G)}}function Re(G){y.props.trigger.indexOf("focusin")<0&&G.target!==ee()||y.props.interactive&&G.relatedTarget&&R.contains(G.relatedTarget)||ve(G)}function He(G){return Pi.isTouch?$()!==G.type.indexOf("touch")>=0:!1}function ue(){Le();var G=y.props,se=G.popperOptions,he=G.placement,Be=G.offset,ye=G.getReferenceClientRect,$e=G.moveTransition,ze=j()?EA(R).arrow:null,Bt=ye?{getBoundingClientRect:ye,contextElement:ye.contextElement||ee()}:i,Zi={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Zt){var bt=Zt.state;if(j()){var ei=k(),er=ei.box;["placement","reference-hidden","escaped"].forEach(function(tr){tr==="placement"?er.setAttribute("data-placement",bt.placement):bt.attributes.popper["data-popper-"+tr]?er.setAttribute("data-"+tr,""):er.removeAttribute("data-"+tr)}),bt.attributes.popper={}}}},Tt=[{name:"offset",options:{offset:Be}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!$e}},Zi];j()&&ze&&Tt.push({name:"arrow",options:{element:ze,padding:3}}),Tt.push.apply(Tt,(se==null?void 0:se.modifiers)||[]),y.popperInstance=yx(Bt,R,Object.assign({},se,{placement:he,onFirstUpdate:h,modifiers:Tt}))}function Le(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function be(){var G=y.props.appendTo,se,he=ee();y.props.interactive&&G===O0||G==="parent"?se=he.parentNode:se=U0(G,[he]),se.contains(R)||se.appendChild(R),y.state.isMounted=!0,ue()}function le(){return Ca(R.querySelectorAll("[data-tippy-root]"))}function ge(G){y.clearDelayTimeouts(),G&&L("onTrigger",[y,G]),fe();var se=O(!0),he=D(),Be=he[0],ye=he[1];Pi.isTouch&&Be==="hold"&&ye&&(se=ye),se?r=setTimeout(function(){y.show()},se):y.show()}function ve(G){if(y.clearDelayTimeouts(),L("onUntrigger",[y,G]),!y.state.isVisible){Ee();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(G.type)>=0&&o)){var se=O(!1);se?n=setTimeout(function(){y.state.isVisible&&y.hide()},se):s=requestAnimationFrame(function(){y.hide()})}}function Te(){y.state.isEnabled=!0}function Ce(){y.hide(),y.state.isEnabled=!1}function Ue(){clearTimeout(r),clearTimeout(n),cancelAnimationFrame(s)}function T(G){if(!y.state.isDestroyed){L("onBeforeUpdate",[y,G]),We();var se=y.props,he=J0(i,Object.assign({},se,$0(G),{ignoreAttributes:!0}));y.props=he,Me(),se.interactiveDebounce!==he.interactiveDebounce&&(W(),f=G0(Xe,he.interactiveDebounce)),se.triggerTarget&&!he.triggerTarget?Cn(se.triggerTarget).forEach(function(Be){Be.removeAttribute("aria-expanded")}):he.triggerTarget&&i.removeAttribute("aria-expanded"),M(),V(),_&&_(se,he),y.popperInstance&&(ue(),le().forEach(function(Be){requestAnimationFrame(Be._tippy.popperInstance.forceUpdate)})),L("onAfterUpdate",[y,G])}}function m(G){y.setProps({content:G})}function E(){var G=y.state.isVisible,se=y.state.isDestroyed,he=!y.state.isEnabled,Be=Pi.isTouch&&!y.props.touch,ye=dA(y.props.duration,0,Ei.duration);if(!(G||se||he||Be)&&!ee().hasAttribute("disabled")&&(L("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,j()&&(R.style.visibility="visible"),V(),fe(),y.state.isMounted||(R.style.transition="none"),j()){var $e=k(),ze=$e.box,Bt=$e.content;gA([ze,Bt],0)}h=function(){var Tt;if(!(!y.state.isVisible||l)){if(l=!0,R.offsetHeight,R.style.transition=y.props.moveTransition,j()&&y.props.animation){var Ii=k(),Zt=Ii.box,bt=Ii.content;gA([Zt,bt],ye),Y0([Zt,bt],"visible")}Q(),M(),H0(IA,y),(Tt=y.popperInstance)==null||Tt.forceUpdate(),L("onMount",[y]),y.props.animation&&j()&&we(ye,function(){y.state.isShown=!0,L("onShown",[y])})}},be()}}function w(){var G=!y.state.isVisible,se=y.state.isDestroyed,he=!y.state.isEnabled,Be=dA(y.props.duration,1,Ei.duration);if(!(G||se||he)&&(L("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,l=!1,o=!1,j()&&(R.style.visibility="hidden"),W(),Ee(),V(!0),j()){var ye=k(),$e=ye.box,ze=ye.content;y.props.animation&&(gA([$e,ze],Be),Y0([$e,ze],"hidden"))}Q(),M(),y.props.animation?j()&&Pe(Be,y.unmount):y.unmount()}}function U(G){Z().addEventListener("mousemove",f),H0(Ta,f),f(G)}function J(){y.state.isVisible&&y.hide(),y.state.isMounted&&(Le(),le().forEach(function(G){G._tippy.unmount()}),R.parentNode&&R.parentNode.removeChild(R),IA=IA.filter(function(G){return G!==y}),y.state.isMounted=!1,L("onHidden",[y]))}function X(){y.state.isDestroyed||(y.clearDelayTimeouts(),y.unmount(),We(),delete i._tippy,y.state.isDestroyed=!0,L("onDestroy",[y]))}}function Vr(i,e){e===void 0&&(e={});var t=Ei.plugins.concat(e.plugins||[]);Mx();var r=Object.assign({},e,{plugins:t}),n=Rx(i),s=n.reduce(function(o,a){var c=a&&Vx(a,r);return c&&o.push(c),o},[]);return Ba(i)?s[0]:s}Vr.defaultProps=Ei,Vr.setDefaultProps=Gx,Vr.currentInput=Pi,Object.assign({},v0,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}}),Vr.setDefaultProps({render:X0});function Vt(i,e){return`${i}-${e}`}function Ni(i){var e,t;const r=[];return(((e=i.renderer)==null?void 0:e.type)==="video"||((t=i.renderer)==null?void 0:t.type)==="audio")&&r.push({...i.config,...i.options}),r.push(...i.childNodes.flatMap(Ni).filter(Boolean)),r}class ba extends Error{constructor(e,t=new Error,r=!1){super(),this.fatal=!1,this.fatal=r,this.stack=t.stack,this.message=[e,t.message].filter(Boolean).join(" - ")}}function Ir(i,e,t){return Math.min(Math.max(e,i),t)}const Kx=5;function Wx(i,e){return i.length!==e.length||i.some((t,r)=>t!==e[r])}class jx{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._canvas=_t(),this._controls=_t(),this._drawAbort=null,this.host=e}set activeScenes(e){Wx(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,r,n;const s=Ir(0,e,this.host.duration);this.activeScenes=((t=this.host.composition)==null?void 0:t.tracks.reduce((a,c)=>a.concat(c.scenes.filter(({start:l,duration:u})=>s>=l&&s<l+u)),[]))??[];const o=s!==this.currentTime;this._currentTime=s,this._upcomingScenes=((r=this.host.composition)==null?void 0:r.tracks.reduce((a,c)=>a.concat(c.scenes.filter(({start:l})=>s>=l-Kx&&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 Dt(this._canvas)}controls(){return Dt(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{Ni(e.layout.node).forEach(({key:r})=>{var n,s,o;const{id:a,start:c,duration:l}=e,u=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused,A=Vt(a,r);if(this.host.media[A]){const h=this.host.media[A],{speed:d,volume:f,hls:g,node:p,start:I,duration:C}=h,B=this.host.mediaState[A];p&&B&&(p.currentTime>=I+C||p.ended||u&&(g?(n=g.startLoadOnce)==null||n.call(g,I):B.initialised||(s=p.startLoadOnce)==null||s.call(p),p.volume=Ir(0,this.host.volume*(f??1),1),p.playbackRate=Ir(.1,this.host.playbackRate*(d??1),4)))}else if(u){const h=`${c}-${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,c/this.host.duration*100),end:Math.min((c+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(r=>Ni(r.layout.node).map(async({key:s})=>{const o=Vt(r.id,s);if(this.host.media[o]){const a=this.host.media[o],{node:c}=a,l=this.host.mediaState[o];if(!this.activeScenes.includes(r))c.paused||c.pause();else if(l&&!this.host.waiting&&!this.host.loading&&!this.host.paused&&c.paused&&!c.ended&&l.initialised)try{await c.play()}catch(A){throw new ba("Video play error",A,!0)}}}))))??[])}draw(e=this.currentTime,t){var r;(r=this._drawAbort)==null||r.abort(),this._drawAbort=new AbortController,this.host.composition&&this._canvas.value&&this.host.composition.draw({currentTime:e,canvas:this._canvas.value,overrides:t,signal:this._drawAbort.signal})}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 Jx=Ti(async i=>{const e=await fetch(i);if(!e.ok)throw new Error(`Failed to fetch font (${e.status}): ${i}`);return e.arrayBuffer()}),Z0=Ti(async(i,e,t)=>new FontFace(i,await Jx(t),{weight:e,style:"normal"}).load(),{cacheKey:([i,e,t])=>`${i}|${e}|${t}`}),qx=Ti(async function(e){const{weight:t,family:r}=e,{client:n,server:s}=r.weights.find(a=>a.weight===t)??{},o=n??s;return o?Z0(r.name,t,o):null},{cacheKey:([i])=>{const{client:e,server:t}=i.family.weights.find(r=>r.weight===i.weight)??{};return`${i.family.name}|${i.weight}|${e??t??""}`}});Ti(async function(e){return(await Promise.all(e.weights.map(async({weight:r,client:n,server:s})=>{const o=n??s;if(!o)return null;const a=Array.from(document.fonts).find(l=>l.family===e.name&&l.weight===r);if(a)return a;const c=await Z0(e.name,r,o);return document.fonts.add(c),c}))).filter(r=>r!==null)},{cacheKey:([i])=>JSON.stringify(i)});const zx=Ti(async({options:i})=>{const e=await qx(i.font);return e&&document.fonts.add(e),{font:i.font}}),Xx=Ti(async({config:i})=>i.src?new Promise((e,t)=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{e({image:r})},r.onerror=n=>{t(n)},r.src=i.src}):{image:null},{cacheKey:([{config:i}])=>JSON.stringify(i)});async function vA(i){return i.duration===1/0?new Promise(e=>{i.currentTime=Number.MAX_SAFE_INTEGER,i.ontimeupdate=()=>{i.ontimeupdate=null,e(i.duration),i.currentTime=0}}):i.duration}function ep(i,e){if(i.type==="video"&&i.alpha)return(e?i.alpha.mov:i.alpha.webm)||void 0}function Zx(i,e){return ep(i,e)??i.src}function yA(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function ew(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function tw({config:i,elementSize:e}){return new Promise(async t=>{let r=null;const{type:n,key:s,duration:o}=i,a=Zx(i,yA());n==="video"?(r=document.createElement("video"),r.playsInline=!0,e&&(r.width=e.width,r.height=e.height)):r=document.createElement("audio"),r.muted=!0,r.loop=!1,r.crossOrigin="anonymous",r.src=a;let c=!1;if(r.startLoadOnce=()=>{c||(r.preload="auto",r.load(),c=!0)},n==="video"&&o&&i.aspectRatio)r.preload="none",t({key:s,hls:null,node:r,aspectRatio:i.aspectRatio,totalDuration:o});else{r.preload="metadata";const l=async()=>{const u=await vA(r),A=r instanceof HTMLVideoElement&&r.videoHeight>0?r.videoWidth/r.videoHeight:null;t({key:s,hls:null,node:r,totalDuration:u,aspectRatio:A}),r.removeEventListener("loadedmetadata",l)};r.addEventListener("loadedmetadata",l)}})}function iw({key:i,playlist:e,duration:t,elementSize:r}){return new Promise(n=>{const s=document.createElement("video");s instanceof HTMLVideoElement&&(r&&(s.width=r.width,s.height=r.height),s.playsInline=!0),s.muted=!0,s.loop=!1,s.crossOrigin="anonymous";let o=!1,a=!1,c=!1;const l=new ai({autoStartLoad:!0,capLevelToPlayerSize:!1,xhrSetup:u=>{const{open:A}=u,h=e.split("?")[1];u.open=function(d,f,g){if(h&&!f.toString().includes("?")&&(f+="?"+h),!o&&f.toString().includes(".ts")){if(a)return;a=!0}A.apply(this,[d,f,g])}}});l.on(ai.Events.BUFFER_CODECS,async(u,A)=>{var h,d;if(c)return;const f=A.video,g=(h=f==null?void 0:f.metadata)==null?void 0:h.width,p=(d=f==null?void 0:f.metadata)==null?void 0:d.height;if(g&&p){c=!0,o||l==null||l.stopLoad();const I=t??await vA(s);n({key:i,hls:l,node:s,aspectRatio:g/p,totalDuration:I})}}),l.on(ai.Events.LEVEL_LOADED,async()=>{setTimeout(async()=>{if(c)return;c=!0,o||l==null||l.stopLoad();const u=t??await vA(s),A=l.levels[l.levels.length-1];n({key:i,hls:l,node:s,aspectRatio:A.width/A.height,totalDuration:u})},2e3)}),r&&l.on(ai.Events.MANIFEST_PARSED,()=>{const u=window.devicePixelRatio||1,A=Math.min(r.width,r.height)*u;let h=0;for(let d=l.levels.length-1;d>=0;d--)if(Math.min(l.levels[d].width,l.levels[d].height)<=A){h=d;break}l.autoLevelCapping=h}),l.loadSource(e),l.attachMedia(s),l.startLoadOnce=(u=-1,A)=>{if(l&&!o){const h=l.levels.findIndex(d=>Math.min(d.height,d.width)===A);o=!0,l.startLoad(u),h!==-1&&(l.currentLevel=h)}}})}function rw({config:i,elementSize:e}){const{playlist:t}=i;return!ep(i,yA())&&t&&!yA()&&ai.isSupported()?iw({key:i.key,playlist:t,duration:i.duration??0,elementSize:e}):tw({config:i,elementSize:e})}let nw=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 r=new AbortController,n=setTimeout(()=>{r.signal.aborted||(this.host._processing=!0)},t);return r.signal.addEventListener("abort",()=>{clearTimeout(n)}),r},this._mediaFactory=Ti(async(t,r)=>{var n,s,o,a;const{key:c}=r,l=((s=(n=this.host.shadowRoot)==null?void 0:n.host)==null?void 0:s.clientWidth)??0,u=((a=(o=this.host.shadowRoot)==null?void 0:o.host)==null?void 0:a.clientHeight)??0,A=await rw({config:r,elementSize:{width:l,height:u}}),h={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},d=Object.keys(h).reduce((f,g)=>{const p=g,I=h[p]({id:t,key:c,node:A.node});return f[p]=I,A.node.addEventListener(g,I),f},{});return{media:A,listeners:d,aspectRatio:A.aspectRatio,source:()=>A.node}},{cacheKey:([t,{key:r,src:n,playlist:s,...o}])=>{const a="alpha"in o&&o.alpha?{webm:o.alpha.webm.split("?")[0],mov:o.alpha.mov.split("?")[0]}:void 0;return JSON.stringify({id:t,key:r,src:n==null?void 0:n.split("?")[0],playlist:s==null?void 0:s.split("?")[0],alpha:a})}}),this._handleLoadedData=({id:t,key:r,node:n})=>()=>{const s=Vt(t,r),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:r,node:n}})))},this._handleWaiting=({id:t,key:r,node:n})=>()=>{const s=Vt(t,r),o=this.mediaState[s];o!=null&&o.initialised&&!(o!=null&&o.waiting)&&(this.mediaState={...this.mediaState,[s]:{...o,waiting:!0}},this.host.dispatchEvent(new CustomEvent("video:waiting",{detail:{id:t,key:r,node:n}})))},this._handleCanPlay=({id:t,key:r})=>()=>{const n=Vt(t,r),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:r,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:seeking",{detail:{id:t,key:r,node:n}}))},this._handleSeeked=({id:t,key:r,node:n})=>()=>{const s=Vt(t,r),o=this.mediaState[s];o!=null&&o.initialised&&(this.host.draw(),this.host.activeScenes.flatMap(a=>Ni(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:r,node:n}})))},this._handlePlay=({id:t,key:r,node:n})=>()=>{this.hasPlayed=!0,this.host.dispatchEvent(new CustomEvent("video:play",{detail:{id:t,key:r,node:n}}))},this._handlePlaying=({id:t,key:r,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:playing",{detail:{id:t,key:r,node:n}}))},this._handlePause=({id:t,key:r,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:pause",{detail:{id:t,key:r,node:n}}))},this._handleStalled=({id:t,key:r,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:stalled",{detail:{id:t,key:r,node:n}}))},this._handleTimeUpdate=({id:t,key:r,node:n})=>()=>{const s=this.media[Vt(t,r)];s!=null&&s.loop&&s.duration>0&&n.currentTime>=s.start+s.duration&&(n.currentTime=s.start,n.paused||n.play()),this.host.dispatchEvent(new CustomEvent("video:timeupdate",{detail:{id:t,key:r,node:n}}))},this._handleEnded=({id:t,key:r,node:n})=>()=>{const s=this.media[Vt(t,r)];if(s!=null&&s.loop){n.currentTime=s.start,this.host.paused||n.play();return}this.host.dispatchEvent(new CustomEvent("video:ended",{detail:{id:t,key:r,node:n}}))},this._handleError=({id:t,key:r,node:n})=>()=>{const s=new ba(`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:r,node:n}}))},this._cleanupMedia=t=>{var r;const n=this.media[t];n&&(n.node.pause(),n.node.src="",(r=n.hls)==null||r.destroy(),Object.keys(n.listeners??{}).forEach(s=>{var o,a;if((o=this.media)!=null&&o[t]){const c=(a=n.listeners)==null?void 0:a[s];c&&n.node.removeEventListener(s,c)}}),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 ro(this.host,async([e,t,r,n])=>{var s,o;this._compositionController.abort(),this._compositionController=new AbortController;const a=this._compositionController,c=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:r,resolution:1080});try{(o=this.composition)==null||o.cleanup();const f=await xd({debug:n,config:e,resolvers:{text:zx,image:Xx,video:async({id:g,config:p,options:I})=>{const{media:C,source:B}=await this._mediaFactory(g,{...p,...I});return{video:B,aspectRatio:C.aspectRatio}}},rootWidth:l,rootHeight:u});if(a.signal.aborted)return;this.composition=f}catch(f){throw new ba("Fatal composition error",f,!0)}this.duration=Number.isFinite(this.composition.duration)?this.composition.duration:0;const A={...this.media},h={...this.mediaState},d=[];for(const f of this.composition.tracks)for(const g of f.scenes){const p=Ni(g.layout.node);for(const I of p){const{media:C,listeners:B}=await this._mediaFactory(g.id,I),y=Vt(g.id,C.key);d.push(y);const x=(I.startOffset??0)*C.totalDuration,R=(1-(I.endOffset??0))*C.totalDuration;A[y]={...C,listeners:B,start:x,duration:R-x,speed:I.speed??1,volume:I.volume??1,loop:I.loop??!1},h[y]={initialised:!C,waiting:!!C,...this.mediaState[y]}}}this.media=A,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{c.abort(),this.host._processing=!1}},()=>[this.host.config,this.host.language,this.host.aspectRatio,this.host.debug])}_setMediaCurrentTime({time:e,scene:t}){const{id:r,layout:n,start:s}=t;Ni(n.node).forEach(({key:a})=>{const c=Vt(r,a);if(this.media[c]){const l=this.media[c],u=(e-s)*l.speed,A=l.loop&&l.duration>0?u%l.duration:u;l.node.currentTime=Ir(l.start,A+l.start,l.start+l.duration)}})}setMediaCurrentTime(e){var t;(t=this.composition)==null||t.tracks.forEach(r=>{r.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 sw(i){i.requestFullscreen?i.requestFullscreen():i.mozRequestFullScreen?i.mozRequestFullScreen():i.webkitRequestFullscreen?i.webkitRequestFullscreen():i.msRequestFullscreen&&i.msRequestFullscreen()}function ow(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const CA=["progress","play-large","navigation","play","volume","current-time","duration","levels","speed","captions","fullscreen","preview"],aw={id:"captions",event:"captions:click",label:"Closed Captions"},lw={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},tp={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}]},cw={id:"playbackRate",label:"Playback playbackRate",subItems:tp};class Aw extends uu{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==tn.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)),fi}}const BA=rn(Aw),uw=pS(()=>{const i=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"}),r=new FontFace("Roobert Captions","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),n=yd.map(s=>({load:!1,font:new FontFace(s.family,`url(${s.url})`,{style:s.style})}));return[{load:!0,font:i},{load:!0,font:e},{load:!0,font:t},{load:!0,font:r},...n]}),Oi={"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"},hw={colors:Oi,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 ${Oi["dark-100"]}`,medium:`0 .125rem .625rem ${Oi["dark-100"]}`,large:`0 .25rem 1rem ${Oi["dark-50"]}`,xl:`.25rem .25rem 1rem ${Oi["dark-250"]}`,xxl:`0 .25rem 2rem ${Oi["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${Oi["dark-250"]}`,toolbar:`0 -.625rem .625rem ${Oi["dark-50"]}`,text:`0 0 .25rem ${Oi["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:Oi["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},ip=dS(hw,{delimiter:"-"}),dw=Object.keys(ip).map(i=>Pn(`:host { --${i}: ${ip[i]}; }`)),nt=(i=>{const e=class extends i{firstUpdated(){uw().forEach(({load:s,font:o})=>{document.fonts.add(o),s&&o.load()})}};return e.styles=[(i==null?void 0:i.styles)??[],dw,Et`
|
|
2515
2515
|
:host {
|
|
2516
2516
|
font-family: var(--fontFamilies-sans);
|
|
2517
2517
|
font-size: var(--fontSizes-medium);
|