@pixodesk/svg-animator-core 1.0.41 → 1.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ var t=Object.defineProperty,e=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,s=Math.pow,a=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,l=(t,e)=>{for(var n in e||(e={}))o.call(e,n)&&a(t,n,e[n]);if(r)for(var n of r(e))i.call(e,n)&&a(t,n,e[n]);return t},u=(t,r)=>e(t,n(r)),c=(t,e)=>{var n={};for(var s in t)o.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&r)for(var s of r(t))e.indexOf(s)<0&&i.call(t,s)&&(n[s]=t[s]);return n},f="unexpected extra key";function d(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}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,e,n){return null==t||this.inner.isValid(t,e,n)}_canSanitize(t){return null==t||this.inner._canSanitize(t)}},m=class extends h{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(d(null!=n?n:[])+": expected string, got "+typeof t),!1)}},g=class extends h{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(d(null!=n?n:[])+": 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,e,n){return"boolean"==typeof t||(null==e||e.errors.push(d(null!=n?n:[])+": 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,e,n){return t===this.value||(null==e||e.errors.push(d(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},b=class extends h{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(d(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},k=class extends h{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=d(null!=n?n:[]);let s;e.errors.push(i+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,240));let a=-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>a||u===a&&s&&o.errors.length<s.length)&&(a=u,s=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(s&&a>i.length)for(const t of s.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))}},x=class extends h{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(d(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)}},A=class extends h{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(d(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(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,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=l({},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(d(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)}},j=class extends h{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(d(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)}},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 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(d(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)}},S=class extends h{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},P=class extends h{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return void 0!==t||(null==e||e.errors.push(d(null!=n?n:[])+": required value is missing"),!1)}_canSanitize(t){return void 0!==t}},M=class extends h{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)}},_=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((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(d(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}};function z(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function D(t){var e;const n=t;switch(n._kind){case"union":return{kind:"union",members:n.schemas};case"discriminatedUnion":return{kind:"discriminatedUnion",key:n._key,members:n._schemas};case"record":return{kind:"record",value:n.value};case"tuple":return{kind:"tuple",items:n.schemas}}return"_shape"in n?{kind:"shape",shape:n._shape,openValue:n._openSchema}:"item"in n?{kind:"array",item:n.item}:"inner"in n?{kind:"optional",inner:n.inner}:"fn"in n?{kind:"lazy",resolved:null!=(e=n.resolved)?e:n.resolved=n.fn()}:{kind:"leaf"}}var T,I={string:(t="")=>new m(t),number:(t=0)=>new g(t),boolean:(t=!1)=>new y(t),literal:t=>new v(t),enum:(t,e)=>new b(t,e),union:(t,e)=>new k(t,e),discriminatedUnion:(t,e)=>new x(t,e),object:t=>new A(t),openObject:(t,e)=>new w(t,e),extendedObject:(t,e)=>new A(l(l({},t._shape),e)),array:t=>new j(t),record:t=>new O(t),any:()=>new S,defined:()=>new P,tuple:t=>new _(t),lazy:(t,e)=>new M(t,e)},E="1.2",N="version",V="animator",U=(t=>(t.unstamped="unstamped",t.same="same",t.older="older",t.newer="newer",t.otherGeneration="otherGeneration",t))(U||{}),L=/^(\d+)\.(\d+)(?:\.(\d+))?$/;function C(t){if("string"!=typeof t)return;const e=L.exec(t.trim());return e?{a:Number(e[1]),b:Number(e[2]),c:void 0===e[3]?0:Number(e[3])}:void 0}function W(t){return t.a+"."+t.b+"."+t.c}var R=null!=(T=C("1.2"))?T:{a:1,b:1,c:0};function F(t){if(!t||"object"!=typeof t)return;const e=B(t,V);if(e)return e;const n=B(t,"meta");return n?B(n,V):void 0}function B(t,e){const n=t[e];return n&&"object"==typeof n&&!Array.isArray(n)?n:void 0}function G(t){const e=F(t);return e?C(e[N]):void 0}function Z(t,e,n){return t?t.a!==e.a?"otherGeneration":t.b!==e.b?t.b>e.b?"newer":"older":n&&t.c!==e.c?t.c>e.c?"newer":"older":"same":"unstamped"}function J(t,e,n,r){if(!e)return;const o=r?"player":"editor",i="written for schema "+W(e)+", this "+o+" reads "+W(n);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=[{from:"1.1",to:"1.2",reason:"The trigger block became two axes: `start` says what STARTS an animation, `offScreen` + `visibilityThreshold` + `visibilityDebounce` say whether it may RUN. `scrollIntoView` is no longer a start value — it is what `start: 'load'` behind the default gate already means — and `outAction` split into `offScreen` (scroll) and `mouseOut` (hover), because one field meant three things.",kind:"converted",up:function(t){const e=t.animator;if(!e||"object"!=typeof e)return;const n=e.timeline,r=(n&&"object"==typeof n?n:e).trigger;if(!r||"object"!=typeof r)return;const o=r,i=o.startOn,s=o.outAction;delete o.startOn,delete o.outAction,"scrollIntoView"===i?void 0!==s&&(o.offScreen=s):("programmatic"===i?o.start="none":void 0!==i&&(o.start=i),"mouseOver"===i&&void 0!==s&&(o.mouseOut=s),void 0===o.offScreen&&(o.offScreen="continue"));void 0!==o.scrollIntoViewThreshold&&(o.visibilityThreshold=o.scrollIntoViewThreshold,delete o.scrollIntoViewThreshold);void 0!==o.finishAction&&(o.finish=o.finishAction,delete o.finishAction)}}];function H(t,e){const n=G(t),r=Z(n,e.target,e.readerReadsEditorPart);if(!n||"older"!==r)return{doc:t,from:n,relation:r,applied:[],advice:J(r,n,e.target,!e.readerReadsEditorPart)};const o=[];for(const t of e.steps){const r=C(t.to);r&&("older"===Z(n,r,e.readerReadsEditorPart)&&t.up&&o.push(t))}if(!o.length||!t||"object"!=typeof t)return{doc:t,from:n,relation:r,applied:[]};const i=$(t),s=[];for(const t of o)try{t.up(i),s.push(t)}catch(t){break}return s.length?(Y(i,e.target,e.readerReadsEditorPart),{doc:i,from:n,relation:r,applied:s}):{doc:t,from:n,relation:r,applied:[]}}function K(t){return H(t,{steps:X,target:R,readerReadsEditorPart:!1})}function $(t){const e=globalThis.structuredClone;return e?e(t):JSON.parse(JSON.stringify(t))}function Y(t,e,n){const r=F(t);if(!r)return;const o=C(r[N]);r[N]=W({a:e.a,b:e.b,c:n?e.c:o?o.c:0})}function tt(t,e){return function(t,e){const n=G(t);if(!n)return{ok:!1,blocking:[],reason:"The document carries no version, so there is nothing to convert down from."};const r=Z(n,e.target,e.readerReadsEditorPart);if("otherGeneration"===r)return{ok:!1,blocking:[],reason:"Schema "+W(n)+" and "+W(e.target)+" are different generations; no conversion bridges them."};if("newer"!==r)return{ok:!0,doc:t,applied:[]};const o=[];for(const t of e.steps){const r=C(t.to);r&&"newer"===Z(r,e.target,e.readerReadsEditorPart)&&"newer"!==Z(r,n,e.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(e.target)+": "+i.map(t=>t.from+" → "+t.to+" ("+t.reason+")").join("; ")+" cannot be undone."};const s=$(t),a=[];for(const t of o)if(t.down)try{t.down(s),a.push(t)}catch(e){return{ok:!1,blocking:[t],reason:"Undoing "+t.from+" → "+t.to+" failed: "+String(e)}}return Y(s,e.target,e.readerReadsEditorPart),{ok:!0,doc:s,applied:a}}(t,{steps:X,target:e,readerReadsEditorPart:!1})}var et={forwards:"forwards",backwards:"backwards",both:"both",none:"none"},nt={normal:"normal",reverse:"reverse",alternate:"alternate",alternateReverse:"alternate-reverse"},rt="data-px-animation-src",ot="_px_animator",it={load:"load",mouseOver:"mouseOver",click:"click",none:"none"},st={pause:"pause",continue:"continue",reset:"reset"},at={continue:"continue",pause:"pause",reset:"reset",reverse:"reverse"},lt={hold:"hold",reset:"reset"},ut={view:"view",scroll:"scroll"},ct={block:"block",inline:"inline",x:"x",y:"y"},ft={nearest:"nearest",root:"root"},dt={top:"top",center:"center",bottom:"bottom"},ht={cover:"cover",contain:"contain",entry:"entry",exit:"exit",entryCrossing:"entry-crossing",exitCrossing:"exit-crossing"},pt={sampled:"sampled",offsetPath:"offsetPath"},mt=["duration","iterations","engine","frameRate"],gt=["trigger","delay","fillMode","direction"],yt=[...mt,...gt,"fill","resetOnFinish","timelineSource","scroll"],vt={native:"native",js:"js"},bt=u(l({},vt),{auto:"auto"});function kt(t){return t===bt.js?vt.js:vt.native}function xt(t){return t===bt.native}function At(t){return t!==bt.js}var wt={start:"load",offScreen:"pause",mouseOut:"continue",visibilityThreshold:.5,visibilityDebounce:150},jt={static:"static",fixedTime:"fixedTime",play:"play",autoplay:"autoplay"};function Ot(t){const e=void 0!==t.progress||void 0!==t.time,n=void 0!==t.play||void 0!==t.pause,r=!!t.autoplay,o=[],i=(t,e,n)=>t+" and "+e+" were both set — "+n+" wins, "+(n===t?e:t)+" is ignored.";return e?(n&&o.push(i("progress/time","play/pause","progress/time")),r&&o.push(i("progress/time","autoplay","progress/time")),{mode:jt.fixedTime,warnings:o}):n?(r&&o.push(i("play/pause","autoplay","play/pause")),{mode:jt.play,warnings:o}):r?{mode:jt.autoplay,warnings:o}:{mode:jt.static,warnings:o}}function St(t){return t!==jt.autoplay}function Pt(t){var e,n,r,o,i;return{start:null!=(e=null==t?void 0:t.start)?e:wt.start,offScreen:null!=(n=null==t?void 0:t.offScreen)?n:wt.offScreen,mouseOut:null!=(r=null==t?void 0:t.mouseOut)?r:wt.mouseOut,visibilityThreshold:null!=(o=null==t?void 0:t.visibilityThreshold)?o:wt.visibilityThreshold,visibilityDebounce:null!=(i=null==t?void 0:t.visibilityDebounce)?i:wt.visibilityDebounce}}var Mt={start:"start",end:"end"},_t={normal:"normal",alternate:"alternate"},zt={luminance:"luminance",alpha:"alpha"},Dt={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},Tt={translate:"translate"},It={clip:"clip",extend:"extend"},Et={spacing:"spacing",spacingAndGlyphs:"spacingAndGlyphs"},Nt={align:"align",stretch:"stretch"},Vt={auto:"auto",exact:"exact"},Ut={separate:"separate",combined:"combined"},Lt="textContent",Ct="class",Wt="transform",Rt="offsetDistance",Ft=new Set(["type","children","animator","meta","animate","effects",Lt]),Bt={translate:"translate",rotate:"rotate",scale:"scale",origin:"origin"},Gt=[Bt.translate,Bt.rotate,Bt.scale,Bt.origin],Zt={pad:"pad",reflect:"reflect",repeat:"repeat"},Jt={linear:"linear",radial:"radial"};function qt(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&"svg"===t.type}function Qt(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=Xt.get(n);if(r)return r;const o=n,i=yt.filter(t=>void 0!==o[t]),s=i.length?l({},o):n;for(const t of i)delete s[t];const a=Kt(s);return Xt.set(n,a),a}var Xt=new WeakMap,Ht=new WeakMap;function Kt(t){const e=t.timeline;if(null==e||"object"!=typeof e)return t;const n=Ht.get(t);if(n)return n;const r=t,{timeline:o}=r,i=c(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=l({},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,{finish:n}=t,r=c(t,["finish"]);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 Ht.set(t,i),i}function $t(t){if(!t||void 0!==t.timeline)return t;const e=t,{timelineSource:n,scroll:r,trigger:o,delay:i,iterations:s,direction:a,fill:f,resetOnFinish:d,duration:h,engine:p,frameRate:m}=e,g=c(e,["timelineSource","scroll","trigger","delay","iterations","direction","fill","resetOnFinish","duration","engine","frameRate"]);if("scroll"===n){const t={type:(y=null==r?void 0:r.kind,"scroll"===y?"scroll":"view")};if(void 0!==p&&(t.engine=p),void 0!==m&&(t.frameRate=m),void 0!==h&&(t.duration=h),"number"==typeof s&&(t.iterations=s),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({},g),{timeline:t})}var y;const v={};if(void 0!==p&&(v.engine=p),void 0!==m&&(v.frameRate=m),void 0!==h&&(v.duration=h),void 0!==o||d){const t=l({},o||{});d&&(t.finish="reset"),v.trigger=t}return void 0!==i&&(v.delay=i),void 0!==s&&(v.iterations=s),void 0!==a&&(v.direction=a),void 0!==f&&(v.fillMode=f),Object.keys(v).length>0?u(l({},g),{timeline:v}):g}function Yt(t){var e;if(t)return null==(e=Qt(t))?void 0:e.definitions}function te(t){var e;if(t)return null==(e=Qt(t))?void 0:e.bindings}function ee(t){return null==t?void 0:t.children}var ne=I.union([I.string(),I.tuple([I.number(),I.number(),I.number(),I.number()])]),re=I.union([I.string(),I.number(),I.array(I.number()),I.object({pathData:I.string()}),I.lazy(()=>I.array(Be),[]),I.lazy(()=>de,{})]),oe=I.object({time:I.number().optional(),value:re.optional(),easing:ne.optional(),tangentOut:I.tuple([I.number(),I.number()]).optional(),tangentIn:I.tuple([I.number(),I.number()]).optional()}),ie=t=>{var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0},se=t=>{var e;return null!=(e=t.value)?e:t.v},ae=t=>{var e;return null!=(e=t.easing)?e:t.e},le=t=>t.tangentIn,ue=t=>t.tangentOut,ce=I.object({segmentCount:I.number().optional(),repeatAt:I.enum([Mt.start,Mt.end]).optional(),direction:I.enum([_t.normal,_t.alternate]).optional()}),fe=I.object({value:re.optional(),keyframes:I.array(oe).optional(),loop:I.union([ce,I.boolean()]).optional(),autoOrient:I.boolean().optional(),alongPathMode:I.enum([pt.sampled,pt.offsetPath]).optional()}),de=I.object({translate:I.tuple([I.number(),I.number()]).optional(),rotate:I.number().optional(),skew:I.number().optional(),scale:I.tuple([I.number(),I.number()]).optional(),origin:I.tuple([I.number(),I.number()]).optional()}),he=I.union([I.string(),de,I.object({value:de}),fe]),pe=I.record(fe),me=I.union([I.string(),I.array(I.union([I.string(),pe])),pe]),ge=I.object({start:I.enum([it.load,it.mouseOver,it.click,it.none],wt.start).optional(),offScreen:I.enum([st.pause,st.continue,st.reset],wt.offScreen).optional(),mouseOut:I.enum([at.continue,at.pause,at.reset,at.reverse],wt.mouseOut).optional(),finish:I.enum([lt.hold,lt.reset]).optional(),visibilityThreshold:I.number().optional(),visibilityDebounce:I.number().optional()}),ye=I.object({width:I.number(),pathData:I.string()}),ve=I.object({fontFamily:I.string(),fontStyle:I.string(),ascent:I.number(),unitsPerEm:I.number(),glyphs:I.record(ye)}),be=I.object({easings:I.record(I.tuple([I.number(),I.number(),I.number(),I.number()])).optional(),animations:I.record(pe).optional(),fonts:I.record(ve).optional()}),ke=I.object({phase:I.enum([ht.cover,ht.contain,ht.entry,ht.exit,ht.entryCrossing,ht.exitCrossing]).optional(),fraction:I.number().optional()}),xe=I.object({start:ke.optional(),end:ke.optional()}),Ae=I.object({kind:I.enum([ut.view,ut.scroll]).optional(),axis:I.enum([ct.block,ct.inline,ct.x,ct.y]).optional(),source:I.enum([ft.nearest,ft.root]).optional(),subject:I.string().optional(),smoothing:I.number().optional(),pin:I.boolean().optional(),pinAlign:I.enum([dt.top,dt.center,dt.bottom]).optional(),pinOffset:I.number().optional(),pinDistance:I.number().optional(),range:xe.optional()}),we=I.object({align:I.enum([dt.top,dt.center,dt.bottom]).optional(),offset:I.number().optional(),distance:I.number().optional()}),je=I.enum([bt.auto,bt.native,bt.js]).optional(),Oe=I.object({type:I.literal("time").optional(),engine:je,frameRate:I.number().optional(),duration:I.number().optional(),trigger:ge.optional(),delay:I.number().optional(),iterations:I.union([I.number(),I.literal("infinite")]).optional(),fillMode:I.enum([et.forwards,et.backwards,et.both,et.none]).optional(),direction:I.enum([nt.normal,nt.reverse,nt.alternate,nt.alternateReverse]).optional()}),Se={duration:I.number().optional(),iterations:I.number().optional(),engine:je,frameRate:I.number().optional(),axis:I.enum([ct.block,ct.inline,ct.x,ct.y]).optional(),source:I.enum([ft.nearest,ft.root]).optional(),subject:I.string().optional(),smoothing:I.number().optional(),pin:I.union([I.boolean(),we]).optional(),range:xe.optional()},Pe=I.object(l({type:I.literal("scroll")},Se)),Me=I.object(l({type:I.literal("view")},Se)),_e=I.discriminatedUnion("type",[Oe,Pe,Me]),ze=I.object({target:I.string(),animateWith:I.array(I.string())}),De=I.object({timeline:_e.optional(),definitions:be.optional(),bindings:I.array(ze).optional(),debugGlobalName:I.string().optional(),version:I.string().optional()}),Te=I.union([I.string(),I.number(),I.array(I.number()),I.object({value:I.defined()}),de]),Ie=I.union([I.number(),fe,I.object({value:I.number()})]),Ee=I.union([I.tuple([I.number(),I.number()]),fe,I.object({value:I.tuple([I.number(),I.number()])})]),Ne=I.union([I.string(),fe,I.object({value:I.string()})]),Ve=I.object({translate:Ee.optional(),rotate:Ie.optional(),scale:Ee.optional(),skew:Ie.optional(),origin:Ee.optional()}),Ue=I.object({copies:I.number().optional(),translate:Ee.optional(),rotate:Ie.optional(),skew:Ie.optional(),scale:Ee.optional(),origin:Ee.optional()}),Le=I.object({source:I.string().optional(),maskType:I.enum([zt.luminance,zt.alpha]).optional(),maskUnits:I.enum([Dt.userSpaceOnUse,Dt.objectBoundingBox]).optional(),maskContentUnits:I.enum([Dt.userSpaceOnUse,Dt.objectBoundingBox]).optional(),x:I.number().optional(),y:I.number().optional(),width:I.number().optional(),height:I.number().optional()}),Ce=I.object({pathData:Ne.optional()}),We=I.object({offset:Ie.optional(),range:Ee.optional(),subPaths:I.enum([Ut.separate,Ut.combined]).optional()}),Re=I.object({start:I.number().optional(),stretch:I.number().optional(),timeCrop:I.tuple([I.number(),I.number()]).optional()}),Fe=I.object({without:I.enum([Tt.translate]).optional(),source:I.string().optional(),retime:Re.optional()}),Be=I.object({offset:I.number(),color:I.string()}),Ge=I.union([I.array(Be),I.object({value:I.array(Be)}),fe]),Ze=I.object({type:I.enum([Jt.linear,Jt.radial]),start:Ee.optional(),end:Ee.optional(),center:Ee.optional(),radius:Ie.optional(),focal:Ee.optional(),stops:Ge.optional(),gradientUnits:I.enum([Dt.userSpaceOnUse,Dt.objectBoundingBox]).optional(),spreadMethod:I.enum([Zt.pad,Zt.reflect,Zt.repeat]).optional(),gradientTransform:I.string().optional()}),Je=Ze,qe=I.object({pathData:I.string(),pathOverflow:I.enum([It.clip,It.extend]).optional(),lengthAdjust:I.enum([Et.spacing,Et.spacingAndGlyphs]).optional(),method:I.enum([Nt.align,Nt.stretch]).optional(),spacing:I.enum([Vt.auto,Vt.exact]).optional(),startOffset:Ie.optional(),textLength:Ie.optional()}),Qe=I.object({useGlyphs:I.boolean().optional()}),Xe=I.object({transformBy:Ve.optional(),repeater:Ue.optional(),maskedBy:Le.optional(),clipPath:Ce.optional(),strokeTrim:We.optional(),clone:Fe.optional(),fillGradient:Ze.optional(),strokeGradient:Je.optional(),textPath:qe.optional(),text:Qe.optional()});function He(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!Xe.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 Ke(t,e){var n;const r=!1!==(null==e?void 0:e.strict),o={errors:[],warnings:[],strict:r},i=en.isValid(t,o,["root"])?[]:[...o.errors];if(t&&"object"==typeof t){for(const e of He(t,{strict:r}))i.includes(e)||i.push(e);const e=null==(n=Qt(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,s)=>{var a,l;if(!t)return;const u="string"==typeof t.fontFamily?t.fontFamily:void 0,c=null!=u?u:i,f=s||"text"===t.type&&!!(null==(l=null==(a=t.effects)?void 0:a.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=Qt(t))?void 0:e.version;return void 0===n||void 0!==C(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 $e=I.openObject({type:I.string(),domType:I.string().optional(),textContent:I.string().optional(),id:I.string().optional(),meta:I.any().optional(),effects:Xe.optional(),animate:me.optional(),style:I.record(I.union([I.string(),I.number()])).optional()},Te),Ye=I.openObject(u(l({},$e._shape),{children:I.lazy(()=>I.array(Ye),[]).optional()}),Te),tn=I.object({width:I.union([I.number(),I.string()]).optional(),height:I.union([I.number(),I.string()]).optional(),viewBox:I.string().optional(),animator:De.optional()}),en=I.openObject(u(l(l({},$e._shape),tn._shape),{type:I.literal("svg"),children:I.array(Ye).optional()}),Te),nn=I.object({v:I.array(I.array(I.number())),i:I.array(I.array(I.number())).optional(),o:I.array(I.array(I.number())).optional(),c:I.boolean().optional()});function rn(t){const e=Ke(t,{strict:!1});return{valid:0===e.length,errors:e}}var on=0;function sn(){return"_px_"+Date.now().toString(36)+(++on).toString(36)+Math.random().toString(36).substring(2,6)}function an(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>an(t));const e=t,n={};for(const t of Object.keys(e))n[t]=an(e[t]);return n}function ln(t){var e;const n=an(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"]),s=new Set(["targetId","boundElementId"]),a=(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=sn();r.set(t,n),e.id=n}else e.animate&&(e.id=sn());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]=un(u,r);else if(s.has(l)||a(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]=un(u,r));else if("style"===l&&"object"==typeof u&&null!==u)for(const[t,e]of Object.entries(u))"string"==typeof e&&(u[t]=un(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 c=null==(e=n.animator)?void 0:e.bindings;if(Array.isArray(c)){const t=c.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 u(l({},t),{target:n?"#"+i:i})});n.animator=u(l({},n.animator),{bindings:t})}return n}function un(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}function cn(t,e=!1){var n,r,o,i;const s=t.v,a=t.i,l=t.o,u=t.c;if(!s.length)return"";const c=[],f=s.length;c.push("M"+s[0][0]+","+s[0][1]);for(let t=1;t<f;t++){const o=s[t-1],i=null!=(n=null==l?void 0:l[t-1])?n:o,u=null!=(r=null==a?void 0:a[t])?r:s[t],f=s[t];!e&&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=s[f-1],n=null!=(o=null==l?void 0:l[f-1])?o:t,r=null!=(i=null==a?void 0:a[0])?i:s[0],u=s[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 fn(t,e,n){return t+(e-t)*n}function dn(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let i=0;i<o;i++)r[i]=fn(t[i]||0,e[i]||0,n);return r}function hn(t,e,n){return[fn(t[0]||0,e[0]||0,n),fn(t[1]||0,e[1]||0,n),fn(t[2]||0,e[2]||0,n),fn(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function pn(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++)o.push(mn(t[i],e[i],n));return o}function mn(t,e,n){var r,o,i,s,a,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(dn(f,h,d));const y=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,v=null!=(s=null==(i=e.i)?void 0:i[n])?s:h;m.push(dn(y,v,d));const b=null!=(l=null==(a=t.o)?void 0:a[n])?l:f,k=null!=(c=null==(u=e.o)?void 0:u[n])?c:h;g.push(dn(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 gn(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 s(t){return((i*t+o)*t+r)*t}function a(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=s(l)-n;if(Math.abs(t)<1e-6)return l;const e=a(l);if(Math.abs(e)<1e-6)break;l-=t/e}for(l=n;u<c;){const t=s(l);if(Math.abs(t-n)<1e-6)return l;n>t?u=l:c=l,l=(c+u)/2}return l}function yn(t){const[e,n,r,o]=t,i=3*n,s=3*(o-n)-i,a=1-i-s;return function(t){return n=gn(e,r,t),((a*n+s)*n+i)*n;var n}}function vn(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function bn(t,e,n,r,o){const i=vn(t,e,o),s=vn(e,n,o),a=vn(n,r,o),l=vn(i,s,o),u=vn(s,a,o),c=vn(l,u,o);return{left:[t,i,l,c],right:[c,u,a,r]}}function kn(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,s=gn(n,o,e),a=[n,r],l=[o,i],{left:u,right:c}=bn([0,0],a,l,[1,1],s),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 xn(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function An(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 wn(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),s=4===e.length?e[3]+e[3]:8===e.length?e.slice(6,8):null,a=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==s&&a.push(parseInt(s,16)/255),a}(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 jn=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),On=new Set(["translate","rotate","scale","skew"]),Sn=new Set(["offset-distance","offsetDistance"]);function Pn(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],i=t.translate,s=t.origin,a=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+")"),s&&o.push("translate("+s[0]+c+","+s[1]+c+")"),null!=a&&o.push("rotate("+a+f+")"),null!=l&&o.push("skewX("+l+f+")"),u&&o.push("scale("+u[0]+","+u[1]+")"),s&&o.push("translate("+-s[0]+c+","+-s[1]+c+")"),o.join("")}var Mn=new Set(["offset-distance","offsetDistance"]),_n=1e3;function zn(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function Dn(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var Tn=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 In(t){return Tn.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function En(t,e,n){return Math.max(e,Math.min(t,n))}function Nn(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,s=i*i,a=o*o,l=s*i,u=3*o*s,c=3*a*i,f=a*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 Vn=1e-4;function Un(t,e,n,r,o){const i=Ln(t,e,n,r,o);if(0===i[0]&&0===i[1]){return Ln(t,e,n,r,o<.5?o+Vn:o-Vn)}return i}function Ln(t,e,n,r,o){const i=1-o,s=3*i*i,a=6*o*i,l=3*o*o;return[s*(e[0]-t[0])+a*(n[0]-e[0])+l*(r[0]-n[0]),s*(e[1]-t[1])+a*(n[1]-e[1])+l*(r[1]-n[1])]}function Cn(t,e,n,r,o=100){const i=o+1,s=new Float64Array(i),a=new Float64Array(i);let l=Nn(t,e,n,r,0);s[0]=0,a[0]=0;let u=0;for(let c=1;c<i;c++){const i=c/o,f=Nn(t,e,n,r,i),d=f[0]-l[0],h=f[1]-l[1];u+=Math.sqrt(d*d+h*h),s[c]=i,a[c]=u,l=f}return{ts:s,ds:a}}function Wn(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,s=o;for(;i<s;){const t=i+s>>>1;n[t]<e?i=t+1:s=t}const a=n[s-1],l=n[s]-a,u=l>0?(e-a)/l:0;return r[s-1]+u*(r[s]-r[s-1])}var Rn=new Set(["script","foreignobject"]),Fn=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),Bn=new Set(["href","xlink:href","src"]),Gn=new Set(["mixBlendMode","isolation"]),Zn=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,Jn=/^data:image\/svg\+xml(?:;[^,]*)?,/i,qn=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,Qn=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function Xn(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(Fn.has(n)){const t=String(e);return t.startsWith("#")||(/^url\(#[^)]+\)$/.test(t)||Bn.has(n)&&(Zn.test(t)||Jn.test(t)||function(t){const e=qn.exec(t);return!!e&&Qn.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 Hn(t){const e={};for(const n of Object.keys(t)){const r=zn(n);if(Ft.has(r))continue;if("style"===r)continue;let o=t[n];if(jn.has(r)&&Array.isArray(o))e[r]=An(o);else if("transform"!==r||null===o||"object"!=typeof o||Array.isArray(o)||o.keyframes)On.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),e[Wt]=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[Wt]=Pn(t,{withUnits:!1})}}return e}function Kn(t){const e=se(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 $n(t){return ie(t)}function Yn(t){return ae(t)}function tr(t){const e=t.keyframes;if(!Array.isArray(e))return!1;if(t.autoOrient)return!0;for(const t of e)if(le(t)||ue(t))return!0;return!1}var er=new WeakMap;function nr(t,e,n,r){let o=er.get(t);const i=null==o?void 0:o.get(e);if(i)return i;const s=ue(t),a=le(e),l=[n[0]+(s?s[0]:0),n[1]+(s?s[1]:0)],u=[r[0]+(a?a[0]:0),r[1]+(a?a[1]:0)],c=Cn(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,er.set(t,o)),o.set(e,f),f}function rr(t,e){var n,r,o;if(!tr(t))return t;const i=t.keyframes;if(!Array.isArray(i)||i.length<2)return t;const s=!!t.autoOrient,a=null!=(n=null==e?void 0:e.flatnessTolerance)?n:.5,l=null!=(r=null==e?void 0:e.rotationTolerance)?r:5,u=null!=(o=null==e?void 0:e.maxSamplesPerSegment)?o:32,c=[],f=Kn(i[0]);if(!f)return t;const d=s?function(t,e){const n=Kn(t),r=Kn(e);if(!n||!r)return 0;const o=nr(t,e,n,r),i=Un(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(ir($n(i[0]),lr(sr(i[0]),sr(i[0]),0,f,d,s)));for(let t=0;t<i.length-1;t++){const e=i[t],n=i[t+1],r=Kn(e),o=Kn(n);r&&o?(s&&t>0&&cr(c,e,n,r,o,l),dr(c,e,n,r,o,s,a,l,u)):c.push(ir($n(n),lr(sr(n),sr(n),1,null!=o?o:[0,0],void 0,s)))}const h=Yn(i[i.length-1]);h&&(c[c.length-1].e=h),s&&or(c);const p={keyframes:c};return void 0!==t.loop&&(p.loop=t.loop),p}function or(t){let e;for(const n of t){const t=se(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 ir(t,e){return{t:t,v:e}}function sr(t){const e=se(t);if(e&&"object"==typeof e&&!Array.isArray(e))return e}function ar(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,s="number"==typeof e[o]?e[o]:0;r[o]=i+(s-i)*n}return r}return n<.5?t:e}function lr(t,e,n,r,o,i){const s={translate:r},a=new Set;if(t)for(const e of Object.keys(t))a.add(e);if(e)for(const t of Object.keys(e))a.add(t);for(const r of a){if("translate"===r)continue;if("rotate"===r&&i)continue;const o=null==t?void 0:t[r],a=null==e?void 0:e[r];void 0===o&&void 0===a||(s[r]=ar(o,a,n))}return void 0!==o&&(s.rotate=o+ur(t,e,n)),s}function ur(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=ar(r,o,n);return"number"==typeof i?i:0}function cr(t,e,n,r,o,i){const s=t[t.length-1],a=se(s),l=null==a?void 0:a.rotate;if("number"!=typeof l)return;const u=sr(e),c=l-ur(u,u,0),f=nr(e,n,r,o),d=Un(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=$n(e),g=Math.min(m+fr,(m+$n(n))/2),y=lr(sr(e),sr(e),0,r,h,!0);t.push(ir(g,y))}var fr=.05;function dr(t,e,n,r,o,i,s,a,l){const u=nr(e,n,r,o),c=$n(e),f=$n(n),d=Yn(e),h=(p=d)?yn([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=sr(e),g=sr(n),y=function(t,e,n,r,o){const i=[];hr(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),hr(t.P0[1],t.P1[1],t.P2[1],t.P3[1],i),i.sort((t,e)=>t-e);const s=[0];for(const t of i)t>s[s.length-1]+1e-6&&t<.999999&&s.push(t);s.push(1);const a=[],l={remaining:o-s.length};for(let o=0;o<s.length-1;o++)pr(s[o],s[o+1],a,t,e,n,r,l);return a}(u,i,s,a,l),v=[];for(const t of y){const e=Wn(u.lut,t),n=En(u.totalArc>0?e/u.totalArc:t,0,1),r={u:En(h(n),0,1),p:n,pos:Nn(u.P0,u.P1,u.P2,u.P3,t)};if(i){const e=Un(u.P0,u.P1,u.P2,u.P3,t);r.rotateDeg=180*Math.atan2(e[1],e[0])/Math.PI}v.push(r)}let b=d,k=0;const x=t.length-1;for(let e=0;e<v.length;e++){const n=v[e],r=k<1?En((n.u-k)/(1-k),0,1):1,{left:o,right:s}=kn(b,r),a=0===e?x:t.length-1;o?t[a].e=o:delete t[a].e;const l=c+n.u*(f-c),u=lr(m,g,n.p,n.pos,n.rotateDeg,i);t.push(ir(l,u)),b=s,k=n.u}}function hr(t,e,n,r,o){const i=e-t,s=n-e,a=i-2*s+(r-n),l=2*(s-i),u=i;if(Math.abs(a)<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*a*u;if(c<0)return;const f=Math.sqrt(c),d=(-l-f)/(2*a),h=(-l+f)/(2*a);d>1e-6&&d<.999999&&o.push(d),h>1e-6&&h<.999999&&o.push(h)}function pr(t,e,n,r,o,i,s,a){const l=(t+e)/2,u=Nn(r.P0,r.P1,r.P2,r.P3,t),c=Nn(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=Nn(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=Nn(r.P0,r.P1,r.P2,r.P3,l),p=Nn(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(mr(d,u,c),mr(h,u,c),mr(p,u,c));let g=!0;if(o){const n=Un(r.P0,r.P1,r.P2,r.P3,t),o=Un(r.P0,r.P1,r.P2,r.P3,e),i=180*Math.atan2(n[1],n[0])/Math.PI,a=180*Math.atan2(o[1],o[0])/Math.PI;let l=Math.abs(i-a);l>180&&(l=360-l),l>s&&(g=!1)}m<=i&&g||a.remaining<=0||f<1e-6?n.push(e):(a.remaining-=1,pr(t,l,n,r,o,i,s,a),pr(l,e,n,r,o,i,s,a))}function mr(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 s=(t[0]-e[0])*o-(t[1]-e[1])*r;return Math.abs(s)/Math.sqrt(i)}function gr(t,e){const n=yr(t,e);return null!=n?n:t}function yr(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=yr(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&&tr(n)){const o=rr(n,e);o!==n&&(r=u(l({},t),{transform:o}))}}if(!n&&!r)return null;const i=l({},t);return n&&(i.children=n),r&&(i.animate=r),i}var vr=1;function br(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=>br(t[n],e[n]))}function kr(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,s=o[4]||0,a=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([s,a]),n.i.push([r,i]),n.o.push([s,a])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function xr(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!==xr(t)}function wr(t){if(t&&"object"==typeof t&&"string"==typeof t.pathData){const e=xr(t.pathData);return e?{paths:kr(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&Ar(e[0])){const t=[];for(const n of e){const e=xr(n);e&&t.push(...kr(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&Ar(t[0])){const e=[];for(const n of t){const t=xr(n);t&&e.push(...kr(t))}return{paths:e}}return{paths:t}}if(Ar(t)){return{paths:kr(xr(t))}}return t}function jr(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 Or(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 Sr(t,e,n,r){var o,i;if("d"===t){return{paths:pn(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)}}return jn.has(t)?hn(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?fn(e,n,r):On.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?dn(e||[],n||[],r):fn(+(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],s=null==e?void 0:e[i];if("rotate"===i||"skew"===i)o[i]=fn(+(null!=r?r:0),+(null!=s?s:0),n);else if("translate"===i||"scale"===i||"origin"===i){const t="scale"===i?[1,1]:[0,0];o[i]=dn(r||t,s||t,n)}else o[i]=null!=s?s:r}return o}(e,n,r)}function Pr(t,e,n,r){var o,i,s,a,c;const f=e.length-1,d=En(null!=(o=n.segmentCount)?o:f,1,f);let h;h=n.repeatAt===Mt.start?e.slice(0,d+1):e.slice(f-d);const p=null!=(i=e[0].t)?i:0,m=null!=(s=e[e.length-1].t)?s:0;let g,y;n.repeatAt===Mt.start?(g=0,y=p):(g=m,y=r);const v=y-g;if(v<=0)return e;const b=null!=(a=h[0].t)?a:0,k=(null!=(c=h[h.length-1].t)?c:0)-b;if(k<=0)return e;const x=h.map(t=>({relT:(t.t-b)/k,v:t.v,e:t.e,tangentIn:le(t),tangentOut:ue(t)})),A=Math.floor(v/k),w=v-A*k,j=w/k,O=[],S=n.repeatAt!==Mt.start,P=e[e.length-1];let M,_=!1;function z(e,n,r){var o;let i;if(n){i=[];for(let t=x.length-1;t>=0;t--)i.push({relT:1-x[t].relT,v:x[t].v,e:t>0?xn(x[t-1].e):void 0,tangentIn:x[t].tangentOut,tangentOut:x[t].tangentIn})}else i=x;const s=void 0!==r?r:1;for(let n=0;n<i.length;n++){const r=i[n];if(r.relT>s+1e-9){const o=i[n-1],a=r.relT-o.relT,l=(s-o.relT)/a,u=o.e?yn(o.e)(l):l,c=Sr(t,o.v,r.v,u),{left:f}=kn(o.e,l);return O.length>0&&o.relT<=s&&(O[O.length-1].e=f),void O.push({t:e+s*k,v:c,e:void 0})}const a=O.length>0?O[O.length-1]:P,l=S&&0===n&&void 0!==a&&Math.abs((null!=(o=a.t)?o:0)-(e+r.relT*k))<1e-9;if(l){if(br(a.v,r.v)){O.length>0?(a.e=r.e,a.tangentOut=r.tangentOut):(M=r.e,_=!0);continue}O.length>0&&(delete a.tangentIn,delete a.tangentOut)}const u={t:e+r.relT*k+(l?1: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===Mt.start){if(j>1e-9){!function(e,n,r){let o;if(n){o=[];for(let t=x.length-1;t>=0;t--)o.push({relT:1-x[t].relT,v:x[t].v,e:t>0?xn(x[t-1].e):void 0,tangentIn:x[t].tangentOut,tangentOut:x[t].tangentIn})}else o=x;const i=1-r;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT<i-1e-9)continue;const s=o[n-1];if(s&&s.relT<i-1e-9&&r.relT>i+1e-9){const n=r.relT-s.relT,o=(i-s.relT)/n,a=s.e?yn(s.e)(o):o,l=Sr(t,s.v,r.v,a),{right:u}=kn(s.e,o);O.push({t:e,v:l,e:u})}const a={t:e+(r.relT-i)*k,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(a.tangentIn=r.tangentIn),r.tangentOut&&(a.tangentOut=r.tangentOut),O.push(a)}}(g,n.direction===_t.alternate&&A%2==0,j)}for(let t=0;t<A;t++){const e=A-1-t,r=n.direction===_t.alternate&&e%2==0;z(g+w+t*k,r)}}else{for(let t=0;t<A;t++){const e=n.direction===_t.alternate&&t%2==0;z(g+t*k,e)}if(j>1e-9){const t=n.direction===_t.alternate&&A%2==0;z(g+A*k,t,j)}}if(n.repeatAt===Mt.start)return[...O,...e];if(_&&e.length>0){return[...e.slice(0,-1),u(l({},e[e.length-1]),{e:M}),...O]}return[...e,...O]}function Mr(t,e,n,r){var o;const i=e.keyframes||[],s=[];for(const e of i){const n=ie(e);let i=se(e);const a=ae(e);"d"===t&&(i=wr(i));const l=Dn(t)?In(t):t;jn.has(l)&&(i=null!=(o=wn(i))?o:i);const u={t:n,v:i,e:jr(a,r)},c=le(e),f=ue(e);c&&(u.tangentIn=c),f&&(u.tangentOut=f),s.push(u)}s.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const a=e.loop,l=!0===a?{}:a||void 0;return l&&s.length>=2?Pr(t,s,l,n):s}function _r(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 s=Dn(t)?In(t):t,a=jn.has(s),l=i.map(e=>{var n;const r=ie(e);let o=se(e);"d"===t&&(o=wr(o)),a&&(o=null!=(n=wn(o))?n:o);const i={t:r,v:o,e:ae(e)},s=le(e),l=ue(e);return s&&(i.tangentIn=s),l&&(i.tangentOut=l),i}),u={keyframes:Pr(t,l,o,n)};return void 0!==e.autoOrient&&(u.autoOrient=e.autoOrient),u}function zr(t,e){const n=Dr(t,e);return null!=n?n:t}function Dr(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=Dr(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=_r(n,o,e);i!==o&&(r||(r=l({},t)),r[n]=i)}}if(!n&&!r)return null;const i=l({},t);return n&&(i.children=n),r&&(i.animate=r),i}var Tr=0;function Ir(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 s,a=-1;for(;null!==(s=o.exec(t));){const t=s[1],o=i.indexOf(t);if(o<0||o<=a)return;a=o;const l=s[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)?l(l({},n),t):t,o=t[Wt];if(o&&"object"==typeof o){const e=o;if(Array.isArray(e.keyframes)){const n=u(l({},e),{keyframes:e.keyframes.map(t=>u(l({},t),{value:r(t.value)}))});return void 0!==n.value&&(n.value=r(n.value)),u(l({},t),{transform:n})}return t}const i=Object.keys(t).filter(t=>On.has(t));if(1!==i.length)return t;const s=i[0],a=t[s];if(!a||"object"!=typeof a||!Array.isArray(a.keyframes))return t;const c=u(l({},a),{keyframes:a.keyframes.map(t=>u(l({},t),{value:u(l({},n),{[s]:t.value})}))});void 0!==c.value&&(c.value=u(l({},n),{[s]:c.value}));const f=l({},t);return delete f[s],u(l({},f),{transform:c})}function Er(t,e=vt.native){const n=Qt(t)||{},r=Yt(t),o=n.duration||1e3,i=[],s=(t,n,i)=>{if(0===n.length)return null;const s=function(t,e,n,r=vt.native){const o={};for(const[i,s]of Object.entries(t)){if("transform"===i&&"offsetPath"===s.alongPathMode&&void 0!==t.offsetDistance)continue;const a=Mr(i,s,e,n);if(a.length>0){const t={keyframes:a};void 0!==s.autoOrient&&(t.autoOrient=s.autoOrient),void 0!==s.loop&&(t.loop=s.loop),o[i]=r===vt.native&&"transform"===i?rr(t):t}}return o}(Ir(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(s).length?null:{id:t,animate:s}},a=te(t);if(a)for(const t of a){const e=t.target.startsWith("#")?t.target.slice(1):t.target,n=t.animateWith.map(t=>Or(t,r)).filter(t=>!!t),o=s(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=s(n,function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=Or(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=Or(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,s;const a=e.keyframes||[];if(0===a.length)return null;const{prevKf:l,nextKf:u}=function(t,e){var n,r;const o=t.length-1;let i=t[0],s=t[o>0?1:0];for(let a=0;a<o;a++){const l=null!=(n=t[a].t)?n:0,u=null!=(r=t[a+1].t)?r:0;if(l<=e&&e<=u){i=t[a],s=t[a+1];break}e>u&&a===o-1&&(i=t[o>0?o-1:0],s=t[o])}return{prevKf:i,nextKf:s}}(a,n);let c=l===u?0:(f=n,d=null!=(r=l.t)?r:0,h=null!=(o=u.t)?o:0,p=0,m=1,h===d?p:p+(f-d)/(h-d)*(m-p));var f,d,h,p,m;c=En(c,0,1);const g=ae(l);if(g&&Array.isArray(g))try{c=yn(g)(c)}catch(t){}let y=Dn(t)?In(t):t,v=null;const b=null==l?void 0:l.v,k=null==u?void 0:u.v;if("d"===y){v=pn(null!=(i=null==b?void 0:b.paths)?i:Array.isArray(b)?b:[],null!=(s=null==k?void 0:k.paths)?s:Array.isArray(k)?k:[],c).map(t=>cn(t)).join("")}else if(jn.has(y))v=An(hn(b||[0,0,0,1],k||[0,0,0,1],c)),y=t;else if("stroke-dasharray"===y)v=dn(b||[],k||[],c).join(" "),y=t;else if("transform"!==y||null===b||"object"!=typeof b||Array.isArray(b))if("translate"===y){v="translate("+dn(b||[0,0],k||[0,0],c).join(",")+")",y="transform"}else if("rotate"===y){v="rotate("+fn(+(b||0),+(k||0),c)+")",y="transform"}else if("scale"===y){v="scale("+dn(b||[1,1],k||[1,1],c).join(",")+")",y="transform"}else{v=fn(+(b||0),+(k||0),c)}else{const t=new Set([...b?Object.keys(b):[],...k?Object.keys(k):[]]),n={};for(const e of t){const t=null==b?void 0:b[e],r=null==k?void 0:k[e];if("rotate"===e||"skew"===e)n[e]=fn(+(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=dn(t||o,r||o,c);n[e]=i}}if(tr(e)){const t=b.translate,r=k.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=function(t,e,n,r,o,i){const s=nr(t,e,n,r),a=0===s.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 s=1,a=i;for(;s<a;){const t=s+a>>>1;o[t]<n?s=t+1:a=t}const l=o[a-1],u=o[a]-l,c=u>0?(n-l)/u:0;return r[a-1]+c*(r[a]-r[a-1])}(s.lut,o),l=Nn(s.P0,s.P1,s.P2,s.P3,a);if(!i)return{translate:l};const u=Un(s.P0,s.P1,s.P2,s.P3,a);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)}}v=Pn(n,{withUnits:!1}),y="transform"}return Sn.has(y)&&"number"==typeof v&&(v=100*v+"%"),{k:y,v:null===v?"":""+v}}function Vr(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 Ur=/[MmLlHhVvCcSsQqTtAaZz]/;function Lr(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 Cr(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,s=0,a=0,l=0,u=0,c=0,f=0,d="";const h=()=>parseFloat(e[r++]),p=(t,e,r)=>{const s=[o,i],a=Cn(s,t,e,r,48);n.push({P0:s,P1:t,P2:e,P3:r,lut:a,len:a.ds[a.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];Ur.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,s=e,a=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:s}=Lr([o,i],t,e);p(r,s,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:s}=Lr([o,i],t,e);p(r,s,e)}else{if("A"!==g){r++;continue}r+=5,m(h()+(n?o:0),h()+(n?i:0))}d=t}else m(s,a),o=s,i=a,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,s=Math.hypot(i[0]-o[0],i[1]-o[1])<.001,a=t=>{let r=0;for(;r<e.length-1&&t>n[r+1];)r++;const o=e[r],i=t-n[r],s=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,s=o;for(;i<s;){const t=i+s>>>1;r[t]<e?i=t+1:s=t}const a=r[s-1],l=r[s]-a,u=l>0?(e-a)/l:0;return n[s-1]+u*(n[s]-n[s-1])}(o.lut,i):0,[a,l]=Nn(o.P0,o.P1,o.P2,o.P3,s),[u,c]=Un(o.P0,o.P1,o.P2,o.P3,s);return{x:a,y:l,angle:Math.atan2(c,u)}};return{totalLength:r,closed:s,sampleAtDistance(t){if(s&&r>0&&(t<0||t>r))return a((t%r+r)%r);if(!s&&(t<0||t>r)){const e=t<0?0:r,n=a(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 a((o=r,(e=t)<(n=0)?n:e>o?o:e));var e,n,o}}}function Wr(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 Rr(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(Br),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 Fr(t,e,n,r){var o,i,s,a;const u=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]=u(n.value));const c=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,f=l({},c||{}),d={keyframes:n.keyframes};void 0!==n.loop&&(d.loop=n.loop),void 0!==n.autoOrient&&(d.autoOrient=n.autoOrient),f[e]=d,t.animate=f;const h=null!=(a=null!=(i=n.base)?i:null==(o=n.keyframes[0])?void 0:o.value)?a:null==(s=n.keyframes[0])?void 0:s.v;void 0!==h&&(t[e]=u(h))}function Br(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=l({},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 Gr(t,e){var n;const r=Rr(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)}function Zr(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 Jr(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Jr);const e={};for(const n of Object.keys(t))e[n]=Jr(t[n]);return e}function qr(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 Qr(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function Xr(t){var e;const n=Qr(t.x),r=Qr(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 Hr(t,e){return"_lw_"+e+"_"+t.nextId++}function Kr(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function $r(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>$r(t,e))}function Yr(t,e){if(!e.length)return;(t.children||(t.children=[])).unshift({type:"defs",children:e})}var to=Jr;function eo(t,e){return qr(t,()=>Hr(e,"retimed"))}function no(t){const e=Rr(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 ro(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 s=t.textContent;if("string"==typeof s&&(e+=s.length),t.children)for(const e of t.children)r(e)};return r(t),e*n}var oo=t=>Math.round(1e3*t)/1e3;function io(t,e){var n;if("clip"===e.pathOverflow)return{d:t,startShift:0};const r=Cr(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,i=.15*o,s=no(e.startOffset),a=no(e.textLength).max||(null!=(n=e.advance)?n:0),l=Math.max(0,-s.min),u=Math.max(0,s.max+a-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"+oo(e)+","+oo(n)+"L"+oo(d.x)+","+oo(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"+oo(t)+","+oo(e)}return{d:p,startShift:c}}function so(t,e,n){var r;if(!e||"string"!=typeof e.pathData||!e.pathData)return t;const o=Hr(n,"tpath"),{d:i,startShift:s}=io(e.pathData,{pathOverflow:e.pathOverflow,startOffset:e.startOffset,textLength:e.textLength,advance:ro(t)});n.defs.push({type:"path",id:o,d:i});const a={type:"textPath",href:"#"+o,children:null!=(r=t.children)?r:[]};return void 0!==e.lengthAdjust&&(a.lengthAdjust=e.lengthAdjust),void 0!==e.method&&(a.method=e.method),void 0!==e.spacing&&(a.spacing=e.spacing),ao(a,"startOffset",function(t,e){if(!e||null==t)return t;const n=Rr(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=>u(l({},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,s)),ao(a,"textLength",e.textLength),t.children=[a],t}function ao(t,e,n){null!=n&&Fr(t,e,Rr(n),{asString:!0})}var lo=(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 uo(t,e){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function co(t,e){let n="";for(let r=0;r<t.length;r++){const o=uo(t[r],e);r>0&&45!==o.charCodeAt(0)&&(n+=" "),n+=o}return n}function fo(t,e,n){return[t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}var ho=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function po(t,e,n=2){const r=[];let o;for(ho.lastIndex=0;null!==(o=ho.exec(t));)r.push(o[0]);let i="",s=0;const a=()=>parseFloat(r[s++]);for(;s<r.length;){const t=r[s++];if("M"===t||"L"===t){const[r,o]=fo(e,a(),a());i+=t+co([r,o],n)}else if("C"===t){const[t,r]=fo(e,a(),a()),[o,s]=fo(e,a(),a()),[l,u]=fo(e,a(),a());i+="C"+co([t,r,o,s,l,u],n)}else if("Q"===t){const[t,r]=fo(e,a(),a()),[o,s]=fo(e,a(),a());i+="Q"+co([t,r,o,s],n)}else"Z"!==t&&"z"!==t||(i+="Z")}return i}var mo=["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"],yo=["fill","stroke","strokeWidth","opacity","fillOpacity","strokeOpacity","strokeDasharray","strokeDashoffset"];function vo(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?void 0:e}}function bo(t){return"string"==typeof t?t:void 0}function ko(t){const e=t.animate;if(!e||"object"!=typeof e)return;let n;for(const t of yo)void 0!==e[t]&&((null!=n?n:n={})[t]=e[t]);return n}function xo(t,e){var n,r,o,i,s,a,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=bo(t.fontFamily))?n:e.fontFamily,fontSize:null!=(r=vo(t.fontSize))?r:e.fontSize,fill:null!=(o=t.fill)?o:e.fill,stroke:null!=(i=t.stroke)?i:e.stroke,strokeWidth:null!=(s=t.strokeWidth)?s:e.strokeWidth,letterSpacing:null!=(a=vo(t.letterSpacing))?a:e.letterSpacing,wordSpacing:null!=(l=vo(t.wordSpacing))?l:e.wordSpacing,opacity:null!=(u=vo(p("opacity")))?u:e.opacity,animate:null!=(c=d?void 0:ko(t))?c:e.animate};for(const t of go){const n=null!=(f=p(t))?f:e[t];void 0!==n&&(m[t]=n)}return m}function Ao(t){var e,n,r;return{fontFamily:bo(t.fontFamily),fontSize:null!=(e=vo(t.fontSize))?e:16,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(n=vo(t.letterSpacing))?n:0,wordSpacing:null!=(r=vo(t.wordSpacing))?r:0}}function wo(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 go)void 0!==t[n]&&(e[n]=t[n]);return void 0!==t.animate&&(e.animate=t.animate),e}function jo(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 Oo(t){const e=Object.keys(t);return 1===e.length?t[e[0]]:void 0}function So(t,e){if(t<=0||e<=0)return"";const n=.08,r=t*n,o=.92*t,i=.92*-e,s=o-r,a=-i,l=Math.max(1,.12*Math.min(s,a)),u="M"+r+" 0L"+o+" 0L"+o+" "+i+"L"+r+" "+i+"Z";if(s<=2*l||a<=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 Po(t,e){var n,r,o;const{glyphs:i,create:s=lo,warnings:a}=e,l=Oo(i),u={x:null!=(n=vo(t.x))?n:0,y:null!=(r=vo(t.y))?r:0},c=[],f=[{start:u.x,end:u.x}];let d=0;const h=(t,e)=>{var n;const r=jo(e,i,l,a),o=(null==r?void 0:r.unitsPerEm)||1e3,s=e.fontSize/o,h=null!=(n=null==r?void 0:r.ascent)?n:.9*o,p=wo(e);for(let n=0;n<t.length;n++){const i=t.charAt(n),a=null==r?void 0:r.glyphs[i];if(a&&a.pathData)c.push({glyphD:a.pathData,m:[s,0,0,s,u.x,u.y],paint:p,line:d,x:u.x,y:u.y,scale:s}),u.x+=a.width*s;else if(/\S/.test(i)){const t=a&&a.width>0?a.width:.6*o;c.push({glyphD:So(t,h),m:[s,0,0,s,u.x,u.y],paint:p,isMissing:!0,line:d,x:u.x,y:u.y,scale:s}),u.x+=t*s}else u.x+=(a?a.width:0)*s;u.x+=e.letterSpacing+(" "===i?e.wordSpacing:0),f[d].end=u.x}},p=(t,e)=>{var n,r,o;const i=xo(t,e),s=vo(t.x),a=vo(t.y);void 0!==s&&(u.x=s,d=f.length,f.push({start:u.x,end:u.x})),void 0!==a&&(u.y=a),u.x+=null!=(n=vo(t.dx))?n:0,u.y+=null!=(r=vo(t.dy))?r:0;const l=bo(t[Lt]);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=Ao(t);if(t.children)for(const e of t.children)p(e,m);const g=bo(t[Lt]);g&&!(null==(o=t.children)?void 0:o.length)&&h(g,m);const y=bo(t.textAnchor);if("middle"===y||"end"===y)for(const t of c){const e=f[t.line].end-f[t.line].start,n="middle"===y?-e/2:-e;t.m=[t.scale,0,0,t.scale,t.x+n,t.y]}return Co(t,Lo(c,s,a),s)}function Mo(t,e){var n,r,o,i,s;if(null==(n=e.alongPath)?void 0:n.pathD)return function(t,e,n){var r,o;const{glyphs:i,warnings:s,alongPath:a}=n,l=Cr(e);if(!l)return null==s||s.push("textGlyphs: unparsable along-path geometry (caret)"),[];const u=Oo(i),c=[];let f=0;const d=(t,e)=>{var n,r;const o=xo(t,e),a=bo(t[Lt]);if(a&&!(null==(n=t.children)?void 0:n.length)){const t=jo(o,i,u,s),e=(null==t?void 0:t.unitsPerEm)||1e3,n=o.fontSize/e,l=(null!=(r=null==t?void 0:t.ascent)?r:.9*e)*n;for(let e=0;e<a.length;e++){const r=a.charAt(e),i=null==t?void 0:t.glyphs[r],s=(i?i.width:0)*n,u=s+o.letterSpacing+(" "===r?o.wordSpacing:0);c.push({advStart:f,advEnd:f+u,glyphW:s,ascent:l,fontSize:o.fontSize}),f+=u}}if(t.children)for(const e of t.children)d(e,o)};d(t,Ao(t));const h=f,p=Rr(null==a?void 0:a.textLength),m="animated"===p.kind?Number(null==(r=p.keyframes[0])?void 0:r.value)||0:"static"===p.kind&&Number(p.value)||0,g=m>0&&h>0?m/h:1,y=Rr(null==a?void 0:a.startOffset),{along:v,perp:b}=zo(t),k=v+("animated"===y.kind?Number(null==(o=y.keyframes[0])?void 0:o.value)||0:"static"===y.kind&&Number(y.value)||0),x=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 e=k+t.advStart*g,n=k+t.advEnd*g,r=x(l.sampleAtDistance(e)),o=x(l.sampleAtDistance(n)),i=l.sampleAtDistance(k+(t.advStart+t.glyphW/2)*g);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,e.alongPath.pathD,e);const{glyphs:a,warnings:l}=e,u=Oo(a),f={x:null!=(r=vo(t.x))?r:0,y:null!=(o=vo(t.y))?o:0},d=[],h=[{start:f.x,end:f.x}];let p=0;const m=(t,e)=>{var n;const r=jo(e,a,u,l),o=(null==r?void 0:r.unitsPerEm)||1e3,i=e.fontSize/o,s=(null!=(n=null==r?void 0:r.ascent)?n:.9*o)*i;for(let n=0;n<t.length;n++){const o=t.charAt(n),a=null==r?void 0:r.glyphs[o],l=(a?a.width:0)*i+e.letterSpacing+(" "===o?e.wordSpacing:0);d.push({x:f.x,y:f.y,width:l,ascent:s,fontSize:e.fontSize,line:p}),f.x+=l,h[p].end=f.x}},g=(t,e)=>{var n,r,o;const i=xo(t,e),s=vo(t.x),a=vo(t.y);void 0!==s&&(f.x=s,p=h.length,h.push({start:f.x,end:f.x})),void 0!==a&&(f.y=a),f.x+=null!=(n=vo(t.dx))?n:0,f.y+=null!=(r=vo(t.dy))?r:0;const l=bo(t[Lt]);if(l&&!(null==(o=t.children)?void 0:o.length)&&m(l,i),t.children)for(const e of t.children)g(e,i)},y=Ao(t);if(t.children)for(const e of t.children){const t=d.length;if(g(e,y),d.length===t){const t=xo(e,y),n=jo(t,a,u),r=(null==n?void 0:n.unitsPerEm)||1e3;d.push({x:f.x,y:f.y,width:0,ascent:(null!=(i=null==n?void 0:n.ascent)?i:.9*r)*(t.fontSize/r),fontSize:t.fontSize,line:p})}}const v=bo(t[Lt]);v&&!(null==(s=t.children)?void 0:s.length)&&m(v,y);const b=bo(t.textAnchor);if("middle"===b||"end"===b)for(const t of d){const e=h[t.line].end-h[t.line].start;t.x+="middle"===b?-e/2:-e}return d.map(t=>{var e=t,{line:n}=e;return c(e,["line"])})}function _o(t,e,n,r,o=0){const{x:i,y:s,angle:a}=t.sampleAtDistance(e),l=Math.cos(a),u=Math.sin(a),c=r/2;return[n*l,n*u,-n*u,n*l,i-n*l*c-o*u,s-n*u*c+o*l]}function zo(t){var e,n,r;return{along:(null!=(e=vo(t.x))?e:0)+(null!=(n=vo(t.dx))?n:0),perp:null!=(r=vo(t.dy))?r:0}}function Do(t,e,n,r,o,i){const{glyphs:s,create:a=lo,warnings:c}=r,f=e?Cr(e):null;if(!f)return null==c||c.push("textGlyphs: unparsable along-path geometry"),null;const d=Oo(s),{cells:h,width:p}=function(t,e,n,r){const o=[];let i=0;const s=(t,a)=>{var l,u;const c=xo(t,a),f=bo(t[Lt]);if(f&&!(null==(l=t.children)?void 0:l.length)){const t=jo(c,e,n,r);if(t){const e=c.fontSize/t.unitsPerEm,n=null!=(u=t.ascent)?u:.9*t.unitsPerEm,r=wo(c);for(let s=0;s<f.length;s++){const a=f.charAt(s),l=t.glyphs[a];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(a)){const s=l&&l.width>0?l.width:.6*t.unitsPerEm,a=s*e;o.push({glyphD:So(s,n),widthEm:s,scale:e,paint:r,isMissing:!0,midBase:i+a/2}),i+=a}else i+=(l?l.width:0)*e;i+=c.letterSpacing+(" "===a?c.wordSpacing:0)}}}if(t.children)for(const e of t.children)s(e,c)};return s(t,Ao(t)),{cells:o,width:i}}(t,s,d,c);if(!h.length)return Co(t,[],a);const{along:m,perp:g}=zo(t),y=To(n),v=To(o),b=t=>t>0&&p>0?t/p:1,k="clip"===i&&!f.closed;if(y.animated||v.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}(y.times,v.times),n=(t,e)=>m+y.at(e)+b(v.at(e))*t.midBase,r=y.animated?y.loop:v.loop;return Co(t,function(t,e,n,r,o,i,s,a=0){const c=Math.max(e.totalLength/Io,.5),f=t=>t>=0&&t<=e.totalLength,d=[];for(const h of t){const t=[h.scale,0,0,h.scale,-h.scale*(h.widthEm/2),0],p=po(h.glyphD,t),m=(t,n)=>{const{x:r,y:o,angle:i}=e.sampleAtDistance(t),s=Math.cos(i),l=Math.sin(i);return{time:n,value:{translate:[No(r-a*l,3),No(o+a*s,3)],rotate:No(180*i/Math.PI,3)}}},g=[],y=[],v=(t,e)=>{g.push(m(t,e)),s&&y.push({time:e,value:f(t)?1:0})};v(n(h,r[0]),r[0]);for(let t=1;t<r.length;t++){const e=r[t-1],o=r[t],i=n(h,e),s=n(h,o),a=Math.min(Eo,Math.max(1,Math.ceil(Math.abs(s-i)/c)));for(let t=1;t<=a;t++){const r=e+t/a*(o-e);v(n(h,r),r)}}or(g);const b={keyframes:g};void 0!==o&&(b.loop=o);const k={transform:b};if(h.paint.animate&&Object.assign(k,h.paint.animate),s&&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},Vo(h.paint)),Uo(h.isMissing)),{animate:k}),[]))}return d}(h,f,n,e,r,a,k,g),a)}const x=b(v.at(0)),A=m+y.at(0);return Co(t,Lo((k?h.filter(t=>{const e=A+t.midBase*x;return e>=0&&e<=f.totalLength}):h).map(t=>({glyphD:t.glyphD,paint:t.paint,isMissing:t.isMissing,m:_o(f,A+t.midBase*x,t.scale,t.widthEm,g)})),a,c),a)}function To(t){var e;const n=Rr(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 Io=48,Eo=64;function No(t,e){const n=s(10,e);return Math.round(t*n)/n}function Vo(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 go)void 0!==t[n]&&(e[n]=t[n]);return e}function Uo(t){return t?{[Ct]:"px-missing-glyph"}:{}}function Lo(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=po(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",l(l(l({d:n},Vo(t)),Uo(i)),void 0!==t.animate?{animate:l({},t.animate)}:{}),[]));return o}function Co(t,e,n){const r={};for(const e of Object.keys(t))"type"!==e&&"children"!==e&&-1===mo.indexOf(e)&&(r[e]=t[e]);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 n("g",r,e)}function Wo(t,e){return e.alongPath?Do(t,e.alongPath.pathD,e.alongPath.startOffset,e,e.alongPath.textLength,e.alongPath.pathOverflow):Po(t,e)}function Ro(t,e,n){return(null==e?void 0:e.useGlyphs)?n.glyphs?Po(t,{glyphs:n.glyphs,warnings:n.warnings}):(n.warnings.push("textGlyphs: no definitions.fonts — left as native <text>"),t):t}function Fo(t,e,n,r,o,i){return e.glyphs?Do(t,n,r,{glyphs:e.glyphs,warnings:e.warnings},o,i):(e.warnings.push("textGlyphs: no definitions.fonts"),null)}var Bo={document:"document",host:"host",platform:"platform",usage:"usage",internal:"internal"};function Go(t){return"PX"+t+" https://github.com/pixodesk/pixodesk-svg-animator/blob/main/docs/diagnostics.md#px"+t}function Zo(t,e){const n=e?e+" ":"";return{warn:(e,r,...o)=>{const i=Go(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=Go(r),s=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:s}):(null==t?void 0:t.muteError)||console.error(n+e+" "+i,...o)}}}function Jo(t){try{return{problems:Ke(t)}}catch(t){return{problems:[]}}}function qo(t,e){const{problems:n}=Jo(t);if(!n.length)return;const r=n.slice(0,6),o=n.length-r.length;console.warn(e+": this document does not match the animation schema in "+n.length+" place"+(1===n.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,I as px,E as PX_WIRE_SCHEMA_VERSION,N as PX_WIRE_VERSION_KEY,U as PxWireVersionRelation,C as parseWireVersion,W as formatWireVersion,R 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,et as PxFillMode,nt as PxPlaybackDirection,rt as PX_ANIM_SRC_ATTR_NAME,ot as PX_ANIM_ATTR_NAME,it as PxTriggerStart,st as PxOffScreenAction,at as PxMouseOutAction,lt as PxFinishAction,ut as PxScrollKind,ct as PxScrollAxis,ft as PxScrollSource,dt as PxPinAlign,ht as PxScrollPhase,pt as PxAlongPathMode,mt as PX_TIMELINE_SHARED_KEYS,gt as PX_TIME_ONLY_TIMELINE_KEYS,vt as PxTimelineEngine,bt as PxTimelineEngineSetting,kt as resolveTimelineEngine,xt as isNativeForced,At as mayUseNativeScrollTimeline,wt as PX_TRIGGER_DEFAULTS,jt as PxControlMode,Ot as resolveControlMode,St as controlModeTakesOverTrigger,Pt as resolveTrigger,Mt as PxLoopRepeatAt,_t as PxLoopDirection,zt as PxMaskType,Dt as PxUnits,Tt as PxCloneWithout,It as PxPathOverflow,Et as PxLengthAdjust,Nt as PxTextPathMethod,Vt as PxTextPathSpacing,Ut as PxStrokeTrimSubPaths,Lt as PX_TEXT_CONTENT_ATTR,Wt as TRANSFORM_ATTR,Rt as OFFSET_DISTANCE_ATTR,Bt as TRANSFORM_PART,Gt as PX_TRANSFORM_PART_KEYS,Zt as PxGradientSpreadMethod,Jt as PxGradientType,qt as isPxDocument,Qt as getAnimatorConfig,Kt as flattenAnimatorTimeline,$t as nestAnimatorTimeline,Yt as getDefinitions,te as getBindings,ee as getChildren,re as PxKeyframeValueSchema,oe as PxKeyframeSchema,ie as keyframeTime,se as keyframeValue,ae as keyframeEasing,le as keyframeTangentIn,ue as keyframeTangentOut,ce as PxLoopSchema,fe as PxPropertyAnimationSchema,de as PxTransformPartsSchema,he as PxTransformValueSchema,me as PxElementAnimationSchema,ge as PxTriggerSchema,be as PxDefinitionsSchema,ke as PxScrollRangePointSchema,xe as PxScrollRangeSchema,Ae as PxScrollSchema,_e as PxTimelineSchema,De as PxAnimatorConfigSchema,Te as PxAttrValueSchema,Ve as PxTransformByEffectSchema,Ue as PxRepeaterEffectSchema,Le as PxMaskedByEffectSchema,Ce as PxClipPathEffectSchema,We as PxStrokeTrimEffectSchema,Re as PxRetimeEffectSchema,Fe as PxCloneEffectSchema,Be as PxGradientStopSchema,Ze as PxFillGradientEffectSchema,qe as PxTextPathEffectSchema,Qe as PxTextEffectSchema,Xe as PxEffectsSchema,He as validateNodeEffects,Ke as validateDocument,$e as PxNodeBaseSchema,Ye as PxNodeSchema,tn as PxSvgNodeRootSchema,en as PxAnimatedSvgDocumentSchema,nn as PxBezierPathSchema,rn as isValidPxDocument,sn as generateUniqueId,an as deepClone,ln as generateNewIds,cn as bezierToSvgPath,yn as cubicBezier,bn as subdivideCubicBezier,kn as splitEasing,xn as reverseEasing,An as toRGBA,jn as PX_COLOR_ATTR_NAMES,On as PX_TRANSFORM_FN_NAMES,Sn as PX_PCT_BASED_ATTR_NAMES,Pn as composeTransformParts,Mn as PX_STYLE_ATTR_NAMES,_n as PX_DEFAULT_DURATION_MS,zn as kebabToCamelCaseWord,In as camelCaseToKebabWordIfNeeded,En as clamp,Cn as bezier2D_arcLengthLUT,Rn as PX_DISALLOWED_SVG_TAGS_LOWER,Gn as PX_CSS_ONLY_STYLE_PROPS,Xn as sanitizeAttributeValue,Hn as toDomProps,rr as materializeMotionPathInPropAnim,gr as materializeMotionPathsInTree,vr as PX_LOOP_JUMP_SHIFT_MS,kr as parseSvgPathToBezier,Sr as interpolateValue,zr as materializeInternalLoopsInTree,Ir as mergeStaticTransformIntoAnimDef,Er as normalizeBindings,Vr as calcAnimationValues,Wr as partsRecord,Rr as readAnimatable,Fr as writeAnimatableChannel,Gr as readStaticOrigin,Zr as keyframeWith,Jr as deepClonePxNode,qr as regenerateIdsAndRewriteRefs,Xr as applyUseOffsetToG,Hr as genId,Kr as stripHash,$r as indexById,Yr as spliceDefs,to as clone,eo as regenerateIdsInClone,Cr as createPathSampler,io as extendedPathForBrowser,so as applyTextPathEffect,Mo as layoutGlyphTextChars,Do as materializeGlyphTextAlongPath,Wo as materializeGlyphText,Ro as applyTextGlyphsEffect,Fo as applyTextGlyphsAlongPath,Bo as PxDiagnosticKind,Zo as createDiagnostics,Jo as diagnoseDocument,qo as reportDocumentDiagnostics};
package/dist/index.cjs CHANGED
@@ -68,6 +68,7 @@ __export(index_exports, {
68
68
  PxCloneWithout: () => PxCloneWithout,
69
69
  PxControlMode: () => PxControlMode,
70
70
  PxDefinitionsSchema: () => PxDefinitionsSchema,
71
+ PxDiagnosticCode: () => PxDiagnosticCode,
71
72
  PxDiagnosticKind: () => PxDiagnosticKind,
72
73
  PxEffectsSchema: () => PxEffectsSchema,
73
74
  PxElementAnimationSchema: () => PxElementAnimationSchema,
@@ -85,9 +86,10 @@ __export(index_exports, {
85
86
  PxLoopSchema: () => PxLoopSchema,
86
87
  PxMaskType: () => PxMaskType,
87
88
  PxMaskedByEffectSchema: () => PxMaskedByEffectSchema,
89
+ PxMouseOutAction: () => PxMouseOutAction,
88
90
  PxNodeBaseSchema: () => PxNodeBaseSchema,
89
91
  PxNodeSchema: () => PxNodeSchema,
90
- PxOutAction: () => PxOutAction,
92
+ PxOffScreenAction: () => PxOffScreenAction,
91
93
  PxPathOverflow: () => PxPathOverflow,
92
94
  PxPinAlign: () => PxPinAlign,
93
95
  PxPlaybackDirection: () => PxPlaybackDirection,
@@ -101,7 +103,6 @@ __export(index_exports, {
101
103
  PxScrollRangeSchema: () => PxScrollRangeSchema,
102
104
  PxScrollSchema: () => PxScrollSchema,
103
105
  PxScrollSource: () => PxScrollSource,
104
- PxStartOn: () => PxStartOn,
105
106
  PxStrokeTrimEffectSchema: () => PxStrokeTrimEffectSchema,
106
107
  PxStrokeTrimSubPaths: () => PxStrokeTrimSubPaths,
107
108
  PxSvgNodeRootSchema: () => PxSvgNodeRootSchema,
@@ -116,6 +117,7 @@ __export(index_exports, {
116
117
  PxTransformPartsSchema: () => PxTransformPartsSchema,
117
118
  PxTransformValueSchema: () => PxTransformValueSchema,
118
119
  PxTriggerSchema: () => PxTriggerSchema,
120
+ PxTriggerStart: () => PxTriggerStart,
119
121
  PxUnits: () => PxUnits,
120
122
  PxWireStepKind: () => PxWireStepKind,
121
123
  PxWireVersionRelation: () => PxWireVersionRelation,
@@ -699,7 +701,7 @@ var px = {
699
701
  };
700
702
 
701
703
  // src/version/PxSchemaVersion.ts
702
- var PX_WIRE_SCHEMA_VERSION = "1.1";
704
+ var PX_WIRE_SCHEMA_VERSION = "1.2";
703
705
 
704
706
  // src/version/PxWireVersion.ts
705
707
  var PX_WIRE_VERSION_KEY = "version";
@@ -768,7 +770,46 @@ var PxWireStepKind = /* @__PURE__ */ ((PxWireStepKind2) => {
768
770
  return PxWireStepKind2;
769
771
  })(PxWireStepKind || {});
770
772
  var PX_WIRE_BASELINE_VERSION = "1.1";
771
- var PX_WIRE_STEPS = [];
773
+ var PX_WIRE_STEPS = [
774
+ {
775
+ from: "1.1",
776
+ to: "1.2",
777
+ reason: "The trigger block became two axes: `start` says what STARTS an animation, `offScreen` + `visibilityThreshold` + `visibilityDebounce` say whether it may RUN. `scrollIntoView` is no longer a start value \u2014 it is what `start: 'load'` behind the default gate already means \u2014 and `outAction` split into `offScreen` (scroll) and `mouseOut` (hover), because one field meant three things.",
778
+ kind: "converted" /* converted */,
779
+ up: upTriggerTwoAxes
780
+ // No `down`: 1.2 can express combinations 1.1 could not ("start on click AND pause when
781
+ // scrolled away"), so the mapping is not invertible.
782
+ }
783
+ ];
784
+ function upTriggerTwoAxes(doc) {
785
+ const animator = doc["animator"];
786
+ if (!animator || typeof animator !== "object") return;
787
+ const timeline = animator["timeline"];
788
+ const holder = timeline && typeof timeline === "object" ? timeline : animator;
789
+ const trigger = holder["trigger"];
790
+ if (!trigger || typeof trigger !== "object") return;
791
+ const t = trigger;
792
+ const startOn = t["startOn"];
793
+ const outAction = t["outAction"];
794
+ delete t["startOn"];
795
+ delete t["outAction"];
796
+ if (startOn === "scrollIntoView") {
797
+ if (outAction !== void 0) t["offScreen"] = outAction;
798
+ } else {
799
+ if (startOn === "programmatic") t["start"] = "none";
800
+ else if (startOn !== void 0) t["start"] = startOn;
801
+ if (startOn === "mouseOver" && outAction !== void 0) t["mouseOut"] = outAction;
802
+ if (t["offScreen"] === void 0) t["offScreen"] = "continue";
803
+ }
804
+ if (t["scrollIntoViewThreshold"] !== void 0) {
805
+ t["visibilityThreshold"] = t["scrollIntoViewThreshold"];
806
+ delete t["scrollIntoViewThreshold"];
807
+ }
808
+ if (t["finishAction"] !== void 0) {
809
+ t["finish"] = t["finishAction"];
810
+ delete t["finishAction"];
811
+ }
812
+ }
772
813
  function applyWireSteps(doc, cfg) {
773
814
  const from = readWireVersion(doc);
774
815
  const relation = compareWireVersion(from, cfg.target, cfg.readerReadsEditorPart);
@@ -891,14 +932,18 @@ var PxPlaybackDirection = {
891
932
  alternate: "alternate",
892
933
  alternateReverse: "alternate-reverse"
893
934
  };
894
- var PxStartOn = {
935
+ var PxTriggerStart = {
895
936
  load: "load",
896
937
  mouseOver: "mouseOver",
897
938
  click: "click",
898
- scrollIntoView: "scrollIntoView",
899
- programmatic: "programmatic"
939
+ none: "none"
900
940
  };
901
- var PxOutAction = {
941
+ var PxOffScreenAction = {
942
+ pause: "pause",
943
+ continue: "continue",
944
+ reset: "reset"
945
+ };
946
+ var PxMouseOutAction = {
902
947
  continue: "continue",
903
948
  pause: "pause",
904
949
  reset: "reset",
@@ -966,9 +1011,11 @@ function mayUseNativeScrollTimeline(engine) {
966
1011
  return engine !== PxTimelineEngineSetting.js;
967
1012
  }
968
1013
  var PX_TRIGGER_DEFAULTS = {
969
- startOn: "load",
970
- outAction: "continue",
971
- scrollIntoViewThreshold: 0
1014
+ start: "load",
1015
+ offScreen: "pause",
1016
+ mouseOut: "continue",
1017
+ visibilityThreshold: 0.5,
1018
+ visibilityDebounce: 150
972
1019
  };
973
1020
  var PxControlMode = {
974
1021
  /** No control props — the document's trigger decides, and nothing is taken over. */
@@ -1002,11 +1049,13 @@ function controlModeTakesOverTrigger(mode) {
1002
1049
  return mode !== PxControlMode.autoplay;
1003
1050
  }
1004
1051
  function resolveTrigger(trigger) {
1005
- var _a2, _b, _c;
1052
+ var _a2, _b, _c, _d, _e;
1006
1053
  return {
1007
- startOn: (_a2 = trigger == null ? void 0 : trigger.startOn) != null ? _a2 : PX_TRIGGER_DEFAULTS.startOn,
1008
- outAction: (_b = trigger == null ? void 0 : trigger.outAction) != null ? _b : PX_TRIGGER_DEFAULTS.outAction,
1009
- scrollIntoViewThreshold: (_c = trigger == null ? void 0 : trigger.scrollIntoViewThreshold) != null ? _c : PX_TRIGGER_DEFAULTS.scrollIntoViewThreshold
1054
+ start: (_a2 = trigger == null ? void 0 : trigger.start) != null ? _a2 : PX_TRIGGER_DEFAULTS.start,
1055
+ offScreen: (_b = trigger == null ? void 0 : trigger.offScreen) != null ? _b : PX_TRIGGER_DEFAULTS.offScreen,
1056
+ mouseOut: (_c = trigger == null ? void 0 : trigger.mouseOut) != null ? _c : PX_TRIGGER_DEFAULTS.mouseOut,
1057
+ visibilityThreshold: (_d = trigger == null ? void 0 : trigger.visibilityThreshold) != null ? _d : PX_TRIGGER_DEFAULTS.visibilityThreshold,
1058
+ visibilityDebounce: (_e = trigger == null ? void 0 : trigger.visibilityDebounce) != null ? _e : PX_TRIGGER_DEFAULTS.visibilityDebounce
1010
1059
  };
1011
1060
  }
1012
1061
  var PxLoopRepeatAt = {
@@ -1142,9 +1191,9 @@ function flattenAnimatorTimeline(cfg) {
1142
1191
  } else {
1143
1192
  if (timeline.duration !== void 0) flat.duration = timeline.duration;
1144
1193
  if (timeline.trigger !== void 0) {
1145
- const _b = timeline.trigger, { finishAction } = _b, restTrigger = __objRest(_b, ["finishAction"]);
1194
+ const _b = timeline.trigger, { finish } = _b, restTrigger = __objRest(_b, ["finish"]);
1146
1195
  if (Object.keys(restTrigger).length) flat.trigger = restTrigger;
1147
- if (finishAction !== void 0) flat.resetOnFinish = finishAction === "reset";
1196
+ if (finish !== void 0) flat.resetOnFinish = finish === "reset";
1148
1197
  }
1149
1198
  if (timeline.delay !== void 0) flat.delay = timeline.delay;
1150
1199
  if (timeline.iterations !== void 0) flat.iterations = timeline.iterations;
@@ -1211,7 +1260,7 @@ function nestAnimatorTimeline(cfg) {
1211
1260
  if (duration !== void 0) timeline.duration = duration;
1212
1261
  if (trigger !== void 0 || resetOnFinish) {
1213
1262
  const t = __spreadValues({}, trigger || {});
1214
- if (resetOnFinish) t.finishAction = "reset";
1263
+ if (resetOnFinish) t.finish = "reset";
1215
1264
  timeline.trigger = t;
1216
1265
  }
1217
1266
  if (delay !== void 0) timeline.delay = delay;
@@ -1314,13 +1363,15 @@ var PxElementAnimationSchema = implementsInterface()(px.union([
1314
1363
  PxAnimationDefinitionSchema
1315
1364
  ]));
1316
1365
  var PxTriggerSchema = implementsInterface()(px.object({
1317
- startOn: px.enum([PxStartOn.load, PxStartOn.mouseOver, PxStartOn.click, PxStartOn.scrollIntoView, PxStartOn.programmatic], PX_TRIGGER_DEFAULTS.startOn).optional(),
1318
- outAction: px.enum([PxOutAction.continue, PxOutAction.pause, PxOutAction.reset, PxOutAction.reverse], PX_TRIGGER_DEFAULTS.outAction).optional(),
1366
+ start: px.enum([PxTriggerStart.load, PxTriggerStart.mouseOver, PxTriggerStart.click, PxTriggerStart.none], PX_TRIGGER_DEFAULTS.start).optional(),
1367
+ offScreen: px.enum([PxOffScreenAction.pause, PxOffScreenAction.continue, PxOffScreenAction.reset], PX_TRIGGER_DEFAULTS.offScreen).optional(),
1368
+ mouseOut: px.enum([PxMouseOutAction.continue, PxMouseOutAction.pause, PxMouseOutAction.reset, PxMouseOutAction.reverse], PX_TRIGGER_DEFAULTS.mouseOut).optional(),
1319
1369
  // What happens after a NATURAL finish — `'hold'` (default: keep the end state per
1320
- // `fill`) or `'reset'` (snap back to the start state). Pairs with `outAction` ("what
1321
- // happens when the trigger condition ends"); both end-of-life knobs now read alike.
1322
- finishAction: px.enum([PxFinishAction.hold, PxFinishAction.reset]).optional(),
1323
- scrollIntoViewThreshold: px.number().optional()
1370
+ // `fill`) or `'reset'` (snap back to the start state). One of four occasion keys
1371
+ // (`start`, `offScreen`, `mouseOut`, `finish`), all named the same way.
1372
+ finish: px.enum([PxFinishAction.hold, PxFinishAction.reset]).optional(),
1373
+ visibilityThreshold: px.number().optional(),
1374
+ visibilityDebounce: px.number().optional()
1324
1375
  }));
1325
1376
  var PxGlyphSchema = implementsInterface()(px.object({
1326
1377
  width: px.number(),
@@ -6449,6 +6500,38 @@ function createAdapterAnimator(doc, adapter, callbacks) {
6449
6500
  return api;
6450
6501
  }
6451
6502
 
6503
+ // src/playback/PxDiagnosticCode.ts
6504
+ var PxDiagnosticCode = /* @__PURE__ */ ((PxDiagnosticCode2) => {
6505
+ PxDiagnosticCode2[PxDiagnosticCode2["buildFailed"] = 1001] = "buildFailed";
6506
+ PxDiagnosticCode2[PxDiagnosticCode2["invalidDocumentAtSrc"] = 1002] = "invalidDocumentAtSrc";
6507
+ PxDiagnosticCode2[PxDiagnosticCode2["loadFailed"] = 1003] = "loadFailed";
6508
+ PxDiagnosticCode2[PxDiagnosticCode2["animationBuildFailed"] = 1004] = "animationBuildFailed";
6509
+ PxDiagnosticCode2[PxDiagnosticCode2["effectsShape"] = 1101] = "effectsShape";
6510
+ PxDiagnosticCode2[PxDiagnosticCode2["timelineOverrideIgnored"] = 1102] = "timelineOverrideIgnored";
6511
+ PxDiagnosticCode2[PxDiagnosticCode2["blockedTag"] = 1103] = "blockedTag";
6512
+ PxDiagnosticCode2[PxDiagnosticCode2["unsupportedAnimatedAttrs"] = 1104] = "unsupportedAnimatedAttrs";
6513
+ PxDiagnosticCode2[PxDiagnosticCode2["noBindings"] = 1105] = "noBindings";
6514
+ PxDiagnosticCode2[PxDiagnosticCode2["unresolvedBinding"] = 1106] = "unresolvedBinding";
6515
+ PxDiagnosticCode2[PxDiagnosticCode2["triggersNoRoot"] = 1201] = "triggersNoRoot";
6516
+ PxDiagnosticCode2[PxDiagnosticCode2["noRootForSelector"] = 1202] = "noRootForSelector";
6517
+ PxDiagnosticCode2[PxDiagnosticCode2["noRootElement"] = 1203] = "noRootElement";
6518
+ PxDiagnosticCode2[PxDiagnosticCode2["noElementsForSelector"] = 1206] = "noElementsForSelector";
6519
+ PxDiagnosticCode2[PxDiagnosticCode2["setAttributeNoElement"] = 1207] = "setAttributeNoElement";
6520
+ PxDiagnosticCode2[PxDiagnosticCode2["scrollSmoothingNeedsOwnDriver"] = 1301] = "scrollSmoothingNeedsOwnDriver";
6521
+ PxDiagnosticCode2[PxDiagnosticCode2["scrollNativeUnavailable"] = 1302] = "scrollNativeUnavailable";
6522
+ PxDiagnosticCode2[PxDiagnosticCode2["scrollSubjectInvalid"] = 1303] = "scrollSubjectInvalid";
6523
+ PxDiagnosticCode2[PxDiagnosticCode2["scrollSubjectNoMatch"] = 1304] = "scrollSubjectNoMatch";
6524
+ PxDiagnosticCode2[PxDiagnosticCode2["scrollNoRootToObserve"] = 1305] = "scrollNoRootToObserve";
6525
+ PxDiagnosticCode2[PxDiagnosticCode2["scrollTriggerIgnored"] = 1306] = "scrollTriggerIgnored";
6526
+ PxDiagnosticCode2[PxDiagnosticCode2["rateRejected"] = 1401] = "rateRejected";
6527
+ PxDiagnosticCode2[PxDiagnosticCode2["controlPropsConflict"] = 1501] = "controlPropsConflict";
6528
+ PxDiagnosticCode2[PxDiagnosticCode2["rnCompileFailed"] = 1601] = "rnCompileFailed";
6529
+ PxDiagnosticCode2[PxDiagnosticCode2["rnRenderFailed"] = 1602] = "rnRenderFailed";
6530
+ PxDiagnosticCode2[PxDiagnosticCode2["rnBoundaryCaught"] = 1603] = "rnBoundaryCaught";
6531
+ PxDiagnosticCode2[PxDiagnosticCode2["rnUnsupported"] = 1604] = "rnUnsupported";
6532
+ return PxDiagnosticCode2;
6533
+ })(PxDiagnosticCode || {});
6534
+
6452
6535
  // src/playback/PxDiagnostics.ts
6453
6536
  var PxDiagnosticKind = {
6454
6537
  /** The document is wrong — regenerate or repair the file. */
@@ -6538,16 +6621,16 @@ function foldTimelineOverride(timeline, shortcuts) {
6538
6621
  } else {
6539
6622
  base = timeline != null ? timeline : void 0;
6540
6623
  }
6541
- const { duration, delay, iterations, startOn } = shortcuts;
6542
- if (duration === void 0 && delay === void 0 && iterations === void 0 && startOn === void 0) {
6624
+ const { duration, delay, iterations, start } = shortcuts;
6625
+ if (duration === void 0 && delay === void 0 && iterations === void 0 && start === void 0) {
6543
6626
  return base === void 0 ? void 0 : { timeline: base };
6544
6627
  }
6545
6628
  const out = isPlainObject(base) ? __spreadValues({}, base) : {};
6546
6629
  if (duration !== void 0) out.duration = duration;
6547
6630
  if (delay !== void 0) out.delay = delay;
6548
6631
  if (iterations !== void 0) out.iterations = iterations;
6549
- if (startOn !== void 0) {
6550
- out.trigger = __spreadProps(__spreadValues({}, out.trigger), { startOn });
6632
+ if (start !== void 0) {
6633
+ out.trigger = __spreadProps(__spreadValues({}, out.trigger), { start });
6551
6634
  }
6552
6635
  return { timeline: out };
6553
6636
  }
@@ -6643,6 +6726,7 @@ function diagnoseDocument(doc) {
6643
6726
  PxCloneWithout,
6644
6727
  PxControlMode,
6645
6728
  PxDefinitionsSchema,
6729
+ PxDiagnosticCode,
6646
6730
  PxDiagnosticKind,
6647
6731
  PxEffectsSchema,
6648
6732
  PxElementAnimationSchema,
@@ -6660,9 +6744,10 @@ function diagnoseDocument(doc) {
6660
6744
  PxLoopSchema,
6661
6745
  PxMaskType,
6662
6746
  PxMaskedByEffectSchema,
6747
+ PxMouseOutAction,
6663
6748
  PxNodeBaseSchema,
6664
6749
  PxNodeSchema,
6665
- PxOutAction,
6750
+ PxOffScreenAction,
6666
6751
  PxPathOverflow,
6667
6752
  PxPinAlign,
6668
6753
  PxPlaybackDirection,
@@ -6676,7 +6761,6 @@ function diagnoseDocument(doc) {
6676
6761
  PxScrollRangeSchema,
6677
6762
  PxScrollSchema,
6678
6763
  PxScrollSource,
6679
- PxStartOn,
6680
6764
  PxStrokeTrimEffectSchema,
6681
6765
  PxStrokeTrimSubPaths,
6682
6766
  PxSvgNodeRootSchema,
@@ -6691,6 +6775,7 @@ function diagnoseDocument(doc) {
6691
6775
  PxTransformPartsSchema,
6692
6776
  PxTransformValueSchema,
6693
6777
  PxTriggerSchema,
6778
+ PxTriggerStart,
6694
6779
  PxUnits,
6695
6780
  PxWireStepKind,
6696
6781
  PxWireVersionRelation,