@pixodesk/svg-animator-web 1.0.34 → 1.0.39

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.
@@ -1 +1 @@
1
- "use strict";var PixodeskAnimator=(()=>{var n=Object.defineProperty,t=Object.defineProperties,e=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,c=(t,e,o)=>e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,s=(n,t)=>{for(var e in t||(t={}))i.call(t,e)&&c(n,e,t[e]);if(l)for(var e of l(t))u.call(t,e)&&c(n,e,t[e]);return n},f=(n,e)=>t(n,o(e)),a=(n,t)=>{var e={};for(var o in n)i.call(n,o)&&t.indexOf(o)<0&&(e[o]=n[o]);if(null!=n&&l)for(var o of l(n))t.indexOf(o)<0&&u.call(n,o)&&(e[o]=n[o]);return e},v={};function d(n,t=!1){var e,o,r,l;const i=n.v,u=n.i,c=n.o,s=n.c;if(!i.length)return"";const f=[],a=i.length;f.push("M"+i[0][0]+","+i[0][1]);for(let n=1;n<a;n++){const r=i[n-1],l=null!=(e=null==c?void 0:c[n-1])?e:r,s=null!=(o=null==u?void 0:u[n])?o:i[n],a=i[n];t||l[0]!==r[0]||l[1]!==r[1]||s[0]!==a[0]||s[1]!==a[1]?f.push("C"+l[0]+","+l[1]+","+s[0]+","+s[1]+","+a[0]+","+a[1]):f.push("L"+a[0]+","+a[1])}if(s&&a>0){const n=i[a-1],e=null!=(r=null==c?void 0:c[a-1])?r:n,o=null!=(l=null==u?void 0:u[0])?l:i[0],s=i[0];!t&&e[0]===n[0]&&e[1]===n[1]&&o[0]===s[0]&&o[1]===s[1]||f.push("C"+e[0]+","+e[1]+","+o[0]+","+o[1]+","+s[0]+","+s[1]),f.push("z")}return f.join("")}function m(n,t,e){return n+(t-n)*e}function y(n,t,e){const o=[],r=Math.max(n.length,t.length);for(let l=0;l<r;l++)o[l]=m(n[l]||0,t[l]||0,e);return o}function b(n,t,e){return[m(n[0]||0,t[0]||0,e),m(n[1]||0,t[1]||0,e),m(n[2]||0,t[2]||0,e),m(void 0===n[3]?1:n[3],void 0===t[3]?1:t[3],e)]}function p(n,t,e){const o=Math.max(n.length,t.length),r=[];for(let l=0;l<o;l++)r.push(h(n[l],t[l],e));return r}function h(n,t,e){var o,r,l,i,u,c,s,f,a;if(!n||!t)return n||t||{v:[]};const v=Math.min(Math.max(e,0),1),d=Math.min(n.v.length,t.v.length),m=[],b=[],p=[];for(let e=0;e<d;e++){const a=n.v[e],d=t.v[e];m.push(y(a,d,v));const h=null!=(r=null==(o=n.i)?void 0:o[e])?r:a,g=null!=(i=null==(l=t.i)?void 0:l[e])?i:d;b.push(y(h,g,v));const w=null!=(c=null==(u=n.o)?void 0:u[e])?c:a,A=null!=(f=null==(s=t.o)?void 0:s[e])?f:d;p.push(y(w,A,v))}return{v:m,i:b.length?b:void 0,o:p.length?p:void 0,c:null!=(a=n.c)?a:t.c}}function g(n,t,e){if(e<=0)return 0;if(e>=1)return 1;const o=3*n,r=3*(t-n)-o,l=1-o-r;function i(n){return((l*n+r)*n+o)*n}function u(n){return(3*l*n+2*r)*n+o}let c=e,s=0,f=1;for(let n=0;n<8;n++){const n=i(c)-e;if(Math.abs(n)<1e-6)return c;const t=u(c);if(Math.abs(t)<1e-6)break;c-=n/t}for(c=e;s<f;){const n=i(c);if(Math.abs(n-e)<1e-6)return c;e>n?s=c:f=c,c=(f+s)/2}return c}function w(n){const[t,e,o,r]=n,l=3*e,i=3*(r-e)-l,u=1-l-i;return function(n){return e=g(t,o,n),((u*e+i)*e+l)*e;var e}}function A(n,t,e){return[n[0]+(t[0]-n[0])*e,n[1]+(t[1]-n[1])*e]}function M(n,t){if(!n)return{left:void 0,right:void 0};if(t<=0)return{left:void 0,right:n};if(t>=1)return{left:n,right:void 0};const[e,o,r,l]=n,i=g(e,r,t),u=[e,o],c=[r,l],{left:s,right:f}=function(n,t,e,o,r){const l=A(n,t,r),i=A(t,e,r),u=A(e,o,r),c=A(l,i,r),s=A(i,u,r),f=A(c,s,r);return{left:[n,l,c,f],right:[f,s,u,o]}}([0,0],u,c,[1,1],i),a=s[3][0],v=s[3][1];let d,m;a>1e-9&&Math.abs(v)>1e-9&&(d=[s[1][0]/a,s[1][1]/v,s[2][0]/a,s[2][1]/v]);const y=1-a,b=1-v;return y>1e-9&&Math.abs(b)>1e-9&&(m=[(f[1][0]-a)/y,(f[1][1]-v)/b,(f[2][0]-a)/y,(f[2][1]-v)/b]),{left:d,right:m}}function k(n){if(n)return[1-n[2],1-n[3],1-n[0],1-n[1]]}function j(n){const t=Math.round(255*n[0]),e=Math.round(255*n[1]),o=Math.round(255*n[2]);return 4===n.length?"rgba("+t+","+e+","+o+","+n[3]+")":"rgb("+t+","+e+","+o+")"}function O(n){if(n){if(Array.isArray(n))return n;if("string"==typeof n)return n.startsWith("#")?function(n){const t=n.slice(1),e=t.length<=4,o=e?t[0]+t[0]:t.slice(0,2),r=e?t[1]+t[1]:t.slice(2,4),l=e?t[2]+t[2]:t.slice(4,6),i=4===t.length?t[3]+t[3]:8===t.length?t.slice(6,8):null,u=[parseInt(o,16)/255,parseInt(r,16)/255,parseInt(l,16)/255];return null!==i&&u.push(parseInt(i,16)/255),u}(n):n.startsWith("rgb")?function(n){var t;const e=null==(t=n.match(/rgba?\((.*)\)/))?void 0:t[1];if(!e)throw new Error("Invalid rgb/rgba format");const o=e.split(",").map(n=>+n.trim());return[o[0]/255,o[1]/255,o[2]/255,...void 0!==o[3]?[o[3]]:[]]}(n):void console.warn("Unsupported color format: "+n)}}((t,e)=>{for(var o in e)n(t,o,{get:e[o],enumerable:!0})})(v,{PX_ANIMATOR_DATA_KEY:()=>Gn,createAnimator:()=>Yn,setupAnimationTriggers:()=>Un});var x=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),N=new Set(["translate","rotate","scale","skew"]),S=new Set(["offset-distance","offsetDistance"]);function z(n,t){var e;if(!n)return"";const o=null==(e=null==t?void 0:t.l)||e,r=[],l=n.translate,i=n.origin,u=n.rotate,c=n.skew,s=n.scale,f=o?"px":"",a=o?"deg":"";return l&&r.push("translate("+l[0]+f+","+l[1]+f+")"),i&&r.push("translate("+i[0]+f+","+i[1]+f+")"),null!=u&&r.push("rotate("+u+a+")"),null!=c&&r.push("skewX("+c+a+")"),s&&r.push("scale("+s[0]+","+s[1]+")"),i&&r.push("translate("+-i[0]+f+","+-i[1]+f+")"),r.join("")}var C=new Set(["offset-distance","offsetDistance"]),T=1e3;function U(n){return!n.includes("-")&&/[a-z][A-Z]/.test(n)}var F=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","markerUnits","markerWidth","markerHeight","refX","refY","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","tableValues","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function R(n){return F.has(n)?n:n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function P(n,t,e){return Math.max(t,Math.min(n,e))}function I(n,t,e,o,r){if(r<=0)return[n[0],n[1]];if(r>=1)return[o[0],o[1]];const l=1-r,i=l*l,u=r*r,c=i*l,s=3*r*i,f=3*u*l,a=u*r;return[c*n[0]+s*t[0]+f*e[0]+a*o[0],c*n[1]+s*t[1]+f*e[1]+a*o[1]]}var D=1e-4;function E(n,t,e,o,r){const l=L(n,t,e,o,r);return 0===l[0]&&0===l[1]?L(n,t,e,o,r<.5?r+D:r-D):l}function L(n,t,e,o,r){const l=1-r,i=3*l*l,u=6*r*l,c=3*r*r;return[i*(t[0]-n[0])+u*(e[0]-t[0])+c*(o[0]-e[0]),i*(t[1]-n[1])+u*(e[1]-t[1])+c*(o[1]-e[1])]}function Z(n,t){const{ts:e,ds:o}=n,r=e.length-1;if(t<=e[0])return o[0];if(t>=e[r])return o[r];let l=1,i=r;for(;l<i;){const n=l+i>>>1;e[n]<t?l=n+1:i=n}const u=e[i-1],c=e[i]-u,s=c>0?(t-u)/c:0;return o[i-1]+s*(o[i]-o[i-1])}function _(n){return"scroll"===(null==n?void 0:n.m)}var W="cover";function q(n,t,e,o){var r;const[l,i]=function(n,t,e){const o=t,r=e;switch(n){case"cover":return[0,o+r];case"entry":return[0,Math.min(o,r)];case"contain":return[Math.min(o,r),Math.max(o,r)];case"exit":return[Math.max(o,r),o+r];case"entry-crossing":return[0,o];case"exit-crossing":return[r,o+r]}}(null!=(r=null==n?void 0:n.phase)?r:W,e,o);return l+("number"==typeof(null==n?void 0:n.fraction)?n.fraction:t)*(i-l)}var K={auto:"auto",waapi:"waapi",frames:"frames"},V={waapi:K.waapi,frames:K.frames},X={before:"before",after:"after"};function Y(n){var t;const e=(null==n?void 0:n.animator)||(null==(t=null==n?void 0:n.meta)?void 0:t.animator);return e?function(n){const t=n.timeline;if(null==t||"object"!=typeof t)return n;const e=B.get(n);if(e)return e;const o=n,{timeline:r}=o,l=a(o,["timeline"]);if("scroll"===t.type||"view"===t.type){l.m="scroll",void 0!==t.duration&&(l.duration=t.duration),void 0!==t.iterations&&(l.iterations=t.iterations);const n=s({},l.scroll||{});n.kind=t.type,void 0!==t.h&&(n.driver=t.h),void 0!==t.axis&&(n.axis=t.axis),void 0!==t.source&&(n.source=t.source),void 0!==t.subject&&(n.subject=t.subject),void 0!==t.smoothing&&(n.smoothing=t.smoothing),void 0!==t.range&&(n.range=t.range);const e=t.pin;"boolean"==typeof e?n.pin=e:e&&"object"==typeof e&&(n.pin=!0,void 0!==e.align&&(n.pinAlign=e.align),void 0!==e.top&&(n.pinTop=e.top),void 0!==e.distance&&(n.pinDistance=e.distance)),l.scroll=n}else{if(void 0!==t.duration&&(l.duration=t.duration),void 0!==t.trigger){const n=t.trigger,{onFinish:e}=n,o=a(n,["onFinish"]);Object.keys(o).length&&(l.trigger=o),void 0!==e&&(l.A="reset"===e)}void 0!==t.delay&&(l.delay=t.delay),void 0!==t.iterations&&(l.iterations=t.iterations),void 0!==t.direction&&(l.direction=t.direction),void 0!==t.fill&&(l.fill=t.fill)}return B.set(n,l),l}(e):void 0}var B=new WeakMap;function G(n){var t;const e=null!=(t=n.value)?t:n.v;if(!e)return;if(Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]&&"number"==typeof e[1])return[e[0],e[1]];const o=e.translate;return Array.isArray(o)&&o.length>=2?[o[0],o[1]]:void 0}function H(n){var t,e;return null!=(e=null!=(t=n.time)?t:n.t)?e:0}function $(n){var t;return null!=(t=n.easing)?t:n.e}function Q(n){var t,e;const o=n.keyframes;if(!Array.isArray(o))return!1;if(n.autoOrient)return!0;for(const n of o)if((null!=(t=n.tangentIn)?t:n.ti)||(null!=(e=n.tangentOut)?e:n.to))return!0;return!1}var J=new WeakMap;function nn(n,t,e,o){var r,l;let i=J.get(n);const u=null==i?void 0:i.get(t);if(u)return u;const c=null!=(r=n.tangentOut)?r:n.to,s=null!=(l=t.tangentIn)?l:t.ti,f=[e[0]+(c?c[0]:0),e[1]+(c?c[1]:0)],a=[o[0]+(s?s[0]:0),o[1]+(s?s[1]:0)],v=function(n,t,e,o,r=100){const l=r+1,i=new Float64Array(l),u=new Float64Array(l);let c=I(n,t,e,o,0);i[0]=0,u[0]=0;let s=0;for(let f=1;f<l;f++){const l=f/r,a=I(n,t,e,o,l),v=a[0]-c[0],d=a[1]-c[1];s+=Math.sqrt(v*v+d*d),i[f]=l,u[f]=s,c=a}return{ts:i,ds:u}}(e,f,a,o),d={P0:e,P1:f,P2:a,P3:o,M:v,j:v.ds[v.ds.length-1]};return i||(i=new WeakMap,J.set(n,i)),i.set(t,d),d}var tn=.5,en=5,on=32;function rn(n,t){var e,o,r;if(!Q(n))return n;const l=n.keyframes;if(!Array.isArray(l)||l.length<2)return n;const i=!!n.autoOrient,u=null!=(e=null==t?void 0:t.O)?e:tn,c=null!=(o=null==t?void 0:t.N)?o:en,s=null!=(r=null==t?void 0:t.S)?r:on,f=[],a=G(l[0]);if(!a)return n;const v=i?function(n,t){const e=G(n),o=G(t);if(!e||!o)return 0;const r=nn(n,t,e,o),l=E(r.P0,r.P1,r.P2,r.P3,0);return 180*Math.atan2(l[1],l[0])/Math.PI}(l[0],l[1]):void 0;f.push(ln(H(l[0]),sn(un(l[0]),un(l[0]),0,a,v,i)));for(let n=0;n<l.length-1;n++){const t=l[n],e=l[n+1],o=G(t),r=G(e);o&&r?(i&&n>0&&an(f,t,e,o,r,c),dn(f,t,e,o,r,i,u,c,s)):f.push(ln(H(e),sn(un(e),un(e),1,null!=r?r:[0,0],void 0,i)))}const d=$(l[l.length-1]);d&&(f[f.length-1].e=d),i&&function(n){var t;let e;for(const o of n){const n=null!=(t=o.v)?t:o.value;if(!n||"number"!=typeof n.rotate)continue;if(void 0===e){e=n.rotate;continue}let r=n.rotate;for(;r-e>180;)r-=360;for(;r-e<-180;)r+=360;n.rotate=r,e=r}}(f);const m={keyframes:f};return void 0!==n.loop&&(m.loop=n.loop),m}function ln(n,t){return{t:n,v:t}}function un(n){var t;const e=null!=(t=n.value)?t:n.v;if(e&&"object"==typeof e&&!Array.isArray(e))return e}function cn(n,t,e){if(void 0===n)return t;if(void 0===t)return n;if("number"==typeof n&&"number"==typeof t)return n+(t-n)*e;if(Array.isArray(n)&&Array.isArray(t)&&n.length===t.length){const o=new Array(n.length);for(let r=0;r<n.length;r++){const l="number"==typeof n[r]?n[r]:0,i="number"==typeof t[r]?t[r]:0;o[r]=l+(i-l)*e}return o}return e<.5?n:t}function sn(n,t,e,o,r,l){const i={translate:o},u=new Set;if(n)for(const t of Object.keys(n))u.add(t);if(t)for(const n of Object.keys(t))u.add(n);for(const o of u){if("translate"===o)continue;if("rotate"===o&&l)continue;const r=null==n?void 0:n[o],u=null==t?void 0:t[o];void 0===r&&void 0===u||(i[o]=cn(r,u,e))}return void 0!==r&&(i.rotate=r+fn(n,t,e)),i}function fn(n,t,e){const o="number"==typeof(null==n?void 0:n.rotate)?n.rotate:void 0,r="number"==typeof(null==t?void 0:t.rotate)?t.rotate:void 0;if(void 0===o&&void 0===r)return 0;const l=cn(o,r,e);return"number"==typeof l?l:0}function an(n,t,e,o,r,l){var i;const u=n[n.length-1],c=null!=(i=u.v)?i:u.value,s=null==c?void 0:c.rotate;if("number"!=typeof s)return;const f=un(t),a=s-fn(f,f,0),v=nn(t,e,o,r),d=E(v.P0,v.P1,v.P2,v.P3,0),m=180*Math.atan2(d[1],d[0])/Math.PI,y=function(n,t){let e=n-t;for(;e>180;)e-=360;for(;e<-180;)e+=360;return e}(m,a);if(Math.abs(y)<=l)return;const b=H(t),p=Math.min(b+vn,(b+H(e))/2),h=sn(un(t),un(t),0,o,m,!0);n.push(ln(p,h))}var vn=.05;function dn(n,t,e,o,r,l,i,u,c){const s=nn(t,e,o,r),f=H(t),a=H(e),v=$(t),d=(m=v)?w([m[1],m[0],m[3],m[2]]):n=>n;var m;const y=un(t),b=un(e),p=function(n,t,e,o,r){const l=[];mn(n.P0[0],n.P1[0],n.P2[0],n.P3[0],l),mn(n.P0[1],n.P1[1],n.P2[1],n.P3[1],l),l.sort((n,t)=>n-t);const i=[0];for(const n of l)n>i[i.length-1]+1e-6&&n<.999999&&i.push(n);i.push(1);const u=[],c={C:r-i.length};for(let r=0;r<i.length-1;r++)yn(i[r],i[r+1],u,n,t,e,o,c);return u}(s,l,i,u,c),h=[];for(const n of p){const t=Z(s.M,n),e=P(s.j>0?t/s.j:n,0,1),o={u:P(d(e),0,1),p:e,T:I(s.P0,s.P1,s.P2,s.P3,n)};if(l){const t=E(s.P0,s.P1,s.P2,s.P3,n);o.U=180*Math.atan2(t[1],t[0])/Math.PI}h.push(o)}let g=v,A=0;const k=n.length-1;for(let t=0;t<h.length;t++){const e=h[t],o=A<1?P((e.u-A)/(1-A),0,1):1,{left:r,right:i}=M(g,o),u=0===t?k:n.length-1;r?n[u].e=r:delete n[u].e;const c=f+e.u*(a-f),s=sn(y,b,e.p,e.T,e.U,l);n.push(ln(c,s)),g=i,A=e.u}}function mn(n,t,e,o,r){const l=t-n,i=e-t,u=l-2*i+(o-e),c=2*(i-l),s=l;if(Math.abs(u)<1e-10){if(Math.abs(c)>1e-10){const n=-s/c;n>1e-6&&n<.999999&&r.push(n)}return}const f=c*c-4*u*s;if(f<0)return;const a=Math.sqrt(f),v=(-c-a)/(2*u),d=(-c+a)/(2*u);v>1e-6&&v<.999999&&r.push(v),d>1e-6&&d<.999999&&r.push(d)}function yn(n,t,e,o,r,l,i,u){const c=(n+t)/2,s=I(o.P0,o.P1,o.P2,o.P3,n),f=I(o.P0,o.P1,o.P2,o.P3,t),a=t-n,v=I(o.P0,o.P1,o.P2,o.P3,n+.25*a),d=I(o.P0,o.P1,o.P2,o.P3,c),m=I(o.P0,o.P1,o.P2,o.P3,n+.75*a),y=Math.max(bn(v,s,f),bn(d,s,f),bn(m,s,f));let b=!0;if(r){const e=E(o.P0,o.P1,o.P2,o.P3,n),r=E(o.P0,o.P1,o.P2,o.P3,t),l=180*Math.atan2(e[1],e[0])/Math.PI,u=180*Math.atan2(r[1],r[0])/Math.PI;let c=Math.abs(l-u);c>180&&(c=360-c),c>i&&(b=!1)}y<=l&&b||u.C<=0||a<1e-6?e.push(t):(u.C-=1,yn(n,c,e,o,r,l,i,u),yn(c,t,e,o,r,l,i,u))}function bn(n,t,e){const o=e[0]-t[0],r=e[1]-t[1],l=o*o+r*r;if(l<1e-20){const e=n[0]-t[0],o=n[1]-t[1];return Math.sqrt(e*e+o*o)}const i=(n[0]-t[0])*r-(n[1]-t[1])*o;return Math.abs(i)/Math.sqrt(l)}var pn=1;function hn(n,t){if(n===t)return!0;if(typeof n!=typeof t||null===n||null===t||"object"!=typeof n)return!1;if(Array.isArray(n)!==Array.isArray(t))return!1;const e=Object.keys(n),o=Object.keys(t);return e.length===o.length&&e.every(e=>hn(n[e],t[e]))}function gn(n){const t=[];let e;const o=function(n){const t=n.split(/([MLCZmlcz]|[\s,]+)/).map(n=>n.trim()).filter(n=>n&&","!==n),e=[];let o=null;for(const n of t)if(/[MLCZmlcz]/.test(n))o={type:n,values:[]},e.push(o);else if(o){const t=+n;o.values.push(Number.isNaN(t)?0:t)}return e}(n);for(const n of o){const o=n.type,r=n.values;if("M"===o||"m"===o){const n=r[0]||0,o=r[1]||0;e={v:[[n,o]],i:[[n,o]],o:[[n,o]],c:!1},t.push(e);continue}if(e||(e={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},t.push(e)),"L"===o){const n=r[0]||0,t=r[1]||0;e.v.push([n,t]),e.i.push([n,t]),e.o.push([n,t])}else if("C"===o){const n=r[0]||0,t=r[1]||0,o=r[2]||0,l=r[3]||0,i=r[4]||0,u=r[5]||0;e.o[e.o.length-1]=[n,t],e.v.push([i,u]),e.i.push([o,l]),e.o.push([i,u])}else"Z"===o||"z"===o?e.c=!0:console.warn('Unsupported path command "'+o+'"')}return t}function wn(n){return n.startsWith("path(")&&n.endsWith(")")?n.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(n)?n:void 0}function An(n){return"string"==typeof n&&void 0!==wn(n)}function Mn(n){if(n&&"object"==typeof n&&"string"==typeof n.path){const t=wn(n.path);return t?{paths:gn(t)}:n}if(n&&"object"==typeof n&&"paths"in n){const t=n.paths;if(Array.isArray(t)&&t.length>0&&An(t[0])){const n=[];for(const e of t){const t=wn(e);t&&n.push(...gn(t))}return{paths:n}}return n}if(Array.isArray(n)){if(n.length>0&&An(n[0])){const t=[];for(const e of n){const n=wn(e);n&&t.push(...gn(n))}return{paths:t}}return{paths:n}}return An(n)?{paths:gn(wn(n))}:n}function kn(n,t){var e;if(n)return Array.isArray(n)?n:(null==(e=null==t?void 0:t.easings)?void 0:e[n])?t.easings[n]:void console.warn("Unknown easing name: "+n)}function jn(n,t){var e;if("string"==typeof n){const o=null==(e=null==t?void 0:t.animations)?void 0:e[n];return o||console.warn("Unknown animation name: "+n),o}return n}function On(n,t,e,o){var r,l;return"d"===n?{paths:p(null!=(r=null==t?void 0:t.paths)?r:Array.isArray(t)?t:[],null!=(l=null==e?void 0:e.paths)?l:Array.isArray(e)?e:[],o)}:x.has(n)?b(t||[0,0,0,1],e||[0,0,0,1],o):"transform"!==n||"object"!=typeof t||null===t||Array.isArray(t)||"object"!=typeof e||null===e||Array.isArray(e)?"rotate"===n&&"number"==typeof t&&"number"==typeof e?m(t,e,o):N.has(n)||"stroke-dasharray"===n||"strokeDasharray"===n?y(t||[],e||[],o):m(+(t||0),+(e||0),o):function(n,t,e){const o=new Set([...Object.keys(null!=n?n:{}),...Object.keys(null!=t?t:{})]),r={};for(const l of o){const o=null==n?void 0:n[l],i=null==t?void 0:t[l];if("rotate"===l||"skew"===l)r[l]=m(+(null!=o?o:0),+(null!=i?i:0),e);else if("translate"===l||"scale"===l||"origin"===l){const n="scale"===l?[1,1]:[0,0];r[l]=y(o||n,i||n,e)}else r[l]=null!=i?i:o}return r}(t,e,o)}function xn(n,t,e,o){var r,l,i,u,c,a,v;const d=t.keyframes||[],m=[];for(const t of d){const e=null!=(l=null!=(r=t.time)?r:t.t)?l:0;let s=null!=(i=t.value)?i:t.v;const f=null!=(u=t.easing)?u:t.e;"d"===n&&(s=Mn(s));const d=U(n)?R(n):n;x.has(d)&&(s=null!=(c=O(s))?c:s);const y={t:e,v:s,e:kn(f,o)},b=null!=(a=t.tangentIn)?a:t.ti,p=null!=(v=t.tangentOut)?v:t.to;b&&(y.tangentIn=b),p&&(y.tangentOut=p),m.push(y)}m.sort((n,t)=>{var e,o;return(null!=(e=n.t)?e:0)-(null!=(o=t.t)?o:0)});const y=t.loop,b=!0===y?{}:y||void 0;return b&&m.length>=2?function(n,t,e,o){var r,l,i,u,c;const a=t.length-1,v=P(null!=(r=e.segmentCount)?r:a,1,a);let d;d=e.extend===X.before?t.slice(0,v+1):t.slice(a-v);const m=null!=(l=t[0].t)?l:0,y=null!=(i=t[t.length-1].t)?i:0;let b,p;e.extend===X.before?(b=0,p=m):(b=y,p=o);const h=p-b;if(h<=0)return t;const g=null!=(u=d[0].t)?u:0,A=(null!=(c=d[d.length-1].t)?c:0)-g;if(A<=0)return t;const j=d.map(n=>{var t,e;return{F:(n.t-g)/A,v:n.v,e:n.e,tangentIn:null!=(t=n.tangentIn)?t:n.ti,tangentOut:null!=(e=n.tangentOut)?e:n.to}}),O=Math.floor(h/A),x=h-O*A,N=x/A,S=[],z=e.extend!==X.before,C=t[t.length-1];let T,U=!1;function F(t,e,o){var r;let l;if(e){l=[];for(let n=j.length-1;n>=0;n--)l.push({F:1-j[n].F,v:j[n].v,e:n>0?k(j[n-1].e):void 0,tangentIn:j[n].tangentOut,tangentOut:j[n].tangentIn})}else l=j;const i=void 0!==o?o:1;for(let e=0;e<l.length;e++){const o=l[e];if(o.F>i+1e-9){const r=l[e-1],u=o.F-r.F,c=(i-r.F)/u,s=r.e?w(r.e)(c):c,f=On(n,r.v,o.v,s),{left:a}=M(r.e,c);return S.length>0&&r.F<=i&&(S[S.length-1].e=a),void S.push({t:t+i*A,v:f,e:void 0})}const u=S.length>0?S[S.length-1]:C,c=z&&0===e&&void 0!==u&&Math.abs((null!=(r=u.t)?r:0)-(t+o.F*A))<1e-9;if(c){if(hn(u.v,o.v)){S.length>0?(u.e=o.e,u.tangentOut=o.tangentOut):(T=o.e,U=!0);continue}S.length>0&&(delete u.tangentIn,delete u.tangentOut)}const s={t:t+o.F*A+(c?pn:0),v:o.v,e:e<l.length-1?o.e:void 0};o.tangentIn&&(s.tangentIn=o.tangentIn),o.tangentOut&&(s.tangentOut=o.tangentOut),S.push(s)}}if(e.extend===X.before){N>1e-9&&function(t,e,o){let r;if(e){r=[];for(let n=j.length-1;n>=0;n--)r.push({F:1-j[n].F,v:j[n].v,e:n>0?k(j[n-1].e):void 0,tangentIn:j[n].tangentOut,tangentOut:j[n].tangentIn})}else r=j;const l=1-o;for(let e=0;e<r.length;e++){const o=r[e];if(o.F<l-1e-9)continue;const i=r[e-1];if(i&&i.F<l-1e-9&&o.F>l+1e-9){const e=o.F-i.F,r=(l-i.F)/e,u=i.e?w(i.e)(r):r,c=On(n,i.v,o.v,u),{right:s}=M(i.e,r);S.push({t:t,v:c,e:s})}const u={t:t+(o.F-l)*A,v:o.v,e:e<r.length-1?o.e:void 0};o.tangentIn&&(u.tangentIn=o.tangentIn),o.tangentOut&&(u.tangentOut=o.tangentOut),S.push(u)}}(b,!!e.alternate&&O%2==0,N);for(let n=0;n<O;n++){const t=O-1-n,o=!!e.alternate&&t%2==0;F(b+x+n*A,o)}}else{for(let n=0;n<O;n++){const t=!!e.alternate&&n%2==0;F(b+n*A,t)}if(N>1e-9){const n=!!e.alternate&&O%2==0;F(b+O*A,n,N)}}return e.extend===X.before?[...S,...t]:U&&t.length>0?[...t.slice(0,-1),f(s({},t[t.length-1]),{e:T}),...S]:[...t,...S]}(n,m,b,e):m}var Nn=0;function Sn(n,t=V.waapi){const e=Y(n)||{},o=function(n){var t;if(n)return null==(t=Y(n))?void 0:t.definitions}(n),r=e.duration||1e3,l=[],i=(n,e,l)=>{if(!e)return null;const i=function(n,t){if(!n)return[];const e=[];if("string"==typeof n){const o=jn(n,t);o&&e.push(o)}else if(Array.isArray(n))for(const o of n){const n=jn(o,t);n&&e.push(n)}else e.push(n);return e}(e,o);if(0===i.length)return null;const u=function(n,t,e,o=V.waapi){const r={};for(const[l,i]of Object.entries(n)){if("transform"===l&&"offsetPath"===i.R&&void 0!==n.offsetDistance)continue;const u=xn(l,i,t,e);if(u.length>0){const n={keyframes:u};void 0!==i.autoOrient&&(n.autoOrient=i.autoOrient),void 0!==i.loop&&(n.loop=i.loop),r[l]=o===V.waapi&&"transform"===l?rn(n):n}}return r}(function(n,t){if(!n)return n;const e=t&&"object"==typeof t&&!Array.isArray(t)?t:function(n){var t,e;if(!n||"string"!=typeof n)return;const o={},r=/([a-zA-Z]+)\s*\(([^)]*)\)/g,l=["translate","rotate","skewX","scale"];let i,u=-1;for(;null!==(i=r.exec(n));){const n=i[1],r=l.indexOf(n);if(r<0||r<=u)return;u=r;const c=i[2].split(/[\s,]+/).filter(Boolean).map(Number);if(c.some(n=>Number.isNaN(n)))return;if("translate"===n){if(c.length<1||c.length>2)return;o.translate=[c[0],null!=(t=c[1])?t:0]}else if("rotate"===n){if(1!==c.length)return;o.rotate=c[0]}else if("skewX"===n){if(1!==c.length)return;o.skew=c[0]}else{if(c.length<1||c.length>2)return;o.scale=[c[0],null!=(e=c[1])?e:c[0]]}}return n.replace(/([a-zA-Z]+)\s*\(([^)]*)\)/g,"").replace(/[\s,]/g,"").length?void 0:Object.keys(o).length?o:void 0}(t);if(!e||!Object.keys(e).length)return n;const o=n=>n&&"object"==typeof n&&!Array.isArray(n)?s(s({},e),n):n,r=n.transform;if(r&&"object"==typeof r){const t=r;if(Array.isArray(t.keyframes)){const e=f(s({},t),{keyframes:t.keyframes.map(n=>f(s({},n),{value:o(n.value)}))});return void 0!==e.value&&(e.value=o(e.value)),f(s({},n),{transform:e})}return n}const l=Object.keys(n).filter(n=>N.has(n));if(1!==l.length)return n;const i=l[0],u=n[i];if(!u||"object"!=typeof u||!Array.isArray(u.keyframes))return n;const c=f(s({},u),{keyframes:u.keyframes.map(n=>f(s({},n),{value:f(s({},e),{[i]:n.value})}))});void 0!==c.value&&(c.value=f(s({},e),{[i]:c.value}));const a=s({},n);return delete a[i],f(s({},a),{transform:c})}(function(n){const t={};for(const e of n)for(const[n,o]of Object.entries(e))t[n]=o;return t}(i),l),r,o,t);return 0===Object.keys(u).length?null:{id:n,animate:u}},u=function(n){var t;if(!n)return;const e=null==(t=Y(n))?void 0:t.animateById;return e?Object.entries(e).map(([n,t])=>({id:n.startsWith("#")?n.slice(1):n,animate:t})):void 0}(n);if(u)for(const n of u){const t=i(n.id,n.animate);t&&l.push(t)}const c=n=>{const t=n.animate;if(t&&Object.keys(t).length>0){const e=n.id||"_px_el_"+ ++Nn;n.id=e;const o=i(e,t,n.transform);o&&l.push(o)}if(n.children)for(let t=0;t<n.children.length;t++)c(n.children[t])};if(n.children)for(let t=0;t<n.children.length;t++)c(n.children[t]);return l}function zn(n,t,e){var o,r,l,i,u,c,s;const f=t.keyframes||[];if(0===f.length)return null;const{P:a,I:v}=function(n,t){var e,o;const r=n.length-1;let l=n[0],i=n[r>0?1:0];for(let u=0;u<r;u++){const c=null!=(e=n[u].t)?e:0,s=null!=(o=n[u+1].t)?o:0;if(c<=t&&t<=s){l=n[u],i=n[u+1];break}t>s&&u===r-1&&(l=n[r>0?r-1:0],i=n[r])}return{P:l,I:i}}(f,e);let h=a===v?0:(g=e,A=null!=(o=a.t)?o:0,(M=null!=(r=v.t)?r:0)===A?0:0+(g-A)/(M-A)*1);var g,A,M;h=P(h,0,1);const k=null!=(l=a.e)?l:a.easing;if(k&&Array.isArray(k))try{h=w(k)(h)}catch(n){}let O=U(n)?R(n):n,N=null;const C=null!=(i=null==a?void 0:a.v)?i:null==a?void 0:a.value,T=null!=(u=null==v?void 0:v.v)?u:null==v?void 0:v.value;if("d"===O)N=p(null!=(c=null==C?void 0:C.paths)?c:Array.isArray(C)?C:[],null!=(s=null==T?void 0:T.paths)?s:Array.isArray(T)?T:[],h).map(n=>d(n)).join("");else if(x.has(O))N=j(b(C||[0,0,0,1],T||[0,0,0,1],h)),O=n;else if("stroke-dasharray"===O)N=y(C||[],T||[],h).join(" "),O=n;else if("transform"!==O||null===C||"object"!=typeof C||Array.isArray(C))"translate"===O?(N="translate("+y(C||[0,0],T||[0,0],h).join(",")+")",O="transform"):"rotate"===O?(N="rotate("+m(+(C||0),+(T||0),h)+")",O="transform"):"scale"===O?(N="scale("+y(C||[1,1],T||[1,1],h).join(",")+")",O="transform"):N=m(+(C||0),+(T||0),h);else{const n=new Set([...C?Object.keys(C):[],...T?Object.keys(T):[]]),e={};for(const t of n){const n=null==C?void 0:C[t],o=null==T?void 0:T[t];if("rotate"===t||"skew"===t)e[t]=m(+(null!=n?n:0),+(null!=o?o:0),h);else if("translate"===t||"scale"===t||"origin"===t){const r="scale"===t?[1,1]:[0,0],l=y(n||r,o||r,h);e[t]=l}}if(Q(t)){const n=C.translate,o=T.translate;if(Array.isArray(n)&&Array.isArray(o)){const r=function(n,t,e,o,r,l){const i=nn(n,t,e,o),u=0===i.j?r:function(n,t){const e=t*n.ds[n.ds.length-1],{ts:o,ds:r}=n,l=r.length-1;if(e<=0)return o[0];if(e>=r[l])return o[l];let i=1,u=l;for(;i<u;){const n=i+u>>>1;r[n]<e?i=n+1:u=n}const c=r[u-1],s=r[u]-c,f=s>0?(e-c)/s:0;return o[u-1]+f*(o[u]-o[u-1])}(i.M,r),c=I(i.P0,i.P1,i.P2,i.P3,u);if(!l)return{translate:c};const s=E(i.P0,i.P1,i.P2,i.P3,u);return{translate:c,U:180*Math.atan2(s[1],s[0])/Math.PI}}(a,v,[+n[0],+n[1]],[+o[0],+o[1]],h,!!t.autoOrient);e.translate=[r.translate[0],r.translate[1]],void 0!==r.U&&(e.rotate=r.U)}}N=z(e,{l:!1}),O="transform"}return S.has(O)&&"number"==typeof N&&(N=100*N+"%"),{k:O,v:null===N?"":""+N}}function Cn(n,t){const e={};for(const[o,r]of Object.entries(n)){const n=zn(o,r,t);n&&(e[n.k]=n.v)}return e}function Tn(n){const t=globalThis;"function"!=typeof t.cancelAnimationFrame?t.clearTimeout(n):t.cancelAnimationFrame(n)}function Un(n,t){const{startOn:e,outAction:o="continue",scrollIntoViewThreshold:r=0}=t,l=n.getRootElement();if(!l)return console.warn("setupAnimationTriggers: No root element found for animation."),n;let i=!1;const u=()=>{i&&(i=!1,n.setPlaybackRate(1)),n.play()},c=()=>{switch(o){case"pause":n.pause();break;case"reset":n.cancel();break;case"reverse":i=!0,n.setPlaybackRate(-1),n.play()}};switch(e){case"load":{const n=()=>u();"complete"===document.readyState?n():window.addEventListener("load",n,{once:!0});break}case"mouseOver":{let n=!1;const t=()=>{n=!0,u()},e=()=>{n&&c()};l.addEventListener("mouseenter",t),l.addEventListener("mouseleave",e);break}case"click":{const t=()=>{n.isPlaying()?c():u()};l.addEventListener("click",t);break}case"scrollIntoView":{const n=n=>{var t,e;const o=n.boundingClientRect,r=n.intersectionRect;if(!(null==o?void 0:o.height)||!r)return n.intersectionRatio;const l="undefined"!=typeof window&&window.innerHeight?window.innerHeight:1/0,i=null!=(e=null==(t=n.rootBounds)?void 0:t.height)?e:1/0,u=Math.min(l,i),c=Math.min(o.height,Number.isFinite(u)?u:o.height);return c>0?r.height/c:n.intersectionRatio},t=Array.from({length:21},(n,t)=>t/20);let e=!1;new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&n(t)>=r?(e=!0,u()):e&&(e=!1,c())})},{threshold:t}).observe(l);break}}return n}function Fn(n){return"#"+n}function Rn(n,t,e,o){const r=Y(n)||{};if(!o)if(n.id){const t=Fn(n.id);(o=document.querySelector(t))||console.warn("createFrameLoopAnimator: No root element found for selector: ",t)}else console.warn("createFrameLoopAnimator: No root element provided");const l=function(n,t,e){var o;const r=Y(n)||{},l=Sn(n,V.frames),i=r.iterations;let u=1;"number"==typeof i&&(u=i||1),"infinite"===i&&(u=1/0),u<1&&(u=1);const c=+(r.duration||T),s=c&&u?c*(u===1/0?1/0:u):c?(null!=u?u:1)*c:0,f=r.direction||"normal",a=null!=(o=r.fill)?o:"forwards",v="forwards"===a||"both"===a,d="backwards"===a||"both"===a;let m=null,y=!1,b=-(r.delay||0),p=0,h=1,g=!1;const w=r.frameRate,A=w&&w>0?1e3/w:0;let M=0;const k=()=>{const n=p?(Date.now()-p)*h:0;return b+n},j=()=>{let n=k();return Number.isFinite(s)&&n>s&&(n=s),n<0&&(n=0),n};function O(n){let e=function(){const t=c>0?c:1;let e=0,o=0;c>0?(n=P(n,0,u*t),o=Math.max(0,Math.ceil(n/t)-1),o=Math.min(o,u-1),e=P((n-o*t)/t,0,1)):e=n;const r=f||"normal";let l=e;return"reverse"===r?l=1-e:"alternate"===r?o%2==1&&(l=1-e):"alternate-reverse"===r&&o%2==0&&(l=1-e),l}();for(const n of l||[]){const o=n.animate;if(!o||"object"!=typeof o||Array.isArray(o)){console.warn("Empty or unresolved binding",n);continue}const r=Cn(o,e*c);for(const[e,o]of Object.entries(r))t.setAttribute(n.id,e,o)}}r.delay&&(r.delay<0?O(j()):d&&O(0));const x=()=>!!y&&!!t.isConnected()&&(h<0?k()>0:!(Number.isFinite(s)&&j()>=s)),N=n=>{null!==m&&(Tn(m),m=null),(n||x())&&(m=function(n){const t=globalThis;return"function"==typeof t.requestAnimationFrame?t.requestAnimationFrame(n):t.setTimeout(n,16)}(()=>{m=null,(()=>{var n,o;if(!t.isConnected())return void S();const r=j(),l=k();if(l<0&&h>0)d&&O(0);else{if(h<0&&l<=0)return S(),O(0),void(g||(g=!0,null==(n=null==e?void 0:e.onFinish)||n.call(e)));if(h>0&&s&&Number.isFinite(s)&&r>=s)return S(),O(v?s:0),void(g||(g=!0,null==(o=null==e?void 0:e.onFinish)||o.call(e)));if(A>0){const n=Date.now();if(M&&n-M<A)return;M=n}O(r)}})(),N()}))},S=()=>{if(!y)return;let n=k();Number.isFinite(s)&&n>s&&(n=s),b=n,p=0,y=!1,null!==m&&(Tn(m),m=null),n>=0?O(n):d&&O(0)},z={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>x(),play:()=>{var n;(()=>{if(!y){if(h>=0)Number.isFinite(s)&&b>=s&&(b=0);else if(b<=0){if(!Number.isFinite(s))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");b=s}g=!1,y=!0,p=Date.now(),N(!0)}})(),null==(n=null==e?void 0:e.D)||n.call(e)},pause:()=>{var n;S(),null==(n=null==e?void 0:e.L)||n.call(e)},cancel:()=>{var n;S(),b=0,p=0,y=!1,g=!1,O(b),null==(n=null==e?void 0:e.Z)||n.call(e)},finish:()=>{((n=!0)=>{var t;b=Number.isFinite(s)?s:j(),p=0,y=!1,null!==m&&(Tn(m),m=null),O(v?b:0),n&&!g&&(g=!0,null==(t=null==e?void 0:e.onFinish)||t.call(e))})(!0)},setPlaybackRate:n=>{if(!isFinite(n)||0===n)return void console.warn("setPlaybackRate: rate must be finite and non-zero");let t=k();Number.isFinite(s)&&t>s&&(t=s),n<0!=h<0&&(g=!1),h=n,b=t,y&&(p=Date.now())},getCurrentTime:()=>j(),setCurrentTime:n=>{n<0&&(n=0),Number.isFinite(s)&&n>s&&(n=s),b=n,y&&(p=Date.now()),(!Number.isFinite(s)||n<s)&&(g=!1),O(j())},destroy:()=>{var n;z.cancel(),null==(n=null==e?void 0:e._)||n.call(e)}};return z}(n,t||function(n){const t=new Set;return{isConnected:()=>!n||n.isConnected,setAttribute:(e,o,r)=>{o=R(o);const l=Fn(e),i=(null==n?void 0:n.querySelectorAll(l))||document.querySelectorAll(l);0!==i.length||t.has(l)||(t.add(l),console.warn('setAttribute: No elements found for selector "'+l+'"'));for(let n=0;n<i.length;n++){const t=i[n],e="transform"===o&&"pattern"===t.tagName?"patternTransform":o;t.setAttribute(e,r),C.has(o)&&(t.style[o]=r)}}}}(o),e),i=f(s({},l),{getRootElement:()=>o||null});return r.trigger&&(_(r)?console.warn("scroll timeline: `animator.trigger` is ignored (triggers do not apply to scroll-driven playback)"):Un(i,r.trigger)),i}function Pn(n,t,e,o){var r,l;let i=null!=(r=n.v)?r:n.value;const u=null!=(l=n.e)?l:n.easing,c={offset:t,easing:u&&Array.isArray(u)?"cubic-bezier("+u.join(",")+")":void 0};let s,f=e;var a;return x.has(e)&&Array.isArray(i)?s=j(i):"transform"!==e||null===i||"object"!=typeof i||Array.isArray(i)?N.has(e)?(Array.isArray(i)&&("translate"===e&&(i=i.map(n=>n+"px")),i=i.join(",")),"rotate"===e&&(i+="deg"),s=e+"("+i+")",f="transform"):s="d"===e?'path("'+(i&&"object"==typeof i&&Array.isArray(i.paths)?i.paths:[]).map(n=>d(n,!0)).join("")+'")':S.has(e)&&"number"==typeof i?100*i+"%":""+i:(s=z(i,{l:!0}),f="transform"),CSS.supports(R(f),s)||o.add(f),f=(a=f).includes("-")?a.replace(/-([a-z])/g,(n,t)=>t.toUpperCase()):a,c[f]=s,c}function In(n,t,e){var o,r,l,i,u;const c=[];for(let a=0;a<t.length;a++){const v=t[a],d=null!=(o=v.t)?o:0;if(d<0){const e=t[a+1];if(e&&(null!=(r=e.t)?r:0)>=0){const t=(0-d)/((null!=(l=e.t)?l:0)-d),o=v.e?w(v.e)(t):t,{right:r}=M(v.e,t);c.push({t:0,v:On(n,v.v,e.v,o),e:r})}continue}if(d>e){const o=t[a-1];if(o&&(null!=(i=o.t)?i:0)<=e){const t=null!=(u=o.t)?u:0,r=(e-t)/(d-t),l=o.e?w(o.e)(r):r,{left:i}=M(o.e,r);c.length>0&&(c[c.length-1]=f(s({},c[c.length-1]),{e:i})),c.push({t:e,v:On(n,o.v,v.v,l),e:void 0})}break}c.push(v)}return c}function Dn(n,t,e){var o;const r=new Map;for(const[l,i]of Object.entries(n)){const n=e.duration||1,u=In(l,i.keyframes||[],n),c=[];for(let e=0;e<u.length;e++){const r=u[e],i=Pn(r,P((null!=(o=r.t)?o:0)/n,0,1),l,t);0===e&&(i.offset||0)>0&&c.push(f(s({},i),{offset:0})),c.push(i)}c.length>0&&(c[c.length-1].offset||0)<1&&c.push(f(s({},c[c.length-1]),{offset:1})),c.length>0&&r.set(l,c)}return r}function En(n,t,e,o,r){var l;const i=Y(n)||{};if(!e)if(n.id){const t=Fn(n.id);(e=document.querySelector(t))||console.warn("createFrameLoopAnimator: No root element found for selector: ",t)}else console.warn("createFrameLoopAnimator: No root element provided");const u=Sn(n,V.waapi),c=[],s=i.iterations;let f;"number"==typeof s&&(f=s),"infinite"===s&&(f=1/0);const a=new Set;let v=!1,d=!1;(null==u?void 0:u.length)||console.warn("createWebApiAnimator: No animation bindings defined");for(const n of u||[]){const o=n.animate;if(!o||"object"!=typeof o||Array.isArray(o)){console.warn("createWebApiAnimator: Empty or unresolved binding",n);continue}const u=Fn(n.id),s=(null==e?void 0:e.querySelectorAll(u))||document.querySelectorAll(u);0===s.length&&console.warn('createWebApiAnimator: No elements found for selector "'+u+'"');const m=Dn(o,a,i),y=i.delay&&i.delay>0?i.delay:void 0;let b;if(i.delay&&i.delay<0&&i.duration){const n=-i.delay;b=f===1/0?n%i.duration:Math.min(n,i.duration*(null!=f?f:1))}const p={duration:i.duration,delay:y,fill:null!=(l=i.fill)?l:"forwards",direction:i.direction,iterations:f};for(let n=0;n<s.length;n++){const e=s[n];for(const[,n]of m)if(n.length>0)try{const o=new KeyframeEffect(e,n,p),l=new Animation(o,r?r.timeline:document.timeline);if(r){const n=l;r.rangeStart&&(n.rangeStart=r.rangeStart),r.rangeEnd&&(n.rangeEnd=r.rangeEnd)}(null==t?void 0:t.onFinish)&&(l.onfinish=()=>{var n;v||(v=!0,null==(n=t.onFinish)||n.call(t))}),(null==t?void 0:t._)&&(l.onremove=()=>{var n;d||(d=!0,null==(n=t._)||n.call(t))}),void 0!==b&&(l.currentTime=b),c.push(l)}catch(n){console.warn(n)}}}if(!o&&a.size)return console.warn("Unsupported CSS attrs: "+[...a].join(", ")),null;const m={isReady:()=>!0,getRootElement:()=>e||null,isPlaying:()=>{var n;return"running"===(null==(n=c[0])?void 0:n.playState)},play:()=>{var n;v=!1,c.forEach(n=>n.play()),null==(n=null==t?void 0:t.D)||n.call(t)},pause:()=>{var n;c.forEach(n=>n.pause()),null==(n=null==t?void 0:t.L)||n.call(t)},cancel:()=>{var n;v=!1,c.forEach(n=>n.cancel()),null==(n=null==t?void 0:t.Z)||n.call(t)},finish:()=>{var n;for(const t of c)try{(null==(n=t.effect)?void 0:n.getTiming().iterations)===1/0?(t.effect.updateTiming({iterations:1}),t.finish(),t.effect.updateTiming({iterations:1/0})):t.finish()}catch(n){t.cancel()}},setPlaybackRate:n=>(c.forEach(t=>t.playbackRate=n),m),getCurrentTime:()=>{var n,t;const e=null!=(t=null==(n=c[0])?void 0:n.currentTime)?t:null;return null!==e?+e:null},setCurrentTime:n=>{v=!1,c.forEach(t=>{t.currentTime=n})},destroy:()=>{var n;m.cancel(),c.splice(0,c.length),d||(d=!0,null==(n=null==t?void 0:t._)||n.call(t))}};return i.trigger&&("scroll"===i.m?console.warn("scroll timeline: `animator.trigger` is ignored (triggers do not apply to scroll-driven playback)"):Un(m,i.trigger)),r&&c.forEach(n=>n.play()),m}function Ln(n,t,e){var o,r,l;const i="number"==typeof(null==n?void 0:n.fraction)?n.fraction:t,u=null==(r=null==(o=globalThis.CSS)?void 0:o.percent)?void 0:r.call(o,100*i);if(void 0!==u)return e?{W:null!=(l=null==n?void 0:n.phase)?l:"cover",offset:u}:{offset:u}}function Zn(n,t){const e=document.body,o=document.documentElement;for(let r=n.parentElement;r;r=r.parentElement){if(r===e||r===o)return null;const n=getComputedStyle(r),l="y"===t?n.overflowY:n.overflowX;if("auto"===l||"scroll"===l||"hidden"===l||"overlay"===l)return r}return null}function _n(){return document.scrollingElement||document.documentElement}var Wn="parent",qn="scroller";function Kn(n,t){var e,o;const r=null==t?void 0:t.trim();if(!r)return n;if(r===Wn){let t=null;for(let e=n.parentElement;e&&e!==document.body;e=e.parentElement){const n=getComputedStyle(e).position;"sticky"!==n&&"fixed"!==n||(t=e)}return null!=(o=null!=(e=null==t?void 0:t.parentElement)?e:n.parentElement)?o:n}if(r===qn)return Zn(n,"y")||Zn(n,"x")||_n();let l=null;try{l=document.querySelector(r)}catch(t){return console.warn('scroll timeline: subject "'+r+'" is not a valid selector — measuring the SVG itself'),n}return l||(console.warn('scroll timeline: subject "'+r+'" matched no element — measuring the SVG itself'),n)}function Vn(n,t){const e=n;if(!(null==t?void 0:t.pin)||!e.style)return()=>{};const o=e.style,r=o.position,l=o.top;o.position="sticky";const i="center"===t.pinAlign?.5:"bottom"===t.pinAlign?1:0,u=()=>{var e;const r=null!=(e=t.pinTop)?e:0;if(!i)return void(o.top=r+"px");const l=function(n){const t=Zn(n,"y");return t?t.clientHeight:document.documentElement.clientHeight}(n),u=n.getBoundingClientRect().height;o.top=Math.round((l-u)*i+r)+"px"};u();let c=null;const s=i?u:null;i&&(s&&window.addEventListener("resize",s),"undefined"!=typeof ResizeObserver&&(c=new ResizeObserver(u),c.observe(n)));let f=null;const a=n.parentElement;return t.pinDistance&&t.pinDistance>0&&a&&(f=document.createElement("div"),f.setAttribute("data-px-pin",""),f.style.height=100*t.pinDistance+"vh",a.insertBefore(f,n),f.appendChild(n)),()=>{s&&window.removeEventListener("resize",s),null==c||c.disconnect(),o.position=r,o.top=l,(null==f?void 0:f.parentElement)&&(f.parentElement.insertBefore(n,f),f.remove())}}function Xn(n,t,e){let o,r=t;n.A&&(r=f(s({},t),{onFinish:()=>{var n;null==(n=null==t?void 0:t.onFinish)||n.call(t),null==o||o.cancel()}}));const l=e(r);return o=l,n.debugInstName&&(window[n.debugInstName]=l),l}function Yn(n){return function(n,t,e,o){const r=Y(n)||{};return _(r)?Xn(r,e,e=>{var l,i;let u=()=>{};if(r.mode!==K.frames&&"native"===(null==(l=r.scroll)?void 0:l.driver)&&o){u=Vn(o,r.scroll);const t=function(n,t){var e,o,r,l;if(!t||!_(t))return null;const i=t.scroll||{},u=null!=(e=i.kind)?e:"view";if(i.smoothing)return console.warn('scroll timeline: `smoothing` needs the built-in driver — ignoring `driver: "native"`'),null;const c=globalThis,s="view"===u,f=s?c.ViewTimeline:c.ScrollTimeline;if("function"!=typeof f)return null;const a=null!=(o=i.axis)?o:"block";let v;try{v=new f(s?{subject:Kn(n,i.subject),axis:a}:{source:"root"===i.source?_n():Zn(n,"y")||Zn(n,"x")||_n(),axis:a})}catch(n){return console.warn("scroll timeline: native timeline construction failed — falling back to the custom driver",n),null}return{timeline:v,rangeStart:Ln(null==(r=i.range)?void 0:r.start,0,s),rangeEnd:Ln(null==(l=i.range)?void 0:l.end,1,s)}}(o,r);if(t){const l=En(n,e,o,r.mode===K.waapi,t);if(l){const n=l.destroy.bind(l);return l.destroy=()=>{u(),n()},l}}u(),u=()=>{}}const c=(r.mode!==K.frames?En(n,e,o,r.mode===K.waapi):null)||Rn(n,t,e,o),s=(null==(i=c.getRootElement)?void 0:i.call(c))||o;if(s){u=Vn(s,r.scroll);const n=("number"==typeof(null==(f=r)?void 0:f.duration)&&f.duration>0?f.duration:T)*("number"==typeof(null==f?void 0:f.iterations)&&f.iterations>0?f.iterations:1),t=function(n,t,e){var o,r;if(!t||!_(t))return null;const l=t.scroll||{},i=null!=(o=l.kind)?o:"view",u=Kn(n,l.subject),c=Zn(n,"y")||Zn(n,"x"),s="scroll"===i&&"root"===l.source?_n():c||_n(),f=s===_n(),a=function(n,t){const e=null!=n?n:"block";if("x"===e||"y"===e)return e;const o=!!t&&t.startsWith("vertical");return"inline"===e?o?"y":"x":o?"x":"y"}(l.axis,getComputedStyle(s).writingMode),v=()=>{if("scroll"===i)return function(n,t,e){var o,r;const l=t>0?P(n/t,0,1):1,i="number"==typeof(null==(o=null==e?void 0:e.start)?void 0:o.fraction)?e.start.fraction:0,u="number"==typeof(null==(r=null==e?void 0:e.end)?void 0:r.fraction)?e.end.fraction:1;return u<=i?l>=u?1:0:P((l-i)/(u-i),0,1)}("y"===a?s.scrollTop:s.scrollLeft,"y"===a?s.scrollHeight-s.clientHeight:s.scrollWidth-s.clientWidth,l.range);const n=u.getBoundingClientRect();let t,e;if(f)t=0,e="y"===a?document.documentElement.clientHeight:document.documentElement.clientWidth;else{const n=s.getBoundingClientRect();t="y"===a?n.top:n.left,e="y"===a?s.clientHeight:s.clientWidth}return function(n,t,e,o){const r=e-n,l=q(null==o?void 0:o.start,0,t,e),i=q(null==o?void 0:o.end,1,t,e);return i<=l?r>=i?1:0:P((r-l)/(i-l),0,1)}(("y"===a?n.top:n.left)-t,"y"===a?n.height:n.width,e,l.range)},d=Math.max(0,null!=(r=l.smoothing)?r:0)/1e3;let m=!1,y=null,b=null,p=0,h=null;const g=()=>{h=null,m||(n=>{if(!d)return void e(n);if(null===y)return y=n,void e(n);if(null!==b)return;p=0;const t=n=>{if(b=null,m)return;const o=p?Math.min(.1,(n-p)/1e3):1/60;p=n;const r=v(),l=1-Math.exp(-o/d);y+=(r-y)*l,Math.abs(r-y)<.001&&(y=r),e(y),y!==r&&(b=requestAnimationFrame(t))};b=requestAnimationFrame(t)})(v())},w=()=>{m||null!==h||(h=requestAnimationFrame(g))},A=f?window:s;let M;A.addEventListener("scroll",w,{passive:!0}),window.addEventListener("resize",w,{passive:!0}),"undefined"!=typeof ResizeObserver&&(M=new ResizeObserver(w),M.observe(u),u!==n&&M.observe(n),f||M.observe(s));const k={destroy:()=>{m||(m=!0,A.removeEventListener("scroll",w),window.removeEventListener("resize",w),null==M||M.disconnect(),null!==h&&(cancelAnimationFrame(h),h=null),null!==b&&(cancelAnimationFrame(b),b=null))},refresh:()=>{m||(y=v(),e(y))}};return k.refresh(),k}(s,r,t=>c.setCurrentTime(t*n));if(t){const n=c.destroy.bind(c);c.destroy=()=>{t.destroy(),u(),n()}}}else console.warn("scroll timeline: no root element to observe — animation will stay at frame 0");var f;return c}):Xn(r,e,e=>r.mode===K.frames?Rn(n,t,e,o):En(n,e,o,r.mode===K.waapi)||Rn(n,t,e,o))}(function(n){if(!(null==n?void 0:n.data))throw new Error("createAnimator: `data` is required");return n.data}(n),n.q,n.K,null)}var Bn,Gn="data";return Bn=v,((t,o,l,u)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let l of r(o))i.call(t,l)||void 0===l||n(t,l,{get:()=>o[l],enumerable:!(u=e(o,l))||u.enumerable});return t})(n({},"__esModule",{value:!0}),Bn)})();
1
+ "use strict";var PixodeskAnimator=(()=>{var t=Object.defineProperty,n=Object.defineProperties,e=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertyNames,i=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,u=(n,e,r)=>e in n?t(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,c=(t,n)=>{for(var e in n||(n={}))l.call(n,e)&&u(t,e,n[e]);if(i)for(var e of i(n))s.call(n,e)&&u(t,e,n[e]);return t},a=(t,e)=>n(t,r(e)),f=(t,n)=>{var e={};for(var r in t)l.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&i)for(var r of i(t))n.indexOf(r)<0&&s.call(t,r)&&(e[r]=t[r]);return e},d={};function v(t,n=!1){var e,r,o,i;const l=t.v,s=t.i,u=t.o,c=t.c;if(!l.length)return"";const a=[],f=l.length;a.push("M"+l[0][0]+","+l[0][1]);for(let t=1;t<f;t++){const o=l[t-1],i=null!=(e=null==u?void 0:u[t-1])?e:o,c=null!=(r=null==s?void 0:s[t])?r:l[t],f=l[t];n||i[0]!==o[0]||i[1]!==o[1]||c[0]!==f[0]||c[1]!==f[1]?a.push("C"+i[0]+","+i[1]+","+c[0]+","+c[1]+","+f[0]+","+f[1]):a.push("L"+f[0]+","+f[1])}if(c&&f>0){const t=l[f-1],e=null!=(o=null==u?void 0:u[f-1])?o:t,r=null!=(i=null==s?void 0:s[0])?i:l[0],c=l[0];!n&&e[0]===t[0]&&e[1]===t[1]&&r[0]===c[0]&&r[1]===c[1]||a.push("C"+e[0]+","+e[1]+","+r[0]+","+r[1]+","+c[0]+","+c[1]),a.push("z")}return a.join("")}function h(t,n,e){return t+(n-t)*e}function m(t,n,e){const r=[],o=Math.max(t.length,n.length);for(let i=0;i<o;i++)r[i]=h(t[i]||0,n[i]||0,e);return r}function p(t,n,e){return[h(t[0]||0,n[0]||0,e),h(t[1]||0,n[1]||0,e),h(t[2]||0,n[2]||0,e),h(void 0===t[3]?1:t[3],void 0===n[3]?1:n[3],e)]}function y(t,n,e){const r=Math.max(t.length,n.length),o=[];for(let i=0;i<r;i++)o.push(b(t[i],n[i],e));return o}function b(t,n,e){var r,o,i,l,s,u,c,a,f;if(!t||!n)return t||n||{v:[]};const d=Math.min(Math.max(e,0),1),v=Math.min(t.v.length,n.v.length),h=[],p=[],y=[];for(let e=0;e<v;e++){const f=t.v[e],v=n.v[e];h.push(m(f,v,d));const b=null!=(o=null==(r=t.i)?void 0:r[e])?o:f,g=null!=(l=null==(i=n.i)?void 0:i[e])?l:v;p.push(m(b,g,d));const A=null!=(u=null==(s=t.o)?void 0:s[e])?u:f,w=null!=(a=null==(c=n.o)?void 0:c[e])?a:v;y.push(m(A,w,d))}return{v:h,i:p.length?p:void 0,o:y.length?y:void 0,c:null!=(f=t.c)?f:n.c}}function g(t,n,e){if(e<=0)return 0;if(e>=1)return 1;const r=3*t,o=3*(n-t)-r,i=1-r-o;function l(t){return((i*t+o)*t+r)*t}function s(t){return(3*i*t+2*o)*t+r}let u=e,c=0,a=1;for(let t=0;t<8;t++){const t=l(u)-e;if(Math.abs(t)<1e-6)return u;const n=s(u);if(Math.abs(n)<1e-6)break;u-=t/n}for(u=e;c<a;){const t=l(u);if(Math.abs(t-e)<1e-6)return u;e>t?c=u:a=u,u=(a+c)/2}return u}function A(t){const[n,e,r,o]=t,i=3*e,l=3*(o-e)-i,s=1-i-l;return function(t){return e=g(n,r,t),((s*e+l)*e+i)*e;var e}}function w(t,n,e){return[t[0]+(n[0]-t[0])*e,t[1]+(n[1]-t[1])*e]}function j(t,n){if(!t)return{left:void 0,right:void 0};if(n<=0)return{left:void 0,right:t};if(n>=1)return{left:t,right:void 0};const[e,r,o,i]=t,l=g(e,o,n),s=[e,r],u=[o,i],{left:c,right:a}=function(t,n,e,r,o){const i=w(t,n,o),l=w(n,e,o),s=w(e,r,o),u=w(i,l,o),c=w(l,s,o),a=w(u,c,o);return{left:[t,i,u,a],right:[a,c,s,r]}}([0,0],s,u,[1,1],l),f=c[3][0],d=c[3][1];let v,h;f>1e-9&&Math.abs(d)>1e-9&&(v=[c[1][0]/f,c[1][1]/d,c[2][0]/f,c[2][1]/d]);const m=1-f,p=1-d;return m>1e-9&&Math.abs(p)>1e-9&&(h=[(a[1][0]-f)/m,(a[1][1]-d)/p,(a[2][0]-f)/m,(a[2][1]-d)/p]),{left:v,right:h}}function x(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function M(t){const n=Math.round(255*t[0]),e=Math.round(255*t[1]),r=Math.round(255*t[2]);return 4===t.length?"rgba("+n+","+e+","+r+","+t[3]+")":"rgb("+n+","+e+","+r+")"}function O(t){if(t){if(Array.isArray(t))return t;if("string"==typeof t)return t.startsWith("#")?function(t){const n=t.slice(1),e=n.length<=4,r=e?n[0]+n[0]:n.slice(0,2),o=e?n[1]+n[1]:n.slice(2,4),i=e?n[2]+n[2]:n.slice(4,6),l=4===n.length?n[3]+n[3]:8===n.length?n.slice(6,8):null,s=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==l&&s.push(parseInt(l,16)/255),s}(t):t.startsWith("rgb")?function(t){var n;const e=null==(n=t.match(/rgba?\((.*)\)/))?void 0:n[1];if(!e)throw new Error("Invalid rgb/rgba format");const r=e.split(",").map(t=>+t.trim());return[r[0]/255,r[1]/255,r[2]/255,...void 0!==r[3]?[r[3]]:[]]}(t):void console.warn("Unsupported color format: "+t)}}((n,e)=>{for(var r in e)t(n,r,{get:e[r],enumerable:!0})})(d,{PX_ANIMATOR_DOC_KEY:()=>De,createAnimator:()=>Ie,setupAnimationTriggers:()=>je});var k=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),z=new Set(["translate","rotate","scale","skew"]),S=new Set(["offset-distance","offsetDistance"]);function N(t,n){var e;if(!t)return"";const r=null==(e=null==n?void 0:n.l)||e,o=[],i=t.translate,l=t.origin,s=t.rotate,u=t.skew,c=t.scale,a=r?"px":"",f=r?"deg":"";return i&&o.push("translate("+i[0]+a+","+i[1]+a+")"),l&&o.push("translate("+l[0]+a+","+l[1]+a+")"),null!=s&&o.push("rotate("+s+f+")"),null!=u&&o.push("skewX("+u+f+")"),c&&o.push("scale("+c[0]+","+c[1]+")"),l&&o.push("translate("+-l[0]+a+","+-l[1]+a+")"),o.join("")}var P=new Set(["offset-distance","offsetDistance"]),C=1e3;function T(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var V=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","markerUnits","markerWidth","markerHeight","refX","refY","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","tableValues","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function U(t){return V.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function _(t,n,e){return Math.max(n,Math.min(t,e))}function R(t,n,e,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const i=1-o,l=i*i,s=o*o,u=l*i,c=3*o*l,a=3*s*i,f=s*o;return[u*t[0]+c*n[0]+a*e[0]+f*r[0],u*t[1]+c*n[1]+a*e[1]+f*r[1]]}var I=1e-4;function F(t,n,e,r,o){const i=D(t,n,e,r,o);return 0===i[0]&&0===i[1]?D(t,n,e,r,o<.5?o+I:o-I):i}function D(t,n,e,r,o){const i=1-o,l=3*i*i,s=6*o*i,u=3*o*o;return[l*(n[0]-t[0])+s*(e[0]-n[0])+u*(r[0]-e[0]),l*(n[1]-t[1])+s*(e[1]-n[1])+u*(r[1]-e[1])]}function E(t,n){const{ts:e,ds:r}=t,o=e.length-1;if(n<=e[0])return r[0];if(n>=e[o])return r[o];let i=1,l=o;for(;i<l;){const t=i+l>>>1;e[t]<n?i=t+1:l=t}const s=e[l-1],u=e[l]-s,c=u>0?(n-s)/u:0;return r[l-1]+c*(r[l]-r[l-1])}function W(t){return"scroll"===(null==t?void 0:t.timelineSource)}var L="cover";function B(t,n,e,r){var o;const[i,l]=function(t,n,e){const r=n,o=e;switch(t){case"cover":return[0,r+o];case"entry":return[0,Math.min(r,o)];case"contain":return[Math.min(r,o),Math.max(r,o)];case"exit":return[Math.max(r,o),r+o];case"entry-crossing":return[0,r];case"exit-crossing":return[o,r+o]}}(null!=(o=null==t?void 0:t.phase)?o:L,e,r);return i+("number"==typeof(null==t?void 0:t.fraction)?t.fraction:n)*(l-i)}function Z(t){if(!t.length)return".";let n="";for(const e of t)e.startsWith("[")?n+=e:n+=(n?".":"")+e;return n}var q=class{_canSanitize(t){return this.isValid(t)}optional(){return new G(this)}},G=class extends q{constructor(t){super(),this.inner=t,this._default=void 0}sanitize(t){if(null!=t)return this.inner._canSanitize(t)?this.inner.sanitize(t):void 0}isValid(t,n,e){return null==t||this.inner.isValid(t,n,e)}_canSanitize(t){return null==t||this.inner._canSanitize(t)}},J=class extends q{constructor(t=""){super(),this._default=t}sanitize(t){return"string"==typeof t?t:this._default}isValid(t,n,e){return"string"==typeof t||(null==n||n.errors.push(Z(null!=e?e:[])+": expected string, got "+typeof t),!1)}},K=class extends q{constructor(t=0){super(),this._default=t}sanitize(t){return"number"==typeof t&&isFinite(t)?t:this._default}isValid(t,n,e){return!("number"!=typeof t||!isFinite(t))||(null==n||n.errors.push(Z(null!=e?e:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},X=class extends q{constructor(t=!1){super(),this._default=t}sanitize(t){return"boolean"==typeof t?t:this._default}isValid(t,n,e){return"boolean"==typeof t||(null==n||n.errors.push(Z(null!=e?e:[])+": expected boolean, got "+typeof t),!1)}},Y=class extends q{constructor(t){super(),this.value=t,this._default=t}sanitize(t){return t===this.value?this.value:this._default}isValid(t,n,e){return t===this.value||(null==n||n.errors.push(Z(null!=e?e:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},H=class extends q{constructor(t,n){super(),this.values=t,this._default=null!=n?n:t[0]}sanitize(t){return this.values.includes(t)?t:this._default}isValid(t,n,e){return!!this.values.includes(t)||(null==n||n.errors.push(Z(null!=e?e:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},$=class extends q{constructor(t,n){super(),this.h=t,this.m="union",this._default=null!=n?n:t[0]._default}sanitize(t){for(const n of this.h)if(n.isValid(t))return n.sanitize(t);return this._default}isValid(t,n,e){var r;const o=n&&{errors:[],warnings:[],strict:n.strict};if(this.h.some(n=>n.isValid(t,o,e?[...e]:void 0)))return!0;if(!n)return!1;const i=Z(null!=e?e:[]);let l;n.errors.push(i+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,240));let s=-1;const u=[];for(const r of this.h){const o={errors:[],warnings:[],strict:n.strict};if(r.isValid(t,o,e?[...e]:void 0),!o.errors.length)continue;const c=Math.max(...o.errors.map(t=>t.slice(0,t.indexOf(":")).length));if((c>s||c===s&&l&&o.errors.length<l.length)&&(s=c,l=o.errors),c<=i.length)for(const t of o.errors){const n=/: expected (.+?), got /.exec(t);n&&!u.includes(n[1])&&u.push(n[1])}}if(l&&s>i.length)for(const t of l.slice(0,4))n.errors.includes(t)||n.errors.push(t);else u.length&&n.errors.push(i+": expected "+u.join(" | "));return!1}_canSanitize(t){return this.h.some(n=>n._canSanitize(t))}},Q=class extends q{constructor(t){super(),this._shape=t;const n={};for(const e of Object.keys(t))n[e]=t[e]._default;this._default=n}sanitize(t){const n=t&&"object"==typeof t&&!Array.isArray(t)?t:{},e={};for(const t of Object.keys(this._shape)){const r=this._shape[t].sanitize(n[t]);void 0!==r&&(e[t]=r)}return e}isValid(t,n,e){if(!t||"object"!=typeof t||Array.isArray(t))return null==n||n.errors.push(Z(null!=e?e:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=e?e:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],n,o)||(i=!1),o.pop();if(null==n?void 0:n.strict)for(const t of Object.keys(r))t in this._shape||void 0!==r[t]&&(o.push(t),n.errors.push(Z(o)+": unexpected extra key"),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},tt=class extends q{constructor(t,n){super(),this._shape=t,this.A=n;const e={};for(const n of Object.keys(t))e[n]=t[n]._default;this._default=e}sanitize(t){const n=t&&"object"==typeof t&&!Array.isArray(t)?t:{},e=c({},n);for(const t of Object.keys(this._shape)){const r=this._shape[t].sanitize(n[t]);void 0!==r&&(e[t]=r)}if(this.A)for(const t of Object.keys(n))t in this._shape||(e[t]=this.A.sanitize(n[t]));return e}isValid(t,n,e){if(!t||"object"!=typeof t||Array.isArray(t))return null==n||n.errors.push(Z(null!=e?e:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=e?e:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],n,o)||(i=!1),o.pop();if(this.A)for(const t of Object.keys(r))t in this._shape||(o.push(t),this.A.isValid(r[t],n,o)||(i=!1),o.pop());return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},nt=class extends q{constructor(t){super(),this.item=t,this._default=[]}sanitize(t){if(!Array.isArray(t))return[];const n=[];for(const e of t)this.item._canSanitize(e)&&n.push(this.item.sanitize(e));return n}isValid(t,n,e){if(!Array.isArray(t))return null==n||n.errors.push(Z(null!=e?e:[])+": expected array, got "+typeof t),!1;const r=null!=e?e:[];let o=!0;for(let e=0;e<t.length;e++)r.push("["+e+"]"),this.item.isValid(t[e],n,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)}},et=class extends q{constructor(t){super(),this.value=t,this.m="record",this._default={}}sanitize(t){if(!t||"object"!=typeof t||Array.isArray(t))return{};const n={};for(const[e,r]of Object.entries(t))this.value._canSanitize(r)&&(n[e]=this.value.sanitize(r));return n}isValid(t,n,e){if(!t||"object"!=typeof t||Array.isArray(t))return null==n||n.errors.push(Z(null!=e?e:[])+": expected object/record, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=null!=e?e:[];let o=!0;for(const[e,i]of Object.entries(t))r.push(e),this.value.isValid(i,n,r)||(o=!1),r.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},rt=class extends q{constructor(t,n){super(),this.fn=t,this._default=n,this.resolved=null}get schema(){var t;return null!=(t=this.resolved)?t:this.resolved=this.fn()}sanitize(t){return this.schema.sanitize(t)}isValid(t,n,e){return this.schema.isValid(t,n,e)}_canSanitize(t){return this.schema._canSanitize(t)}},ot=class extends q{constructor(t){super(),this.h=t,this.m="tuple",this._default=t.map(t=>t._default)}sanitize(t){return Array.isArray(t)&&t.length===this.h.length?this.h.map((n,e)=>n.sanitize(t[e])):this._default}isValid(t,n,e){if(!Array.isArray(t)||t.length!==this.h.length)return null==n||n.errors.push(Z(null!=e?e:[])+": expected tuple of length "+this.h.length+", got "+(Array.isArray(t)?"array["+t.length+"]":typeof t)),!1;const r=null!=e?e:[];let o=!0;for(let e=0;e<this.h.length;e++)r.push("["+e+"]"),this.h[e].isValid(t[e],n,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)&&t.length===this.h.length}},it=(t="")=>new J(t),lt=(t=0)=>new K(t),st=(t=!1)=>new X(t),ut=t=>new Y(t),ct=(t,n)=>new H(t,n),at=(t,n)=>new $(t,n),ft=t=>new Q(t),dt=(t,n)=>new tt(t,n),vt=t=>new nt(t),ht=t=>new et(t),mt=t=>new ot(t),pt=(t,n)=>new rt(t,n),yt="block",bt="inline",gt="nearest",At="root",wt="center",jt="bottom",xt=["duration","iterations","engine","frameRate","trigger","delay","fillMode","direction","fill","resetOnFinish","timelineSource","scroll"],Mt={native:"native",js:"js"},Ot=a(c({},Mt),{auto:"auto"});function kt(t){return t===Ot.native}var zt={startOn:"load",outAction:"continue",scrollIntoViewThreshold:0},St={start:"start",end:"end"},Nt={normal:"normal",alternate:"alternate"},Pt="userSpaceOnUse",Ct="objectBoundingBox",Tt="transform";function Vt(t){var n;const e=(null==t?void 0:t.animator)||(null==(n=null==t?void 0:t.meta)?void 0:n.animator);if(!e)return;const r=_t.get(e);if(r)return r;const o=e,i=xt.filter(t=>void 0!==o[t]),l=i.length?c({},o):e;for(const t of i)delete l[t];const s=function(t){const n=t.timeline;if(null==n||"object"!=typeof n)return t;const e=Rt.get(t);if(e)return e;const r=t,{timeline:o}=r,i=f(r,["timeline"]);if(void 0!==n.engine&&(i.engine=n.engine),void 0!==n.frameRate&&(i.frameRate=n.frameRate),"scroll"===n.type||"view"===n.type){i.timelineSource="scroll",void 0!==n.duration&&(i.duration=n.duration),void 0!==n.iterations&&(i.iterations=n.iterations);const t=c({},i.scroll||{});t.kind=n.type,void 0!==n.axis&&(t.axis=n.axis),void 0!==n.source&&(t.source=n.source),void 0!==n.subject&&(t.subject=n.subject),void 0!==n.smoothing&&(t.smoothing=n.smoothing),void 0!==n.range&&(t.range=n.range);const e=n.pin;"boolean"==typeof e?t.pin=e:e&&"object"==typeof e&&(t.pin=!0,void 0!==e.align&&(t.pinAlign=e.align),void 0!==e.offset&&(t.pinOffset=e.offset),void 0!==e.distance&&(t.pinDistance=e.distance)),i.scroll=t}else{if(void 0!==n.duration&&(i.duration=n.duration),void 0!==n.trigger){const t=n.trigger,{finishAction:e}=t,r=f(t,["finishAction"]);Object.keys(r).length&&(i.trigger=r),void 0!==e&&(i.resetOnFinish="reset"===e)}void 0!==n.delay&&(i.delay=n.delay),void 0!==n.iterations&&(i.iterations=n.iterations),void 0!==n.direction&&(i.direction=n.direction),void 0!==n.fillMode&&(i.fill=n.fillMode)}return Rt.set(t,i),i}(l);return _t.set(e,s),s}var Ut,_t=new WeakMap,Rt=new WeakMap,It=at([it(),mt([lt(),lt(),lt(),lt()])]),Ft=at([it(),lt(),vt(lt()),ft({pathData:it()}),pt(()=>vt(wn),[]),pt(()=>Jt,{})]),Dt=ft({time:lt().optional(),value:Ft.optional(),easing:It.optional(),tangentOut:mt([lt(),lt()]).optional(),tangentIn:mt([lt(),lt()]).optional()}),Et=t=>{var n,e;return null!=(e=null!=(n=t.time)?n:t.t)?e:0},Wt=t=>{var n;return null!=(n=t.value)?n:t.v},Lt=t=>{var n;return null!=(n=t.easing)?n:t.e},Bt=t=>t.tangentIn,Zt=t=>t.tangentOut,qt=ft({segmentCount:lt().optional(),repeatAt:ct([St.start,St.end]).optional(),direction:ct([Nt.normal,Nt.alternate]).optional()}),Gt=ft({value:Ft.optional(),keyframes:vt(Dt).optional(),loop:at([qt,st()]).optional(),autoOrient:st().optional(),alongPathMode:ct(["sampled","offsetPath"]).optional()}),Jt=ft({translate:mt([lt(),lt()]).optional(),rotate:lt().optional(),skew:lt().optional(),scale:mt([lt(),lt()]).optional(),origin:mt([lt(),lt()]).optional()}),Kt=(at([it(),Jt,ft({value:Jt}),Gt]),ht(Gt)),Xt=at([it(),vt(at([it(),Kt])),Kt]),Yt=ft({startOn:ct(["load","mouseOver","click","scrollIntoView","programmatic"],zt.startOn).optional(),outAction:ct(["continue","pause","reset","reverse"],zt.outAction).optional(),finishAction:ct(["hold","reset"]).optional(),scrollIntoViewThreshold:lt().optional()}),Ht=ft({width:lt(),pathData:it()}),$t=ft({fontFamily:it(),fontStyle:it(),ascent:lt(),unitsPerEm:lt(),glyphs:ht(Ht)}),Qt=ft({easings:ht(mt([lt(),lt(),lt(),lt()])).optional(),animations:ht(Kt).optional(),styles:ht(ht(at([it(),lt()]))).optional(),fonts:ht($t).optional()}),tn=ft({phase:ct(["cover","contain","entry","exit","entry-crossing","exit-crossing"]).optional(),fraction:lt().optional()}),nn=ft({start:tn.optional(),end:tn.optional()}),en=(ft({kind:ct(["view","scroll"]).optional(),axis:ct([yt,bt,"x","y"]).optional(),source:ct([gt,At]).optional(),subject:it().optional(),smoothing:lt().optional(),pin:st().optional(),pinAlign:ct(["top",wt,jt]).optional(),pinOffset:lt().optional(),pinDistance:lt().optional(),range:nn.optional()}),ft({align:ct(["top",wt,jt]).optional(),offset:lt().optional(),distance:lt().optional()})),rn=ct([Ot.auto,Ot.native,Ot.js]).optional(),on=ft({type:ut("time").optional(),engine:rn,frameRate:lt().optional(),duration:lt().optional(),trigger:Yt.optional(),delay:lt().optional(),iterations:at([lt(),ut("infinite")]).optional(),fillMode:ct(["forwards","backwards","both","none"]).optional(),direction:ct(["normal","reverse","alternate","alternate-reverse"]).optional()}),ln={duration:lt().optional(),iterations:lt().optional(),engine:rn,frameRate:lt().optional(),axis:ct([yt,bt,"x","y"]).optional(),source:ct([gt,At]).optional(),subject:it().optional(),smoothing:lt().optional(),pin:at([st(),en]).optional(),range:nn.optional()},sn=ft(c({type:ut("scroll")},ln)),un=ft(c({type:ut("view")},ln)),cn=ft({timeline:(Ut=[on,sn,un],new class extends q{constructor(t,n,e){var r;super(),this.j=t,this.M=n,this.m="discriminatedUnion",this._default=null!=e?e:n[0]._default,this.O=new Map;for(const e of n){const n=e._shape[t];if(!n)continue;const o=null!=(r=n.inner)?r:n;this.O.set(o._default,e),n.inner&&(this.S=e)}}N(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const n=t[this.j];return null==n?this.S:this.O.get(n)}sanitize(t){var n;return(null!=(n=this.N(t))?n:this.M[0]).sanitize(t)}isValid(t,n,e){const r=this.N(t);if(!r){const r=null===t||"object"!=typeof t||Array.isArray(t)?void 0:t[this.j];return null==n||n.errors.push(Z(null!=e?e:[])+": no discriminated union member matched "+this.j+"="+JSON.stringify(r)),!1}return r.isValid(t,n,e)}_canSanitize(t){if(null===t||"object"!=typeof t||Array.isArray(t))return!1;const n=this.N(t);return n?n._canSanitize(t):this.M[0]._canSanitize(t)}}("type",Ut)).optional(),definitions:Qt.optional(),animateById:ht(Xt).optional(),debugGlobalName:it().optional(),version:it().optional()}),an=(ft({id:it(),animate:Xt}),at([it(),lt(),vt(lt()),ft({value:new class extends q{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,n,e){return void 0!==t||(null==n||n.errors.push(Z(null!=e?e:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}}}),Jt])),fn=at([lt(),Gt,ft({value:lt()})]),dn=at([mt([lt(),lt()]),Gt,ft({value:mt([lt(),lt()])})]),vn=at([it(),Gt,ft({value:it()})]),hn=ft({translate:dn.optional(),rotate:fn.optional(),scale:dn.optional(),skew:fn.optional(),origin:dn.optional()}),mn=ft({copies:lt().optional(),translate:dn.optional(),rotate:fn.optional(),skew:fn.optional(),scale:dn.optional(),origin:dn.optional()}),pn=ft({source:it().optional(),maskType:ct(["luminance","alpha"]).optional(),maskUnits:ct([Pt,Ct]).optional(),maskContentUnits:ct([Pt,Ct]).optional(),x:lt().optional(),y:lt().optional(),width:lt().optional(),height:lt().optional()}),yn=ft({pathData:vn.optional()}),bn=ft({offset:fn.optional(),range:dn.optional(),subPaths:ct(["separate","combined"]).optional()}),gn=ft({start:lt().optional(),stretch:lt().optional(),timeCrop:mt([lt(),lt()]).optional()}),An=ft({without:ct(["translate"]).optional(),source:it().optional(),retime:gn.optional()}),wn=ft({offset:lt(),color:it()}),jn=at([vt(wn),ft({value:vt(wn)}),Gt]),xn=ft({type:ct(["linear","radial"]),start:dn.optional(),end:dn.optional(),center:dn.optional(),radius:fn.optional(),focal:dn.optional(),stops:jn.optional(),gradientUnits:ct([Pt,Ct]).optional(),spreadMethod:ct(["pad","reflect","repeat"]).optional(),gradientTransform:it().optional()}),Mn=xn,On=ft({pathData:it(),pathOverflow:ct(["clip","extend"]).optional(),lengthAdjust:ct(["spacing","spacingAndGlyphs"]).optional(),method:ct(["align","stretch"]).optional(),spacing:ct(["auto","exact"]).optional(),startOffset:fn.optional(),textLength:fn.optional()}),kn=ft({useGlyphs:st().optional()}),zn=ft({transformBy:hn.optional(),repeater:mn.optional(),maskedBy:pn.optional(),clipPath:yn.optional(),strokeTrim:bn.optional(),clone:An.optional(),fillGradient:xn.optional(),strokeGradient:Mn.optional(),textPath:On.optional(),text:kn.optional()}),Sn=dt({type:it(),domType:it().optional(),textContent:it().optional(),id:it().optional(),meta:(new class extends q{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,n,e){return!0}_canSanitize(t){return!0}}).optional(),effects:zn.optional(),animate:Xt.optional(),style:at([it(),ht(at([it(),lt()]))]).optional()},an),Nn=dt(a(c({},Sn._shape),{children:pt(()=>vt(Nn),[]).optional()}),an),Pn=ft({width:at([lt(),it()]).optional(),height:at([lt(),it()]).optional(),viewBox:it().optional(),animator:cn.optional()});function Cn(t){const n=Wt(t);if(!n)return;if(Array.isArray(n)&&n.length>=2&&"number"==typeof n[0]&&"number"==typeof n[1])return[n[0],n[1]];const e=n.translate;return Array.isArray(e)&&e.length>=2?[e[0],e[1]]:void 0}function Tn(t){return Et(t)}function Vn(t){return Lt(t)}function Un(t){const n=t.keyframes;if(!Array.isArray(n))return!1;if(t.autoOrient)return!0;for(const t of n)if(Bt(t)||Zt(t))return!0;return!1}dt(a(c(c({},Sn._shape),Pn._shape),{type:ut("svg"),children:vt(Nn).optional()}),an),ft({v:vt(vt(lt())),i:vt(vt(lt())).optional(),o:vt(vt(lt())).optional(),c:st().optional()});var _n=new WeakMap;function Rn(t,n,e,r){let o=_n.get(t);const i=null==o?void 0:o.get(n);if(i)return i;const l=Zt(t),s=Bt(n),u=[e[0]+(l?l[0]:0),e[1]+(l?l[1]:0)],c=[r[0]+(s?s[0]:0),r[1]+(s?s[1]:0)],a=function(t,n,e,r,o=100){const i=o+1,l=new Float64Array(i),s=new Float64Array(i);let u=R(t,n,e,r,0);l[0]=0,s[0]=0;let c=0;for(let a=1;a<i;a++){const i=a/o,f=R(t,n,e,r,i),d=f[0]-u[0],v=f[1]-u[1];c+=Math.sqrt(d*d+v*v),l[a]=i,s[a]=c,u=f}return{ts:l,ds:s}}(e,u,c,r),f={P0:e,P1:u,P2:c,P3:r,P:a,C:a.ds[a.ds.length-1]};return o||(o=new WeakMap,_n.set(t,o)),o.set(n,f),f}var In=.5,Fn=5,Dn=32;function En(t,n){var e,r,o;if(!Un(t))return t;const i=t.keyframes;if(!Array.isArray(i)||i.length<2)return t;const l=!!t.autoOrient,s=null!=(e=null==n?void 0:n.flatnessTolerance)?e:In,u=null!=(r=null==n?void 0:n.rotationTolerance)?r:Fn,c=null!=(o=null==n?void 0:n.maxSamplesPerSegment)?o:Dn,a=[],f=Cn(i[0]);if(!f)return t;const d=l?function(t,n){const e=Cn(t),r=Cn(n);if(!e||!r)return 0;const o=Rn(t,n,e,r),i=F(o.P0,o.P1,o.P2,o.P3,0);return 180*Math.atan2(i[1],i[0])/Math.PI}(i[0],i[1]):void 0;a.push(Wn(Tn(i[0]),Zn(Ln(i[0]),Ln(i[0]),0,f,d,l)));for(let t=0;t<i.length-1;t++){const n=i[t],e=i[t+1],r=Cn(n),o=Cn(e);r&&o?(l&&t>0&&Gn(a,n,e,r,o,u),Kn(a,n,e,r,o,l,s,u,c)):a.push(Wn(Tn(e),Zn(Ln(e),Ln(e),1,null!=o?o:[0,0],void 0,l)))}const v=Vn(i[i.length-1]);v&&(a[a.length-1].e=v),l&&function(t){let n;for(const e of t){const t=Wt(e);if(!t||"number"!=typeof t.rotate)continue;if(void 0===n){n=t.rotate;continue}let r=t.rotate;for(;r-n>180;)r-=360;for(;r-n<-180;)r+=360;t.rotate=r,n=r}}(a);const h={keyframes:a};return void 0!==t.loop&&(h.loop=t.loop),h}function Wn(t,n){return{t:t,v:n}}function Ln(t){const n=Wt(t);if(n&&"object"==typeof n&&!Array.isArray(n))return n}function Bn(t,n,e){if(void 0===t)return n;if(void 0===n)return t;if("number"==typeof t&&"number"==typeof n)return t+(n-t)*e;if(Array.isArray(t)&&Array.isArray(n)&&t.length===n.length){const r=new Array(t.length);for(let o=0;o<t.length;o++){const i="number"==typeof t[o]?t[o]:0,l="number"==typeof n[o]?n[o]:0;r[o]=i+(l-i)*e}return r}return e<.5?t:n}function Zn(t,n,e,r,o,i){const l={translate:r},s=new Set;if(t)for(const n of Object.keys(t))s.add(n);if(n)for(const t of Object.keys(n))s.add(t);for(const r of s){if("translate"===r)continue;if("rotate"===r&&i)continue;const o=null==t?void 0:t[r],s=null==n?void 0:n[r];void 0===o&&void 0===s||(l[r]=Bn(o,s,e))}return void 0!==o&&(l.rotate=o+qn(t,n,e)),l}function qn(t,n,e){const r="number"==typeof(null==t?void 0:t.rotate)?t.rotate:void 0,o="number"==typeof(null==n?void 0:n.rotate)?n.rotate:void 0;if(void 0===r&&void 0===o)return 0;const i=Bn(r,o,e);return"number"==typeof i?i:0}function Gn(t,n,e,r,o,i){const l=t[t.length-1],s=Wt(l),u=null==s?void 0:s.rotate;if("number"!=typeof u)return;const c=Ln(n),a=u-qn(c,c,0),f=Rn(n,e,r,o),d=F(f.P0,f.P1,f.P2,f.P3,0),v=180*Math.atan2(d[1],d[0])/Math.PI,h=function(t,n){let e=t-n;for(;e>180;)e-=360;for(;e<-180;)e+=360;return e}(v,a);if(Math.abs(h)<=i)return;const m=Tn(n),p=Math.min(m+Jn,(m+Tn(e))/2),y=Zn(Ln(n),Ln(n),0,r,v,!0);t.push(Wn(p,y))}var Jn=.05;function Kn(t,n,e,r,o,i,l,s,u){const c=Rn(n,e,r,o),a=Tn(n),f=Tn(e),d=Vn(n),v=(h=d)?A([h[1],h[0],h[3],h[2]]):t=>t;var h;const m=Ln(n),p=Ln(e),y=function(t,n,e,r,o){const i=[];Xn(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),Xn(t.P0[1],t.P1[1],t.P2[1],t.P3[1],i),i.sort((t,n)=>t-n);const l=[0];for(const t of i)t>l[l.length-1]+1e-6&&t<.999999&&l.push(t);l.push(1);const s=[],u={T:o-l.length};for(let o=0;o<l.length-1;o++)Yn(l[o],l[o+1],s,t,n,e,r,u);return s}(c,i,l,s,u),b=[];for(const t of y){const n=E(c.P,t),e=_(c.C>0?n/c.C:t,0,1),r={u:_(v(e),0,1),p:e,V:R(c.P0,c.P1,c.P2,c.P3,t)};if(i){const n=F(c.P0,c.P1,c.P2,c.P3,t);r.rotateDeg=180*Math.atan2(n[1],n[0])/Math.PI}b.push(r)}let g=d,w=0;const x=t.length-1;for(let n=0;n<b.length;n++){const e=b[n],r=w<1?_((e.u-w)/(1-w),0,1):1,{left:o,right:l}=j(g,r),s=0===n?x:t.length-1;o?t[s].e=o:delete t[s].e;const u=a+e.u*(f-a),c=Zn(m,p,e.p,e.V,e.rotateDeg,i);t.push(Wn(u,c)),g=l,w=e.u}}function Xn(t,n,e,r,o){const i=n-t,l=e-n,s=i-2*l+(r-e),u=2*(l-i),c=i;if(Math.abs(s)<1e-10){if(Math.abs(u)>1e-10){const t=-c/u;t>1e-6&&t<.999999&&o.push(t)}return}const a=u*u-4*s*c;if(a<0)return;const f=Math.sqrt(a),d=(-u-f)/(2*s),v=(-u+f)/(2*s);d>1e-6&&d<.999999&&o.push(d),v>1e-6&&v<.999999&&o.push(v)}function Yn(t,n,e,r,o,i,l,s){const u=(t+n)/2,c=R(r.P0,r.P1,r.P2,r.P3,t),a=R(r.P0,r.P1,r.P2,r.P3,n),f=n-t,d=R(r.P0,r.P1,r.P2,r.P3,t+.25*f),v=R(r.P0,r.P1,r.P2,r.P3,u),h=R(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(Hn(d,c,a),Hn(v,c,a),Hn(h,c,a));let p=!0;if(o){const e=F(r.P0,r.P1,r.P2,r.P3,t),o=F(r.P0,r.P1,r.P2,r.P3,n),i=180*Math.atan2(e[1],e[0])/Math.PI,s=180*Math.atan2(o[1],o[0])/Math.PI;let u=Math.abs(i-s);u>180&&(u=360-u),u>l&&(p=!1)}m<=i&&p||s.T<=0||f<1e-6?e.push(n):(s.T-=1,Yn(t,u,e,r,o,i,l,s),Yn(u,n,e,r,o,i,l,s))}function Hn(t,n,e){const r=e[0]-n[0],o=e[1]-n[1],i=r*r+o*o;if(i<1e-20){const e=t[0]-n[0],r=t[1]-n[1];return Math.sqrt(e*e+r*r)}const l=(t[0]-n[0])*o-(t[1]-n[1])*r;return Math.abs(l)/Math.sqrt(i)}var $n=1;function Qn(t,n){if(t===n)return!0;if(typeof t!=typeof n||null===t||null===n||"object"!=typeof t)return!1;if(Array.isArray(t)!==Array.isArray(n))return!1;const e=Object.keys(t),r=Object.keys(n);return e.length===r.length&&e.every(e=>Qn(t[e],n[e]))}function te(t){const n=[];let e;const r=function(t){const n=t.split(/([MLCZmlcz]|[\s,]+)/).map(t=>t.trim()).filter(t=>t&&","!==t),e=[];let r=null;for(const t of n)if(/[MLCZmlcz]/.test(t))r={type:t,values:[]},e.push(r);else if(r){const n=+t;r.values.push(Number.isNaN(n)?0:n)}return e}(t);for(const t of r){const r=t.type,o=t.values;if("M"===r||"m"===r){const t=o[0]||0,r=o[1]||0;e={v:[[t,r]],i:[[t,r]],o:[[t,r]],c:!1},n.push(e);continue}if(e||(e={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},n.push(e)),"L"===r){const t=o[0]||0,n=o[1]||0;e.v.push([t,n]),e.i.push([t,n]),e.o.push([t,n])}else if("C"===r){const t=o[0]||0,n=o[1]||0,r=o[2]||0,i=o[3]||0,l=o[4]||0,s=o[5]||0;e.o[e.o.length-1]=[t,n],e.v.push([l,s]),e.i.push([r,i]),e.o.push([l,s])}else"Z"===r||"z"===r?e.c=!0:console.warn('Unsupported path command "'+r+'"')}return n}function ne(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function ee(t){return"string"==typeof t&&void 0!==ne(t)}function re(t){if(t&&"object"==typeof t&&"string"==typeof t.pathData){const n=ne(t.pathData);return n?{paths:te(n)}:t}if(t&&"object"==typeof t&&"paths"in t){const n=t.paths;if(Array.isArray(n)&&n.length>0&&ee(n[0])){const t=[];for(const e of n){const n=ne(e);n&&t.push(...te(n))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&ee(t[0])){const n=[];for(const e of t){const t=ne(e);t&&n.push(...te(t))}return{paths:n}}return{paths:t}}return ee(t)?{paths:te(ne(t))}:t}function oe(t,n){var e;if(t)return Array.isArray(t)?t:(null==(e=null==n?void 0:n.easings)?void 0:e[t])?n.easings[t]:void console.warn("Unknown easing name: "+t)}function ie(t,n){var e;if("string"==typeof t){const r=null==(e=null==n?void 0:n.animations)?void 0:e[t];return r||console.warn("Unknown animation name: "+t),r}return t}function le(t,n,e,r){var o,i;return"d"===t?{paths:y(null!=(o=null==n?void 0:n.paths)?o:Array.isArray(n)?n:[],null!=(i=null==e?void 0:e.paths)?i:Array.isArray(e)?e:[],r)}:k.has(t)?p(n||[0,0,0,1],e||[0,0,0,1],r):"transform"!==t||"object"!=typeof n||null===n||Array.isArray(n)||"object"!=typeof e||null===e||Array.isArray(e)?"rotate"===t&&"number"==typeof n&&"number"==typeof e?h(n,e,r):z.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?m(n||[],e||[],r):h(+(n||0),+(e||0),r):function(t,n,e){const r=new Set([...Object.keys(null!=t?t:{}),...Object.keys(null!=n?n:{})]),o={};for(const i of r){const r=null==t?void 0:t[i],l=null==n?void 0:n[i];if("rotate"===i||"skew"===i)o[i]=h(+(null!=r?r:0),+(null!=l?l:0),e);else if("translate"===i||"scale"===i||"origin"===i){const t="scale"===i?[1,1]:[0,0];o[i]=m(r||t,l||t,e)}else o[i]=null!=l?l:r}return o}(n,e,r)}function se(t,n,e,r){var o;const i=n.keyframes||[],l=[];for(const n of i){const e=Et(n);let i=Wt(n);const s=Lt(n);"d"===t&&(i=re(i));const u=T(t)?U(t):t;k.has(u)&&(i=null!=(o=O(i))?o:i);const c={t:e,v:i,e:oe(s,r)},a=Bt(n),f=Zt(n);a&&(c.tangentIn=a),f&&(c.tangentOut=f),l.push(c)}l.sort((t,n)=>{var e,r;return(null!=(e=t.t)?e:0)-(null!=(r=n.t)?r:0)});const s=n.loop,u=!0===s?{}:s||void 0;return u&&l.length>=2?function(t,n,e,r){var o,i,l,s,u;const f=n.length-1,d=_(null!=(o=e.segmentCount)?o:f,1,f);let v;v=e.repeatAt===St.start?n.slice(0,d+1):n.slice(f-d);const h=null!=(i=n[0].t)?i:0,m=null!=(l=n[n.length-1].t)?l:0;let p,y;e.repeatAt===St.start?(p=0,y=h):(p=m,y=r);const b=y-p;if(b<=0)return n;const g=null!=(s=v[0].t)?s:0,w=(null!=(u=v[v.length-1].t)?u:0)-g;if(w<=0)return n;const M=v.map(t=>({U:(t.t-g)/w,v:t.v,e:t.e,tangentIn:Bt(t),tangentOut:Zt(t)})),O=Math.floor(b/w),k=b-O*w,z=k/w,S=[],N=e.repeatAt!==St.start,P=n[n.length-1];let C,T=!1;function V(n,e,r){var o;let i;if(e){i=[];for(let t=M.length-1;t>=0;t--)i.push({U:1-M[t].U,v:M[t].v,e:t>0?x(M[t-1].e):void 0,tangentIn:M[t].tangentOut,tangentOut:M[t].tangentIn})}else i=M;const l=void 0!==r?r:1;for(let e=0;e<i.length;e++){const r=i[e];if(r.U>l+1e-9){const o=i[e-1],s=r.U-o.U,u=(l-o.U)/s,c=o.e?A(o.e)(u):u,a=le(t,o.v,r.v,c),{left:f}=j(o.e,u);return S.length>0&&o.U<=l&&(S[S.length-1].e=f),void S.push({t:n+l*w,v:a,e:void 0})}const s=S.length>0?S[S.length-1]:P,u=N&&0===e&&void 0!==s&&Math.abs((null!=(o=s.t)?o:0)-(n+r.U*w))<1e-9;if(u){if(Qn(s.v,r.v)){S.length>0?(s.e=r.e,s.tangentOut=r.tangentOut):(C=r.e,T=!0);continue}S.length>0&&(delete s.tangentIn,delete s.tangentOut)}const c={t:n+r.U*w+(u?$n:0),v:r.v,e:e<i.length-1?r.e:void 0};r.tangentIn&&(c.tangentIn=r.tangentIn),r.tangentOut&&(c.tangentOut=r.tangentOut),S.push(c)}}if(e.repeatAt===St.start){z>1e-9&&function(n,e,r){let o;if(e){o=[];for(let t=M.length-1;t>=0;t--)o.push({U:1-M[t].U,v:M[t].v,e:t>0?x(M[t-1].e):void 0,tangentIn:M[t].tangentOut,tangentOut:M[t].tangentIn})}else o=M;const i=1-r;for(let e=0;e<o.length;e++){const r=o[e];if(r.U<i-1e-9)continue;const l=o[e-1];if(l&&l.U<i-1e-9&&r.U>i+1e-9){const e=r.U-l.U,o=(i-l.U)/e,s=l.e?A(l.e)(o):o,u=le(t,l.v,r.v,s),{right:c}=j(l.e,o);S.push({t:n,v:u,e:c})}const s={t:n+(r.U-i)*w,v:r.v,e:e<o.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),S.push(s)}}(p,e.direction===Nt.alternate&&O%2==0,z);for(let t=0;t<O;t++){const n=O-1-t,r=e.direction===Nt.alternate&&n%2==0;V(p+k+t*w,r)}}else{for(let t=0;t<O;t++){const n=e.direction===Nt.alternate&&t%2==0;V(p+t*w,n)}if(z>1e-9){const t=e.direction===Nt.alternate&&O%2==0;V(p+O*w,t,z)}}return e.repeatAt===St.start?[...S,...n]:T&&n.length>0?[...n.slice(0,-1),a(c({},n[n.length-1]),{e:C}),...S]:[...n,...S]}(t,l,u,e):l}var ue=0;function ce(t,n=Mt.native){const e=Vt(t)||{},r=function(t){var n;if(t)return null==(n=Vt(t))?void 0:n.definitions}(t),o=e.duration||1e3,i=[],l=(t,e,i)=>{if(!e)return null;const l=function(t,n){if(!t)return[];const e=[];if("string"==typeof t){const r=ie(t,n);r&&e.push(r)}else if(Array.isArray(t))for(const r of t){const t=ie(r,n);t&&e.push(t)}else e.push(t);return e}(e,r);if(0===l.length)return null;const s=function(t,n,e,r=Mt.native){const o={};for(const[i,l]of Object.entries(t)){if("transform"===i&&"offsetPath"===l.alongPathMode&&void 0!==t.offsetDistance)continue;const s=se(i,l,n,e);if(s.length>0){const t={keyframes:s};void 0!==l.autoOrient&&(t.autoOrient=l.autoOrient),void 0!==l.loop&&(t.loop=l.loop),o[i]=r===Mt.native&&"transform"===i?En(t):t}}return o}(function(t,n){if(!t)return t;const e=n&&"object"==typeof n&&!Array.isArray(n)?n:function(t){var n,e;if(!t||"string"!=typeof t)return;const r={},o=/([a-zA-Z]+)\s*\(([^)]*)\)/g,i=["translate","rotate","skewX","scale"];let l,s=-1;for(;null!==(l=o.exec(t));){const t=l[1],o=i.indexOf(t);if(o<0||o<=s)return;s=o;const u=l[2].split(/[\s,]+/).filter(Boolean).map(Number);if(u.some(t=>Number.isNaN(t)))return;if("translate"===t){if(u.length<1||u.length>2)return;r.translate=[u[0],null!=(n=u[1])?n:0]}else if("rotate"===t){if(1!==u.length)return;r.rotate=u[0]}else if("skewX"===t){if(1!==u.length)return;r.skew=u[0]}else{if(u.length<1||u.length>2)return;r.scale=[u[0],null!=(e=u[1])?e:u[0]]}}return t.replace(/([a-zA-Z]+)\s*\(([^)]*)\)/g,"").replace(/[\s,]/g,"").length?void 0:Object.keys(r).length?r:void 0}(n);if(!e||!Object.keys(e).length)return t;const r=t=>t&&"object"==typeof t&&!Array.isArray(t)?c(c({},e),t):t,o=t[Tt];if(o&&"object"==typeof o){const n=o;if(Array.isArray(n.keyframes)){const e=a(c({},n),{keyframes:n.keyframes.map(t=>a(c({},t),{value:r(t.value)}))});return void 0!==e.value&&(e.value=r(e.value)),a(c({},t),{transform:e})}return t}const i=Object.keys(t).filter(t=>z.has(t));if(1!==i.length)return t;const l=i[0],s=t[l];if(!s||"object"!=typeof s||!Array.isArray(s.keyframes))return t;const u=a(c({},s),{keyframes:s.keyframes.map(t=>a(c({},t),{value:a(c({},e),{[l]:t.value})}))});void 0!==u.value&&(u.value=a(c({},e),{[l]:u.value}));const f=c({},t);return delete f[l],a(c({},f),{transform:u})}(function(t){const n={};for(const e of t)for(const[t,r]of Object.entries(e))n[t]=r;return n}(l),i),o,r,n);return 0===Object.keys(s).length?null:{id:t,animate:s}},s=function(t){var n;if(!t)return;const e=null==(n=Vt(t))?void 0:n.animateById;return e?Object.entries(e).map(([t,n])=>({id:t.startsWith("#")?t.slice(1):t,animate:n})):void 0}(t);if(s)for(const t of s){const n=l(t.id,t.animate);n&&i.push(n)}const u=t=>{const n=t.animate;if(n&&Object.keys(n).length>0){const e=t.id||"_px_el_"+ ++ue;t.id=e;const r=l(e,n,t.transform);r&&i.push(r)}if(t.children)for(let n=0;n<t.children.length;n++)u(t.children[n])};if(t.children)for(let n=0;n<t.children.length;n++)u(t.children[n]);return i}function ae(t,n,e){var r,o,i,l;const s=n.keyframes||[];if(0===s.length)return null;const{_:u,R:c}=function(t,n){var e,r;const o=t.length-1;let i=t[0],l=t[o>0?1:0];for(let s=0;s<o;s++){const u=null!=(e=t[s].t)?e:0,c=null!=(r=t[s+1].t)?r:0;if(u<=n&&n<=c){i=t[s],l=t[s+1];break}n>c&&s===o-1&&(i=t[o>0?o-1:0],l=t[o])}return{_:i,R:l}}(s,e);let a=u===c?0:(f=e,d=null!=(r=u.t)?r:0,(b=null!=(o=c.t)?o:0)===d?0:0+(f-d)/(b-d)*1);var f,d,b;a=_(a,0,1);const g=Lt(u);if(g&&Array.isArray(g))try{a=A(g)(a)}catch(t){}let w=T(t)?U(t):t,j=null;const x=null==u?void 0:u.v,O=null==c?void 0:c.v;if("d"===w)j=y(null!=(i=null==x?void 0:x.paths)?i:Array.isArray(x)?x:[],null!=(l=null==O?void 0:O.paths)?l:Array.isArray(O)?O:[],a).map(t=>v(t)).join("");else if(k.has(w))j=M(p(x||[0,0,0,1],O||[0,0,0,1],a)),w=t;else if("stroke-dasharray"===w)j=m(x||[],O||[],a).join(" "),w=t;else if("transform"!==w||null===x||"object"!=typeof x||Array.isArray(x))"translate"===w?(j="translate("+m(x||[0,0],O||[0,0],a).join(",")+")",w="transform"):"rotate"===w?(j="rotate("+h(+(x||0),+(O||0),a)+")",w="transform"):"scale"===w?(j="scale("+m(x||[1,1],O||[1,1],a).join(",")+")",w="transform"):j=h(+(x||0),+(O||0),a);else{const t=new Set([...x?Object.keys(x):[],...O?Object.keys(O):[]]),e={};for(const n of t){const t=null==x?void 0:x[n],r=null==O?void 0:O[n];if("rotate"===n||"skew"===n)e[n]=h(+(null!=t?t:0),+(null!=r?r:0),a);else if("translate"===n||"scale"===n||"origin"===n){const o="scale"===n?[1,1]:[0,0],i=m(t||o,r||o,a);e[n]=i}}if(Un(n)){const t=x.translate,r=O.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=function(t,n,e,r,o,i){const l=Rn(t,n,e,r),s=0===l.C?o:function(t,n){const e=n*t.ds[t.ds.length-1],{ts:r,ds:o}=t,i=o.length-1;if(e<=0)return r[0];if(e>=o[i])return r[i];let l=1,s=i;for(;l<s;){const t=l+s>>>1;o[t]<e?l=t+1:s=t}const u=o[s-1],c=o[s]-u,a=c>0?(e-u)/c:0;return r[s-1]+a*(r[s]-r[s-1])}(l.P,o),u=R(l.P0,l.P1,l.P2,l.P3,s);if(!i)return{translate:u};const c=F(l.P0,l.P1,l.P2,l.P3,s);return{translate:u,rotateDeg:180*Math.atan2(c[1],c[0])/Math.PI}}(u,c,[+t[0],+t[1]],[+r[0],+r[1]],a,!!n.autoOrient);e.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(e.rotate=o.rotateDeg)}}j=N(e,{l:!1}),w="transform"}return S.has(w)&&"number"==typeof j&&(j=100*j+"%"),{k:w,v:null===j?"":""+j}}function fe(t,n){const e={};for(const[r,o]of Object.entries(t)){const t=ae(r,o,n);t&&(e[t.k]=t.v)}return e}var de="setPlaybackRate: rate must be finite and non-zero";function ve(t){return Number.isFinite(t)&&0!==t}function he(t,n){return t>0?n===1/0?t:t*(n>0?n:1):0}function me(t,n){return Number.isNaN(t)||t<0?0:Number.isFinite(n)?t>n?n:t:Number.isFinite(t)?t:0}function pe(t,n,e){const r=he(n,e);return r>0&&Number.isFinite(t)?t<=0?0:e===1/0?t%r/r:t>=r?1:t/r:0}function ye(t,n,e){const r=he(n,e);return r>0&&Number.isFinite(t)?t<=0?0:t>=1?r:t*r:0}function be(t){const n=globalThis;"function"!=typeof n.cancelAnimationFrame?n.clearTimeout(t):n.cancelAnimationFrame(t)}var ge={document:"document",host:"host",platform:"platform",usage:"usage",internal:"internal"};function Ae(t,n){return!!t&&(!0===t||t.includes(n))}function we(t,n){const e=n?n+" ":"";return{warn:(n,r,o)=>{if(null==t?void 0:t.onWarn)return void t.onWarn({kind:n,message:r,detail:o});if(Ae(null==t?void 0:t.silent,n))return;const i=e+n+": "+r;void 0===o?console.warn(i):console.warn(i,o)},error:(n,r)=>{const o=function(t){return"string"==typeof t?new Error(t):t}(r);(null==t?void 0:t.onError)?t.onError({kind:n,message:o.message,error:o}):Ae(null==t?void 0:t.silent,n)||console.error(e+n+": "+o.message)}}}function je(t,n,e){const r=null!=e?e:we(void 0,"[PxAnimator]"),o=[],i=()=>{for(const t of o.splice(0))t()},{startOn:l,outAction:s,scrollIntoViewThreshold:u}={startOn:null!=(a=null==(c=n)?void 0:c.startOn)?a:zt.startOn,outAction:null!=(f=null==c?void 0:c.outAction)?f:zt.outAction,scrollIntoViewThreshold:null!=(d=null==c?void 0:c.scrollIntoViewThreshold)?d:zt.scrollIntoViewThreshold};var c,a,f,d;const v=t.getRootElement();if(!v)return r.warn(ge.host,"setupAnimationTriggers: No root element found for animation."),i;let h=!1;const m=()=>{h&&(h=!1,t.setPlaybackRate(1)),t.play()},p=()=>{switch(s){case"pause":t.pause();break;case"reset":t.cancel();break;case"reverse":h=!0,t.setPlaybackRate(-1),t.play()}};switch(l){case"load":{const t=()=>m();"complete"===document.readyState?t():(window.addEventListener("load",t,{once:!0}),o.push(()=>window.removeEventListener("load",t)));break}case"mouseOver":{let t=!1;const n=()=>{t=!0,m()},e=()=>{t&&p()};v.addEventListener("mouseenter",n),v.addEventListener("mouseleave",e),o.push(()=>{v.removeEventListener("mouseenter",n),v.removeEventListener("mouseleave",e)});break}case"click":{const n=()=>{t.isPlaying()?p():m()};v.addEventListener("click",n),o.push(()=>v.removeEventListener("click",n));break}case"scrollIntoView":{const t=t=>{var n,e;const r=t.boundingClientRect,o=t.intersectionRect;if(!(null==r?void 0:r.height)||!o)return t.intersectionRatio;const i="undefined"!=typeof window&&window.innerHeight?window.innerHeight:1/0,l=null!=(e=null==(n=t.rootBounds)?void 0:n.height)?e:1/0,s=Math.min(i,l),u=Math.min(r.height,Number.isFinite(s)?s:r.height);return u>0?o.height/u:t.intersectionRatio},n=Array.from({length:21},(t,n)=>n/20);let e=!1;const r=new IntersectionObserver(n=>{n.forEach(n=>{n.isIntersecting&&t(n)>=u?(e=!0,m()):e&&(e=!1,p())})},{threshold:n});r.observe(v),o.push(()=>r.disconnect());break}}return i}function xe(t){return"#"+t}function Me(t,n,e,r){var o;const i=Vt(t)||{},l=we(e,"[PxAnimator]");if(!r)if(t.id){const n=xe(t.id);(r=document.querySelector(n))||l.warn(ge.host,"createFrameLoopAnimator: No root element found for selector: "+n)}else l.warn(ge.host,"createFrameLoopAnimator: No root element provided");const s=function(t,n,e){var r;const o=Vt(t)||{},i=ce(t,Mt.js),l=o.iterations;let s=1;"number"==typeof l&&(s=l||1),"infinite"===l&&(s=1/0),s<1&&(s=1);const u=+(o.duration||C),c=u&&s?u*(s===1/0?1/0:s):u?(null!=s?s:1)*u:0,a=o.direction||"normal",f=null!=(r=o.fill)?r:"forwards",d="forwards"===f||"both"===f,v="backwards"===f||"both"===f;let h=null,m=!1,p=-(o.delay||0),y=0,b=1,g=!1;const A=o.frameRate,w=A&&A>0?1e3/A:0;let j=0;const x=()=>{const t=y?(Date.now()-y)*b:0;return p+t},M=()=>{let t=x();return Number.isFinite(c)&&t>c&&(t=c),t<0&&(t=0),t};function O(t){let e=function(){const n=u>0?u:1;let e=0,r=0;u>0?(t=_(t,0,s*n),r=Math.max(0,Math.ceil(t/n)-1),r=Math.min(r,s-1),e=_((t-r*n)/n,0,1)):e=t;const o=a||"normal";let i=e;return"reverse"===o?i=1-e:"alternate"===o?r%2==1&&(i=1-e):"alternate-reverse"===o&&r%2==0&&(i=1-e),i}();for(const t of i||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=fe(r,e*u);for(const[e,r]of Object.entries(o))n.setAttribute(t.id,e,r)}}o.delay&&(o.delay<0?O(M()):v&&O(0));const k=()=>!!m&&!!n.isConnected()&&(b<0?x()>0:!(Number.isFinite(c)&&M()>=c)),z=t=>{null!==h&&(be(h),h=null),(t||k())&&(h=function(t){const n=globalThis;return"function"==typeof n.requestAnimationFrame?n.requestAnimationFrame(t):n.setTimeout(t,16)}(()=>{h=null,(()=>{var t,r;if(!n.isConnected())return void S();const o=M(),i=x();if(i<0&&b>0)v&&O(0);else{if(b<0&&i<=0)return S(),O(0),void(g||(g=!0,null==(t=null==e?void 0:e.onFinish)||t.call(e)));if(b>0&&c&&Number.isFinite(c)&&o>=c)return S(),O(d?c:0),void(g||(g=!0,null==(r=null==e?void 0:e.onFinish)||r.call(e)));if(w>0){const t=Date.now();if(j&&t-j<w)return;j=t}O(o)}})(),z()}))},S=()=>{if(!m)return;let t=x();Number.isFinite(c)&&t>c&&(t=c),p=t,y=0,m=!1,null!==h&&(be(h),h=null),t>=0?O(t):v&&O(0)},N={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>k(),play:()=>{var t;(()=>{if(!m){if(b>=0)Number.isFinite(c)&&p>=c&&(p=0);else if(p<=0){if(!Number.isFinite(c))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");p=c}g=!1,m=!0,y=Date.now(),z(!0)}})(),null==(t=null==e?void 0:e.onPlay)||t.call(e)},pause:()=>{var t;S(),null==(t=null==e?void 0:e.onPause)||t.call(e)},cancel:()=>{var t;S(),p=0,y=0,m=!1,g=!1,O(p),null==(t=null==e?void 0:e.onCancel)||t.call(e)},finish:()=>{((t=!0)=>{var n;p=Number.isFinite(c)?c:M(),y=0,m=!1,null!==h&&(be(h),h=null),O(d?p:0),t&&!g&&(g=!0,null==(n=null==e?void 0:e.onFinish)||n.call(e))})(!0)},setPlaybackRate:t=>{if(!ve(t))return void console.warn(de);let n=x();Number.isFinite(c)&&n>c&&(n=c),t<0!=b<0&&(g=!1),b=t,p=n,m&&(y=Date.now())},getCurrentTime:()=>M(),setCurrentTime:t=>{t=me(t,c),p=t,m&&(y=Date.now()),(!Number.isFinite(c)||t<c)&&(g=!1),O(M())},getCurrentProgress:()=>pe(M(),u,s),setCurrentProgress:t=>{N.setCurrentTime(ye(t,u,s))},destroy:()=>{var t;N.cancel(),null==(t=null==e?void 0:e.onRemove)||t.call(e)}};return N}(t,n||function(t,n){const e=new Set,r=null!=n?n:we(void 0,"[PxAnimator]");return{isConnected:()=>!t||t.isConnected,setAttribute:(n,o,i)=>{o=U(o);const l=xe(n),s=(null==t?void 0:t.querySelectorAll(l))||document.querySelectorAll(l);0!==s.length||e.has(l)||(e.add(l),r.warn(ge.host,'setAttribute: No elements found for selector "'+l+'"'));for(let t=0;t<s.length;t++){const n=s[t],e="transform"===o&&"pattern"===n.tagName?"patternTransform":o;n.setAttribute(e,i),P.has(o)&&(n.style[o]=i)}}}}(r,l),e),u=a(c({},s),{getRootElement:()=>r||null});if(W(i))i.trigger&&l.warn(ge.usage,"scroll timeline: `animator.trigger` is ignored (triggers do not apply to scroll-driven playback)");else{const t=je(u,null!=(o=i.trigger)?o:{},l),n=u.destroy.bind(u);u.destroy=()=>{t(),n()}}return u}function Oe(t,n,e,r){let o=Wt(t);const i=Lt(t),l={offset:n,easing:i&&Array.isArray(i)?"cubic-bezier("+i.join(",")+")":void 0};let s,u=e;var c;return k.has(e)&&Array.isArray(o)?s=M(o):"transform"!==e||null===o||"object"!=typeof o||Array.isArray(o)?z.has(e)?(Array.isArray(o)&&("translate"===e&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===e&&(o+="deg"),s=e+"("+o+")",u="transform"):s="d"===e?'path("'+(o&&"object"==typeof o&&Array.isArray(o.paths)?o.paths:[]).map(t=>v(t,!0)).join("")+'")':S.has(e)&&"number"==typeof o?100*o+"%":""+o:(s=N(o,{l:!0}),u="transform"),CSS.supports(U(u),s)||r.add(u),u=(c=u).includes("-")?c.replace(/-([a-z])/g,(t,n)=>n.toUpperCase()):c,l[u]=s,l}function ke(t,n,e){var r,o,i,l,s;const u=[];for(let f=0;f<n.length;f++){const d=n[f],v=null!=(r=d.t)?r:0;if(v<0){const e=n[f+1];if(e&&(null!=(o=e.t)?o:0)>=0){const n=(0-v)/((null!=(i=e.t)?i:0)-v),r=d.e?A(d.e)(n):n,{right:o}=j(d.e,n);u.push({t:0,v:le(t,d.v,e.v,r),e:o})}continue}if(v>e){const r=n[f-1];if(r&&(null!=(l=r.t)?l:0)<=e){const n=null!=(s=r.t)?s:0,o=(e-n)/(v-n),i=r.e?A(r.e)(o):o,{left:l}=j(r.e,o);u.length>0&&(u[u.length-1]=a(c({},u[u.length-1]),{e:l})),u.push({t:e,v:le(t,r.v,d.v,i),e:void 0})}break}u.push(d)}return u}function ze(t,n,e){var r;const o=new Map;for(const[i,l]of Object.entries(t)){const t=e.duration||1,s=ke(i,l.keyframes||[],t),u=[];for(let e=0;e<s.length;e++){const o=s[e],l=Oe(o,_((null!=(r=o.t)?r:0)/t,0,1),i,n);0===e&&(l.offset||0)>0&&u.push(a(c({},l),{offset:0})),u.push(l)}u.length>0&&(u[u.length-1].offset||0)<1&&u.push(a(c({},u[u.length-1]),{offset:1})),u.length>0&&o.set(i,u)}return o}function Se(t,n,e,r,o){var i,l;const s=Vt(t)||{},u=we(n,"[PxAnimator]");if(!e)if(t.id){const n=xe(t.id);(e=document.querySelector(n))||u.warn(ge.host,"createWebApiAnimator: No root element found for selector: "+n)}else u.warn(ge.host,"createWebApiAnimator: No root element provided");const c=ce(t,Mt.native),a=[],f=s.iterations;let d;"number"==typeof f&&(d=f),"infinite"===f&&(d=1/0);const v=new Set;let h=!1,m=!1;(null==c?void 0:c.length)||u.warn(ge.document,"createWebApiAnimator: No animation bindings defined");for(const t of c||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){u.warn(ge.document,"createWebApiAnimator: Empty or unresolved binding",t);continue}const l=xe(t.id),c=(null==e?void 0:e.querySelectorAll(l))||document.querySelectorAll(l);0===c.length&&u.warn(ge.host,'createWebApiAnimator: No elements found for selector "'+l+'"');const f=ze(r,v,s),p=s.delay&&s.delay>0?s.delay:void 0;let y;if(s.delay&&s.delay<0&&s.duration){const t=-s.delay;y=d===1/0?t%s.duration:Math.min(t,s.duration*(null!=d?d:1))}const b={duration:s.duration,delay:p,fill:null!=(i=s.fill)?i:"forwards",direction:s.direction,iterations:d};for(let t=0;t<c.length;t++){const e=c[t];for(const[,t]of f)if(t.length>0)try{const r=new KeyframeEffect(e,t,b),i=new Animation(r,o?o.timeline:document.timeline);if(o){const t=i;o.rangeStart&&(t.rangeStart=o.rangeStart),o.rangeEnd&&(t.rangeEnd=o.rangeEnd)}(null==n?void 0:n.onFinish)&&(i.onfinish=()=>{var t;h||(h=!0,null==(t=n.onFinish)||t.call(n))}),(null==n?void 0:n.onRemove)&&(i.onremove=()=>{var t;m||(m=!0,null==(t=n.onRemove)||t.call(n))}),void 0!==y&&(i.currentTime=y),a.push(i)}catch(t){u.warn(ge.internal,"createWebApiAnimator: could not build the animation",t)}}}if(!r&&v.size)return u.warn(ge.platform,"Unsupported CSS attrs: "+[...v].join(", ")),null;const p={isReady:()=>!0,getRootElement:()=>e||null,isPlaying:()=>{var t;return"running"===(null==(t=a[0])?void 0:t.playState)},play:()=>{var t;h=!1,a.forEach(t=>t.play()),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;a.forEach(t=>t.pause()),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;h=!1,a.forEach(t=>t.cancel()),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{var t;for(const n of a)try{(null==(t=n.effect)?void 0:t.getTiming().iterations)===1/0?(n.effect.updateTiming({iterations:1}),n.finish(),n.effect.updateTiming({iterations:1/0})):n.finish()}catch(t){n.cancel()}},setPlaybackRate:t=>ve(t)?(a.forEach(n=>n.playbackRate=t),p):(u.warn(ge.usage,de),p),getCurrentTime:()=>{var t,n;const e=null!=(n=null==(t=a[0])?void 0:t.currentTime)?n:null;return null!==e?+e:null},setCurrentTime:t=>{var n;const e=function(t,n){return t>0?n===1/0?1/0:t*(n>0?n:1):0}(null!=(n=s.duration)?n:0,null!=d?d:1),r=e>0?me(t,e):Math.max(0,t);h=!1,a.forEach(t=>{t.currentTime=r})},getCurrentProgress:()=>{var t;const n=p.getCurrentTime();return null===n?null:pe(n,null!=(t=s.duration)?t:0,null!=d?d:1)},setCurrentProgress:t=>{var n;p.setCurrentTime(ye(t,null!=(n=s.duration)?n:0,null!=d?d:1))},destroy:()=>{var t;p.cancel(),a.splice(0,a.length),m||(m=!0,null==(t=null==n?void 0:n.onRemove)||t.call(n))}};if("scroll"===s.timelineSource)s.trigger&&u.warn(ge.usage,"scroll timeline: `animator.trigger` is ignored (triggers do not apply to scroll-driven playback)");else{const t=je(p,null!=(l=s.trigger)?l:{},u),n=p.destroy.bind(p);p.destroy=()=>{t(),n()}}return o&&a.forEach(t=>t.play()),p}function Ne(t,n,e){var r,o,i;const l="number"==typeof(null==t?void 0:t.fraction)?t.fraction:n,s=null==(o=null==(r=globalThis.CSS)?void 0:r.percent)?void 0:o.call(r,100*l);if(void 0!==s)return e?{rangeName:null!=(i=null==t?void 0:t.phase)?i:"cover",offset:s}:{offset:s}}function Pe(t,n){const e=document.body,r=document.documentElement;for(let o=t.parentElement;o;o=o.parentElement){if(o===e||o===r)return null;const t=getComputedStyle(o),i="y"===n?t.overflowY:t.overflowX;if("auto"===i||"scroll"===i||"hidden"===i||"overlay"===i)return o}return null}function Ce(){return document.scrollingElement||document.documentElement}var Te="parent",Ve="scroller";function Ue(t,n,e){var r,o;const i=null!=e?e:we(void 0,"[PxAnimator]"),l=null==n?void 0:n.trim();if(!l)return t;if(l===Te){let n=null;for(let e=t.parentElement;e&&e!==document.body;e=e.parentElement){const t=getComputedStyle(e).position;"sticky"!==t&&"fixed"!==t||(n=e)}return null!=(o=null!=(r=null==n?void 0:n.parentElement)?r:t.parentElement)?o:t}if(l===Ve)return Pe(t,"y")||Pe(t,"x")||Ce();let s=null;try{s=document.querySelector(l)}catch(n){return i.warn(ge.document,'scroll timeline: subject "'+l+'" is not a valid selector — measuring the SVG itself'),t}return s||(i.warn(ge.host,'scroll timeline: subject "'+l+'" matched no element — measuring the SVG itself'),t)}function _e(t,n){const e=t;if(!(null==n?void 0:n.pin)||!e.style)return()=>{};const r=e.style,o=r.position,i=r.top;r.position="sticky";const l="center"===n.pinAlign?.5:"bottom"===n.pinAlign?1:0,s=()=>{var e;const o=null!=(e=n.pinOffset)?e:0;if(!l)return void(r.top=o+"px");const i=function(t){const n=Pe(t,"y");return n?n.clientHeight:document.documentElement.clientHeight}(t),s=t.getBoundingClientRect().height;r.top=Math.round((i-s)*l+o)+"px"};s();let u=null;const c=l?s:null;l&&(c&&window.addEventListener("resize",c),"undefined"!=typeof ResizeObserver&&(u=new ResizeObserver(s),u.observe(t)));let a=null;const f=t.parentElement;return n.pinDistance&&n.pinDistance>0&&f&&(a=document.createElement("div"),a.setAttribute("data-px-pin",""),a.style.height=100*n.pinDistance+"vh",f.insertBefore(a,t),a.appendChild(t)),()=>{c&&window.removeEventListener("resize",c),null==u||u.disconnect(),r.position=o,r.top=i,(null==a?void 0:a.parentElement)&&(a.parentElement.insertBefore(t,a),a.remove())}}function Re(t,n,e){let r,o=n;t.resetOnFinish&&(o=a(c({},n),{onFinish:()=>{var t;null==(t=null==n?void 0:n.onFinish)||t.call(n),null==r||r.cancel()}}));const i=e(o);return r=i,t.debugGlobalName&&(window[t.debugGlobalName]=i),i}function Ie(t){return function(t,n,e,r){const o=Vt(t)||{},i=we(e,"[PxAnimator]");return W(o)?Re(o,e,e=>{var l;let s=()=>{};if(o.engine!==Ot.js&&r){s=_e(r,o.scroll);const n=function(t,n,e){var r,o,i,l;const s=null!=e?e:we(void 0,"[PxAnimator]");if(!n||!W(n))return null;const u=n.scroll||{},c=null!=(r=u.kind)?r:"view";if(u.smoothing)return s.warn(ge.platform,"scroll timeline: `smoothing` needs the built-in driver — using the built-in driver instead of the browser timeline"),null;const a=globalThis,f="view"===c,d=f?a.ViewTimeline:a.ScrollTimeline;if("function"!=typeof d)return null;const v=null!=(o=u.axis)?o:"block";let h;try{h=new d(f?{subject:Ue(t,u.subject,s),axis:v}:{source:"root"===u.source?Ce():Pe(t,"y")||Pe(t,"x")||Ce(),axis:v})}catch(t){return s.warn(ge.platform,"scroll timeline: native timeline construction failed — falling back to the player measuring progress itself",t),null}return{timeline:h,rangeStart:Ne(null==(i=u.range)?void 0:i.start,0,f),rangeEnd:Ne(null==(l=u.range)?void 0:l.end,1,f)}}(r,o,i);if(n){const i=Se(t,e,r,kt(o.engine),n);if(i){const t=i.destroy.bind(i);return i.destroy=()=>{s(),t()},i}}s(),s=()=>{}}const u=(o.engine!==Ot.js?Se(t,e,r,kt(o.engine)):null)||Me(t,n,e,r),c=(null==(l=u.getRootElement)?void 0:l.call(u))||r;if(c){s=_e(c,o.scroll);const t=("number"==typeof(null==(a=o)?void 0:a.duration)&&a.duration>0?a.duration:C)*("number"==typeof(null==a?void 0:a.iterations)&&a.iterations>0?a.iterations:1),n=function(t,n,e,r){var o,i;if(!n||!W(n))return null;const l=null!=r?r:we(void 0,"[PxAnimator]"),s=n.scroll||{},u=null!=(o=s.kind)?o:"view",c=Ue(t,s.subject,l),a=Pe(t,"y")||Pe(t,"x"),f="scroll"===u&&"root"===s.source?Ce():a||Ce(),d=f===Ce(),v=function(t,n){const e=null!=t?t:"block";if("x"===e||"y"===e)return e;const r=!!n&&n.startsWith("vertical");return"inline"===e?r?"y":"x":r?"x":"y"}(s.axis,getComputedStyle(f).writingMode),h=()=>{if("scroll"===u)return function(t,n,e){var r,o;const i=n>0?_(t/n,0,1):1,l="number"==typeof(null==(r=null==e?void 0:e.start)?void 0:r.fraction)?e.start.fraction:0,s="number"==typeof(null==(o=null==e?void 0:e.end)?void 0:o.fraction)?e.end.fraction:1;return s<=l?i>=s?1:0:_((i-l)/(s-l),0,1)}("y"===v?f.scrollTop:f.scrollLeft,"y"===v?f.scrollHeight-f.clientHeight:f.scrollWidth-f.clientWidth,s.range);const t=c.getBoundingClientRect();let n,e;if(d)n=0,e="y"===v?document.documentElement.clientHeight:document.documentElement.clientWidth;else{const t=f.getBoundingClientRect();n="y"===v?t.top:t.left,e="y"===v?f.clientHeight:f.clientWidth}return function(t,n,e,r){const o=e-t,i=B(null==r?void 0:r.start,0,n,e),l=B(null==r?void 0:r.end,1,n,e);return l<=i?o>=l?1:0:_((o-i)/(l-i),0,1)}(("y"===v?t.top:t.left)-n,"y"===v?t.height:t.width,e,s.range)},m=Math.max(0,null!=(i=s.smoothing)?i:0)/1e3;let p=!1,y=null,b=null,g=0,A=null;const w=()=>{A=null,p||(t=>{if(!m)return void e(t);if(null===y)return y=t,void e(t);if(null!==b)return;g=0;const n=t=>{if(b=null,p)return;const r=g?Math.min(.1,(t-g)/1e3):1/60;g=t;const o=h(),i=1-Math.exp(-r/m);y+=(o-y)*i,Math.abs(o-y)<.001&&(y=o),e(y),y!==o&&(b=requestAnimationFrame(n))};b=requestAnimationFrame(n)})(h())},j=()=>{p||null!==A||(A=requestAnimationFrame(w))},x=d?window:f;let M;x.addEventListener("scroll",j,{passive:!0}),window.addEventListener("resize",j,{passive:!0}),"undefined"!=typeof ResizeObserver&&(M=new ResizeObserver(j),M.observe(c),c!==t&&M.observe(t),d||M.observe(f));const O={destroy:()=>{p||(p=!0,x.removeEventListener("scroll",j),window.removeEventListener("resize",j),null==M||M.disconnect(),null!==A&&(cancelAnimationFrame(A),A=null),null!==b&&(cancelAnimationFrame(b),b=null))},refresh:()=>{p||(y=h(),e(y))}};return O.refresh(),O}(c,o,n=>u.setCurrentTime(n*t),i);if(n){const t=u.destroy.bind(u);u.destroy=()=>{n.destroy(),s(),t()}}}else i.warn(ge.host,"scroll timeline: no root element to observe — animation will stay at frame 0");var a;return u}):Re(o,e,e=>o.engine===Ot.js?Me(t,n,e,r):Se(t,e,r,kt(o.engine))||Me(t,n,e,r))}(function(t){if(!(null==t?void 0:t.doc))throw new Error("createAnimator: `doc` is required");return t.doc}(t),t.adapter,function(t){const{onPlay:n,onPause:e,onCancel:r,onFinish:o,onRemove:i,onStop:l,onWarn:s,onError:u,silent:c}=null!=t?t:{},a=t=>t||l?()=>{null==t||t(),null==l||l()}:void 0;return{onPlay:n,onPause:a(e),onCancel:a(r),onFinish:a(o),onRemove:a(i),onWarn:s,onError:u,silent:c}}(t),null)}var Fe,De="doc";return Fe=d,((n,r,i,s)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let i of o(r))l.call(n,i)||void 0===i||t(n,i,{get:()=>r[i],enumerable:!(s=e(r,i))||s.enumerable});return n})(t({},"__esModule",{value:!0}),Fe)})();