@pixodesk/svg-animator-web 1.0.41 → 1.0.43

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 t,e=Object.defineProperty,n=Object.defineProperties,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,c=(t,e)=>{for(var n in e||(e={}))s.call(e,n)&&u(t,n,e[n]);if(a)for(var n of a(e))l.call(e,n)&&u(t,n,e[n]);return t},f=(t,e)=>n(t,o(e)),d={};((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(d,{PxAnimatorConfigSchema:()=>$t,PxDefinitionsSchema:()=>Vt,PxDiagnosticKind:()=>no,PxNodeBaseSchema:()=>ke,PxScrollSchema:()=>Gt,PxSvgNodeRootSchema:()=>we,PxTimelineEngineSetting:()=>rt,PxTriggerSchema:()=>Lt,createAdapterAnimator:()=>bi,createAnimator:()=>Hi,generateNewIds:()=>Se,loadTagAnimators:()=>Ji,px:()=>U,renderNode:()=>Zi,setupAnimationTriggers:()=>Ei,toDomProps:()=>mn,validateDocument:()=>be}),module.exports=(t=d,((t,n,o,a)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let o of i(n))s.call(t,o)||void 0===o||e(t,o,{get:()=>n[o],enumerable:!(a=r(n,o))||a.enumerable});return t})(e({},"__esModule",{value:!0}),t));var h=Object.defineProperty,p=Object.defineProperties,m=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,b=Math.pow,k=(t,e,n)=>e in t?h(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,A=(t,e)=>{for(var n in e||(e={}))v.call(e,n)&&k(t,n,e[n]);if(g)for(var n of g(e))y.call(e,n)&&k(t,n,e[n]);return t},w=(t,e)=>p(t,m(e)),x=(t,e)=>{var n={};for(var r in t)v.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&g)for(var r of g(t))e.indexOf(r)<0&&y.call(t,r)&&(n[r]=t[r]);return n};function j(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var O=class{_canSanitize(t){return this.isValid(t)}optional(){return new P(this)}},P=class extends O{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,e,n){return null==t||this.inner.isValid(t,e,n)}_canSanitize(t){return null==t||this.inner._canSanitize(t)}},S=class extends O{constructor(t=""){super(),this._default=t}sanitize(t){return"string"==typeof t?t:this._default}isValid(t,e,n){return"string"==typeof t||(null==e||e.errors.push(j(null!=n?n:[])+": expected string, got "+typeof t),!1)}},M=class extends O{constructor(t=0){super(),this._default=t}sanitize(t){return"number"==typeof t&&isFinite(t)?t:this._default}isValid(t,e,n){return!("number"!=typeof t||!isFinite(t))||(null==e||e.errors.push(j(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},_=class extends O{constructor(t=!1){super(),this._default=t}sanitize(t){return"boolean"==typeof t?t:this._default}isValid(t,e,n){return"boolean"==typeof t||(null==e||e.errors.push(j(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},E=class extends O{constructor(t){super(),this.value=t,this._default=t}sanitize(t){return t===this.value?this.value:this._default}isValid(t,e,n){return t===this.value||(null==e||e.errors.push(j(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},N=class extends O{constructor(t,e){super(),this.values=t,this._default=null!=e?e:t[0]}sanitize(t){return this.values.includes(t)?t:this._default}isValid(t,e,n){return!!this.values.includes(t)||(null==e||e.errors.push(j(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},C=class extends O{constructor(t,e){super(),this.schemas=t,this._kind="union",this._default=null!=e?e:t[0]._default}sanitize(t){for(const e of this.schemas)if(e.isValid(t))return e.sanitize(t);return this._default}isValid(t,e,n){var r;const o=e&&{errors:[],warnings:[],strict:e.strict};if(this.schemas.some(e=>e.isValid(t,o,n?[...n]:void 0)))return!0;if(!e)return!1;const i=j(null!=n?n:[]);let a;e.errors.push(i+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,240));let s=-1;const l=[];for(const r of this.schemas){const o={errors:[],warnings:[],strict:e.strict};if(r.isValid(t,o,n?[...n]:void 0),!o.errors.length)continue;const u=Math.max(...o.errors.map(t=>t.slice(0,t.indexOf(":")).length));if((u>s||u===s&&a&&o.errors.length<a.length)&&(s=u,a=o.errors),u<=i.length)for(const t of o.errors){const e=/: expected (.+?), got /.exec(t);e&&!l.includes(e[1])&&l.push(e[1])}}if(a&&s>i.length)for(const t of a.slice(0,4))e.errors.includes(t)||e.errors.push(t);else l.length&&e.errors.push(i+": expected "+l.join(" | "));return!1}_canSanitize(t){return this.schemas.some(e=>e._canSanitize(t))}},z=class extends O{constructor(t,e,n){var r;super(),this._key=t,this._schemas=e,this._kind="discriminatedUnion",this._default=null!=n?n:e[0]._default,this._map=new Map;for(const n of e){const e=n._shape[t];if(!e)continue;const o=null!=(r=e.inner)?r:e;this._map.set(o._default,n),e.inner&&(this._absentMember=n)}}_findSchema(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const e=t[this._key];return null==e?this._absentMember:this._map.get(e)}sanitize(t){var e;return(null!=(e=this._findSchema(t))?e:this._schemas[0]).sanitize(t)}isValid(t,e,n){const r=this._findSchema(t);if(!r){const r=null===t||"object"!=typeof t||Array.isArray(t)?void 0:t[this._key];return null==e||e.errors.push(j(null!=n?n:[])+": no discriminated union member matched "+this._key+"="+JSON.stringify(r)),!1}return r.isValid(t,e,n)}_canSanitize(t){if(null===t||"object"!=typeof t||Array.isArray(t))return!1;const e=this._findSchema(t);return e?e._canSanitize(t):this._schemas[0]._canSanitize(t)}},T=class extends O{constructor(t){super(),this._shape=t;const e={};for(const n of Object.keys(t))e[n]=t[n]._default;this._default=e}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n={};for(const t of Object.keys(this._shape)){const r=this._shape[t].sanitize(e[t]);void 0!==r&&(n[t]=r)}return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(j(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(i=!1),o.pop();if(null==e?void 0:e.strict)for(const t of Object.keys(r))t in this._shape||void 0!==r[t]&&(o.push(t),e.errors.push(j(o)+": unexpected extra key"),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},D=class extends O{constructor(t,e){super(),this._shape=t,this._openSchema=e;const n={};for(const e of Object.keys(t))n[e]=t[e]._default;this._default=n}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n=A({},e);for(const t of Object.keys(this._shape)){const r=this._shape[t].sanitize(e[t]);void 0!==r&&(n[t]=r)}if(this._openSchema)for(const t of Object.keys(e))t in this._shape||(n[t]=this._openSchema.sanitize(e[t]));return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(j(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(i=!1),o.pop();if(this._openSchema)for(const t of Object.keys(r))t in this._shape||(o.push(t),this._openSchema.isValid(r[t],e,o)||(i=!1),o.pop());return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},F=class extends O{constructor(t){super(),this.item=t,this._default=[]}sanitize(t){if(!Array.isArray(t))return[];const e=[];for(const n of t)this.item._canSanitize(n)&&e.push(this.item.sanitize(n));return e}isValid(t,e,n){if(!Array.isArray(t))return null==e||e.errors.push(j(null!=n?n:[])+": expected array, got "+typeof t),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<t.length;n++)r.push("["+n+"]"),this.item.isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)}},I=class extends O{constructor(t){super(),this.value=t,this._kind="record",this._default={}}sanitize(t){if(!t||"object"!=typeof t||Array.isArray(t))return{};const e={};for(const[n,r]of Object.entries(t))this.value._canSanitize(r)&&(e[n]=this.value.sanitize(r));return e}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(j(null!=n?n:[])+": expected object/record, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(const[n,i]of Object.entries(t))r.push(n),this.value.isValid(i,e,r)||(o=!1),r.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},L=class extends O{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},R=class extends O{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return void 0!==t||(null==e||e.errors.push(j(null!=n?n:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}},W=class extends O{constructor(t,e){super(),this.fn=t,this._default=e,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,e,n){return this.schema.isValid(t,e,n)}_canSanitize(t){return this.schema._canSanitize(t)}},V=class extends O{constructor(t){super(),this.schemas=t,this._kind="tuple",this._default=t.map(t=>t._default)}sanitize(t){return Array.isArray(t)&&t.length===this.schemas.length?this.schemas.map((e,n)=>e.sanitize(t[n])):this._default}isValid(t,e,n){if(!Array.isArray(t)||t.length!==this.schemas.length)return null==e||e.errors.push(j(null!=n?n:[])+": expected tuple of length "+this.schemas.length+", got "+(Array.isArray(t)?"array["+t.length+"]":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<this.schemas.length;n++)r.push("["+n+"]"),this.schemas[n].isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)&&t.length===this.schemas.length}},U={string:(t="")=>new S(t),number:(t=0)=>new M(t),boolean:(t=!1)=>new _(t),literal:t=>new E(t),enum:(t,e)=>new N(t,e),union:(t,e)=>new C(t,e),discriminatedUnion:(t,e)=>new z(t,e),object:t=>new T(t),openObject:(t,e)=>new D(t,e),extendedObject:(t,e)=>new T(A(A({},t._shape),e)),array:t=>new F(t),record:t=>new I(t),any:()=>new L,defined:()=>new R,tuple:t=>new V(t),lazy:(t,e)=>new W(t,e)},B=/^(\d+)\.(\d+)(?:\.(\d+))?$/;function G(t){if("string"!=typeof t)return;const e=B.exec(t.trim());return e?{a:Number(e[1]),b:Number(e[2]),c:void 0===e[3]?0:Number(e[3])}:void 0}G("1.1");var q="data-px-animation-src",Z="_px_animator",K="block",H="inline",J="nearest",Q="root",X="center",Y="bottom",$=["duration","iterations","engine","frameRate"],tt=["trigger","delay","fillMode","direction"],et=[...$,...tt,"fill","resetOnFinish","timelineSource","scroll"],nt={native:"native",js:"js"},rt=w(A({},nt),{auto:"auto"});function ot(t){return t===rt.js?nt.js:nt.native}function it(t){return t===rt.native}var at={startOn:"load",outAction:"continue",scrollIntoViewThreshold:0},st={start:"start",end:"end"},lt={normal:"normal",alternate:"alternate"},ut="userSpaceOnUse",ct="objectBoundingBox",ft={translate:"translate"},dt={separate:"separate",combined:"combined"},ht="textContent",pt="class",mt="transform",gt="offsetDistance",vt=new Set(["type","children","animator","meta","animate","effects",ht]),yt={translate:"translate",rotate:"rotate",scale:"scale",origin:"origin"},bt=(yt.translate,yt.rotate,yt.scale,yt.origin,"pad"),kt={linear:"linear",radial:"radial"};function At(t){var e;const n=(null==t?void 0:t.animator)||(null==(e=null==t?void 0:t.meta)?void 0:e.animator);if(!n)return;const r=wt.get(n);if(r)return r;const o=n,i=et.filter(t=>void 0!==o[t]),a=i.length?A({},o):n;for(const t of i)delete a[t];const s=function(t){const e=t.timeline;if(null==e||"object"!=typeof e)return t;const n=xt.get(t);if(n)return n;const r=t,{timeline:o}=r,i=x(r,["timeline"]);if(void 0!==e.engine&&(i.engine=e.engine),void 0!==e.frameRate&&(i.frameRate=e.frameRate),"scroll"===e.type||"view"===e.type){i.timelineSource="scroll",void 0!==e.duration&&(i.duration=e.duration),void 0!==e.iterations&&(i.iterations=e.iterations);const t=A({},i.scroll||{});t.kind=e.type,void 0!==e.axis&&(t.axis=e.axis),void 0!==e.source&&(t.source=e.source),void 0!==e.subject&&(t.subject=e.subject),void 0!==e.smoothing&&(t.smoothing=e.smoothing),void 0!==e.range&&(t.range=e.range);const n=e.pin;"boolean"==typeof n?t.pin=n:n&&"object"==typeof n&&(t.pin=!0,void 0!==n.align&&(t.pinAlign=n.align),void 0!==n.offset&&(t.pinOffset=n.offset),void 0!==n.distance&&(t.pinDistance=n.distance)),i.scroll=t}else{if(void 0!==e.duration&&(i.duration=e.duration),void 0!==e.trigger){const t=e.trigger,{finishAction:n}=t,r=x(t,["finishAction"]);Object.keys(r).length&&(i.trigger=r),void 0!==n&&(i.resetOnFinish="reset"===n)}void 0!==e.delay&&(i.delay=e.delay),void 0!==e.iterations&&(i.iterations=e.iterations),void 0!==e.direction&&(i.direction=e.direction),void 0!==e.fillMode&&(i.fill=e.fillMode)}return xt.set(t,i),i}(a);return wt.set(n,s),s}var wt=new WeakMap,xt=new WeakMap;function jt(t){var e;if(t)return null==(e=At(t))?void 0:e.definitions}var Ot=U.union([U.string(),U.tuple([U.number(),U.number(),U.number(),U.number()])]),Pt=U.union([U.string(),U.number(),U.array(U.number()),U.object({pathData:U.string()}),U.lazy(()=>U.array(fe),[]),U.lazy(()=>Dt,{})]),St=U.object({time:U.number().optional(),value:Pt.optional(),easing:Ot.optional(),tangentOut:U.tuple([U.number(),U.number()]).optional(),tangentIn:U.tuple([U.number(),U.number()]).optional()}),Mt=t=>{var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0},_t=t=>{var e;return null!=(e=t.value)?e:t.v},Et=t=>{var e;return null!=(e=t.easing)?e:t.e},Nt=t=>t.tangentIn,Ct=t=>t.tangentOut,zt=U.object({segmentCount:U.number().optional(),repeatAt:U.enum([st.start,st.end]).optional(),direction:U.enum([lt.normal,lt.alternate]).optional()}),Tt=U.object({value:Pt.optional(),keyframes:U.array(St).optional(),loop:U.union([zt,U.boolean()]).optional(),autoOrient:U.boolean().optional(),alongPathMode:U.enum(["sampled","offsetPath"]).optional()}),Dt=U.object({translate:U.tuple([U.number(),U.number()]).optional(),rotate:U.number().optional(),skew:U.number().optional(),scale:U.tuple([U.number(),U.number()]).optional(),origin:U.tuple([U.number(),U.number()]).optional()}),Ft=(U.union([U.string(),Dt,U.object({value:Dt}),Tt]),U.record(Tt)),It=U.union([U.string(),U.array(U.union([U.string(),Ft])),Ft]),Lt=U.object({startOn:U.enum(["load","mouseOver","click","scrollIntoView","programmatic"],at.startOn).optional(),outAction:U.enum(["continue","pause","reset","reverse"],at.outAction).optional(),finishAction:U.enum(["hold","reset"]).optional(),scrollIntoViewThreshold:U.number().optional()}),Rt=U.object({width:U.number(),pathData:U.string()}),Wt=U.object({fontFamily:U.string(),fontStyle:U.string(),ascent:U.number(),unitsPerEm:U.number(),glyphs:U.record(Rt)}),Vt=U.object({easings:U.record(U.tuple([U.number(),U.number(),U.number(),U.number()])).optional(),animations:U.record(Ft).optional(),fonts:U.record(Wt).optional()}),Ut=U.object({phase:U.enum(["cover","contain","entry","exit","entry-crossing","exit-crossing"]).optional(),fraction:U.number().optional()}),Bt=U.object({start:Ut.optional(),end:Ut.optional()}),Gt=U.object({kind:U.enum(["view","scroll"]).optional(),axis:U.enum([K,H,"x","y"]).optional(),source:U.enum([J,Q]).optional(),subject:U.string().optional(),smoothing:U.number().optional(),pin:U.boolean().optional(),pinAlign:U.enum(["top",X,Y]).optional(),pinOffset:U.number().optional(),pinDistance:U.number().optional(),range:Bt.optional()}),qt=U.object({align:U.enum(["top",X,Y]).optional(),offset:U.number().optional(),distance:U.number().optional()}),Zt=U.enum([rt.auto,rt.native,rt.js]).optional(),Kt=U.object({type:U.literal("time").optional(),engine:Zt,frameRate:U.number().optional(),duration:U.number().optional(),trigger:Lt.optional(),delay:U.number().optional(),iterations:U.union([U.number(),U.literal("infinite")]).optional(),fillMode:U.enum(["forwards","backwards","both","none"]).optional(),direction:U.enum(["normal","reverse","alternate","alternate-reverse"]).optional()}),Ht={duration:U.number().optional(),iterations:U.number().optional(),engine:Zt,frameRate:U.number().optional(),axis:U.enum([K,H,"x","y"]).optional(),source:U.enum([J,Q]).optional(),subject:U.string().optional(),smoothing:U.number().optional(),pin:U.union([U.boolean(),qt]).optional(),range:Bt.optional()},Jt=U.object(A({type:U.literal("scroll")},Ht)),Qt=U.object(A({type:U.literal("view")},Ht)),Xt=U.discriminatedUnion("type",[Kt,Jt,Qt]),Yt=U.object({target:U.string(),animateWith:U.array(U.string())}),$t=U.object({timeline:Xt.optional(),definitions:Vt.optional(),bindings:U.array(Yt).optional(),debugGlobalName:U.string().optional(),version:U.string().optional()}),te=U.union([U.string(),U.number(),U.array(U.number()),U.object({value:U.defined()}),Dt]),ee=U.union([U.number(),Tt,U.object({value:U.number()})]),ne=U.union([U.tuple([U.number(),U.number()]),Tt,U.object({value:U.tuple([U.number(),U.number()])})]),re=U.union([U.string(),Tt,U.object({value:U.string()})]),oe=U.object({translate:ne.optional(),rotate:ee.optional(),scale:ne.optional(),skew:ee.optional(),origin:ne.optional()}),ie=U.object({copies:U.number().optional(),translate:ne.optional(),rotate:ee.optional(),skew:ee.optional(),scale:ne.optional(),origin:ne.optional()}),ae=U.object({source:U.string().optional(),maskType:U.enum(["luminance","alpha"]).optional(),maskUnits:U.enum([ut,ct]).optional(),maskContentUnits:U.enum([ut,ct]).optional(),x:U.number().optional(),y:U.number().optional(),width:U.number().optional(),height:U.number().optional()}),se=U.object({pathData:re.optional()}),le=U.object({offset:ee.optional(),range:ne.optional(),subPaths:U.enum([dt.separate,dt.combined]).optional()}),ue=U.object({start:U.number().optional(),stretch:U.number().optional(),timeCrop:U.tuple([U.number(),U.number()]).optional()}),ce=U.object({without:U.enum([ft.translate]).optional(),source:U.string().optional(),retime:ue.optional()}),fe=U.object({offset:U.number(),color:U.string()}),de=U.union([U.array(fe),U.object({value:U.array(fe)}),Tt]),he=U.object({type:U.enum([kt.linear,kt.radial]),start:ne.optional(),end:ne.optional(),center:ne.optional(),radius:ee.optional(),focal:ne.optional(),stops:de.optional(),gradientUnits:U.enum([ut,ct]).optional(),spreadMethod:U.enum([bt,"reflect","repeat"]).optional(),gradientTransform:U.string().optional()}),pe=he,me=U.object({pathData:U.string(),pathOverflow:U.enum(["clip","extend"]).optional(),lengthAdjust:U.enum(["spacing","spacingAndGlyphs"]).optional(),method:U.enum(["align","stretch"]).optional(),spacing:U.enum(["auto","exact"]).optional(),startOffset:ee.optional(),textLength:ee.optional()}),ge=U.object({useGlyphs:U.boolean().optional()}),ve=U.object({transformBy:oe.optional(),repeater:ie.optional(),maskedBy:ae.optional(),clipPath:se.optional(),strokeTrim:le.optional(),clone:ce.optional(),fillGradient:he.optional(),strokeGradient:pe.optional(),textPath:me.optional(),text:ge.optional()});function ye(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!ve.isValid(t.effects,r,[o+".effects"]))for(const t of r.errors)n.push(t)}t&&Array.isArray(t.children)&&t.children.forEach((t,e)=>r(t,o+".children["+e+"]"))};return r(t,"root"),n}function be(t,e){var n;const r=!1!==(null==e?void 0:e.strict),o={errors:[],warnings:[],strict:r},i=xe.isValid(t,o,["root"])?[]:[...o.errors];if(t&&"object"==typeof t){for(const e of ye(t,{strict:r}))i.includes(e)||i.push(e);const e=null==(n=At(t))?void 0:n.definitions;for(const n of function(t,e){if(!e||!Object.keys(e).length)return[];const n=[],r=(t,o,i,a)=>{var s,l;if(!t)return;const u="string"==typeof t.fontFamily?t.fontFamily:void 0,c=null!=u?u:i,f=a||"text"===t.type&&!!(null==(l=null==(s=t.effects)?void 0:s.text)?void 0:l.useGlyphs);if(f&&u&&!Object.prototype.hasOwnProperty.call(e,u)){const t=o+': glyph-mode text uses font-family "'+u+'", which has no entry in animator.definitions.fonts';n.includes(t)||n.push(t)}Array.isArray(t.children)&&t.children.forEach((t,e)=>r(t,o+".children["+e+"]",c,f))};return r(t,"root",void 0,!1),n}(t,null==e?void 0:e.fonts))i.includes(n)||i.push(n);for(const n of function(t,e){const n=[],r=(t,o)=>{if(Array.isArray(t))return void t.forEach((t,e)=>r(t,o+"["+e+"]"));if(!t||"object"!=typeof t)return;const i=t.easing;if(!("string"!=typeof i||e&&Object.prototype.hasOwnProperty.call(e,i))){const t=o+'.easing: "'+i+'" names no entry in animator.definitions.easings — it will play linear';n.includes(t)||n.push(t)}for(const[e,n]of Object.entries(t))"easing"!==e&&n&&"object"==typeof n&&r(n,o+"."+e)};return r(t,"root"),n}(t,null==e?void 0:e.easings))i.includes(n)||i.push(n);for(const e of function(t){var e;const n=null==(e=At(t))?void 0:e.version;return void 0===n||void 0!==G(n)?[]:["root.animator.version: "+JSON.stringify(n)+' is not a version stamp ("a.b" or "a.b.c") — it reads as unstamped']}(t))i.includes(e)||i.push(e)}return i}var ke=U.openObject({type:U.string(),domType:U.string().optional(),textContent:U.string().optional(),id:U.string().optional(),meta:U.any().optional(),effects:ve.optional(),animate:It.optional(),style:U.record(U.union([U.string(),U.number()])).optional()},te),Ae=U.openObject(w(A({},ke._shape),{children:U.lazy(()=>U.array(Ae),[]).optional()}),te),we=U.object({width:U.union([U.number(),U.string()]).optional(),height:U.union([U.number(),U.string()]).optional(),viewBox:U.string().optional(),animator:$t.optional()}),xe=U.openObject(w(A(A({},ke._shape),we._shape),{type:U.literal("svg"),children:U.array(Ae).optional()}),te),je=(U.object({v:U.array(U.array(U.number())),i:U.array(U.array(U.number())).optional(),o:U.array(U.array(U.number())).optional(),c:U.boolean().optional()}),0);function Oe(){return"_px_"+Date.now().toString(36)+(++je).toString(36)+Math.random().toString(36).substring(2,6)}function Pe(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>Pe(t));const e=t,n={};for(const t of Object.keys(e))n[t]=Pe(e[t]);return n}function Se(t){var e;const n=Pe(t),r=new Map,o=new Set(["href","xlink:href"]),i=new Set(["fill","stroke","clip-path","clipPath","mask","marker","marker-start","marker-mid","marker-end","filter","flood-color","lighting-color"]),a=new Set(["targetId","boundElementId"]),s=(t,e)=>"source"===t&&("maskedBy"===e||"clone"===e);!function t(e){if(e&&"object"==typeof e){if(e.id&&"string"==typeof e.id){const t=e.id,n=Oe();r.set(t,n),e.id=n}else e.animate&&(e.id=Oe());if(Array.isArray(e.children))for(const n of e.children)t(n)}}(n),function t(e,n){if(e&&"object"==typeof e)for(const[l,u]of Object.entries(e))if("children"!==l)if("string"==typeof u)if(o.has(l)&&u.startsWith("#")){const t=u.slice(1),n=r.get(t);n&&(e[l]="#"+n)}else if(i.has(l))e[l]=Me(u,r);else if(a.has(l)||s(l,n)){const t=u.startsWith("#"),n=r.get(t?u.slice(1):u);n&&(e[l]=t?"#"+n:n)}else u.includes("url(#")&&(e[l]=Me(u,r));else if("style"===l&&"object"==typeof u&&null!==u)for(const[t,e]of Object.entries(u))"string"==typeof e&&(u[t]=Me(e,r));else"object"==typeof u&&null!==u&&t(u,l);else if(Array.isArray(u))for(const e of u)t(e)}(n);const l=null==(e=n.animator)?void 0:e.bindings;if(Array.isArray(l)){const t=l.map(t=>{var e;const n=t.target.startsWith("#"),o=n?t.target.slice(1):t.target,i=null!=(e=r.get(o))?e:o;return w(A({},t),{target:n?"#"+i:i})});n.animator=w(A({},n.animator),{bindings:t})}return n}function Me(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}function _e(t,e=!1){var n,r,o,i;const a=t.v,s=t.i,l=t.o,u=t.c;if(!a.length)return"";const c=[],f=a.length;c.push("M"+a[0][0]+","+a[0][1]);for(let t=1;t<f;t++){const o=a[t-1],i=null!=(n=null==l?void 0:l[t-1])?n:o,u=null!=(r=null==s?void 0:s[t])?r:a[t],f=a[t];e||i[0]!==o[0]||i[1]!==o[1]||u[0]!==f[0]||u[1]!==f[1]?c.push("C"+i[0]+","+i[1]+","+u[0]+","+u[1]+","+f[0]+","+f[1]):c.push("L"+f[0]+","+f[1])}if(u&&f>0){const t=a[f-1],n=null!=(o=null==l?void 0:l[f-1])?o:t,r=null!=(i=null==s?void 0:s[0])?i:a[0],u=a[0];!e&&n[0]===t[0]&&n[1]===t[1]&&r[0]===u[0]&&r[1]===u[1]||c.push("C"+n[0]+","+n[1]+","+r[0]+","+r[1]+","+u[0]+","+u[1]),c.push("z")}return c.join("")}function Ee(t,e,n){return t+(e-t)*n}function Ne(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let i=0;i<o;i++)r[i]=Ee(t[i]||0,e[i]||0,n);return r}function Ce(t,e,n){return[Ee(t[0]||0,e[0]||0,n),Ee(t[1]||0,e[1]||0,n),Ee(t[2]||0,e[2]||0,n),Ee(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function ze(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++)o.push(Te(t[i],e[i],n));return o}function Te(t,e,n){var r,o,i,a,s,l,u,c,f;if(!t||!e)return t||e||{v:[]};const d=Math.min(Math.max(n,0),1),h=Math.min(t.v.length,e.v.length),p=[],m=[],g=[];for(let n=0;n<h;n++){const f=t.v[n],h=e.v[n];p.push(Ne(f,h,d));const v=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,y=null!=(a=null==(i=e.i)?void 0:i[n])?a:h;m.push(Ne(v,y,d));const b=null!=(l=null==(s=t.o)?void 0:s[n])?l:f,k=null!=(c=null==(u=e.o)?void 0:u[n])?c:h;g.push(Ne(b,k,d))}return{v:p,i:m.length?m:void 0,o:g.length?g:void 0,c:null!=(f=t.c)?f:e.c}}function De(t,e,n){if(n<=0)return 0;if(n>=1)return 1;const r=3*t,o=3*(e-t)-r,i=1-r-o;function a(t){return((i*t+o)*t+r)*t}function s(t){return(3*i*t+2*o)*t+r}let l=n,u=0,c=1;for(let t=0;t<8;t++){const t=a(l)-n;if(Math.abs(t)<1e-6)return l;const e=s(l);if(Math.abs(e)<1e-6)break;l-=t/e}for(l=n;u<c;){const t=a(l);if(Math.abs(t-n)<1e-6)return l;n>t?u=l:c=l,l=(c+u)/2}return l}function Fe(t){const[e,n,r,o]=t,i=3*n,a=3*(o-n)-i,s=1-i-a;return function(t){return n=De(e,r,t),((s*n+a)*n+i)*n;var n}}function Ie(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Le(t,e){if(!t)return{left:void 0,right:void 0};if(e<=0)return{left:void 0,right:t};if(e>=1)return{left:t,right:void 0};const[n,r,o,i]=t,a=De(n,o,e),s=[n,r],l=[o,i],{left:u,right:c}=function(t,e,n,r,o){const i=Ie(t,e,o),a=Ie(e,n,o),s=Ie(n,r,o),l=Ie(i,a,o),u=Ie(a,s,o),c=Ie(l,u,o);return{left:[t,i,l,c],right:[c,u,s,r]}}([0,0],s,l,[1,1],a),f=u[3][0],d=u[3][1];let h,p;f>1e-9&&Math.abs(d)>1e-9&&(h=[u[1][0]/f,u[1][1]/d,u[2][0]/f,u[2][1]/d]);const m=1-f,g=1-d;return m>1e-9&&Math.abs(g)>1e-9&&(p=[(c[1][0]-f)/m,(c[1][1]-d)/g,(c[2][0]-f)/m,(c[2][1]-d)/g]),{left:h,right:p}}function Re(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function We(t){const e=Math.round(255*t[0]),n=Math.round(255*t[1]),r=Math.round(255*t[2]);return 4===t.length?"rgba("+e+","+n+","+r+","+t[3]+")":"rgb("+e+","+n+","+r+")"}function Ve(t){if(t){if(Array.isArray(t))return t;if("string"==typeof t)return t.startsWith("#")?function(t){const e=t.slice(1),n=e.length<=4,r=n?e[0]+e[0]:e.slice(0,2),o=n?e[1]+e[1]:e.slice(2,4),i=n?e[2]+e[2]:e.slice(4,6),a=4===e.length?e[3]+e[3]:8===e.length?e.slice(6,8):null,s=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==a&&s.push(parseInt(a,16)/255),s}(t):t.startsWith("rgb")?function(t){var e;const n=null==(e=t.match(/rgba?\((.*)\)/))?void 0:e[1];if(!n)throw new Error("Invalid rgb/rgba format");const r=n.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)}}var Ue=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),Be=new Set(["translate","rotate","scale","skew"]),Ge=new Set(["offset-distance","offsetDistance"]);function qe(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],i=t.translate,a=t.origin,s=t.rotate,l=t.skew,u=t.scale,c=r?"px":"",f=r?"deg":"";return i&&o.push("translate("+i[0]+c+","+i[1]+c+")"),a&&o.push("translate("+a[0]+c+","+a[1]+c+")"),null!=s&&o.push("rotate("+s+f+")"),null!=l&&o.push("skewX("+l+f+")"),u&&o.push("scale("+u[0]+","+u[1]+")"),a&&o.push("translate("+-a[0]+c+","+-a[1]+c+")"),o.join("")}var Ze=new Set(["offset-distance","offsetDistance"]),Ke=1e3;function He(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function Je(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var Qe=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 Xe(t){return Qe.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Ye(t,e,n){return Math.max(e,Math.min(t,n))}function $e(t,e,n,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const i=1-o,a=i*i,s=o*o,l=a*i,u=3*o*a,c=3*s*i,f=s*o;return[l*t[0]+u*e[0]+c*n[0]+f*r[0],l*t[1]+u*e[1]+c*n[1]+f*r[1]]}var tn=1e-4;function en(t,e,n,r,o){const i=nn(t,e,n,r,o);return 0===i[0]&&0===i[1]?nn(t,e,n,r,o<.5?o+tn:o-tn):i}function nn(t,e,n,r,o){const i=1-o,a=3*i*i,s=6*o*i,l=3*o*o;return[a*(e[0]-t[0])+s*(n[0]-e[0])+l*(r[0]-n[0]),a*(e[1]-t[1])+s*(n[1]-e[1])+l*(r[1]-n[1])]}function rn(t,e,n,r,o=100){const i=o+1,a=new Float64Array(i),s=new Float64Array(i);let l=$e(t,e,n,r,0);a[0]=0,s[0]=0;let u=0;for(let c=1;c<i;c++){const i=c/o,f=$e(t,e,n,r,i),d=f[0]-l[0],h=f[1]-l[1];u+=Math.sqrt(d*d+h*h),a[c]=i,s[c]=u,l=f}return{ts:a,ds:s}}function on(t,e){const{ts:n,ds:r}=t,o=n.length-1;if(e<=n[0])return r[0];if(e>=n[o])return r[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;n[t]<e?i=t+1:a=t}const s=n[a-1],l=n[a]-s,u=l>0?(e-s)/l:0;return r[a-1]+u*(r[a]-r[a-1])}var an=new Set(["script","foreignobject"]),sn=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),ln=new Set(["href","xlink:href","src"]),un=new Set(["mixBlendMode","isolation"]),cn=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,fn=/^data:image\/svg\+xml(?:;[^,]*)?,/i,dn=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,hn=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function pn(t,e){const n=t.toLowerCase();if(!function(t){return!!t.startsWith("on")}(n)){if("fill"===n||"stroke"===n||"stopcolor"===n){const t=String(e);return t.includes("url(")&&!/^url\(#[^)]+\)$/.test(t)?void console.warn('Attribute "'+n+'" blocked: url() must be internal url(#id), got:',e):e}if(sn.has(n)){const t=String(e);return t.startsWith("#")||/^url\(#[^)]+\)$/.test(t)||ln.has(n)&&(cn.test(t)||fn.test(t)||function(t){const e=dn.exec(t);return!!e&&hn.some(t=>e[1].startsWith(t))}(t))?e:void console.warn('Attribute "'+n+'" blocked: must be #id, url(#id), or data:image/… URI, got:',e)}return e}console.warn("Attribute blocked (event handler / dangerous): ",n)}function mn(t){const e={};for(const n of Object.keys(t)){const r=He(n);if(vt.has(r))continue;if("style"===r)continue;let o=t[n];if(Ue.has(r)&&Array.isArray(o))e[r]=We(o);else if("transform"!==r||null===o||"object"!=typeof o||Array.isArray(o)||o.keyframes)Be.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),e[mt]=r+"("+o+")"):Array.isArray(o)?e[r]=o.join(","):null!=o&&(e[r]=String(o));else{const t=o.value&&"object"==typeof o.value?o.value:o;e[mt]=qe(t,{withUnits:!1})}}return e}function gn(t){const e=_t(t);if(!e)return;if(Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]&&"number"==typeof e[1])return[e[0],e[1]];const n=e.translate;return Array.isArray(n)&&n.length>=2?[n[0],n[1]]:void 0}function vn(t){return Mt(t)}function yn(t){return Et(t)}function bn(t){const e=t.keyframes;if(!Array.isArray(e))return!1;if(t.autoOrient)return!0;for(const t of e)if(Nt(t)||Ct(t))return!0;return!1}var kn=new WeakMap;function An(t,e,n,r){let o=kn.get(t);const i=null==o?void 0:o.get(e);if(i)return i;const a=Ct(t),s=Nt(e),l=[n[0]+(a?a[0]:0),n[1]+(a?a[1]:0)],u=[r[0]+(s?s[0]:0),r[1]+(s?s[1]:0)],c=rn(n,l,u,r),f={P0:n,P1:l,P2:u,P3:r,lut:c,totalArc:c.ds[c.ds.length-1]};return o||(o=new WeakMap,kn.set(t,o)),o.set(e,f),f}var wn=.5,xn=5,jn=32;function On(t,e){var n,r,o;if(!bn(t))return t;const i=t.keyframes;if(!Array.isArray(i)||i.length<2)return t;const a=!!t.autoOrient,s=null!=(n=null==e?void 0:e.flatnessTolerance)?n:wn,l=null!=(r=null==e?void 0:e.rotationTolerance)?r:xn,u=null!=(o=null==e?void 0:e.maxSamplesPerSegment)?o:jn,c=[],f=gn(i[0]);if(!f)return t;const d=a?function(t,e){const n=gn(t),r=gn(e);if(!n||!r)return 0;const o=An(t,e,n,r),i=en(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;c.push(Sn(vn(i[0]),En(Mn(i[0]),Mn(i[0]),0,f,d,a)));for(let t=0;t<i.length-1;t++){const e=i[t],n=i[t+1],r=gn(e),o=gn(n);r&&o?(a&&t>0&&Cn(c,e,n,r,o,l),Tn(c,e,n,r,o,a,s,l,u)):c.push(Sn(vn(n),En(Mn(n),Mn(n),1,null!=o?o:[0,0],void 0,a)))}const h=yn(i[i.length-1]);h&&(c[c.length-1].e=h),a&&Pn(c);const p={keyframes:c};return void 0!==t.loop&&(p.loop=t.loop),p}function Pn(t){let e;for(const n of t){const t=_t(n);if(!t||"number"!=typeof t.rotate)continue;if(void 0===e){e=t.rotate;continue}let r=t.rotate;for(;r-e>180;)r-=360;for(;r-e<-180;)r+=360;t.rotate=r,e=r}}function Sn(t,e){return{t:t,v:e}}function Mn(t){const e=_t(t);if(e&&"object"==typeof e&&!Array.isArray(e))return e}function _n(t,e,n){if(void 0===t)return e;if(void 0===e)return t;if("number"==typeof t&&"number"==typeof e)return t+(e-t)*n;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){const r=new Array(t.length);for(let o=0;o<t.length;o++){const i="number"==typeof t[o]?t[o]:0,a="number"==typeof e[o]?e[o]:0;r[o]=i+(a-i)*n}return r}return n<.5?t:e}function En(t,e,n,r,o,i){const a={translate:r},s=new Set;if(t)for(const e of Object.keys(t))s.add(e);if(e)for(const t of Object.keys(e))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==e?void 0:e[r];void 0===o&&void 0===s||(a[r]=_n(o,s,n))}return void 0!==o&&(a.rotate=o+Nn(t,e,n)),a}function Nn(t,e,n){const r="number"==typeof(null==t?void 0:t.rotate)?t.rotate:void 0,o="number"==typeof(null==e?void 0:e.rotate)?e.rotate:void 0;if(void 0===r&&void 0===o)return 0;const i=_n(r,o,n);return"number"==typeof i?i:0}function Cn(t,e,n,r,o,i){const a=t[t.length-1],s=_t(a),l=null==s?void 0:s.rotate;if("number"!=typeof l)return;const u=Mn(e),c=l-Nn(u,u,0),f=An(e,n,r,o),d=en(f.P0,f.P1,f.P2,f.P3,0),h=180*Math.atan2(d[1],d[0])/Math.PI,p=function(t,e){let n=t-e;for(;n>180;)n-=360;for(;n<-180;)n+=360;return n}(h,c);if(Math.abs(p)<=i)return;const m=vn(e),g=Math.min(m+zn,(m+vn(n))/2),v=En(Mn(e),Mn(e),0,r,h,!0);t.push(Sn(g,v))}var zn=.05;function Tn(t,e,n,r,o,i,a,s,l){const u=An(e,n,r,o),c=vn(e),f=vn(n),d=yn(e),h=(p=d)?Fe([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=Mn(e),g=Mn(n),v=function(t,e,n,r,o){const i=[];Dn(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),Dn(t.P0[1],t.P1[1],t.P2[1],t.P3[1],i),i.sort((t,e)=>t-e);const a=[0];for(const t of i)t>a[a.length-1]+1e-6&&t<.999999&&a.push(t);a.push(1);const s=[],l={remaining:o-a.length};for(let o=0;o<a.length-1;o++)Fn(a[o],a[o+1],s,t,e,n,r,l);return s}(u,i,a,s,l),y=[];for(const t of v){const e=on(u.lut,t),n=Ye(u.totalArc>0?e/u.totalArc:t,0,1),r={u:Ye(h(n),0,1),p:n,pos:$e(u.P0,u.P1,u.P2,u.P3,t)};if(i){const e=en(u.P0,u.P1,u.P2,u.P3,t);r.rotateDeg=180*Math.atan2(e[1],e[0])/Math.PI}y.push(r)}let b=d,k=0;const A=t.length-1;for(let e=0;e<y.length;e++){const n=y[e],r=k<1?Ye((n.u-k)/(1-k),0,1):1,{left:o,right:a}=Le(b,r),s=0===e?A:t.length-1;o?t[s].e=o:delete t[s].e;const l=c+n.u*(f-c),u=En(m,g,n.p,n.pos,n.rotateDeg,i);t.push(Sn(l,u)),b=a,k=n.u}}function Dn(t,e,n,r,o){const i=e-t,a=n-e,s=i-2*a+(r-n),l=2*(a-i),u=i;if(Math.abs(s)<1e-10){if(Math.abs(l)>1e-10){const t=-u/l;t>1e-6&&t<.999999&&o.push(t)}return}const c=l*l-4*s*u;if(c<0)return;const f=Math.sqrt(c),d=(-l-f)/(2*s),h=(-l+f)/(2*s);d>1e-6&&d<.999999&&o.push(d),h>1e-6&&h<.999999&&o.push(h)}function Fn(t,e,n,r,o,i,a,s){const l=(t+e)/2,u=$e(r.P0,r.P1,r.P2,r.P3,t),c=$e(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=$e(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=$e(r.P0,r.P1,r.P2,r.P3,l),p=$e(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(In(d,u,c),In(h,u,c),In(p,u,c));let g=!0;if(o){const n=en(r.P0,r.P1,r.P2,r.P3,t),o=en(r.P0,r.P1,r.P2,r.P3,e),i=180*Math.atan2(n[1],n[0])/Math.PI,s=180*Math.atan2(o[1],o[0])/Math.PI;let l=Math.abs(i-s);l>180&&(l=360-l),l>a&&(g=!1)}m<=i&&g||s.remaining<=0||f<1e-6?n.push(e):(s.remaining-=1,Fn(t,l,n,r,o,i,a,s),Fn(l,e,n,r,o,i,a,s))}function In(t,e,n){const r=n[0]-e[0],o=n[1]-e[1],i=r*r+o*o;if(i<1e-20){const n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}const a=(t[0]-e[0])*o-(t[1]-e[1])*r;return Math.abs(a)/Math.sqrt(i)}function Ln(t,e){const n=Rn(t,e);return null!=n?n:t}function Rn(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=Rn(t.children[r],e);null!==o&&(n||(n=t.children.slice()),n[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o,n=t.transform;if(n&&"object"==typeof n&&bn(n)){const o=On(n,e);o!==n&&(r=w(A({},t),{transform:o}))}}if(!n&&!r)return null;const i=A({},t);return n&&(i.children=n),r&&(i.animate=r),i}var Wn=1;function Vn(t,e){if(t===e)return!0;if(typeof t!=typeof e||null===t||null===e||"object"!=typeof t)return!1;if(Array.isArray(t)!==Array.isArray(e))return!1;const n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(n=>Vn(t[n],e[n]))}function Un(t){const e=[];let n;const r=function(t){const e=t.split(/([MLCZmlcz]|[\s,]+)/).map(t=>t.trim()).filter(t=>t&&","!==t),n=[];let r=null;for(const t of e)if(/[MLCZmlcz]/.test(t))r={type:t,values:[]},n.push(r);else if(r){const e=+t;r.values.push(Number.isNaN(e)?0:e)}return n}(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;n={v:[[t,r]],i:[[t,r]],o:[[t,r]],c:!1},e.push(n);continue}if(n||(n={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},e.push(n)),"L"===r){const t=o[0]||0,e=o[1]||0;n.v.push([t,e]),n.i.push([t,e]),n.o.push([t,e])}else if("C"===r){const t=o[0]||0,e=o[1]||0,r=o[2]||0,i=o[3]||0,a=o[4]||0,s=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([a,s]),n.i.push([r,i]),n.o.push([a,s])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function Bn(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function Gn(t){return"string"==typeof t&&void 0!==Bn(t)}function qn(t){if(t&&"object"==typeof t&&"string"==typeof t.pathData){const e=Bn(t.pathData);return e?{paths:Un(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&Gn(e[0])){const t=[];for(const n of e){const e=Bn(n);e&&t.push(...Un(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&Gn(t[0])){const e=[];for(const n of t){const t=Bn(n);t&&e.push(...Un(t))}return{paths:e}}return{paths:t}}return Gn(t)?{paths:Un(Bn(t))}:t}function Zn(t,e){var n;if(t)return Array.isArray(t)?t:(null==(n=null==e?void 0:e.easings)?void 0:n[t])?e.easings[t]:void console.warn("Unknown easing name: "+t)}function Kn(t,e){var n;if("string"==typeof t){const r=null==(n=null==e?void 0:e.animations)?void 0:n[t];return r||console.warn("Unknown animation name: "+t),r}return t}function Hn(t,e,n,r){var o,i;return"d"===t?{paths:ze(null!=(o=null==e?void 0:e.paths)?o:Array.isArray(e)?e:[],null!=(i=null==n?void 0:n.paths)?i:Array.isArray(n)?n:[],r)}:Ue.has(t)?Ce(e||[0,0,0,1],n||[0,0,0,1],r):"transform"!==t||"object"!=typeof e||null===e||Array.isArray(e)||"object"!=typeof n||null===n||Array.isArray(n)?"rotate"===t&&"number"==typeof e&&"number"==typeof n?Ee(e,n,r):Be.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?Ne(e||[],n||[],r):Ee(+(e||0),+(n||0),r):function(t,e,n){const r=new Set([...Object.keys(null!=t?t:{}),...Object.keys(null!=e?e:{})]),o={};for(const i of r){const r=null==t?void 0:t[i],a=null==e?void 0:e[i];if("rotate"===i||"skew"===i)o[i]=Ee(+(null!=r?r:0),+(null!=a?a:0),n);else if("translate"===i||"scale"===i||"origin"===i){const t="scale"===i?[1,1]:[0,0];o[i]=Ne(r||t,a||t,n)}else o[i]=null!=a?a:r}return o}(e,n,r)}function Jn(t,e,n,r){var o,i,a,s,l;const u=e.length-1,c=Ye(null!=(o=n.segmentCount)?o:u,1,u);let f;f=n.repeatAt===st.start?e.slice(0,c+1):e.slice(u-c);const d=null!=(i=e[0].t)?i:0,h=null!=(a=e[e.length-1].t)?a:0;let p,m;n.repeatAt===st.start?(p=0,m=d):(p=h,m=r);const g=m-p;if(g<=0)return e;const v=null!=(s=f[0].t)?s:0,y=(null!=(l=f[f.length-1].t)?l:0)-v;if(y<=0)return e;const b=f.map(t=>({relT:(t.t-v)/y,v:t.v,e:t.e,tangentIn:Nt(t),tangentOut:Ct(t)})),k=Math.floor(g/y),x=g-k*y,j=x/y,O=[],P=n.repeatAt!==st.start,S=e[e.length-1];let M,_=!1;function E(e,n,r){var o;let i;if(n){i=[];for(let t=b.length-1;t>=0;t--)i.push({relT:1-b[t].relT,v:b[t].v,e:t>0?Re(b[t-1].e):void 0,tangentIn:b[t].tangentOut,tangentOut:b[t].tangentIn})}else i=b;const a=void 0!==r?r:1;for(let n=0;n<i.length;n++){const r=i[n];if(r.relT>a+1e-9){const o=i[n-1],s=r.relT-o.relT,l=(a-o.relT)/s,u=o.e?Fe(o.e)(l):l,c=Hn(t,o.v,r.v,u),{left:f}=Le(o.e,l);return O.length>0&&o.relT<=a&&(O[O.length-1].e=f),void O.push({t:e+a*y,v:c,e:void 0})}const s=O.length>0?O[O.length-1]:S,l=P&&0===n&&void 0!==s&&Math.abs((null!=(o=s.t)?o:0)-(e+r.relT*y))<1e-9;if(l){if(Vn(s.v,r.v)){O.length>0?(s.e=r.e,s.tangentOut=r.tangentOut):(M=r.e,_=!0);continue}O.length>0&&(delete s.tangentIn,delete s.tangentOut)}const u={t:e+r.relT*y+(l?Wn:0),v:r.v,e:n<i.length-1?r.e:void 0};r.tangentIn&&(u.tangentIn=r.tangentIn),r.tangentOut&&(u.tangentOut=r.tangentOut),O.push(u)}}if(n.repeatAt===st.start){j>1e-9&&function(e,n,r){let o;if(n){o=[];for(let t=b.length-1;t>=0;t--)o.push({relT:1-b[t].relT,v:b[t].v,e:t>0?Re(b[t-1].e):void 0,tangentIn:b[t].tangentOut,tangentOut:b[t].tangentIn})}else o=b;const i=1-r;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT<i-1e-9)continue;const a=o[n-1];if(a&&a.relT<i-1e-9&&r.relT>i+1e-9){const n=r.relT-a.relT,o=(i-a.relT)/n,s=a.e?Fe(a.e)(o):o,l=Hn(t,a.v,r.v,s),{right:u}=Le(a.e,o);O.push({t:e,v:l,e:u})}const s={t:e+(r.relT-i)*y,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),O.push(s)}}(p,n.direction===lt.alternate&&k%2==0,j);for(let t=0;t<k;t++){const e=k-1-t,r=n.direction===lt.alternate&&e%2==0;E(p+x+t*y,r)}}else{for(let t=0;t<k;t++){const e=n.direction===lt.alternate&&t%2==0;E(p+t*y,e)}if(j>1e-9){const t=n.direction===lt.alternate&&k%2==0;E(p+k*y,t,j)}}return n.repeatAt===st.start?[...O,...e]:_&&e.length>0?[...e.slice(0,-1),w(A({},e[e.length-1]),{e:M}),...O]:[...e,...O]}function Qn(t,e,n,r){var o;const i=e.keyframes||[],a=[];for(const e of i){const n=Mt(e);let i=_t(e);const s=Et(e);"d"===t&&(i=qn(i));const l=Je(t)?Xe(t):t;Ue.has(l)&&(i=null!=(o=Ve(i))?o:i);const u={t:n,v:i,e:Zn(s,r)},c=Nt(e),f=Ct(e);c&&(u.tangentIn=c),f&&(u.tangentOut=f),a.push(u)}a.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const s=e.loop,l=!0===s?{}:s||void 0;return l&&a.length>=2?Jn(t,a,l,n):a}function Xn(t,e,n){const r=e.loop;if(null==r||!1===r)return e;const o=!0===r?{}:r,i=e.keyframes;if(!Array.isArray(i)||i.length<2)return e;const a=Je(t)?Xe(t):t,s=Ue.has(a),l=i.map(e=>{var n;const r=Mt(e);let o=_t(e);"d"===t&&(o=qn(o)),s&&(o=null!=(n=Ve(o))?n:o);const i={t:r,v:o,e:Et(e)},a=Nt(e),l=Ct(e);return a&&(i.tangentIn=a),l&&(i.tangentOut=l),i}),u={keyframes:Jn(t,l,o,n)};return void 0!==e.autoOrient&&(u.autoOrient=e.autoOrient),u}function Yn(t,e){const n=$n(t,e);return null!=n?n:t}function $n(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=$n(t.children[r],e);null!==o&&(n||(n=t.children.slice()),n[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o;for(const n of Object.keys(t)){const o=t[n],i=Xn(n,o,e);i!==o&&(r||(r=A({},t)),r[n]=i)}}if(!n&&!r)return null;const i=A({},t);return n&&(i.children=n),r&&(i.animate=r),i}var tr=0;function er(t,e=nt.native){const n=At(t)||{},r=jt(t),o=n.duration||1e3,i=[],a=(t,n,i)=>{if(0===n.length)return null;const a=function(t,e,n,r=nt.native){const o={};for(const[i,a]of Object.entries(t)){if("transform"===i&&"offsetPath"===a.alongPathMode&&void 0!==t.offsetDistance)continue;const s=Qn(i,a,e,n);if(s.length>0){const t={keyframes:s};void 0!==a.autoOrient&&(t.autoOrient=a.autoOrient),void 0!==a.loop&&(t.loop=a.loop),o[i]=r===nt.native&&"transform"===i?On(t):t}}return o}(function(t,e){if(!t)return t;const n=e&&"object"==typeof e&&!Array.isArray(e)?e:function(t){var e,n;if(!t||"string"!=typeof t)return;const r={},o=/([a-zA-Z]+)\s*\(([^)]*)\)/g,i=["translate","rotate","skewX","scale"];let a,s=-1;for(;null!==(a=o.exec(t));){const t=a[1],o=i.indexOf(t);if(o<0||o<=s)return;s=o;const l=a[2].split(/[\s,]+/).filter(Boolean).map(Number);if(l.some(t=>Number.isNaN(t)))return;if("translate"===t){if(l.length<1||l.length>2)return;r.translate=[l[0],null!=(e=l[1])?e:0]}else if("rotate"===t){if(1!==l.length)return;r.rotate=l[0]}else if("skewX"===t){if(1!==l.length)return;r.skew=l[0]}else{if(l.length<1||l.length>2)return;r.scale=[l[0],null!=(n=l[1])?n:l[0]]}}return t.replace(/([a-zA-Z]+)\s*\(([^)]*)\)/g,"").replace(/[\s,]/g,"").length?void 0:Object.keys(r).length?r:void 0}(e);if(!n||!Object.keys(n).length)return t;const r=t=>t&&"object"==typeof t&&!Array.isArray(t)?A(A({},n),t):t,o=t[mt];if(o&&"object"==typeof o){const e=o;if(Array.isArray(e.keyframes)){const n=w(A({},e),{keyframes:e.keyframes.map(t=>w(A({},t),{value:r(t.value)}))});return void 0!==n.value&&(n.value=r(n.value)),w(A({},t),{transform:n})}return t}const i=Object.keys(t).filter(t=>Be.has(t));if(1!==i.length)return t;const a=i[0],s=t[a];if(!s||"object"!=typeof s||!Array.isArray(s.keyframes))return t;const l=w(A({},s),{keyframes:s.keyframes.map(t=>w(A({},t),{value:w(A({},n),{[a]:t.value})}))});void 0!==l.value&&(l.value=w(A({},n),{[a]:l.value}));const u=A({},t);return delete u[a],w(A({},u),{transform:l})}(function(t){const e={};for(const n of t)for(const[t,r]of Object.entries(n))e[t]=r;return e}(n),i),o,r,e);return 0===Object.keys(a).length?null:{id:t,animate:a}},s=function(t){var e;if(t)return null==(e=At(t))?void 0:e.bindings}(t);if(s)for(const t of s){const e=t.target.startsWith("#")?t.target.slice(1):t.target,n=t.animateWith.map(t=>Kn(t,r)).filter(t=>!!t),o=a(e,n);o&&i.push(o)}const l=t=>{const e=t.animate;if(e&&Object.keys(e).length>0){const n=t.id||"_px_el_"+ ++tr;t.id=n;const o=a(n,function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=Kn(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=Kn(r,e);t&&n.push(t)}else n.push(t);return n}(e,r),t.transform);o&&i.push(o)}if(t.children)for(let e=0;e<t.children.length;e++)l(t.children[e])};if(t.children)for(let e=0;e<t.children.length;e++)l(t.children[e]);return i}function nr(t,e,n){var r,o,i,a;const s=e.keyframes||[];if(0===s.length)return null;const{prevKf:l,nextKf:u}=function(t,e){var n,r;const o=t.length-1;let i=t[0],a=t[o>0?1:0];for(let s=0;s<o;s++){const l=null!=(n=t[s].t)?n:0,u=null!=(r=t[s+1].t)?r:0;if(l<=e&&e<=u){i=t[s],a=t[s+1];break}e>u&&s===o-1&&(i=t[o>0?o-1:0],a=t[o])}return{prevKf:i,nextKf:a}}(s,n);let c=l===u?0:(f=n,d=null!=(r=l.t)?r:0,(h=null!=(o=u.t)?o:0)===d?0:0+(f-d)/(h-d)*1);var f,d,h;c=Ye(c,0,1);const p=Et(l);if(p&&Array.isArray(p))try{c=Fe(p)(c)}catch(t){}let m=Je(t)?Xe(t):t,g=null;const v=null==l?void 0:l.v,y=null==u?void 0:u.v;if("d"===m)g=ze(null!=(i=null==v?void 0:v.paths)?i:Array.isArray(v)?v:[],null!=(a=null==y?void 0:y.paths)?a:Array.isArray(y)?y:[],c).map(t=>_e(t)).join("");else if(Ue.has(m))g=We(Ce(v||[0,0,0,1],y||[0,0,0,1],c)),m=t;else if("stroke-dasharray"===m)g=Ne(v||[],y||[],c).join(" "),m=t;else if("transform"!==m||null===v||"object"!=typeof v||Array.isArray(v))"translate"===m?(g="translate("+Ne(v||[0,0],y||[0,0],c).join(",")+")",m="transform"):"rotate"===m?(g="rotate("+Ee(+(v||0),+(y||0),c)+")",m="transform"):"scale"===m?(g="scale("+Ne(v||[1,1],y||[1,1],c).join(",")+")",m="transform"):g=Ee(+(v||0),+(y||0),c);else{const t=new Set([...v?Object.keys(v):[],...y?Object.keys(y):[]]),n={};for(const e of t){const t=null==v?void 0:v[e],r=null==y?void 0:y[e];if("rotate"===e||"skew"===e)n[e]=Ee(+(null!=t?t:0),+(null!=r?r:0),c);else if("translate"===e||"scale"===e||"origin"===e){const o="scale"===e?[1,1]:[0,0],i=Ne(t||o,r||o,c);n[e]=i}}if(bn(e)){const t=v.translate,r=y.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=function(t,e,n,r,o,i){const a=An(t,e,n,r),s=0===a.totalArc?o:function(t,e){const n=e*t.ds[t.ds.length-1],{ts:r,ds:o}=t,i=o.length-1;if(n<=0)return r[0];if(n>=o[i])return r[i];let a=1,s=i;for(;a<s;){const t=a+s>>>1;o[t]<n?a=t+1:s=t}const l=o[s-1],u=o[s]-l,c=u>0?(n-l)/u:0;return r[s-1]+c*(r[s]-r[s-1])}(a.lut,o),l=$e(a.P0,a.P1,a.P2,a.P3,s);if(!i)return{translate:l};const u=en(a.P0,a.P1,a.P2,a.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}(l,u,[+t[0],+t[1]],[+r[0],+r[1]],c,!!e.autoOrient);n.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(n.rotate=o.rotateDeg)}}g=qe(n,{withUnits:!1}),m="transform"}return Ge.has(m)&&"number"==typeof g&&(g=100*g+"%"),{k:m,v:null===g?"":""+g}}function rr(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=nr(r,o,e);t&&(n[t.k]=t.v)}return n}var or=48,ir=/[MmLlHhVvCcSsQqTtAaZz]/;function ar(t,e,n){return{P1:[t[0]+2/3*(e[0]-t[0]),t[1]+2/3*(e[1]-t[1])],P2:[n[0]+2/3*(e[0]-n[0]),n[1]+2/3*(e[1]-n[1])]}}function sr(t){const e=function(t){const e=function(t){const e=[],n=/([MmLlHhVvCcSsQqTtAaZz])|(-?\d*\.?\d+(?:[eE][-+]?\d+)?)/g;let r;for(;null!==(r=n.exec(t));)e.push(r[0]);return e}(t),n=[];let r=0,o=0,i=0,a=0,s=0,l=0,u=0,c=0,f=0,d="";const h=()=>parseFloat(e[r++]),p=(t,e,r)=>{const a=[o,i],s=rn(a,t,e,r,or);n.push({P0:a,P1:t,P2:e,P3:r,lut:s,len:s.ds[s.ds.length-1]}),o=r[0],i=r[1]},m=(t,e)=>{p([o+(t-o)/3,i+(e-i)/3],[o+2*(t-o)/3,i+2*(e-i)/3],[t,e])};for(;r<e.length;){let t=e[r];ir.test(t)?r++:t="M"===d?"L":"m"===d?"l":d;const n=t>="a",g=t.toUpperCase();if("Z"!==g){if("M"===g){const e=h()+(n?o:0),r=h()+(n?i:0);o=e,i=r,a=e,s=r,d=t;continue}if("L"===g)m(h()+(n?o:0),h()+(n?i:0));else if("H"===g)m(h()+(n?o:0),i);else if("V"===g)m(o,h()+(n?i:0));else if("C"===g){const t=[h()+(n?o:0),h()+(n?i:0)],e=[h()+(n?o:0),h()+(n?i:0)],r=[h()+(n?o:0),h()+(n?i:0)];l=e[0],u=e[1],p(t,e,r)}else if("S"===g){const t="C"===d.toUpperCase()||"S"===d.toUpperCase()?[2*o-l,2*i-u]:[o,i],e=[h()+(n?o:0),h()+(n?i:0)],r=[h()+(n?o:0),h()+(n?i:0)];l=e[0],u=e[1],p(t,e,r)}else if("Q"===g){const t=[h()+(n?o:0),h()+(n?i:0)],e=[h()+(n?o:0),h()+(n?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=ar([o,i],t,e);p(r,a,e)}else if("T"===g){const t="Q"===d.toUpperCase()||"T"===d.toUpperCase()?[2*o-c,2*i-f]:[o,i],e=[h()+(n?o:0),h()+(n?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=ar([o,i],t,e);p(r,a,e)}else{if("A"!==g){r++;continue}r+=5,m(h()+(n?o:0),h()+(n?i:0))}d=t}else m(a,s),o=a,i=s,d=t}return n.length?n:null}(t);if(!e)return null;const n=new Float64Array(e.length+1);for(let t=0;t<e.length;t++)n[t+1]=n[t]+e[t].len;const r=n[e.length],o=e[0].P0,i=e[e.length-1].P3,a=Math.hypot(i[0]-o[0],i[1]-o[1])<.001,s=t=>{let r=0;for(;r<e.length-1&&t>n[r+1];)r++;const o=e[r],i=t-n[r],a=o.len>0?function(t,e){const{ts:n,ds:r}=t,o=r.length-1;if(e<=0)return n[0];if(e>=r[o])return n[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;r[t]<e?i=t+1:a=t}const s=r[a-1],l=r[a]-s,u=l>0?(e-s)/l:0;return n[a-1]+u*(n[a]-n[a-1])}(o.lut,i):0,[s,l]=$e(o.P0,o.P1,o.P2,o.P3,a),[u,c]=en(o.P0,o.P1,o.P2,o.P3,a);return{x:s,y:l,angle:Math.atan2(c,u)}};return{totalLength:r,closed:a,sampleAtDistance(t){if(a&&r>0&&(t<0||t>r))return s((t%r+r)%r);if(!a&&(t<0||t>r)){const e=t<0?0:r,n=s(e),o=t-e;return{x:n.x+Math.cos(n.angle)*o,y:n.y+Math.sin(n.angle)*o,angle:n.angle}}return s((n=r,(e=t)<0?0:e>n?n:e));var e,n}}}function lr(t,e,n){const r={};return"translate"===t?r.translate=e:"rotate"===t?r.rotate=e:"skew"===t?r.skew=e:r.scale=e,n&&"translate"!==t&&(r.origin=n),r}function ur(t){var e,n;if(void 0===t)return{kind:"absent"};if(Array.isArray(t))return{kind:"static",value:t};if("object"==typeof t){const r=t,o=r.keyframes;if(o){const t={kind:"animated",keyframes:o.map(fr),autoOrient:r.autoOrient,loop:r.loop},n=null!=(e=r.value)?e:r.v;return void 0!==n&&"animated"===t.kind&&(t.base=n),t}const i=null!=(n=r.value)?n:r.v;if(void 0!==i)return{kind:"static",value:i}}return{kind:"static",value:t}}function cr(t,e,n,r){var o,i,a,s;const l=t=>(null==r?void 0:r.asString)&&null!=t?String(t):t;if("absent"===n.kind)return;if("static"===n.kind)return void(t[e]=l(n.value));const u=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,c=A({},u||{}),f={keyframes:n.keyframes};void 0!==n.loop&&(f.loop=n.loop),void 0!==n.autoOrient&&(f.autoOrient=n.autoOrient),c[e]=f,t.animate=c;const d=null!=(s=null!=(i=n.base)?i:null==(o=n.keyframes[0])?void 0:o.value)?s:null==(a=n.keyframes[0])?void 0:a.v;void 0!==d&&(t[e]=l(d))}function fr(t){if(!t||"object"!=typeof t)return t;const e=t;if(void 0===e.t&&void 0===e.v&&void 0===e.e&&void 0===e.to&&void 0===e.ti)return t;const n=A({},e);return void 0===n.time&&void 0!==e.t&&(n.time=e.t),void 0===n.value&&void 0!==e.v&&(n.value=e.v),void 0===n.easing&&void 0!==e.e&&(n.easing=e.e),void 0===n.tangentOut&&void 0!==e.to&&(n.tangentOut=e.to),void 0===n.tangentIn&&void 0!==e.ti&&(n.tangentIn=e.ti),n}function dr(t,e){const n={value:e};return void 0!==t.time&&(n.time=t.time),void 0!==t.easing&&(n.easing=t.easing),void 0!==t.tangentOut&&(n.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(n.tangentIn=t.tangentIn),n}function hr(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(hr);const e={};for(const n of Object.keys(t))e[n]=hr(t[n]);return e}function pr(t,e){const n=new Map,r=t=>{var o;if("string"==typeof t.id){const r=e();n.set(t.id,r),t.id=r}null==(o=t.children)||o.forEach(r)};r(t);const o=t=>t.replace(/url\(#([^)]+)\)/g,(t,e)=>{const r=n.get(e);return r?"url(#"+r+")":t}),i=t=>{var e;if("string"==typeof t.href&&t.href.startsWith("#")){const e=n.get(t.href.slice(1));e&&(t.href="#"+e)}for(const e of Object.keys(t)){if("children"===e||"effects"===e||"meta"===e||"animate"===e||"href"===e||"id"===e)continue;const n=t[e];"string"==typeof n&&-1!==n.indexOf("url(#")&&(t[e]=o(n))}null==(e=t.children)||e.forEach(i)};return i(t),n}function mr(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function gr(t){var e;const n=mr(t.x),r=mr(t.y);if(delete t.x,delete t.y,!n&&!r)return t;const o="translate("+n+","+r+")";if(void 0!==t.transform||void 0!==t.animate){const n={type:"g",transform:o,children:null!=(e=t.children)?e:[]};t.children=[n]}else t.transform=o;return t}function vr(t,e){return"_lw_"+e+"_"+t.nextId++}function yr(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function br(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>br(t,e))}var kr=hr,Ar=.15;function wr(t){const e=ur(t);if("static"===e.kind&&"number"==typeof e.value)return{min:e.value,max:e.value};if("animated"===e.kind&&e.keyframes.length){const t=e.keyframes.map(t=>Number(t.value)||0);return{min:Math.min(...t),max:Math.max(...t)}}return{min:0,max:0}}function xr(t){let e=0,n=16;const r=t=>{var o;const i=parseFloat(String(null!=(o=t.fontSize)?o:""))||0;i&&(n=Math.max(n,i));const a=t.textContent;if("string"==typeof a&&(e+=a.length),t.children)for(const e of t.children)r(e)};return r(t),e*n}var jr=t=>Math.round(1e3*t)/1e3;function Or(t,e,n){null!=n&&cr(t,e,ur(n),{asString:!0})}var Pr=(t,e,n)=>{const r={type:t};for(const t in e)void 0!==e[t]&&(r[t]=e[t]);const o=Array.isArray(n)?n.filter(t=>null!=t):null!=n?[n]:[];return o.length&&(r.children=o),r};function Sr(t,e){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function Mr(t,e){let n="";for(let r=0;r<t.length;r++){const o=Sr(t[r],e);r>0&&45!==o.charCodeAt(0)&&(n+=" "),n+=o}return n}function _r(t,e,n){return[t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}var Er=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function Nr(t,e,n=2){const r=[];let o;for(Er.lastIndex=0;null!==(o=Er.exec(t));)r.push(o[0]);let i="",a=0;const s=()=>parseFloat(r[a++]);for(;a<r.length;){const t=r[a++];if("M"===t||"L"===t){const[r,o]=_r(e,s(),s());i+=t+Mr([r,o],n)}else if("C"===t){const[t,r]=_r(e,s(),s()),[o,a]=_r(e,s(),s()),[l,u]=_r(e,s(),s());i+="C"+Mr([t,r,o,a,l,u],n)}else if("Q"===t){const[t,r]=_r(e,s(),s()),[o,a]=_r(e,s(),s());i+="Q"+Mr([t,r,o,a],n)}else"Z"!==t&&"z"!==t||(i+="Z")}return i}var Cr=16,zr=["fontFamily","fontSize","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","textDecoration","textTransform","whiteSpace","x","y","dx","dy","lengthAdjust","fill","stroke","strokeWidth","effects",ht,"xml:space"],Tr=["fillOpacity","fillRule","strokeOpacity","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","mixBlendMode","filter"],Dr=["fill","stroke","strokeWidth","opacity","fillOpacity","strokeOpacity","strokeDasharray","strokeDashoffset"];function Fr(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?void 0:e}}function Ir(t){return"string"==typeof t?t:void 0}function Lr(t){const e=t.animate;if(!e||"object"!=typeof e)return;let n;for(const t of Dr)void 0!==e[t]&&((null!=n?n:n={})[t]=e[t]);return n}function Rr(t,e){var n,r,o,i,a,s,l,u,c,f;const d="text"===t.type,h=t.style,p=e=>{var n;return d?void 0:null!=(n=t[e])?n:null==h?void 0:h[e]},m={fontFamily:null!=(n=Ir(t.fontFamily))?n:e.fontFamily,fontSize:null!=(r=Fr(t.fontSize))?r:e.fontSize,fill:null!=(o=t.fill)?o:e.fill,stroke:null!=(i=t.stroke)?i:e.stroke,strokeWidth:null!=(a=t.strokeWidth)?a:e.strokeWidth,letterSpacing:null!=(s=Fr(t.letterSpacing))?s:e.letterSpacing,wordSpacing:null!=(l=Fr(t.wordSpacing))?l:e.wordSpacing,opacity:null!=(u=Fr(p("opacity")))?u:e.opacity,animate:null!=(c=d?void 0:Lr(t))?c:e.animate};for(const t of Tr){const n=null!=(f=p(t))?f:e[t];void 0!==n&&(m[t]=n)}return m}function Wr(t){var e,n,r;return{fontFamily:Ir(t.fontFamily),fontSize:null!=(e=Fr(t.fontSize))?e:Cr,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(n=Fr(t.letterSpacing))?n:0,wordSpacing:null!=(r=Fr(t.wordSpacing))?r:0}}function Vr(t){const e={};void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),void 0!==t.opacity&&1!==t.opacity&&(e.opacity=t.opacity);for(const n of Tr)void 0!==t[n]&&(e[n]=t[n]);return void 0!==t.animate&&(e.animate=t.animate),e}function Ur(t,e,n,r){var o;const i=t.fontFamily?e[t.fontFamily]:n;return i||null==r||r.push('textGlyphs: no glyphs for font "'+(null!=(o=t.fontFamily)?o:"")+'"'),i}function Br(t){const e=Object.keys(t);return 1===e.length?t[e[0]]:void 0}var Gr=.6,qr="px-missing-glyph";function Zr(t,e){if(t<=0||e<=0)return"";const n=.08*t,r=.92*t,o=.92*-e,i=r-n,a=-o,s=Math.max(1,.12*Math.min(i,a)),l="M"+n+" 0L"+r+" 0L"+r+" "+o+"L"+n+" "+o+"Z";if(i<=2*s||a<=2*s)return l;const u=n+s,c=r-s,f=-s,d=o+s;return l+"M"+u+" "+f+"L"+u+" "+d+"L"+c+" "+d+"L"+c+" "+f+"Z"}function Kr(t,e,n,r,o=0){const{x:i,y:a,angle:s}=t.sampleAtDistance(e),l=Math.cos(s),u=Math.sin(s),c=r/2;return[n*l,n*u,-n*u,n*l,i-n*l*c-o*u,a-n*u*c+o*l]}function Hr(t){var e;const n=ur(t);if("animated"===n.kind&&n.keyframes.length>=2){const t=[...n.keyframes].sort((t,e)=>(Number(t.time)||0)-(Number(e.time)||0)),e=t.map(t=>Number(t.time)||0),r=t.map(t=>Number(t.value)||0);return{animated:!0,times:e,loop:n.loop,at(t){if(t<=e[0])return r[0];for(let n=1;n<e.length;n++)if(t<=e[n]){const o=e[n]-e[n-1],i=o>0?(t-e[n-1])/o:1;return r[n-1]+i*(r[n]-r[n-1])}return r[r.length-1]}}}const r="animated"===n.kind?Number(null==(e=n.keyframes[0])?void 0:e.value)||0:"static"===n.kind&&Number(n.value)||0;return{animated:!1,times:[],at:()=>r}}var Jr=48,Qr=64;function Xr(t,e){const n=b(10,e);return Math.round(t*n)/n}function Yr(t){const e={};void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(e.opacity=t.opacity);for(const n of Tr)void 0!==t[n]&&(e[n]=t[n]);return e}function $r(t){return t?{[pt]:qr}:{}}function to(t,e,n){if(!t.length)return null==n||n.push("textGlyphs: nothing to render"),[];const r=new Map;for(const e of t){const t=JSON.stringify([e.paint,!!e.isMissing]),n=Nr(e.glyphD,e.m),o=r.get(t);o?o.d+=n:r.set(t,{paint:e.paint,d:n,isMissing:e.isMissing})}const o=[];for(const{paint:t,d:n,isMissing:i}of r.values())o.push(e("path",A(A(A({d:n},Yr(t)),$r(i)),void 0!==t.animate?{animate:A({},t.animate)}:{}),[]));return o}function eo(t,e,n){const r={};for(const e of Object.keys(t))"type"!==e&&"children"!==e&&-1===zr.indexOf(e)&&(r[e]=t[e]);if(r.style&&"object"==typeof r.style){const t=A({},r.style);delete t["white-space"],Object.keys(t).length?r.style=t:delete r.style}return n("g",r,e)}var no={document:"document",host:"host",platform:"platform",usage:"usage",internal:"internal"};function ro(t,e){const n=e?e+" ":"";return{warn:(e,r,o)=>{if(null==t?void 0:t.onWarn)return void t.onWarn({kind:e,message:r,detail:o});if(null==t?void 0:t.muteWarn)return;const i=n+e+": "+r;void 0===o?console.warn(i):console.warn(i,o)},error:(e,r,o)=>{const i=function(t){return"string"==typeof t?new Error(t):t}(r);if(null==t?void 0:t.onError)return void t.onError({kind:e,message:i.message,error:i,detail:o});if(null==t?void 0:t.muteError)return;const a=n+e+": "+i.message;void 0===o?console.error(a):console.error(a,o)}}}var oo=6;function io(t,e,n){if(!e)return t;delete t.transform;let r=t;return r=so(r,e.origin,!0),r=ao(r,"scale",e.scale),r=ao(r,"skew",e.skew),r=ao(r,"rotate",e.rotate),r=so(r,e.origin,!1),function(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}(e.translate)?(r=so(r,e.origin,!0),r=ao(r,"translate",e.translate),r=so(r,e.origin,!1)):r=ao(r,"translate",e.translate),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function ao(t,e,n,r){if(void 0===n)return t;const o=ur(n);if("static"===o.kind)return{type:"g",transform:{value:lr(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>dr(t,lr(e,t.value,void 0)))};return o.autoOrient&&(n.autoOrient=!0),void 0!==o.loop&&(n.loop=o.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function so(t,e,n){if(void 0===e)return t;const r=ur(e),o=t=>n?[-t[0],-t[1]]:t;if("absent"===r.kind)return t;if("static"===r.kind)return 0===r.value[0]&&0===r.value[1]?t:{type:"g",transform:{value:{translate:o(r.value)}},children:[t]};if("animated"===r.kind){const e={keyframes:r.keyframes.map(t=>dr(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function lo(t,e,n){var r,o,i;if("use"===t.type&&"translate"===(null==(o=null==(r=t.effects)?void 0:r.clone)?void 0:o.without)){const r=yr(t.effects.clone.source);"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(i=t.children)||i.forEach(t=>lo(t,e,n))}function uo(t){const e=/translate\(([^)]*)\)/.exec(t);if(!e)return[0,0];const n=e[1].split(/[\s,]+/).filter(Boolean).map(Number);return[n[0]||0,n[1]||0]}function co(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||!!Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}function fo(t,e,n,r){if(!e)return t;const o=vr(n,"grad"),i=function(t,e){const n={type:t.type===kt.radial?"radialGradient":"linearGradient",id:e};return t.type===kt.linear?(ho(n,"x1","y1",t.start),ho(n,"x2","y2",t.end)):(ho(n,"cx","cy",t.center),function(t,e,n){const r=ur(n);"absent"!==r.kind&&cr(t,"r",r,{asString:!0})}(n,0,t.radius),ho(n,"fx","fy",t.focal)),t.gradientUnits&&(n.gradientUnits=t.gradientUnits),t.spreadMethod&&(n.spreadMethod=t.spreadMethod),t.gradientTransform&&(n.gradientTransform=t.gradientTransform),n.children=function(t){var e,n;if(!t)return[];const r=ur(t);if("absent"===r.kind)return[];if("static"===r.kind)return Array.isArray(r.value)?r.value.map(po):[];const o=r.keyframes;if(!o.length)return[];const i=r.loop;let a=0;for(const t of o){const e=_t(t);Array.isArray(e)&&e.length>a&&(a=e.length)}if(!a)return[];const s=_t(o[0]),l=[];for(let t=0;t<a;t++){const r=null!=(n=null!=(e=null==s?void 0:s[t])?e:mo(o,0,t))?n:{offset:t/Math.max(1,a-1),color:"#000000"};l.push({offset:r.offset,color:r.color})}return l.map((t,e)=>function(t,e,n,r,o){var i;const a=[],s=[];let l=!1;for(const r of e){const o=Mt(r),u=_t(r),c=null!=(i=null==u?void 0:u[n])?i:mo(e,e.indexOf(r),n);if(!c)continue;const f=Et(r),d={time:o,value:c.color};void 0!==f&&(d.easing=f),a.push(d);const h={time:o,value:c.offset};void 0!==f&&(h.easing=f),s.push(h),c.offset!==t.offset&&(l=!0)}const u={type:"stop",offset:go(t.offset),stopColor:t.color},c={};return a.length&&(c.stopColor={keyframes:a},void 0!==o&&(c.stopColor.loop=o)),l&&s.length&&(c.offset={keyframes:s},void 0!==o&&(c.offset.loop=o)),Object.keys(c).length&&(u.animate=c),u}(t,o,e,0,i))}(t.stops),n}(e,o);return n.defs.push(i),t[r]="url(#"+o+")",t}function ho(t,e,n,r){var o,i,a;const s=ur(r);if("absent"===s.kind)return;if("static"===s.kind)return t[e]=String(s.value[0]),void(t[n]=String(s.value[1]));const l=t=>{const e={keyframes:s.keyframes.map(e=>{const n={time:e.time,value:Array.isArray(e.value)?e.value[t]:void 0};return void 0!==e.easing&&(n.easing=e.easing),n})};return void 0!==s.loop&&(e.loop=s.loop),e},u=null!=(o=t.animate)?o:{};u[e]=l(0),u[n]=l(1),t.animate=u;const c=null!=(a=s.base)?a:null==(i=s.keyframes[0])?void 0:i.value;Array.isArray(c)&&(t[e]=String(c[0]),t[n]=String(c[1]))}function po(t){return{type:"stop",offset:go(t.offset),stopColor:t.color}}function mo(t,e,n){for(let r=e;r>=0;r--){const e=_t(t[r]);if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=_t(t[r]);if(null==e?void 0:e[n])return e[n]}}function go(t){return Math.round(1e3*t)/10+"%"}function vo(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.pathData?t.pathData:void 0}function yo(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=ur(t);if("absent"!==r.kind)return"static"===r.kind?r.value:(e.warnings.push("transformBy.origin: animated origin approximated by its first keyframe"),null==(n=r.keyframes[0])?void 0:n.value)}(e.origin,n);let o=t;return o=bo(o,"translate",e.translate,void 0),o=bo(o,"rotate",e.rotate,r),o=bo(o,"scale",e.scale,r),o}function bo(t,e,n,r,o){if(void 0===n)return t;const i=ur("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);if("static"===i.kind)return{type:"g",transform:{value:lr(e,ko(e,i.value),r)},children:[t]};if("animated"===i.kind){const n={keyframes:i.keyframes.map(t=>{const n=dr(t,lr(e,ko(e,t.value),r));return"translate"===e?A(A({},n),Ao(t)):n})};return void 0!==i.loop&&(n.loop=i.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function ko(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function Ao(t){var e,n;const r={},o=null!=(e=t.tangentOut)?e:t.to,i=null!=(n=t.tangentIn)?n:t.ti;return Array.isArray(o)&&(r.tangentOut=[-o[0],-o[1]]),Array.isArray(i)&&(r.tangentIn=[-i[0],-i[1]]),r}function wo(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function xo(t){let e=0,n=0;for(const r of t)r.translate&&(e+=r.translate[0],n+=r.translate[1]);return[e,n]}function jo(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=Oo(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function Oo(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function Po(t,e){var n,r,o;const i=t.transform,a=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate.transform:void 0;if(void 0===i&&!a)return;const s={};if("string"==typeof i){const t=function(t,e){const n=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,i=0,a=!1,s=!1;for(;null!==(r=n.exec(t));){const t=r[1],e=r[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);"translate"===t?(o+=e[0]||0,i+=e[1]||0,a=!0):s=!0}return s&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t),a?[o,i]:void 0}(i,e);t&&(s.translate=t)}else if(i&&"object"==typeof i&&!i.keyframes){const t=i.value,n=t&&"object"==typeof t?t:i;n&&"object"==typeof n&&Array.isArray(n.translate)&&(s.translate=[n.translate[0]||0,n.translate[1]||0]),!n||void 0===n.rotate&&void 0===n.scale&&void 0===n.skew||e.warnings.push("maskedBy ancestor: non-translate transform parts ignored (rotate/scale not yet supported)")}if(a&&Array.isArray(a.keyframes)){const t=a.keyframes,i=[];for(const a of t){const t=null!=(n=a.value)?n:a.v,s=null!=(o=null!=(r=a.time)?r:a.t)?o:0;t&&"object"==typeof t&&Array.isArray(t.translate)&&(i.push({time:s,value:[t.translate[0]||0,t.translate[1]||0]}),void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: animated non-translate parts ignored"))}i.length&&(s.translateKeyframes=i)}return s.translate||s.translateKeyframes?s:void 0}function So(t,e,n){if(!e)return;const r=yr(e.source);if(!r)return void(e.without===ft.translate&&n.errors.push("clone: content ref missing `source`"));const o=e.without===ft.translate&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function Mo(t,e){const n={};return void 0!==t.translate&&(n.translate=_o(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=_o(t.rotate,t=>t*e)),void 0!==t.skew&&(n.skew=_o(t.skew,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){return _o(t,t=>[Math.pow(t[0],e),Math.pow(t[1],e)],!0)}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function _o(t,e,n=!1){const r=ur(t);if("absent"===r.kind)return t;if("static"===r.kind){const o=e(r.value);return"number"!=typeof t&&!Array.isArray(t)||n?{value:o}:o}const o={keyframes:r.keyframes.map(t=>t&&void 0!==t.value?w(A({},t),{value:e(t.value)}):t)};return void 0!==r.loop&&(o.loop=r.loop),void 0!==r.autoOrient&&(o.autoOrient=r.autoOrient),void 0!==r.base&&(o.value=e(r.base)),o}var Eo=!1;function No(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}var Co=1;function zo(t,e,n){const[r,o]=e;if(!Number.isFinite(r)||!Number.isFinite(o))return void n.warnings.push("retime: timeCrop is not a pair of finite numbers — ignored");const i=o<=r?[{time:0,value:0}]:[...r>0?[{time:Math.max(0,r-Co),value:0}]:[],{time:Math.max(0,r),value:1},{time:o,value:1},{time:o+Co,value:0}],a=A({},t);for(const e of Object.keys(t))delete t[e];t.type="g",t.children=[a],t.animate={opacity:{keyframes:i}}}function To(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function Do(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function Fo(t){var e;const n=null==(e=t.effects)?void 0:e.clone;n&&(delete n.retime,0===Object.keys(n).length&&delete t.effects.clone,t.effects&&0===Object.keys(t.effects).length&&delete t.effects)}function Io(t,e,n){const r=yr(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=Lo(r,e,n,new Set);if(o)if(Eo){const e=n.idMap.get(o);t.type="g",delete t.href,t.children=[e],gr(t),n.defs=n.defs.filter(t=>t!==e)}else t.href="#"+o}function Lo(t,e,n,r){if(r.has(t))return void n.errors.push('retime: loop via "'+t+'"');const o=n.idMap.get(t);if(!o)return void n.warnings.push('retime: target "'+t+'" not found');const i=kr(o);if(function(t,e){pr(t,()=>vr(e,"retimed"))}(i,n),"use"===o.type?Wo(i,e.start,e.stretch):Ro(i,e.start,e.stretch),Fo(i),"use"===o.type&&o.href){const a=yr(o.href);if(a){const s=Do(o),l=s?To(No(s),e):e,u=new Set(r);u.add(t);const c=Lo(a,l,n,u);c&&(i.href="#"+c)}}else!function(t,e,n,r,o){const i=t=>{var a;const s=Do(t);if("use"===t.type&&s&&t.href){const i=yr(t.href);if(i){const a=To(No(s),e),l=new Set(r);l.add(o);const u=Lo(i,a,n,l);u&&(t.href="#"+u)}Fo(t)}null==(a=t.children)||a.forEach(i)};i(t)}(i,e,n,r,t);return n.defs.push(i),"string"==typeof i.id&&n.idMap.set(i.id,i),"string"==typeof i.id?i.id:void 0}function Ro(t,e,n){var r;Wo(t,e,n),null==(r=t.children)||r.forEach(t=>Ro(t,e,n))}function Wo(t,e,n){const r=t=>{for(const r of t)"number"==typeof r.time&&(r.time=e+r.time*n)};if(t.transform&&"object"==typeof t.transform&&Array.isArray(t.transform.keyframes)&&r(t.transform.keyframes),t.animate&&"object"==typeof t.animate)for(const e of Object.keys(t.animate)){const n=t.animate[e];n&&Array.isArray(n.keyframes)&&r(n.keyframes)}}function Vo(t,e){const n=w(A({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function Uo(t,e,n,r,o,i,a,s){const l=Go(r,n,o),u=qo(n,o),c=Ko(i,l),f=Ko(a,u),d=Qo(a),h={type:"path",d:_e(e)};return Ho(h,"strokeDasharray",f),Ho(h,"strokeDashoffset",c),Ho(h,"strokeOpacity",d),[h]}var Bo=1;function Go(t,e,n){const[r]=Zo(n);return n=>e*(-n-r+t)+Bo}function qo(t,e){const[n,r]=Zo(e),o=r-n+1;return e=>{const n=Ye(e[0],0,1),r=Ye(e[1],0,1),i=Math.min(n,r),a=Math.max(n,r),s=[0];let l=Bo;for(let e=0;e<o;e++)s.push(l+i*t),s.push((a-i)*t),l=(1-a)*t;return s.push(l+Bo),s}}function Zo(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function Ko(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>({time:Mt(t),value:e(_t(t)),easing:Et(t)})),loop:t.loop}}function Ho(t,e,n){n&&cr(t,e,n)}var Jo=10;function Qo(t){const e=t=>t[0]===t[1];if("absent"===t.kind)return;if("static"===t.kind)return e(t.value)?{kind:"static",value:0}:void 0;const n=t.keyframes;let r=!1,o=!0;for(const t of n)e(_t(t))?r=!0:o=!1;if(!r)return;if(o)return{kind:"static",value:0};const i=[];for(let t=0;t<n.length;t++){const r=n[t],o=t>0?n[t-1]:void 0,a=t<n.length-1?n[t+1]:void 0,s=Mt(r),l=e(_t(r)),u=o?l&&e(_t(o)):l,c=a?l&&e(_t(a)):l;u&&!c?(i.push({time:s,value:0}),i.push({time:s+Jo,value:1})):!u&&c&&(i.push({time:s-Jo,value:1}),i.push({time:s,value:0}))}return i.length<=1?void 0:{kind:"animated",keyframes:i}}function Xo(t,e){const n=n=>{const r=(n-t.time)/(e.time-t.time),o=t.value[0]+(e.value[0]-t.value[0])*r;return t.value[1]+(e.value[1]-t.value[1])*r-o};let r=t.time,o=e.time,i=n(r);if(0===i)return r;const a=n(o);if(0===a)return o;if(i*a>0)return null;for(let t=0;t<100;t++){const t=(r+o)/2,e=n(t);if(0===e||Math.abs(o-r)<1e-4)return t;i*e<0?o=t:(r=t,i=e)}return(r+o)/2}function Yo(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function $o(t){const e=t.v;if(!e||e.length<2)return 0;let n=0;for(let r=0;r<e.length-1;r++)n+=ti(t,r,r+1);return t.c&&e.length>1&&(n+=ti(t,e.length-1,0)),n}function ti(t,e,n){var r,o,i,a;const s=t.v,l=s[e],u=s[n],c=rn(l,null!=(o=null==(r=t.o)?void 0:r[e])?o:l,null!=(a=null==(i=t.i)?void 0:i[n])?a:u,u);return c.ds[c.ds.length-1]}var ei=.5522847498307936;function ni(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:ot(null==(e=At(t))?void 0:e.engine),glyphs:null==(n=jt(t))?void 0:n.fonts},o=kr(t);br(o,r.idMap),lo(o,r,()=>vr(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const a=yr(null==(i=null==(o=t.effects)?void 0:o.maskedBy)?void 0:i.source);if("string"==typeof a){n.add(t);const r=e.idMap.get(a);r&&n.add(r)}if(Array.isArray(t.children))for(const e of t.children)r(e)};if(r(t),0===n.size)return;const o=(t,r)=>{if(n.has(t)&&e.maskAncestorChains.set(t,r),Array.isArray(t.children)){const n=Po(t,e),i=n?[...r,n]:r;for(const e of t.children)o(e,i)}};o(t,[])}(o,r);const i=function(t,e){return function(t,e){e.idMap.clear(),br(t,e.idMap);const n=[],r=t=>{var e;Do(t)&&n.push(t),null==(e=t.children)||e.forEach(r)};r(t);const o=new Map;for(const t of n){let n=0;const r=new Set,i=o=>{var a;if(o){if(o!==t&&Do(o)&&n++,"use"===o.type&&o.href){const t=yr(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(a=o.children)||a.forEach(i)}},a=yr(t.href);a&&(r.add(a),i(e.idMap.get(a))),o.set(t,n)}n.sort((t,e)=>{var n,r;return(null!=(n=o.get(e))?n:0)-(null!=(r=o.get(t))?r:0)});for(const t of n){const n=Do(t);if(!n)continue;const r=n.timeCrop;Fo(t),Io(t,No(n),e),r&&zo(t,r,e)}}(t,e),t}(ri(o,r),r);return function(t,e){e.length&&(t.children||(t.children=[])).unshift({type:"defs",children:e})}(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function ri(t,e){t.children&&(t.children=t.children.map(t=>ri(t,e)));const n=t.effects,r="string"==typeof t.id?t.id:void 0,o=r?e.contentRefInnerIds.get(r):void 0;if(!n&&!o)return t;const{transformBy:i,repeater:a,maskedBy:s,clipPath:l,strokeTrim:u,clone:c,fillGradient:f,strokeGradient:d,textPath:h,text:p}=null!=n?n:{};n&&delete t.effects;let m=t,g=!1;if(null==p?void 0:p.useGlyphs)if(h){const t="string"==typeof h.pathData?h.pathData:void 0,n=function(t,e,n,r,o,i){return e.glyphs?function(t,e,n,r,o,i){const{glyphs:a,create:s=Pr,warnings:l}=r,u=e?sr(e):null;if(!u)return null==l||l.push("textGlyphs: unparsable along-path geometry"),null;const c=Br(a),{cells:f,width:d}=function(t,e,n,r){const o=[];let i=0;const a=(t,s)=>{var l,u;const c=Rr(t,s),f=Ir(t[ht]);if(f&&!(null==(l=t.children)?void 0:l.length)){const t=Ur(c,e,n,r);if(t){const e=c.fontSize/t.unitsPerEm,n=null!=(u=t.ascent)?u:.9*t.unitsPerEm,r=Vr(c);for(let a=0;a<f.length;a++){const s=f.charAt(a),l=t.glyphs[s];if(l&&l.pathData){const t=l.width*e;o.push({glyphD:l.pathData,widthEm:l.width,scale:e,paint:r,midBase:i+t/2}),i+=t}else if(/\S/.test(s)){const a=l&&l.width>0?l.width:Gr*t.unitsPerEm,s=a*e;o.push({glyphD:Zr(a,n),widthEm:a,scale:e,paint:r,isMissing:!0,midBase:i+s/2}),i+=s}else i+=(l?l.width:0)*e;i+=c.letterSpacing+(" "===s?c.wordSpacing:0)}}}if(t.children)for(const e of t.children)a(e,c)};return a(t,Wr(t)),{cells:o,width:i}}(t,a,c,l);if(!f.length)return eo(t,[],s);const{along:h,perp:p}=function(t){var e,n,r;return{along:(null!=(e=Fr(t.x))?e:0)+(null!=(n=Fr(t.dx))?n:0),perp:null!=(r=Fr(t.dy))?r:0}}(t),m=Hr(n),g=Hr(o),v=t=>t>0&&d>0?t/d:1,y="clip"===i&&!u.closed;if(m.animated||g.animated){const e=function(t,e){const n=[...t,...e].sort((t,e)=>t-e),r=[];for(const t of n)r.length&&t===r[r.length-1]||r.push(t);return r}(m.times,g.times),n=(t,e)=>h+m.at(e)+v(g.at(e))*t.midBase,r=m.animated?m.loop:g.loop;return eo(t,function(t,e,n,r,o,i,a,s=0){const l=Math.max(e.totalLength/Jr,.5),u=t=>t>=0&&t<=e.totalLength,c=[];for(const f of t){const t=[f.scale,0,0,f.scale,-f.scale*(f.widthEm/2),0],d=Nr(f.glyphD,t),h=(t,n)=>{const{x:r,y:o,angle:i}=e.sampleAtDistance(t),a=Math.cos(i),l=Math.sin(i);return{time:n,value:{translate:[Xr(r-s*l,3),Xr(o+s*a,3)],rotate:Xr(180*i/Math.PI,3)}}},p=[],m=[],g=(t,e)=>{p.push(h(t,e)),a&&m.push({time:e,value:u(t)?1:0})};g(n(f,r[0]),r[0]);for(let t=1;t<r.length;t++){const e=r[t-1],o=r[t],i=n(f,e),a=n(f,o),s=Math.min(Qr,Math.max(1,Math.ceil(Math.abs(a-i)/l)));for(let t=1;t<=s;t++){const r=e+t/s*(o-e);g(n(f,r),r)}}Pn(p);const v={keyframes:p};void 0!==o&&(v.loop=o);const y={transform:v};if(f.paint.animate&&Object.assign(y,f.paint.animate),a&&m.some(t=>0===t.value)){const t={keyframes:m};void 0!==o&&(t.loop=o),y.opacity=t}c.push(i("path",w(A(A({d:d},Yr(f.paint)),$r(f.isMissing)),{animate:y}),[]))}return c}(f,u,n,e,r,s,y,p),s)}const b=v(g.at(0)),k=h+m.at(0);return eo(t,to((y?f.filter(t=>{const e=k+t.midBase*b;return e>=0&&e<=u.totalLength}):f).map(t=>({glyphD:t.glyphD,paint:t.paint,isMissing:t.isMissing,m:Kr(u,k+t.midBase*b,t.scale,t.widthEm,p)})),s,l),s)}(t,n,r,{glyphs:e.glyphs,warnings:e.warnings},o,i):(e.warnings.push("textGlyphs: no definitions.fonts"),null)}(m,e,t,h.startOffset,h.textLength,h.pathOverflow);n&&(m=n,g=!0)}else m=function(t,e,n){return(null==e?void 0:e.useGlyphs)?n.glyphs?function(t,e){var n,r,o;const{glyphs:i,create:a=Pr,warnings:s}=e,l=Br(i),u={x:null!=(n=Fr(t.x))?n:0,y:null!=(r=Fr(t.y))?r:0},c=[],f=[{start:u.x,end:u.x}];let d=0;const h=(t,e)=>{var n;const r=Ur(e,i,l,s),o=(null==r?void 0:r.unitsPerEm)||1e3,a=e.fontSize/o,h=null!=(n=null==r?void 0:r.ascent)?n:.9*o,p=Vr(e);for(let n=0;n<t.length;n++){const i=t.charAt(n),s=null==r?void 0:r.glyphs[i];if(s&&s.pathData)c.push({glyphD:s.pathData,m:[a,0,0,a,u.x,u.y],paint:p,line:d,x:u.x,y:u.y,scale:a}),u.x+=s.width*a;else if(/\S/.test(i)){const t=s&&s.width>0?s.width:Gr*o;c.push({glyphD:Zr(t,h),m:[a,0,0,a,u.x,u.y],paint:p,isMissing:!0,line:d,x:u.x,y:u.y,scale:a}),u.x+=t*a}else u.x+=(s?s.width:0)*a;u.x+=e.letterSpacing+(" "===i?e.wordSpacing:0),f[d].end=u.x}},p=(t,e)=>{var n,r,o;const i=Rr(t,e),a=Fr(t.x),s=Fr(t.y);void 0!==a&&(u.x=a,d=f.length,f.push({start:u.x,end:u.x})),void 0!==s&&(u.y=s),u.x+=null!=(n=Fr(t.dx))?n:0,u.y+=null!=(r=Fr(t.dy))?r:0;const l=Ir(t[ht]);if(l&&!(null==(o=t.children)?void 0:o.length)&&h(l,i),t.children)for(const e of t.children)p(e,i)},m=Wr(t);if(t.children)for(const e of t.children)p(e,m);const g=Ir(t[ht]);g&&!(null==(o=t.children)?void 0:o.length)&&h(g,m);const v=Ir(t.textAnchor);if("middle"===v||"end"===v)for(const t of c){const e=f[t.line].end-f[t.line].start,n="middle"===v?-e/2:-e;t.m=[t.scale,0,0,t.scale,t.x+n,t.y]}return eo(t,to(c,a,s),a)}(t,{glyphs:n.glyphs,warnings:n.warnings}):(n.warnings.push("textGlyphs: no definitions.fonts — left as native <text>"),t):t}(m,p,e),g=!0;return g||(m=function(t,e,n){var r;if(!e||"string"!=typeof e.pathData||!e.pathData)return t;const o=vr(n,"tpath"),{d:i,startShift:a}=function(t,e){var n;if("clip"===e.pathOverflow)return{d:t,startShift:0};const r=sr(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,i=Ar*o,a=wr(e.startOffset),s=wr(e.textLength).max||(null!=(n=e.advance)?n:0),l=Math.max(0,-a.min),u=Math.max(0,a.max+s-o),c=l>0?l+i:0,f=u>0?u+i:0;if(f<=0&&c<=0)return{d:t,startShift:0};const d=r.sampleAtDistance(0),h=r.sampleAtDistance(o);let p=t;if(c>0){const e=d.x-Math.cos(d.angle)*c,n=d.y-Math.sin(d.angle)*c,r=t.replace(/^\s*[Mm]\s*-?[\d.]+[\s,]+-?[\d.]+/,"");p="M"+jr(e)+","+jr(n)+"L"+jr(d.x)+","+jr(d.y)+r}if(f>0){const t=h.x+Math.cos(h.angle)*f,e=h.y+Math.sin(h.angle)*f;p+="L"+jr(t)+","+jr(e)}return{d:p,startShift:c}}(e.pathData,{pathOverflow:e.pathOverflow,startOffset:e.startOffset,textLength:e.textLength,advance:xr(t)});n.defs.push({type:"path",id:o,d:i});const s={type:"textPath",href:"#"+o,children:null!=(r=t.children)?r:[]};return void 0!==e.lengthAdjust&&(s.lengthAdjust=e.lengthAdjust),void 0!==e.method&&(s.method=e.method),void 0!==e.spacing&&(s.spacing=e.spacing),Or(s,"startOffset",function(t,e){if(!e||null==t)return t;const n=ur(t);if("absent"===n.kind)return t;if("static"===n.kind)return"number"==typeof t?n.value+e:{value:n.value+e};const r={keyframes:n.keyframes.map(t=>w(A({},t),{value:(Number(t.value)||0)+e}))};return void 0!==n.loop&&(r.loop=n.loop),void 0!==n.autoOrient&&(r.autoOrient=n.autoOrient),void 0!==n.base&&(r.value=n.base+e),r}(e.startOffset,a)),Or(s,"textLength",e.textLength),t.children=[s],t}(m,h,e)),m=function(t,e,n){return fo(t,e,n,"fill")}(m,f,e),m=function(t,e,n){return fo(t,e,n,"stroke")}(m,d,e),m=function(t,e){if(!e)return t;const n=e.subPaths===dt.combined,r=[],o=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const e of t.children)o(e);return}const e="string"==typeof t.d?t.d:function(t){var e,n,r,o,i,a,s,l,u,c;if("rect"===t.type){const i=Number(null!=(e=t.x)?e:0),a=Number(null!=(n=t.y)?n:0),s=Number(null!=(r=t.width)?r:0),l=Number(null!=(o=t.height)?o:0);return"M"+(i+s)+","+a+"L"+(i+s)+","+(a+l)+"L"+i+","+(a+l)+"L"+i+","+a+"L"+(i+s)+","+a+"z"}if("ellipse"===t.type||"circle"===t.type){const e=Number(null!=(i=t.cx)?i:0),n=Number(null!=(a=t.cy)?a:0),r="circle"===t.type?Number(null!=(s=t.r)?s:0):Number(null!=(l=t.rx)?l:0),o="circle"===t.type?Number(null!=(u=t.r)?u:0):Number(null!=(c=t.ry)?c:0);if(!(r>0&&o>0))return;const f=r*ei,d=o*ei,h=(t,e,n,r,o,i)=>"C"+t+","+e+" "+n+","+r+" "+o+","+i;return"M"+(e+r)+","+n+h(e+r,n+d,e+f,n+o,e,n+o)+h(e-f,n+o,e-r,n+d,e-r,n)+h(e-r,n-d,e-f,n-o,e,n-o)+h(e+f,n-o,e+r,n-d,e+r,n)+"z"}}(t);if(void 0===e)return;const n=Un(e);if(!n.length)return;const i={leaf:t,subpaths:[]};for(const t of n){const e=$o(t);i.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}r.push(i)};if(o(t),!r.length)return t;let i=0;const a=n?[...r].reverse():r;for(const t of a)for(const e of t.subpaths)n||(i=0),e.startOffsetPx=i,i+=e.lengthPx;const s=i;if(n&&s<.001)return t;const l=ur(e.offset),u="absent"===l.kind?{kind:"static",value:0}:l,c=function(t){const e=ur(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>({time:Mt(t),value:_t(t),easing:Et(t)}));if(!n.some(t=>t.value[0]>t.value[1]))return{kind:"animated",keyframes:n.map(t=>({time:t.time,value:t.value,easing:t.easing}))};const r=[];for(let t=1;t<n.length;t++){const e=n[t-1],o=n[t];if((e.value[1]-e.value[0])*(o.value[1]-o.value[0])<0){const t=Xo(e,o);null!==t&&t>e.time&&t<o.time&&r.push(Math.round(t))}}const o=Array.from(new Set(r)).sort((t,e)=>t-e),i=[];let a=0;for(const t of n){for(;a<o.length&&o[a]<t.time;){const t=o[a++],e=Yo(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}const e=t.value[0]>t.value[1]?[t.value[1],t.value[0]]:t.value;i.push({time:t.time,value:e,easing:t.easing})}for(;a<o.length;){const t=o[a++],e=Yo(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:i}}(e.range),f="absent"===c.kind?{kind:"static",value:[0,1]}:c,d=function(t){if("absent"===t.kind)return[];if("static"===t.kind)return[t.value];const e=[];for(const n of t.keyframes){const t=_t(n);"number"==typeof t&&e.push(t)}return e}(u),h=[d.length?Math.min(...d):0,d.length?Math.max(...d):0];if(1===r.length&&r[0].leaf===t&&1===r[0].subpaths.length){const e=r[0],o=e.subpaths[0],i=n?s:o.lengthPx;if(i<.001)return t;const a=n?o.startOffsetPx/i:0;return function(t,e,n,r,o,i){const a=Go(n,e,r),s=qo(e,r),l=A({},t);return delete l.effects,Ho(l,"strokeDasharray",Ko(i,s)),Ho(l,"strokeDashoffset",Ko(o,a)),Ho(l,"strokeOpacity",Qo(i)),l}(e.leaf,i,a,h,u,f)}const p=new Map;for(const t of r){const e=[];for(const r of t.subpaths){const o=n?s:r.lengthPx;if(o<.001)continue;const i=n?r.startOffsetPx/o:0;e.push(...Uo(t.leaf,r.subpath,o,i,h,u,f))}p.set(t.leaf,Vo(t.leaf,e))}const m=t=>p.get(t)||(Array.isArray(t.children)&&t.children.length>0?w(A({},t),{children:t.children.map(m)}):t);return m(t)}(m,u),m=function(t,e,n){var r,o;if(!e)return t;const i=null!=(r=e.copies)?r:1;if(i<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const a=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=kr(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate),delete l.id;const u=[l];for(let t=1;t<i;t++){const n=kr(l),r=Mo(e,t),o=r?io(n,r):n;u.push(o)}const c={type:"g",children:u};return t.id&&(c.id=t.id),void 0!==a&&(c.transform=a),void 0!==s&&(c.animate={transform:s}),c}(m,a,e),m=function(t,e,n,r){if(!e)return t;const o=yr(e.source);if(!o)return r.errors.push("maskedBy.source missing — cannot build mask"),t;const i=vr(r,"mask");let a={type:"use",href:"#"+o};if(n)a=yo(a,n,r);else if(wo(t))a=function(t,e){var n;const r=e.animate&&"object"==typeof e.animate&&!Array.isArray(e.animate)?e.animate:void 0,o=null==r?void 0:r.transform,i=o&&"object"==typeof o&&Array.isArray(o.keyframes)?o.keyframes:void 0;if(!i||!i.length)return t;const a=[],s=[],l=[];for(const t of i){const e=(null!=(n=t.value)?n:t.v)||{},r=dr(t,void 0);if(Array.isArray(e.translate)&&a.push(w(A(A({},r),Ao(t)),{value:{translate:[-e.translate[0],-e.translate[1]]}})),"number"==typeof e.rotate){const t={rotate:-e.rotate};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),s.push(w(A({},r),{value:t}))}if(Array.isArray(e.scale)){const t={scale:[1/e.scale[0],1/e.scale[1]]};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),l.push(w(A({},r),{value:t}))}}const u=null==o?void 0:o.loop,c=t=>{const e={keyframes:t};return void 0!==u&&(e.loop=u),e};let f=t;return a.length&&(f={type:"g",animate:{transform:c(a)},children:[f]}),s.length&&(f={type:"g",animate:{transform:c(s)},children:[f]}),l.length&&(f={type:"g",animate:{transform:c(l)},children:[f]}),f}(a,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,i,a,s,l,u,c,f,d,h;const p=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let m;const g=[];for(;null!==(m=p.exec(t));){const t=m[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);g.push({name:m[1],args:t})}if(!g.length)return;const v=g[g.length-1];if("translate"===v.name)for(let t=g.length-2;t>=0;t--){const c=g[t];if("translate"!==c.name)continue;const f=null!=(e=c.args[0])?e:0,d=null!=(n=c.args[1])?n:0,h=null!=(r=v.args[0])?r:0,p=null!=(o=v.args[1])?o:0;if(h!==-f||p!==-d)continue;const m={};m.origin=[f,d];for(let e=0;e<t;e++)if("translate"===g[e].name){const t=null!=(i=g[e].args[0])?i:0,n=null!=(a=g[e].args[1])?a:0;m.translate=m.translate?[m.translate[0]+t,m.translate[1]+n]:[t,n]}for(let e=t+1;e<g.length-1;e++){const t=g[e];if("rotate"===t.name)m.rotate=(null!=(s=m.rotate)?s:0)+(null!=(l=t.args[0])?l:0);else if("scale"===t.name){const e=null!=(u=t.args[0])?u:1,n=t.args.length>1?t.args[1]:e;m.scale=m.scale?[m.scale[0]*e,m.scale[1]*n]:[e,n]}}return m}let y,b,k;for(const t of g)if("translate"===t.name){const e=null!=(c=t.args[0])?c:0,n=null!=(f=t.args[1])?f:0;y=y?[y[0]+e,y[1]+n]:[e,n]}else if("rotate"===t.name)b=(null!=b?b:0)+(null!=(d=t.args[0])?d:0);else if("scale"===t.name){const e=null!=(h=t.args[0])?h:1,n=t.args.length>1?t.args[1]:e;k=k?[k[0]*e,k[1]*n]:[e,n]}const A={};return y&&(A.translate=y),void 0!==b&&(A.rotate=b),k&&(A.scale=k),Object.keys(A).length?A:void 0}(t.transform);if(!e)return;const n={};return e.translate&&(n.translate=e.translate),void 0!==e.rotate&&(n.rotate=e.rotate),e.scale&&(n.scale={value:e.scale}),e.origin&&(n.origin=e.origin),Object.keys(n).length?n:void 0}if(t.transform&&"object"==typeof t.transform&&!t.transform.keyframes){const e=t.transform.value,n=e&&"object"==typeof e?e:t.transform;if(n&&"object"==typeof n){const t={};return Array.isArray(n.translate)&&(t.translate=n.translate),"number"==typeof n.rotate&&(t.rotate=n.rotate),"number"==typeof n.skew&&(t.skew=n.skew),Array.isArray(n.scale)&&(t.scale={value:n.scale}),Array.isArray(n.origin)&&(t.origin=n.origin),Object.keys(t).length?t:void 0}}}(t);e&&(a=yo(a,e,r))}const s=void 0===n&&!function(t){return"string"==typeof t.transform||!(!t.transform||"object"!=typeof t.transform)||wo(t)}(t);a=function(t,e,n,r,o){const i=r.idMap.get(n),a=r.maskAncestorChains.get(e)||[],s=o?Po(e,r):void 0,l=s?[...a,s]:a,u=i&&r.maskAncestorChains.get(i)||[];if(!l.length&&!u.length)return t;const c=new Set;for(const t of l)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);for(const t of u)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);if(!(c.size>0)){const e=xo(l),n=xo(u),r=n[0]-e[0],o=n[1]-e[1];return 0===r&&0===o?t:{type:"g",transform:"translate("+r+","+o+")",children:[t]}}return{type:"g",animate:{transform:{keyframes:Array.from(c).sort((t,e)=>t-e).map(t=>{const e=jo(l,t),n=jo(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,o,r,s);const l={type:"mask",id:i,children:[a]};return e.maskType&&(l.maskType=e.maskType),e.maskUnits&&(l.maskUnits=e.maskUnits),e.maskContentUnits&&(l.maskContentUnits=e.maskContentUnits),void 0!==e.x&&(l.x=String(e.x)),void 0!==e.y&&(l.y=String(e.y)),void 0!==e.width&&(l.width=String(e.width)),void 0!==e.height&&(l.height=String(e.height)),r.defs.push(l),t.mask="url(#"+i+")",t}(m,s,i,e),m=function(t,e,n){if(!(null==e?void 0:e.pathData))return t;const r=vr(n,"clip"),o={type:"path"},i=ur(e.pathData);return"absent"!==i.kind&&("static"===i.kind?o.d=vo(i.value):(cr(o,"d",i),void 0!==o.d&&(o.d=vo(o.d)))),n.defs.push({type:"clipPath",id:r,children:[o]}),t.clipPath="url(#"+r+")",t}(m,l,e),o?(So(m,c,e),m=function(t,e,n,r){const o=function(t,e){var n,r,o;const i={};let a=!1;const s=null==(n=t.animate)?void 0:n.transform;if(s&&"object"==typeof s&&Array.isArray(s.keyframes)){const e=s.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=co(s),r={keyframes:e.map(t=>{const e=t.value||{},r={};void 0!==e.translate&&(r.translate=e.translate),n&&void 0!==e.origin&&(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),void 0!==t.tangentOut&&(o.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(o.tangentIn=t.tangentIn),o})};s.autoOrient&&(r.autoOrient=!0);const o=s.loop;void 0!==o&&(r.loop=o),i.animate={transform:r};const l=e.some(t=>{const e=t.value||{};return void 0!==e.rotate||void 0!==e.scale}),u=e.map(t=>{const e=t.value||{},r={};void 0!==e.rotate&&(r.rotate=e.rotate),void 0!==e.scale&&(r.scale=e.scale),void 0===e.origin||n&&!l||(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),o});if(u.every(t=>0===Object.keys(t.value).length))delete t.animate.transform,t.animate&&0===Object.keys(t.animate).length&&delete t.animate;else{const e={keyframes:u};void 0!==o&&(e.loop=o),t.animate.transform=e}a=!0}}const l=void 0!==(null==e?void 0:e.translate),u=a||l,c=a&&co((null==(r=t.animate)?void 0:r.transform)||void 0)||a&&co((null==(o=i.animate)?void 0:o.transform)||void 0);if("string"==typeof t.transform){const e=function(t){const e=[],n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);)e.push({name:r[1],full:r[0]});if(!e.length)return{rest:t||void 0};if(e.every(t=>"translate"===t.name))return{translate:e.map(t=>t.full).join("")};const o=e[0],i=e[e.length-1];if("translate"===i.name&&"translate"===o.name){const n=uo(i.full),r=uo(o.full),a=-n[0],s=-n[1],l=r[0]-a,u=r[1]-s;return 0===l&&0===u?{rest:t}:{translate:"translate("+l+","+u+")",rest:"translate("+a+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===i.name)return{rest:t};const a=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)a.push(e[s].full),s++;if(!a.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:a.join(""),rest:l||void 0}}(t.transform);u?void 0!==e.translate?e.rest?t.transform=e.rest:delete t.transform:(function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,n=[];let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(1!==n.length)return!1;if("translate"===n[0].name)return!0;if("matrix"!==n[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(n[0].full);if(!o)return!1;const i=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return i.length>=4&&1===i[0]&&0===i[1]&&0===i[2]&&1===i[3]}(t.transform)||c&&function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let n,r=0,o=!1;for(;n=e.exec(t);)r++,"matrix"===n[1]&&(o=!0);return 1===r&&o}(t.transform))&&delete t.transform:e.translate&&(i.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}else if(t.transform&&"object"==typeof t.transform&&!Array.isArray(t.transform)&&!t.transform.keyframes){const e=t.transform.value,n=!(!e||"object"!=typeof e),r=n?e:t.transform,o=t=>n?{value:t}:t;if(Array.isArray(r.translate)){const e=A({},r);delete e.translate;const n=Object.keys(e).length>0;u||(i.transform=o({translate:r.translate})),n?t.transform=o(e):delete t.transform}}return i}(t,e);"string"==typeof t.id&&delete t.id;const{outer:i,inner:a}=function(t){if(!t)return{};const e=co(t.translate),n=void 0!==t.rotate||void 0!==t.scale,r={},o={};return void 0!==t.translate&&(r.translate=t.translate),e&&void 0!==t.origin&&(r.origin=t.origin),void 0!==t.rotate&&(o.rotate=t.rotate),void 0!==t.scale&&(o.scale=t.scale),void 0!==t.skew&&(o.skew=t.skew),void 0===t.origin||e&&!n||(o.origin=t.origin),{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(e);let s=t;s=io(s,a);let l={type:"g",id:n,children:[{type:"g",id:r,children:[s]}]};return void 0!==o.transform&&(l.transform=o.transform),void 0!==o.animate&&(l.animate=o.animate),i&&(delete l.id,l=io(l,i),l.id=n),l}(m,i,r,o)):m=function(t,e,n,r){return So(t,e,r),io(t,n)}(m,c,i,e),(null==c?void 0:c.retime)&&(t.effects={clone:{retime:c.retime}}),r&&e.idMap.set(r,m),m}function oi(t,e,n,r,o){const i=1-o,a=i*i*i,s=3*i*i*o,l=3*i*o*o,u=o*o*o;return[a*t[0]+s*e[0]+l*n[0]+u*r[0],a*t[1]+s*e[1]+l*n[1]+u*r[1]]}function ii(t,e,n,r,o=64){let i=0,a=t;for(let s=1;s<=o;s++){const l=oi(t,e,n,r,s/o);i+=Math.hypot(l[0]-a[0],l[1]-a[1]),a=l}return i}var ai=t=>{const e=Math.round(1e4*t)/1e4;return Object.is(e,-0)?"0":String(e)};function si(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function li(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function ui(t){if("string"!=typeof t)return;const e=t.trim().split(/[\s,]+/).map(Number);return e.length<4||e.some(t=>!Number.isFinite(t))?void 0:[e[0],e[1],e[2],e[3]]}function ci(t,e,n,r,o,i){if("use"===t.type&&"string"==typeof t.href){const a=li(t.href);if(a&&n.has(a)){const s=e.get(a);if(s)return function(t,e,n,r,o,i,a){var s,l,u,c;const f=hr(e);pr(f,o);const d="symbol"===f.type?ui(f.viewBox):void 0,h=null!=(l=null!=(s=si(t.width))?s:null==d?void 0:d[2])?l:a[0],p=null!=(c=null!=(u=si(t.height))?u:null==d?void 0:d[3])?c:a[1],m="symbol"===f.type?function(t,e,n,r,o){const i=ui(t.viewBox),a=w(A({},t),{type:"g"});if(delete a.viewBox,delete a.preserveAspectRatio,delete a.width,delete a.height,!i)return a;const[s,l,u,c]=i,f=u>0&&c>0?Math.min(r/u,o/c):1,d=(r-u*f)/2,h=(o-c*f)/2,p=[];0===d&&0===h||p.push("translate("+d+","+h+")"),1!==f&&p.push("scale("+f+")"),0===s&&0===l||p.push("translate("+-s+","+-l+")"),p.length&&(a.transform=p.join(""));const m=e();return n.push({type:"clipPath",id:m,children:[{type:"rect",x:s,y:l,width:u,height:c}]}),a.clipPath="url(#"+m+")",a}(f,o,i,h,p):f,g=ci(m,n,r,o,i,a),v=w(A({},t),{type:"g",children:[g]});return delete v.href,delete v.width,delete v.height,gr(v)}(t,s,e,n,r,o,i)}}if(!t.children)return t;let a=!1;const s=t.children.map(t=>{const s=ci(t,e,n,r,o,i);return s!==t&&(a=!0),s});return a?w(A({},t),{children:s}):t}function fi(t,e,n){var r,o;let i=ni(t).root;return i=function(t){const e=t=>{var n;let r=t;const o=t.animate,i=null==o?void 0:o.transform;if(i){const e=function(t){var e,n,r;if("offsetPath"!==t.alongPathMode)return;const o=t.keyframes;if(!o||o.length<2)return;const i=_t(o[0]),a=(null==i?void 0:i.origin)&&i.origin.length>=2?[i.origin[0],i.origin[1]]:[0,0],s=[];for(const t of o){const n=_t(t),r=null==n?void 0:n.translate;if(!r||r.length<2)return;if(Object.keys(n).some(t=>"translate"!==t&&"origin"!==t))return;const o=null!=(e=null==n?void 0:n.origin)?e:[0,0];if(o[0]!==a[0]||o[1]!==a[1])return;s.push([r[0]+a[0],r[1]+a[1]])}if(!o.some(t=>Nt(t)||Ct(t)))return;let l="M"+ai(s[0][0])+","+ai(s[0][1]);const u=[];for(let t=0;t<s.length-1;t++){const e=s[t],i=s[t+1],a=null!=(n=Ct(o[t]))?n:[0,0],c=null!=(r=Nt(o[t+1]))?r:[0,0],f=[e[0]+a[0],e[1]+a[1]],d=[i[0]+c[0],i[1]+c[1]];l+="C"+ai(f[0])+","+ai(f[1])+","+ai(d[0])+","+ai(d[1])+","+ai(i[0])+","+ai(i[1]),u.push(ii(e,f,d,i))}const c=u.reduce((t,e)=>t+e,0);if(!(c>0))return;const f=[];let d=0;for(let t=0;t<o.length;t++){t>0&&(d+=u[t-1]);const e={t:Mt(o[t]),v:d/c},n=Et(o[t]);void 0!==n&&(e.e=n),f.push(e)}return{pathStr:l,distanceKfs:f,autoOrient:!!t.autoOrient,anchor:a}}(i);if(e){const n=A({},o);delete n[mt];const a={keyframes:e.distanceKfs};void 0!==i.loop&&(a.loop=i.loop),n[gt]=a;const s=t.transform;let l=s;if(s&&"object"==typeof s){const t=A({},s);delete t[yt.translate],delete t[yt.origin],l=Object.keys(t).length?t:void 0}r=w(A({},t),{animate:n,style:w(A({},t.style),{offsetPath:"path('"+e.pathStr+"')",offsetAnchor:ai(e.anchor[0])+"px "+ai(e.anchor[1])+"px",offsetRotate:e.autoOrient?"auto":"0deg",offsetDistance:"0%"})}),void 0!==l?r.transform=l:delete r.transform}}if(null==(n=r.children)?void 0:n.length){const t=r.children.map(e);t.some((t,e)=>t!==r.children[e])&&(r=w(A({},r),{children:t}))}return r};return e(t)}(i),i=Yn(i,null!=(o=null==(r=At(i))?void 0:r.duration)?o:Ke),e===nt.native&&(i=Ln(i,null==n?void 0:n.motionPath),i=function(t){var e;const n=function(t){const e=new Map,n=t=>{var r;"string"==typeof t.id&&e.set(t.id,t),null==(r=t.children)||r.forEach(n)};return n(t),e}(t),r=function(t,e){const n=new WeakMap,r=new Set,o=(t,r)=>{const i=n.get(t);if(void 0!==i)return i;if(r.has(t))return!1;r.add(t);let a=!1;if(t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate))for(const e in t.animate){a=!0;break}if(!a&&t.children)for(const e of t.children)if(o(e,r)){a=!0;break}if(!a&&"use"===t.type&&"string"==typeof t.href){const n=li(t.href),i=n?e.get(n):void 0;i&&(a=o(i,r))}return r.delete(t),n.set(t,a),a};for(const[t,n]of e)o(n,new Set)&&r.add(t);return r}(0,n);if(0===r.size)return t;let o=0;const i=function(t){const e=ui(t.viewBox);if(e)return[e[2],e[3]];const n=si(t.width),r=si(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),a=[],s=ci(t,n,r,()=>"_lw_use_mat_"+ ++o,a,i);if(0===a.length)return s;const l={type:"defs",children:a},u=[...null!=(e=s.children)?e:[],l];return w(A({},s),{children:u})}(i),i=function(t){const e=(t,n)=>{var r;n(t),null==(r=t.children)||r.forEach(t=>e(t,n))};let n=!0;for(;n;){n=!1;const r=new Set;e(t,t=>{var e;"use"===t.type&&"string"==typeof t.href&&r.add((e=t.href).startsWith("#")?e.slice(1):e)}),e(t,t=>{if(!t.children)return;let e=t.children;"defs"===t.type&&(e=e.filter(t=>!(("g"===t.type||"symbol"===t.type)&&"string"==typeof t.id&&!r.has(t.id)))),e=e.filter(t=>!("defs"===t.type&&(!t.children||0===t.children.length))),e.length!==t.children.length&&(t.children=e,n=!0)})}return t}(i)),i}var di="setPlaybackRate: rate must be finite and non-zero";function hi(t){return Number.isFinite(t)&&0!==t}function pi(t,e){return t>0?e===1/0?t:t*(e>0?e:1):0}function mi(t,e){return Number.isNaN(t)||t<0?0:Number.isFinite(e)?t>e?e:t:Number.isFinite(t)?t:0}function gi(t,e,n){const r=pi(e,n);return r>0&&Number.isFinite(t)?t<=0?0:n===1/0?t%r/r:t>=r?1:t/r:0}function vi(t,e,n){const r=pi(e,n);return r>0&&Number.isFinite(t)?t<=0?0:t>=1?r:t*r:0}function yi(t){const e=globalThis;"function"!=typeof e.cancelAnimationFrame?e.clearTimeout(t):e.cancelAnimationFrame(t)}function bi(t,e,n){var r;const o=At(t)||{},i=er(t,nt.js),a=o.iterations;let s=1;"number"==typeof a&&(s=a||1),"infinite"===a&&(s=1/0),s<1&&(s=1);const l=+(o.duration||Ke),u=l&&s?l*(s===1/0?1/0:s):l?(null!=s?s:1)*l:0,c=o.direction||"normal",f=null!=(r=o.fill)?r:"forwards",d="forwards"===f||"both"===f,h="backwards"===f||"both"===f;let p=null,m=!1,g=-(o.delay||0),v=0,y=1,b=!1;const k=o.frameRate,A=k&&k>0?1e3/k:0;let w=0;const x=()=>{const t=v?(Date.now()-v)*y:0;return g+t},j=()=>{let t=x();return Number.isFinite(u)&&t>u&&(t=u),t<0&&(t=0),t};function O(t){let n=function(){const e=l>0?l:1;let n=0,r=0;l>0?(t=Ye(t,0,s*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,s-1),n=Ye((t-r*e)/e,0,1)):n=t;const o=c||"normal";let i=n;return"reverse"===o?i=1-n:"alternate"===o?r%2==1&&(i=1-n):"alternate-reverse"===o&&r%2==0&&(i=1-n),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=rr(r,n*l);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}o.delay&&(o.delay<0?O(j()):h&&O(0));const P=()=>!!m&&!!e.isConnected()&&(y<0?x()>0:!(Number.isFinite(u)&&j()>=u)),S=t=>{null!==p&&(yi(p),p=null),(t||P())&&(p=function(t){const e=globalThis;return"function"==typeof e.requestAnimationFrame?e.requestAnimationFrame(t):e.setTimeout(t,16)}(()=>{p=null,(()=>{var t,r;if(!e.isConnected())return void M();const o=j(),i=x();if(i<0&&y>0)h&&O(0);else{if(y<0&&i<=0)return M(),O(0),void(b||(b=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)));if(y>0&&u&&Number.isFinite(u)&&o>=u)return M(),O(d?u:0),void(b||(b=!0,null==(r=null==n?void 0:n.onFinish)||r.call(n)));if(A>0){const t=Date.now();if(w&&t-w<A)return;w=t}O(o)}})(),S()}))},M=()=>{if(!m)return;let t=x();Number.isFinite(u)&&t>u&&(t=u),g=t,v=0,m=!1,null!==p&&(yi(p),p=null),t>=0?O(t):h&&O(0)},_={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>P(),play:()=>{var t;(()=>{if(!m){if(y>=0)Number.isFinite(u)&&g>=u&&(g=0);else if(g<=0){if(!Number.isFinite(u))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");g=u}b=!1,m=!0,v=Date.now(),S(!0)}})(),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;M(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;M(),g=0,v=0,m=!1,b=!1,O(g),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;g=Number.isFinite(u)?u:j(),v=0,m=!1,null!==p&&(yi(p),p=null),O(d?g:0),t&&!b&&(b=!0,null==(e=null==n?void 0:n.onFinish)||e.call(n))})(!0)},setPlaybackRate:t=>{if(!hi(t))return void console.warn(di);let e=x();Number.isFinite(u)&&e>u&&(e=u),t<0!=y<0&&(b=!1),y=t,g=e,m&&(v=Date.now())},getCurrentTime:()=>j(),setCurrentTime:t=>{t=mi(t,u),g=t,m&&(v=Date.now()),(!Number.isFinite(u)||t<u)&&(b=!1),O(j())},getCurrentProgress:()=>gi(j(),l,s),setCurrentProgress:t=>{_.setCurrentTime(vi(t,l,s))},destroy:()=>{var t;_.cancel(),null==(t=null==n?void 0:n.onRemove)||t.call(n)}};return _}var ki=["timelineSource","scroll","trigger","delay","iterations","direction","fill","resetOnFinish","duration","mode","frameRate"],Ai=["definitions","bindings"],wi=t=>!!t&&"object"==typeof t&&!Array.isArray(t),xi=t=>wi(t)&&"string"==typeof t.type?t.type:"time",ji=t=>"scroll"===t||"view"===t;function Oi(t,e){const n=wi(t)?A({},t):{};for(const t of Object.keys(e)){const r=e[t];null!==r?wi(r)?n[t]=Oi(n[t],r):n[t]=r:delete n[t]}return n}function Pi(t,e,n){const r=xi(t),o=wi(e)&&"string"==typeof e.type?String(e.type):r;let i;if(o!==r){const n={};if(wi(t))for(const e of $)void 0!==t[e]&&(n[e]=t[e]);i=Oi(n,e)}else i=Oi(t,e);if(ji(o)){for(const t of tt)void 0!==i[t]&&(n("animator.timeline."+t+": no slot on a '"+o+"' timeline — dropped"),delete i[t]);"infinite"===i.iterations&&(n("animator.timeline.iterations: 'infinite' cannot map onto a scroll range — dropped"),delete i.iterations)}return i}function Si(t){return"scroll"===(null==t?void 0:t.timelineSource)}var Mi="cover";function _i(t,e,n,r){var o;const[i,a]=function(t,e,n){const r=e,o=n;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:Mi,n,r);return i+("number"==typeof(null==t?void 0:t.fraction)?t.fraction:e)*(a-i)}function Ei(t,e,n){const r=null!=n?n:ro(void 0,"[PxAnimator]"),o=[],i=()=>{for(const t of o.splice(0))t()},{startOn:a,outAction:s,scrollIntoViewThreshold:l}=function(t){var e,n,r;return{startOn:null!=(e=null==t?void 0:t.startOn)?e:at.startOn,outAction:null!=(n=null==t?void 0:t.outAction)?n:at.outAction,scrollIntoViewThreshold:null!=(r=null==t?void 0:t.scrollIntoViewThreshold)?r:at.scrollIntoViewThreshold}}(e),u=t.getRootElement();if(!u)return r.warn(no.host,"setupAnimationTriggers: No root element found for animation."),i;let c=!1;const f=()=>{c&&(c=!1,t.setPlaybackRate(1)),t.play()},d=()=>{switch(s){case"pause":t.pause();break;case"reset":t.cancel();break;case"reverse":c=!0,t.setPlaybackRate(-1),t.play()}};switch(a){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 e=()=>{t=!0,f()},n=()=>{t&&d()};u.addEventListener("mouseenter",e),u.addEventListener("mouseleave",n),o.push(()=>{u.removeEventListener("mouseenter",e),u.removeEventListener("mouseleave",n)});break}case"click":{const e=()=>{t.isPlaying()?d():f()};u.addEventListener("click",e),o.push(()=>u.removeEventListener("click",e));break}case"scrollIntoView":{const t=t=>{var e,n;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,a=null!=(n=null==(e=t.rootBounds)?void 0:e.height)?n:1/0,s=Math.min(i,a),l=Math.min(r.height,Number.isFinite(s)?s:r.height);return l>0?o.height/l:t.intersectionRatio},e=Array.from({length:21},(t,e)=>e/20);let n=!1;const r=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&t(e)>=l?(n=!0,f()):n&&(n=!1,d())})},{threshold:e});r.observe(u),o.push(()=>r.disconnect());break}}return i}function Ni(t){return"#"+t}function Ci(t,e,n,r){var o;const i=At(t)||{},a=ro(n,"[PxAnimator]");if(!r)if(t.id){const e=Ni(t.id);(r=document.querySelector(e))||a.warn(no.host,"createFrameLoopAnimator: No root element found for selector: "+e)}else a.warn(no.host,"createFrameLoopAnimator: No root element provided");const s=bi(t,e||function(t,e){const n=new Set,r=null!=e?e:ro(void 0,"[PxAnimator]");return{isConnected:()=>!t||t.isConnected,setAttribute:(e,o,i)=>{o=Xe(o);const a=Ni(e),s=(null==t?void 0:t.querySelectorAll(a))||document.querySelectorAll(a);0!==s.length||n.has(a)||(n.add(a),r.warn(no.host,'setAttribute: No elements found for selector "'+a+'"'));for(let t=0;t<s.length;t++){const e=s[t],n="transform"===o&&"pattern"===e.tagName?"patternTransform":o;e.setAttribute(n,i),Ze.has(o)&&(e.style[o]=i)}}}}(r,a),n),l=f(c({},s),{getRootElement:()=>r||null});if(Si(i))i.trigger&&a.warn(no.usage,"scroll timeline: `animator.trigger` is ignored (triggers do not apply to scroll-driven playback)");else{const t=Ei(l,null!=(o=i.trigger)?o:{},a),e=l.destroy.bind(l);l.destroy=()=>{t(),e()}}return l}function zi(t,e,n,r){let o=_t(t);const i=Et(t),a={offset:e,easing:i&&Array.isArray(i)?"cubic-bezier("+i.join(",")+")":void 0};let s,l=n;return Ue.has(n)&&Array.isArray(o)?s=We(o):"transform"!==n||null===o||"object"!=typeof o||Array.isArray(o)?Be.has(n)?(Array.isArray(o)&&("translate"===n&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===n&&(o+="deg"),s=n+"("+o+")",l="transform"):s="d"===n?'path("'+(o&&"object"==typeof o&&Array.isArray(o.paths)?o.paths:[]).map(t=>_e(t,!0)).join("")+'")':Ge.has(n)&&"number"==typeof o?100*o+"%":""+o:(s=qe(o,{withUnits:!0}),l="transform"),CSS.supports(Xe(l),s)||r.add(l),l=He(l),a[l]=s,a}function Ti(t,e,n){var r,o,i,a,s;const l=[];for(let u=0;u<e.length;u++){const d=e[u],h=null!=(r=d.t)?r:0;if(h<0){const n=e[u+1];if(n&&(null!=(o=n.t)?o:0)>=0){const e=(0-h)/((null!=(i=n.t)?i:0)-h),r=d.e?Fe(d.e)(e):e,{right:o}=Le(d.e,e);l.push({t:0,v:Hn(t,d.v,n.v,r),e:o})}continue}if(h>n){const r=e[u-1];if(r&&(null!=(a=r.t)?a:0)<=n){const e=null!=(s=r.t)?s:0,o=(n-e)/(h-e),i=r.e?Fe(r.e)(o):o,{left:a}=Le(r.e,o);l.length>0&&(l[l.length-1]=f(c({},l[l.length-1]),{e:a})),l.push({t:n,v:Hn(t,r.v,d.v,i),e:void 0})}break}l.push(d)}return l}function Di(t,e,n){var r;const o=new Map;for(const[i,a]of Object.entries(t)){const t=n.duration||1,s=Ti(i,a.keyframes||[],t),l=[];for(let n=0;n<s.length;n++){const o=s[n],a=zi(o,Ye((null!=(r=o.t)?r:0)/t,0,1),i,e);0===n&&(a.offset||0)>0&&l.push(f(c({},a),{offset:0})),l.push(a)}l.length>0&&(l[l.length-1].offset||0)<1&&l.push(f(c({},l[l.length-1]),{offset:1})),l.length>0&&o.set(i,l)}return o}function Fi(t,e,n,r,o){var i,a;const s=At(t)||{},l=ro(e,"[PxAnimator]");if(!n)if(t.id){const e=Ni(t.id);(n=document.querySelector(e))||l.warn(no.host,"createWebApiAnimator: No root element found for selector: "+e)}else l.warn(no.host,"createWebApiAnimator: No root element provided");const u=er(t,nt.native),c=[],f=s.iterations;let d;"number"==typeof f&&(d=f),"infinite"===f&&(d=1/0);const h=new Set;let p=!1,m=!1;(null==u?void 0:u.length)||l.warn(no.document,"createWebApiAnimator: No animation bindings defined");for(const t of u||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){l.warn(no.document,"createWebApiAnimator: Empty or unresolved binding",t);continue}const a=Ni(t.id),u=(null==n?void 0:n.querySelectorAll(a))||document.querySelectorAll(a);0===u.length&&l.warn(no.host,'createWebApiAnimator: No elements found for selector "'+a+'"');const f=Di(r,h,s),g=s.delay&&s.delay>0?s.delay:void 0;let v;if(s.delay&&s.delay<0&&s.duration){const t=-s.delay;v=d===1/0?t%s.duration:Math.min(t,s.duration*(null!=d?d:1))}const y={duration:s.duration,delay:g,fill:null!=(i=s.fill)?i:"forwards",direction:s.direction,iterations:d};for(let t=0;t<u.length;t++){const n=u[t];for(const[,t]of f)if(t.length>0)try{const r=new KeyframeEffect(n,t,y),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==e?void 0:e.onFinish)&&(i.onfinish=()=>{var t;p||(p=!0,null==(t=e.onFinish)||t.call(e))}),(null==e?void 0:e.onRemove)&&(i.onremove=()=>{var t;m||(m=!0,null==(t=e.onRemove)||t.call(e))}),void 0!==v&&(i.currentTime=v),c.push(i)}catch(t){l.warn(no.internal,"createWebApiAnimator: could not build the animation",t)}}}if(!r&&h.size)return l.warn(no.platform,"Unsupported CSS attrs: "+[...h].join(", ")),null;const g={isReady:()=>!0,getRootElement:()=>n||null,isPlaying:()=>{var t;return"running"===(null==(t=c[0])?void 0:t.playState)},play:()=>{var t;p=!1,c.forEach(t=>t.play()),null==(t=null==e?void 0:e.onPlay)||t.call(e)},pause:()=>{var t;c.forEach(t=>t.pause()),null==(t=null==e?void 0:e.onPause)||t.call(e)},cancel:()=>{var t;p=!1,c.forEach(t=>t.cancel()),null==(t=null==e?void 0:e.onCancel)||t.call(e)},finish:()=>{var t;for(const e of c)try{(null==(t=e.effect)?void 0:t.getTiming().iterations)===1/0?(e.effect.updateTiming({iterations:1}),e.finish(),e.effect.updateTiming({iterations:1/0})):e.finish()}catch(t){e.cancel()}},setPlaybackRate:t=>hi(t)?(c.forEach(e=>e.playbackRate=t),g):(l.warn(no.usage,di),g),getCurrentTime:()=>{var t,e;const n=null!=(e=null==(t=c[0])?void 0:t.currentTime)?e:null;return null!==n?+n:null},setCurrentTime:t=>{var e;const n=function(t,e){return t>0?e===1/0?1/0:t*(e>0?e:1):0}(null!=(e=s.duration)?e:0,null!=d?d:1),r=n>0?mi(t,n):Math.max(0,t);p=!1,c.forEach(t=>{t.currentTime=r})},getCurrentProgress:()=>{var t;const e=g.getCurrentTime();return null===e?null:gi(e,null!=(t=s.duration)?t:0,null!=d?d:1)},setCurrentProgress:t=>{var e;g.setCurrentTime(vi(t,null!=(e=s.duration)?e:0,null!=d?d:1))},destroy:()=>{var t;g.cancel(),c.splice(0,c.length),m||(m=!0,null==(t=null==e?void 0:e.onRemove)||t.call(e))}};if("scroll"===s.timelineSource)s.trigger&&l.warn(no.usage,"scroll timeline: `animator.trigger` is ignored (triggers do not apply to scroll-driven playback)");else{const t=Ei(g,null!=(a=s.trigger)?a:{},l),e=g.destroy.bind(g);g.destroy=()=>{t(),e()}}return o&&c.forEach(t=>t.play()),g}function Ii(t,e,n){var r,o,i;const a="number"==typeof(null==t?void 0:t.fraction)?t.fraction:e,s=null==(o=null==(r=globalThis.CSS)?void 0:r.percent)?void 0:o.call(r,100*a);if(void 0!==s)return n?{rangeName:null!=(i=null==t?void 0:t.phase)?i:"cover",offset:s}:{offset:s}}function Li(t,e){const n=document.body,r=document.documentElement;for(let o=t.parentElement;o;o=o.parentElement){if(o===n||o===r)return null;const t=getComputedStyle(o),i="y"===e?t.overflowY:t.overflowX;if("auto"===i||"scroll"===i||"hidden"===i||"overlay"===i)return o}return null}function Ri(){return document.scrollingElement||document.documentElement}var Wi="parent",Vi="scroller";function Ui(t,e,n){var r,o;const i=null!=n?n:ro(void 0,"[PxAnimator]"),a=null==e?void 0:e.trim();if(!a)return t;if(a===Wi){let e=null;for(let n=t.parentElement;n&&n!==document.body;n=n.parentElement){const t=getComputedStyle(n).position;"sticky"!==t&&"fixed"!==t||(e=n)}return null!=(o=null!=(r=null==e?void 0:e.parentElement)?r:t.parentElement)?o:t}if(a===Vi)return Li(t,"y")||Li(t,"x")||Ri();let s=null;try{s=document.querySelector(a)}catch(e){return i.warn(no.document,'scroll timeline: subject "'+a+'" is not a valid selector — measuring the SVG itself'),t}return s||(i.warn(no.host,'scroll timeline: subject "'+a+'" matched no element — measuring the SVG itself'),t)}function Bi(t,e){const n=t;if(!(null==e?void 0:e.pin)||!n.style)return()=>{};const r=n.style,o=r.position,i=r.top;r.position="sticky";const a="center"===e.pinAlign?.5:"bottom"===e.pinAlign?1:0,s=()=>{var n;const o=null!=(n=e.pinOffset)?n:0;if(!a)return void(r.top=o+"px");const i=function(t){const e=Li(t,"y");return e?e.clientHeight:document.documentElement.clientHeight}(t),s=t.getBoundingClientRect().height;r.top=Math.round((i-s)*a+o)+"px"};s();let l=null;const u=a?s:null;a&&(u&&window.addEventListener("resize",u),"undefined"!=typeof ResizeObserver&&(l=new ResizeObserver(s),l.observe(t)));let c=null;const f=t.parentElement;return e.pinDistance&&e.pinDistance>0&&f&&(c=document.createElement("div"),c.setAttribute("data-px-pin",""),c.style.height=100*e.pinDistance+"vh",f.insertBefore(c,t),c.appendChild(t)),()=>{u&&window.removeEventListener("resize",u),null==l||l.disconnect(),r.position=o,r.top=i,(null==c?void 0:c.parentElement)&&(c.parentElement.insertBefore(t,c),c.remove())}}function Gi(t,e,n){let r,o=e;t.resetOnFinish&&(o=f(c({},e),{onFinish:()=>{var t;null==(t=null==e?void 0:e.onFinish)||t.call(e),null==r||r.cancel()}}));const i=n(o);return r=i,t.debugGlobalName&&(window[t.debugGlobalName]=i),i}var qi="http://www.w3.org/2000/svg";function Zi(t,e,n){if(!t)return null;const r=t,{type:o,children:i,style:u}=r,c=((t,e)=>{var n={};for(var r in t)s.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&a)for(var r of a(t))e.indexOf(r)<0&&l.call(t,r)&&(n[r]=t[r]);return n})(r,["type","children","style"]),f=c.domType;void 0!==f&&delete c.domType;const d=jt(t)||e,h=u;let p;if(i)for(const t of i){const e=Zi(t,d,n);e&&(p||(p=[]),p.push(e))}const m=function(t,e,n,r,o,i){if(an.has(t.toLowerCase()))return(null!=i?i:ro(void 0,"[PxAnimator]")).warn(no.document,"SVG tag blocked (dangerous): "+t),null;const a=document.createElementNS(qi,t);for(const t in e){const n=pn(t,e[t]);void 0!==n&&(un.has(t)?a.style[t]=String(n):a.setAttribute(Xe(t),n))}if(n)for(const t in n)a.style[t]=String(n[t]);if(null==r?void 0:r.length)for(const t of r)a.appendChild(t);else o&&(a.textContent=o);return a}(o||"g",mn(c),h,p,c[ht],n);return m&&void 0!==f&&m.setAttribute("type",f),m}function Ki(t,e,n,r,o,i){const a=ro(n,"[PxAnimator]"),s=ye(t);for(const t of s)a.warn(no.document,"effects shape: "+t);if(function(t){const{problems:e}=function(t){try{return{problems:be(t)}}catch(t){return{problems:[]}}}(t);if(!e.length)return;const n=e.slice(0,oo),r=e.length-n.length;console.warn("[PxAnimator] createAnimator: this document does not match the animation schema in "+e.length+" place"+(1===e.length?"":"s")+".\n"+n.map(t=>" - "+t).join("\n")+(r>0?"\n … and "+r+" more":"")+"\n\nIf you did not author these keys, the usual cause is a build that MANGLES PROPERTY NAMES. An animation document is data loaded at runtime, so renaming the property reads inside the player stops them matching the keys in the JSON, and the animation silently does nothing. Feed the published reserved-name list to your minifier — @pixodesk/svg-animator-web/mangle-reserved.json — see docs/library/minification.md.")}(t),void 0!==o||i){const e=function(t,e,n){var r,o;const i=!!(null==n?void 0:n.resetTimeline);if(!t||void 0===e||!(i||null!==e&&wi(e)&&Object.keys(e).length))return{doc:t,warnings:[]};const a=t,s=wi(a.animator),l=!s&&wi(null==(r=a.meta)?void 0:r.animator),u=s?a.animator:l?a.meta.animator:void 0,c=[];s&&wi(null==(o=a.meta)?void 0:o.animator)&&c.push("animator: doc.meta.animator is shadowed by doc.animator and was not patched");let f=u;if(i){const t={};for(const e of Ai)wi(u)&&void 0!==u[e]&&(t[e]=u[e]);f=t}const d=function(t,e){const n=[],r=t=>n.push(t);if(null===e)return{config:void 0,warnings:n};if(!wi(e)||0===Object.keys(e).length)return{config:t,warnings:n};const o=wi(t)?ki.filter(e=>void 0!==t[e]):[];o.length&&r("animator: the base carries the flat runtime spelling ("+o.join(", ")+"); the patch merges the wire spelling only");const i=wi(t)?A({},t):{};for(const t of Object.keys(e)){const n=e[t];null!==n?"timeline"!==t?wi(n)?i[t]=Oi(i[t],n):i[t]=n:i.timeline=wi(n)?Pi(i.timeline,n,r):n:delete i[t]}return{config:i,warnings:n}}(f,null!=e?e:{});return c.push(...d.warnings),d.config===u?{doc:t,warnings:c}:l?{doc:w(A({},a),{meta:w(A({},a.meta),{animator:d.config})}),warnings:c}:{doc:w(A({},a),{animator:d.config}),warnings:c}}(t,null!=o?o:{},{resetTimeline:!!i});for(const t of e.warnings)a.warn(no.usage,"timeline override: "+t);t=e.doc}t=fi(t,ot((At(t)||{}).engine));let l=null;if(r){t=Se(t);const e="string"==typeof r?document.querySelector(r):r;e&&(l=Zi(t,void 0,a),l&&e.replaceChildren(l))}const u=function(t,e,n,r){return function(t,e,n,r){const o=At(t)||{},i=ro(n,"[PxAnimator]");return Si(o)?Gi(o,n,n=>{var a;let s=()=>{};if(o.engine!==rt.js&&r){s=Bi(r,o.scroll);const e=function(t,e,n){var r,o,i,a;const s=null!=n?n:ro(void 0,"[PxAnimator]");if(!e||!Si(e))return null;const l=e.scroll||{},u=null!=(r=l.kind)?r:"view";if(l.smoothing)return s.warn(no.platform,"scroll timeline: `smoothing` needs the built-in driver — using the built-in driver instead of the browser timeline"),null;const c=globalThis,f="view"===u,d=f?c.ViewTimeline:c.ScrollTimeline;if("function"!=typeof d)return null;const h=null!=(o=l.axis)?o:"block";let p;try{p=new d(f?{subject:Ui(t,l.subject,s),axis:h}:{source:"root"===l.source?Ri():Li(t,"y")||Li(t,"x")||Ri(),axis:h})}catch(t){return s.warn(no.platform,"scroll timeline: native timeline construction failed — falling back to the player measuring progress itself",t),null}return{timeline:p,rangeStart:Ii(null==(i=l.range)?void 0:i.start,0,f),rangeEnd:Ii(null==(a=l.range)?void 0:a.end,1,f)}}(r,o,i);if(e){const i=Fi(t,n,r,it(o.engine),e);if(i){const t=i.destroy.bind(i);return i.destroy=()=>{s(),t()},i}}s(),s=()=>{}}const l=(o.engine!==rt.js?Fi(t,n,r,it(o.engine)):null)||Ci(t,e,n,r),u=(null==(a=l.getRootElement)?void 0:a.call(l))||r;if(u){s=Bi(u,o.scroll);const t=("number"==typeof(null==(c=o)?void 0:c.duration)&&c.duration>0?c.duration:Ke)*("number"==typeof(null==c?void 0:c.iterations)&&c.iterations>0?c.iterations:1),e=function(t,e,n,r){var o,i;if(!e||!Si(e))return null;const a=null!=r?r:ro(void 0,"[PxAnimator]"),s=e.scroll||{},l=null!=(o=s.kind)?o:"view",u=Ui(t,s.subject,a),c=Li(t,"y")||Li(t,"x"),f="scroll"===l&&"root"===s.source?Ri():c||Ri(),d=f===Ri(),h=function(t,e){const n=null!=t?t:"block";if("x"===n||"y"===n)return n;const r=!!e&&e.startsWith("vertical");return"inline"===n?r?"y":"x":r?"x":"y"}(s.axis,getComputedStyle(f).writingMode),p=()=>{if("scroll"===l)return function(t,e,n){var r,o;const i=e>0?Ye(t/e,0,1):1,a="number"==typeof(null==(r=null==n?void 0:n.start)?void 0:r.fraction)?n.start.fraction:0,s="number"==typeof(null==(o=null==n?void 0:n.end)?void 0:o.fraction)?n.end.fraction:1;return s<=a?i>=s?1:0:Ye((i-a)/(s-a),0,1)}("y"===h?f.scrollTop:f.scrollLeft,"y"===h?f.scrollHeight-f.clientHeight:f.scrollWidth-f.clientWidth,s.range);const t=u.getBoundingClientRect();let e,n;if(d)e=0,n="y"===h?document.documentElement.clientHeight:document.documentElement.clientWidth;else{const t=f.getBoundingClientRect();e="y"===h?t.top:t.left,n="y"===h?f.clientHeight:f.clientWidth}return function(t,e,n,r){const o=n-t,i=_i(null==r?void 0:r.start,0,e,n),a=_i(null==r?void 0:r.end,1,e,n);return a<=i?o>=a?1:0:Ye((o-i)/(a-i),0,1)}(("y"===h?t.top:t.left)-e,"y"===h?t.height:t.width,n,s.range)},m=Math.max(0,null!=(i=s.smoothing)?i:0)/1e3;let g=!1,v=null,y=null,b=0,k=null;const A=()=>{k=null,g||(t=>{if(!m)return void n(t);if(null===v)return v=t,void n(t);if(null!==y)return;b=0;const e=t=>{if(y=null,g)return;const r=b?Math.min(.1,(t-b)/1e3):1/60;b=t;const o=p(),i=1-Math.exp(-r/m);v+=(o-v)*i,Math.abs(o-v)<.001&&(v=o),n(v),v!==o&&(y=requestAnimationFrame(e))};y=requestAnimationFrame(e)})(p())},w=()=>{g||null!==k||(k=requestAnimationFrame(A))},x=d?window:f;let j;x.addEventListener("scroll",w,{passive:!0}),window.addEventListener("resize",w,{passive:!0}),"undefined"!=typeof ResizeObserver&&(j=new ResizeObserver(w),j.observe(u),u!==t&&j.observe(t),d||j.observe(f));const O={destroy:()=>{g||(g=!0,x.removeEventListener("scroll",w),window.removeEventListener("resize",w),null==j||j.disconnect(),null!==k&&(cancelAnimationFrame(k),k=null),null!==y&&(cancelAnimationFrame(y),y=null))},refresh:()=>{g||(v=p(),n(v))}};return O.refresh(),O}(u,o,e=>l.setCurrentTime(e*t),i);if(e){const t=l.destroy.bind(l);l.destroy=()=>{e.destroy(),s(),t()}}}else i.warn(no.host,"scroll timeline: no root element to observe — animation will stay at frame 0");var c;return l}):Gi(o,n,n=>o.engine===rt.js?Ci(t,e,n,r):Fi(t,n,r,it(o.engine))||Ci(t,e,n,r))}(t,e,n,r)}(t,e,n,l);if(r&&l){const t=l,e=u.destroy.bind(u);u.destroy=()=>{e(),t.remove()}}return u}function Hi(t){const{src:e,doc:n,container:r,resetTimeline:o}=t,i=function(t){return"adapter"in t}(t)?t.adapter:void 0,a=function(t){const{timeline:e,duration:n,delay:r,iterations:o,startOn:i}=t;return function(t,e){let n;if("string"==typeof t)try{n=JSON.parse(t)}catch(t){console.warn("timeline override: not valid JSON — ignored",t),n=void 0}else n=null!=t?t:void 0;const{duration:r,delay:o,iterations:i,startOn:a}=e;if(void 0===r&&void 0===o&&void 0===i&&void 0===a)return void 0===n?void 0:{timeline:n};const s=wi(n)?A({},n):{};return void 0!==r&&(s.duration=r),void 0!==o&&(s.delay=o),void 0!==i&&(s.iterations=i),void 0!==a&&(s.trigger=w(A({},s.trigger),{startOn:a})),{timeline:s}}(e,{duration:n,delay:r,iterations:o,startOn:i})}(t),s=function(t){const{onPlay:e,onPause:n,onCancel:r,onFinish:o,onRemove:i,onStop:a,onWarn:s,onError:l,muteWarn:u,muteError:c}=null!=t?t:{},f=t=>t||a?()=>{null==t||t(),null==a||a()}:void 0;return{onPlay:e,onPause:f(n),onCancel:f(r),onFinish:f(o),onRemove:f(i),onWarn:s,onError:l,muteWarn:u,muteError:c}}(t);if(void 0!==n&&void 0!==e)throw new Error("createAnimator: provide either `src` or `doc`, not both");if(void 0===n&&void 0===e)throw new Error("createAnimator: either `src` or `doc` is required");let l=null,u=[],c=!1;const f=t=>{l?t(l):u&&u.push(t)},d=ro(s,"[PxAnimator]"),h=(t,e,n)=>{u=null,d.error(t,e,n)},p=t=>{try{(t=>{l=t;const e=u;u=null,null==e||e.forEach(e=>e(t))})(Ki(t,i,s,r,a,o))}catch(t){const e=function(t){return t instanceof Error?t:new Error(String(t))}(t);h(no.internal,"createAnimator: could not build the player — "+e.message,e)}};return void 0!==n?p(n):fetch(e).then(t=>t.json()).then(t=>{c||(function(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&"svg"===t.type}(t)?p(t):h(no.document,'createAnimator: invalid animation document format at "'+e+'"'))}).catch(t=>{var n;h(no.host,'createAnimator: failed to load "'+e+'" — '+(null!=(n=null==t?void 0:t.message)?n:String(t)))}),{isReady:()=>!!l,getRootElement:()=>l?l.getRootElement():null,isPlaying:()=>(null==l?void 0:l.isPlaying())||!1,play:()=>{f(t=>t.play())},pause:()=>{f(t=>t.pause())},cancel:()=>{f(t=>t.cancel())},finish:()=>{f(t=>t.finish())},setPlaybackRate:t=>{f(e=>e.setPlaybackRate(t))},getCurrentTime:()=>l?l.getCurrentTime():null,setCurrentTime:t=>{f(e=>e.setCurrentTime(t))},getCurrentProgress:()=>l?l.getCurrentProgress():null,setCurrentProgress:t=>{f(e=>e.setCurrentProgress(t))},destroy:()=>{c=!0,u=null,null==l||l.destroy()}}}function Ji(t){const e=document.querySelectorAll("["+q+"]");for(let n=0;n<e.length;n++){const r=e[n];if(!r[Z]){const e=r.getAttribute(q);e&&(r[Z]=Hi(f(c({},t),{src:e,container:r})))}}}
1
+ "use strict";var t,e=Object.defineProperty,n=Object.defineProperties,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,c=(t,e)=>{for(var n in e||(e={}))s.call(e,n)&&u(t,n,e[n]);if(a)for(var n of a(e))l.call(e,n)&&u(t,n,e[n]);return t},f=(t,e)=>n(t,o(e)),d={};((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(d,{PxAnimatorConfigSchema:()=>$t,PxDefinitionsSchema:()=>Bt,PxDiagnosticKind:()=>no,PxNodeBaseSchema:()=>ke,PxScrollSchema:()=>qt,PxSvgNodeRootSchema:()=>we,PxTimelineEngineSetting:()=>rt,PxTriggerSchema:()=>Rt,createAdapterAnimator:()=>Ai,createAnimator:()=>Qi,generateNewIds:()=>Pe,loadTagAnimators:()=>Yi,px:()=>U,renderNode:()=>Ji,setupAnimationTriggers:()=>Ti,toDomProps:()=>mn,validateDocument:()=>be}),module.exports=(t=d,((t,n,o,a)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let o of i(n))s.call(t,o)||void 0===o||e(t,o,{get:()=>n[o],enumerable:!(a=r(n,o))||a.enumerable});return t})(e({},"__esModule",{value:!0}),t));var h=Object.defineProperty,p=Object.defineProperties,m=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,b=Math.pow,k=(t,e,n)=>e in t?h(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,A=(t,e)=>{for(var n in e||(e={}))v.call(e,n)&&k(t,n,e[n]);if(g)for(var n of g(e))y.call(e,n)&&k(t,n,e[n]);return t},w=(t,e)=>p(t,m(e)),x=(t,e)=>{var n={};for(var r in t)v.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&g)for(var r of g(t))e.indexOf(r)<0&&y.call(t,r)&&(n[r]=t[r]);return n};function j(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var O=class{_canSanitize(t){return this.isValid(t)}optional(){return new S(this)}},S=class extends O{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,e,n){return null==t||this.inner.isValid(t,e,n)}_canSanitize(t){return null==t||this.inner._canSanitize(t)}},P=class extends O{constructor(t=""){super(),this._default=t}sanitize(t){return"string"==typeof t?t:this._default}isValid(t,e,n){return"string"==typeof t||(null==e||e.errors.push(j(null!=n?n:[])+": expected string, got "+typeof t),!1)}},M=class extends O{constructor(t=0){super(),this._default=t}sanitize(t){return"number"==typeof t&&isFinite(t)?t:this._default}isValid(t,e,n){return!("number"!=typeof t||!isFinite(t))||(null==e||e.errors.push(j(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},_=class extends O{constructor(t=!1){super(),this._default=t}sanitize(t){return"boolean"==typeof t?t:this._default}isValid(t,e,n){return"boolean"==typeof t||(null==e||e.errors.push(j(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},E=class extends O{constructor(t){super(),this.value=t,this._default=t}sanitize(t){return t===this.value?this.value:this._default}isValid(t,e,n){return t===this.value||(null==e||e.errors.push(j(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},N=class extends O{constructor(t,e){super(),this.values=t,this._default=null!=e?e:t[0]}sanitize(t){return this.values.includes(t)?t:this._default}isValid(t,e,n){return!!this.values.includes(t)||(null==e||e.errors.push(j(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},C=class extends O{constructor(t,e){super(),this.schemas=t,this._kind="union",this._default=null!=e?e:t[0]._default}sanitize(t){for(const e of this.schemas)if(e.isValid(t))return e.sanitize(t);return this._default}isValid(t,e,n){var r;const o=e&&{errors:[],warnings:[],strict:e.strict};if(this.schemas.some(e=>e.isValid(t,o,n?[...n]:void 0)))return!0;if(!e)return!1;const i=j(null!=n?n:[]);let a;e.errors.push(i+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,240));let s=-1;const l=[];for(const r of this.schemas){const o={errors:[],warnings:[],strict:e.strict};if(r.isValid(t,o,n?[...n]:void 0),!o.errors.length)continue;const u=Math.max(...o.errors.map(t=>t.slice(0,t.indexOf(":")).length));if((u>s||u===s&&a&&o.errors.length<a.length)&&(s=u,a=o.errors),u<=i.length)for(const t of o.errors){const e=/: expected (.+?), got /.exec(t);e&&!l.includes(e[1])&&l.push(e[1])}}if(a&&s>i.length)for(const t of a.slice(0,4))e.errors.includes(t)||e.errors.push(t);else l.length&&e.errors.push(i+": expected "+l.join(" | "));return!1}_canSanitize(t){return this.schemas.some(e=>e._canSanitize(t))}},T=class extends O{constructor(t,e,n){var r;super(),this._key=t,this._schemas=e,this._kind="discriminatedUnion",this._default=null!=n?n:e[0]._default,this._map=new Map;for(const n of e){const e=n._shape[t];if(!e)continue;const o=null!=(r=e.inner)?r:e;this._map.set(o._default,n),e.inner&&(this._absentMember=n)}}_findSchema(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const e=t[this._key];return null==e?this._absentMember:this._map.get(e)}sanitize(t){var e;return(null!=(e=this._findSchema(t))?e:this._schemas[0]).sanitize(t)}isValid(t,e,n){const r=this._findSchema(t);if(!r){const r=null===t||"object"!=typeof t||Array.isArray(t)?void 0:t[this._key];return null==e||e.errors.push(j(null!=n?n:[])+": no discriminated union member matched "+this._key+"="+JSON.stringify(r)),!1}return r.isValid(t,e,n)}_canSanitize(t){if(null===t||"object"!=typeof t||Array.isArray(t))return!1;const e=this._findSchema(t);return e?e._canSanitize(t):this._schemas[0]._canSanitize(t)}},z=class extends O{constructor(t){super(),this._shape=t;const e={};for(const n of Object.keys(t))e[n]=t[n]._default;this._default=e}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n={};for(const t of Object.keys(this._shape)){const r=this._shape[t].sanitize(e[t]);void 0!==r&&(n[t]=r)}return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(j(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(i=!1),o.pop();if(null==e?void 0:e.strict)for(const t of Object.keys(r))t in this._shape||void 0!==r[t]&&(o.push(t),e.errors.push(j(o)+": unexpected extra key"),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},F=class extends O{constructor(t,e){super(),this._shape=t,this._openSchema=e;const n={};for(const e of Object.keys(t))n[e]=t[e]._default;this._default=n}sanitize(t){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n=A({},e);for(const t of Object.keys(this._shape)){const r=this._shape[t].sanitize(e[t]);void 0!==r&&(n[t]=r)}if(this._openSchema)for(const t of Object.keys(e))t in this._shape||(n[t]=this._openSchema.sanitize(e[t]));return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(j(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(i=!1),o.pop();if(this._openSchema)for(const t of Object.keys(r))t in this._shape||(o.push(t),this._openSchema.isValid(r[t],e,o)||(i=!1),o.pop());return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},D=class extends O{constructor(t){super(),this.item=t,this._default=[]}sanitize(t){if(!Array.isArray(t))return[];const e=[];for(const n of t)this.item._canSanitize(n)&&e.push(this.item.sanitize(n));return e}isValid(t,e,n){if(!Array.isArray(t))return null==e||e.errors.push(j(null!=n?n:[])+": expected array, got "+typeof t),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<t.length;n++)r.push("["+n+"]"),this.item.isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)}},I=class extends O{constructor(t){super(),this.value=t,this._kind="record",this._default={}}sanitize(t){if(!t||"object"!=typeof t||Array.isArray(t))return{};const e={};for(const[n,r]of Object.entries(t))this.value._canSanitize(r)&&(e[n]=this.value.sanitize(r));return e}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(j(null!=n?n:[])+": expected object/record, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(const[n,i]of Object.entries(t))r.push(n),this.value.isValid(i,e,r)||(o=!1),r.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},R=class extends O{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},L=class extends O{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return void 0!==t||(null==e||e.errors.push(j(null!=n?n:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}},W=class extends O{constructor(t,e){super(),this.fn=t,this._default=e,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,e,n){return this.schema.isValid(t,e,n)}_canSanitize(t){return this.schema._canSanitize(t)}},B=class extends O{constructor(t){super(),this.schemas=t,this._kind="tuple",this._default=t.map(t=>t._default)}sanitize(t){return Array.isArray(t)&&t.length===this.schemas.length?this.schemas.map((e,n)=>e.sanitize(t[n])):this._default}isValid(t,e,n){if(!Array.isArray(t)||t.length!==this.schemas.length)return null==e||e.errors.push(j(null!=n?n:[])+": expected tuple of length "+this.schemas.length+", got "+(Array.isArray(t)?"array["+t.length+"]":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<this.schemas.length;n++)r.push("["+n+"]"),this.schemas[n].isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)&&t.length===this.schemas.length}},U={string:(t="")=>new P(t),number:(t=0)=>new M(t),boolean:(t=!1)=>new _(t),literal:t=>new E(t),enum:(t,e)=>new N(t,e),union:(t,e)=>new C(t,e),discriminatedUnion:(t,e)=>new T(t,e),object:t=>new z(t),openObject:(t,e)=>new F(t,e),extendedObject:(t,e)=>new z(A(A({},t._shape),e)),array:t=>new D(t),record:t=>new I(t),any:()=>new R,defined:()=>new L,tuple:t=>new B(t),lazy:(t,e)=>new W(t,e)},V=/^(\d+)\.(\d+)(?:\.(\d+))?$/;function q(t){if("string"!=typeof t)return;const e=V.exec(t.trim());return e?{a:Number(e[1]),b:Number(e[2]),c:void 0===e[3]?0:Number(e[3])}:void 0}q("1.1");var G="data-px-animation-src",Z="_px_animator",K="block",H="inline",J="nearest",X="root",Q="center",Y="bottom",$=["duration","iterations","engine","frameRate"],tt=["trigger","delay","fillMode","direction"],et=[...$,...tt,"fill","resetOnFinish","timelineSource","scroll"],nt={native:"native",js:"js"},rt=w(A({},nt),{auto:"auto"});function ot(t){return t===rt.js?nt.js:nt.native}function it(t){return t===rt.native}var at={startOn:"load",outAction:"continue",scrollIntoViewThreshold:0},st={start:"start",end:"end"},lt={normal:"normal",alternate:"alternate"},ut="userSpaceOnUse",ct="objectBoundingBox",ft={translate:"translate"},dt={separate:"separate",combined:"combined"},ht="textContent",pt="class",mt="transform",gt="offsetDistance",vt=new Set(["type","children","animator","meta","animate","effects",ht]),yt={translate:"translate",rotate:"rotate",scale:"scale",origin:"origin"},bt=(yt.translate,yt.rotate,yt.scale,yt.origin,"pad"),kt={linear:"linear",radial:"radial"};function At(t){var e;const n=(null==t?void 0:t.animator)||(null==(e=null==t?void 0:t.meta)?void 0:e.animator);if(!n)return;const r=wt.get(n);if(r)return r;const o=n,i=et.filter(t=>void 0!==o[t]),a=i.length?A({},o):n;for(const t of i)delete a[t];const s=function(t){const e=t.timeline;if(null==e||"object"!=typeof e)return t;const n=xt.get(t);if(n)return n;const r=t,{timeline:o}=r,i=x(r,["timeline"]);if(void 0!==e.engine&&(i.engine=e.engine),void 0!==e.frameRate&&(i.frameRate=e.frameRate),"scroll"===e.type||"view"===e.type){i.timelineSource="scroll",void 0!==e.duration&&(i.duration=e.duration),void 0!==e.iterations&&(i.iterations=e.iterations);const t=A({},i.scroll||{});t.kind=e.type,void 0!==e.axis&&(t.axis=e.axis),void 0!==e.source&&(t.source=e.source),void 0!==e.subject&&(t.subject=e.subject),void 0!==e.smoothing&&(t.smoothing=e.smoothing),void 0!==e.range&&(t.range=e.range);const n=e.pin;"boolean"==typeof n?t.pin=n:n&&"object"==typeof n&&(t.pin=!0,void 0!==n.align&&(t.pinAlign=n.align),void 0!==n.offset&&(t.pinOffset=n.offset),void 0!==n.distance&&(t.pinDistance=n.distance)),i.scroll=t}else{if(void 0!==e.duration&&(i.duration=e.duration),void 0!==e.trigger){const t=e.trigger,{finishAction:n}=t,r=x(t,["finishAction"]);Object.keys(r).length&&(i.trigger=r),void 0!==n&&(i.resetOnFinish="reset"===n)}void 0!==e.delay&&(i.delay=e.delay),void 0!==e.iterations&&(i.iterations=e.iterations),void 0!==e.direction&&(i.direction=e.direction),void 0!==e.fillMode&&(i.fill=e.fillMode)}return xt.set(t,i),i}(a);return wt.set(n,s),s}var wt=new WeakMap,xt=new WeakMap;function jt(t){var e;if(t)return null==(e=At(t))?void 0:e.definitions}var Ot=U.union([U.string(),U.tuple([U.number(),U.number(),U.number(),U.number()])]),St=U.union([U.string(),U.number(),U.array(U.number()),U.object({pathData:U.string()}),U.lazy(()=>U.array(fe),[]),U.lazy(()=>Ft,{})]),Pt=U.object({time:U.number().optional(),value:St.optional(),easing:Ot.optional(),tangentOut:U.tuple([U.number(),U.number()]).optional(),tangentIn:U.tuple([U.number(),U.number()]).optional()}),Mt=t=>{var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0},_t=t=>{var e;return null!=(e=t.value)?e:t.v},Et=t=>{var e;return null!=(e=t.easing)?e:t.e},Nt=t=>t.tangentIn,Ct=t=>t.tangentOut,Tt=U.object({segmentCount:U.number().optional(),repeatAt:U.enum([st.start,st.end]).optional(),direction:U.enum([lt.normal,lt.alternate]).optional()}),zt=U.object({value:St.optional(),keyframes:U.array(Pt).optional(),loop:U.union([Tt,U.boolean()]).optional(),autoOrient:U.boolean().optional(),alongPathMode:U.enum(["sampled","offsetPath"]).optional()}),Ft=U.object({translate:U.tuple([U.number(),U.number()]).optional(),rotate:U.number().optional(),skew:U.number().optional(),scale:U.tuple([U.number(),U.number()]).optional(),origin:U.tuple([U.number(),U.number()]).optional()}),Dt=(U.union([U.string(),Ft,U.object({value:Ft}),zt]),U.record(zt)),It=U.union([U.string(),U.array(U.union([U.string(),Dt])),Dt]),Rt=U.object({startOn:U.enum(["load","mouseOver","click","scrollIntoView","programmatic"],at.startOn).optional(),outAction:U.enum(["continue","pause","reset","reverse"],at.outAction).optional(),finishAction:U.enum(["hold","reset"]).optional(),scrollIntoViewThreshold:U.number().optional()}),Lt=U.object({width:U.number(),pathData:U.string()}),Wt=U.object({fontFamily:U.string(),fontStyle:U.string(),ascent:U.number(),unitsPerEm:U.number(),glyphs:U.record(Lt)}),Bt=U.object({easings:U.record(U.tuple([U.number(),U.number(),U.number(),U.number()])).optional(),animations:U.record(Dt).optional(),fonts:U.record(Wt).optional()}),Ut=U.object({phase:U.enum(["cover","contain","entry","exit","entry-crossing","exit-crossing"]).optional(),fraction:U.number().optional()}),Vt=U.object({start:Ut.optional(),end:Ut.optional()}),qt=U.object({kind:U.enum(["view","scroll"]).optional(),axis:U.enum([K,H,"x","y"]).optional(),source:U.enum([J,X]).optional(),subject:U.string().optional(),smoothing:U.number().optional(),pin:U.boolean().optional(),pinAlign:U.enum(["top",Q,Y]).optional(),pinOffset:U.number().optional(),pinDistance:U.number().optional(),range:Vt.optional()}),Gt=U.object({align:U.enum(["top",Q,Y]).optional(),offset:U.number().optional(),distance:U.number().optional()}),Zt=U.enum([rt.auto,rt.native,rt.js]).optional(),Kt=U.object({type:U.literal("time").optional(),engine:Zt,frameRate:U.number().optional(),duration:U.number().optional(),trigger:Rt.optional(),delay:U.number().optional(),iterations:U.union([U.number(),U.literal("infinite")]).optional(),fillMode:U.enum(["forwards","backwards","both","none"]).optional(),direction:U.enum(["normal","reverse","alternate","alternate-reverse"]).optional()}),Ht={duration:U.number().optional(),iterations:U.number().optional(),engine:Zt,frameRate:U.number().optional(),axis:U.enum([K,H,"x","y"]).optional(),source:U.enum([J,X]).optional(),subject:U.string().optional(),smoothing:U.number().optional(),pin:U.union([U.boolean(),Gt]).optional(),range:Vt.optional()},Jt=U.object(A({type:U.literal("scroll")},Ht)),Xt=U.object(A({type:U.literal("view")},Ht)),Qt=U.discriminatedUnion("type",[Kt,Jt,Xt]),Yt=U.object({target:U.string(),animateWith:U.array(U.string())}),$t=U.object({timeline:Qt.optional(),definitions:Bt.optional(),bindings:U.array(Yt).optional(),debugGlobalName:U.string().optional(),version:U.string().optional()}),te=U.union([U.string(),U.number(),U.array(U.number()),U.object({value:U.defined()}),Ft]),ee=U.union([U.number(),zt,U.object({value:U.number()})]),ne=U.union([U.tuple([U.number(),U.number()]),zt,U.object({value:U.tuple([U.number(),U.number()])})]),re=U.union([U.string(),zt,U.object({value:U.string()})]),oe=U.object({translate:ne.optional(),rotate:ee.optional(),scale:ne.optional(),skew:ee.optional(),origin:ne.optional()}),ie=U.object({copies:U.number().optional(),translate:ne.optional(),rotate:ee.optional(),skew:ee.optional(),scale:ne.optional(),origin:ne.optional()}),ae=U.object({source:U.string().optional(),maskType:U.enum(["luminance","alpha"]).optional(),maskUnits:U.enum([ut,ct]).optional(),maskContentUnits:U.enum([ut,ct]).optional(),x:U.number().optional(),y:U.number().optional(),width:U.number().optional(),height:U.number().optional()}),se=U.object({pathData:re.optional()}),le=U.object({offset:ee.optional(),range:ne.optional(),subPaths:U.enum([dt.separate,dt.combined]).optional()}),ue=U.object({start:U.number().optional(),stretch:U.number().optional(),timeCrop:U.tuple([U.number(),U.number()]).optional()}),ce=U.object({without:U.enum([ft.translate]).optional(),source:U.string().optional(),retime:ue.optional()}),fe=U.object({offset:U.number(),color:U.string()}),de=U.union([U.array(fe),U.object({value:U.array(fe)}),zt]),he=U.object({type:U.enum([kt.linear,kt.radial]),start:ne.optional(),end:ne.optional(),center:ne.optional(),radius:ee.optional(),focal:ne.optional(),stops:de.optional(),gradientUnits:U.enum([ut,ct]).optional(),spreadMethod:U.enum([bt,"reflect","repeat"]).optional(),gradientTransform:U.string().optional()}),pe=he,me=U.object({pathData:U.string(),pathOverflow:U.enum(["clip","extend"]).optional(),lengthAdjust:U.enum(["spacing","spacingAndGlyphs"]).optional(),method:U.enum(["align","stretch"]).optional(),spacing:U.enum(["auto","exact"]).optional(),startOffset:ee.optional(),textLength:ee.optional()}),ge=U.object({useGlyphs:U.boolean().optional()}),ve=U.object({transformBy:oe.optional(),repeater:ie.optional(),maskedBy:ae.optional(),clipPath:se.optional(),strokeTrim:le.optional(),clone:ce.optional(),fillGradient:he.optional(),strokeGradient:pe.optional(),textPath:me.optional(),text:ge.optional()});function ye(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!ve.isValid(t.effects,r,[o+".effects"]))for(const t of r.errors)n.push(t)}t&&Array.isArray(t.children)&&t.children.forEach((t,e)=>r(t,o+".children["+e+"]"))};return r(t,"root"),n}function be(t,e){var n;const r=!1!==(null==e?void 0:e.strict),o={errors:[],warnings:[],strict:r},i=xe.isValid(t,o,["root"])?[]:[...o.errors];if(t&&"object"==typeof t){for(const e of ye(t,{strict:r}))i.includes(e)||i.push(e);const e=null==(n=At(t))?void 0:n.definitions;for(const n of function(t,e){if(!e||!Object.keys(e).length)return[];const n=[],r=(t,o,i,a)=>{var s,l;if(!t)return;const u="string"==typeof t.fontFamily?t.fontFamily:void 0,c=null!=u?u:i,f=a||"text"===t.type&&!!(null==(l=null==(s=t.effects)?void 0:s.text)?void 0:l.useGlyphs);if(f&&u&&!Object.prototype.hasOwnProperty.call(e,u)){const t=o+': glyph-mode text uses font-family "'+u+'", which has no entry in animator.definitions.fonts';n.includes(t)||n.push(t)}Array.isArray(t.children)&&t.children.forEach((t,e)=>r(t,o+".children["+e+"]",c,f))};return r(t,"root",void 0,!1),n}(t,null==e?void 0:e.fonts))i.includes(n)||i.push(n);for(const n of function(t,e){const n=[],r=(t,o)=>{if(Array.isArray(t))return void t.forEach((t,e)=>r(t,o+"["+e+"]"));if(!t||"object"!=typeof t)return;const i=t.easing;if(!("string"!=typeof i||e&&Object.prototype.hasOwnProperty.call(e,i))){const t=o+'.easing: "'+i+'" names no entry in animator.definitions.easings — it will play linear';n.includes(t)||n.push(t)}for(const[e,n]of Object.entries(t))"easing"!==e&&n&&"object"==typeof n&&r(n,o+"."+e)};return r(t,"root"),n}(t,null==e?void 0:e.easings))i.includes(n)||i.push(n);for(const e of function(t){var e;const n=null==(e=At(t))?void 0:e.version;return void 0===n||void 0!==q(n)?[]:["root.animator.version: "+JSON.stringify(n)+' is not a version stamp ("a.b" or "a.b.c") — it reads as unstamped']}(t))i.includes(e)||i.push(e)}return i}var ke=U.openObject({type:U.string(),domType:U.string().optional(),textContent:U.string().optional(),id:U.string().optional(),meta:U.any().optional(),effects:ve.optional(),animate:It.optional(),style:U.record(U.union([U.string(),U.number()])).optional()},te),Ae=U.openObject(w(A({},ke._shape),{children:U.lazy(()=>U.array(Ae),[]).optional()}),te),we=U.object({width:U.union([U.number(),U.string()]).optional(),height:U.union([U.number(),U.string()]).optional(),viewBox:U.string().optional(),animator:$t.optional()}),xe=U.openObject(w(A(A({},ke._shape),we._shape),{type:U.literal("svg"),children:U.array(Ae).optional()}),te),je=(U.object({v:U.array(U.array(U.number())),i:U.array(U.array(U.number())).optional(),o:U.array(U.array(U.number())).optional(),c:U.boolean().optional()}),0);function Oe(){return"_px_"+Date.now().toString(36)+(++je).toString(36)+Math.random().toString(36).substring(2,6)}function Se(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>Se(t));const e=t,n={};for(const t of Object.keys(e))n[t]=Se(e[t]);return n}function Pe(t){var e;const n=Se(t),r=new Map,o=new Set(["href","xlink:href"]),i=new Set(["fill","stroke","clip-path","clipPath","mask","marker","marker-start","marker-mid","marker-end","filter","flood-color","lighting-color"]),a=new Set(["targetId","boundElementId"]),s=(t,e)=>"source"===t&&("maskedBy"===e||"clone"===e);!function t(e){if(e&&"object"==typeof e){if(e.id&&"string"==typeof e.id){const t=e.id,n=Oe();r.set(t,n),e.id=n}else e.animate&&(e.id=Oe());if(Array.isArray(e.children))for(const n of e.children)t(n)}}(n),function t(e,n){if(e&&"object"==typeof e)for(const[l,u]of Object.entries(e))if("children"!==l)if("string"==typeof u)if(o.has(l)&&u.startsWith("#")){const t=u.slice(1),n=r.get(t);n&&(e[l]="#"+n)}else if(i.has(l))e[l]=Me(u,r);else if(a.has(l)||s(l,n)){const t=u.startsWith("#"),n=r.get(t?u.slice(1):u);n&&(e[l]=t?"#"+n:n)}else u.includes("url(#")&&(e[l]=Me(u,r));else if("style"===l&&"object"==typeof u&&null!==u)for(const[t,e]of Object.entries(u))"string"==typeof e&&(u[t]=Me(e,r));else"object"==typeof u&&null!==u&&t(u,l);else if(Array.isArray(u))for(const e of u)t(e)}(n);const l=null==(e=n.animator)?void 0:e.bindings;if(Array.isArray(l)){const t=l.map(t=>{var e;const n=t.target.startsWith("#"),o=n?t.target.slice(1):t.target,i=null!=(e=r.get(o))?e:o;return w(A({},t),{target:n?"#"+i:i})});n.animator=w(A({},n.animator),{bindings:t})}return n}function Me(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}function _e(t,e=!1){var n,r,o,i;const a=t.v,s=t.i,l=t.o,u=t.c;if(!a.length)return"";const c=[],f=a.length;c.push("M"+a[0][0]+","+a[0][1]);for(let t=1;t<f;t++){const o=a[t-1],i=null!=(n=null==l?void 0:l[t-1])?n:o,u=null!=(r=null==s?void 0:s[t])?r:a[t],f=a[t];e||i[0]!==o[0]||i[1]!==o[1]||u[0]!==f[0]||u[1]!==f[1]?c.push("C"+i[0]+","+i[1]+","+u[0]+","+u[1]+","+f[0]+","+f[1]):c.push("L"+f[0]+","+f[1])}if(u&&f>0){const t=a[f-1],n=null!=(o=null==l?void 0:l[f-1])?o:t,r=null!=(i=null==s?void 0:s[0])?i:a[0],u=a[0];!e&&n[0]===t[0]&&n[1]===t[1]&&r[0]===u[0]&&r[1]===u[1]||c.push("C"+n[0]+","+n[1]+","+r[0]+","+r[1]+","+u[0]+","+u[1]),c.push("z")}return c.join("")}function Ee(t,e,n){return t+(e-t)*n}function Ne(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let i=0;i<o;i++)r[i]=Ee(t[i]||0,e[i]||0,n);return r}function Ce(t,e,n){return[Ee(t[0]||0,e[0]||0,n),Ee(t[1]||0,e[1]||0,n),Ee(t[2]||0,e[2]||0,n),Ee(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function Te(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++)o.push(ze(t[i],e[i],n));return o}function ze(t,e,n){var r,o,i,a,s,l,u,c,f;if(!t||!e)return t||e||{v:[]};const d=Math.min(Math.max(n,0),1),h=Math.min(t.v.length,e.v.length),p=[],m=[],g=[];for(let n=0;n<h;n++){const f=t.v[n],h=e.v[n];p.push(Ne(f,h,d));const v=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,y=null!=(a=null==(i=e.i)?void 0:i[n])?a:h;m.push(Ne(v,y,d));const b=null!=(l=null==(s=t.o)?void 0:s[n])?l:f,k=null!=(c=null==(u=e.o)?void 0:u[n])?c:h;g.push(Ne(b,k,d))}return{v:p,i:m.length?m:void 0,o:g.length?g:void 0,c:null!=(f=t.c)?f:e.c}}function Fe(t,e,n){if(n<=0)return 0;if(n>=1)return 1;const r=3*t,o=3*(e-t)-r,i=1-r-o;function a(t){return((i*t+o)*t+r)*t}function s(t){return(3*i*t+2*o)*t+r}let l=n,u=0,c=1;for(let t=0;t<8;t++){const t=a(l)-n;if(Math.abs(t)<1e-6)return l;const e=s(l);if(Math.abs(e)<1e-6)break;l-=t/e}for(l=n;u<c;){const t=a(l);if(Math.abs(t-n)<1e-6)return l;n>t?u=l:c=l,l=(c+u)/2}return l}function De(t){const[e,n,r,o]=t,i=3*n,a=3*(o-n)-i,s=1-i-a;return function(t){return n=Fe(e,r,t),((s*n+a)*n+i)*n;var n}}function Ie(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Re(t,e){if(!t)return{left:void 0,right:void 0};if(e<=0)return{left:void 0,right:t};if(e>=1)return{left:t,right:void 0};const[n,r,o,i]=t,a=Fe(n,o,e),s=[n,r],l=[o,i],{left:u,right:c}=function(t,e,n,r,o){const i=Ie(t,e,o),a=Ie(e,n,o),s=Ie(n,r,o),l=Ie(i,a,o),u=Ie(a,s,o),c=Ie(l,u,o);return{left:[t,i,l,c],right:[c,u,s,r]}}([0,0],s,l,[1,1],a),f=u[3][0],d=u[3][1];let h,p;f>1e-9&&Math.abs(d)>1e-9&&(h=[u[1][0]/f,u[1][1]/d,u[2][0]/f,u[2][1]/d]);const m=1-f,g=1-d;return m>1e-9&&Math.abs(g)>1e-9&&(p=[(c[1][0]-f)/m,(c[1][1]-d)/g,(c[2][0]-f)/m,(c[2][1]-d)/g]),{left:h,right:p}}function Le(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function We(t){const e=Math.round(255*t[0]),n=Math.round(255*t[1]),r=Math.round(255*t[2]);return 4===t.length?"rgba("+e+","+n+","+r+","+t[3]+")":"rgb("+e+","+n+","+r+")"}function Be(t){if(t){if(Array.isArray(t))return t;if("string"==typeof t)return t.startsWith("#")?function(t){const e=t.slice(1),n=e.length<=4,r=n?e[0]+e[0]:e.slice(0,2),o=n?e[1]+e[1]:e.slice(2,4),i=n?e[2]+e[2]:e.slice(4,6),a=4===e.length?e[3]+e[3]:8===e.length?e.slice(6,8):null,s=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==a&&s.push(parseInt(a,16)/255),s}(t):t.startsWith("rgb")?function(t){var e;const n=null==(e=t.match(/rgba?\((.*)\)/))?void 0:e[1];if(!n)throw new Error("Invalid rgb/rgba format");const r=n.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)}}var Ue=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),Ve=new Set(["translate","rotate","scale","skew"]),qe=new Set(["offset-distance","offsetDistance"]);function Ge(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],i=t.translate,a=t.origin,s=t.rotate,l=t.skew,u=t.scale,c=r?"px":"",f=r?"deg":"";return i&&o.push("translate("+i[0]+c+","+i[1]+c+")"),a&&o.push("translate("+a[0]+c+","+a[1]+c+")"),null!=s&&o.push("rotate("+s+f+")"),null!=l&&o.push("skewX("+l+f+")"),u&&o.push("scale("+u[0]+","+u[1]+")"),a&&o.push("translate("+-a[0]+c+","+-a[1]+c+")"),o.join("")}var Ze=new Set(["offset-distance","offsetDistance"]),Ke=1e3;function He(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function Je(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var Xe=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 Qe(t){return Xe.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Ye(t,e,n){return Math.max(e,Math.min(t,n))}function $e(t,e,n,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const i=1-o,a=i*i,s=o*o,l=a*i,u=3*o*a,c=3*s*i,f=s*o;return[l*t[0]+u*e[0]+c*n[0]+f*r[0],l*t[1]+u*e[1]+c*n[1]+f*r[1]]}var tn=1e-4;function en(t,e,n,r,o){const i=nn(t,e,n,r,o);return 0===i[0]&&0===i[1]?nn(t,e,n,r,o<.5?o+tn:o-tn):i}function nn(t,e,n,r,o){const i=1-o,a=3*i*i,s=6*o*i,l=3*o*o;return[a*(e[0]-t[0])+s*(n[0]-e[0])+l*(r[0]-n[0]),a*(e[1]-t[1])+s*(n[1]-e[1])+l*(r[1]-n[1])]}function rn(t,e,n,r,o=100){const i=o+1,a=new Float64Array(i),s=new Float64Array(i);let l=$e(t,e,n,r,0);a[0]=0,s[0]=0;let u=0;for(let c=1;c<i;c++){const i=c/o,f=$e(t,e,n,r,i),d=f[0]-l[0],h=f[1]-l[1];u+=Math.sqrt(d*d+h*h),a[c]=i,s[c]=u,l=f}return{ts:a,ds:s}}function on(t,e){const{ts:n,ds:r}=t,o=n.length-1;if(e<=n[0])return r[0];if(e>=n[o])return r[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;n[t]<e?i=t+1:a=t}const s=n[a-1],l=n[a]-s,u=l>0?(e-s)/l:0;return r[a-1]+u*(r[a]-r[a-1])}var an=new Set(["script","foreignobject"]),sn=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),ln=new Set(["href","xlink:href","src"]),un=new Set(["mixBlendMode","isolation"]),cn=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,fn=/^data:image\/svg\+xml(?:;[^,]*)?,/i,dn=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,hn=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function pn(t,e){const n=t.toLowerCase();if(!function(t){return!!t.startsWith("on")}(n)){if("fill"===n||"stroke"===n||"stopcolor"===n){const t=String(e);return t.includes("url(")&&!/^url\(#[^)]+\)$/.test(t)?void console.warn('Attribute "'+n+'" blocked: url() must be internal url(#id), got:',e):e}if(sn.has(n)){const t=String(e);return t.startsWith("#")||/^url\(#[^)]+\)$/.test(t)||ln.has(n)&&(cn.test(t)||fn.test(t)||function(t){const e=dn.exec(t);return!!e&&hn.some(t=>e[1].startsWith(t))}(t))?e:void console.warn('Attribute "'+n+'" blocked: must be #id, url(#id), or data:image/… URI, got:',e)}return e}console.warn("Attribute blocked (event handler / dangerous): ",n)}function mn(t){const e={};for(const n of Object.keys(t)){const r=He(n);if(vt.has(r))continue;if("style"===r)continue;let o=t[n];if(Ue.has(r)&&Array.isArray(o))e[r]=We(o);else if("transform"!==r||null===o||"object"!=typeof o||Array.isArray(o)||o.keyframes)Ve.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),e[mt]=r+"("+o+")"):Array.isArray(o)?e[r]=o.join(","):null!=o&&(e[r]=String(o));else{const t=o.value&&"object"==typeof o.value?o.value:o;e[mt]=Ge(t,{withUnits:!1})}}return e}function gn(t){const e=_t(t);if(!e)return;if(Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]&&"number"==typeof e[1])return[e[0],e[1]];const n=e.translate;return Array.isArray(n)&&n.length>=2?[n[0],n[1]]:void 0}function vn(t){return Mt(t)}function yn(t){return Et(t)}function bn(t){const e=t.keyframes;if(!Array.isArray(e))return!1;if(t.autoOrient)return!0;for(const t of e)if(Nt(t)||Ct(t))return!0;return!1}var kn=new WeakMap;function An(t,e,n,r){let o=kn.get(t);const i=null==o?void 0:o.get(e);if(i)return i;const a=Ct(t),s=Nt(e),l=[n[0]+(a?a[0]:0),n[1]+(a?a[1]:0)],u=[r[0]+(s?s[0]:0),r[1]+(s?s[1]:0)],c=rn(n,l,u,r),f={P0:n,P1:l,P2:u,P3:r,lut:c,totalArc:c.ds[c.ds.length-1]};return o||(o=new WeakMap,kn.set(t,o)),o.set(e,f),f}var wn=.5,xn=5,jn=32;function On(t,e){var n,r,o;if(!bn(t))return t;const i=t.keyframes;if(!Array.isArray(i)||i.length<2)return t;const a=!!t.autoOrient,s=null!=(n=null==e?void 0:e.flatnessTolerance)?n:wn,l=null!=(r=null==e?void 0:e.rotationTolerance)?r:xn,u=null!=(o=null==e?void 0:e.maxSamplesPerSegment)?o:jn,c=[],f=gn(i[0]);if(!f)return t;const d=a?function(t,e){const n=gn(t),r=gn(e);if(!n||!r)return 0;const o=An(t,e,n,r),i=en(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;c.push(Pn(vn(i[0]),En(Mn(i[0]),Mn(i[0]),0,f,d,a)));for(let t=0;t<i.length-1;t++){const e=i[t],n=i[t+1],r=gn(e),o=gn(n);r&&o?(a&&t>0&&Cn(c,e,n,r,o,l),zn(c,e,n,r,o,a,s,l,u)):c.push(Pn(vn(n),En(Mn(n),Mn(n),1,null!=o?o:[0,0],void 0,a)))}const h=yn(i[i.length-1]);h&&(c[c.length-1].e=h),a&&Sn(c);const p={keyframes:c};return void 0!==t.loop&&(p.loop=t.loop),p}function Sn(t){let e;for(const n of t){const t=_t(n);if(!t||"number"!=typeof t.rotate)continue;if(void 0===e){e=t.rotate;continue}let r=t.rotate;for(;r-e>180;)r-=360;for(;r-e<-180;)r+=360;t.rotate=r,e=r}}function Pn(t,e){return{t:t,v:e}}function Mn(t){const e=_t(t);if(e&&"object"==typeof e&&!Array.isArray(e))return e}function _n(t,e,n){if(void 0===t)return e;if(void 0===e)return t;if("number"==typeof t&&"number"==typeof e)return t+(e-t)*n;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){const r=new Array(t.length);for(let o=0;o<t.length;o++){const i="number"==typeof t[o]?t[o]:0,a="number"==typeof e[o]?e[o]:0;r[o]=i+(a-i)*n}return r}return n<.5?t:e}function En(t,e,n,r,o,i){const a={translate:r},s=new Set;if(t)for(const e of Object.keys(t))s.add(e);if(e)for(const t of Object.keys(e))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==e?void 0:e[r];void 0===o&&void 0===s||(a[r]=_n(o,s,n))}return void 0!==o&&(a.rotate=o+Nn(t,e,n)),a}function Nn(t,e,n){const r="number"==typeof(null==t?void 0:t.rotate)?t.rotate:void 0,o="number"==typeof(null==e?void 0:e.rotate)?e.rotate:void 0;if(void 0===r&&void 0===o)return 0;const i=_n(r,o,n);return"number"==typeof i?i:0}function Cn(t,e,n,r,o,i){const a=t[t.length-1],s=_t(a),l=null==s?void 0:s.rotate;if("number"!=typeof l)return;const u=Mn(e),c=l-Nn(u,u,0),f=An(e,n,r,o),d=en(f.P0,f.P1,f.P2,f.P3,0),h=180*Math.atan2(d[1],d[0])/Math.PI,p=function(t,e){let n=t-e;for(;n>180;)n-=360;for(;n<-180;)n+=360;return n}(h,c);if(Math.abs(p)<=i)return;const m=vn(e),g=Math.min(m+Tn,(m+vn(n))/2),v=En(Mn(e),Mn(e),0,r,h,!0);t.push(Pn(g,v))}var Tn=.05;function zn(t,e,n,r,o,i,a,s,l){const u=An(e,n,r,o),c=vn(e),f=vn(n),d=yn(e),h=(p=d)?De([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=Mn(e),g=Mn(n),v=function(t,e,n,r,o){const i=[];Fn(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),Fn(t.P0[1],t.P1[1],t.P2[1],t.P3[1],i),i.sort((t,e)=>t-e);const a=[0];for(const t of i)t>a[a.length-1]+1e-6&&t<.999999&&a.push(t);a.push(1);const s=[],l={remaining:o-a.length};for(let o=0;o<a.length-1;o++)Dn(a[o],a[o+1],s,t,e,n,r,l);return s}(u,i,a,s,l),y=[];for(const t of v){const e=on(u.lut,t),n=Ye(u.totalArc>0?e/u.totalArc:t,0,1),r={u:Ye(h(n),0,1),p:n,pos:$e(u.P0,u.P1,u.P2,u.P3,t)};if(i){const e=en(u.P0,u.P1,u.P2,u.P3,t);r.rotateDeg=180*Math.atan2(e[1],e[0])/Math.PI}y.push(r)}let b=d,k=0;const A=t.length-1;for(let e=0;e<y.length;e++){const n=y[e],r=k<1?Ye((n.u-k)/(1-k),0,1):1,{left:o,right:a}=Re(b,r),s=0===e?A:t.length-1;o?t[s].e=o:delete t[s].e;const l=c+n.u*(f-c),u=En(m,g,n.p,n.pos,n.rotateDeg,i);t.push(Pn(l,u)),b=a,k=n.u}}function Fn(t,e,n,r,o){const i=e-t,a=n-e,s=i-2*a+(r-n),l=2*(a-i),u=i;if(Math.abs(s)<1e-10){if(Math.abs(l)>1e-10){const t=-u/l;t>1e-6&&t<.999999&&o.push(t)}return}const c=l*l-4*s*u;if(c<0)return;const f=Math.sqrt(c),d=(-l-f)/(2*s),h=(-l+f)/(2*s);d>1e-6&&d<.999999&&o.push(d),h>1e-6&&h<.999999&&o.push(h)}function Dn(t,e,n,r,o,i,a,s){const l=(t+e)/2,u=$e(r.P0,r.P1,r.P2,r.P3,t),c=$e(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=$e(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=$e(r.P0,r.P1,r.P2,r.P3,l),p=$e(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(In(d,u,c),In(h,u,c),In(p,u,c));let g=!0;if(o){const n=en(r.P0,r.P1,r.P2,r.P3,t),o=en(r.P0,r.P1,r.P2,r.P3,e),i=180*Math.atan2(n[1],n[0])/Math.PI,s=180*Math.atan2(o[1],o[0])/Math.PI;let l=Math.abs(i-s);l>180&&(l=360-l),l>a&&(g=!1)}m<=i&&g||s.remaining<=0||f<1e-6?n.push(e):(s.remaining-=1,Dn(t,l,n,r,o,i,a,s),Dn(l,e,n,r,o,i,a,s))}function In(t,e,n){const r=n[0]-e[0],o=n[1]-e[1],i=r*r+o*o;if(i<1e-20){const n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}const a=(t[0]-e[0])*o-(t[1]-e[1])*r;return Math.abs(a)/Math.sqrt(i)}function Rn(t,e){const n=Ln(t,e);return null!=n?n:t}function Ln(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=Ln(t.children[r],e);null!==o&&(n||(n=t.children.slice()),n[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o,n=t.transform;if(n&&"object"==typeof n&&bn(n)){const o=On(n,e);o!==n&&(r=w(A({},t),{transform:o}))}}if(!n&&!r)return null;const i=A({},t);return n&&(i.children=n),r&&(i.animate=r),i}var Wn=1;function Bn(t,e){if(t===e)return!0;if(typeof t!=typeof e||null===t||null===e||"object"!=typeof t)return!1;if(Array.isArray(t)!==Array.isArray(e))return!1;const n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(n=>Bn(t[n],e[n]))}function Un(t){const e=[];let n;const r=function(t){const e=t.split(/([MLCZmlcz]|[\s,]+)/).map(t=>t.trim()).filter(t=>t&&","!==t),n=[];let r=null;for(const t of e)if(/[MLCZmlcz]/.test(t))r={type:t,values:[]},n.push(r);else if(r){const e=+t;r.values.push(Number.isNaN(e)?0:e)}return n}(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;n={v:[[t,r]],i:[[t,r]],o:[[t,r]],c:!1},e.push(n);continue}if(n||(n={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},e.push(n)),"L"===r){const t=o[0]||0,e=o[1]||0;n.v.push([t,e]),n.i.push([t,e]),n.o.push([t,e])}else if("C"===r){const t=o[0]||0,e=o[1]||0,r=o[2]||0,i=o[3]||0,a=o[4]||0,s=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([a,s]),n.i.push([r,i]),n.o.push([a,s])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function Vn(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!==Vn(t)}function Gn(t){if(t&&"object"==typeof t&&"string"==typeof t.pathData){const e=Vn(t.pathData);return e?{paths:Un(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&qn(e[0])){const t=[];for(const n of e){const e=Vn(n);e&&t.push(...Un(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&qn(t[0])){const e=[];for(const n of t){const t=Vn(n);t&&e.push(...Un(t))}return{paths:e}}return{paths:t}}return qn(t)?{paths:Un(Vn(t))}:t}function Zn(t,e){var n;if(t)return Array.isArray(t)?t:(null==(n=null==e?void 0:e.easings)?void 0:n[t])?e.easings[t]:void console.warn("Unknown easing name: "+t)}function Kn(t,e){var n;if("string"==typeof t){const r=null==(n=null==e?void 0:e.animations)?void 0:n[t];return r||console.warn("Unknown animation name: "+t),r}return t}function Hn(t,e,n,r){var o,i;return"d"===t?{paths:Te(null!=(o=null==e?void 0:e.paths)?o:Array.isArray(e)?e:[],null!=(i=null==n?void 0:n.paths)?i:Array.isArray(n)?n:[],r)}:Ue.has(t)?Ce(e||[0,0,0,1],n||[0,0,0,1],r):"transform"!==t||"object"!=typeof e||null===e||Array.isArray(e)||"object"!=typeof n||null===n||Array.isArray(n)?"rotate"===t&&"number"==typeof e&&"number"==typeof n?Ee(e,n,r):Ve.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?Ne(e||[],n||[],r):Ee(+(e||0),+(n||0),r):function(t,e,n){const r=new Set([...Object.keys(null!=t?t:{}),...Object.keys(null!=e?e:{})]),o={};for(const i of r){const r=null==t?void 0:t[i],a=null==e?void 0:e[i];if("rotate"===i||"skew"===i)o[i]=Ee(+(null!=r?r:0),+(null!=a?a:0),n);else if("translate"===i||"scale"===i||"origin"===i){const t="scale"===i?[1,1]:[0,0];o[i]=Ne(r||t,a||t,n)}else o[i]=null!=a?a:r}return o}(e,n,r)}function Jn(t,e,n,r){var o,i,a,s,l;const u=e.length-1,c=Ye(null!=(o=n.segmentCount)?o:u,1,u);let f;f=n.repeatAt===st.start?e.slice(0,c+1):e.slice(u-c);const d=null!=(i=e[0].t)?i:0,h=null!=(a=e[e.length-1].t)?a:0;let p,m;n.repeatAt===st.start?(p=0,m=d):(p=h,m=r);const g=m-p;if(g<=0)return e;const v=null!=(s=f[0].t)?s:0,y=(null!=(l=f[f.length-1].t)?l:0)-v;if(y<=0)return e;const b=f.map(t=>({relT:(t.t-v)/y,v:t.v,e:t.e,tangentIn:Nt(t),tangentOut:Ct(t)})),k=Math.floor(g/y),x=g-k*y,j=x/y,O=[],S=n.repeatAt!==st.start,P=e[e.length-1];let M,_=!1;function E(e,n,r){var o;let i;if(n){i=[];for(let t=b.length-1;t>=0;t--)i.push({relT:1-b[t].relT,v:b[t].v,e:t>0?Le(b[t-1].e):void 0,tangentIn:b[t].tangentOut,tangentOut:b[t].tangentIn})}else i=b;const a=void 0!==r?r:1;for(let n=0;n<i.length;n++){const r=i[n];if(r.relT>a+1e-9){const o=i[n-1],s=r.relT-o.relT,l=(a-o.relT)/s,u=o.e?De(o.e)(l):l,c=Hn(t,o.v,r.v,u),{left:f}=Re(o.e,l);return O.length>0&&o.relT<=a&&(O[O.length-1].e=f),void O.push({t:e+a*y,v:c,e:void 0})}const s=O.length>0?O[O.length-1]:P,l=S&&0===n&&void 0!==s&&Math.abs((null!=(o=s.t)?o:0)-(e+r.relT*y))<1e-9;if(l){if(Bn(s.v,r.v)){O.length>0?(s.e=r.e,s.tangentOut=r.tangentOut):(M=r.e,_=!0);continue}O.length>0&&(delete s.tangentIn,delete s.tangentOut)}const u={t:e+r.relT*y+(l?Wn:0),v:r.v,e:n<i.length-1?r.e:void 0};r.tangentIn&&(u.tangentIn=r.tangentIn),r.tangentOut&&(u.tangentOut=r.tangentOut),O.push(u)}}if(n.repeatAt===st.start){j>1e-9&&function(e,n,r){let o;if(n){o=[];for(let t=b.length-1;t>=0;t--)o.push({relT:1-b[t].relT,v:b[t].v,e:t>0?Le(b[t-1].e):void 0,tangentIn:b[t].tangentOut,tangentOut:b[t].tangentIn})}else o=b;const i=1-r;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT<i-1e-9)continue;const a=o[n-1];if(a&&a.relT<i-1e-9&&r.relT>i+1e-9){const n=r.relT-a.relT,o=(i-a.relT)/n,s=a.e?De(a.e)(o):o,l=Hn(t,a.v,r.v,s),{right:u}=Re(a.e,o);O.push({t:e,v:l,e:u})}const s={t:e+(r.relT-i)*y,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),O.push(s)}}(p,n.direction===lt.alternate&&k%2==0,j);for(let t=0;t<k;t++){const e=k-1-t,r=n.direction===lt.alternate&&e%2==0;E(p+x+t*y,r)}}else{for(let t=0;t<k;t++){const e=n.direction===lt.alternate&&t%2==0;E(p+t*y,e)}if(j>1e-9){const t=n.direction===lt.alternate&&k%2==0;E(p+k*y,t,j)}}return n.repeatAt===st.start?[...O,...e]:_&&e.length>0?[...e.slice(0,-1),w(A({},e[e.length-1]),{e:M}),...O]:[...e,...O]}function Xn(t,e,n,r){var o;const i=e.keyframes||[],a=[];for(const e of i){const n=Mt(e);let i=_t(e);const s=Et(e);"d"===t&&(i=Gn(i));const l=Je(t)?Qe(t):t;Ue.has(l)&&(i=null!=(o=Be(i))?o:i);const u={t:n,v:i,e:Zn(s,r)},c=Nt(e),f=Ct(e);c&&(u.tangentIn=c),f&&(u.tangentOut=f),a.push(u)}a.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const s=e.loop,l=!0===s?{}:s||void 0;return l&&a.length>=2?Jn(t,a,l,n):a}function Qn(t,e,n){const r=e.loop;if(null==r||!1===r)return e;const o=!0===r?{}:r,i=e.keyframes;if(!Array.isArray(i)||i.length<2)return e;const a=Je(t)?Qe(t):t,s=Ue.has(a),l=i.map(e=>{var n;const r=Mt(e);let o=_t(e);"d"===t&&(o=Gn(o)),s&&(o=null!=(n=Be(o))?n:o);const i={t:r,v:o,e:Et(e)},a=Nt(e),l=Ct(e);return a&&(i.tangentIn=a),l&&(i.tangentOut=l),i}),u={keyframes:Jn(t,l,o,n)};return void 0!==e.autoOrient&&(u.autoOrient=e.autoOrient),u}function Yn(t,e){const n=$n(t,e);return null!=n?n:t}function $n(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=$n(t.children[r],e);null!==o&&(n||(n=t.children.slice()),n[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o;for(const n of Object.keys(t)){const o=t[n],i=Qn(n,o,e);i!==o&&(r||(r=A({},t)),r[n]=i)}}if(!n&&!r)return null;const i=A({},t);return n&&(i.children=n),r&&(i.animate=r),i}var tr=0;function er(t,e=nt.native){const n=At(t)||{},r=jt(t),o=n.duration||1e3,i=[],a=(t,n,i)=>{if(0===n.length)return null;const a=function(t,e,n,r=nt.native){const o={};for(const[i,a]of Object.entries(t)){if("transform"===i&&"offsetPath"===a.alongPathMode&&void 0!==t.offsetDistance)continue;const s=Xn(i,a,e,n);if(s.length>0){const t={keyframes:s};void 0!==a.autoOrient&&(t.autoOrient=a.autoOrient),void 0!==a.loop&&(t.loop=a.loop),o[i]=r===nt.native&&"transform"===i?On(t):t}}return o}(function(t,e){if(!t)return t;const n=e&&"object"==typeof e&&!Array.isArray(e)?e:function(t){var e,n;if(!t||"string"!=typeof t)return;const r={},o=/([a-zA-Z]+)\s*\(([^)]*)\)/g,i=["translate","rotate","skewX","scale"];let a,s=-1;for(;null!==(a=o.exec(t));){const t=a[1],o=i.indexOf(t);if(o<0||o<=s)return;s=o;const l=a[2].split(/[\s,]+/).filter(Boolean).map(Number);if(l.some(t=>Number.isNaN(t)))return;if("translate"===t){if(l.length<1||l.length>2)return;r.translate=[l[0],null!=(e=l[1])?e:0]}else if("rotate"===t){if(1!==l.length)return;r.rotate=l[0]}else if("skewX"===t){if(1!==l.length)return;r.skew=l[0]}else{if(l.length<1||l.length>2)return;r.scale=[l[0],null!=(n=l[1])?n:l[0]]}}return t.replace(/([a-zA-Z]+)\s*\(([^)]*)\)/g,"").replace(/[\s,]/g,"").length?void 0:Object.keys(r).length?r:void 0}(e);if(!n||!Object.keys(n).length)return t;const r=t=>t&&"object"==typeof t&&!Array.isArray(t)?A(A({},n),t):t,o=t[mt];if(o&&"object"==typeof o){const e=o;if(Array.isArray(e.keyframes)){const n=w(A({},e),{keyframes:e.keyframes.map(t=>w(A({},t),{value:r(t.value)}))});return void 0!==n.value&&(n.value=r(n.value)),w(A({},t),{transform:n})}return t}const i=Object.keys(t).filter(t=>Ve.has(t));if(1!==i.length)return t;const a=i[0],s=t[a];if(!s||"object"!=typeof s||!Array.isArray(s.keyframes))return t;const l=w(A({},s),{keyframes:s.keyframes.map(t=>w(A({},t),{value:w(A({},n),{[a]:t.value})}))});void 0!==l.value&&(l.value=w(A({},n),{[a]:l.value}));const u=A({},t);return delete u[a],w(A({},u),{transform:l})}(function(t){const e={};for(const n of t)for(const[t,r]of Object.entries(n))e[t]=r;return e}(n),i),o,r,e);return 0===Object.keys(a).length?null:{id:t,animate:a}},s=function(t){var e;if(t)return null==(e=At(t))?void 0:e.bindings}(t);if(s)for(const t of s){const e=t.target.startsWith("#")?t.target.slice(1):t.target,n=t.animateWith.map(t=>Kn(t,r)).filter(t=>!!t),o=a(e,n);o&&i.push(o)}const l=t=>{const e=t.animate;if(e&&Object.keys(e).length>0){const n=t.id||"_px_el_"+ ++tr;t.id=n;const o=a(n,function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=Kn(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=Kn(r,e);t&&n.push(t)}else n.push(t);return n}(e,r),t.transform);o&&i.push(o)}if(t.children)for(let e=0;e<t.children.length;e++)l(t.children[e])};if(t.children)for(let e=0;e<t.children.length;e++)l(t.children[e]);return i}function nr(t,e,n){var r,o,i,a;const s=e.keyframes||[];if(0===s.length)return null;const{prevKf:l,nextKf:u}=function(t,e){var n,r;const o=t.length-1;let i=t[0],a=t[o>0?1:0];for(let s=0;s<o;s++){const l=null!=(n=t[s].t)?n:0,u=null!=(r=t[s+1].t)?r:0;if(l<=e&&e<=u){i=t[s],a=t[s+1];break}e>u&&s===o-1&&(i=t[o>0?o-1:0],a=t[o])}return{prevKf:i,nextKf:a}}(s,n);let c=l===u?0:(f=n,d=null!=(r=l.t)?r:0,(h=null!=(o=u.t)?o:0)===d?0:0+(f-d)/(h-d)*1);var f,d,h;c=Ye(c,0,1);const p=Et(l);if(p&&Array.isArray(p))try{c=De(p)(c)}catch(t){}let m=Je(t)?Qe(t):t,g=null;const v=null==l?void 0:l.v,y=null==u?void 0:u.v;if("d"===m)g=Te(null!=(i=null==v?void 0:v.paths)?i:Array.isArray(v)?v:[],null!=(a=null==y?void 0:y.paths)?a:Array.isArray(y)?y:[],c).map(t=>_e(t)).join("");else if(Ue.has(m))g=We(Ce(v||[0,0,0,1],y||[0,0,0,1],c)),m=t;else if("stroke-dasharray"===m)g=Ne(v||[],y||[],c).join(" "),m=t;else if("transform"!==m||null===v||"object"!=typeof v||Array.isArray(v))"translate"===m?(g="translate("+Ne(v||[0,0],y||[0,0],c).join(",")+")",m="transform"):"rotate"===m?(g="rotate("+Ee(+(v||0),+(y||0),c)+")",m="transform"):"scale"===m?(g="scale("+Ne(v||[1,1],y||[1,1],c).join(",")+")",m="transform"):g=Ee(+(v||0),+(y||0),c);else{const t=new Set([...v?Object.keys(v):[],...y?Object.keys(y):[]]),n={};for(const e of t){const t=null==v?void 0:v[e],r=null==y?void 0:y[e];if("rotate"===e||"skew"===e)n[e]=Ee(+(null!=t?t:0),+(null!=r?r:0),c);else if("translate"===e||"scale"===e||"origin"===e){const o="scale"===e?[1,1]:[0,0],i=Ne(t||o,r||o,c);n[e]=i}}if(bn(e)){const t=v.translate,r=y.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=function(t,e,n,r,o,i){const a=An(t,e,n,r),s=0===a.totalArc?o:function(t,e){const n=e*t.ds[t.ds.length-1],{ts:r,ds:o}=t,i=o.length-1;if(n<=0)return r[0];if(n>=o[i])return r[i];let a=1,s=i;for(;a<s;){const t=a+s>>>1;o[t]<n?a=t+1:s=t}const l=o[s-1],u=o[s]-l,c=u>0?(n-l)/u:0;return r[s-1]+c*(r[s]-r[s-1])}(a.lut,o),l=$e(a.P0,a.P1,a.P2,a.P3,s);if(!i)return{translate:l};const u=en(a.P0,a.P1,a.P2,a.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}(l,u,[+t[0],+t[1]],[+r[0],+r[1]],c,!!e.autoOrient);n.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(n.rotate=o.rotateDeg)}}g=Ge(n,{withUnits:!1}),m="transform"}return qe.has(m)&&"number"==typeof g&&(g=100*g+"%"),{k:m,v:null===g?"":""+g}}function rr(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=nr(r,o,e);t&&(n[t.k]=t.v)}return n}var or=48,ir=/[MmLlHhVvCcSsQqTtAaZz]/;function ar(t,e,n){return{P1:[t[0]+2/3*(e[0]-t[0]),t[1]+2/3*(e[1]-t[1])],P2:[n[0]+2/3*(e[0]-n[0]),n[1]+2/3*(e[1]-n[1])]}}function sr(t){const e=function(t){const e=function(t){const e=[],n=/([MmLlHhVvCcSsQqTtAaZz])|(-?\d*\.?\d+(?:[eE][-+]?\d+)?)/g;let r;for(;null!==(r=n.exec(t));)e.push(r[0]);return e}(t),n=[];let r=0,o=0,i=0,a=0,s=0,l=0,u=0,c=0,f=0,d="";const h=()=>parseFloat(e[r++]),p=(t,e,r)=>{const a=[o,i],s=rn(a,t,e,r,or);n.push({P0:a,P1:t,P2:e,P3:r,lut:s,len:s.ds[s.ds.length-1]}),o=r[0],i=r[1]},m=(t,e)=>{p([o+(t-o)/3,i+(e-i)/3],[o+2*(t-o)/3,i+2*(e-i)/3],[t,e])};for(;r<e.length;){let t=e[r];ir.test(t)?r++:t="M"===d?"L":"m"===d?"l":d;const n=t>="a",g=t.toUpperCase();if("Z"!==g){if("M"===g){const e=h()+(n?o:0),r=h()+(n?i:0);o=e,i=r,a=e,s=r,d=t;continue}if("L"===g)m(h()+(n?o:0),h()+(n?i:0));else if("H"===g)m(h()+(n?o:0),i);else if("V"===g)m(o,h()+(n?i:0));else if("C"===g){const t=[h()+(n?o:0),h()+(n?i:0)],e=[h()+(n?o:0),h()+(n?i:0)],r=[h()+(n?o:0),h()+(n?i:0)];l=e[0],u=e[1],p(t,e,r)}else if("S"===g){const t="C"===d.toUpperCase()||"S"===d.toUpperCase()?[2*o-l,2*i-u]:[o,i],e=[h()+(n?o:0),h()+(n?i:0)],r=[h()+(n?o:0),h()+(n?i:0)];l=e[0],u=e[1],p(t,e,r)}else if("Q"===g){const t=[h()+(n?o:0),h()+(n?i:0)],e=[h()+(n?o:0),h()+(n?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=ar([o,i],t,e);p(r,a,e)}else if("T"===g){const t="Q"===d.toUpperCase()||"T"===d.toUpperCase()?[2*o-c,2*i-f]:[o,i],e=[h()+(n?o:0),h()+(n?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=ar([o,i],t,e);p(r,a,e)}else{if("A"!==g){r++;continue}r+=5,m(h()+(n?o:0),h()+(n?i:0))}d=t}else m(a,s),o=a,i=s,d=t}return n.length?n:null}(t);if(!e)return null;const n=new Float64Array(e.length+1);for(let t=0;t<e.length;t++)n[t+1]=n[t]+e[t].len;const r=n[e.length],o=e[0].P0,i=e[e.length-1].P3,a=Math.hypot(i[0]-o[0],i[1]-o[1])<.001,s=t=>{let r=0;for(;r<e.length-1&&t>n[r+1];)r++;const o=e[r],i=t-n[r],a=o.len>0?function(t,e){const{ts:n,ds:r}=t,o=r.length-1;if(e<=0)return n[0];if(e>=r[o])return n[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;r[t]<e?i=t+1:a=t}const s=r[a-1],l=r[a]-s,u=l>0?(e-s)/l:0;return n[a-1]+u*(n[a]-n[a-1])}(o.lut,i):0,[s,l]=$e(o.P0,o.P1,o.P2,o.P3,a),[u,c]=en(o.P0,o.P1,o.P2,o.P3,a);return{x:s,y:l,angle:Math.atan2(c,u)}};return{totalLength:r,closed:a,sampleAtDistance(t){if(a&&r>0&&(t<0||t>r))return s((t%r+r)%r);if(!a&&(t<0||t>r)){const e=t<0?0:r,n=s(e),o=t-e;return{x:n.x+Math.cos(n.angle)*o,y:n.y+Math.sin(n.angle)*o,angle:n.angle}}return s((n=r,(e=t)<0?0:e>n?n:e));var e,n}}}function lr(t,e,n){const r={};return"translate"===t?r.translate=e:"rotate"===t?r.rotate=e:"skew"===t?r.skew=e:r.scale=e,n&&"translate"!==t&&(r.origin=n),r}function ur(t){var e,n;if(void 0===t)return{kind:"absent"};if(Array.isArray(t))return{kind:"static",value:t};if("object"==typeof t){const r=t,o=r.keyframes;if(o){const t={kind:"animated",keyframes:o.map(fr),autoOrient:r.autoOrient,loop:r.loop},n=null!=(e=r.value)?e:r.v;return void 0!==n&&"animated"===t.kind&&(t.base=n),t}const i=null!=(n=r.value)?n:r.v;if(void 0!==i)return{kind:"static",value:i}}return{kind:"static",value:t}}function cr(t,e,n,r){var o,i,a,s;const l=t=>(null==r?void 0:r.asString)&&null!=t?String(t):t;if("absent"===n.kind)return;if("static"===n.kind)return void(t[e]=l(n.value));const u=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,c=A({},u||{}),f={keyframes:n.keyframes};void 0!==n.loop&&(f.loop=n.loop),void 0!==n.autoOrient&&(f.autoOrient=n.autoOrient),c[e]=f,t.animate=c;const d=null!=(s=null!=(i=n.base)?i:null==(o=n.keyframes[0])?void 0:o.value)?s:null==(a=n.keyframes[0])?void 0:a.v;void 0!==d&&(t[e]=l(d))}function fr(t){if(!t||"object"!=typeof t)return t;const e=t;if(void 0===e.t&&void 0===e.v&&void 0===e.e&&void 0===e.to&&void 0===e.ti)return t;const n=A({},e);return void 0===n.time&&void 0!==e.t&&(n.time=e.t),void 0===n.value&&void 0!==e.v&&(n.value=e.v),void 0===n.easing&&void 0!==e.e&&(n.easing=e.e),void 0===n.tangentOut&&void 0!==e.to&&(n.tangentOut=e.to),void 0===n.tangentIn&&void 0!==e.ti&&(n.tangentIn=e.ti),n}function dr(t,e){const n={value:e};return void 0!==t.time&&(n.time=t.time),void 0!==t.easing&&(n.easing=t.easing),void 0!==t.tangentOut&&(n.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(n.tangentIn=t.tangentIn),n}function hr(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(hr);const e={};for(const n of Object.keys(t))e[n]=hr(t[n]);return e}function pr(t,e){const n=new Map,r=t=>{var o;if("string"==typeof t.id){const r=e();n.set(t.id,r),t.id=r}null==(o=t.children)||o.forEach(r)};r(t);const o=t=>t.replace(/url\(#([^)]+)\)/g,(t,e)=>{const r=n.get(e);return r?"url(#"+r+")":t}),i=t=>{var e;if("string"==typeof t.href&&t.href.startsWith("#")){const e=n.get(t.href.slice(1));e&&(t.href="#"+e)}for(const e of Object.keys(t)){if("children"===e||"effects"===e||"meta"===e||"animate"===e||"href"===e||"id"===e)continue;const n=t[e];"string"==typeof n&&-1!==n.indexOf("url(#")&&(t[e]=o(n))}null==(e=t.children)||e.forEach(i)};return i(t),n}function mr(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function gr(t){var e;const n=mr(t.x),r=mr(t.y);if(delete t.x,delete t.y,!n&&!r)return t;const o="translate("+n+","+r+")";if(void 0!==t.transform||void 0!==t.animate){const n={type:"g",transform:o,children:null!=(e=t.children)?e:[]};t.children=[n]}else t.transform=o;return t}function vr(t,e){return"_lw_"+e+"_"+t.nextId++}function yr(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function br(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>br(t,e))}var kr=hr,Ar=.15;function wr(t){const e=ur(t);if("static"===e.kind&&"number"==typeof e.value)return{min:e.value,max:e.value};if("animated"===e.kind&&e.keyframes.length){const t=e.keyframes.map(t=>Number(t.value)||0);return{min:Math.min(...t),max:Math.max(...t)}}return{min:0,max:0}}function xr(t){let e=0,n=16;const r=t=>{var o;const i=parseFloat(String(null!=(o=t.fontSize)?o:""))||0;i&&(n=Math.max(n,i));const a=t.textContent;if("string"==typeof a&&(e+=a.length),t.children)for(const e of t.children)r(e)};return r(t),e*n}var jr=t=>Math.round(1e3*t)/1e3;function Or(t,e,n){null!=n&&cr(t,e,ur(n),{asString:!0})}var Sr=(t,e,n)=>{const r={type:t};for(const t in e)void 0!==e[t]&&(r[t]=e[t]);const o=Array.isArray(n)?n.filter(t=>null!=t):null!=n?[n]:[];return o.length&&(r.children=o),r};function Pr(t,e){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function Mr(t,e){let n="";for(let r=0;r<t.length;r++){const o=Pr(t[r],e);r>0&&45!==o.charCodeAt(0)&&(n+=" "),n+=o}return n}function _r(t,e,n){return[t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}var Er=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function Nr(t,e,n=2){const r=[];let o;for(Er.lastIndex=0;null!==(o=Er.exec(t));)r.push(o[0]);let i="",a=0;const s=()=>parseFloat(r[a++]);for(;a<r.length;){const t=r[a++];if("M"===t||"L"===t){const[r,o]=_r(e,s(),s());i+=t+Mr([r,o],n)}else if("C"===t){const[t,r]=_r(e,s(),s()),[o,a]=_r(e,s(),s()),[l,u]=_r(e,s(),s());i+="C"+Mr([t,r,o,a,l,u],n)}else if("Q"===t){const[t,r]=_r(e,s(),s()),[o,a]=_r(e,s(),s());i+="Q"+Mr([t,r,o,a],n)}else"Z"!==t&&"z"!==t||(i+="Z")}return i}var Cr=16,Tr=["fontFamily","fontSize","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","textDecoration","textTransform","whiteSpace","x","y","dx","dy","lengthAdjust","fill","stroke","strokeWidth","effects",ht,"xml:space"],zr=["fillOpacity","fillRule","strokeOpacity","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","mixBlendMode","filter"],Fr=["fill","stroke","strokeWidth","opacity","fillOpacity","strokeOpacity","strokeDasharray","strokeDashoffset"];function Dr(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?void 0:e}}function Ir(t){return"string"==typeof t?t:void 0}function Rr(t){const e=t.animate;if(!e||"object"!=typeof e)return;let n;for(const t of Fr)void 0!==e[t]&&((null!=n?n:n={})[t]=e[t]);return n}function Lr(t,e){var n,r,o,i,a,s,l,u,c,f;const d="text"===t.type,h=t.style,p=e=>{var n;return d?void 0:null!=(n=t[e])?n:null==h?void 0:h[e]},m={fontFamily:null!=(n=Ir(t.fontFamily))?n:e.fontFamily,fontSize:null!=(r=Dr(t.fontSize))?r:e.fontSize,fill:null!=(o=t.fill)?o:e.fill,stroke:null!=(i=t.stroke)?i:e.stroke,strokeWidth:null!=(a=t.strokeWidth)?a:e.strokeWidth,letterSpacing:null!=(s=Dr(t.letterSpacing))?s:e.letterSpacing,wordSpacing:null!=(l=Dr(t.wordSpacing))?l:e.wordSpacing,opacity:null!=(u=Dr(p("opacity")))?u:e.opacity,animate:null!=(c=d?void 0:Rr(t))?c:e.animate};for(const t of zr){const n=null!=(f=p(t))?f:e[t];void 0!==n&&(m[t]=n)}return m}function Wr(t){var e,n,r;return{fontFamily:Ir(t.fontFamily),fontSize:null!=(e=Dr(t.fontSize))?e:Cr,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(n=Dr(t.letterSpacing))?n:0,wordSpacing:null!=(r=Dr(t.wordSpacing))?r:0}}function Br(t){const e={};void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),void 0!==t.opacity&&1!==t.opacity&&(e.opacity=t.opacity);for(const n of zr)void 0!==t[n]&&(e[n]=t[n]);return void 0!==t.animate&&(e.animate=t.animate),e}function Ur(t,e,n,r){var o;const i=t.fontFamily?e[t.fontFamily]:n;return i||null==r||r.push('textGlyphs: no glyphs for font "'+(null!=(o=t.fontFamily)?o:"")+'"'),i}function Vr(t){const e=Object.keys(t);return 1===e.length?t[e[0]]:void 0}var qr=.6,Gr="px-missing-glyph";function Zr(t,e){if(t<=0||e<=0)return"";const n=.08*t,r=.92*t,o=.92*-e,i=r-n,a=-o,s=Math.max(1,.12*Math.min(i,a)),l="M"+n+" 0L"+r+" 0L"+r+" "+o+"L"+n+" "+o+"Z";if(i<=2*s||a<=2*s)return l;const u=n+s,c=r-s,f=-s,d=o+s;return l+"M"+u+" "+f+"L"+u+" "+d+"L"+c+" "+d+"L"+c+" "+f+"Z"}function Kr(t,e,n,r,o=0){const{x:i,y:a,angle:s}=t.sampleAtDistance(e),l=Math.cos(s),u=Math.sin(s),c=r/2;return[n*l,n*u,-n*u,n*l,i-n*l*c-o*u,a-n*u*c+o*l]}function Hr(t){var e;const n=ur(t);if("animated"===n.kind&&n.keyframes.length>=2){const t=[...n.keyframes].sort((t,e)=>(Number(t.time)||0)-(Number(e.time)||0)),e=t.map(t=>Number(t.time)||0),r=t.map(t=>Number(t.value)||0);return{animated:!0,times:e,loop:n.loop,at(t){if(t<=e[0])return r[0];for(let n=1;n<e.length;n++)if(t<=e[n]){const o=e[n]-e[n-1],i=o>0?(t-e[n-1])/o:1;return r[n-1]+i*(r[n]-r[n-1])}return r[r.length-1]}}}const r="animated"===n.kind?Number(null==(e=n.keyframes[0])?void 0:e.value)||0:"static"===n.kind&&Number(n.value)||0;return{animated:!1,times:[],at:()=>r}}var Jr=48,Xr=64;function Qr(t,e){const n=b(10,e);return Math.round(t*n)/n}function Yr(t){const e={};void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(e.opacity=t.opacity);for(const n of zr)void 0!==t[n]&&(e[n]=t[n]);return e}function $r(t){return t?{[pt]:Gr}:{}}function to(t,e,n){if(!t.length)return null==n||n.push("textGlyphs: nothing to render"),[];const r=new Map;for(const e of t){const t=JSON.stringify([e.paint,!!e.isMissing]),n=Nr(e.glyphD,e.m),o=r.get(t);o?o.d+=n:r.set(t,{paint:e.paint,d:n,isMissing:e.isMissing})}const o=[];for(const{paint:t,d:n,isMissing:i}of r.values())o.push(e("path",A(A(A({d:n},Yr(t)),$r(i)),void 0!==t.animate?{animate:A({},t.animate)}:{}),[]));return o}function eo(t,e,n){const r={};for(const e of Object.keys(t))"type"!==e&&"children"!==e&&-1===Tr.indexOf(e)&&(r[e]=t[e]);if(r.style&&"object"==typeof r.style){const t=A({},r.style);delete t["white-space"],Object.keys(t).length?r.style=t:delete r.style}return n("g",r,e)}var no={document:"document",host:"host",platform:"platform",usage:"usage",internal:"internal"},ro="https://github.com/pixodesk/pixodesk-svg-animator/blob/main/docs/diagnostics.md";function oo(t){return"PX"+t+" "+ro+"#px"+t}function io(t,e){const n=e?e+" ":"";return{warn:(e,r,...o)=>{const i=oo(r);(null==t?void 0:t.onWarn)?t.onWarn({code:r,kind:e,data:o,message:i}):(null==t?void 0:t.muteWarn)||console.warn(n+e+" "+i,...o)},error:(e,r,...o)=>{const i=oo(r),a=function(t){return t.find(t=>t instanceof Error)}(o);(null==t?void 0:t.onError)?t.onError({code:r,kind:e,data:o,message:i,error:a}):(null==t?void 0:t.muteError)||console.error(n+e+" "+i,...o)}}}var ao=6;function so(t,e,n){if(!e)return t;delete t.transform;let r=t;return r=uo(r,e.origin,!0),r=lo(r,"scale",e.scale),r=lo(r,"skew",e.skew),r=lo(r,"rotate",e.rotate),r=uo(r,e.origin,!1),function(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}(e.translate)?(r=uo(r,e.origin,!0),r=lo(r,"translate",e.translate),r=uo(r,e.origin,!1)):r=lo(r,"translate",e.translate),r!==t&&t.id&&(r.id=t.id,delete t.id),r}function lo(t,e,n,r){if(void 0===n)return t;const o=ur(n);if("static"===o.kind)return{type:"g",transform:{value:lr(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>dr(t,lr(e,t.value,void 0)))};return o.autoOrient&&(n.autoOrient=!0),void 0!==o.loop&&(n.loop=o.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function uo(t,e,n){if(void 0===e)return t;const r=ur(e),o=t=>n?[-t[0],-t[1]]:t;if("absent"===r.kind)return t;if("static"===r.kind)return 0===r.value[0]&&0===r.value[1]?t:{type:"g",transform:{value:{translate:o(r.value)}},children:[t]};if("animated"===r.kind){const e={keyframes:r.keyframes.map(t=>dr(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function co(t,e,n){var r,o,i;if("use"===t.type&&"translate"===(null==(o=null==(r=t.effects)?void 0:r.clone)?void 0:o.without)){const r=yr(t.effects.clone.source);"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(i=t.children)||i.forEach(t=>co(t,e,n))}function fo(t){const e=/translate\(([^)]*)\)/.exec(t);if(!e)return[0,0];const n=e[1].split(/[\s,]+/).filter(Boolean).map(Number);return[n[0]||0,n[1]||0]}function ho(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||!!Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}function po(t,e,n,r){if(!e)return t;const o=vr(n,"grad"),i=function(t,e){const n={type:t.type===kt.radial?"radialGradient":"linearGradient",id:e};return t.type===kt.linear?(mo(n,"x1","y1",t.start),mo(n,"x2","y2",t.end)):(mo(n,"cx","cy",t.center),function(t,e,n){const r=ur(n);"absent"!==r.kind&&cr(t,"r",r,{asString:!0})}(n,0,t.radius),mo(n,"fx","fy",t.focal)),t.gradientUnits&&(n.gradientUnits=t.gradientUnits),t.spreadMethod&&(n.spreadMethod=t.spreadMethod),t.gradientTransform&&(n.gradientTransform=t.gradientTransform),n.children=function(t){var e,n;if(!t)return[];const r=ur(t);if("absent"===r.kind)return[];if("static"===r.kind)return Array.isArray(r.value)?r.value.map(go):[];const o=r.keyframes;if(!o.length)return[];const i=r.loop;let a=0;for(const t of o){const e=_t(t);Array.isArray(e)&&e.length>a&&(a=e.length)}if(!a)return[];const s=_t(o[0]),l=[];for(let t=0;t<a;t++){const r=null!=(n=null!=(e=null==s?void 0:s[t])?e:vo(o,0,t))?n:{offset:t/Math.max(1,a-1),color:"#000000"};l.push({offset:r.offset,color:r.color})}return l.map((t,e)=>function(t,e,n,r,o){var i;const a=[],s=[];let l=!1;for(const r of e){const o=Mt(r),u=_t(r),c=null!=(i=null==u?void 0:u[n])?i:vo(e,e.indexOf(r),n);if(!c)continue;const f=Et(r),d={time:o,value:c.color};void 0!==f&&(d.easing=f),a.push(d);const h={time:o,value:c.offset};void 0!==f&&(h.easing=f),s.push(h),c.offset!==t.offset&&(l=!0)}const u={type:"stop",offset:yo(t.offset),stopColor:t.color},c={};return a.length&&(c.stopColor={keyframes:a},void 0!==o&&(c.stopColor.loop=o)),l&&s.length&&(c.offset={keyframes:s},void 0!==o&&(c.offset.loop=o)),Object.keys(c).length&&(u.animate=c),u}(t,o,e,0,i))}(t.stops),n}(e,o);return n.defs.push(i),t[r]="url(#"+o+")",t}function mo(t,e,n,r){var o,i,a;const s=ur(r);if("absent"===s.kind)return;if("static"===s.kind)return t[e]=String(s.value[0]),void(t[n]=String(s.value[1]));const l=t=>{const e={keyframes:s.keyframes.map(e=>{const n={time:e.time,value:Array.isArray(e.value)?e.value[t]:void 0};return void 0!==e.easing&&(n.easing=e.easing),n})};return void 0!==s.loop&&(e.loop=s.loop),e},u=null!=(o=t.animate)?o:{};u[e]=l(0),u[n]=l(1),t.animate=u;const c=null!=(a=s.base)?a:null==(i=s.keyframes[0])?void 0:i.value;Array.isArray(c)&&(t[e]=String(c[0]),t[n]=String(c[1]))}function go(t){return{type:"stop",offset:yo(t.offset),stopColor:t.color}}function vo(t,e,n){for(let r=e;r>=0;r--){const e=_t(t[r]);if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=_t(t[r]);if(null==e?void 0:e[n])return e[n]}}function yo(t){return Math.round(1e3*t)/10+"%"}function bo(t){return"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.pathData?t.pathData:void 0}function ko(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=ur(t);if("absent"!==r.kind)return"static"===r.kind?r.value:(e.warnings.push("transformBy.origin: animated origin approximated by its first keyframe"),null==(n=r.keyframes[0])?void 0:n.value)}(e.origin,n);let o=t;return o=Ao(o,"translate",e.translate,void 0),o=Ao(o,"rotate",e.rotate,r),o=Ao(o,"scale",e.scale,r),o}function Ao(t,e,n,r,o){if(void 0===n)return t;const i=ur("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);if("static"===i.kind)return{type:"g",transform:{value:lr(e,wo(e,i.value),r)},children:[t]};if("animated"===i.kind){const n={keyframes:i.keyframes.map(t=>{const n=dr(t,lr(e,wo(e,t.value),r));return"translate"===e?A(A({},n),xo(t)):n})};return void 0!==i.loop&&(n.loop=i.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function wo(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function xo(t){var e,n;const r={},o=null!=(e=t.tangentOut)?e:t.to,i=null!=(n=t.tangentIn)?n:t.ti;return Array.isArray(o)&&(r.tangentOut=[-o[0],-o[1]]),Array.isArray(i)&&(r.tangentIn=[-i[0],-i[1]]),r}function jo(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function Oo(t){let e=0,n=0;for(const r of t)r.translate&&(e+=r.translate[0],n+=r.translate[1]);return[e,n]}function So(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=Po(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function Po(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function Mo(t,e){var n,r,o;const i=t.transform,a=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate.transform:void 0;if(void 0===i&&!a)return;const s={};if("string"==typeof i){const t=function(t,e){const n=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,i=0,a=!1,s=!1;for(;null!==(r=n.exec(t));){const t=r[1],e=r[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);"translate"===t?(o+=e[0]||0,i+=e[1]||0,a=!0):s=!0}return s&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t),a?[o,i]:void 0}(i,e);t&&(s.translate=t)}else if(i&&"object"==typeof i&&!i.keyframes){const t=i.value,n=t&&"object"==typeof t?t:i;n&&"object"==typeof n&&Array.isArray(n.translate)&&(s.translate=[n.translate[0]||0,n.translate[1]||0]),!n||void 0===n.rotate&&void 0===n.scale&&void 0===n.skew||e.warnings.push("maskedBy ancestor: non-translate transform parts ignored (rotate/scale not yet supported)")}if(a&&Array.isArray(a.keyframes)){const t=a.keyframes,i=[];for(const a of t){const t=null!=(n=a.value)?n:a.v,s=null!=(o=null!=(r=a.time)?r:a.t)?o:0;t&&"object"==typeof t&&Array.isArray(t.translate)&&(i.push({time:s,value:[t.translate[0]||0,t.translate[1]||0]}),void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: animated non-translate parts ignored"))}i.length&&(s.translateKeyframes=i)}return s.translate||s.translateKeyframes?s:void 0}function _o(t,e,n){if(!e)return;const r=yr(e.source);if(!r)return void(e.without===ft.translate&&n.errors.push("clone: content ref missing `source`"));const o=e.without===ft.translate&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function Eo(t,e){const n={};return void 0!==t.translate&&(n.translate=No(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=No(t.rotate,t=>t*e)),void 0!==t.skew&&(n.skew=No(t.skew,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){return No(t,t=>[Math.pow(t[0],e),Math.pow(t[1],e)],!0)}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function No(t,e,n=!1){const r=ur(t);if("absent"===r.kind)return t;if("static"===r.kind){const o=e(r.value);return"number"!=typeof t&&!Array.isArray(t)||n?{value:o}:o}const o={keyframes:r.keyframes.map(t=>t&&void 0!==t.value?w(A({},t),{value:e(t.value)}):t)};return void 0!==r.loop&&(o.loop=r.loop),void 0!==r.autoOrient&&(o.autoOrient=r.autoOrient),void 0!==r.base&&(o.value=e(r.base)),o}var Co=!1;function To(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}var zo=1;function Fo(t,e,n){const[r,o]=e;if(!Number.isFinite(r)||!Number.isFinite(o))return void n.warnings.push("retime: timeCrop is not a pair of finite numbers — ignored");const i=o<=r?[{time:0,value:0}]:[...r>0?[{time:Math.max(0,r-zo),value:0}]:[],{time:Math.max(0,r),value:1},{time:o,value:1},{time:o+zo,value:0}],a=A({},t);for(const e of Object.keys(t))delete t[e];t.type="g",t.children=[a],t.animate={opacity:{keyframes:i}}}function Do(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function Io(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function Ro(t){var e;const n=null==(e=t.effects)?void 0:e.clone;n&&(delete n.retime,0===Object.keys(n).length&&delete t.effects.clone,t.effects&&0===Object.keys(t.effects).length&&delete t.effects)}function Lo(t,e,n){const r=yr(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=Wo(r,e,n,new Set);if(o)if(Co){const e=n.idMap.get(o);t.type="g",delete t.href,t.children=[e],gr(t),n.defs=n.defs.filter(t=>t!==e)}else t.href="#"+o}function Wo(t,e,n,r){if(r.has(t))return void n.errors.push('retime: loop via "'+t+'"');const o=n.idMap.get(t);if(!o)return void n.warnings.push('retime: target "'+t+'" not found');const i=kr(o);if(function(t,e){pr(t,()=>vr(e,"retimed"))}(i,n),"use"===o.type?Uo(i,e.start,e.stretch):Bo(i,e.start,e.stretch),Ro(i),"use"===o.type&&o.href){const a=yr(o.href);if(a){const s=Io(o),l=s?Do(To(s),e):e,u=new Set(r);u.add(t);const c=Wo(a,l,n,u);c&&(i.href="#"+c)}}else!function(t,e,n,r,o){const i=t=>{var a;const s=Io(t);if("use"===t.type&&s&&t.href){const i=yr(t.href);if(i){const a=Do(To(s),e),l=new Set(r);l.add(o);const u=Wo(i,a,n,l);u&&(t.href="#"+u)}Ro(t)}null==(a=t.children)||a.forEach(i)};i(t)}(i,e,n,r,t);return n.defs.push(i),"string"==typeof i.id&&n.idMap.set(i.id,i),"string"==typeof i.id?i.id:void 0}function Bo(t,e,n){var r;Uo(t,e,n),null==(r=t.children)||r.forEach(t=>Bo(t,e,n))}function Uo(t,e,n){const r=t=>{for(const r of t)"number"==typeof r.time&&(r.time=e+r.time*n)};if(t.transform&&"object"==typeof t.transform&&Array.isArray(t.transform.keyframes)&&r(t.transform.keyframes),t.animate&&"object"==typeof t.animate)for(const e of Object.keys(t.animate)){const n=t.animate[e];n&&Array.isArray(n.keyframes)&&r(n.keyframes)}}function Vo(t,e){const n=w(A({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function qo(t,e,n,r,o,i,a,s){const l=Zo(r,n,o),u=Ko(n,o),c=Jo(i,l),f=Jo(a,u),d=Yo(a),h={type:"path",d:_e(e)};return Xo(h,"strokeDasharray",f),Xo(h,"strokeDashoffset",c),Xo(h,"strokeOpacity",d),[h]}var Go=1;function Zo(t,e,n){const[r]=Ho(n);return n=>e*(-n-r+t)+Go}function Ko(t,e){const[n,r]=Ho(e),o=r-n+1;return e=>{const n=Ye(e[0],0,1),r=Ye(e[1],0,1),i=Math.min(n,r),a=Math.max(n,r),s=[0];let l=Go;for(let e=0;e<o;e++)s.push(l+i*t),s.push((a-i)*t),l=(1-a)*t;return s.push(l+Go),s}}function Ho(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function Jo(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>({time:Mt(t),value:e(_t(t)),easing:Et(t)})),loop:t.loop}}function Xo(t,e,n){n&&cr(t,e,n)}var Qo=10;function Yo(t){const e=t=>t[0]===t[1];if("absent"===t.kind)return;if("static"===t.kind)return e(t.value)?{kind:"static",value:0}:void 0;const n=t.keyframes;let r=!1,o=!0;for(const t of n)e(_t(t))?r=!0:o=!1;if(!r)return;if(o)return{kind:"static",value:0};const i=[];for(let t=0;t<n.length;t++){const r=n[t],o=t>0?n[t-1]:void 0,a=t<n.length-1?n[t+1]:void 0,s=Mt(r),l=e(_t(r)),u=o?l&&e(_t(o)):l,c=a?l&&e(_t(a)):l;u&&!c?(i.push({time:s,value:0}),i.push({time:s+Qo,value:1})):!u&&c&&(i.push({time:s-Qo,value:1}),i.push({time:s,value:0}))}return i.length<=1?void 0:{kind:"animated",keyframes:i}}function $o(t,e){const n=n=>{const r=(n-t.time)/(e.time-t.time),o=t.value[0]+(e.value[0]-t.value[0])*r;return t.value[1]+(e.value[1]-t.value[1])*r-o};let r=t.time,o=e.time,i=n(r);if(0===i)return r;const a=n(o);if(0===a)return o;if(i*a>0)return null;for(let t=0;t<100;t++){const t=(r+o)/2,e=n(t);if(0===e||Math.abs(o-r)<1e-4)return t;i*e<0?o=t:(r=t,i=e)}return(r+o)/2}function ti(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function ei(t){const e=t.v;if(!e||e.length<2)return 0;let n=0;for(let r=0;r<e.length-1;r++)n+=ni(t,r,r+1);return t.c&&e.length>1&&(n+=ni(t,e.length-1,0)),n}function ni(t,e,n){var r,o,i,a;const s=t.v,l=s[e],u=s[n],c=rn(l,null!=(o=null==(r=t.o)?void 0:r[e])?o:l,null!=(a=null==(i=t.i)?void 0:i[n])?a:u,u);return c.ds[c.ds.length-1]}var ri=.5522847498307936;function oi(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:ot(null==(e=At(t))?void 0:e.engine),glyphs:null==(n=jt(t))?void 0:n.fonts},o=kr(t);br(o,r.idMap),co(o,r,()=>vr(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const a=yr(null==(i=null==(o=t.effects)?void 0:o.maskedBy)?void 0:i.source);if("string"==typeof a){n.add(t);const r=e.idMap.get(a);r&&n.add(r)}if(Array.isArray(t.children))for(const e of t.children)r(e)};if(r(t),0===n.size)return;const o=(t,r)=>{if(n.has(t)&&e.maskAncestorChains.set(t,r),Array.isArray(t.children)){const n=Mo(t,e),i=n?[...r,n]:r;for(const e of t.children)o(e,i)}};o(t,[])}(o,r);const i=function(t,e){return function(t,e){e.idMap.clear(),br(t,e.idMap);const n=[],r=t=>{var e;Io(t)&&n.push(t),null==(e=t.children)||e.forEach(r)};r(t);const o=new Map;for(const t of n){let n=0;const r=new Set,i=o=>{var a;if(o){if(o!==t&&Io(o)&&n++,"use"===o.type&&o.href){const t=yr(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(a=o.children)||a.forEach(i)}},a=yr(t.href);a&&(r.add(a),i(e.idMap.get(a))),o.set(t,n)}n.sort((t,e)=>{var n,r;return(null!=(n=o.get(e))?n:0)-(null!=(r=o.get(t))?r:0)});for(const t of n){const n=Io(t);if(!n)continue;const r=n.timeCrop;Ro(t),Lo(t,To(n),e),r&&Fo(t,r,e)}}(t,e),t}(ii(o,r),r);return function(t,e){e.length&&(t.children||(t.children=[])).unshift({type:"defs",children:e})}(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function ii(t,e){t.children&&(t.children=t.children.map(t=>ii(t,e)));const n=t.effects,r="string"==typeof t.id?t.id:void 0,o=r?e.contentRefInnerIds.get(r):void 0;if(!n&&!o)return t;const{transformBy:i,repeater:a,maskedBy:s,clipPath:l,strokeTrim:u,clone:c,fillGradient:f,strokeGradient:d,textPath:h,text:p}=null!=n?n:{};n&&delete t.effects;let m=t,g=!1;if(null==p?void 0:p.useGlyphs)if(h){const t="string"==typeof h.pathData?h.pathData:void 0,n=function(t,e,n,r,o,i){return e.glyphs?function(t,e,n,r,o,i){const{glyphs:a,create:s=Sr,warnings:l}=r,u=e?sr(e):null;if(!u)return null==l||l.push("textGlyphs: unparsable along-path geometry"),null;const c=Vr(a),{cells:f,width:d}=function(t,e,n,r){const o=[];let i=0;const a=(t,s)=>{var l,u;const c=Lr(t,s),f=Ir(t[ht]);if(f&&!(null==(l=t.children)?void 0:l.length)){const t=Ur(c,e,n,r);if(t){const e=c.fontSize/t.unitsPerEm,n=null!=(u=t.ascent)?u:.9*t.unitsPerEm,r=Br(c);for(let a=0;a<f.length;a++){const s=f.charAt(a),l=t.glyphs[s];if(l&&l.pathData){const t=l.width*e;o.push({glyphD:l.pathData,widthEm:l.width,scale:e,paint:r,midBase:i+t/2}),i+=t}else if(/\S/.test(s)){const a=l&&l.width>0?l.width:qr*t.unitsPerEm,s=a*e;o.push({glyphD:Zr(a,n),widthEm:a,scale:e,paint:r,isMissing:!0,midBase:i+s/2}),i+=s}else i+=(l?l.width:0)*e;i+=c.letterSpacing+(" "===s?c.wordSpacing:0)}}}if(t.children)for(const e of t.children)a(e,c)};return a(t,Wr(t)),{cells:o,width:i}}(t,a,c,l);if(!f.length)return eo(t,[],s);const{along:h,perp:p}=function(t){var e,n,r;return{along:(null!=(e=Dr(t.x))?e:0)+(null!=(n=Dr(t.dx))?n:0),perp:null!=(r=Dr(t.dy))?r:0}}(t),m=Hr(n),g=Hr(o),v=t=>t>0&&d>0?t/d:1,y="clip"===i&&!u.closed;if(m.animated||g.animated){const e=function(t,e){const n=[...t,...e].sort((t,e)=>t-e),r=[];for(const t of n)r.length&&t===r[r.length-1]||r.push(t);return r}(m.times,g.times),n=(t,e)=>h+m.at(e)+v(g.at(e))*t.midBase,r=m.animated?m.loop:g.loop;return eo(t,function(t,e,n,r,o,i,a,s=0){const l=Math.max(e.totalLength/Jr,.5),u=t=>t>=0&&t<=e.totalLength,c=[];for(const f of t){const t=[f.scale,0,0,f.scale,-f.scale*(f.widthEm/2),0],d=Nr(f.glyphD,t),h=(t,n)=>{const{x:r,y:o,angle:i}=e.sampleAtDistance(t),a=Math.cos(i),l=Math.sin(i);return{time:n,value:{translate:[Qr(r-s*l,3),Qr(o+s*a,3)],rotate:Qr(180*i/Math.PI,3)}}},p=[],m=[],g=(t,e)=>{p.push(h(t,e)),a&&m.push({time:e,value:u(t)?1:0})};g(n(f,r[0]),r[0]);for(let t=1;t<r.length;t++){const e=r[t-1],o=r[t],i=n(f,e),a=n(f,o),s=Math.min(Xr,Math.max(1,Math.ceil(Math.abs(a-i)/l)));for(let t=1;t<=s;t++){const r=e+t/s*(o-e);g(n(f,r),r)}}Sn(p);const v={keyframes:p};void 0!==o&&(v.loop=o);const y={transform:v};if(f.paint.animate&&Object.assign(y,f.paint.animate),a&&m.some(t=>0===t.value)){const t={keyframes:m};void 0!==o&&(t.loop=o),y.opacity=t}c.push(i("path",w(A(A({d:d},Yr(f.paint)),$r(f.isMissing)),{animate:y}),[]))}return c}(f,u,n,e,r,s,y,p),s)}const b=v(g.at(0)),k=h+m.at(0);return eo(t,to((y?f.filter(t=>{const e=k+t.midBase*b;return e>=0&&e<=u.totalLength}):f).map(t=>({glyphD:t.glyphD,paint:t.paint,isMissing:t.isMissing,m:Kr(u,k+t.midBase*b,t.scale,t.widthEm,p)})),s,l),s)}(t,n,r,{glyphs:e.glyphs,warnings:e.warnings},o,i):(e.warnings.push("textGlyphs: no definitions.fonts"),null)}(m,e,t,h.startOffset,h.textLength,h.pathOverflow);n&&(m=n,g=!0)}else m=function(t,e,n){return(null==e?void 0:e.useGlyphs)?n.glyphs?function(t,e){var n,r,o;const{glyphs:i,create:a=Sr,warnings:s}=e,l=Vr(i),u={x:null!=(n=Dr(t.x))?n:0,y:null!=(r=Dr(t.y))?r:0},c=[],f=[{start:u.x,end:u.x}];let d=0;const h=(t,e)=>{var n;const r=Ur(e,i,l,s),o=(null==r?void 0:r.unitsPerEm)||1e3,a=e.fontSize/o,h=null!=(n=null==r?void 0:r.ascent)?n:.9*o,p=Br(e);for(let n=0;n<t.length;n++){const i=t.charAt(n),s=null==r?void 0:r.glyphs[i];if(s&&s.pathData)c.push({glyphD:s.pathData,m:[a,0,0,a,u.x,u.y],paint:p,line:d,x:u.x,y:u.y,scale:a}),u.x+=s.width*a;else if(/\S/.test(i)){const t=s&&s.width>0?s.width:qr*o;c.push({glyphD:Zr(t,h),m:[a,0,0,a,u.x,u.y],paint:p,isMissing:!0,line:d,x:u.x,y:u.y,scale:a}),u.x+=t*a}else u.x+=(s?s.width:0)*a;u.x+=e.letterSpacing+(" "===i?e.wordSpacing:0),f[d].end=u.x}},p=(t,e)=>{var n,r,o;const i=Lr(t,e),a=Dr(t.x),s=Dr(t.y);void 0!==a&&(u.x=a,d=f.length,f.push({start:u.x,end:u.x})),void 0!==s&&(u.y=s),u.x+=null!=(n=Dr(t.dx))?n:0,u.y+=null!=(r=Dr(t.dy))?r:0;const l=Ir(t[ht]);if(l&&!(null==(o=t.children)?void 0:o.length)&&h(l,i),t.children)for(const e of t.children)p(e,i)},m=Wr(t);if(t.children)for(const e of t.children)p(e,m);const g=Ir(t[ht]);g&&!(null==(o=t.children)?void 0:o.length)&&h(g,m);const v=Ir(t.textAnchor);if("middle"===v||"end"===v)for(const t of c){const e=f[t.line].end-f[t.line].start,n="middle"===v?-e/2:-e;t.m=[t.scale,0,0,t.scale,t.x+n,t.y]}return eo(t,to(c,a,s),a)}(t,{glyphs:n.glyphs,warnings:n.warnings}):(n.warnings.push("textGlyphs: no definitions.fonts — left as native <text>"),t):t}(m,p,e),g=!0;return g||(m=function(t,e,n){var r;if(!e||"string"!=typeof e.pathData||!e.pathData)return t;const o=vr(n,"tpath"),{d:i,startShift:a}=function(t,e){var n;if("clip"===e.pathOverflow)return{d:t,startShift:0};const r=sr(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,i=Ar*o,a=wr(e.startOffset),s=wr(e.textLength).max||(null!=(n=e.advance)?n:0),l=Math.max(0,-a.min),u=Math.max(0,a.max+s-o),c=l>0?l+i:0,f=u>0?u+i:0;if(f<=0&&c<=0)return{d:t,startShift:0};const d=r.sampleAtDistance(0),h=r.sampleAtDistance(o);let p=t;if(c>0){const e=d.x-Math.cos(d.angle)*c,n=d.y-Math.sin(d.angle)*c,r=t.replace(/^\s*[Mm]\s*-?[\d.]+[\s,]+-?[\d.]+/,"");p="M"+jr(e)+","+jr(n)+"L"+jr(d.x)+","+jr(d.y)+r}if(f>0){const t=h.x+Math.cos(h.angle)*f,e=h.y+Math.sin(h.angle)*f;p+="L"+jr(t)+","+jr(e)}return{d:p,startShift:c}}(e.pathData,{pathOverflow:e.pathOverflow,startOffset:e.startOffset,textLength:e.textLength,advance:xr(t)});n.defs.push({type:"path",id:o,d:i});const s={type:"textPath",href:"#"+o,children:null!=(r=t.children)?r:[]};return void 0!==e.lengthAdjust&&(s.lengthAdjust=e.lengthAdjust),void 0!==e.method&&(s.method=e.method),void 0!==e.spacing&&(s.spacing=e.spacing),Or(s,"startOffset",function(t,e){if(!e||null==t)return t;const n=ur(t);if("absent"===n.kind)return t;if("static"===n.kind)return"number"==typeof t?n.value+e:{value:n.value+e};const r={keyframes:n.keyframes.map(t=>w(A({},t),{value:(Number(t.value)||0)+e}))};return void 0!==n.loop&&(r.loop=n.loop),void 0!==n.autoOrient&&(r.autoOrient=n.autoOrient),void 0!==n.base&&(r.value=n.base+e),r}(e.startOffset,a)),Or(s,"textLength",e.textLength),t.children=[s],t}(m,h,e)),m=function(t,e,n){return po(t,e,n,"fill")}(m,f,e),m=function(t,e,n){return po(t,e,n,"stroke")}(m,d,e),m=function(t,e){if(!e)return t;const n=e.subPaths===dt.combined,r=[],o=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const e of t.children)o(e);return}const e="string"==typeof t.d?t.d:function(t){var e,n,r,o,i,a,s,l,u,c;if("rect"===t.type){const i=Number(null!=(e=t.x)?e:0),a=Number(null!=(n=t.y)?n:0),s=Number(null!=(r=t.width)?r:0),l=Number(null!=(o=t.height)?o:0);return"M"+(i+s)+","+a+"L"+(i+s)+","+(a+l)+"L"+i+","+(a+l)+"L"+i+","+a+"L"+(i+s)+","+a+"z"}if("ellipse"===t.type||"circle"===t.type){const e=Number(null!=(i=t.cx)?i:0),n=Number(null!=(a=t.cy)?a:0),r="circle"===t.type?Number(null!=(s=t.r)?s:0):Number(null!=(l=t.rx)?l:0),o="circle"===t.type?Number(null!=(u=t.r)?u:0):Number(null!=(c=t.ry)?c:0);if(!(r>0&&o>0))return;const f=r*ri,d=o*ri,h=(t,e,n,r,o,i)=>"C"+t+","+e+" "+n+","+r+" "+o+","+i;return"M"+(e+r)+","+n+h(e+r,n+d,e+f,n+o,e,n+o)+h(e-f,n+o,e-r,n+d,e-r,n)+h(e-r,n-d,e-f,n-o,e,n-o)+h(e+f,n-o,e+r,n-d,e+r,n)+"z"}}(t);if(void 0===e)return;const n=Un(e);if(!n.length)return;const i={leaf:t,subpaths:[]};for(const t of n){const e=ei(t);i.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}r.push(i)};if(o(t),!r.length)return t;let i=0;const a=n?[...r].reverse():r;for(const t of a)for(const e of t.subpaths)n||(i=0),e.startOffsetPx=i,i+=e.lengthPx;const s=i;if(n&&s<.001)return t;const l=ur(e.offset),u="absent"===l.kind?{kind:"static",value:0}:l,c=function(t){const e=ur(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>({time:Mt(t),value:_t(t),easing:Et(t)}));if(!n.some(t=>t.value[0]>t.value[1]))return{kind:"animated",keyframes:n.map(t=>({time:t.time,value:t.value,easing:t.easing}))};const r=[];for(let t=1;t<n.length;t++){const e=n[t-1],o=n[t];if((e.value[1]-e.value[0])*(o.value[1]-o.value[0])<0){const t=$o(e,o);null!==t&&t>e.time&&t<o.time&&r.push(Math.round(t))}}const o=Array.from(new Set(r)).sort((t,e)=>t-e),i=[];let a=0;for(const t of n){for(;a<o.length&&o[a]<t.time;){const t=o[a++],e=ti(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}const e=t.value[0]>t.value[1]?[t.value[1],t.value[0]]:t.value;i.push({time:t.time,value:e,easing:t.easing})}for(;a<o.length;){const t=o[a++],e=ti(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:i}}(e.range),f="absent"===c.kind?{kind:"static",value:[0,1]}:c,d=function(t){if("absent"===t.kind)return[];if("static"===t.kind)return[t.value];const e=[];for(const n of t.keyframes){const t=_t(n);"number"==typeof t&&e.push(t)}return e}(u),h=[d.length?Math.min(...d):0,d.length?Math.max(...d):0];if(1===r.length&&r[0].leaf===t&&1===r[0].subpaths.length){const e=r[0],o=e.subpaths[0],i=n?s:o.lengthPx;if(i<.001)return t;const a=n?o.startOffsetPx/i:0;return function(t,e,n,r,o,i){const a=Zo(n,e,r),s=Ko(e,r),l=A({},t);return delete l.effects,Xo(l,"strokeDasharray",Jo(i,s)),Xo(l,"strokeDashoffset",Jo(o,a)),Xo(l,"strokeOpacity",Yo(i)),l}(e.leaf,i,a,h,u,f)}const p=new Map;for(const t of r){const e=[];for(const r of t.subpaths){const o=n?s:r.lengthPx;if(o<.001)continue;const i=n?r.startOffsetPx/o:0;e.push(...qo(t.leaf,r.subpath,o,i,h,u,f))}p.set(t.leaf,Vo(t.leaf,e))}const m=t=>p.get(t)||(Array.isArray(t.children)&&t.children.length>0?w(A({},t),{children:t.children.map(m)}):t);return m(t)}(m,u),m=function(t,e,n){var r,o;if(!e)return t;const i=null!=(r=e.copies)?r:1;if(i<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const a=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=kr(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate),delete l.id;const u=[l];for(let t=1;t<i;t++){const n=kr(l),r=Eo(e,t),o=r?so(n,r):n;u.push(o)}const c={type:"g",children:u};return t.id&&(c.id=t.id),void 0!==a&&(c.transform=a),void 0!==s&&(c.animate={transform:s}),c}(m,a,e),m=function(t,e,n,r){if(!e)return t;const o=yr(e.source);if(!o)return r.errors.push("maskedBy.source missing — cannot build mask"),t;const i=vr(r,"mask");let a={type:"use",href:"#"+o};if(n)a=ko(a,n,r);else if(jo(t))a=function(t,e){var n;const r=e.animate&&"object"==typeof e.animate&&!Array.isArray(e.animate)?e.animate:void 0,o=null==r?void 0:r.transform,i=o&&"object"==typeof o&&Array.isArray(o.keyframes)?o.keyframes:void 0;if(!i||!i.length)return t;const a=[],s=[],l=[];for(const t of i){const e=(null!=(n=t.value)?n:t.v)||{},r=dr(t,void 0);if(Array.isArray(e.translate)&&a.push(w(A(A({},r),xo(t)),{value:{translate:[-e.translate[0],-e.translate[1]]}})),"number"==typeof e.rotate){const t={rotate:-e.rotate};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),s.push(w(A({},r),{value:t}))}if(Array.isArray(e.scale)){const t={scale:[1/e.scale[0],1/e.scale[1]]};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),l.push(w(A({},r),{value:t}))}}const u=null==o?void 0:o.loop,c=t=>{const e={keyframes:t};return void 0!==u&&(e.loop=u),e};let f=t;return a.length&&(f={type:"g",animate:{transform:c(a)},children:[f]}),s.length&&(f={type:"g",animate:{transform:c(s)},children:[f]}),l.length&&(f={type:"g",animate:{transform:c(l)},children:[f]}),f}(a,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,i,a,s,l,u,c,f,d,h;const p=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let m;const g=[];for(;null!==(m=p.exec(t));){const t=m[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);g.push({name:m[1],args:t})}if(!g.length)return;const v=g[g.length-1];if("translate"===v.name)for(let t=g.length-2;t>=0;t--){const c=g[t];if("translate"!==c.name)continue;const f=null!=(e=c.args[0])?e:0,d=null!=(n=c.args[1])?n:0,h=null!=(r=v.args[0])?r:0,p=null!=(o=v.args[1])?o:0;if(h!==-f||p!==-d)continue;const m={};m.origin=[f,d];for(let e=0;e<t;e++)if("translate"===g[e].name){const t=null!=(i=g[e].args[0])?i:0,n=null!=(a=g[e].args[1])?a:0;m.translate=m.translate?[m.translate[0]+t,m.translate[1]+n]:[t,n]}for(let e=t+1;e<g.length-1;e++){const t=g[e];if("rotate"===t.name)m.rotate=(null!=(s=m.rotate)?s:0)+(null!=(l=t.args[0])?l:0);else if("scale"===t.name){const e=null!=(u=t.args[0])?u:1,n=t.args.length>1?t.args[1]:e;m.scale=m.scale?[m.scale[0]*e,m.scale[1]*n]:[e,n]}}return m}let y,b,k;for(const t of g)if("translate"===t.name){const e=null!=(c=t.args[0])?c:0,n=null!=(f=t.args[1])?f:0;y=y?[y[0]+e,y[1]+n]:[e,n]}else if("rotate"===t.name)b=(null!=b?b:0)+(null!=(d=t.args[0])?d:0);else if("scale"===t.name){const e=null!=(h=t.args[0])?h:1,n=t.args.length>1?t.args[1]:e;k=k?[k[0]*e,k[1]*n]:[e,n]}const A={};return y&&(A.translate=y),void 0!==b&&(A.rotate=b),k&&(A.scale=k),Object.keys(A).length?A:void 0}(t.transform);if(!e)return;const n={};return e.translate&&(n.translate=e.translate),void 0!==e.rotate&&(n.rotate=e.rotate),e.scale&&(n.scale={value:e.scale}),e.origin&&(n.origin=e.origin),Object.keys(n).length?n:void 0}if(t.transform&&"object"==typeof t.transform&&!t.transform.keyframes){const e=t.transform.value,n=e&&"object"==typeof e?e:t.transform;if(n&&"object"==typeof n){const t={};return Array.isArray(n.translate)&&(t.translate=n.translate),"number"==typeof n.rotate&&(t.rotate=n.rotate),"number"==typeof n.skew&&(t.skew=n.skew),Array.isArray(n.scale)&&(t.scale={value:n.scale}),Array.isArray(n.origin)&&(t.origin=n.origin),Object.keys(t).length?t:void 0}}}(t);e&&(a=ko(a,e,r))}const s=void 0===n&&!function(t){return"string"==typeof t.transform||!(!t.transform||"object"!=typeof t.transform)||jo(t)}(t);a=function(t,e,n,r,o){const i=r.idMap.get(n),a=r.maskAncestorChains.get(e)||[],s=o?Mo(e,r):void 0,l=s?[...a,s]:a,u=i&&r.maskAncestorChains.get(i)||[];if(!l.length&&!u.length)return t;const c=new Set;for(const t of l)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);for(const t of u)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);if(!(c.size>0)){const e=Oo(l),n=Oo(u),r=n[0]-e[0],o=n[1]-e[1];return 0===r&&0===o?t:{type:"g",transform:"translate("+r+","+o+")",children:[t]}}return{type:"g",animate:{transform:{keyframes:Array.from(c).sort((t,e)=>t-e).map(t=>{const e=So(l,t),n=So(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,o,r,s);const l={type:"mask",id:i,children:[a]};return e.maskType&&(l.maskType=e.maskType),e.maskUnits&&(l.maskUnits=e.maskUnits),e.maskContentUnits&&(l.maskContentUnits=e.maskContentUnits),void 0!==e.x&&(l.x=String(e.x)),void 0!==e.y&&(l.y=String(e.y)),void 0!==e.width&&(l.width=String(e.width)),void 0!==e.height&&(l.height=String(e.height)),r.defs.push(l),t.mask="url(#"+i+")",t}(m,s,i,e),m=function(t,e,n){if(!(null==e?void 0:e.pathData))return t;const r=vr(n,"clip"),o={type:"path"},i=ur(e.pathData);return"absent"!==i.kind&&("static"===i.kind?o.d=bo(i.value):(cr(o,"d",i),void 0!==o.d&&(o.d=bo(o.d)))),n.defs.push({type:"clipPath",id:r,children:[o]}),t.clipPath="url(#"+r+")",t}(m,l,e),o?(_o(m,c,e),m=function(t,e,n,r){const o=function(t,e){var n,r,o;const i={};let a=!1;const s=null==(n=t.animate)?void 0:n.transform;if(s&&"object"==typeof s&&Array.isArray(s.keyframes)){const e=s.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=ho(s),r={keyframes:e.map(t=>{const e=t.value||{},r={};void 0!==e.translate&&(r.translate=e.translate),n&&void 0!==e.origin&&(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),void 0!==t.tangentOut&&(o.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(o.tangentIn=t.tangentIn),o})};s.autoOrient&&(r.autoOrient=!0);const o=s.loop;void 0!==o&&(r.loop=o),i.animate={transform:r};const l=e.some(t=>{const e=t.value||{};return void 0!==e.rotate||void 0!==e.scale}),u=e.map(t=>{const e=t.value||{},r={};void 0!==e.rotate&&(r.rotate=e.rotate),void 0!==e.scale&&(r.scale=e.scale),void 0===e.origin||n&&!l||(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),o});if(u.every(t=>0===Object.keys(t.value).length))delete t.animate.transform,t.animate&&0===Object.keys(t.animate).length&&delete t.animate;else{const e={keyframes:u};void 0!==o&&(e.loop=o),t.animate.transform=e}a=!0}}const l=void 0!==(null==e?void 0:e.translate),u=a||l,c=a&&ho((null==(r=t.animate)?void 0:r.transform)||void 0)||a&&ho((null==(o=i.animate)?void 0:o.transform)||void 0);if("string"==typeof t.transform){const e=function(t){const e=[],n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);)e.push({name:r[1],full:r[0]});if(!e.length)return{rest:t||void 0};if(e.every(t=>"translate"===t.name))return{translate:e.map(t=>t.full).join("")};const o=e[0],i=e[e.length-1];if("translate"===i.name&&"translate"===o.name){const n=fo(i.full),r=fo(o.full),a=-n[0],s=-n[1],l=r[0]-a,u=r[1]-s;return 0===l&&0===u?{rest:t}:{translate:"translate("+l+","+u+")",rest:"translate("+a+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===i.name)return{rest:t};const a=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)a.push(e[s].full),s++;if(!a.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:a.join(""),rest:l||void 0}}(t.transform);u?void 0!==e.translate?e.rest?t.transform=e.rest:delete t.transform:(function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,n=[];let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(1!==n.length)return!1;if("translate"===n[0].name)return!0;if("matrix"!==n[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(n[0].full);if(!o)return!1;const i=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return i.length>=4&&1===i[0]&&0===i[1]&&0===i[2]&&1===i[3]}(t.transform)||c&&function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let n,r=0,o=!1;for(;n=e.exec(t);)r++,"matrix"===n[1]&&(o=!0);return 1===r&&o}(t.transform))&&delete t.transform:e.translate&&(i.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}else if(t.transform&&"object"==typeof t.transform&&!Array.isArray(t.transform)&&!t.transform.keyframes){const e=t.transform.value,n=!(!e||"object"!=typeof e),r=n?e:t.transform,o=t=>n?{value:t}:t;if(Array.isArray(r.translate)){const e=A({},r);delete e.translate;const n=Object.keys(e).length>0;u||(i.transform=o({translate:r.translate})),n?t.transform=o(e):delete t.transform}}return i}(t,e);"string"==typeof t.id&&delete t.id;const{outer:i,inner:a}=function(t){if(!t)return{};const e=ho(t.translate),n=void 0!==t.rotate||void 0!==t.scale,r={},o={};return void 0!==t.translate&&(r.translate=t.translate),e&&void 0!==t.origin&&(r.origin=t.origin),void 0!==t.rotate&&(o.rotate=t.rotate),void 0!==t.scale&&(o.scale=t.scale),void 0!==t.skew&&(o.skew=t.skew),void 0===t.origin||e&&!n||(o.origin=t.origin),{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(e);let s=t;s=so(s,a);let l={type:"g",id:n,children:[{type:"g",id:r,children:[s]}]};return void 0!==o.transform&&(l.transform=o.transform),void 0!==o.animate&&(l.animate=o.animate),i&&(delete l.id,l=so(l,i),l.id=n),l}(m,i,r,o)):m=function(t,e,n,r){return _o(t,e,r),so(t,n)}(m,c,i,e),(null==c?void 0:c.retime)&&(t.effects={clone:{retime:c.retime}}),r&&e.idMap.set(r,m),m}function ai(t,e,n,r,o){const i=1-o,a=i*i*i,s=3*i*i*o,l=3*i*o*o,u=o*o*o;return[a*t[0]+s*e[0]+l*n[0]+u*r[0],a*t[1]+s*e[1]+l*n[1]+u*r[1]]}function si(t,e,n,r,o=64){let i=0,a=t;for(let s=1;s<=o;s++){const l=ai(t,e,n,r,s/o);i+=Math.hypot(l[0]-a[0],l[1]-a[1]),a=l}return i}var li=t=>{const e=Math.round(1e4*t)/1e4;return Object.is(e,-0)?"0":String(e)};function ui(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function ci(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function fi(t){if("string"!=typeof t)return;const e=t.trim().split(/[\s,]+/).map(Number);return e.length<4||e.some(t=>!Number.isFinite(t))?void 0:[e[0],e[1],e[2],e[3]]}function di(t,e,n,r,o,i){if("use"===t.type&&"string"==typeof t.href){const a=ci(t.href);if(a&&n.has(a)){const s=e.get(a);if(s)return function(t,e,n,r,o,i,a){var s,l,u,c;const f=hr(e);pr(f,o);const d="symbol"===f.type?fi(f.viewBox):void 0,h=null!=(l=null!=(s=ui(t.width))?s:null==d?void 0:d[2])?l:a[0],p=null!=(c=null!=(u=ui(t.height))?u:null==d?void 0:d[3])?c:a[1],m="symbol"===f.type?function(t,e,n,r,o){const i=fi(t.viewBox),a=w(A({},t),{type:"g"});if(delete a.viewBox,delete a.preserveAspectRatio,delete a.width,delete a.height,!i)return a;const[s,l,u,c]=i,f=u>0&&c>0?Math.min(r/u,o/c):1,d=(r-u*f)/2,h=(o-c*f)/2,p=[];0===d&&0===h||p.push("translate("+d+","+h+")"),1!==f&&p.push("scale("+f+")"),0===s&&0===l||p.push("translate("+-s+","+-l+")"),p.length&&(a.transform=p.join(""));const m=e();return n.push({type:"clipPath",id:m,children:[{type:"rect",x:s,y:l,width:u,height:c}]}),a.clipPath="url(#"+m+")",a}(f,o,i,h,p):f,g=di(m,n,r,o,i,a),v=w(A({},t),{type:"g",children:[g]});return delete v.href,delete v.width,delete v.height,gr(v)}(t,s,e,n,r,o,i)}}if(!t.children)return t;let a=!1;const s=t.children.map(t=>{const s=di(t,e,n,r,o,i);return s!==t&&(a=!0),s});return a?w(A({},t),{children:s}):t}function hi(t,e,n){var r,o;let i=oi(t).root;return i=function(t){const e=t=>{var n;let r=t;const o=t.animate,i=null==o?void 0:o.transform;if(i){const e=function(t){var e,n,r;if("offsetPath"!==t.alongPathMode)return;const o=t.keyframes;if(!o||o.length<2)return;const i=_t(o[0]),a=(null==i?void 0:i.origin)&&i.origin.length>=2?[i.origin[0],i.origin[1]]:[0,0],s=[];for(const t of o){const n=_t(t),r=null==n?void 0:n.translate;if(!r||r.length<2)return;if(Object.keys(n).some(t=>"translate"!==t&&"origin"!==t))return;const o=null!=(e=null==n?void 0:n.origin)?e:[0,0];if(o[0]!==a[0]||o[1]!==a[1])return;s.push([r[0]+a[0],r[1]+a[1]])}if(!o.some(t=>Nt(t)||Ct(t)))return;let l="M"+li(s[0][0])+","+li(s[0][1]);const u=[];for(let t=0;t<s.length-1;t++){const e=s[t],i=s[t+1],a=null!=(n=Ct(o[t]))?n:[0,0],c=null!=(r=Nt(o[t+1]))?r:[0,0],f=[e[0]+a[0],e[1]+a[1]],d=[i[0]+c[0],i[1]+c[1]];l+="C"+li(f[0])+","+li(f[1])+","+li(d[0])+","+li(d[1])+","+li(i[0])+","+li(i[1]),u.push(si(e,f,d,i))}const c=u.reduce((t,e)=>t+e,0);if(!(c>0))return;const f=[];let d=0;for(let t=0;t<o.length;t++){t>0&&(d+=u[t-1]);const e={t:Mt(o[t]),v:d/c},n=Et(o[t]);void 0!==n&&(e.e=n),f.push(e)}return{pathStr:l,distanceKfs:f,autoOrient:!!t.autoOrient,anchor:a}}(i);if(e){const n=A({},o);delete n[mt];const a={keyframes:e.distanceKfs};void 0!==i.loop&&(a.loop=i.loop),n[gt]=a;const s=t.transform;let l=s;if(s&&"object"==typeof s){const t=A({},s);delete t[yt.translate],delete t[yt.origin],l=Object.keys(t).length?t:void 0}r=w(A({},t),{animate:n,style:w(A({},t.style),{offsetPath:"path('"+e.pathStr+"')",offsetAnchor:li(e.anchor[0])+"px "+li(e.anchor[1])+"px",offsetRotate:e.autoOrient?"auto":"0deg",offsetDistance:"0%"})}),void 0!==l?r.transform=l:delete r.transform}}if(null==(n=r.children)?void 0:n.length){const t=r.children.map(e);t.some((t,e)=>t!==r.children[e])&&(r=w(A({},r),{children:t}))}return r};return e(t)}(i),i=Yn(i,null!=(o=null==(r=At(i))?void 0:r.duration)?o:Ke),e===nt.native&&(i=Rn(i,null==n?void 0:n.motionPath),i=function(t){var e;const n=function(t){const e=new Map,n=t=>{var r;"string"==typeof t.id&&e.set(t.id,t),null==(r=t.children)||r.forEach(n)};return n(t),e}(t),r=function(t,e){const n=new WeakMap,r=new Set,o=(t,r)=>{const i=n.get(t);if(void 0!==i)return i;if(r.has(t))return!1;r.add(t);let a=!1;if(t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate))for(const e in t.animate){a=!0;break}if(!a&&t.children)for(const e of t.children)if(o(e,r)){a=!0;break}if(!a&&"use"===t.type&&"string"==typeof t.href){const n=ci(t.href),i=n?e.get(n):void 0;i&&(a=o(i,r))}return r.delete(t),n.set(t,a),a};for(const[t,n]of e)o(n,new Set)&&r.add(t);return r}(0,n);if(0===r.size)return t;let o=0;const i=function(t){const e=fi(t.viewBox);if(e)return[e[2],e[3]];const n=ui(t.width),r=ui(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),a=[],s=di(t,n,r,()=>"_lw_use_mat_"+ ++o,a,i);if(0===a.length)return s;const l={type:"defs",children:a},u=[...null!=(e=s.children)?e:[],l];return w(A({},s),{children:u})}(i),i=function(t){const e=(t,n)=>{var r;n(t),null==(r=t.children)||r.forEach(t=>e(t,n))};let n=!0;for(;n;){n=!1;const r=new Set;e(t,t=>{var e;"use"===t.type&&"string"==typeof t.href&&r.add((e=t.href).startsWith("#")?e.slice(1):e)}),e(t,t=>{if(!t.children)return;let e=t.children;"defs"===t.type&&(e=e.filter(t=>!(("g"===t.type||"symbol"===t.type)&&"string"==typeof t.id&&!r.has(t.id)))),e=e.filter(t=>!("defs"===t.type&&(!t.children||0===t.children.length))),e.length!==t.children.length&&(t.children=e,n=!0)})}return t}(i)),i}var pi="setPlaybackRate: rate must be finite and non-zero";function mi(t){return Number.isFinite(t)&&0!==t}function gi(t,e){return t>0?e===1/0?t:t*(e>0?e:1):0}function vi(t,e){return Number.isNaN(t)||t<0?0:Number.isFinite(e)?t>e?e:t:Number.isFinite(t)?t:0}function yi(t,e,n){const r=gi(e,n);return r>0&&Number.isFinite(t)?t<=0?0:n===1/0?t%r/r:t>=r?1:t/r:0}function bi(t,e,n){const r=gi(e,n);return r>0&&Number.isFinite(t)?t<=0?0:t>=1?r:t*r:0}function ki(t){const e=globalThis;"function"!=typeof e.cancelAnimationFrame?e.clearTimeout(t):e.cancelAnimationFrame(t)}function Ai(t,e,n){var r;const o=At(t)||{},i=er(t,nt.js),a=o.iterations;let s=1;"number"==typeof a&&(s=a||1),"infinite"===a&&(s=1/0),s<1&&(s=1);const l=+(o.duration||Ke),u=l&&s?l*(s===1/0?1/0:s):l?(null!=s?s:1)*l:0,c=o.direction||"normal",f=null!=(r=o.fill)?r:"forwards",d="forwards"===f||"both"===f,h="backwards"===f||"both"===f;let p=null,m=!1,g=-(o.delay||0),v=0,y=1,b=!1;const k=o.frameRate,A=k&&k>0?1e3/k:0;let w=0;const x=()=>{const t=v?(Date.now()-v)*y:0;return g+t},j=()=>{let t=x();return Number.isFinite(u)&&t>u&&(t=u),t<0&&(t=0),t};function O(t){let n=function(){const e=l>0?l:1;let n=0,r=0;l>0?(t=Ye(t,0,s*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,s-1),n=Ye((t-r*e)/e,0,1)):n=t;const o=c||"normal";let i=n;return"reverse"===o?i=1-n:"alternate"===o?r%2==1&&(i=1-n):"alternate-reverse"===o&&r%2==0&&(i=1-n),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=rr(r,n*l);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}o.delay&&(o.delay<0?O(j()):h&&O(0));const S=()=>!!m&&!!e.isConnected()&&(y<0?x()>0:!(Number.isFinite(u)&&j()>=u)),P=t=>{null!==p&&(ki(p),p=null),(t||S())&&(p=function(t){const e=globalThis;return"function"==typeof e.requestAnimationFrame?e.requestAnimationFrame(t):e.setTimeout(t,16)}(()=>{p=null,(()=>{var t,r;if(!e.isConnected())return void M();const o=j(),i=x();if(i<0&&y>0)h&&O(0);else{if(y<0&&i<=0)return M(),O(0),void(b||(b=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)));if(y>0&&u&&Number.isFinite(u)&&o>=u)return M(),O(d?u:0),void(b||(b=!0,null==(r=null==n?void 0:n.onFinish)||r.call(n)));if(A>0){const t=Date.now();if(w&&t-w<A)return;w=t}O(o)}})(),P()}))},M=()=>{if(!m)return;let t=x();Number.isFinite(u)&&t>u&&(t=u),g=t,v=0,m=!1,null!==p&&(ki(p),p=null),t>=0?O(t):h&&O(0)},_={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>S(),play:()=>{var t;(()=>{if(!m){if(y>=0)Number.isFinite(u)&&g>=u&&(g=0);else if(g<=0){if(!Number.isFinite(u))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");g=u}b=!1,m=!0,v=Date.now(),P(!0)}})(),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;M(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;M(),g=0,v=0,m=!1,b=!1,O(g),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;g=Number.isFinite(u)?u:j(),v=0,m=!1,null!==p&&(ki(p),p=null),O(d?g:0),t&&!b&&(b=!0,null==(e=null==n?void 0:n.onFinish)||e.call(n))})(!0)},setPlaybackRate:t=>{if(!mi(t))return void console.warn(pi);let e=x();Number.isFinite(u)&&e>u&&(e=u),t<0!=y<0&&(b=!1),y=t,g=e,m&&(v=Date.now())},getCurrentTime:()=>j(),setCurrentTime:t=>{t=vi(t,u),g=t,m&&(v=Date.now()),(!Number.isFinite(u)||t<u)&&(b=!1),O(j())},getCurrentProgress:()=>yi(j(),l,s),setCurrentProgress:t=>{_.setCurrentTime(bi(t,l,s))},destroy:()=>{var t;_.cancel(),null==(t=null==n?void 0:n.onRemove)||t.call(n)}};return _}var wi=(t=>(t[t.buildFailed=1001]="buildFailed",t[t.invalidDocumentAtSrc=1002]="invalidDocumentAtSrc",t[t.loadFailed=1003]="loadFailed",t[t.animationBuildFailed=1004]="animationBuildFailed",t[t.effectsShape=1101]="effectsShape",t[t.timelineOverrideIgnored=1102]="timelineOverrideIgnored",t[t.blockedTag=1103]="blockedTag",t[t.unsupportedAnimatedAttrs=1104]="unsupportedAnimatedAttrs",t[t.noBindings=1105]="noBindings",t[t.unresolvedBinding=1106]="unresolvedBinding",t[t.triggersNoRoot=1201]="triggersNoRoot",t[t.noRootForSelector=1202]="noRootForSelector",t[t.noRootElement=1203]="noRootElement",t[t.noElementsForSelector=1206]="noElementsForSelector",t[t.setAttributeNoElement=1207]="setAttributeNoElement",t[t.scrollSmoothingNeedsOwnDriver=1301]="scrollSmoothingNeedsOwnDriver",t[t.scrollNativeUnavailable=1302]="scrollNativeUnavailable",t[t.scrollSubjectInvalid=1303]="scrollSubjectInvalid",t[t.scrollSubjectNoMatch=1304]="scrollSubjectNoMatch",t[t.scrollNoRootToObserve=1305]="scrollNoRootToObserve",t[t.scrollTriggerIgnored=1306]="scrollTriggerIgnored",t[t.rateRejected=1401]="rateRejected",t[t.controlPropsConflict=1501]="controlPropsConflict",t[t.rnCompileFailed=1601]="rnCompileFailed",t[t.rnRenderFailed=1602]="rnRenderFailed",t[t.rnBoundaryCaught=1603]="rnBoundaryCaught",t[t.rnUnsupported=1604]="rnUnsupported",t))(wi||{}),xi=["timelineSource","scroll","trigger","delay","iterations","direction","fill","resetOnFinish","duration","mode","frameRate"],ji=["definitions","bindings"],Oi=t=>!!t&&"object"==typeof t&&!Array.isArray(t),Si=t=>Oi(t)&&"string"==typeof t.type?t.type:"time",Pi=t=>"scroll"===t||"view"===t;function Mi(t,e){const n=Oi(t)?A({},t):{};for(const t of Object.keys(e)){const r=e[t];null!==r?Oi(r)?n[t]=Mi(n[t],r):n[t]=r:delete n[t]}return n}function _i(t,e,n){const r=Si(t),o=Oi(e)&&"string"==typeof e.type?String(e.type):r;let i;if(o!==r){const n={};if(Oi(t))for(const e of $)void 0!==t[e]&&(n[e]=t[e]);i=Mi(n,e)}else i=Mi(t,e);if(Pi(o)){for(const t of tt)void 0!==i[t]&&(n("animator.timeline."+t+": no slot on a '"+o+"' timeline — dropped"),delete i[t]);"infinite"===i.iterations&&(n("animator.timeline.iterations: 'infinite' cannot map onto a scroll range — dropped"),delete i.iterations)}return i}function Ei(t){return"scroll"===(null==t?void 0:t.timelineSource)}var Ni="cover";function Ci(t,e,n,r){var o;const[i,a]=function(t,e,n){const r=e,o=n;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:Ni,n,r);return i+("number"==typeof(null==t?void 0:t.fraction)?t.fraction:e)*(a-i)}function Ti(t,e,n){const r=null!=n?n:io(void 0,"[PxAnimator]"),o=[],i=()=>{for(const t of o.splice(0))t()},{startOn:a,outAction:s,scrollIntoViewThreshold:l}=function(t){var e,n,r;return{startOn:null!=(e=null==t?void 0:t.startOn)?e:at.startOn,outAction:null!=(n=null==t?void 0:t.outAction)?n:at.outAction,scrollIntoViewThreshold:null!=(r=null==t?void 0:t.scrollIntoViewThreshold)?r:at.scrollIntoViewThreshold}}(e),u=t.getRootElement();if(!u)return r.warn(no.host,wi.triggersNoRoot),i;let c=!1;const f=()=>{c&&(c=!1,t.setPlaybackRate(1)),t.play()},d=()=>{switch(s){case"pause":t.pause();break;case"reset":t.cancel();break;case"reverse":c=!0,t.setPlaybackRate(-1),t.play()}};switch(a){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 e=()=>{t=!0,f()},n=()=>{t&&d()};u.addEventListener("mouseenter",e),u.addEventListener("mouseleave",n),o.push(()=>{u.removeEventListener("mouseenter",e),u.removeEventListener("mouseleave",n)});break}case"click":{const e=()=>{t.isPlaying()?d():f()};u.addEventListener("click",e),o.push(()=>u.removeEventListener("click",e));break}case"scrollIntoView":{const t=t=>{var e,n;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,a=null!=(n=null==(e=t.rootBounds)?void 0:e.height)?n:1/0,s=Math.min(i,a),l=Math.min(r.height,Number.isFinite(s)?s:r.height);return l>0?o.height/l:t.intersectionRatio},e=Array.from({length:21},(t,e)=>e/20);let n=!1;const r=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&t(e)>=l?(n=!0,f()):n&&(n=!1,d())})},{threshold:e});r.observe(u),o.push(()=>r.disconnect());break}}return i}function zi(t){return"#"+t}function Fi(t,e,n,r){var o;const i=At(t)||{},a=io(n,"[PxAnimator]");if(!r)if(t.id){const e=zi(t.id);(r=document.querySelector(e))||a.warn(no.host,wi.noRootForSelector,e)}else a.warn(no.host,wi.noRootElement);const s=Ai(t,e||function(t,e){const n=new Set,r=null!=e?e:io(void 0,"[PxAnimator]");return{isConnected:()=>!t||t.isConnected,setAttribute:(e,o,i)=>{o=Qe(o);const a=zi(e),s=(null==t?void 0:t.querySelectorAll(a))||document.querySelectorAll(a);0!==s.length||n.has(a)||(n.add(a),r.warn(no.host,wi.setAttributeNoElement,a));for(let t=0;t<s.length;t++){const e=s[t],n="transform"===o&&"pattern"===e.tagName?"patternTransform":o;e.setAttribute(n,i),Ze.has(o)&&(e.style[o]=i)}}}}(r,a),n),l=f(c({},s),{getRootElement:()=>r||null});if(Ei(i))i.trigger&&a.warn(no.usage,wi.scrollTriggerIgnored);else{const t=Ti(l,null!=(o=i.trigger)?o:{},a),e=l.destroy.bind(l);l.destroy=()=>{t(),e()}}return l}function Di(t,e,n,r){let o=_t(t);const i=Et(t),a={offset:e,easing:i&&Array.isArray(i)?"cubic-bezier("+i.join(",")+")":void 0};let s,l=n;return Ue.has(n)&&Array.isArray(o)?s=We(o):"transform"!==n||null===o||"object"!=typeof o||Array.isArray(o)?Ve.has(n)?(Array.isArray(o)&&("translate"===n&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===n&&(o+="deg"),s=n+"("+o+")",l="transform"):s="d"===n?'path("'+(o&&"object"==typeof o&&Array.isArray(o.paths)?o.paths:[]).map(t=>_e(t,!0)).join("")+'")':qe.has(n)&&"number"==typeof o?100*o+"%":""+o:(s=Ge(o,{withUnits:!0}),l="transform"),CSS.supports(Qe(l),s)||r.add(l),l=He(l),a[l]=s,a}function Ii(t,e,n){var r,o,i,a,s;const l=[];for(let u=0;u<e.length;u++){const d=e[u],h=null!=(r=d.t)?r:0;if(h<0){const n=e[u+1];if(n&&(null!=(o=n.t)?o:0)>=0){const e=(0-h)/((null!=(i=n.t)?i:0)-h),r=d.e?De(d.e)(e):e,{right:o}=Re(d.e,e);l.push({t:0,v:Hn(t,d.v,n.v,r),e:o})}continue}if(h>n){const r=e[u-1];if(r&&(null!=(a=r.t)?a:0)<=n){const e=null!=(s=r.t)?s:0,o=(n-e)/(h-e),i=r.e?De(r.e)(o):o,{left:a}=Re(r.e,o);l.length>0&&(l[l.length-1]=f(c({},l[l.length-1]),{e:a})),l.push({t:n,v:Hn(t,r.v,d.v,i),e:void 0})}break}l.push(d)}return l}function Ri(t,e,n){var r;const o=new Map;for(const[i,a]of Object.entries(t)){const t=n.duration||1,s=Ii(i,a.keyframes||[],t),l=[];for(let n=0;n<s.length;n++){const o=s[n],a=Di(o,Ye((null!=(r=o.t)?r:0)/t,0,1),i,e);0===n&&(a.offset||0)>0&&l.push(f(c({},a),{offset:0})),l.push(a)}l.length>0&&(l[l.length-1].offset||0)<1&&l.push(f(c({},l[l.length-1]),{offset:1})),l.length>0&&o.set(i,l)}return o}function Li(t,e,n,r,o){var i,a;const s=At(t)||{},l=io(e,"[PxAnimator]");if(!n)if(t.id){const e=zi(t.id);(n=document.querySelector(e))||l.warn(no.host,wi.noRootForSelector,e)}else l.warn(no.host,wi.noRootElement);const u=er(t,nt.native),c=[],f=s.iterations;let d;"number"==typeof f&&(d=f),"infinite"===f&&(d=1/0);const h=new Set;let p=!1,m=!1;(null==u?void 0:u.length)||l.warn(no.document,wi.noBindings);for(const t of u||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){l.warn(no.document,wi.unresolvedBinding,t);continue}const a=zi(t.id),u=(null==n?void 0:n.querySelectorAll(a))||document.querySelectorAll(a);0===u.length&&l.warn(no.host,wi.noElementsForSelector,a);const f=Ri(r,h,s),g=s.delay&&s.delay>0?s.delay:void 0;let v;if(s.delay&&s.delay<0&&s.duration){const t=-s.delay;v=d===1/0?t%s.duration:Math.min(t,s.duration*(null!=d?d:1))}const y={duration:s.duration,delay:g,fill:null!=(i=s.fill)?i:"forwards",direction:s.direction,iterations:d};for(let t=0;t<u.length;t++){const n=u[t];for(const[,t]of f)if(t.length>0)try{const r=new KeyframeEffect(n,t,y),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==e?void 0:e.onFinish)&&(i.onfinish=()=>{var t;p||(p=!0,null==(t=e.onFinish)||t.call(e))}),(null==e?void 0:e.onRemove)&&(i.onremove=()=>{var t;m||(m=!0,null==(t=e.onRemove)||t.call(e))}),void 0!==v&&(i.currentTime=v),c.push(i)}catch(t){l.warn(no.internal,wi.animationBuildFailed,t)}}}if(!r&&h.size)return l.warn(no.platform,wi.unsupportedAnimatedAttrs,[...h].join(", ")),null;const g={isReady:()=>!0,getRootElement:()=>n||null,isPlaying:()=>{var t;return"running"===(null==(t=c[0])?void 0:t.playState)},play:()=>{var t;p=!1,c.forEach(t=>t.play()),null==(t=null==e?void 0:e.onPlay)||t.call(e)},pause:()=>{var t;c.forEach(t=>t.pause()),null==(t=null==e?void 0:e.onPause)||t.call(e)},cancel:()=>{var t;p=!1,c.forEach(t=>t.cancel()),null==(t=null==e?void 0:e.onCancel)||t.call(e)},finish:()=>{var t;for(const e of c)try{(null==(t=e.effect)?void 0:t.getTiming().iterations)===1/0?(e.effect.updateTiming({iterations:1}),e.finish(),e.effect.updateTiming({iterations:1/0})):e.finish()}catch(t){e.cancel()}},setPlaybackRate:t=>mi(t)?(c.forEach(e=>e.playbackRate=t),g):(l.warn(no.usage,wi.rateRejected),g),getCurrentTime:()=>{var t,e;const n=null!=(e=null==(t=c[0])?void 0:t.currentTime)?e:null;return null!==n?+n:null},setCurrentTime:t=>{var e;const n=function(t,e){return t>0?e===1/0?1/0:t*(e>0?e:1):0}(null!=(e=s.duration)?e:0,null!=d?d:1),r=n>0?vi(t,n):Math.max(0,t);p=!1,c.forEach(t=>{t.currentTime=r})},getCurrentProgress:()=>{var t;const e=g.getCurrentTime();return null===e?null:yi(e,null!=(t=s.duration)?t:0,null!=d?d:1)},setCurrentProgress:t=>{var e;g.setCurrentTime(bi(t,null!=(e=s.duration)?e:0,null!=d?d:1))},destroy:()=>{var t;g.cancel(),c.splice(0,c.length),m||(m=!0,null==(t=null==e?void 0:e.onRemove)||t.call(e))}};if("scroll"===s.timelineSource)s.trigger&&l.warn(no.usage,wi.scrollTriggerIgnored);else{const t=Ti(g,null!=(a=s.trigger)?a:{},l),e=g.destroy.bind(g);g.destroy=()=>{t(),e()}}return o&&c.forEach(t=>t.play()),g}function Wi(t,e,n){var r,o,i;const a="number"==typeof(null==t?void 0:t.fraction)?t.fraction:e,s=null==(o=null==(r=globalThis.CSS)?void 0:r.percent)?void 0:o.call(r,100*a);if(void 0!==s)return n?{rangeName:null!=(i=null==t?void 0:t.phase)?i:"cover",offset:s}:{offset:s}}function Bi(t,e){const n=document.body,r=document.documentElement;for(let o=t.parentElement;o;o=o.parentElement){if(o===n||o===r)return null;const t=getComputedStyle(o),i="y"===e?t.overflowY:t.overflowX;if("auto"===i||"scroll"===i||"hidden"===i||"overlay"===i)return o}return null}function Ui(){return document.scrollingElement||document.documentElement}var Vi="parent",qi="scroller";function Gi(t,e,n){var r,o;const i=null!=n?n:io(void 0,"[PxAnimator]"),a=null==e?void 0:e.trim();if(!a)return t;if(a===Vi){let e=null;for(let n=t.parentElement;n&&n!==document.body;n=n.parentElement){const t=getComputedStyle(n).position;"sticky"!==t&&"fixed"!==t||(e=n)}return null!=(o=null!=(r=null==e?void 0:e.parentElement)?r:t.parentElement)?o:t}if(a===qi)return Bi(t,"y")||Bi(t,"x")||Ui();let s=null;try{s=document.querySelector(a)}catch(e){return i.warn(no.document,wi.scrollSubjectInvalid,a),t}return s||(i.warn(no.host,wi.scrollSubjectNoMatch,a),t)}function Zi(t,e){const n=t;if(!(null==e?void 0:e.pin)||!n.style)return()=>{};const r=n.style,o=r.position,i=r.top;r.position="sticky";const a="center"===e.pinAlign?.5:"bottom"===e.pinAlign?1:0,s=()=>{var n;const o=null!=(n=e.pinOffset)?n:0;if(!a)return void(r.top=o+"px");const i=function(t){const e=Bi(t,"y");return e?e.clientHeight:document.documentElement.clientHeight}(t),s=t.getBoundingClientRect().height;r.top=Math.round((i-s)*a+o)+"px"};s();let l=null;const u=a?s:null;a&&(u&&window.addEventListener("resize",u),"undefined"!=typeof ResizeObserver&&(l=new ResizeObserver(s),l.observe(t)));let c=null;const f=t.parentElement;return e.pinDistance&&e.pinDistance>0&&f&&(c=document.createElement("div"),c.setAttribute("data-px-pin",""),c.style.height=100*e.pinDistance+"vh",f.insertBefore(c,t),c.appendChild(t)),()=>{u&&window.removeEventListener("resize",u),null==l||l.disconnect(),r.position=o,r.top=i,(null==c?void 0:c.parentElement)&&(c.parentElement.insertBefore(t,c),c.remove())}}function Ki(t,e,n){let r,o=e;t.resetOnFinish&&(o=f(c({},e),{onFinish:()=>{var t;null==(t=null==e?void 0:e.onFinish)||t.call(e),null==r||r.cancel()}}));const i=n(o);return r=i,t.debugGlobalName&&(window[t.debugGlobalName]=i),i}var Hi="http://www.w3.org/2000/svg";function Ji(t,e,n){if(!t)return null;const r=t,{type:o,children:i,style:u}=r,c=((t,e)=>{var n={};for(var r in t)s.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&a)for(var r of a(t))e.indexOf(r)<0&&l.call(t,r)&&(n[r]=t[r]);return n})(r,["type","children","style"]),f=c.domType;void 0!==f&&delete c.domType;const d=jt(t)||e,h=u;let p;if(i)for(const t of i){const e=Ji(t,d,n);e&&(p||(p=[]),p.push(e))}const m=function(t,e,n,r,o,i){if(an.has(t.toLowerCase()))return(null!=i?i:io(void 0,"[PxAnimator]")).warn(no.document,wi.blockedTag,t),null;const a=document.createElementNS(Hi,t);for(const t in e){const n=pn(t,e[t]);void 0!==n&&(un.has(t)?a.style[t]=String(n):a.setAttribute(Qe(t),n))}if(n)for(const t in n)a.style[t]=String(n[t]);if(null==r?void 0:r.length)for(const t of r)a.appendChild(t);else o&&(a.textContent=o);return a}(o||"g",mn(c),h,p,c[ht],n);return m&&void 0!==f&&m.setAttribute("type",f),m}function Xi(t,e,n,r,o,i){const a=io(n,"[PxAnimator]"),s=ye(t);for(const t of s)a.warn(no.document,wi.effectsShape,t);if(function(t){const{problems:e}=function(t){try{return{problems:be(t)}}catch(t){return{problems:[]}}}(t);if(!e.length)return;const n=e.slice(0,ao),r=e.length-n.length;console.warn("[PxAnimator] createAnimator: this document does not match the animation schema in "+e.length+" place"+(1===e.length?"":"s")+".\n"+n.map(t=>" - "+t).join("\n")+(r>0?"\n … and "+r+" more":"")+"\n\nIf you did not author these keys, the usual cause is a build that MANGLES PROPERTY NAMES. An animation document is data loaded at runtime, so renaming the property reads inside the player stops them matching the keys in the JSON, and the animation silently does nothing. Feed the published reserved-name list to your minifier — @pixodesk/svg-animator-web/mangle-reserved.json — see docs/library/minification.md.")}(t),void 0!==o||i){const e=function(t,e,n){var r,o;const i=!!(null==n?void 0:n.resetTimeline);if(!t||void 0===e||!(i||null!==e&&Oi(e)&&Object.keys(e).length))return{doc:t,warnings:[]};const a=t,s=Oi(a.animator),l=!s&&Oi(null==(r=a.meta)?void 0:r.animator),u=s?a.animator:l?a.meta.animator:void 0,c=[];s&&Oi(null==(o=a.meta)?void 0:o.animator)&&c.push("animator: doc.meta.animator is shadowed by doc.animator and was not patched");let f=u;if(i){const t={};for(const e of ji)Oi(u)&&void 0!==u[e]&&(t[e]=u[e]);f=t}const d=function(t,e){const n=[],r=t=>n.push(t);if(null===e)return{config:void 0,warnings:n};if(!Oi(e)||0===Object.keys(e).length)return{config:t,warnings:n};const o=Oi(t)?xi.filter(e=>void 0!==t[e]):[];o.length&&r("animator: the base carries the flat runtime spelling ("+o.join(", ")+"); the patch merges the wire spelling only");const i=Oi(t)?A({},t):{};for(const t of Object.keys(e)){const n=e[t];null!==n?"timeline"!==t?Oi(n)?i[t]=Mi(i[t],n):i[t]=n:i.timeline=Oi(n)?_i(i.timeline,n,r):n:delete i[t]}return{config:i,warnings:n}}(f,null!=e?e:{});return c.push(...d.warnings),d.config===u?{doc:t,warnings:c}:l?{doc:w(A({},a),{meta:w(A({},a.meta),{animator:d.config})}),warnings:c}:{doc:w(A({},a),{animator:d.config}),warnings:c}}(t,null!=o?o:{},{resetTimeline:!!i});for(const t of e.warnings)a.warn(no.usage,wi.timelineOverrideIgnored,t);t=e.doc}t=hi(t,ot((At(t)||{}).engine));let l=null;if(r){t=Pe(t);const e="string"==typeof r?document.querySelector(r):r;e&&(l=Ji(t,void 0,a),l&&e.replaceChildren(l))}const u=function(t,e,n,r){return function(t,e,n,r){const o=At(t)||{},i=io(n,"[PxAnimator]");return Ei(o)?Ki(o,n,n=>{var a;let s=()=>{};if(o.engine!==rt.js&&r){s=Zi(r,o.scroll);const e=function(t,e,n){var r,o,i,a;const s=null!=n?n:io(void 0,"[PxAnimator]");if(!e||!Ei(e))return null;const l=e.scroll||{},u=null!=(r=l.kind)?r:"view";if(l.smoothing)return s.warn(no.platform,wi.scrollSmoothingNeedsOwnDriver),null;const c=globalThis,f="view"===u,d=f?c.ViewTimeline:c.ScrollTimeline;if("function"!=typeof d)return null;const h=null!=(o=l.axis)?o:"block";let p;try{p=new d(f?{subject:Gi(t,l.subject,s),axis:h}:{source:"root"===l.source?Ui():Bi(t,"y")||Bi(t,"x")||Ui(),axis:h})}catch(t){return s.warn(no.platform,wi.scrollNativeUnavailable,t),null}return{timeline:p,rangeStart:Wi(null==(i=l.range)?void 0:i.start,0,f),rangeEnd:Wi(null==(a=l.range)?void 0:a.end,1,f)}}(r,o,i);if(e){const i=Li(t,n,r,it(o.engine),e);if(i){const t=i.destroy.bind(i);return i.destroy=()=>{s(),t()},i}}s(),s=()=>{}}const l=(o.engine!==rt.js?Li(t,n,r,it(o.engine)):null)||Fi(t,e,n,r),u=(null==(a=l.getRootElement)?void 0:a.call(l))||r;if(u){s=Zi(u,o.scroll);const t=("number"==typeof(null==(c=o)?void 0:c.duration)&&c.duration>0?c.duration:Ke)*("number"==typeof(null==c?void 0:c.iterations)&&c.iterations>0?c.iterations:1),e=function(t,e,n,r){var o,i;if(!e||!Ei(e))return null;const a=null!=r?r:io(void 0,"[PxAnimator]"),s=e.scroll||{},l=null!=(o=s.kind)?o:"view",u=Gi(t,s.subject,a),c=Bi(t,"y")||Bi(t,"x"),f="scroll"===l&&"root"===s.source?Ui():c||Ui(),d=f===Ui(),h=function(t,e){const n=null!=t?t:"block";if("x"===n||"y"===n)return n;const r=!!e&&e.startsWith("vertical");return"inline"===n?r?"y":"x":r?"x":"y"}(s.axis,getComputedStyle(f).writingMode),p=()=>{if("scroll"===l)return function(t,e,n){var r,o;const i=e>0?Ye(t/e,0,1):1,a="number"==typeof(null==(r=null==n?void 0:n.start)?void 0:r.fraction)?n.start.fraction:0,s="number"==typeof(null==(o=null==n?void 0:n.end)?void 0:o.fraction)?n.end.fraction:1;return s<=a?i>=s?1:0:Ye((i-a)/(s-a),0,1)}("y"===h?f.scrollTop:f.scrollLeft,"y"===h?f.scrollHeight-f.clientHeight:f.scrollWidth-f.clientWidth,s.range);const t=u.getBoundingClientRect();let e,n;if(d)e=0,n="y"===h?document.documentElement.clientHeight:document.documentElement.clientWidth;else{const t=f.getBoundingClientRect();e="y"===h?t.top:t.left,n="y"===h?f.clientHeight:f.clientWidth}return function(t,e,n,r){const o=n-t,i=Ci(null==r?void 0:r.start,0,e,n),a=Ci(null==r?void 0:r.end,1,e,n);return a<=i?o>=a?1:0:Ye((o-i)/(a-i),0,1)}(("y"===h?t.top:t.left)-e,"y"===h?t.height:t.width,n,s.range)},m=Math.max(0,null!=(i=s.smoothing)?i:0)/1e3;let g=!1,v=null,y=null,b=0,k=null;const A=()=>{k=null,g||(t=>{if(!m)return void n(t);if(null===v)return v=t,void n(t);if(null!==y)return;b=0;const e=t=>{if(y=null,g)return;const r=b?Math.min(.1,(t-b)/1e3):1/60;b=t;const o=p(),i=1-Math.exp(-r/m);v+=(o-v)*i,Math.abs(o-v)<.001&&(v=o),n(v),v!==o&&(y=requestAnimationFrame(e))};y=requestAnimationFrame(e)})(p())},w=()=>{g||null!==k||(k=requestAnimationFrame(A))},x=d?window:f;let j;x.addEventListener("scroll",w,{passive:!0}),window.addEventListener("resize",w,{passive:!0}),"undefined"!=typeof ResizeObserver&&(j=new ResizeObserver(w),j.observe(u),u!==t&&j.observe(t),d||j.observe(f));const O={destroy:()=>{g||(g=!0,x.removeEventListener("scroll",w),window.removeEventListener("resize",w),null==j||j.disconnect(),null!==k&&(cancelAnimationFrame(k),k=null),null!==y&&(cancelAnimationFrame(y),y=null))},refresh:()=>{g||(v=p(),n(v))}};return O.refresh(),O}(u,o,e=>l.setCurrentTime(e*t),i);if(e){const t=l.destroy.bind(l);l.destroy=()=>{e.destroy(),s(),t()}}}else i.warn(no.host,wi.scrollNoRootToObserve);var c;return l}):Ki(o,n,n=>o.engine===rt.js?Fi(t,e,n,r):Li(t,n,r,it(o.engine))||Fi(t,e,n,r))}(t,e,n,r)}(t,e,n,l);if(r&&l){const t=l,e=u.destroy.bind(u);u.destroy=()=>{e(),t.remove()}}return u}function Qi(t){const{src:e,doc:n,container:r,resetTimeline:o}=t,i=function(t){return"adapter"in t}(t)?t.adapter:void 0,a=function(t){const{timeline:e,duration:n,delay:r,iterations:o,startOn:i}=t;return function(t,e){let n;if("string"==typeof t)try{n=JSON.parse(t)}catch(t){console.warn("timeline override: not valid JSON — ignored",t),n=void 0}else n=null!=t?t:void 0;const{duration:r,delay:o,iterations:i,startOn:a}=e;if(void 0===r&&void 0===o&&void 0===i&&void 0===a)return void 0===n?void 0:{timeline:n};const s=Oi(n)?A({},n):{};return void 0!==r&&(s.duration=r),void 0!==o&&(s.delay=o),void 0!==i&&(s.iterations=i),void 0!==a&&(s.trigger=w(A({},s.trigger),{startOn:a})),{timeline:s}}(e,{duration:n,delay:r,iterations:o,startOn:i})}(t),s=function(t){const{onPlay:e,onPause:n,onCancel:r,onFinish:o,onRemove:i,onStop:a,onWarn:s,onError:l,muteWarn:u,muteError:c}=null!=t?t:{},f=t=>t||a?()=>{null==t||t(),null==a||a()}:void 0;return{onPlay:e,onPause:f(n),onCancel:f(r),onFinish:f(o),onRemove:f(i),onWarn:s,onError:l,muteWarn:u,muteError:c}}(t);if(void 0!==n&&void 0!==e)throw new Error("createAnimator: provide either `src` or `doc`, not both");if(void 0===n&&void 0===e)throw new Error("createAnimator: either `src` or `doc` is required");let l=null,u=[],c=!1;const f=t=>{l?t(l):u&&u.push(t)},d=io(s,"[PxAnimator]"),h=(t,e,...n)=>{u=null,d.error(t,e,...n)},p=t=>{try{(t=>{l=t;const e=u;u=null,null==e||e.forEach(e=>e(t))})(Xi(t,i,s,r,a,o))}catch(t){const e=function(t){return t instanceof Error?t:new Error(String(t))}(t);h(no.internal,wi.buildFailed,e)}};return void 0!==n?p(n):fetch(e).then(t=>t.json()).then(t=>{c||(function(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&"svg"===t.type}(t)?p(t):h(no.document,wi.invalidDocumentAtSrc,e))}).catch(t=>{var n;h(no.host,wi.loadFailed,e,null!=(n=null==t?void 0:t.message)?n:String(t))}),{isReady:()=>!!l,getRootElement:()=>l?l.getRootElement():null,isPlaying:()=>(null==l?void 0:l.isPlaying())||!1,play:()=>{f(t=>t.play())},pause:()=>{f(t=>t.pause())},cancel:()=>{f(t=>t.cancel())},finish:()=>{f(t=>t.finish())},setPlaybackRate:t=>{f(e=>e.setPlaybackRate(t))},getCurrentTime:()=>l?l.getCurrentTime():null,setCurrentTime:t=>{f(e=>e.setCurrentTime(t))},getCurrentProgress:()=>l?l.getCurrentProgress():null,setCurrentProgress:t=>{f(e=>e.setCurrentProgress(t))},destroy:()=>{c=!0,u=null,null==l||l.destroy()}}}function Yi(t){const e=document.querySelectorAll("["+G+"]");for(let n=0;n<e.length;n++){const r=e[n];if(!r[Z]){const e=r.getAttribute(G);e&&(r[Z]=Qi(f(c({},t),{src:e,container:r})))}}}