@pixodesk/svg-animator-core 1.0.40 → 1.0.41

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.
@@ -0,0 +1 @@
1
+ var t=Object.defineProperty,n=Object.defineProperties,e=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=Math.pow,s=(n,e,r)=>e in n?t(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,l=(t,n)=>{for(var e in n||(n={}))o.call(n,e)&&s(t,e,n[e]);if(r)for(var e of r(n))i.call(n,e)&&s(t,e,n[e]);return t},u=(t,r)=>n(t,e(r)),c=(t,n)=>{var e={};for(var a in t)o.call(t,a)&&n.indexOf(a)<0&&(e[a]=t[a]);if(null!=t&&r)for(var a of r(t))n.indexOf(a)<0&&i.call(t,a)&&(e[a]=t[a]);return e},f="unexpected extra key";function d(t){if(!t.length)return".";let n="";for(const e of t)e.startsWith("[")?n+=e:n+=(n?".":"")+e;return n}var h=class{_canSanitize(t){return this.isValid(t)}optional(){return new p(this)}},p=class extends h{constructor(t){super(),this.inner=t,this._default=void 0}sanitize(t){if(null!=t)return this.inner._canSanitize(t)?this.inner.sanitize(t):void 0}isValid(t,n,e){return null==t||this.inner.isValid(t,n,e)}_canSanitize(t){return null==t||this.inner._canSanitize(t)}},g=class extends h{constructor(t=""){super(),this._default=t}sanitize(t){return"string"==typeof t?t:this._default}isValid(t,n,e){return"string"==typeof t||(null==n||n.errors.push(d(null!=e?e:[])+": expected string, got "+typeof t),!1)}},m=class extends h{constructor(t=0){super(),this._default=t}sanitize(t){return"number"==typeof t&&isFinite(t)?t:this._default}isValid(t,n,e){return!("number"!=typeof t||!isFinite(t))||(null==n||n.errors.push(d(null!=e?e:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},y=class extends h{constructor(t=!1){super(),this._default=t}sanitize(t){return"boolean"==typeof t?t:this._default}isValid(t,n,e){return"boolean"==typeof t||(null==n||n.errors.push(d(null!=e?e:[])+": expected boolean, got "+typeof t),!1)}},v=class extends h{constructor(t){super(),this.value=t,this._default=t}sanitize(t){return t===this.value?this.value:this._default}isValid(t,n,e){return t===this.value||(null==n||n.errors.push(d(null!=e?e:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},b=class extends h{constructor(t,n){super(),this.values=t,this._default=null!=n?n:t[0]}sanitize(t){return this.values.includes(t)?t:this._default}isValid(t,n,e){return!!this.values.includes(t)||(null==n||n.errors.push(d(null!=e?e:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},k=class extends h{constructor(t,n){super(),this.schemas=t,this._kind="union",this._default=null!=n?n:t[0]._default}sanitize(t){for(const n of this.schemas)if(n.isValid(t))return n.sanitize(t);return this._default}isValid(t,n,e){var r;const o=n&&{errors:[],warnings:[],strict:n.strict};if(this.schemas.some(n=>n.isValid(t,o,e?[...e]:void 0)))return!0;if(!n)return!1;const i=d(null!=e?e:[]);let a;n.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:n.strict};if(r.isValid(t,o,e?[...e]: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 n=/: expected (.+?), got /.exec(t);n&&!l.includes(n[1])&&l.push(n[1])}}if(a&&s>i.length)for(const t of a.slice(0,4))n.errors.includes(t)||n.errors.push(t);else l.length&&n.errors.push(i+": expected "+l.join(" | "));return!1}_canSanitize(t){return this.schemas.some(n=>n._canSanitize(t))}},A=class extends h{constructor(t,n,e){var r;super(),this._key=t,this._schemas=n,this._kind="discriminatedUnion",this._default=null!=e?e:n[0]._default,this._map=new Map;for(const e of n){const n=e._shape[t];if(!n)continue;const o=null!=(r=n.inner)?r:n;this._map.set(o._default,e),n.inner&&(this._absentMember=e)}}_findSchema(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const n=t[this._key];return null==n?this._absentMember:this._map.get(n)}sanitize(t){var n;return(null!=(n=this._findSchema(t))?n:this._schemas[0]).sanitize(t)}isValid(t,n,e){const r=this._findSchema(t);if(!r){const r=null===t||"object"!=typeof t||Array.isArray(t)?void 0:t[this._key];return null==n||n.errors.push(d(null!=e?e:[])+": no discriminated union member matched "+this._key+"="+JSON.stringify(r)),!1}return r.isValid(t,n,e)}_canSanitize(t){if(null===t||"object"!=typeof t||Array.isArray(t))return!1;const n=this._findSchema(t);return n?n._canSanitize(t):this._schemas[0]._canSanitize(t)}},x=class extends h{constructor(t){super(),this._shape=t;const n={};for(const e of Object.keys(t))n[e]=t[e]._default;this._default=n}sanitize(t){const n=t&&"object"==typeof t&&!Array.isArray(t)?t:{},e={};for(const t of Object.keys(this._shape)){const r=this._shape[t].sanitize(n[t]);void 0!==r&&(e[t]=r)}return e}isValid(t,n,e){if(!t||"object"!=typeof t||Array.isArray(t))return null==n||n.errors.push(d(null!=e?e:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=e?e:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],n,o)||(i=!1),o.pop();if(null==n?void 0:n.strict)for(const t of Object.keys(r))t in this._shape||void 0!==r[t]&&(o.push(t),n.errors.push(d(o)+": "+f),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},w=class extends h{constructor(t,n){super(),this._shape=t,this._openSchema=n;const e={};for(const n of Object.keys(t))e[n]=t[n]._default;this._default=e}sanitize(t){const n=t&&"object"==typeof t&&!Array.isArray(t)?t:{},e=l({},n);for(const t of Object.keys(this._shape)){const r=this._shape[t].sanitize(n[t]);void 0!==r&&(e[t]=r)}if(this._openSchema)for(const t of Object.keys(n))t in this._shape||(e[t]=this._openSchema.sanitize(n[t]));return e}isValid(t,n,e){if(!t||"object"!=typeof t||Array.isArray(t))return null==n||n.errors.push(d(null!=e?e:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=e?e:[];let i=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],n,o)||(i=!1),o.pop();if(this._openSchema)for(const t of Object.keys(r))t in this._shape||(o.push(t),this._openSchema.isValid(r[t],n,o)||(i=!1),o.pop());return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},j=class extends h{constructor(t){super(),this.item=t,this._default=[]}sanitize(t){if(!Array.isArray(t))return[];const n=[];for(const e of t)this.item._canSanitize(e)&&n.push(this.item.sanitize(e));return n}isValid(t,n,e){if(!Array.isArray(t))return null==n||n.errors.push(d(null!=e?e:[])+": expected array, got "+typeof t),!1;const r=null!=e?e:[];let o=!0;for(let e=0;e<t.length;e++)r.push("["+e+"]"),this.item.isValid(t[e],n,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)}},O=class extends h{constructor(t){super(),this.value=t,this._kind="record",this._default={}}sanitize(t){if(!t||"object"!=typeof t||Array.isArray(t))return{};const n={};for(const[e,r]of Object.entries(t))this.value._canSanitize(r)&&(n[e]=this.value.sanitize(r));return n}isValid(t,n,e){if(!t||"object"!=typeof t||Array.isArray(t))return null==n||n.errors.push(d(null!=e?e:[])+": expected object/record, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=null!=e?e:[];let o=!0;for(const[e,i]of Object.entries(t))r.push(e),this.value.isValid(i,n,r)||(o=!1),r.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},S=class extends h{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,n,e){return!0}_canSanitize(t){return!0}},P=class extends h{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,n,e){return void 0!==t||(null==n||n.errors.push(d(null!=e?e:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}},M=class extends h{constructor(t,n){super(),this.fn=t,this._default=n,this.resolved=null}get schema(){var t;return null!=(t=this.resolved)?t:this.resolved=this.fn()}sanitize(t){return this.schema.sanitize(t)}isValid(t,n,e){return this.schema.isValid(t,n,e)}_canSanitize(t){return this.schema._canSanitize(t)}},_=class extends h{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((n,e)=>n.sanitize(t[e])):this._default}isValid(t,n,e){if(!Array.isArray(t)||t.length!==this.schemas.length)return null==n||n.errors.push(d(null!=e?e:[])+": expected tuple of length "+this.schemas.length+", got "+(Array.isArray(t)?"array["+t.length+"]":typeof t)),!1;const r=null!=e?e:[];let o=!0;for(let e=0;e<this.schemas.length;e++)r.push("["+e+"]"),this.schemas[e].isValid(t[e],n,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)&&t.length===this.schemas.length}};function z(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function D(t){var n;const e=t;switch(e._kind){case"union":return{kind:"union",members:e.schemas};case"discriminatedUnion":return{kind:"discriminatedUnion",key:e._key,members:e._schemas};case"record":return{kind:"record",value:e.value};case"tuple":return{kind:"tuple",items:e.schemas}}return"_shape"in e?{kind:"shape",shape:e._shape,openValue:e._openSchema}:"item"in e?{kind:"array",item:e.item}:"inner"in e?{kind:"optional",inner:e.inner}:"fn"in e?{kind:"lazy",resolved:null!=(n=e.resolved)?n:e.resolved=e.fn()}:{kind:"leaf"}}var I,T={string:(t="")=>new g(t),number:(t=0)=>new m(t),boolean:(t=!1)=>new y(t),literal:t=>new v(t),enum:(t,n)=>new b(t,n),union:(t,n)=>new k(t,n),discriminatedUnion:(t,n)=>new A(t,n),object:t=>new x(t),openObject:(t,n)=>new w(t,n),extendedObject:(t,n)=>new x(l(l({},t._shape),n)),array:t=>new j(t),record:t=>new O(t),any:()=>new S,defined:()=>new P,tuple:t=>new _(t),lazy:(t,n)=>new M(t,n)},V="1.1",E="version",N="animator",L=(t=>(t.unstamped="unstamped",t.same="same",t.older="older",t.newer="newer",t.otherGeneration="otherGeneration",t))(L||{}),U=/^(\d+)\.(\d+)(?:\.(\d+))?$/;function C(t){if("string"!=typeof t)return;const n=U.exec(t.trim());return n?{a:Number(n[1]),b:Number(n[2]),c:void 0===n[3]?0:Number(n[3])}:void 0}function W(t){return t.a+"."+t.b+"."+t.c}var F=null!=(I=C("1.1"))?I:{a:1,b:1,c:0};function R(t){if(!t||"object"!=typeof t)return;const n=B(t,N);if(n)return n;const e=B(t,"meta");return e?B(e,N):void 0}function B(t,n){const e=t[n];return e&&"object"==typeof e&&!Array.isArray(e)?e:void 0}function G(t){const n=R(t);return n?C(n[E]):void 0}function Z(t,n,e){return t?t.a!==n.a?"otherGeneration":t.b!==n.b?t.b>n.b?"newer":"older":e&&t.c!==n.c?t.c>n.c?"newer":"older":"same":"unstamped"}function J(t,n,e,r){if(!n)return;const o=r?"player":"editor",i="written for schema "+W(n)+", this "+o+" reads "+W(e);switch(t){case"newer":return"This file is "+i+". Update the "+o+" to open it fully.";case"older":return"This file is "+i+". Saving it from this "+o+" rewrites it in the current format.";case"otherGeneration":return"This file is "+i+" — a different format generation, which no conversion bridges. Open it in a "+o+" of that generation, or accept this document without the parts named above.";default:return}}var q=(t=>(t.additive="additive",t.converted="converted",t))(q||{}),Q="1.1",X=[];function H(t,n){const e=G(t),r=Z(e,n.target,n.readerReadsEditorPart);if(!e||"older"!==r)return{doc:t,from:e,relation:r,applied:[],advice:J(r,e,n.target,!n.readerReadsEditorPart)};const o=[];for(const t of n.steps){const r=C(t.to);r&&("older"===Z(e,r,n.readerReadsEditorPart)&&t.up&&o.push(t))}if(!o.length||!t||"object"!=typeof t)return{doc:t,from:e,relation:r,applied:[]};const i=$(t),a=[];for(const t of o)try{t.up(i),a.push(t)}catch(t){break}return a.length?(Y(i,n.target,n.readerReadsEditorPart),{doc:i,from:e,relation:r,applied:a}):{doc:t,from:e,relation:r,applied:[]}}function K(t){return H(t,{steps:X,target:F,readerReadsEditorPart:!1})}function $(t){const n=globalThis.structuredClone;return n?n(t):JSON.parse(JSON.stringify(t))}function Y(t,n,e){const r=R(t);if(!r)return;const o=C(r[E]);r[E]=W({a:n.a,b:n.b,c:e?n.c:o?o.c:0})}function tt(t,n){return function(t,n){const e=G(t);if(!e)return{ok:!1,blocking:[],reason:"The document carries no version, so there is nothing to convert down from."};const r=Z(e,n.target,n.readerReadsEditorPart);if("otherGeneration"===r)return{ok:!1,blocking:[],reason:"Schema "+W(e)+" and "+W(n.target)+" are different generations; no conversion bridges them."};if("newer"!==r)return{ok:!0,doc:t,applied:[]};const o=[];for(const t of n.steps){const r=C(t.to);r&&"newer"===Z(r,n.target,n.readerReadsEditorPart)&&"newer"!==Z(r,e,n.readerReadsEditorPart)&&o.push(t)}o.reverse();const i=o.filter(t=>"converted"===t.kind&&!t.down);if(i.length)return{ok:!1,blocking:i,reason:"Cannot convert down to "+W(n.target)+": "+i.map(t=>t.from+" → "+t.to+" ("+t.reason+")").join("; ")+" cannot be undone."};const a=$(t),s=[];for(const t of o)if(t.down)try{t.down(a),s.push(t)}catch(n){return{ok:!1,blocking:[t],reason:"Undoing "+t.from+" → "+t.to+" failed: "+String(n)}}return Y(a,n.target,n.readerReadsEditorPart),{ok:!0,doc:a,applied:s}}(t,{steps:X,target:n,readerReadsEditorPart:!1})}var nt={forwards:"forwards",backwards:"backwards",both:"both",none:"none"},et={normal:"normal",reverse:"reverse",alternate:"alternate",alternateReverse:"alternate-reverse"},rt="data-px-animation-src",ot="_px_animator",it={load:"load",mouseOver:"mouseOver",click:"click",scrollIntoView:"scrollIntoView",programmatic:"programmatic"},at={continue:"continue",pause:"pause",reset:"reset",reverse:"reverse"},st={hold:"hold",reset:"reset"},lt={view:"view",scroll:"scroll"},ut={block:"block",inline:"inline",x:"x",y:"y"},ct={nearest:"nearest",root:"root"},ft={top:"top",center:"center",bottom:"bottom"},dt={cover:"cover",contain:"contain",entry:"entry",exit:"exit",entryCrossing:"entry-crossing",exitCrossing:"exit-crossing"},ht={sampled:"sampled",offsetPath:"offsetPath"},pt=["duration","iterations","engine","frameRate"],gt=["trigger","delay","fillMode","direction"],mt=[...pt,...gt,"fill","resetOnFinish","timelineSource","scroll"],yt={native:"native",js:"js"},vt=u(l({},yt),{auto:"auto"});function bt(t){return t===vt.js?yt.js:yt.native}function kt(t){return t===vt.native}function At(t){return t!==vt.js}var xt={startOn:"load",outAction:"continue",scrollIntoViewThreshold:0},wt={static:"static",fixedTime:"fixedTime",play:"play",autoplay:"autoplay"};function jt(t){const n=void 0!==t.progress||void 0!==t.time,e=void 0!==t.play||void 0!==t.pause,r=!!t.autoplay,o=[],i=(t,n,e)=>t+" and "+n+" were both set — "+e+" wins, "+(e===t?n:t)+" is ignored.";return n?(e&&o.push(i("progress/time","play/pause","progress/time")),r&&o.push(i("progress/time","autoplay","progress/time")),{mode:wt.fixedTime,warnings:o}):e?(r&&o.push(i("play/pause","autoplay","play/pause")),{mode:wt.play,warnings:o}):r?{mode:wt.autoplay,warnings:o}:{mode:wt.static,warnings:o}}function Ot(t){return t!==wt.autoplay}function St(t){var n,e,r;return{startOn:null!=(n=null==t?void 0:t.startOn)?n:xt.startOn,outAction:null!=(e=null==t?void 0:t.outAction)?e:xt.outAction,scrollIntoViewThreshold:null!=(r=null==t?void 0:t.scrollIntoViewThreshold)?r:xt.scrollIntoViewThreshold}}var Pt={start:"start",end:"end"},Mt={normal:"normal",alternate:"alternate"},_t={luminance:"luminance",alpha:"alpha"},zt={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},Dt={translate:"translate"},It={clip:"clip",extend:"extend"},Tt={spacing:"spacing",spacingAndGlyphs:"spacingAndGlyphs"},Vt={align:"align",stretch:"stretch"},Et={auto:"auto",exact:"exact"},Nt={separate:"separate",combined:"combined"},Lt="textContent",Ut="class",Ct="transform",Wt="offsetDistance",Ft=new Set(["type","children","animator","meta","animate","effects",Lt]),Rt={translate:"translate",rotate:"rotate",scale:"scale",origin:"origin"},Bt=[Rt.translate,Rt.rotate,Rt.scale,Rt.origin],Gt={pad:"pad",reflect:"reflect",repeat:"repeat"},Zt={linear:"linear",radial:"radial"};function Jt(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&"svg"===t.type}function qt(t){var n;const e=(null==t?void 0:t.animator)||(null==(n=null==t?void 0:t.meta)?void 0:n.animator);if(!e)return;const r=Qt.get(e);if(r)return r;const o=e,i=mt.filter(t=>void 0!==o[t]),a=i.length?l({},o):e;for(const t of i)delete a[t];const s=Ht(a);return Qt.set(e,s),s}var Qt=new WeakMap,Xt=new WeakMap;function Ht(t){const n=t.timeline;if(null==n||"object"!=typeof n)return t;const e=Xt.get(t);if(e)return e;const r=t,{timeline:o}=r,i=c(r,["timeline"]);if(void 0!==n.engine&&(i.engine=n.engine),void 0!==n.frameRate&&(i.frameRate=n.frameRate),"scroll"===n.type||"view"===n.type){i.timelineSource="scroll",void 0!==n.duration&&(i.duration=n.duration),void 0!==n.iterations&&(i.iterations=n.iterations);const t=l({},i.scroll||{});t.kind=n.type,void 0!==n.axis&&(t.axis=n.axis),void 0!==n.source&&(t.source=n.source),void 0!==n.subject&&(t.subject=n.subject),void 0!==n.smoothing&&(t.smoothing=n.smoothing),void 0!==n.range&&(t.range=n.range);const e=n.pin;"boolean"==typeof e?t.pin=e:e&&"object"==typeof e&&(t.pin=!0,void 0!==e.align&&(t.pinAlign=e.align),void 0!==e.offset&&(t.pinOffset=e.offset),void 0!==e.distance&&(t.pinDistance=e.distance)),i.scroll=t}else{if(void 0!==n.duration&&(i.duration=n.duration),void 0!==n.trigger){const t=n.trigger,{finishAction:e}=t,r=c(t,["finishAction"]);Object.keys(r).length&&(i.trigger=r),void 0!==e&&(i.resetOnFinish="reset"===e)}void 0!==n.delay&&(i.delay=n.delay),void 0!==n.iterations&&(i.iterations=n.iterations),void 0!==n.direction&&(i.direction=n.direction),void 0!==n.fillMode&&(i.fill=n.fillMode)}return Xt.set(t,i),i}function Kt(t){if(!t||void 0!==t.timeline)return t;const n=t,{timelineSource:e,scroll:r,trigger:o,delay:i,iterations:a,direction:s,fill:f,resetOnFinish:d,duration:h,engine:p,frameRate:g}=n,m=c(n,["timelineSource","scroll","trigger","delay","iterations","direction","fill","resetOnFinish","duration","engine","frameRate"]);if("scroll"===e){const t={type:(y=null==r?void 0:r.kind,"scroll"===y?"scroll":"view")};if(void 0!==p&&(t.engine=p),void 0!==g&&(t.frameRate=g),void 0!==h&&(t.duration=h),"number"==typeof a&&(t.iterations=a),r){void 0!==r.axis&&(t.axis=r.axis),void 0!==r.source&&(t.source=r.source),void 0!==r.subject&&(t.subject=r.subject),void 0!==r.smoothing&&(t.smoothing=r.smoothing),void 0!==r.range&&(t.range=r.range);void 0!==r.pinAlign||void 0!==r.pinOffset||void 0!==r.pinDistance?t.pin=l(l(l({},void 0!==r.pinAlign?{align:r.pinAlign}:{}),void 0!==r.pinOffset?{offset:r.pinOffset}:{}),void 0!==r.pinDistance?{distance:r.pinDistance}:{}):void 0!==r.pin&&(t.pin=r.pin)}return u(l({},m),{timeline:t})}var y;const v={};if(void 0!==p&&(v.engine=p),void 0!==g&&(v.frameRate=g),void 0!==h&&(v.duration=h),void 0!==o||d){const t=l({},o||{});d&&(t.finishAction="reset"),v.trigger=t}return void 0!==i&&(v.delay=i),void 0!==a&&(v.iterations=a),void 0!==s&&(v.direction=s),void 0!==f&&(v.fillMode=f),Object.keys(v).length>0?u(l({},m),{timeline:v}):m}function $t(t){var n;if(t)return null==(n=qt(t))?void 0:n.definitions}function Yt(t){var n;if(t)return null==(n=qt(t))?void 0:n.bindings}function tn(t){return null==t?void 0:t.children}var nn=T.union([T.string(),T.tuple([T.number(),T.number(),T.number(),T.number()])]),en=T.union([T.string(),T.number(),T.array(T.number()),T.object({pathData:T.string()}),T.lazy(()=>T.array(Bn),[]),T.lazy(()=>dn,{})]),rn=T.object({time:T.number().optional(),value:en.optional(),easing:nn.optional(),tangentOut:T.tuple([T.number(),T.number()]).optional(),tangentIn:T.tuple([T.number(),T.number()]).optional()}),on=t=>{var n,e;return null!=(e=null!=(n=t.time)?n:t.t)?e:0},an=t=>{var n;return null!=(n=t.value)?n:t.v},sn=t=>{var n;return null!=(n=t.easing)?n:t.e},ln=t=>t.tangentIn,un=t=>t.tangentOut,cn=T.object({segmentCount:T.number().optional(),repeatAt:T.enum([Pt.start,Pt.end]).optional(),direction:T.enum([Mt.normal,Mt.alternate]).optional()}),fn=T.object({value:en.optional(),keyframes:T.array(rn).optional(),loop:T.union([cn,T.boolean()]).optional(),autoOrient:T.boolean().optional(),alongPathMode:T.enum([ht.sampled,ht.offsetPath]).optional()}),dn=T.object({translate:T.tuple([T.number(),T.number()]).optional(),rotate:T.number().optional(),skew:T.number().optional(),scale:T.tuple([T.number(),T.number()]).optional(),origin:T.tuple([T.number(),T.number()]).optional()}),hn=T.union([T.string(),dn,T.object({value:dn}),fn]),pn=T.record(fn),gn=T.union([T.string(),T.array(T.union([T.string(),pn])),pn]),mn=T.object({startOn:T.enum([it.load,it.mouseOver,it.click,it.scrollIntoView,it.programmatic],xt.startOn).optional(),outAction:T.enum([at.continue,at.pause,at.reset,at.reverse],xt.outAction).optional(),finishAction:T.enum([st.hold,st.reset]).optional(),scrollIntoViewThreshold:T.number().optional()}),yn=T.object({width:T.number(),pathData:T.string()}),vn=T.object({fontFamily:T.string(),fontStyle:T.string(),ascent:T.number(),unitsPerEm:T.number(),glyphs:T.record(yn)}),bn=T.object({easings:T.record(T.tuple([T.number(),T.number(),T.number(),T.number()])).optional(),animations:T.record(pn).optional(),fonts:T.record(vn).optional()}),kn=T.object({phase:T.enum([dt.cover,dt.contain,dt.entry,dt.exit,dt.entryCrossing,dt.exitCrossing]).optional(),fraction:T.number().optional()}),An=T.object({start:kn.optional(),end:kn.optional()}),xn=T.object({kind:T.enum([lt.view,lt.scroll]).optional(),axis:T.enum([ut.block,ut.inline,ut.x,ut.y]).optional(),source:T.enum([ct.nearest,ct.root]).optional(),subject:T.string().optional(),smoothing:T.number().optional(),pin:T.boolean().optional(),pinAlign:T.enum([ft.top,ft.center,ft.bottom]).optional(),pinOffset:T.number().optional(),pinDistance:T.number().optional(),range:An.optional()}),wn=T.object({align:T.enum([ft.top,ft.center,ft.bottom]).optional(),offset:T.number().optional(),distance:T.number().optional()}),jn=T.enum([vt.auto,vt.native,vt.js]).optional(),On=T.object({type:T.literal("time").optional(),engine:jn,frameRate:T.number().optional(),duration:T.number().optional(),trigger:mn.optional(),delay:T.number().optional(),iterations:T.union([T.number(),T.literal("infinite")]).optional(),fillMode:T.enum([nt.forwards,nt.backwards,nt.both,nt.none]).optional(),direction:T.enum([et.normal,et.reverse,et.alternate,et.alternateReverse]).optional()}),Sn={duration:T.number().optional(),iterations:T.number().optional(),engine:jn,frameRate:T.number().optional(),axis:T.enum([ut.block,ut.inline,ut.x,ut.y]).optional(),source:T.enum([ct.nearest,ct.root]).optional(),subject:T.string().optional(),smoothing:T.number().optional(),pin:T.union([T.boolean(),wn]).optional(),range:An.optional()},Pn=T.object(l({type:T.literal("scroll")},Sn)),Mn=T.object(l({type:T.literal("view")},Sn)),_n=T.discriminatedUnion("type",[On,Pn,Mn]),zn=T.object({target:T.string(),animateWith:T.array(T.string())}),Dn=T.object({timeline:_n.optional(),definitions:bn.optional(),bindings:T.array(zn).optional(),debugGlobalName:T.string().optional(),version:T.string().optional()}),In=T.union([T.string(),T.number(),T.array(T.number()),T.object({value:T.defined()}),dn]),Tn=T.union([T.number(),fn,T.object({value:T.number()})]),Vn=T.union([T.tuple([T.number(),T.number()]),fn,T.object({value:T.tuple([T.number(),T.number()])})]),En=T.union([T.string(),fn,T.object({value:T.string()})]),Nn=T.object({translate:Vn.optional(),rotate:Tn.optional(),scale:Vn.optional(),skew:Tn.optional(),origin:Vn.optional()}),Ln=T.object({copies:T.number().optional(),translate:Vn.optional(),rotate:Tn.optional(),skew:Tn.optional(),scale:Vn.optional(),origin:Vn.optional()}),Un=T.object({source:T.string().optional(),maskType:T.enum([_t.luminance,_t.alpha]).optional(),maskUnits:T.enum([zt.userSpaceOnUse,zt.objectBoundingBox]).optional(),maskContentUnits:T.enum([zt.userSpaceOnUse,zt.objectBoundingBox]).optional(),x:T.number().optional(),y:T.number().optional(),width:T.number().optional(),height:T.number().optional()}),Cn=T.object({pathData:En.optional()}),Wn=T.object({offset:Tn.optional(),range:Vn.optional(),subPaths:T.enum([Nt.separate,Nt.combined]).optional()}),Fn=T.object({start:T.number().optional(),stretch:T.number().optional(),timeCrop:T.tuple([T.number(),T.number()]).optional()}),Rn=T.object({without:T.enum([Dt.translate]).optional(),source:T.string().optional(),retime:Fn.optional()}),Bn=T.object({offset:T.number(),color:T.string()}),Gn=T.union([T.array(Bn),T.object({value:T.array(Bn)}),fn]),Zn=T.object({type:T.enum([Zt.linear,Zt.radial]),start:Vn.optional(),end:Vn.optional(),center:Vn.optional(),radius:Tn.optional(),focal:Vn.optional(),stops:Gn.optional(),gradientUnits:T.enum([zt.userSpaceOnUse,zt.objectBoundingBox]).optional(),spreadMethod:T.enum([Gt.pad,Gt.reflect,Gt.repeat]).optional(),gradientTransform:T.string().optional()}),Jn=Zn,qn=T.object({pathData:T.string(),pathOverflow:T.enum([It.clip,It.extend]).optional(),lengthAdjust:T.enum([Tt.spacing,Tt.spacingAndGlyphs]).optional(),method:T.enum([Vt.align,Vt.stretch]).optional(),spacing:T.enum([Et.auto,Et.exact]).optional(),startOffset:Tn.optional(),textLength:Tn.optional()}),Qn=T.object({useGlyphs:T.boolean().optional()}),Xn=T.object({transformBy:Nn.optional(),repeater:Ln.optional(),maskedBy:Un.optional(),clipPath:Cn.optional(),strokeTrim:Wn.optional(),clone:Rn.optional(),fillGradient:Zn.optional(),strokeGradient:Jn.optional(),textPath:qn.optional(),text:Qn.optional()});function Hn(t,n){const e=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==n?void 0:n.strict)};if(!Xn.isValid(t.effects,r,[o+".effects"]))for(const t of r.errors)e.push(t)}t&&Array.isArray(t.children)&&t.children.forEach((t,n)=>r(t,o+".children["+n+"]"))};return r(t,"root"),e}function Kn(t,n){var e;const r=!1!==(null==n?void 0:n.strict),o={errors:[],warnings:[],strict:r},i=ne.isValid(t,o,["root"])?[]:[...o.errors];if(t&&"object"==typeof t){for(const n of Hn(t,{strict:r}))i.includes(n)||i.push(n);const n=null==(e=qt(t))?void 0:e.definitions;for(const e of function(t,n){if(!n||!Object.keys(n).length)return[];const e=[],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(n,u)){const t=o+': glyph-mode text uses font-family "'+u+'", which has no entry in animator.definitions.fonts';e.includes(t)||e.push(t)}Array.isArray(t.children)&&t.children.forEach((t,n)=>r(t,o+".children["+n+"]",c,f))};return r(t,"root",void 0,!1),e}(t,null==n?void 0:n.fonts))i.includes(e)||i.push(e);for(const e of function(t,n){const e=[],r=(t,o)=>{if(Array.isArray(t))return void t.forEach((t,n)=>r(t,o+"["+n+"]"));if(!t||"object"!=typeof t)return;const i=t.easing;if(!("string"!=typeof i||n&&Object.prototype.hasOwnProperty.call(n,i))){const t=o+'.easing: "'+i+'" names no entry in animator.definitions.easings — it will play linear';e.includes(t)||e.push(t)}for(const[n,e]of Object.entries(t))"easing"!==n&&e&&"object"==typeof e&&r(e,o+"."+n)};return r(t,"root"),e}(t,null==n?void 0:n.easings))i.includes(e)||i.push(e);for(const n of function(t){var n;const e=null==(n=qt(t))?void 0:n.version;return void 0===e||void 0!==C(e)?[]:["root.animator.version: "+JSON.stringify(e)+' is not a version stamp ("a.b" or "a.b.c") — it reads as unstamped']}(t))i.includes(n)||i.push(n)}return i}var $n=T.openObject({type:T.string(),domType:T.string().optional(),textContent:T.string().optional(),id:T.string().optional(),meta:T.any().optional(),effects:Xn.optional(),animate:gn.optional(),style:T.record(T.union([T.string(),T.number()])).optional()},In),Yn=T.openObject(u(l({},$n._shape),{children:T.lazy(()=>T.array(Yn),[]).optional()}),In),te=T.object({width:T.union([T.number(),T.string()]).optional(),height:T.union([T.number(),T.string()]).optional(),viewBox:T.string().optional(),animator:Dn.optional()}),ne=T.openObject(u(l(l({},$n._shape),te._shape),{type:T.literal("svg"),children:T.array(Yn).optional()}),In),ee=T.object({v:T.array(T.array(T.number())),i:T.array(T.array(T.number())).optional(),o:T.array(T.array(T.number())).optional(),c:T.boolean().optional()});function re(t){const n=Kn(t,{strict:!1});return{valid:0===n.length,errors:n}}var oe=0;function ie(){return"_px_"+Date.now().toString(36)+(++oe).toString(36)+Math.random().toString(36).substring(2,6)}function ae(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>ae(t));const n=t,e={};for(const t of Object.keys(n))e[t]=ae(n[t]);return e}function se(t){var n;const e=ae(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,n)=>"source"===t&&("maskedBy"===n||"clone"===n);!function t(n){if(n&&"object"==typeof n){if(n.id&&"string"==typeof n.id){const t=n.id,e=ie();r.set(t,e),n.id=e}else n.animate&&(n.id=ie());if(Array.isArray(n.children))for(const e of n.children)t(e)}}(e),function t(n,e){if(n&&"object"==typeof n)for(const[l,u]of Object.entries(n))if("children"!==l)if("string"==typeof u)if(o.has(l)&&u.startsWith("#")){const t=u.slice(1),e=r.get(t);e&&(n[l]="#"+e)}else if(i.has(l))n[l]=le(u,r);else if(a.has(l)||s(l,e)){const t=u.startsWith("#"),e=r.get(t?u.slice(1):u);e&&(n[l]=t?"#"+e:e)}else u.includes("url(#")&&(n[l]=le(u,r));else if("style"===l&&"object"==typeof u&&null!==u)for(const[t,n]of Object.entries(u))"string"==typeof n&&(u[t]=le(n,r));else"object"==typeof u&&null!==u&&t(u,l);else if(Array.isArray(u))for(const n of u)t(n)}(e);const c=null==(n=e.animator)?void 0:n.bindings;if(Array.isArray(c)){const t=c.map(t=>{var n;const e=t.target.startsWith("#"),o=e?t.target.slice(1):t.target,i=null!=(n=r.get(o))?n:o;return u(l({},t),{target:e?"#"+i:i})});e.animator=u(l({},e.animator),{bindings:t})}return e}function le(t,n){return t.replace(/url\(#([^)]+)\)/g,(t,e)=>{const r=n.get(e);return r?"url(#"+r+")":t})}function ue(t,n=!1){var e,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!=(e=null==l?void 0:l[t-1])?e:o,u=null!=(r=null==s?void 0:s[t])?r:a[t],f=a[t];!n&&i[0]===o[0]&&i[1]===o[1]&&u[0]===f[0]&&u[1]===f[1]?c.push("L"+f[0]+","+f[1]):c.push("C"+i[0]+","+i[1]+","+u[0]+","+u[1]+","+f[0]+","+f[1])}if(u&&f>0){const t=a[f-1],e=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];!n&&e[0]===t[0]&&e[1]===t[1]&&r[0]===u[0]&&r[1]===u[1]||c.push("C"+e[0]+","+e[1]+","+r[0]+","+r[1]+","+u[0]+","+u[1]),c.push("z")}return c.join("")}function ce(t,n,e){return t+(n-t)*e}function fe(t,n,e){const r=[],o=Math.max(t.length,n.length);for(let i=0;i<o;i++)r[i]=ce(t[i]||0,n[i]||0,e);return r}function de(t,n,e){return[ce(t[0]||0,n[0]||0,e),ce(t[1]||0,n[1]||0,e),ce(t[2]||0,n[2]||0,e),ce(void 0===t[3]?1:t[3],void 0===n[3]?1:n[3],e)]}function he(t,n,e){const r=Math.max(t.length,n.length),o=[];for(let i=0;i<r;i++)o.push(pe(t[i],n[i],e));return o}function pe(t,n,e){var r,o,i,a,s,l,u,c,f;if(!t||!n)return t||n||{v:[]};const d=Math.min(Math.max(e,0),1),h=Math.min(t.v.length,n.v.length),p=[],g=[],m=[];for(let e=0;e<h;e++){const f=t.v[e],h=n.v[e];p.push(fe(f,h,d));const y=null!=(o=null==(r=t.i)?void 0:r[e])?o:f,v=null!=(a=null==(i=n.i)?void 0:i[e])?a:h;g.push(fe(y,v,d));const b=null!=(l=null==(s=t.o)?void 0:s[e])?l:f,k=null!=(c=null==(u=n.o)?void 0:u[e])?c:h;m.push(fe(b,k,d))}return{v:p,i:g.length?g:void 0,o:m.length?m:void 0,c:null!=(f=t.c)?f:n.c}}function ge(t,n,e){if(e<=0)return 0;if(e>=1)return 1;const r=3*t,o=3*(n-t)-r,i=1-r-o;function a(t){return((i*t+o)*t+r)*t}function s(t){return(3*i*t+2*o)*t+r}let l=e,u=0,c=1;for(let t=0;t<8;t++){const t=a(l)-e;if(Math.abs(t)<1e-6)return l;const n=s(l);if(Math.abs(n)<1e-6)break;l-=t/n}for(l=e;u<c;){const t=a(l);if(Math.abs(t-e)<1e-6)return l;e>t?u=l:c=l,l=(c+u)/2}return l}function me(t){const[n,e,r,o]=t,i=3*e,a=3*(o-e)-i,s=1-i-a;return function(t){return e=ge(n,r,t),((s*e+a)*e+i)*e;var e}}function ye(t,n,e){return[t[0]+(n[0]-t[0])*e,t[1]+(n[1]-t[1])*e]}function ve(t,n,e,r,o){const i=ye(t,n,o),a=ye(n,e,o),s=ye(e,r,o),l=ye(i,a,o),u=ye(a,s,o),c=ye(l,u,o);return{left:[t,i,l,c],right:[c,u,s,r]}}function be(t,n){if(!t)return{left:void 0,right:void 0};if(n<=0)return{left:void 0,right:t};if(n>=1)return{left:t,right:void 0};const[e,r,o,i]=t,a=ge(e,o,n),s=[e,r],l=[o,i],{left:u,right:c}=ve([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 g=1-f,m=1-d;return g>1e-9&&Math.abs(m)>1e-9&&(p=[(c[1][0]-f)/g,(c[1][1]-d)/m,(c[2][0]-f)/g,(c[2][1]-d)/m]),{left:h,right:p}}function ke(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function Ae(t){const n=Math.round(255*t[0]),e=Math.round(255*t[1]),r=Math.round(255*t[2]);return 4===t.length?"rgba("+n+","+e+","+r+","+t[3]+")":"rgb("+n+","+e+","+r+")"}function xe(t){if(t){if(Array.isArray(t))return t;if("string"==typeof t)return t.startsWith("#")?function(t){const n=t.slice(1),e=n.length<=4,r=e?n[0]+n[0]:n.slice(0,2),o=e?n[1]+n[1]:n.slice(2,4),i=e?n[2]+n[2]:n.slice(4,6),a=4===n.length?n[3]+n[3]:8===n.length?n.slice(6,8):null,s=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==a&&s.push(parseInt(a,16)/255),s}(t):t.startsWith("rgb")?function(t){var n;const e=null==(n=t.match(/rgba?\((.*)\)/))?void 0:n[1];if(!e)throw new Error("Invalid rgb/rgba format");const r=e.split(",").map(t=>+t.trim());return[r[0]/255,r[1]/255,r[2]/255,...void 0!==r[3]?[r[3]]:[]]}(t):void console.warn("Unsupported color format: "+t)}}var we=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),je=new Set(["translate","rotate","scale","skew"]),Oe=new Set(["offset-distance","offsetDistance"]);function Se(t,n){var e;if(!t)return"";const r=null==(e=null==n?void 0:n.withUnits)||e,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 Pe=new Set(["offset-distance","offsetDistance"]),Me=1e3;function _e(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,n)=>n.toUpperCase()):t}function ze(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var De=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 Ie(t){return De.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Te(t,n,e){return Math.max(n,Math.min(t,e))}function Ve(t,n,e,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const i=1-o,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*n[0]+c*e[0]+f*r[0],l*t[1]+u*n[1]+c*e[1]+f*r[1]]}var Ee=1e-4;function Ne(t,n,e,r,o){const i=Le(t,n,e,r,o);if(0===i[0]&&0===i[1]){return Le(t,n,e,r,o<.5?o+Ee:o-Ee)}return i}function Le(t,n,e,r,o){const i=1-o,a=3*i*i,s=6*o*i,l=3*o*o;return[a*(n[0]-t[0])+s*(e[0]-n[0])+l*(r[0]-e[0]),a*(n[1]-t[1])+s*(e[1]-n[1])+l*(r[1]-e[1])]}function Ue(t,n,e,r,o=100){const i=o+1,a=new Float64Array(i),s=new Float64Array(i);let l=Ve(t,n,e,r,0);a[0]=0,s[0]=0;let u=0;for(let c=1;c<i;c++){const i=c/o,f=Ve(t,n,e,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 Ce(t,n){const{ts:e,ds:r}=t,o=e.length-1;if(n<=e[0])return r[0];if(n>=e[o])return r[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;e[t]<n?i=t+1:a=t}const s=e[a-1],l=e[a]-s,u=l>0?(n-s)/l:0;return r[a-1]+u*(r[a]-r[a-1])}var We=new Set(["script","foreignobject"]),Fe=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),Re=new Set(["href","xlink:href","src"]),Be=new Set(["mixBlendMode","isolation"]),Ge=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,Ze=/^data:image\/svg\+xml(?:;[^,]*)?,/i,Je=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,qe=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function Qe(t,n){const e=t.toLowerCase();if(!function(t){return!!t.startsWith("on")}(e)){if("fill"===e||"stroke"===e||"stopcolor"===e){const t=String(n);return t.includes("url(")&&!/^url\(#[^)]+\)$/.test(t)?void console.warn('Attribute "'+e+'" blocked: url() must be internal url(#id), got:',n):n}if(Fe.has(e)){const t=String(n);return t.startsWith("#")||(/^url\(#[^)]+\)$/.test(t)||Re.has(e)&&(Ge.test(t)||Ze.test(t)||function(t){const n=Je.exec(t);return!!n&&qe.some(t=>n[1].startsWith(t))}(t)))?n:void console.warn('Attribute "'+e+'" blocked: must be #id, url(#id), or data:image/… URI, got:',n)}return n}console.warn("Attribute blocked (event handler / dangerous): ",e)}function Xe(t){const n={};for(const e of Object.keys(t)){const r=_e(e);if(Ft.has(r))continue;if("style"===r)continue;let o=t[e];if(we.has(r)&&Array.isArray(o))n[r]=Ae(o);else if("transform"!==r||null===o||"object"!=typeof o||Array.isArray(o)||o.keyframes)je.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),n[Ct]=r+"("+o+")"):Array.isArray(o)?n[r]=o.join(","):null!=o&&(n[r]=String(o));else{const t=o.value&&"object"==typeof o.value?o.value:o;n[Ct]=Se(t,{withUnits:!1})}}return n}function He(t){const n=an(t);if(!n)return;if(Array.isArray(n)&&n.length>=2&&"number"==typeof n[0]&&"number"==typeof n[1])return[n[0],n[1]];const e=n.translate;return Array.isArray(e)&&e.length>=2?[e[0],e[1]]:void 0}function Ke(t){return on(t)}function $e(t){return sn(t)}function Ye(t){const n=t.keyframes;if(!Array.isArray(n))return!1;if(t.autoOrient)return!0;for(const t of n)if(ln(t)||un(t))return!0;return!1}var tr=new WeakMap;function nr(t,n,e,r){let o=tr.get(t);const i=null==o?void 0:o.get(n);if(i)return i;const a=un(t),s=ln(n),l=[e[0]+(a?a[0]:0),e[1]+(a?a[1]:0)],u=[r[0]+(s?s[0]:0),r[1]+(s?s[1]:0)],c=Ue(e,l,u,r),f={P0:e,P1:l,P2:u,P3:r,lut:c,totalArc:c.ds[c.ds.length-1]};return o||(o=new WeakMap,tr.set(t,o)),o.set(n,f),f}function er(t,n){var e,r,o;if(!Ye(t))return t;const i=t.keyframes;if(!Array.isArray(i)||i.length<2)return t;const a=!!t.autoOrient,s=null!=(e=null==n?void 0:n.flatnessTolerance)?e:.5,l=null!=(r=null==n?void 0:n.rotationTolerance)?r:5,u=null!=(o=null==n?void 0:n.maxSamplesPerSegment)?o:32,c=[],f=He(i[0]);if(!f)return t;const d=a?function(t,n){const e=He(t),r=He(n);if(!e||!r)return 0;const o=nr(t,n,e,r),i=Ne(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(or(Ke(i[0]),sr(ir(i[0]),ir(i[0]),0,f,d,a)));for(let t=0;t<i.length-1;t++){const n=i[t],e=i[t+1],r=He(n),o=He(e);r&&o?(a&&t>0&&ur(c,n,e,r,o,l),fr(c,n,e,r,o,a,s,l,u)):c.push(or(Ke(e),sr(ir(e),ir(e),1,null!=o?o:[0,0],void 0,a)))}const h=$e(i[i.length-1]);h&&(c[c.length-1].e=h),a&&rr(c);const p={keyframes:c};return void 0!==t.loop&&(p.loop=t.loop),p}function rr(t){let n;for(const e of t){const t=an(e);if(!t||"number"!=typeof t.rotate)continue;if(void 0===n){n=t.rotate;continue}let r=t.rotate;for(;r-n>180;)r-=360;for(;r-n<-180;)r+=360;t.rotate=r,n=r}}function or(t,n){return{t:t,v:n}}function ir(t){const n=an(t);if(n&&"object"==typeof n&&!Array.isArray(n))return n}function ar(t,n,e){if(void 0===t)return n;if(void 0===n)return t;if("number"==typeof t&&"number"==typeof n)return t+(n-t)*e;if(Array.isArray(t)&&Array.isArray(n)&&t.length===n.length){const r=new Array(t.length);for(let o=0;o<t.length;o++){const i="number"==typeof t[o]?t[o]:0,a="number"==typeof n[o]?n[o]:0;r[o]=i+(a-i)*e}return r}return e<.5?t:n}function sr(t,n,e,r,o,i){const a={translate:r},s=new Set;if(t)for(const n of Object.keys(t))s.add(n);if(n)for(const t of Object.keys(n))s.add(t);for(const r of s){if("translate"===r)continue;if("rotate"===r&&i)continue;const o=null==t?void 0:t[r],s=null==n?void 0:n[r];void 0===o&&void 0===s||(a[r]=ar(o,s,e))}return void 0!==o&&(a.rotate=o+lr(t,n,e)),a}function lr(t,n,e){const r="number"==typeof(null==t?void 0:t.rotate)?t.rotate:void 0,o="number"==typeof(null==n?void 0:n.rotate)?n.rotate:void 0;if(void 0===r&&void 0===o)return 0;const i=ar(r,o,e);return"number"==typeof i?i:0}function ur(t,n,e,r,o,i){const a=t[t.length-1],s=an(a),l=null==s?void 0:s.rotate;if("number"!=typeof l)return;const u=ir(n),c=l-lr(u,u,0),f=nr(n,e,r,o),d=Ne(f.P0,f.P1,f.P2,f.P3,0),h=180*Math.atan2(d[1],d[0])/Math.PI,p=function(t,n){let e=t-n;for(;e>180;)e-=360;for(;e<-180;)e+=360;return e}(h,c);if(Math.abs(p)<=i)return;const g=Ke(n),m=Math.min(g+cr,(g+Ke(e))/2),y=sr(ir(n),ir(n),0,r,h,!0);t.push(or(m,y))}var cr=.05;function fr(t,n,e,r,o,i,a,s,l){const u=nr(n,e,r,o),c=Ke(n),f=Ke(e),d=$e(n),h=(p=d)?me([p[1],p[0],p[3],p[2]]):t=>t;var p;const g=ir(n),m=ir(e),y=function(t,n,e,r,o){const i=[];dr(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),dr(t.P0[1],t.P1[1],t.P2[1],t.P3[1],i),i.sort((t,n)=>t-n);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++)hr(a[o],a[o+1],s,t,n,e,r,l);return s}(u,i,a,s,l),v=[];for(const t of y){const n=Ce(u.lut,t),e=Te(u.totalArc>0?n/u.totalArc:t,0,1),r={u:Te(h(e),0,1),p:e,pos:Ve(u.P0,u.P1,u.P2,u.P3,t)};if(i){const n=Ne(u.P0,u.P1,u.P2,u.P3,t);r.rotateDeg=180*Math.atan2(n[1],n[0])/Math.PI}v.push(r)}let b=d,k=0;const A=t.length-1;for(let n=0;n<v.length;n++){const e=v[n],r=k<1?Te((e.u-k)/(1-k),0,1):1,{left:o,right:a}=be(b,r),s=0===n?A:t.length-1;o?t[s].e=o:delete t[s].e;const l=c+e.u*(f-c),u=sr(g,m,e.p,e.pos,e.rotateDeg,i);t.push(or(l,u)),b=a,k=e.u}}function dr(t,n,e,r,o){const i=n-t,a=e-n,s=i-2*a+(r-e),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 hr(t,n,e,r,o,i,a,s){const l=(t+n)/2,u=Ve(r.P0,r.P1,r.P2,r.P3,t),c=Ve(r.P0,r.P1,r.P2,r.P3,n),f=n-t,d=Ve(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=Ve(r.P0,r.P1,r.P2,r.P3,l),p=Ve(r.P0,r.P1,r.P2,r.P3,t+.75*f),g=Math.max(pr(d,u,c),pr(h,u,c),pr(p,u,c));let m=!0;if(o){const e=Ne(r.P0,r.P1,r.P2,r.P3,t),o=Ne(r.P0,r.P1,r.P2,r.P3,n),i=180*Math.atan2(e[1],e[0])/Math.PI,s=180*Math.atan2(o[1],o[0])/Math.PI;let l=Math.abs(i-s);l>180&&(l=360-l),l>a&&(m=!1)}g<=i&&m||s.remaining<=0||f<1e-6?e.push(n):(s.remaining-=1,hr(t,l,e,r,o,i,a,s),hr(l,n,e,r,o,i,a,s))}function pr(t,n,e){const r=e[0]-n[0],o=e[1]-n[1],i=r*r+o*o;if(i<1e-20){const e=t[0]-n[0],r=t[1]-n[1];return Math.sqrt(e*e+r*r)}const a=(t[0]-n[0])*o-(t[1]-n[1])*r;return Math.abs(a)/Math.sqrt(i)}function gr(t,n){const e=mr(t,n);return null!=e?e:t}function mr(t,n){let e,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=mr(t.children[r],n);null!==o&&(e||(e=t.children.slice()),e[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o,e=t.transform;if(e&&"object"==typeof e&&Ye(e)){const o=er(e,n);o!==e&&(r=u(l({},t),{transform:o}))}}if(!e&&!r)return null;const i=l({},t);return e&&(i.children=e),r&&(i.animate=r),i}var yr=1;function vr(t,n){if(t===n)return!0;if(typeof t!=typeof n||null===t||null===n||"object"!=typeof t)return!1;if(Array.isArray(t)!==Array.isArray(n))return!1;const e=Object.keys(t),r=Object.keys(n);return e.length===r.length&&e.every(e=>vr(t[e],n[e]))}function br(t){const n=[];let e;const r=function(t){const n=t.split(/([MLCZmlcz]|[\s,]+)/).map(t=>t.trim()).filter(t=>t&&","!==t),e=[];let r=null;for(const t of n)if(/[MLCZmlcz]/.test(t))r={type:t,values:[]},e.push(r);else if(r){const n=+t;r.values.push(Number.isNaN(n)?0:n)}return e}(t);for(const t of r){const r=t.type,o=t.values;if("M"===r||"m"===r){const t=o[0]||0,r=o[1]||0;e={v:[[t,r]],i:[[t,r]],o:[[t,r]],c:!1},n.push(e);continue}if(e||(e={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},n.push(e)),"L"===r){const t=o[0]||0,n=o[1]||0;e.v.push([t,n]),e.i.push([t,n]),e.o.push([t,n])}else if("C"===r){const t=o[0]||0,n=o[1]||0,r=o[2]||0,i=o[3]||0,a=o[4]||0,s=o[5]||0;e.o[e.o.length-1]=[t,n],e.v.push([a,s]),e.i.push([r,i]),e.o.push([a,s])}else"Z"===r||"z"===r?e.c=!0:console.warn('Unsupported path command "'+r+'"')}return n}function kr(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function Ar(t){return"string"==typeof t&&void 0!==kr(t)}function xr(t){if(t&&"object"==typeof t&&"string"==typeof t.pathData){const n=kr(t.pathData);return n?{paths:br(n)}:t}if(t&&"object"==typeof t&&"paths"in t){const n=t.paths;if(Array.isArray(n)&&n.length>0&&Ar(n[0])){const t=[];for(const e of n){const n=kr(e);n&&t.push(...br(n))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&Ar(t[0])){const n=[];for(const e of t){const t=kr(e);t&&n.push(...br(t))}return{paths:n}}return{paths:t}}if(Ar(t)){return{paths:br(kr(t))}}return t}function wr(t,n){var e;if(t)return Array.isArray(t)?t:(null==(e=null==n?void 0:n.easings)?void 0:e[t])?n.easings[t]:void console.warn("Unknown easing name: "+t)}function jr(t,n){var e;if("string"==typeof t){const r=null==(e=null==n?void 0:n.animations)?void 0:e[t];return r||console.warn("Unknown animation name: "+t),r}return t}function Or(t,n,e,r){var o,i;if("d"===t){return{paths:he(null!=(o=null==n?void 0:n.paths)?o:Array.isArray(n)?n:[],null!=(i=null==e?void 0:e.paths)?i:Array.isArray(e)?e:[],r)}}return we.has(t)?de(n||[0,0,0,1],e||[0,0,0,1],r):"transform"!==t||"object"!=typeof n||null===n||Array.isArray(n)||"object"!=typeof e||null===e||Array.isArray(e)?"rotate"===t&&"number"==typeof n&&"number"==typeof e?ce(n,e,r):je.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?fe(n||[],e||[],r):ce(+(n||0),+(e||0),r):function(t,n,e){const r=new Set([...Object.keys(null!=t?t:{}),...Object.keys(null!=n?n:{})]),o={};for(const i of r){const r=null==t?void 0:t[i],a=null==n?void 0:n[i];if("rotate"===i||"skew"===i)o[i]=ce(+(null!=r?r:0),+(null!=a?a:0),e);else if("translate"===i||"scale"===i||"origin"===i){const t="scale"===i?[1,1]:[0,0];o[i]=fe(r||t,a||t,e)}else o[i]=null!=a?a:r}return o}(n,e,r)}function Sr(t,n,e,r){var o,i,a,s,c;const f=n.length-1,d=Te(null!=(o=e.segmentCount)?o:f,1,f);let h;h=e.repeatAt===Pt.start?n.slice(0,d+1):n.slice(f-d);const p=null!=(i=n[0].t)?i:0,g=null!=(a=n[n.length-1].t)?a:0;let m,y;e.repeatAt===Pt.start?(m=0,y=p):(m=g,y=r);const v=y-m;if(v<=0)return n;const b=null!=(s=h[0].t)?s:0,k=(null!=(c=h[h.length-1].t)?c:0)-b;if(k<=0)return n;const A=h.map(t=>({relT:(t.t-b)/k,v:t.v,e:t.e,tangentIn:ln(t),tangentOut:un(t)})),x=Math.floor(v/k),w=v-x*k,j=w/k,O=[],S=e.repeatAt!==Pt.start,P=n[n.length-1];let M,_=!1;function z(n,e,r){var o;let i;if(e){i=[];for(let t=A.length-1;t>=0;t--)i.push({relT:1-A[t].relT,v:A[t].v,e:t>0?ke(A[t-1].e):void 0,tangentIn:A[t].tangentOut,tangentOut:A[t].tangentIn})}else i=A;const a=void 0!==r?r:1;for(let e=0;e<i.length;e++){const r=i[e];if(r.relT>a+1e-9){const o=i[e-1],s=r.relT-o.relT,l=(a-o.relT)/s,u=o.e?me(o.e)(l):l,c=Or(t,o.v,r.v,u),{left:f}=be(o.e,l);return O.length>0&&o.relT<=a&&(O[O.length-1].e=f),void O.push({t:n+a*k,v:c,e:void 0})}const s=O.length>0?O[O.length-1]:P,l=S&&0===e&&void 0!==s&&Math.abs((null!=(o=s.t)?o:0)-(n+r.relT*k))<1e-9;if(l){if(vr(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:n+r.relT*k+(l?1:0),v:r.v,e:e<i.length-1?r.e:void 0};r.tangentIn&&(u.tangentIn=r.tangentIn),r.tangentOut&&(u.tangentOut=r.tangentOut),O.push(u)}}if(e.repeatAt===Pt.start){if(j>1e-9){!function(n,e,r){let o;if(e){o=[];for(let t=A.length-1;t>=0;t--)o.push({relT:1-A[t].relT,v:A[t].v,e:t>0?ke(A[t-1].e):void 0,tangentIn:A[t].tangentOut,tangentOut:A[t].tangentIn})}else o=A;const i=1-r;for(let e=0;e<o.length;e++){const r=o[e];if(r.relT<i-1e-9)continue;const a=o[e-1];if(a&&a.relT<i-1e-9&&r.relT>i+1e-9){const e=r.relT-a.relT,o=(i-a.relT)/e,s=a.e?me(a.e)(o):o,l=Or(t,a.v,r.v,s),{right:u}=be(a.e,o);O.push({t:n,v:l,e:u})}const s={t:n+(r.relT-i)*k,v:r.v,e:e<o.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),O.push(s)}}(m,e.direction===Mt.alternate&&x%2==0,j)}for(let t=0;t<x;t++){const n=x-1-t,r=e.direction===Mt.alternate&&n%2==0;z(m+w+t*k,r)}}else{for(let t=0;t<x;t++){const n=e.direction===Mt.alternate&&t%2==0;z(m+t*k,n)}if(j>1e-9){const t=e.direction===Mt.alternate&&x%2==0;z(m+x*k,t,j)}}if(e.repeatAt===Pt.start)return[...O,...n];if(_&&n.length>0){return[...n.slice(0,-1),u(l({},n[n.length-1]),{e:M}),...O]}return[...n,...O]}function Pr(t,n,e,r){var o;const i=n.keyframes||[],a=[];for(const n of i){const e=on(n);let i=an(n);const s=sn(n);"d"===t&&(i=xr(i));const l=ze(t)?Ie(t):t;we.has(l)&&(i=null!=(o=xe(i))?o:i);const u={t:e,v:i,e:wr(s,r)},c=ln(n),f=un(n);c&&(u.tangentIn=c),f&&(u.tangentOut=f),a.push(u)}a.sort((t,n)=>{var e,r;return(null!=(e=t.t)?e:0)-(null!=(r=n.t)?r:0)});const s=n.loop,l=!0===s?{}:s||void 0;return l&&a.length>=2?Sr(t,a,l,e):a}function Mr(t,n,e){const r=n.loop;if(null==r||!1===r)return n;const o=!0===r?{}:r,i=n.keyframes;if(!Array.isArray(i)||i.length<2)return n;const a=ze(t)?Ie(t):t,s=we.has(a),l=i.map(n=>{var e;const r=on(n);let o=an(n);"d"===t&&(o=xr(o)),s&&(o=null!=(e=xe(o))?e:o);const i={t:r,v:o,e:sn(n)},a=ln(n),l=un(n);return a&&(i.tangentIn=a),l&&(i.tangentOut=l),i}),u={keyframes:Sr(t,l,o,e)};return void 0!==n.autoOrient&&(u.autoOrient=n.autoOrient),u}function _r(t,n){const e=zr(t,n);return null!=e?e:t}function zr(t,n){let e,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=zr(t.children[r],n);null!==o&&(e||(e=t.children.slice()),e[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o;for(const e of Object.keys(t)){const o=t[e],i=Mr(e,o,n);i!==o&&(r||(r=l({},t)),r[e]=i)}}if(!e&&!r)return null;const i=l({},t);return e&&(i.children=e),r&&(i.animate=r),i}var Dr=0;function Ir(t,n){if(!t)return t;const e=n&&"object"==typeof n&&!Array.isArray(n)?n:function(t){var n,e;if(!t||"string"!=typeof t)return;const r={},o=/([a-zA-Z]+)\s*\(([^)]*)\)/g,i=["translate","rotate","skewX","scale"];let 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!=(n=l[1])?n: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!=(e=l[1])?e:l[0]]}}return t.replace(/([a-zA-Z]+)\s*\(([^)]*)\)/g,"").replace(/[\s,]/g,"").length?void 0:Object.keys(r).length?r:void 0}(n);if(!e||!Object.keys(e).length)return t;const r=t=>t&&"object"==typeof t&&!Array.isArray(t)?l(l({},e),t):t,o=t[Ct];if(o&&"object"==typeof o){const n=o;if(Array.isArray(n.keyframes)){const e=u(l({},n),{keyframes:n.keyframes.map(t=>u(l({},t),{value:r(t.value)}))});return void 0!==e.value&&(e.value=r(e.value)),u(l({},t),{transform:e})}return t}const i=Object.keys(t).filter(t=>je.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 c=u(l({},s),{keyframes:s.keyframes.map(t=>u(l({},t),{value:u(l({},e),{[a]:t.value})}))});void 0!==c.value&&(c.value=u(l({},e),{[a]:c.value}));const f=l({},t);return delete f[a],u(l({},f),{transform:c})}function Tr(t,n=yt.native){const e=qt(t)||{},r=$t(t),o=e.duration||1e3,i=[],a=(t,e,i)=>{if(0===e.length)return null;const a=function(t,n,e,r=yt.native){const o={};for(const[i,a]of Object.entries(t)){if("transform"===i&&"offsetPath"===a.alongPathMode&&void 0!==t.offsetDistance)continue;const s=Pr(i,a,n,e);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===yt.native&&"transform"===i?er(t):t}}return o}(Ir(function(t){const n={};for(const e of t)for(const[t,r]of Object.entries(e))n[t]=r;return n}(e),i),o,r,n);return 0===Object.keys(a).length?null:{id:t,animate:a}},s=Yt(t);if(s)for(const t of s){const n=t.target.startsWith("#")?t.target.slice(1):t.target,e=t.animateWith.map(t=>jr(t,r)).filter(t=>!!t),o=a(n,e);o&&i.push(o)}const l=t=>{const n=t.animate;if(n&&Object.keys(n).length>0){const e=t.id||"_px_el_"+ ++Dr;t.id=e;const o=a(e,function(t,n){if(!t)return[];const e=[];if("string"==typeof t){const r=jr(t,n);r&&e.push(r)}else if(Array.isArray(t))for(const r of t){const t=jr(r,n);t&&e.push(t)}else e.push(t);return e}(n,r),t.transform);o&&i.push(o)}if(t.children)for(let n=0;n<t.children.length;n++)l(t.children[n])};if(t.children)for(let n=0;n<t.children.length;n++)l(t.children[n]);return i}function Vr(t,n,e){var r,o,i,a;const s=n.keyframes||[];if(0===s.length)return null;const{prevKf:l,nextKf:u}=function(t,n){var e,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!=(e=t[s].t)?e:0,u=null!=(r=t[s+1].t)?r:0;if(l<=n&&n<=u){i=t[s],a=t[s+1];break}n>u&&s===o-1&&(i=t[o>0?o-1:0],a=t[o])}return{prevKf:i,nextKf:a}}(s,e);let c=l===u?0:(f=e,d=null!=(r=l.t)?r:0,h=null!=(o=u.t)?o:0,p=0,g=1,h===d?p:p+(f-d)/(h-d)*(g-p));var f,d,h,p,g;c=Te(c,0,1);const m=sn(l);if(m&&Array.isArray(m))try{c=me(m)(c)}catch(t){}let y=ze(t)?Ie(t):t,v=null;const b=null==l?void 0:l.v,k=null==u?void 0:u.v;if("d"===y){v=he(null!=(i=null==b?void 0:b.paths)?i:Array.isArray(b)?b:[],null!=(a=null==k?void 0:k.paths)?a:Array.isArray(k)?k:[],c).map(t=>ue(t)).join("")}else if(we.has(y))v=Ae(de(b||[0,0,0,1],k||[0,0,0,1],c)),y=t;else if("stroke-dasharray"===y)v=fe(b||[],k||[],c).join(" "),y=t;else if("transform"!==y||null===b||"object"!=typeof b||Array.isArray(b))if("translate"===y){v="translate("+fe(b||[0,0],k||[0,0],c).join(",")+")",y="transform"}else if("rotate"===y){v="rotate("+ce(+(b||0),+(k||0),c)+")",y="transform"}else if("scale"===y){v="scale("+fe(b||[1,1],k||[1,1],c).join(",")+")",y="transform"}else{v=ce(+(b||0),+(k||0),c)}else{const t=new Set([...b?Object.keys(b):[],...k?Object.keys(k):[]]),e={};for(const n of t){const t=null==b?void 0:b[n],r=null==k?void 0:k[n];if("rotate"===n||"skew"===n)e[n]=ce(+(null!=t?t:0),+(null!=r?r:0),c);else if("translate"===n||"scale"===n||"origin"===n){const o="scale"===n?[1,1]:[0,0],i=fe(t||o,r||o,c);e[n]=i}}if(Ye(n)){const t=b.translate,r=k.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=function(t,n,e,r,o,i){const a=nr(t,n,e,r),s=0===a.totalArc?o:function(t,n){const e=n*t.ds[t.ds.length-1],{ts:r,ds:o}=t,i=o.length-1;if(e<=0)return r[0];if(e>=o[i])return r[i];let a=1,s=i;for(;a<s;){const t=a+s>>>1;o[t]<e?a=t+1:s=t}const l=o[s-1],u=o[s]-l,c=u>0?(e-l)/u:0;return r[s-1]+c*(r[s]-r[s-1])}(a.lut,o),l=Ve(a.P0,a.P1,a.P2,a.P3,s);if(!i)return{translate:l};const u=Ne(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,!!n.autoOrient);e.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(e.rotate=o.rotateDeg)}}v=Se(e,{withUnits:!1}),y="transform"}return Oe.has(y)&&"number"==typeof v&&(v=100*v+"%"),{k:y,v:null===v?"":""+v}}function Er(t,n){const e={};for(const[r,o]of Object.entries(t)){const t=Vr(r,o,n);t&&(e[t.k]=t.v)}return e}var Nr=/[MmLlHhVvCcSsQqTtAaZz]/;function Lr(t,n,e){return{P1:[t[0]+2/3*(n[0]-t[0]),t[1]+2/3*(n[1]-t[1])],P2:[e[0]+2/3*(n[0]-e[0]),e[1]+2/3*(n[1]-e[1])]}}function Ur(t){const n=function(t){const n=function(t){const n=[],e=/([MmLlHhVvCcSsQqTtAaZz])|(-?\d*\.?\d+(?:[eE][-+]?\d+)?)/g;let r;for(;null!==(r=e.exec(t));)n.push(r[0]);return n}(t),e=[];let r=0,o=0,i=0,a=0,s=0,l=0,u=0,c=0,f=0,d="";const h=()=>parseFloat(n[r++]),p=(t,n,r)=>{const a=[o,i],s=Ue(a,t,n,r,48);e.push({P0:a,P1:t,P2:n,P3:r,lut:s,len:s.ds[s.ds.length-1]}),o=r[0],i=r[1]},g=(t,n)=>{p([o+(t-o)/3,i+(n-i)/3],[o+2*(t-o)/3,i+2*(n-i)/3],[t,n])};for(;r<n.length;){let t=n[r];Nr.test(t)?r++:t="M"===d?"L":"m"===d?"l":d;const e=t>="a",m=t.toUpperCase();if("Z"!==m){if("M"===m){const n=h()+(e?o:0),r=h()+(e?i:0);o=n,i=r,a=n,s=r,d=t;continue}if("L"===m)g(h()+(e?o:0),h()+(e?i:0));else if("H"===m)g(h()+(e?o:0),i);else if("V"===m)g(o,h()+(e?i:0));else if("C"===m){const t=[h()+(e?o:0),h()+(e?i:0)],n=[h()+(e?o:0),h()+(e?i:0)],r=[h()+(e?o:0),h()+(e?i:0)];l=n[0],u=n[1],p(t,n,r)}else if("S"===m){const t="C"===d.toUpperCase()||"S"===d.toUpperCase()?[2*o-l,2*i-u]:[o,i],n=[h()+(e?o:0),h()+(e?i:0)],r=[h()+(e?o:0),h()+(e?i:0)];l=n[0],u=n[1],p(t,n,r)}else if("Q"===m){const t=[h()+(e?o:0),h()+(e?i:0)],n=[h()+(e?o:0),h()+(e?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=Lr([o,i],t,n);p(r,a,n)}else if("T"===m){const t="Q"===d.toUpperCase()||"T"===d.toUpperCase()?[2*o-c,2*i-f]:[o,i],n=[h()+(e?o:0),h()+(e?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=Lr([o,i],t,n);p(r,a,n)}else{if("A"!==m){r++;continue}r+=5,g(h()+(e?o:0),h()+(e?i:0))}d=t}else g(a,s),o=a,i=s,d=t}return e.length?e:null}(t);if(!n)return null;const e=new Float64Array(n.length+1);for(let t=0;t<n.length;t++)e[t+1]=e[t]+n[t].len;const r=e[n.length],o=n[0].P0,i=n[n.length-1].P3,a=Math.hypot(i[0]-o[0],i[1]-o[1])<.001,s=t=>{let r=0;for(;r<n.length-1&&t>e[r+1];)r++;const o=n[r],i=t-e[r],a=o.len>0?function(t,n){const{ts:e,ds:r}=t,o=r.length-1;if(n<=0)return e[0];if(n>=r[o])return e[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;r[t]<n?i=t+1:a=t}const s=r[a-1],l=r[a]-s,u=l>0?(n-s)/l:0;return e[a-1]+u*(e[a]-e[a-1])}(o.lut,i):0,[s,l]=Ve(o.P0,o.P1,o.P2,o.P3,a),[u,c]=Ne(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 n=t<0?0:r,e=s(n),o=t-n;return{x:e.x+Math.cos(e.angle)*o,y:e.y+Math.sin(e.angle)*o,angle:e.angle}}return s((o=r,(n=t)<(e=0)?e:n>o?o:n));var n,e,o}}}function Cr(t,n,e){const r={};return"translate"===t?r.translate=n:"rotate"===t?r.rotate=n:"skew"===t?r.skew=n:r.scale=n,e&&"translate"!==t&&(r.origin=e),r}function Wr(t){var n,e;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(Rr),autoOrient:r.autoOrient,loop:r.loop},e=null!=(n=r.value)?n:r.v;return void 0!==e&&"animated"===t.kind&&(t.base=e),t}const i=null!=(e=r.value)?e:r.v;if(void 0!==i)return{kind:"static",value:i}}return{kind:"static",value:t}}function Fr(t,n,e,r){var o,i,a,s;const u=t=>(null==r?void 0:r.asString)&&null!=t?String(t):t;if("absent"===e.kind)return;if("static"===e.kind)return void(t[n]=u(e.value));const c=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,f=l({},c||{}),d={keyframes:e.keyframes};void 0!==e.loop&&(d.loop=e.loop),void 0!==e.autoOrient&&(d.autoOrient=e.autoOrient),f[n]=d,t.animate=f;const h=null!=(s=null!=(i=e.base)?i:null==(o=e.keyframes[0])?void 0:o.value)?s:null==(a=e.keyframes[0])?void 0:a.v;void 0!==h&&(t[n]=u(h))}function Rr(t){if(!t||"object"!=typeof t)return t;const n=t;if(void 0===n.t&&void 0===n.v&&void 0===n.e&&void 0===n.to&&void 0===n.ti)return t;const e=l({},n);return void 0===e.time&&void 0!==n.t&&(e.time=n.t),void 0===e.value&&void 0!==n.v&&(e.value=n.v),void 0===e.easing&&void 0!==n.e&&(e.easing=n.e),void 0===e.tangentOut&&void 0!==n.to&&(e.tangentOut=n.to),void 0===e.tangentIn&&void 0!==n.ti&&(e.tangentIn=n.ti),e}function Br(t,n){var e;const r=Wr(t);if("absent"!==r.kind)return"static"===r.kind?r.value:(n.warnings.push("transformBy.origin: animated origin approximated by its first keyframe"),null==(e=r.keyframes[0])?void 0:e.value)}function Gr(t,n){const e={value:n};return void 0!==t.time&&(e.time=t.time),void 0!==t.easing&&(e.easing=t.easing),void 0!==t.tangentOut&&(e.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(e.tangentIn=t.tangentIn),e}function Zr(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Zr);const n={};for(const e of Object.keys(t))n[e]=Zr(t[e]);return n}function Jr(t,n){const e=new Map,r=t=>{var o;if("string"==typeof t.id){const r=n();e.set(t.id,r),t.id=r}null==(o=t.children)||o.forEach(r)};r(t);const o=t=>t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t}),i=t=>{var n;if("string"==typeof t.href&&t.href.startsWith("#")){const n=e.get(t.href.slice(1));n&&(t.href="#"+n)}for(const n of Object.keys(t)){if("children"===n||"effects"===n||"meta"===n||"animate"===n||"href"===n||"id"===n)continue;const e=t[n];"string"==typeof e&&-1!==e.indexOf("url(#")&&(t[n]=o(e))}null==(n=t.children)||n.forEach(i)};return i(t),e}function qr(t){const n="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(n)?n:0}function Qr(t){var n;const e=qr(t.x),r=qr(t.y);if(delete t.x,delete t.y,!e&&!r)return t;const o="translate("+e+","+r+")";if(void 0!==t.transform||void 0!==t.animate){const e={type:"g",transform:o,children:null!=(n=t.children)?n:[]};t.children=[e]}else t.transform=o;return t}function Xr(t,n){return"_lw_"+n+"_"+t.nextId++}function Hr(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function Kr(t,n){var e;"string"==typeof t.id&&n.set(t.id,t),null==(e=t.children)||e.forEach(t=>Kr(t,n))}function $r(t,n){if(!n.length)return;(t.children||(t.children=[])).unshift({type:"defs",children:n})}var Yr=Zr;function to(t,n){return Jr(t,()=>Xr(n,"retimed"))}function no(t){const n=Wr(t);if("static"===n.kind&&"number"==typeof n.value)return{min:n.value,max:n.value};if("animated"===n.kind&&n.keyframes.length){const t=n.keyframes.map(t=>Number(t.value)||0);return{min:Math.min(...t),max:Math.max(...t)}}return{min:0,max:0}}function eo(t){let n=0,e=16;const r=t=>{var o;const i=parseFloat(String(null!=(o=t.fontSize)?o:""))||0;i&&(e=Math.max(e,i));const a=t.textContent;if("string"==typeof a&&(n+=a.length),t.children)for(const n of t.children)r(n)};return r(t),n*e}var ro=t=>Math.round(1e3*t)/1e3;function oo(t,n){var e;if("clip"===n.pathOverflow)return{d:t,startShift:0};const r=Ur(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,i=.15*o,a=no(n.startOffset),s=no(n.textLength).max||(null!=(e=n.advance)?e: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 n=d.x-Math.cos(d.angle)*c,e=d.y-Math.sin(d.angle)*c,r=t.replace(/^\s*[Mm]\s*-?[\d.]+[\s,]+-?[\d.]+/,"");p="M"+ro(n)+","+ro(e)+"L"+ro(d.x)+","+ro(d.y)+r}if(f>0){const t=h.x+Math.cos(h.angle)*f,n=h.y+Math.sin(h.angle)*f;p+="L"+ro(t)+","+ro(n)}return{d:p,startShift:c}}function io(t,n,e){var r;if(!n||"string"!=typeof n.pathData||!n.pathData)return t;const o=Xr(e,"tpath"),{d:i,startShift:a}=oo(n.pathData,{pathOverflow:n.pathOverflow,startOffset:n.startOffset,textLength:n.textLength,advance:eo(t)});e.defs.push({type:"path",id:o,d:i});const s={type:"textPath",href:"#"+o,children:null!=(r=t.children)?r:[]};return void 0!==n.lengthAdjust&&(s.lengthAdjust=n.lengthAdjust),void 0!==n.method&&(s.method=n.method),void 0!==n.spacing&&(s.spacing=n.spacing),ao(s,"startOffset",function(t,n){if(!n||null==t)return t;const e=Wr(t);if("absent"===e.kind)return t;if("static"===e.kind)return"number"==typeof t?e.value+n:{value:e.value+n};const r={keyframes:e.keyframes.map(t=>u(l({},t),{value:(Number(t.value)||0)+n}))};return void 0!==e.loop&&(r.loop=e.loop),void 0!==e.autoOrient&&(r.autoOrient=e.autoOrient),void 0!==e.base&&(r.value=e.base+n),r}(n.startOffset,a)),ao(s,"textLength",n.textLength),t.children=[s],t}function ao(t,n,e){null!=e&&Fr(t,n,Wr(e),{asString:!0})}var so=(t,n,e)=>{const r={type:t};for(const t in n)void 0!==n[t]&&(r[t]=n[t]);const o=Array.isArray(e)?e.filter(t=>null!=t):null!=e?[e]:[];return o.length&&(r.children=o),r};function lo(t,n){return Math.round(t)===t?""+Math.round(t):t.toFixed(n)}function uo(t,n){let e="";for(let r=0;r<t.length;r++){const o=lo(t[r],n);r>0&&45!==o.charCodeAt(0)&&(e+=" "),e+=o}return e}function co(t,n,e){return[t[0]*n+t[2]*e+t[4],t[1]*n+t[3]*e+t[5]]}var fo=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function ho(t,n,e=2){const r=[];let o;for(fo.lastIndex=0;null!==(o=fo.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]=co(n,s(),s());i+=t+uo([r,o],e)}else if("C"===t){const[t,r]=co(n,s(),s()),[o,a]=co(n,s(),s()),[l,u]=co(n,s(),s());i+="C"+uo([t,r,o,a,l,u],e)}else if("Q"===t){const[t,r]=co(n,s(),s()),[o,a]=co(n,s(),s());i+="Q"+uo([t,r,o,a],e)}else"Z"!==t&&"z"!==t||(i+="Z")}return i}var po=["fontFamily","fontSize","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","textDecoration","textTransform","whiteSpace","x","y","dx","dy","lengthAdjust","fill","stroke","strokeWidth","effects",Lt,"xml:space"],go=["fillOpacity","fillRule","strokeOpacity","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","mixBlendMode","filter"],mo=["fill","stroke","strokeWidth","opacity","fillOpacity","strokeOpacity","strokeDasharray","strokeDashoffset"];function yo(t){if("number"==typeof t)return t;if("string"==typeof t){const n=parseFloat(t);return isNaN(n)?void 0:n}}function vo(t){return"string"==typeof t?t:void 0}function bo(t){const n=t.animate;if(!n||"object"!=typeof n)return;let e;for(const t of mo)void 0!==n[t]&&((null!=e?e:e={})[t]=n[t]);return e}function ko(t,n){var e,r,o,i,a,s,l,u,c,f;const d="text"===t.type,h=t.style,p=n=>{var e;return d?void 0:null!=(e=t[n])?e:null==h?void 0:h[n]},g={fontFamily:null!=(e=vo(t.fontFamily))?e:n.fontFamily,fontSize:null!=(r=yo(t.fontSize))?r:n.fontSize,fill:null!=(o=t.fill)?o:n.fill,stroke:null!=(i=t.stroke)?i:n.stroke,strokeWidth:null!=(a=t.strokeWidth)?a:n.strokeWidth,letterSpacing:null!=(s=yo(t.letterSpacing))?s:n.letterSpacing,wordSpacing:null!=(l=yo(t.wordSpacing))?l:n.wordSpacing,opacity:null!=(u=yo(p("opacity")))?u:n.opacity,animate:null!=(c=d?void 0:bo(t))?c:n.animate};for(const t of go){const e=null!=(f=p(t))?f:n[t];void 0!==e&&(g[t]=e)}return g}function Ao(t){var n,e,r;return{fontFamily:vo(t.fontFamily),fontSize:null!=(n=yo(t.fontSize))?n:16,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(e=yo(t.letterSpacing))?e:0,wordSpacing:null!=(r=yo(t.wordSpacing))?r:0}}function xo(t){const n={};void 0!==t.fill&&(n.fill=t.fill),void 0!==t.stroke&&(n.stroke=t.stroke),void 0!==t.strokeWidth&&(n.strokeWidth=t.strokeWidth),void 0!==t.opacity&&1!==t.opacity&&(n.opacity=t.opacity);for(const e of go)void 0!==t[e]&&(n[e]=t[e]);return void 0!==t.animate&&(n.animate=t.animate),n}function wo(t,n,e,r){var o;const i=t.fontFamily?n[t.fontFamily]:e;return i||null==r||r.push('textGlyphs: no glyphs for font "'+(null!=(o=t.fontFamily)?o:"")+'"'),i}function jo(t){const n=Object.keys(t);return 1===n.length?t[n[0]]:void 0}function Oo(t,n){if(t<=0||n<=0)return"";const e=.08,r=t*e,o=.92*t,i=.92*-n,a=o-r,s=-i,l=Math.max(1,.12*Math.min(a,s)),u="M"+r+" 0L"+o+" 0L"+o+" "+i+"L"+r+" "+i+"Z";if(a<=2*l||s<=2*l)return u;const c=r+l,f=o-l,d=-l,h=i+l;return u+"M"+c+" "+d+"L"+c+" "+h+"L"+f+" "+h+"L"+f+" "+d+"Z"}function So(t,n){var e,r,o;const{glyphs:i,create:a=so,warnings:s}=n,l=jo(i),u={x:null!=(e=yo(t.x))?e:0,y:null!=(r=yo(t.y))?r:0},c=[],f=[{start:u.x,end:u.x}];let d=0;const h=(t,n)=>{var e;const r=wo(n,i,l,s),o=(null==r?void 0:r.unitsPerEm)||1e3,a=n.fontSize/o,h=null!=(e=null==r?void 0:r.ascent)?e:.9*o,p=xo(n);for(let e=0;e<t.length;e++){const i=t.charAt(e),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:.6*o;c.push({glyphD:Oo(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+=n.letterSpacing+(" "===i?n.wordSpacing:0),f[d].end=u.x}},p=(t,n)=>{var e,r,o;const i=ko(t,n),a=yo(t.x),s=yo(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!=(e=yo(t.dx))?e:0,u.y+=null!=(r=yo(t.dy))?r:0;const l=vo(t[Lt]);if(l&&!(null==(o=t.children)?void 0:o.length)&&h(l,i),t.children)for(const n of t.children)p(n,i)},g=Ao(t);if(t.children)for(const n of t.children)p(n,g);const m=vo(t[Lt]);m&&!(null==(o=t.children)?void 0:o.length)&&h(m,g);const y=vo(t.textAnchor);if("middle"===y||"end"===y)for(const t of c){const n=f[t.line].end-f[t.line].start,e="middle"===y?-n/2:-n;t.m=[t.scale,0,0,t.scale,t.x+e,t.y]}return Uo(t,Lo(c,a,s),a)}function Po(t,n){var e,r,o,i,a;if(null==(e=n.alongPath)?void 0:e.pathD)return function(t,n,e){var r,o;const{glyphs:i,warnings:a,alongPath:s}=e,l=Ur(n);if(!l)return null==a||a.push("textGlyphs: unparsable along-path geometry (caret)"),[];const u=jo(i),c=[];let f=0;const d=(t,n)=>{var e,r;const o=ko(t,n),s=vo(t[Lt]);if(s&&!(null==(e=t.children)?void 0:e.length)){const t=wo(o,i,u,a),n=(null==t?void 0:t.unitsPerEm)||1e3,e=o.fontSize/n,l=(null!=(r=null==t?void 0:t.ascent)?r:.9*n)*e;for(let n=0;n<s.length;n++){const r=s.charAt(n),i=null==t?void 0:t.glyphs[r],a=(i?i.width:0)*e,u=a+o.letterSpacing+(" "===r?o.wordSpacing:0);c.push({advStart:f,advEnd:f+u,glyphW:a,ascent:l,fontSize:o.fontSize}),f+=u}}if(t.children)for(const n of t.children)d(n,o)};d(t,Ao(t));const h=f,p=Wr(null==s?void 0:s.textLength),g="animated"===p.kind?Number(null==(r=p.keyframes[0])?void 0:r.value)||0:"static"===p.kind&&Number(p.value)||0,m=g>0&&h>0?g/h:1,y=Wr(null==s?void 0:s.startOffset),{along:v,perp:b}=_o(t),k=v+("animated"===y.kind?Number(null==(o=y.keyframes[0])?void 0:o.value)||0:"static"===y.kind&&Number(y.value)||0),A=t=>({x:t.x-b*Math.sin(t.angle),y:t.y+b*Math.cos(t.angle),angle:t.angle});return c.map(t=>{const n=k+t.advStart*m,e=k+t.advEnd*m,r=A(l.sampleAtDistance(n)),o=A(l.sampleAtDistance(e)),i=l.sampleAtDistance(k+(t.advStart+t.glyphW/2)*m);return{x:r.x,y:r.y,width:t.advEnd-t.advStart,ascent:t.ascent,fontSize:t.fontSize,endX:o.x,endY:o.y,rotation:180*i.angle/Math.PI}})}(t,n.alongPath.pathD,n);const{glyphs:s,warnings:l}=n,u=jo(s),f={x:null!=(r=yo(t.x))?r:0,y:null!=(o=yo(t.y))?o:0},d=[],h=[{start:f.x,end:f.x}];let p=0;const g=(t,n)=>{var e;const r=wo(n,s,u,l),o=(null==r?void 0:r.unitsPerEm)||1e3,i=n.fontSize/o,a=(null!=(e=null==r?void 0:r.ascent)?e:.9*o)*i;for(let e=0;e<t.length;e++){const o=t.charAt(e),s=null==r?void 0:r.glyphs[o],l=(s?s.width:0)*i+n.letterSpacing+(" "===o?n.wordSpacing:0);d.push({x:f.x,y:f.y,width:l,ascent:a,fontSize:n.fontSize,line:p}),f.x+=l,h[p].end=f.x}},m=(t,n)=>{var e,r,o;const i=ko(t,n),a=yo(t.x),s=yo(t.y);void 0!==a&&(f.x=a,p=h.length,h.push({start:f.x,end:f.x})),void 0!==s&&(f.y=s),f.x+=null!=(e=yo(t.dx))?e:0,f.y+=null!=(r=yo(t.dy))?r:0;const l=vo(t[Lt]);if(l&&!(null==(o=t.children)?void 0:o.length)&&g(l,i),t.children)for(const n of t.children)m(n,i)},y=Ao(t);if(t.children)for(const n of t.children){const t=d.length;if(m(n,y),d.length===t){const t=ko(n,y),e=wo(t,s,u),r=(null==e?void 0:e.unitsPerEm)||1e3;d.push({x:f.x,y:f.y,width:0,ascent:(null!=(i=null==e?void 0:e.ascent)?i:.9*r)*(t.fontSize/r),fontSize:t.fontSize,line:p})}}const v=vo(t[Lt]);v&&!(null==(a=t.children)?void 0:a.length)&&g(v,y);const b=vo(t.textAnchor);if("middle"===b||"end"===b)for(const t of d){const n=h[t.line].end-h[t.line].start;t.x+="middle"===b?-n/2:-n}return d.map(t=>{var n=t,{line:e}=n;return c(n,["line"])})}function Mo(t,n,e,r,o=0){const{x:i,y:a,angle:s}=t.sampleAtDistance(n),l=Math.cos(s),u=Math.sin(s),c=r/2;return[e*l,e*u,-e*u,e*l,i-e*l*c-o*u,a-e*u*c+o*l]}function _o(t){var n,e,r;return{along:(null!=(n=yo(t.x))?n:0)+(null!=(e=yo(t.dx))?e:0),perp:null!=(r=yo(t.dy))?r:0}}function zo(t,n,e,r,o,i){const{glyphs:a,create:s=so,warnings:c}=r,f=n?Ur(n):null;if(!f)return null==c||c.push("textGlyphs: unparsable along-path geometry"),null;const d=jo(a),{cells:h,width:p}=function(t,n,e,r){const o=[];let i=0;const a=(t,s)=>{var l,u;const c=ko(t,s),f=vo(t[Lt]);if(f&&!(null==(l=t.children)?void 0:l.length)){const t=wo(c,n,e,r);if(t){const n=c.fontSize/t.unitsPerEm,e=null!=(u=t.ascent)?u:.9*t.unitsPerEm,r=xo(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*n;o.push({glyphD:l.pathData,widthEm:l.width,scale:n,paint:r,midBase:i+t/2}),i+=t}else if(/\S/.test(s)){const a=l&&l.width>0?l.width:.6*t.unitsPerEm,s=a*n;o.push({glyphD:Oo(a,e),widthEm:a,scale:n,paint:r,isMissing:!0,midBase:i+s/2}),i+=s}else i+=(l?l.width:0)*n;i+=c.letterSpacing+(" "===s?c.wordSpacing:0)}}}if(t.children)for(const n of t.children)a(n,c)};return a(t,Ao(t)),{cells:o,width:i}}(t,a,d,c);if(!h.length)return Uo(t,[],s);const{along:g,perp:m}=_o(t),y=Do(e),v=Do(o),b=t=>t>0&&p>0?t/p:1,k="clip"===i&&!f.closed;if(y.animated||v.animated){const n=function(t,n){const e=[...t,...n].sort((t,n)=>t-n),r=[];for(const t of e)r.length&&t===r[r.length-1]||r.push(t);return r}(y.times,v.times),e=(t,n)=>g+y.at(n)+b(v.at(n))*t.midBase,r=y.animated?y.loop:v.loop;return Uo(t,function(t,n,e,r,o,i,a,s=0){const c=Math.max(n.totalLength/Io,.5),f=t=>t>=0&&t<=n.totalLength,d=[];for(const h of t){const t=[h.scale,0,0,h.scale,-h.scale*(h.widthEm/2),0],p=ho(h.glyphD,t),g=(t,e)=>{const{x:r,y:o,angle:i}=n.sampleAtDistance(t),a=Math.cos(i),l=Math.sin(i);return{time:e,value:{translate:[Vo(r-s*l,3),Vo(o+s*a,3)],rotate:Vo(180*i/Math.PI,3)}}},m=[],y=[],v=(t,n)=>{m.push(g(t,n)),a&&y.push({time:n,value:f(t)?1:0})};v(e(h,r[0]),r[0]);for(let t=1;t<r.length;t++){const n=r[t-1],o=r[t],i=e(h,n),a=e(h,o),s=Math.min(To,Math.max(1,Math.ceil(Math.abs(a-i)/c)));for(let t=1;t<=s;t++){const r=n+t/s*(o-n);v(e(h,r),r)}}rr(m);const b={keyframes:m};void 0!==o&&(b.loop=o);const k={transform:b};if(h.paint.animate&&Object.assign(k,h.paint.animate),a&&y.some(t=>0===t.value)){const t={keyframes:y};void 0!==o&&(t.loop=o),k.opacity=t}d.push(i("path",u(l(l({d:p},Eo(h.paint)),No(h.isMissing)),{animate:k}),[]))}return d}(h,f,e,n,r,s,k,m),s)}const A=b(v.at(0)),x=g+y.at(0);return Uo(t,Lo((k?h.filter(t=>{const n=x+t.midBase*A;return n>=0&&n<=f.totalLength}):h).map(t=>({glyphD:t.glyphD,paint:t.paint,isMissing:t.isMissing,m:Mo(f,x+t.midBase*A,t.scale,t.widthEm,m)})),s,c),s)}function Do(t){var n;const e=Wr(t);if("animated"===e.kind&&e.keyframes.length>=2){const t=[...e.keyframes].sort((t,n)=>(Number(t.time)||0)-(Number(n.time)||0)),n=t.map(t=>Number(t.time)||0),r=t.map(t=>Number(t.value)||0);return{animated:!0,times:n,loop:e.loop,at(t){if(t<=n[0])return r[0];for(let e=1;e<n.length;e++)if(t<=n[e]){const o=n[e]-n[e-1],i=o>0?(t-n[e-1])/o:1;return r[e-1]+i*(r[e]-r[e-1])}return r[r.length-1]}}}const r="animated"===e.kind?Number(null==(n=e.keyframes[0])?void 0:n.value)||0:"static"===e.kind&&Number(e.value)||0;return{animated:!1,times:[],at:()=>r}}var Io=48,To=64;function Vo(t,n){const e=a(10,n);return Math.round(t*e)/e}function Eo(t){const n={};void 0!==t.fill&&(n.fill=t.fill),void 0!==t.stroke&&(n.stroke=t.stroke),void 0!==t.strokeWidth&&(n.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(n.opacity=t.opacity);for(const e of go)void 0!==t[e]&&(n[e]=t[e]);return n}function No(t){return t?{[Ut]:"px-missing-glyph"}:{}}function Lo(t,n,e){if(!t.length)return null==e||e.push("textGlyphs: nothing to render"),[];const r=new Map;for(const n of t){const t=JSON.stringify([n.paint,!!n.isMissing]),e=ho(n.glyphD,n.m),o=r.get(t);o?o.d+=e:r.set(t,{paint:n.paint,d:e,isMissing:n.isMissing})}const o=[];for(const{paint:t,d:e,isMissing:i}of r.values())o.push(n("path",l(l(l({d:e},Eo(t)),No(i)),void 0!==t.animate?{animate:l({},t.animate)}:{}),[]));return o}function Uo(t,n,e){const r={};for(const n of Object.keys(t))"type"!==n&&"children"!==n&&-1===po.indexOf(n)&&(r[n]=t[n]);if(r.style&&"object"==typeof r.style){const t=l({},r.style);delete t["white-space"],Object.keys(t).length?r.style=t:delete r.style}return e("g",r,n)}function Co(t,n){return n.alongPath?zo(t,n.alongPath.pathD,n.alongPath.startOffset,n,n.alongPath.textLength,n.alongPath.pathOverflow):So(t,n)}function Wo(t,n,e){return(null==n?void 0:n.useGlyphs)?e.glyphs?So(t,{glyphs:e.glyphs,warnings:e.warnings}):(e.warnings.push("textGlyphs: no definitions.fonts — left as native <text>"),t):t}function Fo(t,n,e,r,o,i){return n.glyphs?zo(t,e,r,{glyphs:n.glyphs,warnings:n.warnings},o,i):(n.warnings.push("textGlyphs: no definitions.fonts"),null)}var Ro={document:"document",host:"host",platform:"platform",usage:"usage",internal:"internal"};function Bo(t,n){const e=n?n+" ":"";return{warn:(n,r,o)=>{if(null==t?void 0:t.onWarn)return void t.onWarn({kind:n,message:r,detail:o});if(null==t?void 0:t.muteWarn)return;const i=e+n+": "+r;void 0===o?console.warn(i):console.warn(i,o)},error:(n,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:n,message:i.message,error:i,detail:o});if(null==t?void 0:t.muteError)return;const a=e+n+": "+i.message;void 0===o?console.error(a):console.error(a,o)}}}function Go(t){try{return{problems:Kn(t)}}catch(t){return{problems:[]}}}function Zo(t,n){const{problems:e}=Go(t);if(!e.length)return;const r=e.slice(0,6),o=e.length-r.length;console.warn(n+": this document does not match the animation schema in "+e.length+" place"+(1===e.length?"":"s")+".\n"+r.map(t=>" - "+t).join("\n")+(o>0?"\n … and "+o+" 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.")}export{l as __spreadValues,u as __spreadProps,f as PX_UNKNOWN_KEY_ERROR,z as schemaKeys,D as describeSchema,T as px,V as PX_WIRE_SCHEMA_VERSION,E as PX_WIRE_VERSION_KEY,L as PxWireVersionRelation,C as parseWireVersion,W as formatWireVersion,F as PX_WIRE_VERSION,G as readWireVersion,Z as compareWireVersion,J as wireVersionAdvice,q as PxWireStepKind,Q as PX_WIRE_BASELINE_VERSION,X as PX_WIRE_STEPS,H as applyWireSteps,K as convertWireDocument,tt as downgradeWireDocument,nt as PxFillMode,et as PxPlaybackDirection,rt as PX_ANIM_SRC_ATTR_NAME,ot as PX_ANIM_ATTR_NAME,it as PxStartOn,at as PxOutAction,st as PxFinishAction,lt as PxScrollKind,ut as PxScrollAxis,ct as PxScrollSource,ft as PxPinAlign,dt as PxScrollPhase,ht as PxAlongPathMode,pt as PX_TIMELINE_SHARED_KEYS,gt as PX_TIME_ONLY_TIMELINE_KEYS,yt as PxTimelineEngine,vt as PxTimelineEngineSetting,bt as resolveTimelineEngine,kt as isNativeForced,At as mayUseNativeScrollTimeline,xt as PX_TRIGGER_DEFAULTS,wt as PxControlMode,jt as resolveControlMode,Ot as controlModeTakesOverTrigger,St as resolveTrigger,Pt as PxLoopRepeatAt,Mt as PxLoopDirection,_t as PxMaskType,zt as PxUnits,Dt as PxCloneWithout,It as PxPathOverflow,Tt as PxLengthAdjust,Vt as PxTextPathMethod,Et as PxTextPathSpacing,Nt as PxStrokeTrimSubPaths,Lt as PX_TEXT_CONTENT_ATTR,Ct as TRANSFORM_ATTR,Wt as OFFSET_DISTANCE_ATTR,Rt as TRANSFORM_PART,Bt as PX_TRANSFORM_PART_KEYS,Gt as PxGradientSpreadMethod,Zt as PxGradientType,Jt as isPxDocument,qt as getAnimatorConfig,Ht as flattenAnimatorTimeline,Kt as nestAnimatorTimeline,$t as getDefinitions,Yt as getBindings,tn as getChildren,en as PxKeyframeValueSchema,rn as PxKeyframeSchema,on as keyframeTime,an as keyframeValue,sn as keyframeEasing,ln as keyframeTangentIn,un as keyframeTangentOut,cn as PxLoopSchema,fn as PxPropertyAnimationSchema,dn as PxTransformPartsSchema,hn as PxTransformValueSchema,gn as PxElementAnimationSchema,mn as PxTriggerSchema,bn as PxDefinitionsSchema,kn as PxScrollRangePointSchema,An as PxScrollRangeSchema,xn as PxScrollSchema,_n as PxTimelineSchema,Dn as PxAnimatorConfigSchema,In as PxAttrValueSchema,Nn as PxTransformByEffectSchema,Ln as PxRepeaterEffectSchema,Un as PxMaskedByEffectSchema,Cn as PxClipPathEffectSchema,Wn as PxStrokeTrimEffectSchema,Fn as PxRetimeEffectSchema,Rn as PxCloneEffectSchema,Bn as PxGradientStopSchema,Zn as PxFillGradientEffectSchema,qn as PxTextPathEffectSchema,Qn as PxTextEffectSchema,Xn as PxEffectsSchema,Hn as validateNodeEffects,Kn as validateDocument,$n as PxNodeBaseSchema,Yn as PxNodeSchema,te as PxSvgNodeRootSchema,ne as PxAnimatedSvgDocumentSchema,ee as PxBezierPathSchema,re as isValidPxDocument,ie as generateUniqueId,ae as deepClone,se as generateNewIds,ue as bezierToSvgPath,me as cubicBezier,ve as subdivideCubicBezier,be as splitEasing,ke as reverseEasing,Ae as toRGBA,we as PX_COLOR_ATTR_NAMES,je as PX_TRANSFORM_FN_NAMES,Oe as PX_PCT_BASED_ATTR_NAMES,Se as composeTransformParts,Pe as PX_STYLE_ATTR_NAMES,Me as PX_DEFAULT_DURATION_MS,_e as kebabToCamelCaseWord,Ie as camelCaseToKebabWordIfNeeded,Te as clamp,Ue as bezier2D_arcLengthLUT,We as PX_DISALLOWED_SVG_TAGS_LOWER,Be as PX_CSS_ONLY_STYLE_PROPS,Qe as sanitizeAttributeValue,Xe as toDomProps,er as materializeMotionPathInPropAnim,gr as materializeMotionPathsInTree,yr as PX_LOOP_JUMP_SHIFT_MS,br as parseSvgPathToBezier,Or as interpolateValue,_r as materializeInternalLoopsInTree,Ir as mergeStaticTransformIntoAnimDef,Tr as normalizeBindings,Er as calcAnimationValues,Cr as partsRecord,Wr as readAnimatable,Fr as writeAnimatableChannel,Br as readStaticOrigin,Gr as keyframeWith,Zr as deepClonePxNode,Jr as regenerateIdsAndRewriteRefs,Qr as applyUseOffsetToG,Xr as genId,Hr as stripHash,Kr as indexById,$r as spliceDefs,Yr as clone,to as regenerateIdsInClone,Ur as createPathSampler,oo as extendedPathForBrowser,io as applyTextPathEffect,Po as layoutGlyphTextChars,zo as materializeGlyphTextAlongPath,Co as materializeGlyphText,Wo as applyTextGlyphsEffect,Fo as applyTextGlyphsAlongPath,Ro as PxDiagnosticKind,Bo as createDiagnostics,Go as diagnoseDocument,Zo as reportDocumentDiagnostics};