@vouchfor/embeds 8.0.3 → 8.1.0
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 +1 -1
- package/dist/iife/dialog-embed/embed.iife.js +1 -1
- package/dist/iife/dialog-embed/embed.iife.js.map +1 -1
- package/dist/iife/embeds.iife.js +1 -1
- package/dist/iife/embeds.iife.js.map +1 -1
- package/dist/iife/player-embed/embed.iife.js +1 -1
- package/dist/iife/player-embed/embed.iife.js.map +1 -1
- package/package.json +4 -4
package/dist/es/embeds.js
CHANGED
|
@@ -2472,7 +2472,7 @@ vec4 transition(vec2 uv) {
|
|
|
2472
2472
|
vec4 b=getToColor(p);
|
|
2473
2473
|
return mix(a, b, step(0.0+p.y,progress));
|
|
2474
2474
|
}
|
|
2475
|
-
`,author:"Jake Nelson",license:"MIT",createdAt:"Wed, 1 Nov 2017 15:24:36 -0500",updatedAt:"Thu, 2 Nov 2017 18:37:42 -0500"}];const wh=Ua(Rv);var Qh;function Dv(i){if(typeof i=="string"){const[e,t]=i.split(":");return Math.min(parseFloat(e),parseFloat(t))}return i}function Lv(i){if(typeof i=="string"){const[e,t]=i.split(":"),r=parseFloat(e),n=parseFloat(t);return r/n}return i}function ml({resolution:i,aspectRatio:e}){const t=Dv(i),r=Lv(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 _h={linear:Vm,easeIn:Na,easeInOut:Wm,easeOut:Km,circIn:Tu,circInOut:qm,circOut:bu,backIn:Oa,backInOut:jm,backOut:Jm,anticipate:Xm,bounceIn:tE,bounceInOut:iE,bounceOut:Ns},so=iu((i,e,{clamp:t=!0,ease:r="easeIn",...n}={})=>Om(i,e,{...n,clamp:t,ease:_h[r]}),{cacheKey:([i,e,t])=>JSON.stringify({from:i,to:e,options:t})}),kv={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:so([0,1],[n,s],{ease:e})(t)}}}},oo={type:"fade",processor:{getTargetState:i=>({opacity:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({opacity:so([0,1],[r.opacity,i],{ease:e})(t)})}},Mv={type:"scale",processor:{getTargetState:i=>({scale:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({scale:so([0,1],[r.scale,i],{ease:e})(t)})}},Rh={type:"translate",processor:{getTargetState:i=>({translation:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({translation:so([0,1],[r.translation,i],{ease:e})(t)})}},Fv=[{label:"Both",value:"both"},{label:"At start",value:"enter"},{label:"At end",value:"exit"}],Pv=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"},{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],Nv=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"}],Ov=[{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],Un={timing:{type:"buttonRadio",name:"timing",label:"Animate",options:Fv},speed:{type:"slider",name:"speed",label:"Speed",min:0,max:100,step:1}},El={type:"switch",name:"reverseExit",label:"Reverse exit animation"},Uv=.2,Gv=1;function $v(i,e){const t=i==="both"?e/2:e;return Math.min(Gv,t)}function Gn({speed:i,timing:e,elementDuration:t}){const r=$v(e,t),n=Math.min(Uv,r),s=Math.max(0,Math.min(100,i))/100;return r-s*(r-n)}const Hv="easeOut";function $n(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:Hv,...((t=i==null?void 0:i.options)==null?void 0:t.call(i,e))??{}}}}}function Xi({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 Dh="fade",Yv={type:Dh,name:"Fade",options:{...Un},transform:$n(),generate:(i,e)=>{const t=Gn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration});return{fade:{keyframes:Xi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:oo}}}},Lh="pan",kh=.25,Mh="left";function Fh(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 Fh(Mh,e,t)}}function Vv(i){return{x:-i.x,y:-i.y}}const Kv={type:Lh,name:"Pan",options:{...Un,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Nv},distance:{type:"slider",name:"distance",label:"Distance",min:.1,max:1,step:.05,transform:{format:i=>`${(i*100).toFixed(0)}%`}},reverseExit:El},transform:$n({values:i=>({direction:i.direction??Mh,distance:[i.distance??kh],reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,distance:i.distance[0],reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=Gn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=i.distance??kh,n=Fh(i.direction,e.elementDimensions,r),s=Vv(n);return{fade:{keyframes:Xi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:oo},translate:{keyframes:Xi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:n,exitTo:s,restValue:{x:0,y:0}}),renderer:Rh}}}},Ph="pop",Nh=.5,Wv={type:Ph,name:"Pop",options:{...Un},transform:$n(),generate:(i,e)=>{const t=Gn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration});return{fade:{keyframes:Xi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:oo},scale:{keyframes:Xi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:"backOut",enterFrom:Nh,exitTo:Nh,restValue:1}),renderer:Mv}}}},Oh="rise",Uh=50,qv="up";function Jv(i,e){switch(i){case"down":return{enterY:-e,exitY:e};case"up":default:return{enterY:e,exitY:-e}}}const jv={type:Oh,name:"Rise",options:{...Un,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Ov},distance:{type:"slider",name:"distance",label:"Distance",min:5,max:100,step:5,transform:{format:i=>`${i}px`}},reverseExit:El},transform:$n({values:i=>({direction:i.direction??qv,distance:[i.distance??Uh],reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,distance:i.distance[0],reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=Gn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=i.distance??Uh,{enterY:n,exitY:s}=Jv(i.direction,r);return{fade:{keyframes:Xi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:oo},translate:{keyframes:Xi({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:Rh}}}},Gh="wipe",Il="left";function Gr(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 Gr(Il)}}function $h(i){switch(i){case"left":return Gr("right");case"right":return Gr("left");case"up":return Gr("down");case"down":return Gr("up");default:return $h(Il)}}const Xv={coordinates:{x:0,y:0},dimensions:{width:1,height:1}},zv={type:Gh,name:"Wipe",options:{...Un,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Pv},reverseExit:El},transform:$n({values:i=>({direction:i.direction??Il,reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=Gn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=Gr(i.direction),n=$h(i.direction);return{clip:{keyframes:Xi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:r,exitTo:n,restValue:Xv}),renderer:kv}}}},Zv={[Dh]:Yv,[Oh]:jv,[Ph]:Wv,[Lh]:Kv,[Gh]:zv};function ey(i,e){const{type:t,...r}=i,n=Zv[t];if(!n)throw new Error(`Unknown preset type: ${t}`);return n.generate(r,e)}function ty({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 iy(i,e,t){const{preset:r,...n}=i;if(!r)return n;const s=ey(r,{elementDuration:e,elementDimensions:t});return{...n,...s}}function Hh({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=iy(t,r,n);for(const C of Object.values(I)){if(!C)continue;const B=ty({animation:C,sceneTime:e});B&&(p={...p,...B})}return p}const ry=[];for(let i=0;i<256;++i)ry.push((i+256).toString(16).slice(1));typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);function ny(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 ao=64;function sy(){const i=[],e={x:.5,y:.5},t=.5;for(let r=0;r<ao;r++){const n=r/ao*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 oy(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<ao;s++){const o=s/ao*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 Yh(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 lo(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 Vh(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 ly(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 cy(i="isosceles",e={}){switch(i){case"equilateral":return Ay();case"isosceles":return Kh(e.baseAngle??60);case"right":return uy(e.rightAnglePosition??"bottom-left");case"scalene":return hy(e.angles??[60,60,60])}}function Ay(){return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}]}function Kh(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 uy(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 hy(i){return Kh(i[0])}function dy(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 Yh(0,e);case"parallelogram":return Yh((n==null?void 0:n.angle)??30,e);case"triangle":return cy((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 Vh((o==null?void 0:o.angle)??90);case"diamond":return Vh(90);case"pentagon":return lo(5);case"hexagon":return lo(6);case"octagon":return lo(8);case"star":return ly((c==null?void 0:c.points)??5,(c==null?void 0:c.innerRadius)??.4);case"arrow":return ny((a==null?void 0:a.shaftRatio)??.4,(a==null?void 0:a.headRatio)??.4);case"heart":return ay();case"circle":return sy();case"ellipse":return oy(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 lo((l==null?void 0:l.sides)??6)}}function fy(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 gy(i,e){let t=1,r=0;const n=200;for(let s=0;s<=n;s++){const o=s/n;fy({x:o,y:i},e)&&(t=Math.min(t,o),r=Math.max(r,o))}return r>=t?{left:t,right:r}:null}function py(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:gy(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 my(i,e=1){const t=dy(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=py(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 Ey(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 Iy(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 vy(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 yy(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 Cy=Er(()=>Su.loadYoga());function Wh(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:w="start"}=t??{},_={static:i.POSITION_TYPE_STATIC,relative:i.POSITION_TYPE_RELATIVE,absolute:i.POSITION_TYPE_ABSOLUTE};if(e.setPositionType(_[n]),typeof s<"u"){const{top:D,right:K,bottom:X,left:re}=Iy(s,r);typeof D<"u"&&e.setPosition(i.EDGE_TOP,D),typeof K<"u"&&e.setPosition(i.EDGE_RIGHT,K),typeof X<"u"&&e.setPosition(i.EDGE_BOTTOM,X),typeof re<"u"&&e.setPosition(i.EDGE_LEFT,re)}const k={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(k[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 U={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(U[w]),typeof p<"u"){const{top:D,right:K,bottom:X,left:re}=vy(p,r);e.setMargin(i.EDGE_TOP,D),e.setMargin(i.EDGE_RIGHT,K),e.setMargin(i.EDGE_BOTTOM,X),e.setMargin(i.EDGE_LEFT,re)}if(typeof I<"u"){const{top:D,right:K,bottom:X,left:re}=yy(I,r);e.setPadding(i.EDGE_TOP,D),e.setPadding(i.EDGE_RIGHT,K),e.setPadding(i.EDGE_BOTTOM,X),e.setPadding(i.EDGE_LEFT,re)}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 qh({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();Wh(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 qh({id:i,yoga:e,index:p,parent:d,element:I,resolvers:s}));return{node:d,radius:Ey(l.radius),element:n,renderer:h,config:u,options:A,dependencies:f,childNodes:g}}function Jh(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=>Jh(i,d,u,A));return{...e,x:s+u,y:n+A,width:c,height:l,childNodes:h}}async function vl({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 vl({yoga:i,root:e,tree:c,measureCanvas:r}),s!=null&&s.shape){const A=n.getComputedWidth(),h=n.getComputedHeight(),d=my(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 vl({yoga:i,root:e,tree:c,measureCanvas:r})}}async function jh({id:i,root:e,resolvers:t,measureCanvas:r}){const n=await Cy(),s=n.Node.create();Wh(n,s,{layout:e.layout});const o=await qh({id:i,yoga:n,index:0,parent:s,element:e.element,resolvers:t});await vl({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:Jh(s,o)};return s.freeRecursive(),A}const Xh=/(?<value>\d+\.?\d*)(?=px)/;function yl({words:i,spaceMetrics:e,strokeWidth:t=0}){return i.reduce((r,n,s)=>{const o=n.metrics.width+t,a=s<i.length-1?e.width:0;return r+o+a},0)}iu(({context:i,font:e,fontSizes:t,words:r,maxW:n=1/0,strokeWidth:s=0,letterSpacing:o=0})=>{try{i.save(),i.letterSpacing=`${o}px`,i.font=e.replace(Xh,t[0].toString());const a=i.measureText("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");if(r.length<=0)return[];const c=i.measureText(r[0].text);return r.slice(1).reduce((l,u)=>{const A=l[l.length-1],h=i.measureText(u.text),d={...u,metrics:h},f=[...A.words,d],g=yl({strokeWidth:s,words:f,spaceMetrics:A.spaceMetrics});if(g>n){const p=t[l.length%t.length];i.font=e.replace(Xh,p.toString());const I=i.measureText(" "),C=i.measureText(u.text),B=[{...u,metrics:C}],y=i.measureText("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");l=[...l,{allMetrics:y,spaceMetrics:I,lineWidth:yl({strokeWidth:s,spaceMetrics:I,words:B}),font:i.font,words:B,lineHeight:y.actualBoundingBoxAscent+y.actualBoundingBoxDescent+s}]}else l[l.length-1]={...A,lineWidth:g,words:f};return l},[{allMetrics:a,lineWidth:yl({strokeWidth:s,words:[{...r[0],metrics:c}],spaceMetrics:i.measureText(" ")}),lineHeight:a.actualBoundingBoxAscent+a.actualBoundingBoxDescent+s,font:i.font,words:[{...r[0],metrics:c}],spaceMetrics:i.measureText(" ")}])}finally{i.restore()}},{cacheKey:([{font:i,fontSizes:e,words:t,maxW:r,strokeWidth:n,letterSpacing:s}])=>`${i}_${JSON.stringify(e)}_${JSON.stringify(t)}_${r}_${n}_${s}`});function By(i){return i.slice(0,1).toUpperCase()+i.slice(1)}const zh=[{family:"Noto Arabic",regex:new RegExp("\\p{Script=Arabic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansArabic-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Chinese",regex:new RegExp("\\p{Script=Han}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansSC-VariableFont_wght.woff2",style:"normal"},{family:"Noto Hebrew",regex:new RegExp("\\p{Script=Hebrew}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansHebrew-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Hindi",regex:new RegExp("\\p{Script=Devanagari}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansDevanagari-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Japanese",regex:new RegExp("\\p{Script=Han}|\\p{Script=Katakana}|\\p{Script=Hiragana}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansJP-VariableFont_wght.woff2",style:"normal"},{family:"Noto Korean",regex:new RegExp("\\p{Script=Hangul}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKR-VariableFont_wght.woff2",style:"normal"},{family:"Noto Color Emoji",regex:new RegExp("\\p{Extended_Pictographic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoColorEmoji-Regular.woff2",style:"normal"}];function Ty({text:i,font:e}){let t=e;return zh.forEach(({family:r,regex:n})=>{n.exec(i)&&(t+=`, ${r}`)}),t}Object.keys(_h).map(i=>({label:By(i),value:i,data:i}));function Zh(){return document.createElement("canvas")}function qt(i){let e=0;for(const t of i)Array.isArray(t)?e+=qt(t):e+=t;return e}function co(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 by(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 Sy(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,'\\"')}rE.filters.define("parse",i=>typeof i>"u"?null:typeof i=="string"?`"${Sy(i)}"`:by(i)||Array.isArray(i)?JSON.stringify(i):i);function xy(i){return i.some(({type:e})=>e==="text")}function wy(i){return i.some(({type:e})=>e==="caption")}function Qy(i){return i.some(({type:e})=>e==="audio")}function _y(i){return i.some(({type:e})=>e==="video"||e==="image")}function Cl(i){return i.type==="audio"}const Ry="3";async function Dy({scene:i,start:e=0}){const{id:t,root:r,duration:n}=i,s=await jh({id:t,root:r});return{type:i.type,start:e,duration:n,layout:s,id:i.id,config:i}}async function Ly({track:i}){const e=co(i),t=await Promise.all(i.reduce((s,o,a)=>{if(o.type!=="audio")return s;const c=qt(e.slice(0,a));return s.push(Dy({scene:o,start:c})),s},[])),r=i.reduce((s,o,a)=>{if(o.type!=="gap")return s;const c=qt(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 ed({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=Hh({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:w}=g,_=i.width*y.widthRatio,k=i.height*y.heightRatio;if(d.globalAlpha=p*n,(I.x||I.y)&&d.translate(I.x,I.y),(C!==1||w!==0)&&(d.translate(i.x+_/2,i.y+k/2),d.scale(C,C),d.rotate(w*Math.PI/180),d.translate(-(i.x+_/2),-(i.y+k/2))),B){d.beginPath();const D={x:i.x+B.x*_,y:i.y+B.y*k,width:B.width*_,height:B.height*k};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,_,k),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,U=(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:_,dh:k,radius:i.radius,options:F,dependencies:U}));for await(const D of i.childNodes)await ed({debug:o,node:D,canvases:e,sceneTime:t,sceneDuration:r,parentOpacity:d.globalAlpha,parentTransform:d.getTransform(),override:a});d.restore()}}async function ky({layout:i,canvases:e,sceneTime:t,sceneDuration:r,debug:n=!1,override:s}){const{node:o}=i;await ed({debug:n,node:o,canvases:e,sceneDuration:r,sceneTime:t,override:s})}async function Ao({debug:i=!1,scene:e,start:t=0,resolvers:r,rootWidth:n,rootHeight:s,canvasFactory:o=Zh}){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(),w=await jh({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}),_=async(k,F)=>{const U=Math.max(0,k-t);p.width=p.height=0,p.width=n,p.height=s,await ky({debug:i,layout:w,sceneTime:U,sceneDuration:g,canvases:{sceneCanvas:p,cropCanvas:I,letterboxCanvas:C,posterCanvas:B},override:F})};return{id:l,type:e.type,start:t,duration:g,layout:w,sceneCanvas:p,draw:_,config:e,childScenes:[]}}async function My({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=co(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=qt(o.slice(0,d));return h.type==="caption"&&A.push(Ao({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=qt(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=qt(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 Fy({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];Cl(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,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 Py({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 Hh({sceneTime:a,animations:i.animations,elementDuration:o,elementDimensions:{width:l,height:u}})}function td({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 Ny({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=co(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=qt(o.slice(0,d));return h.type==="video"&&A.push(Ao({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),h.type==="image"&&A.push(Ao({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=qt(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=qt(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 Oy({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=co(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=qt(o.slice(0,d));return h.type==="text"&&A.push(Ao({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=qt(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=qt(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 Uy=(((Qh=wh)==null?void 0:Qh.default)??wh).reduce((i,e)=>(i[e.name]=e,i),{});function Gy(i,e){return i.has(e)||i.set(e,{buffer:null,transitions:{},fromTexture:null,toTexture:null}),i.get(e)}function $y({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=Gy(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=to)==null?void 0:l.default)??to)(o,t),h.fromTexture.minFilter=o.LINEAR,h.fromTexture.magFilter=o.LINEAR),h.toTexture?h.toTexture.setPixels(e):(h.toTexture=(((u=to)==null?void 0:u.default)??to)(o,e),h.toTexture.minFilter=o.LINEAR,h.toTexture.magFilter=o.LINEAR),h.transitions[i]||(h.transitions[i]=(((A=xh)==null?void 0:A.default)??xh)(o,Uy[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 Hy(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 Yy({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),$y({name:i,to:e,from:t,progress:r,width:n.width,height:n.height,glContext:o,contextResources:s,returnPixels:!1}))}async function id({debug:i=!1,config:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s=Zh,drawTransition:o=Yy}){var a;const c=new Map,l=await Promise.all(e.tracks.map(async I=>{if(_y(I))return{...await Ny({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(xy(I))return{...await Oy({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(wy(I))return{...await My({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(Qy(I))return{...await Ly({track:I}),config:I};throw new Error("Unknown track type")})),u=(a=e.groups)!=null&&a.length?Fy({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 w=I.getContext("2d");if(!w)return;w.globalAlpha=1,w.globalCompositeOperation="source-over",w.clearRect(0,0,I.width,I.height),w.save(),w.fillStyle="black",w.fillRect(0,0,I.width,I.height),w.restore();const _=new Map;for(const D of l)if(!Cl(D))for(const K of D.scenes){if(C<K.start||C>=K.start+K.duration)continue;const X=K.layout,re=X==null?void 0:X.node,ne={start:K.start,end:K.start+K.duration,x:(re==null?void 0:re.x)??0,y:(re==null?void 0:re.y)??0,width:(re==null?void 0:re.width)??I.width,height:(re==null?void 0:re.height)??I.height};let L=A.get(K.id);for(;L;)L.animations&&(_.has(L.id)||_.set(L.id,[]),_.get(L.id).push(ne)),L=L.parentGroupId?d.get(L.parentGroupId):void 0}const k=new Map;function F(D){if(k.has(D.id))return k.get(D.id);const K=Py({group:D,currentTime:C,activeMembers:_.get(D.id)??[],fallbackDimensions:{width:I.width,height:I.height}});return k.set(D.id,K),K}function U(D,K,X){const re=f({id:X});if(re.length===0){D.drawImage(K,0,0,K.width,K.height);return}D.save();for(let ne=re.length-1;ne>=0;ne--){const L=re[ne],O=F(L);O&&td({group:L,animationState:O,targetCtx:D,fallbackDimensions:{width:I.width,height:I.height}})}D.drawImage(K,0,0,K.width,K.height),D.restore()}for(let D=0;D<l.length;D++){if(y!=null&&y.aborted)return;const K=l[D];if(Cl(K))continue;const{scenes:X,transitions:re,trackCanvas:ne}=K;ne.width=ne.height=0,ne.width=I.width,ne.height=I.height;const L=ne.getContext("2d");if(!L)continue;const O=X.filter(({start:x,duration:M})=>C>=x&&C<x+M);if(O.length===0)continue;const W=re.find(({start:x,duration:M})=>C>=x&&C<x+M),R=!!(W&&W.to&&W.from&&W.duration>0);for await(const x of O){if(y!=null&&y.aborted)return;const{sceneCanvas:M,draw:V,id:H}=x;if(await(V==null?void 0:V(C,B==null?void 0:B.get(H))),y!=null&&y.aborted)return;R&&(W.to.id===H||W.from.id===H)||U(L,M,H)}if(R){const{name:x,to:M,from:V,duration:H,transitionCanvas:te}=W;te.width=te.height=0,te.width=ne.width,te.height=ne.height;const se=Math.min(1,Math.max(0,(C-M.start)/H));if(await o({name:x,progress:se,contextResources:c,to:M.sceneCanvas,from:V.sceneCanvas,canvas:te}),y!=null&&y.aborted)return;const he=new Set(f({id:V.id})),ge=new Set(f({id:M.id})),Ce=[...he].filter(_e=>ge.has(_e)).sort((_e,fe)=>_e.depth-fe.depth);if(Ce.length===0)L.drawImage(te,0,0,te.width,te.height);else{L.save();for(const _e of Ce){const fe=F(_e);fe&&td({group:_e,animationState:fe,targetCtx:L,fallbackDimensions:{width:I.width,height:I.height}})}L.drawImage(te,0,0,te.width,te.height),L.restore()}}w.drawImage(ne,0,0,ne.width,ne.height)}},cleanup:()=>{Hy(c)},tracks:l,groups:u,aspectRatio:e.aspectRatio,transcriptions:e.transcriptions,duration:Math.max(...l.map(({duration:I})=>I))}}const Vy={version:"8.0.3"};function Ky(i){const{publicApiUrl:e}=Ls(i),t=Vi();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function Wy(i){var s,o,a,c,l,u,A,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:Vi()};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=Vi();return e||(e=Ky(i),(h=(A=window.localStorage)==null?void 0:A.setItem)==null||h.call(A,"vouch-uid-visitor",e)),t||(t=Vi(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),r||(r=Vi(),(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 qy(i,e){return i&&"vouchId"in i?i.vouchId:(e==null?void 0:e.id)??null}function Jy(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:Vy.version,templateVersion:Ry,...r}}const rd=1;class jy{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,r)=>{const n=qy(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}=Ls(this.host.env),{client:r,tab:n,request:s,visitor:o}=Wy(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":Jy(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:r}=this._currentlyPlayingVideo;this._streamLatestTime[r]>this._streamStartTime[r]+rd&&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]+rd&&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 Bl={exports:{}};(function(i,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof qi<"u"&&qi,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 qi<"u"&&qi||{},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(L){return L&&DataView.prototype.isPrototypeOf(L)}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(L){return L&&u.indexOf(Object.prototype.toString.call(L))>-1};function h(L){if(typeof L!="string"&&(L=String(L)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(L)||L==="")throw new TypeError('Invalid character in header field name: "'+L+'"');return L.toLowerCase()}function d(L){return typeof L!="string"&&(L=String(L)),L}function f(L){var O={next:function(){var W=L.shift();return{done:W===void 0,value:W}}};return c.iterable&&(O[Symbol.iterator]=function(){return O}),O}function g(L){this.map={},L instanceof g?L.forEach(function(O,W){this.append(W,O)},this):Array.isArray(L)?L.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):L&&Object.getOwnPropertyNames(L).forEach(function(O){this.append(O,L[O])},this)}g.prototype.append=function(L,O){L=h(L),O=d(O);var W=this.map[L];this.map[L]=W?W+", "+O:O},g.prototype.delete=function(L){delete this.map[h(L)]},g.prototype.get=function(L){return L=h(L),this.has(L)?this.map[L]:null},g.prototype.has=function(L){return this.map.hasOwnProperty(h(L))},g.prototype.set=function(L,O){this.map[h(L)]=d(O)},g.prototype.forEach=function(L,O){for(var W in this.map)this.map.hasOwnProperty(W)&&L.call(O,this.map[W],W,this)},g.prototype.keys=function(){var L=[];return this.forEach(function(O,W){L.push(W)}),f(L)},g.prototype.values=function(){var L=[];return this.forEach(function(O){L.push(O)}),f(L)},g.prototype.entries=function(){var L=[];return this.forEach(function(O,W){L.push([W,O])}),f(L)},c.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function p(L){if(!L._noBody){if(L.bodyUsed)return Promise.reject(new TypeError("Already read"));L.bodyUsed=!0}}function I(L){return new Promise(function(O,W){L.onload=function(){O(L.result)},L.onerror=function(){W(L.error)}})}function C(L){var O=new FileReader,W=I(O);return O.readAsArrayBuffer(L),W}function B(L){var O=new FileReader,W=I(O),R=/charset=([A-Za-z0-9_-]+)/.exec(L.type),x=R?R[1]:"utf-8";return O.readAsText(L,x),W}function y(L){for(var O=new Uint8Array(L),W=new Array(O.length),R=0;R<O.length;R++)W[R]=String.fromCharCode(O[R]);return W.join("")}function w(L){if(L.slice)return L.slice(0);var O=new Uint8Array(L.byteLength);return O.set(new Uint8Array(L)),O.buffer}function _(){return this.bodyUsed=!1,this._initBody=function(L){this.bodyUsed=this.bodyUsed,this._bodyInit=L,L?typeof L=="string"?this._bodyText=L:c.blob&&Blob.prototype.isPrototypeOf(L)?this._bodyBlob=L:c.formData&&FormData.prototype.isPrototypeOf(L)?this._bodyFormData=L:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)?this._bodyText=L.toString():c.arrayBuffer&&c.blob&&l(L)?(this._bodyArrayBuffer=w(L.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(L)||A(L))?this._bodyArrayBuffer=w(L):this._bodyText=L=Object.prototype.toString.call(L):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof L=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var L=p(this);if(L)return L;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var L=p(this);return L||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(c.blob)return this.blob().then(C);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var L=p(this);if(L)return L;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 k=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function F(L){var O=L.toUpperCase();return k.indexOf(O)>-1?O:L}function U(L,O){if(!(this instanceof U))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');O=O||{};var W=O.body;if(L instanceof U){if(L.bodyUsed)throw new TypeError("Already read");this.url=L.url,this.credentials=L.credentials,O.headers||(this.headers=new g(L.headers)),this.method=L.method,this.mode=L.mode,this.signal=L.signal,!W&&L._bodyInit!=null&&(W=L._bodyInit,L.bodyUsed=!0)}else this.url=String(L);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")&&W)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(W),(this.method==="GET"||this.method==="HEAD")&&(O.cache==="no-store"||O.cache==="no-cache")){var R=/([?&])_=[^&]*/;if(R.test(this.url))this.url=this.url.replace(R,"$1_="+new Date().getTime());else{var x=/\?/;this.url+=(x.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}U.prototype.clone=function(){return new U(this,{body:this._bodyInit})};function D(L){var O=new FormData;return L.trim().split("&").forEach(function(W){if(W){var R=W.split("="),x=R.shift().replace(/\+/g," "),M=R.join("=").replace(/\+/g," ");O.append(decodeURIComponent(x),decodeURIComponent(M))}}),O}function K(L){var O=new g,W=L.replace(/\r?\n[\t ]+/g," ");return W.split("\r").map(function(R){return R.indexOf(`
|
|
2475
|
+
`,author:"Jake Nelson",license:"MIT",createdAt:"Wed, 1 Nov 2017 15:24:36 -0500",updatedAt:"Thu, 2 Nov 2017 18:37:42 -0500"}];const wh=Ua(Rv);var Qh;function Dv(i){if(typeof i=="string"){const[e,t]=i.split(":");return Math.min(parseFloat(e),parseFloat(t))}return i}function Lv(i){if(typeof i=="string"){const[e,t]=i.split(":"),r=parseFloat(e),n=parseFloat(t);return r/n}return i}function ml({resolution:i,aspectRatio:e}){const t=Dv(i),r=Lv(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 _h={linear:Vm,easeIn:Na,easeInOut:Wm,easeOut:Km,circIn:Tu,circInOut:qm,circOut:bu,backIn:Oa,backInOut:jm,backOut:Jm,anticipate:Xm,bounceIn:tE,bounceInOut:iE,bounceOut:Ns},so=iu((i,e,{clamp:t=!0,ease:r="easeIn",...n}={})=>Om(i,e,{...n,clamp:t,ease:_h[r]}),{cacheKey:([i,e,t])=>JSON.stringify({from:i,to:e,options:t})}),kv={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:so([0,1],[n,s],{ease:e})(t)}}}},oo={type:"fade",processor:{getTargetState:i=>({opacity:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({opacity:so([0,1],[r.opacity,i],{ease:e})(t)})}},Mv={type:"scale",processor:{getTargetState:i=>({scale:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({scale:so([0,1],[r.scale,i],{ease:e})(t)})}},Rh={type:"translate",processor:{getTargetState:i=>({translation:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({translation:so([0,1],[r.translation,i],{ease:e})(t)})}},Fv=[{label:"Both",value:"both"},{label:"At start",value:"enter"},{label:"At end",value:"exit"}],Pv=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"},{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],Nv=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"}],Ov=[{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],Un={timing:{type:"buttonRadio",name:"timing",label:"Animate",options:Fv},speed:{type:"slider",name:"speed",label:"Speed",min:0,max:100,step:1}},El={type:"switch",name:"reverseExit",label:"Reverse exit animation"},Uv=.2,Gv=1;function $v(i,e){const t=i==="both"?e/2:e;return Math.min(Gv,t)}function Gn({speed:i,timing:e,elementDuration:t}){const r=$v(e,t),n=Math.min(Uv,r),s=Math.max(0,Math.min(100,i))/100;return r-s*(r-n)}const Hv="easeOut";function $n(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:Hv,...((t=i==null?void 0:i.options)==null?void 0:t.call(i,e))??{}}}}}function Xi({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 Dh="fade",Yv={type:Dh,name:"Fade",options:{...Un},transform:$n(),generate:(i,e)=>{const t=Gn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration});return{fade:{keyframes:Xi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:oo}}}},Lh="pan",kh=.25,Mh="left";function Fh(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 Fh(Mh,e,t)}}function Vv(i){return{x:-i.x,y:-i.y}}const Kv={type:Lh,name:"Pan",options:{...Un,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Nv},distance:{type:"slider",name:"distance",label:"Distance",min:.1,max:1,step:.05,transform:{format:i=>`${(i*100).toFixed(0)}%`}},reverseExit:El},transform:$n({values:i=>({direction:i.direction??Mh,distance:[i.distance??kh],reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,distance:i.distance[0],reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=Gn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=i.distance??kh,n=Fh(i.direction,e.elementDimensions,r),s=Vv(n);return{fade:{keyframes:Xi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:oo},translate:{keyframes:Xi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:n,exitTo:s,restValue:{x:0,y:0}}),renderer:Rh}}}},Ph="pop",Nh=.5,Wv={type:Ph,name:"Pop",options:{...Un},transform:$n(),generate:(i,e)=>{const t=Gn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration});return{fade:{keyframes:Xi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:oo},scale:{keyframes:Xi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:"backOut",enterFrom:Nh,exitTo:Nh,restValue:1}),renderer:Mv}}}},Oh="rise",Uh=50,qv="up";function Jv(i,e){switch(i){case"down":return{enterY:-e,exitY:e};case"up":default:return{enterY:e,exitY:-e}}}const jv={type:Oh,name:"Rise",options:{...Un,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Ov},distance:{type:"slider",name:"distance",label:"Distance",min:5,max:100,step:5,transform:{format:i=>`${i}px`}},reverseExit:El},transform:$n({values:i=>({direction:i.direction??qv,distance:[i.distance??Uh],reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,distance:i.distance[0],reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=Gn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=i.distance??Uh,{enterY:n,exitY:s}=Jv(i.direction,r);return{fade:{keyframes:Xi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:oo},translate:{keyframes:Xi({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:Rh}}}},Gh="wipe",Il="left";function Gr(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 Gr(Il)}}function $h(i){switch(i){case"left":return Gr("right");case"right":return Gr("left");case"up":return Gr("down");case"down":return Gr("up");default:return $h(Il)}}const Xv={coordinates:{x:0,y:0},dimensions:{width:1,height:1}},zv={type:Gh,name:"Wipe",options:{...Un,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Pv},reverseExit:El},transform:$n({values:i=>({direction:i.direction??Il,reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=Gn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=Gr(i.direction),n=$h(i.direction);return{clip:{keyframes:Xi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:r,exitTo:n,restValue:Xv}),renderer:kv}}}},Zv={[Dh]:Yv,[Oh]:jv,[Ph]:Wv,[Lh]:Kv,[Gh]:zv};function ey(i,e){const{type:t,...r}=i,n=Zv[t];if(!n)throw new Error(`Unknown preset type: ${t}`);return n.generate(r,e)}function ty({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 iy(i,e,t){const{preset:r,...n}=i;if(!r)return n;const s=ey(r,{elementDuration:e,elementDimensions:t});return{...n,...s}}function Hh({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=iy(t,r,n);for(const C of Object.values(I)){if(!C)continue;const B=ty({animation:C,sceneTime:e});B&&(p={...p,...B})}return p}const ry=[];for(let i=0;i<256;++i)ry.push((i+256).toString(16).slice(1));typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);function ny(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 ao=64;function sy(){const i=[],e={x:.5,y:.5},t=.5;for(let r=0;r<ao;r++){const n=r/ao*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 oy(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<ao;s++){const o=s/ao*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 Yh(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 lo(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 Vh(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 ly(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 cy(i="isosceles",e={}){switch(i){case"equilateral":return Ay();case"isosceles":return Kh(e.baseAngle??60);case"right":return uy(e.rightAnglePosition??"bottom-left");case"scalene":return hy(e.angles??[60,60,60])}}function Ay(){return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}]}function Kh(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 uy(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 hy(i){return Kh(i[0])}function dy(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 Yh(0,e);case"parallelogram":return Yh((n==null?void 0:n.angle)??30,e);case"triangle":return cy((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 Vh((o==null?void 0:o.angle)??90);case"diamond":return Vh(90);case"pentagon":return lo(5);case"hexagon":return lo(6);case"octagon":return lo(8);case"star":return ly((c==null?void 0:c.points)??5,(c==null?void 0:c.innerRadius)??.4);case"arrow":return ny((a==null?void 0:a.shaftRatio)??.4,(a==null?void 0:a.headRatio)??.4);case"heart":return ay();case"circle":return sy();case"ellipse":return oy(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 lo((l==null?void 0:l.sides)??6)}}function fy(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 gy(i,e){let t=1,r=0;const n=200;for(let s=0;s<=n;s++){const o=s/n;fy({x:o,y:i},e)&&(t=Math.min(t,o),r=Math.max(r,o))}return r>=t?{left:t,right:r}:null}function py(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:gy(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 my(i,e=1){const t=dy(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=py(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 Ey(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 Iy(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 vy(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 yy(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 Cy=Er(()=>Su.loadYoga());function Wh(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:w="start"}=t??{},_={static:i.POSITION_TYPE_STATIC,relative:i.POSITION_TYPE_RELATIVE,absolute:i.POSITION_TYPE_ABSOLUTE};if(e.setPositionType(_[n]),typeof s<"u"){const{top:D,right:K,bottom:X,left:re}=Iy(s,r);typeof D<"u"&&e.setPosition(i.EDGE_TOP,D),typeof K<"u"&&e.setPosition(i.EDGE_RIGHT,K),typeof X<"u"&&e.setPosition(i.EDGE_BOTTOM,X),typeof re<"u"&&e.setPosition(i.EDGE_LEFT,re)}const k={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(k[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 U={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(U[w]),typeof p<"u"){const{top:D,right:K,bottom:X,left:re}=vy(p,r);e.setMargin(i.EDGE_TOP,D),e.setMargin(i.EDGE_RIGHT,K),e.setMargin(i.EDGE_BOTTOM,X),e.setMargin(i.EDGE_LEFT,re)}if(typeof I<"u"){const{top:D,right:K,bottom:X,left:re}=yy(I,r);e.setPadding(i.EDGE_TOP,D),e.setPadding(i.EDGE_RIGHT,K),e.setPadding(i.EDGE_BOTTOM,X),e.setPadding(i.EDGE_LEFT,re)}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 qh({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();Wh(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 qh({id:i,yoga:e,index:p,parent:d,element:I,resolvers:s}));return{node:d,radius:Ey(l.radius),element:n,renderer:h,config:u,options:A,dependencies:f,childNodes:g}}function Jh(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=>Jh(i,d,u,A));return{...e,x:s+u,y:n+A,width:c,height:l,childNodes:h}}async function vl({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 vl({yoga:i,root:e,tree:c,measureCanvas:r}),s!=null&&s.shape){const A=n.getComputedWidth(),h=n.getComputedHeight(),d=my(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 vl({yoga:i,root:e,tree:c,measureCanvas:r})}}async function jh({id:i,root:e,resolvers:t,measureCanvas:r}){const n=await Cy(),s=n.Node.create();Wh(n,s,{layout:e.layout});const o=await qh({id:i,yoga:n,index:0,parent:s,element:e.element,resolvers:t});await vl({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:Jh(s,o)};return s.freeRecursive(),A}const Xh=/(?<value>\d+\.?\d*)(?=px)/;function yl({words:i,spaceMetrics:e,strokeWidth:t=0}){return i.reduce((r,n,s)=>{const o=n.metrics.width+t,a=s<i.length-1?e.width:0;return r+o+a},0)}iu(({context:i,font:e,fontSizes:t,words:r,maxW:n=1/0,strokeWidth:s=0,letterSpacing:o=0})=>{try{i.save(),i.letterSpacing=`${o}px`,i.font=e.replace(Xh,t[0].toString());const a=i.measureText("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");if(r.length<=0)return[];const c=i.measureText(r[0].text);return r.slice(1).reduce((l,u)=>{const A=l[l.length-1],h=i.measureText(u.text),d={...u,metrics:h},f=[...A.words,d],g=yl({strokeWidth:s,words:f,spaceMetrics:A.spaceMetrics});if(g>n){const p=t[l.length%t.length];i.font=e.replace(Xh,p.toString());const I=i.measureText(" "),C=i.measureText(u.text),B=[{...u,metrics:C}],y=i.measureText("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");l=[...l,{allMetrics:y,spaceMetrics:I,lineWidth:yl({strokeWidth:s,spaceMetrics:I,words:B}),font:i.font,words:B,lineHeight:y.actualBoundingBoxAscent+y.actualBoundingBoxDescent+s}]}else l[l.length-1]={...A,lineWidth:g,words:f};return l},[{allMetrics:a,lineWidth:yl({strokeWidth:s,words:[{...r[0],metrics:c}],spaceMetrics:i.measureText(" ")}),lineHeight:a.actualBoundingBoxAscent+a.actualBoundingBoxDescent+s,font:i.font,words:[{...r[0],metrics:c}],spaceMetrics:i.measureText(" ")}])}finally{i.restore()}},{cacheKey:([{font:i,fontSizes:e,words:t,maxW:r,strokeWidth:n,letterSpacing:s}])=>`${i}_${JSON.stringify(e)}_${JSON.stringify(t)}_${r}_${n}_${s}`});function By(i){return i.slice(0,1).toUpperCase()+i.slice(1)}const zh=[{family:"Noto Arabic",regex:new RegExp("\\p{Script=Arabic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansArabic-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Chinese",regex:new RegExp("\\p{Script=Han}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansSC-VariableFont_wght.woff2",style:"normal"},{family:"Noto Hebrew",regex:new RegExp("\\p{Script=Hebrew}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansHebrew-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Hindi",regex:new RegExp("\\p{Script=Devanagari}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansDevanagari-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Japanese",regex:new RegExp("\\p{Script=Han}|\\p{Script=Katakana}|\\p{Script=Hiragana}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansJP-VariableFont_wght.woff2",style:"normal"},{family:"Noto Korean",regex:new RegExp("\\p{Script=Hangul}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKR-VariableFont_wght.woff2",style:"normal"},{family:"Noto Color Emoji",regex:new RegExp("\\p{Extended_Pictographic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoColorEmoji-Regular.woff2",style:"normal"}];function Ty({text:i,font:e}){let t=e;return zh.forEach(({family:r,regex:n})=>{n.exec(i)&&(t+=`, ${r}`)}),t}Object.keys(_h).map(i=>({label:By(i),value:i,data:i}));function Zh(){return document.createElement("canvas")}function qt(i){let e=0;for(const t of i)Array.isArray(t)?e+=qt(t):e+=t;return e}function co(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 by(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 Sy(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,'\\"')}rE.filters.define("parse",i=>typeof i>"u"?null:typeof i=="string"?`"${Sy(i)}"`:by(i)||Array.isArray(i)?JSON.stringify(i):i);function xy(i){return i.some(({type:e})=>e==="text")}function wy(i){return i.some(({type:e})=>e==="caption")}function Qy(i){return i.some(({type:e})=>e==="audio")}function _y(i){return i.some(({type:e})=>e==="video"||e==="image")}function Cl(i){return i.type==="audio"}const Ry="3";async function Dy({scene:i,start:e=0}){const{id:t,root:r,duration:n}=i,s=await jh({id:t,root:r});return{type:i.type,start:e,duration:n,layout:s,id:i.id,config:i}}async function Ly({track:i}){const e=co(i),t=await Promise.all(i.reduce((s,o,a)=>{if(o.type!=="audio")return s;const c=qt(e.slice(0,a));return s.push(Dy({scene:o,start:c})),s},[])),r=i.reduce((s,o,a)=>{if(o.type!=="gap")return s;const c=qt(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 ed({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=Hh({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:w}=g,_=i.width*y.widthRatio,k=i.height*y.heightRatio;if(d.globalAlpha=p*n,(I.x||I.y)&&d.translate(I.x,I.y),(C!==1||w!==0)&&(d.translate(i.x+_/2,i.y+k/2),d.scale(C,C),d.rotate(w*Math.PI/180),d.translate(-(i.x+_/2),-(i.y+k/2))),B){d.beginPath();const D={x:i.x+B.x*_,y:i.y+B.y*k,width:B.width*_,height:B.height*k};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,_,k),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,U=(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:_,dh:k,radius:i.radius,options:F,dependencies:U}));for await(const D of i.childNodes)await ed({debug:o,node:D,canvases:e,sceneTime:t,sceneDuration:r,parentOpacity:d.globalAlpha,parentTransform:d.getTransform(),override:a});d.restore()}}async function ky({layout:i,canvases:e,sceneTime:t,sceneDuration:r,debug:n=!1,override:s}){const{node:o}=i;await ed({debug:n,node:o,canvases:e,sceneDuration:r,sceneTime:t,override:s})}async function Ao({debug:i=!1,scene:e,start:t=0,resolvers:r,rootWidth:n,rootHeight:s,canvasFactory:o=Zh}){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(),w=await jh({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}),_=async(k,F)=>{const U=Math.max(0,k-t);p.width=p.height=0,p.width=n,p.height=s,await ky({debug:i,layout:w,sceneTime:U,sceneDuration:g,canvases:{sceneCanvas:p,cropCanvas:I,letterboxCanvas:C,posterCanvas:B},override:F})};return{id:l,type:e.type,start:t,duration:g,layout:w,sceneCanvas:p,draw:_,config:e,childScenes:[]}}async function My({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=co(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=qt(o.slice(0,d));return h.type==="caption"&&A.push(Ao({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=qt(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=qt(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 Fy({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];Cl(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 Py({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 Hh({sceneTime:a,animations:i.animations,elementDuration:o,elementDimensions:{width:l,height:u}})}function td({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 Ny({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=co(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=qt(o.slice(0,d));return h.type==="video"&&A.push(Ao({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),h.type==="image"&&A.push(Ao({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=qt(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=qt(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 Oy({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=co(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=qt(o.slice(0,d));return h.type==="text"&&A.push(Ao({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=qt(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=qt(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 Uy=(((Qh=wh)==null?void 0:Qh.default)??wh).reduce((i,e)=>(i[e.name]=e,i),{});function Gy(i,e){return i.has(e)||i.set(e,{buffer:null,transitions:{},fromTexture:null,toTexture:null}),i.get(e)}function $y({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=Gy(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=to)==null?void 0:l.default)??to)(o,t),h.fromTexture.minFilter=o.LINEAR,h.fromTexture.magFilter=o.LINEAR),h.toTexture?h.toTexture.setPixels(e):(h.toTexture=(((u=to)==null?void 0:u.default)??to)(o,e),h.toTexture.minFilter=o.LINEAR,h.toTexture.magFilter=o.LINEAR),h.transitions[i]||(h.transitions[i]=(((A=xh)==null?void 0:A.default)??xh)(o,Uy[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 Hy(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 Yy({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),$y({name:i,to:e,from:t,progress:r,width:n.width,height:n.height,glContext:o,contextResources:s,returnPixels:!1}))}async function id({debug:i=!1,config:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s=Zh,drawTransition:o=Yy}){var a;const c=new Map,l=await Promise.all(e.tracks.map(async I=>{if(_y(I))return{...await Ny({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(xy(I))return{...await Oy({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(wy(I))return{...await My({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(Qy(I))return{...await Ly({track:I}),config:I};throw new Error("Unknown track type")})),u=(a=e.groups)!=null&&a.length?Fy({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 w=I.getContext("2d");if(!w)return;w.globalAlpha=1,w.globalCompositeOperation="source-over",w.clearRect(0,0,I.width,I.height),w.save(),w.fillStyle="black",w.fillRect(0,0,I.width,I.height),w.restore();const _=new Map;for(const D of l)if(!Cl(D))for(const K of D.scenes){if(C<K.start||C>=K.start+K.duration)continue;const X=K.layout,re=X==null?void 0:X.node,ne={start:K.start,end:K.start+K.duration,x:(re==null?void 0:re.x)??0,y:(re==null?void 0:re.y)??0,width:(re==null?void 0:re.width)??I.width,height:(re==null?void 0:re.height)??I.height};let L=A.get(K.id);for(;L;)L.animations&&(_.has(L.id)||_.set(L.id,[]),_.get(L.id).push(ne)),L=L.parentGroupId?d.get(L.parentGroupId):void 0}const k=new Map;function F(D){if(k.has(D.id))return k.get(D.id);const K=Py({group:D,currentTime:C,activeMembers:_.get(D.id)??[],fallbackDimensions:{width:I.width,height:I.height}});return k.set(D.id,K),K}function U(D,K,X){const re=f({id:X});if(re.length===0){D.drawImage(K,0,0,K.width,K.height);return}D.save();for(let ne=re.length-1;ne>=0;ne--){const L=re[ne],O=F(L);O&&td({group:L,animationState:O,targetCtx:D,fallbackDimensions:{width:I.width,height:I.height}})}D.drawImage(K,0,0,K.width,K.height),D.restore()}for(let D=0;D<l.length;D++){if(y!=null&&y.aborted)return;const K=l[D];if(Cl(K))continue;const{scenes:X,transitions:re,trackCanvas:ne}=K;ne.width=ne.height=0,ne.width=I.width,ne.height=I.height;const L=ne.getContext("2d");if(!L)continue;const O=X.filter(({start:x,duration:M})=>C>=x&&C<x+M);if(O.length===0)continue;const W=re.find(({start:x,duration:M})=>C>=x&&C<x+M),R=!!(W&&W.to&&W.from&&W.duration>0);for await(const x of O){if(y!=null&&y.aborted)return;const{sceneCanvas:M,draw:V,id:H}=x;if(await(V==null?void 0:V(C,B==null?void 0:B.get(H))),y!=null&&y.aborted)return;R&&(W.to.id===H||W.from.id===H)||U(L,M,H)}if(R){const{name:x,to:M,from:V,duration:H,transitionCanvas:te}=W;te.width=te.height=0,te.width=ne.width,te.height=ne.height;const se=Math.min(1,Math.max(0,(C-M.start)/H));if(await o({name:x,progress:se,contextResources:c,to:M.sceneCanvas,from:V.sceneCanvas,canvas:te}),y!=null&&y.aborted)return;const he=new Set(f({id:V.id})),ge=new Set(f({id:M.id})),Ce=[...he].filter(_e=>ge.has(_e)).sort((_e,fe)=>_e.depth-fe.depth);if(Ce.length===0)L.drawImage(te,0,0,te.width,te.height);else{L.save();for(const _e of Ce){const fe=F(_e);fe&&td({group:_e,animationState:fe,targetCtx:L,fallbackDimensions:{width:I.width,height:I.height}})}L.drawImage(te,0,0,te.width,te.height),L.restore()}}w.drawImage(ne,0,0,ne.width,ne.height)}},cleanup:()=>{Hy(c)},tracks:l,groups:u,aspectRatio:e.aspectRatio,transcriptions:e.transcriptions,duration:Math.max(...l.map(({duration:I})=>I))}}const Vy={version:"8.1.0"};function Ky(i){const{publicApiUrl:e}=Ls(i),t=Vi();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function Wy(i){var s,o,a,c,l,u,A,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:Vi()};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=Vi();return e||(e=Ky(i),(h=(A=window.localStorage)==null?void 0:A.setItem)==null||h.call(A,"vouch-uid-visitor",e)),t||(t=Vi(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),r||(r=Vi(),(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 qy(i,e){return i&&"vouchId"in i?i.vouchId:(e==null?void 0:e.id)??null}function Jy(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:Vy.version,templateVersion:Ry,...r}}const rd=1;class jy{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,r)=>{const n=qy(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}=Ls(this.host.env),{client:r,tab:n,request:s,visitor:o}=Wy(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":Jy(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:r}=this._currentlyPlayingVideo;this._streamLatestTime[r]>this._streamStartTime[r]+rd&&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]+rd&&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 Bl={exports:{}};(function(i,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof qi<"u"&&qi,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 qi<"u"&&qi||{},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(L){return L&&DataView.prototype.isPrototypeOf(L)}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(L){return L&&u.indexOf(Object.prototype.toString.call(L))>-1};function h(L){if(typeof L!="string"&&(L=String(L)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(L)||L==="")throw new TypeError('Invalid character in header field name: "'+L+'"');return L.toLowerCase()}function d(L){return typeof L!="string"&&(L=String(L)),L}function f(L){var O={next:function(){var W=L.shift();return{done:W===void 0,value:W}}};return c.iterable&&(O[Symbol.iterator]=function(){return O}),O}function g(L){this.map={},L instanceof g?L.forEach(function(O,W){this.append(W,O)},this):Array.isArray(L)?L.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):L&&Object.getOwnPropertyNames(L).forEach(function(O){this.append(O,L[O])},this)}g.prototype.append=function(L,O){L=h(L),O=d(O);var W=this.map[L];this.map[L]=W?W+", "+O:O},g.prototype.delete=function(L){delete this.map[h(L)]},g.prototype.get=function(L){return L=h(L),this.has(L)?this.map[L]:null},g.prototype.has=function(L){return this.map.hasOwnProperty(h(L))},g.prototype.set=function(L,O){this.map[h(L)]=d(O)},g.prototype.forEach=function(L,O){for(var W in this.map)this.map.hasOwnProperty(W)&&L.call(O,this.map[W],W,this)},g.prototype.keys=function(){var L=[];return this.forEach(function(O,W){L.push(W)}),f(L)},g.prototype.values=function(){var L=[];return this.forEach(function(O){L.push(O)}),f(L)},g.prototype.entries=function(){var L=[];return this.forEach(function(O,W){L.push([W,O])}),f(L)},c.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function p(L){if(!L._noBody){if(L.bodyUsed)return Promise.reject(new TypeError("Already read"));L.bodyUsed=!0}}function I(L){return new Promise(function(O,W){L.onload=function(){O(L.result)},L.onerror=function(){W(L.error)}})}function C(L){var O=new FileReader,W=I(O);return O.readAsArrayBuffer(L),W}function B(L){var O=new FileReader,W=I(O),R=/charset=([A-Za-z0-9_-]+)/.exec(L.type),x=R?R[1]:"utf-8";return O.readAsText(L,x),W}function y(L){for(var O=new Uint8Array(L),W=new Array(O.length),R=0;R<O.length;R++)W[R]=String.fromCharCode(O[R]);return W.join("")}function w(L){if(L.slice)return L.slice(0);var O=new Uint8Array(L.byteLength);return O.set(new Uint8Array(L)),O.buffer}function _(){return this.bodyUsed=!1,this._initBody=function(L){this.bodyUsed=this.bodyUsed,this._bodyInit=L,L?typeof L=="string"?this._bodyText=L:c.blob&&Blob.prototype.isPrototypeOf(L)?this._bodyBlob=L:c.formData&&FormData.prototype.isPrototypeOf(L)?this._bodyFormData=L:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)?this._bodyText=L.toString():c.arrayBuffer&&c.blob&&l(L)?(this._bodyArrayBuffer=w(L.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(L)||A(L))?this._bodyArrayBuffer=w(L):this._bodyText=L=Object.prototype.toString.call(L):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof L=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var L=p(this);if(L)return L;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var L=p(this);return L||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(c.blob)return this.blob().then(C);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var L=p(this);if(L)return L;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 k=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function F(L){var O=L.toUpperCase();return k.indexOf(O)>-1?O:L}function U(L,O){if(!(this instanceof U))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');O=O||{};var W=O.body;if(L instanceof U){if(L.bodyUsed)throw new TypeError("Already read");this.url=L.url,this.credentials=L.credentials,O.headers||(this.headers=new g(L.headers)),this.method=L.method,this.mode=L.mode,this.signal=L.signal,!W&&L._bodyInit!=null&&(W=L._bodyInit,L.bodyUsed=!0)}else this.url=String(L);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")&&W)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(W),(this.method==="GET"||this.method==="HEAD")&&(O.cache==="no-store"||O.cache==="no-cache")){var R=/([?&])_=[^&]*/;if(R.test(this.url))this.url=this.url.replace(R,"$1_="+new Date().getTime());else{var x=/\?/;this.url+=(x.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}U.prototype.clone=function(){return new U(this,{body:this._bodyInit})};function D(L){var O=new FormData;return L.trim().split("&").forEach(function(W){if(W){var R=W.split("="),x=R.shift().replace(/\+/g," "),M=R.join("=").replace(/\+/g," ");O.append(decodeURIComponent(x),decodeURIComponent(M))}}),O}function K(L){var O=new g,W=L.replace(/\r?\n[\t ]+/g," ");return W.split("\r").map(function(R){return R.indexOf(`
|
|
2476
2476
|
`)===0?R.substr(1,R.length):R}).forEach(function(R){var x=R.split(":"),M=x.shift().trim();if(M){var V=x.join(":").trim();try{O.append(M,V)}catch(H){console.warn("Response "+H.message)}}}),O}_.call(U.prototype);function X(L,O){if(!(this instanceof X))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(L)}_.call(X.prototype),X.prototype.clone=function(){return new X(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},X.error=function(){var L=new X(null,{status:200,statusText:""});return L.ok=!1,L.status=0,L.type="error",L};var re=[301,302,303,307,308];X.redirect=function(L,O){if(re.indexOf(O)===-1)throw new RangeError("Invalid status code");return new X(null,{status:O,headers:{location:L}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(O,W){this.message=O,this.name=W;var R=Error(O);this.stack=R.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function ne(L,O){return new Promise(function(W,R){var x=new U(L,O);if(x.signal&&x.signal.aborted)return R(new o.DOMException("Aborted","AbortError"));var M=new XMLHttpRequest;function V(){M.abort()}M.onload=function(){var se={statusText:M.statusText,headers:K(M.getAllResponseHeaders()||"")};x.url.indexOf("file://")===0&&(M.status<200||M.status>599)?se.status=200:se.status=M.status,se.url="responseURL"in M?M.responseURL:se.headers.get("X-Request-URL");var he="response"in M?M.response:M.responseText;setTimeout(function(){W(new X(he,se))},0)},M.onerror=function(){setTimeout(function(){R(new TypeError("Network request failed"))},0)},M.ontimeout=function(){setTimeout(function(){R(new TypeError("Network request timed out"))},0)},M.onabort=function(){setTimeout(function(){R(new o.DOMException("Aborted","AbortError"))},0)};function H(se){try{return se===""&&a.location.href?a.location.href:se}catch{return se}}if(M.open(x.method,H(x.url),!0),x.credentials==="include"?M.withCredentials=!0:x.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 te=[];Object.getOwnPropertyNames(O.headers).forEach(function(se){te.push(h(se)),M.setRequestHeader(se,d(O.headers[se]))}),x.headers.forEach(function(se,he){te.indexOf(he)===-1&&M.setRequestHeader(he,se)})}else x.headers.forEach(function(se,he){M.setRequestHeader(he,se)});x.signal&&(x.signal.addEventListener("abort",V),M.onreadystatechange=function(){M.readyState===4&&x.signal.removeEventListener("abort",V)}),M.send(typeof x._bodyInit>"u"?null:x._bodyInit)})}return ne.polyfill=!0,a.fetch||(a.fetch=ne,a.Headers=g,a.Request=U,a.Response=X),o.Headers=g,o.Request=U,o.Response=X,o.fetch=ne,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})(Bl,Bl.exports);var Xy=Bl.exports;const nd=Ua(Xy);async function zy(i){var e;try{if((e=await nd(i,{method:"HEAD"}))!=null&&e.ok)return i}catch{return}}async function Tl({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=>zy(a)),o=(await Promise.all(s)).find(Boolean);o&&(n=o)}return n}async function Zy(i){try{return(await nd(i)).text()}catch{return null}}async function eC(i){return i=i.trim(),i.startsWith("http")||i.startsWith("blob:")?Zy(i):i}function tC(i){if(typeof i=="string"){const[e,t]=i.split(":");return parseFloat(e)/parseFloat(t)}return i}const iC=Er(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 rC(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 nC=Er(async i=>{var e,t,r,n,s,o,a,c,l,u,A;const[h,d,f]=await Promise.all([Tl({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]}),Tl({sources:[(o=(s=i==null?void 0:i.answer)==null?void 0:s.media)==null?void 0:o.playlist]}),Tl({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 sd(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 sC(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 oC(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 bl({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,w,_,k,F,U,D,K,X;const re=(n=e==null?void 0:e.answer)==null?void 0:n.metadata;(re==null?void 0:re.aspectRatio)!=null&&(re.aspectRatio=tC(re.aspectRatio));const[ne,L,O]=await Promise.all([oC(i,e,t),nC(e),iC({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)]),W=sd(e),R=sC(e);return{...L,...W,...R,key:ne,captions:O,wordTimings:rC((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?((k=(_=(w=(y=i==null?void 0:i.questions)==null?void 0:y.items)==null?void 0:w[t-1])==null?void 0:_.answer)==null?void 0:k.label)??((D=(U=(F=i==null?void 0:i.questions)==null?void 0:F.items)==null?void 0:U[t-1])==null?void 0:D.title)??null:null,isFirstInstanceOfName:t?((X=(K=i==null?void 0:i.questions)==null?void 0:K.items)==null?void 0:X.findIndex(x=>sd(x).name===W.name))===t:!0}}const uo={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 aC({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&&uo[h]&&!r.find(f=>f.value===h)&&r.push({value:h,label:uo[h]}),d&&uo[d]&&!r.find(f=>f.value===d)&&r.push({value:d,label:uo[d]}),r},[]))??[]}/**
|
|
2477
2477
|
* @license
|
|
2478
2478
|
* Copyright 2018 Google LLC
|