@pixodesk/svg-animator-web 1.0.15 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var t,e=Object.defineProperty,n=Object.defineProperties,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=Math.pow,c=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,f=(t,e)=>{for(var n in e||(e={}))s.call(e,n)&&c(t,n,e[n]);if(a)for(var n of a(e))l.call(e,n)&&c(t,n,e[n]);return t},d=(t,e)=>n(t,o(e)),m={};function h(t,e,n){const r={};return"translate"===t?r.translate=e:"rotate"===t?r.rotate=e:r.scale=e,n&&"translate"!==t&&(r.origin=n),r}function p(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};if(void 0!==e.value)return{kind:"static",value:e.value}}return{kind:"static",value:t}}function y(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 v(t,e,n){if(!e)return t;delete t.transform;let r=t;var o;return r=g(r,"skew",e.skew,n),r=b(r,e.origin,!0),r=g(r,"scale",void 0===(o=e.scale)?void 0:Array.isArray(o)?[o[0]/100,o[1]/100]:o,n),r=g(r,"rotate",e.rotate,n),r=b(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=g(r,"translate",e.translate,n):(r=b(r,e.origin,!0),r=g(r,"translate",e.translate,n),r=b(r,e.origin,!1)),r}function g(t,e,n,r){if(void 0===n)return t;if("skew"===e){const e=p(n);return"static"!==e.kind?(r.warnings.push("transformation.skew: only static skew is supported"),t):{type:"g",transform:"skewX("+e.value[0]+")skewY("+e.value[1]+")",children:[t]}}const o=p(n);if("static"===o.kind)return{type:"g",transform:{value:h(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>y(t,h(e,t.value,void 0)))};return o.autoOrient&&(n.autoOrient=!0),{type:"g",animate:{transform:n},children:[t]}}return t}function b(t,e,n){if(void 0===e)return t;const r=p(e),o=t=>n?[-t[0],-t[1]]:t;return"absent"===r.kind?t:"static"===r.kind?0===r.value[0]&&0===r.value[1]?t:{type:"g",transform:{value:{translate:o(r.value)}},children:[t]}:"animated"===r.kind?{type:"g",animate:{transform:{keyframes:r.keyframes.map(t=>y(t,{translate:o(t.value)}))}},children:[t]}:t}function A(t,e,n){var r,o,i;if("use"===t.type&&"content"===(null==(o=null==(r=t.effects)?void 0:r.ref)?void 0:o.type)){const r=t.effects.ref.baseId;"string"==typeof r&&r&&!e.contentRefInnerIds.has(r)&&e.contentRefInnerIds.set(r,n(r))}null==(i=t.children)||i.forEach(t=>A(t,e,n))}function k(t,e,n,r,o){const i=function(t,e){var n;const r={};let o=!1;const i=null==(n=t.animate)?void 0:n.transform;if(i&&"object"==typeof i&&Array.isArray(i.keyframes)){const e=i.keyframes;if(e.some(t=>t.value&&t.value.translate)){const n=j(i),a={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})};i.autoOrient&&(a.autoOrient=!0),r.animate={transform:a};const s=e.some(t=>{const e=t.value||{};return void 0!==e.rotate||void 0!==e.scale}),l=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&&!s||(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});l.every(t=>0===Object.keys(t.value).length)?(delete t.animate.transform,t.animate&&0===Object.keys(t.animate).length&&delete t.animate):t.animate.transform={keyframes:l},o=!0}}const a=void 0!==(null==e?void 0:e.translate),s=o||a;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=w(i.full),r=w(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);s?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)&&delete t.transform:e.translate&&(r.transform=e.translate,e.rest?t.transform=e.rest:delete t.transform)}return r}(t,e);"string"==typeof t.id&&delete t.id;const{outer:a,inner:s}=function(t){if(!t)return{};const e=j(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=v(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=v(u,a,o),u.id=n),u}function w(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 j(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 S(t,e){return"_lw_"+e+"_"+t.nextId++}function x(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>x(t,e))}function _(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(_);const e={};for(const n of Object.keys(t))e[n]=_(t[n]);return e}function O(t,e){const n=new Map,r=t=>{var o;if("string"==typeof t.id){const r=S(e,"retimed");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||"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 P(t,e,n,r){if(!e)return t;if(!e.href)return r.errors.push("maskedBy.href missing — cannot build mask"),t;const o=S(r,"mask");let i={type:"use",href:"#"+e.href};i=function(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=p(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=M(o,"translate",e.translate,void 0,n),o=M(o,"rotate",e.rotate,r,n),o=M(o,"scale",e.scale,r,n),o}(i,n,r);const a={type:"mask",id:o,children:[i]};return e.maskType&&(a.maskType=e.maskType),e.maskUnits&&(a.maskUnits=e.maskUnits),e.maskContentUnits&&(a.maskContentUnits=e.maskContentUnits),r.defs.push(a),t.mask="url(#"+o+")",t}function M(t,e,n,r,o){if(void 0===n)return t;const i=p(n);return"static"===i.kind?{type:"g",transform:{value:h(e,z(e,i.value),r)},children:[t]}:"animated"===i.kind?{type:"g",animate:{transform:{keyframes:i.keyframes.map(t=>y(t,h(e,z(e,t.value),r)))}},children:[t]}:t}function z(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(m,{COLOUR_ATTR_NAMES:()=>re,PX_ANIMATOR_DATA_KEY:()=>Qe,PX_ANIM_ATTR_NAME:()=>at,PX_ANIM_SRC_ATTR_NAME:()=>it,PX_TRANSFORM_PART_KEYS:()=>ht,PxAnimatedSvgDocumentSchema:()=>Vt,PxAnimationDefinitionSchema:()=>vt,PxAnimatorConfigSchema:()=>kt,PxAttrValueSchema:()=>jt,PxBezierPathSchema:()=>Lt,PxBindingSchema:()=>wt,PxDefsSchema:()=>At,PxEasingOrRefSchema:()=>ct,PxEffectsSchema:()=>It,PxElementAnimationSchema:()=>gt,PxKeyframeSchema:()=>ft,PxLoopSchema:()=>dt,PxMaskedByEffectSchema:()=>Pt,PxNodeBase:()=>Tt,PxNodeSchema:()=>Ct,PxPropertyAnimationSchema:()=>mt,PxRefEffectSchema:()=>Et,PxRepeaterEffectSchema:()=>Ot,PxRetimeEffectSchema:()=>zt,PxSvgNodeExtra:()=>Rt,PxTransformPartsSchema:()=>pt,PxTransformValueSchema:()=>yt,PxTransformationEffectSchema:()=>_t,PxTriggerSchema:()=>bt,PxTrimPathEffectSchema:()=>Mt,STYLE_ATTR_NAMES:()=>se,TRANSFORM_FN_NAMES:()=>oe,applyPlayerEffects:()=>R,calcAnimationValues:()=>Fe,camelCaseToKebabWordIfNeeded:()=>ce,collectSampleTimes:()=>An,createAnimator:()=>tn,createAnimatorImpl:()=>He,createBasicFrameLoopAnimator:()=>De,createFrameLoopAnimator:()=>Be,createWebApiAnimator:()=>Xe,describeSchema:()=>rt,diffInEffect:()=>wn,generateNewIds:()=>Ge,getAnimatorConfig:()=>Dt,getBindings:()=>Wt,getChildren:()=>qt,getDefs:()=>Bt,getNormalizedProps:()=>we,isPxElementFileFormat:()=>Ft,isPxElementFileFormatDeep:()=>Ut,loadTagAnimators:()=>en,normalizeDocument:()=>Ve,px:()=>ot,renderNode:()=>je,schemaKeys:()=>nt,setupAnimationTriggers:()=>Se,toRGBA:()=>ee,validateNodeEffects:()=>Nt,visualModelAt:()=>kn}),module.exports=(t=m,((t,n,o,a)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let l of i(n))s.call(t,l)||l===o||e(t,l,{get:()=>n[l],enumerable:!(a=r(n,l))||a.enumerable});return t})(e({},"__esModule",{value:!0}),t));var E="content";function I(t,e){const n={};return t.translate&&(n.translate=[t.translate[0]*e,t.translate[1]*e]),void 0!==t.rotate&&(n.rotate=t.rotate*e),t.scale&&(n.scale=[u(t.scale[0]/100,e),u(t.scale[1]/100,e)]),t.origin&&(n.origin=[t.origin[0]*e,t.origin[1]*e]),n}var N=!0;function T(t,e,n){var r;const o=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)&&o(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)&&o(n.keyframes)}null==(r=t.children)||r.forEach(t=>T(t,e,n))}function C(t,e,n){var r;if(!e&&!n)return t;const o=null!=(r=t.d)?r:function(t){var e,n,r,o;if("rect"!==t.type)return;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"}(t);if(void 0===o)return t;const i=d(f({},t),{type:"g"});delete i.d;const a=i.meta=f({},i.meta||{}),s=a.effects=f({},a.effects||{});return e&&(s.trimPath=e),s.isCombinedShape=!0,i.children=[{type:"path",d:o}],i}function R(t){const e={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map},n=_(t);x(n,e.idMap),A(n,e,()=>S(e,"inner"));const r=L(V(n,e),e);return function(t,e){if(!e.length)return;(t.children||(t.children=[])).unshift({type:"defs",children:e})}(r,e.defs),{root:r,defs:e.defs,warnings:e.warnings,errors:e.errors}}function V(t,e){t.children&&(t.children=t.children.map(t=>V(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,trimPath:l,retime:u,ref:c}=null!=n?n:{},f=null==n?void 0:n.isCombinedShape;n&&delete t.effects;let d=t;return d=C(d,l,f),d=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=_(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate);const u=[l];for(let t=1;t<i;t++){const n=_(l);n.transform={value:I(e,t)},u.push(n)}const c={type:"g",children:u};return void 0!==a&&(c.transform=a),void 0!==s&&(c.animate={transform:s}),c}(d,a,e),d=P(d,s,i,e),d=o?k(d,i,r,o,e):function(t,e,n,r){if(e){const n=e.baseId;if(n){const o=e.type===E&&r.contentRefInnerIds.get(n)||n;t.href="#"+o}else r.errors.push("ref: missing baseId")}return v(t,n,r)}(d,c,i,e),u&&(t.effects={retime:u}),r&&e.idMap.set(r,d),d}function L(t,e){var n;t.children&&(t.children=t.children.map(t=>L(t,e)));const r=null==(n=t.effects)?void 0:n.retime;return r?(delete t.effects,function(t,e,n){var r,o,i,a;if(!e)return t;const s=e.baseId;if(!s)return n.errors.push("retime: missing baseId"),t;const l=n.idMap.get(s);if(!l)return n.warnings.push('retime: target "'+s+'" not found'),t;const u=null!=(r=e.start)?r:0,c=null!=(o=e.stretch)?o:1;if(N){const e=_(l);O(e,n);const r=S(n,"retime");return e.id=r,T(e,u,c),n.defs.push(e),t.href="#"+r,t}const m=("symbol"===l.type?l.children||[]:[l]).map(t=>{const e=_(t);return O(e,n),T(e,u,c),e}),h=d(f({},t),{type:"g",children:m});delete h.href;const p=Number(null!=(i=t.x)?i:0),y=Number(null!=(a=t.y)?a:0);if(p||y){const t="translate("+p+","+y+")";h.transform="string"==typeof h.transform?t+h.transform:t,delete h.x,delete h.y}return h}(t,r,e)):t}function F(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}var U=class{_canSanitize(t){return this.isValid(t)}optional(){return new D(this)}},D=class extends U{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)}},B=class extends U{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(F(null!=n?n:[])+": expected string, got "+typeof t),!1)}},W=class extends U{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(F(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},q=class extends U{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(F(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},K=class extends U{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(F(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},X=class extends U{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(F(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},Y=class extends U{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(F(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))}},J=class extends U{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(F(null!=n?n:[])+": no discriminated union member matched "+this._key+"="+JSON.stringify(r)),!1}return r.isValid(t,e,n)}_canSanitize(t){if(null===t||"object"!=typeof t||Array.isArray(t))return!1;const e=this._findSchema(t);return e?e._canSanitize(t):this._schemas[0]._canSanitize(t)}},Z=class extends U{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(F(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(F(o)+": unexpected extra key"),o.pop(),i=!1);return i}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},G=class extends U{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=f({},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(F(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)}},$=class extends U{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(F(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)}},H=class extends U{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(F(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)}},Q=class extends U{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},tt=class extends U{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)}},et=class extends U{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(F(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 nt(t){return Object.fromEntries(Object.keys(t._shape).map(t=>[t,t]))}function rt(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 ot={string:(t="")=>new B(t),number:(t=0)=>new W(t),boolean:(t=!1)=>new q(t),literal:t=>new K(t),enum:(t,e)=>new X(t,e),union:(t,e)=>new Y(t,e),discriminatedUnion:(t,e)=>new J(t,e),object:t=>new Z(t),openObject:(t,e)=>new G(t,e),extendedObject:(t,e)=>new Z(f(f({},t._shape),e)),array:t=>new $(t),record:t=>new H(t),any:()=>new Q,tuple:t=>new et(t),lazy:(t,e)=>new tt(t,e)},it="data-px-animation-src",at="_px_animator",st="text",lt="textContent",ut=new Set(["type","children","animator","meta","animate",st,lt]),ct=ot.union([ot.string(),ot.tuple([ot.number(),ot.number(),ot.number(),ot.number()])]),ft=(ot.union([ot.string(),ot.number(),ot.array(ot.number()),ot.lazy(()=>pt,{}),ot.object({path:ot.string()}),ot.lazy(()=>ot.object({paths:ot.array(Lt)}),{paths:[]})]),ot.object({time:ot.number().optional(),t:ot.number().optional(),value:ot.any().optional(),v:ot.any().optional(),easing:ct.optional(),e:ct.optional(),tangentOut:ot.tuple([ot.number(),ot.number()]).optional(),to:ot.tuple([ot.number(),ot.number()]).optional(),tangentIn:ot.tuple([ot.number(),ot.number()]).optional(),ti:ot.tuple([ot.number(),ot.number()]).optional(),selected:ot.boolean().optional()})),dt=ot.object({segmentCount:ot.number().optional(),before:ot.boolean().optional(),alternate:ot.boolean().optional()}),mt=ot.object({keyframes:ot.array(ft).optional(),kfs:ot.array(ft).optional(),loop:ot.union([dt,ot.boolean()]).optional(),autoOrient:ot.boolean().optional()}),ht=["translate","rotate","scale","origin"],pt=ot.object({translate:ot.tuple([ot.number(),ot.number()]).optional(),rotate:ot.number().optional(),scale:ot.tuple([ot.number(),ot.number()]).optional(),origin:ot.tuple([ot.number(),ot.number()]).optional()}),yt=ot.union([ot.string(),ot.object({value:pt}),mt]),vt=ot.record(mt),gt=ot.union([ot.string(),ot.array(ot.union([ot.string(),vt])),vt]),bt=ot.object({startOn:ot.enum(["load","mouseOver","click","scrollIntoView","programmatic"]).optional(),outAction:ot.enum(["continue","pause","reset","reverse"]).optional(),scrollIntoViewThreshold:ot.number().optional()}),At=ot.object({easings:ot.record(ot.tuple([ot.number(),ot.number(),ot.number(),ot.number()])).optional(),animations:ot.record(vt).optional(),styles:ot.record(ot.any()).optional()}),kt=ot.object({mode:ot.enum(["auto","webapi","frames"]).optional(),duration:ot.number().optional(),delay:ot.number().optional(),iterations:ot.union([ot.number(),ot.literal("infinite")]).optional(),fill:ot.enum(["forwards","backwards","both","none"]).optional(),direction:ot.enum(["normal","reverse","alternate","alternate-reverse"]).optional(),frameRate:ot.number().optional(),trigger:bt.optional(),definitions:At.optional(),animate:ot.record(gt).optional(),debug:ot.boolean().optional(),debugInstName:ot.string().optional()}),wt=ot.object({id:ot.string(),animate:gt}),jt=ot.union([ot.string(),ot.number(),ot.object({value:ot.any()}),mt]),St=ot.union([ot.number(),ot.object({value:ot.number()}),ot.object({keyframes:ot.array(ft),autoOrient:ot.boolean().optional()})]),xt=ot.union([ot.tuple([ot.number(),ot.number()]),ot.object({value:ot.tuple([ot.number(),ot.number()])}),ot.object({keyframes:ot.array(ft),autoOrient:ot.boolean().optional()})]),_t=ot.object({translate:xt.optional(),rotate:St.optional(),scale:xt.optional(),skew:xt.optional(),origin:xt.optional()}),Ot=ot.object({copies:ot.number().optional(),translate:ot.tuple([ot.number(),ot.number()]).optional(),rotate:ot.number().optional(),scale:ot.tuple([ot.number(),ot.number()]).optional(),origin:ot.tuple([ot.number(),ot.number()]).optional()}),Pt=ot.object({href:ot.string().optional(),maskType:ot.string().optional(),maskUnits:ot.string().optional(),maskContentUnits:ot.string().optional()}),Mt=ot.any(),zt=ot.object({baseId:ot.string().optional(),start:ot.number().optional(),stretch:ot.number().optional(),timeCrop:ot.tuple([ot.number(),ot.number()]).optional()}),Et=ot.object({baseId:ot.string().optional(),type:ot.string().optional()}),It=ot.object({transformation:_t.optional(),repeater:Ot.optional(),maskedBy:Pt.optional(),trimPath:Mt.optional(),retime:zt.optional(),isCombinedShape:ot.boolean().optional(),ref:Et.optional()});function Nt(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!It.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 Tt=ot.openObject({type:ot.string(),id:ot.string().optional(),meta:ot.any().optional(),effects:It.optional(),animate:vt.optional(),style:ot.union([ot.string(),ot.record(ot.union([ot.string(),ot.number()]))]).optional()},jt),Ct=ot.openObject(d(f({},Tt._shape),{children:ot.lazy(()=>ot.array(Ct),[]).optional()}),jt),Rt=ot.object({width:ot.number().optional(),height:ot.number().optional(),viewBox:ot.string().optional(),animator:kt.optional()}),Vt=ot.openObject(d(f(f({},Tt._shape),Rt._shape),{type:ot.literal("svg"),children:ot.array(Ct).optional()}),jt),Lt=ot.object({v:ot.array(ot.array(ot.number())),i:ot.array(ot.array(ot.number())).optional(),o:ot.array(ot.array(ot.number())).optional(),c:ot.boolean().optional()});function Ft(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&("svg"===t.type||"svg"===t.tagName)}function Ut(t){const e=Vt.isValid(t);return{valid:e,errors:e?[]:["Document failed schema validation"]}}function Dt(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 Bt(t){var e;if(t)return null==(e=Dt(t))?void 0:e.definitions}function Wt(t){var e;if(!t)return;const n=null==(e=Dt(t))?void 0:e.animate;return n?Object.entries(n).map(([t,e])=>({id:t,animate:e})):void 0}function qt(t){return null==t?void 0:t.children}function Kt(t,e,n){return t+(e-t)*n}function Xt(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let i=0;i<o;i++)r[i]=Kt(t[i]||0,e[i]||0,n);return r}function Yt(t,e,n){return[Kt(t[0]||0,e[0]||0,n),Kt(t[1]||0,e[1]||0,n),Kt(t[2]||0,e[2]||0,n),Kt(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function Jt(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++)o.push(Zt(t[i],e[i],n));return o}function Zt(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),m=Math.min(t.v.length,e.v.length),h=[],p=[],y=[];for(let n=0;n<m;n++){const f=t.v[n],m=e.v[n];h.push(Xt(f,m,d));const v=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,g=null!=(a=null==(i=e.i)?void 0:i[n])?a:m;p.push(Xt(v,g,d));const b=null!=(l=null==(s=t.o)?void 0:s[n])?l:f,A=null!=(c=null==(u=e.o)?void 0:u[n])?c:m;y.push(Xt(b,A,d))}return{v:h,i:p.length?p: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,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 $t(t){const[e,n,r,o]=t,i=3*n,a=3*(o-n)-i,s=1-i-a;return function(t){return n=Gt(e,r,t),((s*n+a)*n+i)*n;var n}}function Ht(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Qt(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=Gt(n,o,e),s=[n,r],l=[o,i],{left:u,right:c}=function(t,e,n,r,o){const i=Ht(t,e,o),a=Ht(e,n,o),s=Ht(n,r,o),l=Ht(i,a,o),u=Ht(a,s,o),c=Ht(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 m,h;f>1e-9&&Math.abs(d)>1e-9&&(m=[u[1][0]/f,u[1][1]/d,u[2][0]/f,u[2][1]/d]);const p=1-f,y=1-d;return p>1e-9&&Math.abs(y)>1e-9&&(h=[(c[1][0]-f)/p,(c[1][1]-d)/y,(c[2][0]-f)/p,(c[2][1]-d)/y]),{left:m,right:h}}function te(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function ee(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 ne(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 re=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),oe=new Set(["translate","rotate","scale","skew"]),ie=new Set(["offset-distance","offsetDistance"]);function ae(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.scale,u=r?"px":"",c=r?"deg":"";return i&&o.push("translate("+i[0]+u+","+i[1]+u+")"),a&&o.push("translate("+a[0]+u+","+a[1]+u+")"),null!=s&&o.push("rotate("+s+c+")"),l&&o.push("scale("+l[0]+","+l[1]+")"),a&&o.push("translate("+-a[0]+u+","+-a[1]+u+")"),o.join("")}var se=new Set(["offset-distance","offsetDistance"]),le=1e3;var ue=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function ce(t){return ue.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function fe(t,e,n){return Math.max(e,Math.min(t,n))}function de(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 me=1e-4;function he(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])]}var pe="http://www.w3.org/2000/svg",ye=new Set(["svg","g","path","circle","ellipse","rect","line","polyline","polygon","text","tspan","textPath","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker","filter","feGaussianBlur","feOffset","feBlend","feColorMatrix","feMerge","feMergeNode"].map(t=>t.toLowerCase())),ve=["href","src","filter","clipPath","mask","markerStart","markerMid","markerEnd"],ge=new Set(ve),be=["href","src","fill","fillOpacity","fillRule","stroke","strokeWidth","strokeOpacity","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeDasharray","strokeDashoffset","opacity","transform","x","y","cx","cy","r","rx","ry","width","height","d","x1","y1","x2","y2","points","dx","dy","fontSize","fontFamily","fontWeight","fontStyle","textAnchor","letterSpacing","wordSpacing","space","xml:space","textDecoration","textTransform","whiteSpace","white-space","dominantBaseline","alignmentBaseline","rotate","id","class","viewBox","preserveAspectRatio","offset","stopColor","stopOpacity","gradientTransform","clipPath","mask","offsetPath","offsetDistance","offsetRotate","offsetAnchor","offsetPosition","startOffset","textLength","lengthAdjust","filter","stdDeviation","in","in2","result","mode",...ve],Ae=new Set(be.map(t=>t.toLowerCase()));function ke(t,e){const n=t.toLowerCase();if(Ae.has(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() references must be internal url(#id), got:',e):e}if(ge.has(n)){const t=String(e);return t.startsWith("#")||/^url\(#[^)]+\)$/.test(t)?e:void 0}return e}console.warn("Attribute not in whitelist: ",n)}function we(t){const e={};for(const n of Object.keys(t)){if(ut.has(n))continue;if("style"===n)continue;let r=t[n];re.has(n)&&Array.isArray(r)?e[n]=ee(r):"transform"===n&&null!==r&&"object"==typeof r&&!Array.isArray(r)&&r.value&&"object"==typeof r.value?e.transform=ae(r.value,{withUnits:!1}):oe.has(n)?(Array.isArray(r)&&("translate"===n&&(r=r.map(t=>t+"px")),r=r.join(",")),"rotate"===n&&(r+="deg"),e.transform=n+"("+r+")"):null!=r&&(e[n]=String(r))}return e}function je(t,e){if(!t)return null;const n=t,{type:r,children:o,style:i}=n,u=((t,e)=>{var n={};for(var r in t)s.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&a)for(var r of a(t))e.indexOf(r)<0&&l.call(t,r)&&(n[r]=t[r]);return n})(n,["type","children","style"]),c=Bt(t)||e,f=function(t,e){var n;if(t)return"string"==typeof t?null==(n=null==e?void 0:e.styles)?void 0:n[t]:t}(i,c);let d;if(o)for(const t of o){const e=je(t,c);e&&(d||(d=[]),d.push(e))}return function(t,e,n,r,o){if(!ye.has(t.toLowerCase()))return console.warn("Attribute not in whitelist: ",t),null;const i=document.createElementNS(pe,t);for(const t in e)i.setAttribute(ce(t),ke(t,e[t]));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}(r||"g",we(u),f,d,u[st]||u[lt])}function Se(t,e){const{startOn:n,outAction:r="continue",scrollIntoViewThreshold:o=.5}=e,i=t.getRootElement();if(!i)return console.warn("setupAnimationTriggers: No root element found for animation."),t;const a=()=>{t.play()},s=()=>{switch(r){case"pause":t.pause();break;case"reset":t.cancel();break;case"reverse":t.play()}};switch(n){case"load":{const t=()=>a();"complete"===document.readyState?t():window.addEventListener("load",t,{once:!0});break}case"mouseOver":{const t=()=>a(),e=()=>s();i.addEventListener("mouseenter",t),i.addEventListener("mouseleave",e);break}case"click":{const e=()=>{t.isPlaying()?s():a()};i.addEventListener("click",e);break}case"scrollIntoView":new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&t.intersectionRatio>=o?a():s()})},{threshold:o}).observe(i);break}return t}var xe=new WeakMap;function _e(t,e,n,r){const o=xe.get(t);if(o)return o;const i=t.tangentOut,a=e.tangentIn,s=[n[0]+(i?i[0]:0),n[1]+(i?i[1]:0)],l=[r[0]+(a?a[0]:0),r[1]+(a?a[1]:0)],u=function(t,e,n,r,o=100){const i=o+1,a=new Float64Array(i),s=new Float64Array(i);let l=de(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=de(t,e,n,r,i),d=f[0]-l[0],m=f[1]-l[1];u+=Math.sqrt(d*d+m*m),a[c]=i,s[c]=u,l=f}return{ts:a,ds:s}}(n,s,l,r),c={P0:n,P1:s,P2:l,P3:r,lut:u,totalArc:u.ds[u.ds.length-1]};return xe.set(t,c),c}function Oe(t,e,n,r,o,i){const a=_e(t,e,n,r),s=0===a.totalArc?o: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])}(a.lut,o*a.totalArc),l=de(a.P0,a.P1,a.P2,a.P3,s);if(!i)return{translate:l};const u=function(t,e,n,r,o){const i=he(t,e,n,r,o);if(0===i[0]&&0===i[1])return he(t,e,n,r,o<.5?o+me:o-me);return i}(a.P0,a.P1,a.P2,a.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}function Pe(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 Me(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function ze(t){return"string"==typeof t&&void 0!==Me(t)}function Ee(t){if(t&&"object"==typeof t&&"string"==typeof t.path){const e=Me(t.path);return e?{paths:Pe(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&ze(e[0])){const t=[];for(const n of e){const e=Me(n);e&&t.push(...Pe(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&ze(t[0])){const e=[];for(const n of t){const t=Me(n);t&&e.push(...Pe(t))}return{paths:e}}return{paths:t}}if(ze(t)){return{paths:Pe(Me(t))}}return t}function Ie(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 Ne(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 Te(t,e,n,r){var o,i;if("d"===t){return{paths:Jt(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 re.has(t)?Yt(e||[0,0,0,1],n||[0,0,0,1],r):oe.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?Xt(e||[],n||[],r):Kt(+(e||0),+(n||0),r)}function Ce(t,e,n,r){var o,i,a,s,l;const u=e.keyframes||e.kfs||[],c=[];for(const e of u){const n=null!=(i=null!=(o=e.time)?o:e.t)?i:0;let u=null!=(a=e.value)?a:e.v;const f=null!=(s=e.easing)?s:e.e;"d"===t&&(u=Ee(u)),re.has(t)&&(u=null!=(l=ne(u))?l:u),c.push({t:n,v:u,e:Ie(f,r)})}c.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const f=e.loop,d=!0===f?{}:f||void 0;return d&&c.length>=2?function(t,e,n,r){var o,i,a,s,l;const u=e.length-1,c=fe(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,m=null!=(a=e[e.length-1].t)?a:0;let h,p;n.before?(h=0,p=d):(h=m,p=r);const y=p-h;if(y<=0)return e;const v=null!=(s=f[0].t)?s:0,g=(null!=(l=f[f.length-1].t)?l:0)-v;if(g<=0)return e;const b=f.map(t=>({relT:(t.t-v)/g,v:t.v,e:t.e})),A=Math.floor(y/g),k=(y-A*g)/g,w=[];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?te(b[t-1].e):void 0})}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?$t(a.e)(l):l,c=Te(t,a.v,r.v,u),{left:f}=Qt(a.e,l);return w.length>0&&a.relT<=i&&(w[w.length-1].e=f),void w.push({t:e+i*g,v:c,e:void 0})}w.push({t:e+r.relT*g,v:r.v,e:n<o.length-1?r.e:void 0})}}for(let t=0;t<A;t++){const e=n.before?A-1-t:t,r=!!n.alternate&&e%2==0;j(h+t*g,r)}if(k>1e-9){const t=!!n.alternate&&A%2==0;j(h+A*g,t,k)}return n.before?[...w,...e]:[...e,...w]}(t,c,d,n):c}var Re=0;function Ve(t){const e=Dt(t)||{},n=Bt(t),r=e.duration||1e3,o=[],i=(t,e)=>{if(!e)return null;const o=function(t,e){if(!t)return[];const n=[];if("string"==typeof t){const r=Ne(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=Ne(r,e);t&&n.push(t)}else n.push(t);return n}(e,n);if(0===o.length)return null;const i=function(t,e,n){const r={};for(const[o,i]of Object.entries(t)){const t=Ce(o,i,e,n);t.length>0&&(r[o]={kfs:t})}return r}(function(t){const e={};for(const n of t)for(const[t,r]of Object.entries(n))e[t]=r;return e}(o),r,n);return 0===Object.keys(i).length?null:{id:t,animate:i}},a=Wt(t);if(a)for(const t of a){const e=i(t.id,t.animate);e&&o.push(e)}const s=t=>{const e=t.animate;if(e&&Object.keys(e).length>0){const n=t.id||"_px_el_"+ ++Re;t.id=n;const r=i(n,e);r&&o.push(r)}if(t.children)for(let e=0;e<t.children.length;e++)s(t.children[e])};if(t.children)for(let e=0;e<t.children.length;e++)s(t.children[e]);return o}function Le(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;let o=t[0],i=t[t.length-1];for(let a=0;a<t.length-1;a++){const s=null!=(n=t[a].t)?n:0,l=null!=(r=t[a+1].t)?r:0;if(s<=e&&e<=l){o=t[a],i=t[a+1];break}}return{prevKf:o,nextKf:i}}(c,n);let m=f===d?0:(h=n,p=null!=(r=f.t)?r:0,y=null!=(o=d.t)?o:0,v=0,g=1,y===p?v:v+(h-p)/(y-p)*(g-v));var h,p,y,v,g;m=fe(m,0,1);const b=null!=(i=f.e)?i:f.easing;if(b&&Array.isArray(b))try{m=$t(b)(m)}catch(t){}let A=!(k=t).includes("-")&&/[a-z][A-Z]/.test(k)?ce(t):t;var k;let w=null;const j=null!=(a=null==f?void 0:f.v)?a:null==f?void 0:f.value,S=null!=(s=null==d?void 0:d.v)?s:null==d?void 0:d.value;if("d"===A){w=Jt(null!=(l=null==j?void 0:j.paths)?l:Array.isArray(j)?j:[],null!=(u=null==S?void 0:S.paths)?u:Array.isArray(S)?S:[],m).map(t=>function(t){var e,n,r,o;const i=t.v,a=t.i,s=t.o,l=t.c;if(!i.length)return"";const u=[],c=i.length;u.push("M"+i[0][0]+","+i[0][1]);for(let t=1;t<c;t++){const r=i[t-1],o=null!=(e=null==s?void 0:s[t-1])?e:r,l=null!=(n=null==a?void 0:a[t])?n:i[t],c=i[t];o[0]===r[0]&&o[1]===r[1]&&l[0]===c[0]&&l[1]===c[1]?u.push("L"+c[0]+","+c[1]):u.push("C"+o[0]+","+o[1]+","+l[0]+","+l[1]+","+c[0]+","+c[1])}if(l&&c>0){const t=i[c-1],e=null!=(r=null==s?void 0:s[c-1])?r:t,n=null!=(o=null==a?void 0:a[0])?o:i[0],l=i[0];e[0]===t[0]&&e[1]===t[1]&&n[0]===l[0]&&n[1]===l[1]||u.push("C"+e[0]+","+e[1]+","+n[0]+","+n[1]+","+l[0]+","+l[1]),u.push("z")}return u.join("")}(t)).join("")}else if(re.has(A))w=ee(Yt(j||[0,0,0,1],S||[0,0,0,1],m)),A=t;else if("stroke-dasharray"===A)w=Xt(j||[],S||[],m).join(" "),A=t;else if("transform"!==A||null===j||"object"!=typeof j||Array.isArray(j))if("translate"===A){w="translate("+Xt(j||[0,0],S||[0,0],m).join(",")+")",A="transform"}else if("rotate"===A){w="rotate("+Kt(+(j||0),+(S||0),m)+")",A="transform"}else if("scale"===A){w="scale("+Xt(j||[1,1],S||[1,1],m).join(",")+")",A="transform"}else{w=Kt(+(j||0),+(S||0),m)}else{const t=new Set([...j?Object.keys(j):[],...S?Object.keys(S):[]]),n={};for(const e of t){const t=null==j?void 0:j[e],r=null==S?void 0:S[e];if("rotate"===e)n.rotate=Kt(+(null!=t?t:0),+(null!=r?r:0),m);else if("translate"===e||"scale"===e||"origin"===e){const o="scale"===e?[1,1]:[0,0],i=Xt(t||o,r||o,m);n[e]=i}}if(function(t){var e;const n=null!=(e=t.keyframes)?e:t.kfs;if(!Array.isArray(n))return!1;if(t.autoOrient)return!0;for(const t of n)if(t.tangentIn||t.tangentOut)return!0;return!1}(e)){const t=j.translate,r=S.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=Oe(f,d,[+t[0],+t[1]],[+r[0],+r[1]],m,!!e.autoOrient);n.translate=[o.translate[0],o.translate[1]],void 0!==o.rotateDeg&&(n.rotate=o.rotateDeg)}}w=ae(n,{withUnits:!1}),A="transform"}return ie.has(A)&&"number"==typeof w&&(w=100*w+"%"),{k:A,v:null===w?"":""+w}}function Fe(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=Le(r,o,e);t&&(n[t.k]=t.v)}return n}function Ue(t){return"#"+t}function De(t,e,n){const r=Dt(t)||{},o=Ve(t),i=r.iterations;let a=1;"number"==typeof i&&(a=i||1),"infinite"===i&&(a=1/0),a<1&&(a=1);const s=+(r.duration||le),l=s&&a?s*(a===1/0?1/0:a):s?(null!=a?a:1)*s:0,u=r.direction||"normal";let c=null,f=!1,d=r.delay||0,m=0,h=1,p=!1;const y=r.frameRate,v=y&&y>0?1e3/y:0;let g=0;const b=()=>{const t=m?(Date.now()-m)*h:0;let e=d+t;return Number.isFinite(l)&&e>l&&(e=l),e<0&&(e=0),e};function A(t){let n=function(){const e=s>0?s:1;let n=0,r=0;if(s>0){t=fe(t,0,a*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,a-1);n=fe((t-r*e)/e,0,1)}else n=t;const o=u||"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 o||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=Fe(r,n*s);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}r.delay&&A(b());const k=()=>!!f&&(!!e.isConnected()&&!(Number.isFinite(l)&&b()>=l)),w=t=>{null!==c&&(cancelAnimationFrame(c),c=null),(t||k())&&(c=requestAnimationFrame(()=>{c=null,(()=>{var t;if(!e.isConnected())return void j();const r=b();if(v>0){const t=Date.now();if(g&&t-g<v)return;g=t}if(l&&Number.isFinite(l)&&r>=l)return A(l),p||(p=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)),void j();A(r)})(),w()}))},j=()=>{f&&(d=b(),m=0,f=!1,null!==c&&(cancelAnimationFrame(c),c=null),A(d))},S={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>k(),play:()=>{var t;f||(f=!0,m=Date.now(),w(!0)),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;j(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;j(),d=0,m=0,f=!1,p=!1,A(d),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;d=Number.isFinite(l)?l:b(),m=0,f=!1,A(d),t&&!p&&(p=!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");const e=b();h=t,d=e,f&&(m=Date.now())},getCurrentTime:()=>b(),setCurrentTime:t=>{t<0&&(t=0),Number.isFinite(l)&&t>l&&(t=l),d=t,f&&(m=Date.now()),A(b())},destroy:()=>{S.cancel()}};return S}function Be(t,e,n,r){const o=Dt(t)||{};if(!r)if(t.id){const e=Ue(t.id);(r=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");let i=De(t,e||function(t){const e=new Set,n={isConnected:()=>!t||t.isConnected,setAttribute:(n,r,o)=>{r=ce(r);const i=Ue(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];e.setAttribute(r,o),se.has(r)&&(e.style[r]=o)}}};return n}(r),n);return i=d(f({},i),{getRootElement:()=>r||null}),o.trigger&&Se(i,o.trigger),i}function We(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;var f;return re.has(n)&&Array.isArray(a)?u=ee(a):"transform"!==n||null===a||"object"!=typeof a||Array.isArray(a)?oe.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"):u=""+a:(u=ae(a,{withUnits:!0}),c="transform"),CSS.supports(c,u)||r.add(c),c=(f=c).includes("-")?f.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):f,l[c]=u,l}function qe(t,e,n){var r,o,i,a,s;const l=[];for(let u=0;u<e.length;u++){const c=e[u],m=null!=(r=c.t)?r:0;if(m<0){const n=e[u+1];if(n&&(null!=(o=n.t)?o:0)>=0){const e=(0-m)/((null!=(i=n.t)?i:0)-m),r=c.e?$t(c.e)(e):e,{right:o}=Qt(c.e,e);l.push({t:0,v:Te(t,c.v,n.v,r),e:o})}continue}if(m>n){const r=e[u-1];if(r&&(null!=(a=r.t)?a:0)<=n){const e=null!=(s=r.t)?s:0,o=(n-e)/(m-e),i=r.e?$t(r.e)(o):o,{left:a}=Qt(r.e,o);l.length>0&&(l[l.length-1]=d(f({},l[l.length-1]),{e:a})),l.push({t:n,v:Te(t,r.v,c.v,i),e:void 0})}break}l.push(c)}return l}function Ke(t,e,n){var r;const o=new Map;for(const[i,a]of Object.entries(t)){const t=n.duration||1,s=qe(i,a.kfs||a.keyframes||[],t),l=[];for(let n=0;n<s.length;n++){const o=s[n],a=We(o,fe((null!=(r=o.t)?r:0)/t,0,1),i,e);0===n&&(a.offset||0)>0&&l.push(d(f({},a),{offset:0})),l.push(a)}l.length>0&&(l[l.length-1].offset||0)<1&&l.push(d(f({},l[l.length-1]),{offset:1})),l.length>0&&o.set(i,l)}return o}function Xe(t,e,n,r){var o;const i=Dt(t)||{},a=Ve(t);if(!n)if(t.id){const e=Ue(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 s=[],l=i.iterations;let u;"number"==typeof l&&(u=l),"infinite"===l&&(u=1/0);const c=new Set;(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=Ue(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 f=Ke(r,c,i),d=i.delay&&i.delay>0?i.delay:void 0,m=i.delay&&i.delay<0&&i.duration?-i.delay%i.duration:void 0,h={duration:i.duration,delay:d,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 f)if(t.length>0)try{const r=new KeyframeEffect(n,t,h),o=new Animation(r,document.timeline);(null==e?void 0:e.onFinish)&&(o.onfinish=()=>{var t;return null==(t=e.onFinish)?void 0:t.call(e)}),(null==e?void 0:e.onRemove)&&(o.onremove=()=>{var t;return null==(t=e.onRemove)?void 0:t.call(e)}),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 f={isReady:()=>!0,getRootElement:()=>n||null,isPlaying:()=>{var t;return"running"===(null==(t=s[0])?void 0:t.playState)},play:()=>{var t;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;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),f),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=>{s.forEach(e=>{e.currentTime=t})},destroy:()=>{f.cancel(),s.splice(0,s.length)}};return i.trigger&&Se(f,i.trigger),f}var Ye=0;function Je(){return"_px_"+Date.now().toString(36)+(++Ye).toString(36)+Math.random().toString(36).substring(2,6)}function Ze(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>Ze(t));const e=t,n={};for(const t of Object.keys(e))n[t]=Ze(e[t]);return n}function Ge(t){var e,n;const r=Ze(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=Je();o.set(t,n),e.id=n}else e.animate&&(e.id=Je());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]=$e(r,o);else if(s.has(n)){const t=o.get(r);t&&(e[n]=t)}else r.includes("url(#")&&(e[n]=$e(r,o));else if("style"===n&&"object"==typeof r&&null!==r)for(const[t,e]of Object.entries(r))"string"==typeof e&&(r[t]=$e(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=d(f({},r.animator),{animate:t})}return r}function $e(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}function He(t,e,n,r){const o=Nt(t);for(const t of o)console.warn("[PxAnimator] effects shape warning:",t);(Dt(t=R(t).root)||{}).debug=!0;let i=null;if(r&&t.children){t=Ge(t);const e="string"==typeof r?document.querySelector(r):r;e&&(i=je(t),i&&e.replaceChildren(i))}return function(t,e,n,r){const o=Dt(t)||{};let i;return i="frames"===o.mode?Be(t,e,n,r):Xe(t,n,r,"webapi"===o.mode)||Be(t,e,n,r),o.debugInstName&&(window[o.debugInstName]=i),i}(t,e,n,i)}var Qe="data";function tn(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 He(n,r,o,i);let a=null;return fetch(e).then(t=>t.json()).then(t=>{Ft(t)?a=He(t,r,o,i):console.error("Invalid animation document format")}),{isReady:()=>!!a,getRootElement:()=>a?a.getRootElement():null,isPlaying:()=>(null==a?void 0:a.isPlaying())||!1,play:()=>{null==a||a.play()},pause:()=>{null==a||a.pause()},cancel:()=>{null==a||a.cancel()},finish:()=>{null==a||a.finish()},setPlaybackRate:t=>{null==a||a.setPlaybackRate(t)},getCurrentTime:()=>(null==a?void 0:a.getCurrentTime())||0,setCurrentTime:t=>{null==a||a.setCurrentTime(t)},destroy:()=>{null==a||a.destroy()}}}function en(){const t=document.querySelectorAll("["+it+"]");for(let e=0;e<t.length;e++){const n=t[e];if(!n[at]){const t=n.getAttribute(it);t&&(n[at]=tn({src:t,container:n}))}}}"undefined"!=typeof window&&(window.loadTagAnimators=en,window.createAnimator=tn,window.setupAnimationTriggers=Se);var nn=[1,0,0,1,0,0];function rn(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 on=(t,e)=>[1,0,0,1,t,e],an=(t,e)=>[t,0,0,e,0,0];function sn(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var ln=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],un=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function cn(t){let e=nn;t.translate&&(e=rn(e,on(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=rn(e,on(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=rn(e,sn(t.rotate))),t.scale&&(e=rn(e,an(t.scale[0],t.scale[1]))),n&&(e=rn(e,on(-t.origin[0],-t.origin[1]))),e}function fn(t,e,n){return t+(e-t)*n}function dn(t,e){return null==t?nn:"string"==typeof t?function(t){let e=nn;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=rn(e,on(n[0]||0,n[1]||0)):"scale"===t?e=rn(e,an(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=rn(e,sn(n[0])):"skewX"===t?e=rn(e,ln(n[0])):"skewY"===t?e=rn(e,un(n[0])):"matrix"===t&&(e=rn(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?cn(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),m=c.value||{},h=f.value||{},p={};return m.translate&&h.translate?p.translate=[fn(m.translate[0],h.translate[0],d),fn(m.translate[1],h.translate[1],d)]:p.translate=m.translate||h.translate,void 0!==m.rotate&&void 0!==h.rotate?p.rotate=fn(m.rotate,h.rotate,d):p.rotate=null!=(l=m.rotate)?l:h.rotate,m.scale&&h.scale?p.scale=[fn(m.scale[0],h.scale[0],d),fn(m.scale[1],h.scale[1],d)]:p.scale=m.scale||h.scale,p.origin=m.origin||h.origin,p}(t.keyframes,e)):t.value?cn(t.value):nn}var mn=new Set(["svg","g","symbol"]),hn=new Set(["defs","mask","clipPath","title"]);function pn(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>pn(t,e))}function yn(t){return null==t?0:Number(t)}function vn(t){return Math.round(100*t)/100+0}function gn(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=vn(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 fn(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,m=e.map(vn).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return yn(t.width)+","+yn(t.height)+","+yn(t.x)+","+yn(t.y);case"ellipse":return yn(t.rx)+","+yn(t.ry)+","+yn(t.cx)+","+yn(t.cy);case"circle":return yn(t.r)+","+yn(t.cx)+","+yn(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+m+"]|f:"+l+"|s:"+u+"|sw:"+(yn(c)||"")+"|o:"+f+"|m:"+d}function bn(t,e,n,r,o){var i;const a=t.type||"";if(hn.has(a))return;const s=rn(e,function(t,e){return t.animate&&t.animate.transform?dn(t.animate.transform,e):void 0!==t.transform?dn(t.transform,e):nn}(t,n));if("use"===a){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",i=r.get(e),a=rn(s,on(yn(t.x),yn(t.y)));return void(i?bn(i,a,n,r,o):o.push("UNRESOLVED_USE:#"+e))}mn.has(a)?null==(i=t.children)||i.forEach(t=>bn(t,s,n,r,o)):o.push(gn(t,s,n))}function An(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=>An(t,e))}function kn(t,e){const n=new Map;pn(t,n);const r=[];return bn(t,nn,e,n,r),r.sort()}function wn(t,e){const n=new Set;An(t,n),An(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=kn(t,o),i=kn(e,o),a=jn(n,i),s=jn(i,n);(a.length||s.length)&&r.push({time:o,onlyInA:a,onlyInB:s})}return r}function jn(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}
1
+ "use strict";var t,e=Object.defineProperty,n=Object.defineProperties,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertyNames,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,c=(t,e)=>{for(var n in e||(e={}))s.call(e,n)&&u(t,n,e[n]);if(i)for(var n of i(e))l.call(e,n)&&u(t,n,e[n]);return t},f=(t,e)=>n(t,o(e)),d={};function h(t,e,n){const r={};return"translate"===t?r.translate=e:"rotate"===t?r.rotate=e:r.scale=e,n&&"translate"!==t&&(r.origin=n),r}function m(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 p(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 v(t,e,n){if(!e)return t;delete t.transform;let r=t;var o;return r=y(r,"skew",e.skew,n),r=g(r,e.origin,!0),r=y(r,"scale",void 0===(o=e.scale)?void 0:Array.isArray(o)?[o[0]/100,o[1]/100]:o,n),r=y(r,"rotate",e.rotate,n),r=g(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=y(r,"translate",e.translate,n):(r=g(r,e.origin,!0),r=y(r,"translate",e.translate,n),r=g(r,e.origin,!1)),r}function y(t,e,n,r){if(void 0===n)return t;if("skew"===e){const e=m(n);return"static"!==e.kind?(r.warnings.push("transformation.skew: only static skew is supported"),t):{type:"g",transform:"skewX("+e.value[0]+")skewY("+e.value[1]+")",children:[t]}}const o=m(n);if("static"===o.kind)return{type:"g",transform:{value:h(e,o.value,void 0)},children:[t]};if("animated"===o.kind){const n={keyframes:o.keyframes.map(t=>p(t,h(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 g(t,e,n){if(void 0===e)return t;const r=m(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=>p(t,{translate:o(t.value)}))};return void 0!==r.loop&&(e.loop=r.loop),{type:"g",animate:{transform:e},children:[t]}}return t}function b(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=>b(t,e,n))}function A(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=w(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&&w((null==(r=t.animate)?void 0:r.transform)||void 0)||i&&w((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=k(a.full),r=k(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=w(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=v(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=v(u,i,o),u.id=n),u}function k(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 w(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 j(t){if(!t.length)return".";let e="";for(const n of t)n.startsWith("[")?e+=n:e+=(e?".":"")+n;return e}((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})(d,{COLOUR_ATTR_NAMES:()=>Ee,PX_ANIMATOR_DATA_KEY:()=>_r,PX_ANIM_ATTR_NAME:()=>K,PX_ANIM_SRC_ATTR_NAME:()=>W,PX_TRANSFORM_PART_KEYS:()=>tt,PxAnimatedSvgDocumentSchema:()=>Tt,PxAnimationDefinitionSchema:()=>rt,PxAnimatorConfigSchema:()=>st,PxAnimatorEngine:()=>G,PxAnimatorMode:()=>q,PxAttrValueSchema:()=>ut,PxBezierPathSchema:()=>Et,PxBindingSchema:()=>lt,PxCloneEffectSchema:()=>yt,PxDefsSchema:()=>it,PxEasingOrRefSchema:()=>J,PxEffectsSchema:()=>Ot,PxElementAnimationSchema:()=>ot,PxFillGradientEffectSchema:()=>jt,PxGradientSpreadMethod:()=>bt,PxGradientStopSchema:()=>kt,PxGradientType:()=>At,PxGradientUnits:()=>gt,PxKeyframeSchema:()=>$,PxLoopSchema:()=>H,PxMaskedByEffectSchema:()=>mt,PxNodeBase:()=>Mt,PxNodeSchema:()=>_t,PxPropertyAnimationSchema:()=>Q,PxRepeaterEffectSchema:()=>ht,PxRetimeEffectSchema:()=>vt,PxStrokeGradientEffectSchema:()=>Pt,PxSvgNodeExtra:()=>It,PxTextAlongPathEffectSchema:()=>xt,PxTransformPartsSchema:()=>et,PxTransformValueSchema:()=>nt,PxTransformationEffectSchema:()=>dt,PxTriggerSchema:()=>at,PxTrimPathEffectSchema:()=>pt,STYLE_ATTR_NAMES:()=>Re,TRANSFORM_FN_NAMES:()=>ze,applyPlayerEffects:()=>Zn,calcAnimationValues:()=>zn,camelCaseToKebabWordIfNeeded:()=>Le,collectSampleTimes:()=>Zr,createAnimator:()=>Ir,createAnimatorImpl:()=>Mr,createBasicFrameLoopAnimator:()=>yr,createFrameLoopAnimator:()=>gr,createWebApiAnimator:()=>wr,describeSchema:()=>L,diffInEffect:()=>$r,evaluateMotionPathSegment:()=>en,generateNewIds:()=>Or,getAnimatorConfig:()=>Ct,getBindings:()=>Ut,getChildren:()=>Vt,getDefs:()=>Rt,getNormalizedProps:()=>hr,isPxElementFileFormat:()=>zt,isPxElementFileFormatDeep:()=>Nt,loadTagAnimators:()=>Tr,materialiseAllInTree:()=>rr,materialiseAnimatedUseInstances:()=>$n,materialiseInternalLoopsInPropAnim:()=>Sn,materialiseInternalLoopsInTree:()=>Mn,materialiseMotionPathInPropAnim:()=>an,materialiseMotionPathsInTree:()=>vn,normalizeDocument:()=>Tn,propAnimIsMotionPath:()=>He,px:()=>B,renderNode:()=>mr,schemaKeys:()=>D,setupAnimationTriggers:()=>pr,toRGBA:()=>Ie,validateNodeEffects:()=>St,visualModelAt:()=>Jr}),module.exports=(t=d,((t,n,o,i)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let l of a(n))s.call(t,l)||l===o||e(t,l,{get:()=>n[l],enumerable:!(i=r(n,l))||i.enumerable});return t})(e({},"__esModule",{value:!0}),t));var P=class{_canSanitize(t){return this.isValid(t)}optional(){return new x(this)}},x=class extends P{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)}},O=class extends P{constructor(t=""){super(),this._default=t}sanitize(t){return"string"==typeof t?t:this._default}isValid(t,e,n){return"string"==typeof t||(null==e||e.errors.push(j(null!=n?n:[])+": expected string, got "+typeof t),!1)}},S=class extends P{constructor(t=0){super(),this._default=t}sanitize(t){return"number"==typeof t&&isFinite(t)?t:this._default}isValid(t,e,n){return!("number"!=typeof t||!isFinite(t))||(null==e||e.errors.push(j(null!=n?n:[])+": expected finite number, got "+JSON.stringify(t)),!1)}},M=class extends P{constructor(t=!1){super(),this._default=t}sanitize(t){return"boolean"==typeof t?t:this._default}isValid(t,e,n){return"boolean"==typeof t||(null==e||e.errors.push(j(null!=n?n:[])+": expected boolean, got "+typeof t),!1)}},_=class extends P{constructor(t){super(),this.value=t,this._default=t}sanitize(t){return t===this.value?this.value:this._default}isValid(t,e,n){return t===this.value||(null==e||e.errors.push(j(null!=n?n:[])+": expected "+JSON.stringify(this.value)+", got "+JSON.stringify(t)),!1)}},I=class extends P{constructor(t,e){super(),this.values=t,this._default=null!=e?e:t[0]}sanitize(t){return this.values.includes(t)?t:this._default}isValid(t,e,n){return!!this.values.includes(t)||(null==e||e.errors.push(j(null!=n?n:[])+": expected one of "+this.values.map(t=>JSON.stringify(t)).join(" | ")+", got "+JSON.stringify(t)),!1)}},T=class extends P{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(j(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))}},E=class extends P{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(j(null!=n?n:[])+": no discriminated union member matched "+this._key+"="+JSON.stringify(r)),!1}return r.isValid(t,e,n)}_canSanitize(t){if(null===t||"object"!=typeof t||Array.isArray(t))return!1;const e=this._findSchema(t);return e?e._canSanitize(t):this._schemas[0]._canSanitize(t)}},z=class extends P{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(j(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(j(o)+": unexpected extra key"),o.pop(),a=!1);return a}_canSanitize(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}},N=class extends P{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=c({},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(j(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)}},C=class extends P{constructor(t){super(),this.item=t,this._default=[]}sanitize(t){if(!Array.isArray(t))return[];const e=[];for(const n of t)this.item._canSanitize(n)&&e.push(this.item.sanitize(n));return e}isValid(t,e,n){if(!Array.isArray(t))return null==e||e.errors.push(j(null!=n?n:[])+": expected array, got "+typeof t),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<t.length;n++)r.push("["+n+"]"),this.item.isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)}},R=class extends P{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(j(null!=n?n:[])+": expected object/record, got "+(Array.isArray(t)?"array":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(const[n,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)}},U=class extends P{constructor(){super(...arguments),this._default=void 0}sanitize(t){return t}isValid(t,e,n){return!0}_canSanitize(t){return!0}},V=class extends P{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)}},F=class extends P{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(j(null!=n?n:[])+": expected tuple of length "+this.schemas.length+", got "+(Array.isArray(t)?"array["+t.length+"]":typeof t)),!1;const r=null!=n?n:[];let o=!0;for(let n=0;n<this.schemas.length;n++)r.push("["+n+"]"),this.schemas[n].isValid(t[n],e,r)||(o=!1),r.pop();return o}_canSanitize(t){return Array.isArray(t)&&t.length===this.schemas.length}};function D(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 B={string:(t="")=>new O(t),number:(t=0)=>new S(t),boolean:(t=!1)=>new M(t),literal:t=>new _(t),enum:(t,e)=>new I(t,e),union:(t,e)=>new T(t,e),discriminatedUnion:(t,e)=>new E(t,e),object:t=>new z(t),openObject:(t,e)=>new N(t,e),extendedObject:(t,e)=>new z(c(c({},t._shape),e)),array:t=>new C(t),record:t=>new R(t),any:()=>new U,tuple:t=>new F(t),lazy:(t,e)=>new V(t,e)},W="data-px-animation-src",K="_px_animator",q={auto:"auto",webapi:"webapi",frames:"frames"},G={webapi:q.webapi,frames:q.frames},X="text",Y="textContent",Z=new Set(["type","children","animator","meta","animate",X,Y]),J=B.union([B.string(),B.tuple([B.number(),B.number(),B.number(),B.number()])]),$=(B.union([B.string(),B.number(),B.array(B.number()),B.lazy(()=>et,{}),B.object({path:B.string()}),B.lazy(()=>B.object({paths:B.array(Et)}),{paths:[]})]),B.object({time:B.number().optional(),t:B.number().optional(),value:B.any().optional(),v:B.any().optional(),easing:J.optional(),e:J.optional(),tangentOut:B.tuple([B.number(),B.number()]).optional(),to:B.tuple([B.number(),B.number()]).optional(),tangentIn:B.tuple([B.number(),B.number()]).optional(),ti:B.tuple([B.number(),B.number()]).optional(),selected:B.boolean().optional()})),H=B.object({segmentCount:B.number().optional(),before:B.boolean().optional(),alternate:B.boolean().optional()}),Q=B.object({keyframes:B.array($).optional(),kfs:B.array($).optional(),loop:B.union([H,B.boolean()]).optional(),autoOrient:B.boolean().optional()}),tt=["translate","rotate","scale","origin"],et=B.object({translate:B.tuple([B.number(),B.number()]).optional(),rotate:B.number().optional(),scale:B.tuple([B.number(),B.number()]).optional(),origin:B.tuple([B.number(),B.number()]).optional()}),nt=B.union([B.string(),B.object({value:et}),Q]),rt=B.record(Q),ot=B.union([B.string(),B.array(B.union([B.string(),rt])),rt]),at=B.object({startOn:B.enum(["load","mouseOver","click","scrollIntoView","programmatic"]).optional(),outAction:B.enum(["continue","pause","reset","reverse"]).optional(),scrollIntoViewThreshold:B.number().optional()}),it=B.object({easings:B.record(B.tuple([B.number(),B.number(),B.number(),B.number()])).optional(),animations:B.record(rt).optional(),styles:B.record(B.any()).optional()}),st=B.object({mode:B.enum([q.auto,q.webapi,q.frames]).optional(),duration:B.number().optional(),delay:B.number().optional(),iterations:B.union([B.number(),B.literal("infinite")]).optional(),fill:B.enum(["forwards","backwards","both","none"]).optional(),direction:B.enum(["normal","reverse","alternate","alternate-reverse"]).optional(),frameRate:B.number().optional(),trigger:at.optional(),definitions:it.optional(),animate:B.record(ot).optional(),debug:B.boolean().optional(),debugInstName:B.string().optional()}),lt=B.object({id:B.string(),animate:ot}),ut=B.union([B.string(),B.number(),B.object({value:B.any()}),Q]),ct=B.union([B.number(),B.object({value:B.number()}),B.object({keyframes:B.array($),autoOrient:B.boolean().optional()})]),ft=B.union([B.tuple([B.number(),B.number()]),B.object({value:B.tuple([B.number(),B.number()])}),B.object({keyframes:B.array($),autoOrient:B.boolean().optional()})]),dt=B.object({translate:ft.optional(),rotate:ct.optional(),scale:ft.optional(),skew:ft.optional(),origin:ft.optional()}),ht=B.object({copies:B.number().optional(),translate:ft.optional(),rotate:ct.optional(),scale:ft.optional(),origin:ft.optional()}),mt=B.object({href:B.string().optional(),maskType:B.string().optional(),maskUnits:B.string().optional(),maskContentUnits:B.string().optional()}),pt=B.object({offset:ct.optional(),range:ft.optional(),trimAllAsOne:B.boolean().optional()}),vt=B.object({baseId:B.string().optional(),start:B.number().optional(),stretch:B.number().optional(),timeCrop:B.tuple([B.number(),B.number()]).optional()}),yt=B.object({type:B.string().optional(),baseId:B.string().optional(),retime:vt.optional()}),gt={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},bt={pad:"pad",reflect:"reflect",repeat:"repeat"},At={linear:"linear",radial:"radial"},kt=B.object({offset:B.number(),color:B.string()}),wt=B.union([B.array(kt),B.object({value:B.array(kt)}),B.object({keyframes:B.array($)})]),jt=B.object({type:B.enum([At.linear,At.radial]),p1:B.tuple([B.number(),B.number()]).optional(),p2:B.tuple([B.number(),B.number()]).optional(),c:B.tuple([B.number(),B.number()]).optional(),r:B.number().optional(),fp:B.tuple([B.number(),B.number()]).optional(),stops:wt.optional(),gradientUnits:B.string().optional(),spreadMethod:B.string().optional(),gradientTransform:B.string().optional()}),Pt=jt,xt=B.object({href:B.string(),lengthAdjust:B.string().optional(),method:B.string().optional(),spacing:B.string().optional(),startOffset:ct.optional(),textLength:ct.optional()}),Ot=B.object({transformation:dt.optional(),repeater:ht.optional(),maskedBy:mt.optional(),trimPath:pt.optional(),clone:yt.optional(),isCombinedShape:B.boolean().optional(),fillGradient:jt.optional(),strokeGradient:Pt.optional(),textAlongPath:xt.optional()});function St(t,e){const n=[],r=(t,o)=>{if(t&&t.effects){const r={errors:[],warnings:[],strict:!!(null==e?void 0:e.strict)};if(!Ot.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=B.openObject({type:B.string(),id:B.string().optional(),meta:B.any().optional(),effects:Ot.optional(),animate:ot.optional(),style:B.union([B.string(),B.record(B.union([B.string(),B.number()]))]).optional()},ut),_t=B.openObject(f(c({},Mt._shape),{children:B.lazy(()=>B.array(_t),[]).optional()}),ut),It=B.object({width:B.number().optional(),height:B.number().optional(),viewBox:B.string().optional(),animator:st.optional()}),Tt=B.openObject(f(c(c({},Mt._shape),It._shape),{type:B.literal("svg"),children:B.array(_t).optional()}),ut),Et=B.object({v:B.array(B.array(B.number())),i:B.array(B.array(B.number())).optional(),o:B.array(B.array(B.number())).optional(),c:B.boolean().optional()});function zt(t){return!(!t||"object"!=typeof t||Array.isArray(t))&&("svg"===t.type||"svg"===t.tagName)}function Nt(t){const e=Tt.isValid(t);return{valid:e,errors:e?[]:["Document failed schema validation"]}}function Ct(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 Rt(t){var e;if(t)return null==(e=Ct(t))?void 0:e.definitions}function Ut(t){var e;if(!t)return;const n=null==(e=Ct(t))?void 0:e.animate;return n?Object.entries(n).map(([t,e])=>({id:t,animate:e})):void 0}function Vt(t){return null==t?void 0:t.children}function Ft(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Ft);const e={};for(const n of Object.keys(t))e[n]=Ft(t[n]);return e}function Dt(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 Lt(t){const e="number"==typeof t?t:"string"==typeof t?parseFloat(t):NaN;return Number.isFinite(e)?e:0}function Bt(t){var e;const n=Lt(t.x),r=Lt(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 Wt(t,e){return"_lw_"+e+"_"+t.nextId++}function Kt(t){return"string"==typeof t?t.replace(/^#/,""):void 0}function qt(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>qt(t,e))}var Gt=Ft;function Xt(t,e,n,r){if(!e)return t;const o=Wt(n,"grad"),a=function(t,e){const n={type:t.type===At.radial?"radialGradient":"linearGradient",id:e};t.type===At.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);return n.children=function(t){var e,n,r,o;if(!t)return[];if(Array.isArray(t))return t.map(Yt);if("object"==typeof t&&Array.isArray(t.value))return t.value.map(Yt);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:Zt(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,m=null!=(l=null==h?void 0:h[n])?l:Zt(e,e.indexOf(r),n);if(!m)continue;const p=null!=(u=r.easing)?u:r.e,v={time:o,value:m.color};void 0!==p&&(v.easing=p),c.push(v);const y={time:o,value:m.offset};void 0!==p&&(y.easing=p),f.push(y),m.offset!==t.offset&&(d=!0)}const h={type:"stop",offset:Jt(t.offset),stopColor:t.color},m={};c.length&&(m.stopColor={keyframes:c},void 0!==o&&(m.stopColor.loop=o));d&&f.length&&(m.offset={keyframes:f},void 0!==o&&(m.offset.loop=o));Object.keys(m).length&&(h.animate=m);return h}(t,i,e,0,s))}(t.stops),n}(e,o);return n.defs.push(a),t[r]="url(#"+o+")",t}function Yt(t){return{type:"stop",offset:Jt(t.offset),stopColor:t.color}}function Zt(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 Jt(t){return Math.round(1e3*t)/10+"%"}function $t(t,e,n,r){if(!e)return t;if(!e.href)return r.errors.push("maskedBy.href missing — cannot build mask"),t;const o=Wt(r,"mask");let a={type:"use",href:"#"+e.href};if(n)a=Ht(a,n,r);else if(ee(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=p(t,void 0);if(Array.isArray(e.translate)&&i.push(f(c({},r),{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(f(c({},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(f(c({},r),{value:t}))}}const u=null==o?void 0:o.loop,d=t=>{const e={keyframes:t};return void 0!==u&&(e.loop=u),e};let h=t;i.length&&(h={type:"g",animate:{transform:d(i)},children:[h]});s.length&&(h={type:"g",animate:{transform:d(s)},children:[h]});l.length&&(h={type:"g",animate:{transform:d(l)},children:[h]});return h}(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 m=/([a-zA-Z]+)\s*\(([^)]*)\)/g;let p;const v=[];for(;null!==(p=m.exec(t));){const t=p[2].split(/[\s,]+/).filter(t=>t.length>0).map(Number);v.push({name:p[1],args:t})}if(!v.length)return;const y=v[v.length-1];if("translate"===y.name)for(let t=v.length-2;t>=0;t--){const c=v[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=y.args[0])?r:0,m=null!=(o=y.args[1])?o:0;if(h!==-f||m!==-d)continue;const p={};p.origin=[f,d];for(let e=0;e<t;e++)if("translate"===v[e].name){const t=null!=(a=v[e].args[0])?a:0,n=null!=(i=v[e].args[1])?i:0;p.translate=p.translate?[p.translate[0]+t,p.translate[1]+n]:[t,n]}for(let e=t+1;e<v.length-1;e++){const t=v[e];if("rotate"===t.name)p.rotate=(null!=(s=p.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;p.scale=p.scale?[p.scale[0]*e,p.scale[1]*n]:[e,n]}}return p}let g,b,A;for(const t of v)if("translate"===t.name){const e=null!=(c=t.args[0])?c:0,n=null!=(f=t.args[1])?f:0;g=g?[g[0]+e,g[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;A=A?[A[0]*e,A[1]*n]:[e,n]}const k={};g&&(k.translate=g);void 0!==b&&(k.rotate=b);A&&(k.scale=A);return Object.keys(k).length?k: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=Ht(a,e,r))}const i=void 0===n&&!function(t){return"string"==typeof t.transform||(!(!t.transform||"object"!=typeof t.transform)||ee(t))}(t);a=function(t,e,n,r,o){const a=r.idMap.get(n),i=r.maskAncestorChains.get(e)||[],s=o?ae(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=ne(l),n=ne(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=re(l,t),n=re(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 Ht(t,e,n){if(!e)return t;const r=function(t,e){var n;const r=m(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=Qt(o,"translate",e.translate,void 0,n),o=Qt(o,"rotate",e.rotate,r,n),o=Qt(o,"scale",e.scale,r,n),o}function Qt(t,e,n,r,o){if(void 0===n)return t;const a=m("scale"===e&&Array.isArray(n)?[n[0]/100,n[1]/100]:n);if("static"===a.kind)return{type:"g",transform:{value:h(e,te(e,a.value),r)},children:[t]};if("animated"===a.kind){const n={keyframes:a.keyframes.map(t=>p(t,h(e,te(e,t.value),r)))};return void 0!==a.loop&&(n.loop=a.loop),{type:"g",animate:{transform:n},children:[t]}}return t}function te(t,e){return"translate"===t?[-e[0],-e[1]]:"rotate"===t?-e:[1/e[0],1/e[1]]}function ee(t){const e=t.animate&&"object"==typeof t.animate&&!Array.isArray(t.animate)?t.animate:void 0;return!(!e||!e.transform)}function ne(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 re(t,e){let n=0,r=0;for(const o of t)if(o.translateKeyframes&&o.translateKeyframes.length){const t=oe(o.translateKeyframes,e);n+=t[0],r+=t[1]}else o.translate&&(n+=o.translate[0],r+=o.translate[1]);return[n,r]}function oe(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 ae(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 ie="content";function se(t,e,n){if(!e)return;const r=e.baseId;if(!r)return void(e.type===ie&&n.errors.push("clone: content ref missing baseId"));const o=e.type===ie&&n.contentRefInnerIds.get(r)||r;t.href="#"+o}function le(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 f(c({},n),{keyframes:n.keyframes.map(t=>t&&void 0!==t.value?f(c({},t),{value:e(t.value)}):t)});if(void 0!==n.value)return f(c({},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 f(c({},n),{keyframes:n.keyframes.map(t=>t&&void 0!==t.value?f(c({},t),{value:e(t.value)}):t)});if(void 0!==n.value)return f(c({},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 f(c({},e),{keyframes:e.keyframes.map(t=>t&&void 0!==t.value?f(c({},t),{value:r(t.value)}):t)});if(void 0!==e.value)return f(c({},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}var ue=!1;function ce(t){var e,n;return{start:null!=(e=t.start)?e:0,stretch:null!=(n=t.stretch)?n:1}}function fe(t,e){return{start:e.start+e.stretch*t.start,stretch:e.stretch*t.stretch}}function de(t){var e,n;return null==(n=null==(e=t.effects)?void 0:e.clone)?void 0:n.retime}function he(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 me(t,e,n){const r=Kt(t.href);if(!r)return void n.errors.push("retime: <use> has no href to follow");const o=pe(r,e,n,new Set);if(o)if(ue){const e=n.idMap.get(o);t.type="g",delete t.href,t.children=[e],Bt(t),n.defs=n.defs.filter(t=>t!==e)}else t.href="#"+o}function pe(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=Gt(o);if(function(t,e){Dt(t,()=>Wt(e,"retimed"))}(a,n),"use"===o.type?ye(a,e.start,e.stretch):ve(a,e.start,e.stretch),he(a),"use"===o.type&&o.href){const i=Kt(o.href);if(i){const s=de(o),l=s?fe(ce(s),e):e,u=new Set(r);u.add(t);const c=pe(i,l,n,u);c&&(a.href="#"+c)}}else!function(t,e,n,r,o){const a=t=>{var i;const s=de(t);if("use"===t.type&&s&&t.href){const a=Kt(t.href);if(a){const i=fe(ce(s),e),l=new Set(r);l.add(o);const u=pe(a,i,n,l);u&&(t.href="#"+u)}he(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 ve(t,e,n){var r;ye(t,e,n),null==(r=t.children)||r.forEach(t=>ve(t,e,n))}function ye(t,e,n){const r=t=>{for(const r of t)"number"==typeof r.time&&(r.time=e+r.time*n)};if(t.transform&&"object"==typeof t.transform&&Array.isArray(t.transform.keyframes)&&r(t.transform.keyframes),t.animate&&"object"==typeof t.animate)for(const e of Object.keys(t.animate)){const n=t.animate[e];n&&Array.isArray(n.keyframes)&&r(n.keyframes)}}function ge(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=c({},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)}function be(t){var e,n,r,o;const a=t.v,i=t.i,s=t.o,l=t.c;if(!a.length)return"";const u=[],c=a.length;u.push("M"+a[0][0]+","+a[0][1]);for(let t=1;t<c;t++){const r=a[t-1],o=null!=(e=null==s?void 0:s[t-1])?e:r,l=null!=(n=null==i?void 0:i[t])?n:a[t],c=a[t];o[0]===r[0]&&o[1]===r[1]&&l[0]===c[0]&&l[1]===c[1]?u.push("L"+c[0]+","+c[1]):u.push("C"+o[0]+","+o[1]+","+l[0]+","+l[1]+","+c[0]+","+c[1])}if(l&&c>0){const t=a[c-1],e=null!=(r=null==s?void 0:s[c-1])?r:t,n=null!=(o=null==i?void 0:i[0])?o:a[0],l=a[0];e[0]===t[0]&&e[1]===t[1]&&n[0]===l[0]&&n[1]===l[1]||u.push("C"+e[0]+","+e[1]+","+n[0]+","+n[1]+","+l[0]+","+l[1]),u.push("z")}return u.join("")}function Ae(t,e,n){return t+(e-t)*n}function ke(t,e,n){const r=[],o=Math.max(t.length,e.length);for(let a=0;a<o;a++)r[a]=Ae(t[a]||0,e[a]||0,n);return r}function we(t,e,n){return[Ae(t[0]||0,e[0]||0,n),Ae(t[1]||0,e[1]||0,n),Ae(t[2]||0,e[2]||0,n),Ae(void 0===t[3]?1:t[3],void 0===e[3]?1:e[3],n)]}function je(t,e,n){const r=Math.max(t.length,e.length),o=[];for(let a=0;a<r;a++)o.push(Pe(t[a],e[a],n));return o}function Pe(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),m=[],p=[],v=[];for(let n=0;n<h;n++){const f=t.v[n],h=e.v[n];m.push(ke(f,h,d));const y=null!=(o=null==(r=t.i)?void 0:r[n])?o:f,g=null!=(i=null==(a=e.i)?void 0:a[n])?i:h;p.push(ke(y,g,d));const b=null!=(l=null==(s=t.o)?void 0:s[n])?l:f,A=null!=(c=null==(u=e.o)?void 0:u[n])?c:h;v.push(ke(b,A,d))}return{v:m,i:p.length?p:void 0,o:v.length?v:void 0,c:null!=(f=t.c)?f:e.c}}function xe(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 Oe(t){const[e,n,r,o]=t,a=3*n,i=3*(o-n)-a,s=1-a-i;return function(t){return n=xe(e,r,t),((s*n+i)*n+a)*n;var n}}function Se(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function Me(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=xe(n,o,e),s=[n,r],l=[o,a],{left:u,right:c}=function(t,e,n,r,o){const a=Se(t,e,o),i=Se(e,n,o),s=Se(n,r,o),l=Se(a,i,o),u=Se(i,s,o),c=Se(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,m;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 p=1-f,v=1-d;return p>1e-9&&Math.abs(v)>1e-9&&(m=[(c[1][0]-f)/p,(c[1][1]-d)/v,(c[2][0]-f)/p,(c[2][1]-d)/v]),{left:h,right:m}}function _e(t){if(t)return[1-t[2],1-t[3],1-t[0],1-t[1]]}function Ie(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 Te(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 Ee=new Set(["color","fill","flood-color","lighting-color","stop-color","stroke"]),ze=new Set(["translate","rotate","scale","skew"]),Ne=new Set(["offset-distance","offsetDistance"]);function Ce(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.scale,u=r?"px":"",c=r?"deg":"";return a&&o.push("translate("+a[0]+u+","+a[1]+u+")"),i&&o.push("translate("+i[0]+u+","+i[1]+u+")"),null!=s&&o.push("rotate("+s+c+")"),l&&o.push("scale("+l[0]+","+l[1]+")"),i&&o.push("translate("+-i[0]+u+","+-i[1]+u+")"),o.join("")}var Re=new Set(["offset-distance","offsetDistance"]),Ue=1e3;function Ve(t){return t.includes("-")?t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()):t}function Fe(t){return!t.includes("-")&&/[a-z][A-Z]/.test(t)}var De=new Set(["viewBox","preserveAspectRatio","gradientUnits","gradientTransform","spreadMethod","patternUnits","patternContentUnits","patternTransform","clipPathUnits","maskUnits","maskContentUnits","markerUnits","markerWidth","markerHeight","refX","refY","textLength","lengthAdjust","startOffset","filterUnits","primitiveUnits","stdDeviation","baseFrequency","numOctaves","surfaceScale","diffuseConstant","specularConstant","specularExponent","kernelMatrix","kernelUnitLength","edgeMode","preserveAlpha","targetX","targetY"]);function Le(t){return De.has(t)?t:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Be(t,e,n){return Math.max(e,Math.min(t,n))}function We(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 Ke=1e-4;function qe(t,e,n,r,o){const a=Ge(t,e,n,r,o);if(0===a[0]&&0===a[1]){return Ge(t,e,n,r,o<.5?o+Ke:o-Ke)}return a}function Ge(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 Xe(t,e,n,r,o=100){const a=o+1,i=new Float64Array(a),s=new Float64Array(a);let l=We(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=We(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 Ye(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])}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 Je(t){var e,n;return null!=(n=null!=(e=t.time)?e:t.t)?n:0}function $e(t){var e;return null!=(e=t.easing)?e:t.e}function He(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 Qe=new WeakMap;function tn(t,e,n,r){var o,a;const i=Qe.get(t);if(i)return i;const s=null!=(o=t.tangentOut)?o:t.to,l=null!=(a=e.tangentIn)?a:e.ti,u=[n[0]+(s?s[0]:0),n[1]+(s?s[1]:0)],c=[r[0]+(l?l[0]:0),r[1]+(l?l[1]:0)],f=Xe(n,u,c,r),d={P0:n,P1:u,P2:c,P3:r,lut:f,totalArc:f.ds[f.ds.length-1]};return Qe.set(t,d),d}function en(t,e,n,r,o,a){const i=tn(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=We(i.P0,i.P1,i.P2,i.P3,s);if(!a)return{translate:l};const u=qe(i.P0,i.P1,i.P2,i.P3,s);return{translate:l,rotateDeg:180*Math.atan2(u[1],u[0])/Math.PI}}var nn=.5,rn=5,on=32;function an(t,e){var n,r,o,a;if(!He(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:nn,u=null!=(o=null==e?void 0:e.rotationTolerance)?o:rn,c=null!=(a=null==e?void 0:e.maxSamplesPerSegment)?a:on,f=[],d=Ze(i[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=tn(t,e,n,r),a=qe(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(sn(Je(i[0]),cn(ln(i[0]),ln(i[0]),0,d,h,s)));for(let t=0;t<i.length-1;t++){const e=i[t],n=i[t+1],r=Ze(e),o=Ze(n);r&&o?(s&&t>0&&fn(f,e,n,r,o,u),dn(f,e,n,r,o,s,l,u,c)):f.push(sn(Je(n),cn(ln(n),ln(n),1,null!=o?o:[0,0],void 0,s)))}const m=$e(i[i.length-1]);m&&(f[f.length-1].e=m),s&&function(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}}(f);const p={kfs:f};return void 0!==t.loop&&(p.loop=t.loop),p}function sn(t,e){return{t:t,v:e}}function ln(t){var e;const n=null!=(e=t.value)?e:t.v;if(n&&"object"==typeof n&&!Array.isArray(n))return n}function un(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 cn(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]=un(o,s,n))}return void 0!==o&&(i.rotate=o),i}function fn(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=tn(e,n,r,o),f=qe(c.P0,c.P1,c.P2,c.P3,0),d=180*Math.atan2(f[1],f[0])/Math.PI,h=function(t,e){let n=t-e;for(;n>180;)n-=360;for(;n<-180;)n+=360;return n}(d,u);if(Math.abs(h)<=a)return;const m=cn(ln(e),ln(e),0,r,d,!0);t.push(sn(Je(e),m))}function dn(t,e,n,r,o,a,i,s,l){const u=tn(e,n,r,o),c=Je(e),f=Je(n),d=$e(e),h=(m=d)?Oe([m[1],m[0],m[3],m[2]]):t=>t;var m;const p=ln(e),v=ln(n),y=function(t,e,n,r,o){const a=[];hn(t.P0[0],t.P1[0],t.P2[0],t.P3[0],a),hn(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++)mn(i[o],i[o+1],s,t,e,n,r,l);return s}(u,a,i,s,l),g=[];for(const t of y){const e=Ye(u.lut,t),n=Be(u.totalArc>0?e/u.totalArc:t,0,1),r={u:Be(h(n),0,1),p:n,pos:We(u.P0,u.P1,u.P2,u.P3,t)};if(a){const e=qe(u.P0,u.P1,u.P2,u.P3,t);r.rotateDeg=180*Math.atan2(e[1],e[0])/Math.PI}g.push(r)}let b=d,A=0;const k=t.length-1;for(let e=0;e<g.length;e++){const n=g[e],r=A<1?Be((n.u-A)/(1-A),0,1):1,{left:o,right:i}=Me(b,r),s=0===e?k:t.length-1;o?t[s].e=o:delete t[s].e;const l=c+n.u*(f-c),u=cn(p,v,n.p,n.pos,n.rotateDeg,a);t.push(sn(l,u)),b=i,A=n.u}}function hn(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 mn(t,e,n,r,o,a,i,s){const l=(t+e)/2,u=We(r.P0,r.P1,r.P2,r.P3,t),c=We(r.P0,r.P1,r.P2,r.P3,e),f=e-t,d=We(r.P0,r.P1,r.P2,r.P3,t+.25*f),h=We(r.P0,r.P1,r.P2,r.P3,l),m=We(r.P0,r.P1,r.P2,r.P3,t+.75*f),p=Math.max(pn(d,u,c),pn(h,u,c),pn(m,u,c));let v=!0;if(o){const n=qe(r.P0,r.P1,r.P2,r.P3,t),o=qe(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&&(v=!1)}p<=a&&v||s.remaining<=0||f<1e-6?n.push(e):(s.remaining-=1,mn(t,l,n,r,o,a,i,s),mn(l,e,n,r,o,a,i,s))}function pn(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 vn(t,e){const n=yn(t,e);return null!=n?n:t}function yn(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=yn(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&&He(n)){const o=an(n,e);o!==n&&(r=f(c({},t),{transform:o}))}}if(!n&&!r)return null;const a=c({},t);return n&&(a.children=n),r&&(a.animate=r),a}function gn(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 bn(t){return t.startsWith("path(")&&t.endsWith(")")?t.slice(5,-1):/^[MmZzLlHhVvCcSsQqTtAa]/.test(t)?t:void 0}function An(t){return"string"==typeof t&&void 0!==bn(t)}function kn(t){if(t&&"object"==typeof t&&"string"==typeof t.path){const e=bn(t.path);return e?{paths:gn(e)}:t}if(t&&"object"==typeof t&&"paths"in t){const e=t.paths;if(Array.isArray(e)&&e.length>0&&An(e[0])){const t=[];for(const n of e){const e=bn(n);e&&t.push(...gn(e))}return{paths:t}}return t}if(Array.isArray(t)){if(t.length>0&&An(t[0])){const e=[];for(const n of t){const t=bn(n);t&&e.push(...gn(t))}return{paths:e}}return{paths:t}}if(An(t)){return{paths:gn(bn(t))}}return t}function wn(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 jn(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 Pn(t,e,n,r){var o,a;if("d"===t){return{paths:je(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 Ee.has(t)?we(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?Ae(e,n,r):ze.has(t)||"stroke-dasharray"===t||"strokeDasharray"===t?ke(e||[],n||[],r):Ae(+(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)o[a]=Ae(+(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]=ke(r||t,i||t,n)}else o[a]=null!=i?i:r}return o}(e,n,r)}function xn(t,e,n,r){var o,a,i,s,l;const u=e.length-1,c=Be(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 m,p;n.before?(m=0,p=d):(m=h,p=r);const v=p-m;if(v<=0)return e;const y=null!=(s=f[0].t)?s:0,g=(null!=(l=f[f.length-1].t)?l:0)-y;if(g<=0)return e;const b=f.map(t=>{var e,n;return{relT:(t.t-y)/g,v:t.v,e:t.e,tangentIn:null!=(e=t.tangentIn)?e:t.ti,tangentOut:null!=(n=t.tangentOut)?n:t.to}}),A=Math.floor(v/g),k=v-A*g,w=k/g,j=[];function P(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?_e(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?Oe(i.e)(l):l,c=Pn(t,i.v,r.v,u),{left:f}=Me(i.e,l);return j.length>0&&i.relT<=a&&(j[j.length-1].e=f),void j.push({t:e+a*g,v:c,e:void 0})}const i={t:e+r.relT*g,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(i.tangentIn=r.tangentIn),r.tangentOut&&(i.tangentOut=r.tangentOut),j.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?_e(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?Oe(i.e)(o):o,l=Pn(t,i.v,r.v,s),{right:u}=Me(i.e,o);j.push({t:e,v:l,e:u})}const s={t:e+(r.relT-a)*g,v:r.v,e:n<o.length-1?r.e:void 0};r.tangentIn&&(s.tangentIn=r.tangentIn),r.tangentOut&&(s.tangentOut=r.tangentOut),j.push(s)}}(m,!!n.alternate&&A%2==0,w)}for(let t=0;t<A;t++){const e=A-1-t,r=!!n.alternate&&e%2==0;P(m+k+t*g,r)}}else{for(let t=0;t<A;t++){const e=!!n.alternate&&t%2==0;P(m+t*g,e)}if(w>1e-9){const t=!!n.alternate&&A%2==0;P(m+A*g,t,w)}}return n.before?[...j,...e]:[...e,...j]}function On(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=kn(f));const m=Fe(t)?Le(t):t;Ee.has(m)&&(f=null!=(l=Te(f))?l:f);const p={t:n,v:f,e:wn(h,r)},v=null!=(u=e.tangentIn)?u:e.ti,y=null!=(c=e.tangentOut)?c:e.to;v&&(p.tangentIn=v),y&&(p.tangentOut=y),d.push(p)}d.sort((t,e)=>{var n,r;return(null!=(n=t.t)?n:0)-(null!=(r=e.t)?r:0)});const h=e.loop,m=!0===h?{}:h||void 0;return m&&d.length>=2?xn(t,d,m,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=Fe(t)?Le(t):t,l=Ee.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=kn(d)),l&&(d=null!=(o=Te(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:xn(t,u,a,n)};return void 0!==e.autoOrient&&(c.autoOrient=e.autoOrient),c}function Mn(t,e){const n=_n(t,e);return null!=n?n:t}function _n(t,e){let n,r;if(t.children)for(let r=0;r<t.children.length;r++){const o=_n(t.children[r],e);null!==o&&(n||(n=t.children.slice()),n[r]=o)}const o=t.animate;if(o&&"object"==typeof o&&!Array.isArray(o)){const t=o;for(const n of Object.keys(t)){const o=t[n],a=Sn(n,o,e);a!==o&&(r||(r=c({},t)),r[n]=a)}}if(!n&&!r)return null;const a=c({},t);return n&&(a.children=n),r&&(a.animate=r),a}var In=0;function Tn(t,e=G.webapi){const n=Ct(t)||{},r=Rt(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=jn(t,e);r&&n.push(r)}else if(Array.isArray(t))for(const r of t){const t=jn(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=G.webapi){const o={};for(const[a,i]of Object.entries(t)){const t=On(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===G.webapi&&"transform"===a?an(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=Ut(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_"+ ++In;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 En(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;let o=t[0],a=t[t.length-1];for(let i=0;i<t.length-1;i++){const s=null!=(n=t[i].t)?n:0,l=null!=(r=t[i+1].t)?r:0;if(s<=e&&e<=l){o=t[i],a=t[i+1];break}}return{prevKf:o,nextKf:a}}(c,n);let h=f===d?0:(m=n,p=null!=(r=f.t)?r:0,v=null!=(o=d.t)?o:0,y=0,g=1,v===p?y:y+(m-p)/(v-p)*(g-y));var m,p,v,y,g;h=Be(h,0,1);const b=null!=(a=f.e)?a:f.easing;if(b&&Array.isArray(b))try{h=Oe(b)(h)}catch(t){}let A=Fe(t)?Le(t):t,k=null;const w=null!=(i=null==f?void 0:f.v)?i:null==f?void 0:f.value,j=null!=(s=null==d?void 0:d.v)?s:null==d?void 0:d.value;if("d"===A){k=je(null!=(l=null==w?void 0:w.paths)?l:Array.isArray(w)?w:[],null!=(u=null==j?void 0:j.paths)?u:Array.isArray(j)?j:[],h).map(t=>be(t)).join("")}else if(Ee.has(A))k=Ie(we(w||[0,0,0,1],j||[0,0,0,1],h)),A=t;else if("stroke-dasharray"===A)k=ke(w||[],j||[],h).join(" "),A=t;else if("transform"!==A||null===w||"object"!=typeof w||Array.isArray(w))if("translate"===A){k="translate("+ke(w||[0,0],j||[0,0],h).join(",")+")",A="transform"}else if("rotate"===A){k="rotate("+Ae(+(w||0),+(j||0),h)+")",A="transform"}else if("scale"===A){k="scale("+ke(w||[1,1],j||[1,1],h).join(",")+")",A="transform"}else{k=Ae(+(w||0),+(j||0),h)}else{const t=new Set([...w?Object.keys(w):[],...j?Object.keys(j):[]]),n={};for(const e of t){const t=null==w?void 0:w[e],r=null==j?void 0:j[e];if("rotate"===e)n.rotate=Ae(+(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=ke(t||o,r||o,h);n[e]=a}}if(He(e)){const t=w.translate,r=j.translate;if(Array.isArray(t)&&Array.isArray(r)){const o=en(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)}}k=Ce(n,{withUnits:!1}),A="transform"}return Ne.has(A)&&"number"==typeof k&&(k=100*k+"%"),{k:A,v:null===k?"":""+k}}function zn(t,e){const n={};for(const[r,o]of Object.entries(t)){const t=En(r,o,e);t&&(n[t.k]=t.v)}return n}function Nn(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;if("rect"!==t.type)return;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"}(t);if(void 0===e)return;const n=gn(e);if(!n.length)return;const r={leaf:t,subpaths:[]};for(const t of n){const e=Xn(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 d=m(e.offset),h="absent"===d.kind?{kind:"static",value:0}:d,p=function(t){const e=m(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=qn(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=Gn(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=Gn(n,t),r=(e[0]+e[1])/2;a.push({time:t,value:[r,r]})}return{kind:"animated",keyframes:a}}(e.range),v="absent"===p.kind?{kind:"static",value:[0,1]}:p,y=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}(h),g=[y.length?Math.min(...y):0,y.length?Math.max(...y):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=Vn(n,e,r),s=Fn(e,r),l=c({},t);return delete l.effects,Bn(l,"strokeDasharray",Ln(a,s)),Bn(l,"strokeDashoffset",Ln(o,i)),Bn(l,"strokeOpacity",Kn(a)),l}(e.leaf,r,i,g,h,v)}const b=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(...Rn(t.leaf,n.subpath,a,i,g,h,v,r))}b.set(t.leaf,Cn(t.leaf,e))}const A=t=>{const e=b.get(t);return e||(Array.isArray(t.children)&&t.children.length>0?f(c({},t),{children:t.children.map(A)}):t)};return A(t)}function Cn(t,e){const n=f(c({},t),{type:"g",children:e});return delete n.d,delete n.strokeDasharray,delete n.strokeDashoffset,delete n.effects,n}function Rn(t,e,n,r,o,a,i,s){const l=Vn(r,n,o),u=Fn(n,o),c=Ln(a,l),f=Ln(i,u),d=Kn(i),h=function(t){return{type:"path",d:t}}(be(e));return Bn(h,"strokeDasharray",f),Bn(h,"strokeDashoffset",c),Bn(h,"strokeOpacity",d),[h]}var Un=1;function Vn(t,e,n){const[r]=Dn(n);return n=>e*(-n-r+t)+Un}function Fn(t,e){const[n,r]=Dn(e),o=r-n+1;return e=>{const n=Be(e[0],0,1),r=Be(e[1],0,1),a=Math.min(n,r),i=Math.max(n,r),s=[0];let l=Un;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+Un),s}}function Dn(t){return[Math.floor(Math.min(-t[0],-t[1])),Math.ceil(Math.max(-t[0],-t[1]))]}function Ln(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 Bn(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=c({},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 Wn=10;function Kn(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),m=u?h&&s(null!=(a=u.value)?a:u.v):h,p=c?h&&s(null!=(i=c.value)?i:c.v):h;m&&!p?(f.push({time:d,value:0}),f.push({time:d+Wn,value:1})):!m&&p&&(f.push({time:d-Wn,value:1}),f.push({time:d,value:0}))}return f.length<=1?void 0:{kind:"animated",keyframes:f}}function qn(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 Gn(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 Xn(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+=Yn(t,r,r+1);return t.c&&e.length>1&&(n+=Yn(t,e.length-1,0)),n}function Yn(t,e,n){var r,o,a,i;const s=t.v,l=s[e],u=s[n],c=Xe(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]}function Zn(t){var e;const n={defs:[],warnings:[],errors:[],idMap:new Map,nextId:0,contentRefInnerIds:new Map,maskAncestorChains:new Map,engine:(null==(e=Ct(t))?void 0:e.mode)===q.frames?G.frames:G.webapi},r=Gt(t);qt(r,n.idMap),b(r,n,()=>Wt(n,"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=ae(t,e),a=n?[...r,n]:r;for(const e of t.children)o(e,a)}};o(t,[])}(r,n);const o=function(t,e){return function(t,e){e.idMap.clear(),qt(t,e.idMap);const n=[],r=t=>{var e;de(t)&&n.push(t),null==(e=t.children)||e.forEach(r)};r(t);for(const t of n){const n=de(t);n&&(he(t),me(t,ce(n),e))}}(t,e),t}(Jn(r,n),n);return function(t,e){if(!e.length)return;(t.children||(t.children=[])).unshift({type:"defs",children:e})}(o,n.defs),{root:o,defs:n.defs,warnings:n.warnings,errors:n.errors}}function Jn(t,e){t.children&&(t.children=t.children.map(t=>Jn(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,trimPath:l,clone:u,fillGradient:c,strokeGradient:f,textAlongPath:d}=null!=n?n:{};null==n||n.isCombinedShape;n&&delete t.effects;let h=t;return h=function(t,e){var n;if(!e)return t;const r={type:"textPath",href:"string"!=typeof e.href||e.href.startsWith("#")?e.href:"#"+e.href,children:null!=(n=t.children)?n:[]};return void 0!==e.lengthAdjust&&(r.lengthAdjust=e.lengthAdjust),void 0!==e.method&&(r.method=e.method),void 0!==e.spacing&&(r.spacing=e.spacing),ge(r,"startOffset",e.startOffset),ge(r,"textLength",e.textLength),t.children=[r],t}(h,d),h=function(t,e,n){return Xt(t,e,n,"fill")}(h,c,e),h=function(t,e,n){return Xt(t,e,n,"stroke")}(h,f,e),h=Nn(h,l,0,e),h=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=Gt(t);delete l.transform,l.animate&&(delete l.animate.transform,0===Object.keys(l.animate).length&&delete l.animate);const u=[l];for(let t=1;t<a;t++){const r=Gt(l),o=le(e,t),a=o?v(r,o,n):r;u.push(a)}const c={type:"g",children:u};return void 0!==i&&(c.transform=i),void 0!==s&&(c.animate={transform:s}),c}(h,i,e),h=$t(h,s,a,e),o?(se(h,u,e),h=A(h,a,r,o,e)):h=function(t,e,n,r){return se(t,e,r),v(t,n,r)}(h,u,a,e),(null==u?void 0:u.retime)&&(t.effects={clone:{retime:u.retime}}),r&&e.idMap.set(r,h),h}function $n(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=Qn(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=er(t.viewBox);if(e)return[e[2],e[3]];const n=Hn(t.width),r=Hn(t.height);return void 0!==n&&void 0!==r?[n,r]:[1,1]}(t),i=[],s=nr(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 f(c({},s),{children:u})}function Hn(t){if("number"==typeof t)return t;if("string"==typeof t){const e=parseFloat(t);return Number.isFinite(e)?e:void 0}}function Qn(t){if("string"==typeof t)return t.startsWith("#")?t.slice(1):t}function tr(t,e,n,r,o,a,i){var s,l,u,d;const h=Ft(e);Dt(h,o);const m="symbol"===h.type?er(h.viewBox):void 0,p=null!=(l=null!=(s=Hn(t.width))?s:null==m?void 0:m[2])?l:i[0],v=null!=(d=null!=(u=Hn(t.height))?u:null==m?void 0:m[3])?d:i[1],y="symbol"===h.type?function(t,e,n,r,o){const a=er(t.viewBox),i=f(c({},t),{type:"g"});if(delete i.viewBox,delete i.preserveAspectRatio,delete i.width,delete i.height,!a)return i;const[s,l,u,d]=a,h=u>0&&d>0?Math.min(r/u,o/d):1,m=(r-u*h)/2,p=(o-d*h)/2,v=[];0===m&&0===p||v.push("translate("+m+","+p+")");1!==h&&v.push("scale("+h+")");0===s&&0===l||v.push("translate("+-s+","+-l+")");v.length&&(i.transform=v.join(""));const y=e();return n.push({type:"clipPath",id:y,children:[{type:"rect",x:s,y:l,width:u,height:d}]}),i.clipPath="url(#"+y+")",i}(h,o,a,p,v):h,g=nr(y,n,r,o,a,i),b=f(c({},t),{type:"g",children:[g]});return delete b.href,delete b.width,delete b.height,Bt(b)}function er(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 nr(t,e,n,r,o,a){if("use"===t.type&&"string"==typeof t.href){const i=Qn(t.href);if(i&&n.has(i)){const s=e.get(i);if(s)return tr(t,s,e,n,r,o,a)}}if(!t.children)return t;let i=!1;const s=t.children.map(t=>{const s=nr(t,e,n,r,o,a);return s!==t&&(i=!0),s});return i?f(c({},t),{children:s}):t}function rr(t,e,n){var r,o;let a=Zn(t).root;return a=Mn(a,null!=(o=null==(r=Ct(a))?void 0:r.duration)?o:Ue),e===G.webapi&&(a=vn(a,null==n?void 0:n.motionPath),a=$n(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}var or="http://www.w3.org/2000/svg",ar=new Set(["script","foreignobject"]),ir=new Set(["href","xlink:href","src","filter","clippath","mask","markerstart","markermid","markerend"]),sr=new Set(["href","xlink:href","src"]),lr=/^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/i,ur=/^data:image\/svg\+xml(?:;[^,]*)?,/i,cr=/^data:image\/[^;,]*;base64,([A-Za-z0-9+/]{8})/i,fr=["iVBORw0K","/9j/","R0lGOD","UklGR","Qk"];function dr(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(ir.has(n)){const t=String(e);return t.startsWith("#")||(/^url\(#[^)]+\)$/.test(t)||sr.has(n)&&(lr.test(t)||ur.test(t)||function(t){const e=cr.exec(t);return!!e&&fr.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 hr(t){const e={};for(const n of Object.keys(t)){const r=Ve(n);if(Z.has(r))continue;if("style"===r)continue;let o=t[n];Ee.has(r)&&Array.isArray(o)?e[r]=Ie(o):"transform"===r&&null!==o&&"object"==typeof o&&!Array.isArray(o)&&o.value&&"object"==typeof o.value?e.transform=Ce(o.value,{withUnits:!1}):ze.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 mr(t,e){if(!t)return null;const n=t,{type:r,children:o,style:a}=n,u=((t,e)=>{var n={};for(var r in t)s.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&i)for(var r of i(t))e.indexOf(r)<0&&l.call(t,r)&&(n[r]=t[r]);return n})(n,["type","children","style"]),c=Rt(t)||e,f=function(t,e){var n;if(t)return"string"==typeof t?null==(n=null==e?void 0:e.styles)?void 0:n[t]:t}(a,c);let d;if(o)for(const t of o){const e=mr(t,c);e&&(d||(d=[]),d.push(e))}return function(t,e,n,r,o){if(ar.has(t.toLowerCase()))return console.warn("SVG tag blocked (dangerous): ",t),null;const a=document.createElementNS(or,t);for(const t in e){const n=dr(t,e[t]);void 0!==n&&a.setAttribute(Le(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}(r||"g",hr(u),f,d,u[X]||u[Y])}function pr(t,e){const{startOn:n,outAction:r="continue",scrollIntoViewThreshold:o=.5}=e,a=t.getRootElement();if(!a)return console.warn("setupAnimationTriggers: No root element found for animation."),t;const i=()=>{t.play()},s=()=>{switch(r){case"pause":t.pause();break;case"reset":t.cancel();break;case"reverse":t.play()}};switch(n){case"load":{const t=()=>i();"complete"===document.readyState?t():window.addEventListener("load",t,{once:!0});break}case"mouseOver":{const t=()=>i(),e=()=>s();a.addEventListener("mouseenter",t),a.addEventListener("mouseleave",e);break}case"click":{const e=()=>{t.isPlaying()?s():i()};a.addEventListener("click",e);break}case"scrollIntoView":new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&t.intersectionRatio>=o?i():s()})},{threshold:o}).observe(a);break}return t}function vr(t){return"#"+t}function yr(t,e,n){const r=Ct(t)||{},o=Tn(t,G.frames),a=r.iterations;let i=1;"number"==typeof a&&(i=a||1),"infinite"===a&&(i=1/0),i<1&&(i=1);const s=+(r.duration||Ue),l=s&&i?s*(i===1/0?1/0:i):s?(null!=i?i:1)*s:0,u=r.direction||"normal";let c=null,f=!1,d=r.delay||0,h=0,m=1,p=!1;const v=r.frameRate,y=v&&v>0?1e3/v:0;let g=0;const b=()=>{const t=h?(Date.now()-h)*m:0;let e=d+t;return Number.isFinite(l)&&e>l&&(e=l),e<0&&(e=0),e};function A(t){let n=function(){const e=s>0?s:1;let n=0,r=0;if(s>0){t=Be(t,0,i*e),r=Math.max(0,Math.ceil(t/e)-1),r=Math.min(r,i-1);n=Be((t-r*e)/e,0,1)}else n=t;const o=u||"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 o||[]){const r=t.animate;if(!r||"object"!=typeof r||Array.isArray(r)){console.warn("Empty or unresolved binding",t);continue}const o=zn(r,n*s);for(const[n,r]of Object.entries(o))e.setAttribute(t.id,n,r)}}r.delay&&A(b());const k=()=>!!f&&(!!e.isConnected()&&!(Number.isFinite(l)&&b()>=l)),w=t=>{null!==c&&(cancelAnimationFrame(c),c=null),(t||k())&&(c=requestAnimationFrame(()=>{c=null,(()=>{var t;if(!e.isConnected())return void j();const r=b();if(y>0){const t=Date.now();if(g&&t-g<y)return;g=t}if(l&&Number.isFinite(l)&&r>=l)return A(l),p||(p=!0,null==(t=null==n?void 0:n.onFinish)||t.call(n)),void j();A(r)})(),w()}))},j=()=>{f&&(d=b(),h=0,f=!1,null!==c&&(cancelAnimationFrame(c),c=null),A(d))},P={isReady:()=>!0,getRootElement:()=>null,isPlaying:()=>k(),play:()=>{var t;f||(Number.isFinite(l)&&d>=l&&(d=0,p=!1),f=!0,h=Date.now(),w(!0)),null==(t=null==n?void 0:n.onPlay)||t.call(n)},pause:()=>{var t;j(),null==(t=null==n?void 0:n.onPause)||t.call(n)},cancel:()=>{var t;j(),d=0,h=0,f=!1,p=!1,A(d),null==(t=null==n?void 0:n.onCancel)||t.call(n)},finish:()=>{((t=!0)=>{var e;d=Number.isFinite(l)?l:b(),h=0,f=!1,A(d),t&&!p&&(p=!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");const e=b();m=t,d=e,f&&(h=Date.now())},getCurrentTime:()=>b(),setCurrentTime:t=>{t<0&&(t=0),Number.isFinite(l)&&t>l&&(t=l),d=t,f&&(h=Date.now()),A(b())},destroy:()=>{P.cancel()}};return P}function gr(t,e,n,r){const o=Ct(t)||{};if(!r)if(t.id){const e=vr(t.id);(r=document.querySelector(e))||console.warn("createFrameLoopAnimator: No root element found for selector: ",e)}else console.warn("createFrameLoopAnimator: No root element provided");let a=yr(t,e||function(t){const e=new Set,n={isConnected:()=>!t||t.isConnected,setAttribute:(n,r,o)=>{r=Le(r);const a=vr(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];e.setAttribute(r,o),Re.has(r)&&(e.style[r]=o)}}};return n}(r),n);return a=f(c({},a),{getRootElement:()=>r||null}),o.trigger&&pr(a,o.trigger),a}function br(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;return Ee.has(n)&&Array.isArray(i)?u=Ie(i):"transform"!==n||null===i||"object"!=typeof i||Array.isArray(i)?ze.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"):u=""+i:(u=Ce(i,{withUnits:!0}),c="transform"),CSS.supports(c,u)||r.add(c),c=Ve(c),l[c]=u,l}function Ar(t,e,n){var r,o,a,i,s;const l=[];for(let u=0;u<e.length;u++){const d=e[u],h=null!=(r=d.t)?r:0;if(h<0){const n=e[u+1];if(n&&(null!=(o=n.t)?o:0)>=0){const e=(0-h)/((null!=(a=n.t)?a:0)-h),r=d.e?Oe(d.e)(e):e,{right:o}=Me(d.e,e);l.push({t:0,v:Pn(t,d.v,n.v,r),e:o})}continue}if(h>n){const r=e[u-1];if(r&&(null!=(i=r.t)?i:0)<=n){const e=null!=(s=r.t)?s:0,o=(n-e)/(h-e),a=r.e?Oe(r.e)(o):o,{left:i}=Me(r.e,o);l.length>0&&(l[l.length-1]=f(c({},l[l.length-1]),{e:i})),l.push({t:n,v:Pn(t,r.v,d.v,a),e:void 0})}break}l.push(d)}return l}function kr(t,e,n){var r;const o=new Map;for(const[a,i]of Object.entries(t)){const t=n.duration||1,s=Ar(a,i.kfs||i.keyframes||[],t),l=[];for(let n=0;n<s.length;n++){const o=s[n],i=br(o,Be((null!=(r=o.t)?r:0)/t,0,1),a,e);0===n&&(i.offset||0)>0&&l.push(f(c({},i),{offset:0})),l.push(i)}l.length>0&&(l[l.length-1].offset||0)<1&&l.push(f(c({},l[l.length-1]),{offset:1})),l.length>0&&o.set(a,l)}return o}function wr(t,e,n,r){var o;const a=Ct(t)||{};if(!n)if(t.id){const e=vr(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=Tn(t,G.webapi),s=[],l=a.iterations;let u;"number"==typeof l&&(u=l),"infinite"===l&&(u=1/0);const c=new Set;(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=vr(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 f=kr(r,c,a),d=a.delay&&a.delay>0?a.delay:void 0,h=a.delay&&a.delay<0&&a.duration?-a.delay%a.duration:void 0,m={duration:a.duration,delay:d,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 f)if(t.length>0)try{const r=new KeyframeEffect(n,t,m),o=new Animation(r,document.timeline);(null==e?void 0:e.onFinish)&&(o.onfinish=()=>{var t;return null==(t=e.onFinish)?void 0:t.call(e)}),(null==e?void 0:e.onRemove)&&(o.onremove=()=>{var t;return null==(t=e.onRemove)?void 0:t.call(e)}),h&&(o.currentTime=h),s.push(o)}catch(t){console.warn(t)}}}if(!r&&c.size)return console.warn("Unsupported CSS attrs: "+[...c].join(", ")),null;const f={isReady:()=>!0,getRootElement:()=>n||null,isPlaying:()=>{var t;return"running"===(null==(t=s[0])?void 0:t.playState)},play:()=>{var t;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;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),f),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=>{s.forEach(e=>{e.currentTime=t})},destroy:()=>{f.cancel(),s.splice(0,s.length)}};return a.trigger&&pr(f,a.trigger),f}var jr=0;function Pr(){return"_px_"+Date.now().toString(36)+(++jr).toString(36)+Math.random().toString(36).substring(2,6)}function xr(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(t=>xr(t));const e=t,n={};for(const t of Object.keys(e))n[t]=xr(e[t]);return n}function Or(t){var e,n;const r=xr(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=Pr();o.set(t,n),e.id=n}else e.animate&&(e.id=Pr());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]=Sr(r,o);else if(s.has(n)){const t=o.get(r);t&&(e[n]=t)}else r.includes("url(#")&&(e[n]=Sr(r,o));else if("style"===n&&"object"==typeof r&&null!==r)for(const[t,e]of Object.entries(r))"string"==typeof e&&(r[t]=Sr(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=f(c({},r.animator),{animate:t})}return r}function Sr(t,e){return t.replace(/url\(#([^)]+)\)/g,(t,n)=>{const r=e.get(n);return r?"url(#"+r+")":t})}function Mr(t,e,n,r){const o=St(t);for(const t of o)console.warn("[PxAnimator] effects shape warning:",t);const a=Ct(t)||{};a.debug=!0;t=rr(t,a.mode===q.frames?G.frames:G.webapi);let i=null;if(r&&t.children){t=Or(t);const e="string"==typeof r?document.querySelector(r):r;e&&(i=mr(t),i&&e.replaceChildren(i))}return function(t,e,n,r){const o=Ct(t)||{};let a;return a=o.mode===q.frames?gr(t,e,n,r):wr(t,n,r,o.mode===q.webapi)||gr(t,e,n,r),o.debugInstName&&(window[o.debugInstName]=a),a}(t,e,n,i)}var _r="data";function Ir(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 Mr(n,r,o,a);let i=null;return fetch(e).then(t=>t.json()).then(t=>{zt(t)?i=Mr(t,r,o,a):console.error("Invalid animation document format")}),{isReady:()=>!!i,getRootElement:()=>i?i.getRootElement():null,isPlaying:()=>(null==i?void 0:i.isPlaying())||!1,play:()=>{null==i||i.play()},pause:()=>{null==i||i.pause()},cancel:()=>{null==i||i.cancel()},finish:()=>{null==i||i.finish()},setPlaybackRate:t=>{null==i||i.setPlaybackRate(t)},getCurrentTime:()=>(null==i?void 0:i.getCurrentTime())||0,setCurrentTime:t=>{null==i||i.setCurrentTime(t)},destroy:()=>{null==i||i.destroy()}}}function Tr(){const t=document.querySelectorAll("["+W+"]");for(let e=0;e<t.length;e++){const n=t[e];if(!n[K]){const t=n.getAttribute(W);t&&(n[K]=Ir({src:t,container:n}))}}}"undefined"!=typeof window&&(window.loadTagAnimators=Tr,window.createAnimator=Ir,window.setupAnimationTriggers=pr);var Er=[1,0,0,1,0,0];function zr(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 Nr=(t,e)=>[1,0,0,1,t,e],Cr=(t,e)=>[t,0,0,e,0,0];function Rr(t){const e=t*Math.PI/180;return[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]}var Ur=t=>[1,0,Math.tan(t*Math.PI/180),1,0,0],Vr=t=>[1,Math.tan(t*Math.PI/180),0,1,0,0];function Fr(t){let e=Er;t.translate&&(e=zr(e,Nr(t.translate[0],t.translate[1])));const n=t.origin&&(void 0!==t.rotate||t.scale);return n&&(e=zr(e,Nr(t.origin[0],t.origin[1]))),void 0!==t.rotate&&(e=zr(e,Rr(t.rotate))),t.scale&&(e=zr(e,Cr(t.scale[0],t.scale[1]))),n&&(e=zr(e,Nr(-t.origin[0],-t.origin[1]))),e}function Dr(t,e,n){return t+(e-t)*n}function Lr(t,e){return null==t?Er:"string"==typeof t?function(t){let e=Er;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=zr(e,Nr(n[0]||0,n[1]||0)):"scale"===t?e=zr(e,Cr(n[0],n.length>1?n[1]:n[0])):"rotate"===t?e=zr(e,Rr(n[0])):"skewX"===t?e=zr(e,Ur(n[0])):"skewY"===t?e=zr(e,Vr(n[0])):"matrix"===t&&(e=zr(e,[n[0],n[1],n[2],n[3],n[4],n[5]]))}return e}(t):t.keyframes?Fr(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||{},m=f.value||{},p={};return h.translate&&m.translate?p.translate=[Dr(h.translate[0],m.translate[0],d),Dr(h.translate[1],m.translate[1],d)]:p.translate=h.translate||m.translate,void 0!==h.rotate&&void 0!==m.rotate?p.rotate=Dr(h.rotate,m.rotate,d):p.rotate=null!=(l=h.rotate)?l:m.rotate,h.scale&&m.scale?p.scale=[Dr(h.scale[0],m.scale[0],d),Dr(h.scale[1],m.scale[1],d)]:p.scale=h.scale||m.scale,p.origin=h.origin||m.origin,p}(t.keyframes,e)):t.value?Fr(t.value):Er}var Br=new Set(["svg","g","symbol"]),Wr=new Set(["defs","mask","clipPath","title"]);function Kr(t,e){var n;"string"==typeof t.id&&e.set(t.id,t),null==(n=t.children)||n.forEach(t=>Kr(t,e))}function qr(t){return null==t?0:Number(t)}function Gr(t){return Math.round(100*t)/100+0}function Xr(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=Gr(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 Dr(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(Gr).join(",");return t.type+"|"+function(t){var e;switch(t.type){case"rect":return qr(t.width)+","+qr(t.height)+","+qr(t.x)+","+qr(t.y);case"ellipse":return qr(t.rx)+","+qr(t.ry)+","+qr(t.cx)+","+qr(t.cy);case"circle":return qr(t.r)+","+qr(t.cx)+","+qr(t.cy);case"path":return String(null!=(e=t.d)?e:"");default:return""}}(t)+"|["+h+"]|f:"+l+"|s:"+u+"|sw:"+(qr(c)||"")+"|o:"+f+"|m:"+d}function Yr(t,e,n,r,o){var a;const i=t.type||"";if(Wr.has(i))return;const s=zr(e,function(t,e){return t.animate&&t.animate.transform?Lr(t.animate.transform,e):void 0!==t.transform?Lr(t.transform,e):Er}(t,n));if("use"===i){const e="string"==typeof t.href?t.href.replace(/^#/,""):"",a=r.get(e),i=zr(s,Nr(qr(t.x),qr(t.y)));return void(a?Yr(a,i,n,r,o):o.push("UNRESOLVED_USE:#"+e))}Br.has(i)?null==(a=t.children)||a.forEach(t=>Yr(t,s,n,r,o)):o.push(Xr(t,s,n))}function Zr(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=>Zr(t,e))}function Jr(t,e){const n=new Map;Kr(t,n);const r=[];return Yr(t,Er,e,n,r),r.sort()}function $r(t,e){const n=new Set;Zr(t,n),Zr(e,n);const r=[];for(const o of Array.from(n).sort((t,e)=>t-e)){const n=Jr(t,o),a=Jr(e,o),i=Hr(n,a),s=Hr(a,n);(i.length||s.length)&&r.push({time:o,onlyInA:i,onlyInB:s})}return r}function Hr(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}