@vouchfor/embeds 8.3.0 → 8.3.1
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
|
@@ -2473,7 +2473,7 @@ vec4 transition(vec2 uv) {
|
|
|
2473
2473
|
return mix(a, b, step(0.0+p.y,progress));
|
|
2474
2474
|
}
|
|
2475
2475
|
`,author:"Jake Nelson",license:"MIT",createdAt:"Wed, 1 Nov 2017 15:24:36 -0500",updatedAt:"Thu, 2 Nov 2017 18:37:42 -0500"}];const pd=Cl(xy);var md;function wy(r){if(typeof r=="string"){const[e,t]=r.split(":");return Math.min(parseFloat(e),parseFloat(t))}return r}function _y(r){if(typeof r=="string"){const[e,t]=r.split(":"),i=parseFloat(e),n=parseFloat(t);return i/n}return r}function Zl({resolution:r,aspectRatio:e}){const t=wy(r),i=_y(e),n=i>=1,s=Math.min(n?t*i:t/i,t),o=Math.max(n?t*i:t/i,t);return{resolution:t,aspectRatio:i,height:Math.round(n?s:o),width:Math.round(n?o:s)}}const Ed={linear:GE,easeIn:vl,easeInOut:$E,easeOut:HE,circIn:hh,circInOut:YE,circOut:dh,backIn:yl,backInOut:KE,backOut:VE,anticipate:WE,bounceIn:zE,bounceInOut:XE,bounceOut:vo},Go=Yu((r,e,{clamp:t=!0,ease:i="easeIn",...n}={})=>ME(r,e,{...n,clamp:t,ease:Ed[i]}),{cacheKey:([r,e,t])=>JSON.stringify({from:r,to:e,options:t})}),Qy={type:"clip",processor:{getTargetState:r=>({clip:{x:r.coordinates.x,y:r.coordinates.y,width:r.dimensions.width,height:r.dimensions.height}}),interpolateState:({value:r,easing:e,progress:t,from:i})=>{const n=i.clip??{x:0,y:0,width:1,height:1},s={x:r.coordinates.x,y:r.coordinates.y,width:r.dimensions.width,height:r.dimensions.height};return{clip:Go([0,1],[n,s],{ease:e})(t)}}}},Ho={type:"fade",processor:{getTargetState:r=>({opacity:r}),interpolateState:({value:r,easing:e,progress:t,from:i})=>({opacity:Go([0,1],[i.opacity,r],{ease:e})(t)})}},Ry={type:"scale",processor:{getTargetState:r=>({scale:r}),interpolateState:({value:r,easing:e,progress:t,from:i})=>({scale:Go([0,1],[i.scale,r],{ease:e})(t)})}},Id={type:"translate",processor:{getTargetState:r=>({translation:r}),interpolateState:({value:r,easing:e,progress:t,from:i})=>({translation:Go([0,1],[i.translation,r],{ease:e})(t)})}},Dy=[{label:"Both",value:"both"},{label:"At start",value:"enter"},{label:"At end",value:"exit"}],Ly=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"},{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],ky=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"}],My=[{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],fs={timing:{type:"buttonRadio",name:"timing",label:"Animate",options:Dy},speed:{type:"slider",name:"speed",label:"Speed",min:0,max:100,step:1}},ec={type:"switch",name:"reverseExit",label:"Reverse exit animation"},Fy=.2,Py=1;function Ny(r,e){const t=r==="both"?e/2:e;return Math.min(Py,t)}function gs({speed:r,timing:e,elementDuration:t}){const i=Ny(e,t),n=Math.min(Fy,i),s=Math.max(0,Math.min(100,r))/100;return i-s*(i-n)}const Oy="easeOut";function ps(r){return{values:e=>{var t;return{timing:e.timing??"both",speed:[e.speed??50],...((t=r==null?void 0:r.values)==null?void 0:t.call(r,e))??{}}},options:e=>{var t;return{timing:e.timing,speed:e.speed[0],easing:Oy,...((t=r==null?void 0:r.options)==null?void 0:t.call(r,e))??{}}}}}function ar({timing:r,duration:e,elementDuration:t,easing:i,reverseExit:n=!1,enterFrom:s,exitTo:o,restValue:a}){const l=[],c=r==="both"||r==="enter",u=r==="both"||r==="exit",A=Math.max(0,t-e);if(c?(l.push({time:0,value:s,easing:i}),l.push({time:e,value:a,easing:"linear"})):l.push({time:0,value:a,easing:"linear"}),u){A>e&&l.push({time:A,value:a,easing:i});const h=n?s:o;l.push({time:t,value:h,easing:i})}return l}const vd="fade",Uy={type:vd,name:"Fade",options:{...fs},transform:ps(),generate:(r,e)=>{const t=gs({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration});return{fade:{keyframes:ar({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:Ho}}}},yd="pan",Cd=.25,Bd="left";function Td(r,e,t){switch(r){case"left":return{x:e.width*t,y:0};case"right":return{x:-e.width*t,y:0};default:return Td(Bd,e,t)}}function Gy(r){return{x:-r.x,y:-r.y}}const Hy={type:yd,name:"Pan",options:{...fs,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:ky},distance:{type:"slider",name:"distance",label:"Distance",min:.1,max:1,step:.05,transform:{format:r=>`${(r*100).toFixed(0)}%`}},reverseExit:ec},transform:ps({values:r=>({direction:r.direction??Bd,distance:[r.distance??Cd],reverseExit:r.reverseExit??!1}),options:r=>({direction:r.direction,distance:r.distance[0],reverseExit:r.reverseExit})}),generate:(r,e)=>{const t=gs({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration}),i=r.distance??Cd,n=Td(r.direction,e.elementDimensions,i),s=Gy(n);return{fade:{keyframes:ar({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:Ho},translate:{keyframes:ar({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:n,exitTo:s,restValue:{x:0,y:0}}),renderer:Id}}}},Sd="pop",bd=.5,$y={type:Sd,name:"Pop",options:{...fs},transform:ps(),generate:(r,e)=>{const t=gs({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration});return{fade:{keyframes:ar({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:Ho},scale:{keyframes:ar({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:"backOut",enterFrom:bd,exitTo:bd,restValue:1}),renderer:Ry}}}},xd="rise",wd=50,Yy="up";function Vy(r,e){switch(r){case"down":return{enterY:-e,exitY:e};case"up":default:return{enterY:e,exitY:-e}}}const Ky={type:xd,name:"Rise",options:{...fs,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:My},distance:{type:"slider",name:"distance",label:"Distance",min:5,max:100,step:5,transform:{format:r=>`${r}px`}},reverseExit:ec},transform:ps({values:r=>({direction:r.direction??Yy,distance:[r.distance??wd],reverseExit:r.reverseExit??!1}),options:r=>({direction:r.direction,distance:r.distance[0],reverseExit:r.reverseExit})}),generate:(r,e)=>{const t=gs({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration}),i=r.distance??wd,{enterY:n,exitY:s}=Vy(r.direction,i);return{fade:{keyframes:ar({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:Ho},translate:{keyframes:ar({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:{x:0,y:n},exitTo:{x:0,y:s},restValue:{x:0,y:0}}),renderer:Id}}}},_d="wipe",tc="left";function cn(r){switch(r){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 cn(tc)}}function Qd(r){switch(r){case"left":return cn("right");case"right":return cn("left");case"up":return cn("down");case"down":return cn("up");default:return Qd(tc)}}const Wy={coordinates:{x:0,y:0},dimensions:{width:1,height:1}},Jy={type:_d,name:"Wipe",options:{...fs,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Ly},reverseExit:ec},transform:ps({values:r=>({direction:r.direction??tc,reverseExit:r.reverseExit??!1}),options:r=>({direction:r.direction,reverseExit:r.reverseExit})}),generate:(r,e)=>{const t=gs({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration}),i=cn(r.direction),n=Qd(r.direction);return{clip:{keyframes:ar({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:i,exitTo:n,restValue:Wy}),renderer:Qy}}}},jy={[vd]:Uy,[xd]:Ky,[Sd]:$y,[yd]:Hy,[_d]:Jy};function qy(r,e){const{type:t,...i}=r,n=jy[t];if(!n)throw new Error(`Unknown preset type: ${t}`);return n.generate(i,e)}function zy({animation:r,sceneTime:e}){const t=r.keyframes;if(!t||t.length===0)return null;const i=[...t].sort((s,o)=>s.time-o.time);if(e<i[0].time)return null;const n=i[i.length-1];if(e>=n.time)return r.renderer.processor.getTargetState(n.value);for(let s=0;s<i.length-1;s++){const o=i[s],a=i[s+1];if(e>=o.time&&e<=a.time){const l=a.time-o.time,c=l===0?0:(e-o.time)/l,u=o.easing||"linear",A=r.renderer.processor.getTargetState(o.value);return r.renderer.processor.interpolateState({easing:u,progress:c,from:A,value:a.value})}}return null}function Xy(r,e,t){const{preset:i,...n}=r;if(!i)return n;const s=qy(i,{elementDuration:e,elementDimensions:t});return{...n,...s}}function Rd({layout:r,sceneTime:e,animations:t,elementDuration:i=5,elementDimensions:n={width:100,height:100}}){var s,o,a,l,c,u,A,h,d,f,g;let p={clip:null,opacity:((s=r==null?void 0:r.transform)==null?void 0:s.opacity)??1,translation:{x:((a=(o=r==null?void 0:r.transform)==null?void 0:o.translate)==null?void 0:a.x)??0,y:((c=(l=r==null?void 0:r.transform)==null?void 0:l.translate)==null?void 0:c.y)??0},scale:((u=r==null?void 0:r.transform)==null?void 0:u.scale)??1,rotation:((A=r==null?void 0:r.transform)==null?void 0:A.rotation)??0,dimensions:{widthRatio:((d=(h=r==null?void 0:r.transform)==null?void 0:h.dimension)==null?void 0:d.widthRatio)??1,heightRatio:((g=(f=r==null?void 0:r.transform)==null?void 0:f.dimension)==null?void 0:g.heightRatio)??1}};if(!t)return p;const I=Xy(t,i,n);for(const C of Object.values(I)){if(!C)continue;const B=zy({animation:C,sceneTime:e});B&&(p={...p,...B})}return p}const Zy=[];for(let r=0;r<256;++r)Zy.push((r+256).toString(16).slice(1));typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);function eC(r=.4,e=.4){const t=Math.max(.1,Math.min(.8,r)),i=Math.max(.2,Math.min(.6,e)),s=(1-t)/2,a=1-i;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 $o=64;function tC(){const r=[],e={x:.5,y:.5},t=.5;for(let i=0;i<$o;i++){const n=i/$o*2*Math.PI,s=e.x+t*Math.cos(n),o=e.y+t*Math.sin(n);r.push({x:s,y:o})}return r}function iC(r=1){const e=[],t={x:.5,y:.5};let i,n;r>=1?(i=.5,n=.5/r):(i=.5*r,n=.5);for(let s=0;s<$o;s++){const o=s/$o*2*Math.PI,a=t.x+i*Math.cos(o),l=t.y+n*Math.sin(o);e.push({x:a,y:l})}return e}function rC(){const r=[];for(let t=0;t<=100;t++){const i=t/100*2*Math.PI,n=16*Math.sin(i)**3,s=-(13*Math.cos(i)-5*Math.cos(2*i)-2*Math.cos(3*i)-Math.cos(4*i)),o=(n+16)/32,a=(s+13)/26;r.push({x:o,y:a})}return r}function Dd(r=0,e=1){if(r===0)return[{x:0,y:0},{x:1,y:0},{x:1,y:1},{x:0,y:1}];const t=r*Math.PI/180,i=Math.tan(t)/e;return[{x:Math.max(0,Math.min(1,0+i)),y:0},{x:Math.max(0,Math.min(1,1+i)),y:0},{x:Math.max(0,Math.min(1,1-i)),y:1},{x:Math.max(0,Math.min(1,0-i)),y:1}]}function Yo(r){if(r<3)throw new Error("A polygon must have at least 3 sides");const e=[],t=[];for(let c=0;c<r;c++){const u=c*2*Math.PI/r-Math.PI/2,A=Math.cos(u),h=Math.sin(u);t.push({x:A,y:h})}const i=Math.min(...t.map(c=>c.x)),n=Math.max(...t.map(c=>c.x)),s=Math.min(...t.map(c=>c.y)),o=Math.max(...t.map(c=>c.y)),a=n-i,l=o-s;for(const c of t){const u=(c.x-i)/a,A=(c.y-s)/l;e.push({x:u,y:A})}return e}function Ld(r=90){const e=r*Math.PI/180,i=.5/Math.tan(e),s=1/(1+Math.abs(i)*2),o=i*s;return[{x:.5+o,y:0},{x:1,y:.5},{x:.5-o,y:1},{x:0,y:.5}]}function nC(r=5,e=.4){const t=[];for(let n=0;n<r*2;n++){const s=n*Math.PI/r-Math.PI/2,o=n%2===0?.5:e,a=.5+o*Math.cos(s),l=.5+o*Math.sin(s);t.push({x:a,y:l})}return t}function sC(r="isosceles",e={}){switch(r){case"equilateral":return oC();case"isosceles":return kd(e.baseAngle??60);case"right":return aC(e.rightAnglePosition??"bottom-left");case"scalene":return lC(e.angles??[60,60,60])}}function oC(){return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}]}function kd(r){const e=r*Math.PI/180,t=.5/Math.tan(e),i=Math.max(.1,Math.min(2,t));return[{x:.5,y:1-Math.min(1,i)},{x:0,y:1},{x:1,y:1}]}function aC(r){switch(r){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 lC(r){return kd(r[0])}function cC(r={},e=1){const{type:t="rectangle",customPolygon:i,parallelogram:n,triangle:s,rhombus:o,arrow:a,star:l,regularPolygon:c}=r;switch(t){case"rectangle":return Dd(0,e);case"parallelogram":return Dd((n==null?void 0:n.angle)??30,e);case"triangle":return sC((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 Ld((o==null?void 0:o.angle)??90);case"diamond":return Ld(90);case"pentagon":return Yo(5);case"hexagon":return Yo(6);case"octagon":return Yo(8);case"star":return nC((l==null?void 0:l.points)??5,(l==null?void 0:l.innerRadius)??.4);case"arrow":return eC((a==null?void 0:a.shaftRatio)??.4,(a==null?void 0:a.headRatio)??.4);case"heart":return rC();case"circle":return tC();case"ellipse":return iC(e);case"custom-polygon":if(!(i!=null&&i.points)||i.points.length<3)throw new Error("Custom polygon must have at least 3 points");return i.points;default:return Yo((c==null?void 0:c.sides)??6)}}function AC(r,e){let t=!1;const i=r.x,n=r.y;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s].x,l=e[s].y,c=e[o].x,u=e[o].y;l>n!=u>n&&i<(c-a)*(n-l)/(u-l)+a&&(t=!t)}return t}function uC(r,e){let t=1,i=0;const n=200;for(let s=0;s<=n;s++){const o=s/n;AC({x:o,y:r},e)&&(t=Math.min(t,o),i=Math.max(i,o))}return i>=t?{left:t,right:i}:null}function hC(r){const e=Math.min(...r.map(l=>l.y)),t=Math.max(...r.map(l=>l.y));let i={x:0,y:0,width:0,height:0},n=0;const s=200,o=(t-e)/s,a=[];for(let l=0;l<=s;l++){const c=e+l*o;a.push({y:c,span:uC(c,r)})}for(let l=0;l<a.length-1;l++){const c=a[l].y;for(let u=l+1;u<a.length;u++){const h=a[u].y-c;let d=0,f=1,g=!0;const p=Math.min(5,u-l+1);for(let I=0;I<p;I++){const C=l+Math.floor(I/(p-1)*(u-l)),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,i={x:d,y:c,width:I,height:h})}}}return i}function dC(r,e=1){const t=cC(r,e);if(t.length<3)return{top:0,right:0,bottom:0,left:0};if(r.type==="rectangle")return{top:0,right:0,bottom:0,left:0};const i=hC(t),n=i.y,s=i.x,o=1-(i.x+i.width),a=1-(i.y+i.height);return{top:Math.max(0,n),right:Math.max(0,o),bottom:Math.max(0,a),left:Math.max(0,s)}}function fC(r){return typeof r=="number"?{topLeft:r,topRight:r,bottomRight:r,bottomLeft:r}:{topLeft:(r==null?void 0:r.topLeft)??0,topRight:(r==null?void 0:r.topRight)??0,bottomRight:(r==null?void 0:r.bottomRight)??0,bottomLeft:(r==null?void 0:r.bottomLeft)??0}}function gC(r,e){return typeof r=="number"?{top:r*e,right:r*e,bottom:r*e,left:r*e}:typeof r=="string"?{top:r,right:r,bottom:r,left:r}:{top:typeof r.top=="number"?r.top*e:r.top,right:typeof r.right=="number"?r.right*e:r.right,bottom:typeof r.bottom=="number"?r.bottom*e:r.bottom,left:typeof r.left=="number"?r.left*e:r.left}}function pC(r,e){return typeof r=="number"?{top:r*e,right:r*e,bottom:r*e,left:r*e}:typeof r=="string"?{top:r,right:r,bottom:r,left:r}:{top:(typeof r.top=="number"?r.top*e:r.top)??0,right:(typeof r.right=="number"?r.right*e:r.right)??0,bottom:(typeof r.bottom=="number"?r.bottom*e:r.bottom)??0,left:(typeof r.left=="number"?r.left*e:r.left)??0}}function mC(r,e){return typeof r=="number"?{top:r*e,right:r*e,bottom:r*e,left:r*e}:typeof r=="string"?{top:r,right:r,bottom:r,left:r}:{top:(typeof r.top=="number"?r.top*e:r.top)??0,right:(typeof r.right=="number"?r.right*e:r.right)??0,bottom:(typeof r.bottom=="number"?r.bottom*e:r.bottom)??0,left:(typeof r.left=="number"?r.left*e:r.left)??0}}const EC=Mr(()=>fh.loadYoga());function Md(r,e,{layout:t,scale:i=1}){const{position:n="relative",inset:s,width:o,height:a,minWidth:l,minHeight:c,maxWidth:u,maxHeight:A,flex:h,flexGrow:d,flexShrink:f,gap:g,margin:p,padding:I,direction:C="column",align:B="start",alignSelf:y,justify:x="start"}=t??{},Q={static:r.POSITION_TYPE_STATIC,relative:r.POSITION_TYPE_RELATIVE,absolute:r.POSITION_TYPE_ABSOLUTE};if(e.setPositionType(Q[n]),typeof s<"u"){const{top:D,right:$,bottom:J,left:ee}=gC(s,i);typeof D<"u"&&e.setPosition(r.EDGE_TOP,D),typeof $<"u"&&e.setPosition(r.EDGE_RIGHT,$),typeof J<"u"&&e.setPosition(r.EDGE_BOTTOM,J),typeof ee<"u"&&e.setPosition(r.EDGE_LEFT,ee)}const R={row:r.FLEX_DIRECTION_ROW,column:r.FLEX_DIRECTION_COLUMN,"row-reverse":r.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":r.FLEX_DIRECTION_COLUMN_REVERSE};e.setFlexDirection(R[C]);const F={start:r.ALIGN_FLEX_START,end:r.ALIGN_FLEX_END,center:r.ALIGN_CENTER,stretch:r.ALIGN_STRETCH};e.setAlignItems(F[B]),y&&e.setAlignSelf(F[y]);const P={start:r.JUSTIFY_FLEX_START,end:r.JUSTIFY_FLEX_END,center:r.JUSTIFY_CENTER,"space-between":r.JUSTIFY_SPACE_BETWEEN,"space-around":r.JUSTIFY_SPACE_AROUND,"space-evenly":r.JUSTIFY_SPACE_EVENLY};if(e.setJustifyContent(P[x]),typeof p<"u"){const{top:D,right:$,bottom:J,left:ee}=pC(p,i);e.setMargin(r.EDGE_TOP,D),e.setMargin(r.EDGE_RIGHT,$),e.setMargin(r.EDGE_BOTTOM,J),e.setMargin(r.EDGE_LEFT,ee)}if(typeof I<"u"){const{top:D,right:$,bottom:J,left:ee}=mC(I,i);e.setPadding(r.EDGE_TOP,D),e.setPadding(r.EDGE_RIGHT,$),e.setPadding(r.EDGE_BOTTOM,J),e.setPadding(r.EDGE_LEFT,ee)}typeof d<"u"||typeof f<"u"?(typeof d<"u"&&e.setFlexGrow(d),typeof f<"u"&&e.setFlexShrink(f)):typeof h<"u"&&e.setFlex(h),e.setGap(r.GUTTER_ALL,(g??0)*i),typeof o<"u"&&e.setWidth(typeof o=="number"?o*i:o),typeof a<"u"&&e.setHeight(typeof a=="number"?a*i:a),typeof l<"u"&&e.setMinWidth(typeof l=="number"?l*i:l),typeof c<"u"&&e.setMinHeight(typeof c=="number"?c*i:c),typeof u<"u"&&e.setMaxWidth(typeof u=="number"?u*i:u),typeof A<"u"&&e.setMaxHeight(typeof A=="number"?A*i:A)}async function Fd({id:r,yoga:e,index:t,parent:i,element:n,resolvers:s}){var o,a,l;const{layout:c={},config:u={},options:A={},renderer:h}=n,d=e.Node.create();Md(e,d,{layout:c}),i.insertChild(d,t);let f=null;s&&((h==null?void 0:h.type)==="text"||(h==null?void 0:h.type)==="caption"||(h==null?void 0:h.type)==="image"||(h==null?void 0:h.type)==="video")&&((h==null?void 0:h.type)==="caption"?f=await((o=s.text)==null?void 0:o.call(s,{id:r,config:u,options:A}))??null:f=await((a=s[h.type])==null?void 0:a.call(s,{id:r,config:u,options:A}))??null);const g=[];for await(const[p,I]of((l=n.children)==null?void 0:l.entries())??[])g.push(await Fd({id:r,yoga:e,index:p,parent:d,element:I,resolvers:s}));return{node:d,radius:fC(c.radius),element:n,renderer:h,config:u,options:A,dependencies:f,childNodes:g}}function Pd(r,e,t=0,i=0){const{top:n,left:s}=r.getComputedLayout(),{top:o,left:a,width:l,height:c}=e.node.getComputedLayout(),u=t+a,A=i+o,h=e.childNodes.map(d=>Pd(r,d,u,A));return{...e,x:s+u,y:n+A,width:l,height:c,childNodes:h}}async function ic({yoga:r,root:e,tree:t,measureCanvas:i}){for await(const{node:n,options:s,dependencies:o,renderer:a,childNodes:l}of t){if(a){const{width:c,height:u}=a;if(c&&i){e.calculateLayout();const A=await c({node:n,options:s,dependencies:o,measureCanvas:i});A&&n.setWidth(A)}if(u&&i){e.calculateLayout();const A=await u({node:n,options:s,dependencies:o,measureCanvas:i});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 ic({yoga:r,root:e,tree:l,measureCanvas:i}),s!=null&&s.shape){const A=n.getComputedWidth(),h=n.getComputedHeight(),d=dC(s.shape,A/h);n.setPadding(r.EDGE_TOP,d.top*h),n.setPadding(r.EDGE_RIGHT,d.right*A),n.setPadding(r.EDGE_BOTTOM,d.bottom*h),n.setPadding(r.EDGE_LEFT,d.left*A)}}e.calculateLayout(),await ic({yoga:r,root:e,tree:l,measureCanvas:i})}}async function Nd({id:r,root:e,resolvers:t,measureCanvas:i}){const n=await EC(),s=n.Node.create();Md(n,s,{layout:e.layout});const o=await Fd({id:r,yoga:n,index:0,parent:s,element:e.element,resolvers:t});await ic({yoga:n,root:s,tree:[o],measureCanvas:i});const{top:a,left:l,width:c,height:u}=s.getComputedLayout(),A={root:{x:l,y:a,width:c,height:u},node:Pd(s,o)};return s.freeRecursive(),A}function Od(){var r=function(e){var t={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},i={},n={};i.L=1,n[1]="L",Object.keys(t).forEach(function(ue,Le){i[ue]=1<<Le+1,n[i[ue]]=ue}),Object.freeze(i);var s=i.LRI|i.RLI|i.FSI,o=i.L|i.R|i.AL,a=i.B|i.S|i.WS|i.ON|i.FSI|i.LRI|i.RLI|i.PDI,l=i.BN|i.RLE|i.LRE|i.RLO|i.LRO|i.PDF,c=i.S|i.WS|i.B|s|i.PDI|l,u=null;function A(){if(!u){u=new Map;var ue=function(Se){if(t.hasOwnProperty(Se)){var ae=0;t[Se].split(",").forEach(function(ge){var ve=ge.split("+"),Te=ve[0],Ce=ve[1];Te=parseInt(Te,36),Ce=Ce?parseInt(Ce,36):0,u.set(ae+=Te,i[Se]);for(var Ue=0;Ue<Ce;Ue++)u.set(++ae,i[Se])})}};for(var Le in t)ue(Le)}}function h(ue){return A(),u.get(ue.codePointAt(0))||i.L}function d(ue){return n[h(ue)]}var f={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function g(ue,Le){var Se=36,ae=0,ge=new Map,ve=Le&&new Map,Te;return ue.split(",").forEach(function Ce(Ue){if(Ue.indexOf("+")!==-1)for(var T=+Ue;T--;)Ce(Te);else{Te=Ue;var m=Ue.split(">"),E=m[0],w=m[1];E=String.fromCodePoint(ae+=parseInt(E,Se)),w=String.fromCodePoint(ae+=parseInt(w,Se)),ge.set(E,w),Le&&ve.set(w,E)}}),{map:ge,reverseMap:ve}}var p,I,C;function B(){if(!p){var ue=g(f.pairs,!0),Le=ue.map,Se=ue.reverseMap;p=Le,I=Se,C=g(f.canonical,!1).map}}function y(ue){return B(),p.get(ue)||null}function x(ue){return B(),I.get(ue)||null}function Q(ue){return B(),C.get(ue)||null}var R=i.L,F=i.R,P=i.EN,D=i.ES,$=i.ET,J=i.AN,ee=i.CS,Z=i.B,k=i.S,O=i.ON,V=i.BN,L=i.NSM,_=i.AL,M=i.LRO,W=i.RLO,Y=i.LRE,ie=i.RLE,oe=i.PDF,fe=i.LRI,Ee=i.RLI,Fe=i.FSI,we=i.PDI;function Ne(ue,Le){for(var Se=125,ae=new Uint32Array(ue.length),ge=0;ge<ue.length;ge++)ae[ge]=h(ue[ge]);var ve=new Map;function Te(Yt,Ei){var Vt=ae[Yt];ae[Yt]=Ei,ve.set(Vt,ve.get(Vt)-1),Vt&a&&ve.set(a,ve.get(a)-1),ve.set(Ei,(ve.get(Ei)||0)+1),Ei&a&&ve.set(a,(ve.get(a)||0)+1)}for(var Ce=new Uint8Array(ue.length),Ue=new Map,T=[],m=null,E=0;E<ue.length;E++)m||T.push(m={start:E,end:ue.length-1,level:Le==="rtl"?1:Le==="ltr"?0:Np(E,!1)}),ae[E]&Z&&(m.end=E,m=null);for(var w=ie|Y|W|M|s|we|oe|Z,U=function(Yt){return Yt+(Yt&1?1:2)},j=function(Yt){return Yt+(Yt&1?2:1)},X=0;X<T.length;X++){m=T[X];var G=[{_level:m.level,_override:0,_isolate:0}],ne=void 0,he=0,Be=0,ye=0;ve.clear();for(var $e=m.start;$e<=m.end;$e++){var ze=ae[$e];if(ne=G[G.length-1],ve.set(ze,(ve.get(ze)||0)+1),ze&a&&ve.set(a,(ve.get(a)||0)+1),ze&w)if(ze&(ie|Y)){Ce[$e]=ne._level;var yt=(ze===ie?j:U)(ne._level);yt<=Se&&!he&&!Be?G.push({_level:yt,_override:0,_isolate:0}):he||Be++}else if(ze&(W|M)){Ce[$e]=ne._level;var Vi=(ze===W?j:U)(ne._level);Vi<=Se&&!he&&!Be?G.push({_level:Vi,_override:ze&W?F:R,_isolate:0}):he||Be++}else if(ze&s){ze&Fe&&(ze=Np($e+1,!0)===1?Ee:fe),Ce[$e]=ne._level,ne._override&&Te($e,ne._override);var Ct=(ze===Ee?j:U)(ne._level);Ct<=Se&&he===0&&Be===0?(ye++,G.push({_level:Ct,_override:0,_isolate:1,_isolInitIndex:$e})):he++}else if(ze&we){if(he>0)he--;else if(ye>0){for(Be=0;!G[G.length-1]._isolate;)G.pop();var fi=G[G.length-1]._isolInitIndex;fi!=null&&(Ue.set(fi,$e),Ue.set($e,fi)),G.pop(),ye--}ne=G[G.length-1],Ce[$e]=ne._level,ne._override&&Te($e,ne._override)}else ze&oe?(he===0&&(Be>0?Be--:!ne._isolate&&G.length>1&&(G.pop(),ne=G[G.length-1])),Ce[$e]=ne._level):ze&Z&&(Ce[$e]=m.level);else Ce[$e]=ne._level,ne._override&&ze!==V&&Te($e,ne._override)}for(var jt=[],Bt=null,qt=m.start;qt<=m.end;qt++){var Ki=ae[qt];if(!(Ki&l)){var Wi=Ce[qt],Oa=Ki&s,gi=Ki===we;Bt&&Wi===Bt._level?(Bt._end=qt,Bt._endsWithIsolInit=Oa):jt.push(Bt={_start:qt,_end:qt,_level:Wi,_startsWithPDI:gi,_endsWithIsolInit:Oa})}}for(var $s=[],Qn=0;Qn<jt.length;Qn++){var Mt=jt[Qn];if(!Mt._startsWithPDI||Mt._startsWithPDI&&!Ue.has(Mt._start)){for(var Rn=[Bt=Mt],qr=void 0;Bt&&Bt._endsWithIsolInit&&(qr=Ue.get(Bt._end))!=null;)for(var Er=Qn+1;Er<jt.length;Er++)if(jt[Er]._start===qr){Rn.push(Bt=jt[Er]);break}for(var Mi=[],zr=0;zr<Rn.length;zr++)for(var Dn=Rn[zr],Ys=Dn._start;Ys<=Dn._end;Ys++)Mi.push(Ys);for(var YA=Ce[Mi[0]],Ua=m.level,Ln=Mi[0]-1;Ln>=0;Ln--)if(!(ae[Ln]&l)){Ua=Ce[Ln];break}var Vs=Mi[Mi.length-1],VA=Ce[Vs],Ga=m.level;if(!(ae[Vs]&s)){for(var kn=Vs+1;kn<=m.end;kn++)if(!(ae[kn]&l)){Ga=Ce[kn];break}}$s.push({_seqIndices:Mi,_sosType:Math.max(Ua,YA)%2?F:R,_eosType:Math.max(Ga,VA)%2?F:R})}}for(var Ks=0;Ks<$s.length;Ks++){var Mn=$s[Ks],_e=Mn._seqIndices,Xr=Mn._sosType,KA=Mn._eosType,Ji=Ce[_e[0]]&1?F:R;if(ve.get(L))for(var Fn=0;Fn<_e.length;Fn++){var Ws=_e[Fn];if(ae[Ws]&L){for(var Ir=Xr,Pn=Fn-1;Pn>=0;Pn--)if(!(ae[_e[Pn]]&l)){Ir=ae[_e[Pn]];break}Te(Ws,Ir&(s|we)?O:Ir)}}if(ve.get(P))for(var Nn=0;Nn<_e.length;Nn++){var Js=_e[Nn];if(ae[Js]&P)for(var vr=Nn-1;vr>=-1;vr--){var li=vr===-1?Xr:ae[_e[vr]];if(li&o){li===_&&Te(Js,J);break}}}if(ve.get(_))for(var yr=0;yr<_e.length;yr++){var js=_e[yr];ae[js]&_&&Te(js,F)}if(ve.get(D)||ve.get(ee))for(var S=1;S<_e.length-1;S++){var b=_e[S];if(ae[b]&(D|ee)){for(var N=0,H=0,z=S-1;z>=0&&(N=ae[_e[z]],!!(N&l));z--);for(var te=S+1;te<_e.length&&(H=ae[_e[te]],!!(H&l));te++);N===H&&(ae[b]===D?N===P:N&(P|J))&&Te(b,N)}}if(ve.get(P))for(var se=0;se<_e.length;se++){var le=_e[se];if(ae[le]&P){for(var de=se-1;de>=0&&ae[_e[de]]&($|l);de--)Te(_e[de],P);for(se++;se<_e.length&&ae[_e[se]]&($|l|P);se++)ae[_e[se]]!==P&&Te(_e[se],P)}}if(ve.get($)||ve.get(D)||ve.get(ee))for(var ce=0;ce<_e.length;ce++){var Ie=_e[ce];if(ae[Ie]&($|D|ee)){Te(Ie,O);for(var Re=ce-1;Re>=0&&ae[_e[Re]]&l;Re--)Te(_e[Re],O);for(var Je=ce+1;Je<_e.length&&ae[_e[Je]]&l;Je++)Te(_e[Je],O)}}if(ve.get(P))for(var lt=0,Ze=Xr;lt<_e.length;lt++){var Ft=_e[lt],Nt=ae[Ft];Nt&P?Ze===R&&Te(Ft,R):Nt&o&&(Ze=Nt)}if(ve.get(a)){var pi=F|P|J,ci=pi|R,Zr=[];{for(var ji=[],On=0;On<_e.length;On++)if(ae[_e[On]]&a){var qs=ue[_e[On]],_p=void 0;if(y(qs)!==null)if(ji.length<63)ji.push({char:qs,seqIndex:On});else break;else if((_p=x(qs))!==null)for(var zs=ji.length-1;zs>=0;zs--){var WA=ji[zs].char;if(WA===_p||WA===x(Q(qs))||y(Q(WA))===qs){Zr.push([ji[zs].seqIndex,On]),ji.length=zs;break}}}Zr.sort(function(Yt,Ei){return Yt[0]-Ei[0]})}for(var JA=0;JA<Zr.length;JA++){for(var Qp=Zr[JA],Ha=Qp[0],jA=Qp[1],Rp=!1,mi=0,qA=Ha+1;qA<jA;qA++){var Dp=_e[qA];if(ae[Dp]&ci){Rp=!0;var Lp=ae[Dp]&pi?F:R;if(Lp===Ji){mi=Lp;break}}}if(Rp&&!mi){mi=Xr;for(var zA=Ha-1;zA>=0;zA--){var kp=_e[zA];if(ae[kp]&ci){var Mp=ae[kp]&pi?F:R;Mp!==Ji?mi=Mp:mi=Ji;break}}}if(mi){if(ae[_e[Ha]]=ae[_e[jA]]=mi,mi!==Ji){for(var Xs=Ha+1;Xs<_e.length;Xs++)if(!(ae[_e[Xs]]&l)){h(ue[_e[Xs]])&L&&(ae[_e[Xs]]=mi);break}}if(mi!==Ji){for(var Zs=jA+1;Zs<_e.length;Zs++)if(!(ae[_e[Zs]]&l)){h(ue[_e[Zs]])&L&&(ae[_e[Zs]]=mi);break}}}}for(var Cr=0;Cr<_e.length;Cr++)if(ae[_e[Cr]]&a){for(var Fp=Cr,XA=Cr,ZA=Xr,eo=Cr-1;eo>=0;eo--)if(ae[_e[eo]]&l)Fp=eo;else{ZA=ae[_e[eo]]&pi?F:R;break}for(var Pp=KA,to=Cr+1;to<_e.length;to++)if(ae[_e[to]]&(a|l))XA=to;else{Pp=ae[_e[to]]&pi?F:R;break}for(var eu=Fp;eu<=XA;eu++)ae[_e[eu]]=ZA===Pp?ZA:Ji;Cr=XA}}}for(var zt=m.start;zt<=m.end;zt++){var $_=Ce[zt],$a=ae[zt];if($_&1?$a&(R|P|J)&&Ce[zt]++:$a&F?Ce[zt]++:$a&(J|P)&&(Ce[zt]+=2),$a&l&&(Ce[zt]=zt===0?m.level:Ce[zt-1]),zt===m.end||h(ue[zt])&(k|Z))for(var Ya=zt;Ya>=0&&h(ue[Ya])&c;Ya--)Ce[Ya]=m.level}}return{levels:Ce,paragraphs:T};function Np(Yt,Ei){for(var Vt=Yt;Vt<ue.length;Vt++){var Br=ae[Vt];if(Br&(F|_))return 1;if(Br&(Z|R)||Ei&&Br===we)return 0;if(Br&s){var Op=Y_(Vt);Vt=Op===-1?ue.length:Op}}return 0}function Y_(Yt){for(var Ei=1,Vt=Yt+1;Vt<ue.length;Vt++){var Br=ae[Vt];if(Br&Z)break;if(Br&we){if(--Ei===0)return Vt}else Br&s&&Ei++}return-1}}var pe="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",Me;function We(){if(!Me){var ue=g(pe,!0),Le=ue.map,Se=ue.reverseMap;Se.forEach(function(ae,ge){Le.set(ge,ae)}),Me=Le}}function Oe(ue){return We(),Me.get(ue)||null}function Xe(ue,Le,Se,ae){var ge=ue.length;Se=Math.max(0,Se==null?0:+Se),ae=Math.min(ge-1,ae==null?ge-1:+ae);for(var ve=new Map,Te=Se;Te<=ae;Te++)if(Le[Te]&1){var Ce=Oe(ue[Te]);Ce!==null&&ve.set(Te,Ce)}return ve}function De(ue,Le,Se,ae){var ge=ue.length;Se=Math.max(0,Se==null?0:+Se),ae=Math.min(ge-1,ae==null?ge-1:+ae);var ve=[];return Le.paragraphs.forEach(function(Te){var Ce=Math.max(Se,Te.start),Ue=Math.min(ae,Te.end);if(Ce<Ue){for(var T=Le.levels.slice(Ce,Ue+1),m=Ue;m>=Ce&&h(ue[m])&c;m--)T[m]=Te.level;for(var E=Te.level,w=1/0,U=0;U<T.length;U++){var j=T[U];j>E&&(E=j),j<w&&(w=j|1)}for(var X=E;X>=w;X--)for(var G=0;G<T.length;G++)if(T[G]>=X){for(var ne=G;G+1<T.length&&T[G+1]>=X;)G++;G>ne&&ve.push([ne+Ce,G+Ce])}}}),ve}function Qe(ue,Le,Se,ae){var ge=He(ue,Le,Se,ae),ve=[].concat(ue);return ge.forEach(function(Te,Ce){ve[Ce]=(Le.levels[Te]&1?Oe(ue[Te]):null)||ue[Te]}),ve.join("")}function He(ue,Le,Se,ae){for(var ge=De(ue,Le,Se,ae),ve=[],Te=0;Te<ue.length;Te++)ve[Te]=Te;return ge.forEach(function(Ce){for(var Ue=Ce[0],T=Ce[1],m=ve.slice(Ue,T+1),E=m.length;E--;)ve[T-E]=m[E]}),ve}return e.closingToOpeningBracket=x,e.getBidiCharType=h,e.getBidiCharTypeName=d,e.getCanonicalBracket=Q,e.getEmbeddingLevels=Ne,e.getMirroredCharacter=Oe,e.getMirroredCharactersMap=Xe,e.getReorderSegments=De,e.getReorderedIndices=He,e.getReorderedString=Qe,e.openingToClosingBracket=y,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return r}const Ud=Object.freeze(Object.defineProperty({__proto__:null,default:Od},Symbol.toStringTag,{value:"Module"})),IC=typeof Ud=="function"?Ud:Od;function vC(r,e){return r==="start"?e==="rtl"?"right":"left":r==="end"?e==="rtl"?"left":"right":r??"left"}const Gd=IC();function yC(r){var e;if(!r)return"ltr";try{const{paragraphs:t}=Gd.getEmbeddingLevels(r);return(((e=t[0])==null?void 0:e.level)??0)%2===1?"rtl":"ltr"}catch{return"ltr"}}function CC(r){return{order:r.map((e,t)=>t),directions:r.map(()=>"ltr"),baseDirection:"ltr"}}function BC(r,e){var t;if(!r.length)return{order:[],directions:[],baseDirection:e??"ltr"};try{const i=r.map(({text:d})=>d).join(" "),{levels:n,paragraphs:s}=Gd.getEmbeddingLevels(i,e),o=((t=s[0])==null?void 0:t.level)??0,a=o%2===1?"rtl":"ltr",l=[];let c=0;for(const d of r)l.push(n[c]??o),c+=d.text.length+1;const u=r.map((d,f)=>f),A=Math.max(...l);for(let d=A;d>=1;d--){let f=-1;for(let g=0;g<=u.length;g++){const p=g<u.length&&l[u[g]]>=d;if(p&&f<0)f=g;else if(!p&&f>=0){const I=u.slice(f,g).reverse();u.splice(f,I.length,...I),f=-1}}}const h=l.map(d=>d%2===1?"rtl":"ltr");return{order:u,directions:h,baseDirection:a}}catch{return CC(r)}}const TC=500;function SC(){const r=new Map,e={has:t=>r.has(t),get:t=>r.get(t),set:(t,i)=>{if(r.size>=TC&&!r.has(t)){const n=r.keys().next();n.done||r.delete(n.value)}r.set(t,i)},delete:t=>r.delete(t),clear:()=>r.clear()};return typeof document<"u"&&"fonts"in document&&document.fonts.addEventListener("loadingdone",()=>e.clear()),e}let rc;function bC(){return rc===void 0&&(rc=typeof Intl<"u"&&typeof Intl.Segmenter=="function"?new Intl.Segmenter(void 0,{granularity:"word"}):null),rc}const Hd=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Thai}\p{Script=Lao}\p{Script=Khmer}\p{Script=Myanmar}]/u;function xC(r){return r.split(`
|
|
2476
|
-
`).map(e=>{if(!e)return[];const t=[];for(const i of e.match(/\S+|\s+/g)??[])if(/^\s+$/.test(i))t.push({text:i,logicalIndex:t.length,whitespace:!0,spaceBefore:!1});else if(Hd.test(i))for(const n of $d(i))t.push({text:n.text,logicalIndex:t.length,whitespace:!1,spaceBefore:!1});else t.push({text:i,logicalIndex:t.length,whitespace:!1,spaceBefore:!1});return t})}function $d(r){const e=[];let t=!1,i="";const n=bC();if(!n)return[{text:r,spaceBefore:!1}];for(const{segment:s,isWordLike:o}of n.segment(r)){if(!o&&s.trim().length===0){t=e.length>0?!0:t;continue}if(o){e.push({text:s,spaceBefore:t}),t=!1;continue}e.length>0?e[e.length-1].text+=s:i+=s}return i&&e.length>0?e[0].text=i+e[0].text:i&&e.push({text:i,spaceBefore:t}),e}function wC(r){const e=[];for(const t of r){const n=Hd.test(t.text)||/\s/.test(t.text)?$d(t.text):[{text:t.text,spaceBefore:!1}];if(n.length<=1){e.push({text:t.text,logicalIndex:e.length,whitespace:!1,spaceBefore:e.length>0,timing:{id:t.id,start:t.start,end:t.end}});continue}const s=n.reduce((l,c)=>l+[...c.text].length,0),o=t.end-t.start;let a=t.start;n.forEach((l,c)=>{const u=[...l.text].length/s*o,A=a,h=c===n.length-1?t.end:a+u;a=h,e.push({text:l.text,logicalIndex:e.length,whitespace:!1,spaceBefore:c===0?e.length>0:l.spaceBefore,timing:{id:t.id,subIndex:c,start:A,end:h}})})}return e}const _C=/(?<value>\d+\.?\d*)(?=px)/,nc=1;function QC(r,e){const t=typeof r=="string"?xC(r):[wC(r)];return e?t.map(i=>i.map(n=>({...n,text:n.text.toUpperCase()}))):t}function RC({context:r,groups:e,appendedFont:t,fontSizes:i,maxW:n,wrap:s,strokeWidth:o,letterSpacing:a,wholeLineMeasure:l}){const c=[],u=h=>{const d=i[h%i.length];return{fontSize:d,font:t.replace(_C,d.toString())}},A=(h,d)=>(r.font=h,r.letterSpacing=`${a}px`,r.measureText(d));for(const h of e){const d=c.length,{fontSize:f,font:g}=u(c.length);let p={items:[],font:g,fontSize:f,lineWidth:0,fontAscent:0,fontDescent:0},I="",C="";const B=()=>{const y=A(p.font,"");p.fontAscent=y.fontBoundingBoxAscent,p.fontDescent=y.fontBoundingBoxDescent,c.push(p);const x=u(c.length);p={items:[],font:x.font,fontSize:x.fontSize,lineWidth:0,fontAscent:0,fontDescent:0},I="",C=""};for(const y of h){if(y.whitespace){C+=y.text;continue}const x=()=>{const F=p.items.length>0&&y.spaceBefore&&!C?" ":C,P=F?A(p.font,F).width:0,D=A(p.font,y.text);return{token:y,metrics:D,width:D.width+o,gapBefore:P,gapText:F}};let Q=x();const R=l?A(p.font,I+Q.gapText+y.text).width+o*(p.items.length+1):p.lineWidth+Q.gapBefore+Q.width;if(s&&R>n+nc&&p.items.length>0&&(B(),Q=x()),s&&l&&p.items.length===0&&Q.width>n+nc){let F=y.text;for(;F.length>0;){let P="";for(const $ of F){const J=A(p.font,P+$).width+o;if(P&&J>n+nc)break;P+=$}F=F.slice(P.length);const D=A(p.font,P);p.items.push({token:{...y,text:P},metrics:D,width:D.width+o,gapBefore:0,gapText:""}),I=P,p.lineWidth=D.width+o*p.items.length,F.length>0&&B()}C="";continue}p.items.push(Q),I+=Q.gapText+y.text,p.lineWidth=l?A(p.font,I).width+o*p.items.length:p.lineWidth+Q.gapBefore+Q.width,C=""}l&&C&&(p.items.length>0||c.length===d)&&(I+=C,p.lineWidth=A(p.font,I).width+o*p.items.length),(p.items.length>0||c.length===d)&&B()}return c}const Yd=[{family:"Noto Arabic",regex:new RegExp("\\p{Script=Arabic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansArabic-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Chinese",regex:new RegExp("\\p{Script=Han}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansSC-VariableFont_wght.woff2",style:"normal"},{family:"Noto Hebrew",regex:new RegExp("\\p{Script=Hebrew}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansHebrew-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Hindi",regex:new RegExp("\\p{Script=Devanagari}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansDevanagari-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Japanese",regex:new RegExp("\\p{Script=Han}|\\p{Script=Katakana}|\\p{Script=Hiragana}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansJP-VariableFont_wght.woff2",style:"normal"},{family:"Noto Korean",regex:new RegExp("\\p{Script=Hangul}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKR-VariableFont_wght.woff2",style:"normal"},{family:"Noto Color Emoji",regex:new RegExp("\\p{Extended_Pictographic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoColorEmoji-Regular.woff2",style:"normal"},{family:"Noto Telugu",regex:new RegExp("\\p{Script=Telugu}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansTelugu-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Tamil",regex:new RegExp("\\p{Script=Tamil}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansTamil-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Kannada",regex:new RegExp("\\p{Script=Kannada}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKannada-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Malayalam",regex:new RegExp("\\p{Script=Malayalam}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansMalayalam-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Bengali",regex:new RegExp("\\p{Script=Bengali}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansBengali-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Gujarati",regex:new RegExp("\\p{Script=Gujarati}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGujarati-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Gurmukhi",regex:new RegExp("\\p{Script=Gurmukhi}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGurmukhi-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Sinhala",regex:new RegExp("\\p{Script=Sinhala}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansSinhala-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Thai",regex:new RegExp("\\p{Script=Thai}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansThai-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Lao",regex:new RegExp("\\p{Script=Lao}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansLao-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Khmer",regex:new RegExp("\\p{Script=Khmer}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKhmer-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Myanmar",regex:new RegExp("\\p{Script=Myanmar}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansMyanmar-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Ethiopic",regex:new RegExp("\\p{Script=Ethiopic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansEthiopic-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Armenian",regex:new RegExp("\\p{Script=Armenian}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansArmenian-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Georgian",regex:new RegExp("\\p{Script=Georgian}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGeorgian-VariableFont_wdth%2Cwght.woff2",style:"normal"}];function Vd({text:r,font:e}){let t=e;return Yd.forEach(({family:i,regex:n})=>{n.exec(r)&&(t+=`, ${i}`)}),t}function Kd(r){return Math.max(r??1,.5)}function DC({measured:r,index:e,lineTop:t,dx:i,dw:n,align:s,direction:o,lineHeight:a,strokeWidth:l}){const{items:c,font:u,fontSize:A,lineWidth:h,fontAscent:d,fontDescent:f}=r;let g=0;s==="center"?g=(n-h)/2:s==="right"&&(g=n-h);const p=Kd(a),I=A*p+l,C=(p-1)*A/2,B=(A+d-f)/2,y=t+C+B+l/2,{order:x,directions:Q,baseDirection:R}=BC(c.map(({token:Z})=>({text:Z.text})),o),F=c.map(({gapBefore:Z})=>Z);let P=i+g+l/2;const D=[];x.forEach((Z,k)=>{const O=c[Z];P+=F[k],D.push({...O.token,x:P,baselineY:y,width:O.width,lineIndex:e,direction:Q[Z],font:u,metrics:O.metrics}),P+=O.width});const $=[],J=[];D.forEach((Z,k)=>{const O=$[$.length-1];if(O&&O.direction===Z.direction){const V=Math.max(O.x+O.width,Z.x+Z.width);O.tokens.push(Z),O.x=Math.min(O.x,Z.x),O.width=V-O.x,J[J.length-1].push(x[k])}else $.push({text:"",x:Z.x,width:Z.width,direction:Z.direction,tokens:[Z]}),J.push([x[k]])}),$.forEach((Z,k)=>{const O=[...J[k]].sort((V,L)=>V-L);Z.text=O.map((V,L)=>L===0?c[V].token.text:`${c[V].gapText}${c[V].token.text}`).join("")});const ee=o??R;return{index:e,box:{x:i+g,y:t,width:h,height:I},baselineY:y,direction:ee,runs:$,tokens:D}}function LC(r){const{context:e,text:t,font:i,fontSizes:n,dx:s=0,dy:o=0,maxW:a=1/0,dw:l=a,align:c="left",direction:u,lineHeight:A,lineGap:h=0,letterSpacing:d=0,strokeWidth:f=0,wrap:g=!0,uppercase:p=!1}=r,I=QC(t,p),C=I.flat().map(({text:Q})=>Q).join(" "),B=Vd({font:i,text:C}),y=u??yC(C),x=vC(c,y);try{e.save();const Q=RC({context:e,groups:I,appendedFont:B,fontSizes:n,maxW:a,wrap:g,strokeWidth:f,letterSpacing:d,wholeLineMeasure:typeof t=="string"}),R=[];let F=o;for(let ee=0;ee<Q.length;ee++){const Z=DC({measured:Q[ee],index:ee,lineTop:F,dx:s,dw:l,align:x,direction:u,lineHeight:A,strokeWidth:f});R.push(Z),F+=Z.box.height+h}const P=Q[Q.length-1],D=P?Math.max(0,(P.fontAscent+P.fontDescent-P.fontSize*Kd(A))/2):0,$=R.reduce((ee,{box:Z})=>ee+Z.height,0)+h*Math.max(0,R.length-1)+D,J=R.length?{x:Math.min(...R.map(({box:ee})=>ee.x)),y:Math.min(...R.map(({box:ee})=>ee.y)),width:Math.max(...R.map(({box:ee})=>ee.x+ee.width))-Math.min(...R.map(({box:ee})=>ee.x)),height:Math.max(...R.map(({box:ee})=>ee.y+ee.height))-Math.min(...R.map(({box:ee})=>ee.y))}:{x:s,y:o,width:0,height:0};return{lines:R,totalHeight:$,blockBox:J,direction:y,font:B}}finally{e.restore()}}Yu(LC,{cache:SC(),cacheKey:([r])=>JSON.stringify([r.text,r.font,r.fontSizes,r.dx,r.dy,r.dw,r.maxW,r.align,r.direction,r.lineHeight,r.lineGap,r.letterSpacing,r.strokeWidth,r.wrap,r.uppercase])});function kC(r){return r.slice(0,1).toUpperCase()+r.slice(1)}Object.keys(Ed).map(r=>({label:kC(r),value:r,data:r}));function Wd(){return document.createElement("canvas")}function Zt(r){let e=0;for(const t of r)Array.isArray(t)?e+=Zt(t):e+=t;return e}function Vo(r){return r.map(({type:e,duration:t},i)=>{var n,s,o,a;if(e==="transition"){const l=((n=r[i-2])==null?void 0:n.type)==="transition"?r[i-2]:null,c=((s=r[i-1])==null?void 0:s.duration)??1/0,u=((o=r[i+1])==null?void 0:o.duration)??1/0,A=((a=r[i+2])==null?void 0:a.type)==="transition"?r[i+2]:null;return Math.min(l?c/2:c,t,A?u/2:u)*-1}return t})}function MC(r){if(r===null||typeof r!="object")return!1;if(Object.getPrototypeOf(r)===null)return!0;let e=r;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e}function FC(r){return r.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}ZE.filters.define("parse",r=>typeof r>"u"?null:typeof r=="string"?`"${FC(r)}"`:MC(r)||Array.isArray(r)?JSON.stringify(r):r);function PC(r){return r.some(({type:e})=>e==="text")}function NC(r){return r.some(({type:e})=>e==="caption")}function OC(r){return r.some(({type:e})=>e==="audio")}function UC(r){return r.some(({type:e})=>e==="video"||e==="image")}function sc(r){return r.type==="audio"}const GC="3";async function HC({scene:r,start:e=0}){const{id:t,root:i,duration:n}=r,s=await Nd({id:t,root:i});return{type:r.type,start:e,duration:n,layout:s,id:r.id,config:r}}async function $C({track:r}){const e=Vo(r),t=await Promise.all(r.reduce((s,o,a)=>{if(o.type!=="audio")return s;const l=Zt(e.slice(0,a));return s.push(HC({scene:o,start:l})),s},[])),i=r.reduce((s,o,a)=>{if(o.type!=="gap")return s;const l=Zt(e.slice(0,a));return s.push({type:o.type,id:o.id,start:l,config:o,duration:o.duration}),s},[]),n=r.map(({id:s})=>t.find(({id:o})=>o===s)??i.find(({id:o})=>o===s)).filter(Boolean);return{type:"audio",scenes:t,gapScenes:i,mergedScenes:n,config:r,duration:Math.max(...n.map(({start:s,duration:o})=>s+o))}}async function Jd({node:r,canvases:e,sceneTime:t,sceneDuration:i,parentOpacity:n=1,parentTransform:s,debug:o=!1,override:a}){var l,c,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&&((l=r.element.layout)!=null&&l.transform)?{...r.element.layout,transform:{...r.element.layout.transform,rotation:a.rotation}}:r.element.layout,g=Rd({layout:f,sceneTime:t,animations:r.element.animations,elementDuration:i,elementDimensions:{width:r.width,height:r.height}}),{opacity:p,translation:I,scale:C,clip:B,dimensions:y,rotation:x}=g,Q=r.width*y.widthRatio,R=r.height*y.heightRatio;if(d.globalAlpha=p*n,(I.x||I.y)&&d.translate(I.x,I.y),(C!==1||x!==0)&&(d.translate(r.x+Q/2,r.y+R/2),d.scale(C,C),d.rotate(x*Math.PI/180),d.translate(-(r.x+Q/2),-(r.y+R/2))),B){d.beginPath();const D={x:r.x+B.x*Q,y:r.y+B.y*R,width:B.width*Q,height:B.height*R};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(r.x,r.y,Q,R),d.globalAlpha=D}const F=(a==null?void 0:a.fontSize)!=null||(a==null?void 0:a.textValue)!=null?{...r.options,...a.textValue!=null?{value:a.textValue}:{},...a.fontSize!=null&&((c=r.options)!=null&&c.font)?{font:{...r.options.font,size:a.fontSize}}:{}}:r.options,P=(a==null?void 0:a.fontSize)!=null&&((u=r.dependencies)!=null&&u.font)?{...r.dependencies,font:{...r.dependencies.font,size:a.fontSize}}:r.dependencies;await((h=(A=r.renderer)==null?void 0:A.render)==null?void 0:h.call(A,{canvases:e,sceneTime:t,dx:r.x,dy:r.y,dw:Q,dh:R,radius:r.radius,options:F,dependencies:P}));for await(const D of r.childNodes)await Jd({debug:o,node:D,canvases:e,sceneTime:t,sceneDuration:i,parentOpacity:d.globalAlpha,parentTransform:d.getTransform(),override:a});d.restore()}}async function YC({layout:r,canvases:e,sceneTime:t,sceneDuration:i,debug:n=!1,override:s}){const{node:o}=r;await Jd({debug:n,node:o,canvases:e,sceneDuration:i,sceneTime:t,override:s})}async function Ko({debug:r=!1,scene:e,start:t=0,resolvers:i,rootWidth:n,rootHeight:s,canvasFactory:o=Wd}){var a,l;const{id:c,x:u,y:A,width:h,height:d,root:f,duration:g}=e,p=o(),I=o(),C=o(),B=o(),y=o(),x=await Nd({id:c,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??((l=f.element.layout)==null?void 0:l.height)}}},resolvers:i,measureCanvas:y}),Q=async(R,F)=>{const P=Math.max(0,R-t);p.width=p.height=0,p.width=n,p.height=s,await YC({debug:r,layout:x,sceneTime:P,sceneDuration:g,canvases:{sceneCanvas:p,cropCanvas:I,letterboxCanvas:C,posterCanvas:B},override:F})};return{id:c,type:e.type,start:t,duration:g,layout:x,sceneCanvas:p,draw:Q,config:e,childScenes:[]}}async function VC({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Vo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=Zt(o.slice(0,d));return h.type==="caption"&&A.push(Ko({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=Zt(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),c=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=Zt(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)??l.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)).filter(Boolean);return{type:"caption",scenes:a,gapScenes:l,transitions:c,mergedScenes:u,duration:Math.max(...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}function KC({groups:r,tracks:e}){const t=r.map(s=>new Set(s.sceneIds)),i=r.map((s,o)=>{const a=[];for(let u=0;u<e.length;u++){const A=e[u];sc(A)||A.scenes.some(h=>s.sceneIds.includes(h.id))&&a.push(u)}let l,c=1/0;for(let u=0;u<r.length;u++){if(o===u)continue;const A=t[u];s.sceneIds.every(d=>A.has(d))&&A.size>t[o].size&&A.size<c&&(l=r[u].id,c=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:l,depth:0}}),n=new Map(i.map(s=>[s.id,s]));for(const s of i){let o=0,a=s;for(;a!=null&&a.parentGroupId;)o++,a=n.get(a.parentGroupId);s.depth=o}return i}function WC({group:r,currentTime:e,activeMembers:t,fallbackDimensions:i}){if(!r.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),l=r.bounds,c=(l==null?void 0:l.width)??i.width,u=(l==null?void 0:l.height)??i.height;return Rd({sceneTime:a,animations:r.animations,elementDuration:o,elementDimensions:{width:c,height:u}})}function jd({group:r,animationState:e,targetCtx:t,fallbackDimensions:i}){const n=r.bounds,s=(n==null?void 0:n.x)??0,o=(n==null?void 0:n.y)??0,a=(n==null?void 0:n.width)??i.width,l=(n==null?void 0:n.height)??i.height,{opacity:c,translation:u,scale:A,clip:h,rotation:d}=e;if(t.globalAlpha*=c,(u.x||u.y)&&t.translate(u.x,u.y),A!==1||d!==0){const f=s+a/2,g=o+l/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*l,h.width*a,h.height*l),t.clip())}async function JC({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Vo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=Zt(o.slice(0,d));return h.type==="video"&&A.push(Ko({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),h.type==="image"&&A.push(Ko({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=Zt(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),c=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=Zt(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)??l.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)).filter(Boolean);return{type:"picture",scenes:a,gapScenes:l,transitions:c,mergedScenes:u,duration:Math.max(0,...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}async function jC({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Vo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=Zt(o.slice(0,d));return h.type==="text"&&A.push(Ko({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=Zt(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),c=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=Zt(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)??l.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)).filter(Boolean);return{type:"text",scenes:a,gapScenes:l,transitions:c,mergedScenes:u,duration:Math.max(...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}const qC=(((md=pd)==null?void 0:md.default)??pd).reduce((r,e)=>(r[e.name]=e,r),{});function zC(r,e){return r.has(e)||r.set(e,{buffer:null,transitions:{},fromTexture:null,toTexture:null}),r.get(e)}function XC({name:r,to:e,from:t,progress:i,width:n,height:s,glContext:o,contextResources:a,returnPixels:l=!0}){var c,u,A;const h=zC(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=(((c=Po)==null?void 0:c.default)??Po)(o,t),h.fromTexture.minFilter=o.LINEAR,h.fromTexture.magFilter=o.LINEAR),h.toTexture?h.toTexture.setPixels(e):(h.toTexture=(((u=Po)==null?void 0:u.default)??Po)(o,e),h.toTexture.minFilter=o.LINEAR,h.toTexture.magFilter=o.LINEAR),h.transitions[r]||(h.transitions[r]=(((A=gd)==null?void 0:A.default)??gd)(o,qC[r])),h.transitions[r].draw(i,h.fromTexture,h.toTexture,n,s),!l)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 ZC(r){for(const[e,t]of r.entries())t.buffer&&e.deleteBuffer(t.buffer),t.fromTexture&&t.fromTexture.dispose(),t.toTexture&&t.toTexture.dispose(),Object.values(t.transitions).forEach(i=>{i.dispose()}),r.delete(e)}function eB({name:r,to:e,from:t,progress:i,canvas:n,contextResources:s}){const o=n.getContext("webgl",{alpha:!0,depth:!1,antialias:!1,preserveDrawingBuffer:!1});o&&(o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!0),XC({name:r,to:e,from:t,progress:i,width:n.width,height:n.height,glContext:o,contextResources:s,returnPixels:!1}))}async function qd({debug:r=!1,config:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s=Wd,drawTransition:o=eB}){var a;const l=new Map,c=await Promise.all(e.tracks.map(async I=>{if(UC(I))return{...await JC({debug:r,track:I,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:I};if(PC(I))return{...await jC({debug:r,track:I,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:I};if(NC(I))return{...await VC({debug:r,track:I,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:I};if(OC(I))return{...await $C({track:I}),config:I};throw new Error("Unknown track type")})),u=(a=e.groups)!=null&&a.length?KC({groups:e.groups,tracks:c}):[],A=new Map,h=[...u].sort((I,C)=>I.depth-C.depth);for(const I of h)for(const C of I.sceneIds)A.set(C,I);const d=new Map(u.map(I=>[I.id,I]));function f(I){const C=[];let B=A.get(I.id);for(;B;)B.animations&&C.push(B),B=B.parentGroupId?d.get(B.parentGroupId):void 0;return C}return{draw:async({canvas:I,currentTime:C,overrides:B,signal:y})=>{const x=I.getContext("2d");if(!x)return;x.globalAlpha=1,x.globalCompositeOperation="source-over",x.clearRect(0,0,I.width,I.height),x.save(),x.fillStyle="black",x.fillRect(0,0,I.width,I.height),x.restore();const Q=new Map;for(const D of c)if(!sc(D))for(const $ of D.scenes){if(C<$.start||C>=$.start+$.duration)continue;const J=$.layout,ee=J==null?void 0:J.node,Z={start:$.start,end:$.start+$.duration,x:(ee==null?void 0:ee.x)??0,y:(ee==null?void 0:ee.y)??0,width:(ee==null?void 0:ee.width)??I.width,height:(ee==null?void 0:ee.height)??I.height};let k=A.get($.id);for(;k;)k.animations&&(Q.has(k.id)||Q.set(k.id,[]),Q.get(k.id).push(Z)),k=k.parentGroupId?d.get(k.parentGroupId):void 0}const R=new Map;function F(D){if(R.has(D.id))return R.get(D.id);const $=WC({group:D,currentTime:C,activeMembers:Q.get(D.id)??[],fallbackDimensions:{width:I.width,height:I.height}});return R.set(D.id,$),$}function P(D,$,J){const ee=f({id:J});if(ee.length===0){D.drawImage($,0,0,$.width,$.height);return}D.save();for(let Z=ee.length-1;Z>=0;Z--){const k=ee[Z],O=F(k);O&&jd({group:k,animationState:O,targetCtx:D,fallbackDimensions:{width:I.width,height:I.height}})}D.drawImage($,0,0,$.width,$.height),D.restore()}for(let D=0;D<c.length;D++){if(y!=null&&y.aborted)return;const $=c[D];if(sc($))continue;const{scenes:J,transitions:ee,trackCanvas:Z}=$;Z.width=Z.height=0,Z.width=I.width,Z.height=I.height;const k=Z.getContext("2d");if(!k)continue;const O=J.filter(({start:_,duration:M})=>C>=_&&C<_+M);if(O.length===0)continue;const V=ee.find(({start:_,duration:M})=>C>=_&&C<_+M),L=!!(V&&V.to&&V.from&&V.duration>0);for await(const _ of O){if(y!=null&&y.aborted)return;const{sceneCanvas:M,draw:W,id:Y}=_;if(await(W==null?void 0:W(C,B==null?void 0:B.get(Y))),y!=null&&y.aborted)return;L&&(V.to.id===Y||V.from.id===Y)||P(k,M,Y)}if(L){const{name:_,to:M,from:W,duration:Y,transitionCanvas:ie}=V;ie.width=ie.height=0,ie.width=Z.width,ie.height=Z.height;const oe=Math.min(1,Math.max(0,(C-M.start)/Y));if(await o({name:_,progress:oe,contextResources:l,to:M.sceneCanvas,from:W.sceneCanvas,canvas:ie}),y!=null&&y.aborted)return;const fe=new Set(f({id:W.id})),Ee=new Set(f({id:M.id})),we=[...fe].filter(Ne=>Ee.has(Ne)).sort((Ne,pe)=>Ne.depth-pe.depth);if(we.length===0)k.drawImage(ie,0,0,ie.width,ie.height);else{k.save();for(const Ne of we){const pe=F(Ne);pe&&jd({group:Ne,animationState:pe,targetCtx:k,fallbackDimensions:{width:I.width,height:I.height}})}k.drawImage(ie,0,0,ie.width,ie.height),k.restore()}}x.drawImage(Z,0,0,Z.width,Z.height)}},cleanup:()=>{ZC(l)},tracks:c,groups:u,aspectRatio:e.aspectRatio,transcriptions:e.transcriptions,duration:Math.max(...c.map(({duration:I})=>I))}}const tB={version:"8.3.0"};function iB(r){const{publicApiUrl:e}=go(r),t=Lr();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function rB(r){var s,o,a,l,c,u,A,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:Lr()};let e=(o=(s=window.localStorage)==null?void 0:s.getItem)==null?void 0:o.call(s,"vouch-uid-visitor"),t=(l=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:l.call(a,"vouch-uid-client"),i=(u=(c=window.sessionStorage)==null?void 0:c.getItem)==null?void 0:u.call(c,"vouch-uid-tab");const n=Lr();return e||(e=iB(r),(h=(A=window.localStorage)==null?void 0:A.setItem)==null||h.call(A,"vouch-uid-visitor",e)),t||(t=Lr(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),i||(i=Lr(),(p=(g=window.sessionStorage)==null?void 0:g.setItem)==null||p.call(g,"vouch-uid-tab",i)),{client:t,tab:i,request:n,visitor:e}}function nB(r,e){return r&&"vouchId"in r?r.vouchId:(e==null?void 0:e.id)??null}function sB(r="embedded_player"){var n,s;const[e,t]=((s=(n=Intl.DateTimeFormat().resolvedOptions().timeZone)==null?void 0:n.split)==null?void 0:s.call(n,"/"))??[],i={};return[...new URLSearchParams(location.search).entries()].forEach(([o,a])=>{if(/utm/.test(o)){const l=o.toLowerCase().replace(/[-_][a-z0-9]/g,c=>c.slice(-1).toUpperCase());i[l]=a}}),{source:r,time:new Date,region:t,country:e,screenHeight:window.screen.height,screenWidth:window.screen.width,referrer:document.referrer,currentUrl:location.href,embedType:"media-player-embed",embedVersion:tB.version,templateVersion:GC,...i}}const zd=1;class oB{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,i)=>{const n=nB(i,this.host.vouch);!n||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...i,senderId:this.host.senderId,vouchId:n,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=go(this.host.env),{client:i,tab:n,request:s,visitor:o}=rB(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":i,"x-uid-tab":n,"x-uid-request":s,"x-uid-visitor":o,"x-reporting-metadata":sB(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:i}=this._currentlyPlayingVideo;this._streamLatestTime[i]>this._streamStartTime[i]+zd&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]}},this._handleVouchLoaded=({detail:t})=>{t&&(this._hasLoaded[t]||(this._createTrackingEvent("VOUCH_LOADED",{vouchId:t}),this._hasLoaded[t]=!0))},this._handlePlay=()=>{this._hasPlayed||(this._createTrackingEvent("VIDEO_PLAYED",{streamStart:this.host.currentTime}),this._hasPlayed=!0)},this._handleVideoPlay=({detail:{id:t,key:i}})=>{this._answersViewed[i]||(this._createTrackingEvent("VOUCH_RESPONSE_VIEWED",{answerId:t}),this._answersViewed[i]=!0)},this._handleVideoTimeUpdate=({detail:{id:t,key:i,node:n}})=>{this.host.paused||(this._currentlyPlayingVideo={id:t,key:i,node:n},this._streamLatestTime[i]=n.currentTime,this._streamStartTime[i]||(this._streamStartTime[i]=n.currentTime,this._streamLatestTime[i]=n.currentTime))},this._handleVideoPause=({detail:{id:t,key:i}})=>{this._streamLatestTime[i]>this._streamStartTime[i]+zd&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]},this._pageUnloading=()=>{this._streamEnded(),this._sendTrackingEvent()},this._handleVisibilityChange=()=>{document.visibilityState==="hidden"&&this._pageUnloading()},this._handlePageHide=()=>{this._pageUnloading()},this.host=e,e.addController(this)}hostConnected(){requestAnimationFrame(()=>{var e,t,i,n;"onvisibilitychange"in document?document.addEventListener("visibilitychange",this._handleVisibilityChange):window.addEventListener("pagehide",this._handlePageHide),this.host.addEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.addEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.addEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.addEventListener("video:pause",this._handleVideoPause),(n=this.host.mediaPlayer)==null||n.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,i,n;this._pageUnloading(),"onvisibilitychange"in document?document.removeEventListener("visibilitychange",this._handleVisibilityChange):window.removeEventListener("pagehide",this._handlePageHide),this.host.removeEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.removeEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.removeEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.removeEventListener("video:pause",this._handleVideoPause),(n=this.host.mediaPlayer)==null||n.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var oc={exports:{}};(function(r,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof nr<"u"&&nr,i=function(){function s(){this.fetch=!1,this.DOMException=t.DOMException}return s.prototype=t,new s}();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof nr<"u"&&nr||{},l={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 c(k){return k&&DataView.prototype.isPrototypeOf(k)}if(l.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],A=ArrayBuffer.isView||function(k){return k&&u.indexOf(Object.prototype.toString.call(k))>-1};function h(k){if(typeof k!="string"&&(k=String(k)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(k)||k==="")throw new TypeError('Invalid character in header field name: "'+k+'"');return k.toLowerCase()}function d(k){return typeof k!="string"&&(k=String(k)),k}function f(k){var O={next:function(){var V=k.shift();return{done:V===void 0,value:V}}};return l.iterable&&(O[Symbol.iterator]=function(){return O}),O}function g(k){this.map={},k instanceof g?k.forEach(function(O,V){this.append(V,O)},this):Array.isArray(k)?k.forEach(function(O){if(O.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+O.length);this.append(O[0],O[1])},this):k&&Object.getOwnPropertyNames(k).forEach(function(O){this.append(O,k[O])},this)}g.prototype.append=function(k,O){k=h(k),O=d(O);var V=this.map[k];this.map[k]=V?V+", "+O:O},g.prototype.delete=function(k){delete this.map[h(k)]},g.prototype.get=function(k){return k=h(k),this.has(k)?this.map[k]:null},g.prototype.has=function(k){return this.map.hasOwnProperty(h(k))},g.prototype.set=function(k,O){this.map[h(k)]=d(O)},g.prototype.forEach=function(k,O){for(var V in this.map)this.map.hasOwnProperty(V)&&k.call(O,this.map[V],V,this)},g.prototype.keys=function(){var k=[];return this.forEach(function(O,V){k.push(V)}),f(k)},g.prototype.values=function(){var k=[];return this.forEach(function(O){k.push(O)}),f(k)},g.prototype.entries=function(){var k=[];return this.forEach(function(O,V){k.push([V,O])}),f(k)},l.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function p(k){if(!k._noBody){if(k.bodyUsed)return Promise.reject(new TypeError("Already read"));k.bodyUsed=!0}}function I(k){return new Promise(function(O,V){k.onload=function(){O(k.result)},k.onerror=function(){V(k.error)}})}function C(k){var O=new FileReader,V=I(O);return O.readAsArrayBuffer(k),V}function B(k){var O=new FileReader,V=I(O),L=/charset=([A-Za-z0-9_-]+)/.exec(k.type),_=L?L[1]:"utf-8";return O.readAsText(k,_),V}function y(k){for(var O=new Uint8Array(k),V=new Array(O.length),L=0;L<O.length;L++)V[L]=String.fromCharCode(O[L]);return V.join("")}function x(k){if(k.slice)return k.slice(0);var O=new Uint8Array(k.byteLength);return O.set(new Uint8Array(k)),O.buffer}function Q(){return this.bodyUsed=!1,this._initBody=function(k){this.bodyUsed=this.bodyUsed,this._bodyInit=k,k?typeof k=="string"?this._bodyText=k:l.blob&&Blob.prototype.isPrototypeOf(k)?this._bodyBlob=k:l.formData&&FormData.prototype.isPrototypeOf(k)?this._bodyFormData=k:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)?this._bodyText=k.toString():l.arrayBuffer&&l.blob&&c(k)?(this._bodyArrayBuffer=x(k.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(k)||A(k))?this._bodyArrayBuffer=x(k):this._bodyText=k=Object.prototype.toString.call(k):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof k=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var k=p(this);if(k)return k;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var k=p(this);return k||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(l.blob)return this.blob().then(C);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var k=p(this);if(k)return k;if(this._bodyBlob)return B(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(D)}),this.json=function(){return this.text().then(JSON.parse)},this}var R=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function F(k){var O=k.toUpperCase();return R.indexOf(O)>-1?O:k}function P(k,O){if(!(this instanceof P))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');O=O||{};var V=O.body;if(k instanceof P){if(k.bodyUsed)throw new TypeError("Already read");this.url=k.url,this.credentials=k.credentials,O.headers||(this.headers=new g(k.headers)),this.method=k.method,this.mode=k.mode,this.signal=k.signal,!V&&k._bodyInit!=null&&(V=k._bodyInit,k.bodyUsed=!0)}else this.url=String(k);if(this.credentials=O.credentials||this.credentials||"same-origin",(O.headers||!this.headers)&&(this.headers=new g(O.headers)),this.method=F(O.method||this.method||"GET"),this.mode=O.mode||this.mode||null,this.signal=O.signal||this.signal||function(){if("AbortController"in a){var M=new AbortController;return M.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&V)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(V),(this.method==="GET"||this.method==="HEAD")&&(O.cache==="no-store"||O.cache==="no-cache")){var L=/([?&])_=[^&]*/;if(L.test(this.url))this.url=this.url.replace(L,"$1_="+new Date().getTime());else{var _=/\?/;this.url+=(_.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}P.prototype.clone=function(){return new P(this,{body:this._bodyInit})};function D(k){var O=new FormData;return k.trim().split("&").forEach(function(V){if(V){var L=V.split("="),_=L.shift().replace(/\+/g," "),M=L.join("=").replace(/\+/g," ");O.append(decodeURIComponent(_),decodeURIComponent(M))}}),O}function $(k){var O=new g,V=k.replace(/\r?\n[\t ]+/g," ");return V.split("\r").map(function(L){return L.indexOf(`
|
|
2476
|
+
`).map(e=>{if(!e)return[];const t=[];for(const i of e.match(/\S+|\s+/g)??[])if(/^\s+$/.test(i))t.push({text:i,logicalIndex:t.length,whitespace:!0,spaceBefore:!1});else if(Hd.test(i))for(const n of $d(i))t.push({text:n.text,logicalIndex:t.length,whitespace:!1,spaceBefore:!1});else t.push({text:i,logicalIndex:t.length,whitespace:!1,spaceBefore:!1});return t})}function $d(r){const e=[];let t=!1,i="";const n=bC();if(!n)return[{text:r,spaceBefore:!1}];for(const{segment:s,isWordLike:o}of n.segment(r)){if(!o&&s.trim().length===0){t=e.length>0?!0:t;continue}if(o){e.push({text:s,spaceBefore:t}),t=!1;continue}e.length>0?e[e.length-1].text+=s:i+=s}return i&&e.length>0?e[0].text=i+e[0].text:i&&e.push({text:i,spaceBefore:t}),e}function wC(r){const e=[];for(const t of r){const n=Hd.test(t.text)||/\s/.test(t.text)?$d(t.text):[{text:t.text,spaceBefore:!1}];if(n.length<=1){e.push({text:t.text,logicalIndex:e.length,whitespace:!1,spaceBefore:e.length>0,timing:{id:t.id,start:t.start,end:t.end}});continue}const s=n.reduce((l,c)=>l+[...c.text].length,0),o=t.end-t.start;let a=t.start;n.forEach((l,c)=>{const u=[...l.text].length/s*o,A=a,h=c===n.length-1?t.end:a+u;a=h,e.push({text:l.text,logicalIndex:e.length,whitespace:!1,spaceBefore:c===0?e.length>0:l.spaceBefore,timing:{id:t.id,subIndex:c,start:A,end:h}})})}return e}const _C=/(?<value>\d+\.?\d*)(?=px)/,nc=1;function QC(r,e){const t=typeof r=="string"?xC(r):[wC(r)];return e?t.map(i=>i.map(n=>({...n,text:n.text.toUpperCase()}))):t}function RC({context:r,groups:e,appendedFont:t,fontSizes:i,maxW:n,wrap:s,strokeWidth:o,letterSpacing:a,wholeLineMeasure:l}){const c=[],u=h=>{const d=i[h%i.length];return{fontSize:d,font:t.replace(_C,d.toString())}},A=(h,d)=>(r.font=h,r.letterSpacing=`${a}px`,r.measureText(d));for(const h of e){const d=c.length,{fontSize:f,font:g}=u(c.length);let p={items:[],font:g,fontSize:f,lineWidth:0,fontAscent:0,fontDescent:0},I="",C="";const B=()=>{const y=A(p.font,"");p.fontAscent=y.fontBoundingBoxAscent,p.fontDescent=y.fontBoundingBoxDescent,c.push(p);const x=u(c.length);p={items:[],font:x.font,fontSize:x.fontSize,lineWidth:0,fontAscent:0,fontDescent:0},I="",C=""};for(const y of h){if(y.whitespace){C+=y.text;continue}const x=()=>{const F=p.items.length>0&&y.spaceBefore&&!C?" ":C,P=F?A(p.font,F).width:0,D=A(p.font,y.text);return{token:y,metrics:D,width:D.width+o,gapBefore:P,gapText:F}};let Q=x();const R=l?A(p.font,I+Q.gapText+y.text).width+o*(p.items.length+1):p.lineWidth+Q.gapBefore+Q.width;if(s&&R>n+nc&&p.items.length>0&&(B(),Q=x()),s&&l&&p.items.length===0&&Q.width>n+nc){let F=y.text;for(;F.length>0;){let P="";for(const $ of F){const J=A(p.font,P+$).width+o;if(P&&J>n+nc)break;P+=$}F=F.slice(P.length);const D=A(p.font,P);p.items.push({token:{...y,text:P},metrics:D,width:D.width+o,gapBefore:0,gapText:""}),I=P,p.lineWidth=D.width+o*p.items.length,F.length>0&&B()}C="";continue}p.items.push(Q),I+=Q.gapText+y.text,p.lineWidth=l?A(p.font,I).width+o*p.items.length:p.lineWidth+Q.gapBefore+Q.width,C=""}l&&C&&(p.items.length>0||c.length===d)&&(I+=C,p.lineWidth=A(p.font,I).width+o*p.items.length),(p.items.length>0||c.length===d)&&B()}return c}const Yd=[{family:"Noto Arabic",regex:new RegExp("\\p{Script=Arabic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansArabic-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Chinese",regex:new RegExp("\\p{Script=Han}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansSC-VariableFont_wght.woff2",style:"normal"},{family:"Noto Hebrew",regex:new RegExp("\\p{Script=Hebrew}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansHebrew-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Hindi",regex:new RegExp("\\p{Script=Devanagari}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansDevanagari-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Japanese",regex:new RegExp("\\p{Script=Han}|\\p{Script=Katakana}|\\p{Script=Hiragana}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansJP-VariableFont_wght.woff2",style:"normal"},{family:"Noto Korean",regex:new RegExp("\\p{Script=Hangul}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKR-VariableFont_wght.woff2",style:"normal"},{family:"Noto Color Emoji",regex:new RegExp("\\p{Extended_Pictographic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoColorEmoji-Regular.woff2",style:"normal"},{family:"Noto Telugu",regex:new RegExp("\\p{Script=Telugu}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansTelugu-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Tamil",regex:new RegExp("\\p{Script=Tamil}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansTamil-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Kannada",regex:new RegExp("\\p{Script=Kannada}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKannada-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Malayalam",regex:new RegExp("\\p{Script=Malayalam}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansMalayalam-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Bengali",regex:new RegExp("\\p{Script=Bengali}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansBengali-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Gujarati",regex:new RegExp("\\p{Script=Gujarati}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGujarati-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Gurmukhi",regex:new RegExp("\\p{Script=Gurmukhi}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGurmukhi-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Sinhala",regex:new RegExp("\\p{Script=Sinhala}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansSinhala-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Thai",regex:new RegExp("\\p{Script=Thai}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansThai-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Lao",regex:new RegExp("\\p{Script=Lao}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansLao-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Khmer",regex:new RegExp("\\p{Script=Khmer}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKhmer-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Myanmar",regex:new RegExp("\\p{Script=Myanmar}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansMyanmar-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Ethiopic",regex:new RegExp("\\p{Script=Ethiopic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansEthiopic-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Armenian",regex:new RegExp("\\p{Script=Armenian}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansArmenian-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Georgian",regex:new RegExp("\\p{Script=Georgian}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGeorgian-VariableFont_wdth%2Cwght.woff2",style:"normal"}];function Vd({text:r,font:e}){let t=e;return Yd.forEach(({family:i,regex:n})=>{n.exec(r)&&(t+=`, ${i}`)}),t}function Kd(r){return Math.max(r??1,.5)}function DC({measured:r,index:e,lineTop:t,dx:i,dw:n,align:s,direction:o,lineHeight:a,strokeWidth:l}){const{items:c,font:u,fontSize:A,lineWidth:h,fontAscent:d,fontDescent:f}=r;let g=0;s==="center"?g=(n-h)/2:s==="right"&&(g=n-h);const p=Kd(a),I=A*p+l,C=(p-1)*A/2,B=(A+d-f)/2,y=t+C+B+l/2,{order:x,directions:Q,baseDirection:R}=BC(c.map(({token:Z})=>({text:Z.text})),o),F=c.map(({gapBefore:Z})=>Z);let P=i+g+l/2;const D=[];x.forEach((Z,k)=>{const O=c[Z];P+=F[k],D.push({...O.token,x:P,baselineY:y,width:O.width,lineIndex:e,direction:Q[Z],font:u,metrics:O.metrics}),P+=O.width});const $=[],J=[];D.forEach((Z,k)=>{const O=$[$.length-1];if(O&&O.direction===Z.direction){const V=Math.max(O.x+O.width,Z.x+Z.width);O.tokens.push(Z),O.x=Math.min(O.x,Z.x),O.width=V-O.x,J[J.length-1].push(x[k])}else $.push({text:"",x:Z.x,width:Z.width,direction:Z.direction,tokens:[Z]}),J.push([x[k]])}),$.forEach((Z,k)=>{const O=[...J[k]].sort((V,L)=>V-L);Z.text=O.map((V,L)=>L===0?c[V].token.text:`${c[V].gapText}${c[V].token.text}`).join("")});const ee=o??R;return{index:e,box:{x:i+g,y:t,width:h,height:I},baselineY:y,direction:ee,runs:$,tokens:D}}function LC(r){const{context:e,text:t,font:i,fontSizes:n,dx:s=0,dy:o=0,maxW:a=1/0,dw:l=a,align:c="left",direction:u,lineHeight:A,lineGap:h=0,letterSpacing:d=0,strokeWidth:f=0,wrap:g=!0,uppercase:p=!1}=r,I=QC(t,p),C=I.flat().map(({text:Q})=>Q).join(" "),B=Vd({font:i,text:C}),y=u??yC(C),x=vC(c,y);try{e.save();const Q=RC({context:e,groups:I,appendedFont:B,fontSizes:n,maxW:a,wrap:g,strokeWidth:f,letterSpacing:d,wholeLineMeasure:typeof t=="string"}),R=[];let F=o;for(let ee=0;ee<Q.length;ee++){const Z=DC({measured:Q[ee],index:ee,lineTop:F,dx:s,dw:l,align:x,direction:u,lineHeight:A,strokeWidth:f});R.push(Z),F+=Z.box.height+h}const P=Q[Q.length-1],D=P?Math.max(0,(P.fontAscent+P.fontDescent-P.fontSize*Kd(A))/2):0,$=R.reduce((ee,{box:Z})=>ee+Z.height,0)+h*Math.max(0,R.length-1)+D,J=R.length?{x:Math.min(...R.map(({box:ee})=>ee.x)),y:Math.min(...R.map(({box:ee})=>ee.y)),width:Math.max(...R.map(({box:ee})=>ee.x+ee.width))-Math.min(...R.map(({box:ee})=>ee.x)),height:Math.max(...R.map(({box:ee})=>ee.y+ee.height))-Math.min(...R.map(({box:ee})=>ee.y))}:{x:s,y:o,width:0,height:0};return{lines:R,totalHeight:$,blockBox:J,direction:y,font:B}}finally{e.restore()}}Yu(LC,{cache:SC(),cacheKey:([r])=>JSON.stringify([r.text,r.font,r.fontSizes,r.dx,r.dy,r.dw,r.maxW,r.align,r.direction,r.lineHeight,r.lineGap,r.letterSpacing,r.strokeWidth,r.wrap,r.uppercase])});function kC(r){return r.slice(0,1).toUpperCase()+r.slice(1)}Object.keys(Ed).map(r=>({label:kC(r),value:r,data:r}));function Wd(){return document.createElement("canvas")}function Zt(r){let e=0;for(const t of r)Array.isArray(t)?e+=Zt(t):e+=t;return e}function Vo(r){return r.map(({type:e,duration:t},i)=>{var n,s,o,a;if(e==="transition"){const l=((n=r[i-2])==null?void 0:n.type)==="transition"?r[i-2]:null,c=((s=r[i-1])==null?void 0:s.duration)??1/0,u=((o=r[i+1])==null?void 0:o.duration)??1/0,A=((a=r[i+2])==null?void 0:a.type)==="transition"?r[i+2]:null;return Math.min(l?c/2:c,t,A?u/2:u)*-1}return t})}function MC(r){if(r===null||typeof r!="object")return!1;if(Object.getPrototypeOf(r)===null)return!0;let e=r;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e}function FC(r){return r.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}ZE.filters.define("parse",r=>typeof r>"u"?null:typeof r=="string"?`"${FC(r)}"`:MC(r)||Array.isArray(r)?JSON.stringify(r):r);function PC(r){return r.some(({type:e})=>e==="text")}function NC(r){return r.some(({type:e})=>e==="caption")}function OC(r){return r.some(({type:e})=>e==="audio")}function UC(r){return r.some(({type:e})=>e==="video"||e==="image")}function sc(r){return r.type==="audio"}const GC="3";async function HC({scene:r,start:e=0}){const{id:t,root:i,duration:n}=r,s=await Nd({id:t,root:i});return{type:r.type,start:e,duration:n,layout:s,id:r.id,config:r}}async function $C({track:r}){const e=Vo(r),t=await Promise.all(r.reduce((s,o,a)=>{if(o.type!=="audio")return s;const l=Zt(e.slice(0,a));return s.push(HC({scene:o,start:l})),s},[])),i=r.reduce((s,o,a)=>{if(o.type!=="gap")return s;const l=Zt(e.slice(0,a));return s.push({type:o.type,id:o.id,start:l,config:o,duration:o.duration}),s},[]),n=r.map(({id:s})=>t.find(({id:o})=>o===s)??i.find(({id:o})=>o===s)).filter(Boolean);return{type:"audio",scenes:t,gapScenes:i,mergedScenes:n,config:r,duration:Math.max(...n.map(({start:s,duration:o})=>s+o))}}async function Jd({node:r,canvases:e,sceneTime:t,sceneDuration:i,parentOpacity:n=1,parentTransform:s,debug:o=!1,override:a}){var l,c,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&&((l=r.element.layout)!=null&&l.transform)?{...r.element.layout,transform:{...r.element.layout.transform,rotation:a.rotation}}:r.element.layout,g=Rd({layout:f,sceneTime:t,animations:r.element.animations,elementDuration:i,elementDimensions:{width:r.width,height:r.height}}),{opacity:p,translation:I,scale:C,clip:B,dimensions:y,rotation:x}=g,Q=r.width*y.widthRatio,R=r.height*y.heightRatio;if(d.globalAlpha=p*n,(I.x||I.y)&&d.translate(I.x,I.y),(C!==1||x!==0)&&(d.translate(r.x+Q/2,r.y+R/2),d.scale(C,C),d.rotate(x*Math.PI/180),d.translate(-(r.x+Q/2),-(r.y+R/2))),B){d.beginPath();const D={x:r.x+B.x*Q,y:r.y+B.y*R,width:B.width*Q,height:B.height*R};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(r.x,r.y,Q,R),d.globalAlpha=D}const F=(a==null?void 0:a.fontSize)!=null||(a==null?void 0:a.textValue)!=null?{...r.options,...a.textValue!=null?{value:a.textValue}:{},...a.fontSize!=null&&((c=r.options)!=null&&c.font)?{font:{...r.options.font,size:a.fontSize}}:{}}:r.options,P=(a==null?void 0:a.fontSize)!=null&&((u=r.dependencies)!=null&&u.font)?{...r.dependencies,font:{...r.dependencies.font,size:a.fontSize}}:r.dependencies;await((h=(A=r.renderer)==null?void 0:A.render)==null?void 0:h.call(A,{canvases:e,sceneTime:t,dx:r.x,dy:r.y,dw:Q,dh:R,radius:r.radius,options:F,dependencies:P}));for await(const D of r.childNodes)await Jd({debug:o,node:D,canvases:e,sceneTime:t,sceneDuration:i,parentOpacity:d.globalAlpha,parentTransform:d.getTransform(),override:a});d.restore()}}async function YC({layout:r,canvases:e,sceneTime:t,sceneDuration:i,debug:n=!1,override:s}){const{node:o}=r;await Jd({debug:n,node:o,canvases:e,sceneDuration:i,sceneTime:t,override:s})}async function Ko({debug:r=!1,scene:e,start:t=0,resolvers:i,rootWidth:n,rootHeight:s,canvasFactory:o=Wd}){var a,l;const{id:c,x:u,y:A,width:h,height:d,root:f,duration:g}=e,p=o(),I=o(),C=o(),B=o(),y=o(),x=await Nd({id:c,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??((l=f.element.layout)==null?void 0:l.height)}}},resolvers:i,measureCanvas:y}),Q=async(R,F)=>{const P=Math.max(0,R-t);p.width=p.height=0,p.width=n,p.height=s,await YC({debug:r,layout:x,sceneTime:P,sceneDuration:g,canvases:{sceneCanvas:p,cropCanvas:I,letterboxCanvas:C,posterCanvas:B},override:F})};return{id:c,type:e.type,start:t,duration:g,layout:x,sceneCanvas:p,draw:Q,config:e,childScenes:[]}}async function VC({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Vo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=Zt(o.slice(0,d));return h.type==="caption"&&A.push(Ko({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=Zt(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),c=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=Zt(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)??l.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)).filter(Boolean);return{type:"caption",scenes:a,gapScenes:l,transitions:c,mergedScenes:u,duration:Math.max(...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}function KC({groups:r,tracks:e}){const t=r.map(s=>new Set(s.sceneIds)),i=r.map((s,o)=>{const a=[];for(let u=0;u<e.length;u++){const A=e[u];sc(A)||A.scenes.some(h=>s.sceneIds.includes(h.id))&&a.push(u)}let l,c=1/0;for(let u=0;u<r.length;u++){if(o===u)continue;const A=t[u];s.sceneIds.every(d=>A.has(d))&&A.size>t[o].size&&A.size<c&&(l=r[u].id,c=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:l,depth:0}}),n=new Map(i.map(s=>[s.id,s]));for(const s of i){let o=0,a=s;for(;a!=null&&a.parentGroupId;)o++,a=n.get(a.parentGroupId);s.depth=o}return i}function WC({group:r,currentTime:e,activeMembers:t,fallbackDimensions:i}){if(!r.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),l=r.bounds,c=(l==null?void 0:l.width)??i.width,u=(l==null?void 0:l.height)??i.height;return Rd({sceneTime:a,animations:r.animations,elementDuration:o,elementDimensions:{width:c,height:u}})}function jd({group:r,animationState:e,targetCtx:t,fallbackDimensions:i}){const n=r.bounds,s=(n==null?void 0:n.x)??0,o=(n==null?void 0:n.y)??0,a=(n==null?void 0:n.width)??i.width,l=(n==null?void 0:n.height)??i.height,{opacity:c,translation:u,scale:A,clip:h,rotation:d}=e;if(t.globalAlpha*=c,(u.x||u.y)&&t.translate(u.x,u.y),A!==1||d!==0){const f=s+a/2,g=o+l/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*l,h.width*a,h.height*l),t.clip())}async function JC({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Vo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=Zt(o.slice(0,d));return h.type==="video"&&A.push(Ko({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),h.type==="image"&&A.push(Ko({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=Zt(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),c=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=Zt(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)??l.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)).filter(Boolean);return{type:"picture",scenes:a,gapScenes:l,transitions:c,mergedScenes:u,duration:Math.max(0,...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}async function jC({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Vo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=Zt(o.slice(0,d));return h.type==="text"&&A.push(Ko({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=Zt(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),c=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=Zt(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)??l.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)).filter(Boolean);return{type:"text",scenes:a,gapScenes:l,transitions:c,mergedScenes:u,duration:Math.max(...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}const qC=(((md=pd)==null?void 0:md.default)??pd).reduce((r,e)=>(r[e.name]=e,r),{});function zC(r,e){return r.has(e)||r.set(e,{buffer:null,transitions:{},fromTexture:null,toTexture:null}),r.get(e)}function XC({name:r,to:e,from:t,progress:i,width:n,height:s,glContext:o,contextResources:a,returnPixels:l=!0}){var c,u,A;const h=zC(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=(((c=Po)==null?void 0:c.default)??Po)(o,t),h.fromTexture.minFilter=o.LINEAR,h.fromTexture.magFilter=o.LINEAR),h.toTexture?h.toTexture.setPixels(e):(h.toTexture=(((u=Po)==null?void 0:u.default)??Po)(o,e),h.toTexture.minFilter=o.LINEAR,h.toTexture.magFilter=o.LINEAR),h.transitions[r]||(h.transitions[r]=(((A=gd)==null?void 0:A.default)??gd)(o,qC[r])),h.transitions[r].draw(i,h.fromTexture,h.toTexture,n,s),!l)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 ZC(r){for(const[e,t]of r.entries())t.buffer&&e.deleteBuffer(t.buffer),t.fromTexture&&t.fromTexture.dispose(),t.toTexture&&t.toTexture.dispose(),Object.values(t.transitions).forEach(i=>{i.dispose()}),r.delete(e)}function eB({name:r,to:e,from:t,progress:i,canvas:n,contextResources:s}){const o=n.getContext("webgl",{alpha:!0,depth:!1,antialias:!1,preserveDrawingBuffer:!1});o&&(o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!0),XC({name:r,to:e,from:t,progress:i,width:n.width,height:n.height,glContext:o,contextResources:s,returnPixels:!1}))}async function qd({debug:r=!1,config:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s=Wd,drawTransition:o=eB}){var a;const l=new Map,c=await Promise.all(e.tracks.map(async I=>{if(UC(I))return{...await JC({debug:r,track:I,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:I};if(PC(I))return{...await jC({debug:r,track:I,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:I};if(NC(I))return{...await VC({debug:r,track:I,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:I};if(OC(I))return{...await $C({track:I}),config:I};throw new Error("Unknown track type")})),u=(a=e.groups)!=null&&a.length?KC({groups:e.groups,tracks:c}):[],A=new Map,h=[...u].sort((I,C)=>I.depth-C.depth);for(const I of h)for(const C of I.sceneIds)A.set(C,I);const d=new Map(u.map(I=>[I.id,I]));function f(I){const C=[];let B=A.get(I.id);for(;B;)B.animations&&C.push(B),B=B.parentGroupId?d.get(B.parentGroupId):void 0;return C}return{draw:async({canvas:I,currentTime:C,overrides:B,signal:y})=>{const x=I.getContext("2d");if(!x)return;x.globalAlpha=1,x.globalCompositeOperation="source-over",x.clearRect(0,0,I.width,I.height),x.save(),x.fillStyle="black",x.fillRect(0,0,I.width,I.height),x.restore();const Q=new Map;for(const D of c)if(!sc(D))for(const $ of D.scenes){if(C<$.start||C>=$.start+$.duration)continue;const J=$.layout,ee=J==null?void 0:J.node,Z={start:$.start,end:$.start+$.duration,x:(ee==null?void 0:ee.x)??0,y:(ee==null?void 0:ee.y)??0,width:(ee==null?void 0:ee.width)??I.width,height:(ee==null?void 0:ee.height)??I.height};let k=A.get($.id);for(;k;)k.animations&&(Q.has(k.id)||Q.set(k.id,[]),Q.get(k.id).push(Z)),k=k.parentGroupId?d.get(k.parentGroupId):void 0}const R=new Map;function F(D){if(R.has(D.id))return R.get(D.id);const $=WC({group:D,currentTime:C,activeMembers:Q.get(D.id)??[],fallbackDimensions:{width:I.width,height:I.height}});return R.set(D.id,$),$}function P(D,$,J){const ee=f({id:J});if(ee.length===0){D.drawImage($,0,0,$.width,$.height);return}D.save();for(let Z=ee.length-1;Z>=0;Z--){const k=ee[Z],O=F(k);O&&jd({group:k,animationState:O,targetCtx:D,fallbackDimensions:{width:I.width,height:I.height}})}D.drawImage($,0,0,$.width,$.height),D.restore()}for(let D=0;D<c.length;D++){if(y!=null&&y.aborted)return;const $=c[D];if(sc($))continue;const{scenes:J,transitions:ee,trackCanvas:Z}=$;Z.width=Z.height=0,Z.width=I.width,Z.height=I.height;const k=Z.getContext("2d");if(!k)continue;const O=J.filter(({start:_,duration:M})=>C>=_&&C<_+M);if(O.length===0)continue;const V=ee.find(({start:_,duration:M})=>C>=_&&C<_+M),L=!!(V&&V.to&&V.from&&V.duration>0);for await(const _ of O){if(y!=null&&y.aborted)return;const{sceneCanvas:M,draw:W,id:Y}=_;if(await(W==null?void 0:W(C,B==null?void 0:B.get(Y))),y!=null&&y.aborted)return;L&&(V.to.id===Y||V.from.id===Y)||P(k,M,Y)}if(L){const{name:_,to:M,from:W,duration:Y,transitionCanvas:ie}=V;ie.width=ie.height=0,ie.width=Z.width,ie.height=Z.height;const oe=Math.min(1,Math.max(0,(C-M.start)/Y));if(await o({name:_,progress:oe,contextResources:l,to:M.sceneCanvas,from:W.sceneCanvas,canvas:ie}),y!=null&&y.aborted)return;const fe=new Set(f({id:W.id})),Ee=new Set(f({id:M.id})),we=[...fe].filter(Ne=>Ee.has(Ne)).sort((Ne,pe)=>Ne.depth-pe.depth);if(we.length===0)k.drawImage(ie,0,0,ie.width,ie.height);else{k.save();for(const Ne of we){const pe=F(Ne);pe&&jd({group:Ne,animationState:pe,targetCtx:k,fallbackDimensions:{width:I.width,height:I.height}})}k.drawImage(ie,0,0,ie.width,ie.height),k.restore()}}x.drawImage(Z,0,0,Z.width,Z.height)}},cleanup:()=>{ZC(l)},tracks:c,groups:u,aspectRatio:e.aspectRatio,transcriptions:e.transcriptions,duration:Math.max(...c.map(({duration:I})=>I))}}const tB={version:"8.3.1"};function iB(r){const{publicApiUrl:e}=go(r),t=Lr();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function rB(r){var s,o,a,l,c,u,A,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:Lr()};let e=(o=(s=window.localStorage)==null?void 0:s.getItem)==null?void 0:o.call(s,"vouch-uid-visitor"),t=(l=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:l.call(a,"vouch-uid-client"),i=(u=(c=window.sessionStorage)==null?void 0:c.getItem)==null?void 0:u.call(c,"vouch-uid-tab");const n=Lr();return e||(e=iB(r),(h=(A=window.localStorage)==null?void 0:A.setItem)==null||h.call(A,"vouch-uid-visitor",e)),t||(t=Lr(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),i||(i=Lr(),(p=(g=window.sessionStorage)==null?void 0:g.setItem)==null||p.call(g,"vouch-uid-tab",i)),{client:t,tab:i,request:n,visitor:e}}function nB(r,e){return r&&"vouchId"in r?r.vouchId:(e==null?void 0:e.id)??null}function sB(r="embedded_player"){var n,s;const[e,t]=((s=(n=Intl.DateTimeFormat().resolvedOptions().timeZone)==null?void 0:n.split)==null?void 0:s.call(n,"/"))??[],i={};return[...new URLSearchParams(location.search).entries()].forEach(([o,a])=>{if(/utm/.test(o)){const l=o.toLowerCase().replace(/[-_][a-z0-9]/g,c=>c.slice(-1).toUpperCase());i[l]=a}}),{source:r,time:new Date,region:t,country:e,screenHeight:window.screen.height,screenWidth:window.screen.width,referrer:document.referrer,currentUrl:location.href,embedType:"media-player-embed",embedVersion:tB.version,templateVersion:GC,...i}}const zd=1;class oB{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,i)=>{const n=nB(i,this.host.vouch);!n||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...i,senderId:this.host.senderId,vouchId:n,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=go(this.host.env),{client:i,tab:n,request:s,visitor:o}=rB(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":i,"x-uid-tab":n,"x-uid-request":s,"x-uid-visitor":o,"x-reporting-metadata":sB(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:i}=this._currentlyPlayingVideo;this._streamLatestTime[i]>this._streamStartTime[i]+zd&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]}},this._handleVouchLoaded=({detail:t})=>{t&&(this._hasLoaded[t]||(this._createTrackingEvent("VOUCH_LOADED",{vouchId:t}),this._hasLoaded[t]=!0))},this._handlePlay=()=>{this._hasPlayed||(this._createTrackingEvent("VIDEO_PLAYED",{streamStart:this.host.currentTime}),this._hasPlayed=!0)},this._handleVideoPlay=({detail:{id:t,key:i}})=>{this._answersViewed[i]||(this._createTrackingEvent("VOUCH_RESPONSE_VIEWED",{answerId:t}),this._answersViewed[i]=!0)},this._handleVideoTimeUpdate=({detail:{id:t,key:i,node:n}})=>{this.host.paused||(this._currentlyPlayingVideo={id:t,key:i,node:n},this._streamLatestTime[i]=n.currentTime,this._streamStartTime[i]||(this._streamStartTime[i]=n.currentTime,this._streamLatestTime[i]=n.currentTime))},this._handleVideoPause=({detail:{id:t,key:i}})=>{this._streamLatestTime[i]>this._streamStartTime[i]+zd&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]},this._pageUnloading=()=>{this._streamEnded(),this._sendTrackingEvent()},this._handleVisibilityChange=()=>{document.visibilityState==="hidden"&&this._pageUnloading()},this._handlePageHide=()=>{this._pageUnloading()},this.host=e,e.addController(this)}hostConnected(){requestAnimationFrame(()=>{var e,t,i,n;"onvisibilitychange"in document?document.addEventListener("visibilitychange",this._handleVisibilityChange):window.addEventListener("pagehide",this._handlePageHide),this.host.addEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.addEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.addEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.addEventListener("video:pause",this._handleVideoPause),(n=this.host.mediaPlayer)==null||n.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,i,n;this._pageUnloading(),"onvisibilitychange"in document?document.removeEventListener("visibilitychange",this._handleVisibilityChange):window.removeEventListener("pagehide",this._handlePageHide),this.host.removeEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.removeEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.removeEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.removeEventListener("video:pause",this._handleVideoPause),(n=this.host.mediaPlayer)==null||n.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var oc={exports:{}};(function(r,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof nr<"u"&&nr,i=function(){function s(){this.fetch=!1,this.DOMException=t.DOMException}return s.prototype=t,new s}();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof nr<"u"&&nr||{},l={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 c(k){return k&&DataView.prototype.isPrototypeOf(k)}if(l.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],A=ArrayBuffer.isView||function(k){return k&&u.indexOf(Object.prototype.toString.call(k))>-1};function h(k){if(typeof k!="string"&&(k=String(k)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(k)||k==="")throw new TypeError('Invalid character in header field name: "'+k+'"');return k.toLowerCase()}function d(k){return typeof k!="string"&&(k=String(k)),k}function f(k){var O={next:function(){var V=k.shift();return{done:V===void 0,value:V}}};return l.iterable&&(O[Symbol.iterator]=function(){return O}),O}function g(k){this.map={},k instanceof g?k.forEach(function(O,V){this.append(V,O)},this):Array.isArray(k)?k.forEach(function(O){if(O.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+O.length);this.append(O[0],O[1])},this):k&&Object.getOwnPropertyNames(k).forEach(function(O){this.append(O,k[O])},this)}g.prototype.append=function(k,O){k=h(k),O=d(O);var V=this.map[k];this.map[k]=V?V+", "+O:O},g.prototype.delete=function(k){delete this.map[h(k)]},g.prototype.get=function(k){return k=h(k),this.has(k)?this.map[k]:null},g.prototype.has=function(k){return this.map.hasOwnProperty(h(k))},g.prototype.set=function(k,O){this.map[h(k)]=d(O)},g.prototype.forEach=function(k,O){for(var V in this.map)this.map.hasOwnProperty(V)&&k.call(O,this.map[V],V,this)},g.prototype.keys=function(){var k=[];return this.forEach(function(O,V){k.push(V)}),f(k)},g.prototype.values=function(){var k=[];return this.forEach(function(O){k.push(O)}),f(k)},g.prototype.entries=function(){var k=[];return this.forEach(function(O,V){k.push([V,O])}),f(k)},l.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function p(k){if(!k._noBody){if(k.bodyUsed)return Promise.reject(new TypeError("Already read"));k.bodyUsed=!0}}function I(k){return new Promise(function(O,V){k.onload=function(){O(k.result)},k.onerror=function(){V(k.error)}})}function C(k){var O=new FileReader,V=I(O);return O.readAsArrayBuffer(k),V}function B(k){var O=new FileReader,V=I(O),L=/charset=([A-Za-z0-9_-]+)/.exec(k.type),_=L?L[1]:"utf-8";return O.readAsText(k,_),V}function y(k){for(var O=new Uint8Array(k),V=new Array(O.length),L=0;L<O.length;L++)V[L]=String.fromCharCode(O[L]);return V.join("")}function x(k){if(k.slice)return k.slice(0);var O=new Uint8Array(k.byteLength);return O.set(new Uint8Array(k)),O.buffer}function Q(){return this.bodyUsed=!1,this._initBody=function(k){this.bodyUsed=this.bodyUsed,this._bodyInit=k,k?typeof k=="string"?this._bodyText=k:l.blob&&Blob.prototype.isPrototypeOf(k)?this._bodyBlob=k:l.formData&&FormData.prototype.isPrototypeOf(k)?this._bodyFormData=k:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)?this._bodyText=k.toString():l.arrayBuffer&&l.blob&&c(k)?(this._bodyArrayBuffer=x(k.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(k)||A(k))?this._bodyArrayBuffer=x(k):this._bodyText=k=Object.prototype.toString.call(k):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof k=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var k=p(this);if(k)return k;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var k=p(this);return k||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(l.blob)return this.blob().then(C);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var k=p(this);if(k)return k;if(this._bodyBlob)return B(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(D)}),this.json=function(){return this.text().then(JSON.parse)},this}var R=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function F(k){var O=k.toUpperCase();return R.indexOf(O)>-1?O:k}function P(k,O){if(!(this instanceof P))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');O=O||{};var V=O.body;if(k instanceof P){if(k.bodyUsed)throw new TypeError("Already read");this.url=k.url,this.credentials=k.credentials,O.headers||(this.headers=new g(k.headers)),this.method=k.method,this.mode=k.mode,this.signal=k.signal,!V&&k._bodyInit!=null&&(V=k._bodyInit,k.bodyUsed=!0)}else this.url=String(k);if(this.credentials=O.credentials||this.credentials||"same-origin",(O.headers||!this.headers)&&(this.headers=new g(O.headers)),this.method=F(O.method||this.method||"GET"),this.mode=O.mode||this.mode||null,this.signal=O.signal||this.signal||function(){if("AbortController"in a){var M=new AbortController;return M.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&V)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(V),(this.method==="GET"||this.method==="HEAD")&&(O.cache==="no-store"||O.cache==="no-cache")){var L=/([?&])_=[^&]*/;if(L.test(this.url))this.url=this.url.replace(L,"$1_="+new Date().getTime());else{var _=/\?/;this.url+=(_.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}P.prototype.clone=function(){return new P(this,{body:this._bodyInit})};function D(k){var O=new FormData;return k.trim().split("&").forEach(function(V){if(V){var L=V.split("="),_=L.shift().replace(/\+/g," "),M=L.join("=").replace(/\+/g," ");O.append(decodeURIComponent(_),decodeURIComponent(M))}}),O}function $(k){var O=new g,V=k.replace(/\r?\n[\t ]+/g," ");return V.split("\r").map(function(L){return L.indexOf(`
|
|
2477
2477
|
`)===0?L.substr(1,L.length):L}).forEach(function(L){var _=L.split(":"),M=_.shift().trim();if(M){var W=_.join(":").trim();try{O.append(M,W)}catch(Y){console.warn("Response "+Y.message)}}}),O}Q.call(P.prototype);function J(k,O){if(!(this instanceof J))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(O||(O={}),this.type="default",this.status=O.status===void 0?200:O.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=O.statusText===void 0?"":""+O.statusText,this.headers=new g(O.headers),this.url=O.url||"",this._initBody(k)}Q.call(J.prototype),J.prototype.clone=function(){return new J(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},J.error=function(){var k=new J(null,{status:200,statusText:""});return k.ok=!1,k.status=0,k.type="error",k};var ee=[301,302,303,307,308];J.redirect=function(k,O){if(ee.indexOf(O)===-1)throw new RangeError("Invalid status code");return new J(null,{status:O,headers:{location:k}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(O,V){this.message=O,this.name=V;var L=Error(O);this.stack=L.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function Z(k,O){return new Promise(function(V,L){var _=new P(k,O);if(_.signal&&_.signal.aborted)return L(new o.DOMException("Aborted","AbortError"));var M=new XMLHttpRequest;function W(){M.abort()}M.onload=function(){var oe={statusText:M.statusText,headers:$(M.getAllResponseHeaders()||"")};_.url.indexOf("file://")===0&&(M.status<200||M.status>599)?oe.status=200:oe.status=M.status,oe.url="responseURL"in M?M.responseURL:oe.headers.get("X-Request-URL");var fe="response"in M?M.response:M.responseText;setTimeout(function(){V(new J(fe,oe))},0)},M.onerror=function(){setTimeout(function(){L(new TypeError("Network request failed"))},0)},M.ontimeout=function(){setTimeout(function(){L(new TypeError("Network request timed out"))},0)},M.onabort=function(){setTimeout(function(){L(new o.DOMException("Aborted","AbortError"))},0)};function Y(oe){try{return oe===""&&a.location.href?a.location.href:oe}catch{return oe}}if(M.open(_.method,Y(_.url),!0),_.credentials==="include"?M.withCredentials=!0:_.credentials==="omit"&&(M.withCredentials=!1),"responseType"in M&&(l.blob?M.responseType="blob":l.arrayBuffer&&(M.responseType="arraybuffer")),O&&typeof O.headers=="object"&&!(O.headers instanceof g||a.Headers&&O.headers instanceof a.Headers)){var ie=[];Object.getOwnPropertyNames(O.headers).forEach(function(oe){ie.push(h(oe)),M.setRequestHeader(oe,d(O.headers[oe]))}),_.headers.forEach(function(oe,fe){ie.indexOf(fe)===-1&&M.setRequestHeader(fe,oe)})}else _.headers.forEach(function(oe,fe){M.setRequestHeader(fe,oe)});_.signal&&(_.signal.addEventListener("abort",W),M.onreadystatechange=function(){M.readyState===4&&_.signal.removeEventListener("abort",W)}),M.send(typeof _._bodyInit>"u"?null:_._bodyInit)})}return Z.polyfill=!0,a.fetch||(a.fetch=Z,a.Headers=g,a.Request=P,a.Response=J),o.Headers=g,o.Request=P,o.Response=J,o.fetch=Z,o})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=t.fetch?t:i;e=n.fetch,e.default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,r.exports=e})(oc,oc.exports);var aB=oc.exports;const Xd=Cl(aB);async function lB(r){var e;try{if((e=await Xd(r,{method:"HEAD"}))!=null&&e.ok)return r}catch{return}}async function ac({sources:r}){const e=r==null?void 0:r.filter(Boolean),t=e==null?void 0:e.find(s=>s.startsWith("blob:")),i=e==null?void 0:e.find(s=>!s.startsWith("http")&&!s.startsWith("blob:"));if(t||i)return t??i;let n=e[0];if(e.length>0){const s=e.map(a=>lB(a)),o=(await Promise.all(s)).find(Boolean);o&&(n=o)}return n}async function cB(r){try{return(await Xd(r)).text()}catch{return null}}async function AB(r){return r=r.trim(),r.startsWith("http")||r.startsWith("blob:")?cB(r):r}function uB(r){if(typeof r=="string"){const[e,t]=r.split(":");return parseFloat(e)/parseFloat(t)}return r}const hB=Mr(async({original:r,translation:e,originalLanguage:t="",translationLanguage:i=""},{language:n})=>{var s,o;const a={[(s=i==null?void 0:i.split("-"))==null?void 0:s[0]]:e,[(o=t==null?void 0:t.split("-"))==null?void 0:o[0]]:r},l=(n&&a[n])??r;return l?AB(l):null},{cacheKey:([r,{language:e}])=>JSON.stringify({...r,language:e})});function dB(r){var e;return((e=r==null?void 0:r.items)==null?void 0:e.map(t=>{var i;return{text:(i=t.alternatives[0])==null?void 0:i.content,start:t.start_time,end:t.end_time}}))??[]}const fB=Mr(async r=>{var e,t,i,n,s,o,a,l,c,u,A;const[h,d,f]=await Promise.all([ac({sources:[(t=(e=r==null?void 0:r.answer)==null?void 0:e.media)==null?void 0:t.video,(n=(i=r==null?void 0:r.answer)==null?void 0:i.media)==null?void 0:n.input]}),ac({sources:[(o=(s=r==null?void 0:r.answer)==null?void 0:s.media)==null?void 0:o.playlist]}),ac({sources:[((l=(a=r==null?void 0:r.answer)==null?void 0:a.media)==null?void 0:l.reducedQuality)??((A=(u=(c=r==null?void 0:r.answer)==null?void 0:c.media)==null?void 0:u.videos)==null?void 0:A.xs)]})]);return{src:h,playlist:d,preview:f}},{cacheKey:([r])=>{var e,t,i,n,s,o,a,l,c,u,A;return JSON.stringify({video:(t=(e=r==null?void 0:r.answer)==null?void 0:e.media)==null?void 0:t.video,input:(n=(i=r==null?void 0:r.answer)==null?void 0:i.media)==null?void 0:n.input,playlist:(o=(s=r==null?void 0:r.answer)==null?void 0:s.media)==null?void 0:o.playlist,preview:((l=(a=r==null?void 0:r.answer)==null?void 0:a.media)==null?void 0:l.reducedQuality)??((A=(u=(c=r==null?void 0:r.answer)==null?void 0:c.media)==null?void 0:u.videos)==null?void 0:A.xs)})}});function Zd(r){var e,t,i,n,s,o,a,l,c,u,A,h;const d=((t=(e=r==null?void 0:r.answer)==null?void 0:e.contact)==null?void 0:t.name)==="Anonymous"?"":((s=(n=(i=r==null?void 0:r.answer)==null?void 0:i.contact)==null?void 0:n.name)==null?void 0:s.trim())??"",f=((l=(a=(o=r==null?void 0:r.answer)==null?void 0:o.contact)==null?void 0:a.client)==null?void 0:l.name)==="Not Supplied"?"":((h=(A=(u=(c=r==null?void 0:r.answer)==null?void 0:c.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 gB(r){var e,t;const i=(t=(e=r==null?void 0:r.answer)==null?void 0:e.contact)==null?void 0:t.roleTitle,n=i==null?void 0:i.split(" ");return{roleTitle:i,roleWords:n,firstRoleWord:n==null?void 0:n[0],remainingRoleWords:n==null?void 0:n.slice(1).join(" ")}}async function pB(r,e,t){var i,n,s;const o=(i=e==null?void 0:e.answer)==null?void 0:i.id;return((s=(n=r==null?void 0:r.questions)==null?void 0:n.items)==null?void 0:s.reduce((l,c)=>{var u;return((u=c==null?void 0:c.answer)==null?void 0:u.id)===o?(l??0)+1:l},0))<=1?o:`${o}-${t}`}async function lc({data:r,rootData:e,index:t},i){var n,s,o,a,l,c,u,A,h,d,f,g,p,I,C,B,y,x,Q,R,F,P,D,$,J;const ee=(n=e==null?void 0:e.answer)==null?void 0:n.metadata;(ee==null?void 0:ee.aspectRatio)!=null&&(ee.aspectRatio=uB(ee.aspectRatio));const[Z,k,O]=await Promise.all([pB(r,e,t),fB(e),hB({original:((o=(s=e==null?void 0:e.answer)==null?void 0:s.media)==null?void 0:o.captions)??((l=(a=e==null?void 0:e.answer)==null?void 0:a.captions)==null?void 0:l.current),translation:((u=(c=e==null?void 0:e.answer)==null?void 0:c.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},i)]),V=Zd(e),L=gB(e);return{...k,...V,...L,key:Z,captions:O,wordTimings:dB((C=e==null?void 0:e.answer)==null?void 0:C.transcription),answerLabel:((B=e==null?void 0:e.answer)==null?void 0:B.label)??(e==null?void 0:e.title),prevAnswerLabel:t?((R=(Q=(x=(y=r==null?void 0:r.questions)==null?void 0:y.items)==null?void 0:x[t-1])==null?void 0:Q.answer)==null?void 0:R.label)??((D=(P=(F=r==null?void 0:r.questions)==null?void 0:F.items)==null?void 0:P[t-1])==null?void 0:D.title)??null:null,isFirstInstanceOfName:t?((J=($=r==null?void 0:r.questions)==null?void 0:$.items)==null?void 0:J.findIndex(_=>Zd(_).name===V.name))===t:!0}}const Wo={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 mB({data:r}){var e,t;return((t=(e=r==null?void 0:r.questions)==null?void 0:e.items)==null?void 0:t.reduce((i,n)=>{var s,o,a,l,c,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=(c=(l=n==null?void 0:n.answer)==null?void 0:l.transcription)==null?void 0:c.translation)==null?void 0:u.language)==null?void 0:A.split("-")[0];return h&&Wo[h]&&!i.find(f=>f.value===h)&&i.push({value:h,label:Wo[h]}),d&&Wo[d]&&!i.find(f=>f.value===d)&&i.push({value:d,label:Wo[d]}),i},[]))??[]}/**
|
|
2478
2478
|
* @license
|
|
2479
2479
|
* Copyright 2018 Google LLC
|