@pixodesk/svg-animator-web 1.0.24 → 1.0.26
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 +156 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +156 -4
- 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 +24 -2
- package/dist/index.prerendered-waapi.umd.js.map +1 -1
- package/dist/index.prerendered-waapi.umd.min.js +1 -1
- package/dist/index.prerendered.umd.js +23 -2
- package/dist/index.prerendered.umd.js.map +1 -1
- package/dist/index.prerendered.umd.min.js +1 -1
- package/dist/index.umd.js +158 -4
- 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,o=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyDescriptors,e=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,c=(t,o,r)=>o in t?n(t,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[o]=r,f=(n,t)=>{for(var o in t||(t={}))i.call(t,o)&&c(n,o,t[o]);if(l)for(var o of l(t))u.call(t,o)&&c(n,o,t[o]);return n},s=(n,o)=>t(n,r(o)),a={};((t,o)=>{for(var r in o)n(t,r,{get:o[r],enumerable:!0})})(a,{PX_ANIMATOR_DATA_KEY:()=>Mn,createAnimator:()=>gn,setupAnimationTriggers:()=>pn});var v={waapi:"waapi",frames:"frames"},d={before:"before",after:"after"};function p(n){var t;return(null==n?void 0:n.animator)||(null==(t=null==n?void 0:n.meta)?void 0:t.animator)}function h(n,t,o){return n+(t-n)*o}function m(n,t,o){const r=[],e=Math.max(n.length,t.length);for(let l=0;l<e;l++)r[l]=h(n[l]||0,t[l]||0,o);return r}function b(n,t,o){const r=Math.max(n.length,t.length),e=[];for(let l=0;l<r;l++)e.push(y(n[l],t[l],o));return e}function y(n,t,o){var r,e,l,i,u,c,f,s,a;if(!n||!t)return n||t||{v:[]};const v=Math.min(Math.max(o,0),1),d=Math.min(n.v.length,t.v.length),p=[],h=[],b=[];for(let o=0;o<d;o++){const a=n.v[o],d=t.v[o];p.push(m(a,d,v));const y=null!=(e=null==(r=n.i)?void 0:r[o])?e:a,g=null!=(i=null==(l=t.i)?void 0:l[o])?i:d;h.push(m(y,g,v));const A=null!=(c=null==(u=n.o)?void 0:u[o])?c:a,M=null!=(s=null==(f=t.o)?void 0:f[o])?s:d;b.push(m(A,M,v))}return{v:p,i:h.length?h:void 0,o:b.length?b:void 0,c:null!=(a=n.c)?a:t.c}}function g(n,t,o){if(o<=0)return 0;if(o>=1)return 1;const r=3*n,e=3*(t-n)-r,l=1-r-e;function i(n){return((l*n+e)*n+r)*n}function u(n){return(3*l*n+2*e)*n+r}let c=o,f=0,s=1;for(let n=0;n<8;n++){const n=i(c)-o;if(Math.abs(n)<1e-6)return c;const t=u(c);if(Math.abs(t)<1e-6)break;c-=n/t}for(c=o;f<s;){const n=i(c);if(Math.abs(n-o)<1e-6)return c;o>n?f=c:s=c,c=(s+f)/2}return c}function A(n){const[t,o,r,e]=n,l=3*o,i=3*(e-o)-l,u=1-l-i;return function(n){return o=g(t,r,n),((u*o+i)*o+l)*o;var o}}function M(n,t,o){return[n[0]+(t[0]-n[0])*o,n[1]+(t[1]-n[1])*o]}function w(n,t){if(!n)return{left:void 0,right:void 0};if(t<=0)return{left:void 0,right:n};if(t>=1)return{left:n,right:void 0};const[o,r,e,l]=n,i=g(o,e,t),u=[o,r],c=[e,l],{left:f,right:s}=function(n,t,o,r,e){const l=M(n,t,e),i=M(t,o,e),u=M(o,r,e),c=M(l,i,e),f=M(i,u,e),s=M(c,f,e);return{left:[n,l,c,s],right:[s,f,u,r]}}([0,0],u,c,[1,1],i),a=f[3][0],v=f[3][1];let d,p;a>1e-9&&Math.abs(v)>1e-9&&(d=[f[1][0]/a,f[1][1]/v,f[2][0]/a,f[2][1]/v]);const h=1-a,m=1-v;return h>1e-9&&Math.abs(m)>1e-9&&(p=[(s[1][0]-a)/h,(s[1][1]-v)/m,(s[2][0]-a)/h,(s[2][1]-v)/m]),{left:d,right:p}}function j(n){if(n)return[1-n[2],1-n[3],1-n[0],1-n[1]]}function k(n){if(n){if(Array.isArray(n))return n;if("string"==typeof n)return n.startsWith("#")?function(n){const t=n.slice(1),o=t.length<=4,r=o?t[0]+t[0]:t.slice(0,2),e=o?t[1]+t[1]:t.slice(2,4),l=o?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(r,16)/255,parseInt(e,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 o=null==(t=n.match(/rgba?\((.*)\)/))?void 0:t[1];if(!o)throw new Error("Invalid rgb/rgba format");const r=o.split(",").map(n=>+n.trim());return[r[0]/255,r[1]/255,r[2]/255,...void 0!==r[3]?[r[3]]:[]]}(n):void console.warn("Unsupported color format: "+n)}}var O=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),U=new Set(["translate","rotate","scale","skew"]);function C(n){return!n.includes("-")&&/[a-z][A-Z]/.test(n)}var T=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 I(n){return T.has(n)?n:n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function S(n,t,o){return Math.max(t,Math.min(n,o))}function z(n,t,o,r,e){if(e<=0)return[n[0],n[1]];if(e>=1)return[r[0],r[1]];const l=1-e,i=l*l,u=e*e,c=i*l,f=3*e*i,s=3*u*l,a=u*e;return[c*n[0]+f*t[0]+s*o[0]+a*r[0],c*n[1]+f*t[1]+s*o[1]+a*r[1]]}var L=1e-4;function P(n,t,o,r,e){const l=x(n,t,o,r,e);return 0===l[0]&&0===l[1]?x(n,t,o,r,e<.5?e+L:e-L):l}function x(n,t,o,r,e){const l=1-e,i=3*l*l,u=6*e*l,c=3*e*e;return[i*(t[0]-n[0])+u*(o[0]-t[0])+c*(r[0]-o[0]),i*(t[1]-n[1])+u*(o[1]-t[1])+c*(r[1]-o[1])]}function N(n,t){const{ts:o,ds:r}=n,e=o.length-1;if(t<=o[0])return r[0];if(t>=o[e])return r[e];let l=1,i=e;for(;l<i;){const n=l+i>>>1;o[n]<t?l=n+1:i=n}const u=o[i-1],c=o[i]-u,f=c>0?(t-u)/c:0;return r[i-1]+f*(r[i]-r[i-1])}function _(n){var t;const o=null!=(t=n.value)?t:n.v;if(!o)return;if(Array.isArray(o)&&o.length>=2&&"number"==typeof o[0]&&"number"==typeof o[1])return[o[0],o[1]];const r=o.translate;return Array.isArray(r)&&r.length>=2?[r[0],r[1]]:void 0}function E(n){var t,o;return null!=(o=null!=(t=n.time)?t:n.t)?o:0}function F(n){var t;return null!=(t=n.easing)?t:n.e}var W=new WeakMap;function Z(n,t,o,r){var e,l;let i=W.get(n);const u=null==i?void 0:i.get(t);if(u)return u;const c=null!=(e=n.tangentOut)?e:n.to,f=null!=(l=t.tangentIn)?l:t.ti,s=[o[0]+(c?c[0]:0),o[1]+(c?c[1]:0)],a=[r[0]+(f?f[0]:0),r[1]+(f?f[1]:0)],v=function(n,t,o,r,e=100){const l=e+1,i=new Float64Array(l),u=new Float64Array(l);let c=z(n,t,o,r,0);i[0]=0,u[0]=0;let f=0;for(let s=1;s<l;s++){const l=s/e,a=z(n,t,o,r,l),v=a[0]-c[0],d=a[1]-c[1];f+=Math.sqrt(v*v+d*d),i[s]=l,u[s]=f,c=a}return{ts:i,ds:u}}(o,s,a,r),d={P0:o,P1:s,P2:a,P3:r,l:v,h:v.ds[v.ds.length-1]};return i||(i=new WeakMap,W.set(n,i)),i.set(t,d),d}var R=.5,V=5,X=32;function q(n,t){var o,r,e,l;if(!function(n){var t,o,r;const e=null!=(t=n.keyframes)?t:n.kfs;if(!Array.isArray(e))return!1;if(n.autoOrient)return!0;for(const n of e)if((null!=(o=n.tangentIn)?o:n.ti)||(null!=(r=n.tangentOut)?r:n.to))return!0;return!1}(n))return n;const i=null!=(o=n.keyframes)?o:n.kfs;if(!Array.isArray(i)||i.length<2)return n;const u=!!n.autoOrient,c=null!=(r=null==t?void 0:t.m)?r:R,f=null!=(e=null==t?void 0:t.A)?e:V,s=null!=(l=null==t?void 0:t.M)?l:X,a=[],v=_(i[0]);if(!v)return n;const d=u?function(n,t){const o=_(n),r=_(t);if(!o||!r)return 0;const e=Z(n,t,o,r),l=P(e.P0,e.P1,e.P2,e.P3,0);return 180*Math.atan2(l[1],l[0])/Math.PI}(i[0],i[1]):void 0;a.push(D(E(i[0]),K(Y(i[0]),Y(i[0]),0,v,d,u)));for(let n=0;n<i.length-1;n++){const t=i[n],o=i[n+1],r=_(t),e=_(o);r&&e?(u&&n>0&&B(a,t,o,r,e,f),G(a,t,o,r,e,u,c,f,s)):a.push(D(E(o),K(Y(o),Y(o),1,null!=e?e:[0,0],void 0,u)))}const p=F(i[i.length-1]);p&&(a[a.length-1].e=p),u&&function(n){var t;let o;for(const r of n){const n=null!=(t=r.v)?t:r.value;if(!n||"number"!=typeof n.rotate)continue;if(void 0===o){o=n.rotate;continue}let e=n.rotate;for(;e-o>180;)e-=360;for(;e-o<-180;)e+=360;n.rotate=e,o=e}}(a);const h={kfs:a};return void 0!==n.loop&&(h.loop=n.loop),h}function D(n,t){return{t:n,v:t}}function Y(n){var t;const o=null!=(t=n.value)?t:n.v;if(o&&"object"==typeof o&&!Array.isArray(o))return o}function H(n,t,o){if(void 0===n)return t;if(void 0===t)return n;if("number"==typeof n&&"number"==typeof t)return n+(t-n)*o;if(Array.isArray(n)&&Array.isArray(t)&&n.length===t.length){const r=new Array(n.length);for(let e=0;e<n.length;e++){const l="number"==typeof n[e]?n[e]:0,i="number"==typeof t[e]?t[e]:0;r[e]=l+(i-l)*o}return r}return o<.5?n:t}function K(n,t,o,r,e,l){const i={translate:r},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 r of u){if("translate"===r)continue;if("rotate"===r&&l)continue;const e=null==n?void 0:n[r],u=null==t?void 0:t[r];void 0===e&&void 0===u||(i[r]=H(e,u,o))}return void 0!==e&&(i.rotate=e+$(n,t,o)),i}function $(n,t,o){const r="number"==typeof(null==n?void 0:n.rotate)?n.rotate:void 0,e="number"==typeof(null==t?void 0:t.rotate)?t.rotate:void 0;if(void 0===r&&void 0===e)return 0;const l=H(r,e,o);return"number"==typeof l?l:0}function B(n,t,o,r,e,l){var i;const u=n[n.length-1],c=null!=(i=u.v)?i:u.value,f=null==c?void 0:c.rotate;if("number"!=typeof f)return;const s=Y(t),a=f-$(s,s,0),v=Z(t,o,r,e),d=P(v.P0,v.P1,v.P2,v.P3,0),p=180*Math.atan2(d[1],d[0])/Math.PI,h=function(n,t){let o=n-t;for(;o>180;)o-=360;for(;o<-180;)o+=360;return o}(p,a);if(Math.abs(h)<=l)return;const m=E(t),b=Math.min(m+Q,(m+E(o))/2),y=K(Y(t),Y(t),0,r,p,!0);n.push(D(b,y))}var Q=.05;function G(n,t,o,r,e,l,i,u,c){const f=Z(t,o,r,e),s=E(t),a=E(o),v=F(t),d=(p=v)?A([p[1],p[0],p[3],p[2]]):n=>n;var p;const h=Y(t),m=Y(o),b=function(n,t,o,r,e){const l=[];J(n.P0[0],n.P1[0],n.P2[0],n.P3[0],l),J(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={j:e-i.length};for(let e=0;e<i.length-1;e++)nn(i[e],i[e+1],u,n,t,o,r,c);return u}(f,l,i,u,c),y=[];for(const n of b){const t=N(f.l,n),o=S(f.h>0?t/f.h:n,0,1),r={u:S(d(o),0,1),p:o,k:z(f.P0,f.P1,f.P2,f.P3,n)};if(l){const t=P(f.P0,f.P1,f.P2,f.P3,n);r.O=180*Math.atan2(t[1],t[0])/Math.PI}y.push(r)}let g=v,M=0;const j=n.length-1;for(let t=0;t<y.length;t++){const o=y[t],r=M<1?S((o.u-M)/(1-M),0,1):1,{left:e,right:i}=w(g,r),u=0===t?j:n.length-1;e?n[u].e=e:delete n[u].e;const c=s+o.u*(a-s),f=K(h,m,o.p,o.k,o.O,l);n.push(D(c,f)),g=i,M=o.u}}function J(n,t,o,r,e){const l=t-n,i=o-t,u=l-2*i+(r-o),c=2*(i-l),f=l;if(Math.abs(u)<1e-10){if(Math.abs(c)>1e-10){const n=-f/c;n>1e-6&&n<.999999&&e.push(n)}return}const s=c*c-4*u*f;if(s<0)return;const a=Math.sqrt(s),v=(-c-a)/(2*u),d=(-c+a)/(2*u);v>1e-6&&v<.999999&&e.push(v),d>1e-6&&d<.999999&&e.push(d)}function nn(n,t,o,r,e,l,i,u){const c=(n+t)/2,f=z(r.P0,r.P1,r.P2,r.P3,n),s=z(r.P0,r.P1,r.P2,r.P3,t),a=t-n,v=z(r.P0,r.P1,r.P2,r.P3,n+.25*a),d=z(r.P0,r.P1,r.P2,r.P3,c),p=z(r.P0,r.P1,r.P2,r.P3,n+.75*a),h=Math.max(tn(v,f,s),tn(d,f,s),tn(p,f,s));let m=!0;if(e){const o=P(r.P0,r.P1,r.P2,r.P3,n),e=P(r.P0,r.P1,r.P2,r.P3,t),l=180*Math.atan2(o[1],o[0])/Math.PI,u=180*Math.atan2(e[1],e[0])/Math.PI;let c=Math.abs(l-u);c>180&&(c=360-c),c>i&&(m=!1)}h<=l&&m||u.j<=0||a<1e-6?o.push(t):(u.j-=1,nn(n,c,o,r,e,l,i,u),nn(c,t,o,r,e,l,i,u))}function tn(n,t,o){const r=o[0]-t[0],e=o[1]-t[1],l=r*r+e*e;if(l<1e-20){const o=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(o*o+r*r)}const i=(n[0]-t[0])*e-(n[1]-t[1])*r;return Math.abs(i)/Math.sqrt(l)}var on=10;function rn(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 o=Object.keys(n),r=Object.keys(t);return o.length===r.length&&o.every(o=>rn(n[o],t[o]))}function en(n){const t=[];let o;const r=function(n){const t=n.split(/([MLCZmlcz]|[\s,]+)/).map(n=>n.trim()).filter(n=>n&&","!==n),o=[];let r=null;for(const n of t)if(/[MLCZmlcz]/.test(n))r={type:n,values:[]},o.push(r);else if(r){const t=+n;r.values.push(Number.isNaN(t)?0:t)}return o}(n);for(const n of r){const r=n.type,e=n.values;if("M"===r||"m"===r){const n=e[0]||0,r=e[1]||0;o={v:[[n,r]],i:[[n,r]],o:[[n,r]],c:!1},t.push(o);continue}if(o||(o={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},t.push(o)),"L"===r){const n=e[0]||0,t=e[1]||0;o.v.push([n,t]),o.i.push([n,t]),o.o.push([n,t])}else if("C"===r){const n=e[0]||0,t=e[1]||0,r=e[2]||0,l=e[3]||0,i=e[4]||0,u=e[5]||0;o.o[o.o.length-1]=[n,t],o.v.push([i,u]),o.i.push([r,l]),o.o.push([i,u])}else"Z"===r||"z"===r?o.c=!0:console.warn('Unsupported path command "'+r+'"')}return t}function ln(n){return n.startsWith("path(")&&n.endsWith(")")?n.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(n)?n:void 0}function un(n){return"string"==typeof n&&void 0!==ln(n)}function cn(n){if(n&&"object"==typeof n&&"string"==typeof n.path){const t=ln(n.path);return t?{paths:en(t)}:n}if(n&&"object"==typeof n&&"paths"in n){const t=n.paths;if(Array.isArray(t)&&t.length>0&&un(t[0])){const n=[];for(const o of t){const t=ln(o);t&&n.push(...en(t))}return{paths:n}}return n}if(Array.isArray(n)){if(n.length>0&&un(n[0])){const t=[];for(const o of n){const n=ln(o);n&&t.push(...en(n))}return{paths:t}}return{paths:n}}return un(n)?{paths:en(ln(n))}:n}function fn(n,t){var o;if(n)return Array.isArray(n)?n:(null==(o=null==t?void 0:t.easings)?void 0:o[n])?t.easings[n]:void console.warn("Unknown easing name: "+n)}function sn(n,t){var o;if("string"==typeof n){const r=null==(o=null==t?void 0:t.animations)?void 0:o[n];return r||console.warn("Unknown animation name: "+n),r}return n}function an(n,t,o,r){var e,l;return"d"===n?{paths:b(null!=(e=null==t?void 0:t.paths)?e:Array.isArray(t)?t:[],null!=(l=null==o?void 0:o.paths)?l:Array.isArray(o)?o:[],r)}:O.has(n)?function(n,t,o){return[h(n[0]||0,t[0]||0,o),h(n[1]||0,t[1]||0,o),h(n[2]||0,t[2]||0,o),h(void 0===n[3]?1:n[3],void 0===t[3]?1:t[3],o)]}(t||[0,0,0,1],o||[0,0,0,1],r):"transform"!==n||"object"!=typeof t||null===t||Array.isArray(t)||"object"!=typeof o||null===o||Array.isArray(o)?"rotate"===n&&"number"==typeof t&&"number"==typeof o?h(t,o,r):U.has(n)||"stroke-dasharray"===n||"strokeDasharray"===n?m(t||[],o||[],r):h(+(t||0),+(o||0),r):function(n,t,o){const r=new Set([...Object.keys(null!=n?n:{}),...Object.keys(null!=t?t:{})]),e={};for(const l of r){const r=null==n?void 0:n[l],i=null==t?void 0:t[l];if("rotate"===l||"skew"===l)e[l]=h(+(null!=r?r:0),+(null!=i?i:0),o);else if("translate"===l||"scale"===l||"origin"===l){const n="scale"===l?[1,1]:[0,0];e[l]=m(r||n,i||n,o)}else e[l]=null!=i?i:r}return e}(t,o,r)}function vn(n,t,o,r){var e,l,i,u,c,f,s;const a=t.keyframes||t.kfs||[],v=[];for(const t of a){const o=null!=(l=null!=(e=t.time)?e:t.t)?l:0;let a=null!=(i=t.value)?i:t.v;const d=null!=(u=t.easing)?u:t.e;"d"===n&&(a=cn(a));const p=C(n)?I(n):n;O.has(p)&&(a=null!=(c=k(a))?c:a);const h={t:o,v:a,e:fn(d,r)},m=null!=(f=t.tangentIn)?f:t.ti,b=null!=(s=t.tangentOut)?s:t.to;m&&(h.tangentIn=m),b&&(h.tangentOut=b),v.push(h)}v.sort((n,t)=>{var o,r;return(null!=(o=n.t)?o:0)-(null!=(r=t.t)?r:0)});const p=t.loop,h=!0===p?{}:p||void 0;return h&&v.length>=2?function(n,t,o,r){var e,l,i,u,c;const f=t.length-1,s=S(null!=(e=o.segmentCount)?e:f,1,f);let a;a=o.extend===d.before?t.slice(0,s+1):t.slice(f-s);const v=null!=(l=t[0].t)?l:0,p=null!=(i=t[t.length-1].t)?i:0;let h,m;o.extend===d.before?(h=0,m=v):(h=p,m=r);const b=m-h;if(b<=0)return t;const y=null!=(u=a[0].t)?u:0,g=(null!=(c=a[a.length-1].t)?c:0)-y;if(g<=0)return t;const M=a.map(n=>{var t,o;return{U:(n.t-y)/g,v:n.v,e:n.e,tangentIn:null!=(t=n.tangentIn)?t:n.ti,tangentOut:null!=(o=n.tangentOut)?o:n.to}}),k=Math.floor(b/g),O=b-k*g,U=O/g,C=[],T=o.extend!==d.before,I=t[t.length-1];function z(t,o,r){var e;let l;if(o){l=[];for(let n=M.length-1;n>=0;n--)l.push({U:1-M[n].U,v:M[n].v,e:n>0?j(M[n-1].e):void 0,tangentIn:M[n].tangentOut,tangentOut:M[n].tangentIn})}else l=M;const i=void 0!==r?r:1;for(let o=0;o<l.length;o++){const r=l[o];if(r.U>i+1e-9){const e=l[o-1],u=r.U-e.U,c=(i-e.U)/u,f=e.e?A(e.e)(c):c,s=an(n,e.v,r.v,f),{left:a}=w(e.e,c);return C.length>0&&e.U<=i&&(C[C.length-1].e=a),void C.push({t:t+i*g,v:s,e:void 0})}const u=C.length>0?C[C.length-1]:I,c=T&&0===o&&void 0!==u&&Math.abs((null!=(e=u.t)?e:0)-(t+r.U*g))<1e-9;if(c){if(rn(u.v,r.v))continue;C.length>0&&(delete u.tangentIn,delete u.tangentOut)}const f={t:t+r.U*g+(c?on:0),v:r.v,e:o<l.length-1?r.e:void 0};r.tangentIn&&(f.tangentIn=r.tangentIn),r.tangentOut&&(f.tangentOut=r.tangentOut),C.push(f)}}if(o.extend===d.before){U>1e-9&&function(t,o,r){let e;if(o){e=[];for(let n=M.length-1;n>=0;n--)e.push({U:1-M[n].U,v:M[n].v,e:n>0?j(M[n-1].e):void 0,tangentIn:M[n].tangentOut,tangentOut:M[n].tangentIn})}else e=M;const l=1-r;for(let o=0;o<e.length;o++){const r=e[o];if(r.U<l-1e-9)continue;const i=e[o-1];if(i&&i.U<l-1e-9&&r.U>l+1e-9){const o=r.U-i.U,e=(l-i.U)/o,u=i.e?A(i.e)(e):e,c=an(n,i.v,r.v,u),{right:f}=w(i.e,e);C.push({t:t,v:c,e:f})}const u={t:t+(r.U-l)*g,v:r.v,e:o<e.length-1?r.e:void 0};r.tangentIn&&(u.tangentIn=r.tangentIn),r.tangentOut&&(u.tangentOut=r.tangentOut),C.push(u)}}(h,!!o.alternate&&k%2==0,U);for(let n=0;n<k;n++){const t=k-1-n,r=!!o.alternate&&t%2==0;z(h+O+n*g,r)}}else{for(let n=0;n<k;n++){const t=!!o.alternate&&n%2==0;z(h+n*g,t)}if(U>1e-9){const n=!!o.alternate&&k%2==0;z(h+k*g,n,U)}}return o.extend===d.before?[...C,...t]:[...t,...C]}(n,v,h,o):v}var dn=0;function pn(n,t){const{startOn:o,outAction:r="continue",scrollIntoViewThreshold:e=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(r){case"pause":n.pause();break;case"reset":n.cancel();break;case"reverse":i=!0,n.setPlaybackRate(-1),n.play()}};switch(o){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()},o=()=>{n&&c()};l.addEventListener("mouseenter",t),l.addEventListener("mouseleave",o);break}case"click":{const t=()=>{n.isPlaying()?c():u()};l.addEventListener("click",t);break}case"scrollIntoView":{const n=n=>{var t,o;const r=n.boundingClientRect,e=n.intersectionRect;if(!(null==r?void 0:r.height)||!e)return n.intersectionRatio;const l="undefined"!=typeof window&&window.innerHeight?window.innerHeight:1/0,i=null!=(o=null==(t=n.rootBounds)?void 0:t.height)?o:1/0,u=Math.min(l,i),c=Math.min(r.height,Number.isFinite(u)?u:r.height);return c>0?e.height/c:n.intersectionRatio},t=Array.from({length:21},(n,t)=>t/20);let o=!1;new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&n(t)>=e?(o=!0,u()):o&&(o=!1,c())})},{threshold:t}).observe(l);break}}return n}function hn(n){return"#"+n}function mn(n,t,o,r){var e,l;let i=null!=(e=n.v)?e: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 f,s=o;var a;return O.has(o)&&Array.isArray(i)?f=function(n){const t=Math.round(255*n[0]),o=Math.round(255*n[1]),r=Math.round(255*n[2]);return 4===n.length?"rgba("+t+","+o+","+r+","+n[3]+")":"rgb("+t+","+o+","+r+")"}(i):"transform"!==o||null===i||"object"!=typeof i||Array.isArray(i)?U.has(o)?(Array.isArray(i)&&("translate"===o&&(i=i.map(n=>n+"px")),i=i.join(",")),"rotate"===o&&(i+="deg"),f=o+"("+i+")",s="transform"):f="d"===o?'path("'+(i&&"object"==typeof i&&Array.isArray(i.paths)?i.paths:[]).map(n=>function(n,t=!1){var o,r,e,l;const i=n.v,u=n.i,c=n.o,f=n.c;if(!i.length)return"";const s=[],a=i.length;s.push("M"+i[0][0]+","+i[0][1]);for(let n=1;n<a;n++){const e=i[n-1],l=null!=(o=null==c?void 0:c[n-1])?o:e,f=null!=(r=null==u?void 0:u[n])?r:i[n],a=i[n];t||l[0]!==e[0]||l[1]!==e[1]||f[0]!==a[0]||f[1]!==a[1]?s.push("C"+l[0]+","+l[1]+","+f[0]+","+f[1]+","+a[0]+","+a[1]):s.push("L"+a[0]+","+a[1])}if(f&&a>0){const n=i[a-1],o=null!=(e=null==c?void 0:c[a-1])?e:n,r=null!=(l=null==u?void 0:u[0])?l:i[0],f=i[0];!t&&o[0]===n[0]&&o[1]===n[1]&&r[0]===f[0]&&r[1]===f[1]||s.push("C"+o[0]+","+o[1]+","+r[0]+","+r[1]+","+f[0]+","+f[1]),s.push("z")}return s.join("")}(n,!0)).join("")+'")':""+i:(f=function(n,t){var o;if(!n)return"";const r=null==(o=null==t?void 0:t.C)||o,e=[],l=n.translate,i=n.origin,u=n.rotate,c=n.skew,f=n.scale,s=r?"px":"",a=r?"deg":"";return l&&e.push("translate("+l[0]+s+","+l[1]+s+")"),i&&e.push("translate("+i[0]+s+","+i[1]+s+")"),null!=u&&e.push("rotate("+u+a+")"),null!=c&&e.push("skewX("+c+a+")"),f&&e.push("scale("+f[0]+","+f[1]+")"),i&&e.push("translate("+-i[0]+s+","+-i[1]+s+")"),e.join("")}(i,{C:!0}),s="transform"),CSS.supports(I(s),f)||r.add(s),s=(a=s).includes("-")?a.replace(/-([a-z])/g,(n,t)=>t.toUpperCase()):a,c[s]=f,c}function bn(n,t,o){var r,e,l,i,u;const c=[];for(let a=0;a<t.length;a++){const v=t[a],d=null!=(r=v.t)?r:0;if(d<0){const o=t[a+1];if(o&&(null!=(e=o.t)?e:0)>=0){const t=(0-d)/((null!=(l=o.t)?l:0)-d),r=v.e?A(v.e)(t):t,{right:e}=w(v.e,t);c.push({t:0,v:an(n,v.v,o.v,r),e:e})}continue}if(d>o){const r=t[a-1];if(r&&(null!=(i=r.t)?i:0)<=o){const t=null!=(u=r.t)?u:0,e=(o-t)/(d-t),l=r.e?A(r.e)(e):e,{left:i}=w(r.e,e);c.length>0&&(c[c.length-1]=s(f({},c[c.length-1]),{e:i})),c.push({t:o,v:an(n,r.v,v.v,l),e:void 0})}break}c.push(v)}return c}function yn(n,t,o){var r;const e=new Map;for(const[l,i]of Object.entries(n)){const n=o.duration||1,u=bn(l,i.kfs||i.keyframes||[],n),c=[];for(let o=0;o<u.length;o++){const e=u[o],i=mn(e,S((null!=(r=e.t)?r:0)/n,0,1),l,t);0===o&&(i.offset||0)>0&&c.push(s(f({},i),{offset:0})),c.push(i)}c.length>0&&(c[c.length-1].offset||0)<1&&c.push(s(f({},c[c.length-1]),{offset:1})),c.length>0&&e.set(l,c)}return e}function gn(n){const t=function(n){if(!(null==n?void 0:n.data))throw new Error("createAnimator: `data` is required");return n.data}(n);return function(n,o){let r,e=o;n.resetOnFinish&&(e=s(f({},o),{T:()=>{var n;null==(n=null==o?void 0:o.T)||n.call(o),null==r||r.cancel()}}));const l=function(n,t,o){var r;const e=p(n)||{};if(!o)if(n.id){const t=hn(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=v.waapi){const o=p(n)||{},r=function(n){var t;if(n)return null==(t=p(n))?void 0:t.definitions}(n),e=o.duration||1e3,l=[],i=(n,o)=>{if(!o)return null;const l=function(n,t){if(!n)return[];const o=[];if("string"==typeof n){const r=sn(n,t);r&&o.push(r)}else if(Array.isArray(n))for(const r of n){const n=sn(r,t);n&&o.push(n)}else o.push(n);return o}(o,r);if(0===l.length)return null;const i=function(n,t,o,r=v.waapi){const e={};for(const[l,i]of Object.entries(n)){const n=vn(l,i,t,o);if(n.length>0){const t={kfs:n};void 0!==i.autoOrient&&(t.autoOrient=i.autoOrient),void 0!==i.loop&&(t.loop=i.loop),e[l]=r===v.waapi&&"transform"===l?q(t):t}}return e}(function(n){const t={};for(const o of n)for(const[n,r]of Object.entries(o))t[n]=r;return t}(l),e,r,t);return 0===Object.keys(i).length?null:{id:n,animate:i}},u=function(n){var t;if(!n)return;const o=null==(t=p(n))?void 0:t.animateById;return o?Object.entries(o).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 o=n.id||"_px_el_"+ ++dn;n.id=o;const r=i(o,t);r&&l.push(r)}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}(n,v.waapi),i=[],u=e.iterations;let c;"number"==typeof u&&(c=u),"infinite"===u&&(c=1/0);const f=new Set;let s=!1,a=!1;(null==l?void 0:l.length)||console.warn("createWebApiAnimator: No animation bindings defined");for(const n of l||[]){const l=n.animate;if(!l||"object"!=typeof l||Array.isArray(l)){console.warn("createWebApiAnimator: Empty or unresolved binding",n);continue}const u=hn(n.id),v=(null==o?void 0:o.querySelectorAll(u))||document.querySelectorAll(u);0===v.length&&console.warn('createWebApiAnimator: No elements found for selector "'+u+'"');const d=yn(l,f,e),p=e.delay&&e.delay>0?e.delay:void 0;let h;if(e.delay&&e.delay<0&&e.duration){const n=-e.delay;h=c===1/0?n%e.duration:Math.min(n,e.duration*(null!=c?c:1))}const m={duration:e.duration,delay:p,fill:null!=(r=e.fill)?r:"forwards",direction:e.direction,iterations:c};for(let n=0;n<v.length;n++){const o=v[n];for(const[,n]of d)if(n.length>0)try{const r=new KeyframeEffect(o,n,m),e=new Animation(r,document.timeline);(null==t?void 0:t.T)&&(e.onfinish=()=>{var n;s||(s=!0,null==(n=t.T)||n.call(t))}),(null==t?void 0:t.I)&&(e.onremove=()=>{var n;a||(a=!0,null==(n=t.I)||n.call(t))}),void 0!==h&&(e.currentTime=h),i.push(e)}catch(n){console.warn(n)}}}const d={isReady:()=>!0,getRootElement:()=>o||null,isPlaying:()=>{var n;return"running"===(null==(n=i[0])?void 0:n.playState)},play:()=>{var n;s=!1,i.forEach(n=>n.play()),null==(n=null==t?void 0:t.S)||n.call(t)},pause:()=>{var n;i.forEach(n=>n.pause()),null==(n=null==t?void 0:t.L)||n.call(t)},cancel:()=>{var n;s=!1,i.forEach(n=>n.cancel()),null==(n=null==t?void 0:t.P)||n.call(t)},finish:()=>{var n;for(const t of i)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=>(i.forEach(t=>t.playbackRate=n),d),getCurrentTime:()=>{var n,t;const o=null!=(t=null==(n=i[0])?void 0:n.currentTime)?t:null;return null!==o?+o:null},setCurrentTime:n=>{s=!1,i.forEach(t=>{t.currentTime=n})},destroy:()=>{var n;d.cancel(),i.splice(0,i.length),a||(a=!0,null==(n=null==t?void 0:t.I)||n.call(t))}};return e.trigger&&pn(d,e.trigger),d}(t,e,null);return r=l,n.debugInstName&&(window[n.debugInstName]=l),l}(p(t)||{},n.N)}var An,Mn="data";return An=a,((t,r,l,u)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let l of e(r))i.call(t,l)||void 0===l||n(t,l,{get:()=>r[l],enumerable:!(u=o(r,l))||u.enumerable});return t})(n({},"__esModule",{value:!0}),An)})();
|
|
1
|
+
"use strict";var PixodeskAnimator=(()=>{var n=Object.defineProperty,t=Object.defineProperties,o=Object.getOwnPropertyDescriptor,e=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,c=(t,o,e)=>o in t?n(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,f=(n,t)=>{for(var o in t||(t={}))i.call(t,o)&&c(n,o,t[o]);if(l)for(var o of l(t))u.call(t,o)&&c(n,o,t[o]);return n},s=(n,o)=>t(n,e(o)),a={};((t,o)=>{for(var e in o)n(t,e,{get:o[e],enumerable:!0})})(a,{PX_ANIMATOR_DATA_KEY:()=>wn,createAnimator:()=>An,setupAnimationTriggers:()=>hn});var v={waapi:"waapi",frames:"frames"},d={before:"before",after:"after"};function p(n){var t;return(null==n?void 0:n.animator)||(null==(t=null==n?void 0:n.meta)?void 0:t.animator)}function h(n,t,o){return n+(t-n)*o}function m(n,t,o){const e=[],r=Math.max(n.length,t.length);for(let l=0;l<r;l++)e[l]=h(n[l]||0,t[l]||0,o);return e}function b(n,t,o){const e=Math.max(n.length,t.length),r=[];for(let l=0;l<e;l++)r.push(y(n[l],t[l],o));return r}function y(n,t,o){var e,r,l,i,u,c,f,s,a;if(!n||!t)return n||t||{v:[]};const v=Math.min(Math.max(o,0),1),d=Math.min(n.v.length,t.v.length),p=[],h=[],b=[];for(let o=0;o<d;o++){const a=n.v[o],d=t.v[o];p.push(m(a,d,v));const y=null!=(r=null==(e=n.i)?void 0:e[o])?r:a,g=null!=(i=null==(l=t.i)?void 0:l[o])?i:d;h.push(m(y,g,v));const A=null!=(c=null==(u=n.o)?void 0:u[o])?c:a,M=null!=(s=null==(f=t.o)?void 0:f[o])?s:d;b.push(m(A,M,v))}return{v:p,i:h.length?h:void 0,o:b.length?b:void 0,c:null!=(a=n.c)?a:t.c}}function g(n,t,o){if(o<=0)return 0;if(o>=1)return 1;const e=3*n,r=3*(t-n)-e,l=1-e-r;function i(n){return((l*n+r)*n+e)*n}function u(n){return(3*l*n+2*r)*n+e}let c=o,f=0,s=1;for(let n=0;n<8;n++){const n=i(c)-o;if(Math.abs(n)<1e-6)return c;const t=u(c);if(Math.abs(t)<1e-6)break;c-=n/t}for(c=o;f<s;){const n=i(c);if(Math.abs(n-o)<1e-6)return c;o>n?f=c:s=c,c=(s+f)/2}return c}function A(n){const[t,o,e,r]=n,l=3*o,i=3*(r-o)-l,u=1-l-i;return function(n){return o=g(t,e,n),((u*o+i)*o+l)*o;var o}}function M(n,t,o){return[n[0]+(t[0]-n[0])*o,n[1]+(t[1]-n[1])*o]}function w(n,t){if(!n)return{left:void 0,right:void 0};if(t<=0)return{left:void 0,right:n};if(t>=1)return{left:n,right:void 0};const[o,e,r,l]=n,i=g(o,r,t),u=[o,e],c=[r,l],{left:f,right:s}=function(n,t,o,e,r){const l=M(n,t,r),i=M(t,o,r),u=M(o,e,r),c=M(l,i,r),f=M(i,u,r),s=M(c,f,r);return{left:[n,l,c,s],right:[s,f,u,e]}}([0,0],u,c,[1,1],i),a=f[3][0],v=f[3][1];let d,p;a>1e-9&&Math.abs(v)>1e-9&&(d=[f[1][0]/a,f[1][1]/v,f[2][0]/a,f[2][1]/v]);const h=1-a,m=1-v;return h>1e-9&&Math.abs(m)>1e-9&&(p=[(s[1][0]-a)/h,(s[1][1]-v)/m,(s[2][0]-a)/h,(s[2][1]-v)/m]),{left:d,right:p}}function j(n){if(n)return[1-n[2],1-n[3],1-n[0],1-n[1]]}function k(n){if(n){if(Array.isArray(n))return n;if("string"==typeof n)return n.startsWith("#")?function(n){const t=n.slice(1),o=t.length<=4,e=o?t[0]+t[0]:t.slice(0,2),r=o?t[1]+t[1]:t.slice(2,4),l=o?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(e,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 o=null==(t=n.match(/rgba?\((.*)\)/))?void 0:t[1];if(!o)throw new Error("Invalid rgb/rgba format");const e=o.split(",").map(n=>+n.trim());return[e[0]/255,e[1]/255,e[2]/255,...void 0!==e[3]?[e[3]]:[]]}(n):void console.warn("Unsupported color format: "+n)}}var O=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),U=new Set(["translate","rotate","scale","skew"]),C=new Set(["offset-distance","offsetDistance"]);function T(n){return!n.includes("-")&&/[a-z][A-Z]/.test(n)}var I=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 S(n){return I.has(n)?n:n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function P(n,t,o){return Math.max(t,Math.min(n,o))}function z(n,t,o,e,r){if(r<=0)return[n[0],n[1]];if(r>=1)return[e[0],e[1]];const l=1-r,i=l*l,u=r*r,c=i*l,f=3*r*i,s=3*u*l,a=u*r;return[c*n[0]+f*t[0]+s*o[0]+a*e[0],c*n[1]+f*t[1]+s*o[1]+a*e[1]]}var L=1e-4;function x(n,t,o,e,r){const l=N(n,t,o,e,r);return 0===l[0]&&0===l[1]?N(n,t,o,e,r<.5?r+L:r-L):l}function N(n,t,o,e,r){const l=1-r,i=3*l*l,u=6*r*l,c=3*r*r;return[i*(t[0]-n[0])+u*(o[0]-t[0])+c*(e[0]-o[0]),i*(t[1]-n[1])+u*(o[1]-t[1])+c*(e[1]-o[1])]}function _(n,t){const{ts:o,ds:e}=n,r=o.length-1;if(t<=o[0])return e[0];if(t>=o[r])return e[r];let l=1,i=r;for(;l<i;){const n=l+i>>>1;o[n]<t?l=n+1:i=n}const u=o[i-1],c=o[i]-u,f=c>0?(t-u)/c:0;return e[i-1]+f*(e[i]-e[i-1])}function E(n){var t;const o=null!=(t=n.value)?t:n.v;if(!o)return;if(Array.isArray(o)&&o.length>=2&&"number"==typeof o[0]&&"number"==typeof o[1])return[o[0],o[1]];const e=o.translate;return Array.isArray(e)&&e.length>=2?[e[0],e[1]]:void 0}function F(n){var t,o;return null!=(o=null!=(t=n.time)?t:n.t)?o:0}function W(n){var t;return null!=(t=n.easing)?t:n.e}var Z=new WeakMap;function R(n,t,o,e){var r,l;let i=Z.get(n);const u=null==i?void 0:i.get(t);if(u)return u;const c=null!=(r=n.tangentOut)?r:n.to,f=null!=(l=t.tangentIn)?l:t.ti,s=[o[0]+(c?c[0]:0),o[1]+(c?c[1]:0)],a=[e[0]+(f?f[0]:0),e[1]+(f?f[1]:0)],v=function(n,t,o,e,r=100){const l=r+1,i=new Float64Array(l),u=new Float64Array(l);let c=z(n,t,o,e,0);i[0]=0,u[0]=0;let f=0;for(let s=1;s<l;s++){const l=s/r,a=z(n,t,o,e,l),v=a[0]-c[0],d=a[1]-c[1];f+=Math.sqrt(v*v+d*d),i[s]=l,u[s]=f,c=a}return{ts:i,ds:u}}(o,s,a,e),d={P0:o,P1:s,P2:a,P3:e,l:v,h:v.ds[v.ds.length-1]};return i||(i=new WeakMap,Z.set(n,i)),i.set(t,d),d}var D=.5,V=5,X=32;function q(n,t){var o,e,r,l;if(!function(n){var t,o,e;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!=(o=n.tangentIn)?o:n.ti)||(null!=(e=n.tangentOut)?e:n.to))return!0;return!1}(n))return n;const i=null!=(o=n.keyframes)?o:n.kfs;if(!Array.isArray(i)||i.length<2)return n;const u=!!n.autoOrient,c=null!=(e=null==t?void 0:t.m)?e:D,f=null!=(r=null==t?void 0:t.A)?r:V,s=null!=(l=null==t?void 0:t.M)?l:X,a=[],v=E(i[0]);if(!v)return n;const d=u?function(n,t){const o=E(n),e=E(t);if(!o||!e)return 0;const r=R(n,t,o,e),l=x(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;a.push(Y(F(i[0]),$(H(i[0]),H(i[0]),0,v,d,u)));for(let n=0;n<i.length-1;n++){const t=i[n],o=i[n+1],e=E(t),r=E(o);e&&r?(u&&n>0&&Q(a,t,o,e,r,f),J(a,t,o,e,r,u,c,f,s)):a.push(Y(F(o),$(H(o),H(o),1,null!=r?r:[0,0],void 0,u)))}const p=W(i[i.length-1]);p&&(a[a.length-1].e=p),u&&function(n){var t;let o;for(const e of n){const n=null!=(t=e.v)?t:e.value;if(!n||"number"!=typeof n.rotate)continue;if(void 0===o){o=n.rotate;continue}let r=n.rotate;for(;r-o>180;)r-=360;for(;r-o<-180;)r+=360;n.rotate=r,o=r}}(a);const h={kfs:a};return void 0!==n.loop&&(h.loop=n.loop),h}function Y(n,t){return{t:n,v:t}}function H(n){var t;const o=null!=(t=n.value)?t:n.v;if(o&&"object"==typeof o&&!Array.isArray(o))return o}function K(n,t,o){if(void 0===n)return t;if(void 0===t)return n;if("number"==typeof n&&"number"==typeof t)return n+(t-n)*o;if(Array.isArray(n)&&Array.isArray(t)&&n.length===t.length){const e=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;e[r]=l+(i-l)*o}return e}return o<.5?n:t}function $(n,t,o,e,r,l){const i={translate:e},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 e of u){if("translate"===e)continue;if("rotate"===e&&l)continue;const r=null==n?void 0:n[e],u=null==t?void 0:t[e];void 0===r&&void 0===u||(i[e]=K(r,u,o))}return void 0!==r&&(i.rotate=r+B(n,t,o)),i}function B(n,t,o){const e="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===e&&void 0===r)return 0;const l=K(e,r,o);return"number"==typeof l?l:0}function Q(n,t,o,e,r,l){var i;const u=n[n.length-1],c=null!=(i=u.v)?i:u.value,f=null==c?void 0:c.rotate;if("number"!=typeof f)return;const s=H(t),a=f-B(s,s,0),v=R(t,o,e,r),d=x(v.P0,v.P1,v.P2,v.P3,0),p=180*Math.atan2(d[1],d[0])/Math.PI,h=function(n,t){let o=n-t;for(;o>180;)o-=360;for(;o<-180;)o+=360;return o}(p,a);if(Math.abs(h)<=l)return;const m=F(t),b=Math.min(m+G,(m+F(o))/2),y=$(H(t),H(t),0,e,p,!0);n.push(Y(b,y))}var G=.05;function J(n,t,o,e,r,l,i,u,c){const f=R(t,o,e,r),s=F(t),a=F(o),v=W(t),d=(p=v)?A([p[1],p[0],p[3],p[2]]):n=>n;var p;const h=H(t),m=H(o),b=function(n,t,o,e,r){const l=[];nn(n.P0[0],n.P1[0],n.P2[0],n.P3[0],l),nn(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={j:r-i.length};for(let r=0;r<i.length-1;r++)tn(i[r],i[r+1],u,n,t,o,e,c);return u}(f,l,i,u,c),y=[];for(const n of b){const t=_(f.l,n),o=P(f.h>0?t/f.h:n,0,1),e={u:P(d(o),0,1),p:o,k:z(f.P0,f.P1,f.P2,f.P3,n)};if(l){const t=x(f.P0,f.P1,f.P2,f.P3,n);e.O=180*Math.atan2(t[1],t[0])/Math.PI}y.push(e)}let g=v,M=0;const j=n.length-1;for(let t=0;t<y.length;t++){const o=y[t],e=M<1?P((o.u-M)/(1-M),0,1):1,{left:r,right:i}=w(g,e),u=0===t?j:n.length-1;r?n[u].e=r:delete n[u].e;const c=s+o.u*(a-s),f=$(h,m,o.p,o.k,o.O,l);n.push(Y(c,f)),g=i,M=o.u}}function nn(n,t,o,e,r){const l=t-n,i=o-t,u=l-2*i+(e-o),c=2*(i-l),f=l;if(Math.abs(u)<1e-10){if(Math.abs(c)>1e-10){const n=-f/c;n>1e-6&&n<.999999&&r.push(n)}return}const s=c*c-4*u*f;if(s<0)return;const a=Math.sqrt(s),v=(-c-a)/(2*u),d=(-c+a)/(2*u);v>1e-6&&v<.999999&&r.push(v),d>1e-6&&d<.999999&&r.push(d)}function tn(n,t,o,e,r,l,i,u){const c=(n+t)/2,f=z(e.P0,e.P1,e.P2,e.P3,n),s=z(e.P0,e.P1,e.P2,e.P3,t),a=t-n,v=z(e.P0,e.P1,e.P2,e.P3,n+.25*a),d=z(e.P0,e.P1,e.P2,e.P3,c),p=z(e.P0,e.P1,e.P2,e.P3,n+.75*a),h=Math.max(on(v,f,s),on(d,f,s),on(p,f,s));let m=!0;if(r){const o=x(e.P0,e.P1,e.P2,e.P3,n),r=x(e.P0,e.P1,e.P2,e.P3,t),l=180*Math.atan2(o[1],o[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&&(m=!1)}h<=l&&m||u.j<=0||a<1e-6?o.push(t):(u.j-=1,tn(n,c,o,e,r,l,i,u),tn(c,t,o,e,r,l,i,u))}function on(n,t,o){const e=o[0]-t[0],r=o[1]-t[1],l=e*e+r*r;if(l<1e-20){const o=n[0]-t[0],e=n[1]-t[1];return Math.sqrt(o*o+e*e)}const i=(n[0]-t[0])*r-(n[1]-t[1])*e;return Math.abs(i)/Math.sqrt(l)}var en=1;function rn(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 o=Object.keys(n),e=Object.keys(t);return o.length===e.length&&o.every(o=>rn(n[o],t[o]))}function ln(n){const t=[];let o;const e=function(n){const t=n.split(/([MLCZmlcz]|[\s,]+)/).map(n=>n.trim()).filter(n=>n&&","!==n),o=[];let e=null;for(const n of t)if(/[MLCZmlcz]/.test(n))e={type:n,values:[]},o.push(e);else if(e){const t=+n;e.values.push(Number.isNaN(t)?0:t)}return o}(n);for(const n of e){const e=n.type,r=n.values;if("M"===e||"m"===e){const n=r[0]||0,e=r[1]||0;o={v:[[n,e]],i:[[n,e]],o:[[n,e]],c:!1},t.push(o);continue}if(o||(o={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},t.push(o)),"L"===e){const n=r[0]||0,t=r[1]||0;o.v.push([n,t]),o.i.push([n,t]),o.o.push([n,t])}else if("C"===e){const n=r[0]||0,t=r[1]||0,e=r[2]||0,l=r[3]||0,i=r[4]||0,u=r[5]||0;o.o[o.o.length-1]=[n,t],o.v.push([i,u]),o.i.push([e,l]),o.o.push([i,u])}else"Z"===e||"z"===e?o.c=!0:console.warn('Unsupported path command "'+e+'"')}return t}function un(n){return n.startsWith("path(")&&n.endsWith(")")?n.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(n)?n:void 0}function cn(n){return"string"==typeof n&&void 0!==un(n)}function fn(n){if(n&&"object"==typeof n&&"string"==typeof n.path){const t=un(n.path);return t?{paths:ln(t)}:n}if(n&&"object"==typeof n&&"paths"in n){const t=n.paths;if(Array.isArray(t)&&t.length>0&&cn(t[0])){const n=[];for(const o of t){const t=un(o);t&&n.push(...ln(t))}return{paths:n}}return n}if(Array.isArray(n)){if(n.length>0&&cn(n[0])){const t=[];for(const o of n){const n=un(o);n&&t.push(...ln(n))}return{paths:t}}return{paths:n}}return cn(n)?{paths:ln(un(n))}:n}function sn(n,t){var o;if(n)return Array.isArray(n)?n:(null==(o=null==t?void 0:t.easings)?void 0:o[n])?t.easings[n]:void console.warn("Unknown easing name: "+n)}function an(n,t){var o;if("string"==typeof n){const e=null==(o=null==t?void 0:t.animations)?void 0:o[n];return e||console.warn("Unknown animation name: "+n),e}return n}function vn(n,t,o,e){var r,l;return"d"===n?{paths:b(null!=(r=null==t?void 0:t.paths)?r:Array.isArray(t)?t:[],null!=(l=null==o?void 0:o.paths)?l:Array.isArray(o)?o:[],e)}:O.has(n)?function(n,t,o){return[h(n[0]||0,t[0]||0,o),h(n[1]||0,t[1]||0,o),h(n[2]||0,t[2]||0,o),h(void 0===n[3]?1:n[3],void 0===t[3]?1:t[3],o)]}(t||[0,0,0,1],o||[0,0,0,1],e):"transform"!==n||"object"!=typeof t||null===t||Array.isArray(t)||"object"!=typeof o||null===o||Array.isArray(o)?"rotate"===n&&"number"==typeof t&&"number"==typeof o?h(t,o,e):U.has(n)||"stroke-dasharray"===n||"strokeDasharray"===n?m(t||[],o||[],e):h(+(t||0),+(o||0),e):function(n,t,o){const e=new Set([...Object.keys(null!=n?n:{}),...Object.keys(null!=t?t:{})]),r={};for(const l of e){const e=null==n?void 0:n[l],i=null==t?void 0:t[l];if("rotate"===l||"skew"===l)r[l]=h(+(null!=e?e:0),+(null!=i?i:0),o);else if("translate"===l||"scale"===l||"origin"===l){const n="scale"===l?[1,1]:[0,0];r[l]=m(e||n,i||n,o)}else r[l]=null!=i?i:e}return r}(t,o,e)}function dn(n,t,o,e){var r,l,i,u,c,a,v;const p=t.keyframes||t.kfs||[],h=[];for(const t of p){const o=null!=(l=null!=(r=t.time)?r:t.t)?l:0;let f=null!=(i=t.value)?i:t.v;const s=null!=(u=t.easing)?u:t.e;"d"===n&&(f=fn(f));const d=T(n)?S(n):n;O.has(d)&&(f=null!=(c=k(f))?c:f);const p={t:o,v:f,e:sn(s,e)},m=null!=(a=t.tangentIn)?a:t.ti,b=null!=(v=t.tangentOut)?v:t.to;m&&(p.tangentIn=m),b&&(p.tangentOut=b),h.push(p)}h.sort((n,t)=>{var o,e;return(null!=(o=n.t)?o:0)-(null!=(e=t.t)?e:0)});const m=t.loop,b=!0===m?{}:m||void 0;return b&&h.length>=2?function(n,t,o,e){var r,l,i,u,c;const a=t.length-1,v=P(null!=(r=o.segmentCount)?r:a,1,a);let p;p=o.extend===d.before?t.slice(0,v+1):t.slice(a-v);const h=null!=(l=t[0].t)?l:0,m=null!=(i=t[t.length-1].t)?i:0;let b,y;o.extend===d.before?(b=0,y=h):(b=m,y=e);const g=y-b;if(g<=0)return t;const M=null!=(u=p[0].t)?u:0,k=(null!=(c=p[p.length-1].t)?c:0)-M;if(k<=0)return t;const O=p.map(n=>{var t,o;return{U:(n.t-M)/k,v:n.v,e:n.e,tangentIn:null!=(t=n.tangentIn)?t:n.ti,tangentOut:null!=(o=n.tangentOut)?o:n.to}}),U=Math.floor(g/k),C=g-U*k,T=C/k,I=[],S=o.extend!==d.before,z=t[t.length-1];let L,x=!1;function N(t,o,e){var r;let l;if(o){l=[];for(let n=O.length-1;n>=0;n--)l.push({U:1-O[n].U,v:O[n].v,e:n>0?j(O[n-1].e):void 0,tangentIn:O[n].tangentOut,tangentOut:O[n].tangentIn})}else l=O;const i=void 0!==e?e:1;for(let o=0;o<l.length;o++){const e=l[o];if(e.U>i+1e-9){const r=l[o-1],u=e.U-r.U,c=(i-r.U)/u,f=r.e?A(r.e)(c):c,s=vn(n,r.v,e.v,f),{left:a}=w(r.e,c);return I.length>0&&r.U<=i&&(I[I.length-1].e=a),void I.push({t:t+i*k,v:s,e:void 0})}const u=I.length>0?I[I.length-1]:z,c=S&&0===o&&void 0!==u&&Math.abs((null!=(r=u.t)?r:0)-(t+e.U*k))<1e-9;if(c){if(rn(u.v,e.v)){I.length>0?(u.e=e.e,u.tangentOut=e.tangentOut):(L=e.e,x=!0);continue}I.length>0&&(delete u.tangentIn,delete u.tangentOut)}const f={t:t+e.U*k+(c?en:0),v:e.v,e:o<l.length-1?e.e:void 0};e.tangentIn&&(f.tangentIn=e.tangentIn),e.tangentOut&&(f.tangentOut=e.tangentOut),I.push(f)}}if(o.extend===d.before){T>1e-9&&function(t,o,e){let r;if(o){r=[];for(let n=O.length-1;n>=0;n--)r.push({U:1-O[n].U,v:O[n].v,e:n>0?j(O[n-1].e):void 0,tangentIn:O[n].tangentOut,tangentOut:O[n].tangentIn})}else r=O;const l=1-e;for(let o=0;o<r.length;o++){const e=r[o];if(e.U<l-1e-9)continue;const i=r[o-1];if(i&&i.U<l-1e-9&&e.U>l+1e-9){const o=e.U-i.U,r=(l-i.U)/o,u=i.e?A(i.e)(r):r,c=vn(n,i.v,e.v,u),{right:f}=w(i.e,r);I.push({t:t,v:c,e:f})}const u={t:t+(e.U-l)*k,v:e.v,e:o<r.length-1?e.e:void 0};e.tangentIn&&(u.tangentIn=e.tangentIn),e.tangentOut&&(u.tangentOut=e.tangentOut),I.push(u)}}(b,!!o.alternate&&U%2==0,T);for(let n=0;n<U;n++){const t=U-1-n,e=!!o.alternate&&t%2==0;N(b+C+n*k,e)}}else{for(let n=0;n<U;n++){const t=!!o.alternate&&n%2==0;N(b+n*k,t)}if(T>1e-9){const n=!!o.alternate&&U%2==0;N(b+U*k,n,T)}}return o.extend===d.before?[...I,...t]:x&&t.length>0?[...t.slice(0,-1),s(f({},t[t.length-1]),{e:L}),...I]:[...t,...I]}(n,h,b,o):h}var pn=0;function hn(n,t){const{startOn:o,outAction:e="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(e){case"pause":n.pause();break;case"reset":n.cancel();break;case"reverse":i=!0,n.setPlaybackRate(-1),n.play()}};switch(o){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()},o=()=>{n&&c()};l.addEventListener("mouseenter",t),l.addEventListener("mouseleave",o);break}case"click":{const t=()=>{n.isPlaying()?c():u()};l.addEventListener("click",t);break}case"scrollIntoView":{const n=n=>{var t,o;const e=n.boundingClientRect,r=n.intersectionRect;if(!(null==e?void 0:e.height)||!r)return n.intersectionRatio;const l="undefined"!=typeof window&&window.innerHeight?window.innerHeight:1/0,i=null!=(o=null==(t=n.rootBounds)?void 0:t.height)?o:1/0,u=Math.min(l,i),c=Math.min(e.height,Number.isFinite(u)?u:e.height);return c>0?r.height/c:n.intersectionRatio},t=Array.from({length:21},(n,t)=>t/20);let o=!1;new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&n(t)>=r?(o=!0,u()):o&&(o=!1,c())})},{threshold:t}).observe(l);break}}return n}function mn(n){return"#"+n}function bn(n,t,o,e){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 f,s=o;var a;return O.has(o)&&Array.isArray(i)?f=function(n){const t=Math.round(255*n[0]),o=Math.round(255*n[1]),e=Math.round(255*n[2]);return 4===n.length?"rgba("+t+","+o+","+e+","+n[3]+")":"rgb("+t+","+o+","+e+")"}(i):"transform"!==o||null===i||"object"!=typeof i||Array.isArray(i)?U.has(o)?(Array.isArray(i)&&("translate"===o&&(i=i.map(n=>n+"px")),i=i.join(",")),"rotate"===o&&(i+="deg"),f=o+"("+i+")",s="transform"):f="d"===o?'path("'+(i&&"object"==typeof i&&Array.isArray(i.paths)?i.paths:[]).map(n=>function(n,t=!1){var o,e,r,l;const i=n.v,u=n.i,c=n.o,f=n.c;if(!i.length)return"";const s=[],a=i.length;s.push("M"+i[0][0]+","+i[0][1]);for(let n=1;n<a;n++){const r=i[n-1],l=null!=(o=null==c?void 0:c[n-1])?o:r,f=null!=(e=null==u?void 0:u[n])?e:i[n],a=i[n];t||l[0]!==r[0]||l[1]!==r[1]||f[0]!==a[0]||f[1]!==a[1]?s.push("C"+l[0]+","+l[1]+","+f[0]+","+f[1]+","+a[0]+","+a[1]):s.push("L"+a[0]+","+a[1])}if(f&&a>0){const n=i[a-1],o=null!=(r=null==c?void 0:c[a-1])?r:n,e=null!=(l=null==u?void 0:u[0])?l:i[0],f=i[0];!t&&o[0]===n[0]&&o[1]===n[1]&&e[0]===f[0]&&e[1]===f[1]||s.push("C"+o[0]+","+o[1]+","+e[0]+","+e[1]+","+f[0]+","+f[1]),s.push("z")}return s.join("")}(n,!0)).join("")+'")':C.has(o)&&"number"==typeof i?100*i+"%":""+i:(f=function(n,t){var o;if(!n)return"";const e=null==(o=null==t?void 0:t.C)||o,r=[],l=n.translate,i=n.origin,u=n.rotate,c=n.skew,f=n.scale,s=e?"px":"",a=e?"deg":"";return l&&r.push("translate("+l[0]+s+","+l[1]+s+")"),i&&r.push("translate("+i[0]+s+","+i[1]+s+")"),null!=u&&r.push("rotate("+u+a+")"),null!=c&&r.push("skewX("+c+a+")"),f&&r.push("scale("+f[0]+","+f[1]+")"),i&&r.push("translate("+-i[0]+s+","+-i[1]+s+")"),r.join("")}(i,{C:!0}),s="transform"),CSS.supports(S(s),f)||e.add(s),s=(a=s).includes("-")?a.replace(/-([a-z])/g,(n,t)=>t.toUpperCase()):a,c[s]=f,c}function yn(n,t,o){var e,r,l,i,u;const c=[];for(let a=0;a<t.length;a++){const v=t[a],d=null!=(e=v.t)?e:0;if(d<0){const o=t[a+1];if(o&&(null!=(r=o.t)?r:0)>=0){const t=(0-d)/((null!=(l=o.t)?l:0)-d),e=v.e?A(v.e)(t):t,{right:r}=w(v.e,t);c.push({t:0,v:vn(n,v.v,o.v,e),e:r})}continue}if(d>o){const e=t[a-1];if(e&&(null!=(i=e.t)?i:0)<=o){const t=null!=(u=e.t)?u:0,r=(o-t)/(d-t),l=e.e?A(e.e)(r):r,{left:i}=w(e.e,r);c.length>0&&(c[c.length-1]=s(f({},c[c.length-1]),{e:i})),c.push({t:o,v:vn(n,e.v,v.v,l),e:void 0})}break}c.push(v)}return c}function gn(n,t,o){var e;const r=new Map;for(const[l,i]of Object.entries(n)){const n=o.duration||1,u=yn(l,i.kfs||i.keyframes||[],n),c=[];for(let o=0;o<u.length;o++){const r=u[o],i=bn(r,P((null!=(e=r.t)?e:0)/n,0,1),l,t);0===o&&(i.offset||0)>0&&c.push(s(f({},i),{offset:0})),c.push(i)}c.length>0&&(c[c.length-1].offset||0)<1&&c.push(s(f({},c[c.length-1]),{offset:1})),c.length>0&&r.set(l,c)}return r}function An(n){const t=function(n){if(!(null==n?void 0:n.data))throw new Error("createAnimator: `data` is required");return n.data}(n);return function(n,o){let e,r=o;n.resetOnFinish&&(r=s(f({},o),{T:()=>{var n;null==(n=null==o?void 0:o.T)||n.call(o),null==e||e.cancel()}}));const l=function(n,t,o){var e;const r=p(n)||{};if(!o)if(n.id){const t=mn(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=v.waapi){const o=p(n)||{},e=function(n){var t;if(n)return null==(t=p(n))?void 0:t.definitions}(n),r=o.duration||1e3,l=[],i=(n,o)=>{if(!o)return null;const l=function(n,t){if(!n)return[];const o=[];if("string"==typeof n){const e=an(n,t);e&&o.push(e)}else if(Array.isArray(n))for(const e of n){const n=an(e,t);n&&o.push(n)}else o.push(n);return o}(o,e);if(0===l.length)return null;const i=function(n,t,o,e=v.waapi){const r={};for(const[l,i]of Object.entries(n)){if("transform"===l&&"offsetPath"===i.I&&void 0!==n.offsetDistance)continue;const u=dn(l,i,t,o);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]=e===v.waapi&&"transform"===l?q(n):n}}return r}(function(n){const t={};for(const o of n)for(const[n,e]of Object.entries(o))t[n]=e;return t}(l),r,e,t);return 0===Object.keys(i).length?null:{id:n,animate:i}},u=function(n){var t;if(!n)return;const o=null==(t=p(n))?void 0:t.animateById;return o?Object.entries(o).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 o=n.id||"_px_el_"+ ++pn;n.id=o;const e=i(o,t);e&&l.push(e)}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}(n,v.waapi),i=[],u=r.iterations;let c;"number"==typeof u&&(c=u),"infinite"===u&&(c=1/0);const f=new Set;let s=!1,a=!1;(null==l?void 0:l.length)||console.warn("createWebApiAnimator: No animation bindings defined");for(const n of l||[]){const l=n.animate;if(!l||"object"!=typeof l||Array.isArray(l)){console.warn("createWebApiAnimator: Empty or unresolved binding",n);continue}const u=mn(n.id),v=(null==o?void 0:o.querySelectorAll(u))||document.querySelectorAll(u);0===v.length&&console.warn('createWebApiAnimator: No elements found for selector "'+u+'"');const d=gn(l,f,r),p=r.delay&&r.delay>0?r.delay:void 0;let h;if(r.delay&&r.delay<0&&r.duration){const n=-r.delay;h=c===1/0?n%r.duration:Math.min(n,r.duration*(null!=c?c:1))}const m={duration:r.duration,delay:p,fill:null!=(e=r.fill)?e:"forwards",direction:r.direction,iterations:c};for(let n=0;n<v.length;n++){const o=v[n];for(const[,n]of d)if(n.length>0)try{const e=new KeyframeEffect(o,n,m),r=new Animation(e,document.timeline);(null==t?void 0:t.T)&&(r.onfinish=()=>{var n;s||(s=!0,null==(n=t.T)||n.call(t))}),(null==t?void 0:t.S)&&(r.onremove=()=>{var n;a||(a=!0,null==(n=t.S)||n.call(t))}),void 0!==h&&(r.currentTime=h),i.push(r)}catch(n){console.warn(n)}}}const d={isReady:()=>!0,getRootElement:()=>o||null,isPlaying:()=>{var n;return"running"===(null==(n=i[0])?void 0:n.playState)},play:()=>{var n;s=!1,i.forEach(n=>n.play()),null==(n=null==t?void 0:t.P)||n.call(t)},pause:()=>{var n;i.forEach(n=>n.pause()),null==(n=null==t?void 0:t.L)||n.call(t)},cancel:()=>{var n;s=!1,i.forEach(n=>n.cancel()),null==(n=null==t?void 0:t.N)||n.call(t)},finish:()=>{var n;for(const t of i)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=>(i.forEach(t=>t.playbackRate=n),d),getCurrentTime:()=>{var n,t;const o=null!=(t=null==(n=i[0])?void 0:n.currentTime)?t:null;return null!==o?+o:null},setCurrentTime:n=>{s=!1,i.forEach(t=>{t.currentTime=n})},destroy:()=>{var n;d.cancel(),i.splice(0,i.length),a||(a=!0,null==(n=null==t?void 0:t.S)||n.call(t))}};return r.trigger&&hn(d,r.trigger),d}(t,r,null);return e=l,n.debugInstName&&(window[n.debugInstName]=l),l}(p(t)||{},n._)}var Mn,wn="data";return Mn=a,((t,e,l,u)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let l of r(e))i.call(t,l)||void 0===l||n(t,l,{get:()=>e[l],enumerable:!(u=o(e,l))||u.enumerable});return t})(n({},"__esModule",{value:!0}),Mn)})();
|
|
@@ -836,7 +836,7 @@ var PixodeskAnimator = (() => {
|
|
|
836
836
|
}
|
|
837
837
|
|
|
838
838
|
// ../svg-animator-core/src/PxDefinitions.ts
|
|
839
|
-
var LOOP_JUMP_SHIFT_MS =
|
|
839
|
+
var LOOP_JUMP_SHIFT_MS = 1;
|
|
840
840
|
function deepEqualValue(a, b) {
|
|
841
841
|
if (a === b) return true;
|
|
842
842
|
if (typeof a !== typeof b || a === null || b === null || typeof a !== "object") return false;
|
|
@@ -1085,6 +1085,8 @@ var PixodeskAnimator = (() => {
|
|
|
1085
1085
|
const looped = [];
|
|
1086
1086
|
const separateBoundary = loop.extend !== PxLoopExtend.before;
|
|
1087
1087
|
const originalTerminalKf = keyframes[keyframes.length - 1];
|
|
1088
|
+
let terminalEasingOverride;
|
|
1089
|
+
let hasTerminalEasingOverride = false;
|
|
1088
1090
|
function appendRep(repStart, isReversed, partial) {
|
|
1089
1091
|
var _a2;
|
|
1090
1092
|
let entries;
|
|
@@ -1125,7 +1127,16 @@ var PixodeskAnimator = (() => {
|
|
|
1125
1127
|
const prevKf = looped.length > 0 ? looped[looped.length - 1] : originalTerminalKf;
|
|
1126
1128
|
const isBoundary = separateBoundary && i === 0 && prevKf !== void 0 && Math.abs(((_a2 = prevKf.t) != null ? _a2 : 0) - (repStart + entry.relT * segDuration)) < 1e-9;
|
|
1127
1129
|
if (isBoundary) {
|
|
1128
|
-
if (deepEqualValue(prevKf.v, entry.v))
|
|
1130
|
+
if (deepEqualValue(prevKf.v, entry.v)) {
|
|
1131
|
+
if (looped.length > 0) {
|
|
1132
|
+
prevKf.e = entry.e;
|
|
1133
|
+
prevKf.tangentOut = entry.tangentOut;
|
|
1134
|
+
} else {
|
|
1135
|
+
terminalEasingOverride = entry.e;
|
|
1136
|
+
hasTerminalEasingOverride = true;
|
|
1137
|
+
}
|
|
1138
|
+
continue;
|
|
1139
|
+
}
|
|
1129
1140
|
if (looped.length > 0) {
|
|
1130
1141
|
delete prevKf.tangentIn;
|
|
1131
1142
|
delete prevKf.tangentOut;
|
|
@@ -1206,6 +1217,11 @@ var PixodeskAnimator = (() => {
|
|
|
1206
1217
|
if (loop.extend === PxLoopExtend.before) {
|
|
1207
1218
|
return [...looped, ...keyframes];
|
|
1208
1219
|
} else {
|
|
1220
|
+
if (hasTerminalEasingOverride && keyframes.length > 0) {
|
|
1221
|
+
const head = keyframes.slice(0, -1);
|
|
1222
|
+
const tail = __spreadProps(__spreadValues({}, keyframes[keyframes.length - 1]), { e: terminalEasingOverride });
|
|
1223
|
+
return [...head, tail, ...looped];
|
|
1224
|
+
}
|
|
1209
1225
|
return [...keyframes, ...looped];
|
|
1210
1226
|
}
|
|
1211
1227
|
}
|
|
@@ -1262,6 +1278,9 @@ var PixodeskAnimator = (() => {
|
|
|
1262
1278
|
function normalizeAnimationDefinition(animDef, duration, defs, engine = PxAnimatorEngine.waapi) {
|
|
1263
1279
|
const normalized = {};
|
|
1264
1280
|
for (const [propName, propAnim] of Object.entries(animDef)) {
|
|
1281
|
+
if (propName === "transform" && propAnim.alongPathMode === "offsetPath" && animDef["offsetDistance"] !== void 0) {
|
|
1282
|
+
continue;
|
|
1283
|
+
}
|
|
1265
1284
|
const normalizedKfs = normalizeKeyframes(propName, propAnim, duration, defs);
|
|
1266
1285
|
if (normalizedKfs.length > 0) {
|
|
1267
1286
|
const out = { kfs: normalizedKfs };
|
|
@@ -1924,6 +1943,8 @@ var PixodeskAnimator = (() => {
|
|
|
1924
1943
|
} else if (propName === "d") {
|
|
1925
1944
|
const paths = value && typeof value === "object" && Array.isArray(value.paths) ? value.paths : [];
|
|
1926
1945
|
cssValue = 'path("' + paths.map((bz) => bezierToSvgPath(bz, true)).join("") + '")';
|
|
1946
|
+
} else if (PCT_BASED_ATTR_NAMES.has(propName) && typeof value === "number") {
|
|
1947
|
+
cssValue = value * 100 + "%";
|
|
1927
1948
|
} else {
|
|
1928
1949
|
cssValue = "" + value;
|
|
1929
1950
|
}
|