@pixodesk/svg-animator-web 1.0.27 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +227 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +226 -18
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.prerendered-waapi.umd.js.map +1 -1
- package/dist/index.prerendered.umd.js +155 -8
- package/dist/index.prerendered.umd.js.map +1 -1
- package/dist/index.prerendered.umd.min.js +1 -1
- package/dist/index.umd.js +225 -18
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/package.json +2 -2
|
@@ -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 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:()=>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 z(n){return!n.includes("-")&&/[a-z][A-Z]/.test(n)}var U=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 U.has(n)?n:n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function R(n,t,e){return Math.max(t,Math.min(n,e))}function P(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 I=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+I:r-I):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=P(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=P(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=R(s.h>0?t/s.h:n,0,1),o={u:R(d(e),0,1),p:e,N:P(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 w=v,M=0;const k=n.length-1;for(let t=0;t<h.length;t++){const e=h[t],o=M<1?R((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.S,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=P(o.P0,o.P1,o.P2,o.P3,n),a=P(o.P0,o.P1,o.P2,o.P3,t),f=t-n,v=P(o.P0,o.P1,o.P2,o.P3,n+.25*f),d=P(o.P0,o.P1,o.P2,o.P3,c),m=P(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 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):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=wn(s));const d=z(n)?F(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=R(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 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),x=h-O*k,N=x/k,S=[],C=e.extend!==Z.before,T=t[t.length-1];let z,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({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 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):(z=o.e,U=!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}=A(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]:U&&t.length>0?[...t.slice(0,-1),a(s({},t[t.length-1]),{e:z}),...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:(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=R(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=z(n)?F(n):n,C=null;const T=null!=(i=null==f?void 0:f.v)?i:null==f?void 0:f.value,U=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==U?void 0:U.paths)?s:Array.isArray(U)?U:[],h).map(n=>v(n)).join("");else if(O.has(x))C=k(y(T||[0,0,0,1],U||[0,0,0,1],h)),x=n;else if("stroke-dasharray"===x)C=m(T||[],U||[],h).join(" "),x=n;else if("transform"!==x||null===T||"object"!=typeof T||Array.isArray(T))"translate"===x?(C="translate("+m(T||[0,0],U||[0,0],h).join(",")+")",x="transform"):"rotate"===x?(C="rotate("+d(+(T||0),+(U||0),h)+")",x="transform"):"scale"===x?(C="scale("+m(T||[1,1],U||[1,1],h).join(",")+")",x="transform"):C=d(+(T||0),+(U||0),h);else{const n=new Set([...T?Object.keys(T):[],...U?Object.keys(U):[]]),e={};for(const t of n){const n=null==T?void 0:T[t],o=null==U?void 0:U[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=U.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=P(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 zn(n){return"#"+n}function Un(n,t,e,o){const r=X(n)||{};if(!o)if(n.id){const t=zn(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 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=R(n,0,u*t),o=Math.max(0,Math.ceil(n/t)-1),o=Math.min(o,u-1),e=R((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.R)||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.R)||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),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.P)||n.call(e)},pause:()=>{var n;S(),null==(n=null==e?void 0:e.I)||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.R)||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=zn(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 Rn(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 Pn(n,t,e){var o;const r=new Map;for(const[l,i]of Object.entries(n)){const n=e.duration||1,u=Rn(l,i.kfs||i.keyframes||[],n),c=[];for(let e=0;e<u.length;e++){const r=u[e],i=Fn(r,R((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 In(n,t,e,o,r){var l;const i=X(n)||{};if(!e)if(n.id){const t=zn(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=zn(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=Pn(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.R)&&(l.onfinish=()=>{var n;v||(v=!0,null==(n=t.R)||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.P)||n.call(t)},pause:()=>{var n;c.forEach(n=>n.pause()),null==(n=null==t?void 0:t.I)||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){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=En(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 a=null;const f=n.parentElement;return t.pinDistance&&t.pinDistance>0&&f&&(a=document.createElement("div"),a.setAttribute("data-px-pin",""),a.style.height=100*t.pinDistance+"vh",f.insertBefore(a,n),a.appendChild(n)),()=>{s&&window.removeEventListener("resize",s),null==c||c.disconnect(),o.position=r,o.top=l,(null==a?void 0:a.parentElement)&&(a.parentElement.insertBefore(n,a),a.remove())}}function Wn(n,t,e){let o,r=t;n.resetOnFinish&&(r=a(s({},t),{R:()=>{var n;null==(n=null==t?void 0:t.R)||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=In(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?In(n,e,o,r.mode===V.waapi):null)||Un(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?R(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:R((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:R((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())},w=()=>{m||null!==h||(h=requestAnimationFrame(g))},A=a?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),a||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!==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?Un(n,t,e,o):In(n,e,o,r.mode===V.waapi)||Un(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,13 @@ 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
|
+
pinAlign: px.enum(["top", "center", "bottom"]).optional(),
|
|
1206
|
+
pinTop: px.number().optional(),
|
|
1207
|
+
pinDistance: px.number().optional(),
|
|
1201
1208
|
range: PxScrollRangeSchema.optional()
|
|
1202
1209
|
}));
|
|
1203
1210
|
var PxAnimatorConfigSchema = implementsInterface()(px.object({
|
|
@@ -4465,6 +4472,19 @@ var PixodeskAnimator = (() => {
|
|
|
4465
4472
|
TEXT_CONTENT_ATTR,
|
|
4466
4473
|
"xml:space"
|
|
4467
4474
|
];
|
|
4475
|
+
var PAINT_STATIC_KEYS = [
|
|
4476
|
+
"fillOpacity",
|
|
4477
|
+
"fillRule",
|
|
4478
|
+
"strokeOpacity",
|
|
4479
|
+
"strokeDasharray",
|
|
4480
|
+
"strokeDashoffset",
|
|
4481
|
+
"strokeLinecap",
|
|
4482
|
+
"strokeLinejoin",
|
|
4483
|
+
"strokeMiterlimit",
|
|
4484
|
+
"mixBlendMode",
|
|
4485
|
+
"filter"
|
|
4486
|
+
];
|
|
4487
|
+
var PAINT_ANIMATE_KEYS = ["fill", "stroke", "strokeWidth", "opacity", "fillOpacity", "strokeOpacity", "strokeDasharray", "strokeDashoffset"];
|
|
4468
4488
|
function parseLen(v) {
|
|
4469
4489
|
if (typeof v === "number") return v;
|
|
4470
4490
|
if (typeof v === "string") {
|
|
@@ -4476,17 +4496,39 @@ var PixodeskAnimator = (() => {
|
|
|
4476
4496
|
function str(v) {
|
|
4477
4497
|
return typeof v === "string" ? v : void 0;
|
|
4478
4498
|
}
|
|
4499
|
+
function paintAnimateOf(node) {
|
|
4500
|
+
const bag = node.animate;
|
|
4501
|
+
if (!bag || typeof bag !== "object") return void 0;
|
|
4502
|
+
let out;
|
|
4503
|
+
for (const k of PAINT_ANIMATE_KEYS) {
|
|
4504
|
+
if (bag[k] !== void 0) (out != null ? out : out = {})[k] = bag[k];
|
|
4505
|
+
}
|
|
4506
|
+
return out;
|
|
4507
|
+
}
|
|
4479
4508
|
function resolveStyle2(node, parent) {
|
|
4480
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
4481
|
-
|
|
4509
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
4510
|
+
const isTextRoot = node.type === "text";
|
|
4511
|
+
const nodeStyle = node.style;
|
|
4512
|
+
const own = (key) => {
|
|
4513
|
+
var _a2;
|
|
4514
|
+
return isTextRoot ? void 0 : (_a2 = node[key]) != null ? _a2 : nodeStyle == null ? void 0 : nodeStyle[key];
|
|
4515
|
+
};
|
|
4516
|
+
const res = {
|
|
4482
4517
|
fontFamily: (_a = str(node.fontFamily)) != null ? _a : parent.fontFamily,
|
|
4483
4518
|
fontSize: (_b = parseLen(node.fontSize)) != null ? _b : parent.fontSize,
|
|
4484
4519
|
fill: (_c = node.fill) != null ? _c : parent.fill,
|
|
4485
4520
|
stroke: (_d = node.stroke) != null ? _d : parent.stroke,
|
|
4486
4521
|
strokeWidth: (_e = node.strokeWidth) != null ? _e : parent.strokeWidth,
|
|
4487
4522
|
letterSpacing: (_f = parseLen(node.letterSpacing)) != null ? _f : parent.letterSpacing,
|
|
4488
|
-
wordSpacing: (_g = parseLen(node.wordSpacing)) != null ? _g : parent.wordSpacing
|
|
4523
|
+
wordSpacing: (_g = parseLen(node.wordSpacing)) != null ? _g : parent.wordSpacing,
|
|
4524
|
+
opacity: (_h = parseLen(own("opacity"))) != null ? _h : parent.opacity,
|
|
4525
|
+
animate: (_i = isTextRoot ? void 0 : paintAnimateOf(node)) != null ? _i : parent.animate
|
|
4489
4526
|
};
|
|
4527
|
+
for (const key of PAINT_STATIC_KEYS) {
|
|
4528
|
+
const v = (_j = own(key)) != null ? _j : parent[key];
|
|
4529
|
+
if (v !== void 0) res[key] = v;
|
|
4530
|
+
}
|
|
4531
|
+
return res;
|
|
4490
4532
|
}
|
|
4491
4533
|
function rootStyleOf(node) {
|
|
4492
4534
|
var _a, _b, _c;
|
|
@@ -4505,6 +4547,11 @@ var PixodeskAnimator = (() => {
|
|
|
4505
4547
|
if (s.fill !== void 0) p.fill = s.fill;
|
|
4506
4548
|
if (s.stroke !== void 0) p.stroke = s.stroke;
|
|
4507
4549
|
if (s.strokeWidth !== void 0) p.strokeWidth = s.strokeWidth;
|
|
4550
|
+
if (s.opacity !== void 0 && s.opacity !== 1) p.opacity = s.opacity;
|
|
4551
|
+
for (const key of PAINT_STATIC_KEYS) {
|
|
4552
|
+
if (s[key] !== void 0) p[key] = s[key];
|
|
4553
|
+
}
|
|
4554
|
+
if (s.animate !== void 0) p.animate = s.animate;
|
|
4508
4555
|
return p;
|
|
4509
4556
|
}
|
|
4510
4557
|
function glyphFontFor(s, glyphs, soleFont, warnings) {
|
|
@@ -4518,6 +4565,7 @@ var PixodeskAnimator = (() => {
|
|
|
4518
4565
|
return names.length === 1 ? glyphs[names[0]] : void 0;
|
|
4519
4566
|
}
|
|
4520
4567
|
var MISSING_GLYPH_ADVANCE_EM = 0.6;
|
|
4568
|
+
var MISSING_GLYPH_CLASS_NAME = "px-missing-glyph";
|
|
4521
4569
|
function missingGlyphBoxEm(advanceEm, ascentEm) {
|
|
4522
4570
|
if (advanceEm <= 0 || ascentEm <= 0) return "";
|
|
4523
4571
|
const inset = 0.08;
|
|
@@ -4553,7 +4601,7 @@ var PixodeskAnimator = (() => {
|
|
|
4553
4601
|
pen.x += g.width * scale;
|
|
4554
4602
|
} else if (/\S/.test(ch)) {
|
|
4555
4603
|
const advEm = g && g.width > 0 ? g.width : MISSING_GLYPH_ADVANCE_EM * upm;
|
|
4556
|
-
placements.push({ glyphD: missingGlyphBoxEm(advEm, ascentEm), m: [scale, 0, 0, scale, pen.x, pen.y], paint, line, x: pen.x, y: pen.y, scale });
|
|
4604
|
+
placements.push({ glyphD: missingGlyphBoxEm(advEm, ascentEm), m: [scale, 0, 0, scale, pen.x, pen.y], paint, isMissing: true, line, x: pen.x, y: pen.y, scale });
|
|
4557
4605
|
pen.x += advEm * scale;
|
|
4558
4606
|
} else {
|
|
4559
4607
|
pen.x += (g ? g.width : 0) * scale;
|
|
@@ -4616,7 +4664,7 @@ var PixodeskAnimator = (() => {
|
|
|
4616
4664
|
} else if (/\S/.test(ch)) {
|
|
4617
4665
|
const wEm = g && g.width > 0 ? g.width : MISSING_GLYPH_ADVANCE_EM * gf.unitsPerEm;
|
|
4618
4666
|
const boxAdv = wEm * scale;
|
|
4619
|
-
cells.push({ glyphD: missingGlyphBoxEm(wEm, ascentEm), widthEm: wEm, scale, paint, midBase: adv + boxAdv / 2 });
|
|
4667
|
+
cells.push({ glyphD: missingGlyphBoxEm(wEm, ascentEm), widthEm: wEm, scale, paint, isMissing: true, midBase: adv + boxAdv / 2 });
|
|
4620
4668
|
adv += boxAdv;
|
|
4621
4669
|
} else {
|
|
4622
4670
|
adv += (g ? g.width : 0) * scale;
|
|
@@ -4672,6 +4720,7 @@ var PixodeskAnimator = (() => {
|
|
|
4672
4720
|
const placements = placeCells.map((c) => ({
|
|
4673
4721
|
glyphD: c.glyphD,
|
|
4674
4722
|
paint: c.paint,
|
|
4723
|
+
isMissing: c.isMissing,
|
|
4675
4724
|
m: alongAffine(sampler, base + c.midBase * k, c.scale, c.widthEm, perp)
|
|
4676
4725
|
}));
|
|
4677
4726
|
return toGroup(node, buildPaths(placements, create, warnings), create);
|
|
@@ -4754,12 +4803,13 @@ var PixodeskAnimator = (() => {
|
|
|
4754
4803
|
const transform = { keyframes: kfs };
|
|
4755
4804
|
if (loop !== void 0) transform.loop = loop;
|
|
4756
4805
|
const animate = { transform };
|
|
4806
|
+
if (c.paint.animate) Object.assign(animate, c.paint.animate);
|
|
4757
4807
|
if (isClip && opKfs.some((k) => k.value === 0)) {
|
|
4758
4808
|
const op = { keyframes: opKfs };
|
|
4759
4809
|
if (loop !== void 0) op.loop = loop;
|
|
4760
4810
|
animate.opacity = op;
|
|
4761
4811
|
}
|
|
4762
|
-
out.push(create("path", __spreadProps(__spreadValues({ d }, paintProps(c.paint)), { animate }), []));
|
|
4812
|
+
out.push(create("path", __spreadProps(__spreadValues(__spreadValues({ d }, paintProps(c.paint)), missingGlyphProps(c.isMissing)), { animate }), []));
|
|
4763
4813
|
}
|
|
4764
4814
|
return out;
|
|
4765
4815
|
}
|
|
@@ -4768,24 +4818,34 @@ var PixodeskAnimator = (() => {
|
|
|
4768
4818
|
if (paint.fill !== void 0) p.fill = paint.fill;
|
|
4769
4819
|
if (paint.stroke !== void 0) p.stroke = paint.stroke;
|
|
4770
4820
|
if (paint.strokeWidth !== void 0) p.strokeWidth = paint.strokeWidth;
|
|
4821
|
+
if (paint.opacity !== void 0) p.opacity = paint.opacity;
|
|
4822
|
+
for (const key of PAINT_STATIC_KEYS) {
|
|
4823
|
+
if (paint[key] !== void 0) p[key] = paint[key];
|
|
4824
|
+
}
|
|
4771
4825
|
return p;
|
|
4772
4826
|
}
|
|
4827
|
+
function missingGlyphProps(isMissing) {
|
|
4828
|
+
return isMissing ? { class: MISSING_GLYPH_CLASS_NAME } : {};
|
|
4829
|
+
}
|
|
4773
4830
|
function buildPaths(placements, create, warnings) {
|
|
4774
|
-
var _a, _b, _c;
|
|
4775
4831
|
if (!placements.length) {
|
|
4776
4832
|
warnings == null ? void 0 : warnings.push("textGlyphs: nothing to render");
|
|
4777
4833
|
return [];
|
|
4778
4834
|
}
|
|
4779
4835
|
const byPaint = /* @__PURE__ */ new Map();
|
|
4780
4836
|
for (const p of placements) {
|
|
4781
|
-
const key = JSON.stringify([
|
|
4837
|
+
const key = JSON.stringify([p.paint, !!p.isMissing]);
|
|
4782
4838
|
const baked = transformPathData(p.glyphD, p.m);
|
|
4783
4839
|
const entry = byPaint.get(key);
|
|
4784
4840
|
if (entry) entry.d += baked;
|
|
4785
|
-
else byPaint.set(key, { paint: p.paint, d: baked });
|
|
4841
|
+
else byPaint.set(key, { paint: p.paint, d: baked, isMissing: p.isMissing });
|
|
4786
4842
|
}
|
|
4787
4843
|
const out = [];
|
|
4788
|
-
for (const { paint, d } of byPaint.values())
|
|
4844
|
+
for (const { paint, d, isMissing } of byPaint.values()) {
|
|
4845
|
+
out.push(create("path", __spreadValues(__spreadValues(__spreadValues({
|
|
4846
|
+
d
|
|
4847
|
+
}, paintProps(paint)), missingGlyphProps(isMissing)), paint.animate !== void 0 ? { animate: __spreadValues({}, paint.animate) } : {}), []));
|
|
4848
|
+
}
|
|
4789
4849
|
return out;
|
|
4790
4850
|
}
|
|
4791
4851
|
function toGroup(node, children, create) {
|
|
@@ -6122,6 +6182,10 @@ var PixodeskAnimator = (() => {
|
|
|
6122
6182
|
if (!config || !isScrollTimeline(config)) return null;
|
|
6123
6183
|
const scroll = config.scroll || {};
|
|
6124
6184
|
const kind = (_a = scroll.kind) != null ? _a : "view";
|
|
6185
|
+
if (scroll.smoothing) {
|
|
6186
|
+
console.warn('scroll timeline: `smoothing` needs the built-in driver \u2014 ignoring `driver: "native"`');
|
|
6187
|
+
return null;
|
|
6188
|
+
}
|
|
6125
6189
|
const g = globalThis;
|
|
6126
6190
|
const view = kind === "view";
|
|
6127
6191
|
const Ctor = view ? g.ViewTimeline : g.ScrollTimeline;
|
|
@@ -6130,7 +6194,7 @@ var PixodeskAnimator = (() => {
|
|
|
6130
6194
|
let timeline;
|
|
6131
6195
|
try {
|
|
6132
6196
|
if (view) {
|
|
6133
|
-
timeline = new Ctor({ subject, axis });
|
|
6197
|
+
timeline = new Ctor({ subject: resolveScrollSubject(subject, scroll.subject), axis });
|
|
6134
6198
|
} else {
|
|
6135
6199
|
const source = scroll.source === "root" ? documentScroller() : findNearestScroller(subject, "y") || findNearestScroller(subject, "x") || documentScroller();
|
|
6136
6200
|
timeline = new Ctor({ source, axis });
|
|
@@ -6146,7 +6210,10 @@ var PixodeskAnimator = (() => {
|
|
|
6146
6210
|
};
|
|
6147
6211
|
}
|
|
6148
6212
|
function findNearestScroller(el, axis) {
|
|
6213
|
+
const body = document.body;
|
|
6214
|
+
const root = document.documentElement;
|
|
6149
6215
|
for (let p = el.parentElement; p; p = p.parentElement) {
|
|
6216
|
+
if (p === body || p === root) return null;
|
|
6150
6217
|
const style = getComputedStyle(p);
|
|
6151
6218
|
const overflow = axis === "y" ? style.overflowY : style.overflowX;
|
|
6152
6219
|
if (overflow === "auto" || overflow === "scroll" || overflow === "hidden" || overflow === "overlay") {
|
|
@@ -6158,11 +6225,42 @@ var PixodeskAnimator = (() => {
|
|
|
6158
6225
|
function documentScroller() {
|
|
6159
6226
|
return document.scrollingElement || document.documentElement;
|
|
6160
6227
|
}
|
|
6228
|
+
var SUBJECT_PARENT = "parent";
|
|
6229
|
+
var SUBJECT_SCROLLER = "scroller";
|
|
6230
|
+
function resolveScrollSubject(svgRoot, subject) {
|
|
6231
|
+
var _a, _b;
|
|
6232
|
+
const spec = subject == null ? void 0 : subject.trim();
|
|
6233
|
+
if (!spec) return svgRoot;
|
|
6234
|
+
if (spec === SUBJECT_PARENT) {
|
|
6235
|
+
let outermostPinned = null;
|
|
6236
|
+
for (let p = svgRoot.parentElement; p && p !== document.body; p = p.parentElement) {
|
|
6237
|
+
const position = getComputedStyle(p).position;
|
|
6238
|
+
if (position === "sticky" || position === "fixed") outermostPinned = p;
|
|
6239
|
+
}
|
|
6240
|
+
return (_b = (_a = outermostPinned == null ? void 0 : outermostPinned.parentElement) != null ? _a : svgRoot.parentElement) != null ? _b : svgRoot;
|
|
6241
|
+
}
|
|
6242
|
+
if (spec === SUBJECT_SCROLLER) {
|
|
6243
|
+
return findNearestScroller(svgRoot, "y") || findNearestScroller(svgRoot, "x") || documentScroller();
|
|
6244
|
+
}
|
|
6245
|
+
let found = null;
|
|
6246
|
+
try {
|
|
6247
|
+
found = document.querySelector(spec);
|
|
6248
|
+
} catch (e) {
|
|
6249
|
+
console.warn('scroll timeline: subject "' + spec + '" is not a valid selector \u2014 measuring the SVG itself');
|
|
6250
|
+
return svgRoot;
|
|
6251
|
+
}
|
|
6252
|
+
if (!found) {
|
|
6253
|
+
console.warn('scroll timeline: subject "' + spec + '" matched no element \u2014 measuring the SVG itself');
|
|
6254
|
+
return svgRoot;
|
|
6255
|
+
}
|
|
6256
|
+
return found;
|
|
6257
|
+
}
|
|
6161
6258
|
function createScrollDriver(subject, config, onProgress) {
|
|
6162
|
-
var _a;
|
|
6259
|
+
var _a, _b;
|
|
6163
6260
|
if (!config || !isScrollTimeline(config)) return null;
|
|
6164
6261
|
const scroll = config.scroll || {};
|
|
6165
6262
|
const kind = (_a = scroll.kind) != null ? _a : "view";
|
|
6263
|
+
const measured = resolveScrollSubject(subject, scroll.subject);
|
|
6166
6264
|
const nearest = findNearestScroller(subject, "y") || findNearestScroller(subject, "x");
|
|
6167
6265
|
const scroller = kind === "scroll" && scroll.source === "root" ? documentScroller() : nearest || documentScroller();
|
|
6168
6266
|
const isRootScroller = scroller === documentScroller();
|
|
@@ -6173,7 +6271,7 @@ var PixodeskAnimator = (() => {
|
|
|
6173
6271
|
const maxOffset = axis === "y" ? scroller.scrollHeight - scroller.clientHeight : scroller.scrollWidth - scroller.clientWidth;
|
|
6174
6272
|
return scrollOffsetProgress(offset, maxOffset, scroll.range);
|
|
6175
6273
|
}
|
|
6176
|
-
const subjectRect =
|
|
6274
|
+
const subjectRect = measured.getBoundingClientRect();
|
|
6177
6275
|
let portStart, portSize;
|
|
6178
6276
|
if (isRootScroller) {
|
|
6179
6277
|
portStart = 0;
|
|
@@ -6187,12 +6285,43 @@ var PixodeskAnimator = (() => {
|
|
|
6187
6285
|
const subjectSize = axis === "y" ? subjectRect.height : subjectRect.width;
|
|
6188
6286
|
return scrollViewProgress(subjectStart, subjectSize, portSize, scroll.range);
|
|
6189
6287
|
};
|
|
6190
|
-
|
|
6288
|
+
const smoothingSec = Math.max(0, (_b = scroll.smoothing) != null ? _b : 0) / 1e3;
|
|
6289
|
+
const SETTLE_EPSILON = 1e-3;
|
|
6191
6290
|
let destroyed = false;
|
|
6291
|
+
let smoothed = null;
|
|
6292
|
+
let smoothRaf = null;
|
|
6293
|
+
let lastFrameMs = 0;
|
|
6294
|
+
const emit = (target) => {
|
|
6295
|
+
if (!smoothingSec) {
|
|
6296
|
+
onProgress(target);
|
|
6297
|
+
return;
|
|
6298
|
+
}
|
|
6299
|
+
if (smoothed === null) {
|
|
6300
|
+
smoothed = target;
|
|
6301
|
+
onProgress(target);
|
|
6302
|
+
return;
|
|
6303
|
+
}
|
|
6304
|
+
if (smoothRaf !== null) return;
|
|
6305
|
+
lastFrameMs = 0;
|
|
6306
|
+
const step = (nowMs) => {
|
|
6307
|
+
smoothRaf = null;
|
|
6308
|
+
if (destroyed) return;
|
|
6309
|
+
const dtSec = lastFrameMs ? Math.min(0.1, (nowMs - lastFrameMs) / 1e3) : 1 / 60;
|
|
6310
|
+
lastFrameMs = nowMs;
|
|
6311
|
+
const goal = compute();
|
|
6312
|
+
const k = 1 - Math.exp(-dtSec / smoothingSec);
|
|
6313
|
+
smoothed = smoothed + (goal - smoothed) * k;
|
|
6314
|
+
if (Math.abs(goal - smoothed) < SETTLE_EPSILON) smoothed = goal;
|
|
6315
|
+
onProgress(smoothed);
|
|
6316
|
+
if (smoothed !== goal) smoothRaf = requestAnimationFrame(step);
|
|
6317
|
+
};
|
|
6318
|
+
smoothRaf = requestAnimationFrame(step);
|
|
6319
|
+
};
|
|
6320
|
+
let rafId = null;
|
|
6192
6321
|
const tick = () => {
|
|
6193
6322
|
rafId = null;
|
|
6194
6323
|
if (destroyed) return;
|
|
6195
|
-
|
|
6324
|
+
emit(compute());
|
|
6196
6325
|
};
|
|
6197
6326
|
const schedule = () => {
|
|
6198
6327
|
if (destroyed || rafId !== null) return;
|
|
@@ -6204,7 +6333,8 @@ var PixodeskAnimator = (() => {
|
|
|
6204
6333
|
let resizeObserver;
|
|
6205
6334
|
if (typeof ResizeObserver !== "undefined") {
|
|
6206
6335
|
resizeObserver = new ResizeObserver(schedule);
|
|
6207
|
-
resizeObserver.observe(
|
|
6336
|
+
resizeObserver.observe(measured);
|
|
6337
|
+
if (measured !== subject) resizeObserver.observe(subject);
|
|
6208
6338
|
if (!isRootScroller) resizeObserver.observe(scroller);
|
|
6209
6339
|
}
|
|
6210
6340
|
const driver = {
|
|
@@ -6218,14 +6348,76 @@ var PixodeskAnimator = (() => {
|
|
|
6218
6348
|
cancelAnimationFrame(rafId);
|
|
6219
6349
|
rafId = null;
|
|
6220
6350
|
}
|
|
6351
|
+
if (smoothRaf !== null) {
|
|
6352
|
+
cancelAnimationFrame(smoothRaf);
|
|
6353
|
+
smoothRaf = null;
|
|
6354
|
+
}
|
|
6221
6355
|
},
|
|
6356
|
+
// `refresh` is a deliberate JUMP (attach, host relayout) — never eased.
|
|
6222
6357
|
refresh: () => {
|
|
6223
|
-
if (!destroyed)
|
|
6358
|
+
if (!destroyed) {
|
|
6359
|
+
smoothed = compute();
|
|
6360
|
+
onProgress(smoothed);
|
|
6361
|
+
}
|
|
6224
6362
|
}
|
|
6225
6363
|
};
|
|
6226
6364
|
driver.refresh();
|
|
6227
6365
|
return driver;
|
|
6228
6366
|
}
|
|
6367
|
+
function pinScrollportHeight(svgRoot) {
|
|
6368
|
+
const scroller = findNearestScroller(svgRoot, "y");
|
|
6369
|
+
return scroller ? scroller.clientHeight : document.documentElement.clientHeight;
|
|
6370
|
+
}
|
|
6371
|
+
function applyScrollPin(svgRoot, scroll) {
|
|
6372
|
+
const styled = svgRoot;
|
|
6373
|
+
if (!(scroll == null ? void 0 : scroll.pin) || !styled.style) return () => {
|
|
6374
|
+
};
|
|
6375
|
+
const style = styled.style;
|
|
6376
|
+
const prevPosition = style.position;
|
|
6377
|
+
const prevTop = style.top;
|
|
6378
|
+
style.position = "sticky";
|
|
6379
|
+
const alignFactor = scroll.pinAlign === "center" ? 0.5 : scroll.pinAlign === "bottom" ? 1 : 0;
|
|
6380
|
+
const applyTop = () => {
|
|
6381
|
+
var _a;
|
|
6382
|
+
const extra = (_a = scroll.pinTop) != null ? _a : 0;
|
|
6383
|
+
if (!alignFactor) {
|
|
6384
|
+
style.top = extra + "px";
|
|
6385
|
+
return;
|
|
6386
|
+
}
|
|
6387
|
+
const portSize = pinScrollportHeight(svgRoot);
|
|
6388
|
+
const ownSize = svgRoot.getBoundingClientRect().height;
|
|
6389
|
+
style.top = Math.round((portSize - ownSize) * alignFactor + extra) + "px";
|
|
6390
|
+
};
|
|
6391
|
+
applyTop();
|
|
6392
|
+
let resizeObserver = null;
|
|
6393
|
+
const onWindowResize = alignFactor ? applyTop : null;
|
|
6394
|
+
if (alignFactor) {
|
|
6395
|
+
if (onWindowResize) window.addEventListener("resize", onWindowResize);
|
|
6396
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
6397
|
+
resizeObserver = new ResizeObserver(applyTop);
|
|
6398
|
+
resizeObserver.observe(svgRoot);
|
|
6399
|
+
}
|
|
6400
|
+
}
|
|
6401
|
+
let wrapper = null;
|
|
6402
|
+
const parent = svgRoot.parentElement;
|
|
6403
|
+
if (scroll.pinDistance && scroll.pinDistance > 0 && parent) {
|
|
6404
|
+
wrapper = document.createElement("div");
|
|
6405
|
+
wrapper.setAttribute("data-px-pin", "");
|
|
6406
|
+
wrapper.style.height = scroll.pinDistance * 100 + "vh";
|
|
6407
|
+
parent.insertBefore(wrapper, svgRoot);
|
|
6408
|
+
wrapper.appendChild(svgRoot);
|
|
6409
|
+
}
|
|
6410
|
+
return () => {
|
|
6411
|
+
if (onWindowResize) window.removeEventListener("resize", onWindowResize);
|
|
6412
|
+
resizeObserver == null ? void 0 : resizeObserver.disconnect();
|
|
6413
|
+
style.position = prevPosition;
|
|
6414
|
+
style.top = prevTop;
|
|
6415
|
+
if (wrapper == null ? void 0 : wrapper.parentElement) {
|
|
6416
|
+
wrapper.parentElement.insertBefore(svgRoot, wrapper);
|
|
6417
|
+
wrapper.remove();
|
|
6418
|
+
}
|
|
6419
|
+
};
|
|
6420
|
+
}
|
|
6229
6421
|
|
|
6230
6422
|
// src/PxAnimatorBind.ts
|
|
6231
6423
|
function finaliseAnimator(animatorConfig, callbacks, make) {
|
|
@@ -6252,7 +6444,10 @@ var PixodeskAnimator = (() => {
|
|
|
6252
6444
|
if (isScrollTimeline(animatorConfig)) {
|
|
6253
6445
|
return finaliseAnimator(animatorConfig, callbacks, (cb) => {
|
|
6254
6446
|
var _a, _b;
|
|
6447
|
+
let unpin = () => {
|
|
6448
|
+
};
|
|
6255
6449
|
if (animatorConfig.mode !== PxAnimatorMode.frames && ((_a = animatorConfig.scroll) == null ? void 0 : _a.driver) === "native" && rootElement) {
|
|
6450
|
+
unpin = applyScrollPin(rootElement, animatorConfig.scroll);
|
|
6256
6451
|
const native = createNativeScrollTimeline(rootElement, animatorConfig);
|
|
6257
6452
|
if (native) {
|
|
6258
6453
|
const api2 = createWebApiAnimator(
|
|
@@ -6262,12 +6457,23 @@ var PixodeskAnimator = (() => {
|
|
|
6262
6457
|
animatorConfig.mode === PxAnimatorMode.waapi,
|
|
6263
6458
|
native
|
|
6264
6459
|
);
|
|
6265
|
-
if (api2)
|
|
6460
|
+
if (api2) {
|
|
6461
|
+
const destroyNative = api2.destroy.bind(api2);
|
|
6462
|
+
api2.destroy = () => {
|
|
6463
|
+
unpin();
|
|
6464
|
+
destroyNative();
|
|
6465
|
+
};
|
|
6466
|
+
return api2;
|
|
6467
|
+
}
|
|
6266
6468
|
}
|
|
6469
|
+
unpin();
|
|
6470
|
+
unpin = () => {
|
|
6471
|
+
};
|
|
6267
6472
|
}
|
|
6268
6473
|
const api = (animatorConfig.mode !== PxAnimatorMode.frames ? createWebApiAnimator(doc, cb, rootElement, animatorConfig.mode === PxAnimatorMode.waapi) : null) || createFrameLoopAnimator(doc, adapter, cb, rootElement);
|
|
6269
6474
|
const subject = ((_b = api.getRootElement) == null ? void 0 : _b.call(api)) || rootElement;
|
|
6270
6475
|
if (subject) {
|
|
6476
|
+
unpin = applyScrollPin(subject, animatorConfig.scroll);
|
|
6271
6477
|
const totalMs = scrollTotalDurationMs(animatorConfig);
|
|
6272
6478
|
const driver = createScrollDriver(
|
|
6273
6479
|
subject,
|
|
@@ -6278,6 +6484,7 @@ var PixodeskAnimator = (() => {
|
|
|
6278
6484
|
const destroy = api.destroy.bind(api);
|
|
6279
6485
|
api.destroy = () => {
|
|
6280
6486
|
driver.destroy();
|
|
6487
|
+
unpin();
|
|
6281
6488
|
destroy();
|
|
6282
6489
|
};
|
|
6283
6490
|
}
|