@pixodesk/svg-animator-web 1.0.43 → 1.0.44

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