@pixodesk/svg-animator-web 1.0.27 → 1.0.28

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},a=(n,e)=>t(n,o(e)),f={};function v(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 a=[],f=i.length;a.push("M"+i[0][0]+","+i[0][1]);for(let n=1;n<f;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],f=i[n];t||l[0]!==r[0]||l[1]!==r[1]||s[0]!==f[0]||s[1]!==f[1]?a.push("C"+l[0]+","+l[1]+","+s[0]+","+s[1]+","+f[0]+","+f[1]):a.push("L"+f[0]+","+f[1])}if(s&&f>0){const n=i[f-1],e=null!=(r=null==c?void 0:c[f-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]||a.push("C"+e[0]+","+e[1]+","+o[0]+","+o[1]+","+s[0]+","+s[1]),a.push("z")}return a.join("")}function d(n,t,e){return n+(t-n)*e}function m(n,t,e){const o=[],r=Math.max(n.length,t.length);for(let l=0;l<r;l++)o[l]=d(n[l]||0,t[l]||0,e);return o}function y(n,t,e){return[d(n[0]||0,t[0]||0,e),d(n[1]||0,t[1]||0,e),d(n[2]||0,t[2]||0,e),d(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(b(n[l],t[l],e));return r}function b(n,t,e){var o,r,l,i,u,c,s,a,f;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),y=[],p=[],b=[];for(let e=0;e<d;e++){const f=n.v[e],d=t.v[e];y.push(m(f,d,v));const h=null!=(r=null==(o=n.i)?void 0:o[e])?r:f,g=null!=(i=null==(l=t.i)?void 0:l[e])?i:d;p.push(m(h,g,v));const w=null!=(c=null==(u=n.o)?void 0:u[e])?c:f,A=null!=(a=null==(s=t.o)?void 0:s[e])?a:d;b.push(m(w,A,v))}return{v:y,i:p.length?p:void 0,o:b.length?b:void 0,c:null!=(f=n.c)?f:t.c}}function h(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,a=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<a;){const n=i(c);if(Math.abs(n-e)<1e-6)return c;e>n?s=c:a=c,c=(a+s)/2}return c}function g(n){const[t,e,o,r]=n,l=3*e,i=3*(r-e)-l,u=1-l-i;return function(n){return e=h(t,o,n),((u*e+i)*e+l)*e;var e}}function w(n,t,e){return[n[0]+(t[0]-n[0])*e,n[1]+(t[1]-n[1])*e]}function A(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=h(e,r,t),u=[e,o],c=[r,l],{left:s,right:a}=function(n,t,e,o,r){const l=w(n,t,r),i=w(t,e,r),u=w(e,o,r),c=w(l,i,r),s=w(i,u,r),a=w(c,s,r);return{left:[n,l,c,a],right:[a,s,u,o]}}([0,0],u,c,[1,1],i),f=s[3][0],v=s[3][1];let d,m;f>1e-9&&Math.abs(v)>1e-9&&(d=[s[1][0]/f,s[1][1]/v,s[2][0]/f,s[2][1]/v]);const y=1-f,p=1-v;return y>1e-9&&Math.abs(p)>1e-9&&(m=[(a[1][0]-f)/y,(a[1][1]-v)/p,(a[2][0]-f)/y,(a[2][1]-v)/p]),{left:d,right:m}}function M(n){if(n)return[1-n[2],1-n[3],1-n[0],1-n[1]]}function k(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 j(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})})(f,{PX_ANIMATOR_DATA_KEY:()=>Zn,createAnimator:()=>Kn,setupAnimationTriggers:()=>Sn});var O=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),N=new Set(["translate","rotate","scale","skew"]),T=new Set(["offset-distance","offsetDistance"]);function x(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,a=o?"px":"",f=o?"deg":"";return l&&r.push("translate("+l[0]+a+","+l[1]+a+")"),i&&r.push("translate("+i[0]+a+","+i[1]+a+")"),null!=u&&r.push("rotate("+u+f+")"),null!=c&&r.push("skewX("+c+f+")"),s&&r.push("scale("+s[0]+","+s[1]+")"),i&&r.push("translate("+-i[0]+a+","+-i[1]+a+")"),r.join("")}var C=new Set(["offset-distance","offsetDistance"]),S=1e3;function U(n){return!n.includes("-")&&/[a-z][A-Z]/.test(n)}var z=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 P(n){return z.has(n)?n:n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function I(n,t,e){return Math.max(t,Math.min(n,e))}function R(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,a=3*u*l,f=u*r;return[c*n[0]+s*t[0]+a*e[0]+f*o[0],c*n[1]+s*t[1]+a*e[1]+f*o[1]]}var D=1e-4;function E(n,t,e,o,r){const l=F(n,t,e,o,r);return 0===l[0]&&0===l[1]?F(n,t,e,o,r<.5?r+D:r-D):l}function F(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 L(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.timelineSource)}var K="cover";function W(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:K,e,o);return l+("number"==typeof(null==n?void 0:n.fraction)?n.fraction:t)*(i-l)}var Z={auto:"auto",waapi:"waapi",frames:"frames"},q={waapi:Z.waapi,frames:Z.frames},V={before:"before",after:"after"};function X(n){var t;return(null==n?void 0:n.animator)||(null==(t=null==n?void 0:n.meta)?void 0:t.animator)}function Y(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 B(n){var t,e,o;const r=null!=(t=n.keyframes)?t:n.kfs;if(!Array.isArray(r))return!1;if(n.autoOrient)return!0;for(const n of r)if((null!=(e=n.tangentIn)?e:n.ti)||(null!=(o=n.tangentOut)?o:n.to))return!0;return!1}var Q=new WeakMap;function G(n,t,e,o){var r,l;let i=Q.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,a=[e[0]+(c?c[0]:0),e[1]+(c?c[1]:0)],f=[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=R(n,t,e,o,0);i[0]=0,u[0]=0;let s=0;for(let a=1;a<l;a++){const l=a/r,f=R(n,t,e,o,l),v=f[0]-c[0],d=f[1]-c[1];s+=Math.sqrt(v*v+d*d),i[a]=l,u[a]=s,c=f}return{ts:i,ds:u}}(e,a,f,o),d={P0:e,P1:a,P2:f,P3:o,m:v,h:v.ds[v.ds.length-1]};return i||(i=new WeakMap,Q.set(n,i)),i.set(t,d),d}var J=.5,nn=5,tn=32;function en(n,t){var e,o,r,l;if(!B(n))return n;const i=null!=(e=n.keyframes)?e:n.kfs;if(!Array.isArray(i)||i.length<2)return n;const u=!!n.autoOrient,c=null!=(o=null==t?void 0:t.A)?o:J,s=null!=(r=null==t?void 0:t.M)?r:nn,a=null!=(l=null==t?void 0:t.j)?l:tn,f=[],v=Y(i[0]);if(!v)return n;const d=u?function(n,t){const e=Y(n),o=Y(t);if(!e||!o)return 0;const r=G(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}(i[0],i[1]):void 0;f.push(on(H(i[0]),un(rn(i[0]),rn(i[0]),0,v,d,u)));for(let n=0;n<i.length-1;n++){const t=i[n],e=i[n+1],o=Y(t),r=Y(e);o&&r?(u&&n>0&&sn(f,t,e,o,r,s),fn(f,t,e,o,r,u,c,s,a)):f.push(on(H(e),un(rn(e),rn(e),1,null!=r?r:[0,0],void 0,u)))}const m=$(i[i.length-1]);m&&(f[f.length-1].e=m),u&&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 y={kfs:f};return void 0!==n.loop&&(y.loop=n.loop),y}function on(n,t){return{t:n,v:t}}function rn(n){var t;const e=null!=(t=n.value)?t:n.v;if(e&&"object"==typeof e&&!Array.isArray(e))return e}function ln(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 un(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]=ln(r,u,e))}return void 0!==r&&(i.rotate=r+cn(n,t,e)),i}function cn(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=ln(o,r,e);return"number"==typeof l?l:0}function sn(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 a=rn(t),f=s-cn(a,a,0),v=G(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,f);if(Math.abs(y)<=l)return;const p=H(t),b=Math.min(p+an,(p+H(e))/2),h=un(rn(t),rn(t),0,o,m,!0);n.push(on(b,h))}var an=.05;function fn(n,t,e,o,r,l,i,u,c){const s=G(t,e,o,r),a=H(t),f=H(e),v=$(t),d=(m=v)?g([m[1],m[0],m[3],m[2]]):n=>n;var m;const y=rn(t),p=rn(e),b=function(n,t,e,o,r){const l=[];vn(n.P0[0],n.P1[0],n.P2[0],n.P3[0],l),vn(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={O:r-i.length};for(let r=0;r<i.length-1;r++)dn(i[r],i[r+1],u,n,t,e,o,c);return u}(s,l,i,u,c),h=[];for(const n of b){const t=L(s.m,n),e=I(s.h>0?t/s.h:n,0,1),o={u:I(d(e),0,1),p:e,N:R(s.P0,s.P1,s.P2,s.P3,n)};if(l){const t=E(s.P0,s.P1,s.P2,s.P3,n);o.T=180*Math.atan2(t[1],t[0])/Math.PI}h.push(o)}let w=v,M=0;const k=n.length-1;for(let t=0;t<h.length;t++){const e=h[t],o=M<1?I((e.u-M)/(1-M),0,1):1,{left:r,right:i}=A(w,o),u=0===t?k:n.length-1;r?n[u].e=r:delete n[u].e;const c=a+e.u*(f-a),s=un(y,p,e.p,e.N,e.T,l);n.push(on(c,s)),w=i,M=e.u}}function vn(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 a=c*c-4*u*s;if(a<0)return;const f=Math.sqrt(a),v=(-c-f)/(2*u),d=(-c+f)/(2*u);v>1e-6&&v<.999999&&r.push(v),d>1e-6&&d<.999999&&r.push(d)}function dn(n,t,e,o,r,l,i,u){const c=(n+t)/2,s=R(o.P0,o.P1,o.P2,o.P3,n),a=R(o.P0,o.P1,o.P2,o.P3,t),f=t-n,v=R(o.P0,o.P1,o.P2,o.P3,n+.25*f),d=R(o.P0,o.P1,o.P2,o.P3,c),m=R(o.P0,o.P1,o.P2,o.P3,n+.75*f),y=Math.max(mn(v,s,a),mn(d,s,a),mn(m,s,a));let p=!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&&(p=!1)}y<=l&&p||u.O<=0||f<1e-6?e.push(t):(u.O-=1,dn(n,c,e,o,r,l,i,u),dn(c,t,e,o,r,l,i,u))}function mn(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 yn=1;function pn(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=>pn(n[e],t[e]))}function bn(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 hn(n){return n.startsWith("path(")&&n.endsWith(")")?n.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(n)?n:void 0}function gn(n){return"string"==typeof n&&void 0!==hn(n)}function wn(n){if(n&&"object"==typeof n&&"string"==typeof n.path){const t=hn(n.path);return t?{paths:bn(t)}:n}if(n&&"object"==typeof n&&"paths"in n){const t=n.paths;if(Array.isArray(t)&&t.length>0&&gn(t[0])){const n=[];for(const e of t){const t=hn(e);t&&n.push(...bn(t))}return{paths:n}}return n}if(Array.isArray(n)){if(n.length>0&&gn(n[0])){const t=[];for(const e of n){const n=hn(e);n&&t.push(...bn(n))}return{paths:t}}return{paths:n}}return gn(n)?{paths:bn(hn(n))}:n}function An(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 Mn(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 kn(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)}:O.has(n)?y(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?d(t,e,o):N.has(n)||"stroke-dasharray"===n||"strokeDasharray"===n?m(t||[],e||[],o):d(+(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]=d(+(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]=m(o||n,i||n,e)}else r[l]=null!=i?i:o}return r}(t,e,o)}function jn(n,t,e,o){var r,l,i,u,c,f,v;const d=t.keyframes||t.kfs||[],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 a=null!=(u=t.easing)?u:t.e;"d"===n&&(s=wn(s));const d=U(n)?P(n):n;O.has(d)&&(s=null!=(c=j(s))?c:s);const y={t:e,v:s,e:An(a,o)},p=null!=(f=t.tangentIn)?f:t.ti,b=null!=(v=t.tangentOut)?v:t.to;p&&(y.tangentIn=p),b&&(y.tangentOut=b),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,p=!0===y?{}:y||void 0;return p&&m.length>=2?function(n,t,e,o){var r,l,i,u,c;const f=t.length-1,v=I(null!=(r=e.segmentCount)?r:f,1,f);let d;d=e.extend===V.before?t.slice(0,v+1):t.slice(f-v);const m=null!=(l=t[0].t)?l:0,y=null!=(i=t[t.length-1].t)?i:0;let p,b;e.extend===V.before?(p=0,b=m):(p=y,b=o);const h=b-p;if(h<=0)return t;const w=null!=(u=d[0].t)?u:0,k=(null!=(c=d[d.length-1].t)?c:0)-w;if(k<=0)return t;const j=d.map(n=>{var t,e;return{C:(n.t-w)/k,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/k),N=h-O*k,T=N/k,x=[],C=e.extend!==V.before,S=t[t.length-1];let U,z=!1;function P(t,e,o){var r;let l;if(e){l=[];for(let n=j.length-1;n>=0;n--)l.push({C:1-j[n].C,v:j[n].v,e:n>0?M(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.C>i+1e-9){const r=l[e-1],u=o.C-r.C,c=(i-r.C)/u,s=r.e?g(r.e)(c):c,a=kn(n,r.v,o.v,s),{left:f}=A(r.e,c);return x.length>0&&r.C<=i&&(x[x.length-1].e=f),void x.push({t:t+i*k,v:a,e:void 0})}const u=x.length>0?x[x.length-1]:S,c=C&&0===e&&void 0!==u&&Math.abs((null!=(r=u.t)?r:0)-(t+o.C*k))<1e-9;if(c){if(pn(u.v,o.v)){x.length>0?(u.e=o.e,u.tangentOut=o.tangentOut):(U=o.e,z=!0);continue}x.length>0&&(delete u.tangentIn,delete u.tangentOut)}const s={t:t+o.C*k+(c?yn: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),x.push(s)}}if(e.extend===V.before){T>1e-9&&function(t,e,o){let r;if(e){r=[];for(let n=j.length-1;n>=0;n--)r.push({C:1-j[n].C,v:j[n].v,e:n>0?M(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.C<l-1e-9)continue;const i=r[e-1];if(i&&i.C<l-1e-9&&o.C>l+1e-9){const e=o.C-i.C,r=(l-i.C)/e,u=i.e?g(i.e)(r):r,c=kn(n,i.v,o.v,u),{right:s}=A(i.e,r);x.push({t:t,v:c,e:s})}const u={t:t+(o.C-l)*k,v:o.v,e:e<r.length-1?o.e:void 0};o.tangentIn&&(u.tangentIn=o.tangentIn),o.tangentOut&&(u.tangentOut=o.tangentOut),x.push(u)}}(p,!!e.alternate&&O%2==0,T);for(let n=0;n<O;n++){const t=O-1-n,o=!!e.alternate&&t%2==0;P(p+N+n*k,o)}}else{for(let n=0;n<O;n++){const t=!!e.alternate&&n%2==0;P(p+n*k,t)}if(T>1e-9){const n=!!e.alternate&&O%2==0;P(p+O*k,n,T)}}return e.extend===V.before?[...x,...t]:z&&t.length>0?[...t.slice(0,-1),a(s({},t[t.length-1]),{e:U}),...x]:[...t,...x]}(n,m,p,e):m}var On=0;function Nn(n,t=q.waapi){const e=X(n)||{},o=function(n){var t;if(n)return null==(t=X(n))?void 0:t.definitions}(n),r=e.duration||1e3,l=[],i=(n,e)=>{if(!e)return null;const l=function(n,t){if(!n)return[];const e=[];if("string"==typeof n){const o=Mn(n,t);o&&e.push(o)}else if(Array.isArray(n))for(const o of n){const n=Mn(o,t);n&&e.push(n)}else e.push(n);return e}(e,o);if(0===l.length)return null;const i=function(n,t,e,o=q.waapi){const r={};for(const[l,i]of Object.entries(n)){if("transform"===l&&"offsetPath"===i.S&&void 0!==n.offsetDistance)continue;const u=jn(l,i,t,e);if(u.length>0){const n={kfs:u};void 0!==i.autoOrient&&(n.autoOrient=i.autoOrient),void 0!==i.loop&&(n.loop=i.loop),r[l]=o===q.waapi&&"transform"===l?en(n):n}}return r}(function(n){const t={};for(const e of n)for(const[n,o]of Object.entries(e))t[n]=o;return t}(l),r,o,t);return 0===Object.keys(i).length?null:{id:n,animate:i}},u=function(n){var t;if(!n)return;const e=null==(t=X(n))?void 0:t.animateById;return e?Object.entries(e).map(([n,t])=>({id: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_"+ ++On;n.id=e;const o=i(e,t);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 Tn(n,t,e){var o,r,l,i,u,c,s;const a=t.kfs||t.keyframes||[];if(0===a.length)return null;const{U:f,P:b}=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{U:l,P:i}}(a,e);let h=f===b?0:(w=e,A=null!=(o=f.t)?o:0,(M=null!=(r=b.t)?r:0)===A?0:0+(w-A)/(M-A)*1);var w,A,M;h=I(h,0,1);const j=null!=(l=f.e)?l:f.easing;if(j&&Array.isArray(j))try{h=g(j)(h)}catch(n){}let N=U(n)?P(n):n,C=null;const S=null!=(i=null==f?void 0:f.v)?i:null==f?void 0:f.value,z=null!=(u=null==b?void 0:b.v)?u:null==b?void 0:b.value;if("d"===N)C=p(null!=(c=null==S?void 0:S.paths)?c:Array.isArray(S)?S:[],null!=(s=null==z?void 0:z.paths)?s:Array.isArray(z)?z:[],h).map(n=>v(n)).join("");else if(O.has(N))C=k(y(S||[0,0,0,1],z||[0,0,0,1],h)),N=n;else if("stroke-dasharray"===N)C=m(S||[],z||[],h).join(" "),N=n;else if("transform"!==N||null===S||"object"!=typeof S||Array.isArray(S))"translate"===N?(C="translate("+m(S||[0,0],z||[0,0],h).join(",")+")",N="transform"):"rotate"===N?(C="rotate("+d(+(S||0),+(z||0),h)+")",N="transform"):"scale"===N?(C="scale("+m(S||[1,1],z||[1,1],h).join(",")+")",N="transform"):C=d(+(S||0),+(z||0),h);else{const n=new Set([...S?Object.keys(S):[],...z?Object.keys(z):[]]),e={};for(const t of n){const n=null==S?void 0:S[t],o=null==z?void 0:z[t];if("rotate"===t||"skew"===t)e[t]=d(+(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=m(n||r,o||r,h);e[t]=l}}if(B(t)){const n=S.translate,o=z.translate;if(Array.isArray(n)&&Array.isArray(o)){const r=function(n,t,e,o,r,l){const i=G(n,t,e,o),u=0===i.h?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,a=s>0?(e-c)/s:0;return o[u-1]+a*(o[u]-o[u-1])}(i.m,r),c=R(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,T:180*Math.atan2(s[1],s[0])/Math.PI}}(f,b,[+n[0],+n[1]],[+o[0],+o[1]],h,!!t.autoOrient);e.translate=[r.translate[0],r.translate[1]],void 0!==r.T&&(e.rotate=r.T)}}C=x(e,{l:!1}),N="transform"}return T.has(N)&&"number"==typeof C&&(C=100*C+"%"),{k:N,v:null===C?"":""+C}}function xn(n,t){const e={};for(const[o,r]of Object.entries(n)){const n=Tn(o,r,t);n&&(e[n.k]=n.v)}return e}function Cn(n){const t=globalThis;"function"!=typeof t.cancelAnimationFrame?t.clearTimeout(n):t.cancelAnimationFrame(n)}function Sn(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 Un(n){return"#"+n}function zn(n,t,e,o){const r=X(n)||{};if(!o)if(n.id){const t=Un(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=X(n)||{},l=Nn(n,q.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||S),s=c&&u?c*(u===1/0?1/0:u):c?(null!=u?u:1)*c:0,a=r.direction||"normal",f=null!=(o=r.fill)?o:"forwards",v="forwards"===f||"both"===f,d="backwards"===f||"both"===f;let m=null,y=!1,p=-(r.delay||0),b=0,h=1,g=!1;const w=r.frameRate,A=w&&w>0?1e3/w:0;let M=0;const k=()=>{const n=b?(Date.now()-b)*h:0;return p+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=I(n,0,u*t),o=Math.max(0,Math.ceil(n/t)-1),o=Math.min(o,u-1),e=I((n-o*t)/t,0,1)):e=n;const r=a||"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=xn(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 N=()=>!!y&&!!t.isConnected()&&(h<0?k()>0:!(Number.isFinite(s)&&j()>=s)),T=n=>{null!==m&&(Cn(m),m=null),(n||N())&&(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 x();const r=j(),l=k();if(l<0&&h>0)d&&O(0);else{if(h<0&&l<=0)return x(),O(0),void(g||(g=!0,null==(n=null==e?void 0:e.I)||n.call(e)));if(h>0&&s&&Number.isFinite(s)&&r>=s)return x(),O(v?s:0),void(g||(g=!0,null==(o=null==e?void 0:e.I)||o.call(e)));if(A>0){const n=Date.now();if(M&&n-M<A)return;M=n}O(r)}})(),T()}))},x=()=>{if(!y)return;let n=k();Number.isFinite(s)&&n>s&&(n=s),p=n,b=0,y=!1,null!==m&&(Cn(m),m=null),n>=0?O(n):d&&O(0)},C={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>N(),play:()=>{var n;(()=>{if(!y){if(h>=0)Number.isFinite(s)&&p>=s&&(p=0);else if(p<=0){if(!Number.isFinite(s))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");p=s}g=!1,y=!0,b=Date.now(),T(!0)}})(),null==(n=null==e?void 0:e.R)||n.call(e)},pause:()=>{var n;x(),null==(n=null==e?void 0:e.D)||n.call(e)},cancel:()=>{var n;x(),p=0,b=0,y=!1,g=!1,O(p),null==(n=null==e?void 0:e.F)||n.call(e)},finish:()=>{((n=!0)=>{var t;p=Number.isFinite(s)?s:j(),b=0,y=!1,null!==m&&(Cn(m),m=null),O(v?p:0),n&&!g&&(g=!0,null==(t=null==e?void 0:e.I)||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,p=t,y&&(b=Date.now())},getCurrentTime:()=>j(),setCurrentTime:n=>{n<0&&(n=0),Number.isFinite(s)&&n>s&&(n=s),p=n,y&&(b=Date.now()),(!Number.isFinite(s)||n<s)&&(g=!1),O(j())},destroy:()=>{var n;C.cancel(),null==(n=null==e?void 0:e.L)||n.call(e)}};return C}(n,t||function(n){const t=new Set;return{isConnected:()=>!n||n.isConnected,setAttribute:(e,o,r)=>{o=P(o);const l=Un(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=a(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)"):Sn(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,a=e;var f;return O.has(e)&&Array.isArray(i)?s=k(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+")",a="transform"):s="d"===e?'path("'+(i&&"object"==typeof i&&Array.isArray(i.paths)?i.paths:[]).map(n=>v(n,!0)).join("")+'")':T.has(e)&&"number"==typeof i?100*i+"%":""+i:(s=x(i,{l:!0}),a="transform"),CSS.supports(P(a),s)||o.add(a),a=(f=a).includes("-")?f.replace(/-([a-z])/g,(n,t)=>t.toUpperCase()):f,c[a]=s,c}function In(n,t,e){var o,r,l,i,u;const c=[];for(let f=0;f<t.length;f++){const v=t[f],d=null!=(o=v.t)?o:0;if(d<0){const e=t[f+1];if(e&&(null!=(r=e.t)?r:0)>=0){const t=(0-d)/((null!=(l=e.t)?l:0)-d),o=v.e?g(v.e)(t):t,{right:r}=A(v.e,t);c.push({t:0,v:kn(n,v.v,e.v,o),e:r})}continue}if(d>e){const o=t[f-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?g(o.e)(r):r,{left:i}=A(o.e,r);c.length>0&&(c[c.length-1]=a(s({},c[c.length-1]),{e:i})),c.push({t:e,v:kn(n,o.v,v.v,l),e:void 0})}break}c.push(v)}return c}function Rn(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.kfs||i.keyframes||[],n),c=[];for(let e=0;e<u.length;e++){const r=u[e],i=Pn(r,I((null!=(o=r.t)?o:0)/n,0,1),l,t);0===e&&(i.offset||0)>0&&c.push(a(s({},i),{offset:0})),c.push(i)}c.length>0&&(c[c.length-1].offset||0)<1&&c.push(a(s({},c[c.length-1]),{offset:1})),c.length>0&&r.set(l,c)}return r}function Dn(n,t,e,o,r){var l;const i=X(n)||{};if(!e)if(n.id){const t=Un(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=Nn(n,q.waapi),c=[],s=i.iterations;let a;"number"==typeof s&&(a=s),"infinite"===s&&(a=1/0);const f=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=Un(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=Rn(o,f,i),y=i.delay&&i.delay>0?i.delay:void 0;let p;if(i.delay&&i.delay<0&&i.duration){const n=-i.delay;p=a===1/0?n%i.duration:Math.min(n,i.duration*(null!=a?a:1))}const b={duration:i.duration,delay:y,fill:null!=(l=i.fill)?l:"forwards",direction:i.direction,iterations:a};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,b),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.I)&&(l.onfinish=()=>{var n;v||(v=!0,null==(n=t.I)||n.call(t))}),(null==t?void 0:t.L)&&(l.onremove=()=>{var n;d||(d=!0,null==(n=t.L)||n.call(t))}),void 0!==p&&(l.currentTime=p),c.push(l)}catch(n){console.warn(n)}}}if(!o&&f.size)return console.warn("Unsupported CSS attrs: "+[...f].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.R)||n.call(t)},pause:()=>{var n;c.forEach(n=>n.pause()),null==(n=null==t?void 0:t.D)||n.call(t)},cancel:()=>{var n;v=!1,c.forEach(n=>n.cancel()),null==(n=null==t?void 0:t.F)||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.L)||n.call(t))}};return i.trigger&&("scroll"===i.timelineSource?console.warn("scroll timeline: `animator.trigger` is ignored (triggers do not apply to scroll-driven playback)"):Sn(m,i.trigger)),r&&c.forEach(n=>n.play()),m}function En(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?{_:null!=(l=null==n?void 0:n.phase)?l:"cover",offset:u}:{offset:u}}function Fn(n,t){for(let e=n.parentElement;e;e=e.parentElement){const n=getComputedStyle(e),o="y"===t?n.overflowY:n.overflowX;if("auto"===o||"scroll"===o||"hidden"===o||"overlay"===o)return e}return null}function Ln(){return document.scrollingElement||document.documentElement}function _n(n,t,e){let o,r=t;n.resetOnFinish&&(r=a(s({},t),{I:()=>{var n;null==(n=null==t?void 0:t.I)||n.call(t),null==o||o.cancel()}}));const l=e(r);return o=l,n.debugInstName&&(window[n.debugInstName]=l),l}function Kn(n){return function(n,t,e,o){const r=X(n)||{};return _(r)?_n(r,e,e=>{var l,i;if(r.mode!==Z.frames&&"native"===(null==(l=r.scroll)?void 0:l.driver)&&o){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",c=globalThis,s="view"===u,a=s?c.ViewTimeline:c.ScrollTimeline;if("function"!=typeof a)return null;const f=null!=(o=i.axis)?o:"block";let v;try{v=new a(s?{subject:n,axis:f}:{source:"root"===i.source?Ln():Fn(n,"y")||Fn(n,"x")||Ln(),axis:f})}catch(n){return console.warn("scroll timeline: native timeline construction failed — falling back to the custom driver",n),null}return{timeline:v,rangeStart:En(null==(r=i.range)?void 0:r.start,0,s),rangeEnd:En(null==(l=i.range)?void 0:l.end,1,s)}}(o,r);if(t){const l=Dn(n,e,o,r.mode===Z.waapi,t);if(l)return l}}const u=(r.mode!==Z.frames?Dn(n,e,o,r.mode===Z.waapi):null)||zn(n,t,e,o),c=(null==(i=u.getRootElement)?void 0:i.call(u))||o;if(c){const n=("number"==typeof(null==(s=r)?void 0:s.duration)&&s.duration>0?s.duration:S)*("number"==typeof(null==s?void 0:s.iterations)&&s.iterations>0?s.iterations:1),t=function(n,t,e){var o;if(!t||!_(t))return null;const r=t.scroll||{},l=null!=(o=r.kind)?o:"view",i=Fn(n,"y")||Fn(n,"x"),u="scroll"===l&&"root"===r.source?Ln():i||Ln(),c=u===Ln(),s=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"}(r.axis,getComputedStyle(u).writingMode),a=()=>{if("scroll"===l)return function(n,t,e){var o,r;const l=t>0?I(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:I((l-i)/(u-i),0,1)}("y"===s?u.scrollTop:u.scrollLeft,"y"===s?u.scrollHeight-u.clientHeight:u.scrollWidth-u.clientWidth,r.range);const t=n.getBoundingClientRect();let e,o;if(c)e=0,o="y"===s?document.documentElement.clientHeight:document.documentElement.clientWidth;else{const n=u.getBoundingClientRect();e="y"===s?n.top:n.left,o="y"===s?u.clientHeight:u.clientWidth}return function(n,t,e,o){const r=e-n,l=W(null==o?void 0:o.start,0,t,e),i=W(null==o?void 0:o.end,1,t,e);return i<=l?r>=i?1:0:I((r-l)/(i-l),0,1)}(("y"===s?t.top:t.left)-e,"y"===s?t.height:t.width,o,r.range)};let f=null,v=!1;const d=()=>{f=null,v||e(a())},m=()=>{v||null!==f||(f=requestAnimationFrame(d))},y=c?window:u;let p;y.addEventListener("scroll",m,{passive:!0}),window.addEventListener("resize",m,{passive:!0}),"undefined"!=typeof ResizeObserver&&(p=new ResizeObserver(m),p.observe(n),c||p.observe(u));const b={destroy:()=>{v||(v=!0,y.removeEventListener("scroll",m),window.removeEventListener("resize",m),null==p||p.disconnect(),null!==f&&(cancelAnimationFrame(f),f=null))},refresh:()=>{v||e(a())}};return b.refresh(),b}(c,r,t=>u.setCurrentTime(t*n));if(t){const n=u.destroy.bind(u);u.destroy=()=>{t.destroy(),n()}}}else console.warn("scroll timeline: no root element to observe — animation will stay at frame 0");var s;return u}):_n(r,e,e=>r.mode===Z.frames?zn(n,t,e,o):Dn(n,e,o,r.mode===Z.waapi)||zn(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.K,n.W,null)}var Wn,Zn="data";return Wn=f,((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}),Wn)})();
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},a=(n,e)=>t(n,o(e)),f={};function v(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 a=[],f=i.length;a.push("M"+i[0][0]+","+i[0][1]);for(let n=1;n<f;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],f=i[n];t||l[0]!==r[0]||l[1]!==r[1]||s[0]!==f[0]||s[1]!==f[1]?a.push("C"+l[0]+","+l[1]+","+s[0]+","+s[1]+","+f[0]+","+f[1]):a.push("L"+f[0]+","+f[1])}if(s&&f>0){const n=i[f-1],e=null!=(r=null==c?void 0:c[f-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]||a.push("C"+e[0]+","+e[1]+","+o[0]+","+o[1]+","+s[0]+","+s[1]),a.push("z")}return a.join("")}function d(n,t,e){return n+(t-n)*e}function m(n,t,e){const o=[],r=Math.max(n.length,t.length);for(let l=0;l<r;l++)o[l]=d(n[l]||0,t[l]||0,e);return o}function y(n,t,e){return[d(n[0]||0,t[0]||0,e),d(n[1]||0,t[1]||0,e),d(n[2]||0,t[2]||0,e),d(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(b(n[l],t[l],e));return r}function b(n,t,e){var o,r,l,i,u,c,s,a,f;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),y=[],p=[],b=[];for(let e=0;e<d;e++){const f=n.v[e],d=t.v[e];y.push(m(f,d,v));const h=null!=(r=null==(o=n.i)?void 0:o[e])?r:f,g=null!=(i=null==(l=t.i)?void 0:l[e])?i:d;p.push(m(h,g,v));const A=null!=(c=null==(u=n.o)?void 0:u[e])?c:f,w=null!=(a=null==(s=t.o)?void 0:s[e])?a:d;b.push(m(A,w,v))}return{v:y,i:p.length?p:void 0,o:b.length?b:void 0,c:null!=(f=n.c)?f:t.c}}function h(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,a=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<a;){const n=i(c);if(Math.abs(n-e)<1e-6)return c;e>n?s=c:a=c,c=(a+s)/2}return c}function g(n){const[t,e,o,r]=n,l=3*e,i=3*(r-e)-l,u=1-l-i;return function(n){return e=h(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 w(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=h(e,r,t),u=[e,o],c=[r,l],{left:s,right:a}=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),a=A(c,s,r);return{left:[n,l,c,a],right:[a,s,u,o]}}([0,0],u,c,[1,1],i),f=s[3][0],v=s[3][1];let d,m;f>1e-9&&Math.abs(v)>1e-9&&(d=[s[1][0]/f,s[1][1]/v,s[2][0]/f,s[2][1]/v]);const y=1-f,p=1-v;return y>1e-9&&Math.abs(p)>1e-9&&(m=[(a[1][0]-f)/y,(a[1][1]-v)/p,(a[2][0]-f)/y,(a[2][1]-v)/p]),{left:d,right:m}}function M(n){if(n)return[1-n[2],1-n[3],1-n[0],1-n[1]]}function k(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 j(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})})(f,{PX_ANIMATOR_DATA_KEY:()=>Yn,createAnimator:()=>Zn,setupAnimationTriggers:()=>Tn});var O=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),x=new Set(["translate","rotate","scale","skew"]),N=new Set(["offset-distance","offsetDistance"]);function S(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,a=o?"px":"",f=o?"deg":"";return l&&r.push("translate("+l[0]+a+","+l[1]+a+")"),i&&r.push("translate("+i[0]+a+","+i[1]+a+")"),null!=u&&r.push("rotate("+u+f+")"),null!=c&&r.push("skewX("+c+f+")"),s&&r.push("scale("+s[0]+","+s[1]+")"),i&&r.push("translate("+-i[0]+a+","+-i[1]+a+")"),r.join("")}var C=new Set(["offset-distance","offsetDistance"]),T=1e3;function U(n){return!n.includes("-")&&/[a-z][A-Z]/.test(n)}var z=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 F(n){return z.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,a=3*u*l,f=u*r;return[c*n[0]+s*t[0]+a*e[0]+f*o[0],c*n[1]+s*t[1]+a*e[1]+f*o[1]]}var R=1e-4;function D(n,t,e,o,r){const l=E(n,t,e,o,r);return 0===l[0]&&0===l[1]?E(n,t,e,o,r<.5?r+R:r-R):l}function E(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 L(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.timelineSource)}var q="cover";function K(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:q,e,o);return l+("number"==typeof(null==n?void 0:n.fraction)?n.fraction:t)*(i-l)}var V={auto:"auto",waapi:"waapi",frames:"frames"},W={waapi:V.waapi,frames:V.frames},Z={before:"before",after:"after"};function X(n){var t;return(null==n?void 0:n.animator)||(null==(t=null==n?void 0:n.meta)?void 0:t.animator)}function Y(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 G(n){var t,e;return null!=(e=null!=(t=n.time)?t:n.t)?e:0}function H(n){var t;return null!=(t=n.easing)?t:n.e}function $(n){var t,e,o;const r=null!=(t=n.keyframes)?t:n.kfs;if(!Array.isArray(r))return!1;if(n.autoOrient)return!0;for(const n of r)if((null!=(e=n.tangentIn)?e:n.ti)||(null!=(o=n.tangentOut)?o:n.to))return!0;return!1}var B=new WeakMap;function Q(n,t,e,o){var r,l;let i=B.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,a=[e[0]+(c?c[0]:0),e[1]+(c?c[1]:0)],f=[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 a=1;a<l;a++){const l=a/r,f=I(n,t,e,o,l),v=f[0]-c[0],d=f[1]-c[1];s+=Math.sqrt(v*v+d*d),i[a]=l,u[a]=s,c=f}return{ts:i,ds:u}}(e,a,f,o),d={P0:e,P1:a,P2:f,P3:o,m:v,h:v.ds[v.ds.length-1]};return i||(i=new WeakMap,B.set(n,i)),i.set(t,d),d}var J=.5,nn=5,tn=32;function en(n,t){var e,o,r,l;if(!$(n))return n;const i=null!=(e=n.keyframes)?e:n.kfs;if(!Array.isArray(i)||i.length<2)return n;const u=!!n.autoOrient,c=null!=(o=null==t?void 0:t.A)?o:J,s=null!=(r=null==t?void 0:t.M)?r:nn,a=null!=(l=null==t?void 0:t.j)?l:tn,f=[],v=Y(i[0]);if(!v)return n;const d=u?function(n,t){const e=Y(n),o=Y(t);if(!e||!o)return 0;const r=Q(n,t,e,o),l=D(r.P0,r.P1,r.P2,r.P3,0);return 180*Math.atan2(l[1],l[0])/Math.PI}(i[0],i[1]):void 0;f.push(on(G(i[0]),un(rn(i[0]),rn(i[0]),0,v,d,u)));for(let n=0;n<i.length-1;n++){const t=i[n],e=i[n+1],o=Y(t),r=Y(e);o&&r?(u&&n>0&&sn(f,t,e,o,r,s),fn(f,t,e,o,r,u,c,s,a)):f.push(on(G(e),un(rn(e),rn(e),1,null!=r?r:[0,0],void 0,u)))}const m=H(i[i.length-1]);m&&(f[f.length-1].e=m),u&&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 y={kfs:f};return void 0!==n.loop&&(y.loop=n.loop),y}function on(n,t){return{t:n,v:t}}function rn(n){var t;const e=null!=(t=n.value)?t:n.v;if(e&&"object"==typeof e&&!Array.isArray(e))return e}function ln(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 un(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]=ln(r,u,e))}return void 0!==r&&(i.rotate=r+cn(n,t,e)),i}function cn(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=ln(o,r,e);return"number"==typeof l?l:0}function sn(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 a=rn(t),f=s-cn(a,a,0),v=Q(t,e,o,r),d=D(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,f);if(Math.abs(y)<=l)return;const p=G(t),b=Math.min(p+an,(p+G(e))/2),h=un(rn(t),rn(t),0,o,m,!0);n.push(on(b,h))}var an=.05;function fn(n,t,e,o,r,l,i,u,c){const s=Q(t,e,o,r),a=G(t),f=G(e),v=H(t),d=(m=v)?g([m[1],m[0],m[3],m[2]]):n=>n;var m;const y=rn(t),p=rn(e),b=function(n,t,e,o,r){const l=[];vn(n.P0[0],n.P1[0],n.P2[0],n.P3[0],l),vn(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={O:r-i.length};for(let r=0;r<i.length-1;r++)dn(i[r],i[r+1],u,n,t,e,o,c);return u}(s,l,i,u,c),h=[];for(const n of b){const t=L(s.m,n),e=P(s.h>0?t/s.h:n,0,1),o={u:P(d(e),0,1),p:e,N:I(s.P0,s.P1,s.P2,s.P3,n)};if(l){const t=D(s.P0,s.P1,s.P2,s.P3,n);o.S=180*Math.atan2(t[1],t[0])/Math.PI}h.push(o)}let A=v,M=0;const k=n.length-1;for(let t=0;t<h.length;t++){const e=h[t],o=M<1?P((e.u-M)/(1-M),0,1):1,{left:r,right:i}=w(A,o),u=0===t?k:n.length-1;r?n[u].e=r:delete n[u].e;const c=a+e.u*(f-a),s=un(y,p,e.p,e.N,e.S,l);n.push(on(c,s)),A=i,M=e.u}}function vn(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 a=c*c-4*u*s;if(a<0)return;const f=Math.sqrt(a),v=(-c-f)/(2*u),d=(-c+f)/(2*u);v>1e-6&&v<.999999&&r.push(v),d>1e-6&&d<.999999&&r.push(d)}function dn(n,t,e,o,r,l,i,u){const c=(n+t)/2,s=I(o.P0,o.P1,o.P2,o.P3,n),a=I(o.P0,o.P1,o.P2,o.P3,t),f=t-n,v=I(o.P0,o.P1,o.P2,o.P3,n+.25*f),d=I(o.P0,o.P1,o.P2,o.P3,c),m=I(o.P0,o.P1,o.P2,o.P3,n+.75*f),y=Math.max(mn(v,s,a),mn(d,s,a),mn(m,s,a));let p=!0;if(r){const e=D(o.P0,o.P1,o.P2,o.P3,n),r=D(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&&(p=!1)}y<=l&&p||u.O<=0||f<1e-6?e.push(t):(u.O-=1,dn(n,c,e,o,r,l,i,u),dn(c,t,e,o,r,l,i,u))}function mn(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 yn=1;function pn(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=>pn(n[e],t[e]))}function bn(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 hn(n){return n.startsWith("path(")&&n.endsWith(")")?n.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(n)?n:void 0}function gn(n){return"string"==typeof n&&void 0!==hn(n)}function An(n){if(n&&"object"==typeof n&&"string"==typeof n.path){const t=hn(n.path);return t?{paths:bn(t)}:n}if(n&&"object"==typeof n&&"paths"in n){const t=n.paths;if(Array.isArray(t)&&t.length>0&&gn(t[0])){const n=[];for(const e of t){const t=hn(e);t&&n.push(...bn(t))}return{paths:n}}return n}if(Array.isArray(n)){if(n.length>0&&gn(n[0])){const t=[];for(const e of n){const n=hn(e);n&&t.push(...bn(n))}return{paths:t}}return{paths:n}}return gn(n)?{paths:bn(hn(n))}:n}function wn(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 Mn(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 kn(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)}:O.has(n)?y(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?d(t,e,o):x.has(n)||"stroke-dasharray"===n||"strokeDasharray"===n?m(t||[],e||[],o):d(+(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]=d(+(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]=m(o||n,i||n,e)}else r[l]=null!=i?i:o}return r}(t,e,o)}function jn(n,t,e,o){var r,l,i,u,c,f,v;const d=t.keyframes||t.kfs||[],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 a=null!=(u=t.easing)?u:t.e;"d"===n&&(s=An(s));const d=U(n)?F(n):n;O.has(d)&&(s=null!=(c=j(s))?c:s);const y={t:e,v:s,e:wn(a,o)},p=null!=(f=t.tangentIn)?f:t.ti,b=null!=(v=t.tangentOut)?v:t.to;p&&(y.tangentIn=p),b&&(y.tangentOut=b),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,p=!0===y?{}:y||void 0;return p&&m.length>=2?function(n,t,e,o){var r,l,i,u,c;const f=t.length-1,v=P(null!=(r=e.segmentCount)?r:f,1,f);let d;d=e.extend===Z.before?t.slice(0,v+1):t.slice(f-v);const m=null!=(l=t[0].t)?l:0,y=null!=(i=t[t.length-1].t)?i:0;let p,b;e.extend===Z.before?(p=0,b=m):(p=y,b=o);const h=b-p;if(h<=0)return t;const A=null!=(u=d[0].t)?u:0,k=(null!=(c=d[d.length-1].t)?c:0)-A;if(k<=0)return t;const j=d.map(n=>{var t,e;return{C:(n.t-A)/k,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/k),x=h-O*k,N=x/k,S=[],C=e.extend!==Z.before,T=t[t.length-1];let U,z=!1;function F(t,e,o){var r;let l;if(e){l=[];for(let n=j.length-1;n>=0;n--)l.push({C:1-j[n].C,v:j[n].v,e:n>0?M(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.C>i+1e-9){const r=l[e-1],u=o.C-r.C,c=(i-r.C)/u,s=r.e?g(r.e)(c):c,a=kn(n,r.v,o.v,s),{left:f}=w(r.e,c);return S.length>0&&r.C<=i&&(S[S.length-1].e=f),void S.push({t:t+i*k,v:a,e:void 0})}const u=S.length>0?S[S.length-1]:T,c=C&&0===e&&void 0!==u&&Math.abs((null!=(r=u.t)?r:0)-(t+o.C*k))<1e-9;if(c){if(pn(u.v,o.v)){S.length>0?(u.e=o.e,u.tangentOut=o.tangentOut):(U=o.e,z=!0);continue}S.length>0&&(delete u.tangentIn,delete u.tangentOut)}const s={t:t+o.C*k+(c?yn: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===Z.before){N>1e-9&&function(t,e,o){let r;if(e){r=[];for(let n=j.length-1;n>=0;n--)r.push({C:1-j[n].C,v:j[n].v,e:n>0?M(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.C<l-1e-9)continue;const i=r[e-1];if(i&&i.C<l-1e-9&&o.C>l+1e-9){const e=o.C-i.C,r=(l-i.C)/e,u=i.e?g(i.e)(r):r,c=kn(n,i.v,o.v,u),{right:s}=w(i.e,r);S.push({t:t,v:c,e:s})}const u={t:t+(o.C-l)*k,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)}}(p,!!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(p+x+n*k,o)}}else{for(let n=0;n<O;n++){const t=!!e.alternate&&n%2==0;F(p+n*k,t)}if(N>1e-9){const n=!!e.alternate&&O%2==0;F(p+O*k,n,N)}}return e.extend===Z.before?[...S,...t]:z&&t.length>0?[...t.slice(0,-1),a(s({},t[t.length-1]),{e:U}),...S]:[...t,...S]}(n,m,p,e):m}var On=0;function xn(n,t=W.waapi){const e=X(n)||{},o=function(n){var t;if(n)return null==(t=X(n))?void 0:t.definitions}(n),r=e.duration||1e3,l=[],i=(n,e)=>{if(!e)return null;const l=function(n,t){if(!n)return[];const e=[];if("string"==typeof n){const o=Mn(n,t);o&&e.push(o)}else if(Array.isArray(n))for(const o of n){const n=Mn(o,t);n&&e.push(n)}else e.push(n);return e}(e,o);if(0===l.length)return null;const i=function(n,t,e,o=W.waapi){const r={};for(const[l,i]of Object.entries(n)){if("transform"===l&&"offsetPath"===i.T&&void 0!==n.offsetDistance)continue;const u=jn(l,i,t,e);if(u.length>0){const n={kfs:u};void 0!==i.autoOrient&&(n.autoOrient=i.autoOrient),void 0!==i.loop&&(n.loop=i.loop),r[l]=o===W.waapi&&"transform"===l?en(n):n}}return r}(function(n){const t={};for(const e of n)for(const[n,o]of Object.entries(e))t[n]=o;return t}(l),r,o,t);return 0===Object.keys(i).length?null:{id:n,animate:i}},u=function(n){var t;if(!n)return;const e=null==(t=X(n))?void 0:t.animateById;return e?Object.entries(e).map(([n,t])=>({id: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_"+ ++On;n.id=e;const o=i(e,t);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 Nn(n,t,e){var o,r,l,i,u,c,s;const a=t.kfs||t.keyframes||[];if(0===a.length)return null;const{U:f,F:b}=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{U:l,F:i}}(a,e);let h=f===b?0:(A=e,w=null!=(o=f.t)?o:0,(M=null!=(r=b.t)?r:0)===w?0:0+(A-w)/(M-w)*1);var A,w,M;h=P(h,0,1);const j=null!=(l=f.e)?l:f.easing;if(j&&Array.isArray(j))try{h=g(j)(h)}catch(n){}let x=U(n)?F(n):n,C=null;const T=null!=(i=null==f?void 0:f.v)?i:null==f?void 0:f.value,z=null!=(u=null==b?void 0:b.v)?u:null==b?void 0:b.value;if("d"===x)C=p(null!=(c=null==T?void 0:T.paths)?c:Array.isArray(T)?T:[],null!=(s=null==z?void 0:z.paths)?s:Array.isArray(z)?z:[],h).map(n=>v(n)).join("");else if(O.has(x))C=k(y(T||[0,0,0,1],z||[0,0,0,1],h)),x=n;else if("stroke-dasharray"===x)C=m(T||[],z||[],h).join(" "),x=n;else if("transform"!==x||null===T||"object"!=typeof T||Array.isArray(T))"translate"===x?(C="translate("+m(T||[0,0],z||[0,0],h).join(",")+")",x="transform"):"rotate"===x?(C="rotate("+d(+(T||0),+(z||0),h)+")",x="transform"):"scale"===x?(C="scale("+m(T||[1,1],z||[1,1],h).join(",")+")",x="transform"):C=d(+(T||0),+(z||0),h);else{const n=new Set([...T?Object.keys(T):[],...z?Object.keys(z):[]]),e={};for(const t of n){const n=null==T?void 0:T[t],o=null==z?void 0:z[t];if("rotate"===t||"skew"===t)e[t]=d(+(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=m(n||r,o||r,h);e[t]=l}}if($(t)){const n=T.translate,o=z.translate;if(Array.isArray(n)&&Array.isArray(o)){const r=function(n,t,e,o,r,l){const i=Q(n,t,e,o),u=0===i.h?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,a=s>0?(e-c)/s:0;return o[u-1]+a*(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=D(i.P0,i.P1,i.P2,i.P3,u);return{translate:c,S:180*Math.atan2(s[1],s[0])/Math.PI}}(f,b,[+n[0],+n[1]],[+o[0],+o[1]],h,!!t.autoOrient);e.translate=[r.translate[0],r.translate[1]],void 0!==r.S&&(e.rotate=r.S)}}C=S(e,{l:!1}),x="transform"}return N.has(x)&&"number"==typeof C&&(C=100*C+"%"),{k:x,v:null===C?"":""+C}}function Sn(n,t){const e={};for(const[o,r]of Object.entries(n)){const n=Nn(o,r,t);n&&(e[n.k]=n.v)}return e}function Cn(n){const t=globalThis;"function"!=typeof t.cancelAnimationFrame?t.clearTimeout(n):t.cancelAnimationFrame(n)}function Tn(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 Un(n){return"#"+n}function zn(n,t,e,o){const r=X(n)||{};if(!o)if(n.id){const t=Un(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=X(n)||{},l=xn(n,W.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,a=r.direction||"normal",f=null!=(o=r.fill)?o:"forwards",v="forwards"===f||"both"===f,d="backwards"===f||"both"===f;let m=null,y=!1,p=-(r.delay||0),b=0,h=1,g=!1;const A=r.frameRate,w=A&&A>0?1e3/A:0;let M=0;const k=()=>{const n=b?(Date.now()-b)*h:0;return p+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=a||"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=Sn(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&&(Cn(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.P)||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.P)||o.call(e)));if(w>0){const n=Date.now();if(M&&n-M<w)return;M=n}O(r)}})(),N()}))},S=()=>{if(!y)return;let n=k();Number.isFinite(s)&&n>s&&(n=s),p=n,b=0,y=!1,null!==m&&(Cn(m),m=null),n>=0?O(n):d&&O(0)},C={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>x(),play:()=>{var n;(()=>{if(!y){if(h>=0)Number.isFinite(s)&&p>=s&&(p=0);else if(p<=0){if(!Number.isFinite(s))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");p=s}g=!1,y=!0,b=Date.now(),N(!0)}})(),null==(n=null==e?void 0:e.I)||n.call(e)},pause:()=>{var n;S(),null==(n=null==e?void 0:e.R)||n.call(e)},cancel:()=>{var n;S(),p=0,b=0,y=!1,g=!1,O(p),null==(n=null==e?void 0:e.D)||n.call(e)},finish:()=>{((n=!0)=>{var t;p=Number.isFinite(s)?s:j(),b=0,y=!1,null!==m&&(Cn(m),m=null),O(v?p:0),n&&!g&&(g=!0,null==(t=null==e?void 0:e.P)||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,p=t,y&&(b=Date.now())},getCurrentTime:()=>j(),setCurrentTime:n=>{n<0&&(n=0),Number.isFinite(s)&&n>s&&(n=s),p=n,y&&(b=Date.now()),(!Number.isFinite(s)||n<s)&&(g=!1),O(j())},destroy:()=>{var n;C.cancel(),null==(n=null==e?void 0:e.L)||n.call(e)}};return C}(n,t||function(n){const t=new Set;return{isConnected:()=>!n||n.isConnected,setAttribute:(e,o,r)=>{o=F(o);const l=Un(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=a(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)"):Tn(i,r.trigger)),i}function Fn(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,a=e;var f;return O.has(e)&&Array.isArray(i)?s=k(i):"transform"!==e||null===i||"object"!=typeof i||Array.isArray(i)?x.has(e)?(Array.isArray(i)&&("translate"===e&&(i=i.map(n=>n+"px")),i=i.join(",")),"rotate"===e&&(i+="deg"),s=e+"("+i+")",a="transform"):s="d"===e?'path("'+(i&&"object"==typeof i&&Array.isArray(i.paths)?i.paths:[]).map(n=>v(n,!0)).join("")+'")':N.has(e)&&"number"==typeof i?100*i+"%":""+i:(s=S(i,{l:!0}),a="transform"),CSS.supports(F(a),s)||o.add(a),a=(f=a).includes("-")?f.replace(/-([a-z])/g,(n,t)=>t.toUpperCase()):f,c[a]=s,c}function Pn(n,t,e){var o,r,l,i,u;const c=[];for(let f=0;f<t.length;f++){const v=t[f],d=null!=(o=v.t)?o:0;if(d<0){const e=t[f+1];if(e&&(null!=(r=e.t)?r:0)>=0){const t=(0-d)/((null!=(l=e.t)?l:0)-d),o=v.e?g(v.e)(t):t,{right:r}=w(v.e,t);c.push({t:0,v:kn(n,v.v,e.v,o),e:r})}continue}if(d>e){const o=t[f-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?g(o.e)(r):r,{left:i}=w(o.e,r);c.length>0&&(c[c.length-1]=a(s({},c[c.length-1]),{e:i})),c.push({t:e,v:kn(n,o.v,v.v,l),e:void 0})}break}c.push(v)}return c}function In(n,t,e){var o;const r=new Map;for(const[l,i]of Object.entries(n)){const n=e.duration||1,u=Pn(l,i.kfs||i.keyframes||[],n),c=[];for(let e=0;e<u.length;e++){const r=u[e],i=Fn(r,P((null!=(o=r.t)?o:0)/n,0,1),l,t);0===e&&(i.offset||0)>0&&c.push(a(s({},i),{offset:0})),c.push(i)}c.length>0&&(c[c.length-1].offset||0)<1&&c.push(a(s({},c[c.length-1]),{offset:1})),c.length>0&&r.set(l,c)}return r}function Rn(n,t,e,o,r){var l;const i=X(n)||{};if(!e)if(n.id){const t=Un(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=xn(n,W.waapi),c=[],s=i.iterations;let a;"number"==typeof s&&(a=s),"infinite"===s&&(a=1/0);const f=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=Un(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=In(o,f,i),y=i.delay&&i.delay>0?i.delay:void 0;let p;if(i.delay&&i.delay<0&&i.duration){const n=-i.delay;p=a===1/0?n%i.duration:Math.min(n,i.duration*(null!=a?a:1))}const b={duration:i.duration,delay:y,fill:null!=(l=i.fill)?l:"forwards",direction:i.direction,iterations:a};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,b),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.P)&&(l.onfinish=()=>{var n;v||(v=!0,null==(n=t.P)||n.call(t))}),(null==t?void 0:t.L)&&(l.onremove=()=>{var n;d||(d=!0,null==(n=t.L)||n.call(t))}),void 0!==p&&(l.currentTime=p),c.push(l)}catch(n){console.warn(n)}}}if(!o&&f.size)return console.warn("Unsupported CSS attrs: "+[...f].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.I)||n.call(t)},pause:()=>{var n;c.forEach(n=>n.pause()),null==(n=null==t?void 0:t.R)||n.call(t)},cancel:()=>{var n;v=!1,c.forEach(n=>n.cancel()),null==(n=null==t?void 0:t.D)||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.L)||n.call(t))}};return i.trigger&&("scroll"===i.timelineSource?console.warn("scroll timeline: `animator.trigger` is ignored (triggers do not apply to scroll-driven playback)"):Tn(m,i.trigger)),r&&c.forEach(n=>n.play()),m}function Dn(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?{_:null!=(l=null==n?void 0:n.phase)?l:"cover",offset:u}:{offset:u}}function En(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 Ln(){return document.scrollingElement||document.documentElement}var _n="parent",qn="scroller";function Kn(n,t){var e,o;const r=null==t?void 0:t.trim();if(!r)return n;if(r===_n){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 En(n,"y")||En(n,"x")||Ln();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){var e;const o=n;if(!(null==t?void 0:t.pin)||!o.style)return()=>{};const r=o.style,l=r.position,i=r.top;r.position="sticky",r.top=(null!=(e=t.pinTop)?e:0)+"px";let u=null;const c=n.parentElement;return t.pinDistance&&t.pinDistance>0&&c&&(u=document.createElement("div"),u.setAttribute("data-px-pin",""),u.style.height=100*t.pinDistance+"vh",c.insertBefore(u,n),u.appendChild(n)),()=>{r.position=l,r.top=i,(null==u?void 0:u.parentElement)&&(u.parentElement.insertBefore(n,u),u.remove())}}function Wn(n,t,e){let o,r=t;n.resetOnFinish&&(r=a(s({},t),{P:()=>{var n;null==(n=null==t?void 0:t.P)||n.call(t),null==o||o.cancel()}}));const l=e(r);return o=l,n.debugInstName&&(window[n.debugInstName]=l),l}function Zn(n){return function(n,t,e,o){const r=X(n)||{};return _(r)?Wn(r,e,e=>{var l,i;let u=()=>{};if(r.mode!==V.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,a=s?c.ViewTimeline:c.ScrollTimeline;if("function"!=typeof a)return null;const f=null!=(o=i.axis)?o:"block";let v;try{v=new a(s?{subject:Kn(n,i.subject),axis:f}:{source:"root"===i.source?Ln():En(n,"y")||En(n,"x")||Ln(),axis:f})}catch(n){return console.warn("scroll timeline: native timeline construction failed — falling back to the custom driver",n),null}return{timeline:v,rangeStart:Dn(null==(r=i.range)?void 0:r.start,0,s),rangeEnd:Dn(null==(l=i.range)?void 0:l.end,1,s)}}(o,r);if(t){const l=Rn(n,e,o,r.mode===V.waapi,t);if(l){const n=l.destroy.bind(l);return l.destroy=()=>{u(),n()},l}}u(),u=()=>{}}const c=(r.mode!==V.frames?Rn(n,e,o,r.mode===V.waapi):null)||zn(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==(a=r)?void 0:a.duration)&&a.duration>0?a.duration:T)*("number"==typeof(null==a?void 0:a.iterations)&&a.iterations>0?a.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=En(n,"y")||En(n,"x"),s="scroll"===i&&"root"===l.source?Ln():c||Ln(),a=s===Ln(),f=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"===f?s.scrollTop:s.scrollLeft,"y"===f?s.scrollHeight-s.clientHeight:s.scrollWidth-s.clientWidth,l.range);const n=u.getBoundingClientRect();let t,e;if(a)t=0,e="y"===f?document.documentElement.clientHeight:document.documentElement.clientWidth;else{const n=s.getBoundingClientRect();t="y"===f?n.top:n.left,e="y"===f?s.clientHeight:s.clientWidth}return function(n,t,e,o){const r=e-n,l=K(null==o?void 0:o.start,0,t,e),i=K(null==o?void 0:o.end,1,t,e);return i<=l?r>=i?1:0:P((r-l)/(i-l),0,1)}(("y"===f?n.top:n.left)-t,"y"===f?n.height:n.width,e,l.range)},d=Math.max(0,null!=(r=l.smoothing)?r:0)/1e3;let m=!1,y=null,p=null,b=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!==p)return;b=0;const t=n=>{if(p=null,m)return;const o=b?Math.min(.1,(n-b)/1e3):1/60;b=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&&(p=requestAnimationFrame(t))};p=requestAnimationFrame(t)})(v())},A=()=>{m||null!==h||(h=requestAnimationFrame(g))},w=a?window:s;let M;w.addEventListener("scroll",A,{passive:!0}),window.addEventListener("resize",A,{passive:!0}),"undefined"!=typeof ResizeObserver&&(M=new ResizeObserver(A),M.observe(u),u!==n&&M.observe(n),a||M.observe(s));const k={destroy:()=>{m||(m=!0,w.removeEventListener("scroll",A),window.removeEventListener("resize",A),null==M||M.disconnect(),null!==h&&(cancelAnimationFrame(h),h=null),null!==p&&(cancelAnimationFrame(p),p=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 a;return c}):Wn(r,e,e=>r.mode===V.frames?zn(n,t,e,o):Rn(n,e,o,r.mode===V.waapi)||zn(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 Xn,Yn="data";return Xn=f,((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}),Xn)})();
package/dist/index.umd.js CHANGED
@@ -1198,6 +1198,12 @@ var PixodeskAnimator = (() => {
1198
1198
  kind: px.enum(["view", "scroll"]).optional(),
1199
1199
  axis: px.enum(["block", "inline", "x", "y"]).optional(),
1200
1200
  source: px.enum(["nearest", "root"]).optional(),
1201
+ // Free-form: the two keywords `parent`/`scroller` plus any CSS selector.
1202
+ subject: px.string().optional(),
1203
+ smoothing: px.number().optional(),
1204
+ pin: px.boolean().optional(),
1205
+ pinTop: px.number().optional(),
1206
+ pinDistance: px.number().optional(),
1201
1207
  range: PxScrollRangeSchema.optional()
1202
1208
  }));
1203
1209
  var PxAnimatorConfigSchema = implementsInterface()(px.object({
@@ -6122,6 +6128,10 @@ var PixodeskAnimator = (() => {
6122
6128
  if (!config || !isScrollTimeline(config)) return null;
6123
6129
  const scroll = config.scroll || {};
6124
6130
  const kind = (_a = scroll.kind) != null ? _a : "view";
6131
+ if (scroll.smoothing) {
6132
+ console.warn('scroll timeline: `smoothing` needs the built-in driver \u2014 ignoring `driver: "native"`');
6133
+ return null;
6134
+ }
6125
6135
  const g = globalThis;
6126
6136
  const view = kind === "view";
6127
6137
  const Ctor = view ? g.ViewTimeline : g.ScrollTimeline;
@@ -6130,7 +6140,7 @@ var PixodeskAnimator = (() => {
6130
6140
  let timeline;
6131
6141
  try {
6132
6142
  if (view) {
6133
- timeline = new Ctor({ subject, axis });
6143
+ timeline = new Ctor({ subject: resolveScrollSubject(subject, scroll.subject), axis });
6134
6144
  } else {
6135
6145
  const source = scroll.source === "root" ? documentScroller() : findNearestScroller(subject, "y") || findNearestScroller(subject, "x") || documentScroller();
6136
6146
  timeline = new Ctor({ source, axis });
@@ -6146,7 +6156,10 @@ var PixodeskAnimator = (() => {
6146
6156
  };
6147
6157
  }
6148
6158
  function findNearestScroller(el, axis) {
6159
+ const body = document.body;
6160
+ const root = document.documentElement;
6149
6161
  for (let p = el.parentElement; p; p = p.parentElement) {
6162
+ if (p === body || p === root) return null;
6150
6163
  const style = getComputedStyle(p);
6151
6164
  const overflow = axis === "y" ? style.overflowY : style.overflowX;
6152
6165
  if (overflow === "auto" || overflow === "scroll" || overflow === "hidden" || overflow === "overlay") {
@@ -6158,11 +6171,42 @@ var PixodeskAnimator = (() => {
6158
6171
  function documentScroller() {
6159
6172
  return document.scrollingElement || document.documentElement;
6160
6173
  }
6174
+ var SUBJECT_PARENT = "parent";
6175
+ var SUBJECT_SCROLLER = "scroller";
6176
+ function resolveScrollSubject(svgRoot, subject) {
6177
+ var _a, _b;
6178
+ const spec = subject == null ? void 0 : subject.trim();
6179
+ if (!spec) return svgRoot;
6180
+ if (spec === SUBJECT_PARENT) {
6181
+ let outermostPinned = null;
6182
+ for (let p = svgRoot.parentElement; p && p !== document.body; p = p.parentElement) {
6183
+ const position = getComputedStyle(p).position;
6184
+ if (position === "sticky" || position === "fixed") outermostPinned = p;
6185
+ }
6186
+ return (_b = (_a = outermostPinned == null ? void 0 : outermostPinned.parentElement) != null ? _a : svgRoot.parentElement) != null ? _b : svgRoot;
6187
+ }
6188
+ if (spec === SUBJECT_SCROLLER) {
6189
+ return findNearestScroller(svgRoot, "y") || findNearestScroller(svgRoot, "x") || documentScroller();
6190
+ }
6191
+ let found = null;
6192
+ try {
6193
+ found = document.querySelector(spec);
6194
+ } catch (e) {
6195
+ console.warn('scroll timeline: subject "' + spec + '" is not a valid selector \u2014 measuring the SVG itself');
6196
+ return svgRoot;
6197
+ }
6198
+ if (!found) {
6199
+ console.warn('scroll timeline: subject "' + spec + '" matched no element \u2014 measuring the SVG itself');
6200
+ return svgRoot;
6201
+ }
6202
+ return found;
6203
+ }
6161
6204
  function createScrollDriver(subject, config, onProgress) {
6162
- var _a;
6205
+ var _a, _b;
6163
6206
  if (!config || !isScrollTimeline(config)) return null;
6164
6207
  const scroll = config.scroll || {};
6165
6208
  const kind = (_a = scroll.kind) != null ? _a : "view";
6209
+ const measured = resolveScrollSubject(subject, scroll.subject);
6166
6210
  const nearest = findNearestScroller(subject, "y") || findNearestScroller(subject, "x");
6167
6211
  const scroller = kind === "scroll" && scroll.source === "root" ? documentScroller() : nearest || documentScroller();
6168
6212
  const isRootScroller = scroller === documentScroller();
@@ -6173,7 +6217,7 @@ var PixodeskAnimator = (() => {
6173
6217
  const maxOffset = axis === "y" ? scroller.scrollHeight - scroller.clientHeight : scroller.scrollWidth - scroller.clientWidth;
6174
6218
  return scrollOffsetProgress(offset, maxOffset, scroll.range);
6175
6219
  }
6176
- const subjectRect = subject.getBoundingClientRect();
6220
+ const subjectRect = measured.getBoundingClientRect();
6177
6221
  let portStart, portSize;
6178
6222
  if (isRootScroller) {
6179
6223
  portStart = 0;
@@ -6187,12 +6231,43 @@ var PixodeskAnimator = (() => {
6187
6231
  const subjectSize = axis === "y" ? subjectRect.height : subjectRect.width;
6188
6232
  return scrollViewProgress(subjectStart, subjectSize, portSize, scroll.range);
6189
6233
  };
6190
- let rafId = null;
6234
+ const smoothingSec = Math.max(0, (_b = scroll.smoothing) != null ? _b : 0) / 1e3;
6235
+ const SETTLE_EPSILON = 1e-3;
6191
6236
  let destroyed = false;
6237
+ let smoothed = null;
6238
+ let smoothRaf = null;
6239
+ let lastFrameMs = 0;
6240
+ const emit = (target) => {
6241
+ if (!smoothingSec) {
6242
+ onProgress(target);
6243
+ return;
6244
+ }
6245
+ if (smoothed === null) {
6246
+ smoothed = target;
6247
+ onProgress(target);
6248
+ return;
6249
+ }
6250
+ if (smoothRaf !== null) return;
6251
+ lastFrameMs = 0;
6252
+ const step = (nowMs) => {
6253
+ smoothRaf = null;
6254
+ if (destroyed) return;
6255
+ const dtSec = lastFrameMs ? Math.min(0.1, (nowMs - lastFrameMs) / 1e3) : 1 / 60;
6256
+ lastFrameMs = nowMs;
6257
+ const goal = compute();
6258
+ const k = 1 - Math.exp(-dtSec / smoothingSec);
6259
+ smoothed = smoothed + (goal - smoothed) * k;
6260
+ if (Math.abs(goal - smoothed) < SETTLE_EPSILON) smoothed = goal;
6261
+ onProgress(smoothed);
6262
+ if (smoothed !== goal) smoothRaf = requestAnimationFrame(step);
6263
+ };
6264
+ smoothRaf = requestAnimationFrame(step);
6265
+ };
6266
+ let rafId = null;
6192
6267
  const tick = () => {
6193
6268
  rafId = null;
6194
6269
  if (destroyed) return;
6195
- onProgress(compute());
6270
+ emit(compute());
6196
6271
  };
6197
6272
  const schedule = () => {
6198
6273
  if (destroyed || rafId !== null) return;
@@ -6204,7 +6279,8 @@ var PixodeskAnimator = (() => {
6204
6279
  let resizeObserver;
6205
6280
  if (typeof ResizeObserver !== "undefined") {
6206
6281
  resizeObserver = new ResizeObserver(schedule);
6207
- resizeObserver.observe(subject);
6282
+ resizeObserver.observe(measured);
6283
+ if (measured !== subject) resizeObserver.observe(subject);
6208
6284
  if (!isRootScroller) resizeObserver.observe(scroller);
6209
6285
  }
6210
6286
  const driver = {
@@ -6218,14 +6294,50 @@ var PixodeskAnimator = (() => {
6218
6294
  cancelAnimationFrame(rafId);
6219
6295
  rafId = null;
6220
6296
  }
6297
+ if (smoothRaf !== null) {
6298
+ cancelAnimationFrame(smoothRaf);
6299
+ smoothRaf = null;
6300
+ }
6221
6301
  },
6302
+ // `refresh` is a deliberate JUMP (attach, host relayout) — never eased.
6222
6303
  refresh: () => {
6223
- if (!destroyed) onProgress(compute());
6304
+ if (!destroyed) {
6305
+ smoothed = compute();
6306
+ onProgress(smoothed);
6307
+ }
6224
6308
  }
6225
6309
  };
6226
6310
  driver.refresh();
6227
6311
  return driver;
6228
6312
  }
6313
+ function applyScrollPin(svgRoot, scroll) {
6314
+ var _a;
6315
+ const styled = svgRoot;
6316
+ if (!(scroll == null ? void 0 : scroll.pin) || !styled.style) return () => {
6317
+ };
6318
+ const style = styled.style;
6319
+ const prevPosition = style.position;
6320
+ const prevTop = style.top;
6321
+ style.position = "sticky";
6322
+ style.top = ((_a = scroll.pinTop) != null ? _a : 0) + "px";
6323
+ let wrapper = null;
6324
+ const parent = svgRoot.parentElement;
6325
+ if (scroll.pinDistance && scroll.pinDistance > 0 && parent) {
6326
+ wrapper = document.createElement("div");
6327
+ wrapper.setAttribute("data-px-pin", "");
6328
+ wrapper.style.height = scroll.pinDistance * 100 + "vh";
6329
+ parent.insertBefore(wrapper, svgRoot);
6330
+ wrapper.appendChild(svgRoot);
6331
+ }
6332
+ return () => {
6333
+ style.position = prevPosition;
6334
+ style.top = prevTop;
6335
+ if (wrapper == null ? void 0 : wrapper.parentElement) {
6336
+ wrapper.parentElement.insertBefore(svgRoot, wrapper);
6337
+ wrapper.remove();
6338
+ }
6339
+ };
6340
+ }
6229
6341
 
6230
6342
  // src/PxAnimatorBind.ts
6231
6343
  function finaliseAnimator(animatorConfig, callbacks, make) {
@@ -6252,7 +6364,10 @@ var PixodeskAnimator = (() => {
6252
6364
  if (isScrollTimeline(animatorConfig)) {
6253
6365
  return finaliseAnimator(animatorConfig, callbacks, (cb) => {
6254
6366
  var _a, _b;
6367
+ let unpin = () => {
6368
+ };
6255
6369
  if (animatorConfig.mode !== PxAnimatorMode.frames && ((_a = animatorConfig.scroll) == null ? void 0 : _a.driver) === "native" && rootElement) {
6370
+ unpin = applyScrollPin(rootElement, animatorConfig.scroll);
6256
6371
  const native = createNativeScrollTimeline(rootElement, animatorConfig);
6257
6372
  if (native) {
6258
6373
  const api2 = createWebApiAnimator(
@@ -6262,12 +6377,23 @@ var PixodeskAnimator = (() => {
6262
6377
  animatorConfig.mode === PxAnimatorMode.waapi,
6263
6378
  native
6264
6379
  );
6265
- if (api2) return api2;
6380
+ if (api2) {
6381
+ const destroyNative = api2.destroy.bind(api2);
6382
+ api2.destroy = () => {
6383
+ unpin();
6384
+ destroyNative();
6385
+ };
6386
+ return api2;
6387
+ }
6266
6388
  }
6389
+ unpin();
6390
+ unpin = () => {
6391
+ };
6267
6392
  }
6268
6393
  const api = (animatorConfig.mode !== PxAnimatorMode.frames ? createWebApiAnimator(doc, cb, rootElement, animatorConfig.mode === PxAnimatorMode.waapi) : null) || createFrameLoopAnimator(doc, adapter, cb, rootElement);
6269
6394
  const subject = ((_b = api.getRootElement) == null ? void 0 : _b.call(api)) || rootElement;
6270
6395
  if (subject) {
6396
+ unpin = applyScrollPin(subject, animatorConfig.scroll);
6271
6397
  const totalMs = scrollTotalDurationMs(animatorConfig);
6272
6398
  const driver = createScrollDriver(
6273
6399
  subject,
@@ -6278,6 +6404,7 @@ var PixodeskAnimator = (() => {
6278
6404
  const destroy = api.destroy.bind(api);
6279
6405
  api.destroy = () => {
6280
6406
  driver.destroy();
6407
+ unpin();
6281
6408
  destroy();
6282
6409
  };
6283
6410
  }