@pixodesk/svg-animator-web 1.0.21 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1 +1 @@
1
- var t=Object.defineProperty,e=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,i=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,s=(t,e)=>{for(var n in e||(e={}))o.call(e,n)&&i(t,n,e[n]);if(r)for(var n of r(e))a.call(e,n)&&i(t,n,e[n]);return t},l=(t,r)=>e(t,n(r)),u=Object.defineProperty,c=Object.defineProperties,f=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,m=Math.pow,y=(t,e,n)=>e in t?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,g=(t,e)=>{for(var n in e||(e={}))h.call(e,n)&&y(t,n,e[n]);if(d)for(var n of d(e))p.call(e,n)&&y(t,n,e[n]);return t},v=(t,e)=>c(t,f(e));function b(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var k=class{_canSanitize(t){return this.isValid(t)}optional(){return new A(this)}},A=class extends k{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)}},w=class extends k{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(b(null!=n?n:[])+": expected string, got "+typeof t),!1)}},x=class extends k{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(b(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},j=class extends k{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(b(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},O=class extends k{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(b(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},S=class extends k{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(b(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},P=class extends k{constructor(t,e){super(),this.schemas=t,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;return!!this.schemas.some(e=>e.isValid(t))||(null==e||e.errors.push(b(null!=n?n:[])+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,60)),!1)}_canSanitize(t){return this.schemas.some(e=>e._canSanitize(t))}},M=class extends k{constructor(t,e,n){super(),this._key=t,this._schemas=e,this._default=null!=n?n:e[0]._default,this._map=new Map;for(const n of e){const e=n._shape[t];e&&this._map.set(e._default,n)}}_findSchema(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const e=t[this._key];return null!=e?this._map.get(e):void 0}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(b(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)}},_=class extends k{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))n[t]=this._shape[t].sanitize(e[t]);return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(b(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let a=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(a=!1),o.pop();if(null==e?void 0:e.strict)for(const t of Object.keys(r))t in this._shape||(o.push(t),e.errors.push(b(o)+": unexpected extra key"),o.pop(),a=!1);return a}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},z=class extends k{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=g({},e);for(const t of Object.keys(this._shape))n[t]=this._shape[t].sanitize(e[t]);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(b(null!=n?n:[])+": expected object, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=t,o=null!=n?n:[];let a=!0;for(const t of Object.keys(this._shape))o.push(t),this._shape[t].isValid(r[t],e,o)||(a=!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)||(a=!1),o.pop());return a}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},I=class extends k{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(b(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)}},N=class extends k{constructor(t){super(),this.value=t,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(b(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,a]of Object.entries(t))r.push(n),this.value.isValid(a,e,r)||(o=!1),r.pop();return o}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},C=class extends k{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},E=class extends k{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)}},T=class extends k{constructor(t){super(),this.schemas=t,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(b(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 F(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function L(t){var e;const n=t;return"_shape"in n?{kind:"shape",shape:n._shape}:"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.fn()}:{kind:"leaf"}}var D={string:(t="")=>new w(t),number:(t=0)=>new x(t),boolean:(t=!1)=>new j(t),literal:t=>new O(t),enum:(t,e)=>new S(t,e),union:(t,e)=>new P(t,e),discriminatedUnion:(t,e)=>new M(t,e),object:t=>new _(t),openObject:(t,e)=>new z(t,e),extendedObject:(t,e)=>new _(g(g({},t._shape),e)),array:t=>new I(t),record:t=>new N(t),any:()=>new C,tuple:t=>new T(t),lazy:(t,e)=>new E(t,e)},U="data-px-animation-src",V="_px_animator",R={auto:"auto",webapi:"webapi",frames:"frames"},W={webapi:R.webapi,frames:R.frames},B="text",q="textContent",G=new Set(["type","children","animator","meta","animate",B,q]),Z=D.union([D.string(),D.tuple([D.number(),D.number(),D.number(),D.number()])]),K=(D.union([D.string(),D.number(),D.array(D.number()),D.lazy(()=>J,{}),D.object({path:D.string()}),D.lazy(()=>D.object({paths:D.array(Nt)}),{paths:[]})]),D.object({time:D.number().optional(),t:D.number().optional(),value:D.any().optional(),v:D.any().optional(),easing:Z.optional(),e:Z.optional(),tangentOut:D.tuple([D.number(),D.number()]).optional(),to:D.tuple([D.number(),D.number()]).optional(),tangentIn:D.tuple([D.number(),D.number()]).optional(),ti:D.tuple([D.number(),D.number()]).optional(),selected:D.boolean().optional()})),X=D.object({segmentCount:D.number().optional(),before:D.boolean().optional(),alternate:D.boolean().optional()}),Y=D.object({keyframes:D.array(K).optional(),kfs:D.array(K).optional(),loop:D.union([X,D.boolean()]).optional(),autoOrient:D.boolean().optional()}),Q=["translate","rotate","scale","origin"],J=D.object({translate:D.tuple([D.number(),D.number()]).optional(),rotate:D.number().optional(),skew:D.number().optional(),scale:D.tuple([D.number(),D.number()]).optional(),origin:D.tuple([D.number(),D.number()]).optional()}),H=D.union([D.string(),D.object({value:J}),Y]),$=D.record(Y),tt=D.union([D.string(),D.array(D.union([D.string(),$])),$]),et=D.object({startOn:D.enum(["load","mouseOver","click","scrollIntoView","programmatic"]).optional(),outAction:D.enum(["continue","pause","reset","reverse"]).optional(),scrollIntoViewThreshold:D.number().optional()}),nt=D.object({width:D.number(),d:D.string()}),rt=D.object({fFamily:D.string(),style:D.string(),ascent:D.number(),unitsPerEm:D.number(),glyphs:D.record(nt)}),ot=D.object({easings:D.record(D.tuple([D.number(),D.number(),D.number(),D.number()])).optional(),animations:D.record($).optional(),styles:D.record(D.any()).optional(),glyphs:D.record(rt).optional()}),at=D.object({mode:D.enum([R.auto,R.webapi,R.frames]).optional(),duration:D.number().optional(),delay:D.number().optional(),iterations:D.union([D.number(),D.literal("infinite")]).optional(),fill:D.enum(["forwards","backwards","both","none"]).optional(),direction:D.enum(["normal","reverse","alternate","alternate-reverse"]).optional(),frameRate:D.number().optional(),trigger:et.optional(),resetOnFinish:D.boolean().optional(),definitions:ot.optional(),animate:D.record(tt).optional(),debug:D.boolean().optional(),debugInstName:D.string().optional()}),it=D.object({id:D.string(),animate:tt}),st=D.union([D.string(),D.number(),D.object({value:D.any()}),Y]),lt=D.union([D.number(),D.object({value:D.number()}),D.object({keyframes:D.array(K),autoOrient:D.boolean().optional()})]),ut=D.union([D.tuple([D.number(),D.number()]),D.object({value:D.tuple([D.number(),D.number()])}),D.object({keyframes:D.array(K),autoOrient:D.boolean().optional()})]),ct=D.object({translate:ut.optional(),rotate:lt.optional(),scale:ut.optional(),skew:lt.optional(),origin:ut.optional()}),ft=D.object({copies:D.number().optional(),translate:ut.optional(),rotate:lt.optional(),scale:ut.optional(),origin:ut.optional()}),dt=D.object({href:D.string().optional(),maskType:D.string().optional(),maskUnits:D.string().optional(),maskContentUnits:D.string().optional()}),ht=D.object({d:D.string().optional(),animate:Y.optional()}),pt=D.object({offset:lt.optional(),range:ut.optional(),trimAllAsOne:D.boolean().optional()}),mt=D.object({baseId:D.string().optional(),start:D.number().optional(),stretch:D.number().optional(),timeCrop:D.tuple([D.number(),D.number()]).optional()}),yt=D.object({type:D.string().optional(),baseId:D.string().optional(),retime:mt.optional()}),gt={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},vt={pad:"pad",reflect:"reflect",repeat:"repeat"},bt={linear:"linear",radial:"radial"},kt=D.object({offset:D.number(),color:D.string()}),At=D.union([D.array(kt),D.object({value:D.array(kt)}),D.object({keyframes:D.array(K)})]),wt=D.object({type:D.enum([bt.linear,bt.radial]),p1:D.tuple([D.number(),D.number()]).optional(),p2:D.tuple([D.number(),D.number()]).optional(),c:D.tuple([D.number(),D.number()]).optional(),r:D.number().optional(),fp:D.tuple([D.number(),D.number()]).optional(),stops:At.optional(),gradientUnits:D.string().optional(),spreadMethod:D.string().optional(),gradientTransform:D.string().optional()}),xt=wt,jt=D.object({path:D.string(),pathOverflow:D.string().optional(),lengthAdjust:D.string().optional(),method:D.string().optional(),spacing:D.string().optional(),startOffset:lt.optional(),textLength:lt.optional()}),Ot=D.object({useGlyphs:D.boolean().optional()}),St=D.object({transformation:ct.optional(),repeater:ft.optional(),maskedBy:dt.optional(),clipPath:ht.optional(),trimPath:pt.optional(),clone:yt.optional(),isCombinedShape:D.boolean().optional(),fillGradient:wt.optional(),strokeGradient:xt.optional(),textPath:jt.optional(),text:Ot.optional()});function Pt(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!St.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}var Mt=D.openObject({type:D.string(),id:D.string().optional(),meta:D.any().optional(),effects:St.optional(),animate:tt.optional(),style:D.union([D.string(),D.record(D.union([D.string(),D.number()]))]).optional()},st),_t=D.openObject(v(g({},Mt._shape),{children:D.lazy(()=>D.array(_t),[]).optional()}),st),zt=D.object({width:D.number().optional(),height:D.number().optional(),viewBox:D.string().optional(),animator:at.optional()}),It=D.openObject(v(g(g({},Mt._shape),zt._shape),{type:D.literal("svg"),children:D.array(_t).optional()}),st),Nt=D.object({v:D.array(D.array(D.number())),i:D.array(D.array(D.number())).optional(),o:D.array(D.array(D.number())).optional(),c:D.boolean().optional()});function Ct(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&("svg"===t.type||"svg"===t.tagName)}function Et(t){const e=It.isValid(t);return{valid:e,errors:e?[]:["Document failed schema validation"]}}function Tt(t){var e,n;return(null==t?void 0:t.animator)||(null==(e=null==t?void 0:t.meta)?void 0:e.animator)||(null==t?void 0:t.animation)||(null==(n=null==t?void 0:t.meta)?void 0:n.animation)}function Ft(t){var e;if(t)return null==(e=Tt(t))?void 0:e.definitions}function Lt(t){var e;if(!t)return;const n=null==(e=Tt(t))?void 0:e.animate;return n?Object.entries(n).map(([t,e])=>({id:t,animate:e})):void 0}function Dt(t){return null==t?void 0:t.children}function Ut(t,e=!1){var n,r,o,a;const i=t.v,s=t.i,l=t.o,u=t.c;if(!i.length)return"";const c=[],f=i.length;c.push("M"+i[0][0]+","+i[0][1]);for(let t=1;t<f;t++){const o=i[t-1],a=null!=(n=null==l?void 0:l[t-1])?n:o,u=null!=(r=null==s?void 0:s[t])?r:i[t],f=i[t];!e&&a[0]===o[0]&&a[1]===o[1]&&u[0]===f[0]&&u[1]===f[1]?c.push("L"+f[0]+","+f[1]):c.push("C"+a[0]+","+a[1]+","+u[0]+","+u[1]+","+f[0]+","+f[1])}if(u&&f>0){const t=i[f-1],n=null!=(o=null==l?void 0:l[f-1])?o:t,r=null!=(a=null==s?void 0:s[0])?a:i[0],u=i[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 Vt(t,e,n){return t+(e-t)*n}function Rt(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let a=0;a<o;a++)r[a]=Vt(t[a]||0,e[a]||0,n);return r}function Wt(t,e,n){return[Vt(t[0]||0,e[0]||0,n),Vt(t[1]||0,e[1]||0,n),Vt(t[2]||0,e[2]||0,n),Vt(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function Bt(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let a=0;a<r;a++)o.push(qt(t[a],e[a],n));return o}function qt(t,e,n){var r,o,a,i,s,l,u,c,f;if(!t||!e)return t||e||{v:[]};const d=Math.min(Math.max(n,0),1),h=Math.min(t.v.length,e.v.length),p=[],m=[],y=[];for(let n=0;n<h;n++){const f=t.v[n],h=e.v[n];p.push(Rt(f,h,d));const g=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,v=null!=(i=null==(a=e.i)?void 0:a[n])?i:h;m.push(Rt(g,v,d));const b=null!=(l=null==(s=t.o)?void 0:s[n])?l:f,k=null!=(c=null==(u=e.o)?void 0:u[n])?c:h;y.push(Rt(b,k,d))}return{v:p,i:m.length?m:void 0,o:y.length?y:void 0,c:null!=(f=t.c)?f:e.c}}function Gt(t,e,n){if(n<=0)return 0;if(n>=1)return 1;const r=3*t,o=3*(e-t)-r,a=1-r-o;function i(t){return((a*t+o)*t+r)*t}function s(t){return(3*a*t+2*o)*t+r}let l=n,u=0,c=1;for(let t=0;t<8;t++){const t=i(l)-n;if(Math.abs(t)<1e-6)return l;const e=s(l);if(Math.abs(e)<1e-6)break;l-=t/e}for(l=n;u<c;){const t=i(l);if(Math.abs(t-n)<1e-6)return l;n>t?u=l:c=l,l=(c+u)/2}return l}function Zt(t){const[e,n,r,o]=t,a=3*n,i=3*(o-n)-a,s=1-a-i;return function(t){return n=Gt(e,r,t),((s*n+i)*n+a)*n;var n}}function Kt(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Xt(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,a]=t,i=Gt(n,o,e),s=[n,r],l=[o,a],{left:u,right:c}=function(t,e,n,r,o){const a=Kt(t,e,o),i=Kt(e,n,o),s=Kt(n,r,o),l=Kt(a,i,o),u=Kt(i,s,o),c=Kt(l,u,o);return{left:[t,a,l,c],right:[c,u,s,r]}}([0,0],s,l,[1,1],i),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,y=1-d;return m>1e-9&&Math.abs(y)>1e-9&&(p=[(c[1][0]-f)/m,(c[1][1]-d)/y,(c[2][0]-f)/m,(c[2][1]-d)/y]),{left:h,right:p}}function Yt(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function Qt(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 Jt(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),a=n?e[2]+e[2]:e.slice(4,6),i=4===e.length?e[3]+e[3]:8===e.length?e.slice(6,8):null,s=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(a,16)/255];return null!==i&&s.push(parseInt(i,16)/255),s}(t):t.startsWith("rgb")?function(t){var e;const n=null==(e=t.match(/rgba?\((.*)\)/))?void 0:e[1];if(!n)throw new Error("Invalid rgb/rgba format");const r=n.split(",").map(t=>+t.trim());return[r[0]/255,r[1]/255,r[2]/255,...void 0!==r[3]?[r[3]]:[]]}(t):void console.warn("Unsupported color format: "+t)}}var Ht=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),$t=new Set(["translate","rotate","scale","skew"]),te=new Set(["offset-distance","offsetDistance"]);function ee(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],a=t.translate,i=t.origin,s=t.rotate,l=t.skew,u=t.scale,c=r?"px":"",f=r?"deg":"";return a&&o.push("translate("+a[0]+c+","+a[1]+c+")"),i&&o.push("translate("+i[0]+c+","+i[1]+c+")"),null!=s&&o.push("rotate("+s+f+")"),null!=l&&o.push("skewX("+l+f+")"),u&&o.push("scale("+u[0]+","+u[1]+")"),i&&o.push("translate("+-i[0]+c+","+-i[1]+c+")"),o.join("")}var ne=new Set(["offset-distance","offsetDistance"]);function re(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function oe(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var ae=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","markerUnits","markerWidth","markerHeight","refX","refY","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","tableValues","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function ie(t){return ae.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function se(t,e,n){return Math.max(e,Math.min(t,n))}function le(t,e,n,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const a=1-o,i=a*a,s=o*o,l=i*a,u=3*o*i,c=3*s*a,f=s*o;return[l*t[0]+u*e[0]+c*n[0]+f*r[0],l*t[1]+u*e[1]+c*n[1]+f*r[1]]}var ue=1e-4;function ce(t,e,n,r,o){const a=fe(t,e,n,r,o);if(0===a[0]&&0===a[1]){return fe(t,e,n,r,o<.5?o+ue:o-ue)}return a}function fe(t,e,n,r,o){const a=1-o,i=3*a*a,s=6*o*a,l=3*o*o;return[i*(e[0]-t[0])+s*(n[0]-e[0])+l*(r[0]-n[0]),i*(e[1]-t[1])+s*(n[1]-e[1])+l*(r[1]-n[1])]}function de(t,e,n,r,o=100){const a=o+1,i=new Float64Array(a),s=new Float64Array(a);let l=le(t,e,n,r,0);i[0]=0,s[0]=0;let u=0;for(let c=1;c<a;c++){const a=c/o,f=le(t,e,n,r,a),d=f[0]-l[0],h=f[1]-l[1];u+=Math.sqrt(d*d+h*h),i[c]=a,s[c]=u,l=f}return{ts:i,ds:s}}function he(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 a=1,i=o;for(;a<i;){const t=a+i>>>1;n[t]<e?a=t+1:i=t}const s=n[i-1],l=n[i]-s,u=l>0?(e-s)/l:0;return r[i-1]+u*(r[i]-r[i-1])}var pe=0;function me(){return"_px_"+Date.now().toString(36)+(++pe).toString(36)+Math.random().toString(36).substring(2,6)}function ye(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>ye(t));const e=t,n={};for(const t of Object.keys(e))n[t]=ye(e[t]);return n}function ge(t){var e,n;const r=ye(t),o=new Map,a=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(["baseId","targetId","boundElementId"]);!function t(e){if(e&&"object"==typeof e){if(e.id&&"string"==typeof e.id){const t=e.id,n=me();o.set(t,n),e.id=n}else e.animate&&(e.id=me());if(Array.isArray(e.children))for(const n of e.children)t(n)}}(r),function t(e){if(e&&"object"==typeof e)for(const[n,r]of Object.entries(e))if("children"!==n)if("string"==typeof r)if(a.has(n)&&r.startsWith("#")){const t=r.slice(1),a=o.get(t);a&&(e[n]="#"+a)}else if(i.has(n))e[n]=ve(r,o);else if(s.has(n)){const t=o.get(r);t&&(e[n]=t)}else r.includes("url(#")&&(e[n]=ve(r,o));else if("style"===n&&"object"==typeof r&&null!==r)for(const[t,e]of Object.entries(r))"string"==typeof e&&(r[t]=ve(e,o));else"object"==typeof r&&null!==r&&t(r);else if(Array.isArray(r))for(const e of r)t(e)}(r);const l=null==(e=r.animator)?void 0:e.animate;if(l&&"object"==typeof l){const t={};for(const[e,r]of Object.entries(l)){t[null!=(n=o.get(e))?n:e]=r}r.animator=v(g({},r.animator),{animate:t})}return r}function ve(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}var be=new Set(["script","foreignobject"]),ke=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),Ae=new Set(["href","xlink:href","src"]),we=new Set(["mixBlendMode","isolation"]),xe=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,je=/^data:image\/svg\+xml(?:;[^,]*)?,/i,Oe=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,Se=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function Pe(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(ke.has(n)){const t=String(e);return t.startsWith("#")||(/^url\(#[^)]+\)$/.test(t)||Ae.has(n)&&(xe.test(t)||je.test(t)||function(t){const e=Oe.exec(t);return!!e&&Se.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 Me(t){const e={};for(const n of Object.keys(t)){const r=re(n);if(G.has(r))continue;if("style"===r)continue;let o=t[n];Ht.has(r)&&Array.isArray(o)?e[r]=Qt(o):"transform"===r&&null!==o&&"object"==typeof o&&!Array.isArray(o)&&o.value&&"object"==typeof o.value?e.transform=ee(o.value,{withUnits:!1}):$t.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),e.transform=r+"("+o+")"):null!=o&&(e[r]=String(o))}return e}function _e(t){var e;const n=null!=(e=t.value)?e:t.v;if(!n)return;if(Array.isArray(n)&&n.length>=2&&"number"==typeof n[0]&&"number"==typeof n[1])return[n[0],n[1]];const r=n.translate;return Array.isArray(r)&&r.length>=2?[r[0],r[1]]:void 0}function ze(t){var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0}function Ie(t){var e;return null!=(e=t.easing)?e:t.e}function Ne(t){var e,n,r;const o=null!=(e=t.keyframes)?e:t.kfs;if(!Array.isArray(o))return!1;if(t.autoOrient)return!0;for(const t of o)if((null!=(n=t.tangentIn)?n:t.ti)||(null!=(r=t.tangentOut)?r:t.to))return!0;return!1}var Ce=new WeakMap;function Ee(t,e,n,r){var o,a;let i=Ce.get(t);const s=null==i?void 0:i.get(e);if(s)return s;const l=null!=(o=t.tangentOut)?o:t.to,u=null!=(a=e.tangentIn)?a:e.ti,c=[n[0]+(l?l[0]:0),n[1]+(l?l[1]:0)],f=[r[0]+(u?u[0]:0),r[1]+(u?u[1]:0)],d=de(n,c,f,r),h={P0:n,P1:c,P2:f,P3:r,lut:d,totalArc:d.ds[d.ds.length-1]};return i||(i=new WeakMap,Ce.set(t,i)),i.set(e,h),h}function Te(t,e,n,r,o,a){const i=Ee(t,e,n,r),s=0===i.totalArc?o:function(t,e){const n=t.ds[t.ds.length-1],r=e*n,{ts:o,ds:a}=t,i=a.length-1;if(r<=0)return o[0];if(r>=a[i])return o[i];let s=1,l=i;for(;s<l;){const t=s+l>>>1;a[t]<r?s=t+1:l=t}const u=a[l-1],c=a[l]-u,f=c>0?(r-u)/c:0;return o[l-1]+f*(o[l]-o[l-1])}(i.lut,o),l=le(i.P0,i.P1,i.P2,i.P3,s);if(!a)return{translate:l};const u=ce(i.P0,i.P1,i.P2,i.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}function Fe(t,e){var n,r,o,a;if(!Ne(t))return t;const i=null!=(n=t.keyframes)?n:t.kfs;if(!Array.isArray(i)||i.length<2)return t;const s=!!t.autoOrient,l=null!=(r=null==e?void 0:e.flatnessTolerance)?r:.5,u=null!=(o=null==e?void 0:e.rotationTolerance)?o:5,c=null!=(a=null==e?void 0:e.maxSamplesPerSegment)?a:32,f=[],d=_e(i[0]);if(!d)return t;const h=s?function(t,e){const n=_e(t),r=_e(e);if(!n||!r)return 0;const o=Ee(t,e,n,r),a=ce(o.P0,o.P1,o.P2,o.P3,0);return 180*Math.atan2(a[1],a[0])/Math.PI}(i[0],i[1]):void 0;f.push(De(ze(i[0]),Re(Ue(i[0]),Ue(i[0]),0,d,h,s)));for(let t=0;t<i.length-1;t++){const e=i[t],n=i[t+1],r=_e(e),o=_e(n);r&&o?(s&&t>0&&Be(f,e,n,r,o,u),Ge(f,e,n,r,o,s,l,u,c)):f.push(De(ze(n),Re(Ue(n),Ue(n),1,null!=o?o:[0,0],void 0,s)))}const p=Ie(i[i.length-1]);p&&(f[f.length-1].e=p),s&&Le(f);const m={kfs:f};return void 0!==t.loop&&(m.loop=t.loop),m}function Le(t){var e;let n;for(const r of t){const t=null!=(e=r.v)?e:r.value;if(!t||"number"!=typeof t.rotate)continue;if(void 0===n){n=t.rotate;continue}let o=t.rotate;for(;o-n>180;)o-=360;for(;o-n<-180;)o+=360;t.rotate=o,n=o}}function De(t,e){return{t:t,v:e}}function Ue(t){var e;const n=null!=(e=t.value)?e:t.v;if(n&&"object"==typeof n&&!Array.isArray(n))return n}function Ve(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 a="number"==typeof t[o]?t[o]:0,i="number"==typeof e[o]?e[o]:0;r[o]=a+(i-a)*n}return r}return n<.5?t:e}function Re(t,e,n,r,o,a){const i={translate:r},s=new Set;if(t)for(const e of Object.keys(t))s.add(e);if(e)for(const t of Object.keys(e))s.add(t);for(const r of s){if("translate"===r)continue;if("rotate"===r&&a)continue;const o=null==t?void 0:t[r],s=null==e?void 0:e[r];void 0===o&&void 0===s||(i[r]=Ve(o,s,n))}return void 0!==o&&(i.rotate=o+We(t,e,n)),i}function We(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 a=Ve(r,o,n);return"number"==typeof a?a:0}function Be(t,e,n,r,o,a){var i;const s=t[t.length-1],l=null!=(i=s.v)?i:s.value,u=null==l?void 0:l.rotate;if("number"!=typeof u)return;const c=Ue(e),f=u-We(c,c,0),d=Ee(e,n,r,o),h=ce(d.P0,d.P1,d.P2,d.P3,0),p=180*Math.atan2(h[1],h[0])/Math.PI,m=function(t,e){let n=t-e;for(;n>180;)n-=360;for(;n<-180;)n+=360;return n}(p,f);if(Math.abs(m)<=a)return;const y=ze(e),g=Math.min(y+qe,(y+ze(n))/2),v=Re(Ue(e),Ue(e),0,r,p,!0);t.push(De(g,v))}var qe=.05;function Ge(t,e,n,r,o,a,i,s,l){const u=Ee(e,n,r,o),c=ze(e),f=ze(n),d=Ie(e),h=(p=d)?Zt([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=Ue(e),y=Ue(n),g=function(t,e,n,r,o){const a=[];Ze(t.P0[0],t.P1[0],t.P2[0],t.P3[0],a),Ze(t.P0[1],t.P1[1],t.P2[1],t.P3[1],a),a.sort((t,e)=>t-e);const i=[0];for(const t of a)t>i[i.length-1]+1e-6&&t<.999999&&i.push(t);i.push(1);const s=[],l={remaining:o-i.length};for(let o=0;o<i.length-1;o++)Ke(i[o],i[o+1],s,t,e,n,r,l);return s}(u,a,i,s,l),v=[];for(const t of g){const e=he(u.lut,t),n=se(u.totalArc>0?e/u.totalArc:t,0,1),r={u:se(h(n),0,1),p:n,pos:le(u.P0,u.P1,u.P2,u.P3,t)};if(a){const e=ce(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 A=t.length-1;for(let e=0;e<v.length;e++){const n=v[e],r=k<1?se((n.u-k)/(1-k),0,1):1,{left:o,right:i}=Xt(b,r),s=0===e?A:t.length-1;o?t[s].e=o:delete t[s].e;const l=c+n.u*(f-c),u=Re(m,y,n.p,n.pos,n.rotateDeg,a);t.push(De(l,u)),b=i,k=n.u}}function Ze(t,e,n,r,o){const a=e-t,i=n-e,s=a-2*i+(r-n),l=2*(i-a),u=a;if(Math.abs(s)<1e-10){if(Math.abs(l)>1e-10){const t=-u/l;t>1e-6&&t<.999999&&o.push(t)}return}const c=l*l-4*s*u;if(c<0)return;const f=Math.sqrt(c),d=(-l-f)/(2*s),h=(-l+f)/(2*s);d>1e-6&&d<.999999&&o.push(d),h>1e-6&&h<.999999&&o.push(h)}function Ke(t,e,n,r,o,a,i,s){const l=(t+e)/2,u=le(r.P0,r.P1,r.P2,r.P3,t),c=le(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=le(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=le(r.P0,r.P1,r.P2,r.P3,l),p=le(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(Xe(d,u,c),Xe(h,u,c),Xe(p,u,c));let y=!0;if(o){const n=ce(r.P0,r.P1,r.P2,r.P3,t),o=ce(r.P0,r.P1,r.P2,r.P3,e),a=180*Math.atan2(n[1],n[0])/Math.PI,s=180*Math.atan2(o[1],o[0])/Math.PI;let l=Math.abs(a-s);l>180&&(l=360-l),l>i&&(y=!1)}m<=a&&y||s.remaining<=0||f<1e-6?n.push(e):(s.remaining-=1,Ke(t,l,n,r,o,a,i,s),Ke(l,e,n,r,o,a,i,s))}function Xe(t,e,n){const r=n[0]-e[0],o=n[1]-e[1],a=r*r+o*o;if(a<1e-20){const n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}const i=(t[0]-e[0])*o-(t[1]-e[1])*r;return Math.abs(i)/Math.sqrt(a)}function Ye(t,e){const n=Qe(t,e);return null!=n?n:t}function Qe(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=Qe(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&&Ne(n)){const o=Fe(n,e);o!==n&&(r=v(g({},t),{transform:o}))}}if(!n&&!r)return null;const a=g({},t);return n&&(a.children=n),r&&(a.animate=r),a}function Je(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,a=o[3]||0,i=o[4]||0,s=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([i,s]),n.i.push([r,a]),n.o.push([i,s])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function He(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function $e(t){return"string"==typeof t&&void 0!==He(t)}function tn(t){if(t&&"object"==typeof t&&"string"==typeof t.path){const e=He(t.path);return e?{paths:Je(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&$e(e[0])){const t=[];for(const n of e){const e=He(n);e&&t.push(...Je(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&$e(t[0])){const e=[];for(const n of t){const t=He(n);t&&e.push(...Je(t))}return{paths:e}}return{paths:t}}if($e(t)){return{paths:Je(He(t))}}return t}function en(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 nn(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 rn(t,e,n,r){var o,a;if("d"===t){return{paths:Bt(null!=(o=null==e?void 0:e.paths)?o:Array.isArray(e)?e:[],null!=(a=null==n?void 0:n.paths)?a:Array.isArray(n)?n:[],r)}}return Ht.has(t)?Wt(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?Vt(e,n,r):$t.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?Rt(e||[],n||[],r):Vt(+(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 a of r){const r=null==t?void 0:t[a],i=null==e?void 0:e[a];if("rotate"===a||"skew"===a)o[a]=Vt(+(null!=r?r:0),+(null!=i?i:0),n);else if("translate"===a||"scale"===a||"origin"===a){const t="scale"===a?[1,1]:[0,0];o[a]=Rt(r||t,i||t,n)}else o[a]=null!=i?i:r}return o}(e,n,r)}function on(t,e,n,r){var o,a,i,s,l;const u=e.length-1,c=se(null!=(o=n.segmentCount)?o:u,1,u);let f;f=n.before?e.slice(0,c+1):e.slice(u-c);const d=null!=(a=e[0].t)?a:0,h=null!=(i=e[e.length-1].t)?i:0;let p,m;n.before?(p=0,m=d):(p=h,m=r);const y=m-p;if(y<=0)return e;const g=null!=(s=f[0].t)?s:0,v=(null!=(l=f[f.length-1].t)?l:0)-g;if(v<=0)return e;const b=f.map(t=>{var e,n;return{relT:(t.t-g)/v,v:t.v,e:t.e,tangentIn:null!=(e=t.tangentIn)?e:t.ti,tangentOut:null!=(n=t.tangentOut)?n:t.to}}),k=Math.floor(y/v),A=y-k*v,w=A/v,x=[];function j(e,n,r){let o;if(n){o=[];for(let t=b.length-1;t>=0;t--)o.push({relT:1-b[t].relT,v:b[t].v,e:t>0?Yt(b[t-1].e):void 0,tangentIn:b[t].tangentOut,tangentOut:b[t].tangentIn})}else o=b;const a=void 0!==r?r:1;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT>a+1e-9){const i=o[n-1],s=r.relT-i.relT,l=(a-i.relT)/s,u=i.e?Zt(i.e)(l):l,c=rn(t,i.v,r.v,u),{left:f}=Xt(i.e,l);return x.length>0&&i.relT<=a&&(x[x.length-1].e=f),void x.push({t:e+a*v,v:c,e:void 0})}const i={t:e+r.relT*v,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(i.tangentIn=r.tangentIn),r.tangentOut&&(i.tangentOut=r.tangentOut),x.push(i)}}if(n.before){if(w>1e-9){!function(e,n,r){let o;if(n){o=[];for(let t=b.length-1;t>=0;t--)o.push({relT:1-b[t].relT,v:b[t].v,e:t>0?Yt(b[t-1].e):void 0,tangentIn:b[t].tangentOut,tangentOut:b[t].tangentIn})}else o=b;const a=1-r;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT<a-1e-9)continue;const i=o[n-1];if(i&&i.relT<a-1e-9&&r.relT>a+1e-9){const n=r.relT-i.relT,o=(a-i.relT)/n,s=i.e?Zt(i.e)(o):o,l=rn(t,i.v,r.v,s),{right:u}=Xt(i.e,o);x.push({t:e,v:l,e:u})}const s={t:e+(r.relT-a)*v,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),x.push(s)}}(p,!!n.alternate&&k%2==0,w)}for(let t=0;t<k;t++){const e=k-1-t,r=!!n.alternate&&e%2==0;j(p+A+t*v,r)}}else{for(let t=0;t<k;t++){const e=!!n.alternate&&t%2==0;j(p+t*v,e)}if(w>1e-9){const t=!!n.alternate&&k%2==0;j(p+k*v,t,w)}}return n.before?[...x,...e]:[...e,...x]}function an(t,e,n,r){var o,a,i,s,l,u,c;const f=e.keyframes||e.kfs||[],d=[];for(const e of f){const n=null!=(a=null!=(o=e.time)?o:e.t)?a:0;let f=null!=(i=e.value)?i:e.v;const h=null!=(s=e.easing)?s:e.e;"d"===t&&(f=tn(f));const p=oe(t)?ie(t):t;Ht.has(p)&&(f=null!=(l=Jt(f))?l:f);const m={t:n,v:f,e:en(h,r)},y=null!=(u=e.tangentIn)?u:e.ti,g=null!=(c=e.tangentOut)?c:e.to;y&&(m.tangentIn=y),g&&(m.tangentOut=g),d.push(m)}d.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const h=e.loop,p=!0===h?{}:h||void 0;return p&&d.length>=2?on(t,d,p,n):d}function sn(t,e,n){var r;const o=e.loop;if(null==o||!1===o)return e;const a=!0===o?{}:o,i=null!=(r=e.keyframes)?r:e.kfs;if(!Array.isArray(i)||i.length<2)return e;const s=oe(t)?ie(t):t,l=Ht.has(s),u=i.map(e=>{var n,r,o,a,i,s,u,c;const f=null!=(n=e.t)?n:e.time;let d=null!=(r=e.v)?r:e.value;"d"===t&&(d=tn(d)),l&&(d=null!=(o=Jt(d))?o:d);const h={t:f,v:d,e:null!=(a=e.e)?a:e.easing};return(null!=(i=e.tangentIn)?i:e.ti)&&(h.tangentIn=null!=(s=e.tangentIn)?s:e.ti),(null!=(u=e.tangentOut)?u:e.to)&&(h.tangentOut=null!=(c=e.tangentOut)?c:e.to),h}),c={kfs:on(t,u,a,n)};return void 0!==e.autoOrient&&(c.autoOrient=e.autoOrient),c}function ln(t,e){const n=un(t,e);return null!=n?n:t}function un(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=un(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],a=sn(n,o,e);a!==o&&(r||(r=g({},t)),r[n]=a)}}if(!n&&!r)return null;const a=g({},t);return n&&(a.children=n),r&&(a.animate=r),a}var cn=0;function fn(t,e=W.webapi){const n=Tt(t)||{},r=Ft(t),o=n.duration||1e3,a=[],i=(t,n)=>{if(!n)return null;const a=function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=nn(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=nn(r,e);t&&n.push(t)}else n.push(t);return n}(n,r);if(0===a.length)return null;const i=function(t,e,n,r=W.webapi){const o={};for(const[a,i]of Object.entries(t)){const t=an(a,i,e,n);if(t.length>0){const e={kfs:t};void 0!==i.autoOrient&&(e.autoOrient=i.autoOrient),void 0!==i.loop&&(e.loop=i.loop),o[a]=r===W.webapi&&"transform"===a?Fe(e):e}}return o}(function(t){const e={};for(const n of t)for(const[t,r]of Object.entries(n))e[t]=r;return e}(a),o,r,e);return 0===Object.keys(i).length?null:{id:t,animate:i}},s=Lt(t);if(s)for(const t of s){const e=i(t.id,t.animate);e&&a.push(e)}const l=t=>{const e=t.animate;if(e&&Object.keys(e).length>0){const n=t.id||"_px_el_"+ ++cn;t.id=n;const r=i(n,e);r&&a.push(r)}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 a}function dn(t,e,n){var r,o,a,i,s,l,u;const c=e.kfs||e.keyframes||[];if(0===c.length)return null;const{prevKf:f,nextKf:d}=function(t,e){var n,r;const o=t.length-1;let a=t[0],i=t[o>0?1:0];for(let s=0;s<o;s++){const l=null!=(n=t[s].t)?n:0,u=null!=(r=t[s+1].t)?r:0;if(l<=e&&e<=u){a=t[s],i=t[s+1];break}e>u&&s===o-1&&(a=t[o>0?o-1:0],i=t[o])}return{prevKf:a,nextKf:i}}(c,n);let h=f===d?0:(p=n,m=null!=(r=f.t)?r:0,y=null!=(o=d.t)?o:0,g=0,v=1,y===m?g:g+(p-m)/(y-m)*(v-g));var p,m,y,g,v;h=se(h,0,1);const b=null!=(a=f.e)?a:f.easing;if(b&&Array.isArray(b))try{h=Zt(b)(h)}catch(t){}let k=oe(t)?ie(t):t,A=null;const w=null!=(i=null==f?void 0:f.v)?i:null==f?void 0:f.value,x=null!=(s=null==d?void 0:d.v)?s:null==d?void 0:d.value;if("d"===k){A=Bt(null!=(l=null==w?void 0:w.paths)?l:Array.isArray(w)?w:[],null!=(u=null==x?void 0:x.paths)?u:Array.isArray(x)?x:[],h).map(t=>Ut(t)).join("")}else if(Ht.has(k))A=Qt(Wt(w||[0,0,0,1],x||[0,0,0,1],h)),k=t;else if("stroke-dasharray"===k)A=Rt(w||[],x||[],h).join(" "),k=t;else if("transform"!==k||null===w||"object"!=typeof w||Array.isArray(w))if("translate"===k){A="translate("+Rt(w||[0,0],x||[0,0],h).join(",")+")",k="transform"}else if("rotate"===k){A="rotate("+Vt(+(w||0),+(x||0),h)+")",k="transform"}else if("scale"===k){A="scale("+Rt(w||[1,1],x||[1,1],h).join(",")+")",k="transform"}else{A=Vt(+(w||0),+(x||0),h)}else{const t=new Set([...w?Object.keys(w):[],...x?Object.keys(x):[]]),n={};for(const e of t){const t=null==w?void 0:w[e],r=null==x?void 0:x[e];if("rotate"===e||"skew"===e)n[e]=Vt(+(null!=t?t:0),+(null!=r?r:0),h);else if("translate"===e||"scale"===e||"origin"===e){const o="scale"===e?[1,1]:[0,0],a=Rt(t||o,r||o,h);n[e]=a}}if(Ne(e)){const t=w.translate,r=x.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=Te(f,d,[+t[0],+t[1]],[+r[0],+r[1]],h,!!e.autoOrient);n.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(n.rotate=o.rotateDeg)}}A=ee(n,{withUnits:!1}),k="transform"}return te.has(k)&&"number"==typeof A&&(A=100*A+"%"),{k:k,v:null===A?"":""+A}}function hn(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=dn(r,o,e);t&&(n[t.k]=t.v)}return n}function pn(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(pn);const e={};for(const n of Object.keys(t))e[n]=pn(t[n]);return e}function mn(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}),a=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(a)};return a(t),n}function yn(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function gn(t){var e;const n=yn(t.x),r=yn(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 vn(t){var e;const n=function(t){const e=new Map,n=t=>{var r;"string"==typeof t.id&&e.set(t.id,t),null==(r=t.children)||r.forEach(n)};return n(t),e}(t),r=function(t,e){const n=new WeakMap,r=new Set,o=(t,r)=>{const a=n.get(t);if(void 0!==a)return a;if(r.has(t))return!1;r.add(t);let i=!1;if(t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate))for(const e in t.animate){i=!0;break}if(!i&&t.children)for(const e of t.children)if(o(e,r)){i=!0;break}if(!i&&"use"===t.type&&"string"==typeof t.href){const n=kn(t.href),a=n?e.get(n):void 0;a&&(i=o(a,r))}return r.delete(t),n.set(t,i),i};for(const[t,n]of e)o(n,new Set)&&r.add(t);return r}(0,n);if(0===r.size)return t;let o=0;const a=function(t){const e=wn(t.viewBox);if(e)return[e[2],e[3]];const n=bn(t.width),r=bn(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),i=[],s=xn(t,n,r,()=>"_lw_use_mat_"+ ++o,i,a);if(0===i.length)return s;const l={type:"defs",children:i},u=[...null!=(e=s.children)?e:[],l];return v(g({},s),{children:u})}function bn(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function kn(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function An(t,e,n,r,o,a,i){var s,l,u,c;const f=pn(e);mn(f,o);const d="symbol"===f.type?wn(f.viewBox):void 0,h=null!=(l=null!=(s=bn(t.width))?s:null==d?void 0:d[2])?l:i[0],p=null!=(c=null!=(u=bn(t.height))?u:null==d?void 0:d[3])?c:i[1],m="symbol"===f.type?function(t,e,n,r,o){const a=wn(t.viewBox),i=v(g({},t),{type:"g"});if(delete i.viewBox,delete i.preserveAspectRatio,delete i.width,delete i.height,!a)return i;const[s,l,u,c]=a,f=u>0&&c>0?Math.min(r/u,o/c):1,d=(r-u*f)/2,h=(o-c*f)/2,p=[];0===d&&0===h||p.push("translate("+d+","+h+")");1!==f&&p.push("scale("+f+")");0===s&&0===l||p.push("translate("+-s+","+-l+")");p.length&&(i.transform=p.join(""));const m=e();return n.push({type:"clipPath",id:m,children:[{type:"rect",x:s,y:l,width:u,height:c}]}),i.clipPath="url(#"+m+")",i}(f,o,a,h,p):f,y=xn(m,n,r,o,a,i),b=v(g({},t),{type:"g",children:[y]});return delete b.href,delete b.width,delete b.height,gn(b)}function wn(t){if("string"!=typeof t)return;const e=t.trim().split(/[\s,]+/).map(Number);return e.length<4||e.some(t=>!Number.isFinite(t))?void 0:[e[0],e[1],e[2],e[3]]}function xn(t,e,n,r,o,a){if("use"===t.type&&"string"==typeof t.href){const i=kn(t.href);if(i&&n.has(i)){const s=e.get(i);if(s)return An(t,s,e,n,r,o,a)}}if(!t.children)return t;let i=!1;const s=t.children.map(t=>{const s=xn(t,e,n,r,o,a);return s!==t&&(i=!0),s});return i?v(g({},t),{children:s}):t}function jn(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 On(t){if(void 0===t)return{kind:"absent"};if(Array.isArray(t))return{kind:"static",value:t};if("object"==typeof t){const e=t;if(e.keyframes)return{kind:"animated",keyframes:e.keyframes,autoOrient:e.autoOrient,loop:e.loop};if(void 0!==e.value)return{kind:"static",value:e.value}}return{kind:"static",value:t}}function Sn(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 Pn(t,e,n){if(!e)return t;delete t.transform;let r=t;var o;return r=_n(r,e.origin,!0),r=Mn(r,"scale",void 0===(o=e.scale)?void 0:Array.isArray(o)?[o[0]/100,o[1]/100]:o,n),r=Mn(r,"skew",e.skew,n),r=Mn(r,"rotate",e.rotate,n),r=_n(r,e.origin,!1),!function(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}(e.translate)?r=Mn(r,"translate",e.translate,n):(r=_n(r,e.origin,!0),r=Mn(r,"translate",e.translate,n),r=_n(r,e.origin,!1)),r}function Mn(t,e,n,r){if(void 0===n)return t;const o=On(n);if("static"===o.kind)return{type:"g",transform:{value:jn(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>Sn(t,jn(e,t.value,void 0)))};return o.autoOrient&&(n.autoOrient=!0),void 0!==o.loop&&(n.loop=o.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function _n(t,e,n){if(void 0===e)return t;const r=On(e),o=t=>n?[-t[0],-t[1]]:t;if("absent"===r.kind)return t;if("static"===r.kind)return 0===r.value[0]&&0===r.value[1]?t:{type:"g",transform:{value:{translate:o(r.value)}},children:[t]};if("animated"===r.kind){const e={keyframes:r.keyframes.map(t=>Sn(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function zn(t,e,n){var r,o,a;if("use"===t.type&&"content"===(null==(o=null==(r=t.effects)?void 0:r.clone)?void 0:o.type)){const r=t.effects.clone.baseId;"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(a=t.children)||a.forEach(t=>zn(t,e,n))}function In(t,e,n,r,o){const a=function(t,e){var n,r,o;const a={};let i=!1;const s=null==(n=t.animate)?void 0:n.transform;if(s&&"object"==typeof s&&Array.isArray(s.keyframes)){const e=s.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=Cn(s),r={keyframes:e.map(t=>{const e=t.value||{},r={};void 0!==e.translate&&(r.translate=e.translate),n&&void 0!==e.origin&&(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),void 0!==t.tangentOut&&(o.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(o.tangentIn=t.tangentIn),o})};s.autoOrient&&(r.autoOrient=!0);const o=s.loop;void 0!==o&&(r.loop=o),a.animate={transform:r};const l=e.some(t=>{const e=t.value||{};return void 0!==e.rotate||void 0!==e.scale}),u=e.map(t=>{const e=t.value||{},r={};void 0!==e.rotate&&(r.rotate=e.rotate),void 0!==e.scale&&(r.scale=e.scale),void 0===e.origin||n&&!l||(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),o});if(u.every(t=>0===Object.keys(t.value).length))delete t.animate.transform,t.animate&&0===Object.keys(t.animate).length&&delete t.animate;else{const e={keyframes:u};void 0!==o&&(e.loop=o),t.animate.transform=e}i=!0}}const l=void 0!==(null==e?void 0:e.translate),u=i||l,c=i&&Cn((null==(r=t.animate)?void 0:r.transform)||void 0)||i&&Cn((null==(o=a.animate)?void 0:o.transform)||void 0);if("string"==typeof t.transform){const e=function(t){const e=[],n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);)e.push({name:r[1],full:r[0]});if(!e.length)return{rest:t||void 0};if(e.every(t=>"translate"===t.name))return{translate:e.map(t=>t.full).join("")};const o=e[0],a=e[e.length-1];if("translate"===a.name&&"translate"===o.name){const n=Nn(a.full),r=Nn(o.full),i=-n[0],s=-n[1],l=r[0]-i,u=r[1]-s;if(0===l&&0===u)return{rest:t};return{translate:"translate("+l+","+u+")",rest:"translate("+i+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===a.name)return{rest:t};const i=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)i.push(e[s].full),s++;if(!i.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:i.join(""),rest:l||void 0}}(t.transform);u?void 0!==e.translate?e.rest?t.transform=e.rest:delete t.transform:!function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,n=[];let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(1!==n.length)return!1;if("translate"===n[0].name)return!0;if("matrix"!==n[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(n[0].full);if(!o)return!1;const a=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return a.length>=4&&1===a[0]&&0===a[1]&&0===a[2]&&1===a[3]}(t.transform)?c&&function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let n,r=0,o=!1;for(;n=e.exec(t);)r++,"matrix"===n[1]&&(o=!0);return 1===r&&o}(t.transform)&&delete t.transform:delete t.transform:e.translate&&(a.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}return a}(t,e);"string"==typeof t.id&&delete t.id;const{outer:i,inner:s}=function(t){if(!t)return{};const e=Cn(t.translate),n=void 0!==t.rotate||void 0!==t.scale,r={},o={};void 0!==t.translate&&(r.translate=t.translate);e&&void 0!==t.origin&&(r.origin=t.origin);void 0!==t.rotate&&(o.rotate=t.rotate);void 0!==t.scale&&(o.scale=t.scale);void 0!==t.skew&&(o.skew=t.skew);void 0===t.origin||e&&!n||(o.origin=t.origin);return{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(e);let l=t;l=Pn(l,s,o);let u={type:"g",id:n,children:[{type:"g",id:r,children:[l]}]};return void 0!==a.transform&&(u.transform=a.transform),void 0!==a.animate&&(u.animate=a.animate),i&&(delete u.id,u=Pn(u,i,o),u.id=n),u}function Nn(t){const e=/translate\(([^)]*)\)/.exec(t);if(!e)return[0,0];const n=e[1].split(/[\s,]+/).filter(Boolean).map(Number);return[n[0]||0,n[1]||0]}function Cn(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||!!Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}function En(t,e){return"_lw_"+e+"_"+t.nextId++}function Tn(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function Fn(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Fn(t,e))}var Ln=pn;function Dn(t,e,n,r){if(!e)return t;const o=En(n,"grad"),a=function(t,e){const n={type:t.type===bt.radial?"radialGradient":"linearGradient",id:e};t.type===bt.linear?(t.p1&&(n.x1=String(t.p1[0]),n.y1=String(t.p1[1])),t.p2&&(n.x2=String(t.p2[0]),n.y2=String(t.p2[1]))):(t.c&&(n.cx=String(t.c[0]),n.cy=String(t.c[1])),void 0!==t.r&&(n.r=String(t.r)),t.fp&&(n.fx=String(t.fp[0]),n.fy=String(t.fp[1])));t.gradientUnits&&(n.gradientUnits=t.gradientUnits);t.spreadMethod&&(n.spreadMethod=t.spreadMethod);t.gradientTransform&&(n.gradientTransform=t.gradientTransform);const r=t.animate;if(r){const t={};for(const e of Object.keys(r)){const n=Un[e];n&&(t[n]=r[e])}Object.keys(t).length&&(n.animate=t)}return n.children=function(t){var e,n,r,o;if(!t)return[];if(Array.isArray(t))return t.map(Vn);if("object"==typeof t&&Array.isArray(t.value))return t.value.map(Vn);const a=t,i=a.keyframes;if(!Array.isArray(i)||!i.length)return[];const s=a.loop;let l=0;for(const t of i){const n=null!=(e=t.value)?e:t.v;Array.isArray(n)&&n.length>l&&(l=n.length)}if(!l)return[];const u=null!=(n=i[0].value)?n:i[0].v,c=[];for(let t=0;t<l;t++){const e=null!=(o=null!=(r=null==u?void 0:u[t])?r:Rn(i,0,t))?o:{offset:t/Math.max(1,l-1),color:"#000000"};c.push({offset:e.offset,color:e.color})}return c.map((t,e)=>function(t,e,n,r,o){var a,i,s,l,u;const c=[],f=[];let d=!1;for(const r of e){const o=null!=(i=null!=(a=r.time)?a:r.t)?i:0,h=null!=(s=r.value)?s:r.v,p=null!=(l=null==h?void 0:h[n])?l:Rn(e,e.indexOf(r),n);if(!p)continue;const m=null!=(u=r.easing)?u:r.e,y={time:o,value:p.color};void 0!==m&&(y.easing=m),c.push(y);const g={time:o,value:p.offset};void 0!==m&&(g.easing=m),f.push(g),p.offset!==t.offset&&(d=!0)}const h={type:"stop",offset:Wn(t.offset),stopColor:t.color},p={};c.length&&(p.stopColor={keyframes:c},void 0!==o&&(p.stopColor.loop=o));d&&f.length&&(p.offset={keyframes:f},void 0!==o&&(p.offset.loop=o));Object.keys(p).length&&(h.animate=p);return h}(t,i,e,0,s))}(t.stops),n}(e,o);return n.defs.push(a),t[r]="url(#"+o+")",t}var Un={gradientX1:"x1",gradientY1:"y1",gradientX2:"x2",gradientY2:"y2",gradientCx:"cx",gradientCy:"cy",gradientFx:"fx",gradientFy:"fy",gradientR:"r"};function Vn(t){return{type:"stop",offset:Wn(t.offset),stopColor:t.color}}function Rn(t,e,n){var r,o;for(let o=e;o>=0;o--){const e=null!=(r=t[o].value)?r:t[o].v;if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=null!=(o=t[r].value)?o:t[r].v;if(null==e?void 0:e[n])return e[n]}}function Wn(t){return Math.round(1e3*t)/10+"%"}function Bn(t,e,n,r){if(!e)return t;if(!e.href)return r.errors.push("maskedBy.href missing — cannot build mask"),t;const o=En(r,"mask");let a={type:"use",href:"#"+e.href};if(n)a=qn(a,n,r);else if(Xn(t))a=function(t,e){var n;const r=e.animate&&"object"==typeof e.animate&&!Array.isArray(e.animate)?e.animate:void 0,o=null==r?void 0:r.transform,a=o&&"object"==typeof o&&Array.isArray(o.keyframes)?o.keyframes:void 0;if(!a||!a.length)return t;const i=[],s=[],l=[];for(const t of a){const e=(null!=(n=t.value)?n:t.v)||{},r=Sn(t,void 0);if(Array.isArray(e.translate)&&i.push(v(g(g({},r),Kn(t)),{value:{translate:[-e.translate[0],-e.translate[1]]}})),"number"==typeof e.rotate){const t={rotate:-e.rotate};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),s.push(v(g({},r),{value:t}))}if(Array.isArray(e.scale)){const t={scale:[1/e.scale[0],1/e.scale[1]]};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),l.push(v(g({},r),{value:t}))}}const u=null==o?void 0:o.loop,c=t=>{const e={keyframes:t};return void 0!==u&&(e.loop=u),e};let f=t;i.length&&(f={type:"g",animate:{transform:c(i)},children:[f]});s.length&&(f={type:"g",animate:{transform:c(s)},children:[f]});l.length&&(f={type:"g",animate:{transform:c(l)},children:[f]});return f}(a,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,a,i,s,l,u,c,f,d,h;const p=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let m;const y=[];for(;null!==(m=p.exec(t));){const t=m[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);y.push({name:m[1],args:t})}if(!y.length)return;const g=y[y.length-1];if("translate"===g.name)for(let t=y.length-2;t>=0;t--){const c=y[t];if("translate"!==c.name)continue;const f=null!=(e=c.args[0])?e:0,d=null!=(n=c.args[1])?n:0,h=null!=(r=g.args[0])?r:0,p=null!=(o=g.args[1])?o:0;if(h!==-f||p!==-d)continue;const m={};m.origin=[f,d];for(let e=0;e<t;e++)if("translate"===y[e].name){const t=null!=(a=y[e].args[0])?a:0,n=null!=(i=y[e].args[1])?i:0;m.translate=m.translate?[m.translate[0]+t,m.translate[1]+n]:[t,n]}for(let e=t+1;e<y.length-1;e++){const t=y[e];if("rotate"===t.name)m.rotate=(null!=(s=m.rotate)?s:0)+(null!=(l=t.args[0])?l:0);else if("scale"===t.name){const e=null!=(u=t.args[0])?u:1,n=t.args.length>1?t.args[1]:e;m.scale=m.scale?[m.scale[0]*e,m.scale[1]*n]:[e,n]}}return m}let v,b,k;for(const t of y)if("translate"===t.name){const e=null!=(c=t.args[0])?c:0,n=null!=(f=t.args[1])?f:0;v=v?[v[0]+e,v[1]+n]:[e,n]}else if("rotate"===t.name)b=(null!=b?b:0)+(null!=(d=t.args[0])?d:0);else if("scale"===t.name){const e=null!=(h=t.args[0])?h:1,n=t.args.length>1?t.args[1]:e;k=k?[k[0]*e,k[1]*n]:[e,n]}const A={};v&&(A.translate=v);void 0!==b&&(A.rotate=b);k&&(A.scale=k);return Object.keys(A).length?A:void 0}(t.transform);if(!e)return;const n={};return e.translate&&(n.translate=e.translate),void 0!==e.rotate&&(n.rotate=e.rotate),e.scale&&(n.scale={value:e.scale}),e.origin&&(n.origin=e.origin),Object.keys(n).length?n:void 0}return}(t);e&&(a=qn(a,e,r))}const i=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||Xn(t))}(t);a=function(t,e,n,r,o){const a=r.idMap.get(n),i=r.maskAncestorChains.get(e)||[],s=o?Hn(e,r):void 0,l=s?[...i,s]:i,u=a&&r.maskAncestorChains.get(a)||[];if(!l.length&&!u.length)return t;const c=new Set;for(const t of l)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);for(const t of u)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);if(!(c.size>0)){const e=Yn(l),n=Yn(u),r=n[0]-e[0],o=n[1]-e[1];return 0===r&&0===o?t:{type:"g",transform:"translate("+r+","+o+")",children:[t]}}const f=Array.from(c).sort((t,e)=>t-e);return{type:"g",animate:{transform:{keyframes:f.map(t=>{const e=Qn(l,t),n=Qn(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(a,t,e.href,r,i);const s={type:"mask",id:o,children:[a]};return e.maskType&&(s.maskType=e.maskType),e.maskUnits&&(s.maskUnits=e.maskUnits),e.maskContentUnits&&(s.maskContentUnits=e.maskContentUnits),r.defs.push(s),t.mask="url(#"+o+")",t}function qn(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=On(t);if("absent"!==r.kind)return"static"===r.kind?r.value:(e.warnings.push("transformation.origin: animated origin approximated by its first keyframe"),null==(n=r.keyframes[0])?void 0:n.value)}(e.origin,n);let o=t;return o=Gn(o,"translate",e.translate,void 0,n),o=Gn(o,"rotate",e.rotate,r,n),o=Gn(o,"scale",e.scale,r,n),o}function Gn(t,e,n,r,o){if(void 0===n)return t;const a=On("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);if("static"===a.kind)return{type:"g",transform:{value:jn(e,Zn(e,a.value),r)},children:[t]};if("animated"===a.kind){const n={keyframes:a.keyframes.map(t=>{const n=Sn(t,jn(e,Zn(e,t.value),r));return"translate"===e?g(g({},n),Kn(t)):n})};return void 0!==a.loop&&(n.loop=a.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function Zn(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function Kn(t){var e,n;const r={},o=null!=(e=t.tangentOut)?e:t.to,a=null!=(n=t.tangentIn)?n:t.ti;return Array.isArray(o)&&(r.tangentOut=[-o[0],-o[1]]),Array.isArray(a)&&(r.tangentIn=[-a[0],-a[1]]),r}function Xn(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function Yn(t){let e=0,n=0;for(const r of t)r.translate&&(e+=r.translate[0],n+=r.translate[1]);return[e,n]}function Qn(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=Jn(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function Jn(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],a=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*a,r.value[1]+(o.value[1]-r.value[1])*a]}return t[t.length-1].value}function Hn(t,e){var n,r,o;const a=t.transform,i=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate.transform:void 0;if(void 0===a&&!i)return;const s={};if("string"==typeof a){const t=function(t,e){const n=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,a=0,i=!1,s=!1;for(;null!==(r=n.exec(t));){const t=r[1],e=r[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);"translate"===t?(o+=e[0]||0,a+=e[1]||0,i=!0):s=!0}s&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t);return i?[o,a]:void 0}(a,e);t&&(s.translate=t)}else if(a&&"object"==typeof a){const t=a.value;t&&"object"==typeof t&&Array.isArray(t.translate)&&(s.translate=[t.translate[0]||0,t.translate[1]||0]),!t||void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: non-translate transform parts ignored (rotate/scale not yet supported)")}if(i&&Array.isArray(i.keyframes)){const t=i.keyframes,a=[];for(const i of t){const t=null!=(n=i.value)?n:i.v,s=null!=(o=null!=(r=i.time)?r:i.t)?o:0;t&&"object"==typeof t&&Array.isArray(t.translate)&&(a.push({time:s,value:[t.translate[0]||0,t.translate[1]||0]}),void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: animated non-translate parts ignored"))}a.length&&(s.translateKeyframes=a)}return s.translate||s.translateKeyframes?s:void 0}var $n="content";function tr(t,e,n){if(!e)return;const r=e.baseId;if(!r)return void(e.type===$n&&n.errors.push("clone: content ref missing baseId"));const o=e.type===$n&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function er(t,e){const n={};return void 0!==t.translate&&(n.translate=function(t,e){if(Array.isArray(t))return e(t);if(t&&"object"==typeof t){const n=t;if(Array.isArray(n.keyframes))return v(g({},n),{keyframes:n.keyframes.map(t=>t&&void 0!==t.value?v(g({},t),{value:e(t.value)}):t)});if(void 0!==n.value)return v(g({},n),{value:e(n.value)})}return t}(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=function(t,e){if("number"==typeof t)return e(t);if(t&&"object"==typeof t){const n=t;if(Array.isArray(n.keyframes))return v(g({},n),{keyframes:n.keyframes.map(t=>t&&void 0!==t.value?v(g({},t),{value:e(t.value)}):t)});if(void 0!==n.value)return v(g({},n),{value:e(n.value)})}return t}(t.rotate,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){const n=t=>[Math.pow(t[0]/100,e),Math.pow(t[1]/100,e)],r=t=>[Math.pow(t[0],e),Math.pow(t[1],e)];if(Array.isArray(t))return{value:n(t)};if(t&&"object"==typeof t){const e=t;if(Array.isArray(e.keyframes))return v(g({},e),{keyframes:e.keyframes.map(t=>t&&void 0!==t.value?v(g({},t),{value:r(t.value)}):t)});if(void 0!==e.value)return v(g({},e),{value:n(e.value)})}return t}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function nr(t){var e,n;return t.timeCrop&&console.warn("retime: `timeCrop` is not supported yet and will be ignored"),{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function rr(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function or(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function ar(t){var e;const n=null==(e=t.effects)?void 0:e.clone;n&&(delete n.retime,0===Object.keys(n).length&&delete t.effects.clone,t.effects&&0===Object.keys(t.effects).length&&delete t.effects)}function ir(t,e,n){const r=Tn(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=sr(r,e,n,new Set);o&&(t.href="#"+o)}function sr(t,e,n,r){if(r.has(t))return void n.errors.push('retime: loop via "'+t+'"');const o=n.idMap.get(t);if(!o)return void n.warnings.push('retime: target "'+t+'" not found');const a=Ln(o);if(function(t,e){mn(t,()=>En(e,"retimed"))}(a,n),"use"===o.type?ur(a,e.start,e.stretch):lr(a,e.start,e.stretch),ar(a),"use"===o.type&&o.href){const i=Tn(o.href);if(i){const s=or(o),l=s?rr(nr(s),e):e,u=new Set(r);u.add(t);const c=sr(i,l,n,u);c&&(a.href="#"+c)}}else!function(t,e,n,r,o){const a=t=>{var i;const s=or(t);if("use"===t.type&&s&&t.href){const a=Tn(t.href);if(a){const i=rr(nr(s),e),l=new Set(r);l.add(o);const u=sr(a,i,n,l);u&&(t.href="#"+u)}ar(t)}null==(i=t.children)||i.forEach(a)};a(t)}(a,e,n,r,t);return n.defs.push(a),"string"==typeof a.id&&n.idMap.set(a.id,a),"string"==typeof a.id?a.id:void 0}function lr(t,e,n){var r;ur(t,e,n),null==(r=t.children)||r.forEach(t=>lr(t,e,n))}function ur(t,e,n){const r=t=>{for(const r of t)"number"==typeof r.time&&(r.time=e+r.time*n)};if(t.transform&&"object"==typeof t.transform&&Array.isArray(t.transform.keyframes)&&r(t.transform.keyframes),t.animate&&"object"==typeof t.animate)for(const e of Object.keys(t.animate)){const n=t.animate[e];n&&Array.isArray(n.keyframes)&&r(n.keyframes)}}var cr=/[MmLlHhVvCcSsQqTtAaZz]/;function fr(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 dr(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,a=0,i=0,s=0,l=0,u=0,c=0,f=0,d="";const h=()=>parseFloat(e[r++]),p=(t,e,r)=>{const i=[o,a],s=de(i,t,e,r,48);n.push({P0:i,P1:t,P2:e,P3:r,lut:s,len:s.ds[s.ds.length-1]}),o=r[0],a=r[1]},m=(t,e)=>{p([o+(t-o)/3,a+(e-a)/3],[o+2*(t-o)/3,a+2*(e-a)/3],[t,e])};for(;r<e.length;){let t=e[r];cr.test(t)?r++:t="M"===d?"L":"m"===d?"l":d;const n=t>="a",y=t.toUpperCase();if("Z"!==y){if("M"===y){const e=h()+(n?o:0),r=h()+(n?a:0);o=e,a=r,i=e,s=r,d=t;continue}if("L"===y)m(h()+(n?o:0),h()+(n?a:0));else if("H"===y)m(h()+(n?o:0),a);else if("V"===y)m(o,h()+(n?a:0));else if("C"===y){const t=[h()+(n?o:0),h()+(n?a:0)],e=[h()+(n?o:0),h()+(n?a:0)],r=[h()+(n?o:0),h()+(n?a:0)];l=e[0],u=e[1],p(t,e,r)}else if("S"===y){const t="C"===d.toUpperCase()||"S"===d.toUpperCase()?[2*o-l,2*a-u]:[o,a],e=[h()+(n?o:0),h()+(n?a:0)],r=[h()+(n?o:0),h()+(n?a:0)];l=e[0],u=e[1],p(t,e,r)}else if("Q"===y){const t=[h()+(n?o:0),h()+(n?a:0)],e=[h()+(n?o:0),h()+(n?a:0)];c=t[0],f=t[1];const{P1:r,P2:i}=fr([o,a],t,e);p(r,i,e)}else if("T"===y){const t="Q"===d.toUpperCase()||"T"===d.toUpperCase()?[2*o-c,2*a-f]:[o,a],e=[h()+(n?o:0),h()+(n?a:0)];c=t[0],f=t[1];const{P1:r,P2:i}=fr([o,a],t,e);p(r,i,e)}else{if("A"!==y){r++;continue}r+=5,m(h()+(n?o:0),h()+(n?a:0))}d=t}else m(i,s),o=i,a=s,d=t}return n.length?n:null}(t);if(!e)return null;const n=new Float64Array(e.length+1);for(let t=0;t<e.length;t++)n[t+1]=n[t]+e[t].len;const r=n[e.length],o=e[0].P0,a=e[e.length-1].P3,i=Math.hypot(a[0]-o[0],a[1]-o[1])<.001,s=t=>{let r=0;for(;r<e.length-1&&t>n[r+1];)r++;const o=e[r],a=t-n[r],i=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 a=1,i=o;for(;a<i;){const t=a+i>>>1;r[t]<e?a=t+1:i=t}const s=r[i-1],l=r[i]-s,u=l>0?(e-s)/l:0;return n[i-1]+u*(n[i]-n[i-1])}(o.lut,a):0,[s,l]=le(o.P0,o.P1,o.P2,o.P3,i),[u,c]=ce(o.P0,o.P1,o.P2,o.P3,i);return{x:s,y:l,angle:Math.atan2(c,u)}};return{totalLength:r,closed:i,sampleAtDistance(t){if(i&&r>0&&(t<0||t>r))return s((t%r+r)%r);if(!i&&(t<0||t>r)){const e=t<0?0:r,n=s(e),o=t-e;return{x:n.x+Math.cos(n.angle)*o,y:n.y+Math.sin(n.angle)*o,angle:n.angle}}return s((o=r,(e=t)<(n=0)?n:e>o?o:e));var e,n,o}}}function hr(t){if("number"==typeof t)return{min:t,max:t};if(t&&"object"==typeof t){const e=t;if("number"==typeof e.value)return{min:e.value,max:e.value};if(Array.isArray(e.keyframes)&&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 pr(t){let e=0,n=16;const r=t=>{var o,a;const i=parseFloat(String(null!=(o=t.fontSize)?o:""))||0;i&&(n=Math.max(n,i));const s=null!=(a=t.text)?a: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 mr=t=>Math.round(1e3*t)/1e3;function yr(t,e){if(!e||null==t)return t;if("number"==typeof t)return t+e;const n=t;return"number"==typeof n.value?v(g({},n),{value:n.value+e}):Array.isArray(n.keyframes)?v(g({},n),{keyframes:n.keyframes.map(t=>v(g({},t),{value:(Number(t.value)||0)+e}))}):t}function gr(t,e){var n;if("clip"===e.pathOverflow)return{d:t,startShift:0};const r=dr(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,a=.15*o,i=hr(e.startOffset),s=hr(e.textLength).max||(null!=(n=e.advance)?n:0),l=Math.max(0,-i.min),u=Math.max(0,i.max+s-o),c=l>0?l+a:0,f=u>0?u+a: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"+mr(e)+","+mr(n)+"L"+mr(d.x)+","+mr(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"+mr(t)+","+mr(e)}return{d:p,startShift:c}}function vr(t,e,n){if(null!=n)if("number"!=typeof n){if("object"==typeof n&&null!==n){const r=n;if(Array.isArray(r.keyframes)){const n=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,o=g({},n||{}),a={keyframes:r.keyframes};return void 0!==r.loop&&(a.loop=r.loop),o[e]=a,void(t.animate=o)}if("number"==typeof r.value)return void(t[e]=String(r.value))}}else t[e]=String(n)}var br=(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 kr(t,e){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function Ar(t,e){let n="";for(let r=0;r<t.length;r++){const o=kr(t[r],e);r>0&&45!==o.charCodeAt(0)&&(n+=" "),n+=o}return n}function wr(t,e,n){return[t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}var xr=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function jr(t,e,n=2){const r=[];let o;for(xr.lastIndex=0;null!==(o=xr.exec(t));)r.push(o[0]);let a="",i=0;const s=()=>parseFloat(r[i++]);for(;i<r.length;){const t=r[i++];if("M"===t||"L"===t){const[r,o]=wr(e,s(),s());a+=t+Ar([r,o],n)}else if("C"===t){const[t,r]=wr(e,s(),s()),[o,i]=wr(e,s(),s()),[l,u]=wr(e,s(),s());a+="C"+Ar([t,r,o,i,l,u],n)}else if("Q"===t){const[t,r]=wr(e,s(),s()),[o,i]=wr(e,s(),s());a+="Q"+Ar([t,r,o,i],n)}else"Z"!==t&&"z"!==t||(a+="Z")}return a}var Or=["fontFamily","fontSize","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","textDecoration","textTransform","whiteSpace","x","y","dx","dy","lengthAdjust","fill","stroke","strokeWidth","effects",B,q,"xml:space"];function Sr(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?void 0:e}}function Pr(t){return"string"==typeof t?t:void 0}function Mr(t,e){var n,r,o,a,i,s,l;return{fontFamily:null!=(n=Pr(t.fontFamily))?n:e.fontFamily,fontSize:null!=(r=Sr(t.fontSize))?r:e.fontSize,fill:null!=(o=t.fill)?o:e.fill,stroke:null!=(a=t.stroke)?a:e.stroke,strokeWidth:null!=(i=t.strokeWidth)?i:e.strokeWidth,letterSpacing:null!=(s=Sr(t.letterSpacing))?s:e.letterSpacing,wordSpacing:null!=(l=Sr(t.wordSpacing))?l:e.wordSpacing}}function _r(t){var e,n,r;return{fontFamily:Pr(t.fontFamily),fontSize:null!=(e=Sr(t.fontSize))?e:16,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(n=Sr(t.letterSpacing))?n:0,wordSpacing:null!=(r=Sr(t.wordSpacing))?r:0}}function zr(t){const e={};return void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),e}function Ir(t,e,n,r){var o;const a=t.fontFamily?e[t.fontFamily]:n;return a||null==r||r.push('textGlyphs: no glyphs for font "'+(null!=(o=t.fontFamily)?o:"")+'"'),a}function Nr(t){const e=Object.keys(t);return 1===e.length?t[e[0]]:void 0}function Cr(t,e){if(t<=0||e<=0)return"";const n=.08,r=t*n,o=.92*t,a=.92*-e,i=o-r,s=-a,l=Math.max(1,.12*Math.min(i,s)),u="M"+r+" 0L"+o+" 0L"+o+" "+a+"L"+r+" "+a+"Z";if(i<=2*l||s<=2*l)return u;const c=r+l,f=o-l,d=-l,h=a+l;return u+"M"+c+" "+d+"L"+c+" "+h+"L"+f+" "+h+"L"+f+" "+d+"Z"}function Er(t,e){var n,r,o,a;const{glyphs:i,create:s=br,warnings:l}=e,u=Nr(i),c={x:null!=(n=Sr(t.x))?n:0,y:null!=(r=Sr(t.y))?r:0},f=[],d=[{start:c.x,end:c.x}];let h=0;const p=(t,e)=>{var n;const r=Ir(e,i,u,l),o=(null==r?void 0:r.unitsPerEm)||1e3,a=e.fontSize/o,s=null!=(n=null==r?void 0:r.ascent)?n:.9*o,p=zr(e);for(let n=0;n<t.length;n++){const i=t.charAt(n),l=null==r?void 0:r.glyphs[i];if(l&&l.d)f.push({glyphD:l.d,m:[a,0,0,a,c.x,c.y],paint:p,line:h,x:c.x,y:c.y,scale:a}),c.x+=l.width*a;else if(/\S/.test(i)){const t=l&&l.width>0?l.width:.6*o;f.push({glyphD:Cr(t,s),m:[a,0,0,a,c.x,c.y],paint:p,line:h,x:c.x,y:c.y,scale:a}),c.x+=t*a}else c.x+=(l?l.width:0)*a;c.x+=e.letterSpacing+(" "===i?e.wordSpacing:0),d[h].end=c.x}},m=(t,e)=>{var n,r,o,a;const i=Mr(t,e),s=Sr(t.x),l=Sr(t.y);void 0!==s&&(c.x=s,h=d.length,d.push({start:c.x,end:c.x})),void 0!==l&&(c.y=l),c.x+=null!=(n=Sr(t.dx))?n:0,c.y+=null!=(r=Sr(t.dy))?r:0;const u=null!=(o=Pr(t[B]))?o:Pr(t[q]);if(u&&!(null==(a=t.children)?void 0:a.length)&&p(u,i),t.children)for(const e of t.children)m(e,i)},y=_r(t);if(t.children)for(const e of t.children)m(e,y);const g=null!=(o=Pr(t[B]))?o:Pr(t[q]);g&&!(null==(a=t.children)?void 0:a.length)&&p(g,y);const v=Pr(t.textAnchor);if("middle"===v||"end"===v)for(const t of f){const e=d[t.line].end-d[t.line].start,n="middle"===v?-e/2:-e;t.m=[t.scale,0,0,t.scale,t.x+n,t.y]}return Gr(t,qr(f,s,l),s)}function Tr(t,e){var n,r,o,a,i,s;if(null==(n=e.alongPath)?void 0:n.pathD)return function(t,e,n){var r,o;const{glyphs:a,warnings:i,alongPath:s}=n,l=dr(e);if(!l)return null==i||i.push("textGlyphs: unparsable along-path geometry (caret)"),[];const u=Nr(a),c=[];let f=0;const d=(t,e)=>{var n,r,o;const s=Mr(t,e),l=null!=(n=Pr(t[B]))?n:Pr(t[q]);if(l&&!(null==(r=t.children)?void 0:r.length)){const t=Ir(s,a,u,i),e=(null==t?void 0:t.unitsPerEm)||1e3,n=s.fontSize/e,r=(null!=(o=null==t?void 0:t.ascent)?o:.9*e)*n;for(let e=0;e<l.length;e++){const o=l.charAt(e),a=null==t?void 0:t.glyphs[o],i=(a?a.width:0)*n,u=i+s.letterSpacing+(" "===o?s.wordSpacing:0);c.push({advStart:f,advEnd:f+u,glyphW:i,ascent:r,fontSize:s.fontSize}),f+=u}}if(t.children)for(const e of t.children)d(e,s)};d(t,_r(t));const h=f,p=On(null==s?void 0:s.textLength),m="animated"===p.kind?Number(null==(r=p.keyframes[0])?void 0:r.value)||0:"static"===p.kind&&Number(p.value)||0,y=m>0&&h>0?m/h:1,g=On(null==s?void 0:s.startOffset),{along:v,perp:b}=Lr(t),k=v+("animated"===g.kind?Number(null==(o=g.keyframes[0])?void 0:o.value)||0:"static"===g.kind&&Number(g.value)||0),A=t=>({x:t.x-b*Math.sin(t.angle),y:t.y+b*Math.cos(t.angle),angle:t.angle});return c.map(t=>{const e=k+t.advStart*y,n=k+t.advEnd*y,r=A(l.sampleAtDistance(e)),o=A(l.sampleAtDistance(n)),a=l.sampleAtDistance(k+(t.advStart+t.glyphW/2)*y);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*a.angle/Math.PI}})}(t,e.alongPath.pathD,e);const{glyphs:l,warnings:u}=e,c=Nr(l),f={x:null!=(r=Sr(t.x))?r:0,y:null!=(o=Sr(t.y))?o:0},m=[],y=[{start:f.x,end:f.x}];let g=0;const v=(t,e)=>{var n;const r=Ir(e,l,c,u),o=(null==r?void 0:r.unitsPerEm)||1e3,a=e.fontSize/o,i=(null!=(n=null==r?void 0:r.ascent)?n:.9*o)*a;for(let n=0;n<t.length;n++){const o=t.charAt(n),s=null==r?void 0:r.glyphs[o],l=(s?s.width:0)*a+e.letterSpacing+(" "===o?e.wordSpacing:0);m.push({x:f.x,y:f.y,width:l,ascent:i,fontSize:e.fontSize,line:g}),f.x+=l,y[g].end=f.x}},b=(t,e)=>{var n,r,o,a;const i=Mr(t,e),s=Sr(t.x),l=Sr(t.y);void 0!==s&&(f.x=s,g=y.length,y.push({start:f.x,end:f.x})),void 0!==l&&(f.y=l),f.x+=null!=(n=Sr(t.dx))?n:0,f.y+=null!=(r=Sr(t.dy))?r:0;const u=null!=(o=Pr(t[B]))?o:Pr(t[q]);if(u&&!(null==(a=t.children)?void 0:a.length)&&v(u,i),t.children)for(const e of t.children)b(e,i)},k=_r(t);if(t.children)for(const e of t.children){const t=m.length;if(b(e,k),m.length===t){const t=Mr(e,k),n=Ir(t,l,c),r=(null==n?void 0:n.unitsPerEm)||1e3;m.push({x:f.x,y:f.y,width:0,ascent:(null!=(a=null==n?void 0:n.ascent)?a:.9*r)*(t.fontSize/r),fontSize:t.fontSize,line:g})}}const A=null!=(i=Pr(t[B]))?i:Pr(t[q]);A&&!(null==(s=t.children)?void 0:s.length)&&v(A,k);const w=Pr(t.textAnchor);if("middle"===w||"end"===w)for(const t of m){const e=y[t.line].end-y[t.line].start;t.x+="middle"===w?-e/2:-e}return m.map(t=>{var e=t,{line:n}=e;return((t,e)=>{var n={};for(var r in t)h.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&d)for(var r of d(t))e.indexOf(r)<0&&p.call(t,r)&&(n[r]=t[r]);return n})(e,["line"])})}function Fr(t,e,n,r,o=0){const{x:a,y:i,angle:s}=t.sampleAtDistance(e),l=Math.cos(s),u=Math.sin(s),c=r/2;return[n*l,n*u,-n*u,n*l,a-n*l*c-o*u,i-n*u*c+o*l]}function Lr(t){var e,n,r;return{along:(null!=(e=Sr(t.x))?e:0)+(null!=(n=Sr(t.dx))?n:0),perp:null!=(r=Sr(t.dy))?r:0}}function Dr(t,e,n,r,o,a){const{glyphs:i,create:s=br,warnings:l}=r,u=e?dr(e):null;if(!u)return null==l||l.push("textGlyphs: unparsable along-path geometry"),null;const c=Nr(i),{cells:f,width:d}=function(t,e,n,r){const o=[];let a=0;const i=(t,s)=>{var l,u,c;const f=Mr(t,s),d=null!=(l=Pr(t[B]))?l:Pr(t[q]);if(d&&!(null==(u=t.children)?void 0:u.length)){const t=Ir(f,e,n,r);if(t){const e=f.fontSize/t.unitsPerEm,n=null!=(c=t.ascent)?c:.9*t.unitsPerEm,r=zr(f);for(let i=0;i<d.length;i++){const s=d.charAt(i),l=t.glyphs[s];if(l&&l.d){const t=l.width*e;o.push({glyphD:l.d,widthEm:l.width,scale:e,paint:r,midBase:a+t/2}),a+=t}else if(/\S/.test(s)){const i=l&&l.width>0?l.width:.6*t.unitsPerEm,s=i*e;o.push({glyphD:Cr(i,n),widthEm:i,scale:e,paint:r,midBase:a+s/2}),a+=s}else a+=(l?l.width:0)*e;a+=f.letterSpacing+(" "===s?f.wordSpacing:0)}}}if(t.children)for(const e of t.children)i(e,f)};return i(t,_r(t)),{cells:o,width:a}}(t,i,c,l);if(!f.length)return Gr(t,[],s);const{along:h,perp:p}=Lr(t),m=Ur(n),y=Ur(o),b=t=>t>0&&d>0?t/d:1,k="clip"===a&&!u.closed;if(m.animated||y.animated){const e=function(t,e){const n=[...t,...e].sort((t,e)=>t-e),r=[];for(const t of n)r.length&&t===r[r.length-1]||r.push(t);return r}(m.times,y.times),n=(t,e)=>h+m.at(e)+b(y.at(e))*t.midBase,r=m.animated?m.loop:y.loop;return Gr(t,function(t,e,n,r,o,a,i,s=0){const l=Math.max(e.totalLength/Vr,.5),u=t=>t>=0&&t<=e.totalLength,c=[];for(const f of t){const t=[f.scale,0,0,f.scale,-f.scale*(f.widthEm/2),0],d=jr(f.glyphD,t),h=(t,n)=>{const{x:r,y:o,angle:a}=e.sampleAtDistance(t),i=Math.cos(a),l=Math.sin(a);return{time:n,value:{translate:[Wr(r-s*l,3),Wr(o+s*i,3)],rotate:Wr(180*a/Math.PI,3)}}},p=[],m=[],y=(t,e)=>{p.push(h(t,e)),i&&m.push({time:e,value:u(t)?1:0})};y(n(f,r[0]),r[0]);for(let t=1;t<r.length;t++){const e=r[t-1],o=r[t],a=n(f,e),i=n(f,o),s=Math.min(Rr,Math.max(1,Math.ceil(Math.abs(i-a)/l)));for(let t=1;t<=s;t++){const r=e+t/s*(o-e);y(n(f,r),r)}}Le(p);const b={keyframes:p};void 0!==o&&(b.loop=o);const k={transform:b};if(i&&m.some(t=>0===t.value)){const t={keyframes:m};void 0!==o&&(t.loop=o),k.opacity=t}c.push(a("path",v(g({d:d},Br(f.paint)),{animate:k}),[]))}return c}(f,u,n,e,r,s,k,p),s)}const A=b(y.at(0)),w=h+m.at(0);return Gr(t,qr((k?f.filter(t=>{const e=w+t.midBase*A;return e>=0&&e<=u.totalLength}):f).map(t=>({glyphD:t.glyphD,paint:t.paint,m:Fr(u,w+t.midBase*A,t.scale,t.widthEm,p)})),s,l),s)}function Ur(t){var e;const n=On(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],a=o>0?(t-e[n-1])/o:1;return r[n-1]+a*(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 Vr=48,Rr=64;function Wr(t,e){const n=m(10,e);return Math.round(t*n)/n}function Br(t){const e={};return void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),e}function qr(t,e,n){var r,o,a;if(!t.length)return null==n||n.push("textGlyphs: nothing to render"),[];const i=new Map;for(const e of t){const t=JSON.stringify([null!=(r=e.paint.fill)?r:null,null!=(o=e.paint.stroke)?o:null,null!=(a=e.paint.strokeWidth)?a:null]),n=jr(e.glyphD,e.m),s=i.get(t);s?s.d+=n:i.set(t,{paint:e.paint,d:n})}const s=[];for(const{paint:t,d:n}of i.values())s.push(e("path",g({d:n},Br(t)),[]));return s}function Gr(t,e,n){const r={};for(const e of Object.keys(t))"type"!==e&&"children"!==e&&-1===Or.indexOf(e)&&(r[e]=t[e]);if(r.style&&"object"==typeof r.style){const t=g({},r.style);delete t["white-space"],Object.keys(t).length?r.style=t:delete r.style}return n("g",r,e)}function Zr(t,e){return e.alongPath?Dr(t,e.alongPath.pathD,e.alongPath.startOffset,e,e.alongPath.textLength,e.alongPath.pathOverflow):Er(t,e)}function Kr(t,e,n,r){if(!e)return t;const o=!!e.trimAllAsOne,a=[],i=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const e of t.children)i(e);return}const e="string"==typeof t.d?t.d:function(t){var e,n,r,o,a,i,s,l,u,c;if("rect"===t.type){const a=Number(null!=(e=t.x)?e:0),i=Number(null!=(n=t.y)?n:0),s=Number(null!=(r=t.width)?r:0),l=Number(null!=(o=t.height)?o:0);return"M"+(a+s)+","+i+"L"+(a+s)+","+(i+l)+"L"+a+","+(i+l)+"L"+a+","+i+"L"+(a+s)+","+i+"z"}if("ellipse"===t.type||"circle"===t.type){const e=Number(null!=(a=t.cx)?a:0),n=Number(null!=(i=t.cy)?i:0),r="circle"===t.type?Number(null!=(s=t.r)?s:0):Number(null!=(l=t.rx)?l:0),o="circle"===t.type?Number(null!=(u=t.r)?u:0):Number(null!=(c=t.ry)?c:0);if(!(r>0&&o>0))return;const f=r*lo,d=o*lo,h=(t,e,n,r,o,a)=>"C"+t+","+e+" "+n+","+r+" "+o+","+a;return"M"+(e+r)+","+n+h(e+r,n+d,e+f,n+o,e,n+o)+h(e-f,n+o,e-r,n+d,e-r,n)+h(e-r,n-d,e-f,n-o,e,n-o)+h(e+f,n-o,e+r,n-d,e+r,n)+"z"}return}(t);if(void 0===e)return;const n=Je(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){const e=io(t);r.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}a.push(r)};if(i(t),!a.length)return t;let s=0;const l=o?[...a].reverse():a;for(const t of l)for(const e of t.subpaths)o||(s=0),e.startOffsetPx=s,s+=e.lengthPx;const u=s;if(o&&u<.001)return t;const c=On(e.offset),f="absent"===c.kind?{kind:"static",value:0}:c,d=function(t){const e=On(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>{var e,n,r,o;return{time:null!=(n=null!=(e=t.time)?e:t.t)?n:0,value:null!=(r=t.value)?r:t.v,easing:null!=(o=t.easing)?o:t.e}});if(!n.some(t=>t.value[0]>t.value[1]))return{kind:"animated",keyframes:n.map(t=>({time:t.time,value:t.value,easing:t.easing}))};const r=[];for(let t=1;t<n.length;t++){const e=n[t-1],o=n[t];if((e.value[1]-e.value[0])*(o.value[1]-o.value[0])<0){const t=oo(e,o);null!==t&&t>e.time&&t<o.time&&r.push(Math.round(t))}}const o=Array.from(new Set(r)).sort((t,e)=>t-e),a=[];let i=0;for(const t of n){for(;i<o.length&&o[i]<t.time;){const t=o[i++],e=ao(n,t),r=(e[0]+e[1])/2;a.push({time:t,value:[r,r]})}const e=t.value[0]>t.value[1]?[t.value[1],t.value[0]]:t.value;a.push({time:t.time,value:e,easing:t.easing})}for(;i<o.length;){const t=o[i++],e=ao(n,t),r=(e[0]+e[1])/2;a.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:a}}(e.range),h="absent"===d.kind?{kind:"static",value:[0,1]}:d,p=function(t){var e;if("absent"===t.kind)return[];if("static"===t.kind)return[t.value];const n=[];for(const r of t.keyframes){const t=null!=(e=r.value)?e:r.v;"number"==typeof t&&n.push(t)}return n}(f),m=[p.length?Math.min(...p):0,p.length?Math.max(...p):0];if(1===a.length&&a[0].leaf===t&&1===a[0].subpaths.length){const e=a[0],n=e.subpaths[0],r=o?u:n.lengthPx;if(r<.001)return t;const i=o?n.startOffsetPx/r:0;return function(t,e,n,r,o,a){const i=Jr(n,e,r),s=Hr(e,r),l=g({},t);return delete l.effects,eo(l,"strokeDasharray",to(a,s)),eo(l,"strokeDashoffset",to(o,i)),eo(l,"strokeOpacity",ro(a)),l}(e.leaf,r,i,m,f,h)}const y=new Map;for(const t of a){const e=[];for(const n of t.subpaths){const a=o?u:n.lengthPx;if(a<.001)continue;const i=o?n.startOffsetPx/a:0;e.push(...Yr(t.leaf,n.subpath,a,i,m,f,h,r))}y.set(t.leaf,Xr(t.leaf,e))}const b=t=>{const e=y.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?v(g({},t),{children:t.children.map(b)}):t)};return b(t)}function Xr(t,e){const n=v(g({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function Yr(t,e,n,r,o,a,i,s){const l=Jr(r,n,o),u=Hr(n,o),c=to(a,l),f=to(i,u),d=ro(i),h=function(t){return{type:"path",d:t}}(Ut(e));return eo(h,"strokeDasharray",f),eo(h,"strokeDashoffset",c),eo(h,"strokeOpacity",d),[h]}var Qr=1;function Jr(t,e,n){const[r]=$r(n);return n=>e*(-n-r+t)+Qr}function Hr(t,e){const[n,r]=$r(e),o=r-n+1;return e=>{const n=se(e[0],0,1),r=se(e[1],0,1),a=Math.min(n,r),i=Math.max(n,r),s=[0];let l=Qr;for(let e=0;e<o;e++)s.push(l+a*t),s.push((i-a)*t),l=(1-i)*t;return s.push(l+Qr),s}}function $r(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function to(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>{var n,r,o,a;return{time:null!=(r=null!=(n=t.time)?n:t.t)?r:0,value:e(null!=(o=t.value)?o:t.v),easing:null!=(a=t.easing)?a:t.e}}),loop:t.loop}}function eo(t,e,n){var r,o;if(!n)return;if("static"===n.kind)return void(t[e]=n.value);const a=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,i=g({},a||{}),s={keyframes:n.keyframes};void 0!==n.loop&&(s.loop=n.loop),i[e]=s,t.animate=i;const l=n.keyframes[0];l&&void 0!==(null!=(r=l.value)?r:l.v)&&(t[e]=null!=(o=l.value)?o:l.v)}var no=10;function ro(t){var e,n,r,o,a,i;const s=t=>t[0]===t[1];if("absent"===t.kind)return;if("static"===t.kind)return s(t.value)?{kind:"static",value:0}:void 0;const l=t.keyframes;let u=!1,c=!0;for(const t of l)s(null!=(e=t.value)?e:t.v)?u=!0:c=!1;if(!u)return;if(c)return{kind:"static",value:0};const f=[];for(let t=0;t<l.length;t++){const e=l[t],u=t>0?l[t-1]:void 0,c=t<l.length-1?l[t+1]:void 0,d=null!=(r=null!=(n=e.time)?n:e.t)?r:0,h=s(null!=(o=e.value)?o:e.v),p=u?h&&s(null!=(a=u.value)?a:u.v):h,m=c?h&&s(null!=(i=c.value)?i:c.v):h;p&&!m?(f.push({time:d,value:0}),f.push({time:d+no,value:1})):!p&&m&&(f.push({time:d-no,value:1}),f.push({time:d,value:0}))}return f.length<=1?void 0:{kind:"animated",keyframes:f}}function oo(t,e){const n=n=>{const r=(n-t.time)/(e.time-t.time),o=t.value[0]+(e.value[0]-t.value[0])*r;return t.value[1]+(e.value[1]-t.value[1])*r-o};let r=t.time,o=e.time,a=n(r);if(0===a)return r;const i=n(o);if(0===i)return o;if(a*i>0)return null;for(let t=0;t<100;t++){const t=(r+o)/2,e=n(t);if(0===e||Math.abs(o-r)<1e-4)return t;a*e<0?o=t:(r=t,a=e)}return(r+o)/2}function ao(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],a=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*a,r.value[1]+(o.value[1]-r.value[1])*a]}return t[t.length-1].value}function io(t){const e=t.v;if(!e||e.length<2)return 0;let n=0;for(let r=0;r<e.length-1;r++)n+=so(t,r,r+1);return t.c&&e.length>1&&(n+=so(t,e.length-1,0)),n}function so(t,e,n){var r,o,a,i;const s=t.v,l=s[e],u=s[n],c=de(l,null!=(o=null==(r=t.o)?void 0:r[e])?o:l,null!=(i=null==(a=t.i)?void 0:a[n])?i:u,u);return c.ds[c.ds.length-1]}var lo=.5522847498307936;function uo(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:(null==(e=Tt(t))?void 0:e.mode)===R.frames?W.frames:W.webapi,glyphs:null==(n=Ft(t))?void 0:n.glyphs},o=Ln(t);Fn(o,r.idMap),zn(o,r,()=>En(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,a;const i=null==(a=null==(o=t.effects)?void 0:o.maskedBy)?void 0:a.href;if("string"==typeof i){n.add(t);const r=e.idMap.get(i);r&&n.add(r)}if(Array.isArray(t.children))for(const e of t.children)r(e)};if(r(t),0===n.size)return;const o=(t,r)=>{if(n.has(t)&&e.maskAncestorChains.set(t,r),Array.isArray(t.children)){const n=Hn(t,e),a=n?[...r,n]:r;for(const e of t.children)o(e,a)}};o(t,[])}(o,r);const a=function(t,e){return function(t,e){e.idMap.clear(),Fn(t,e.idMap);const n=[],r=t=>{var e;or(t)&&n.push(t),null==(e=t.children)||e.forEach(r)};r(t);const o=new Map;for(const t of n){let n=0;const r=new Set,a=o=>{var i;if(o){if(o!==t&&or(o)&&n++,"use"===o.type&&o.href){const t=Tn(o.href);t&&!r.has(t)&&(r.add(t),a(e.idMap.get(t)))}null==(i=o.children)||i.forEach(a)}},i=Tn(t.href);i&&(r.add(i),a(e.idMap.get(i))),o.set(t,n)}n.sort((t,e)=>{var n,r;return(null!=(n=o.get(e))?n:0)-(null!=(r=o.get(t))?r:0)});for(const t of n){const n=or(t);n&&(ar(t),ir(t,nr(n),e))}}(t,e),t}(co(o,r),r);return function(t,e){if(!e.length)return;(t.children||(t.children=[])).unshift({type:"defs",children:e})}(a,r.defs),{root:a,defs:r.defs,warnings:r.warnings,errors:r.errors}}function co(t,e){t.children&&(t.children=t.children.map(t=>co(t,e)));const n=t.effects,r="string"==typeof t.id?t.id:void 0,o=r?e.contentRefInnerIds.get(r):void 0;if(!n&&!o)return t;const{transformation:a,repeater:i,maskedBy:s,clipPath:l,trimPath:u,clone:c,fillGradient:f,strokeGradient:d,textPath:h,text:p}=null!=n?n:{};null==n||n.isCombinedShape;n&&delete t.effects;let m=t,y=!1;if(null==p?void 0:p.useGlyphs)if(h){const t="string"==typeof h.path?h.path:void 0,n=function(t,e,n,r,o,a){return e.glyphs?Dr(t,n,r,{glyphs:e.glyphs,warnings:e.warnings},o,a):(e.warnings.push("textGlyphs: no definitions.glyphs"),null)}(m,e,t,h.startOffset,h.textLength,h.pathOverflow);n&&(m=n,y=!0)}else m=function(t,e,n){return(null==e?void 0:e.useGlyphs)?n.glyphs?Er(t,{glyphs:n.glyphs,warnings:n.warnings}):(n.warnings.push("textGlyphs: no definitions.glyphs — left as native <text>"),t):t}(m,p,e),y=!0;return y||(m=function(t,e,n){var r;if(!e||"string"!=typeof e.path||!e.path)return t;const o=En(n,"tpath"),{d:a,startShift:i}=gr(e.path,{pathOverflow:e.pathOverflow,startOffset:e.startOffset,textLength:e.textLength,advance:pr(t)});n.defs.push({type:"path",id:o,d:a});const s={type:"textPath",href:"#"+o,children:null!=(r=t.children)?r:[]};return void 0!==e.lengthAdjust&&(s.lengthAdjust=e.lengthAdjust),void 0!==e.method&&(s.method=e.method),void 0!==e.spacing&&(s.spacing=e.spacing),vr(s,"startOffset",yr(e.startOffset,i)),vr(s,"textLength",e.textLength),t.children=[s],t}(m,h,e)),m=function(t,e,n){return Dn(t,e,n,"fill")}(m,f,e),m=function(t,e,n){return Dn(t,e,n,"stroke")}(m,d,e),m=Kr(m,u,0,e),m=function(t,e,n){var r,o;if(!e)return t;const a=null!=(r=e.copies)?r:1;if(a<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const i=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=Ln(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate),delete l.id;const u=[l];for(let t=1;t<a;t++){const r=Ln(l),o=er(e,t),a=o?Pn(r,o,n):r;u.push(a)}const c={type:"g",children:u};return t.id&&(c.id=t.id),void 0!==i&&(c.transform=i),void 0!==s&&(c.animate={transform:s}),c}(m,i,e),m=Bn(m,s,a,e),m=function(t,e,n){if(!e||!e.d&&!e.animate)return t;const r=En(n,"clip"),o={type:"path",d:e.d};return e.animate&&(o.animate={d:e.animate}),n.defs.push({type:"clipPath",id:r,children:[o]}),t.clipPath="url(#"+r+")",t}(m,l,e),o?(tr(m,c,e),m=In(m,a,r,o,e)):m=function(t,e,n,r){return tr(t,e,r),Pn(t,n,r)}(m,c,a,e),(null==c?void 0:c.retime)&&(t.effects={clone:{retime:c.retime}}),r&&e.idMap.set(r,m),m}function fo(t,e,n){var r,o;let a=uo(t).root;return a=ln(a,null!=(o=null==(r=Tt(a))?void 0:r.duration)?o:1e3),e===W.webapi&&(a=Ye(a,null==n?void 0:n.motionPath),a=vn(a),a=function(t){const e=t=>t.startsWith("#")?t.slice(1):t,n=(t,e)=>{var r;e(t),null==(r=t.children)||r.forEach(t=>n(t,e))};let r=!0;for(;r;){r=!1;const o=new Set;n(t,t=>{"use"===t.type&&"string"==typeof t.href&&o.add(e(t.href))}),n(t,t=>{if(!t.children)return;let e=t.children;"defs"===t.type&&(e=e.filter(t=>!(("g"===t.type||"symbol"===t.type)&&"string"==typeof t.id&&!o.has(t.id)))),e=e.filter(t=>!("defs"===t.type&&(!t.children||0===t.children.length))),e.length!==t.children.length&&(t.children=e,r=!0)})}return t}(a)),a}function ho(t){const e=globalThis;"function"!=typeof e.cancelAnimationFrame?e.clearTimeout(t):e.cancelAnimationFrame(t)}function po(t,e,n){var r;const o=Tt(t)||{},a=fn(t,W.frames),i=o.iterations;let s=1;"number"==typeof i&&(s=i||1),"infinite"===i&&(s=1/0),s<1&&(s=1);const l=+(o.duration||1e3),u=l&&s?l*(s===1/0?1/0:s):l?(null!=s?s:1)*l:0,c=o.direction||"normal",f=null!=(r=o.fill)?r:"forwards",d="forwards"===f||"both"===f,h="backwards"===f||"both"===f;let p=null,m=!1,y=-(o.delay||0),g=0,v=1,b=!1;const k=o.frameRate,A=k&&k>0?1e3/k:0;let w=0;const x=()=>{const t=g?(Date.now()-g)*v:0;return y+t},j=()=>{let t=x();return Number.isFinite(u)&&t>u&&(t=u),t<0&&(t=0),t};function O(t){let n=function(){const e=l>0?l:1;let n=0,r=0;if(l>0){t=se(t,0,s*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,s-1);n=se((t-r*e)/e,0,1)}else n=t;const o=c||"normal";let a=n;return"reverse"===o?a=1-n:"alternate"===o?r%2==1&&(a=1-n):"alternate-reverse"===o&&r%2==0&&(a=1-n),a}();for(const t of a||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=hn(r,n*l);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}o.delay&&(o.delay<0?O(j()):h&&O(0));const S=()=>!!m&&(!!e.isConnected()&&(v<0?x()>0:!(Number.isFinite(u)&&j()>=u))),P=t=>{null!==p&&(ho(p),p=null),(t||S())&&(p=function(t){const e=globalThis;return"function"==typeof e.requestAnimationFrame?e.requestAnimationFrame(t):e.setTimeout(t,16)}(()=>{p=null,(()=>{var t,r;if(!e.isConnected())return void M();const o=j(),a=x();if(a<0&&v>0)h&&O(0);else{if(v<0&&a<=0)return M(),O(0),void(b||(b=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)));if(v>0&&u&&Number.isFinite(u)&&o>=u)return M(),O(d?u:0),void(b||(b=!0,null==(r=null==n?void 0:n.onFinish)||r.call(n)));if(A>0){const t=Date.now();if(w&&t-w<A)return;w=t}O(o)}})(),P()}))},M=()=>{if(!m)return;let t=x();Number.isFinite(u)&&t>u&&(t=u),y=t,g=0,m=!1,null!==p&&(ho(p),p=null),t>=0?O(t):h&&O(0)},_={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>S(),play:()=>{var t;(()=>{if(!m){if(v>=0)Number.isFinite(u)&&y>=u&&(y=0);else if(y<=0){if(!Number.isFinite(u))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");y=u}b=!1,m=!0,g=Date.now(),P(!0)}})(),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;M(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;M(),y=0,g=0,m=!1,b=!1,O(y),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;y=Number.isFinite(u)?u:j(),g=0,m=!1,null!==p&&(ho(p),p=null),O(d?y:0),t&&!b&&(b=!0,null==(e=null==n?void 0:n.onFinish)||e.call(n))})(!0)},setPlaybackRate:t=>{if(!isFinite(t)||0===t)return void console.warn("setPlaybackRate: rate must be finite and non-zero");let e=x();Number.isFinite(u)&&e>u&&(e=u),t<0!=v<0&&(b=!1),v=t,y=e,m&&(g=Date.now())},getCurrentTime:()=>j(),setCurrentTime:t=>{t<0&&(t=0),Number.isFinite(u)&&t>u&&(t=u),y=t,m&&(g=Date.now()),(!Number.isFinite(u)||t<u)&&(b=!1),O(j())},destroy:()=>{var t;_.cancel(),null==(t=null==n?void 0:n.onRemove)||t.call(n)}};return _}var mo=[1,0,0,1,0,0];function yo(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}var go=(t,e)=>[1,0,0,1,t,e],vo=(t,e)=>[t,0,0,e,0,0];function bo(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var ko=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],Ao=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function wo(t){let e=mo;t.translate&&(e=yo(e,go(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=yo(e,go(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=yo(e,bo(t.rotate))),t.scale&&(e=yo(e,vo(t.scale[0],t.scale[1]))),n&&(e=yo(e,go(-t.origin[0],-t.origin[1]))),e}function xo(t,e,n){return t+(e-t)*n}function jo(t,e){return null==t?mo:"string"==typeof t?function(t){let e=mo;const n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);){const t=r[1],n=r[2].split(/[\s,]+/).filter(Boolean).map(Number);"translate"===t?e=yo(e,go(n[0]||0,n[1]||0)):"scale"===t?e=yo(e,vo(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=yo(e,bo(n[0])):"skewX"===t?e=yo(e,ko(n[0])):"skewY"===t?e=yo(e,Ao(n[0])):"matrix"===t&&(e=yo(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?wo(function(t,e){var n,r,o,a,i,s,l;if(!t.length)return{};if(e<=(null!=(n=t[0].time)?n:0))return t[0].value||{};if(e>=(null!=(r=t[t.length-1].time)?r:0))return t[t.length-1].value||{};let u=0;for(;u<t.length-1&&(null!=(o=t[u+1].time)?o:0)<e;)u++;const c=t[u],f=t[u+1],d=(e-(null!=(a=c.time)?a:0))/((null!=(i=f.time)?i:0)-(null!=(s=c.time)?s:0)||1),h=c.value||{},p=f.value||{},m={};return h.translate&&p.translate?m.translate=[xo(h.translate[0],p.translate[0],d),xo(h.translate[1],p.translate[1],d)]:m.translate=h.translate||p.translate,void 0!==h.rotate&&void 0!==p.rotate?m.rotate=xo(h.rotate,p.rotate,d):m.rotate=null!=(l=h.rotate)?l:p.rotate,h.scale&&p.scale?m.scale=[xo(h.scale[0],p.scale[0],d),xo(h.scale[1],p.scale[1],d)]:m.scale=h.scale||p.scale,m.origin=h.origin||p.origin,m}(t.keyframes,e)):t.value?wo(t.value):mo}var Oo=new Set(["svg","g","symbol"]),So=new Set(["defs","mask","clipPath","title"]);function Po(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Po(t,e))}function Mo(t){return null==t?0:Number(t)}function _o(t){return Math.round(100*t)/100+0}function zo(t,e,n){var r,o,a,i,s;const l=null!=(r=t.fill)?r:"",u=null!=(o=t.stroke)?o:"",c=null!=(i=null!=(a=t["stroke-width"])?a:t.strokeWidth)?i:"",f=_o(function(t,e,n,r){var o,a,i,s,l,u;if(t&&t.keyframes&&t.keyframes.length){const e=t.keyframes;if(r<=(null!=(o=e[0].time)?o:0))return e[0].value;if(r>=(null!=(a=e[e.length-1].time)?a:0))return e[e.length-1].value;let n=0;for(;n<e.length-1&&(null!=(i=e[n+1].time)?i:0)<r;)n++;const c=e[n],f=e[n+1],d=(r-(null!=(s=c.time)?s:0))/((null!=(l=f.time)?l:0)-(null!=(u=c.time)?u:0)||1);return xo(c.value,f.value,d)}return void 0!==e?Number(e):n}(null==(s=t.animate)?void 0:s.opacity,t.opacity,1,n)),d=t.mask?1:0,h=e.map(_o).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return Mo(t.width)+","+Mo(t.height)+","+Mo(t.x)+","+Mo(t.y);case"ellipse":return Mo(t.rx)+","+Mo(t.ry)+","+Mo(t.cx)+","+Mo(t.cy);case"circle":return Mo(t.r)+","+Mo(t.cx)+","+Mo(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+h+"]|f:"+l+"|s:"+u+"|sw:"+(Mo(c)||"")+"|o:"+f+"|m:"+d}function Io(t,e,n,r,o){var a;const i=t.type||"";if(So.has(i))return;const s=yo(e,function(t,e){return t.animate&&t.animate.transform?jo(t.animate.transform,e):void 0!==t.transform?jo(t.transform,e):mo}(t,n));if("use"===i){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",a=r.get(e),i=yo(s,go(Mo(t.x),Mo(t.y)));return void(a?Io(a,i,n,r,o):o.push("UNRESOLVED_USE:#"+e))}Oo.has(i)?null==(a=t.children)||a.forEach(t=>Io(t,s,n,r,o)):o.push(zo(t,s,n))}function No(t,e){var n;e.add(0);(t=>{var n;if(t&&"object"==typeof t)for(const r of Object.keys(t)){const o=null==(n=t[r])?void 0:n.keyframes;Array.isArray(o)&&o.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)})}})(t.animate),t.transform&&"object"==typeof t.transform&&t.transform.keyframes&&t.transform.keyframes.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)}),null==(n=t.children)||n.forEach(t=>No(t,e))}function Co(t,e){const n=new Map;Po(t,n);const r=[];return Io(t,mo,e,n,r),r.sort()}function Eo(t,e){const n=new Set;No(t,n),No(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=Co(t,o),a=Co(e,o),i=To(n,a),s=To(a,n);(i.length||s.length)&&r.push({time:o,onlyInA:i,onlyInB:s})}return r}function To(t,e){const n=new Map;for(const t of e)n.set(t,(n.get(t)||0)+1);const r=[];for(const e of t){const t=n.get(e)||0;t>0?n.set(e,t-1):r.push(e)}return r}function Fo(t,e){if(!t)return null;const n=t,{type:i,children:s,style:l}=n,u=((t,e)=>{var n={};for(var i in t)o.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&r)for(var i of r(t))e.indexOf(i)<0&&a.call(t,i)&&(n[i]=t[i]);return n})(n,["type","children","style"]),c=u.funcType;void 0!==c&&delete u.funcType;const f=Ft(t)||e,d=function(t,e){var n;if(t)return"string"==typeof t?null==(n=null==e?void 0:e.styles)?void 0:n[t]:t}(l,f);let h;if(s)for(const t of s){const e=Fo(t,f);e&&(h||(h=[]),h.push(e))}const p=function(t,e,n,r,o){if(be.has(t.toLowerCase()))return console.warn("SVG tag blocked (dangerous): ",t),null;const a=document.createElementNS("http://www.w3.org/2000/svg",t);for(const t in e){const n=Pe(t,e[t]);void 0!==n&&(we.has(t)?a.style[t]=String(n):a.setAttribute(ie(t),n))}if(n)for(const t in n)a.style[t]=String(n[t]);if(r)for(const t of r)a.appendChild(t);return o&&(a.textContent=o),a}(i||"g",Me(u),d,h,u[B]||u[q]);return p&&void 0!==c&&p.setAttribute("type",c),p}function Lo(t,e){const{startOn:n,outAction:r="continue",scrollIntoViewThreshold:o=0}=e,a=t.getRootElement();if(!a)return console.warn("setupAnimationTriggers: No root element found for animation."),t;let i=!1;const s=()=>{i&&(i=!1,t.setPlaybackRate(1)),t.play()},l=()=>{switch(r){case"pause":t.pause();break;case"reset":t.cancel();break;case"reverse":i=!0,t.setPlaybackRate(-1),t.play()}};switch(n){case"load":{const t=()=>s();"complete"===document.readyState?t():window.addEventListener("load",t,{once:!0});break}case"mouseOver":{const t=()=>s(),e=()=>l();a.addEventListener("mouseenter",t),a.addEventListener("mouseleave",e);break}case"click":{const e=()=>{t.isPlaying()?l():s()};a.addEventListener("click",e);break}case"scrollIntoView":new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&t.intersectionRatio>=o?s():l()})},{threshold:o}).observe(a);break}return t}function Do(t){return"#"+t}function Uo(t,e,n,r){const o=Tt(t)||{};if(!r)if(t.id){const e=Do(t.id);(r=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");const a=po(t,e||function(t){const e=new Set,n={isConnected:()=>!t||t.isConnected,setAttribute:(n,r,o)=>{r=ie(r);const a=Do(n),i=(null==t?void 0:t.querySelectorAll(a))||document.querySelectorAll(a);0!==i.length||e.has(a)||(e.add(a),console.warn('setAttribute: No elements found for selector "'+a+'"'));for(let t=0;t<i.length;t++){const e=i[t],n="transform"===r&&"pattern"===e.tagName?"patternTransform":r;e.setAttribute(n,o),ne.has(r)&&(e.style[r]=o)}}};return n}(r),n),i=l(s({},a),{getRootElement:()=>r||null});return o.trigger&&Lo(i,o.trigger),i}function Vo(t,e,n,r){var o,a;let i=null!=(o=t.v)?o:t.value;const s=null!=(a=t.e)?a:t.easing,l={offset:e,easing:s&&Array.isArray(s)?"cubic-bezier("+s.join(",")+")":void 0};let u,c=n;if(Ht.has(n)&&Array.isArray(i))u=Qt(i);else if("transform"!==n||null===i||"object"!=typeof i||Array.isArray(i))if($t.has(n))Array.isArray(i)&&("translate"===n&&(i=i.map(t=>t+"px")),i=i.join(",")),"rotate"===n&&(i+="deg"),u=n+"("+i+")",c="transform";else if("d"===n){u='path("'+(i&&"object"==typeof i&&Array.isArray(i.paths)?i.paths:[]).map(t=>Ut(t,!0)).join("")+'")'}else u=""+i;else u=ee(i,{withUnits:!0}),c="transform";return CSS.supports(c,u)||r.add(c),c=re(c),l[c]=u,l}function Ro(t,e,n){var r,o,a,i,u;const c=[];for(let f=0;f<e.length;f++){const d=e[f],h=null!=(r=d.t)?r:0;if(h<0){const n=e[f+1];if(n&&(null!=(o=n.t)?o:0)>=0){const e=(0-h)/((null!=(a=n.t)?a:0)-h),r=d.e?Zt(d.e)(e):e,{right:o}=Xt(d.e,e);c.push({t:0,v:rn(t,d.v,n.v,r),e:o})}continue}if(h>n){const r=e[f-1];if(r&&(null!=(i=r.t)?i:0)<=n){const e=null!=(u=r.t)?u:0,o=(n-e)/(h-e),a=r.e?Zt(r.e)(o):o,{left:i}=Xt(r.e,o);c.length>0&&(c[c.length-1]=l(s({},c[c.length-1]),{e:i})),c.push({t:n,v:rn(t,r.v,d.v,a),e:void 0})}break}c.push(d)}return c}function Wo(t,e,n){var r;const o=new Map;for(const[a,i]of Object.entries(t)){const t=n.duration||1,u=Ro(a,i.kfs||i.keyframes||[],t),c=[];for(let n=0;n<u.length;n++){const o=u[n],i=Vo(o,se((null!=(r=o.t)?r:0)/t,0,1),a,e);0===n&&(i.offset||0)>0&&c.push(l(s({},i),{offset:0})),c.push(i)}c.length>0&&(c[c.length-1].offset||0)<1&&c.push(l(s({},c[c.length-1]),{offset:1})),c.length>0&&o.set(a,c)}return o}function Bo(t,e,n,r){var o;const a=Tt(t)||{};if(!n)if(t.id){const e=Do(t.id);(n=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");const i=fn(t,W.webapi),s=[],l=a.iterations;let u;"number"==typeof l&&(u=l),"infinite"===l&&(u=1/0);const c=new Set;let f=!1,d=!1;(null==i?void 0:i.length)||console.warn("createWebApiAnimator: No animation bindings defined");for(const t of i||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("createWebApiAnimator: Empty or unresolved binding",t);continue}const i=Do(t.id),l=(null==n?void 0:n.querySelectorAll(i))||document.querySelectorAll(i);0===l.length&&console.warn('createWebApiAnimator: No elements found for selector "'+i+'"');const h=Wo(r,c,a),p=a.delay&&a.delay>0?a.delay:void 0;let m;if(a.delay&&a.delay<0&&a.duration){const t=-a.delay;m=u===1/0?t%a.duration:Math.min(t,a.duration*(null!=u?u:1))}const y={duration:a.duration,delay:p,fill:null!=(o=a.fill)?o:"forwards",direction:a.direction,iterations:u};for(let t=0;t<l.length;t++){const n=l[t];for(const[,t]of h)if(t.length>0)try{const r=new KeyframeEffect(n,t,y),o=new Animation(r,document.timeline);(null==e?void 0:e.onFinish)&&(o.onfinish=()=>{var t;f||(f=!0,null==(t=e.onFinish)||t.call(e))}),(null==e?void 0:e.onRemove)&&(o.onremove=()=>{var t;d||(d=!0,null==(t=e.onRemove)||t.call(e))}),void 0!==m&&(o.currentTime=m),s.push(o)}catch(t){console.warn(t)}}}if(!r&&c.size)return console.warn("Unsupported CSS attrs: "+[...c].join(", ")),null;const h={isReady:()=>!0,getRootElement:()=>n||null,isPlaying:()=>{var t;return"running"===(null==(t=s[0])?void 0:t.playState)},play:()=>{var t;f=!1,s.forEach(t=>t.play()),null==(t=null==e?void 0:e.onPlay)||t.call(e)},pause:()=>{var t;s.forEach(t=>t.pause()),null==(t=null==e?void 0:e.onPause)||t.call(e)},cancel:()=>{var t;f=!1,s.forEach(t=>t.cancel()),null==(t=null==e?void 0:e.onCancel)||t.call(e)},finish:()=>{var t;for(const e of s)try{(null==(t=e.effect)?void 0:t.getTiming().iterations)===1/0?(e.effect.updateTiming({iterations:1}),e.finish(),e.effect.updateTiming({iterations:1/0})):e.finish()}catch(t){e.cancel()}},setPlaybackRate:t=>(s.forEach(e=>e.playbackRate=t),h),getCurrentTime:()=>{var t,e;const n=null!=(e=null==(t=s[0])?void 0:t.currentTime)?e:null;return null!==n?+n:null},setCurrentTime:t=>{f=!1,s.forEach(e=>{e.currentTime=t})},destroy:()=>{var t;h.cancel(),s.splice(0,s.length),d||(d=!0,null==(t=null==e?void 0:e.onRemove)||t.call(e))}};return a.trigger&&Lo(h,a.trigger),h}function qo(t,e,n,r){const o=Pt(t);for(const t of o)console.warn("[PxAnimator] effects shape warning:",t);t=fo(t,(Tt(t)||{}).mode===R.frames?W.frames:W.webapi);let a=null;if(r){t=ge(t);const e="string"==typeof r?document.querySelector(r):r;e&&(a=Fo(t),a&&e.replaceChildren(a))}return function(t,e,n,r){const o=Tt(t)||{};let a,i,u=n;return o.resetOnFinish&&(u=l(s({},n),{onFinish:()=>{var t;null==(t=null==n?void 0:n.onFinish)||t.call(n),null==a||a.cancel()}})),i=o.mode===R.frames?Uo(t,e,u,r):Bo(t,u,r,o.mode===R.webapi)||Uo(t,e,u,r),a=i,o.debugInstName&&(window[o.debugInstName]=i),i}(t,e,n,a)}var Go="data";function Zo(t){const{src:e,data:n,adapter:r,callbacks:o,container:a}=t;if(void 0!==n&&void 0!==e)throw new Error("createAnimator: provide either `src` or `data`, not both");if(void 0===n&&void 0===e)throw new Error("createAnimator: either `src` or `data` is required");if(void 0!==n)return qo(n,r,o,a);let i=null,s=[],l=!1;const u=t=>{i?t(i):s&&s.push(t)};return fetch(e).then(t=>t.json()).then(t=>{if(!l)if(Ct(t)){i=qo(t,r,o,a);const e=s;s=null,null==e||e.forEach(t=>t(i))}else console.error('createAnimator: invalid animation document format at "'+e+'"')}).catch(t=>{s=null,console.error('createAnimator: failed to load "'+e+'"',t)}),{isReady:()=>!!i,getRootElement:()=>i?i.getRootElement():null,isPlaying:()=>(null==i?void 0:i.isPlaying())||!1,play:()=>{u(t=>t.play())},pause:()=>{u(t=>t.pause())},cancel:()=>{u(t=>t.cancel())},finish:()=>{u(t=>t.finish())},setPlaybackRate:t=>{u(e=>e.setPlaybackRate(t))},getCurrentTime:()=>i?i.getCurrentTime():null,setCurrentTime:t=>{u(e=>e.setCurrentTime(t))},destroy:()=>{l=!0,s=null,null==i||i.destroy()}}}function Ko(){const t=document.querySelectorAll("["+U+"]");for(let e=0;e<t.length;e++){const n=t[e];if(!n[V]){const t=n.getAttribute(U);t&&(n[V]=Zo({src:t,container:n}))}}}"undefined"!=typeof window&&(window.loadTagAnimators=Ko,window.createAnimator=Zo,window.setupAnimationTriggers=Lo);export{Ht as COLOUR_ATTR_NAMES,Go as PX_ANIMATOR_DATA_KEY,V as PX_ANIM_ATTR_NAME,U as PX_ANIM_SRC_ATTR_NAME,Q as PX_TRANSFORM_PART_KEYS,It as PxAnimatedSvgDocumentSchema,$ as PxAnimationDefinitionSchema,at as PxAnimatorConfigSchema,W as PxAnimatorEngine,R as PxAnimatorMode,st as PxAttrValueSchema,Nt as PxBezierPathSchema,it as PxBindingSchema,yt as PxCloneEffectSchema,ot as PxDefsSchema,Z as PxEasingOrRefSchema,St as PxEffectsSchema,tt as PxElementAnimationSchema,wt as PxFillGradientEffectSchema,vt as PxGradientSpreadMethod,kt as PxGradientStopSchema,bt as PxGradientType,gt as PxGradientUnits,K as PxKeyframeSchema,X as PxLoopSchema,dt as PxMaskedByEffectSchema,Mt as PxNodeBase,_t as PxNodeSchema,Y as PxPropertyAnimationSchema,ft as PxRepeaterEffectSchema,mt as PxRetimeEffectSchema,xt as PxStrokeGradientEffectSchema,zt as PxSvgNodeExtra,Ot as PxTextEffectSchema,jt as PxTextPathEffectSchema,J as PxTransformPartsSchema,H as PxTransformValueSchema,ct as PxTransformationEffectSchema,et as PxTriggerSchema,pt as PxTrimPathEffectSchema,ne as STYLE_ATTR_NAMES,$t as TRANSFORM_FN_NAMES,uo as applyPlayerEffects,hn as calcAnimationValues,ie as camelCaseToKebabWordIfNeeded,No as collectSampleTimes,Zo as createAnimator,qo as createAnimatorImpl,po as createBasicFrameLoopAnimator,Uo as createFrameLoopAnimator,dr as createPathSampler,Bo as createWebApiAnimator,L as describeSchema,Eo as diffInEffect,Te as evaluateMotionPathSegment,gr as extendedPathForBrowser,ge as generateNewIds,Tt as getAnimatorConfig,Lt as getBindings,Dt as getChildren,Ft as getDefs,Me as getNormalizedProps,Ct as isPxElementFileFormat,Et as isPxElementFileFormatDeep,br as jsonElementFactory,Tr as layoutGlyphTextChars,Ko as loadTagAnimators,fo as materialiseAllInTree,vn as materialiseAnimatedUseInstances,Zr as materialiseGlyphText,Dr as materialiseGlyphTextAlongPath,Er as materialiseGlyphTextHorizontal,sn as materialiseInternalLoopsInPropAnim,ln as materialiseInternalLoopsInTree,Fe as materialiseMotionPathInPropAnim,Ye as materialiseMotionPathsInTree,fn as normalizeDocument,Ne as propAnimIsMotionPath,D as px,Fo as renderNode,F as schemaKeys,Lo as setupAnimationTriggers,yr as shiftAnimatable,Qt as toRGBA,Pt as validateNodeEffects,Co as visualModelAt};
1
+ var t=Object.defineProperty,e=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,s=(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},l=(t,r)=>e(t,n(r)),u=Object.defineProperty,c=Object.defineProperties,f=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,m=Math.pow,g=(t,e,n)=>e in t?u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,v=(t,e)=>{for(var n in e||(e={}))h.call(e,n)&&g(t,n,e[n]);if(d)for(var n of d(e))p.call(e,n)&&g(t,n,e[n]);return t},y=(t,e)=>c(t,f(e));function b(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var k=class{_canSanitize(t){return this.isValid(t)}optional(){return new A(this)}},A=class extends k{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)}},w=class extends k{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(b(null!=n?n:[])+": expected string, got "+typeof t),!1)}},x=class extends k{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(b(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},j=class extends k{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(b(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},O=class extends k{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(b(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},S=class extends k{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(b(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},P=class extends k{constructor(t,e){super(),this.schemas=t,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;return!!this.schemas.some(e=>e.isValid(t))||(null==e||e.errors.push(b(null!=n?n:[])+": no union member matched for value "+(null!=(r=JSON.stringify(t))?r:"").slice(0,60)),!1)}_canSanitize(t){return this.schemas.some(e=>e._canSanitize(t))}},M=class extends k{constructor(t,e,n){super(),this._key=t,this._schemas=e,this._default=null!=n?n:e[0]._default,this._map=new Map;for(const n of e){const e=n._shape[t];e&&this._map.set(e._default,n)}}_findSchema(t){if(null===t||"object"!=typeof t||Array.isArray(t))return;const e=t[this._key];return null!=e?this._map.get(e):void 0}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(b(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)}},_=class extends k{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))n[t]=this._shape[t].sanitize(e[t]);return n}isValid(t,e,n){if(!t||"object"!=typeof t||Array.isArray(t))return null==e||e.errors.push(b(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||(o.push(t),e.errors.push(b(o)+": unexpected extra key"),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},z=class extends k{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=v({},e);for(const t of Object.keys(this._shape))n[t]=this._shape[t].sanitize(e[t]);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(b(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)}},I=class extends k{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(b(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)}},N=class extends k{constructor(t){super(),this.value=t,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(b(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)}},C=class extends k{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},E=class extends k{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)}},T=class extends k{constructor(t){super(),this.schemas=t,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(b(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 F(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function L(t){var e;const n=t;return"_shape"in n?{kind:"shape",shape:n._shape}:"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.fn()}:{kind:"leaf"}}var D={string:(t="")=>new w(t),number:(t=0)=>new x(t),boolean:(t=!1)=>new j(t),literal:t=>new O(t),enum:(t,e)=>new S(t,e),union:(t,e)=>new P(t,e),discriminatedUnion:(t,e)=>new M(t,e),object:t=>new _(t),openObject:(t,e)=>new z(t,e),extendedObject:(t,e)=>new _(v(v({},t._shape),e)),array:t=>new I(t),record:t=>new N(t),any:()=>new C,tuple:t=>new T(t),lazy:(t,e)=>new E(t,e)},U="data-px-animation-src",R="_px_animator",V={auto:"auto",webapi:"webapi",frames:"frames"},W={webapi:V.webapi,frames:V.frames},B="text",q="textContent",G=new Set(["type","children","animator","meta","animate",B,q]),Z=D.union([D.string(),D.tuple([D.number(),D.number(),D.number(),D.number()])]),K=(D.union([D.string(),D.number(),D.array(D.number()),D.lazy(()=>J,{}),D.object({path:D.string()}),D.lazy(()=>D.object({paths:D.array(Ct)}),{paths:[]})]),D.object({time:D.number().optional(),t:D.number().optional(),value:D.any().optional(),v:D.any().optional(),easing:Z.optional(),e:Z.optional(),tangentOut:D.tuple([D.number(),D.number()]).optional(),to:D.tuple([D.number(),D.number()]).optional(),tangentIn:D.tuple([D.number(),D.number()]).optional(),ti:D.tuple([D.number(),D.number()]).optional(),selected:D.boolean().optional()})),X=D.object({segmentCount:D.number().optional(),before:D.boolean().optional(),alternate:D.boolean().optional()}),Y=D.object({keyframes:D.array(K).optional(),kfs:D.array(K).optional(),loop:D.union([X,D.boolean()]).optional(),autoOrient:D.boolean().optional()}),Q=["translate","rotate","scale","origin"],J=D.object({translate:D.tuple([D.number(),D.number()]).optional(),rotate:D.number().optional(),skew:D.number().optional(),scale:D.tuple([D.number(),D.number()]).optional(),origin:D.tuple([D.number(),D.number()]).optional()}),H=D.union([D.string(),D.object({value:J}),Y]),$=D.record(Y),tt=D.union([D.string(),D.array(D.union([D.string(),$])),$]),et=D.object({startOn:D.enum(["load","mouseOver","click","scrollIntoView","programmatic"]).optional(),outAction:D.enum(["continue","pause","reset","reverse"]).optional(),scrollIntoViewThreshold:D.number().optional()}),nt=D.object({width:D.number(),d:D.string()}),rt=D.object({fFamily:D.string(),style:D.string(),ascent:D.number(),unitsPerEm:D.number(),glyphs:D.record(nt)}),ot=D.object({easings:D.record(D.tuple([D.number(),D.number(),D.number(),D.number()])).optional(),animations:D.record($).optional(),styles:D.record(D.any()).optional(),glyphs:D.record(rt).optional()}),it=D.object({mode:D.enum([V.auto,V.webapi,V.frames]).optional(),duration:D.number().optional(),delay:D.number().optional(),iterations:D.union([D.number(),D.literal("infinite")]).optional(),fill:D.enum(["forwards","backwards","both","none"]).optional(),direction:D.enum(["normal","reverse","alternate","alternate-reverse"]).optional(),frameRate:D.number().optional(),trigger:et.optional(),resetOnFinish:D.boolean().optional(),definitions:ot.optional(),animate:D.record(tt).optional(),timeline:D.string().optional(),debug:D.boolean().optional(),debugInstName:D.string().optional()}),at=D.object({id:D.string(),animate:tt}),st=D.union([D.string(),D.number(),D.object({value:D.any()}),Y]),lt=D.union([D.number(),D.object({value:D.number()}),D.object({keyframes:D.array(K),autoOrient:D.boolean().optional()})]),ut=D.union([D.tuple([D.number(),D.number()]),D.object({value:D.tuple([D.number(),D.number()])}),D.object({keyframes:D.array(K),autoOrient:D.boolean().optional()})]),ct=D.object({translate:ut.optional(),rotate:lt.optional(),scale:ut.optional(),skew:lt.optional(),origin:ut.optional()}),ft=D.object({copies:D.number().optional(),translate:ut.optional(),rotate:lt.optional(),scale:ut.optional(),origin:ut.optional()}),dt=D.object({href:D.string().optional(),maskType:D.string().optional(),maskUnits:D.string().optional(),maskContentUnits:D.string().optional()}),ht=D.object({d:D.string().optional(),animate:Y.optional()}),pt=D.object({offset:lt.optional(),range:ut.optional(),trimAllAsOne:D.boolean().optional()}),mt=D.object({baseId:D.string().optional(),start:D.number().optional(),stretch:D.number().optional(),timeCrop:D.tuple([D.number(),D.number()]).optional()}),gt=D.object({type:D.string().optional(),baseId:D.string().optional(),retime:mt.optional()}),vt={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},yt={pad:"pad",reflect:"reflect",repeat:"repeat"},bt={linear:"linear",radial:"radial"},kt=D.object({offset:D.number(),color:D.string()}),At=D.union([D.array(kt),D.object({value:D.array(kt)}),D.object({keyframes:D.array(K)})]),wt=D.object({gradientX1:Y.optional(),gradientY1:Y.optional(),gradientX2:Y.optional(),gradientY2:Y.optional(),gradientCx:Y.optional(),gradientCy:Y.optional(),gradientFx:Y.optional(),gradientFy:Y.optional(),gradientR:Y.optional()}),xt=D.object({type:D.enum([bt.linear,bt.radial]),p1:D.tuple([D.number(),D.number()]).optional(),p2:D.tuple([D.number(),D.number()]).optional(),c:D.tuple([D.number(),D.number()]).optional(),r:D.number().optional(),fp:D.tuple([D.number(),D.number()]).optional(),stops:At.optional(),gradientUnits:D.string().optional(),spreadMethod:D.string().optional(),gradientTransform:D.string().optional(),animate:wt.optional()}),jt=xt,Ot=D.object({path:D.string(),pathOverflow:D.string().optional(),lengthAdjust:D.string().optional(),method:D.string().optional(),spacing:D.string().optional(),startOffset:lt.optional(),textLength:lt.optional()}),St=D.object({useGlyphs:D.boolean().optional()}),Pt=D.object({transformation:ct.optional(),repeater:ft.optional(),maskedBy:dt.optional(),clipPath:ht.optional(),trimPath:pt.optional(),clone:gt.optional(),isCombinedShape:D.boolean().optional(),fillGradient:xt.optional(),strokeGradient:jt.optional(),textPath:Ot.optional(),text:St.optional()});function Mt(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!Pt.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}var _t=D.openObject({type:D.string(),id:D.string().optional(),meta:D.any().optional(),effects:Pt.optional(),animate:tt.optional(),style:D.union([D.string(),D.record(D.union([D.string(),D.number()]))]).optional()},st),zt=D.openObject(y(v({},_t._shape),{children:D.lazy(()=>D.array(zt),[]).optional()}),st),It=D.object({width:D.number().optional(),height:D.number().optional(),viewBox:D.string().optional(),animator:it.optional()}),Nt=D.openObject(y(v(v({},_t._shape),It._shape),{type:D.literal("svg"),children:D.array(zt).optional()}),st),Ct=D.object({v:D.array(D.array(D.number())),i:D.array(D.array(D.number())).optional(),o:D.array(D.array(D.number())).optional(),c:D.boolean().optional()});function Et(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&("svg"===t.type||"svg"===t.tagName)}function Tt(t){const e=Nt.isValid(t);return{valid:e,errors:e?[]:["Document failed schema validation"]}}function Ft(t){var e,n;return(null==t?void 0:t.animator)||(null==(e=null==t?void 0:t.meta)?void 0:e.animator)||(null==t?void 0:t.animation)||(null==(n=null==t?void 0:t.meta)?void 0:n.animation)}function Lt(t){var e;if(t)return null==(e=Ft(t))?void 0:e.definitions}function Dt(t){var e;if(!t)return;const n=null==(e=Ft(t))?void 0:e.animate;return n?Object.entries(n).map(([t,e])=>({id:t,animate:e})):void 0}function Ut(t){return null==t?void 0:t.children}function Rt(t,e=!1){var n,r,o,i;const a=t.v,s=t.i,l=t.o,u=t.c;if(!a.length)return"";const c=[],f=a.length;c.push("M"+a[0][0]+","+a[0][1]);for(let t=1;t<f;t++){const o=a[t-1],i=null!=(n=null==l?void 0:l[t-1])?n:o,u=null!=(r=null==s?void 0:s[t])?r:a[t],f=a[t];!e&&i[0]===o[0]&&i[1]===o[1]&&u[0]===f[0]&&u[1]===f[1]?c.push("L"+f[0]+","+f[1]):c.push("C"+i[0]+","+i[1]+","+u[0]+","+u[1]+","+f[0]+","+f[1])}if(u&&f>0){const t=a[f-1],n=null!=(o=null==l?void 0:l[f-1])?o:t,r=null!=(i=null==s?void 0:s[0])?i:a[0],u=a[0];!e&&n[0]===t[0]&&n[1]===t[1]&&r[0]===u[0]&&r[1]===u[1]||c.push("C"+n[0]+","+n[1]+","+r[0]+","+r[1]+","+u[0]+","+u[1]),c.push("z")}return c.join("")}function Vt(t,e,n){return t+(e-t)*n}function Wt(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let i=0;i<o;i++)r[i]=Vt(t[i]||0,e[i]||0,n);return r}function Bt(t,e,n){return[Vt(t[0]||0,e[0]||0,n),Vt(t[1]||0,e[1]||0,n),Vt(t[2]||0,e[2]||0,n),Vt(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function qt(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++)o.push(Gt(t[i],e[i],n));return o}function Gt(t,e,n){var r,o,i,a,s,l,u,c,f;if(!t||!e)return t||e||{v:[]};const d=Math.min(Math.max(n,0),1),h=Math.min(t.v.length,e.v.length),p=[],m=[],g=[];for(let n=0;n<h;n++){const f=t.v[n],h=e.v[n];p.push(Wt(f,h,d));const v=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,y=null!=(a=null==(i=e.i)?void 0:i[n])?a:h;m.push(Wt(v,y,d));const b=null!=(l=null==(s=t.o)?void 0:s[n])?l:f,k=null!=(c=null==(u=e.o)?void 0:u[n])?c:h;g.push(Wt(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 Zt(t,e,n){if(n<=0)return 0;if(n>=1)return 1;const r=3*t,o=3*(e-t)-r,i=1-r-o;function a(t){return((i*t+o)*t+r)*t}function s(t){return(3*i*t+2*o)*t+r}let l=n,u=0,c=1;for(let t=0;t<8;t++){const t=a(l)-n;if(Math.abs(t)<1e-6)return l;const e=s(l);if(Math.abs(e)<1e-6)break;l-=t/e}for(l=n;u<c;){const t=a(l);if(Math.abs(t-n)<1e-6)return l;n>t?u=l:c=l,l=(c+u)/2}return l}function Kt(t){const[e,n,r,o]=t,i=3*n,a=3*(o-n)-i,s=1-i-a;return function(t){return n=Zt(e,r,t),((s*n+a)*n+i)*n;var n}}function Xt(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Yt(t,e){if(!t)return{left:void 0,right:void 0};if(e<=0)return{left:void 0,right:t};if(e>=1)return{left:t,right:void 0};const[n,r,o,i]=t,a=Zt(n,o,e),s=[n,r],l=[o,i],{left:u,right:c}=function(t,e,n,r,o){const i=Xt(t,e,o),a=Xt(e,n,o),s=Xt(n,r,o),l=Xt(i,a,o),u=Xt(a,s,o),c=Xt(l,u,o);return{left:[t,i,l,c],right:[c,u,s,r]}}([0,0],s,l,[1,1],a),f=u[3][0],d=u[3][1];let h,p;f>1e-9&&Math.abs(d)>1e-9&&(h=[u[1][0]/f,u[1][1]/d,u[2][0]/f,u[2][1]/d]);const m=1-f,g=1-d;return m>1e-9&&Math.abs(g)>1e-9&&(p=[(c[1][0]-f)/m,(c[1][1]-d)/g,(c[2][0]-f)/m,(c[2][1]-d)/g]),{left:h,right:p}}function Qt(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function Jt(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 Ht(t){if(t){if(Array.isArray(t))return t;if("string"==typeof t)return t.startsWith("#")?function(t){const e=t.slice(1),n=e.length<=4,r=n?e[0]+e[0]:e.slice(0,2),o=n?e[1]+e[1]:e.slice(2,4),i=n?e[2]+e[2]:e.slice(4,6),a=4===e.length?e[3]+e[3]:8===e.length?e.slice(6,8):null,s=[parseInt(r,16)/255,parseInt(o,16)/255,parseInt(i,16)/255];return null!==a&&s.push(parseInt(a,16)/255),s}(t):t.startsWith("rgb")?function(t){var e;const n=null==(e=t.match(/rgba?\((.*)\)/))?void 0:e[1];if(!n)throw new Error("Invalid rgb/rgba format");const r=n.split(",").map(t=>+t.trim());return[r[0]/255,r[1]/255,r[2]/255,...void 0!==r[3]?[r[3]]:[]]}(t):void console.warn("Unsupported color format: "+t)}}var $t=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),te=new Set(["translate","rotate","scale","skew"]),ee=new Set(["offset-distance","offsetDistance"]);function ne(t,e){var n;if(!t)return"";const r=null==(n=null==e?void 0:e.withUnits)||n,o=[],i=t.translate,a=t.origin,s=t.rotate,l=t.skew,u=t.scale,c=r?"px":"",f=r?"deg":"";return i&&o.push("translate("+i[0]+c+","+i[1]+c+")"),a&&o.push("translate("+a[0]+c+","+a[1]+c+")"),null!=s&&o.push("rotate("+s+f+")"),null!=l&&o.push("skewX("+l+f+")"),u&&o.push("scale("+u[0]+","+u[1]+")"),a&&o.push("translate("+-a[0]+c+","+-a[1]+c+")"),o.join("")}var re=new Set(["offset-distance","offsetDistance"]);function oe(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function ie(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var ae=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 se(t){return ae.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function le(t,e,n){return Math.max(e,Math.min(t,n))}function ue(t,e,n,r,o){if(o<=0)return[t[0],t[1]];if(o>=1)return[r[0],r[1]];const i=1-o,a=i*i,s=o*o,l=a*i,u=3*o*a,c=3*s*i,f=s*o;return[l*t[0]+u*e[0]+c*n[0]+f*r[0],l*t[1]+u*e[1]+c*n[1]+f*r[1]]}var ce=1e-4;function fe(t,e,n,r,o){const i=de(t,e,n,r,o);if(0===i[0]&&0===i[1]){return de(t,e,n,r,o<.5?o+ce:o-ce)}return i}function de(t,e,n,r,o){const i=1-o,a=3*i*i,s=6*o*i,l=3*o*o;return[a*(e[0]-t[0])+s*(n[0]-e[0])+l*(r[0]-n[0]),a*(e[1]-t[1])+s*(n[1]-e[1])+l*(r[1]-n[1])]}function he(t,e,n,r,o=100){const i=o+1,a=new Float64Array(i),s=new Float64Array(i);let l=ue(t,e,n,r,0);a[0]=0,s[0]=0;let u=0;for(let c=1;c<i;c++){const i=c/o,f=ue(t,e,n,r,i),d=f[0]-l[0],h=f[1]-l[1];u+=Math.sqrt(d*d+h*h),a[c]=i,s[c]=u,l=f}return{ts:a,ds:s}}function pe(t,e){const{ts:n,ds:r}=t,o=n.length-1;if(e<=n[0])return r[0];if(e>=n[o])return r[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;n[t]<e?i=t+1:a=t}const s=n[a-1],l=n[a]-s,u=l>0?(e-s)/l:0;return r[a-1]+u*(r[a]-r[a-1])}var me=0;function ge(){return"_px_"+Date.now().toString(36)+(++me).toString(36)+Math.random().toString(36).substring(2,6)}function ve(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>ve(t));const e=t,n={};for(const t of Object.keys(e))n[t]=ve(e[t]);return n}function ye(t){var e,n;const r=ve(t),o=new Map,i=new Set(["href","xlink:href"]),a=new Set(["fill","stroke","clip-path","clipPath","mask","marker","marker-start","marker-mid","marker-end","filter","flood-color","lighting-color"]),s=new Set(["baseId","targetId","boundElementId"]);!function t(e){if(e&&"object"==typeof e){if(e.id&&"string"==typeof e.id){const t=e.id,n=ge();o.set(t,n),e.id=n}else e.animate&&(e.id=ge());if(Array.isArray(e.children))for(const n of e.children)t(n)}}(r),function t(e){if(e&&"object"==typeof e)for(const[n,r]of Object.entries(e))if("children"!==n)if("string"==typeof r)if(i.has(n)&&r.startsWith("#")){const t=r.slice(1),i=o.get(t);i&&(e[n]="#"+i)}else if(a.has(n))e[n]=be(r,o);else if(s.has(n)){const t=o.get(r);t&&(e[n]=t)}else r.includes("url(#")&&(e[n]=be(r,o));else if("style"===n&&"object"==typeof r&&null!==r)for(const[t,e]of Object.entries(r))"string"==typeof e&&(r[t]=be(e,o));else"object"==typeof r&&null!==r&&t(r);else if(Array.isArray(r))for(const e of r)t(e)}(r);const l=null==(e=r.animator)?void 0:e.animate;if(l&&"object"==typeof l){const t={};for(const[e,r]of Object.entries(l)){t[null!=(n=o.get(e))?n:e]=r}r.animator=y(v({},r.animator),{animate:t})}return r}function be(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}var ke=new Set(["script","foreignobject"]),Ae=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),we=new Set(["href","xlink:href","src"]),xe=new Set(["mixBlendMode","isolation"]),je=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,Oe=/^data:image\/svg\+xml(?:;[^,]*)?,/i,Se=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,Pe=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function Me(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(Ae.has(n)){const t=String(e);return t.startsWith("#")||(/^url\(#[^)]+\)$/.test(t)||we.has(n)&&(je.test(t)||Oe.test(t)||function(t){const e=Se.exec(t);return!!e&&Pe.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 _e(t){const e={};for(const n of Object.keys(t)){const r=oe(n);if(G.has(r))continue;if("style"===r)continue;let o=t[n];$t.has(r)&&Array.isArray(o)?e[r]=Jt(o):"transform"===r&&null!==o&&"object"==typeof o&&!Array.isArray(o)&&o.value&&"object"==typeof o.value?e.transform=ne(o.value,{withUnits:!1}):te.has(r)?(Array.isArray(o)&&("translate"===r&&(o=o.map(t=>t+"px")),o=o.join(",")),"rotate"===r&&(o+="deg"),e.transform=r+"("+o+")"):null!=o&&(e[r]=String(o))}return e}function ze(t){var e;const n=null!=(e=t.value)?e:t.v;if(!n)return;if(Array.isArray(n)&&n.length>=2&&"number"==typeof n[0]&&"number"==typeof n[1])return[n[0],n[1]];const r=n.translate;return Array.isArray(r)&&r.length>=2?[r[0],r[1]]:void 0}function Ie(t){var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0}function Ne(t){var e;return null!=(e=t.easing)?e:t.e}function Ce(t){var e,n,r;const o=null!=(e=t.keyframes)?e:t.kfs;if(!Array.isArray(o))return!1;if(t.autoOrient)return!0;for(const t of o)if((null!=(n=t.tangentIn)?n:t.ti)||(null!=(r=t.tangentOut)?r:t.to))return!0;return!1}var Ee=new WeakMap;function Te(t,e,n,r){var o,i;let a=Ee.get(t);const s=null==a?void 0:a.get(e);if(s)return s;const l=null!=(o=t.tangentOut)?o:t.to,u=null!=(i=e.tangentIn)?i:e.ti,c=[n[0]+(l?l[0]:0),n[1]+(l?l[1]:0)],f=[r[0]+(u?u[0]:0),r[1]+(u?u[1]:0)],d=he(n,c,f,r),h={P0:n,P1:c,P2:f,P3:r,lut:d,totalArc:d.ds[d.ds.length-1]};return a||(a=new WeakMap,Ee.set(t,a)),a.set(e,h),h}function Fe(t,e,n,r,o,i){const a=Te(t,e,n,r),s=0===a.totalArc?o:function(t,e){const n=t.ds[t.ds.length-1],r=e*n,{ts:o,ds:i}=t,a=i.length-1;if(r<=0)return o[0];if(r>=i[a])return o[a];let s=1,l=a;for(;s<l;){const t=s+l>>>1;i[t]<r?s=t+1:l=t}const u=i[l-1],c=i[l]-u,f=c>0?(r-u)/c:0;return o[l-1]+f*(o[l]-o[l-1])}(a.lut,o),l=ue(a.P0,a.P1,a.P2,a.P3,s);if(!i)return{translate:l};const u=fe(a.P0,a.P1,a.P2,a.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}function Le(t,e){var n,r,o,i;if(!Ce(t))return t;const a=null!=(n=t.keyframes)?n:t.kfs;if(!Array.isArray(a)||a.length<2)return t;const s=!!t.autoOrient,l=null!=(r=null==e?void 0:e.flatnessTolerance)?r:.5,u=null!=(o=null==e?void 0:e.rotationTolerance)?o:5,c=null!=(i=null==e?void 0:e.maxSamplesPerSegment)?i:32,f=[],d=ze(a[0]);if(!d)return t;const h=s?function(t,e){const n=ze(t),r=ze(e);if(!n||!r)return 0;const o=Te(t,e,n,r),i=fe(o.P0,o.P1,o.P2,o.P3,0);return 180*Math.atan2(i[1],i[0])/Math.PI}(a[0],a[1]):void 0;f.push(Ue(Ie(a[0]),We(Re(a[0]),Re(a[0]),0,d,h,s)));for(let t=0;t<a.length-1;t++){const e=a[t],n=a[t+1],r=ze(e),o=ze(n);r&&o?(s&&t>0&&qe(f,e,n,r,o,u),Ze(f,e,n,r,o,s,l,u,c)):f.push(Ue(Ie(n),We(Re(n),Re(n),1,null!=o?o:[0,0],void 0,s)))}const p=Ne(a[a.length-1]);p&&(f[f.length-1].e=p),s&&De(f);const m={kfs:f};return void 0!==t.loop&&(m.loop=t.loop),m}function De(t){var e;let n;for(const r of t){const t=null!=(e=r.v)?e:r.value;if(!t||"number"!=typeof t.rotate)continue;if(void 0===n){n=t.rotate;continue}let o=t.rotate;for(;o-n>180;)o-=360;for(;o-n<-180;)o+=360;t.rotate=o,n=o}}function Ue(t,e){return{t:t,v:e}}function Re(t){var e;const n=null!=(e=t.value)?e:t.v;if(n&&"object"==typeof n&&!Array.isArray(n))return n}function Ve(t,e,n){if(void 0===t)return e;if(void 0===e)return t;if("number"==typeof t&&"number"==typeof e)return t+(e-t)*n;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){const r=new Array(t.length);for(let o=0;o<t.length;o++){const i="number"==typeof t[o]?t[o]:0,a="number"==typeof e[o]?e[o]:0;r[o]=i+(a-i)*n}return r}return n<.5?t:e}function We(t,e,n,r,o,i){const a={translate:r},s=new Set;if(t)for(const e of Object.keys(t))s.add(e);if(e)for(const t of Object.keys(e))s.add(t);for(const r of s){if("translate"===r)continue;if("rotate"===r&&i)continue;const o=null==t?void 0:t[r],s=null==e?void 0:e[r];void 0===o&&void 0===s||(a[r]=Ve(o,s,n))}return void 0!==o&&(a.rotate=o+Be(t,e,n)),a}function Be(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=Ve(r,o,n);return"number"==typeof i?i:0}function qe(t,e,n,r,o,i){var a;const s=t[t.length-1],l=null!=(a=s.v)?a:s.value,u=null==l?void 0:l.rotate;if("number"!=typeof u)return;const c=Re(e),f=u-Be(c,c,0),d=Te(e,n,r,o),h=fe(d.P0,d.P1,d.P2,d.P3,0),p=180*Math.atan2(h[1],h[0])/Math.PI,m=function(t,e){let n=t-e;for(;n>180;)n-=360;for(;n<-180;)n+=360;return n}(p,f);if(Math.abs(m)<=i)return;const g=Ie(e),v=Math.min(g+Ge,(g+Ie(n))/2),y=We(Re(e),Re(e),0,r,p,!0);t.push(Ue(v,y))}var Ge=.05;function Ze(t,e,n,r,o,i,a,s,l){const u=Te(e,n,r,o),c=Ie(e),f=Ie(n),d=Ne(e),h=(p=d)?Kt([p[1],p[0],p[3],p[2]]):t=>t;var p;const m=Re(e),g=Re(n),v=function(t,e,n,r,o){const i=[];Ke(t.P0[0],t.P1[0],t.P2[0],t.P3[0],i),Ke(t.P0[1],t.P1[1],t.P2[1],t.P3[1],i),i.sort((t,e)=>t-e);const a=[0];for(const t of i)t>a[a.length-1]+1e-6&&t<.999999&&a.push(t);a.push(1);const s=[],l={remaining:o-a.length};for(let o=0;o<a.length-1;o++)Xe(a[o],a[o+1],s,t,e,n,r,l);return s}(u,i,a,s,l),y=[];for(const t of v){const e=pe(u.lut,t),n=le(u.totalArc>0?e/u.totalArc:t,0,1),r={u:le(h(n),0,1),p:n,pos:ue(u.P0,u.P1,u.P2,u.P3,t)};if(i){const e=fe(u.P0,u.P1,u.P2,u.P3,t);r.rotateDeg=180*Math.atan2(e[1],e[0])/Math.PI}y.push(r)}let b=d,k=0;const A=t.length-1;for(let e=0;e<y.length;e++){const n=y[e],r=k<1?le((n.u-k)/(1-k),0,1):1,{left:o,right:a}=Yt(b,r),s=0===e?A:t.length-1;o?t[s].e=o:delete t[s].e;const l=c+n.u*(f-c),u=We(m,g,n.p,n.pos,n.rotateDeg,i);t.push(Ue(l,u)),b=a,k=n.u}}function Ke(t,e,n,r,o){const i=e-t,a=n-e,s=i-2*a+(r-n),l=2*(a-i),u=i;if(Math.abs(s)<1e-10){if(Math.abs(l)>1e-10){const t=-u/l;t>1e-6&&t<.999999&&o.push(t)}return}const c=l*l-4*s*u;if(c<0)return;const f=Math.sqrt(c),d=(-l-f)/(2*s),h=(-l+f)/(2*s);d>1e-6&&d<.999999&&o.push(d),h>1e-6&&h<.999999&&o.push(h)}function Xe(t,e,n,r,o,i,a,s){const l=(t+e)/2,u=ue(r.P0,r.P1,r.P2,r.P3,t),c=ue(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=ue(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=ue(r.P0,r.P1,r.P2,r.P3,l),p=ue(r.P0,r.P1,r.P2,r.P3,t+.75*f),m=Math.max(Ye(d,u,c),Ye(h,u,c),Ye(p,u,c));let g=!0;if(o){const n=fe(r.P0,r.P1,r.P2,r.P3,t),o=fe(r.P0,r.P1,r.P2,r.P3,e),i=180*Math.atan2(n[1],n[0])/Math.PI,s=180*Math.atan2(o[1],o[0])/Math.PI;let l=Math.abs(i-s);l>180&&(l=360-l),l>a&&(g=!1)}m<=i&&g||s.remaining<=0||f<1e-6?n.push(e):(s.remaining-=1,Xe(t,l,n,r,o,i,a,s),Xe(l,e,n,r,o,i,a,s))}function Ye(t,e,n){const r=n[0]-e[0],o=n[1]-e[1],i=r*r+o*o;if(i<1e-20){const n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}const a=(t[0]-e[0])*o-(t[1]-e[1])*r;return Math.abs(a)/Math.sqrt(i)}function Qe(t,e){const n=Je(t,e);return null!=n?n:t}function Je(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=Je(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&&Ce(n)){const o=Le(n,e);o!==n&&(r=y(v({},t),{transform:o}))}}if(!n&&!r)return null;const i=v({},t);return n&&(i.children=n),r&&(i.animate=r),i}function He(t){const e=[];let n;const r=function(t){const e=t.split(/([MLCZmlcz]|[\s,]+)/).map(t=>t.trim()).filter(t=>t&&","!==t),n=[];let r=null;for(const t of e)if(/[MLCZmlcz]/.test(t))r={type:t,values:[]},n.push(r);else if(r){const e=+t;r.values.push(Number.isNaN(e)?0:e)}return n}(t);for(const t of r){const r=t.type,o=t.values;if("M"===r||"m"===r){const t=o[0]||0,r=o[1]||0;n={v:[[t,r]],i:[[t,r]],o:[[t,r]],c:!1},e.push(n);continue}if(n||(n={v:[[0,0]],i:[[0,0]],o:[[0,0]],c:!1},e.push(n)),"L"===r){const t=o[0]||0,e=o[1]||0;n.v.push([t,e]),n.i.push([t,e]),n.o.push([t,e])}else if("C"===r){const t=o[0]||0,e=o[1]||0,r=o[2]||0,i=o[3]||0,a=o[4]||0,s=o[5]||0;n.o[n.o.length-1]=[t,e],n.v.push([a,s]),n.i.push([r,i]),n.o.push([a,s])}else"Z"===r||"z"===r?n.c=!0:console.warn('Unsupported path command "'+r+'"')}return e}function $e(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function tn(t){return"string"==typeof t&&void 0!==$e(t)}function en(t){if(t&&"object"==typeof t&&"string"==typeof t.path){const e=$e(t.path);return e?{paths:He(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&tn(e[0])){const t=[];for(const n of e){const e=$e(n);e&&t.push(...He(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&tn(t[0])){const e=[];for(const n of t){const t=$e(n);t&&e.push(...He(t))}return{paths:e}}return{paths:t}}if(tn(t)){return{paths:He($e(t))}}return t}function nn(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 rn(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 on(t,e,n,r){var o,i;if("d"===t){return{paths:qt(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 $t.has(t)?Bt(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?Vt(e,n,r):te.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?Wt(e||[],n||[],r):Vt(+(e||0),+(n||0),r):function(t,e,n){const r=new Set([...Object.keys(null!=t?t:{}),...Object.keys(null!=e?e:{})]),o={};for(const i of r){const r=null==t?void 0:t[i],a=null==e?void 0:e[i];if("rotate"===i||"skew"===i)o[i]=Vt(+(null!=r?r:0),+(null!=a?a:0),n);else if("translate"===i||"scale"===i||"origin"===i){const t="scale"===i?[1,1]:[0,0];o[i]=Wt(r||t,a||t,n)}else o[i]=null!=a?a:r}return o}(e,n,r)}function an(t,e,n,r){var o,i,a,s,l;const u=e.length-1,c=le(null!=(o=n.segmentCount)?o:u,1,u);let f;f=n.before?e.slice(0,c+1):e.slice(u-c);const d=null!=(i=e[0].t)?i:0,h=null!=(a=e[e.length-1].t)?a:0;let p,m;n.before?(p=0,m=d):(p=h,m=r);const g=m-p;if(g<=0)return e;const v=null!=(s=f[0].t)?s:0,y=(null!=(l=f[f.length-1].t)?l:0)-v;if(y<=0)return e;const b=f.map(t=>{var e,n;return{relT:(t.t-v)/y,v:t.v,e:t.e,tangentIn:null!=(e=t.tangentIn)?e:t.ti,tangentOut:null!=(n=t.tangentOut)?n:t.to}}),k=Math.floor(g/y),A=g-k*y,w=A/y,x=[];function j(e,n,r){let o;if(n){o=[];for(let t=b.length-1;t>=0;t--)o.push({relT:1-b[t].relT,v:b[t].v,e:t>0?Qt(b[t-1].e):void 0,tangentIn:b[t].tangentOut,tangentOut:b[t].tangentIn})}else o=b;const i=void 0!==r?r:1;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT>i+1e-9){const a=o[n-1],s=r.relT-a.relT,l=(i-a.relT)/s,u=a.e?Kt(a.e)(l):l,c=on(t,a.v,r.v,u),{left:f}=Yt(a.e,l);return x.length>0&&a.relT<=i&&(x[x.length-1].e=f),void x.push({t:e+i*y,v:c,e:void 0})}const a={t:e+r.relT*y,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(a.tangentIn=r.tangentIn),r.tangentOut&&(a.tangentOut=r.tangentOut),x.push(a)}}if(n.before){if(w>1e-9){!function(e,n,r){let o;if(n){o=[];for(let t=b.length-1;t>=0;t--)o.push({relT:1-b[t].relT,v:b[t].v,e:t>0?Qt(b[t-1].e):void 0,tangentIn:b[t].tangentOut,tangentOut:b[t].tangentIn})}else o=b;const i=1-r;for(let n=0;n<o.length;n++){const r=o[n];if(r.relT<i-1e-9)continue;const a=o[n-1];if(a&&a.relT<i-1e-9&&r.relT>i+1e-9){const n=r.relT-a.relT,o=(i-a.relT)/n,s=a.e?Kt(a.e)(o):o,l=on(t,a.v,r.v,s),{right:u}=Yt(a.e,o);x.push({t:e,v:l,e:u})}const s={t:e+(r.relT-i)*y,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),x.push(s)}}(p,!!n.alternate&&k%2==0,w)}for(let t=0;t<k;t++){const e=k-1-t,r=!!n.alternate&&e%2==0;j(p+A+t*y,r)}}else{for(let t=0;t<k;t++){const e=!!n.alternate&&t%2==0;j(p+t*y,e)}if(w>1e-9){const t=!!n.alternate&&k%2==0;j(p+k*y,t,w)}}return n.before?[...x,...e]:[...e,...x]}function sn(t,e,n,r){var o,i,a,s,l,u,c;const f=e.keyframes||e.kfs||[],d=[];for(const e of f){const n=null!=(i=null!=(o=e.time)?o:e.t)?i:0;let f=null!=(a=e.value)?a:e.v;const h=null!=(s=e.easing)?s:e.e;"d"===t&&(f=en(f));const p=ie(t)?se(t):t;$t.has(p)&&(f=null!=(l=Ht(f))?l:f);const m={t:n,v:f,e:nn(h,r)},g=null!=(u=e.tangentIn)?u:e.ti,v=null!=(c=e.tangentOut)?c:e.to;g&&(m.tangentIn=g),v&&(m.tangentOut=v),d.push(m)}d.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const h=e.loop,p=!0===h?{}:h||void 0;return p&&d.length>=2?an(t,d,p,n):d}function ln(t,e,n){var r;const o=e.loop;if(null==o||!1===o)return e;const i=!0===o?{}:o,a=null!=(r=e.keyframes)?r:e.kfs;if(!Array.isArray(a)||a.length<2)return e;const s=ie(t)?se(t):t,l=$t.has(s),u=a.map(e=>{var n,r,o,i,a,s,u,c;const f=null!=(n=e.t)?n:e.time;let d=null!=(r=e.v)?r:e.value;"d"===t&&(d=en(d)),l&&(d=null!=(o=Ht(d))?o:d);const h={t:f,v:d,e:null!=(i=e.e)?i:e.easing};return(null!=(a=e.tangentIn)?a:e.ti)&&(h.tangentIn=null!=(s=e.tangentIn)?s:e.ti),(null!=(u=e.tangentOut)?u:e.to)&&(h.tangentOut=null!=(c=e.tangentOut)?c:e.to),h}),c={kfs:an(t,u,i,n)};return void 0!==e.autoOrient&&(c.autoOrient=e.autoOrient),c}function un(t,e){const n=cn(t,e);return null!=n?n:t}function cn(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=cn(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=ln(n,o,e);i!==o&&(r||(r=v({},t)),r[n]=i)}}if(!n&&!r)return null;const i=v({},t);return n&&(i.children=n),r&&(i.animate=r),i}var fn=0;function dn(t,e=W.webapi){const n=Ft(t)||{},r=Lt(t),o=n.duration||1e3,i=[],a=(t,n)=>{if(!n)return null;const i=function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=rn(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=rn(r,e);t&&n.push(t)}else n.push(t);return n}(n,r);if(0===i.length)return null;const a=function(t,e,n,r=W.webapi){const o={};for(const[i,a]of Object.entries(t)){const t=sn(i,a,e,n);if(t.length>0){const e={kfs:t};void 0!==a.autoOrient&&(e.autoOrient=a.autoOrient),void 0!==a.loop&&(e.loop=a.loop),o[i]=r===W.webapi&&"transform"===i?Le(e):e}}return o}(function(t){const e={};for(const n of t)for(const[t,r]of Object.entries(n))e[t]=r;return e}(i),o,r,e);return 0===Object.keys(a).length?null:{id:t,animate:a}},s=Dt(t);if(s)for(const t of s){const e=a(t.id,t.animate);e&&i.push(e)}const l=t=>{const e=t.animate;if(e&&Object.keys(e).length>0){const n=t.id||"_px_el_"+ ++fn;t.id=n;const r=a(n,e);r&&i.push(r)}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 hn(t,e,n){var r,o,i,a,s,l,u;const c=e.kfs||e.keyframes||[];if(0===c.length)return null;const{prevKf:f,nextKf:d}=function(t,e){var n,r;const o=t.length-1;let i=t[0],a=t[o>0?1:0];for(let s=0;s<o;s++){const l=null!=(n=t[s].t)?n:0,u=null!=(r=t[s+1].t)?r:0;if(l<=e&&e<=u){i=t[s],a=t[s+1];break}e>u&&s===o-1&&(i=t[o>0?o-1:0],a=t[o])}return{prevKf:i,nextKf:a}}(c,n);let h=f===d?0:(p=n,m=null!=(r=f.t)?r:0,g=null!=(o=d.t)?o:0,v=0,y=1,g===m?v:v+(p-m)/(g-m)*(y-v));var p,m,g,v,y;h=le(h,0,1);const b=null!=(i=f.e)?i:f.easing;if(b&&Array.isArray(b))try{h=Kt(b)(h)}catch(t){}let k=ie(t)?se(t):t,A=null;const w=null!=(a=null==f?void 0:f.v)?a:null==f?void 0:f.value,x=null!=(s=null==d?void 0:d.v)?s:null==d?void 0:d.value;if("d"===k){A=qt(null!=(l=null==w?void 0:w.paths)?l:Array.isArray(w)?w:[],null!=(u=null==x?void 0:x.paths)?u:Array.isArray(x)?x:[],h).map(t=>Rt(t)).join("")}else if($t.has(k))A=Jt(Bt(w||[0,0,0,1],x||[0,0,0,1],h)),k=t;else if("stroke-dasharray"===k)A=Wt(w||[],x||[],h).join(" "),k=t;else if("transform"!==k||null===w||"object"!=typeof w||Array.isArray(w))if("translate"===k){A="translate("+Wt(w||[0,0],x||[0,0],h).join(",")+")",k="transform"}else if("rotate"===k){A="rotate("+Vt(+(w||0),+(x||0),h)+")",k="transform"}else if("scale"===k){A="scale("+Wt(w||[1,1],x||[1,1],h).join(",")+")",k="transform"}else{A=Vt(+(w||0),+(x||0),h)}else{const t=new Set([...w?Object.keys(w):[],...x?Object.keys(x):[]]),n={};for(const e of t){const t=null==w?void 0:w[e],r=null==x?void 0:x[e];if("rotate"===e||"skew"===e)n[e]=Vt(+(null!=t?t:0),+(null!=r?r:0),h);else if("translate"===e||"scale"===e||"origin"===e){const o="scale"===e?[1,1]:[0,0],i=Wt(t||o,r||o,h);n[e]=i}}if(Ce(e)){const t=w.translate,r=x.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=Fe(f,d,[+t[0],+t[1]],[+r[0],+r[1]],h,!!e.autoOrient);n.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(n.rotate=o.rotateDeg)}}A=ne(n,{withUnits:!1}),k="transform"}return ee.has(k)&&"number"==typeof A&&(A=100*A+"%"),{k:k,v:null===A?"":""+A}}function pn(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=hn(r,o,e);t&&(n[t.k]=t.v)}return n}function mn(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(mn);const e={};for(const n of Object.keys(t))e[n]=mn(t[n]);return e}function gn(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 vn(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function yn(t){var e;const n=vn(t.x),r=vn(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 bn(t){var e;const n=function(t){const e=new Map,n=t=>{var r;"string"==typeof t.id&&e.set(t.id,t),null==(r=t.children)||r.forEach(n)};return n(t),e}(t),r=function(t,e){const n=new WeakMap,r=new Set,o=(t,r)=>{const i=n.get(t);if(void 0!==i)return i;if(r.has(t))return!1;r.add(t);let a=!1;if(t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate))for(const e in t.animate){a=!0;break}if(!a&&t.children)for(const e of t.children)if(o(e,r)){a=!0;break}if(!a&&"use"===t.type&&"string"==typeof t.href){const n=An(t.href),i=n?e.get(n):void 0;i&&(a=o(i,r))}return r.delete(t),n.set(t,a),a};for(const[t,n]of e)o(n,new Set)&&r.add(t);return r}(0,n);if(0===r.size)return t;let o=0;const i=function(t){const e=xn(t.viewBox);if(e)return[e[2],e[3]];const n=kn(t.width),r=kn(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),a=[],s=jn(t,n,r,()=>"_lw_use_mat_"+ ++o,a,i);if(0===a.length)return s;const l={type:"defs",children:a},u=[...null!=(e=s.children)?e:[],l];return y(v({},s),{children:u})}function kn(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function An(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function wn(t,e,n,r,o,i,a){var s,l,u,c;const f=mn(e);gn(f,o);const d="symbol"===f.type?xn(f.viewBox):void 0,h=null!=(l=null!=(s=kn(t.width))?s:null==d?void 0:d[2])?l:a[0],p=null!=(c=null!=(u=kn(t.height))?u:null==d?void 0:d[3])?c:a[1],m="symbol"===f.type?function(t,e,n,r,o){const i=xn(t.viewBox),a=y(v({},t),{type:"g"});if(delete a.viewBox,delete a.preserveAspectRatio,delete a.width,delete a.height,!i)return a;const[s,l,u,c]=i,f=u>0&&c>0?Math.min(r/u,o/c):1,d=(r-u*f)/2,h=(o-c*f)/2,p=[];0===d&&0===h||p.push("translate("+d+","+h+")");1!==f&&p.push("scale("+f+")");0===s&&0===l||p.push("translate("+-s+","+-l+")");p.length&&(a.transform=p.join(""));const m=e();return n.push({type:"clipPath",id:m,children:[{type:"rect",x:s,y:l,width:u,height:c}]}),a.clipPath="url(#"+m+")",a}(f,o,i,h,p):f,g=jn(m,n,r,o,i,a),b=y(v({},t),{type:"g",children:[g]});return delete b.href,delete b.width,delete b.height,yn(b)}function xn(t){if("string"!=typeof t)return;const e=t.trim().split(/[\s,]+/).map(Number);return e.length<4||e.some(t=>!Number.isFinite(t))?void 0:[e[0],e[1],e[2],e[3]]}function jn(t,e,n,r,o,i){if("use"===t.type&&"string"==typeof t.href){const a=An(t.href);if(a&&n.has(a)){const s=e.get(a);if(s)return wn(t,s,e,n,r,o,i)}}if(!t.children)return t;let a=!1;const s=t.children.map(t=>{const s=jn(t,e,n,r,o,i);return s!==t&&(a=!0),s});return a?y(v({},t),{children:s}):t}function On(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 Sn(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=null!=(e=r.keyframes)?e:r.kfs;if(o)return{kind:"animated",keyframes:o.map(Pn),autoOrient:r.autoOrient,loop:r.loop};const i=null!=(n=r.value)?n:r.v;if(void 0!==i)return{kind:"static",value:i}}return{kind:"static",value:t}}function Pn(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=v({},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 Mn(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 _n(t,e,n){if(!e)return t;delete t.transform;let r=t;var o;return r=In(r,e.origin,!0),r=zn(r,"scale",void 0===(o=e.scale)?void 0:Array.isArray(o)?[o[0]/100,o[1]/100]:o,n),r=zn(r,"skew",e.skew,n),r=zn(r,"rotate",e.rotate,n),r=In(r,e.origin,!1),!function(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}(e.translate)?r=zn(r,"translate",e.translate,n):(r=In(r,e.origin,!0),r=zn(r,"translate",e.translate,n),r=In(r,e.origin,!1)),r}function zn(t,e,n,r){if(void 0===n)return t;const o=Sn(n);if("static"===o.kind)return{type:"g",transform:{value:On(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>Mn(t,On(e,t.value,void 0)))};return o.autoOrient&&(n.autoOrient=!0),void 0!==o.loop&&(n.loop=o.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function In(t,e,n){if(void 0===e)return t;const r=Sn(e),o=t=>n?[-t[0],-t[1]]:t;if("absent"===r.kind)return t;if("static"===r.kind)return 0===r.value[0]&&0===r.value[1]?t:{type:"g",transform:{value:{translate:o(r.value)}},children:[t]};if("animated"===r.kind){const e={keyframes:r.keyframes.map(t=>Mn(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function Nn(t,e,n){var r,o,i;if("use"===t.type&&"content"===(null==(o=null==(r=t.effects)?void 0:r.clone)?void 0:o.type)){const r=t.effects.clone.baseId;"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(i=t.children)||i.forEach(t=>Nn(t,e,n))}function Cn(t,e,n,r,o){const i=function(t,e){var n,r,o;const i={};let a=!1;const s=null==(n=t.animate)?void 0:n.transform;if(s&&"object"==typeof s&&Array.isArray(s.keyframes)){const e=s.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=Tn(s),r={keyframes:e.map(t=>{const e=t.value||{},r={};void 0!==e.translate&&(r.translate=e.translate),n&&void 0!==e.origin&&(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),void 0!==t.tangentOut&&(o.tangentOut=t.tangentOut),void 0!==t.tangentIn&&(o.tangentIn=t.tangentIn),o})};s.autoOrient&&(r.autoOrient=!0);const o=s.loop;void 0!==o&&(r.loop=o),i.animate={transform:r};const l=e.some(t=>{const e=t.value||{};return void 0!==e.rotate||void 0!==e.scale}),u=e.map(t=>{const e=t.value||{},r={};void 0!==e.rotate&&(r.rotate=e.rotate),void 0!==e.scale&&(r.scale=e.scale),void 0===e.origin||n&&!l||(r.origin=e.origin);const o={value:r};return void 0!==t.time&&(o.time=t.time),void 0!==t.easing&&(o.easing=t.easing),o});if(u.every(t=>0===Object.keys(t.value).length))delete t.animate.transform,t.animate&&0===Object.keys(t.animate).length&&delete t.animate;else{const e={keyframes:u};void 0!==o&&(e.loop=o),t.animate.transform=e}a=!0}}const l=void 0!==(null==e?void 0:e.translate),u=a||l,c=a&&Tn((null==(r=t.animate)?void 0:r.transform)||void 0)||a&&Tn((null==(o=i.animate)?void 0:o.transform)||void 0);if("string"==typeof t.transform){const e=function(t){const e=[],n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);)e.push({name:r[1],full:r[0]});if(!e.length)return{rest:t||void 0};if(e.every(t=>"translate"===t.name))return{translate:e.map(t=>t.full).join("")};const o=e[0],i=e[e.length-1];if("translate"===i.name&&"translate"===o.name){const n=En(i.full),r=En(o.full),a=-n[0],s=-n[1],l=r[0]-a,u=r[1]-s;if(0===l&&0===u)return{rest:t};return{translate:"translate("+l+","+u+")",rest:"translate("+a+","+s+")"+e.slice(1).map(t=>t.full).join("")}}if("translate"===i.name)return{rest:t};const a=[];let s=0;for(;s<e.length&&"translate"===e[s].name;)a.push(e[s].full),s++;if(!a.length)return{rest:t};const l=e.slice(s).map(t=>t.full).join("");return{translate:a.join(""),rest:l||void 0}}(t.transform);u?void 0!==e.translate?e.rest?t.transform=e.rest:delete t.transform:!function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g,n=[];let r;for(;r=e.exec(t);)n.push({name:r[1],full:r[0]});if(1!==n.length)return!1;if("translate"===n[0].name)return!0;if("matrix"!==n[0].name)return!1;const o=/matrix\(([^)]*)\)/.exec(n[0].full);if(!o)return!1;const i=o[1].split(/[\s,]+/).filter(Boolean).map(Number);return i.length>=4&&1===i[0]&&0===i[1]&&0===i[2]&&1===i[3]}(t.transform)?c&&function(t){const e=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let n,r=0,o=!1;for(;n=e.exec(t);)r++,"matrix"===n[1]&&(o=!0);return 1===r&&o}(t.transform)&&delete t.transform:delete t.transform:e.translate&&(i.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}return i}(t,e);"string"==typeof t.id&&delete t.id;const{outer:a,inner:s}=function(t){if(!t)return{};const e=Tn(t.translate),n=void 0!==t.rotate||void 0!==t.scale,r={},o={};void 0!==t.translate&&(r.translate=t.translate);e&&void 0!==t.origin&&(r.origin=t.origin);void 0!==t.rotate&&(o.rotate=t.rotate);void 0!==t.scale&&(o.scale=t.scale);void 0!==t.skew&&(o.skew=t.skew);void 0===t.origin||e&&!n||(o.origin=t.origin);return{outer:Object.keys(r).length?r:void 0,inner:Object.keys(o).length?o:void 0}}(e);let l=t;l=_n(l,s,o);let u={type:"g",id:n,children:[{type:"g",id:r,children:[l]}]};return void 0!==i.transform&&(u.transform=i.transform),void 0!==i.animate&&(u.animate=i.animate),a&&(delete u.id,u=_n(u,a,o),u.id=n),u}function En(t){const e=/translate\(([^)]*)\)/.exec(t);if(!e)return[0,0];const n=e[1].split(/[\s,]+/).filter(Boolean).map(Number);return[n[0]||0,n[1]||0]}function Tn(t){if(!t||"object"!=typeof t)return!1;const e=t;return!!e.autoOrient||!!Array.isArray(e.keyframes)&&e.keyframes.some(t=>t.tangentOut||t.tangentIn)}function Fn(t,e){return"_lw_"+e+"_"+t.nextId++}function Ln(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function Dn(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Dn(t,e))}var Un=mn;function Rn(t,e,n,r){if(!e)return t;const o=Fn(n,"grad"),i=function(t,e){const n={type:t.type===bt.radial?"radialGradient":"linearGradient",id:e};t.type===bt.linear?(t.p1&&(n.x1=String(t.p1[0]),n.y1=String(t.p1[1])),t.p2&&(n.x2=String(t.p2[0]),n.y2=String(t.p2[1]))):(t.c&&(n.cx=String(t.c[0]),n.cy=String(t.c[1])),void 0!==t.r&&(n.r=String(t.r)),t.fp&&(n.fx=String(t.fp[0]),n.fy=String(t.fp[1])));t.gradientUnits&&(n.gradientUnits=t.gradientUnits);t.spreadMethod&&(n.spreadMethod=t.spreadMethod);t.gradientTransform&&(n.gradientTransform=t.gradientTransform);const r=t.animate;if(r){const t={};for(const e of Object.keys(r)){const n=Vn[e];n&&(t[n]=r[e])}Object.keys(t).length&&(n.animate=t)}return n.children=function(t){var e,n,r,o;if(!t)return[];if(Array.isArray(t))return t.map(Wn);if("object"==typeof t&&Array.isArray(t.value))return t.value.map(Wn);const i=t,a=i.keyframes;if(!Array.isArray(a)||!a.length)return[];const s=i.loop;let l=0;for(const t of a){const n=null!=(e=t.value)?e:t.v;Array.isArray(n)&&n.length>l&&(l=n.length)}if(!l)return[];const u=null!=(n=a[0].value)?n:a[0].v,c=[];for(let t=0;t<l;t++){const e=null!=(o=null!=(r=null==u?void 0:u[t])?r:Bn(a,0,t))?o:{offset:t/Math.max(1,l-1),color:"#000000"};c.push({offset:e.offset,color:e.color})}return c.map((t,e)=>function(t,e,n,r,o){var i,a,s,l,u;const c=[],f=[];let d=!1;for(const r of e){const o=null!=(a=null!=(i=r.time)?i:r.t)?a:0,h=null!=(s=r.value)?s:r.v,p=null!=(l=null==h?void 0:h[n])?l:Bn(e,e.indexOf(r),n);if(!p)continue;const m=null!=(u=r.easing)?u:r.e,g={time:o,value:p.color};void 0!==m&&(g.easing=m),c.push(g);const v={time:o,value:p.offset};void 0!==m&&(v.easing=m),f.push(v),p.offset!==t.offset&&(d=!0)}const h={type:"stop",offset:qn(t.offset),stopColor:t.color},p={};c.length&&(p.stopColor={keyframes:c},void 0!==o&&(p.stopColor.loop=o));d&&f.length&&(p.offset={keyframes:f},void 0!==o&&(p.offset.loop=o));Object.keys(p).length&&(h.animate=p);return h}(t,a,e,0,s))}(t.stops),n}(e,o);return n.defs.push(i),t[r]="url(#"+o+")",t}var Vn={gradientX1:"x1",gradientY1:"y1",gradientX2:"x2",gradientY2:"y2",gradientCx:"cx",gradientCy:"cy",gradientFx:"fx",gradientFy:"fy",gradientR:"r"};function Wn(t){return{type:"stop",offset:qn(t.offset),stopColor:t.color}}function Bn(t,e,n){var r,o;for(let o=e;o>=0;o--){const e=null!=(r=t[o].value)?r:t[o].v;if(null==e?void 0:e[n])return e[n]}for(let r=e+1;r<t.length;r++){const e=null!=(o=t[r].value)?o:t[r].v;if(null==e?void 0:e[n])return e[n]}}function qn(t){return Math.round(1e3*t)/10+"%"}function Gn(t,e,n,r){if(!e)return t;if(!e.href)return r.errors.push("maskedBy.href missing — cannot build mask"),t;const o=Fn(r,"mask");let i={type:"use",href:"#"+e.href};if(n)i=Zn(i,n,r);else if(Qn(t))i=function(t,e){var n;const r=e.animate&&"object"==typeof e.animate&&!Array.isArray(e.animate)?e.animate:void 0,o=null==r?void 0:r.transform,i=o&&"object"==typeof o&&Array.isArray(o.keyframes)?o.keyframes:void 0;if(!i||!i.length)return t;const a=[],s=[],l=[];for(const t of i){const e=(null!=(n=t.value)?n:t.v)||{},r=Mn(t,void 0);if(Array.isArray(e.translate)&&a.push(y(v(v({},r),Yn(t)),{value:{translate:[-e.translate[0],-e.translate[1]]}})),"number"==typeof e.rotate){const t={rotate:-e.rotate};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),s.push(y(v({},r),{value:t}))}if(Array.isArray(e.scale)){const t={scale:[1/e.scale[0],1/e.scale[1]]};Array.isArray(e.origin)&&(t.origin=[e.origin[0],e.origin[1]]),l.push(y(v({},r),{value:t}))}}const u=null==o?void 0:o.loop,c=t=>{const e={keyframes:t};return void 0!==u&&(e.loop=u),e};let f=t;a.length&&(f={type:"g",animate:{transform:c(a)},children:[f]});s.length&&(f={type:"g",animate:{transform:c(s)},children:[f]});l.length&&(f={type:"g",animate:{transform:c(l)},children:[f]});return f}(i,t);else{const e=function(t){if("string"==typeof t.transform){const e=function(t){var e,n,r,o,i,a,s,l,u,c,f,d,h;const p=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let m;const g=[];for(;null!==(m=p.exec(t));){const t=m[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);g.push({name:m[1],args:t})}if(!g.length)return;const v=g[g.length-1];if("translate"===v.name)for(let t=g.length-2;t>=0;t--){const c=g[t];if("translate"!==c.name)continue;const f=null!=(e=c.args[0])?e:0,d=null!=(n=c.args[1])?n:0,h=null!=(r=v.args[0])?r:0,p=null!=(o=v.args[1])?o:0;if(h!==-f||p!==-d)continue;const m={};m.origin=[f,d];for(let e=0;e<t;e++)if("translate"===g[e].name){const t=null!=(i=g[e].args[0])?i:0,n=null!=(a=g[e].args[1])?a:0;m.translate=m.translate?[m.translate[0]+t,m.translate[1]+n]:[t,n]}for(let e=t+1;e<g.length-1;e++){const t=g[e];if("rotate"===t.name)m.rotate=(null!=(s=m.rotate)?s:0)+(null!=(l=t.args[0])?l:0);else if("scale"===t.name){const e=null!=(u=t.args[0])?u:1,n=t.args.length>1?t.args[1]:e;m.scale=m.scale?[m.scale[0]*e,m.scale[1]*n]:[e,n]}}return m}let y,b,k;for(const t of g)if("translate"===t.name){const e=null!=(c=t.args[0])?c:0,n=null!=(f=t.args[1])?f:0;y=y?[y[0]+e,y[1]+n]:[e,n]}else if("rotate"===t.name)b=(null!=b?b:0)+(null!=(d=t.args[0])?d:0);else if("scale"===t.name){const e=null!=(h=t.args[0])?h:1,n=t.args.length>1?t.args[1]:e;k=k?[k[0]*e,k[1]*n]:[e,n]}const A={};y&&(A.translate=y);void 0!==b&&(A.rotate=b);k&&(A.scale=k);return Object.keys(A).length?A:void 0}(t.transform);if(!e)return;const n={};return e.translate&&(n.translate=e.translate),void 0!==e.rotate&&(n.rotate=e.rotate),e.scale&&(n.scale={value:e.scale}),e.origin&&(n.origin=e.origin),Object.keys(n).length?n:void 0}return}(t);e&&(i=Zn(i,e,r))}const a=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||Qn(t))}(t);i=function(t,e,n,r,o){const i=r.idMap.get(n),a=r.maskAncestorChains.get(e)||[],s=o?tr(e,r):void 0,l=s?[...a,s]:a,u=i&&r.maskAncestorChains.get(i)||[];if(!l.length&&!u.length)return t;const c=new Set;for(const t of l)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);for(const t of u)if(t.translateKeyframes)for(const e of t.translateKeyframes)c.add(e.time);if(!(c.size>0)){const e=Jn(l),n=Jn(u),r=n[0]-e[0],o=n[1]-e[1];return 0===r&&0===o?t:{type:"g",transform:"translate("+r+","+o+")",children:[t]}}const f=Array.from(c).sort((t,e)=>t-e);return{type:"g",animate:{transform:{keyframes:f.map(t=>{const e=Hn(l,t),n=Hn(u,t);return{time:t,value:{translate:[n[0]-e[0],n[1]-e[1]]}}})}},children:[t]}}(i,t,e.href,r,a);const s={type:"mask",id:o,children:[i]};return e.maskType&&(s.maskType=e.maskType),e.maskUnits&&(s.maskUnits=e.maskUnits),e.maskContentUnits&&(s.maskContentUnits=e.maskContentUnits),r.defs.push(s),t.mask="url(#"+o+")",t}function Zn(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=Sn(t);if("absent"!==r.kind)return"static"===r.kind?r.value:(e.warnings.push("transformation.origin: animated origin approximated by its first keyframe"),null==(n=r.keyframes[0])?void 0:n.value)}(e.origin,n);let o=t;return o=Kn(o,"translate",e.translate,void 0,n),o=Kn(o,"rotate",e.rotate,r,n),o=Kn(o,"scale",e.scale,r,n),o}function Kn(t,e,n,r,o){if(void 0===n)return t;const i=Sn("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);if("static"===i.kind)return{type:"g",transform:{value:On(e,Xn(e,i.value),r)},children:[t]};if("animated"===i.kind){const n={keyframes:i.keyframes.map(t=>{const n=Mn(t,On(e,Xn(e,t.value),r));return"translate"===e?v(v({},n),Yn(t)):n})};return void 0!==i.loop&&(n.loop=i.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function Xn(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function Yn(t){var e,n;const r={},o=null!=(e=t.tangentOut)?e:t.to,i=null!=(n=t.tangentIn)?n:t.ti;return Array.isArray(o)&&(r.tangentOut=[-o[0],-o[1]]),Array.isArray(i)&&(r.tangentIn=[-i[0],-i[1]]),r}function Qn(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function Jn(t){let e=0,n=0;for(const r of t)r.translate&&(e+=r.translate[0],n+=r.translate[1]);return[e,n]}function Hn(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=$n(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function $n(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function tr(t,e){var n,r,o;const i=t.transform,a=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate.transform:void 0;if(void 0===i&&!a)return;const s={};if("string"==typeof i){const t=function(t,e){const n=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let r,o=0,i=0,a=!1,s=!1;for(;null!==(r=n.exec(t));){const t=r[1],e=r[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);"translate"===t?(o+=e[0]||0,i+=e[1]||0,a=!0):s=!0}s&&e.warnings.push("maskedBy ancestor: non-translate transform in string ignored: "+t);return a?[o,i]:void 0}(i,e);t&&(s.translate=t)}else if(i&&"object"==typeof i){const t=i.value;t&&"object"==typeof t&&Array.isArray(t.translate)&&(s.translate=[t.translate[0]||0,t.translate[1]||0]),!t||void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: non-translate transform parts ignored (rotate/scale not yet supported)")}if(a&&Array.isArray(a.keyframes)){const t=a.keyframes,i=[];for(const a of t){const t=null!=(n=a.value)?n:a.v,s=null!=(o=null!=(r=a.time)?r:a.t)?o:0;t&&"object"==typeof t&&Array.isArray(t.translate)&&(i.push({time:s,value:[t.translate[0]||0,t.translate[1]||0]}),void 0===t.rotate&&void 0===t.scale&&void 0===t.skew||e.warnings.push("maskedBy ancestor: animated non-translate parts ignored"))}i.length&&(s.translateKeyframes=i)}return s.translate||s.translateKeyframes?s:void 0}var er="content";function nr(t,e,n){if(!e)return;const r=e.baseId;if(!r)return void(e.type===er&&n.errors.push("clone: content ref missing baseId"));const o=e.type===er&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function rr(t,e){const n={};return void 0!==t.translate&&(n.translate=function(t,e){if(Array.isArray(t))return e(t);if(t&&"object"==typeof t){const n=t;if(Array.isArray(n.keyframes))return y(v({},n),{keyframes:n.keyframes.map(t=>t&&void 0!==t.value?y(v({},t),{value:e(t.value)}):t)});if(void 0!==n.value)return y(v({},n),{value:e(n.value)})}return t}(t.translate,t=>[t[0]*e,t[1]*e])),void 0!==t.rotate&&(n.rotate=function(t,e){if("number"==typeof t)return e(t);if(t&&"object"==typeof t){const n=t;if(Array.isArray(n.keyframes))return y(v({},n),{keyframes:n.keyframes.map(t=>t&&void 0!==t.value?y(v({},t),{value:e(t.value)}):t)});if(void 0!==n.value)return y(v({},n),{value:e(n.value)})}return t}(t.rotate,t=>t*e)),void 0!==t.scale&&(n.scale=function(t,e){const n=t=>[Math.pow(t[0]/100,e),Math.pow(t[1]/100,e)],r=t=>[Math.pow(t[0],e),Math.pow(t[1],e)];if(Array.isArray(t))return{value:n(t)};if(t&&"object"==typeof t){const e=t;if(Array.isArray(e.keyframes))return y(v({},e),{keyframes:e.keyframes.map(t=>t&&void 0!==t.value?y(v({},t),{value:r(t.value)}):t)});if(void 0!==e.value)return y(v({},e),{value:n(e.value)})}return t}(t.scale,e)),void 0!==t.origin&&(n.origin=t.origin),Object.keys(n).length?n:void 0}function or(t){var e,n;return t.timeCrop&&console.warn("retime: `timeCrop` is not supported yet and will be ignored"),{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function ir(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function ar(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function sr(t){var e;const n=null==(e=t.effects)?void 0:e.clone;n&&(delete n.retime,0===Object.keys(n).length&&delete t.effects.clone,t.effects&&0===Object.keys(t.effects).length&&delete t.effects)}function lr(t,e,n){const r=Ln(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=ur(r,e,n,new Set);o&&(t.href="#"+o)}function ur(t,e,n,r){if(r.has(t))return void n.errors.push('retime: loop via "'+t+'"');const o=n.idMap.get(t);if(!o)return void n.warnings.push('retime: target "'+t+'" not found');const i=Un(o);if(function(t,e){gn(t,()=>Fn(e,"retimed"))}(i,n),"use"===o.type?fr(i,e.start,e.stretch):cr(i,e.start,e.stretch),sr(i),"use"===o.type&&o.href){const a=Ln(o.href);if(a){const s=ar(o),l=s?ir(or(s),e):e,u=new Set(r);u.add(t);const c=ur(a,l,n,u);c&&(i.href="#"+c)}}else!function(t,e,n,r,o){const i=t=>{var a;const s=ar(t);if("use"===t.type&&s&&t.href){const i=Ln(t.href);if(i){const a=ir(or(s),e),l=new Set(r);l.add(o);const u=ur(i,a,n,l);u&&(t.href="#"+u)}sr(t)}null==(a=t.children)||a.forEach(i)};i(t)}(i,e,n,r,t);return n.defs.push(i),"string"==typeof i.id&&n.idMap.set(i.id,i),"string"==typeof i.id?i.id:void 0}function cr(t,e,n){var r;fr(t,e,n),null==(r=t.children)||r.forEach(t=>cr(t,e,n))}function fr(t,e,n){const r=t=>{for(const r of t)"number"==typeof r.time&&(r.time=e+r.time*n)};if(t.transform&&"object"==typeof t.transform&&Array.isArray(t.transform.keyframes)&&r(t.transform.keyframes),t.animate&&"object"==typeof t.animate)for(const e of Object.keys(t.animate)){const n=t.animate[e];n&&Array.isArray(n.keyframes)&&r(n.keyframes)}}var dr=/[MmLlHhVvCcSsQqTtAaZz]/;function hr(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 pr(t){const e=function(t){const e=function(t){const e=[],n=/([MmLlHhVvCcSsQqTtAaZz])|(-?\d*\.?\d+(?:[eE][-+]?\d+)?)/g;let r;for(;null!==(r=n.exec(t));)e.push(r[0]);return e}(t),n=[];let r=0,o=0,i=0,a=0,s=0,l=0,u=0,c=0,f=0,d="";const h=()=>parseFloat(e[r++]),p=(t,e,r)=>{const a=[o,i],s=he(a,t,e,r,48);n.push({P0:a,P1:t,P2:e,P3:r,lut:s,len:s.ds[s.ds.length-1]}),o=r[0],i=r[1]},m=(t,e)=>{p([o+(t-o)/3,i+(e-i)/3],[o+2*(t-o)/3,i+2*(e-i)/3],[t,e])};for(;r<e.length;){let t=e[r];dr.test(t)?r++:t="M"===d?"L":"m"===d?"l":d;const n=t>="a",g=t.toUpperCase();if("Z"!==g){if("M"===g){const e=h()+(n?o:0),r=h()+(n?i:0);o=e,i=r,a=e,s=r,d=t;continue}if("L"===g)m(h()+(n?o:0),h()+(n?i:0));else if("H"===g)m(h()+(n?o:0),i);else if("V"===g)m(o,h()+(n?i:0));else if("C"===g){const t=[h()+(n?o:0),h()+(n?i:0)],e=[h()+(n?o:0),h()+(n?i:0)],r=[h()+(n?o:0),h()+(n?i:0)];l=e[0],u=e[1],p(t,e,r)}else if("S"===g){const t="C"===d.toUpperCase()||"S"===d.toUpperCase()?[2*o-l,2*i-u]:[o,i],e=[h()+(n?o:0),h()+(n?i:0)],r=[h()+(n?o:0),h()+(n?i:0)];l=e[0],u=e[1],p(t,e,r)}else if("Q"===g){const t=[h()+(n?o:0),h()+(n?i:0)],e=[h()+(n?o:0),h()+(n?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=hr([o,i],t,e);p(r,a,e)}else if("T"===g){const t="Q"===d.toUpperCase()||"T"===d.toUpperCase()?[2*o-c,2*i-f]:[o,i],e=[h()+(n?o:0),h()+(n?i:0)];c=t[0],f=t[1];const{P1:r,P2:a}=hr([o,i],t,e);p(r,a,e)}else{if("A"!==g){r++;continue}r+=5,m(h()+(n?o:0),h()+(n?i:0))}d=t}else m(a,s),o=a,i=s,d=t}return n.length?n:null}(t);if(!e)return null;const n=new Float64Array(e.length+1);for(let t=0;t<e.length;t++)n[t+1]=n[t]+e[t].len;const r=n[e.length],o=e[0].P0,i=e[e.length-1].P3,a=Math.hypot(i[0]-o[0],i[1]-o[1])<.001,s=t=>{let r=0;for(;r<e.length-1&&t>n[r+1];)r++;const o=e[r],i=t-n[r],a=o.len>0?function(t,e){const{ts:n,ds:r}=t,o=r.length-1;if(e<=0)return n[0];if(e>=r[o])return n[o];let i=1,a=o;for(;i<a;){const t=i+a>>>1;r[t]<e?i=t+1:a=t}const s=r[a-1],l=r[a]-s,u=l>0?(e-s)/l:0;return n[a-1]+u*(n[a]-n[a-1])}(o.lut,i):0,[s,l]=ue(o.P0,o.P1,o.P2,o.P3,a),[u,c]=fe(o.P0,o.P1,o.P2,o.P3,a);return{x:s,y:l,angle:Math.atan2(c,u)}};return{totalLength:r,closed:a,sampleAtDistance(t){if(a&&r>0&&(t<0||t>r))return s((t%r+r)%r);if(!a&&(t<0||t>r)){const e=t<0?0:r,n=s(e),o=t-e;return{x:n.x+Math.cos(n.angle)*o,y:n.y+Math.sin(n.angle)*o,angle:n.angle}}return s((o=r,(e=t)<(n=0)?n:e>o?o:e));var e,n,o}}}function mr(t){if("number"==typeof t)return{min:t,max:t};if(t&&"object"==typeof t){const e=t;if("number"==typeof e.value)return{min:e.value,max:e.value};if(Array.isArray(e.keyframes)&&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 gr(t){let e=0,n=16;const r=t=>{var o,i;const a=parseFloat(String(null!=(o=t.fontSize)?o:""))||0;a&&(n=Math.max(n,a));const s=null!=(i=t.text)?i: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 vr=t=>Math.round(1e3*t)/1e3;function yr(t,e){if(!e||null==t)return t;if("number"==typeof t)return t+e;const n=t;return"number"==typeof n.value?y(v({},n),{value:n.value+e}):Array.isArray(n.keyframes)?y(v({},n),{keyframes:n.keyframes.map(t=>y(v({},t),{value:(Number(t.value)||0)+e}))}):t}function br(t,e){var n;if("clip"===e.pathOverflow)return{d:t,startShift:0};const r=pr(t);if(!r||r.closed||r.totalLength<=0)return{d:t,startShift:0};const o=r.totalLength,i=.15*o,a=mr(e.startOffset),s=mr(e.textLength).max||(null!=(n=e.advance)?n:0),l=Math.max(0,-a.min),u=Math.max(0,a.max+s-o),c=l>0?l+i:0,f=u>0?u+i:0;if(f<=0&&c<=0)return{d:t,startShift:0};const d=r.sampleAtDistance(0),h=r.sampleAtDistance(o);let p=t;if(c>0){const e=d.x-Math.cos(d.angle)*c,n=d.y-Math.sin(d.angle)*c,r=t.replace(/^\s*[Mm]\s*-?[\d.]+[\s,]+-?[\d.]+/,"");p="M"+vr(e)+","+vr(n)+"L"+vr(d.x)+","+vr(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"+vr(t)+","+vr(e)}return{d:p,startShift:c}}function kr(t,e,n){if(null!=n)if("number"!=typeof n){if("object"==typeof n&&null!==n){const r=n;if(Array.isArray(r.keyframes)){const n=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,o=v({},n||{}),i={keyframes:r.keyframes};return void 0!==r.loop&&(i.loop=r.loop),o[e]=i,void(t.animate=o)}if("number"==typeof r.value)return void(t[e]=String(r.value))}}else t[e]=String(n)}var Ar=(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 wr(t,e){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function xr(t,e){let n="";for(let r=0;r<t.length;r++){const o=wr(t[r],e);r>0&&45!==o.charCodeAt(0)&&(n+=" "),n+=o}return n}function jr(t,e,n){return[t[0]*e+t[2]*n+t[4],t[1]*e+t[3]*n+t[5]]}var Or=/([MLCQZ])|(-?\d*\.?\d+(?:e[-+]?\d+)?)/gi;function Sr(t,e,n=2){const r=[];let o;for(Or.lastIndex=0;null!==(o=Or.exec(t));)r.push(o[0]);let i="",a=0;const s=()=>parseFloat(r[a++]);for(;a<r.length;){const t=r[a++];if("M"===t||"L"===t){const[r,o]=jr(e,s(),s());i+=t+xr([r,o],n)}else if("C"===t){const[t,r]=jr(e,s(),s()),[o,a]=jr(e,s(),s()),[l,u]=jr(e,s(),s());i+="C"+xr([t,r,o,a,l,u],n)}else if("Q"===t){const[t,r]=jr(e,s(),s()),[o,a]=jr(e,s(),s());i+="Q"+xr([t,r,o,a],n)}else"Z"!==t&&"z"!==t||(i+="Z")}return i}var Pr=["fontFamily","fontSize","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","textDecoration","textTransform","whiteSpace","x","y","dx","dy","lengthAdjust","fill","stroke","strokeWidth","effects",B,q,"xml:space"];function Mr(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return isNaN(e)?void 0:e}}function _r(t){return"string"==typeof t?t:void 0}function zr(t,e){var n,r,o,i,a,s,l;return{fontFamily:null!=(n=_r(t.fontFamily))?n:e.fontFamily,fontSize:null!=(r=Mr(t.fontSize))?r:e.fontSize,fill:null!=(o=t.fill)?o:e.fill,stroke:null!=(i=t.stroke)?i:e.stroke,strokeWidth:null!=(a=t.strokeWidth)?a:e.strokeWidth,letterSpacing:null!=(s=Mr(t.letterSpacing))?s:e.letterSpacing,wordSpacing:null!=(l=Mr(t.wordSpacing))?l:e.wordSpacing}}function Ir(t){var e,n,r;return{fontFamily:_r(t.fontFamily),fontSize:null!=(e=Mr(t.fontSize))?e:16,fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth,letterSpacing:null!=(n=Mr(t.letterSpacing))?n:0,wordSpacing:null!=(r=Mr(t.wordSpacing))?r:0}}function Nr(t){const e={};return void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),e}function Cr(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 Er(t){const e=Object.keys(t);return 1===e.length?t[e[0]]:void 0}function Tr(t,e){if(t<=0||e<=0)return"";const n=.08,r=t*n,o=.92*t,i=.92*-e,a=o-r,s=-i,l=Math.max(1,.12*Math.min(a,s)),u="M"+r+" 0L"+o+" 0L"+o+" "+i+"L"+r+" "+i+"Z";if(a<=2*l||s<=2*l)return u;const c=r+l,f=o-l,d=-l,h=i+l;return u+"M"+c+" "+d+"L"+c+" "+h+"L"+f+" "+h+"L"+f+" "+d+"Z"}function Fr(t,e){var n,r,o,i;const{glyphs:a,create:s=Ar,warnings:l}=e,u=Er(a),c={x:null!=(n=Mr(t.x))?n:0,y:null!=(r=Mr(t.y))?r:0},f=[],d=[{start:c.x,end:c.x}];let h=0;const p=(t,e)=>{var n;const r=Cr(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,p=Nr(e);for(let n=0;n<t.length;n++){const a=t.charAt(n),l=null==r?void 0:r.glyphs[a];if(l&&l.d)f.push({glyphD:l.d,m:[i,0,0,i,c.x,c.y],paint:p,line:h,x:c.x,y:c.y,scale:i}),c.x+=l.width*i;else if(/\S/.test(a)){const t=l&&l.width>0?l.width:.6*o;f.push({glyphD:Tr(t,s),m:[i,0,0,i,c.x,c.y],paint:p,line:h,x:c.x,y:c.y,scale:i}),c.x+=t*i}else c.x+=(l?l.width:0)*i;c.x+=e.letterSpacing+(" "===a?e.wordSpacing:0),d[h].end=c.x}},m=(t,e)=>{var n,r,o,i;const a=zr(t,e),s=Mr(t.x),l=Mr(t.y);void 0!==s&&(c.x=s,h=d.length,d.push({start:c.x,end:c.x})),void 0!==l&&(c.y=l),c.x+=null!=(n=Mr(t.dx))?n:0,c.y+=null!=(r=Mr(t.dy))?r:0;const u=null!=(o=_r(t[B]))?o:_r(t[q]);if(u&&!(null==(i=t.children)?void 0:i.length)&&p(u,a),t.children)for(const e of t.children)m(e,a)},g=Ir(t);if(t.children)for(const e of t.children)m(e,g);const v=null!=(o=_r(t[B]))?o:_r(t[q]);v&&!(null==(i=t.children)?void 0:i.length)&&p(v,g);const y=_r(t.textAnchor);if("middle"===y||"end"===y)for(const t of f){const e=d[t.line].end-d[t.line].start,n="middle"===y?-e/2:-e;t.m=[t.scale,0,0,t.scale,t.x+n,t.y]}return Kr(t,Zr(f,s,l),s)}function Lr(t,e){var n,r,o,i,a,s;if(null==(n=e.alongPath)?void 0:n.pathD)return function(t,e,n){var r,o;const{glyphs:i,warnings:a,alongPath:s}=n,l=pr(e);if(!l)return null==a||a.push("textGlyphs: unparsable along-path geometry (caret)"),[];const u=Er(i),c=[];let f=0;const d=(t,e)=>{var n,r,o;const s=zr(t,e),l=null!=(n=_r(t[B]))?n:_r(t[q]);if(l&&!(null==(r=t.children)?void 0:r.length)){const t=Cr(s,i,u,a),e=(null==t?void 0:t.unitsPerEm)||1e3,n=s.fontSize/e,r=(null!=(o=null==t?void 0:t.ascent)?o:.9*e)*n;for(let e=0;e<l.length;e++){const o=l.charAt(e),i=null==t?void 0:t.glyphs[o],a=(i?i.width:0)*n,u=a+s.letterSpacing+(" "===o?s.wordSpacing:0);c.push({advStart:f,advEnd:f+u,glyphW:a,ascent:r,fontSize:s.fontSize}),f+=u}}if(t.children)for(const e of t.children)d(e,s)};d(t,Ir(t));const h=f,p=Sn(null==s?void 0:s.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,v=Sn(null==s?void 0:s.startOffset),{along:y,perp:b}=Ur(t),k=y+("animated"===v.kind?Number(null==(o=v.keyframes[0])?void 0:o.value)||0:"static"===v.kind&&Number(v.value)||0),A=t=>({x:t.x-b*Math.sin(t.angle),y:t.y+b*Math.cos(t.angle),angle:t.angle});return c.map(t=>{const e=k+t.advStart*g,n=k+t.advEnd*g,r=A(l.sampleAtDistance(e)),o=A(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:l,warnings:u}=e,c=Er(l),f={x:null!=(r=Mr(t.x))?r:0,y:null!=(o=Mr(t.y))?o:0},m=[],g=[{start:f.x,end:f.x}];let v=0;const y=(t,e)=>{var n;const r=Cr(e,l,c,u),o=(null==r?void 0:r.unitsPerEm)||1e3,i=e.fontSize/o,a=(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),s=null==r?void 0:r.glyphs[o],l=(s?s.width:0)*i+e.letterSpacing+(" "===o?e.wordSpacing:0);m.push({x:f.x,y:f.y,width:l,ascent:a,fontSize:e.fontSize,line:v}),f.x+=l,g[v].end=f.x}},b=(t,e)=>{var n,r,o,i;const a=zr(t,e),s=Mr(t.x),l=Mr(t.y);void 0!==s&&(f.x=s,v=g.length,g.push({start:f.x,end:f.x})),void 0!==l&&(f.y=l),f.x+=null!=(n=Mr(t.dx))?n:0,f.y+=null!=(r=Mr(t.dy))?r:0;const u=null!=(o=_r(t[B]))?o:_r(t[q]);if(u&&!(null==(i=t.children)?void 0:i.length)&&y(u,a),t.children)for(const e of t.children)b(e,a)},k=Ir(t);if(t.children)for(const e of t.children){const t=m.length;if(b(e,k),m.length===t){const t=zr(e,k),n=Cr(t,l,c),r=(null==n?void 0:n.unitsPerEm)||1e3;m.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:v})}}const A=null!=(a=_r(t[B]))?a:_r(t[q]);A&&!(null==(s=t.children)?void 0:s.length)&&y(A,k);const w=_r(t.textAnchor);if("middle"===w||"end"===w)for(const t of m){const e=g[t.line].end-g[t.line].start;t.x+="middle"===w?-e/2:-e}return m.map(t=>{var e=t,{line:n}=e;return((t,e)=>{var n={};for(var r in t)h.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&d)for(var r of d(t))e.indexOf(r)<0&&p.call(t,r)&&(n[r]=t[r]);return n})(e,["line"])})}function Dr(t,e,n,r,o=0){const{x:i,y:a,angle:s}=t.sampleAtDistance(e),l=Math.cos(s),u=Math.sin(s),c=r/2;return[n*l,n*u,-n*u,n*l,i-n*l*c-o*u,a-n*u*c+o*l]}function Ur(t){var e,n,r;return{along:(null!=(e=Mr(t.x))?e:0)+(null!=(n=Mr(t.dx))?n:0),perp:null!=(r=Mr(t.dy))?r:0}}function Rr(t,e,n,r,o,i){const{glyphs:a,create:s=Ar,warnings:l}=r,u=e?pr(e):null;if(!u)return null==l||l.push("textGlyphs: unparsable along-path geometry"),null;const c=Er(a),{cells:f,width:d}=function(t,e,n,r){const o=[];let i=0;const a=(t,s)=>{var l,u,c;const f=zr(t,s),d=null!=(l=_r(t[B]))?l:_r(t[q]);if(d&&!(null==(u=t.children)?void 0:u.length)){const t=Cr(f,e,n,r);if(t){const e=f.fontSize/t.unitsPerEm,n=null!=(c=t.ascent)?c:.9*t.unitsPerEm,r=Nr(f);for(let a=0;a<d.length;a++){const s=d.charAt(a),l=t.glyphs[s];if(l&&l.d){const t=l.width*e;o.push({glyphD:l.d,widthEm:l.width,scale:e,paint:r,midBase:i+t/2}),i+=t}else if(/\S/.test(s)){const a=l&&l.width>0?l.width:.6*t.unitsPerEm,s=a*e;o.push({glyphD:Tr(a,n),widthEm:a,scale:e,paint:r,midBase:i+s/2}),i+=s}else i+=(l?l.width:0)*e;i+=f.letterSpacing+(" "===s?f.wordSpacing:0)}}}if(t.children)for(const e of t.children)a(e,f)};return a(t,Ir(t)),{cells:o,width:i}}(t,a,c,l);if(!f.length)return Kr(t,[],s);const{along:h,perp:p}=Ur(t),m=Vr(n),g=Vr(o),b=t=>t>0&&d>0?t/d:1,k="clip"===i&&!u.closed;if(m.animated||g.animated){const e=function(t,e){const n=[...t,...e].sort((t,e)=>t-e),r=[];for(const t of n)r.length&&t===r[r.length-1]||r.push(t);return r}(m.times,g.times),n=(t,e)=>h+m.at(e)+b(g.at(e))*t.midBase,r=m.animated?m.loop:g.loop;return Kr(t,function(t,e,n,r,o,i,a,s=0){const l=Math.max(e.totalLength/Wr,.5),u=t=>t>=0&&t<=e.totalLength,c=[];for(const f of t){const t=[f.scale,0,0,f.scale,-f.scale*(f.widthEm/2),0],d=Sr(f.glyphD,t),h=(t,n)=>{const{x:r,y:o,angle:i}=e.sampleAtDistance(t),a=Math.cos(i),l=Math.sin(i);return{time:n,value:{translate:[qr(r-s*l,3),qr(o+s*a,3)],rotate:qr(180*i/Math.PI,3)}}},p=[],m=[],g=(t,e)=>{p.push(h(t,e)),a&&m.push({time:e,value:u(t)?1:0})};g(n(f,r[0]),r[0]);for(let t=1;t<r.length;t++){const e=r[t-1],o=r[t],i=n(f,e),a=n(f,o),s=Math.min(Br,Math.max(1,Math.ceil(Math.abs(a-i)/l)));for(let t=1;t<=s;t++){const r=e+t/s*(o-e);g(n(f,r),r)}}De(p);const b={keyframes:p};void 0!==o&&(b.loop=o);const k={transform:b};if(a&&m.some(t=>0===t.value)){const t={keyframes:m};void 0!==o&&(t.loop=o),k.opacity=t}c.push(i("path",y(v({d:d},Gr(f.paint)),{animate:k}),[]))}return c}(f,u,n,e,r,s,k,p),s)}const A=b(g.at(0)),w=h+m.at(0);return Kr(t,Zr((k?f.filter(t=>{const e=w+t.midBase*A;return e>=0&&e<=u.totalLength}):f).map(t=>({glyphD:t.glyphD,paint:t.paint,m:Dr(u,w+t.midBase*A,t.scale,t.widthEm,p)})),s,l),s)}function Vr(t){var e;const n=Sn(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 Wr=48,Br=64;function qr(t,e){const n=m(10,e);return Math.round(t*n)/n}function Gr(t){const e={};return void 0!==t.fill&&(e.fill=t.fill),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth),e}function Zr(t,e,n){var r,o,i;if(!t.length)return null==n||n.push("textGlyphs: nothing to render"),[];const a=new Map;for(const e of t){const t=JSON.stringify([null!=(r=e.paint.fill)?r:null,null!=(o=e.paint.stroke)?o:null,null!=(i=e.paint.strokeWidth)?i:null]),n=Sr(e.glyphD,e.m),s=a.get(t);s?s.d+=n:a.set(t,{paint:e.paint,d:n})}const s=[];for(const{paint:t,d:n}of a.values())s.push(e("path",v({d:n},Gr(t)),[]));return s}function Kr(t,e,n){const r={};for(const e of Object.keys(t))"type"!==e&&"children"!==e&&-1===Pr.indexOf(e)&&(r[e]=t[e]);if(r.style&&"object"==typeof r.style){const t=v({},r.style);delete t["white-space"],Object.keys(t).length?r.style=t:delete r.style}return n("g",r,e)}function Xr(t,e){return e.alongPath?Rr(t,e.alongPath.pathD,e.alongPath.startOffset,e,e.alongPath.textLength,e.alongPath.pathOverflow):Fr(t,e)}function Yr(t,e,n,r){if(!e)return t;const o=!!e.trimAllAsOne,i=[],a=t=>{if(Array.isArray(t.children)&&t.children.length>0){for(const e of t.children)a(e);return}const e="string"==typeof t.d?t.d:function(t){var e,n,r,o,i,a,s,l,u,c;if("rect"===t.type){const i=Number(null!=(e=t.x)?e:0),a=Number(null!=(n=t.y)?n:0),s=Number(null!=(r=t.width)?r:0),l=Number(null!=(o=t.height)?o:0);return"M"+(i+s)+","+a+"L"+(i+s)+","+(a+l)+"L"+i+","+(a+l)+"L"+i+","+a+"L"+(i+s)+","+a+"z"}if("ellipse"===t.type||"circle"===t.type){const e=Number(null!=(i=t.cx)?i:0),n=Number(null!=(a=t.cy)?a:0),r="circle"===t.type?Number(null!=(s=t.r)?s:0):Number(null!=(l=t.rx)?l:0),o="circle"===t.type?Number(null!=(u=t.r)?u:0):Number(null!=(c=t.ry)?c:0);if(!(r>0&&o>0))return;const f=r*co,d=o*co,h=(t,e,n,r,o,i)=>"C"+t+","+e+" "+n+","+r+" "+o+","+i;return"M"+(e+r)+","+n+h(e+r,n+d,e+f,n+o,e,n+o)+h(e-f,n+o,e-r,n+d,e-r,n)+h(e-r,n-d,e-f,n-o,e,n-o)+h(e+f,n-o,e+r,n-d,e+r,n)+"z"}return}(t);if(void 0===e)return;const n=He(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){const e=lo(t);r.subpaths.push({subpath:t,lengthPx:e,startOffsetPx:0})}i.push(r)};if(a(t),!i.length)return t;let s=0;const l=o?[...i].reverse():i;for(const t of l)for(const e of t.subpaths)o||(s=0),e.startOffsetPx=s,s+=e.lengthPx;const u=s;if(o&&u<.001)return t;const c=Sn(e.offset),f="absent"===c.kind?{kind:"static",value:0}:c,d=function(t){const e=Sn(t);if("animated"!==e.kind)return e;const n=e.keyframes.map(t=>{var e,n,r,o;return{time:null!=(n=null!=(e=t.time)?e:t.t)?n:0,value:null!=(r=t.value)?r:t.v,easing:null!=(o=t.easing)?o:t.e}});if(!n.some(t=>t.value[0]>t.value[1]))return{kind:"animated",keyframes:n.map(t=>({time:t.time,value:t.value,easing:t.easing}))};const r=[];for(let t=1;t<n.length;t++){const e=n[t-1],o=n[t];if((e.value[1]-e.value[0])*(o.value[1]-o.value[0])<0){const t=ao(e,o);null!==t&&t>e.time&&t<o.time&&r.push(Math.round(t))}}const o=Array.from(new Set(r)).sort((t,e)=>t-e),i=[];let a=0;for(const t of n){for(;a<o.length&&o[a]<t.time;){const t=o[a++],e=so(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}const e=t.value[0]>t.value[1]?[t.value[1],t.value[0]]:t.value;i.push({time:t.time,value:e,easing:t.easing})}for(;a<o.length;){const t=o[a++],e=so(n,t),r=(e[0]+e[1])/2;i.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:i}}(e.range),h="absent"===d.kind?{kind:"static",value:[0,1]}:d,p=function(t){var e;if("absent"===t.kind)return[];if("static"===t.kind)return[t.value];const n=[];for(const r of t.keyframes){const t=null!=(e=r.value)?e:r.v;"number"==typeof t&&n.push(t)}return n}(f),m=[p.length?Math.min(...p):0,p.length?Math.max(...p):0];if(1===i.length&&i[0].leaf===t&&1===i[0].subpaths.length){const e=i[0],n=e.subpaths[0],r=o?u:n.lengthPx;if(r<.001)return t;const a=o?n.startOffsetPx/r:0;return function(t,e,n,r,o,i){const a=$r(n,e,r),s=to(e,r),l=v({},t);return delete l.effects,ro(l,"strokeDasharray",no(i,s)),ro(l,"strokeDashoffset",no(o,a)),ro(l,"strokeOpacity",io(i)),l}(e.leaf,r,a,m,f,h)}const g=new Map;for(const t of i){const e=[];for(const n of t.subpaths){const i=o?u:n.lengthPx;if(i<.001)continue;const a=o?n.startOffsetPx/i:0;e.push(...Jr(t.leaf,n.subpath,i,a,m,f,h,r))}g.set(t.leaf,Qr(t.leaf,e))}const b=t=>{const e=g.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?y(v({},t),{children:t.children.map(b)}):t)};return b(t)}function Qr(t,e){const n=y(v({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function Jr(t,e,n,r,o,i,a,s){const l=$r(r,n,o),u=to(n,o),c=no(i,l),f=no(a,u),d=io(a),h=function(t){return{type:"path",d:t}}(Rt(e));return ro(h,"strokeDasharray",f),ro(h,"strokeDashoffset",c),ro(h,"strokeOpacity",d),[h]}var Hr=1;function $r(t,e,n){const[r]=eo(n);return n=>e*(-n-r+t)+Hr}function to(t,e){const[n,r]=eo(e),o=r-n+1;return e=>{const n=le(e[0],0,1),r=le(e[1],0,1),i=Math.min(n,r),a=Math.max(n,r),s=[0];let l=Hr;for(let e=0;e<o;e++)s.push(l+i*t),s.push((a-i)*t),l=(1-a)*t;return s.push(l+Hr),s}}function eo(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function no(t,e){if("absent"!==t.kind)return"static"===t.kind?{kind:"static",value:e(t.value)}:{kind:"animated",keyframes:t.keyframes.map(t=>{var n,r,o,i;return{time:null!=(r=null!=(n=t.time)?n:t.t)?r:0,value:e(null!=(o=t.value)?o:t.v),easing:null!=(i=t.easing)?i:t.e}}),loop:t.loop}}function ro(t,e,n){var r,o;if(!n)return;if("static"===n.kind)return void(t[e]=n.value);const i=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0,a=v({},i||{}),s={keyframes:n.keyframes};void 0!==n.loop&&(s.loop=n.loop),a[e]=s,t.animate=a;const l=n.keyframes[0];l&&void 0!==(null!=(r=l.value)?r:l.v)&&(t[e]=null!=(o=l.value)?o:l.v)}var oo=10;function io(t){var e,n,r,o,i,a;const s=t=>t[0]===t[1];if("absent"===t.kind)return;if("static"===t.kind)return s(t.value)?{kind:"static",value:0}:void 0;const l=t.keyframes;let u=!1,c=!0;for(const t of l)s(null!=(e=t.value)?e:t.v)?u=!0:c=!1;if(!u)return;if(c)return{kind:"static",value:0};const f=[];for(let t=0;t<l.length;t++){const e=l[t],u=t>0?l[t-1]:void 0,c=t<l.length-1?l[t+1]:void 0,d=null!=(r=null!=(n=e.time)?n:e.t)?r:0,h=s(null!=(o=e.value)?o:e.v),p=u?h&&s(null!=(i=u.value)?i:u.v):h,m=c?h&&s(null!=(a=c.value)?a:c.v):h;p&&!m?(f.push({time:d,value:0}),f.push({time:d+oo,value:1})):!p&&m&&(f.push({time:d-oo,value:1}),f.push({time:d,value:0}))}return f.length<=1?void 0:{kind:"animated",keyframes:f}}function ao(t,e){const n=n=>{const r=(n-t.time)/(e.time-t.time),o=t.value[0]+(e.value[0]-t.value[0])*r;return t.value[1]+(e.value[1]-t.value[1])*r-o};let r=t.time,o=e.time,i=n(r);if(0===i)return r;const a=n(o);if(0===a)return o;if(i*a>0)return null;for(let t=0;t<100;t++){const t=(r+o)/2,e=n(t);if(0===e||Math.abs(o-r)<1e-4)return t;i*e<0?o=t:(r=t,i=e)}return(r+o)/2}function so(t,e){if(e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let n=1;n<t.length;n++)if(e<=t[n].time){const r=t[n-1],o=t[n],i=(e-r.time)/(o.time-r.time);return[r.value[0]+(o.value[0]-r.value[0])*i,r.value[1]+(o.value[1]-r.value[1])*i]}return t[t.length-1].value}function lo(t){const e=t.v;if(!e||e.length<2)return 0;let n=0;for(let r=0;r<e.length-1;r++)n+=uo(t,r,r+1);return t.c&&e.length>1&&(n+=uo(t,e.length-1,0)),n}function uo(t,e,n){var r,o,i,a;const s=t.v,l=s[e],u=s[n],c=he(l,null!=(o=null==(r=t.o)?void 0:r[e])?o:l,null!=(a=null==(i=t.i)?void 0:i[n])?a:u,u);return c.ds[c.ds.length-1]}var co=.5522847498307936;function fo(t){var e,n;const r={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:(null==(e=Ft(t))?void 0:e.mode)===V.frames?W.frames:W.webapi,glyphs:null==(n=Lt(t))?void 0:n.glyphs},o=Un(t);Dn(o,r.idMap),Nn(o,r,()=>Fn(r,"inner")),function(t,e){const n=new Set,r=t=>{var o,i;const a=null==(i=null==(o=t.effects)?void 0:o.maskedBy)?void 0:i.href;if("string"==typeof a){n.add(t);const r=e.idMap.get(a);r&&n.add(r)}if(Array.isArray(t.children))for(const e of t.children)r(e)};if(r(t),0===n.size)return;const o=(t,r)=>{if(n.has(t)&&e.maskAncestorChains.set(t,r),Array.isArray(t.children)){const n=tr(t,e),i=n?[...r,n]:r;for(const e of t.children)o(e,i)}};o(t,[])}(o,r);const i=function(t,e){return function(t,e){e.idMap.clear(),Dn(t,e.idMap);const n=[],r=t=>{var e;ar(t)&&n.push(t),null==(e=t.children)||e.forEach(r)};r(t);const o=new Map;for(const t of n){let n=0;const r=new Set,i=o=>{var a;if(o){if(o!==t&&ar(o)&&n++,"use"===o.type&&o.href){const t=Ln(o.href);t&&!r.has(t)&&(r.add(t),i(e.idMap.get(t)))}null==(a=o.children)||a.forEach(i)}},a=Ln(t.href);a&&(r.add(a),i(e.idMap.get(a))),o.set(t,n)}n.sort((t,e)=>{var n,r;return(null!=(n=o.get(e))?n:0)-(null!=(r=o.get(t))?r:0)});for(const t of n){const n=ar(t);n&&(sr(t),lr(t,or(n),e))}}(t,e),t}(ho(o,r),r);return function(t,e){if(!e.length)return;(t.children||(t.children=[])).unshift({type:"defs",children:e})}(i,r.defs),{root:i,defs:r.defs,warnings:r.warnings,errors:r.errors}}function ho(t,e){t.children&&(t.children=t.children.map(t=>ho(t,e)));const n=t.effects,r="string"==typeof t.id?t.id:void 0,o=r?e.contentRefInnerIds.get(r):void 0;if(!n&&!o)return t;const{transformation:i,repeater:a,maskedBy:s,clipPath:l,trimPath:u,clone:c,fillGradient:f,strokeGradient:d,textPath:h,text:p}=null!=n?n:{};null==n||n.isCombinedShape;n&&delete t.effects;let m=t,g=!1;if(null==p?void 0:p.useGlyphs)if(h){const t="string"==typeof h.path?h.path:void 0,n=function(t,e,n,r,o,i){return e.glyphs?Rr(t,n,r,{glyphs:e.glyphs,warnings:e.warnings},o,i):(e.warnings.push("textGlyphs: no definitions.glyphs"),null)}(m,e,t,h.startOffset,h.textLength,h.pathOverflow);n&&(m=n,g=!0)}else m=function(t,e,n){return(null==e?void 0:e.useGlyphs)?n.glyphs?Fr(t,{glyphs:n.glyphs,warnings:n.warnings}):(n.warnings.push("textGlyphs: no definitions.glyphs — left as native <text>"),t):t}(m,p,e),g=!0;return g||(m=function(t,e,n){var r;if(!e||"string"!=typeof e.path||!e.path)return t;const o=Fn(n,"tpath"),{d:i,startShift:a}=br(e.path,{pathOverflow:e.pathOverflow,startOffset:e.startOffset,textLength:e.textLength,advance:gr(t)});n.defs.push({type:"path",id:o,d:i});const s={type:"textPath",href:"#"+o,children:null!=(r=t.children)?r:[]};return void 0!==e.lengthAdjust&&(s.lengthAdjust=e.lengthAdjust),void 0!==e.method&&(s.method=e.method),void 0!==e.spacing&&(s.spacing=e.spacing),kr(s,"startOffset",yr(e.startOffset,a)),kr(s,"textLength",e.textLength),t.children=[s],t}(m,h,e)),m=function(t,e,n){return Rn(t,e,n,"fill")}(m,f,e),m=function(t,e,n){return Rn(t,e,n,"stroke")}(m,d,e),m=Yr(m,u,0,e),m=function(t,e,n){var r,o;if(!e)return t;const i=null!=(r=e.copies)?r:1;if(i<1)return n.errors.push("repeater.copies invalid: "+e.copies),t;const a=t.transform,s=null==(o=t.animate)?void 0:o.transform,l=Un(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate),delete l.id;const u=[l];for(let t=1;t<i;t++){const r=Un(l),o=rr(e,t),i=o?_n(r,o,n):r;u.push(i)}const c={type:"g",children:u};return t.id&&(c.id=t.id),void 0!==a&&(c.transform=a),void 0!==s&&(c.animate={transform:s}),c}(m,a,e),m=Gn(m,s,i,e),m=function(t,e,n){if(!e||!e.d&&!e.animate)return t;const r=Fn(n,"clip"),o={type:"path",d:e.d};return e.animate&&(o.animate={d:e.animate}),n.defs.push({type:"clipPath",id:r,children:[o]}),t.clipPath="url(#"+r+")",t}(m,l,e),o?(nr(m,c,e),m=Cn(m,i,r,o,e)):m=function(t,e,n,r){return nr(t,e,r),_n(t,n,r)}(m,c,i,e),(null==c?void 0:c.retime)&&(t.effects={clone:{retime:c.retime}}),r&&e.idMap.set(r,m),m}function po(t,e,n){var r,o;let i=fo(t).root;return i=un(i,null!=(o=null==(r=Ft(i))?void 0:r.duration)?o:1e3),e===W.webapi&&(i=Qe(i,null==n?void 0:n.motionPath),i=bn(i),i=function(t){const e=t=>t.startsWith("#")?t.slice(1):t,n=(t,e)=>{var r;e(t),null==(r=t.children)||r.forEach(t=>n(t,e))};let r=!0;for(;r;){r=!1;const o=new Set;n(t,t=>{"use"===t.type&&"string"==typeof t.href&&o.add(e(t.href))}),n(t,t=>{if(!t.children)return;let e=t.children;"defs"===t.type&&(e=e.filter(t=>!(("g"===t.type||"symbol"===t.type)&&"string"==typeof t.id&&!o.has(t.id)))),e=e.filter(t=>!("defs"===t.type&&(!t.children||0===t.children.length))),e.length!==t.children.length&&(t.children=e,r=!0)})}return t}(i)),i}function mo(t){const e=globalThis;"function"!=typeof e.cancelAnimationFrame?e.clearTimeout(t):e.cancelAnimationFrame(t)}function go(t,e,n){var r;const o=Ft(t)||{},i=dn(t,W.frames),a=o.iterations;let s=1;"number"==typeof a&&(s=a||1),"infinite"===a&&(s=1/0),s<1&&(s=1);const l=+(o.duration||1e3),u=l&&s?l*(s===1/0?1/0:s):l?(null!=s?s:1)*l:0,c=o.direction||"normal",f=null!=(r=o.fill)?r:"forwards",d="forwards"===f||"both"===f,h="backwards"===f||"both"===f;let p=null,m=!1,g=-(o.delay||0),v=0,y=1,b=!1;const k=o.frameRate,A=k&&k>0?1e3/k:0;let w=0;const x=()=>{const t=v?(Date.now()-v)*y:0;return g+t},j=()=>{let t=x();return Number.isFinite(u)&&t>u&&(t=u),t<0&&(t=0),t};function O(t){let n=function(){const e=l>0?l:1;let n=0,r=0;if(l>0){t=le(t,0,s*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,s-1);n=le((t-r*e)/e,0,1)}else n=t;const o=c||"normal";let i=n;return"reverse"===o?i=1-n:"alternate"===o?r%2==1&&(i=1-n):"alternate-reverse"===o&&r%2==0&&(i=1-n),i}();for(const t of i||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=pn(r,n*l);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}o.delay&&(o.delay<0?O(j()):h&&O(0));const S=()=>!!m&&(!!e.isConnected()&&(y<0?x()>0:!(Number.isFinite(u)&&j()>=u))),P=t=>{null!==p&&(mo(p),p=null),(t||S())&&(p=function(t){const e=globalThis;return"function"==typeof e.requestAnimationFrame?e.requestAnimationFrame(t):e.setTimeout(t,16)}(()=>{p=null,(()=>{var t,r;if(!e.isConnected())return void M();const o=j(),i=x();if(i<0&&y>0)h&&O(0);else{if(y<0&&i<=0)return M(),O(0),void(b||(b=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)));if(y>0&&u&&Number.isFinite(u)&&o>=u)return M(),O(d?u:0),void(b||(b=!0,null==(r=null==n?void 0:n.onFinish)||r.call(n)));if(A>0){const t=Date.now();if(w&&t-w<A)return;w=t}O(o)}})(),P()}))},M=()=>{if(!m)return;let t=x();Number.isFinite(u)&&t>u&&(t=u),g=t,v=0,m=!1,null!==p&&(mo(p),p=null),t>=0?O(t):h&&O(0)},_={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>S(),play:()=>{var t;(()=>{if(!m){if(y>=0)Number.isFinite(u)&&g>=u&&(g=0);else if(g<=0){if(!Number.isFinite(u))return void console.warn("play: cannot start reverse playback of an infinite animation from time 0");g=u}b=!1,m=!0,v=Date.now(),P(!0)}})(),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;M(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;M(),g=0,v=0,m=!1,b=!1,O(g),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;g=Number.isFinite(u)?u:j(),v=0,m=!1,null!==p&&(mo(p),p=null),O(d?g:0),t&&!b&&(b=!0,null==(e=null==n?void 0:n.onFinish)||e.call(n))})(!0)},setPlaybackRate:t=>{if(!isFinite(t)||0===t)return void console.warn("setPlaybackRate: rate must be finite and non-zero");let e=x();Number.isFinite(u)&&e>u&&(e=u),t<0!=y<0&&(b=!1),y=t,g=e,m&&(v=Date.now())},getCurrentTime:()=>j(),setCurrentTime:t=>{t<0&&(t=0),Number.isFinite(u)&&t>u&&(t=u),g=t,m&&(v=Date.now()),(!Number.isFinite(u)||t<u)&&(b=!1),O(j())},destroy:()=>{var t;_.cancel(),null==(t=null==n?void 0:n.onRemove)||t.call(n)}};return _}var vo=[1,0,0,1,0,0];function yo(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}var bo=(t,e)=>[1,0,0,1,t,e],ko=(t,e)=>[t,0,0,e,0,0];function Ao(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var wo=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],xo=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function jo(t){let e=vo;t.translate&&(e=yo(e,bo(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=yo(e,bo(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=yo(e,Ao(t.rotate))),t.scale&&(e=yo(e,ko(t.scale[0],t.scale[1]))),n&&(e=yo(e,bo(-t.origin[0],-t.origin[1]))),e}function Oo(t,e,n){return t+(e-t)*n}function So(t,e){return null==t?vo:"string"==typeof t?function(t){let e=vo;const n=/(translate|rotate|scale|matrix|skewX|skewY)\(([^)]*)\)/g;let r;for(;r=n.exec(t);){const t=r[1],n=r[2].split(/[\s,]+/).filter(Boolean).map(Number);"translate"===t?e=yo(e,bo(n[0]||0,n[1]||0)):"scale"===t?e=yo(e,ko(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=yo(e,Ao(n[0])):"skewX"===t?e=yo(e,wo(n[0])):"skewY"===t?e=yo(e,xo(n[0])):"matrix"===t&&(e=yo(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?jo(function(t,e){var n,r,o,i,a,s,l;if(!t.length)return{};if(e<=(null!=(n=t[0].time)?n:0))return t[0].value||{};if(e>=(null!=(r=t[t.length-1].time)?r:0))return t[t.length-1].value||{};let u=0;for(;u<t.length-1&&(null!=(o=t[u+1].time)?o:0)<e;)u++;const c=t[u],f=t[u+1],d=(e-(null!=(i=c.time)?i:0))/((null!=(a=f.time)?a:0)-(null!=(s=c.time)?s:0)||1),h=c.value||{},p=f.value||{},m={};return h.translate&&p.translate?m.translate=[Oo(h.translate[0],p.translate[0],d),Oo(h.translate[1],p.translate[1],d)]:m.translate=h.translate||p.translate,void 0!==h.rotate&&void 0!==p.rotate?m.rotate=Oo(h.rotate,p.rotate,d):m.rotate=null!=(l=h.rotate)?l:p.rotate,h.scale&&p.scale?m.scale=[Oo(h.scale[0],p.scale[0],d),Oo(h.scale[1],p.scale[1],d)]:m.scale=h.scale||p.scale,m.origin=h.origin||p.origin,m}(t.keyframes,e)):t.value?jo(t.value):vo}var Po=new Set(["svg","g","symbol"]),Mo=new Set(["defs","mask","clipPath","title"]);function _o(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>_o(t,e))}function zo(t){return null==t?0:Number(t)}function Io(t){return Math.round(100*t)/100+0}function No(t,e,n){var r,o,i,a,s;const l=null!=(r=t.fill)?r:"",u=null!=(o=t.stroke)?o:"",c=null!=(a=null!=(i=t["stroke-width"])?i:t.strokeWidth)?a:"",f=Io(function(t,e,n,r){var o,i,a,s,l,u;if(t&&t.keyframes&&t.keyframes.length){const e=t.keyframes;if(r<=(null!=(o=e[0].time)?o:0))return e[0].value;if(r>=(null!=(i=e[e.length-1].time)?i:0))return e[e.length-1].value;let n=0;for(;n<e.length-1&&(null!=(a=e[n+1].time)?a:0)<r;)n++;const c=e[n],f=e[n+1],d=(r-(null!=(s=c.time)?s:0))/((null!=(l=f.time)?l:0)-(null!=(u=c.time)?u:0)||1);return Oo(c.value,f.value,d)}return void 0!==e?Number(e):n}(null==(s=t.animate)?void 0:s.opacity,t.opacity,1,n)),d=t.mask?1:0,h=e.map(Io).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return zo(t.width)+","+zo(t.height)+","+zo(t.x)+","+zo(t.y);case"ellipse":return zo(t.rx)+","+zo(t.ry)+","+zo(t.cx)+","+zo(t.cy);case"circle":return zo(t.r)+","+zo(t.cx)+","+zo(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+h+"]|f:"+l+"|s:"+u+"|sw:"+(zo(c)||"")+"|o:"+f+"|m:"+d}function Co(t,e,n,r,o){var i;const a=t.type||"";if(Mo.has(a))return;const s=yo(e,function(t,e){return t.animate&&t.animate.transform?So(t.animate.transform,e):void 0!==t.transform?So(t.transform,e):vo}(t,n));if("use"===a){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",i=r.get(e),a=yo(s,bo(zo(t.x),zo(t.y)));return void(i?Co(i,a,n,r,o):o.push("UNRESOLVED_USE:#"+e))}Po.has(a)?null==(i=t.children)||i.forEach(t=>Co(t,s,n,r,o)):o.push(No(t,s,n))}function Eo(t,e){var n;e.add(0);(t=>{var n;if(t&&"object"==typeof t)for(const r of Object.keys(t)){const o=null==(n=t[r])?void 0:n.keyframes;Array.isArray(o)&&o.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)})}})(t.animate),t.transform&&"object"==typeof t.transform&&t.transform.keyframes&&t.transform.keyframes.forEach(t=>{var n;return e.add(null!=(n=t.time)?n:0)}),null==(n=t.children)||n.forEach(t=>Eo(t,e))}function To(t,e){const n=new Map;_o(t,n);const r=[];return Co(t,vo,e,n,r),r.sort()}function Fo(t,e){const n=new Set;Eo(t,n),Eo(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=To(t,o),i=To(e,o),a=Lo(n,i),s=Lo(i,n);(a.length||s.length)&&r.push({time:o,onlyInA:a,onlyInB:s})}return r}function Lo(t,e){const n=new Map;for(const t of e)n.set(t,(n.get(t)||0)+1);const r=[];for(const e of t){const t=n.get(e)||0;t>0?n.set(e,t-1):r.push(e)}return r}function Do(t,e){if(!t)return null;const n=t,{type:a,children:s,style:l}=n,u=((t,e)=>{var n={};for(var a in t)o.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(null!=t&&r)for(var a of r(t))e.indexOf(a)<0&&i.call(t,a)&&(n[a]=t[a]);return n})(n,["type","children","style"]),c=u.funcType;void 0!==c&&delete u.funcType;const f=Lt(t)||e,d=function(t,e){var n;if(t)return"string"==typeof t?null==(n=null==e?void 0:e.styles)?void 0:n[t]:t}(l,f);let h;if(s)for(const t of s){const e=Do(t,f);e&&(h||(h=[]),h.push(e))}const p=function(t,e,n,r,o){if(ke.has(t.toLowerCase()))return console.warn("SVG tag blocked (dangerous): ",t),null;const i=document.createElementNS("http://www.w3.org/2000/svg",t);for(const t in e){const n=Me(t,e[t]);void 0!==n&&(xe.has(t)?i.style[t]=String(n):i.setAttribute(se(t),n))}if(n)for(const t in n)i.style[t]=String(n[t]);if(r)for(const t of r)i.appendChild(t);return o&&(i.textContent=o),i}(a||"g",_e(u),d,h,u[B]||u[q]);return p&&void 0!==c&&p.setAttribute("type",c),p}function Uo(t,e){const{startOn:n,outAction:r="continue",scrollIntoViewThreshold:o=0}=e,i=t.getRootElement();if(!i)return console.warn("setupAnimationTriggers: No root element found for animation."),t;let a=!1;const s=()=>{a&&(a=!1,t.setPlaybackRate(1)),t.play()},l=()=>{switch(r){case"pause":t.pause();break;case"reset":t.cancel();break;case"reverse":a=!0,t.setPlaybackRate(-1),t.play()}};switch(n){case"load":{const t=()=>s();"complete"===document.readyState?t():window.addEventListener("load",t,{once:!0});break}case"mouseOver":{let t=!1;const e=()=>{t=!0,s()},n=()=>{t&&l()};i.addEventListener("mouseenter",e),i.addEventListener("mouseleave",n);break}case"click":{const e=()=>{t.isPlaying()?l():s()};i.addEventListener("click",e);break}case"scrollIntoView":{const t=t=>{var e,n;const r=t.boundingClientRect,o=t.intersectionRect;if(!(null==r?void 0:r.height)||!o)return t.intersectionRatio;const i="undefined"!=typeof window&&window.innerHeight?window.innerHeight:1/0,a=null!=(n=null==(e=t.rootBounds)?void 0:e.height)?n:1/0,s=Math.min(i,a),l=Math.min(r.height,Number.isFinite(s)?s:r.height);return l>0?o.height/l:t.intersectionRatio},e=Array.from({length:21},(t,e)=>e/20);let n=!1;new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&t(e)>=o?(n=!0,s()):n&&(n=!1,l())})},{threshold:e}).observe(i);break}}return t}function Ro(t){return"#"+t}function Vo(t,e,n,r){const o=Ft(t)||{};if(!r)if(t.id){const e=Ro(t.id);(r=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");const i=go(t,e||function(t){const e=new Set,n={isConnected:()=>!t||t.isConnected,setAttribute:(n,r,o)=>{r=se(r);const i=Ro(n),a=(null==t?void 0:t.querySelectorAll(i))||document.querySelectorAll(i);0!==a.length||e.has(i)||(e.add(i),console.warn('setAttribute: No elements found for selector "'+i+'"'));for(let t=0;t<a.length;t++){const e=a[t],n="transform"===r&&"pattern"===e.tagName?"patternTransform":r;e.setAttribute(n,o),re.has(r)&&(e.style[r]=o)}}};return n}(r),n),a=l(s({},i),{getRootElement:()=>r||null});return o.trigger&&Uo(a,o.trigger),a}function Wo(t,e,n,r){var o,i;let a=null!=(o=t.v)?o:t.value;const s=null!=(i=t.e)?i:t.easing,l={offset:e,easing:s&&Array.isArray(s)?"cubic-bezier("+s.join(",")+")":void 0};let u,c=n;if($t.has(n)&&Array.isArray(a))u=Jt(a);else if("transform"!==n||null===a||"object"!=typeof a||Array.isArray(a))if(te.has(n))Array.isArray(a)&&("translate"===n&&(a=a.map(t=>t+"px")),a=a.join(",")),"rotate"===n&&(a+="deg"),u=n+"("+a+")",c="transform";else if("d"===n){u='path("'+(a&&"object"==typeof a&&Array.isArray(a.paths)?a.paths:[]).map(t=>Rt(t,!0)).join("")+'")'}else u=""+a;else u=ne(a,{withUnits:!0}),c="transform";return CSS.supports(c,u)||r.add(c),c=oe(c),l[c]=u,l}function Bo(t,e,n){var r,o,i,a,u;const c=[];for(let f=0;f<e.length;f++){const d=e[f],h=null!=(r=d.t)?r:0;if(h<0){const n=e[f+1];if(n&&(null!=(o=n.t)?o:0)>=0){const e=(0-h)/((null!=(i=n.t)?i:0)-h),r=d.e?Kt(d.e)(e):e,{right:o}=Yt(d.e,e);c.push({t:0,v:on(t,d.v,n.v,r),e:o})}continue}if(h>n){const r=e[f-1];if(r&&(null!=(a=r.t)?a:0)<=n){const e=null!=(u=r.t)?u:0,o=(n-e)/(h-e),i=r.e?Kt(r.e)(o):o,{left:a}=Yt(r.e,o);c.length>0&&(c[c.length-1]=l(s({},c[c.length-1]),{e:a})),c.push({t:n,v:on(t,r.v,d.v,i),e:void 0})}break}c.push(d)}return c}function qo(t,e,n){var r;const o=new Map;for(const[i,a]of Object.entries(t)){const t=n.duration||1,u=Bo(i,a.kfs||a.keyframes||[],t),c=[];for(let n=0;n<u.length;n++){const o=u[n],a=Wo(o,le((null!=(r=o.t)?r:0)/t,0,1),i,e);0===n&&(a.offset||0)>0&&c.push(l(s({},a),{offset:0})),c.push(a)}c.length>0&&(c[c.length-1].offset||0)<1&&c.push(l(s({},c[c.length-1]),{offset:1})),c.length>0&&o.set(i,c)}return o}function Go(t,e,n,r){var o;const i=Ft(t)||{};if(!n)if(t.id){const e=Ro(t.id);(n=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");const a=dn(t,W.webapi),s=[],l=i.iterations;let u;"number"==typeof l&&(u=l),"infinite"===l&&(u=1/0);const c=new Set;let f=!1,d=!1;(null==a?void 0:a.length)||console.warn("createWebApiAnimator: No animation bindings defined");for(const t of a||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("createWebApiAnimator: Empty or unresolved binding",t);continue}const a=Ro(t.id),l=(null==n?void 0:n.querySelectorAll(a))||document.querySelectorAll(a);0===l.length&&console.warn('createWebApiAnimator: No elements found for selector "'+a+'"');const h=qo(r,c,i),p=i.delay&&i.delay>0?i.delay:void 0;let m;if(i.delay&&i.delay<0&&i.duration){const t=-i.delay;m=u===1/0?t%i.duration:Math.min(t,i.duration*(null!=u?u:1))}const g={duration:i.duration,delay:p,fill:null!=(o=i.fill)?o:"forwards",direction:i.direction,iterations:u};for(let t=0;t<l.length;t++){const n=l[t];for(const[,t]of h)if(t.length>0)try{const r=new KeyframeEffect(n,t,g),o=new Animation(r,document.timeline);(null==e?void 0:e.onFinish)&&(o.onfinish=()=>{var t;f||(f=!0,null==(t=e.onFinish)||t.call(e))}),(null==e?void 0:e.onRemove)&&(o.onremove=()=>{var t;d||(d=!0,null==(t=e.onRemove)||t.call(e))}),void 0!==m&&(o.currentTime=m),s.push(o)}catch(t){console.warn(t)}}}if(!r&&c.size)return console.warn("Unsupported CSS attrs: "+[...c].join(", ")),null;const h={isReady:()=>!0,getRootElement:()=>n||null,isPlaying:()=>{var t;return"running"===(null==(t=s[0])?void 0:t.playState)},play:()=>{var t;f=!1,s.forEach(t=>t.play()),null==(t=null==e?void 0:e.onPlay)||t.call(e)},pause:()=>{var t;s.forEach(t=>t.pause()),null==(t=null==e?void 0:e.onPause)||t.call(e)},cancel:()=>{var t;f=!1,s.forEach(t=>t.cancel()),null==(t=null==e?void 0:e.onCancel)||t.call(e)},finish:()=>{var t;for(const e of s)try{(null==(t=e.effect)?void 0:t.getTiming().iterations)===1/0?(e.effect.updateTiming({iterations:1}),e.finish(),e.effect.updateTiming({iterations:1/0})):e.finish()}catch(t){e.cancel()}},setPlaybackRate:t=>(s.forEach(e=>e.playbackRate=t),h),getCurrentTime:()=>{var t,e;const n=null!=(e=null==(t=s[0])?void 0:t.currentTime)?e:null;return null!==n?+n:null},setCurrentTime:t=>{f=!1,s.forEach(e=>{e.currentTime=t})},destroy:()=>{var t;h.cancel(),s.splice(0,s.length),d||(d=!0,null==(t=null==e?void 0:e.onRemove)||t.call(e))}};return i.trigger&&Uo(h,i.trigger),h}function Zo(t,e,n,r){const o=Mt(t);for(const t of o)console.warn("[PxAnimator] effects shape warning:",t);t=po(t,(Ft(t)||{}).mode===V.frames?W.frames:W.webapi);let i=null;if(r){t=ye(t);const e="string"==typeof r?document.querySelector(r):r;e&&(i=Do(t),i&&e.replaceChildren(i))}return function(t,e,n,r){const o=Ft(t)||{};let i,a,u=n;return o.resetOnFinish&&(u=l(s({},n),{onFinish:()=>{var t;null==(t=null==n?void 0:n.onFinish)||t.call(n),null==i||i.cancel()}})),a=o.mode===V.frames?Vo(t,e,u,r):Go(t,u,r,o.mode===V.webapi)||Vo(t,e,u,r),i=a,o.debugInstName&&(window[o.debugInstName]=a),a}(t,e,n,i)}var Ko="data";function Xo(t){const{src:e,data:n,adapter:r,callbacks:o,container:i}=t;if(void 0!==n&&void 0!==e)throw new Error("createAnimator: provide either `src` or `data`, not both");if(void 0===n&&void 0===e)throw new Error("createAnimator: either `src` or `data` is required");if(void 0!==n)return Zo(n,r,o,i);let a=null,s=[],l=!1;const u=t=>{a?t(a):s&&s.push(t)};return fetch(e).then(t=>t.json()).then(t=>{if(!l)if(Et(t)){a=Zo(t,r,o,i);const e=s;s=null,null==e||e.forEach(t=>t(a))}else console.error('createAnimator: invalid animation document format at "'+e+'"')}).catch(t=>{s=null,console.error('createAnimator: failed to load "'+e+'"',t)}),{isReady:()=>!!a,getRootElement:()=>a?a.getRootElement():null,isPlaying:()=>(null==a?void 0:a.isPlaying())||!1,play:()=>{u(t=>t.play())},pause:()=>{u(t=>t.pause())},cancel:()=>{u(t=>t.cancel())},finish:()=>{u(t=>t.finish())},setPlaybackRate:t=>{u(e=>e.setPlaybackRate(t))},getCurrentTime:()=>a?a.getCurrentTime():null,setCurrentTime:t=>{u(e=>e.setCurrentTime(t))},destroy:()=>{l=!0,s=null,null==a||a.destroy()}}}function Yo(){const t=document.querySelectorAll("["+U+"]");for(let e=0;e<t.length;e++){const n=t[e];if(!n[R]){const t=n.getAttribute(U);t&&(n[R]=Xo({src:t,container:n}))}}}"undefined"!=typeof window&&(window.loadTagAnimators=Yo,window.createAnimator=Xo,window.setupAnimationTriggers=Uo);export{$t as COLOUR_ATTR_NAMES,Ko as PX_ANIMATOR_DATA_KEY,R as PX_ANIM_ATTR_NAME,U as PX_ANIM_SRC_ATTR_NAME,Q as PX_TRANSFORM_PART_KEYS,Nt as PxAnimatedSvgDocumentSchema,$ as PxAnimationDefinitionSchema,it as PxAnimatorConfigSchema,W as PxAnimatorEngine,V as PxAnimatorMode,st as PxAttrValueSchema,Ct as PxBezierPathSchema,at as PxBindingSchema,gt as PxCloneEffectSchema,ot as PxDefsSchema,Z as PxEasingOrRefSchema,Pt as PxEffectsSchema,tt as PxElementAnimationSchema,xt as PxFillGradientEffectSchema,yt as PxGradientSpreadMethod,kt as PxGradientStopSchema,bt as PxGradientType,vt as PxGradientUnits,K as PxKeyframeSchema,X as PxLoopSchema,dt as PxMaskedByEffectSchema,_t as PxNodeBase,zt as PxNodeSchema,Y as PxPropertyAnimationSchema,ft as PxRepeaterEffectSchema,mt as PxRetimeEffectSchema,jt as PxStrokeGradientEffectSchema,It as PxSvgNodeExtra,St as PxTextEffectSchema,Ot as PxTextPathEffectSchema,J as PxTransformPartsSchema,H as PxTransformValueSchema,ct as PxTransformationEffectSchema,et as PxTriggerSchema,pt as PxTrimPathEffectSchema,re as STYLE_ATTR_NAMES,te as TRANSFORM_FN_NAMES,fo as applyPlayerEffects,pn as calcAnimationValues,se as camelCaseToKebabWordIfNeeded,Eo as collectSampleTimes,Xo as createAnimator,Zo as createAnimatorImpl,go as createBasicFrameLoopAnimator,Vo as createFrameLoopAnimator,pr as createPathSampler,Go as createWebApiAnimator,L as describeSchema,Fo as diffInEffect,Fe as evaluateMotionPathSegment,br as extendedPathForBrowser,ye as generateNewIds,Ft as getAnimatorConfig,Dt as getBindings,Ut as getChildren,Lt as getDefs,_e as getNormalizedProps,Et as isPxElementFileFormat,Tt as isPxElementFileFormatDeep,Ar as jsonElementFactory,Lr as layoutGlyphTextChars,Yo as loadTagAnimators,po as materialiseAllInTree,bn as materialiseAnimatedUseInstances,Xr as materialiseGlyphText,Rr as materialiseGlyphTextAlongPath,Fr as materialiseGlyphTextHorizontal,ln as materialiseInternalLoopsInPropAnim,un as materialiseInternalLoopsInTree,Le as materialiseMotionPathInPropAnim,Qe as materialiseMotionPathsInTree,dn as normalizeDocument,Ce as propAnimIsMotionPath,D as px,Do as renderNode,F as schemaKeys,Uo as setupAnimationTriggers,yr as shiftAnimatable,Jt as toRGBA,Mt as validateNodeEffects,To as visualModelAt};