@zzalai/leafer-point-annotation 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +308 -0
- package/README_EN.md +308 -0
- package/docs/assets/index-DGiYiG5f.css +1 -0
- package/docs/assets/index-L8gL3x2V.js +1 -0
- package/docs/index.html +14 -0
- package/index.html +13 -0
- package/package.json +64 -0
- package/project-docs/ARCHITECTURE.md +401 -0
- package/project-docs/IMPLEMENTATION_PLAN.md +196 -0
- package/project-docs/REQUIREMENTS.md +517 -0
- package/project-docs/TODO.md +167 -0
- package/project-docs/leafer-development-guide/LEAFER_DEVELOPMENT_GUIDE.md +835 -0
- package/project-docs/leafer-development-guide/LEAFER_UNDO_REDO_GUIDE.md +329 -0
- package/project-docs/leafer-development-guide/TINYKEYS_GUIDE.md +407 -0
- package/src/App.vue +464 -0
- package/src/components/BrushSizeSlider.vue +190 -0
- package/src/components/BrushStylePanel.vue +295 -0
- package/src/components/PointAnnotation.vue +1663 -0
- package/src/elements/PointAnnotationElement.ts +155 -0
- package/src/index.ts +4 -0
- package/src/main.ts +4 -0
- package/src/types/index.ts +122 -0
- package/src/utils/BrushCommands.ts +47 -0
- package/src/utils/BrushStroke.ts +96 -0
- package/src/utils/COCOExporter.ts +90 -0
- package/src/utils/CanvasBrush.ts +179 -0
- package/src/utils/PointCommands.ts +74 -0
- package/src/utils/YOLOExporter.ts +39 -0
- package/src/vite-env.d.ts +7 -0
- package/tsconfig.json +24 -0
- package/tsconfig.node.json +10 -0
- package/vite.config.ts +42 -0
- package/vite.docs.config.ts +28 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t){const e=Object.create(null);for(const i of t.split(","))e[i]=1;return t=>t in e}!function(){const t=document.createElement("link").relList;if(!(t&&t.supports&&t.supports("modulepreload"))){for(const t of document.querySelectorAll('link[rel="modulepreload"]'))e(t);new MutationObserver(t=>{for(const i of t)if("childList"===i.type)for(const t of i.addedNodes)"LINK"===t.tagName&&"modulepreload"===t.rel&&e(t)}).observe(document,{childList:!0,subtree:!0})}function e(t){if(t.ep)return;t.ep=!0;const e=function(t){const e={};return t.integrity&&(e.integrity=t.integrity),t.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),"use-credentials"===t.crossOrigin?e.credentials="include":"anonymous"===t.crossOrigin?e.credentials="omit":e.credentials="same-origin",e}(t);fetch(t.href,e)}}();var e,i={},n=[],r=()=>{},o=()=>!1,s=t=>111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),a=t=>t.startsWith("onUpdate:"),l=Object.assign,h=(t,e)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)},c=Object.prototype.hasOwnProperty,d=(t,e)=>c.call(t,e),u=Array.isArray,p=t=>"[object Map]"===b(t),f=t=>"[object Set]"===b(t),g=t=>"[object Date]"===b(t),_=t=>"function"==typeof t,v=t=>"string"==typeof t,m=t=>"symbol"==typeof t,y=t=>null!==t&&"object"==typeof t,x=t=>(y(t)||_(t))&&_(t.then)&&_(t.catch),w=Object.prototype.toString,b=t=>w.call(t),S=t=>"[object Object]"===b(t),k=t=>v(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,E=t(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),C=t=>{const e=Object.create(null);return i=>e[i]||(e[i]=t(i))},O=/-\w/g,L=C(t=>t.replace(O,t=>t.slice(1).toUpperCase())),P=/\B([A-Z])/g,T=C(t=>t.replace(P,"-$1").toLowerCase()),B=C(t=>t.charAt(0).toUpperCase()+t.slice(1)),R=C(t=>t?`on${B(t)}`:""),A=(t,e)=>!Object.is(t,e),M=(t,...e)=>{for(let i=0;i<t.length;i++)t[i](...e)},D=(t,e,i,n=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:n,value:i})},I=t=>{const e=parseFloat(t);return isNaN(e)?t:e},F=()=>e||(e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function W(t){if(u(t)){const e={};for(let i=0;i<t.length;i++){const n=t[i],r=v(n)?V(n):W(n);if(r)for(const t in r)e[t]=r[t]}return e}if(v(t)||y(t))return t}var z=/;(?![^(]*\))/g,N=/:([^]+)/,j=/\/\*[^]*?\*\//g;function V(t){const e={};return t.replace(j,"").split(z).forEach(t=>{if(t){const i=t.split(N);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function H(t){let e="";if(v(t))e=t;else if(u(t))for(let i=0;i<t.length;i++){const n=H(t[i]);n&&(e+=n+" ")}else if(y(t))for(const i in t)t[i]&&(e+=i+" ");return e.trim()}var U="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Y=t(U);function X(t){return!!t||""===t}function G(t,e){if(t===e)return!0;let i=g(t),n=g(e);if(i||n)return!(!i||!n)&&t.getTime()===e.getTime();if(i=m(t),n=m(e),i||n)return t===e;if(i=u(t),n=u(e),i||n)return!(!i||!n)&&function(t,e){if(t.length!==e.length)return!1;let i=!0;for(let n=0;i&&n<t.length;n++)i=G(t[n],e[n]);return i}(t,e);if(i=y(t),n=y(e),i||n){if(!i||!n)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t){const n=t.hasOwnProperty(i),r=e.hasOwnProperty(i);if(n&&!r||!n&&r||!G(t[i],e[i]))return!1}}return String(t)===String(e)}function K(t,e){return t.findIndex(t=>G(t,e))}var $,Z,q=t=>!(!t||!0!==t.__v_isRef),J=t=>v(t)?t:null==t?"":u(t)||y(t)&&(t.toString===w||!_(t.toString))?q(t)?J(t.value):JSON.stringify(t,Q,2):String(t),Q=(t,e)=>q(e)?Q(t,e.value):p(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[e,i],n)=>(t[tt(e,n)+" =>"]=i,t),{})}:f(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>tt(t))}:m(e)?tt(e):!y(e)||u(e)||S(e)?e:String(e),tt=(t,e="")=>{var i;return m(t)?`Symbol(${null!=(i=t.description)?i:e})`:t},et=class{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=$,!t&&$&&(this.index=($.scopes||($.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let t,e;if(this._isPaused=!0,this.scopes)for(t=0,e=this.scopes.length;t<e;t++)this.scopes[t].pause();for(t=0,e=this.effects.length;t<e;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){let t,e;if(this._isPaused=!1,this.scopes)for(t=0,e=this.scopes.length;t<e;t++)this.scopes[t].resume();for(t=0,e=this.effects.length;t<e;t++)this.effects[t].resume()}}run(t){if(this._active){const e=$;try{return $=this,t()}finally{$=e}}}on(){1===++this._on&&(this.prevScope=$,$=this)}off(){if(this._on>0&&0===--this._on){if($===this)$=this.prevScope;else{let t=$;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){let e,i;for(this._active=!1,e=0,i=this.effects.length;e<i;e++)this.effects[e].stop();for(this.effects.length=0,e=0,i=this.cleanups.length;e<i;e++)this.cleanups[e]();if(this.cleanups.length=0,this.scopes){for(e=0,i=this.scopes.length;e<i;e++)this.scopes[e].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.parent=void 0}}};var it,nt,rt=new WeakSet,ot=class{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,$&&$.active&&$.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,rt.has(this)&&(rt.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||at(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,xt(this),ct(this);const t=Z,e=_t;Z=this,_t=!0;try{return this.fn()}finally{dt(this),Z=t,_t=e,this.flags&=-3}}stop(){if(1&this.flags){for(let t=this.deps;t;t=t.nextDep)ft(t);this.deps=this.depsTail=void 0,xt(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?rt.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ut(this)&&this.run()}get dirty(){return ut(this)}},st=0;function at(t,e=!1){if(t.flags|=8,e)return t.next=nt,void(nt=t);t.next=it,it=t}function lt(){st++}function ht(){if(--st>0)return;if(nt){let t=nt;for(nt=void 0;t;){const e=t.next;t.next=void 0,t.flags&=-9,t=e}}let t;for(;it;){let i=it;for(it=void 0;i;){const n=i.next;if(i.next=void 0,i.flags&=-9,1&i.flags)try{i.trigger()}catch(e){t||(t=e)}i=n}}if(t)throw t}function ct(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function dt(t){let e,i=t.depsTail,n=i;for(;n;){const t=n.prevDep;-1===n.version?(n===i&&(i=t),ft(n),gt(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=t}t.deps=e,t.depsTail=i}function ut(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(pt(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function pt(t){if(4&t.flags&&!(16&t.flags))return;if(t.flags&=-17,t.globalVersion===wt)return;if(t.globalVersion=wt,!t.isSSR&&128&t.flags&&(!t.deps&&!t._dirty||!ut(t)))return;t.flags|=2;const e=t.dep,i=Z,n=_t;Z=t,_t=!0;try{ct(t);const i=t.fn(t._value);(0===e.version||A(i,t._value))&&(t.flags|=128,t._value=i,e.version++)}catch(r){throw e.version++,r}finally{Z=i,_t=n,dt(t),t.flags&=-3}}function ft(t,e=!1){const{dep:i,prevSub:n,nextSub:r}=t;if(n&&(n.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=n,t.nextSub=void 0),i.subs===t&&(i.subs=n,!n&&i.computed)){i.computed.flags&=-5;for(let t=i.computed.deps;t;t=t.nextDep)ft(t,!0)}e||--i.sc||!i.map||i.map.delete(i.key)}function gt(t){const{prevDep:e,nextDep:i}=t;e&&(e.nextDep=i,t.prevDep=void 0),i&&(i.prevDep=e,t.nextDep=void 0)}var _t=!0,vt=[];function mt(){vt.push(_t),_t=!1}function yt(){const t=vt.pop();_t=void 0===t||t}function xt(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const t=Z;Z=void 0;try{e()}finally{Z=t}}}var wt=0,bt=class{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},St=class{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Z||!_t||Z===this.computed)return;let e=this.activeLink;if(void 0===e||e.sub!==Z)e=this.activeLink=new bt(Z,this),Z.deps?(e.prevDep=Z.depsTail,Z.depsTail.nextDep=e,Z.depsTail=e):Z.deps=Z.depsTail=e,kt(e);else if(-1===e.version&&(e.version=this.version,e.nextDep)){const t=e.nextDep;t.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=t),e.prevDep=Z.depsTail,e.nextDep=void 0,Z.depsTail.nextDep=e,Z.depsTail=e,Z.deps===e&&(Z.deps=t)}return e}trigger(t){this.version++,wt++,this.notify(t)}notify(t){lt();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{ht()}}};function kt(t){if(t.dep.sc++,4&t.sub.flags){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let t=e.deps;t;t=t.nextDep)kt(t)}const i=t.dep.subs;i!==t&&(t.prevSub=i,i&&(i.nextSub=t)),t.dep.subs=t}}var Et=new WeakMap,Ct=Symbol(""),Ot=Symbol(""),Lt=Symbol("");function Pt(t,e,i){if(_t&&Z){let e=Et.get(t);e||Et.set(t,e=new Map);let n=e.get(i);n||(e.set(i,n=new St),n.map=e,n.key=i),n.track()}}function Tt(t,e,i,n,r,o){const s=Et.get(t);if(!s)return void wt++;const a=t=>{t&&t.trigger()};if(lt(),"clear"===e)s.forEach(a);else{const r=u(t),o=r&&k(i);if(r&&"length"===i){const t=Number(n);s.forEach((e,i)=>{("length"===i||i===Lt||!m(i)&&i>=t)&&a(e)})}else switch((void 0!==i||s.has(void 0))&&a(s.get(i)),o&&a(s.get(Lt)),e){case"add":r?o&&a(s.get("length")):(a(s.get(Ct)),p(t)&&a(s.get(Ot)));break;case"delete":r||(a(s.get(Ct)),p(t)&&a(s.get(Ot)));break;case"set":p(t)&&a(s.get(Ct))}}ht()}function Bt(t){const e=_e(t);return e===t?e:(Pt(e,0,Lt),fe(t)?e:e.map(ve))}function Rt(t){return Pt(t=_e(t),0,Lt),t}function At(t,e){return pe(t)?me(ue(t)?ve(e):e):ve(e)}var Mt={__proto__:null,[Symbol.iterator](){return Dt(this,Symbol.iterator,t=>At(this,t))},concat(...t){return Bt(this).concat(...t.map(t=>u(t)?Bt(t):t))},entries(){return Dt(this,"entries",t=>(t[1]=At(this,t[1]),t))},every(t,e){return Ft(this,"every",t,e,void 0,arguments)},filter(t,e){return Ft(this,"filter",t,e,t=>t.map(t=>At(this,t)),arguments)},find(t,e){return Ft(this,"find",t,e,t=>At(this,t),arguments)},findIndex(t,e){return Ft(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return Ft(this,"findLast",t,e,t=>At(this,t),arguments)},findLastIndex(t,e){return Ft(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return Ft(this,"forEach",t,e,void 0,arguments)},includes(...t){return zt(this,"includes",t)},indexOf(...t){return zt(this,"indexOf",t)},join(t){return Bt(this).join(t)},lastIndexOf(...t){return zt(this,"lastIndexOf",t)},map(t,e){return Ft(this,"map",t,e,void 0,arguments)},pop(){return Nt(this,"pop")},push(...t){return Nt(this,"push",t)},reduce(t,...e){return Wt(this,"reduce",t,e)},reduceRight(t,...e){return Wt(this,"reduceRight",t,e)},shift(){return Nt(this,"shift")},some(t,e){return Ft(this,"some",t,e,void 0,arguments)},splice(...t){return Nt(this,"splice",t)},toReversed(){return Bt(this).toReversed()},toSorted(t){return Bt(this).toSorted(t)},toSpliced(...t){return Bt(this).toSpliced(...t)},unshift(...t){return Nt(this,"unshift",t)},values(){return Dt(this,"values",t=>At(this,t))}};function Dt(t,e,i){const n=Rt(t),r=n[e]();return n===t||fe(t)||(r._next=r.next,r.next=()=>{const t=r._next();return t.done||(t.value=i(t.value)),t}),r}var It=Array.prototype;function Ft(t,e,i,n,r,o){const s=Rt(t),a=s!==t&&!fe(t),l=s[e];if(l!==It[e]){const e=l.apply(t,o);return a?ve(e):e}let h=i;s!==t&&(a?h=function(e,n){return i.call(this,At(t,e),n,t)}:i.length>2&&(h=function(e,n){return i.call(this,e,n,t)}));const c=l.call(s,h,n);return a&&r?r(c):c}function Wt(t,e,i,n){const r=Rt(t);let o=i,s=!1;r!==t&&(r!==t&&!fe(t)?(s=0===n.length,o=function(e,n,r){return s&&(s=!1,e=At(t,e)),i.call(this,e,At(t,n),r,t)}):i.length>3&&(o=function(e,n,r){return i.call(this,e,n,r,t)}));const a=r[e](o,...n);return s?At(t,a):a}function zt(t,e,i){const n=_e(t);Pt(n,0,Lt);const r=n[e](...i);return-1!==r&&!1!==r||!ge(i[0])?r:(i[0]=_e(i[0]),n[e](...i))}function Nt(t,e,i=[]){mt(),lt();const n=_e(t)[e].apply(t,i);return ht(),yt(),n}var jt=t("__proto__,__v_isRef,__isVue"),Vt=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>"arguments"!==t&&"caller"!==t).map(t=>Symbol[t]).filter(m));function Ht(t){m(t)||(t=String(t));const e=_e(this);return Pt(e,0,t),e.hasOwnProperty(t)}var Ut=class{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,i){if("__v_skip"===e)return t.__v_skip;const n=this._isReadonly,r=this._isShallow;if("__v_isReactive"===e)return!n;if("__v_isReadonly"===e)return n;if("__v_isShallow"===e)return r;if("__v_raw"===e)return i===(n?r?ae:se:r?oe:re).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(i)?t:void 0;const o=u(t);if(!n){let t;if(o&&(t=Mt[e]))return t;if("hasOwnProperty"===e)return Ht}const s=Reflect.get(t,e,ye(t)?t:i);if(m(e)?Vt.has(e):jt(e))return s;if(n||Pt(t,0,e),r)return s;if(ye(s)){const t=o&&k(e)?s:s.value;return n&&y(t)?ce(t):t}return y(s)?n?ce(s):he(s):s}},Yt=class extends Ut{constructor(t=!1){super(!1,t)}set(t,e,i,n){let r=t[e];const o=u(t)&&k(e);if(!this._isShallow){const t=pe(r);if(fe(i)||pe(i)||(r=_e(r),i=_e(i)),!o&&ye(r)&&!ye(i))return t||(r.value=i),!0}const s=o?Number(e)<t.length:d(t,e),a=Reflect.set(t,e,i,ye(t)?t:n);return t===_e(n)&&(s?A(i,r)&&Tt(t,"set",e,i):Tt(t,"add",e,i)),a}deleteProperty(t,e){const i=d(t,e),n=(t[e],Reflect.deleteProperty(t,e));return n&&i&&Tt(t,"delete",e,void 0),n}has(t,e){const i=Reflect.has(t,e);return m(e)&&Vt.has(e)||Pt(t,0,e),i}ownKeys(t){return Pt(t,0,u(t)?"length":Ct),Reflect.ownKeys(t)}},Xt=class extends Ut{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}},Gt=new Yt,Kt=new Xt,$t=new Yt(!0),Zt=t=>t,qt=t=>Reflect.getPrototypeOf(t);function Jt(t){return function(...e){return"delete"!==t&&("clear"===t?void 0:this)}}function Qt(t,e){const i={get(i){const n=this.__v_raw,r=_e(n),o=_e(i);t||(A(i,o)&&Pt(r,0,i),Pt(r,0,o));const{has:s}=qt(r),a=e?Zt:t?me:ve;return s.call(r,i)?a(n.get(i)):s.call(r,o)?a(n.get(o)):void(n!==r&&n.get(i))},get size(){const e=this.__v_raw;return!t&&Pt(_e(e),0,Ct),e.size},has(e){const i=this.__v_raw,n=_e(i),r=_e(e);return t||(A(e,r)&&Pt(n,0,e),Pt(n,0,r)),e===r?i.has(e):i.has(e)||i.has(r)},forEach(i,n){const r=this,o=r.__v_raw,s=e?Zt:t?me:ve;return!t&&Pt(_e(o),0,Ct),o.forEach((t,e)=>i.call(n,s(t),s(e),r))}};return l(i,t?{add:Jt("add"),set:Jt("set"),delete:Jt("delete"),clear:Jt("clear")}:{add(t){const i=_e(this),n=qt(i),r=_e(t),o=e||fe(t)||pe(t)?t:r;return n.has.call(i,o)||A(t,o)&&n.has.call(i,t)||A(r,o)&&n.has.call(i,r)||(i.add(o),Tt(i,"add",o,o)),this},set(t,i){e||fe(i)||pe(i)||(i=_e(i));const n=_e(this),{has:r,get:o}=qt(n);let s=r.call(n,t);s||(t=_e(t),s=r.call(n,t));const a=o.call(n,t);return n.set(t,i),s?A(i,a)&&Tt(n,"set",t,i):Tt(n,"add",t,i),this},delete(t){const e=_e(this),{has:i,get:n}=qt(e);let r=i.call(e,t);r||(t=_e(t),r=i.call(e,t));n&&n.call(e,t);const o=e.delete(t);return r&&Tt(e,"delete",t,void 0),o},clear(){const t=_e(this),e=0!==t.size,i=t.clear();return e&&Tt(t,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(n=>{i[n]=function(t,e,i){return function(...n){const r=this.__v_raw,o=_e(r),s=p(o),a="entries"===t||t===Symbol.iterator&&s,h="keys"===t&&s,c=r[t](...n),d=i?Zt:e?me:ve;return!e&&Pt(o,0,h?Ot:Ct),l(Object.create(c),{next(){const{value:t,done:e}=c.next();return e?{value:t,done:e}:{value:a?[d(t[0]),d(t[1])]:d(t),done:e}}})}}(n,t,e)}),i}function te(t,e){const i=Qt(t,e);return(e,n,r)=>"__v_isReactive"===n?!t:"__v_isReadonly"===n?t:"__v_raw"===n?e:Reflect.get(d(i,n)&&n in e?i:e,n,r)}var ee={get:te(!1,!1)},ie={get:te(!1,!0)},ne={get:te(!0,!1)},re=new WeakMap,oe=new WeakMap,se=new WeakMap,ae=new WeakMap;function le(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>b(t).slice(8,-1))(t))}function he(t){return pe(t)?t:de(t,!1,Gt,ee,re)}function ce(t){return de(t,!0,Kt,ne,se)}function de(t,e,i,n,r){if(!y(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const o=le(t);if(0===o)return t;const s=r.get(t);if(s)return s;const a=new Proxy(t,2===o?n:i);return r.set(t,a),a}function ue(t){return pe(t)?ue(t.__v_raw):!(!t||!t.__v_isReactive)}function pe(t){return!(!t||!t.__v_isReadonly)}function fe(t){return!(!t||!t.__v_isShallow)}function ge(t){return!!t&&!!t.__v_raw}function _e(t){const e=t&&t.__v_raw;return e?_e(e):t}var ve=t=>y(t)?he(t):t,me=t=>y(t)?ce(t):t;function ye(t){return!!t&&!0===t.__v_isRef}function xe(t){return i=!1,ye(e=t)?e:new we(e,i);var e,i}var we=class{constructor(t,e){this.dep=new St,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:_e(t),this._value=e?t:ve(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){const e=this._rawValue,i=this.__v_isShallow||fe(t)||pe(t);A(t=i?t:_e(t),e)&&(this._rawValue=t,this._value=i?t:ve(t),this.dep.trigger())}};function be(t){return ye(t)?t.value:t}var Se={get:(t,e,i)=>"__v_raw"===e?t:be(Reflect.get(t,e,i)),set:(t,e,i,n)=>{const r=t[e];return ye(r)&&!ye(i)?(r.value=i,!0):Reflect.set(t,e,i,n)}};function ke(t){return ue(t)?t:new Proxy(t,Se)}var Ee=class{constructor(t,e,i){this.fn=t,this.setter=e,this._value=void 0,this.dep=new St(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=wt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=i}notify(){if(this.flags|=16,!(8&this.flags)&&Z!==this)return at(this,!0),!0}get value(){const t=this.dep.track();return pt(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}};var Ce={},Oe=new WeakMap,Le=void 0;function Pe(t,e,n=i){const{immediate:o,deep:s,once:a,scheduler:l,augmentJob:c,call:d}=n,p=t=>s?t:fe(t)||!1===s||0===s?Te(t,1):Te(t);let f,g,v,m,y=!1,x=!1;if(ye(t)?(g=()=>t.value,y=fe(t)):ue(t)?(g=()=>p(t),y=!0):u(t)?(x=!0,y=t.some(t=>ue(t)||fe(t)),g=()=>t.map(t=>ye(t)?t.value:ue(t)?p(t):_(t)?d?d(t,2):t():void 0)):g=_(t)?e?d?()=>d(t,2):t:()=>{if(v){mt();try{v()}finally{yt()}}const e=Le;Le=f;try{return d?d(t,3,[m]):t(m)}finally{Le=e}}:r,e&&s){const t=g,e=!0===s?1/0:s;g=()=>Te(t(),e)}const w=$,b=()=>{f.stop(),w&&w.active&&h(w.effects,f)};if(a&&e){const t=e;e=(...e)=>{t(...e),b()}}let S=x?new Array(t.length).fill(Ce):Ce;const k=t=>{if(1&f.flags&&(f.dirty||t))if(e){const t=f.run();if(s||y||(x?t.some((t,e)=>A(t,S[e])):A(t,S))){v&&v();const i=Le;Le=f;try{const i=[t,S===Ce?void 0:x&&S[0]===Ce?[]:S,m];S=t,d?d(e,3,i):e(...i)}finally{Le=i}}}else f.run()};return c&&c(k),f=new ot(g),f.scheduler=l?()=>l(k,!1):k,m=t=>function(t,e=!1,i=Le){if(i){let e=Oe.get(i);e||Oe.set(i,e=[]),e.push(t)}}(t,!1,f),v=f.onStop=()=>{const t=Oe.get(f);if(t){if(d)d(t,4);else for(const e of t)e();Oe.delete(f)}},e?o?k(!0):S=f.run():l?l(k.bind(null,!0),!0):f.run(),b.pause=f.pause.bind(f),b.resume=f.resume.bind(f),b.stop=b,b}function Te(t,e=1/0,i){if(e<=0||!y(t)||t.__v_skip)return t;if(((i=i||new Map).get(t)||0)>=e)return t;if(i.set(t,e),e--,ye(t))Te(t.value,e,i);else if(u(t))for(let n=0;n<t.length;n++)Te(t[n],e,i);else if(f(t)||p(t))t.forEach(t=>{Te(t,e,i)});else if(S(t)){for(const n in t)Te(t[n],e,i);for(const n of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,n)&&Te(t[n],e,i)}return t}function Be(t,e,i,n){try{return n?t(...n):t()}catch(r){Ae(r,e,i)}}function Re(t,e,i,n){if(_(t)){const r=Be(t,e,i,n);return r&&x(r)&&r.catch(t=>{Ae(t,e,i)}),r}if(u(t)){const r=[];for(let o=0;o<t.length;o++)r.push(Re(t[o],e,i,n));return r}}function Ae(t,e,n,r=!0){e&&e.vnode;const{errorHandler:o,throwUnhandledErrorInProduction:s}=e&&e.appContext.config||i;if(e){let i=e.parent;const r=e.proxy,s=`https://vuejs.org/error-reference/#runtime-${n}`;for(;i;){const e=i.ec;if(e)for(let i=0;i<e.length;i++)if(!1===e[i](t,r,s))return;i=i.parent}if(o)return mt(),Be(o,null,10,[t,r,s]),void yt()}!function(t,e,i,n=!0,r=!1){if(r)throw t}(t,0,0,r,s)}var Me=[],De=-1,Ie=[],Fe=null,We=0,ze=Promise.resolve(),Ne=null;function je(t){const e=Ne||ze;return t?e.then(this?t.bind(this):t):e}function Ve(t){if(!(1&t.flags)){const e=Xe(t),i=Me[Me.length-1];!i||!(2&t.flags)&&e>=Xe(i)?Me.push(t):Me.splice(function(t){let e=De+1,i=Me.length;for(;e<i;){const n=e+i>>>1,r=Me[n],o=Xe(r);o<t||o===t&&2&r.flags?e=n+1:i=n}return e}(e),0,t),t.flags|=1,He()}}function He(){Ne||(Ne=ze.then(Ge))}function Ue(t,e,i=De+1){for(;i<Me.length;i++){const e=Me[i];if(e&&2&e.flags){if(t&&e.id!==t.uid)continue;Me.splice(i,1),i--,4&e.flags&&(e.flags&=-2),e(),4&e.flags||(e.flags&=-2)}}}function Ye(t){if(Ie.length){const t=[...new Set(Ie)].sort((t,e)=>Xe(t)-Xe(e));if(Ie.length=0,Fe)return void Fe.push(...t);for(Fe=t,We=0;We<Fe.length;We++){const t=Fe[We];4&t.flags&&(t.flags&=-2),8&t.flags||t(),t.flags&=-2}Fe=null,We=0}}var Xe=t=>null==t.id?2&t.flags?-1:1/0:t.id;function Ge(t){try{for(De=0;De<Me.length;De++){const t=Me[De];!t||8&t.flags||(4&t.flags&&(t.flags&=-2),Be(t,t.i,t.i?15:14),4&t.flags||(t.flags&=-2))}}finally{for(;De<Me.length;De++){const t=Me[De];t&&(t.flags&=-2)}De=-1,Me.length=0,Ye(),Ne=null,(Me.length||Ie.length)&&Ge(t)}}var Ke=null,$e=null;function Ze(t){const e=Ke;return Ke=t,$e=t&&t.type.__scopeId||null,e}function qe(t,e=Ke,i){if(!e)return t;if(t._n)return t;const n=(...i)=>{n._d&&_r(-1);const r=Ze(e);let o;try{o=t(...i)}finally{Ze(r),n._d&&_r(1)}return o};return n._n=!0,n._c=!0,n._d=!0,n}function Je(t,e){if(null===Ke)return t;const n=Kr(Ke),r=t.dirs||(t.dirs=[]);for(let o=0;o<e.length;o++){let[t,s,a,l=i]=e[o];t&&(_(t)&&(t={mounted:t,updated:t}),t.deep&&Te(s),r.push({dir:t,instance:n,value:s,oldValue:void 0,arg:a,modifiers:l}))}return t}function Qe(t,e,i,n){const r=t.dirs,o=e&&e.dirs;for(let s=0;s<r.length;s++){const a=r[s];o&&(a.oldValue=o[s].value);let l=a.dir[n];l&&(mt(),Re(l,i,8,[t.el,a,t,e]),yt())}}function ti(t,e){if(Fr){let i=Fr.provides;const n=Fr.parent&&Fr.parent.provides;n===i&&(i=Fr.provides=Object.create(n)),i[t]=e}}function ei(t,e,i=!1){const n=Wr();if(n||Ln){let r=Ln?Ln._context.provides:n?null==n.parent||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(r&&t in r)return r[t];if(arguments.length>1)return i&&_(e)?e.call(n&&n.proxy):e}}var ii=Symbol.for("v-scx");function ni(t,e,i){return ri(t,e,i)}function ri(t,e,n=i){const{immediate:o,deep:s,flush:a,once:h}=n,c=l({},n),d=e&&o||!e&&"post"!==a;let u;if(Ur)if("sync"===a){const t=ei(ii);u=t.__watcherHandles||(t.__watcherHandles=[])}else if(!d){const t=()=>{};return t.stop=r,t.resume=r,t.pause=r,t}const p=Fr;c.call=(t,e,i)=>Re(t,p,e,i);let f=!1;"post"===a?c.scheduler=t=>{Qn(t,p&&p.suspense)}:"sync"!==a&&(f=!0,c.scheduler=(t,e)=>{e?t():Ve(t)}),c.augmentJob=t=>{e&&(t.flags|=4),f&&(t.flags|=2,p&&(t.id=p.uid,t.i=p))};const g=Pe(t,e,c);return Ur&&(u?u.push(g):d&&g()),g}function oi(t,e,i){const n=this.proxy,r=v(t)?t.includes(".")?si(n,t):()=>n[t]:t.bind(n,n);let o;_(e)?o=e:(o=e.handler,i=e);const s=zr(this),a=ri(r,o.bind(n),i);return s(),a}function si(t,e){const i=e.split(".");return()=>{let e=t;for(let t=0;t<i.length&&e;t++)e=e[i[t]];return e}}var ai=new WeakMap,li=Symbol("_vte"),hi=t=>t.__isTeleport,ci=t=>t&&(t.disabled||""===t.disabled),di=t=>"undefined"!=typeof SVGElement&&t instanceof SVGElement,ui=t=>"function"==typeof MathMLElement&&t instanceof MathMLElement,pi=(t,e)=>{const i=t&&t.to;return v(i)?e?e(i):null:i},fi={name:"Teleport",__isTeleport:!0,process(t,e,i,n,r,o,s,a,l,h){const{mc:c,pc:d,pbc:u,o:{insert:p,querySelector:f,createText:g,createComment:_,parentNode:v}}=h,m=ci(e.props);let{dynamicChildren:y}=e;const x=(t,e,i)=>{16&t.shapeFlag&&c(t.children,e,i,r,o,s,a,l)},w=(t=e)=>{const i=ci(t.props),n=t.target=pi(t.props,f),o=mi(n,t,g,p);n&&("svg"!==s&&di(n)?s="svg":"mathml"!==s&&ui(n)&&(s="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(n),i||(x(t,n,o),vi(t,!1)))},b=t=>{const e=()=>{ai.get(t)===e&&(ai.delete(t),ci(t.props)&&(x(t,v(t.el)||i,t.anchor),vi(t,!0)),w(t))};ai.set(t,e),Qn(e,o)};if(null==t){const t=e.el=g(""),r=e.anchor=g("");if(p(t,i,n),p(r,i,n),(S=e.props)&&(S.defer||""===S.defer)||o&&o.pendingBranch)return void b(e);m&&(x(e,i,r),vi(e,!0)),w()}else{e.el=t.el;const n=e.anchor=t.anchor,c=ai.get(t);if(c)return c.flags|=8,ai.delete(t),void b(e);e.targetStart=t.targetStart;const p=e.target=t.target,g=e.targetAnchor=t.targetAnchor,_=ci(t.props),v=_?i:p,x=_?n:g;if("svg"===s||di(p)?s="svg":("mathml"===s||ui(p))&&(s="mathml"),y?(u(t.dynamicChildren,y,v,r,o,s,a),nr(t,e,!0)):l||d(t,e,v,x,r,o,s,a,!1),m)_?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):gi(e,i,n,h,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const t=e.target=pi(e.props,f);t&&gi(e,t,null,h,0)}else _&&gi(e,p,g,h,1);vi(e,m)}var S},remove(t,e,i,{um:n,o:{remove:r}},o){const{shapeFlag:s,children:a,anchor:l,targetStart:h,targetAnchor:c,target:d,props:u}=t;let p=o||!ci(u);const f=ai.get(t);if(f&&(f.flags|=8,ai.delete(t),p=!1),d&&(r(h),r(c)),o&&r(l),16&s)for(let g=0;g<a.length;g++){const t=a[g];n(t,e,i,p,!!t.dynamicChildren)}},move:gi,hydrate:function(t,e,i,n,r,o,{o:{nextSibling:s,parentNode:a,querySelector:l,insert:h,createText:c}},d){function u(t,i){let n=i;for(;n;){if(n&&8===n.nodeType)if("teleport start anchor"===n.data)e.targetStart=n;else if("teleport anchor"===n.data){e.targetAnchor=n,t._lpa=e.targetAnchor&&s(e.targetAnchor);break}n=s(n)}}function p(t,e){e.anchor=d(s(t),e,a(t),i,n,r,o)}const f=e.target=pi(e.props,l),g=ci(e.props);if(f){const l=f._lpa||f.firstChild;16&e.shapeFlag&&(g?(p(t,e),u(f,l),e.targetAnchor||mi(f,e,c,h,a(t)===f?t:null)):(e.anchor=s(t),u(f,l),e.targetAnchor||mi(f,e,c,h),d(l&&s(l),e,f,i,n,r,o))),vi(e,g)}else g&&16&e.shapeFlag&&(p(t,e),e.targetStart=t,e.targetAnchor=s(t));return e.anchor&&s(e.anchor)}};function gi(t,e,i,{o:{insert:n},m:r},o=2){0===o&&n(t.targetAnchor,e,i);const{el:s,anchor:a,shapeFlag:l,children:h,props:c}=t,d=2===o;if(d&&n(s,e,i),!ai.has(t)&&(!d||ci(c))&&16&l)for(let u=0;u<h.length;u++)r(h[u],e,i,2);d&&n(a,e,i)}var _i=fi;function vi(t,e){const i=t.ctx;if(i&&i.ut){let n,r;for(e?(n=t.el,r=t.anchor):(n=t.targetStart,r=t.targetAnchor);n&&n!==r;)1===n.nodeType&&n.setAttribute("data-v-owner",i.uid),n=n.nextSibling;i.ut()}}function mi(t,e,i,n,r=null){const o=e.targetStart=i(""),s=e.targetAnchor=i("");return o[li]=s,t&&(n(o,t,r),n(s,t,r)),s}var yi=Symbol("_leaveCb"),xi=Symbol("_enterCb");var wi=[Function,Array],bi={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:wi,onEnter:wi,onAfterEnter:wi,onEnterCancelled:wi,onBeforeLeave:wi,onLeave:wi,onAfterLeave:wi,onLeaveCancelled:wi,onBeforeAppear:wi,onAppear:wi,onAfterAppear:wi,onAppearCancelled:wi},Si=t=>{const e=t.subTree;return e.component?Si(e.component):e};function ki(t){let e=t[0];if(t.length>1)for(const i of t)if(i.type!==cr){e=i;break}return e}var Ei={name:"BaseTransition",props:bi,setup(t,{slots:e}){const i=Wr(),n=function(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Gi(()=>{t.isMounted=!0}),Zi(()=>{t.isUnmounting=!0}),t}();return()=>{const r=e.default&&Bi(e.default(),!0),o=r&&r.length?ki(r):i.subTree?Lr():void 0;if(!o)return;const s=_e(t),{mode:a}=s;if(n.isLeaving)return Li(o);const l=Pi(o);if(!l)return Li(o);let h=Oi(l,s,n,i,t=>h=t);l.type!==cr&&Ti(l,h);let c=i.subTree&&Pi(i.subTree);if(c&&c.type!==cr&&!wr(c,l)&&Si(i).type!==cr){let t=Oi(c,s,n,i);if(Ti(c,t),"out-in"===a&&l.type!==cr)return n.isLeaving=!0,t.afterLeave=()=>{n.isLeaving=!1,8&i.job.flags||i.update(),delete t.afterLeave,c=void 0},Li(o);"in-out"===a&&l.type!==cr?t.delayLeave=(t,e,i)=>{Ci(n,c)[String(c.key)]=c,t[yi]=()=>{e(),t[yi]=void 0,delete h.delayedLeave,c=void 0},h.delayedLeave=()=>{i(),delete h.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function Ci(t,e){const{leavingVNodes:i}=t;let n=i.get(e.type);return n||(n=Object.create(null),i.set(e.type,n)),n}function Oi(t,e,i,n,r){const{appear:o,mode:s,persisted:a=!1,onBeforeEnter:l,onEnter:h,onAfterEnter:c,onEnterCancelled:d,onBeforeLeave:p,onLeave:f,onAfterLeave:g,onLeaveCancelled:_,onBeforeAppear:v,onAppear:m,onAfterAppear:y,onAppearCancelled:x}=e,w=String(t.key),b=Ci(i,t),S=(t,e)=>{t&&Re(t,n,9,e)},k=(t,e)=>{const i=e[1];S(t,e),u(t)?t.every(t=>t.length<=1)&&i():t.length<=1&&i()},E={mode:s,persisted:a,beforeEnter(e){let n=l;if(!i.isMounted){if(!o)return;n=v||l}e[yi]&&e[yi](!0);const r=b[w];r&&wr(t,r)&&r.el[yi]&&r.el[yi](),S(n,[e])},enter(e){if(b[w]===t)return;let n=h,r=c,s=d;if(!i.isMounted){if(!o)return;n=m||h,r=y||c,s=x||d}let a=!1;e[xi]=t=>{a||(a=!0,S(t?s:r,[e]),E.delayedLeave&&E.delayedLeave(),e[xi]=void 0)};const l=e[xi].bind(null,!1);n?k(n,[e,l]):l()},leave(e,n){const r=String(t.key);if(e[xi]&&e[xi](!0),i.isUnmounting)return n();S(p,[e]);let o=!1;e[yi]=i=>{o||(o=!0,n(),S(i?_:g,[e]),e[yi]=void 0,b[r]===t&&delete b[r])};const s=e[yi].bind(null,!1);b[r]=t,f?k(f,[e,s]):s()},clone(t){const o=Oi(t,e,i,n,r);return r&&r(o),o}};return E}function Li(t){if(zi(t))return(t=Cr(t)).children=null,t}function Pi(t){if(!zi(t))return hi(t.type)&&t.children?ki(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:i}=t;if(i){if(16&e)return i[0];if(32&e&&_(i.default))return i.default()}}function Ti(t,e){6&t.shapeFlag&&t.component?(t.transition=e,Ti(t.component.subTree,e)):128&t.shapeFlag?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function Bi(t,e=!1,i){let n=[],r=0;for(let o=0;o<t.length;o++){let s=t[o];const a=null==i?s.key:String(i)+String(null!=s.key?s.key:o);s.type===lr?(128&s.patchFlag&&r++,n=n.concat(Bi(s.children,e,a))):(e||s.type!==cr)&&n.push(null!=a?Cr(s,{key:a}):s)}if(r>1)for(let o=0;o<n.length;o++)n[o].patchFlag=-2;return n}function Ri(t,e){return _(t)?l({name:t.name},e,{setup:t}):t}function Ai(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function Mi(t,e){let i;return!(!(i=Object.getOwnPropertyDescriptor(t,e))||i.configurable)}var Di=new WeakMap;function Ii(t,e,n,r,s=!1){if(u(t))return void t.forEach((t,i)=>Ii(t,e&&(u(e)?e[i]:e),n,r,s));if(Wi(r)&&!s)return void(512&r.shapeFlag&&r.type.__asyncResolved&&r.component.subTree.component&&Ii(t,e,n,r.component.subTree));const a=4&r.shapeFlag?Kr(r.component):r.el,l=s?null:a,{i:c,r:p}=t,f=e&&e.r,g=c.refs===i?c.refs={}:c.refs,m=c.setupState,y=_e(m),x=m===i?o:t=>!Mi(g,t)&&d(y,t),w=(t,e)=>!e||!Mi(g,e);if(null!=f&&f!==p)if(Fi(e),v(f))g[f]=null,x(f)&&(m[f]=null);else if(ye(f)){const t=e;w(0,t.k)&&(f.value=null),t.k&&(g[t.k]=null)}if(_(p))Be(p,c,12,[l,g]);else{const e=v(p),i=ye(p);if(e||i){const r=()=>{if(t.f){const i=e?x(p)?m[p]:g[p]:w()||!t.k?p.value:g[t.k];if(s)u(i)&&h(i,a);else if(u(i))i.includes(a)||i.push(a);else if(e)g[p]=[a],x(p)&&(m[p]=g[p]);else{const e=[a];w(0,t.k)&&(p.value=e),t.k&&(g[t.k]=e)}}else e?(g[p]=l,x(p)&&(m[p]=l)):i&&(w(0,t.k)&&(p.value=l),t.k&&(g[t.k]=l))};if(l){const e=()=>{r(),Di.delete(t)};e.id=-1,Di.set(t,e),Qn(e,n)}else Fi(t),r()}}}function Fi(t){const e=Di.get(t);e&&(e.flags|=8,Di.delete(t))}F().requestIdleCallback,F().cancelIdleCallback;var Wi=t=>!!t.type.__asyncLoader,zi=t=>t.type.__isKeepAlive;function Ni(t,e){Vi(t,"a",e)}function ji(t,e){Vi(t,"da",e)}function Vi(t,e,i=Fr){const n=t.__wdc||(t.__wdc=()=>{let e=i;for(;e;){if(e.isDeactivated)return;e=e.parent}return t()});if(Ui(e,n,i),i){let t=i.parent;for(;t&&t.parent;)zi(t.parent.vnode)&&Hi(n,e,i,t),t=t.parent}}function Hi(t,e,i,n){const r=Ui(e,t,n,!0);qi(()=>{h(n[e],r)},i)}function Ui(t,e,i=Fr,n=!1){if(i){const r=i[t]||(i[t]=[]),o=e.__weh||(e.__weh=(...n)=>{mt();const r=zr(i),o=Re(e,i,t,n);return r(),yt(),o});return n?r.unshift(o):r.push(o),o}}var Yi=t=>(e,i=Fr)=>{Ur&&"sp"!==t||Ui(t,(...t)=>e(...t),i)},Xi=Yi("bm"),Gi=Yi("m"),Ki=Yi("bu"),$i=Yi("u"),Zi=Yi("bum"),qi=Yi("um"),Ji=Yi("sp"),Qi=Yi("rtg"),tn=Yi("rtc");function en(t,e=Fr){Ui("ec",t,e)}var nn="components";function rn(t,e){return function(t,e,i=!0,n=!1){const r=Ke||Fr;if(r){const i=r.type;if(t===nn){const t=function(t,e=!0){return _(t)?t.displayName||t.name:t.name||e&&t.__name}(i,!1);if(t&&(t===e||t===L(e)||t===B(L(e))))return i}const o=sn(r[t]||i[t],e)||sn(r.appContext[t],e);return!o&&n?i:o}}(nn,t,!0,e)||t}var on=Symbol.for("v-ndc");function sn(t,e){return t&&(t[e]||t[L(e)]||t[B(L(e))])}function an(t,e,i,n){let r;const o=i&&i[n],s=u(t);if(s||v(t)){let i=!1,n=!1;s&&ue(t)&&(i=!fe(t),n=pe(t),t=Rt(t)),r=new Array(t.length);for(let s=0,a=t.length;s<a;s++)r[s]=e(i?n?me(ve(t[s])):ve(t[s]):t[s],s,void 0,o&&o[s])}else if("number"==typeof t){r=new Array(t);for(let i=0;i<t;i++)r[i]=e(i+1,i,void 0,o&&o[i])}else if(y(t))if(t[Symbol.iterator])r=Array.from(t,(t,i)=>e(t,i,void 0,o&&o[i]));else{const i=Object.keys(t);r=new Array(i.length);for(let n=0,s=i.length;n<s;n++){const s=i[n];r[n]=e(t[s],s,n,o&&o[n])}}else r=[];return i&&(i[n]=r),r}var ln=t=>t?jr(t)?Kr(t):ln(t.parent):null,hn=l(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>ln(t.parent),$root:t=>ln(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>vn(t),$forceUpdate:t=>t.f||(t.f=()=>{Ve(t.update)}),$nextTick:t=>t.n||(t.n=je.bind(t.proxy)),$watch:t=>oi.bind(t)}),cn=(t,e)=>t!==i&&!t.__isScriptSetup&&d(t,e),dn={get({_:t},e){if("__v_skip"===e)return!0;const{ctx:n,setupState:r,data:o,props:s,accessCache:a,type:l,appContext:h}=t;if("$"!==e[0]){const t=a[e];if(void 0!==t)switch(t){case 1:return r[e];case 2:return o[e];case 4:return n[e];case 3:return s[e]}else{if(cn(r,e))return a[e]=1,r[e];if(o!==i&&d(o,e))return a[e]=2,o[e];if(d(s,e))return a[e]=3,s[e];if(n!==i&&d(n,e))return a[e]=4,n[e];pn&&(a[e]=0)}}const c=hn[e];let u,p;return c?("$attrs"===e&&Pt(t.attrs,0,""),c(t)):(u=l.__cssModules)&&(u=u[e])?u:n!==i&&d(n,e)?(a[e]=4,n[e]):(p=h.config.globalProperties,d(p,e)?p[e]:void 0)},set({_:t},e,n){const{data:r,setupState:o,ctx:s}=t;return cn(o,e)?(o[e]=n,!0):r!==i&&d(r,e)?(r[e]=n,!0):!d(t.props,e)&&(("$"!==e[0]||!(e.slice(1)in t))&&(s[e]=n,!0))},has({_:{data:t,setupState:e,accessCache:n,ctx:r,appContext:o,props:s,type:a}},l){let h;return!!(n[l]||t!==i&&"$"!==l[0]&&d(t,l)||cn(e,l)||d(s,l)||d(r,l)||d(hn,l)||d(o.config.globalProperties,l)||(h=a.__cssModules)&&h[l])},defineProperty(t,e,i){return null!=i.get?t._.accessCache[e]=0:d(i,"value")&&this.set(t,e,i.value,null),Reflect.defineProperty(t,e,i)}};function un(t){return u(t)?t.reduce((t,e)=>(t[e]=null,t),{}):t}var pn=!0;function fn(t){const e=vn(t),i=t.proxy,n=t.ctx;pn=!1,e.beforeCreate&&gn(e.beforeCreate,t,"bc");const{data:o,computed:s,methods:a,watch:l,provide:h,inject:c,created:d,beforeMount:p,mounted:f,beforeUpdate:g,updated:v,activated:m,deactivated:x,beforeDestroy:w,beforeUnmount:b,destroyed:S,unmounted:k,render:E,renderTracked:C,renderTriggered:O,errorCaptured:L,serverPrefetch:P,expose:T,inheritAttrs:B,components:R,directives:A,filters:M}=e;if(c&&function(t,e){u(t)&&(t=wn(t));for(const i in t){const n=t[i];let r;r=y(n)?"default"in n?ei(n.from||i,n.default,!0):ei(n.from||i):ei(n),ye(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:t=>r.value=t}):e[i]=r}}(c,n,null),a)for(const r in a){const t=a[r];_(t)&&(n[r]=t.bind(i))}if(o){const e=o.call(i,i);y(e)&&(t.data=he(e))}if(pn=!0,s)for(const u in s){const t=s[u],e=$r({get:_(t)?t.bind(i,i):_(t.get)?t.get.bind(i,i):r,set:!_(t)&&_(t.set)?t.set.bind(i):r});Object.defineProperty(n,u,{enumerable:!0,configurable:!0,get:()=>e.value,set:t=>e.value=t})}if(l)for(const r in l)_n(l[r],n,i,r);if(h){const t=_(h)?h.call(i):h;Reflect.ownKeys(t).forEach(e=>{ti(e,t[e])})}function D(t,e){u(e)?e.forEach(e=>t(e.bind(i))):e&&t(e.bind(i))}if(d&&gn(d,t,"c"),D(Xi,p),D(Gi,f),D(Ki,g),D($i,v),D(Ni,m),D(ji,x),D(en,L),D(tn,C),D(Qi,O),D(Zi,b),D(qi,k),D(Ji,P),u(T))if(T.length){const e=t.exposed||(t.exposed={});T.forEach(t=>{Object.defineProperty(e,t,{get:()=>i[t],set:e=>i[t]=e,enumerable:!0})})}else t.exposed||(t.exposed={});E&&t.render===r&&(t.render=E),null!=B&&(t.inheritAttrs=B),R&&(t.components=R),A&&(t.directives=A),P&&Ai(t)}function gn(t,e,i){Re(u(t)?t.map(t=>t.bind(e.proxy)):t.bind(e.proxy),e,i)}function _n(t,e,i,n){let r=n.includes(".")?si(i,n):()=>i[n];if(v(t)){const i=e[t];_(i)&&ni(r,i)}else if(_(t))ni(r,t.bind(i));else if(y(t))if(u(t))t.forEach(t=>_n(t,e,i,n));else{const n=_(t.handler)?t.handler.bind(i):e[t.handler];_(n)&&ni(r,n,t)}}function vn(t){const e=t.type,{mixins:i,extends:n}=e,{mixins:r,optionsCache:o,config:{optionMergeStrategies:s}}=t.appContext,a=o.get(e);let l;return a?l=a:r.length||i||n?(l={},r.length&&r.forEach(t=>mn(l,t,s,!0)),mn(l,e,s)):l=e,y(e)&&o.set(e,l),l}function mn(t,e,i,n=!1){const{mixins:r,extends:o}=e;o&&mn(t,o,i,!0),r&&r.forEach(e=>mn(t,e,i,!0));for(const s in e)if(n&&"expose"===s);else{const n=yn[s]||i&&i[s];t[s]=n?n(t[s],e[s]):e[s]}return t}var yn={data:xn,props:kn,emits:kn,methods:Sn,computed:Sn,beforeCreate:bn,created:bn,beforeMount:bn,mounted:bn,beforeUpdate:bn,updated:bn,beforeDestroy:bn,beforeUnmount:bn,destroyed:bn,unmounted:bn,activated:bn,deactivated:bn,errorCaptured:bn,serverPrefetch:bn,components:Sn,directives:Sn,watch:function(t,e){if(!t)return e;if(!e)return t;const i=l(Object.create(null),t);for(const n in e)i[n]=bn(t[n],e[n]);return i},provide:xn,inject:function(t,e){return Sn(wn(t),wn(e))}};function xn(t,e){return e?t?function(){return l(_(t)?t.call(this,this):t,_(e)?e.call(this,this):e)}:e:t}function wn(t){if(u(t)){const e={};for(let i=0;i<t.length;i++)e[t[i]]=t[i];return e}return t}function bn(t,e){return t?[...new Set([].concat(t,e))]:e}function Sn(t,e){return t?l(Object.create(null),t,e):e}function kn(t,e){return t?u(t)&&u(e)?[...new Set([...t,...e])]:l(Object.create(null),un(t),un(null!=e?e:{})):e}function En(){return{app:null,config:{isNativeTag:o,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var Cn=0;function On(t,e){return function(i,n=null){_(i)||(i=l({},i)),null==n||y(n)||(n=null);const r=En(),o=new WeakSet,s=[];let a=!1;const h=r.app={_uid:Cn++,_component:i,_props:n,_container:null,_context:r,_instance:null,version:Zr,get config(){return r.config},set config(t){},use:(t,...e)=>(o.has(t)||(t&&_(t.install)?(o.add(t),t.install(h,...e)):_(t)&&(o.add(t),t(h,...e))),h),mixin:t=>(r.mixins.includes(t)||r.mixins.push(t),h),component:(t,e)=>e?(r.components[t]=e,h):r.components[t],directive:(t,e)=>e?(r.directives[t]=e,h):r.directives[t],mount(o,s,l){if(!a){const c=h._ceVNode||Er(i,n);return c.appContext=r,!0===l?l="svg":!1===l&&(l=void 0),s&&e?e(c,o):t(c,o,l),a=!0,h._container=o,o.__vue_app__=h,Kr(c.component)}},onUnmount(t){s.push(t)},unmount(){a&&(Re(s,h._instance,16),t(null,h._container),delete h._container.__vue_app__)},provide:(t,e)=>(r.provides[t]=e,h),runWithContext(t){const e=Ln;Ln=h;try{return t()}finally{Ln=e}}};return h}}var Ln=null;function Pn(t,e,...n){if(t.isUnmounted)return;const r=t.vnode.props||i;let o=n;const s=e.startsWith("update:"),a=s&&((t,e)=>"modelValue"===e||"model-value"===e?t.modelModifiers:t[`${e}Modifiers`]||t[`${L(e)}Modifiers`]||t[`${T(e)}Modifiers`])(r,e.slice(7));let l;a&&(a.trim&&(o=n.map(t=>v(t)?t.trim():t)),a.number&&(o=n.map(I)));let h=r[l=R(e)]||r[l=R(L(e))];!h&&s&&(h=r[l=R(T(e))]),h&&Re(h,t,6,o);const c=r[l+"Once"];if(c){if(t.emitted){if(t.emitted[l])return}else t.emitted={};t.emitted[l]=!0,Re(c,t,6,o)}}var Tn=new WeakMap;function Bn(t,e,i=!1){const n=i?Tn:e.emitsCache,r=n.get(t);if(void 0!==r)return r;const o=t.emits;let s={},a=!1;if(!_(t)){const n=t=>{const i=Bn(t,e,!0);i&&(a=!0,l(s,i))};!i&&e.mixins.length&&e.mixins.forEach(n),t.extends&&n(t.extends),t.mixins&&t.mixins.forEach(n)}return o||a?(u(o)?o.forEach(t=>s[t]=null):l(s,o),y(t)&&n.set(t,s),s):(y(t)&&n.set(t,null),null)}function Rn(t,e){return!(!t||!s(e))&&(e=e.slice(2).replace(/Once$/,""),d(t,e[0].toLowerCase()+e.slice(1))||d(t,T(e))||d(t,e))}function An(t){const{type:e,vnode:i,proxy:n,withProxy:r,propsOptions:[o],slots:s,attrs:l,emit:h,render:c,renderCache:d,props:u,data:p,setupState:f,ctx:g,inheritAttrs:_}=t,v=Ze(t);let m,y;try{if(4&i.shapeFlag){const t=r||n,e=t;m=Pr(c.call(e,t,d,u,f,p,g)),y=l}else{const t=e;m=Pr(t.length>1?t(u,{attrs:l,slots:s,emit:h}):t(u,null)),y=e.props?l:Mn(l)}}catch(w){ur.length=0,Ae(w,t,1),m=Er(cr)}let x=m;if(y&&!1!==_){const t=Object.keys(y),{shapeFlag:e}=x;t.length&&7&e&&(o&&t.some(a)&&(y=Dn(y,o)),x=Cr(x,y,!1,!0))}return i.dirs&&(x=Cr(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(i.dirs):i.dirs),i.transition&&Ti(x,i.transition),m=x,Ze(v),m}var Mn=t=>{let e;for(const i in t)("class"===i||"style"===i||s(i))&&((e||(e={}))[i]=t[i]);return e},Dn=(t,e)=>{const i={};for(const n in t)a(n)&&n.slice(9)in e||(i[n]=t[n]);return i};function In(t,e,i){const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!0;for(let r=0;r<n.length;r++){const o=n[r];if(Fn(e,t,o)&&!Rn(i,o))return!0}return!1}function Fn(t,e,i){const n=t[i],r=e[i];return"style"===i&&y(n)&&y(r)?!G(n,r):n!==r}var Wn={},zn=()=>Object.create(Wn),Nn=t=>Object.getPrototypeOf(t)===Wn;function jn(t,e,i,n=!1){const r={},o=zn();t.propsDefaults=Object.create(null),Vn(t,e,r,o);for(const s in t.propsOptions[0])s in r||(r[s]=void 0);i?t.props=n?r:de(r,!1,$t,ie,oe):t.type.props?t.props=r:t.props=o,t.attrs=o}function Vn(t,e,n,r){const[o,s]=t.propsOptions;let a,l=!1;if(e)for(let i in e){if(E(i))continue;const h=e[i];let c;o&&d(o,c=L(i))?s&&s.includes(c)?(a||(a={}))[c]=h:n[c]=h:Rn(t.emitsOptions,i)||i in r&&h===r[i]||(r[i]=h,l=!0)}if(s){const e=_e(n),r=a||i;for(let i=0;i<s.length;i++){const a=s[i];n[a]=Hn(o,e,a,r[a],t,!d(r,a))}}return l}function Hn(t,e,i,n,r,o){const s=t[i];if(null!=s){const t=d(s,"default");if(t&&void 0===n){const t=s.default;if(s.type!==Function&&!s.skipFactory&&_(t)){const{propsDefaults:o}=r;if(i in o)n=o[i];else{const s=zr(r);n=o[i]=t.call(null,e),s()}}else n=t;r.ce&&r.ce._setProp(i,n)}s[0]&&(o&&!t?n=!1:!s[1]||""!==n&&n!==T(i)||(n=!0))}return n}var Un=new WeakMap;function Yn(t,e,r=!1){const o=r?Un:e.propsCache,s=o.get(t);if(s)return s;const a=t.props,h={},c=[];let p=!1;if(!_(t)){const i=t=>{p=!0;const[i,n]=Yn(t,e,!0);l(h,i),n&&c.push(...n)};!r&&e.mixins.length&&e.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}if(!a&&!p)return y(t)&&o.set(t,n),n;if(u(a))for(let n=0;n<a.length;n++){const t=L(a[n]);Xn(t)&&(h[t]=i)}else if(a)for(const i in a){const t=L(i);if(Xn(t)){const e=a[i],n=h[t]=u(e)||_(e)?{type:e}:l({},e),r=n.type;let o=!1,s=!0;if(u(r))for(let t=0;t<r.length;++t){const e=r[t],i=_(e)&&e.name;if("Boolean"===i){o=!0;break}"String"===i&&(s=!1)}else o=_(r)&&"Boolean"===r.name;n[0]=o,n[1]=s,(o||d(n,"default"))&&c.push(t)}}const f=[h,c];return y(t)&&o.set(t,f),f}function Xn(t){return"$"!==t[0]&&!E(t)}var Gn=t=>"_"===t||"_ctx"===t||"$stable"===t,Kn=t=>u(t)?t.map(Pr):[Pr(t)],$n=(t,e,i)=>{if(e._n)return e;const n=qe((...t)=>Kn(e(...t)),i);return n._c=!1,n},Zn=(t,e,i)=>{const n=t._ctx;for(const r in t){if(Gn(r))continue;const i=t[r];if(_(i))e[r]=$n(0,i,n);else if(null!=i){const t=Kn(i);e[r]=()=>t}}},qn=(t,e)=>{const i=Kn(e);t.slots.default=()=>i},Jn=(t,e,i)=>{for(const n in e)!i&&Gn(n)||(t[n]=e[n])};var Qn=function(t,e){e&&e.pendingBranch?u(t)?e.effects.push(...t):e.effects.push(t):(i=t,u(i)?Ie.push(...i):Fe&&-1===i.id?Fe.splice(We+1,0,i):1&i.flags||(Ie.push(i),i.flags|=1),He());var i};function tr(t){return function(t,e){F().__VUE__=!0;const{insert:o,remove:s,patchProp:a,createElement:l,createText:h,createComment:c,setText:u,setElementText:p,parentNode:f,nextSibling:g,setScopeId:_=r,insertStaticContent:v}=t,m=(t,e,i,n=null,r=null,o=null,s=void 0,a=null,l=!!e.dynamicChildren)=>{if(t===e)return;t&&!wr(t,e)&&(n=Q(t),K(t,r,o,!0),t=null),-2===e.patchFlag&&(l=!1,e.dynamicChildren=null);const{type:h,ref:c,shapeFlag:d}=e;switch(h){case hr:y(t,e,i,n);break;case cr:w(t,e,i,n);break;case dr:null==t&&b(e,i,n,s);break;case lr:W(t,e,i,n,r,o,s,a,l);break;default:1&d?C(t,e,i,n,r,o,s,a,l):6&d?z(t,e,i,n,r,o,s,a,l):(64&d||128&d)&&h.process(t,e,i,n,r,o,s,a,l,nt)}null!=c&&r?Ii(c,t&&t.ref,o,e||t,!e):null==c&&t&&null!=t.ref&&Ii(t.ref,null,o,t,!0)},y=(t,e,i,n)=>{if(null==t)o(e.el=h(e.children),i,n);else{const i=e.el=t.el;e.children!==t.children&&u(i,e.children)}},w=(t,e,i,n)=>{null==t?o(e.el=c(e.children||""),i,n):e.el=t.el},b=(t,e,i,n)=>{[t.el,t.anchor]=v(t.children,e,i,n,t.el,t.anchor)},S=({el:t,anchor:e},i,n)=>{let r;for(;t&&t!==e;)r=g(t),o(t,i,n),t=r;o(e,i,n)},k=({el:t,anchor:e})=>{let i;for(;t&&t!==e;)i=g(t),s(t),t=i;s(e)},C=(t,e,i,n,r,o,s,a,l)=>{if("svg"===e.type?s="svg":"math"===e.type&&(s="mathml"),null==t)O(e,i,n,r,o,s,a,l);else{const i=t.el&&t.el._isVueCE?t.el:null;try{i&&i._beginPatch(),R(t,e,r,o,s,a,l)}finally{i&&i._endPatch()}}},O=(t,e,i,n,r,s,h,c)=>{let d,u;const{props:f,shapeFlag:g,transition:_,dirs:v}=t;if(d=t.el=l(t.type,s,f&&f.is,f),8&g?p(d,t.children):16&g&&B(t.children,d,null,n,r,er(t,s),h,c),v&&Qe(t,null,n,"created"),P(d,t,t.scopeId,h,n),f){for(const t in f)"value"===t||E(t)||a(d,t,null,f[t],s,n);"value"in f&&a(d,"value",null,f.value,s),(u=f.onVnodeBeforeMount)&&Rr(u,n,t)}v&&Qe(t,null,n,"beforeMount");const m=function(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}(r,_);m&&_.beforeEnter(d),o(d,e,i),((u=f&&f.onVnodeMounted)||m||v)&&Qn(()=>{try{u&&Rr(u,n,t),m&&_.enter(d),v&&Qe(t,null,n,"mounted")}finally{}},r)},P=(t,e,i,n,r)=>{if(i&&_(t,i),n)for(let o=0;o<n.length;o++)_(t,n[o]);if(r){let i=r.subTree;if(e===i||ar(i.type)&&(i.ssContent===e||i.ssFallback===e)){const e=r.vnode;P(t,e,e.scopeId,e.slotScopeIds,r.parent)}}},B=(t,e,i,n,r,o,s,a,l=0)=>{for(let h=l;h<t.length;h++)m(null,t[h]=a?Tr(t[h]):Pr(t[h]),e,i,n,r,o,s,a)},R=(t,e,n,r,o,s,l)=>{const h=e.el=t.el;let{patchFlag:c,dynamicChildren:d,dirs:u}=e;c|=16&t.patchFlag;const f=t.props||i,g=e.props||i;let _;if(n&&ir(n,!1),(_=g.onVnodeBeforeUpdate)&&Rr(_,n,e,t),u&&Qe(e,t,n,"beforeUpdate"),n&&ir(n,!0),(f.innerHTML&&null==g.innerHTML||f.textContent&&null==g.textContent)&&p(h,""),d?A(t.dynamicChildren,d,h,n,r,er(e,o),s):l||U(t,e,h,null,n,r,er(e,o),s,!1),c>0){if(16&c)I(h,f,g,n,o);else if(2&c&&f.class!==g.class&&a(h,"class",null,g.class,o),4&c&&a(h,"style",f.style,g.style,o),8&c){const t=e.dynamicProps;for(let e=0;e<t.length;e++){const i=t[e],r=f[i],s=g[i];s===r&&"value"!==i||a(h,i,r,s,o,n)}}1&c&&t.children!==e.children&&p(h,e.children)}else l||null!=d||I(h,f,g,n,o);((_=g.onVnodeUpdated)||u)&&Qn(()=>{_&&Rr(_,n,e,t),u&&Qe(e,t,n,"updated")},r)},A=(t,e,i,n,r,o,s)=>{for(let a=0;a<e.length;a++){const l=t[a],h=e[a];m(l,h,l.el&&(l.type===lr||!wr(l,h)||198&l.shapeFlag)?f(l.el):i,null,n,r,o,s,!0)}},I=(t,e,n,r,o)=>{if(e!==n){if(e!==i)for(const i in e)E(i)||i in n||a(t,i,e[i],null,o,r);for(const i in n){if(E(i))continue;const s=n[i],l=e[i];s!==l&&"value"!==i&&a(t,i,l,s,o,r)}"value"in n&&a(t,"value",e.value,n.value,o)}},W=(t,e,i,n,r,s,a,l,c)=>{const d=e.el=t?t.el:h(""),u=e.anchor=t?t.anchor:h("");let{patchFlag:p,dynamicChildren:f,slotScopeIds:g}=e;g&&(l=l?l.concat(g):g),null==t?(o(d,i,n),o(u,i,n),B(e.children||[],i,u,r,s,a,l,c)):p>0&&64&p&&f&&t.dynamicChildren&&t.dynamicChildren.length===f.length?(A(t.dynamicChildren,f,i,r,s,a,l),(null!=e.key||r&&e===r.subTree)&&nr(t,e,!0)):U(t,e,i,u,r,s,a,l,c)},z=(t,e,i,n,r,o,s,a,l)=>{e.slotScopeIds=a,null==t?512&e.shapeFlag?r.ctx.activate(e,i,n,s,l):N(e,i,n,r,o,s,l):j(t,e,l)},N=(t,e,n,r,o,s,a)=>{const l=t.component=function(t,e,n){const r=t.type,o=(e?e.appContext:t.appContext)||Ar,s={uid:Mr++,vnode:t,type:r,parent:e,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new et(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(o.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Yn(r,o),emitsOptions:Bn(r,o),emit:null,emitted:null,propsDefaults:i,inheritAttrs:r.inheritAttrs,ctx:i,data:i,props:i,attrs:i,slots:i,refs:i,setupState:i,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};s.ctx={_:s},s.root=e?e.root:s,s.emit=Pn.bind(null,s),t.ce&&t.ce(s);return s}(t,r,o);if(zi(t)&&(l.ctx.renderer=nt),function(t,e=!1,i=!1){e&&Ir(e);const{props:n,children:r}=t.vnode,o=jr(t);jn(t,n,o,e),((t,e,i)=>{const n=t.slots=zn();if(32&t.vnode.shapeFlag){const t=e._;t?(Jn(n,e,i),i&&D(n,"_",t,!0)):Zn(e,n)}else e&&qn(t,e)})(t,r,i||e);const s=o?function(t,e){const i=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,dn);const{setup:n}=i;if(n){mt();const i=t.setupContext=n.length>1?function(t){const e=e=>{t.exposed=e||{}};return{attrs:new Proxy(t.attrs,Gr),slots:t.slots,emit:t.emit,expose:e}}(t):null,r=zr(t),o=Be(n,t,0,[t.props,i]),s=x(o);if(yt(),r(),!s&&!t.sp||Wi(t)||Ai(t),s){if(o.then(Nr,Nr),e)return o.then(i=>{Yr(t,i,e)}).catch(e=>{Ae(e,t,0)});t.asyncDep=o}else Yr(t,o,e)}else Xr(t,e)}(t,e):void 0;e&&Ir(!1)}(l,!1,a),l.asyncDep){if(o&&o.registerDep(l,V,a),!t.el){const i=l.subTree=Er(cr);w(null,i,e,n),t.placeholder=i.el}}else V(l,t,e,n,o,s,a)},j=(t,e,i)=>{const n=e.component=t.component;if(function(t,e,i){const{props:n,children:r,component:o}=t,{props:s,children:a,patchFlag:l}=e,h=o.emitsOptions;if(e.dirs||e.transition)return!0;if(!(i&&l>=0))return!(!r&&!a||a&&a.$stable)||n!==s&&(n?!s||In(n,s,h):!!s);if(1024&l)return!0;if(16&l)return n?In(n,s,h):!!s;if(8&l){const t=e.dynamicProps;for(let e=0;e<t.length;e++){const i=t[e];if(Fn(s,n,i)&&!Rn(h,i))return!0}}return!1}(t,e,i)){if(n.asyncDep&&!n.asyncResolved)return void H(n,e,i);n.next=e,n.update()}else e.el=t.el,n.vnode=e},V=(t,e,i,n,r,o,s)=>{const a=()=>{if(t.isMounted){let{next:e,bu:i,u:n,parent:a,vnode:l}=t;{const i=rr(t);if(i)return e&&(e.el=l.el,H(t,e,s)),void i.asyncDep.then(()=>{Qn(()=>{t.isUnmounted||h()},r)})}let c,d=e;ir(t,!1),e?(e.el=l.el,H(t,e,s)):e=l,i&&M(i),(c=e.props&&e.props.onVnodeBeforeUpdate)&&Rr(c,a,e,l),ir(t,!0);const u=An(t),p=t.subTree;t.subTree=u,m(p,u,f(p.el),Q(p),t,r,o),e.el=u.el,null===d&&function({vnode:t,parent:e,suspense:i},n){for(;e;){const i=e.subTree;if(i.suspense&&i.suspense.activeBranch===t&&(i.suspense.vnode.el=i.el=n,t=i),i!==t)break;(t=e.vnode).el=n,e=e.parent}i&&i.activeBranch===t&&(i.vnode.el=n)}(t,u.el),n&&Qn(n,r),(c=e.props&&e.props.onVnodeUpdated)&&Qn(()=>Rr(c,a,e,l),r)}else{let s;const{el:a,props:l}=e,{bm:h,m:c,parent:d,root:u,type:p}=t,f=Wi(e);if(ir(t,!1),h&&M(h),!f&&(s=l&&l.onVnodeBeforeMount)&&Rr(s,d,e),ir(t,!0),a&&st){const e=()=>{t.subTree=An(t),st(a,t.subTree,t,r,null)};f&&p.__asyncHydrate?p.__asyncHydrate(a,t,e):e()}else{u.ce&&u.ce._hasShadowRoot()&&u.ce._injectChildStyle(p,t.parent?t.parent.type:void 0);const s=t.subTree=An(t);m(null,s,i,n,t,r,o),e.el=s.el}if(c&&Qn(c,r),!f&&(s=l&&l.onVnodeMounted)){const t=e;Qn(()=>Rr(s,d,t),r)}(256&e.shapeFlag||d&&Wi(d.vnode)&&256&d.vnode.shapeFlag)&&t.a&&Qn(t.a,r),t.isMounted=!0,e=i=n=null}};t.scope.on();const l=t.effect=new ot(a);t.scope.off();const h=t.update=l.run.bind(l),c=t.job=l.runIfDirty.bind(l);c.i=t,c.id=t.uid,l.scheduler=()=>Ve(c),ir(t,!0),h()},H=(t,e,n)=>{e.component=t;const r=t.vnode.props;t.vnode=e,t.next=null,function(t,e,i,n){const{props:r,attrs:o,vnode:{patchFlag:s}}=t,a=_e(r),[l]=t.propsOptions;let h=!1;if(!(n||s>0)||16&s){let n;Vn(t,e,r,o)&&(h=!0);for(const o in a)e&&(d(e,o)||(n=T(o))!==o&&d(e,n))||(l?!i||void 0===i[o]&&void 0===i[n]||(r[o]=Hn(l,a,o,void 0,t,!0)):delete r[o]);if(o!==a)for(const t in o)e&&d(e,t)||(delete o[t],h=!0)}else if(8&s){const i=t.vnode.dynamicProps;for(let n=0;n<i.length;n++){let s=i[n];if(Rn(t.emitsOptions,s))continue;const c=e[s];if(l)if(d(o,s))c!==o[s]&&(o[s]=c,h=!0);else{const e=L(s);r[e]=Hn(l,a,e,c,t,!1)}else c!==o[s]&&(o[s]=c,h=!0)}}h&&Tt(t.attrs,"set","")}(t,e.props,r,n),((t,e,n)=>{const{vnode:r,slots:o}=t;let s=!0,a=i;if(32&r.shapeFlag){const t=e._;t?n&&1===t?s=!1:Jn(o,e,n):(s=!e.$stable,Zn(e,o)),a=e}else e&&(qn(t,e),a={default:1});if(s)for(const i in o)Gn(i)||null!=a[i]||delete o[i]})(t,e.children,n),mt(),Ue(t),yt()},U=(t,e,i,n,r,o,s,a,l=!1)=>{const h=t&&t.children,c=t?t.shapeFlag:0,d=e.children,{patchFlag:u,shapeFlag:f}=e;if(u>0){if(128&u)return void X(h,d,i,n,r,o,s,a,l);if(256&u)return void Y(h,d,i,n,r,o,s,a,l)}8&f?(16&c&&J(h,r,o),d!==h&&p(i,d)):16&c?16&f?X(h,d,i,n,r,o,s,a,l):J(h,r,o,!0):(8&c&&p(i,""),16&f&&B(d,i,n,r,o,s,a,l))},Y=(t,e,i,r,o,s,a,l,h)=>{e=e||n;const c=(t=t||n).length,d=e.length,u=Math.min(c,d);let p;for(p=0;p<u;p++){const n=e[p]=h?Tr(e[p]):Pr(e[p]);m(t[p],n,i,null,o,s,a,l,h)}c>d?J(t,o,s,!0,!1,u):B(e,i,r,o,s,a,l,h,u)},X=(t,e,i,r,o,s,a,l,h)=>{let c=0;const d=e.length;let u=t.length-1,p=d-1;for(;c<=u&&c<=p;){const n=t[c],r=e[c]=h?Tr(e[c]):Pr(e[c]);if(!wr(n,r))break;m(n,r,i,null,o,s,a,l,h),c++}for(;c<=u&&c<=p;){const n=t[u],r=e[p]=h?Tr(e[p]):Pr(e[p]);if(!wr(n,r))break;m(n,r,i,null,o,s,a,l,h),u--,p--}if(c>u){if(c<=p){const t=p+1,n=t<d?e[t].el:r;for(;c<=p;)m(null,e[c]=h?Tr(e[c]):Pr(e[c]),i,n,o,s,a,l,h),c++}}else if(c>p)for(;c<=u;)K(t[c],o,s,!0),c++;else{const f=c,g=c,_=new Map;for(c=g;c<=p;c++){const t=e[c]=h?Tr(e[c]):Pr(e[c]);null!=t.key&&_.set(t.key,c)}let v,y=0;const x=p-g+1;let w=!1,b=0;const S=new Array(x);for(c=0;c<x;c++)S[c]=0;for(c=f;c<=u;c++){const n=t[c];if(y>=x){K(n,o,s,!0);continue}let r;if(null!=n.key)r=_.get(n.key);else for(v=g;v<=p;v++)if(0===S[v-g]&&wr(n,e[v])){r=v;break}void 0===r?K(n,o,s,!0):(S[r-g]=c+1,r>=b?b=r:w=!0,m(n,e[r],i,null,o,s,a,l,h),y++)}const k=w?function(t){const e=t.slice(),i=[0];let n,r,o,s,a;const l=t.length;for(n=0;n<l;n++){const l=t[n];if(0!==l){if(r=i[i.length-1],t[r]<l){e[n]=r,i.push(n);continue}for(o=0,s=i.length-1;o<s;)a=o+s>>1,t[i[a]]<l?o=a+1:s=a;l<t[i[o]]&&(o>0&&(e[n]=i[o-1]),i[o]=n)}}o=i.length,s=i[o-1];for(;o-- >0;)i[o]=s,s=e[s];return i}(S):n;for(v=k.length-1,c=x-1;c>=0;c--){const t=g+c,n=e[t],u=e[t+1],p=t+1<d?u.el||sr(u):r;0===S[c]?m(null,n,i,p,o,s,a,l,h):w&&(v<0||c!==k[v]?G(n,i,p,2):v--)}}},G=(t,e,i,n,r=null)=>{const{el:a,type:l,transition:h,children:c,shapeFlag:d}=t;if(6&d)G(t.component.subTree,e,i,n);else if(128&d)t.suspense.move(e,i,n);else if(64&d)l.move(t,e,i,nt);else if(l!==lr)if(l!==dr)if(2!==n&&1&d&&h)if(0===n)h.beforeEnter(a),o(a,e,i),Qn(()=>h.enter(a),r);else{const{leave:n,delayLeave:r,afterLeave:l}=h,c=()=>{t.ctx.isUnmounted?s(a):o(a,e,i)},d=()=>{a._isLeaving&&a[yi](!0),n(a,()=>{c(),l&&l()})};r?r(a,c,d):d()}else o(a,e,i);else S(t,e,i);else{o(a,e,i);for(let t=0;t<c.length;t++)G(c[t],e,i,n);o(t.anchor,e,i)}},K=(t,e,i,n=!1,r=!1)=>{const{type:o,props:s,ref:a,children:l,dynamicChildren:h,shapeFlag:c,patchFlag:d,dirs:u,cacheIndex:p,memo:f}=t;if(-2===d&&(r=!1),null!=a&&(mt(),Ii(a,null,i,t,!0),yt()),null!=p&&(e.renderCache[p]=void 0),256&c)return void e.ctx.deactivate(t);const g=1&c&&u,_=!Wi(t);let v;if(_&&(v=s&&s.onVnodeBeforeUnmount)&&Rr(v,e,t),6&c)q(t.component,i,n);else{if(128&c)return void t.suspense.unmount(i,n);g&&Qe(t,null,e,"beforeUnmount"),64&c?t.type.remove(t,e,i,nt,n):h&&!h.hasOnce&&(o!==lr||d>0&&64&d)?J(h,e,i,!1,!0):(o===lr&&384&d||!r&&16&c)&&J(l,e,i),n&&$(t)}const m=null!=f&&null==p;(_&&(v=s&&s.onVnodeUnmounted)||g||m)&&Qn(()=>{v&&Rr(v,e,t),g&&Qe(t,null,e,"unmounted"),m&&(t.el=null)},i)},$=t=>{const{type:e,el:i,anchor:n,transition:r}=t;if(e===lr)return void Z(i,n);if(e===dr)return void k(t);const o=()=>{s(i),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&t.shapeFlag&&r&&!r.persisted){const{leave:e,delayLeave:n}=r,s=()=>e(i,o);n?n(t.el,o,s):s()}else o()},Z=(t,e)=>{let i;for(;t!==e;)i=g(t),s(t),t=i;s(e)},q=(t,e,i)=>{const{bum:n,scope:r,job:o,subTree:s,um:a,m:l,a:h}=t;or(l),or(h),n&&M(n),r.stop(),o&&(o.flags|=8,K(s,t,e,i)),a&&Qn(a,e),Qn(()=>{t.isUnmounted=!0},e)},J=(t,e,i,n=!1,r=!1,o=0)=>{for(let s=o;s<t.length;s++)K(t[s],e,i,n,r)},Q=t=>{if(6&t.shapeFlag)return Q(t.component.subTree);if(128&t.shapeFlag)return t.suspense.next();const e=g(t.anchor||t.el),i=e&&e[li];return i?g(i):e};let tt=!1;const it=(t,e,i)=>{let n;null==t?e._vnode&&(K(e._vnode,null,null,!0),n=e._vnode.component):m(e._vnode||null,t,e,null,null,null,i),e._vnode=t,tt||(tt=!0,Ue(n),Ye(),tt=!1)},nt={p:m,um:K,m:G,r:$,mt:N,mc:B,pc:U,pbc:A,n:Q,o:t};let rt,st;e&&([rt,st]=e(nt));return{render:it,hydrate:rt,createApp:On(it,rt)}}(t)}function er({type:t,props:e},i){return"svg"===i&&"foreignObject"===t||"mathml"===i&&"annotation-xml"===t&&e&&e.encoding&&e.encoding.includes("html")?void 0:i}function ir({effect:t,job:e},i){i?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function nr(t,e,i=!1){const n=t.children,r=e.children;if(u(n)&&u(r))for(let o=0;o<n.length;o++){const t=n[o];let e=r[o];1&e.shapeFlag&&!e.dynamicChildren&&((e.patchFlag<=0||32===e.patchFlag)&&(e=r[o]=Tr(r[o]),e.el=t.el),i||-2===e.patchFlag||nr(t,e)),e.type===hr&&(-1===e.patchFlag&&(e=r[o]=Tr(e)),e.el=t.el),e.type!==cr||e.el||(e.el=t.el)}}function rr(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:rr(e)}function or(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}function sr(t){if(t.placeholder)return t.placeholder;const e=t.component;return e?sr(e.subTree):null}var ar=t=>t.__isSuspense;var lr=Symbol.for("v-fgt"),hr=Symbol.for("v-txt"),cr=Symbol.for("v-cmt"),dr=Symbol.for("v-stc"),ur=[],pr=null;function fr(t=!1){ur.push(pr=t?null:[])}var gr=1;function _r(t,e=!1){gr+=t,t<0&&pr&&e&&(pr.hasOnce=!0)}function vr(t){return t.dynamicChildren=gr>0?pr||n:null,ur.pop(),pr=ur[ur.length-1]||null,gr>0&&pr&&pr.push(t),t}function mr(t,e,i,n,r,o){return vr(kr(t,e,i,n,r,o,!0))}function yr(t,e,i,n,r){return vr(Er(t,e,i,n,r,!0))}function xr(t){return!!t&&!0===t.__v_isVNode}function wr(t,e){return t.type===e.type&&t.key===e.key}var br=({key:t})=>null!=t?t:null,Sr=({ref:t,ref_key:e,ref_for:i})=>("number"==typeof t&&(t=""+t),null!=t?v(t)||ye(t)||_(t)?{i:Ke,r:t,k:e,f:!!i}:t:null);function kr(t,e=null,i=null,n=0,r=null,o=(t===lr?0:1),s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&br(e),ref:e&&Sr(e),scopeId:$e,slotScopeIds:null,children:i,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:n,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Ke};return a?(Br(l,i),128&o&&t.normalize(l)):i&&(l.shapeFlag|=v(i)?8:16),gr>0&&!s&&pr&&(l.patchFlag>0||6&o)&&32!==l.patchFlag&&pr.push(l),l}var Er=function(t,e=null,i=null,n=0,r=null,o=!1){t&&t!==on||(t=cr);if(xr(t)){const n=Cr(t,e,!0);return i&&Br(n,i),gr>0&&!o&&pr&&(6&n.shapeFlag?pr[pr.indexOf(t)]=n:pr.push(n)),n.patchFlag=-2,n}s=t,_(s)&&"__vccOpts"in s&&(t=t.__vccOpts);var s;if(e){e=function(t){return t?ge(t)||Nn(t)?l({},t):t:null}(e);let{class:t,style:i}=e;t&&!v(t)&&(e.class=H(t)),y(i)&&(ge(i)&&!u(i)&&(i=l({},i)),e.style=W(i))}const a=v(t)?1:ar(t)?128:hi(t)?64:y(t)?4:_(t)?2:0;return kr(t,e,i,n,r,a,o,!0)};function Cr(t,e,i=!1,n=!1){const{props:r,ref:o,patchFlag:l,children:h,transition:c}=t,d=e?function(...t){const e={};for(let i=0;i<t.length;i++){const n=t[i];for(const t in n)if("class"===t)e.class!==n.class&&(e.class=H([e.class,n.class]));else if("style"===t)e.style=W([e.style,n.style]);else if(s(t)){const i=e[t],r=n[t];!r||i===r||u(i)&&i.includes(r)?null!=r||null!=i||a(t)||(e[t]=r):e[t]=i?[].concat(i,r):r}else""!==t&&(e[t]=n[t])}return e}(r||{},e):r,p={__v_isVNode:!0,__v_skip:!0,type:t.type,props:d,key:d&&br(d),ref:e&&e.ref?i&&o?u(o)?o.concat(Sr(e)):[o,Sr(e)]:Sr(e):o,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:h,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==lr?-1===l?16:16|l:l,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:c,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Cr(t.ssContent),ssFallback:t.ssFallback&&Cr(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return c&&n&&Ti(p,c.clone(p)),p}function Or(t=" ",e=0){return Er(hr,null,t,e)}function Lr(t="",e=!1){return e?(fr(),yr(cr,null,t)):Er(cr,null,t)}function Pr(t){return null==t||"boolean"==typeof t?Er(cr):u(t)?Er(lr,null,t.slice()):xr(t)?Tr(t):Er(hr,null,String(t))}function Tr(t){return null===t.el&&-1!==t.patchFlag||t.memo?t:Cr(t)}function Br(t,e){let i=0;const{shapeFlag:n}=t;if(null==e)e=null;else if(u(e))i=16;else if("object"==typeof e){if(65&n){const i=e.default;return void(i&&(i._c&&(i._d=!1),Br(t,i()),i._c&&(i._d=!0)))}{i=32;const n=e._;n||Nn(e)?3===n&&Ke&&(1===Ke.slots._?e._=1:(e._=2,t.patchFlag|=1024)):e._ctx=Ke}}else _(e)?(e={default:e,_ctx:Ke},i=32):(e=String(e),64&n?(i=16,e=[Or(e)]):i=8);t.children=e,t.shapeFlag|=i}function Rr(t,e,i,n=null){Re(t,e,7,[i,n])}var Ar=En(),Mr=0;var Dr,Ir,Fr=null,Wr=()=>Fr||Ke;{const t=F(),e=(e,i)=>{let n;return(n=t[e])||(n=t[e]=[]),n.push(i),t=>{n.length>1?n.forEach(e=>e(t)):n[0](t)}};Dr=e("__VUE_INSTANCE_SETTERS__",t=>Fr=t),Ir=e("__VUE_SSR_SETTERS__",t=>Ur=t)}var zr=t=>{const e=Fr;return Dr(t),t.scope.on(),()=>{t.scope.off(),Dr(e)}},Nr=()=>{Fr&&Fr.scope.off(),Dr(null)};function jr(t){return 4&t.vnode.shapeFlag}var Vr,Hr,Ur=!1;function Yr(t,e,i){_(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:y(e)&&(t.setupState=ke(e)),Xr(t,i)}function Xr(t,e,i){const n=t.type;if(!t.render){if(!e&&Vr&&!n.render){const e=n.template||vn(t).template;if(e){const{isCustomElement:i,compilerOptions:r}=t.appContext.config,{delimiters:o,compilerOptions:s}=n,a=l(l({isCustomElement:i,delimiters:o},r),s);n.render=Vr(e,a)}}t.render=n.render||r,Hr&&Hr(t)}{const e=zr(t);mt();try{fn(t)}finally{yt(),e()}}}var Gr={get:(t,e)=>(Pt(t,0,""),t[e])};function Kr(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(ke((e=t.exposed,!d(e,"__v_skip")&&Object.isExtensible(e)&&D(e,"__v_skip",!0),e)),{get:(e,i)=>i in e?e[i]:i in hn?hn[i](t):void 0,has:(t,e)=>e in t||e in hn})):t.proxy;var e}var $r=(t,e)=>function(t,e,i=!1){let n,r;return _(t)?n=t:(n=t.get,r=t.set),new Ee(n,r,i)}(t,0,Ur);var Zr="3.5.33",qr=void 0,Jr="undefined"!=typeof window&&window.trustedTypes;if(Jr)try{qr=Jr.createPolicy("vue",{createHTML:t=>t})}catch(bS){}var Qr=qr?t=>qr.createHTML(t):t=>t,to="undefined"!=typeof document?document:null,eo=to&&to.createElement("template"),io={insert:(t,e,i)=>{e.insertBefore(t,i||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,i,n)=>{const r="svg"===e?to.createElementNS("http://www.w3.org/2000/svg",t):"mathml"===e?to.createElementNS("http://www.w3.org/1998/Math/MathML",t):i?to.createElement(t,{is:i}):to.createElement(t);return"select"===t&&n&&null!=n.multiple&&r.setAttribute("multiple",n.multiple),r},createText:t=>to.createTextNode(t),createComment:t=>to.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>to.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,i,n,r,o){const s=i?i.previousSibling:e.lastChild;if(r&&(r===o||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),i),r!==o&&(r=r.nextSibling););else{eo.innerHTML=Qr("svg"===n?`<svg>${t}</svg>`:"mathml"===n?`<math>${t}</math>`:t);const r=eo.content;if("svg"===n||"mathml"===n){const t=r.firstChild;for(;t.firstChild;)r.appendChild(t.firstChild);r.removeChild(t)}e.insertBefore(r,i)}return[s?s.nextSibling:e.firstChild,i?i.previousSibling:e.lastChild]}},no="transition",ro="animation",oo=Symbol("_vtc"),so={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},ao=l({},bi,so),lo=t=>(t.displayName="Transition",t.props=ao,t),ho=lo((t,{slots:e})=>function(t,e,i){try{_r(-1);const n=arguments.length;return 2===n?y(e)&&!u(e)?xr(e)?Er(t,null,[e]):Er(t,e):Er(t,null,e):(n>3?i=Array.prototype.slice.call(arguments,2):3===n&&xr(i)&&(i=[i]),Er(t,e,i))}finally{_r(1)}}(Ei,function(t){const e={};for(const l in t)l in so||(e[l]=t[l]);if(!1===t.css)return e;const{name:i="v",type:n,duration:r,enterFromClass:o=`${i}-enter-from`,enterActiveClass:s=`${i}-enter-active`,enterToClass:a=`${i}-enter-to`,appearFromClass:h=o,appearActiveClass:c=s,appearToClass:d=a,leaveFromClass:u=`${i}-leave-from`,leaveActiveClass:p=`${i}-leave-active`,leaveToClass:f=`${i}-leave-to`}=t,g=function(t){if(null==t)return null;if(y(t))return[po(t.enter),po(t.leave)];{const e=po(t);return[e,e]}}(r),_=g&&g[0],v=g&&g[1],{onBeforeEnter:m,onEnter:x,onEnterCancelled:w,onLeave:b,onLeaveCancelled:S,onBeforeAppear:k=m,onAppear:E=x,onAppearCancelled:C=w}=e,O=(t,e,i,n)=>{t._enterCancelled=n,go(t,e?d:a),go(t,e?c:s),i&&i()},L=(t,e)=>{t._isLeaving=!1,go(t,u),go(t,f),go(t,p),e&&e()},P=t=>(e,i)=>{const r=t?E:x,s=()=>O(e,t,i);co(r,[e,s]),_o(()=>{go(e,t?h:o),fo(e,t?d:a),uo(r)||mo(e,n,_,s)})};return l(e,{onBeforeEnter(t){co(m,[t]),fo(t,o),fo(t,s)},onBeforeAppear(t){co(k,[t]),fo(t,h),fo(t,c)},onEnter:P(!1),onAppear:P(!0),onLeave(t,e){t._isLeaving=!0;const i=()=>L(t,e);fo(t,u),t._enterCancelled?(fo(t,p),wo(t)):(wo(t),fo(t,p)),_o(()=>{t._isLeaving&&(go(t,u),fo(t,f),uo(b)||mo(t,n,v,i))}),co(b,[t,i])},onEnterCancelled(t){O(t,!1,void 0,!0),co(w,[t])},onAppearCancelled(t){O(t,!0,void 0,!0),co(C,[t])},onLeaveCancelled(t){L(t),co(S,[t])}})}(t),e)),co=(t,e=[])=>{u(t)?t.forEach(t=>t(...e)):t&&t(...e)},uo=t=>!!t&&(u(t)?t.some(t=>t.length>1):t.length>1);function po(t){return(t=>{const e=v(t)?Number(t):NaN;return isNaN(e)?t:e})(t)}function fo(t,e){e.split(/\s+/).forEach(e=>e&&t.classList.add(e)),(t[oo]||(t[oo]=new Set)).add(e)}function go(t,e){e.split(/\s+/).forEach(e=>e&&t.classList.remove(e));const i=t[oo];i&&(i.delete(e),i.size||(t[oo]=void 0))}function _o(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}var vo=0;function mo(t,e,i,n){const r=t._endId=++vo,o=()=>{r===t._endId&&n()};if(null!=i)return setTimeout(o,i);const{type:s,timeout:a,propCount:l}=function(t,e){const i=window.getComputedStyle(t),n=t=>(i[t]||"").split(", "),r=n(`${no}Delay`),o=n(`${no}Duration`),s=yo(r,o),a=n(`${ro}Delay`),l=n(`${ro}Duration`),h=yo(a,l);let c=null,d=0,u=0;e===no?s>0&&(c=no,d=s,u=o.length):e===ro?h>0&&(c=ro,d=h,u=l.length):(d=Math.max(s,h),c=d>0?s>h?no:ro:null,u=c?c===no?o.length:l.length:0);const p=c===no&&/\b(?:transform|all)(?:,|$)/.test(n(`${no}Property`).toString());return{type:c,timeout:d,propCount:u,hasTransform:p}}(t,e);if(!s)return n();const h=s+"end";let c=0;const d=()=>{t.removeEventListener(h,u),o()},u=e=>{e.target===t&&++c>=l&&d()};setTimeout(()=>{c<l&&d()},a+1),t.addEventListener(h,u)}function yo(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((e,i)=>xo(e)+xo(t[i])))}function xo(t){return"auto"===t?0:1e3*Number(t.slice(0,-1).replace(",","."))}function wo(t){return(t?t.ownerDocument:document).body.offsetHeight}var bo=Symbol("_vod"),So=Symbol("_vsh"),ko=Symbol(""),Eo=/(?:^|;)\s*display\s*:/;var Co=/\s*!important$/;function Oo(t,e,i){if(u(i))i.forEach(i=>Oo(t,e,i));else if(null==i&&(i=""),e.startsWith("--"))t.setProperty(e,i);else{const n=function(t,e){const i=Po[e];if(i)return i;let n=L(e);if("filter"!==n&&n in t)return Po[e]=n;n=B(n);for(let r=0;r<Lo.length;r++){const i=Lo[r]+n;if(i in t)return Po[e]=i}return e}(t,e);Co.test(i)?t.setProperty(T(n),i.replace(Co,""),"important"):t[n]=i}}var Lo=["Webkit","Moz","ms"],Po={};function To(t,e,i,n){return"TEXTAREA"===t.tagName&&("width"===e||"height"===e)&&v(n)&&i===n}var Bo="http://www.w3.org/1999/xlink";function Ro(t,e,i,n,r,o=Y(e)){n&&e.startsWith("xlink:")?null==i?t.removeAttributeNS(Bo,e.slice(6,e.length)):t.setAttributeNS(Bo,e,i):null==i||o&&!X(i)?t.removeAttribute(e):t.setAttribute(e,o?"":m(i)?String(i):i)}function Ao(t,e,i,n,r){if("innerHTML"===e||"textContent"===e)return void(null!=i&&(t[e]="innerHTML"===e?Qr(i):i));const o=t.tagName;if("value"===e&&"PROGRESS"!==o&&!o.includes("-")){const n="OPTION"===o?t.getAttribute("value")||"":t.value,r=null==i?"checkbox"===t.type?"on":"":String(i);return n===r&&"_value"in t||(t.value=r),null==i&&t.removeAttribute(e),void(t._value=i)}let s=!1;if(""===i||null==i){const n=typeof t[e];"boolean"===n?i=X(i):null==i&&"string"===n?(i="",s=!0):"number"===n&&(i=0,s=!0)}try{t[e]=i}catch(bS){}s&&t.removeAttribute(r||e)}function Mo(t,e,i,n){t.addEventListener(e,i,n)}var Do=Symbol("_vei");function Io(t,e,i,n,r=null){const o=t[Do]||(t[Do]={}),s=o[e];if(n&&s)s.value=n;else{const[i,a]=function(t){let e;if(Fo.test(t)){let i;for(e={};i=t.match(Fo);)t=t.slice(0,t.length-i[0].length),e[i[0].toLowerCase()]=!0}return[":"===t[2]?t.slice(3):T(t.slice(2)),e]}(e);n?Mo(t,i,o[e]=function(t,e){const i=t=>{if(t._vts){if(t._vts<=i.attached)return}else t._vts=Date.now();Re(function(t,e){if(u(e)){const i=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{i.call(t),t._stopped=!0},e.map(t=>e=>!e._stopped&&t&&t(e))}return e}(t,i.value),e,5,[t])};return i.value=t,i.attached=No(),i}(n,r),a):s&&(!function(t,e,i,n){t.removeEventListener(e,i,n)}(t,i,s,a),o[e]=void 0)}}var Fo=/(?:Once|Passive|Capture)$/;var Wo=0,zo=Promise.resolve(),No=()=>Wo||(zo.then(()=>Wo=0),Wo=Date.now());var jo=t=>111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123;var Vo=t=>{const e=t.props["onUpdate:modelValue"]||!1;return u(e)?t=>M(e,t):e};function Ho(t){t.target.composing=!0}function Uo(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}var Yo=Symbol("_assign");function Xo(t,e,i){return e&&(t=t.trim()),i&&(t=I(t)),t}var Go={created(t,{modifiers:{lazy:e,trim:i,number:n}},r){t[Yo]=Vo(r);const o=n||r.props&&"number"===r.props.type;Mo(t,e?"change":"input",e=>{e.target.composing||t[Yo](Xo(t.value,i,o))}),(i||o)&&Mo(t,"change",()=>{t.value=Xo(t.value,i,o)}),e||(Mo(t,"compositionstart",Ho),Mo(t,"compositionend",Uo),Mo(t,"change",Uo))},mounted(t,{value:e}){t.value=null==e?"":e},beforeUpdate(t,{value:e,oldValue:i,modifiers:{lazy:n,trim:r,number:o}},s){if(t[Yo]=Vo(s),t.composing)return;const a=null==e?"":e;if((!o&&"number"!==t.type||/^0\d/.test(t.value)?t.value:I(t.value))===a)return;const l=t.getRootNode();if((l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===t&&"range"!==t.type){if(n&&e===i)return;if(r&&t.value.trim()===a)return}t.value=a}},Ko={deep:!0,created(t,{value:e,modifiers:{number:i}},n){const r=f(e);Mo(t,"change",()=>{const e=Array.prototype.filter.call(t.options,t=>t.selected).map(t=>i?I(Zo(t)):Zo(t));t[Yo](t.multiple?r?new Set(e):e:e[0]),t._assigning=!0,je(()=>{t._assigning=!1})}),t[Yo]=Vo(n)},mounted(t,{value:e}){$o(t,e)},beforeUpdate(t,e,i){t[Yo]=Vo(i)},updated(t,{value:e}){t._assigning||$o(t,e)}};function $o(t,e){const i=t.multiple,n=u(e);if(!i||n||f(e)){for(let r=0,o=t.options.length;r<o;r++){const o=t.options[r],s=Zo(o);if(i)if(n){const t=typeof s;o.selected="string"===t||"number"===t?e.some(t=>String(t)===String(s)):K(e,s)>-1}else o.selected=e.has(s);else if(G(Zo(o),e))return void(t.selectedIndex!==r&&(t.selectedIndex=r))}i||-1===t.selectedIndex||(t.selectedIndex=-1)}}function Zo(t){return"_value"in t?t._value:t.value}var qo,Jo=["ctrl","shift","alt","meta"],Qo={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&0!==t.button,middle:t=>"button"in t&&1!==t.button,right:t=>"button"in t&&2!==t.button,exact:(t,e)=>Jo.some(i=>t[`${i}Key`]&&!e.includes(i))},ts=(t,e)=>{if(!t)return t;const i=t._withMods||(t._withMods={}),n=e.join(".");return i[n]||(i[n]=(i,...n)=>{for(let t=0;t<e.length;t++){const n=Qo[e[t]];if(n&&n(i,e))return}return t(i,...n)})},es={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},is=(t,e)=>{const i=t._withKeys||(t._withKeys={}),n=e.join(".");return i[n]||(i[n]=i=>{if(!("key"in i))return;const n=T(i.key);return e.some(t=>t===n||es[t]===n)?t(i):void 0})},ns=l({patchProp:(t,e,i,n,r,o)=>{const l="svg"===r;"class"===e?function(t,e,i){const n=t[oo];n&&(e=(e?[e,...n]:[...n]).join(" ")),null==e?t.removeAttribute("class"):i?t.setAttribute("class",e):t.className=e}(t,n,l):"style"===e?function(t,e,i){const n=t.style,r=v(i);let o=!1;if(i&&!r){if(e)if(v(e))for(const t of e.split(";")){const e=t.slice(0,t.indexOf(":")).trim();null==i[e]&&Oo(n,e,"")}else for(const t in e)null==i[t]&&Oo(n,t,"");for(const r in i){"display"===r&&(o=!0);const s=i[r];null!=s?To(t,r,!v(e)&&e?e[r]:void 0,s)||Oo(n,r,s):Oo(n,r,"")}}else if(r){if(e!==i){const t=n[ko];t&&(i+=";"+t),n.cssText=i,o=Eo.test(i)}}else e&&t.removeAttribute("style");bo in t&&(t[bo]=o?n.display:"",t[So]&&(n.display="none"))}(t,i,n):s(e)?a(e)||Io(t,e,0,n,o):("."===e[0]?(e=e.slice(1),1):"^"===e[0]?(e=e.slice(1),0):function(t,e,i,n){if(n)return"innerHTML"===e||"textContent"===e||!!(e in t&&jo(e)&&_(i));if("spellcheck"===e||"draggable"===e||"translate"===e||"autocorrect"===e)return!1;if("sandbox"===e&&"IFRAME"===t.tagName)return!1;if("form"===e)return!1;if("list"===e&&"INPUT"===t.tagName)return!1;if("type"===e&&"TEXTAREA"===t.tagName)return!1;if("width"===e||"height"===e){const e=t.tagName;if("IMG"===e||"VIDEO"===e||"CANVAS"===e||"SOURCE"===e)return!1}return(!jo(e)||!v(i))&&e in t}(t,e,n,l))?(Ao(t,e,n),t.tagName.includes("-")||"value"!==e&&"checked"!==e&&"selected"!==e||Ro(t,e,n,l,0,"value"!==e)):t._isVueCE&&(function(t,e){const i=t._def.props;if(!i)return!1;const n=L(e);return Array.isArray(i)?i.some(t=>L(t)===n):Object.keys(i).some(t=>L(t)===n)}(t,e)||t._def.__asyncLoader&&(/[A-Z]/.test(e)||!v(n)))?Ao(t,L(e),n,0,e):("true-value"===e?t._trueValue=n:"false-value"===e&&(t._falseValue=n),Ro(t,e,n,l))}},io);var rs;!function(t){t[t.No=0]="No",t[t.Yes=1]="Yes",t[t.NoAndSkip=2]="NoAndSkip",t[t.YesAndSkip=3]="YesAndSkip"}(rs||(rs={}));var os={};function ss(t){return void 0===t}function as(t){return null==t}function ls(t){return"string"==typeof t}var{isFinite:hs}=Number;function cs(t){return"number"==typeof t}var{isArray:ds}=Array;function us(t){return t&&"object"==typeof t}var ps,fs,gs,_s={default:(t,e)=>(vs(e,t),vs(t,e),t),assign(t,e,i){let n;Object.keys(e).forEach(r=>{var o,s;if(n=e[r],(null==n?void 0:n.constructor)===Object&&(null===(o=t[r])||void 0===o?void 0:o.constructor)===Object)return vs(t[r],e[r],i&&i[r]);i&&r in i?(null===(s=i[r])||void 0===s?void 0:s.constructor)===Object&&vs(t[r]={},e[r],i[r]):t[r]=e[r]})},copyAttrs:(t,e,i)=>(i.forEach(i=>{ss(e[i])||(t[i]=e[i])}),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let i=0,n=t.length;i<n;i++)e[t[i]]=!0;return e},stintSet(t,e,i){i||(i=void 0),t[e]!==i&&(t[e]=i)}},{assign:vs}=_s,ms=class{get __useNaturalRatio(){return!0}get __isLinePath(){const{path:t}=this;return t&&6===t.length&&1===t[0]}get __usePathBox(){return this.__pathInputed}get __blendMode(){if(this.eraser&&"path"!==this.eraser)return"destination-out";const{blendMode:t}=this;return"pass-through"===t?null:t}constructor(t){this.__leaf=t}__get(t){if(this.__input){const e=this.__input[t];if(!ss(e))return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let i;for(let n in this)"_"!==n[0]&&(i=e?e[n]:void 0,t[n]=ss(i)?this[n]:i);return t}__setInput(t,e){this.__input||(this.__input={}),this.__input[t]=e}__getInput(t){if(this.__input){const e=this.__input[t];if(!ss(e))return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!ss(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,e){const i={};if(t)if(ds(t))for(let n of t)i[n]=this.__getInput(n);else for(let n in t)i[n]=this.__getInput(n);else{let t,e,{__input:n}=this;i.tag=this.__leaf.tag;for(let r in this)if("_"!==r[0]&&(t=this["_"+r],!ss(t))){if("path"===r&&!this.__pathInputed)continue;e=n?n[r]:void 0,i[r]=ss(e)?t:e}}if(e&&e.matrix){const{a:t,b:e,c:n,d:r,e:o,f:s}=this.__leaf.__localMatrix;i.matrix={a:t,b:e,c:n,d:r,e:o,f:s}}return i}__setMiddle(t,e){this.__middle||(this.__middle={}),this.__middle[t]=e}__getMiddle(t){return this.__middle&&this.__middle[t]}__checkSingle(){const t=this;if("pass-through"===t.blendMode){const e=this.__leaf;t.opacity<1&&(e.isBranch||t.__hasMultiPaint)||e.__hasEraser||t.eraser||t.filter?t.__single=!0:t.__single&&(t.__single=!1)}else t.__single=!0}__removeNaturalSize(){this.__naturalWidth=this.__naturalHeight=void 0}destroy(){this.__input=this.__middle=null,this.__complexData&&this.__complexData.destroy()}},ys={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=xs;return e[t]?e[t]++:(e[t]=1,0)}},xs=ys,{max:ws}=Math,bs=[0,0,0,0],Ss={zero:[...bs],tempFour:bs,set:(t,e,i,n,r)=>(void 0===i&&(i=n=r=e),t[0]=e,t[1]=i,t[2]=n,t[3]=r,t),setTemp:(t,e,i,n)=>ks(bs,t,e,i,n),toTempAB(t,e,i){gs=i?cs(t)?e:t:[],cs(t)?(ps=Cs(t),fs=e):cs(e)?(ps=t,fs=Cs(e)):(ps=t,fs=e),4!==ps.length&&(ps=Es(ps)),4!==fs.length&&(fs=Es(fs))},get(t,e){let i;if(!cs(t))switch(t.length){case 4:i=ss(e)?t:[...t];break;case 2:i=[t[0],t[1],t[0],t[1]];break;case 3:i=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(i||(i=[t,t,t,t]),!ss(e))for(let n=0;n<4;n++)i[n]>e&&(i[n]=e);return i},max:(t,e,i)=>cs(t)&&cs(e)?ws(t,e):(Os(t,e,i),ks(gs,ws(ps[0],fs[0]),ws(ps[1],fs[1]),ws(ps[2],fs[2]),ws(ps[3],fs[3]))),add:(t,e,i)=>cs(t)&&cs(e)?t+e:(Os(t,e,i),ks(gs,ps[0]+fs[0],ps[1]+fs[1],ps[2]+fs[2],ps[3]+fs[3])),swapAndScale(t,e,i,n){if(cs(t))return e===i?t*e:[t*i,t*e];const r=n?t:[],[o,s,a,l]=4===t.length?t:Es(t);return ks(r,a*i,l*e,o*i,s*e)}},{set:ks,get:Es,setTemp:Cs,toTempAB:Os}=Ss,{round:Ls,pow:Ps,max:Ts,floor:Bs,PI:Rs}=Math,As={},Ms={within:(t,e,i)=>(us(e)&&(i=e.max,e=e.min),!ss(e)&&t<e&&(t=e),!ss(i)&&t>i&&(t=i),t),fourNumber:Ss.get,formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),Ms.float(t)),getGapRotation(t,e,i=0){let n=t+i;if(e>1){const t=Math.abs(n%e);(t<1||t>e-1)&&(n=Math.round(n/e)*e)}return n-i},float(t,e){const i=ss(e)?1e12:Ps(10,e);return-0===(t=Ls(t*i)/i)?0:t},sign:t=>t<0?-1:1,getScaleData(t,e,i,n){if(n||(n={}),e){const t=(cs(e)?e:e.width||0)/i.width,r=(cs(e)?e:e.height||0)/i.height;n.scaleX=t||r||1,n.scaleY=r||t||1}else t&&Ms.assignScale(n,t);return n},getScaleFixedData(t,e,i,n,r){let{scaleX:o,scaleY:s}=t;if((n||e)&&(o<0&&(o=-o),s<0&&(s=-s)),e)if(!0===e)o=s=i?1:1/o;else{let t;cs(e)?t=e:"zoom-in"===e&&(t=1),t&&(o=s=o>t||s>t?i?1:1/o:i?1:1/t)}return As.scaleX=o,As.scaleY=s,As},assignScale(t,e){cs(e)?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},getFloorScale:(t,e=1)=>Ts(Bs(t),e)/t,randInt:Ds,randColor:t=>`rgba(${Ds(255)},${Ds(255)},${Ds(255)},${t||1})`};function Ds(t){return Math.round(Math.random()*t)}var Is=Rs/180,Fs=2*Rs,Ws=Rs/2;function zs(){return{a:1,b:0,c:0,d:1,e:0,f:0}}var{sin:Ns,cos:js,acos:Vs,sqrt:Hs}=Math,{float:Us}=Ms,Ys={};function Xs(){return Object.assign(Object.assign(Object.assign({},{a:1,b:0,c:0,d:1,e:0,f:0}),{x:0,y:0,width:0,height:0}),{scaleX:1,scaleY:1,rotation:0,skewX:0,skewY:0})}var Gs,Ks,$s={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:Xs(),tempMatrix:{},set(t,e=1,i=0,n=0,r=1,o=0,s=0){t.a=e,t.b=i,t.c=n,t.d=r,t.e=o,t.f=s},get:zs,getWorld:Xs,copy(t,e){t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f},translate(t,e,i){t.e+=e,t.f+=i},translateInner(t,e,i,n){t.e+=t.a*e+t.c*i,t.f+=t.b*e+t.d*i,n&&(t.e-=e,t.f-=i)},scale(t,e,i=e){t.a*=e,t.b*=e,t.c*=i,t.d*=i},pixelScale(t,e,i){i||(i=t),i.a=t.a*e,i.b=t.b*e,i.c=t.c*e,i.d=t.d*e,i.e=t.e*e,i.f=t.f*e},scaleOfOuter(t,e,i,n){Zs.toInnerPoint(t,e,Ys),Zs.scaleOfInner(t,Ys,i,n)},scaleOfInner(t,e,i,n=i){Zs.translateInner(t,e.x,e.y),Zs.scale(t,i,n),Zs.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:i,b:n,c:r,d:o}=t,s=js(e*=Is),a=Ns(e);t.a=i*s-n*a,t.b=i*a+n*s,t.c=r*s-o*a,t.d=r*a+o*s},rotateOfOuter(t,e,i){Zs.toInnerPoint(t,e,Ys),Zs.rotateOfInner(t,Ys,i)},rotateOfInner(t,e,i){Zs.translateInner(t,e.x,e.y),Zs.rotate(t,i),Zs.translateInner(t,-e.x,-e.y)},skew(t,e,i){const{a:n,b:r,c:o,d:s}=t;i&&(i*=Is,t.a=n+o*i,t.b=r+s*i),e&&(e*=Is,t.c=o+n*e,t.d=s+r*e)},skewOfOuter(t,e,i,n){Zs.toInnerPoint(t,e,Ys),Zs.skewOfInner(t,Ys,i,n)},skewOfInner(t,e,i,n=0){Zs.translateInner(t,e.x,e.y),Zs.skew(t,i,n),Zs.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:i,b:n,c:r,d:o,e:s,f:a}=t;t.a=e.a*i+e.b*r,t.b=e.a*n+e.b*o,t.c=e.c*i+e.d*r,t.d=e.c*n+e.d*o,t.e=e.e*i+e.f*r+s,t.f=e.e*n+e.f*o+a},multiplyParent(t,e,i,n,r){const{e:o,f:s}=t;if(i||(i=t),ss(n)&&(n=1!==t.a||t.b||t.c||1!==t.d),n){const{a:n,b:o,c:s,d:a}=t;i.a=n*e.a+o*e.c,i.b=n*e.b+o*e.d,i.c=s*e.a+a*e.c,i.d=s*e.b+a*e.d,r&&(i.scaleX=e.scaleX*r.scaleX,i.scaleY=e.scaleY*r.scaleY)}else i.a=e.a,i.b=e.b,i.c=e.c,i.d=e.d,r&&(i.scaleX=e.scaleX,i.scaleY=e.scaleY);i.e=o*e.a+s*e.c+e.e,i.f=o*e.b+s*e.d+e.f},divide(t,e){Zs.multiply(t,Zs.tempInvert(e))},divideParent(t,e){Zs.multiplyParent(t,Zs.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=Zs;return Zs.copy(e,t),Zs.invert(e),e},invert(t){const{a:e,b:i,c:n,d:r,e:o,f:s}=t;if(i||n){const a=1/(e*r-i*n);t.a=r*a,t.b=-i*a,t.c=-n*a,t.d=e*a,t.e=-(o*r-s*n)*a,t.f=-(s*e-o*i)*a}else if(1===e&&1===r)t.e=-o,t.f=-s;else{const i=1/(e*r);t.a=r*i,t.d=e*i,t.e=-o*r*i,t.f=-s*e*i}},toOuterPoint(t,e,i,n){const{x:r,y:o}=e;i||(i=e),i.x=r*t.a+o*t.c,i.y=r*t.b+o*t.d,n||(i.x+=t.e,i.y+=t.f)},toInnerPoint(t,e,i,n){const{a:r,b:o,c:s,d:a}=t,l=1/(r*a-o*s),{x:h,y:c}=e;if(i||(i=e),i.x=(h*a-c*s)*l,i.y=(c*r-h*o)*l,!n){const{e:e,f:n}=t;i.x-=(e*a-n*s)*l,i.y-=(n*r-e*o)*l}},setLayout(t,e,i,n,r){const{x:o,y:s,scaleX:a,scaleY:l}=e;if(ss(r)&&(r=e.rotation||e.skewX||e.skewY),r){const{rotation:i,skewX:n,skewY:r}=e,o=i*Is,s=js(o),h=Ns(o);if(n||r){const e=n*Is,i=r*Is;t.a=(s+i*-h)*a,t.b=(h+i*s)*a,t.c=(e*s-h)*l,t.d=(s+e*h)*l}else t.a=s*a,t.b=h*a,t.c=-h*l,t.d=s*l}else t.a=a,t.b=0,t.c=0,t.d=l;t.e=o,t.f=s,(i=i||n)&&Zs.translateInner(t,-i.x,-i.y,!n)},getLayout(t,e,i,n){const{a:r,b:o,c:s,d:a,e:l,f:h}=t;let c,d,u,p,f,g=l,_=h;if(o||s){const t=r*a-o*s;if(s&&!n){c=Hs(r*r+o*o),d=t/c;const e=r/c;u=o>0?Vs(e):-Vs(e)}else{d=Hs(s*s+a*a),c=t/d;const e=s/d;u=Ws-(a>0?Vs(-e):-Vs(e))}const e=Us(js(u)),i=Ns(u);c=Us(c),d=Us(d),p=e?Us((s/d+i)/e/Is,9):0,f=e?Us((o/c-i)/e/Is,9):0,u=Us(u/Is)}else c=r,d=a,u=p=f=0;return(e=i||e)&&(g+=e.x*r+e.y*s,_+=e.x*o+e.y*a,i||(g-=e.x,_-=e.y)),{x:g,y:_,scaleX:c,scaleY:d,rotation:u,skewX:p,skewY:f}},withScale(t,e,i=e){const n=t;if(!e||!i){const{a:n,b:r,c:o,d:s}=t;r||o?i=(n*s-r*o)/(e=Hs(n*n+r*r)):(e=n,i=s)}return n.scaleX=e,n.scaleY=i,n},reset(t){Zs.set(t)}},Zs=$s,{float:qs}=Ms,{toInnerPoint:Js,toOuterPoint:Qs}=$s,{sin:ta,cos:ea,abs:ia,sqrt:na,atan2:ra,min:oa,round:sa}=Math,aa={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(t,e=0,i=0){t.x=e,t.y=i},setRadius(t,e,i){t.radiusX=e,t.radiusY=ss(i)?e:i},copy(t,e){t.x=e.x,t.y=e.y},copyFrom(t,e,i){t.x=e,t.y=i},round(t,e){t.x=e?sa(t.x-.5)+.5:sa(t.x),t.y=e?sa(t.y-.5)+.5:sa(t.y)},move(t,e,i){us(e)?(t.x+=e.x,t.y+=e.y):(t.x+=e,t.y+=i)},scale(t,e,i=e){t.x&&(t.x*=e),t.y&&(t.y*=i)},scaleOf(t,e,i,n=i){t.x+=(t.x-e.x)*(i-1),t.y+=(t.y-e.y)*(n-1)},rotate(t,e,i){i||(i=la.defaultPoint);const n=ea(e*=Is),r=ta(e),o=t.x-i.x,s=t.y-i.y;t.x=i.x+o*n-s*r,t.y=i.y+o*r+s*n},tempToInnerOf(t,e){const{tempPoint:i}=la;return ca(i,t),Js(e,i,i),i},tempToOuterOf(t,e){const{tempPoint:i}=la;return ca(i,t),Qs(e,i,i),i},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:i}=la;return ca(i,t),la.toInnerRadiusPointOf(t,e,i),i},copyRadiusPoint:(t,e,i,n)=>(ca(t,e),da(t,i,n),t),toInnerRadiusPointOf(t,e,i){i||(i=t),Js(e,t,i),i.radiusX=Math.abs(t.radiusX/e.scaleX),i.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,i){Js(e,t,i)},toOuterOf(t,e,i){Qs(e,t,i)},getCenter:(t,e)=>({x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}),getCenterX:(t,e)=>t+(e-t)/2,getCenterY:(t,e)=>t+(e-t)/2,getDistance:(t,e)=>ha(t.x,t.y,e.x,e.y),getDistanceFrom(t,e,i,n){const r=ia(i-t),o=ia(n-e);return na(r*r+o*o)},getMinDistanceFrom:(t,e,i,n,r,o)=>oa(ha(t,e,i,n),ha(i,n,r,o)),getAngle:(t,e)=>ua(t,e)/Is,getRotation:(t,e,i,n)=>(n||(n=e),la.getRadianFrom(t.x,t.y,e.x,e.y,i.x,i.y,n.x,n.y)/Is),getRadianFrom(t,e,i,n,r,o,s,a){ss(s)&&(s=i,a=n);const l=t-i,h=e-n,c=r-s,d=o-a;return Math.atan2(l*d-h*c,l*c+h*d)},getAtan2:(t,e)=>ra(e.y-t.y,e.x-t.x),getDistancePoint(t,e,i,n,r){const o=ua(t,e);return r&&(t=e),n||(e={}),e.x=t.x+ea(o)*i,e.y=t.y+ta(o)*i,e},toNumberPoints(t){let e=t;return us(t[0])&&(e=[],t.forEach(t=>e.push(t.x,t.y))),e},isSame:(t,e,i)=>i?t.x===e.x&&t.y===e.y:qs(t.x)===qs(e.x)&&qs(t.y)===qs(e.y),reset(t){la.reset(t)}},la=aa,{getDistanceFrom:ha,copy:ca,setRadius:da,getAtan2:ua}=la,pa=class t{constructor(t,e){this.set(t,e)}set(t,e){return us(t)?aa.copy(this,t):aa.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new t(this)}move(t,e){return aa.move(this,t,e),this}scale(t,e){return aa.scale(this,t,e),this}scaleOf(t,e,i){return aa.scaleOf(this,t,e,i),this}rotate(t,e){return aa.rotate(this,t,e),this}rotateOf(t,e){return aa.rotate(this,e,t),this}getRotation(t,e,i){return aa.getRotation(this,t,e,i)}toInnerOf(t,e){return aa.toInnerOf(this,t,e),this}toOuterOf(t,e){return aa.toOuterOf(this,t,e),this}getCenter(e){return new t(aa.getCenter(this,e))}getDistance(t){return aa.getDistance(this,t)}getDistancePoint(e,i,n,r){return new t(aa.getDistancePoint(this,e,i,n,r))}getAngle(t){return aa.getAngle(this,t)}getAtan2(t){return aa.getAtan2(this,t)}isSame(t,e){return aa.isSame(this,t,e)}reset(){return aa.reset(this),this}},fa=(new pa,class t{constructor(t,e,i,n,r,o){this.set(t,e,i,n,r,o)}set(t,e,i,n,r,o){return us(t)?$s.copy(this,t):$s.set(this,t,e,i,n,r,o),this}setWith(t){return $s.copy(this,t),this.scaleX=t.scaleX,this.scaleY=t.scaleY,this}get(){const{a:t,b:e,c:i,d:n,e:r,f:o}=this;return{a:t,b:e,c:i,d:n,e:r,f:o}}clone(){return new t(this)}translate(t,e){return $s.translate(this,t,e),this}translateInner(t,e){return $s.translateInner(this,t,e),this}scale(t,e){return $s.scale(this,t,e),this}scaleWith(t,e){return $s.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}pixelScale(t){return $s.pixelScale(this,t),this}scaleOfOuter(t,e,i){return $s.scaleOfOuter(this,t,e,i),this}scaleOfInner(t,e,i){return $s.scaleOfInner(this,t,e,i),this}rotate(t){return $s.rotate(this,t),this}rotateOfOuter(t,e){return $s.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return $s.rotateOfInner(this,t,e),this}skew(t,e){return $s.skew(this,t,e),this}skewOfOuter(t,e,i){return $s.skewOfOuter(this,t,e,i),this}skewOfInner(t,e,i){return $s.skewOfInner(this,t,e,i),this}multiply(t){return $s.multiply(this,t),this}multiplyParent(t){return $s.multiplyParent(this,t),this}divide(t){return $s.divide(this,t),this}divideParent(t){return $s.divideParent(this,t),this}invert(){return $s.invert(this),this}invertWith(){return $s.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,i){$s.toOuterPoint(this,t,e,i)}toInnerPoint(t,e,i){$s.toInnerPoint(this,t,e,i)}setLayout(t,e,i){return $s.setLayout(this,t,e,i),this}getLayout(t,e,i){return $s.getLayout(this,t,e,i)}withScale(t,e){return $s.withScale(this,t,e)}reset(){$s.reset(this)}}),ga=(new fa,{tempPointBounds:{},setPoint(t,e,i){t.minX=t.maxX=e,t.minY=t.maxY=i},addPoint(t,e,i){t.minX=e<t.minX?e:t.minX,t.minY=i<t.minY?i:t.minY,t.maxX=e>t.maxX?e:t.maxX,t.maxY=i>t.maxY?i:t.maxY},addBounds(t,e,i,n,r){_a(t,e,i),_a(t,e+n,i+r)},copy(t,e){t.minX=e.minX,t.minY=e.minY,t.maxX=e.maxX,t.maxY=e.maxY},addPointBounds(t,e){t.minX=e.minX<t.minX?e.minX:t.minX,t.minY=e.minY<t.minY?e.minY:t.minY,t.maxX=e.maxX>t.maxX?e.maxX:t.maxX,t.maxY=e.maxY>t.maxY?e.maxY:t.maxY},toBounds(t,e){e.x=t.minX,e.y=t.minY,e.width=t.maxX-t.minX,e.height=t.maxY-t.minY}}),{addPoint:_a}=ga;(function(t){t[t.top=0]="top",t[t.right=1]="right",t[t.bottom=2]="bottom",t[t.left=3]="left"})(Gs||(Gs={})),function(t){t[t.topLeft=0]="topLeft",t[t.top=1]="top",t[t.topRight=2]="topRight",t[t.right=3]="right",t[t.bottomRight=4]="bottomRight",t[t.bottom=5]="bottom",t[t.bottomLeft=6]="bottomLeft",t[t.left=7]="left",t[t.center=8]="center",t[t["top-left"]=0]="top-left",t[t["top-right"]=2]="top-right",t[t["bottom-right"]=4]="bottom-right",t[t["bottom-left"]=6]="bottom-left"}(Ks||(Ks={}));var va=[{x:0,y:0},{x:.5,y:0},{x:1,y:0},{x:1,y:.5},{x:1,y:1},{x:.5,y:1},{x:0,y:1},{x:0,y:.5},{x:.5,y:.5}];va.forEach(t=>t.type="percent");var ma={directionData:va,tempPoint:{},get:ya,toPoint(t,e,i,n,r,o){const s=ya(t);i.x=s.x,i.y=s.y,"percent"===s.type&&(i.x*=e.width,i.y*=e.height,r&&(o||(i.x-=r.x,i.y-=r.y),s.x&&(i.x-=1===s.x?r.width:.5===s.x?s.x*r.width:0),s.y&&(i.y-=1===s.y?r.height:.5===s.y?s.y*r.height:0))),n||(i.x+=e.x,i.y+=e.y)},getPoint:(t,e,i,n=!0)=>(i||(i={}),ma.toPoint(t,e,i,n),i)};function ya(t){return ls(t)?va[Ks[t]]:t}var xa,wa,ba,Sa,{toPoint:ka}=ma,Ea={toPoint(t,e,i,n,r,o){ka(t,i,n,r,e,o)}},{tempPointBounds:Ca,setPoint:Oa,addPoint:La,toBounds:Pa}=ga,{toOuterPoint:Ta}=$s,{float:Ba,fourNumber:Ra}=Ms,{floor:Aa,ceil:Ma}=Math,Da={},Ia={},Fa={},Wa={tempBounds:Fa,set(t,e=0,i=0,n=0,r=0){t.x=e,t.y=i,t.width=n,t.height=r},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,i,n,r){const{x:o,y:s,width:a,height:l}=e;if(ds(i)){const e=Ra(i);n?za.set(t,o+e[3],s+e[0],a-e[1]-e[3],l-e[2]-e[0]):za.set(t,o-e[3],s-e[0],a+e[1]+e[3],l+e[2]+e[0])}else n&&(i=-i),za.set(t,o-i,s-i,a+2*i,l+2*i);r&&("width"===r?(t.y=s,t.height=l):(t.x=o,t.width=a))},minX:t=>t.width>0?t.x:t.x+t.width,minY:t=>t.height>0?t.y:t.y+t.height,maxX:t=>t.width>0?t.x+t.width:t.x,maxY:t=>t.height>0?t.y+t.height:t.y,move(t,e,i){t.x+=e,t.y+=i},scroll(t,e){t.x+=e.scrollX,t.y+=e.scrollY},getByMove:(t,e,i)=>(t=Object.assign({},t),za.move(t,e,i),t),toOffsetOutBounds(t,e,i){e?ja(e,t):e=t,i||(i=t),e.offsetX=za.maxX(i),e.offsetY=za.maxY(i),za.move(e,-e.offsetX,-e.offsetY)},scale(t,e,i=e,n){n||aa.scale(t,e,i),t.width*=e,t.height*=i},scaleOf(t,e,i,n=i){aa.scaleOf(t,e,i,n),t.width*=i,t.height*=n},tempToOuterOf:(t,e)=>(za.copy(Fa,t),za.toOuterOf(Fa,e),Fa),getOuterOf:(t,e)=>(t=Object.assign({},t),za.toOuterOf(t,e),t),toOuterOf(t,e,i){if(i||(i=t),0===e.b&&0===e.c){const{a:n,d:r,e:o,f:s}=e;n>0?(i.width=t.width*n,i.x=o+t.x*n):(i.width=t.width*-n,i.x=o+t.x*n-i.width),r>0?(i.height=t.height*r,i.y=s+t.y*r):(i.height=t.height*-r,i.y=s+t.y*r-i.height)}else Da.x=t.x,Da.y=t.y,Ta(e,Da,Ia),Oa(Ca,Ia.x,Ia.y),Da.x=t.x+t.width,Ta(e,Da,Ia),La(Ca,Ia.x,Ia.y),Da.y=t.y+t.height,Ta(e,Da,Ia),La(Ca,Ia.x,Ia.y),Da.x=t.x,Ta(e,Da,Ia),La(Ca,Ia.x,Ia.y),Pa(Ca,i)},toInnerOf(t,e,i){i||(i=t),za.move(i,-e.e,-e.f),za.scale(i,1/e.a,1/e.d)},getFitMatrix(t,e,i=1){const n=Math.min(i,za.getFitScale(t,e));return new fa(n,0,0,n,-e.x*n,-e.y*n)},getFitScale(t,e,i){const n=t.width/e.width,r=t.height/e.height;return i?Math.max(n,r):Math.min(n,r)},put(t,e,i="center",n=1,r=!0,o){o||(o=e),ls(n)&&(n=za.getFitScale(t,e,"cover"===n)),Fa.width=r?e.width*=n:e.width*n,Fa.height=r?e.height*=n:e.height*n,Ea.toPoint(i,Fa,t,o,!0,!0)},getSpread(t,e,i){const n={};return za.copyAndSpread(n,t,e,!1,i),n},spread(t,e,i){za.copyAndSpread(t,t,e,!1,i)},shrink(t,e,i){za.copyAndSpread(t,t,e,!0,i)},ceil(t){const{x:e,y:i}=t;t.x=Aa(t.x),t.y=Aa(t.y),t.width=e>t.x?Ma(t.width+e-t.x):Ma(t.width),t.height=i>t.y?Ma(t.height+i-t.y):Ma(t.height)},unsign(t){t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height)},float(t,e){t.x=Ba(t.x,e),t.y=Ba(t.y,e),t.width=Ba(t.width,e),t.height=Ba(t.height,e)},add(t,e,i){xa=t.x+t.width,wa=t.y+t.height,ba=e.x,Sa=e.y,i||(ba+=e.width,Sa+=e.height),xa=xa>ba?xa:ba,wa=wa>Sa?wa:Sa,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=xa-t.x,t.height=wa-t.y},addList(t,e){za.setListWithFn(t,e,void 0,!0)},setList(t,e,i=!1){za.setListWithFn(t,e,void 0,i)},addListWithFn(t,e,i){za.setListWithFn(t,e,i,!0)},setListWithFn(t,e,i,n=!1){let r,o=!0;for(let s=0,a=e.length;s<a;s++)r=i?i(e[s],s):e[s],r&&(r.width||r.height)&&(o?(o=!1,n||ja(t,r)):Na(t,r));o&&za.reset(t)},setPoints(t,e){e.forEach((t,e)=>0===e?Oa(Ca,t.x,t.y):La(Ca,t.x,t.y)),Pa(Ca,t)},setPoint(t,e){za.set(t,e.x,e.y)},addPoint(t,e){Na(t,e,!0)},getPoints(t){const{x:e,y:i,width:n,height:r}=t;return[{x:e,y:i},{x:e+n,y:i},{x:e+n,y:i+r},{x:e,y:i+r}]},getPoint:(t,e,i=!1,n)=>ma.getPoint(e,t,n,i),hitRadiusPoint:(t,e,i)=>(i&&(e=aa.tempToInnerRadiusPointOf(e,i)),e.x>=t.x-e.radiusX&&e.x<=t.x+t.width+e.radiusX&&e.y>=t.y-e.radiusY&&e.y<=t.y+t.height+e.radiusY),hitPoint:(t,e,i)=>(i&&(e=aa.tempToInnerOf(e,i)),e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height),hit:(t,e,i)=>(i&&(e=za.tempToOuterOf(e,i)),!(t.y+t.height<e.y||e.y+e.height<t.y||t.x+t.width<e.x||e.x+e.width<t.x)),includes:(t,e,i)=>(i&&(e=za.tempToOuterOf(e,i)),t.x<=e.x&&t.y<=e.y&&t.x+t.width>=e.x+e.width&&t.y+t.height>=e.y+e.height),getIntersectData(t,e,i){if(i&&(e=za.tempToOuterOf(e,i)),!za.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:n,y:r,width:o,height:s}=e;return xa=n+o,wa=r+s,ba=t.x+t.width,Sa=t.y+t.height,n=n>t.x?n:t.x,r=r>t.y?r:t.y,o=(xa=xa<ba?xa:ba)-n,s=(wa=wa<Sa?wa:Sa)-r,{x:n,y:r,width:o,height:s}},intersect(t,e,i){za.copy(t,za.getIntersectData(t,e,i))},isSame:(t,e)=>t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height,isEmpty:t=>0===t.x&&0===t.y&&0===t.width&&0===t.height,hasSize:t=>t.width&&t.height,reset(t){za.set(t)}},za=Wa,{add:Na,copy:ja}=za,Va=class t{get minX(){return Wa.minX(this)}get minY(){return Wa.minY(this)}get maxX(){return Wa.maxX(this)}get maxY(){return Wa.maxY(this)}constructor(t,e,i,n){this.set(t,e,i,n)}set(t,e,i,n){return us(t)?Wa.copy(this,t):Wa.set(this,t,e,i,n),this}get(){const{x:t,y:e,width:i,height:n}=this;return{x:t,y:e,width:i,height:n}}clone(){return new t(this)}move(t,e){return Wa.move(this,t,e),this}scale(t,e,i){return Wa.scale(this,t,e,i),this}scaleOf(t,e,i){return Wa.scaleOf(this,t,e,i),this}toOuterOf(t,e){return Wa.toOuterOf(this,t,e),this}toInnerOf(t,e){return Wa.toInnerOf(this,t,e),this}getFitMatrix(t,e){return Wa.getFitMatrix(this,t,e)}put(t,e,i){Wa.put(this,t,e,i)}spread(t,e){return Wa.spread(this,t,e),this}shrink(t,e){return Wa.shrink(this,t,e),this}ceil(){return Wa.ceil(this),this}unsign(){return Wa.unsign(this),this}float(t){return Wa.float(this,t),this}add(t){return Wa.add(this,t),this}addList(t){return Wa.setList(this,t,!0),this}setList(t){return Wa.setList(this,t),this}addListWithFn(t,e){return Wa.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return Wa.setListWithFn(this,t,e),this}setPoint(t){return Wa.setPoint(this,t),this}setPoints(t){return Wa.setPoints(this,t),this}addPoint(t){return Wa.addPoint(this,t),this}getPoints(){return Wa.getPoints(this)}getPoint(t,e,i){return Wa.getPoint(this,t,e,i)}hitPoint(t,e){return Wa.hitPoint(this,t,e)}hitRadiusPoint(t,e){return Wa.hitRadiusPoint(this,t,e)}hit(t,e){return Wa.hit(this,t,e)}includes(t,e){return Wa.includes(this,t,e)}intersect(t,e){return Wa.intersect(this,t,e),this}getIntersect(e,i){return new t(Wa.getIntersectData(this,e,i))}isSame(t){return Wa.isSame(this,t)}isEmpty(){return Wa.isEmpty(this)}reset(){Wa.reset(this)}},Ha=new Va,Ua=class{constructor(t,e,i,n,r,o){us(t)?this.copy(t):this.set(t,e,i,n,r,o)}set(t=0,e=0,i=0,n=0,r=0,o=0){this.top=t,this.right=e,this.bottom=i,this.left=n,this.width=r,this.height=o}copy(t){const{top:e,right:i,bottom:n,left:r,width:o,height:s}=t;this.set(e,i,n,r,o,s)}getBoundsFrom(t){const{top:e,right:i,bottom:n,left:r,width:o,height:s}=this;return new Va(r,e,o||t.width-r-i,s||t.height-e-n)}},Ya={number:(t,e)=>us(t)?"percent"===t.type?t.value*e:t.value:t},Xa={0:1,1:1,2:1,3:1,4:1,5:1,6:1,7:1,8:1,9:1,".":1,e:1,E:1},{floor:Ga,max:Ka}=Math,$a={toURL(t,e){let i=encodeURIComponent(t);return"text"===e?i="data:text/plain;charset=utf-8,"+i:"svg"===e&&(i="data:image/svg+xml,"+i),i},image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,crossOrigin:"anonymous",isLarge:(t,e,i,n)=>t.width*t.height*(e?e*i:1)>(n||Za.maxCacheSize),isSuperLarge:(t,e,i)=>Za.isLarge(t,e,i,Za.maxPatternSize),getRealURL(t){const{prefix:e,suffix:i}=Za;return!i||t.startsWith("data:")||t.startsWith("blob:")||(t+=(t.includes("?")?"&":"?")+i),e&&"/"===t[0]&&(t=e+t),t},resize(t,e,i,n,r,o,s,a,l,h){const c=Ka(Ga(e+(n||0)),1),d=Ka(Ga(i+(r||0)),1);let u,p,f;h&&(f=Ya.number(h.offset,"x"===h.type?e:i))&&("x"===h.type?u=!0:p=!0);const g=$a.origin.createCanvas(p?2*c:c,u?2*d:d),_=g.getContext("2d");if(a&&(_.globalAlpha=a),_.imageSmoothingEnabled=!1!==s,Za.canUse(t)){if(o){const n=e/o.width,r=i/o.height;_.setTransform(n,0,0,r,-o.x*n,-o.y*r),_.drawImage(t,0,0,t.width,t.height)}else _.drawImage(t,0,0,e,i);f&&(_.drawImage(g,0,0,c,d,u?f-c:c,u?d:f-d,c,d),_.drawImage(g,0,0,c,d,u?f:c,u?d:f,c,d))}return g},canUse:t=>t&&t.width&&!t.__closed,setPatternTransform(t,e,i){try{e&&t.setTransform&&(t.setTransform(e),e=void 0)}catch(t){}i&&_s.stintSet(i,"transform",e)}}},{image:Za}=$a,{randColor:qa}=Ms,Ja=class t{constructor(t){this.repeatMap={},this.name=t}static get(e){return new t(e)}static set filter(t){this.filterList=Qa(t)}static set exclude(t){this.excludeList=Qa(t)}static drawRepaint(t,e){const i=qa();t.fillWorld(e,i.replace("1)",".1)")),t.strokeWorld(e,i)}static drawBounds(e,i,n){const r="hit"===t.showBounds,o=e.__nowWorld,s=qa();r&&(i.setWorld(o),e.__drawHitPath(i),i.fillStyle=s.replace("1)",".2)"),i.fill()),i.resetTransform(),i.setStroke(s,2),r?i.stroke():i.strokeWorld(o,s)}log(...t){if(tl.enable){if(tl.filterList.length&&tl.filterList.every(t=>t!==this.name))return;if(tl.excludeList.length&&tl.excludeList.some(t=>t===this.name))return}}tip(...t){tl.enable&&this.warn(...t)}warn(...t){tl.showWarn}repeat(t,...e){this.repeatMap[t]||(this.warn("repeat:"+t,...e),this.repeatMap[t]=!0)}error(...t){try{throw new Error}catch(bS){}}};function Qa(t){return t?ls(t)&&(t=[t]):t=[],t}Ja.filterList=[],Ja.excludeList=[],Ja.showWarn=!0;var tl=Ja,el=Ja.get("RunTime"),il={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const i=ys.create(ys.RUNTIME);return nl.currentId=nl.idMap[i]=e?performance.now():Date.now(),nl.currentName=nl.nameMap[i]=t,nl.nameToIdMap[t]=i,i},end(t,e){const i=nl.idMap[t],n=nl.nameMap[t],r=e?(performance.now()-i)/1e3:Date.now()-i;nl.idMap[t]=nl.nameMap[t]=nl.nameToIdMap[n]=void 0,el.log(n,r,"ms")},endOfName(t,e){const i=nl.nameToIdMap[t];ss(i)||nl.end(i,e)}},nl=il,rl=[],ol={list:{},add(t,...e){this.list[t]=!0,rl.push(...e)},has(t,e){const i=this.list[t];return!i&&e&&this.need(t),i},need(t){}};setTimeout(()=>rl.forEach(t=>ol.has(t,!0)));var sl={editor:t=>ol.need("editor")},al=Ja.get("UICreator"),ll={list:{},register(t){const{__tag:e}=t.prototype;hl[e]&&al.repeat(e),hl[e]=t},get(t,e,i,n,r,o){if(!hl[t])return void al.warn("not register "+t);const s=new hl[t](e);return ss(i)||(s.x=i,n&&(s.y=n),r&&(s.width=r),o&&(s.height=o)),s}},{list:hl}=ll,cl=Ja.get("EventCreator"),dl={nameList:{},register(t){let e;Object.keys(t).forEach(i=>{e=t[i],ls(e)&&(ul[e]&&cl.repeat(e),ul[e]=t)})},changeName(t,e){const i=ul[t];if(i){const n=Object.keys(i).find(e=>i[e]===t);n&&(i[n]=e,ul[e]=i)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new ul[t](...e)},{nameList:ul}=dl,pl=class{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let e;const{list:i}=this;for(let r=0,o=i.length;r<o;r++)if(e=i[r],e.recycled&&e.isSameSize(t))return e.recycled=!1,e.manager||(e.manager=this),e;const n=sl.canvas(t);return this.add(n),n}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let i=0,n=this.list.length;i<n;i++)t=this.list[i],t.recycled?t.destroy():e.push(t);this.list=e}clear(){this.list.forEach(t=>{t.destroy()}),this.list.length=0}destroy(){this.clear()}};function fl(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s}function gl(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(s,a)}l((n=n.apply(t,e||[])).next())})}function _l(t){return(e,i)=>{t||(t=i);const n={get(){return this.context[t]},set(e){this.context[t]=e}};"strokeCap"===i&&(n.set=function(e){this.context[t]="none"===e?"butt":e}),Object.defineProperty(e,i,n)}}var vl=[];function ml(){return(t,e)=>{vl.push(e)}}var yl=[],xl=class{set blendMode(t){"normal"===t&&(t="source-over"),this.context.globalCompositeOperation=t}get blendMode(){return this.context.globalCompositeOperation}set dashPattern(t){this.context.setLineDash(t||yl)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;vl.forEach(e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))}),this.textBaseline="alphabetic"}setTransform(t,e,i,n,r,o){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,i,n,r,o){us(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,i,n,r,o)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,i,n){}strokeRect(t,e,i,n){}clearRect(t,e,i,n){}drawImage(t,e,i,n,r,o,s,a,l){switch(arguments.length){case 9:if(e<0){const t=-e/n*a;n+=e,e=0,o+=t,a-=t}if(i<0){const t=-i/r*l;r+=i,i=0,s+=t,l-=t}this.context.drawImage(t,e,i,n,r,o,s,a,l);break;case 5:this.context.drawImage(t,e,i,n,r);break;case 3:this.context.drawImage(t,e,i)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,i,n,r,o){}quadraticCurveTo(t,e,i,n){}closePath(){}arc(t,e,i,n,r,o){}arcTo(t,e,i,n,r){}ellipse(t,e,i,n,r,o,s,a){}rect(t,e,i,n){}roundRect(t,e,i,n,r){}createConicGradient(t,e,i){}createLinearGradient(t,e,i,n){}createPattern(t,e){}createRadialGradient(t,e,i,n,r,o){}fillText(t,e,i,n){}measureText(t){}strokeText(t,e,i,n){}destroy(){this.context=null}};fl([_l("imageSmoothingEnabled")],xl.prototype,"smooth",void 0),fl([_l("imageSmoothingQuality")],xl.prototype,"smoothLevel",void 0),fl([_l("globalAlpha")],xl.prototype,"opacity",void 0),fl([_l()],xl.prototype,"fillStyle",void 0),fl([_l()],xl.prototype,"strokeStyle",void 0),fl([_l("lineWidth")],xl.prototype,"strokeWidth",void 0),fl([_l("lineCap")],xl.prototype,"strokeCap",void 0),fl([_l("lineJoin")],xl.prototype,"strokeJoin",void 0),fl([_l("lineDashOffset")],xl.prototype,"dashOffset",void 0),fl([_l()],xl.prototype,"miterLimit",void 0),fl([_l()],xl.prototype,"shadowBlur",void 0),fl([_l()],xl.prototype,"shadowColor",void 0),fl([_l()],xl.prototype,"shadowOffsetX",void 0),fl([_l()],xl.prototype,"shadowOffsetY",void 0),fl([_l()],xl.prototype,"filter",void 0),fl([_l()],xl.prototype,"font",void 0),fl([_l()],xl.prototype,"fontKerning",void 0),fl([_l()],xl.prototype,"fontStretch",void 0),fl([_l()],xl.prototype,"fontVariantCaps",void 0),fl([_l()],xl.prototype,"textAlign",void 0),fl([_l()],xl.prototype,"textBaseline",void 0),fl([_l()],xl.prototype,"textRendering",void 0),fl([_l()],xl.prototype,"wordSpacing",void 0),fl([_l()],xl.prototype,"letterSpacing",void 0),fl([_l()],xl.prototype,"direction",void 0),fl([ml()],xl.prototype,"setTransform",null),fl([ml()],xl.prototype,"resetTransform",null),fl([ml()],xl.prototype,"getTransform",null),fl([ml()],xl.prototype,"save",null),fl([ml()],xl.prototype,"restore",null),fl([ml()],xl.prototype,"translate",null),fl([ml()],xl.prototype,"scale",null),fl([ml()],xl.prototype,"rotate",null),fl([ml()],xl.prototype,"fill",null),fl([ml()],xl.prototype,"stroke",null),fl([ml()],xl.prototype,"clip",null),fl([ml()],xl.prototype,"fillRect",null),fl([ml()],xl.prototype,"strokeRect",null),fl([ml()],xl.prototype,"clearRect",null),fl([ml()],xl.prototype,"beginPath",null),fl([ml()],xl.prototype,"moveTo",null),fl([ml()],xl.prototype,"lineTo",null),fl([ml()],xl.prototype,"bezierCurveTo",null),fl([ml()],xl.prototype,"quadraticCurveTo",null),fl([ml()],xl.prototype,"closePath",null),fl([ml()],xl.prototype,"arc",null),fl([ml()],xl.prototype,"arcTo",null),fl([ml()],xl.prototype,"ellipse",null),fl([ml()],xl.prototype,"rect",null),fl([ml()],xl.prototype,"roundRect",null),fl([ml()],xl.prototype,"createConicGradient",null),fl([ml()],xl.prototype,"createLinearGradient",null),fl([ml()],xl.prototype,"createPattern",null),fl([ml()],xl.prototype,"createRadialGradient",null),fl([ml()],xl.prototype,"fillText",null),fl([ml()],xl.prototype,"measureText",null),fl([ml()],xl.prototype,"strokeText",null);var{copy:wl,multiplyParent:bl,pixelScale:Sl}=$s,{round:kl}=Math,El=new Va,Cl=new Va,Ol={width:1,height:1,pixelRatio:1},Ll=["width","height","pixelRatio"],Pl=class extends xl{get width(){return this.size.width}get height(){return this.size.height}get pixelRatio(){return this.size.pixelRatio}get pixelWidth(){return this.width*this.pixelRatio||0}get pixelHeight(){return this.height*this.pixelRatio||0}get pixelSnap(){return this.config.pixelSnap}set pixelSnap(t){this.config.pixelSnap=t}get allowBackgroundColor(){return this.view&&this.parentView}constructor(t,e){super(),this.size={},this.worldTransform={},t||(t=Ol),this.manager=e,this.innerId=ys.create(ys.CNAVAS);const{width:i,height:n,pixelRatio:r}=t;this.autoLayout=!i||!n,this.size.pixelRatio=r||$a.devicePixelRatio,this.config=t,this.init()}init(){}__createContext(){const{view:t}=this,{contextSettings:e}=this.config;this.context=e?t.getContext("2d",e):t.getContext("2d"),this.__bindContext()}export(t,e){}toBlob(t,e){}toDataURL(t,e){}saveAs(t,e){}resize(t,e=!0){if(this.isSameSize(t))return;let i;this.context&&!this.unreal&&e&&this.width&&(i=this.getSameCanvas(),i.copyWorld(this));const n=this.size;_s.copyAttrs(n,t,Ll),Ll.forEach(t=>n[t]||(n[t]=1)),this.bounds=new Va(0,0,this.width,this.height),this.updateViewSize(),this.updateClientBounds(),this.context&&(this.smooth=this.config.smooth,!this.unreal&&i&&(this.clearWorld(i.bounds),this.copyWorld(i),i.recycle()))}updateViewSize(){}updateClientBounds(){}getClientBounds(t){return t&&this.updateClientBounds(),this.clientBounds||this.bounds}startAutoLayout(t,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:i,pixelSnap:n}=this,r=this.worldTransform;e&&bl(t,e,r),Sl(t,i,r),n&&!t.ignorePixelSnap&&(t.half&&t.half*i%2?(r.e=kl(r.e-.5)+.5,r.f=kl(r.f-.5)+.5):(r.e=kl(r.e),r.f=kl(r.f))),this.setTransform(r.a,r.b,r.c,r.d,r.e,r.f)}useWorldTransform(t){t&&(this.worldTransform=t);const e=this.worldTransform;e&&this.setTransform(e.a,e.b,e.c,e.d,e.e,e.f)}setStroke(t,e,i,n){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),i&&this.setStrokeOptions(i,n)}setStrokeOptions(t,e){let{strokeCap:i,strokeJoin:n,dashPattern:r,dashOffset:o,miterLimit:s}=t;e&&(e.strokeCap&&(i=e.strokeCap),e.strokeJoin&&(n=e.strokeJoin),ss(e.dashPattern)||(r=e.dashPattern),ss(e.dashOffset)||(o=e.dashOffset),e.miterLimit&&(s=e.miterLimit)),this.strokeCap=i,this.strokeJoin=n,this.dashPattern=r,this.dashOffset=o,this.miterLimit=s}saveBlendMode(t){this.savedBlendMode=this.blendMode,this.blendMode=t}restoreBlendMode(){this.blendMode=this.savedBlendMode}hitFill(t,e){return!0}hitStroke(t,e){return!0}hitPixel(t,e,i=1){return!0}setWorldShadow(t,e,i,n){const{pixelRatio:r}=this;this.shadowOffsetX=t*r,this.shadowOffsetY=e*r,this.shadowBlur=i*r,this.shadowColor=n||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,i,n,r){n&&(this.blendMode=n),e?(this.setTempPixelBounds(e,r),i?(this.setTempPixelBounds2(i,r),i=Cl):i=El,this.drawImage(t.view,El.x,El.y,El.width,El.height,i.x,i.y,i.width,i.height)):this.drawImage(t.view,0,0),n&&(this.blendMode="source-over")}copyWorldToInner(t,e,i,n,r){e.b||e.c?(this.save(),this.resetTransform(),this.copyWorld(t,e,Wa.tempToOuterOf(i,e),n,r),this.restore()):(n&&(this.blendMode=n),this.setTempPixelBounds(e,r),this.drawImage(t.view,El.x,El.y,El.width,El.height,i.x,i.y,i.width,i.height),n&&(this.blendMode="source-over"))}copyWorldByReset(t,e,i,n,r,o){this.resetTransform(),this.copyWorld(t,e,i,n,o),r||this.useWorldTransform()}useGrayscaleAlpha(t){let e,i;this.setTempPixelBounds(t,!0,!0);const{context:n}=this,r=n.getImageData(El.x,El.y,El.width,El.height),{data:o}=r;for(let s=0,a=o.length;s<a;s+=4)i=.299*o[s]+.587*o[s+1]+.114*o[s+2],(e=o[s+3])&&(o[s+3]=255===e?i:e*(i/255));n.putImageData(r,El.x,El.y)}useMask(t,e,i){this.copyWorld(t,e,i,"destination-in")}useEraser(t,e,i){this.copyWorld(t,e,i,"destination-out")}fillWorld(t,e,i,n){i&&(this.blendMode=i),this.fillStyle=e,this.setTempPixelBounds(t,n),this.fillRect(El.x,El.y,El.width,El.height),i&&(this.blendMode="source-over")}strokeWorld(t,e,i,n){i&&(this.blendMode=i),this.strokeStyle=e,this.setTempPixelBounds(t,n),this.strokeRect(El.x,El.y,El.width,El.height),i&&(this.blendMode="source-over")}clipWorld(t,e=!0){this.beginPath(),this.setTempPixelBounds(t,e),this.rect(El.x,El.y,El.width,El.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e=!0){this.setTempPixelBounds(t,e),this.clearRect(El.x,El.y,El.width,El.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempPixelBounds(t,e,i){this.copyToPixelBounds(El,t,e,i)}setTempPixelBounds2(t,e,i){this.copyToPixelBounds(Cl,t,e,i)}copyToPixelBounds(t,e,i,n){t.set(e),n&&t.intersect(this.bounds),t.scale(this.pixelRatio),i&&t.ceil()}isSameSize(t){return this.width===t.width&&this.height===t.height&&(!t.pixelRatio||this.pixelRatio===t.pixelRatio)}getSameCanvas(t,e){const{size:i,pixelSnap:n}=this,r=this.manager?this.manager.get(i):sl.canvas(Object.assign({},i));return r.save(),t&&(wl(r.worldTransform,this.worldTransform),r.useWorldTransform()),e&&(r.smooth=this.smooth),r.pixelSnap!==n&&(r.pixelSnap=n),r}recycle(t){this.recycled||(this.restore(),t?this.clearWorld(t):this.clear(),this.manager?this.manager.recycle(this):this.destroy())}updateRender(t){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}},Tl={creator:{},parse(t,e){},convertToCanvasData(t,e){}},Bl={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},Rl=Object.assign({M:1,m:10,L:2,l:20,H:3,h:30,V:4,v:40,C:5,c:50,S:6,s:60,Q:7,q:70,T:8,t:80,A:9,a:90,Z:11,z:11,R:12},Bl),Al={M:3,m:3,L:3,l:3,H:2,h:2,V:2,v:2,C:7,c:7,S:5,s:5,Q:5,q:5,T:3,t:3,A:8,a:8,Z:1,z:1,N:5,D:9,X:6,G:9,F:5,O:7,P:4,U:6},Ml={m:10,l:20,H:3,h:30,V:4,v:40,c:50,S:6,s:60,q:70,T:8,t:80,A:9,a:90},Dl=Object.assign(Object.assign({},Ml),Bl),Il=Rl,Fl={};for(let _O in Il)Fl[Il[_O]]=_O;var Wl={};for(let _O in Il)Wl[Il[_O]]=Al[_O];var zl,Nl,jl,Vl={drawRoundRect(t,e,i,n,r,o){const s=Ms.fourNumber(o,Math.min(n/2,r/2)),a=e+n,l=i+r;s[0]?t.moveTo(e+s[0],i):t.moveTo(e,i),s[1]?t.arcTo(a,i,a,l,s[1]):t.lineTo(a,i),s[2]?t.arcTo(a,l,e,l,s[2]):t.lineTo(a,l),s[3]?t.arcTo(e,l,e,i,s[3]):t.lineTo(e,l),s[0]?t.arcTo(e,i,a,i,s[0]):t.lineTo(e,i)}},{sin:Hl,cos:Ul,hypot:Yl,atan2:Xl,ceil:Gl,abs:Kl,PI:$l,sqrt:Zl,pow:ql}=Math,{setPoint:Jl,addPoint:Ql}=ga,{set:th,toNumberPoints:eh}=aa,{M:ih,L:nh,C:rh,Q:oh,Z:sh}=Rl,ah={},lh={points(t,e,i,n){let r=eh(e);if(t.push(ih,r[0],r[1]),i&&r.length>5){let e,o,s,a,l,h,c,d,u,p,f,g,_,v,m,y=r.length;const x=!0===i?.5:i;n&&(r=[r[y-2],r[y-1],...r,r[0],r[1],r[2],r[3]],y=r.length);for(let i=2;i<y-2;i+=2)e=r[i-2],o=r[i-1],s=r[i],a=r[i+1],l=r[i+2],h=r[i+3],f=s-e,g=a-o,_=Zl(ql(f,2)+ql(g,2)),v=Zl(ql(l-s,2)+ql(h-a,2)),(_||v)&&(m=_+v,_=x*_/m,v=x*v/m,l-=e,h-=o,c=s-_*l,d=a-_*h,2===i?n||t.push(oh,c,d,s,a):(f||g)&&t.push(rh,u,p,c,d,s,a),u=s+v*l,p=a+v*h);n||t.push(oh,u,p,r[y-2],r[y-1])}else for(let o=2,s=r.length;o<s;o+=2)t.push(nh,r[o],r[o+1]);n&&t.push(sh)},rect(t,e,i,n,r){Tl.creator.path=t,Tl.creator.moveTo(e,i).lineTo(e+n,i).lineTo(e+n,i+r).lineTo(e,i+r).lineTo(e,i)},roundRect(t,e,i,n,r,o){Tl.creator.path=[],Vl.drawRoundRect(Tl.creator,e,i,n,r,o),t.push(...Tl.convertToCanvasData(Tl.creator.path,!0))},arcTo(t,e,i,n,r,o,s,a,l,h,c){const d=n-e,u=r-i,p=o-n,f=s-r;let g=Xl(u,d),_=Xl(f,p);const v=Yl(d,u),m=Yl(p,f);let y=_-g;if(y<0&&(y+=Fs),v<1e-12||m<1e-12||y<1e-12||Kl(y-$l)<1e-12)return t&&t.push(nh,n,r),l&&(Jl(l,e,i),Ql(l,n,r)),c&&th(c,e,i),void(h&&th(h,n,r));const x=d*f-p*u<0,w=x?-1:1,b=a/Ul(y/2),S=n+b*Ul(g+y/2+Ws*w),k=r+b*Hl(g+y/2+Ws*w);return g-=Ws*w,_-=Ws*w,dh(t,S,k,a,a,0,g/Is,_/Is,x,l,h,c)},arc:(t,e,i,n,r,o,s,a,l,h)=>dh(t,e,i,n,n,0,r,o,s,a,l,h),ellipse(t,e,i,n,r,o,s,a,l,h,c,d){const u=o*Is,p=Hl(u),f=Ul(u);let g=s*Is,_=a*Is;g>$l&&(g-=Fs),_<0&&(_+=Fs);let v=_-g;v<0?v+=Fs:v>Fs&&(v-=Fs),l&&(v-=Fs);const m=Gl(Kl(v/Ws)),y=v/m,x=Hl(y/4),w=8/3*x*x/Hl(y/2);_=g+y;let b,S,k,E,C,O,L,P,T=Ul(g),B=Hl(g),R=k=f*n*T-p*r*B,A=E=p*n*T+f*r*B,M=e+k,D=i+E;t&&t.push(t.length?nh:ih,M,D),h&&Jl(h,M,D),d&&th(d,M,D);for(let I=0;I<m;I++)b=Ul(_),S=Hl(_),k=f*n*b-p*r*S,E=p*n*b+f*r*S,C=e+R-w*(f*n*B+p*r*T),O=i+A-w*(p*n*B-f*r*T),L=e+k+w*(f*n*S+p*r*b),P=i+E+w*(p*n*S-f*r*b),t&&t.push(rh,C,O,L,P,e+k,i+E),h&&ch(e+R,i+A,C,O,L,P,e+k,i+E,h,!0),R=k,A=E,T=b,B=S,g=_,_+=y;c&&th(c,e+k,i+E)},quadraticCurveTo(t,e,i,n,r,o,s){t.push(rh,(e+2*n)/3,(i+2*r)/3,(o+2*n)/3,(s+2*r)/3,o,s)},toTwoPointBoundsByQuadraticCurve(t,e,i,n,r,o,s,a){ch(t,e,(t+2*i)/3,(e+2*n)/3,(r+2*i)/3,(o+2*n)/3,r,o,s,a)},toTwoPointBounds(t,e,i,n,r,o,s,a,l,h){const c=[];let d,u,p,f,g,_,v,m,y=t,x=i,w=r,b=s;for(let S=0;S<2;++S)if(1==S&&(y=e,x=n,w=o,b=a),d=-3*y+9*x-9*w+3*b,u=6*y-12*x+6*w,p=3*x-3*y,Math.abs(d)<1e-12){if(Math.abs(u)<1e-12)continue;f=-p/u,0<f&&f<1&&c.push(f)}else v=u*u-4*p*d,m=Math.sqrt(v),v<0||(g=(-u+m)/(2*d),0<g&&g<1&&c.push(g),_=(-u-m)/(2*d),0<_&&_<1&&c.push(_));h?Ql(l,t,e):Jl(l,t,e),Ql(l,s,a);for(let S=0,k=c.length;S<k;S++)hh(c[S],t,e,i,n,r,o,s,a,ah),Ql(l,ah.x,ah.y)},getPointAndSet(t,e,i,n,r,o,s,a,l,h){const c=1-t,d=c*c*c,u=3*c*c*t,p=3*c*t*t,f=t*t*t;h.x=d*e+u*n+p*o+f*a,h.y=d*i+u*r+p*s+f*l},getPoint(t,e,i,n,r,o,s,a,l){const h={};return hh(t,e,i,n,r,o,s,a,l,h),h},getDerivative(t,e,i,n,r){const o=1-t;return 3*o*o*(i-e)+6*o*t*(n-i)+3*t*t*(r-n)},cut(t,e,i,n,r,o,s,a,l){if(t<=0)return{left:null,right:[n,r,o,s,a,l]};if(t>=1)return{left:[n,r,o,s,a,l],right:null};const h=1-t,c=e*h+n*t,d=i*h+r*t,u=n*h+o*t,p=r*h+s*t,f=o*h+a*t,g=s*h+l*t,_=c*h+u*t,v=d*h+p*t,m=u*h+f*t,y=p*h+g*t;return{left:[c,d,_,v,_*h+m*t,v*h+y*t],right:[m,y,f,g,a,l]}}},{getPointAndSet:hh,toTwoPointBounds:ch,ellipse:dh}=lh,{sin:uh,cos:ph,sqrt:fh,atan2:gh}=Math,{ellipse:_h}=lh,vh={ellipticalArc(t,e,i,n,r,o,s,a,l,h,c){const d=(l-e)/2,u=(h-i)/2,p=o*Is,f=uh(p),g=ph(p),_=-g*d-f*u,v=-g*u+f*d,m=n*n,y=r*r,x=v*v,w=_*_,b=m*y-m*x-y*w;let S=0;if(b<0){const t=fh(1-b/(m*y));n*=t,r*=t}else S=(s===a?-1:1)*fh(b/(m*x+y*w));const k=S*n*v/r,E=-S*r*_/n,C=gh((v-E)/r,(_-k)/n),O=gh((-v-E)/r,(-_-k)/n);let L=O-C;0===a&&L>0?L-=Fs:1===a&&L<0&&(L+=Fs);const P=e+d+g*k-f*E,T=i+u+f*k+g*E,B=L<0?1:0;c||$a.ellipseToCurve?_h(t,P,T,n,r,o,C/Is,O/Is,B):n!==r||o?t.push(Rl.G,P,T,n,r,o,C/Is,O/Is,B):t.push(Rl.O,P,T,n,C/Is,O/Is,B)}},mh=t=>[],{M:yh,m:xh,L:wh,l:bh,H:Sh,h:kh,V:Eh,v:Ch,C:Oh,c:Lh,S:Ph,s:Th,Q:Bh,q:Rh,T:Ah,t:Mh,A:Dh,a:Ih,Z:Fh,z:Wh,N:zh,D:Nh,X:jh,G:Vh,F:Hh,O:Uh,P:Yh,U:Xh}=Rl,{rect:Gh,roundRect:Kh,arcTo:$h,arc:Zh,ellipse:qh,quadraticCurveTo:Jh}=lh,{ellipticalArc:Qh}=vh,tc=Ja.get("PathConvert"),ec={},ic={current:{dot:0},stringify(t,e){let i,n,r,o=0,s=t.length,a="";for(;o<s;){n=t[o],i=Wl[n],a+=n===r?" ":Fl[n];for(let n=1;n<i;n++)a+=Ms.float(t[o+n],e),n===i-1||(a+=" ");r=n,o+=i}return a},parse(t,e){let i,n,r,o="";const s=[],a=e?Dl:Ml;for(let l=0,h=t.length;l<h;l++)n=t[l],Xa[n]?("."===n&&(nc.dot&&(rc(s,o),o=""),nc.dot++),"0"===o&&"."!==n&&(rc(s,o),o=""),o+=n):Rl[n]?(o&&(rc(s,o),o=""),nc.name=Rl[n],nc.length=Al[n],nc.index=0,rc(s,nc.name),!i&&a[n]&&(i=!0)):"-"===n||"+"===n?"e"===r||"E"===r?o+=n:(o&&rc(s,o),o=n):o&&(rc(s,o),o=""),r=n;return o&&rc(s,o),i?ic.toCanvasData(s,e):s},toCanvasData(t,e){let i,n,r,o,s,a=0,l=0,h=0,c=0,d=0,u=t.length;const p=[];for(;d<u;){switch(r=t[d],r){case xh:t[d+1]+=a,t[d+2]+=l;case yh:a=t[d+1],l=t[d+2],p.push(yh,a,l),d+=3;break;case kh:t[d+1]+=a;case Sh:a=t[d+1],p.push(wh,a,l),d+=2;break;case Ch:t[d+1]+=l;case Eh:l=t[d+1],p.push(wh,a,l),d+=2;break;case bh:t[d+1]+=a,t[d+2]+=l;case wh:a=t[d+1],l=t[d+2],p.push(wh,a,l),d+=3;break;case Th:t[d+1]+=a,t[d+2]+=l,t[d+3]+=a,t[d+4]+=l,r=Ph;case Ph:s=o===Oh||o===Ph,h=s?2*a-i:t[d+1],c=s?2*l-n:t[d+2],i=t[d+1],n=t[d+2],a=t[d+3],l=t[d+4],p.push(Oh,h,c,i,n,a,l),d+=5;break;case Lh:t[d+1]+=a,t[d+2]+=l,t[d+3]+=a,t[d+4]+=l,t[d+5]+=a,t[d+6]+=l,r=Oh;case Oh:i=t[d+3],n=t[d+4],a=t[d+5],l=t[d+6],p.push(Oh,t[d+1],t[d+2],i,n,a,l),d+=7;break;case Mh:t[d+1]+=a,t[d+2]+=l,r=Ah;case Ah:s=o===Bh||o===Ah,i=s?2*a-i:t[d+1],n=s?2*l-n:t[d+2],e?Jh(p,a,l,i,n,t[d+1],t[d+2]):p.push(Bh,i,n,t[d+1],t[d+2]),a=t[d+1],l=t[d+2],d+=3;break;case Rh:t[d+1]+=a,t[d+2]+=l,t[d+3]+=a,t[d+4]+=l,r=Bh;case Bh:i=t[d+1],n=t[d+2],e?Jh(p,a,l,i,n,t[d+3],t[d+4]):p.push(Bh,i,n,t[d+3],t[d+4]),a=t[d+3],l=t[d+4],d+=5;break;case Ih:t[d+6]+=a,t[d+7]+=l;case Dh:Qh(p,a,l,t[d+1],t[d+2],t[d+3],t[d+4],t[d+5],t[d+6],t[d+7],e),a=t[d+6],l=t[d+7],d+=8;break;case Wh:case Fh:p.push(Fh),d++;break;case zh:a=t[d+1],l=t[d+2],e?Gh(p,a,l,t[d+3],t[d+4]):oc(p,t,d,5),d+=5;break;case Nh:a=t[d+1],l=t[d+2],e?Kh(p,a,l,t[d+3],t[d+4],[t[d+5],t[d+6],t[d+7],t[d+8]]):oc(p,t,d,9),d+=9;break;case jh:a=t[d+1],l=t[d+2],e?Kh(p,a,l,t[d+3],t[d+4],t[d+5]):oc(p,t,d,6),d+=6;break;case Vh:qh(e?p:oc(p,t,d,9),t[d+1],t[d+2],t[d+3],t[d+4],t[d+5],t[d+6],t[d+7],t[d+8],null,ec),a=ec.x,l=ec.y,d+=9;break;case Hh:e?qh(p,t[d+1],t[d+2],t[d+3],t[d+4],0,0,360,!1):oc(p,t,d,5),a=t[d+1]+t[d+3],l=t[d+2],d+=5;break;case Uh:Zh(e?p:oc(p,t,d,7),t[d+1],t[d+2],t[d+3],t[d+4],t[d+5],t[d+6],null,ec),a=ec.x,l=ec.y,d+=7;break;case Yh:e?Zh(p,t[d+1],t[d+2],t[d+3],0,360,!1):oc(p,t,d,4),a=t[d+1]+t[d+3],l=t[d+2],d+=4;break;case Xh:$h(e?p:oc(p,t,d,6),a,l,t[d+1],t[d+2],t[d+3],t[d+4],t[d+5],null,ec),a=ec.x,l=ec.y,d+=6;break;default:return tc.error(`command: ${r} [index:${d}]`,t),p}o=r}return p},objectToCanvasData(t){if(t[0].name.length>1)return mh(t);{const e=[];return t.forEach(t=>{switch(t.name){case"M":e.push(yh,t.x,t.y);break;case"L":e.push(wh,t.x,t.y);break;case"C":e.push(Oh,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(Bh,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(Fh)}}),e}},copyData(t,e,i,n){for(let r=i,o=i+n;r<o;r++)t.push(e[r])},pushData(t,e){nc.index===nc.length&&(nc.index=1,t.push(nc.name)),t.push(Number(e)),nc.index++,nc.dot=0}},{current:nc,pushData:rc,copyData:oc}=ic,{M:sc,L:ac,C:lc,Q:hc,Z:cc,N:dc,D:uc,X:pc,G:fc,F:gc,O:_c,P:vc,U:mc}=Rl,{getMinDistanceFrom:yc,getRadianFrom:xc}=aa,{tan:wc,min:bc,abs:Sc}=Math,kc={},Ec={beginPath(t){t.length=0},moveTo(t,e,i){t.push(sc,e,i)},lineTo(t,e,i){t.push(ac,e,i)},bezierCurveTo(t,e,i,n,r,o,s){t.push(lc,e,i,n,r,o,s)},quadraticCurveTo(t,e,i,n,r){t.push(hc,e,i,n,r)},closePath(t){t.push(cc)},rect(t,e,i,n,r){t.push(dc,e,i,n,r)},roundRect(t,e,i,n,r,o){if(cs(o))t.push(pc,e,i,n,r,o);else{const s=Ms.fourNumber(o);s?t.push(uc,e,i,n,r,...s):t.push(dc,e,i,n,r)}},ellipse(t,e,i,n,r,o,s,a,l){if(n===r)return Oc(t,e,i,n,s,a,l);as(o)?t.push(gc,e,i,n,r):(as(s)&&(s=0),as(a)&&(a=360),t.push(fc,e,i,n,r,o,s,a,l?1:0))},arc(t,e,i,n,r,o,s){as(r)?t.push(vc,e,i,n):(as(r)&&(r=0),as(o)&&(o=360),t.push(_c,e,i,n,r,o,s?1:0))},arcTo(t,e,i,n,r,o,s,a,l){if(!ss(s)){const t=yc(s,a,e,i,n,r)/(l?1:2);o=bc(o,bc(t,t*Sc(wc(xc(s,a,e,i,n,r)/2))))}t.push(mc,e,i,n,r,o)},drawEllipse(t,e,i,n,r,o,s,a,l){lh.ellipse(null,e,i,n,r,as(o)?0:o,as(s)?0:s,as(a)?360:a,l,null,null,kc),t.push(sc,kc.x,kc.y),Cc(t,e,i,n,r,o,s,a,l)},drawArc(t,e,i,n,r,o,s){lh.arc(null,e,i,n,as(r)?0:r,as(o)?360:o,s,null,null,kc),t.push(sc,kc.x,kc.y),Oc(t,e,i,n,r,o,s)},drawPoints(t,e,i,n){lh.points(t,e,i,n)}},{ellipse:Cc,arc:Oc}=Ec,{moveTo:Lc,lineTo:Pc,quadraticCurveTo:Tc,bezierCurveTo:Bc,closePath:Rc,beginPath:Ac,rect:Mc,roundRect:Dc,ellipse:Ic,arc:Fc,arcTo:Wc,drawEllipse:zc,drawArc:Nc,drawPoints:jc}=Ec,Vc=class{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?ls(t)?Tl.parse(t):t:[],this}beginPath(){return Ac(this.__path),this.paint(),this}moveTo(t,e){return Lc(this.__path,t,e),this.paint(),this}lineTo(t,e){return Pc(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,i,n,r,o){return Bc(this.__path,t,e,i,n,r,o),this.paint(),this}quadraticCurveTo(t,e,i,n){return Tc(this.__path,t,e,i,n),this.paint(),this}closePath(){return Rc(this.__path),this.paint(),this}rect(t,e,i,n){return Mc(this.__path,t,e,i,n),this.paint(),this}roundRect(t,e,i,n,r){return Dc(this.__path,t,e,i,n,r),this.paint(),this}ellipse(t,e,i,n,r,o,s,a){return Ic(this.__path,t,e,i,n,r,o,s,a),this.paint(),this}arc(t,e,i,n,r,o){return Fc(this.__path,t,e,i,n,r,o),this.paint(),this}arcTo(t,e,i,n,r){return Wc(this.__path,t,e,i,n,r),this.paint(),this}drawEllipse(t,e,i,n,r,o,s,a){return zc(this.__path,t,e,i,n,r,o,s,a),this.paint(),this}drawArc(t,e,i,n,r,o){return Nc(this.__path,t,e,i,n,r,o),this.paint(),this}drawPoints(t,e,i){return jc(this.__path,t,e,i),this.paint(),this}clearPath(){return this.beginPath()}paint(){}},{M:Hc,L:Uc,C:Yc,Q:Xc,Z:Gc,N:Kc,D:$c,X:Zc,G:qc,F:Jc,O:Qc,P:td,U:ed}=Rl,id=Ja.get("PathDrawer"),nd={drawPathByData(t,e){if(!e)return;let i,n=0,r=e.length;for(;n<r;)switch(i=e[n],i){case Hc:t.moveTo(e[n+1],e[n+2]),n+=3;break;case Uc:t.lineTo(e[n+1],e[n+2]),n+=3;break;case Yc:t.bezierCurveTo(e[n+1],e[n+2],e[n+3],e[n+4],e[n+5],e[n+6]),n+=7;break;case Xc:t.quadraticCurveTo(e[n+1],e[n+2],e[n+3],e[n+4]),n+=5;break;case Gc:t.closePath(),n+=1;break;case Kc:t.rect(e[n+1],e[n+2],e[n+3],e[n+4]),n+=5;break;case $c:t.roundRect(e[n+1],e[n+2],e[n+3],e[n+4],[e[n+5],e[n+6],e[n+7],e[n+8]]),n+=9;break;case Zc:t.roundRect(e[n+1],e[n+2],e[n+3],e[n+4],e[n+5]),n+=6;break;case qc:t.ellipse(e[n+1],e[n+2],e[n+3],e[n+4],e[n+5]*Is,e[n+6]*Is,e[n+7]*Is,e[n+8]),n+=9;break;case Jc:t.ellipse(e[n+1],e[n+2],e[n+3],e[n+4],0,0,Fs,!1),n+=5;break;case Qc:t.arc(e[n+1],e[n+2],e[n+3],e[n+4]*Is,e[n+5]*Is,e[n+6]),n+=7;break;case td:t.arc(e[n+1],e[n+2],e[n+3],0,Fs,!1),n+=4;break;case ed:t.arcTo(e[n+1],e[n+2],e[n+3],e[n+4],e[n+5]),n+=6;break;default:return void id.error(`command: ${i} [index:${n}]`,e)}}},{M:rd,L:od,C:sd,Q:ad,Z:ld,N:hd,D:cd,X:dd,G:ud,F:pd,O:fd,P:gd,U:_d}=Rl,{toTwoPointBounds:vd,toTwoPointBoundsByQuadraticCurve:md,arcTo:yd,arc:xd,ellipse:wd}=lh,{addPointBounds:bd,copy:Sd,addPoint:kd,setPoint:Ed,addBounds:Cd,toBounds:Od}=ga,Ld=Ja.get("PathBounds"),Pd={},Td={},Bd={},Rd={toBounds(t,e){Rd.toTwoPointBounds(t,Td),Od(Td,e)},toTwoPointBounds(t,e){if(!t||!t.length)return Ed(e,0,0);let i,n,r,o,s,a=0,l=0,h=0;const c=t.length;for(;a<c;)switch(s=t[a],0===a&&(s===ld||s===sd||s===ad?Ed(e,l,h):Ed(e,t[a+1],t[a+2])),s){case rd:case od:l=t[a+1],h=t[a+2],kd(e,l,h),a+=3;break;case sd:r=t[a+5],o=t[a+6],vd(l,h,t[a+1],t[a+2],t[a+3],t[a+4],r,o,Pd),bd(e,Pd),l=r,h=o,a+=7;break;case ad:i=t[a+1],n=t[a+2],r=t[a+3],o=t[a+4],md(l,h,i,n,r,o,Pd),bd(e,Pd),l=r,h=o,a+=5;break;case ld:a+=1;break;case hd:l=t[a+1],h=t[a+2],Cd(e,l,h,t[a+3],t[a+4]),a+=5;break;case cd:case dd:l=t[a+1],h=t[a+2],Cd(e,l,h,t[a+3],t[a+4]),a+=s===cd?9:6;break;case ud:wd(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],t[a+7],t[a+8],Pd,Bd),0===a?Sd(e,Pd):bd(e,Pd),l=Bd.x,h=Bd.y,a+=9;break;case pd:l=t[a+1],h=t[a+2],Nl=t[a+3],jl=t[a+4],Cd(e,l-Nl,h-jl,2*Nl,2*jl),l+=Nl,a+=5;break;case fd:xd(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Pd,Bd),0===a?Sd(e,Pd):bd(e,Pd),l=Bd.x,h=Bd.y,a+=7;break;case gd:l=t[a+1],h=t[a+2],zl=t[a+3],Cd(e,l-zl,h-zl,2*zl,2*zl),l+=zl,a+=4;break;case _d:yd(null,l,h,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Pd,Bd),0===a?Sd(e,Pd):bd(e,Pd),l=Bd.x,h=Bd.y,a+=6;break;default:return void Ld.error(`command: ${s} [index:${a}]`,t)}}},{M:Ad,L:Md,Z:Dd}=Rl,{getCenterX:Id,getCenterY:Fd}=aa,{arcTo:Wd}=Ec,zd={smooth(t,e,i){let n,r,o,s=0,a=0,l=0,h=0,c=0,d=0,u=0,p=0,f=0;ds(e)&&(e=e[0]||0);const g=t.length,_=9===g,v=[];for(;s<g;){switch(n=t[s],n){case Ad:h=p=t[s+1],c=f=t[s+2],s+=3,t[s]===Md?(d=t[s+1],u=t[s+2],_?v.push(Ad,h,c):v.push(Ad,Id(h,d),Fd(c,u))):v.push(Ad,h,c);break;case Md:switch(a=t[s+1],l=t[s+2],s+=3,t[s]){case Md:Wd(v,a,l,t[s+1],t[s+2],e,p,f,_);break;case Dd:Wd(v,a,l,h,c,e,p,f,_);break;default:v.push(Md,a,l)}p=a,f=l;break;case Dd:r!==Dd&&(Wd(v,h,c,d,u,e,p,f,_),v.push(Dd)),s+=1;break;default:o=Wl[n];for(let e=0;e<o;e++)v.push(t[s+e]);s+=o}r=n}return n!==Dd&&(v[1]=h,v[2]=c),v}};function Nd(t){return new Vc(t)}var jd=Nd();Tl.creator=Nd(),Tl.parse=ic.parse,Tl.convertToCanvasData=ic.toCanvasData;var{drawRoundRect:Vd}=Vl;function Hd(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,i,n,r){Vd(this,t,e,i,n,r)})}(t)}var Ud={alphaPixelTypes:["png","webp","svg"],upperCaseTypeMap:{},mimeType:(t,e="image")=>!t||t.startsWith(e)?t:("jpg"===t&&(t="jpeg"),e+"/"+t),fileType(t){const e=t.split(".");return e[e.length-1]},isOpaqueImage(t){const e=Yd.fileType(t);return["jpg","jpeg"].some(t=>t===e)},getExportOptions(t){switch(typeof t){case"object":return t;case"number":return{quality:t};case"boolean":return{blob:t};default:return{}}}},Yd=Ud;Yd.mineType=Yd.mimeType,Yd.alphaPixelTypes.forEach(t=>Yd.upperCaseTypeMap[t]=t.toUpperCase());var Xd=Ja.get("TaskProcessor"),Gd=class{constructor(t){this.parallel=!0,this.time=1,this.id=ys.create(ys.TASK),this.task=t}run(){return gl(this,void 0,void 0,function*(){try{if(this.isComplete||this.runing)return;if(this.runing=!0,this.canUse&&!this.canUse())return this.cancel();this.task&&(yield this.task())}catch(wS){Xd.error(wS)}})}complete(){this.isComplete=!0,this.parent=this.task=this.canUse=null}cancel(){this.isCancel=!0,this.complete()}},Kd=class{get total(){return this.list.length+this.delayNumber}get finishedIndex(){return this.isComplete?0:this.index+this.parallelSuccessNumber}get remain(){return this.isComplete?this.total:this.total-this.finishedIndex}get percent(){const{total:t}=this;let e=0,i=0;for(let n=0;n<t;n++)n<=this.finishedIndex?(i+=this.list[n].time,n===this.finishedIndex&&(e=i)):e+=this.list[n].time;return this.isComplete?1:i/e}constructor(t){this.config={parallel:6},this.list=[],this.running=!1,this.isComplete=!0,this.index=0,this.delayNumber=0,t&&_s.assign(this.config,t),this.empty()}add(t,e,i){let n,r,o,s;const a=new Gd(t);return a.parent=this,cs(e)?s=e:e&&(r=e.parallel,n=e.start,o=e.time,s=e.delay,i||(i=e.canUse)),o&&(a.time=o),!1===r&&(a.parallel=!1),i&&(a.canUse=i),ss(s)?this.push(a,n):(this.delayNumber++,setTimeout(()=>{this.delayNumber&&(this.delayNumber--,this.push(a,n))},s)),this.isComplete=!1,a}push(t,e){this.list.push(t),!1===e||this.timer||(this.timer=setTimeout(()=>this.start()))}empty(){this.index=0,this.parallelSuccessNumber=0,this.list=[],this.parallelList=[],this.delayNumber=0}start(){this.running||(this.running=!0,this.isComplete=!1,this.run())}pause(){clearTimeout(this.timer),this.timer=null,this.running=!1}resume(){this.start()}skip(){this.index++,this.resume()}stop(){this.isComplete=!0,this.list.forEach(t=>{t.isComplete||t.run()}),this.pause(),this.empty()}run(){this.running&&(this.setParallelList(),this.parallelList.length>1?this.runParallelTasks():this.remain?this.runTask():this.onComplete())}runTask(){const t=this.list[this.index];t?t.run().then(()=>{this.onTask(t),this.index++,t.isCancel?this.runTask():this.nextTask()}).catch(t=>{this.onError(t)}):this.timer=setTimeout(()=>this.nextTask())}runParallelTasks(){this.parallelList.forEach(t=>this.runParallelTask(t))}runParallelTask(t){t.run().then(()=>{this.onTask(t),this.fillParallelTask()}).catch(t=>{this.onParallelError(t)})}nextTask(){this.total===this.finishedIndex?this.onComplete():this.timer=setTimeout(()=>this.run())}setParallelList(){let t;const{config:e,list:i,index:n}=this;this.parallelList=[],this.parallelSuccessNumber=0;let r=n+e.parallel;if(r>i.length&&(r=i.length),e.parallel>1)for(let o=n;o<r&&(t=i[o],t.parallel);o++)this.parallelList.push(t)}fillParallelTask(){let t;const e=this.parallelList;this.parallelSuccessNumber++,e.pop();const i=e.length,n=this.finishedIndex+i;if(e.length){if(!this.running)return;n<this.total&&(t=this.list[n],t&&t.parallel&&(e.push(t),this.runParallelTask(t)))}else this.index+=this.parallelSuccessNumber,this.parallelSuccessNumber=0,this.nextTask()}onComplete(){this.stop(),this.config.onComplete&&this.config.onComplete()}onTask(t){t.complete(),this.config.onTask&&this.config.onTask()}onParallelError(t){this.parallelList.forEach(t=>{t.parallel=!1}),this.parallelList.length=0,this.parallelSuccessNumber=0,this.onError(t)}onError(t){this.pause(),this.config.onError&&this.config.onError(t)}destroy(){this.stop()}},$d=Ja.get("Resource"),Zd={tasker:new Kd,queue:new Kd({parallel:1}),map:{},get isComplete(){return qd.tasker.isComplete},set(t,e){qd.map[t]&&$d.repeat(t),qd.map[t]=e},get:t=>qd.map[t],remove(t){const e=qd.map[t];e&&(e.destroy&&e.destroy(),delete qd.map[t])},loadImage(t,e){return new Promise((i,n)=>{const r=this.setImage(t,t,e);r.load(()=>i(r),t=>n(t))})},setImage(t,e,i){let n;return ls(e)?n={url:e}:e.url||(n={url:t,view:e}),n&&(i&&(n.format=i),e=sl.image(n)),qd.set(t,e),e},loadFilm(t,e){},loadVideo(t,e){},destroy(){qd.map={}}},qd=Zd,Jd={maxRecycled:10,recycledList:[],patternTasker:Zd.queue,get(t,e){let i=Zd.get(t.url);return i||Zd.set(t.url,i="film"===e?sl.film(t):sl.image(t)),i.use++,i},recycle(t){t.parent&&(t=t.parent),t.use--,setTimeout(()=>{t.use||($a.image.isLarge(t)?t.url&&Zd.remove(t.url):(t.clearLevels(),Qd.recycledList.push(t)))})},recyclePaint(t){Qd.recycle(t.image)},clearRecycled(t){const e=Qd.recycledList;(e.length>Qd.maxRecycled||t)&&(e.forEach(e=>(!e.use||t)&&e.url&&Zd.remove(e.url)),e.length=0)},clearLevels(){},hasAlphaPixel:t=>Ud.alphaPixelTypes.some(e=>Qd.isFormat(e,t)),isFormat(t,e){if(e.format)return e.format===t;const{url:i}=e;if(i.startsWith("data:")){if(i.startsWith("data:"+Ud.mimeType(t)))return!0}else{if(i.includes("."+t)||i.includes("."+Ud.upperCaseTypeMap[t]))return!0;if("png"===t&&!i.includes("."))return!0}return!1},destroy(){this.clearRecycled(!0)}},Qd=Jd,{IMAGE:tu,create:eu}=ys,iu=class{get tag(){return"Image"}get url(){return this.config.url}get crossOrigin(){const{crossOrigin:t}=this.config;return ss(t)?$a.image.crossOrigin:t}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=eu(tu),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}Jd.isFormat("svg",t)&&(this.isSVG=!0),Jd.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(t,e,i){return this.loading||(this.loading=!0,Zd.tasker.add(()=>gl(this,void 0,void 0,function*(){return yield $a.origin["load"+this.tag](this.getLoadUrl(i),this.crossOrigin,this).then(t=>{i&&this.setThumbView(t),this.setView(t)}).catch(t=>{this.error=t,this.onComplete(!1)})}))),this.waitComplete.push(t,e),this.waitComplete.length-2}unload(t,e){const i=this.waitComplete;if(e){const e=i[t+1];e&&e({type:"stop"})}i[t]=i[t+1]=void 0}setView(t){this.ready=!0,this.width||(this.width=t.width,this.height=t.height,this.view=t),this.onComplete(!0)}onComplete(t){let e;this.waitComplete.forEach((i,n)=>{e=n%2,i&&(t?e||i(this):e&&i(this.error))}),this.waitComplete.length=0,this.loading=!1}getFull(t){return this.view}getCanvas(t,e,i,n,r,o,s,a){if(t||(t=this.width),e||(e=this.height),this.cache){let{params:t,data:e}=this.cache;for(let i in t)if(t[i]!==arguments[i]){e=null;break}if(e)return e}const l=$a.image.resize(this.view,t,e,r,o,void 0,s,i,n,a);return this.cache=this.use>1?{data:l,params:arguments}:null,l}getPattern(t,e,i,n){const r=$a.canvas.createPattern(t,e);return $a.image.setPatternTransform(r,i,n),r}render(t,e,i,n,r,o,s,a,l){t.drawImage(this.view,e,i,n,r)}getLoadUrl(t){return this.url}setThumbView(t){}getThumbSize(t){}getMinLevel(){}getLevelData(t,e,i){}clearLevels(t){}destroyFilter(){}destroy(){this.clearLevels(),this.destroyFilter();const{view:t}=this;t&&t.close&&t.close(),this.config={url:""},this.cache=this.view=null,this.waitComplete.length=0}};function nu(t,e,i,n){n||(i.configurable=i.enumerable=!0),Object.defineProperty(t,e,i)}function ru(t,e){return Object.getOwnPropertyDescriptor(t,e)}function ou(t,e){return(i,n)=>function(t,e,i,n){nu(t,e,Object.assign({get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}},n||{})),ku(t,e,i)}(i,n,t,e&&e(n))}function su(t){return ou(t)}function au(t,e){return ou(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function lu(t,e){return ou(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__scrollWorld||(this.__scrollWorld={}))}}))}function hu(t){return ou(t,t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),pu(this))}}))}function cu(t,e){return ou(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function du(t,e){return ou(t,t=>({set(i){this.__setAttr(t,i,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function uu(t,e){return ou(t,t=>({set(i){this.__setAttr(t,i,e)&&pu(this)}}))}function pu(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}var fu=uu;function gu(t,e){return ou(t,t=>({set(i){this.__setAttr(t,i)&&(function(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&pu(t)}(this),e&&(this.__.__useStroke=!0))}}))}var _u=gu;function vu(t){return ou(t,t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}}))}function mu(t){return ou(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange())}}))}function yu(t){return ou(t,t=>({set(e){if(this.__setAttr(t,e)){const t=this.__;_s.stintSet(t,"__useDim",t.dim||t.bright||t.dimskip)}}}))}function xu(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function wu(t,e,i,n){t.__setAttr(e,i)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==n&&0!==i||pu(t))}function bu(t){return ou(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,this.leafer&&this.leafer.updateCursor())}}))}function Su(t){return(e,i)=>{nu(e,"__DataProcessor",{get:()=>t})}}function ku(t,e,i){const n=t.__DataProcessor.prototype,r="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),s=function(t,e){const i="_"+t;return{get(){const t=this[i];return null==t?e:t},set(t){this[i]=t}}}(e,i);if(ss(i))s.get=function(){return this[r]};else if("function"==typeof i)s.get=function(){const t=this[r];return null==t?i(this.__leaf):t};else if(us(i)){const t=function(t){return"{}"===JSON.stringify(t)}(i);s.get=function(){const e=this[r];return null==e?this[r]=t?{}:_s.clone(i):e}}const a=t.isBranchLeaf;"width"===e?s.get=function(){const t=this[r];if(null==t){const t=this,e=t.__naturalWidth,n=t.__leaf;return!i||n.pathInputed?n.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:a&&n.children.length?n.boxBounds.width:i}return t}:"height"===e&&(s.get=function(){const t=this[r];if(null==t){const t=this,e=t.__naturalHeight,n=t.__leaf;return!i||n.pathInputed?n.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:a&&n.children.length?n.boxBounds.height:i}return t});let l,h=n;for(;!l&&h;)l=ru(h,e),h=h.__proto__;l&&l.set&&(s.set=l.set),n[o]&&(s.set=n[o],delete n[o]),nu(n,e,s)}var Eu=new Ja("rewrite"),Cu=[],Ou=["destroy","constructor"];function Lu(t){return(e,i)=>{Cu.push({name:e.constructor.name+"."+i,run:()=>{e[i]=t}})}}function Pu(){return t=>{Tu()}}function Tu(t){Cu.length&&(Cu.forEach(e=>{t&&Eu.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()}),Cu.length=0)}function Bu(t,e){return i=>{var n;(t.prototype?(n=t.prototype,Object.getOwnPropertyNames(n)):Object.keys(t)).forEach(n=>{Ou.includes(n)||e&&e.includes(n)||(t.prototype?ru(t.prototype,n).writable&&(i.prototype[n]=t.prototype[n]):i.prototype[n]=t[n])})}}function Ru(){return t=>{ll.register(t)}}function Au(){return t=>{dl.register(t)}}setTimeout(()=>Tu(!0));var{copy:Mu,toInnerPoint:Du,toOuterPoint:Iu,scaleOfOuter:Fu,rotateOfOuter:Wu,skewOfOuter:zu,multiplyParent:Nu,divideParent:ju,getLayout:Vu}=$s,Hu={},{round:Uu}=Math,Yu={updateAllMatrix(t,e,i){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(i=!0),Ku(t,e,i),t.isBranch){const{children:n}=t;for(let t=0,r=n.length;t<r;t++)Gu(n[t],e,i)}},updateMatrix(t,e,i){const n=t.__layout;e?i&&(n.waitAutoLayout=!0,t.__hasAutoLayout&&(n.matrixChanged=!1)):n.waitAutoLayout&&(n.waitAutoLayout=!1),n.matrixChanged&&t.__updateLocalMatrix(),n.waitAutoLayout||t.__updateWorldMatrix()},updateBounds(t){const e=t.__layout;e.boundsChanged&&t.__updateLocalBounds(),e.waitAutoLayout||t.__updateWorldBounds()},updateAllWorldOpacity(t){if(t.__updateWorldOpacity(),t.isBranch){const{children:e}=t;for(let t=0,i=e.length;t<i;t++)$u(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&$u(t),t.__updateChange(),e.surfaceChanged&&(t.__hasComplex&&Xu.updateComplex(t),e.surfaceChanged=!1)},updateAllChange(t){if(qu(t),t.isBranch){const{children:e}=t;for(let t=0,i=e.length;t<i;t++)Zu(e[t])}},worldHittable(t){for(;t;){if(!t.__.hittable)return!1;t=t.parent}return!0},draggable:t=>(t.draggable||t.editable)&&t.hitSelf&&!t.locked,copyCanvasByWorld(t,e,i,n,r,o){n||(n=t.__nowWorld),t.__worldFlipped||$a.fullImageShadow?e.copyWorldByReset(i,n,t.__nowWorld,r,o):e.copyWorldToInner(i,n,t.__layout.renderBounds,r)},renderComplex(t,e,i){},updateComplex(t){},checkComplex(t){},moveWorld(t,e,i=0,n,r){const o=us(e)?Object.assign({},e):{x:e,y:i};n?Iu(t.localTransform,o,o,!0):t.parent&&Du(t.parent.scrollWorldTransform,o,o,!0),Xu.moveLocal(t,o.x,o.y,r)},moveLocal(t,e,i=0,n){us(e)&&(i=e.y,e=e.x),e+=t.x,i+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=Uu(e),i=Uu(i)),n?t.animate({x:e,y:i},n):(t.x=e,t.y=i)},zoomOfWorld(t,e,i,n,r,o){Xu.zoomOfLocal(t,Ju(t,e),i,n,r,o)},zoomOfLocal(t,e,i,n=i,r,o){const s=t.__localMatrix;if(cs(n)||(n&&(o=n),n=i),Mu(Hu,s),Fu(Hu,e,i,n),Xu.hasHighPosition(t))Xu.setTransform(t,Hu,r,o);else{const e=t.x+Hu.e-s.e,a=t.y+Hu.f-s.f;o&&!r?t.animate({x:e,y:a,scaleX:t.scaleX*i,scaleY:t.scaleY*n},o):(t.x=e,t.y=a,t.scaleResize(i,n,!0!==r))}},rotateOfWorld(t,e,i,n){Xu.rotateOfLocal(t,Ju(t,e),i,n)},rotateOfLocal(t,e,i,n){const r=t.__localMatrix;Mu(Hu,r),Wu(Hu,e,i),Xu.hasHighPosition(t)?Xu.setTransform(t,Hu,!1,n):t.set({x:t.x+Hu.e-r.e,y:t.y+Hu.f-r.f,rotation:Ms.formatRotation(t.rotation+i)},n)},skewOfWorld(t,e,i,n,r,o){Xu.skewOfLocal(t,Ju(t,e),i,n,r,o)},skewOfLocal(t,e,i,n=0,r,o){Mu(Hu,t.__localMatrix),zu(Hu,e,i,n),Xu.setTransform(t,Hu,r,o)},transformWorld(t,e,i,n){Mu(Hu,t.worldTransform),Nu(Hu,e),t.parent&&ju(Hu,t.parent.scrollWorldTransform),Xu.setTransform(t,Hu,i,n)},transform(t,e,i,n){Mu(Hu,t.localTransform),Nu(Hu,e),Xu.setTransform(t,Hu,i,n)},setTransform(t,e,i,n){const r=t.__,o=r.origin&&Xu.getInnerOrigin(t,r.origin),s=Vu(e,o,r.around&&Xu.getInnerOrigin(t,r.around));if(Xu.hasOffset(t)&&(s.x-=r.offsetX,s.y-=r.offsetY),i){const e=s.scaleX/t.scaleX,i=s.scaleY/t.scaleY;if(delete s.scaleX,delete s.scaleY,o){Wa.scale(t.boxBounds,Math.abs(e),Math.abs(i));const n=Xu.getInnerOrigin(t,r.origin);aa.move(s,o.x-n.x,o.y-n.y)}t.set(s),t.scaleResize(e,i,!1)}else t.set(s,n)},getFlipTransform(t,e){const i={a:1,b:0,c:0,d:1,e:0,f:0},n="x"===e?1:-1;return Fu(i,Xu.getLocalOrigin(t,"center"),-1*n,1*n),i},getLocalOrigin:(t,e)=>aa.tempToOuterOf(Xu.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const i={};return ma.toPoint(e,t.boxBounds,i),i},getRelativeWorld:(t,e,i)=>(Mu(Hu,t.worldTransform),ju(Hu,e.scrollWorldTransform),i?Hu:Object.assign({},Hu)),updateScaleFixedWorld(t){},updateOuterBounds(t){},cacheId(t){},drop(t,e,i,n){t.setTransform(Xu.getRelativeWorld(t,e,!0),n),e.add(t,i)},hasHighPosition:t=>t.origin||t.around||Xu.hasOffset(t),hasOffset:t=>t.offsetX||t.offsetY,hasParent(t,e){if(!e)return!1;for(;t;){if(e===t)return!0;t=t.parent}},animateMove(t,e,i=.3){if(e.x||e.y)if(Math.abs(e.x)<1&&Math.abs(e.y)<1)t.move(e);else{const n=e.x*i,r=e.y*i;e.x-=n,e.y-=r,t.move(n,r),$a.requestRender(()=>Xu.animateMove(t,e,i))}}},Xu=Yu,{updateAllMatrix:Gu,updateMatrix:Ku,updateAllWorldOpacity:$u,updateAllChange:Zu,updateChange:qu}=Xu;function Ju(t,e){return t.updateLayout(),t.parent?aa.tempToInnerOf(e,t.parent.scrollWorldTransform):e}var Qu,tp={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser||0===t.__.visible?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localStrokeBounds,localRenderBounds(t){const{__:e,__layout:i}=t;return e.eraser||0===e.visible?null:i.localOuterBounds||i.localRenderBounds},maskLocalBoxBounds:(t,e)=>ep(t,e)&&t.__localBoxBounds,maskLocalStrokeBounds:(t,e)=>ep(t,e)&&t.__layout.localStrokeBounds,maskLocalRenderBounds(t,e){const{__layout:i}=t;return ep(t,e)&&(i.localOuterBounds||i.localRenderBounds)},excludeRenderBounds:(t,e)=>!(!e.bounds||e.bounds.hit(t.__world,e.matrix))||!(!e.hideBounds||!e.hideBounds.includes(t.__world,e.matrix))};function ep(t,e){return e||(Qu=0),t.__.mask&&(Qu=1),Qu<0?null:(Qu&&(Qu=-1),!0)}var{updateBounds:ip}=Yu,np={sort:(t,e)=>t.__.zIndex===e.__.zIndex?t.__tempNumber-e.__tempNumber:t.__.zIndex-e.__.zIndex,pushAllChildBranch(t,e){if(t.__tempNumber=1,t.__.__childBranchNumber){const{children:i}=t;for(let n=0,r=i.length;n<r;n++)(t=i[n]).isBranch&&(t.__tempNumber=1,e.add(t),rp(t,e))}},pushAllParent(t,e){const{keys:i}=e;if(i)for(;t.parent&&ss(i[t.parent.innerId]);)e.add(t.parent),t=t.parent;else for(;t.parent;)e.add(t.parent),t=t.parent},pushAllBranchStack(t,e){let i=e.length;const{children:n}=t;for(let r=0,o=n.length;r<o;r++)n[r].isBranch&&e.push(n[r]);for(let r=i,o=e.length;r<o;r++)op(e[r],e)},updateBounds(t,e){const i=[t];op(t,i),sp(i,e)},updateBoundsByBranchStack(t,e){let i,n;for(let r=t.length-1;r>-1;r--){i=t[r],n=i.children;for(let t=0,e=n.length;t<e;t++)ip(n[t]);e&&e===i||ip(i)}},move(t,e,i){let n;const{children:r}=t;for(let o=0,s=r.length;o<s;o++)n=(t=r[o]).__world,n.e+=e,n.f+=i,n.x+=e,n.y+=i,t.isBranch&&ap(t,e,i)},scale(t,e,i,n,r,o,s){let a;const{children:l}=t,h=n-1,c=r-1;for(let d=0,u=l.length;d<u;d++)a=(t=l[d]).__world,a.a*=n,a.d*=r,(a.b||a.c)&&(a.b*=n,a.c*=r),a.e===a.x&&a.f===a.y?(a.x=a.e+=(a.e-o)*h+e,a.y=a.f+=(a.f-s)*c+i):(a.e+=(a.e-o)*h+e,a.f+=(a.f-s)*c+i,a.x+=(a.x-o)*h+e,a.y+=(a.y-s)*c+i),a.width*=n,a.height*=r,a.scaleX*=n,a.scaleY*=r,t.isBranch&&lp(t,e,i,n,r,o,s)}},{pushAllChildBranch:rp,pushAllBranchStack:op,updateBoundsByBranchStack:sp,move:ap,scale:lp}=np,hp={run(t){if(t&&t.length){const e=t.length;for(let i=0;i<e;i++)t[i]();t.length===e?t.length=0:t.splice(0,e)}}},{getRelativeWorld:cp,updateBounds:dp}=Yu,{toOuterOf:up,getPoints:pp,copy:fp}=Wa,gp="_localContentBounds",_p="_worldContentBounds",vp="_worldBoxBounds",mp="_worldStrokeBounds",yp=class{get contentBounds(){return this._contentBounds||this.boxBounds}set contentBounds(t){this._contentBounds=t}get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}set renderBounds(t){this._renderBounds=t}get localContentBounds(){return up(this.contentBounds,this.leaf.__localMatrix,this[gp]||(this[gp]={})),this[gp]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return up(this.contentBounds,this.leaf.__world,this[_p]||(this[_p]={})),this[_p]}get worldBoxBounds(){return up(this.boxBounds,this.leaf.__world,this[vp]||(this[vp]={})),this[vp]}get worldStrokeBounds(){return up(this.strokeBounds,this.leaf.__world,this[mp]||(this[mp]={})),this[mp]}get a(){return 1}get b(){return 0}get c(){return 0}get d(){return 1}get e(){return this.leaf.__.x}get f(){return this.leaf.__.y}get x(){return this.e+this.boxBounds.x}get y(){return this.f+this.boxBounds.y}get width(){return this.boxBounds.width}get height(){return this.boxBounds.height}constructor(t){this.leaf=t,this.leaf.__local&&(this._localRenderBounds=this._localStrokeBounds=this.leaf.__local),t.__world&&(this.boxBounds={x:0,y:0,width:0,height:0},this.boxChange(),this.matrixChange())}createLocal(){const t=this.leaf.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0};this._localStrokeBounds||(this._localStrokeBounds=t),this._localRenderBounds||(this._localRenderBounds=t)}update(){const{leaf:t}=this,{leafer:e}=t;if(t.isApp)return dp(t);if(e)e.ready?e.watcher.changed&&e.layouter.layout():e.start();else{let e=t;for(;e.parent&&!e.parent.leafer;)e=e.parent;const i=e;if(i.__fullLayouting)return;i.__fullLayouting=!0,$a.layout(i),delete i.__fullLayouting}}getTransform(t="world"){this.update();const{leaf:e}=this;switch(t){case"world":return e.__world;case"local":return e.__localMatrix;case"inner":return $s.defaultMatrix;case"page":t=e.zoomLayer;default:return cp(e,t)}}getBounds(t,e="world"){switch(this.update(),e){case"world":return this.getWorldBounds(t);case"local":return this.getLocalBounds(t);case"inner":return this.getInnerBounds(t);case"page":e=this.leaf.zoomLayer;default:return new Va(this.getInnerBounds(t)).toOuterOf(this.getTransform(e))}}getInnerBounds(t="box"){switch(t){case"render":return this.renderBounds;case"content":if(this.contentBounds)return this.contentBounds;case"box":return this.boxBounds;case"stroke":return this.strokeBounds}}getLocalBounds(t="box"){switch(t){case"render":return this.localRenderBounds;case"stroke":return this.localStrokeBounds;case"content":if(this.contentBounds)return this.localContentBounds;case"box":return this.leaf.__localBoxBounds}}getWorldBounds(t="box"){switch(t){case"render":return this.leaf.__world;case"stroke":return this.worldStrokeBounds;case"content":if(this.contentBounds)return this.worldContentBounds;case"box":return this.worldBoxBounds}}getLayoutBounds(t,e="world",i){const{leaf:n}=this;let r,o,s,a=this.getInnerBounds(t);switch(e){case"world":r=n.getWorldPoint(a),o=n.__world;break;case"local":const{scaleX:t,scaleY:i,rotation:l,skewX:h,skewY:c}=n.__;s={scaleX:t,scaleY:i,rotation:l,skewX:h,skewY:c},r=n.getLocalPointByInner(a);break;case"inner":r=a,o=$s.defaultMatrix;break;case"page":e=n.zoomLayer;default:r=n.getWorldPoint(a,e),o=cp(n,e,!0)}if(s||(s=$s.getLayout(o)),fp(s,a),aa.copy(s,r),i){const{scaleX:t,scaleY:e}=s,i=Math.abs(t),n=Math.abs(e);1===i&&1===n||(s.scaleX/=i,s.scaleY/=n,s.width*=i,s.height*=n)}return s}getLayoutPoints(t,e="world"){const{leaf:i}=this,n=pp(this.getInnerBounds(t));let r;switch(e){case"world":r=null;break;case"local":r=i.parent;break;case"inner":break;case"page":e=i.zoomLayer;default:r=e}return ss(r)||n.forEach(t=>i.innerToWorld(t,null,!1,r)),n}shrinkContent(){const{x:t,y:e,width:i,height:n}=this.boxBounds;this._contentBounds={x:t,y:e,width:i,height:n}}spreadStroke(){const{x:t,y:e,width:i,height:n}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:i,height:n},this._localStrokeBounds={x:t,y:e,width:i,height:n},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:i,height:n}=this.renderBounds;this._renderBounds={x:t,y:e,width:i,height:n},this._localRenderBounds={x:t,y:e,width:i,height:n}}shrinkContentCancel(){this._contentBounds=void 0}spreadStrokeCancel(){const t=this.renderBounds===this.strokeBounds;this._strokeBounds=this.boxBounds,this._localStrokeBounds=this.leaf.__localBoxBounds,t&&this.spreadRenderCancel()}spreadRenderCancel(){this._renderBounds=this._strokeBounds,this._localRenderBounds=this._localStrokeBounds}boxChange(){this.boxChanged=!0,this.localBoxChanged?this.boundsChanged||(this.boundsChanged=!0):this.localBoxChange(),this.hitCanvasChanged=!0}localBoxChange(){this.localBoxChanged=!0,this.boundsChanged=!0}strokeChange(){this.strokeChanged=!0,this.strokeSpread||(this.strokeSpread=1),this.boundsChanged=!0,this.hitCanvasChanged=!0}renderChange(){this.renderChanged=!0,this.renderSpread||(this.renderSpread=1),this.boundsChanged=!0}scaleChange(){this.scaleChanged=!0,this._scaleOrRotationChange()}rotationChange(){this.rotationChanged=!0,this.affectRotation=!0,this._scaleOrRotationChange()}_scaleOrRotationChange(){this.affectScaleOrRotation=!0,this.matrixChange(),this.leaf.__local||this.createLocal()}matrixChange(){this.matrixChanged=!0,this.localBoxChanged?this.boundsChanged||(this.boundsChanged=!0):this.localBoxChange()}surfaceChange(){this.surfaceChanged=!0}opacityChange(){this.opacityChanged=!0}childrenSortChange(){this.childrenSortChanged||(this.childrenSortChanged=this.affectChildrenSort=!0,this.leaf.forceUpdate("surface"))}destroy(){}},xp=class{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&$a.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&$a.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&$a.event.stop(this.origin)}},wp=class extends xp{constructor(t,e,i){super(t,e),this.parent=i,this.child=e}};wp.ADD="child.add",wp.REMOVE="child.remove",wp.CREATED="created",wp.MOUNTED="mounted",wp.UNMOUNTED="unmounted",wp.DESTROY="destroy";var bp="property.scroll",Sp=class extends xp{constructor(t,e,i,n,r){super(t,e),this.attrName=i,this.oldValue=n,this.newValue=r}};Sp.CHANGE="property.change",Sp.LEAFER_CHANGE="property.leafer_change",Sp.SCROLL=bp;var kp={scrollX:bp,scrollY:bp},Ep=class extends xp{constructor(t,e){super(t),Object.assign(this,e)}};Ep.LOAD="image.load",Ep.LOADED="image.loaded",Ep.ERROR="image.error";var Cp=class extends xp{static checkHas(t,e,i){"on"===i?e===Tp?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(Op)||t.hasEvent(Lp)||t.hasEvent(Pp),t.__hasWorldEvent=t.hasEvent(Tp))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(Op,t),"inner"===e&&t.emit(Lp,t)),t.emit(Pp,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(Tp,t)}};Cp.RESIZE="bounds.resize",Cp.INNER="bounds.inner",Cp.LOCAL="bounds.local",Cp.WORLD="bounds.world";var{RESIZE:Op,INNER:Lp,LOCAL:Pp,WORLD:Tp}=Cp,Bp={};[Op,Lp,Pp,Tp].forEach(t=>Bp[t]=1);var Rp=class t extends xp{get bigger(){if(!this.old)return!0;const{width:t,height:e}=this.old;return this.width>=t&&this.height>=e}get smaller(){return!this.bigger}get samePixelRatio(){return!this.old||this.pixelRatio===this.old.pixelRatio}constructor(e,i){us(e)?(super(t.RESIZE),Object.assign(this,e)):super(e),this.old=i}static isResizing(t){return this.resizingKeys&&!ss(this.resizingKeys[t.innerId])}};Rp.RESIZE="resize";var Ap=class extends xp{constructor(t,e){super(t),this.data=e}};Ap.REQUEST="watch.request",Ap.DATA="watch.data";var Mp=class extends xp{constructor(t,e,i){super(t),e&&(this.data=e,this.times=i)}};Mp.REQUEST="layout.request",Mp.START="layout.start",Mp.BEFORE="layout.before",Mp.LAYOUT="layout",Mp.AFTER="layout.after",Mp.AGAIN="layout.again",Mp.END="layout.end";var Dp=class extends xp{constructor(t,e,i,n){super(t),e&&(this.times=e),i&&(this.renderBounds=i,this.renderOptions=n)}};Dp.REQUEST="render.request",Dp.CHILD_START="render.child_start",Dp.CHILD_END="render.child_end",Dp.START="render.start",Dp.BEFORE="render.before",Dp.RENDER="render",Dp.AFTER="render.after",Dp.AGAIN="render.again",Dp.END="render.end",Dp.NEXT="render.next";var Ip=class extends xp{};Ip.START="leafer.start",Ip.BEFORE_READY="leafer.before_ready",Ip.READY="leafer.ready",Ip.AFTER_READY="leafer.after_ready",Ip.VIEW_READY="leafer.view_ready",Ip.VIEW_COMPLETED="leafer.view_completed",Ip.STOP="leafer.stop",Ip.RESTART="leafer.restart",Ip.END="leafer.end",Ip.UPDATE_MODE="leafer.update_mode",Ip.TRANSFORM="leafer.transform",Ip.MOVE="leafer.move",Ip.SCALE="leafer.scale",Ip.ROTATE="leafer.rotate",Ip.SKEW="leafer.skew";var{MOVE:Fp,SCALE:Wp,ROTATE:zp,SKEW:Np}=Ip,jp={x:Fp,y:Fp,scaleX:Wp,scaleY:Wp,rotation:zp,skewX:Np,skewY:Np},Vp={};function Hp(t,e,i){if(e){const{__captureMap:e}=t;return e||(i?t.__captureMap={}:Vp)}{const{__bubbleMap:e}=t;return e||(i?t.__bubbleMap={}:Vp)}}var{on:Up,on_:Yp,off:Xp,off_:Gp,once:Kp,emit:$p,emitEvent:Zp,hasEvent:qp,destroy:Jp}=class{set event(t){this.on(t)}on(t,e,i){if(!e){let e;if(ds(t))t.forEach(t=>this.on(t[0],t[1],t[2]));else for(let i in t)ds(e=t[i])?this.on(i,e[0],e[1]):this.on(i,e);return}let n,r,o;i&&("once"===i?r=!0:"boolean"==typeof i?n=i:(n=i.capture,r=i.once));const s=Hp(this,n,!0),a=ls(t)?t.split(" "):t,l=r?{listener:e,once:r}:{listener:e};a.forEach(t=>{t&&(o=s[t],o?-1===o.findIndex(t=>t.listener===e)&&o.push(l):s[t]=[l],Bp[t]&&Cp.checkHas(this,t,"on"))})}off(t,e,i){if(t){const n=ls(t)?t.split(" "):t;if(e){let t,r,o;i&&(t="boolean"==typeof i?i:"once"!==i&&i.capture);const s=Hp(this,t);n.forEach(t=>{t&&(r=s[t],r&&(o=r.findIndex(t=>t.listener===e),o>-1&&r.splice(o,1),r.length||delete s[t],Bp[t]&&Cp.checkHas(this,t,"off")))})}else{const{__bubbleMap:t,__captureMap:e}=this;n.forEach(i=>{t&&delete t[i],e&&delete e[i]})}}else this.__bubbleMap=this.__captureMap=void 0}on_(t,e,i,n){return e?this.on(t,i?e=e.bind(i):e,n):ds(t)&&t.forEach(t=>this.on(t[0],t[2]?t[1]=t[1].bind(t[2]):t[1],t[3])),{type:t,current:this,listener:e,options:n}}off_(t){if(!t)return;const e=ds(t)?t:[t];e.forEach(t=>{t&&(t.listener?t.current.off(t.type,t.listener,t.options):ds(t.type)&&t.type.forEach(e=>t.current.off(e[0],e[1],e[3])))}),e.length=0}once(t,e,i,n){if(!e)return ds(t)&&t.forEach(t=>this.once(t[0],t[1],t[2],t[3]));us(i)?e=e.bind(i):n=i,this.on(t,e,{once:!0,capture:n})}emit(t,e,i){!e&&dl.has(t)&&(e=dl.get(t,{type:t,target:this,current:this}));const n=Hp(this,i)[t];if(n){let r;for(let o=0,s=n.length;o<s&&!((r=n[o])&&(r.listener(e),r.once&&(this.off(t,r.listener,i),o--,s--),e&&e.isStopNow));o++);}this.syncEventer&&this.syncEventer.emitEvent(e,i)}emitEvent(t,e){t.current=this,this.emit(t.type,t,e)}hasEvent(t,e){if(this.syncEventer&&this.syncEventer.hasEvent(t,e))return!0;const{__bubbleMap:i,__captureMap:n}=this,r=i&&i[t],o=n&&n[t];return!!(ss(e)?r||o:e?o:r)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}.prototype,Qp={on:Up,on_:Yp,off:Xp,off_:Gp,once:Kp,emit:$p,emitEvent:Zp,hasEvent:qp,destroyEventer:Jp},tf=Ja.get("setAttr"),ef={__setAttr(t,e,i){if(this.leaferIsCreated){const n=this.__.__getInput(t);if(!i||hs(e)||ss(e)||(tf.warn(this.innerName,t,e),e=void 0),us(e)||n!==e){if(this.__realSetAttr(t,e),this.isLeafer){this.emitEvent(new Sp(Sp.LEAFER_CHANGE,this,t,n,e));const i=jp[t];i&&(this.emitEvent(new Ip(i,this)),this.emitEvent(new Ip(Ip.TRANSFORM,this)))}this.emitPropertyEvent(Sp.CHANGE,t,n,e);const i=kp[t];return i&&this.emitPropertyEvent(i,t,n,e),!0}return!1}return this.__realSetAttr(t,e),!0},emitPropertyEvent(t,e,i,n){const r=new Sp(t,this,e,i,n);this.isLeafer||this.hasEvent(t)&&this.emitEvent(r),this.leafer.emitEvent(r)},__realSetAttr(t,e){const i=this.__;i[t]=e,this.__proxyData&&this.setProxyAttr(t,e),i.normalStyle&&(this.lockNormalStyle||ss(i.normalStyle[t])||(i.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:nf,multiplyParent:rf,translateInner:of,defaultWorld:sf}=$s,{toPoint:af,tempPoint:lf}=ma,hf={__updateWorldMatrix(){const{parent:t,__layout:e,__world:i,__scrollWorld:n,__:r}=this;rf(this.__local||e,t?t.__scrollWorld||t.__world:sf,i,!!e.affectScaleOrRotation,r),n&&of(Object.assign(n,i),r.scrollX,r.scrollY),e.scaleFixed&&Yu.updateScaleFixedWorld(this)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,i=this.__;t.affectScaleOrRotation&&(t.scaleChanged&&(t.resized||(t.resized="scale"))||t.rotationChanged)&&(nf(e,i,null,null,t.affectRotation),t.scaleChanged=t.rotationChanged=void 0),e.e=i.x+i.offsetX,e.f=i.y+i.offsetY,(i.around||i.origin)&&(af(i.around||i.origin,t.boxBounds,lf),of(e,-lf.x,-lf.y,!i.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:cf,updateAllMatrix:df}=Yu,{updateBounds:uf}=np,{toOuterOf:pf,copyAndSpread:ff,copy:gf}=Wa,{toBounds:_f}=Rd,vf={__updateWorldBounds(){const{__layout:t,__world:e}=this;pf(t.renderBounds,e,e),this.__hasComplex&&Yu.checkComplex(this),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&Cp.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&Cp.emitWorld(this)},__updateLocalBounds(){const t=this.__layout;t.boxChanged&&(this.__.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),t.resized="inner"),t.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),t.localBoxChanged=void 0,t.strokeSpread&&(t.strokeChanged=!0),t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.boxChange()),t.boxChanged=void 0,t.strokeChanged&&(t.strokeSpread=this.__updateStrokeSpread(),t.strokeSpread?(t.strokeBounds===t.boxBounds&&t.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):t.spreadStrokeCancel(),t.strokeChanged=void 0,(t.renderSpread||t.strokeSpread!==t.strokeBoxSpread)&&(t.renderChanged=!0),this.parent&&this.parent.__layout.strokeChange(),t.resized="inner"),t.renderChanged&&(t.renderSpread=this.__updateRenderSpread(),t.renderSpread?(t.renderBounds!==t.boxBounds&&t.renderBounds!==t.strokeBounds||t.spreadRender(),this.__updateRenderBounds(),this.__updateLocalRenderBounds()):t.spreadRenderCancel(),t.renderChanged=void 0,this.parent&&this.parent.__layout.renderChange()),t.outerScale&&Yu.updateOuterBounds(this),t.resized||(t.resized="local"),t.boundsChanged=void 0},__updateLocalBoxBounds(){this.__hasMotionPath&&this.__updateMotionPath(),this.__hasAutoLayout&&this.__updateAutoLayout(),pf(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){pf(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){pf(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(t,e){const i=this.__layout.boxBounds,n=this.__;n.__usePathBox?_f(n.path,i):(i.x=0,i.y=0,i.width=n.width,i.height=n.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.__extraUpdate(),this.__.flow?(this.__layout.boxChanged&&this.__updateFlowLayout(),df(this),uf(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(df(this),uf(this,this))):cf(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(t){const e=this.__layout;ff(e.strokeBounds,e.boxBounds,e.strokeBoxSpread)},__updateRenderBounds(t){const e=this.__layout,{renderSpread:i}=e;cs(i)&&i<=0?gf(e.renderBounds,e.strokeBounds):ff(e.renderBounds,e.boxBounds,i)}},mf={__render(t,e){if(e.shape)return this.__renderShape(t,e);if((!e.cellList||e.cellList.has(this))&&this.__worldOpacity){const i=this.__;if(i.bright&&!e.topRendering)return e.topList.add(this);if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=e.ignoreOpacity?1:e.dimOpacity&&!i.dimskip?i.opacity*e.dimOpacity:i.opacity,this.__.__single){if("path"===i.eraser)return this.__renderEraser(t,e);const n=t.getSameCanvas(!0,!0);this.__draw(n,e,t),Yu.copyCanvasByWorld(this,t,n,this.__nowWorld,i.__blendMode,!0),n.recycle(this.__nowWorld)}else this.__draw(t,e);Ja.showBounds&&Ja.drawBounds(this,t,e)}},__renderShape(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawShape(t,e))},__clip(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawRenderPath(t),t.clipUI(this))},__updateWorldOpacity(){this.__worldOpacity=this.__.visible?this.parent?this.parent.__worldOpacity*this.__.opacity:this.__.opacity:0,this.__layout.opacityChanged&&(this.__layout.opacityChanged=!1)}},{excludeRenderBounds:yf}=tp,{hasSize:xf}=Wa,wf={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){const i=this.__nowWorld=this.__getNowWorld(e);if(this.__worldOpacity&&xf(i)){const n=this.__;if(n.__useDim)if(n.dim)e.dimOpacity=!0===n.dim?.2:n.dim;else{if(n.bright&&!e.topRendering)return e.topList.add(this);n.dimskip&&e.dimOpacity&&(e.dimOpacity=0)}if(n.__single&&!this.isBranchLeaf){if("path"===n.eraser)return this.__renderEraser(t,e);const r=t.getSameCanvas(!1,!0);this.__renderBranch(r,e),t.opacity=e.ignoreOpacity?1:e.dimOpacity?n.opacity*e.dimOpacity:n.opacity,t.copyWorldByReset(r,i,i,n.__blendMode,!0),r.recycle(i)}else this.__renderBranch(t,e)}},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{let i;const{children:n}=this;for(let r=0,o=n.length;r<o;r++)i=n[r],yf(i,e)||(i.__hasComplex?Yu.renderComplex(i,t,e):i.__render(t,e))}},__clip(t,e){if(this.__worldOpacity){const{children:i}=this;for(let n=0,r=i.length;n<r;n++)yf(i[n],e)||i[n].__clip(t,e)}}},{LEAF:bf,create:Sf}=ys,{stintSet:kf}=_s,{toInnerPoint:Ef,toOuterPoint:Cf,multiplyParent:Of}=$s,{toOuterOf:Lf}=Wa,{copy:Pf,move:Tf}=aa,{getScaleFixedData:Bf}=Ms,{moveLocal:Rf,zoomOfLocal:Af,rotateOfLocal:Mf,skewOfLocal:Df,moveWorld:If,zoomOfWorld:Ff,rotateOfWorld:Wf,skewOfWorld:zf,transform:Nf,transformWorld:jf,setTransform:Vf,getFlipTransform:Hf,getLocalOrigin:Uf,getRelativeWorld:Yf,drop:Xf}=Yu,Gf=class{get tag(){return this.__tag}set tag(t){}get __tag(){return"Leaf"}get innerName(){return this.__.name||this.tag+this.innerId}get __DataProcessor(){return ms}get __LayoutProcessor(){return yp}get leaferIsCreated(){return this.leafer&&this.leafer.created}get leaferIsReady(){return this.leafer&&this.leafer.ready}get isLeafer(){return!1}get isBranch(){return!1}get isBranchLeaf(){return!1}get __localMatrix(){return this.__local||this.__layout}get __localBoxBounds(){return this.__local||this.__layout}get worldTransform(){return this.__layout.getTransform("world")}get localTransform(){return this.__layout.getTransform("local")}get scrollWorldTransform(){return this.updateLayout(),this.__scrollWorld||this.__world}get boxBounds(){return this.getBounds("box","inner")}get renderBounds(){return this.getBounds("render","inner")}get worldBoxBounds(){return this.getBounds("box")}get worldStrokeBounds(){return this.getBounds("stroke")}get worldRenderBounds(){return this.getBounds("render")}get worldOpacity(){return this.updateLayout(),this.__worldOpacity}get __worldFlipped(){return this.__world.scaleX<0||this.__world.scaleY<0}get __onlyHitMask(){return this.__hasMask&&!this.__.hitChildren}get __ignoreHitWorld(){return(this.__hasMask||this.__hasEraser)&&this.__.hitChildren}get __inLazyBounds(){return this.leaferIsCreated&&this.leafer.lazyBounds.hit(this.__world)}get pathInputed(){return this.__.__pathInputed}set event(t){this.on(t)}constructor(t){this.innerId=Sf(bf),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(wp.CREATED)}reset(t){this.leafer&&this.leafer.forceRender(this.__world),0!==t&&(this.__world={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0,scaleX:1,scaleY:1},null!==t&&(this.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0})),this.__worldOpacity=1,this.__=new this.__DataProcessor(this),this.__layout=new this.__LayoutProcessor(this),this.__level&&this.resetCustom(),t&&(t.__&&(t=t.toJSON()),t.children?this.set(t):Object.assign(this,t))}resetCustom(){this.__hasMask=this.__hasEraser=null,this.forceUpdate()}waitParent(t,e){e&&(t=t.bind(e)),this.parent?t():this.on(wp.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(wp.MOUNTED,t,"once")}nextRender(t,e,i){this.leafer?this.leafer.nextRender(t,e,i):this.waitLeafer(()=>this.leafer.nextRender(t,e,i))}removeNextRender(t){this.nextRender(t,null,"off")}__bindLeafer(t){if(this.isLeafer&&null!==t&&(t=this),this.leafer&&!t&&this.leafer.leafs--,this.leafer=t,t?(t.leafs++,this.__level=this.parent?this.parent.__level+1:1,this.animation&&this.__runAnimation("in"),this.__bubbleMap&&this.__emitLifeEvent(wp.MOUNTED),t.cacheId&&Yu.cacheId(this)):this.__emitLifeEvent(wp.UNMOUNTED),this.isBranch){const{children:e}=this;for(let i=0,n=e.length;i<n;i++)e[i].__bindLeafer(t)}}set(t,e){}get(t){}setAttr(t,e){this[t]=e}getAttr(t){return this[t]}getComputedAttr(t){return this.__[t]}toJSON(t){return t&&this.__layout.update(),this.__.__getInputData(null,t)}toString(t){return JSON.stringify(this.toJSON(t))}toSVG(){}__SVG(t){}toHTML(){}__setAttr(t,e){return!0}__getAttr(t){}setProxyAttr(t,e){}getProxyAttr(t){}find(t,e){}findTag(t){}findOne(t,e){}findId(t){}focus(t){}updateState(){}updateLayout(){this.__layout.update()}forceUpdate(t){ss(t)?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=ss(e)?null:void 0,this[t]=e}forceRender(t,e){this.forceUpdate("surface")}__extraUpdate(){this.leaferIsReady&&this.leafer.layouter.addExtra(this)}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(t,e){}__updateContentBounds(){}__updateStrokeBounds(t){}__updateRenderBounds(t){}__updateAutoLayout(){}__updateFlowLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(t){this.__hasEraser=!!t||this.children.some(t=>t.__.eraser)}__renderEraser(t,e){t.save(),this.__clip(t,e);const{renderBounds:i}=this.__layout;t.clearRect(i.x,i.y,i.width,i.height),t.restore()}__updateMask(t){this.__hasMask=this.children.some(t=>t.__.mask&&t.__.visible&&t.__.opacity)}__renderMask(t,e){}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld,i=this.__world;return Of(i,t.matrix,e,void 0,i),Lf(this.__layout.renderBounds,e,e),kf(e,"half",i.half),kf(e,"ignorePixelSnap",i.ignorePixelSnap),e}return this.__world}getClampRenderScale(){let{scaleX:t}=this.__nowWorld||this.__world;return t<0&&(t=-t),t>1?t:1}getRenderScaleData(t,e,i=!0){return Bf(Jd.patternLocked?this.__world:this.__nowWorld||this.__world,e,i,t)}getTransform(t){return this.__layout.getTransform(t||"local")}getBounds(t,e){return this.__layout.getBounds(t,e)}getLayoutBounds(t,e,i){return this.__layout.getLayoutBounds(t,e,i)}getLayoutPoints(t,e){return this.__layout.getLayoutPoints(t,e)}getWorldBounds(t,e,i){const n=e?Yf(this,e):this.worldTransform,r=i?t:{};return Lf(t,n,r),r}worldToLocal(t,e,i,n){this.parent?this.parent.worldToInner(t,e,i,n):e&&Pf(e,t)}localToWorld(t,e,i,n){this.parent?this.parent.innerToWorld(t,e,i,n):e&&Pf(e,t)}worldToInner(t,e,i,n){n&&(n.innerToWorld(t,e,i),t=e||t),Ef(this.worldTransform,t,e,i)}innerToWorld(t,e,i,n){Cf(this.worldTransform,t,e,i),n&&n.worldToInner(e||t,null,i)}getBoxPoint(t,e,i,n){const r=this.getInnerPoint(t,e,i,n);return i?r:this.getBoxPointByInner(r,null,null,!0)}getBoxPointByInner(t,e,i,n){const r=n?t:Object.assign({},t),{x:o,y:s}=this.boxBounds;return Tf(r,-o,-s),r}getInnerPoint(t,e,i,n){const r=n?t:{};return this.worldToInner(t,r,i,e),r}getInnerPointByBox(t,e,i,n){const r=n?t:Object.assign({},t),{x:o,y:s}=this.boxBounds;return Tf(r,o,s),r}getInnerPointByLocal(t,e,i,n){return this.getInnerPoint(t,this.parent,i,n)}getLocalPoint(t,e,i,n){const r=n?t:{};return this.worldToLocal(t,r,i,e),r}getLocalPointByInner(t,e,i,n){return this.getWorldPoint(t,this.parent,i,n)}getPagePoint(t,e,i,n){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,i,n)}getWorldPoint(t,e,i,n){const r=n?t:{};return this.innerToWorld(t,r,i,e),r}getWorldPointByBox(t,e,i,n){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,n),e,i,!0)}getWorldPointByLocal(t,e,i,n){const r=n?t:{};return this.localToWorld(t,r,i,e),r}getWorldPointByPage(t,e,i,n){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,i,n)}setTransform(t,e,i){Vf(this,t,e,i)}transform(t,e,i){Nf(this,t,e,i)}move(t,e,i){Rf(this,t,e,i)}moveInner(t,e,i){If(this,t,e,!0,i)}scaleOf(t,e,i,n,r){Af(this,Uf(this,t),e,i,n,r)}rotateOf(t,e,i){Mf(this,Uf(this,t),e,i)}skewOf(t,e,i,n,r){Df(this,Uf(this,t),e,i,n,r)}transformWorld(t,e,i){jf(this,t,e,i)}moveWorld(t,e,i){If(this,t,e,!1,i)}scaleOfWorld(t,e,i,n,r){Ff(this,t,e,i,n,r)}rotateOfWorld(t,e){Wf(this,t,e)}skewOfWorld(t,e,i,n,r){zf(this,t,e,i,n,r)}flip(t,e){Nf(this,Hf(this,t),!1,e)}scaleResize(t,e=t,i){this.scaleX*=t,this.scaleY*=e}__scaleResize(t,e){}resizeWidth(t){}resizeHeight(t){}hit(t,e){return!0}__hitWorld(t,e){return!0}__hit(t,e){return!0}__hitFill(t){return!0}__hitStroke(t,e){return!0}__hitPixel(t){return!0}__drawHitPath(t){}__updateHitCanvas(){}__render(t,e){}__drawFast(t,e){}__draw(t,e,i){}__clip(t,e){}__renderShape(t,e){}__drawShape(t,e){}__updateWorldOpacity(){}__updateChange(){}__drawPath(t){}__drawRenderPath(t){}__updatePath(){}__updateRenderPath(t){}getMotionPathData(){return ol.need("path")}getMotionPoint(t){return ol.need("path")}getMotionTotal(){return 0}__updateMotionPath(){}__runAnimation(t,e){}__updateSortChildren(){}add(t,e){}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,i){Xf(this,t,e,i)}on(t,e,i){}off(t,e,i){}on_(t,e,i,n){}off_(t){}once(t,e,i,n){}emit(t,e,i){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e,i){i?this.addAttr(t,e,i):ku(this.prototype,t,e)}static addAttr(t,e,i,n){i||(i=uu),i(e,n)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new wp(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(wp.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}};Gf=fl([Bu(ef),Bu(hf),Bu(vf),Bu(Qp),Bu(mf)],Gf);var{setListWithFn:Kf}=Wa,{sort:$f}=np,{localBoxBounds:Zf,localStrokeBounds:qf,localRenderBounds:Jf,maskLocalBoxBounds:Qf,maskLocalStrokeBounds:tg,maskLocalRenderBounds:eg}=tp,ig=new Ja("Branch"),ng=class extends Gf{__updateStrokeSpread(){const{children:t}=this;for(let e=0,i=t.length;e<i;e++)if(t[e].__layout.strokeSpread)return 1;return 0}__updateRenderSpread(){let t;const{children:e}=this;for(let i=0,n=e.length;i<n;i++)if(t=e[i].__layout,t.renderSpread||t.localOuterBounds)return 1;return 0}__updateBoxBounds(t,e){Kf(e||this.__layout.boxBounds,this.children,this.__hasMask?Qf:Zf)}__updateStrokeBounds(t){Kf(t||this.__layout.strokeBounds,this.children,this.__hasMask?tg:qf)}__updateRenderBounds(t){Kf(t||this.__layout.renderBounds,this.children,this.__hasMask?eg:Jf)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let i=0,n=e.length;i<n;i++)e[i].__tempNumber=i,e[i].__.zIndex&&(t=!0);e.sort($f),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this||t.destroyed)return ig.warn("add self or destroyed");const i=ss(e);if(!t.__){if(ds(t))return t.forEach(t=>{this.add(t,e),i||e++});if(!(t=ll.get(t.tag,t)))return}t.parent&&t.parent.remove(t),t.parent=this,i?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1);const n=t.__layout;n.boxChanged||n.boxChange(),n.matrixChanged||n.matrixChange(),t.__bubbleMap&&t.__emitLifeEvent(wp.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(wp.ADD,t)),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}addMany(...t){this.add(t)}remove(t,e){t?t.__?t.animationOut?t.__runAnimation("out",()=>this.__remove(t,e)):this.__remove(t,e):this.find(t).forEach(t=>this.remove(t,e)):ss(t)&&super.remove(null,e)}removeAll(t){const{children:e}=this;e.length&&(this.children=[],this.__preRemove(),this.__.__childBranchNumber=0,e.forEach(e=>{this.__realRemoveChild(e),t&&e.destroy()}))}clear(){this.removeAll(!0)}__remove(t,e){const i=this.children.indexOf(t);i>-1&&(this.children.splice(i,1),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||1)-1),this.__preRemove(),this.__realRemoveChild(t),e&&t.destroy())}__preRemove(){this.__hasMask&&this.__updateMask(),this.__hasEraser&&this.__updateEraser(),this.__layout.boxChange(),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}__realRemoveChild(t){t.__emitLifeEvent(wp.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(wp.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const i=new wp(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(i),this.leafer.emitEvent(i)}};ng=fl([Bu(wf)],ng);var rg=class t{get length(){return this.list.length}constructor(t){this.reset(),t&&(ds(t)?this.addList(t):this.add(t))}has(t){return t&&!ss(this.keys[t.innerId])}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return ss(e)?-1:e}add(t){const{list:e,keys:i}=this;ss(i[t.innerId])&&(e.push(t),i[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:i}=this;if(ss(i[t.innerId])){const{list:n}=this;for(let t=e,r=n.length;t<r;t++)i[n[t].innerId]++;0===e?n.unshift(t):(e>n.length&&(e=n.length),n.splice(e,0,t)),i[t.innerId]=e}}addList(t){for(let e=0;e<t.length;e++)this.add(t[e])}remove(t){const{list:e}=this;let i;for(let n=0,r=e.length;n<r;n++)ss(i)?e[n].innerId===t.innerId&&(i=n,delete this.keys[t.innerId]):this.keys[e[n].innerId]=n-1;ss(i)||e.splice(i,1)}sort(t){const{list:e}=this;t?e.sort((t,e)=>e.__level-t.__level):e.sort((t,e)=>t.__level-e.__level)}forEach(t){this.list.forEach(t)}clone(){const e=new t;return e.list=[...this.list],e.keys=Object.assign({},this.keys),e}update(){this.keys={};const{list:t,keys:e}=this;for(let i=0,n=t.length;i<n;i++)e[t[i].innerId]=i}reset(){this.list=[],this.keys={}}destroy(){this.reset()}},og=class{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(ds(t)?this.addList(t):this.add(t))}has(t){return!ss(this.keys[t.innerId])}without(t){return ss(this.keys[t.innerId])}sort(t){const{levels:e}=this;t?e.sort((t,e)=>e-t):e.sort((t,e)=>t-e)}addList(t){t.forEach(t=>{this.add(t)})}add(t){const{keys:e,levelMap:i}=this;e[t.innerId]||(e[t.innerId]=1,i[t.__level]?i[t.__level].push(t):(i[t.__level]=[t],this.levels.push(t.__level)),this._length++)}forEach(t){let e;this.levels.forEach(i=>{e=this.levelMap[i];for(let n=0,r=e.length;n<r;n++)t(e[n])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}};function sg(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s}function ag(t){return ou(t,t=>({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0);const i=this.__layout;i.renderChanged||i.renderChange(),i.surfaceChange()}}))}function lg(t){return ou(t,t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}var hg={},cg={hasTransparent:function(t){if(!t||7===t.length||4===t.length)return!1;if("transparent"===t)return!0;const e=t[0];if("#"===e)switch(t.length){case 5:return"f"!==t[4]&&"F"!==t[4];case 9:return"f"!==t[7]&&"F"!==t[7]||"f"!==t[8]&&"F"!==t[8]}else if(("r"===e||"h"===e)&&"a"===t[3]){const e=t.lastIndexOf(",");if(e>-1)return parseFloat(t.slice(e+1))<1}return!1}},dg=Ya,ug={},pg={},fg={},gg={},_g={},vg={apply(){ol.need("filter")}},mg={},yg={setStyleName:()=>ol.need("state"),set:()=>ol.need("state")},{parse:xg,objectToCanvasData:wg}=ic,{stintSet:bg}=_s,{hasTransparent:Sg}=cg,kg={originPaint:{}},Eg=Ja.get("UIData"),Cg=class extends ms{get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get __strokeWidth(){return this.__getRealStrokeWidth()}get __maxStrokeWidth(){const t=this,e=t.__hasStrokeSides||t.strokeWidth;return t.__hasMultiStrokeStyle?Math.max(t.__hasMultiStrokeStyle,e):e}get __hasMultiPaint(){const t=this;return t.fill&&this.__useStroke||t.__isFills&&t.fill.length>1||t.__isStrokes&&t.stroke.length>1||t.__useEffect}get __clipAfterFill(){const t=this;return t.cornerRadius||t.innerShadow||t.__pathInputed}get __hasSurface(){return this.fill||this.stroke}get __autoWidth(){return null==this._width}get __autoHeight(){return null==this._height}get __autoSide(){return null==this._width||null==this._height}get __autoSize(){return null==this._width&&null==this._height}setVisible(t){this._visible=t;const{leafer:e}=this.__leaf;e&&(e.watcher.hasVisible=!0)}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,Eg.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,Eg.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),ls(t)||!t?(bg(this,"__isTransparentFill",Sg(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):us(t)&&this.__setPaint("fill",t)}setStroke(t){ls(t)||!t?(bg(this,"__isTransparentStroke",Sg(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t):us(t)&&this.__setPaint("stroke",t)}setPath(t){const e=ls(t);e||t&&us(t[0])?(this.__setInput("path",t),this._path=e?xg(t):wg(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){Og(this,"shadow",t)}setInnerShadow(t){Og(this,"innerShadow",t)}setFilter(t){Og(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&pg.compute("fill",this.__leaf),e&&pg.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeScaleFixed:i}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),ss(t.strokeScaleFixed)||(i=t.strokeScaleFixed)),i){const{scaleX:t}=this.__leaf.getRenderScaleData(!0,i,!1);if(1!==t)return e*t}return e}__checkComplex(){const t=this;bg(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)}__setPaint(t,e){this.__setInput(t,e);const i=this.__leaf.__layout;i.boxChanged||i.boxChange(),ds(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=kg)):(this.__isStrokes=!0,this._stroke||(this._stroke=kg))}__removePaint(t,e){e&&this.__removeInput(t),fg.recycleImage(t,this),"fill"===t?(bg(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(bg(this,"__isAlphaPixelStroke",void 0),bg(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}};function Og(t,e,i){t.__setInput(e,i),ds(i)?(i.some(t=>!1===t.visible)&&(i=i.filter(t=>!1!==t.visible)),i.length||(i=void 0)):i=i&&!1!==i.visible?[i]:void 0,t["_"+e]=i}var Lg=class extends Cg{},Pg=class extends Lg{get __boxStroke(){return!this.__pathInputed}get __drawAfterFill(){return this.__single||this.__clipAfterFill}get __clipAfterFill(){const t=this;return"show"!==t.overflow&&t.__leaf.children.length&&(t.__leaf.isOverflow||super.__clipAfterFill)}},Tg=class extends Cg{get __usePathBox(){return this.points||this.__pathInputed}},Bg=class extends Cg{get __boxStroke(){return!this.__pathInputed}},Rg={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900},{max:Ag,add:Mg}=Ss,Dg={__updateStrokeSpread(){let t=0,e=0;const i=this.__,{strokeAlign:n,__maxStrokeWidth:r}=i,o=this.__box;if((i.stroke||"all"===i.hitStroke)&&r&&"inside"!==n&&(e=t="center"===n?r/2:r,!i.__boxStroke||i.__useArrow)){const e=i.__isLinePath?0:10*t,n="none"===i.strokeCap?0:r;t+=Math.max(e,n)}return i.__useArrow&&(t+=5*r),o&&(t=Ag(t,o.__layout.strokeSpread=o.__updateStrokeSpread()),e=Math.max(e,o.__layout.strokeBoxSpread)),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:i,blur:n,backgroundBlur:r,filter:o,renderSpread:s}=this.__,{strokeSpread:a}=this.__layout,l=this.__box;e&&(t=_g.getShadowRenderSpread(this,e)),n&&(t=Ag(t,n)),o&&(t=Mg(t,vg.getSpread(o))),s&&(t=Mg(t,s)),a&&(t=Mg(t,a));let h=t;return i&&(h=Ag(h,_g.getInnerShadowSpread(this,i))),r&&(h=Ag(h,r)),this.__layout.renderShapeSpread=h,l?Ag(l.__updateRenderSpread(),t):t}},{stintSet:Ig}=_s,Fg={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);Ig(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),Ig(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:i,stroke:n}=t,r=t.innerShadow||t.blur||t.backgroundBlur||t.filter;Ig(t,"__isFastShadow",e&&!r&&e.length<2&&!e[0].spread&&!_g.isTransformShadow(e[0])&&i&&!t.__isTransparentFill&&!(ds(i)&&i.length>1)&&(this.useFastShadow||!n||n&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!r)}t.__checkSingle(),t.__checkComplex()},__drawFast(t,e){Wg(this,t,e)},__draw(t,e,i){const n=this.__;if(n.__complex){n.__needComputePaint&&n.__computePaint();const{fill:r,stroke:o,__drawAfterFill:s,__fillAfterStroke:a,__isFastShadow:l}=n;if(this.__drawRenderPath(t),n.__useEffect&&!l){const l=pg.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:h,innerShadow:c,filter:d}=n;h&&_g.shadow(this,t,l),a&&(n.__isStrokes?pg.strokes(o,this,t,e):pg.stroke(o,this,t,e)),r&&(n.__isFills?pg.fills(r,this,t,e):pg.fill(r,this,t,e)),s&&this.__drawAfterFill(t,e),c&&_g.innerShadow(this,t,l),o&&!a&&(n.__isStrokes?pg.strokes(o,this,t,e):pg.stroke(o,this,t,e)),d&&vg.apply(d,this,this.__nowWorld,t,i,l),l.worldCanvas&&l.worldCanvas.recycle(),l.canvas.recycle()}else{if(a&&(n.__isStrokes?pg.strokes(o,this,t,e):pg.stroke(o,this,t,e)),l){const e=n.shadow[0],{scaleX:i,scaleY:r}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*i,e.y*r,e.blur*i,cg.string(e.color))}r&&(n.__isFills?pg.fills(r,this,t,e):pg.fill(r,this,t,e)),l&&t.restore(),s&&this.__drawAfterFill(t,e),o&&!a&&(n.__isStrokes?pg.strokes(o,this,t,e):pg.stroke(o,this,t,e))}}else n.__pathForRender?Wg(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const i=this.__,{fill:n,stroke:r}=i;n&&!e.ignoreFill&&(i.__isAlphaPixelFill?pg.fills(n,this,t,e):pg.fill("#000000",this,t,e)),i.__isCanvas&&this.__drawAfterFill(t,e),r&&!e.ignoreStroke&&(i.__isAlphaPixelStroke?pg.strokes(r,this,t,e):pg.stroke("#000000",this,t,e))},__drawAfterFill(t,e){this.__.__clipAfterFill?(t.save(),t.clipUI(this),this.__drawContent(t,e),t.restore()):this.__drawContent(t,e)}};function Wg(t,e,i){const{fill:n,stroke:r,__drawAfterFill:o,__fillAfterStroke:s}=t.__;t.__drawRenderPath(e),s&&pg.stroke(r,t,e,i),n&&pg.fill(n,t,e,i),o&&t.__drawAfterFill(e,i),r&&!s&&pg.stroke(r,t,e,i)}var zg,Ng={__drawFast(t,e){let{x:i,y:n,width:r,height:o}=this.__layout.boxBounds;const{fill:s,stroke:a,__drawAfterFill:l}=this.__;if(s&&(t.fillStyle=s,t.fillRect(i,n,r,o)),l&&this.__drawAfterFill(t,e),a){const{strokeAlign:s,__strokeWidth:l}=this.__;if(!l)return;t.setStroke(a,l,this.__);const h=l/2;switch(s){case"center":t.strokeRect(0,0,r,o);break;case"inside":r-=l,o-=l,r<0||o<0?(t.save(),this.__clip(t,e),t.strokeRect(i+h,n+h,r,o),t.restore()):t.strokeRect(i+h,n+h,r,o);break;case"outside":t.strokeRect(i-h,n-h,r+l,o+l)}}}},jg=zg=class extends Gf{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set strokeWidthFixed(t){this.strokeScaleFixed=t}get strokeWidthFixed(){return this.strokeScaleFixed}set scale(t){Ms.assignScale(this,t)}get scale(){return this.__.scale}get isAutoWidth(){const t=this.__;return t.__autoWidth||t.autoWidth}get isAutoHeight(){const t=this.__;return t.__autoHeight||t.autoHeight}get pen(){const{path:t}=this.__;return jd.set(this.path=t||[]),t||this.__drawPathByBox(jd),jd}reset(t){}set(t,e){t&&Object.assign(this,t)}get(t){return ls(t)?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}clearProxyData(){}find(t,e){return ol.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return ol.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let i=e?this.__.__pathForRender:this.__.path;return i||(jd.set(i=[]),this.__drawPathByBox(jd,!e)),t?ic.toCanvasData(i,!0):i}getPathString(t,e,i){return ic.stringify(this.getPath(t,e),i)}asPath(t,e){this.path=this.getPath(t,e)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||mg.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(t){const e=this.__;e.path?(e.__pathForRender=e.cornerRadius||e.path.radius?zd.smooth(e.path,e.cornerRadius,e.cornerSmoothing):e.path,e.__useArrow&&ug.addArrows(this,t)):e.__pathForRender&&(e.__pathForRender=void 0)}__drawRenderPath(t){const e=this.__;t.beginPath(),e.__useArrow&&ug.updateArrow(this),this.__drawPathByData(t,e.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path,!0)}__drawPathByData(t,e,i){e?nd.drawPathByData(t,e):this.__drawPathByBox(t,i)}__drawPathByBox(t,e){const{x:i,y:n,width:r,height:o}=this.__layout.boxBounds;if(this.__.cornerRadius&&!e){const{cornerRadius:e}=this.__;t.roundRect(i,n,r,o,cs(e)?[e]:e)}else t.rect(i,n,r,o);t.closePath()}drawImagePlaceholder(t,e,i){pg.fill(this.__.placeholderColor,this,e,i)}animate(t,e,i,n){return this.set(t),ol.need("animate")}killAnimate(t,e){}export(t,e){return ol.need("export")}syncExport(t,e){return ol.need("export")}clone(t){const e=_s.clone(this.toJSON());return t&&Object.assign(e,t),zg.one(e)}static one(t,e,i,n,r){return ll.get(t.tag||this.prototype.__tag,t,e,i,n,r)}static registerUI(){Ru()(this)}static registerData(t){Su(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.__.__willDestroy=!0,this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}};sg([Su(Cg)],jg.prototype,"__",void 0),sg([(t,e)=>{const i="_"+e;nu(t,e,{set(t){this.isLeafer&&(this[i]=t)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[i]||this:this.leafer&&this.leafer.zoomLayer}})}],jg.prototype,"zoomLayer",void 0),sg([su("")],jg.prototype,"id",void 0),sg([su("")],jg.prototype,"name",void 0),sg([su("")],jg.prototype,"className",void 0),sg([mu("pass-through")],jg.prototype,"blendMode",void 0),sg([function(t){return ou(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&xu(this)}}))}(1)],jg.prototype,"opacity",void 0),sg([function(t){return ou(t,t=>({set(e){const i=this.visible;if(!0===i&&0===e){if(this.animationOut)return this.__runAnimation("out",()=>wu(this,t,e,i))}else 0===i&&!0===e&&this.animation&&this.__runAnimation("in");wu(this,t,e,i),this.mask&&xu(this)}}))}(!0)],jg.prototype,"visible",void 0),sg([mu(!1)],jg.prototype,"locked",void 0),sg([yu(!1)],jg.prototype,"dim",void 0),sg([yu(!1)],jg.prototype,"dimskip",void 0),sg([function(t){return ou(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__layout.childrenSortChange()})}}))}(0)],jg.prototype,"zIndex",void 0),sg([function(t){return ou(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent(()=>{this.parent.__updateMask(e)}))}}))}(!1)],jg.prototype,"mask",void 0),sg([function(t){return ou(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__updateEraser(e)})}}))}(!1)],jg.prototype,"eraser",void 0),sg([au(0,!0)],jg.prototype,"x",void 0),sg([au(0,!0)],jg.prototype,"y",void 0),sg([uu(100,!0)],jg.prototype,"width",void 0),sg([uu(100,!0)],jg.prototype,"height",void 0),sg([cu(1,!0)],jg.prototype,"scaleX",void 0),sg([cu(1,!0)],jg.prototype,"scaleY",void 0),sg([du(0,!0)],jg.prototype,"rotation",void 0),sg([du(0,!0)],jg.prototype,"skewX",void 0),sg([du(0,!0)],jg.prototype,"skewY",void 0),sg([au(0,!0)],jg.prototype,"offsetX",void 0),sg([au(0,!0)],jg.prototype,"offsetY",void 0),sg([lu(0,!0)],jg.prototype,"scrollX",void 0),sg([lu(0,!0)],jg.prototype,"scrollY",void 0),sg([hu()],jg.prototype,"origin",void 0),sg([hu()],jg.prototype,"around",void 0),sg([su(!1)],jg.prototype,"lazy",void 0),sg([function(t){return ou(t,t=>({set(e){this.__setAttr(t,e)&&(pu(this),this.__.__removeNaturalSize())}}))}(1)],jg.prototype,"pixelRatio",void 0),sg([vu(0)],jg.prototype,"renderSpread",void 0),sg([function(t){return ou(t,t=>({set(e){const i=this.__;2!==i.__pathInputed&&(i.__pathInputed=e?1:0),e||(i.__pathForRender=void 0),this.__setAttr(t,e),pu(this)}}))}()],jg.prototype,"path",void 0),sg([fu()],jg.prototype,"windingRule",void 0),sg([fu(!0)],jg.prototype,"closed",void 0),sg([uu(0)],jg.prototype,"padding",void 0),sg([uu(!1)],jg.prototype,"lockRatio",void 0),sg([uu()],jg.prototype,"widthRange",void 0),sg([uu()],jg.prototype,"heightRange",void 0),sg([su(!1)],jg.prototype,"draggable",void 0),sg([su()],jg.prototype,"dragBounds",void 0),sg([su("auto")],jg.prototype,"dragBoundsType",void 0),sg([su(!1)],jg.prototype,"editable",void 0),sg([bu(!0)],jg.prototype,"hittable",void 0),sg([bu("path")],jg.prototype,"hitFill",void 0),sg([_u("path")],jg.prototype,"hitStroke",void 0),sg([bu(!1)],jg.prototype,"hitBox",void 0),sg([bu(!0)],jg.prototype,"hitChildren",void 0),sg([bu(!0)],jg.prototype,"hitSelf",void 0),sg([bu()],jg.prototype,"hitRadius",void 0),sg([function(t){return ou(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}}))}("")],jg.prototype,"cursor",void 0),sg([mu()],jg.prototype,"fill",void 0),sg([_u(void 0,!0)],jg.prototype,"stroke",void 0),sg([_u("inside")],jg.prototype,"strokeAlign",void 0),sg([_u(1,!0)],jg.prototype,"strokeWidth",void 0),sg([_u(!1)],jg.prototype,"strokeScaleFixed",void 0),sg([_u("none")],jg.prototype,"strokeCap",void 0),sg([_u("miter")],jg.prototype,"strokeJoin",void 0),sg([_u()],jg.prototype,"dashPattern",void 0),sg([_u(0)],jg.prototype,"dashOffset",void 0),sg([_u(10)],jg.prototype,"miterLimit",void 0),sg([fu(0)],jg.prototype,"cornerRadius",void 0),sg([fu()],jg.prototype,"cornerSmoothing",void 0),sg([ag()],jg.prototype,"shadow",void 0),sg([ag()],jg.prototype,"innerShadow",void 0),sg([ag()],jg.prototype,"blur",void 0),sg([ag()],jg.prototype,"backgroundBlur",void 0),sg([ag()],jg.prototype,"grayscale",void 0),sg([ag()],jg.prototype,"filter",void 0),sg([mu()],jg.prototype,"placeholderColor",void 0),sg([su(100)],jg.prototype,"placeholderDelay",void 0),sg([su({})],jg.prototype,"data",void 0),sg([Lu(Gf.prototype.reset)],jg.prototype,"reset",null),jg=zg=sg([Bu(Dg),Bu(Fg),Pu()],jg);var Vg,Hg=class extends jg{get __tag(){return"Group"}get isBranch(){return!0}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(t,e){if(t)if(t.children){const{children:i}=t;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t,e),i.forEach(t=>this.add(t)),t.children=i}else super.set(t,e)}toJSON(t){const e=super.toJSON(t);if(!this.childlessJSON){const i=e.children=[];this.children.forEach(e=>e.skipJSON||i.push(e.toJSON(t)))}return e}pick(t,e){}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}};sg([Su(Lg)],Hg.prototype,"__",void 0),sg([uu(0)],Hg.prototype,"width",void 0),sg([uu(0)],Hg.prototype,"height",void 0),Hg=sg([Bu(ng),Ru()],Hg);var Ug=Ja.get("Leafer"),Yg=Vg=class extends Hg{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&Zd.isComplete}get layoutLocked(){return!this.layouter.running}get view(){return this.canvas&&this.canvas.view}get FPS(){return this.renderer?this.renderer.FPS:60}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}get clientBounds(){return this.canvas&&this.canvas.getClientBounds(!0)||{x:0,y:0,width:0,height:0}}constructor(t,e){super(e),this.config={start:!0,hittable:!0,smooth:!0,lazySpeard:100},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t),Vg.list.add(this)}init(t,e){if(this.canvas)return;let i;const{config:n}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),i=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,_s.assign(n,t));const r=this.canvas=sl.canvas(n);this.__controllers.push(this.renderer=sl.renderer(this,r,n),this.watcher=sl.watcher(this,n),this.layouter=sl.layouter(this,n)),this.isApp&&this.__setApp(),this.__checkAutoLayout(),e||(this.selector=sl.selector(this),this.interaction=sl.interaction(this,r,this.selector,n),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=sl.hitCanvasManager()),this.canvasManager=new pl,i=n.start),this.hittable=n.hittable,this.fill=n.fill,this.canvasManager.add(r),this.__listenEvents(),i&&(this.__startTimer=setTimeout(this.start.bind(this))),hp.run(this.__initWait),this.onInit()}onInit(){}initType(t){}set(t,e){this.waitInit(()=>{super.set(t,e)})}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.running=!0,this.ready?this.emitLeafer(Ip.RESTART):this.emitLeafer(Ip.START),this.__controllers.forEach(t=>t.start()),this.isApp||this.renderer.render())}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach(t=>t.stop()),this.running=!1,this.emitLeafer(Ip.STOP))}unlockLayout(t=!0){this.layouter.start(),t&&this.updateLayout()}lockLayout(t=!0){t&&this.updateLayout(),this.layouter.stop()}resize(t){const e=_s.copyAttrs({},t,Ll);Object.keys(e).forEach(t=>this[t]=e[t])}forceRender(t,e){const{renderer:i}=this;i&&(i.addBlock(t?new Va(t):this.canvas.bounds),this.viewReady&&(e?i.render():i.update()))}requestRender(t=!1){this.renderer&&this.renderer.update(t)}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}updateLazyBounds(){this.lazyBounds=this.canvas.bounds.clone().spread(this.config.lazySpeard)}__doResize(t){const{canvas:e}=this;if(!e||e.isSameSize(t))return;const i=_s.copyAttrs({},this.canvas,Ll);e.resize(t),this.updateLazyBounds(),this.__onResize(new Rp(t,i))}__onResize(t){this.emitEvent(t),_s.copyAttrs(this.__,t,Ll),setTimeout(()=>{this.canvasManager&&this.canvasManager.clearRecycled()},0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(){const{config:t,parentApp:e}=this;e||(t.width&&t.height||(this.autoLayout=new Ua(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(Ll.includes(t)?this.__changeCanvasSize(t,e):"fill"===t?this.__changeFill(e):"hittable"===t?this.parent||(this.canvas.hittable=e):"zIndex"===t?(this.canvas.zIndex=e,setTimeout(()=>this.parent&&this.parent.__updateSortChildren())):"mode"===t&&this.emit(Ip.UPDATE_MODE,{mode:e})),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&Ll.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const{config:i,canvas:n}=this,r=_s.copyAttrs({},n,Ll);r[t]=i[t]=e,i.width&&i.height?n.stopAutoLayout():this.__checkAutoLayout(),this.__doResize(r)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceRender()}__onCreated(){this.created=!0}__onReady(){this.ready=!0,this.emitLeafer(Ip.BEFORE_READY),this.emitLeafer(Ip.READY),this.emitLeafer(Ip.AFTER_READY),hp.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(Ip.VIEW_READY),hp.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:i}=this.config;if(t){let{width:n,height:r,pixelRatio:o}=this;const s="box"===t?this.worldBoxBounds:this.__world;e||(n=Math.max(1,s.x+s.width)),i||(r=Math.max(1,s.y+s.height)),this.__doResize({width:n,height:r,pixelRatio:o})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){hp.run(this.__nextRenderWait);const{imageReady:t}=this;t&&!this.viewCompleted&&this.__checkViewCompleted(),t||(this.viewCompleted=!1,this.requestRender())}else this.requestRender()}__checkViewCompleted(t=!0){this.nextRender(()=>{this.imageReady&&(t&&this.emitLeafer(Ip.VIEW_COMPLETED),hp.run(this.__viewCompletedWait),this.viewCompleted=!0)})}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender(()=>this.interaction.updateCursor())}waitInit(t,e){e&&(t=t.bind(e)),this.__initWait||(this.__initWait=[]),this.canvas?t():this.__initWait.push(t)}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,i){e&&(t=t.bind(e));const n=this.__nextRenderWait;if(i){for(let r=0;r<n.length;r++)if(n[r]===t){n.splice(r,1);break}}else n.push(t);this.requestRender()}zoom(t,e,i,n){return ol.need("view")}getValidMove(t,e,i){return{x:t,y:e}}getValidScale(t){return t}getWorldPointByClient(t,e){return this.interaction&&this.interaction.getLocal(t,e)}getPagePointByClient(t,e){return this.getPagePoint(this.getWorldPointByClient(t,e))}getClientPointByWorld(t){const{x:e,y:i}=this.clientBounds;return{x:e+t.x,y:i+t.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(t){}emitLeafer(t){this.emitEvent(new Ip(t,this))}__listenEvents(){const t=il.start("FirstCreate "+this.innerName);this.once([[Ip.START,()=>il.end(t)],[Mp.START,this.updateLazyBounds,this],[Dp.START,this.__onCreated,this],[Dp.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[Ap.DATA,this.__onWatchData,this],[Mp.END,this.__onLayoutEnd,this],[Dp.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){Vg.list.remove(this);try{this.stop(),this.emitLeafer(Ip.END),this.__removeListenEvents(),this.__controllers.forEach(t=>!(this.parent&&t===this.interaction)&&t.destroy()),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager&&this.canvasManager.destroy()),this.canvas&&this.canvas.destroy(),this.config.view=this.parentApp=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout(()=>{Jd.clearRecycled()},100)}catch(t){Ug.error(t)}}};t?e():setTimeout(e)}};Yg.list=new rg,sg([Su(class extends Lg{__getInputData(t,e){const i=super.__getInputData(t,e);return Ll.forEach(t=>delete i[t]),i}})],Yg.prototype,"__",void 0),sg([uu()],Yg.prototype,"pixelRatio",void 0),sg([su("normal")],Yg.prototype,"mode",void 0),Yg=Vg=sg([Ru()],Yg);var Xg=class extends jg{get __tag(){return"Rect"}};sg([Su(Bg)],Xg.prototype,"__",void 0),Xg=sg([Bu(Ng),Pu(),Ru()],Xg);var{add:Gg,includes:Kg,scroll:$g}=Wa,Zg=Xg.prototype,qg=Hg.prototype,Jg=class extends Hg{get __tag(){return"Box"}get isBranchLeaf(){return!0}get __useSelfBox(){return this.pathInputed}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){return this.__updateRectRenderSpread()||-1}__updateRectBoxBounds(){}__updateBoxBounds(t){if(this.children.length&&!this.__useSelfBox){const t=this.__;if(t.__autoSide){t.__hasSurface&&this.__extraUpdate(),super.__updateBoxBounds();const{boxBounds:e}=this.__layout;t.__autoSize||(t.__autoWidth?(e.width+=e.x,e.x=0,e.height=t.height,e.y=0):(e.height+=e.y,e.y=0,e.width=t.width,e.x=0)),this.__updateNaturalSize()}else this.__updateRectBoxBounds()}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){let t,e;if(this.children.length){const i=this.__,n=this.__layout,{renderBounds:r,boxBounds:o}=n,{overflow:s}=i,a=n.childrenRenderBounds||(n.childrenRenderBounds={x:0,y:0,width:0,height:0});super.__updateRenderBounds(a),(e=s&&s.includes("scroll"))&&(Gg(a,o),$g(a,i)),this.__updateRectRenderBounds(),t=!Kg(o,a),t&&"show"===s&&Gg(r,a)}else this.__updateRectRenderBounds();_s.stintSet(this,"isOverflow",t),this.__checkScroll(e)}__updateRectRenderBounds(){}__checkScroll(t){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.children.length&&this.__renderGroup(t,e)),this.hasScroller&&this.scroller.__render(t,e)}__drawContent(t,e){this.__renderGroup(t,e),(this.__.__useStroke||this.__.__useEffect)&&(t.setWorld(this.__nowWorld),this.__drawRenderPath(t))}};sg([Su(Pg)],Jg.prototype,"__",void 0),sg([uu(100)],Jg.prototype,"width",void 0),sg([uu(100)],Jg.prototype,"height",void 0),sg([su(!1)],Jg.prototype,"resizeChildren",void 0),sg([vu("show")],Jg.prototype,"overflow",void 0),sg([Lu(Zg.__updateStrokeSpread)],Jg.prototype,"__updateStrokeSpread",null),sg([Lu(Zg.__updateRenderSpread)],Jg.prototype,"__updateRectRenderSpread",null),sg([Lu(Zg.__updateBoxBounds)],Jg.prototype,"__updateRectBoxBounds",null),sg([Lu(Zg.__updateStrokeBounds)],Jg.prototype,"__updateStrokeBounds",null),sg([Lu(Zg.__updateRenderBounds)],Jg.prototype,"__updateRectRenderBounds",null),sg([Lu(Zg.__updateChange)],Jg.prototype,"__updateRectChange",null),sg([Lu(Zg.__render)],Jg.prototype,"__renderRect",null),sg([Lu(qg.__render)],Jg.prototype,"__renderGroup",null),Jg=sg([Pu(),Ru()],Jg);var Qg=class extends Jg{get __tag(){return"Frame"}get isFrame(){return!0}};sg([Su(class extends Pg{})],Qg.prototype,"__",void 0),sg([mu("#FFFFFF")],Qg.prototype,"fill",void 0),sg([vu("hide")],Qg.prototype,"overflow",void 0),Qg=sg([Ru()],Qg);var{moveTo:t_,closePath:e_,ellipse:i_}=Ec,n_=class extends jg{get __tag(){return"Ellipse"}__updatePath(){const t=this.__,{width:e,height:i,innerRadius:n,startAngle:r,endAngle:o}=t,s=e/2,a=i/2,l=t.path=[];let h;n?r||o?(n<1?i_(l,s,a,s*n,a*n,0,r,o,!1):h=!0,i_(l,s,a,s,a,0,o,r,!0)):(n<1&&(i_(l,s,a,s*n,a*n),t_(l,e,a)),i_(l,s,a,s,a,0,360,0,!0)):r||o?(t_(l,s,a),i_(l,s,a,s,a,0,r,o,!1)):i_(l,s,a,s,a),h||e_(l),($a.ellipseToCurve||t.__useArrow||t.cornerRadius)&&(t.path=this.getPath(!0))}};sg([Su(class extends Cg{get __boxStroke(){return!this.__pathInputed}})],n_.prototype,"__",void 0),sg([fu(0)],n_.prototype,"innerRadius",void 0),sg([fu(0)],n_.prototype,"startAngle",void 0),sg([fu(0)],n_.prototype,"endAngle",void 0),n_=sg([Ru()],n_);var{sin:r_,cos:o_,PI:s_}=Math,{moveTo:a_,lineTo:l_,closePath:h_,drawPoints:c_}=Ec,d_=class extends jg{get __tag(){return"Polygon"}__updatePath(){const t=this.__,e=t.path=[];if(t.points)c_(e,t.points,t.curve,t.closed);else{const{width:i,height:n,sides:r,startAngle:o}=t,s=i/2,a=n/2;let l,h=0;o?(h=o*Is,a_(e,s+s*r_(h),a-a*o_(h))):a_(e,s,0);for(let t=1;t<r;t++)l=2*t*s_/r+h,l_(e,s+s*r_(l),a-a*o_(l));h_(e)}}};sg([Su(class extends Tg{})],d_.prototype,"__",void 0),sg([fu(3)],d_.prototype,"sides",void 0),sg([fu(0)],d_.prototype,"startAngle",void 0),sg([fu()],d_.prototype,"points",void 0),sg([fu(0)],d_.prototype,"curve",void 0),d_=sg([Pu(),Ru()],d_);var{sin:u_,cos:p_,PI:f_}=Math,{moveTo:g_,lineTo:__,closePath:v_}=Ec,m_=class extends jg{get __tag(){return"Star"}__updatePath(){const{width:t,height:e,corners:i,innerRadius:n,startAngle:r}=this.__,o=t/2,s=e/2,a=this.__.path=[];let l,h=0;r?(h=r*Is,g_(a,o+o*u_(h),s-s*p_(h))):g_(a,o,0);for(let c=1;c<2*i;c++)l=c*f_/i+h,__(a,o+(c%2==0?o:o*n)*u_(l),s-(c%2==0?s:s*n)*p_(l));v_(a)}};sg([Su(class extends Cg{get __boxStroke(){return!this.__pathInputed}})],m_.prototype,"__",void 0),sg([fu(5)],m_.prototype,"corners",void 0),sg([fu(.382)],m_.prototype,"innerRadius",void 0),sg([fu(0)],m_.prototype,"startAngle",void 0),m_=sg([Ru()],m_);var{moveTo:y_,lineTo:x_,drawPoints:w_}=Ec,{rotate:b_,getAngle:S_,getDistance:k_,defaultPoint:E_}=aa,C_=class extends jg{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,i={x:0,y:0};return t&&(i.x=t),e&&b_(i,e),i}set toPoint(t){this.width=k_(E_,t),this.rotation=S_(E_,t),this.height&&(this.height=0)}__updatePath(){const t=this.__,e=t.path=[];t.points?w_(e,t.points,t.curve,t.closed):(y_(e,0,0),x_(e,this.width,0))}};sg([Su(Tg)],C_.prototype,"__",void 0),sg([gu("center")],C_.prototype,"strokeAlign",void 0),sg([uu(0)],C_.prototype,"height",void 0),sg([fu()],C_.prototype,"points",void 0),sg([fu(0)],C_.prototype,"curve",void 0),sg([fu(!1)],C_.prototype,"closed",void 0),C_=sg([Ru()],C_);var O_=class extends Xg{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return ds(t)&&t[0].image}};sg([Su(class extends Bg{get __urlType(){return"image"}setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.fill=t?{type:this.__urlType,mode:"stretch",url:t}:void 0}__getData(){const t=super.__getData();return t.url&&delete t.fill,t}__getInputData(t,e){const i=super.__getInputData(t,e);return i.url&&delete i.fill,i}})],O_.prototype,"__",void 0),sg([uu("")],O_.prototype,"url",void 0),O_=sg([Ru()],O_);var L_=class extends Xg{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=sl.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new iu({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new Ep(Ep.LOADED,{image:t}))})}draw(t,e,i,n){const r=new fa(t.worldTransform).invert(),o=new fa;e&&o.translate(e.x,e.y),i&&(cs(i)?o.scale(i):o.scale(i.x,i.y)),n&&o.rotate(n),r.multiplyParent(o),t.__render(this.canvas,{matrix:r.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:i,height:n}=this.__,{view:r}=this.canvas;t.drawImage(r,0,0,r.width,r.height,0,0,i,n)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e,safeResize:i}=this.__;t.resize(this.__,i),t.smooth!==e&&(t.smooth=e)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null),super.destroy()}};sg([Su(class extends Bg{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(t,e){const i=super.__getInputData(t,e);return i.url=this.__leaf.canvas.toDataURL("image/png"),i}})],L_.prototype,"__",void 0),sg([lg(100)],L_.prototype,"width",void 0),sg([lg(100)],L_.prototype,"height",void 0),sg([lg(1)],L_.prototype,"pixelRatio",void 0),sg([lg(!0)],L_.prototype,"smooth",void 0),sg([su(!1)],L_.prototype,"safeResize",void 0),sg([lg()],L_.prototype,"contextSettings",void 0),L_=sg([Ru()],L_);var{copyAndSpread:P_,includes:T_,spread:B_,setList:R_}=Wa,{stintSet:A_}=_s,M_=class extends jg{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:i,fontFamily:n,fontSize:r,fontWeight:o,italic:s,textCase:a,textOverflow:l,padding:h,width:c,height:d}=t;t.__lineHeight=dg.number(e,r),t.__letterSpacing=dg.number(i,r),t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*r)/2,t.__font=`${s?"italic ":""}${"small-caps"===a?"small-caps ":""}${"normal"!==o?o+" ":""}${r||12}px ${n||"caption"}`,A_(t,"__padding",h&&Ms.fourNumber(h)),A_(t,"__clipText","show"!==l&&!t.__autoSize),A_(t,"__isCharMode",c||d||t.__letterSpacing||"none"!==a),t.__textDrawData=hg.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:i,italic:n,padding:r,__autoWidth:o,__autoHeight:s}=t;this.__updateTextDrawData();const{bounds:a}=t.__textDrawData,l=e.boxBounds;if(e.contentBounds=a,t.__lineHeight<i&&B_(a,i/2),o||s){if(l.x=o?a.x:0,l.y=s?a.y:0,l.width=o?a.width:t.width,l.height=s?a.height:t.height,r){const[e,i,n,r]=t.__padding;o&&(l.x-=r,l.width+=i+r),s&&(l.y-=e,l.height+=n+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();n&&(l.width+=.16*i),_s.stintSet(this,"isOverflow",!T_(l,a)),this.isOverflow?(R_(t.__textBoxBounds={},[l,a]),e.renderChanged=!0):t.__textBoxBounds=l}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.isOverflow?1:0),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;P_(t,this.__.__textBoxBounds,e),this.__box&&(this.__box.__layout.renderBounds=t)}__updateChange(){super.__updateChange();const t=this.__box;t&&(t.__onUpdateSize(),t.__updateChange())}__drawRenderPath(t){t.font=this.__.__font}__draw(t,e,i){const n=this.__box;n&&(n.__nowWorld=this.__nowWorld,n.__draw(t,e,i)),this.textEditing&&!e.exporting||super.__draw(t,e,i)}__drawShape(t,e){e.shape&&this.__box&&this.__box.__drawShape(t,e),super.__drawShape(t,e)}destroy(){this.boxStyle&&(this.boxStyle=null),super.destroy()}};sg([Su(class extends Cg{get __useNaturalRatio(){return!1}setFontWeight(t){ls(t)?(this.__setInput("fontWeight",t),t=Rg[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,i=e.__box;if(t){const{boxStyle:n}=this;if(i)for(let t in n)i[t]=void 0;else i=e.__box=ll.get("Rect",0);const r=e.__layout,o=i.__layout;n||(i.parent=e,i.__world=e.__world,o.boxBounds=r.boxBounds),i.set(t),o.strokeChanged&&r.strokeChange()}else i&&(e.__box=i.parent=null,i.destroy());this._boxStyle=t}__getInputData(t,e){const i=super.__getInputData(t,e);return i.textEditing&&delete i.textEditing,i}})],M_.prototype,"__",void 0),sg([uu(0)],M_.prototype,"width",void 0),sg([uu(0)],M_.prototype,"height",void 0),sg([mu()],M_.prototype,"boxStyle",void 0),sg([su(!1)],M_.prototype,"resizeFontSize",void 0),sg([mu("#000000")],M_.prototype,"fill",void 0),sg([gu("outside")],M_.prototype,"strokeAlign",void 0),sg([bu("all")],M_.prototype,"hitFill",void 0),sg([uu("")],M_.prototype,"text",void 0),sg([uu("")],M_.prototype,"placeholder",void 0),sg([uu("caption")],M_.prototype,"fontFamily",void 0),sg([uu(12)],M_.prototype,"fontSize",void 0),sg([uu("normal")],M_.prototype,"fontWeight",void 0),sg([uu(!1)],M_.prototype,"italic",void 0),sg([uu("none")],M_.prototype,"textCase",void 0),sg([uu("none")],M_.prototype,"textDecoration",void 0),sg([uu(0)],M_.prototype,"letterSpacing",void 0),sg([uu({type:"percent",value:1.5})],M_.prototype,"lineHeight",void 0),sg([uu(0)],M_.prototype,"paraIndent",void 0),sg([uu(0)],M_.prototype,"paraSpacing",void 0),sg([uu("x")],M_.prototype,"writingMode",void 0),sg([uu("left")],M_.prototype,"textAlign",void 0),sg([uu("top")],M_.prototype,"verticalAlign",void 0),sg([uu(!0)],M_.prototype,"autoSizeAlign",void 0),sg([uu("normal")],M_.prototype,"textWrap",void 0),sg([uu("show")],M_.prototype,"textOverflow",void 0),sg([mu(!1)],M_.prototype,"textEditing",void 0),M_=sg([Ru()],M_);var D_=class extends jg{get __tag(){return"Path"}};sg([Su(class extends Cg{get __pathInputed(){return 2}})],D_.prototype,"__",void 0),sg([gu("center")],D_.prototype,"strokeAlign",void 0),D_=sg([Ru()],D_);var I_=class extends Hg{get __tag(){return"Pen"}setStyle(t){const e=this.pathElement=new D_(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}beginPath(){return this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,i,n,r,o){return this}quadraticCurveTo(t,e,i,n){return this}closePath(){return this}rect(t,e,i,n){return this}roundRect(t,e,i,n,r){return this}ellipse(t,e,i,n,r,o,s,a){return this}arc(t,e,i,n,r,o){return this}arcTo(t,e,i,n,r){return this}drawEllipse(t,e,i,n,r,o,s,a){return this}drawArc(t,e,i,n,r,o){return this}drawPoints(t,e,i){return this}clearPath(){return this}paint(){const{pathElement:t}=this;t.__layout.boxChanged||t.forceUpdate("path")}};function F_(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s}sg([Su(class extends Lg{})],I_.prototype,"__",void 0),sg([(t,e)=>{nu(t,e,{get(){return this.__path}})}],I_.prototype,"path",void 0),I_=sg([Bu(Vc,["set","path","paint"]),Ru()],I_);var W_=class extends Yg{get __tag(){return"App"}get isApp(){return!0}constructor(t,e){super(t,e)}init(t,e){if(super.init(t,e),t){const{ground:e,tree:i,sky:n,editor:r}=t;e&&(this.ground=this.addLeafer(e)),(i||r)&&(this.tree=this.addLeafer(i||{type:t.type||"design"})),(n||r)&&(this.sky=this.addLeafer(n)),r&&sl.editor(r,this)}}__setApp(){const{canvas:t}=this,{realCanvas:e,view:i}=this.config;e||i===this.canvas.view||!t.parentView?this.realCanvas=!0:t.unrealCanvas(),this.leafer=this,this.watcher.disable(),this.layouter.disable()}__updateLocalBounds(){this.forEach(t=>t.updateLayout()),super.__updateLocalBounds()}start(){super.start(),this.forEach(t=>t.start())}stop(){this.forEach(t=>t.stop()),super.stop()}unlockLayout(){super.unlockLayout(),this.forEach(t=>t.unlockLayout())}lockLayout(){super.lockLayout(),this.forEach(t=>t.lockLayout())}forceRender(t,e){this.forEach(i=>i.forceRender(t,e))}addLeafer(t){const e=new Yg(t);return this.add(e),e}add(t,e){if(!t.view){if(this.realCanvas&&!this.canvas.bounds)return void setTimeout(()=>this.add(t,e),10);t.init(this.__getChildConfig(t.userConfig),this)}super.add(t,e),ss(e)||(t.canvas.childIndex=e),this.__listenChildEvents(t)}forEach(t){this.children.forEach(t)}__onCreated(){this.created=this.children.every(t=>t.created)}__onReady(){this.children.every(t=>t.ready)&&super.__onReady()}__onViewReady(){this.children.every(t=>t.viewReady)&&super.__onViewReady()}__onChildRenderEnd(t){this.renderer.addBlock(t.renderBounds),this.viewReady&&this.renderer.update()}__render(t,e){t.context&&this.forEach(i=>e.matrix?i.__render(t,e):t.copyWorld(i.canvas,e.bounds,void 0,void 0,!0))}__onResize(t){this.forEach(e=>e.resize(t)),super.__onResize(t)}updateLayout(){this.forEach(t=>t.updateLayout())}__getChildConfig(t){const e=Object.assign({},this.config);return e.hittable=e.realCanvas=void 0,t&&_s.assign(e,t),this.autoLayout&&_s.copyAttrs(e,this,Ll),e.view=this.realCanvas?void 0:this.view,e.fill=void 0,e}__listenChildEvents(t){t.once([[Mp.END,this.__onReady,this],[Dp.START,this.__onCreated,this],[Dp.END,this.__onViewReady,this]]),this.realCanvas&&this.__eventIds.push(t.on_(Dp.END,this.__onChildRenderEnd,this))}};W_=F_([Ru()],W_);var z_={},N_={isHoldSpaceKey:()=>N_.isHold("Space"),isHold:t=>z_[t],isHoldKeys:(t,e)=>e?t(e):void 0,setDownCode(t){z_[t]||(z_[t]=!0)},setUpCode(t){z_[t]=!1}},j_={LEFT:1,RIGHT:2,MIDDLE:4,defaultLeft(t){t.buttons||(t.buttons=1)},left:t=>1===t.buttons,right:t=>2===t.buttons,middle:t=>4===t.buttons},V_=class extends xp{get spaceKey(){return N_.isHoldSpaceKey()}get left(){return j_.left(this)}get right(){return j_.right(this)}get middle(){return j_.middle(this)}constructor(t){super(t.type),this.bubbles=!0,Object.assign(this,t)}isHoldKeys(t){return N_.isHoldKeys(t,this)}getBoxPoint(t){return(t||this.current).getBoxPoint(this)}getInnerPoint(t){return(t||this.current).getInnerPoint(this)}getLocalPoint(t){return(t||this.current).getLocalPoint(this)}getPagePoint(){return this.current.getPagePoint(this)}getInner(t){return this.getInnerPoint(t)}getLocal(t){return this.getLocalPoint(t)}getPage(){return this.getPagePoint()}static changeName(t,e){dl.changeName(t,e)}},{min:H_,max:U_,abs:Y_}=Math,{float:X_,sign:G_}=Ms,{minX:K_,maxX:$_,minY:Z_,maxY:q_}=Wa,J_=new Va,Q_=new Va,tv={limitMove(t,e){const{dragBounds:i,dragBoundsType:n}=t;i&&ev.getValidMove(t.__localBoxBounds,ev.getDragBounds(t),n,e,!0),ev.axisMove(t,e)},limitScaleOf(t,e,i,n){const{dragBounds:r,dragBoundsType:o}=t;r&&ev.getValidScaleOf(t.__localBoxBounds,ev.getDragBounds(t),o,t.getLocalPointByInner(t.getInnerPointByBox(e)),i,n,!0)},axisMove(t,e){const{draggable:i}=t;"x"===i&&(e.y=0),"y"===i&&(e.x=0)},getDragBounds(t){const{dragBounds:e}=t;return"parent"===e?t.parent.boxBounds:e},isInnerMode:(t,e,i,n)=>"inner"===i||"auto"===i&&X_(t[n])>X_(e[n]),getValidMove(t,e,i,n,r){const o=t.x+n.x,s=t.y+n.y,a=o+t.width,l=s+t.height,h=e.x+e.width,c=e.y+e.height;return r||(n=Object.assign({},n)),ev.isInnerMode(t,e,i,"width")?o>e.x?n.x+=e.x-o:a<h&&(n.x+=h-a):o<e.x?n.x+=e.x-o:a>h&&(n.x+=h-a),ev.isInnerMode(t,e,i,"height")?s>e.y?n.y+=e.y-s:l<c&&(n.y+=c-l):s<e.y?n.y+=e.y-s:l>c&&(n.y+=c-l),n.x=X_(n.x),n.y=X_(n.y),n},getValidScaleOf(t,e,i,n,r,o,s){s||(r=Object.assign({},r)),Q_.set(e),J_.set(t).scaleOf(n,r.x,r.y);const a=(n.x-t.x)/t.width,l=1-a,h=(n.y-t.y)/t.height,c=1-h;let d,u,p,f,g=1,_=1;return ev.isInnerMode(t,e,i,"width")?(r.x<0&&J_.scaleOf(n,g=1/r.x,1),p=X_(J_.minX-Q_.minX),f=X_(Q_.maxX-J_.maxX),d=a&&p>0?1+p/(a*J_.width):1,u=l&&f>0?1+f/(l*J_.width):1,g*=U_(d,u)):(r.x<0&&((X_(K_(t)-K_(e))<=0||X_($_(e)-$_(t))<=0)&&J_.scaleOf(n,g=1/r.x,1),J_.unsign()),p=X_(Q_.minX-J_.minX),f=X_(J_.maxX-Q_.maxX),d=a&&p>0?1-p/(a*J_.width):1,u=l&&f>0?1-f/(l*J_.width):1,g*=H_(d,u)),ev.isInnerMode(t,e,i,"height")?(r.y<0&&J_.scaleOf(n,1,_=1/r.y),p=X_(J_.minY-Q_.minY),f=X_(Q_.maxY-J_.maxY),d=h&&p>0?1+p/(h*J_.height):1,u=c&&f>0?1+f/(c*J_.height):1,_*=U_(d,u),o&&(d=U_(Y_(g),Y_(_)),g=G_(g)*d,_=G_(_)*d)):(r.y<0&&((X_(Z_(t)-Z_(e))<=0||X_(q_(e)-q_(t))<=0)&&J_.scaleOf(n,1,_=1/r.y),J_.unsign()),p=X_(Q_.minY-J_.minY),f=X_(J_.maxY-Q_.maxY),d=h&&p>0?1-p/(h*J_.height):1,u=c&&f>0?1-f/(c*J_.height):1,_*=H_(d,u)),r.x*=hs(g)?g:1,r.y*=hs(_)?_:1,r}},ev=tv,iv=class extends V_{};iv.POINTER="pointer",iv.BEFORE_DOWN="pointer.before_down",iv.BEFORE_MOVE="pointer.before_move",iv.BEFORE_UP="pointer.before_up",iv.DOWN="pointer.down",iv.MOVE="pointer.move",iv.UP="pointer.up",iv.OVER="pointer.over",iv.OUT="pointer.out",iv.ENTER="pointer.enter",iv.LEAVE="pointer.leave",iv.TAP="tap",iv.DOUBLE_TAP="double_tap",iv.CLICK="click",iv.DOUBLE_CLICK="double_click",iv.LONG_PRESS="long_press",iv.LONG_TAP="long_tap",iv.MENU="pointer.menu",iv.MENU_TAP="pointer.menu_tap";iv=F_([Au()],iv);var nv={},rv=class extends iv{static setList(t){this.list=t instanceof rg?t:new rg(t)}static setData(t){this.data=t}static getValidMove(t,e,i,n=!0){const r=t.getLocalPoint(i,null,!0);return aa.move(r,e.x-t.x,e.y-t.y),n&&this.limitMove(t,r),tv.axisMove(t,r),r}static limitMove(t,e){tv.limitMove(t,e)}getPageMove(t){return this.assignMove(t),this.current.getPagePoint(nv,null,!0)}getInnerMove(t,e){return t||(t=this.current),this.assignMove(e),t.getInnerPoint(nv,null,!0)}getLocalMove(t,e){return t||(t=this.current),this.assignMove(e),t.getLocalPoint(nv,null,!0)}getPageTotal(){return this.getPageMove(!0)}getInnerTotal(t){return this.getInnerMove(t,!0)}getLocalTotal(t){return this.getLocalMove(t,!0)}getPageBounds(){const t=this.getPageTotal(),e=this.getPagePoint(),i={};return Wa.set(i,e.x-t.x,e.y-t.y,t.x,t.y),Wa.unsign(i),i}assignMove(t){nv.x=t?this.totalX:this.moveX,nv.y=t?this.totalY:this.moveY}};rv.BEFORE_DRAG="drag.before_drag",rv.START="drag.start",rv.DRAG="drag",rv.END="drag.end",rv.OVER="drag.over",rv.OUT="drag.out",rv.ENTER="drag.enter",rv.LEAVE="drag.leave",rv=F_([Au()],rv);var ov=class extends iv{static setList(t){rv.setList(t)}static setData(t){rv.setData(t)}};ov.DROP="drop",ov=F_([Au()],ov);var sv=class extends rv{};sv.BEFORE_MOVE="move.before_move",sv.START="move.start",sv.MOVE="move",sv.DRAG_ANIMATE="move.drag_animate",sv.END="move.end",sv.PULL_DOWN="move.pull_down",sv.REACH_BOTTOM="move.reach_bottom",sv=F_([Au()],sv);var av=class extends V_{};av=F_([Au()],av);var lv=class extends iv{};lv.BEFORE_ROTATE="rotate.before_rotate",lv.START="rotate.start",lv.ROTATE="rotate",lv.END="rotate.end",lv=F_([Au()],lv);var hv=class extends rv{};hv.SWIPE="swipe",hv.LEFT="swipe.left",hv.RIGHT="swipe.right",hv.UP="swipe.up",hv.DOWN="swipe.down",hv=F_([Au()],hv);var cv=class extends iv{};cv.BEFORE_ZOOM="zoom.before_zoom",cv.START="zoom.start",cv.ZOOM="zoom",cv.END="zoom.end",cv=F_([Au()],cv);var dv=class extends V_{};dv.BEFORE_DOWN="key.before_down",dv.BEFORE_UP="key.before_up",dv.DOWN="key.down",dv.HOLD="key.hold",dv.UP="key.up",dv=F_([Au()],dv);var uv={getDragEventData:(t,e,i)=>Object.assign(Object.assign({},i),{x:i.x,y:i.y,moveX:i.x-e.x,moveY:i.y-e.y,totalX:i.x-t.x,totalY:i.y-t.y}),getDropEventData:(t,e,i)=>Object.assign(Object.assign({},t),{list:e,data:i}),getSwipeDirection:t=>t<-45&&t>-135?hv.UP:t>45&&t<135?hv.DOWN:t<=45&&t>=-45?hv.RIGHT:hv.LEFT,getSwipeEventData:(t,e,i)=>Object.assign(Object.assign({},i),{moveX:e.moveX,moveY:e.moveY,totalX:i.x-t.x,totalY:i.y-t.y,type:pv.getSwipeDirection(aa.getAngle(t,i))}),getBase(t){const e=1===t.button?4:t.button;return{altKey:t.altKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,metaKey:t.metaKey,time:Date.now(),buttons:ss(t.buttons)?1:0===t.buttons?e:t.buttons,origin:t}},pathHasEventType(t,e){const{list:i}=t;for(let n=0,r=i.length;n<r;n++)if(i[n].hasEvent(e))return!0;return!1},filterPathByEventType(t,e){const i=new rg,{list:n}=t;for(let r=0,o=n.length;r<o;r++)n[r].hasEvent(e)&&i.add(n[r]);return i},pathCanDrag:t=>t&&t.list.some(t=>Yu.draggable(t)||!t.isLeafer&&t.hasEvent(rv.DRAG)),pathHasOutside:t=>t&&t.list.some(t=>t.isOutside)},pv=uv,fv=new rg,{getDragEventData:gv,getDropEventData:_v,getSwipeEventData:vv}=uv,mv=class{constructor(t){this.dragDataList=[],this.interaction=t}setDragData(t){this.animateWait&&this.dragEndReal(),this.downData=this.interaction.downData,this.dragData=gv(t,t,t),this.canAnimate=this.canDragOut=!0}getList(t,e){const{proxy:i}=this.interaction.selector,n=i&&i.list.length,r=rv.list||this.draggableList||fv;return this.dragging&&(n?t?fv:new rg(e?[...i.list,...i.dragHoverExclude]:i.list):r)}checkDrag(t,e){const{interaction:i}=this;if(this.moving&&t.buttons<1)return this.canAnimate=!1,void i.pointerCancel();!this.moving&&e&&(this.moving=i.canMove(this.downData)||i.isHoldRightKey||i.isMobileDragEmpty)&&(this.dragData.moveType="drag",i.emit(sv.START,this.dragData)),this.moving||this.dragStart(t,e),this.drag(t)}dragStart(t,e){this.dragging||(this.dragging=e&&j_.left(t),this.dragging&&(this.interaction.emit(rv.START,this.dragData),this.getDraggableList(this.dragData.path),this.setDragStartPoints(this.realDraggableList=this.getList(!0))))}setDragStartPoints(t){this.dragStartPoints={},t.forEach(t=>this.dragStartPoints[t.innerId]={x:t.x,y:t.y})}getDraggableList(t){let e;for(let i=0,n=t.length;i<n;i++)if(e=t.list[i],Yu.draggable(e)){this.draggableList=new rg(e);break}}drag(t){const{interaction:e,dragData:i,downData:n}=this,{path:r,throughPath:o}=n;this.dragData=gv(n,i,t),o&&(this.dragData.throughPath=o),this.dragData.path=r,this.dragDataList.push(this.dragData),this.moving?(t.moving=!0,this.dragData.moveType="drag",e.emit(sv.BEFORE_MOVE,this.dragData),e.emit(sv.MOVE,this.dragData)):this.dragging&&(t.dragging=!0,this.dragReal(),e.emit(rv.BEFORE_DRAG,this.dragData),e.emit(rv.DRAG,this.dragData))}dragReal(t){const{interaction:e}=this,{running:i}=e,n=this.realDraggableList;if(n.length&&i){const{totalX:i,totalY:r}=this.dragData,{dragLimitAnimate:o}=e.p,s=!o||!!t;n.forEach(e=>{if(e.draggable){const n=ls(e.draggable),a=rv.getValidMove(e,this.dragStartPoints[e.innerId],{x:i,y:r},s||n);o&&!n&&t?Yu.animateMove(e,a,cs(o)?o:.3):e.move(a)}})}}dragOverOrOut(t){const{interaction:e}=this,{dragOverPath:i}=this,{path:n}=t;this.dragOverPath=n,i?n.indexAt(0)!==i.indexAt(0)&&(e.emit(rv.OUT,t,i),e.emit(rv.OVER,t,n)):e.emit(rv.OVER,t,n)}dragEnterOrLeave(t){const{interaction:e}=this,{dragEnterPath:i}=this,{path:n}=t;e.emit(rv.LEAVE,t,i,n),e.emit(rv.ENTER,t,n,i),this.dragEnterPath=n}dragEnd(t){(this.dragging||this.moving)&&(this.checkDragEndAnimate(t)||this.dragEndReal(t))}dragEndReal(t){const{interaction:e,downData:i,dragData:n}=this;t||(t=n);const{path:r,throughPath:o}=i,s=gv(i,t,t);if(o&&(s.throughPath=o),s.path=r,this.moving&&(this.moving=!1,s.moveType="drag",e.emit(sv.END,s)),this.dragging){const r=this.getList();this.dragging=!1,e.p.dragLimitAnimate&&this.dragReal(!0),e.emit(rv.END,s),this.swipe(t,i,n,s),this.drop(t,r,this.dragEnterPath)}this.autoMoveCancel(),this.dragReset(),this.animate(null,"off")}swipe(t,e,i,n){const{interaction:r}=this;if(aa.getDistance(e,t)>r.config.pointer.swipeDistance){const t=vv(e,i,n);this.interaction.emit(t.type,t)}}drop(t,e,i){const n=_v(t,e,rv.data);n.path=i,this.interaction.emit(ov.DROP,n),this.interaction.emit(rv.LEAVE,t,i)}dragReset(){rv.list=rv.data=this.draggableList=this.dragData=this.downData=this.dragOverPath=this.dragEnterPath=null,this.dragDataList=[]}checkDragEndAnimate(t,e){return!1}animate(t,e){}stopAnimate(){}checkDragOut(t){}autoMoveOnDragOut(t){}autoMoveCancel(){}destroy(){this.dragReset()}},yv=Ja.get("emit"),xv=["move","zoom","rotate","key"];function wv(t,e,i,n,r){if(xv.some(t=>e.startsWith(t))&&t.__.hitChildren&&!Sv(t,r)){let o;for(let s=0,a=t.children.length;s<a;s++)o=t.children[s],!i.path.has(o)&&o.__.hittable&&bv(o,e,i,n,r)}}function bv(t,e,i,n,r){if(t.destroyed)return!1;if(t.__.hitSelf&&!Sv(t,r)&&(yg.updateEventStyle&&!n&&yg.updateEventStyle(t,e),t.hasEvent(e,n))){i.phase=n?1:t===i.target?2:3;const r=dl.get(e,i);if(t.emitEvent(r,n),r.isStop)return!0}return!1}function Sv(t,e){return e&&e.has(t)}var kv={wheel:{zoomSpeed:.5,moveSpeed:.5,rotateSpeed:.5,delta:{x:20,y:8}},pointer:{type:"pointer",snap:!0,hitRadius:5,tapTime:120,longPressTime:800,transformTime:500,hover:!0,dragHover:!0,dragDistance:2,swipeDistance:20},touch:{preventDefault:"auto"},multiTouch:{},move:{autoDistance:2},zoom:{},cursor:!0,keyEvent:!0},{pathHasEventType:Ev,pathCanDrag:Cv,pathHasOutside:Ov}=uv,Lv=class{get dragging(){return this.dragger.dragging}get transforming(){return this.transformer.transforming}get moveMode(){return!0===this.m.drag||this.isHoldSpaceKey||this.isHoldMiddleKey||this.isHoldRightKey&&this.dragger.moving||this.isDragEmpty}get canHover(){return this.p.hover&&!this.config.mobile}get isDragEmpty(){return this.m.dragEmpty&&this.isRootPath(this.hoverData)&&(!this.downData||this.isRootPath(this.downData))}get isMobileDragEmpty(){return this.m.dragEmpty&&!this.canHover&&this.downData&&this.isTreePath(this.downData)}get isHoldMiddleKey(){return this.m.holdMiddleKey&&this.downData&&j_.middle(this.downData)}get isHoldRightKey(){return this.m.holdRightKey&&this.downData&&j_.right(this.downData)}get isHoldSpaceKey(){return this.m.holdSpaceKey&&N_.isHoldSpaceKey()}get m(){return this.config.move}get p(){return this.config.pointer}get hitRadius(){return this.p.hitRadius}constructor(t,e,i,n){this.config=_s.clone(kv),this.tapCount=0,this.downKeyMap={},this.target=t,this.canvas=e,this.selector=i,this.defaultPath=new rg(t),this.createTransformer(),this.dragger=new mv(this),n&&(this.config=_s.default(n,this.config)),this.__listenEvents()}start(){this.running=!0}stop(){this.running=!1}receive(t){}pointerDown(t,e){t||(t=this.hoverData),t&&(j_.defaultLeft(t),this.updateDownData(t),this.checkPath(t,e),this.downTime=Date.now(),this.emit(iv.BEFORE_DOWN,t),t.path.needUpdate&&this.updateDownData(t),this.emit(iv.DOWN,t),j_.left(t)&&(this.tapWait(),this.longPressWait(t)),this.waitRightTap=j_.right(t),this.dragger.setDragData(t),this.isHoldRightKey||this.updateCursor(t))}pointerMove(t){if(t||(t=this.hoverData),!t)return;const{downData:e}=this;e&&j_.defaultLeft(t),(this.canvas.bounds.hitPoint(t)||e)&&(this.pointerMoveReal(t),e&&this.dragger.checkDragOut(t))}pointerMoveReal(t){if(this.emit(iv.BEFORE_MOVE,t,this.defaultPath),this.downData){const e=aa.getDistance(this.downData,t)>this.p.dragDistance;e&&(this.pointerWaitCancel(),this.waitRightTap=!1),this.dragger.checkDrag(t,e)}this.dragger.moving||(this.updateHoverData(t),this.checkPath(t),this.emit(iv.MOVE,t),this.pointerHover(t),this.dragging&&(this.dragger.dragOverOrOut(t),this.dragger.dragEnterOrLeave(t))),this.updateCursor(this.downData||t)}pointerUp(t){const{downData:e}=this;if(t||(t=e),!e)return;j_.defaultLeft(t),t.multiTouch=e.multiTouch,this.findPath(t);const i=Object.assign(Object.assign({},t),{path:t.path.clone()});t.path.addList(e.path.list),this.checkPath(t),this.downData=null,this.emit(iv.BEFORE_UP,t),this.emit(iv.UP,t),this.touchLeave(t),t.isCancel||(this.tap(t),this.menuTap(t)),this.dragger.dragEnd(t),this.updateCursor(i)}pointerCancel(){const t=Object.assign({},this.dragger.dragData);t.isCancel=!0,this.pointerUp(t)}menu(t){this.findPath(t),this.emit(iv.MENU,t),this.waitMenuTap=!0,!this.downData&&this.waitRightTap&&this.menuTap(t)}menuTap(t){this.waitRightTap&&this.waitMenuTap&&(this.emit(iv.MENU_TAP,t),this.waitRightTap=this.waitMenuTap=!1)}createTransformer(){}move(t){}zoom(t){}rotate(t){}transformEnd(){}wheel(t){}multiTouch(t,e){}keyDown(t){if(!this.config.keyEvent)return;this.emit(dv.BEFORE_DOWN,t,this.defaultPath);const{code:e}=t;this.downKeyMap[e]||(this.downKeyMap[e]=!0,N_.setDownCode(e),this.emit(dv.HOLD,t,this.defaultPath),this.moveMode&&(this.cancelHover(),this.updateCursor())),this.emit(dv.DOWN,t,this.defaultPath)}keyUp(t){if(!this.config.keyEvent)return;this.emit(dv.BEFORE_UP,t,this.defaultPath);const{code:e}=t;this.downKeyMap[e]=!1,N_.setUpCode(e),this.emit(dv.UP,t,this.defaultPath),"grab"===this.cursor&&this.updateCursor()}pointerHover(t){!this.canHover||this.dragging&&!this.p.dragHover||(t.path||(t.path=new rg),this.pointerOverOrOut(t),this.pointerEnterOrLeave(t))}pointerOverOrOut(t){const{path:e}=t,{overPath:i}=this;this.overPath=e,i?e.indexAt(0)!==i.indexAt(0)&&(this.emit(iv.OUT,t,i),this.emit(iv.OVER,t,e)):this.emit(iv.OVER,t,e)}pointerEnterOrLeave(t){let{path:e}=t;this.downData&&!this.moveMode&&(e=e.clone(),this.downData.path.forEach(t=>e.add(t)));const{enterPath:i}=this;this.enterPath=e,this.emit(iv.LEAVE,t,i,e),this.emit(iv.ENTER,t,e,i)}touchLeave(t){"touch"===t.pointerType&&this.enterPath&&(this.emit(iv.LEAVE,t),this.dragger.dragging&&this.emit(ov.LEAVE,t))}tap(t){const{pointer:e}=this.config,i=this.longTap(t);if(!e.tapMore&&i)return;if(!this.waitTap)return;e.tapMore&&this.emitTap(t);const n=Date.now()-this.downTime,r=[iv.DOUBLE_TAP,iv.DOUBLE_CLICK].some(e=>Ev(t.path,e));n<e.tapTime+50&&r?(this.tapCount++,2===this.tapCount?(this.tapWaitCancel(),this.emitDoubleTap(t)):(clearTimeout(this.tapTimer),this.tapTimer=setTimeout(()=>{e.tapMore||(this.tapWaitCancel(),this.emitTap(t))},e.tapTime))):e.tapMore||(this.tapWaitCancel(),this.emitTap(t))}findPath(t,e){const{hitRadius:i,through:n}=this.p,{bottomList:r,target:o}=this;$a.backgrounder||t.origin||o&&o.updateLayout();const s=this.selector.getByPoint(t,i,Object.assign({bottomList:r,name:t.type},e||{through:n}));return s.throughPath&&(t.throughPath=s.throughPath),t.path=s.path,s.path}isRootPath(t){return t&&t.path.list[0].isLeafer}isTreePath(t){const e=this.target.app;return!(!e||!e.isApp)&&e.editor&&!t.path.has(e.editor)&&t.path.has(e.tree)&&!t.target.syncEventer}checkPath(t,e){(e||this.moveMode&&!Ov(t.path))&&(t.path=this.defaultPath)}canMove(t){return t&&(this.moveMode||"auto"===this.m.drag&&!Cv(t.path))&&!Ov(t.path)}isDrag(t){return this.dragger.getList().has(t)}isPress(t){return this.downData&&this.downData.path.has(t)}isHover(t){return this.enterPath&&this.enterPath.has(t)}isFocus(t){return this.focusData===t}cancelHover(){const{hoverData:t}=this;t&&(t.path=this.defaultPath,this.pointerHover(t))}stopDragAnimate(){this.dragger.stopAnimate()}replaceDownTarget(t){const{downData:e}=this;if(e&&t){const{path:i}=e;i.remove(i.list[0]),i.addAt(t,0)}}updateDownData(t,e,i){const{downData:n}=this;!t&&n&&(t=n),t&&(this.findPath(t,e),i&&n&&t.path.addList(n.path.list),this.downData=t)}updateHoverData(t){t||(t=this.hoverData),t&&(this.findPath(t,{exclude:this.dragger.getList(!1,!0),name:iv.MOVE}),this.hoverData=t)}updateCursor(t){if(!this.config.cursor||!this.canHover)return;if(t||(this.updateHoverData(),t=this.downData||this.hoverData),this.dragger.moving)return this.setCursor("grabbing");if(this.canMove(t))return this.setCursor(this.downData?"grabbing":"grab");if(!t)return;let e,i;const{path:n}=t;for(let r=0,o=n.length;r<o&&(e=n.list[r],i=e.syncEventer&&e.syncEventer.cursor||e.cursor,!i);r++);this.setCursor(i)}setCursor(t){this.cursor=t}getLocal(t,e){const i=this.canvas.getClientBounds(e),n={x:t.clientX-i.x,y:t.clientY-i.y},{bounds:r}=this.canvas;return n.x*=r.width/i.width,n.y*=r.height/i.height,this.p.snap&&aa.round(n),n}emitTap(t){this.emit(iv.TAP,t),this.emit(iv.CLICK,t)}emitDoubleTap(t){this.emit(iv.DOUBLE_TAP,t),this.emit(iv.DOUBLE_CLICK,t)}pointerWaitCancel(){this.tapWaitCancel(),this.longPressWaitCancel()}tapWait(){clearTimeout(this.tapTimer),this.waitTap=!0}tapWaitCancel(){this.waitTap&&(clearTimeout(this.tapTimer),this.waitTap=!1,this.tapCount=0)}longPressWait(t){clearTimeout(this.longPressTimer),this.longPressTimer=setTimeout(()=>{this.longPressed=!0,this.emit(iv.LONG_PRESS,t)},this.p.longPressTime)}longTap(t){let e;return this.longPressed&&(this.emit(iv.LONG_TAP,t),(Ev(t.path,iv.LONG_TAP)||Ev(t.path,iv.LONG_PRESS))&&(e=!0)),this.longPressWaitCancel(),e}longPressWaitCancel(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressed=!1)}__onResize(){const{dragOut:t}=this.m;this.shrinkCanvasBounds=new Va(this.canvas.bounds),this.shrinkCanvasBounds.spread(-(cs(t)?t:2))}__listenEvents(){const{target:t}=this;this.__eventIds=[t.on_(Rp.RESIZE,this.__onResize,this)],t.once(Ip.READY,()=>this.__onResize())}__removeListenEvents(){this.target.off_(this.__eventIds),this.__eventIds.length=0}emit(t,e,i,n){this.running&&function(t,e,i,n){if(!i&&!e.path)return;let r;e.type=t,i?e=Object.assign(Object.assign({},e),{path:i}):i=e.path,e.target=i.indexAt(0);try{for(let o=i.length-1;o>-1;o--){if(r=i.list[o],bv(r,t,e,!0,n))return;r.isApp&&wv(r,t,e,!0,n)}for(let o=0,s=i.length;o<s;o++)if(r=i.list[o],r.isApp&&wv(r,t,e,!1,n),bv(r,t,e,!1,n))return}catch(t){yv.error(t)}}(t,e,i,n)}destroy(){this.__eventIds.length&&(this.stop(),this.__removeListenEvents(),this.dragger.destroy(),this.transformer&&this.transformer.destroy(),this.downData=this.overPath=this.enterPath=null)}},Pv=class{static set(t,e){this.custom[t]=e}static get(t){return this.custom[t]}};Pv.custom={};var Tv=class extends pl{constructor(){super(...arguments),this.maxTotal=1e3,this.pathList=new rg,this.pixelList=new rg}getPixelType(t,e){return this.__autoClear(),this.pixelList.add(t),sl.hitCanvas(e)}getPathType(t){return this.__autoClear(),this.pathList.add(t),sl.hitCanvas()}clearImageType(){this.__clearLeafList(this.pixelList)}clearPathType(){this.__clearLeafList(this.pathList)}__clearLeafList(t){t.length&&(t.forEach(t=>{t.__hitCanvas&&(t.__hitCanvas.destroy(),t.__hitCanvas=null)}),t.reset())}__autoClear(){this.pathList.length+this.pixelList.length>this.maxTotal&&this.clear()}clear(){this.clearPathType(),this.clearImageType()}};$a.getSelector=function(t){return t.leafer?t.leafer.selector:$a.selector||($a.selector=sl.selector())};var{toInnerRadiusPointOf:Bv,copyRadiusPoint:Rv}=aa,{hitRadiusPoint:Av,hitPoint:Mv}=Wa,Dv={},Iv={},Fv=Gf.prototype;Fv.hit=function(t,e=0){this.updateLayout(),Rv(Iv,t,e);const i=this.__world;return!!(e?Av(i,Iv):Mv(i,Iv))&&(this.isBranch?$a.getSelector(this).hitPoint(Object.assign({},Iv),e,{target:this}):this.__hitWorld(Iv))},Fv.__hitWorld=function(t,e){const i=this.__;if(!i.hitSelf)return!1;const n=this.__world,r=this.__layout,o=n.width<10&&n.height<10;if(i.hitRadius&&(Rv(Dv,t,i.hitRadius),t=Dv),Bv(t,n,Dv),i.hitBox||o){if(Wa.hitRadiusPoint(r.boxBounds,Dv))return!0;if(o)return!1}return!r.hitCanvasChanged&&this.__hitCanvas||(this.__updateHitCanvas(),r.boundsChanged||(r.hitCanvasChanged=!1)),this.__hit(Dv,e)},Fv.__hitFill=function(t){const e=this.__hitCanvas;return e&&e.hitFill(t,this.__.windingRule)},Fv.__hitStroke=function(t,e){const i=this.__hitCanvas;return i&&i.hitStroke(t,e)},Fv.__hitPixel=function(t){const e=this.__hitCanvas;return e&&e.hitPixel(t,this.__layout.renderBounds,e.hitScale)},Fv.__drawHitPath=function(t){t&&this.__drawRenderPath(t)};var Wv=new fa,zv=jg.prototype;zv.__updateHitCanvas=function(){this.__box&&this.__box.__updateHitCanvas();const{hitCanvasManager:t}=this.leafer||this.parent&&this.parent.leafer||{};if(!t)return;const e=this.__,i=(e.__isAlphaPixelFill||e.__isCanvas)&&"pixel"===e.hitFill,n=e.__isAlphaPixelStroke&&"pixel"===e.hitStroke,r=i||n;this.__hitCanvas||(this.__hitCanvas=r?t.getPixelType(this,{contextSettings:{willReadFrequently:!0}}):t.getPathType(this));const o=this.__hitCanvas;if(r){const{renderBounds:t}=this.__layout,r=$a.image.hitCanvasSize,s=o.hitScale=Ha.set(0,0,r,r).getFitMatrix(t).a,{x:a,y:l,width:h,height:c}=Ha.set(t).scale(s);o.resize({width:h,height:c,pixelRatio:1}),o.clear(),Jd.patternLocked=!0,this.__renderShape(o,{matrix:Wv.setWith(this.__world).scaleWith(1/s).invertWith().translate(-a,-l),snapshot:!0,ignoreFill:!i,ignoreStroke:!n}),Jd.patternLocked=!1,o.resetTransform(),e.__isHitPixel=!0}else e.__isHitPixel&&(e.__isHitPixel=!1);this.__drawHitPath(o),o.setStrokeOptions(e)},zv.__hit=function(t,e){if(this.__box&&this.__box.__hit(t))return!0;const i=this.__;if(i.__isHitPixel&&this.__hitPixel(t))return!0;const{hitFill:n}=i,r=(i.fill||i.__isCanvas)&&("path"===n||"pixel"===n&&!(i.__isAlphaPixelFill||i.__isCanvas))||"all"===n||e;if(r&&this.__hitFill(t))return!0;const{hitStroke:o,__maxStrokeWidth:s}=i,a=i.stroke&&("path"===o||"pixel"===o&&!i.__isAlphaPixelStroke)||"all"===o;if(!r&&!a)return!1;const l=2*t.radiusX;let h=l;if(a)switch(i.strokeAlign){case"inside":if(h+=2*s,!r&&this.__hitFill(t)&&this.__hitStroke(t,h))return!0;h=l;break;case"center":h+=s;break;case"outside":if(h+=2*s,!r){if(!this.__hitFill(t)&&this.__hitStroke(t,h))return!0;h=l}}return!!h&&this.__hitStroke(t,h)};var Nv=jg.prototype,jv=Xg.prototype,Vv=Jg.prototype;jv.__updateHitCanvas=Vv.__updateHitCanvas=function(){this.stroke||this.cornerRadius||(this.fill||this.__.__isCanvas)&&"pixel"===this.hitFill||"all"===this.hitStroke?Nv.__updateHitCanvas.call(this):this.__hitCanvas&&(this.__hitCanvas=null)},jv.__hitFill=Vv.__hitFill=function(t){return this.__hitCanvas?Nv.__hitFill.call(this,t):Wa.hitRadiusPoint(this.__layout.boxBounds,t)},M_.prototype.__drawHitPath=function(t){const{__lineHeight:e,fontSize:i,__baseLine:n,__letterSpacing:r,__textDrawData:o}=this.__;t.beginPath(),r<0?this.__drawPathByBox(t):o.rows.forEach(r=>t.rect(r.x,r.y-n,r.width,e<i?i:e))},Hg.prototype.pick=function(t,e){return e||(e=os),this.updateLayout(),$a.getSelector(this).getByPoint(t,e.hitRadius||0,Object.assign(Object.assign({},e),{target:this}))};var Hv,Uv=Pl.prototype;function Yv(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(s,a)}l((n=n.apply(t,e||[])).next())})}Uv.hitFill=function(t,e){return e?this.context.isPointInPath(t.x,t.y,e):this.context.isPointInPath(t.x,t.y)},Uv.hitStroke=function(t,e){return this.strokeWidth=e,this.context.isPointInStroke(t.x,t.y)},Uv.hitPixel=function(t,e,i=1){let{x:n,y:r,radiusX:o,radiusY:s}=t;e&&(n-=e.x,r-=e.y),Ha.set(n-o,r-s,2*o,2*s).scale(i).ceil();const{data:a}=this.context.getImageData(Ha.x,Ha.y,Ha.width||1,Ha.height||1);for(let l=0,h=a.length;l<h;l+=4)if(a[l+3]>0)return!0;return a[3]>0},function(t){t[t.none=1]="none",t[t.free=2]="free",t[t.mirrorAngle=3]="mirrorAngle",t[t.mirror=4]="mirror"}(Hv||(Hv={}));var Xv=Ja.get("LeaferCanvas"),Gv=class extends Pl{set zIndex(t){const{style:e}=this.view;e.zIndex=t,this.setAbsolute(this.view)}set childIndex(t){const{view:e,parentView:i}=this;if(e&&i){const n=i.children[t];n?(this.setAbsolute(n),i.insertBefore(e,n)):i.appendChild(n)}}init(){const{config:t}=this,e=t.view||t.canvas;e?this.__createViewFrom(e):this.__createView();const{style:i}=this.view;if(i.display||(i.display="block"),this.parentView=this.view.parentElement,this.parentView){const t=this.parentView.style;t.webkitUserSelect=t.userSelect="none",this.view.classList.add("leafer-canvas-view")}$a.syncDomFont&&!this.parentView&&(i.display="none",document.body&&document.body.appendChild(this.view)),this.__createContext(),this.autoLayout||this.resize(t)}set backgroundColor(t){this.view.style.backgroundColor=t}get backgroundColor(){return this.view.style.backgroundColor}set hittable(t){this.view.style.pointerEvents=t?"auto":"none"}get hittable(){return"none"!==this.view.style.pointerEvents}__createView(){this.view=document.createElement("canvas")}__createViewFrom(t){let e=ls(t)?document.getElementById(t):t;if(e)if(e instanceof HTMLCanvasElement)this.view=e;else{let t=e;if(e===window||e===document){const e=document.createElement("div"),{style:i}=e;i.position="absolute",i.top=i.bottom=i.left=i.right="0px",document.body.appendChild(e),t=e}this.__createView();const i=this.view;t.hasChildNodes()&&(this.setAbsolute(i),t.style.position||(t.style.position="relative")),t.appendChild(i)}else Xv.error(`no id: ${t}`),this.__createView()}setAbsolute(t){const{style:e}=t;e.position="absolute",e.top=e.left="0px"}updateViewSize(){const{width:t,height:e,pixelRatio:i}=this,{style:n}=this.view;n.width=t+"px",n.height=e+"px",this.unreal||(this.view.width=Math.ceil(t*i),this.view.height=Math.ceil(e*i))}updateClientBounds(){this.view.parentElement&&(this.clientBounds=this.view.getBoundingClientRect())}startAutoLayout(t,e){if(this.resizeListener=e,t){if(this.autoBounds=t,this.resizeObserver)return;try{this.resizeObserver=new ResizeObserver(t=>{this.updateClientBounds();for(const e of t)this.checkAutoBounds(e.contentRect)});const t=this.parentView;t?(this.resizeObserver.observe(t),this.checkAutoBounds(t.getBoundingClientRect())):(this.checkAutoBounds(this.view),Xv.warn("no parent"))}catch(t){this.imitateResizeObserver()}this.stopListenPixelRatio()}else this.listenPixelRatio(),this.unreal&&this.updateViewSize()}imitateResizeObserver(){this.autoLayout&&(this.parentView&&this.checkAutoBounds(this.parentView.getBoundingClientRect()),$a.requestRender(this.imitateResizeObserver.bind(this)))}listenPixelRatio(){this.windowListener||window.addEventListener("resize",this.windowListener=()=>{const t=$a.devicePixelRatio;if(!this.config.pixelRatio&&this.pixelRatio!==t){const{width:e,height:i}=this;this.emitResize({width:e,height:i,pixelRatio:t})}})}stopListenPixelRatio(){this.windowListener&&(window.removeEventListener("resize",this.windowListener),this.windowListener=null)}checkAutoBounds(t){const e=this.view,{x:i,y:n,width:r,height:o}=this.autoBounds.getBoundsFrom(t),s={width:r,height:o,pixelRatio:this.config.pixelRatio?this.pixelRatio:$a.devicePixelRatio};if(!this.isSameSize(s)){const{style:t}=e;t.marginLeft=i+"px",t.marginTop=n+"px",this.emitResize(s)}}stopAutoLayout(){this.autoLayout=!1,this.resizeObserver&&this.resizeObserver.disconnect(),this.resizeListener=this.resizeObserver=null}emitResize(t){const e={};_s.copyAttrs(e,this,Ll),this.resize(t),this.resizeListener&&!ss(this.width)&&this.resizeListener(new Rp(t,e))}unrealCanvas(){if(!this.unreal&&this.parentView){let t=this.view;t&&t.remove(),t=this.view=document.createElement("div"),this.parentView.appendChild(this.view),t.classList.add("leafer-app-view"),this.unreal=!0}}destroy(){const{view:t}=this;t&&(this.stopAutoLayout(),this.stopListenPixelRatio(),t.parentElement&&t.remove(),super.destroy())}};Hd(CanvasRenderingContext2D.prototype),Hd(Path2D.prototype),Object.assign(sl,{canvas:(t,e)=>new Gv(t,e),image:t=>new iu(t)}),$a.name="web",$a.isMobile="ontouchstart"in window,$a.requestRender=function(t){window.requestAnimationFrame(t)},nu($a,"devicePixelRatio",{get:()=>devicePixelRatio});var{userAgent:Kv}=navigator;Kv.indexOf("Firefox")>-1?($a.intWheelDeltaY=!0,$a.syncDomFont=!0):(/iPhone|iPad|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent))&&($a.fullImageShadow=!0),Kv.indexOf("Windows")>-1?($a.os="Windows",$a.intWheelDeltaY=!0):Kv.indexOf("Mac")>-1?$a.os="Mac":Kv.indexOf("Linux")>-1&&($a.os="Linux");var $v=class{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove&&this.config.usePartLayout){const t=new rg;return this.__updatedList.list.forEach(e=>{e.leafer&&t.add(e)}),t}return this.__updatedList}constructor(t,e){this.totalTimes=0,this.config={},this.__updatedList=new rg,this.target=t,e&&(this.config=_s.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}update(){this.changed=!0,this.running&&this.target.emit(Dp.REQUEST)}__onAttrChange(t){this.config.usePartLayout&&this.__updatedList.add(t.target),this.update()}__onChildEvent(t){this.config.usePartLayout&&(t.type===wp.ADD?(this.hasAdd=!0,this.__pushChild(t.child)):(this.hasRemove=!0,this.__updatedList.add(t.parent))),this.update()}__pushChild(t){this.__updatedList.add(t),t.isBranch&&this.__loopChildren(t)}__loopChildren(t){const{children:e}=t;for(let i=0,n=e.length;i<n;i++)this.__pushChild(e[i])}__onRquestData(){this.target.emitEvent(new Ap(Ap.DATA,{updatedList:this.updatedList})),this.__updatedList=new rg,this.totalTimes++,this.changed=this.hasVisible=this.hasRemove=this.hasAdd=!1}__listenEvents(){this.__eventIds=[this.target.on_([[Sp.CHANGE,this.__onAttrChange,this],[[wp.ADD,wp.REMOVE],this.__onChildEvent,this],[Ap.REQUEST,this.__onRquestData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.__updatedList=null)}},{updateAllMatrix:Zv,updateBounds:qv,updateChange:Jv}=Yu,{pushAllChildBranch:Qv,pushAllParent:tm}=np,{worldBounds:em}=tp,im=class{constructor(t){this.updatedBounds=new Va,this.beforeBounds=new Va,this.afterBounds=new Va,ds(t)&&(t=new rg(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,em)}setAfter(){this.afterBounds.setListWithFn(this.updatedList.list,em),this.updatedBounds.setList([this.beforeBounds,this.afterBounds])}merge(t){this.updatedList.addList(t.updatedList.list),this.beforeBounds.add(t.beforeBounds),this.afterBounds.add(t.afterBounds),this.updatedBounds.add(t.updatedBounds)}destroy(){this.updatedList=null}},{updateAllMatrix:nm,updateAllChange:rm}=Yu,om=Ja.get("Layouter"),sm=class t{constructor(t,e){this.totalTimes=0,this.config={usePartLayout:!0},this.__levelList=new og,this.target=t,e&&(this.config=_s.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}layout(){if(this.layouting||!this.running)return;const{target:t}=this;this.times=0;try{t.emit(Mp.START),this.layoutOnce(),t.emitEvent(new Mp(Mp.END,this.layoutedBlocks,this.times))}catch(t){om.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?om.warn("layouting"):this.times>3?om.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit(Ap.REQUEST),this.totalTimes>1&&this.config.usePartLayout?this.partLayout():this.fullLayout(),this.layouting=!1,void(this.waitAgain&&(this.waitAgain=!1,this.layoutOnce())))}partLayout(){var t;if(!(null===(t=this.__updatedList)||void 0===t?void 0:t.length))return;const e=il.start("PartLayout"),{target:i,__updatedList:n}=this,{BEFORE:r,LAYOUT:o,AFTER:s}=Mp,a=this.getBlocks(n);a.forEach(t=>t.setBefore()),i.emitEvent(new Mp(r,a,this.times)),this.extraBlock=null,n.sort(),function(t,e){let i;t.list.forEach(t=>{i=t.__layout,e.without(t)&&!i.proxyZoom&&(i.matrixChanged?(Zv(t,!0),e.add(t),t.isBranch&&Qv(t,e),tm(t,e)):i.boundsChanged&&(e.add(t),t.isBranch&&(t.__tempNumber=0),tm(t,e)))})}(n,this.__levelList),function(t){let e,i,n;t.sort(!0),t.levels.forEach(r=>{e=t.levelMap[r];for(let t=0,o=e.length;t<o;t++){if(i=e[t],i.isBranch&&i.__tempNumber){n=i.children;for(let t=0,e=n.length;t<e;t++)n[t].isBranch||qv(n[t])}qv(i)}})}(this.__levelList),function(t){t.list.forEach(Jv)}(n),this.extraBlock&&a.push(this.extraBlock),a.forEach(t=>t.setAfter()),i.emitEvent(new Mp(o,a,this.times)),i.emitEvent(new Mp(s,a,this.times)),this.addBlocks(a),this.__levelList.reset(),this.__updatedList=null,il.end(e)}fullLayout(){const e=il.start("FullLayout"),{target:i}=this,{BEFORE:n,LAYOUT:r,AFTER:o}=Mp,s=this.getBlocks(new rg(i));i.emitEvent(new Mp(n,s,this.times)),t.fullLayout(i),s.forEach(t=>{t.setAfter()}),i.emitEvent(new Mp(r,s,this.times)),i.emitEvent(new Mp(o,s,this.times)),this.addBlocks(s),il.end(e)}static fullLayout(t){nm(t,!0),t.isBranch?np.updateBounds(t):Yu.updateBounds(t),rm(t)}addExtra(t){if(!this.__updatedList.has(t)){const{updatedList:e,beforeBounds:i}=this.extraBlock||(this.extraBlock=new im([]));e.length?i.add(t.__world):i.set(t.__world),e.add(t)}}createBlock(t){return new im(t)}getBlocks(t){return[this.createBlock(t)]}addBlocks(t){this.layoutedBlocks?this.layoutedBlocks.push(...t):this.layoutedBlocks=t}__onReceiveWatchData(t){this.__updatedList=t.data.updatedList}__listenEvents(){this.__eventIds=[this.target.on_([[Mp.REQUEST,this.layout,this],[Mp.AGAIN,this.layoutAgain,this],[Ap.DATA,this.__onReceiveWatchData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}},am=Ja.get("Renderer"),lm=class t{get needFill(){return!(this.canvas.allowBackgroundColor||!this.config.fill)}constructor(t,e,i){this.FPS=60,this.totalTimes=0,this.times=0,this.config={usePartRender:!0,ceilPartPixel:!0,maxFPS:120},this.frames=[],this.target=t,this.canvas=e,i&&(this.config=_s.default(i,this.config)),this.__listenEvents()}start(){this.running=!0,this.update(!1)}stop(){this.running=!1}update(t=!0){this.changed||(this.changed=t),this.requestTime||this.__requestRender()}requestLayout(){this.target.emit(Mp.REQUEST)}checkRender(){if(this.running){const{target:t}=this;t.isApp&&(t.emit(Dp.CHILD_START,t),t.children.forEach(t=>{t.renderer.FPS=this.FPS,t.renderer.checkRender()}),t.emit(Dp.CHILD_END,t)),this.changed&&this.canvas.view&&this.render(),this.target.emit(Dp.NEXT)}}render(t){if(!this.running||!this.canvas.view)return this.update();const{target:e}=this;this.times=0,this.totalBounds=new Va,am.log(e.innerName,"---\x3e");try{this.emitRender(Dp.START),this.renderOnce(t),this.emitRender(Dp.END,this.totalBounds),Jd.clearRecycled()}catch(t){this.rendering=!1,am.error(t)}am.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return am.warn("rendering");if(this.times>3)return am.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new Va,this.renderOptions={},t)this.emitRender(Dp.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(Dp.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(Dp.RENDER,this.renderBounds,this.renderOptions),this.emitRender(Dp.AFTER,this.renderBounds,this.renderOptions),this.updateBlocks=null,this.rendering=!1,this.waitAgain&&(this.waitAgain=!1,this.renderOnce())}partRender(){const{canvas:t,updateBlocks:e}=this;e&&(this.mergeBlocks(),e.forEach(e=>{t.bounds.hit(e)&&!e.isEmpty()&&this.clipRender(e)}))}clipRender(e){const i=il.start("PartRender"),{canvas:n}=this,r=e.getIntersect(n.bounds),o=new Va(r);n.save(),r.spread(t.clipSpread).ceil();const{ceilPartPixel:s}=this.config;n.clipWorld(r,s),n.clearWorld(r,s),this.__render(r,o),n.restore(),il.end(i)}fullRender(){const t=il.start("FullRender"),{canvas:e}=this;e.save(),e.clear(),this.__render(e.bounds),e.restore(),il.end(t)}__render(t,e){const{canvas:i,target:n}=this,r=t.includes(n.__world),o=r?{includes:r}:{bounds:t,includes:r};this.needFill&&i.fillWorld(t,this.config.fill),Ja.showRepaint&&Ja.drawRepaint(i,t),this.config.useCellRender&&(o.cellList=this.getCellList()),$a.render(n,i,o),this.renderBounds=e=e||t,this.renderOptions=o,this.totalBounds.isEmpty()?this.totalBounds=e:this.totalBounds.add(e),i.updateRender(e)}getCellList(){}addBlock(t,e){this.updateBlocks||(this.updateBlocks=[]),this.updateBlocks.push(t)}mergeBlocks(){const{updateBlocks:t}=this;if(t){const e=new Va;e.setList(t),t.length=0,t.push(e)}}__requestRender(){const t=this.target;if(this.requestTime||!t)return;if(t.parentApp)return t.parentApp.requestRender(!1);this.requestTime=this.frameTime||Date.now();const e=()=>{const t=1e3/((this.frameTime=Date.now())-this.requestTime),{maxFPS:i}=this.config;if(i&&t>i)return $a.requestRender(e);const{frames:n}=this;n.length>30&&n.shift(),n.push(t),this.FPS=Math.round(n.reduce((t,e)=>t+e,0)/n.length),this.requestTime=0,this.checkRender()};$a.requestRender(e)}__onResize(t){if(!this.canvas.unreal){if(t.bigger||!t.samePixelRatio){const{width:e,height:i}=t.old;if(!new Va(0,0,e,i).includes(this.target.__world)||this.needFill||!t.samePixelRatio)return this.addBlock(this.canvas.bounds),void this.target.forceUpdate("surface")}this.addBlock(new Va(0,0,1,1)),this.update()}}__onLayoutEnd(t){t.data&&t.data.map(t=>{let e;const{updatedList:i}=t;i&&i.list.some(t=>(e=!t.__world.width||!t.__world.height,e&&(t.isLeafer||am.tip(t.innerName,": empty"),e=!t.isBranch||t.isBranchLeaf),e)),this.addBlock(e?this.canvas.bounds:t.updatedBounds,i)})}emitRender(t,e,i){this.target.emitEvent(new Dp(t,this.times,e,i))}__listenEvents(){this.__eventIds=[this.target.on_([[Dp.REQUEST,this.update,this],[Mp.END,this.__onLayoutEnd,this],[Dp.AGAIN,this.renderAgain,this],[Rp.RESIZE,this.__onResize,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.config={},this.target=this.canvas=null)}};lm.clipSpread=10;var hm={},{copyRadiusPoint:cm}=aa,{hitRadiusPoint:dm}=Wa,um=class{constructor(t,e){this.target=t,this.selector=e}getByPoint(t,e,i){e||(e=0),i||(i={});const n=i.through||!1,r=i.ignoreHittable||!1,o=i.target||this.target;this.exclude=i.exclude||null,this.point={x:t.x,y:t.y,radiusX:e,radiusY:e},this.findList=new rg(i.findList),i.findList||this.hitBranch(o.isBranchLeaf?{children:[o]}:o);const{list:s}=this.findList,a=this.getBestMatchLeaf(s,i.bottomList,r,!!i.findList),l=r?this.getPath(a):this.getHitablePath(a);return this.clear(),n?{path:l,target:a,throughPath:s.length?this.getThroughPath(s):l}:{path:l,target:a}}hitPoint(t,e,i){return!!this.getByPoint(t,e,i).target}getBestMatchLeaf(t,e,i,n){const r=this.findList=new rg;if(t.length){let e;const{x:n,y:o}=this.point,s={x:n,y:o,radiusX:0,radiusY:0};for(let a=0,l=t.length;a<l;a++)if(e=t[a],(i||Yu.worldHittable(e))&&(this.hitChild(e,s),r.length)){if(e.isBranchLeaf&&t.some(t=>t!==e&&Yu.hasParent(t,e))){r.reset();break}return r.list[0]}}if(e)for(let o=0,s=e.length;o<s;o++)if(this.hitChild(e[o].target,this.point,e[o].proxy),r.length)return r.list[0];return n?null:i?t[0]:t.find(t=>Yu.worldHittable(t))}getPath(t){const e=new rg,i=[],{target:n}=this;for(;t&&(t.syncEventer&&i.push(t.syncEventer),e.add(t),(t=t.parent)!==n););return i.length&&i.forEach(t=>{for(;t&&(t.__.hittable&&e.add(t),(t=t.parent)!==n););}),n&&e.add(n),e}getHitablePath(t){const e=this.getPath(t&&t.hittable?t:null);let i,n=new rg;for(let r=e.list.length-1;r>-1&&(i=e.list[r],i.__.hittable)&&(n.addAt(i,0),i.__.hitChildren&&(!i.isLeafer||"draw"!==i.mode));r--);return n}getThroughPath(t){const e=new rg,i=[];for(let s=t.length-1;s>-1;s--)i.push(this.getPath(t[s]));let n,r,o;for(let s=0,a=i.length;s<a;s++){n=i[s],r=i[s+1];for(let t=0,i=n.length;t<i&&(o=n.list[t],!r||!r.has(o));t++)e.add(o)}return e}hitBranch(t){this.eachFind(t.children,t.__onlyHitMask)}eachFind(t,e){let i,n,r;const{point:o}=this;for(let s=t.length-1;s>-1;s--)if(i=t[s],r=i.__,r.visible&&(!e||r.mask))if(n=dm(i.__world,r.hitRadius?cm(hm,o,r.hitRadius):o),i.isBranch){if(n||i.__ignoreHitWorld){if(i.isBranchLeaf&&r.__clipAfterFill&&!i.__hitWorld(o,!0))continue;i.topChildren&&this.eachFind(i.topChildren,!1),this.eachFind(i.children,i.__onlyHitMask),i.isBranchLeaf&&this.hitChild(i,o)}}else n&&this.hitChild(i,o)}hitChild(t,e,i){if((!this.exclude||!this.exclude.has(t))&&t.__hitWorld(e)){const{parent:n}=t;if(n&&n.__hasMask&&!t.__.mask){let i,r=[];const{children:o}=n;for(let n=0,s=o.length;n<s;n++)if(i=o[n],i.__.mask&&r.push(i),i===t){if(r&&!r.every(t=>t.__hitWorld(e)))return;break}}this.findList.add(i||t)}}clear(){this.point=null,this.findList=null,this.exclude=null}destroy(){this.clear()}},pm=class{constructor(t,e){this.config={},e&&(this.config=_s.default(e,this.config)),this.picker=new um(this.target=t,this),this.finder=sl.finder&&sl.finder(t,this.config)}getByPoint(t,e,i){const{target:n,picker:r}=this;return $a.backgrounder&&n&&n.updateLayout(),r.getByPoint(t,e,i)}hitPoint(t,e,i){return this.picker.hitPoint(t,e,i)}getBy(t,e,i,n){return this.finder?this.finder.getBy(t,e,i,n):ol.need("find")}destroy(){this.picker.destroy(),this.finder&&this.finder.destroy()}};Object.assign(sl,{watcher:(t,e)=>new $v(t,e),layouter:(t,e)=>new sm(t,e),renderer:(t,e,i)=>new lm(t,e,i),selector:(t,e)=>new pm(t,e)}),$a.layout=sm.fullLayout,$a.render=function(t,e,i){const n=Object.assign(Object.assign({},i),{topRendering:!0});i.topList=new rg,t.__render(e,i),i.topList.length&&i.topList.forEach(t=>t.__render(e,n))};var fm={convert(t,e){const i=uv.getBase(t),{x:n,y:r}=e,o=Object.assign(Object.assign({},i),{x:n,y:r,width:t.width,height:t.height,pointerType:t.pointerType,pressure:t.pressure});return"pen"===o.pointerType&&(o.tangentialPressure=t.tangentialPressure,o.tiltX=t.tiltX,o.tiltY=t.tiltY,o.twist=t.twist),o},convertMouse(t,e){const i=uv.getBase(t),{x:n,y:r}=e;return Object.assign(Object.assign({},i),{x:n,y:r,width:1,height:1,pointerType:"mouse",pressure:.5})},convertTouch(t,e){const i=fm.getTouch(t),n=uv.getBase(t),{x:r,y:o}=e;return Object.assign(Object.assign({},n),{x:r,y:o,width:1,height:1,pointerType:"touch",multiTouch:t.touches.length>1,pressure:i.force})},getTouch:t=>t.targetTouches[0]||t.changedTouches[0]},gm={convert(t){const e=uv.getBase(t);return Object.assign(Object.assign({},e),{code:t.code,key:t.key})}},{pathCanDrag:_m}=uv,vm=class extends Lv{get windowTarget(){const{view:t}=this;return t&&t.ownerDocument||window}get notPointer(){const{p:t}=this;return"pointer"!==t.type||t.touch||this.useMultiTouch}get notTouch(){const{p:t}=this;return"mouse"===t.type||this.usePointer}get notMouse(){return this.usePointer||this.useTouch}__listenEvents(){super.__listenEvents();const t=this.view=this.canvas.view;this.viewEvents={pointerdown:this.onPointerDown,mousedown:this.onMouseDown,touchstart:this.onTouchStart,pointerleave:this.onPointerLeave,contextmenu:this.onContextMenu,wheel:this.onWheel,gesturestart:this.onGesturestart,gesturechange:this.onGesturechange,gestureend:this.onGestureend},this.windowEvents={pointermove:this.onPointerMove,pointerup:this.onPointerUp,pointercancel:this.onPointerCancel,mousemove:this.onMouseMove,mouseup:this.onMouseUp,touchmove:this.onTouchMove,touchend:this.onTouchEnd,touchcancel:this.onTouchCancel,keydown:this.onKeyDown,keyup:this.onKeyUp,scroll:this.onScroll};const{viewEvents:e,windowEvents:i}=this;for(let n in e)e[n]=e[n].bind(this),t.addEventListener(n,e[n]);for(let n in i)i[n]=i[n].bind(this),this.windowTarget.addEventListener(n,i[n])}__removeListenEvents(){super.__removeListenEvents();const{viewEvents:t,windowEvents:e}=this;for(let i in t)this.view.removeEventListener(i,t[i]),this.viewEvents={};for(let i in e)this.windowTarget.removeEventListener(i,e[i]),this.windowEvents={}}getTouches(t){const e=[];for(let i=0,n=t.length;i<n;i++)e.push(t[i]);return e}preventDefaultPointer(t){const{pointer:e}=this.config;e.preventDefault&&t.preventDefault()}preventDefaultWheel(t){const{wheel:e}=this.config;e.preventDefault&&t.preventDefault()}preventWindowPointer(t){return!(this.downData||t.target===this.view||this.config.shadowDOM&&t.composedPath&&t.composedPath().includes(this.view))}onKeyDown(t){this.keyDown(gm.convert(t))}onKeyUp(t){this.keyUp(gm.convert(t))}onContextMenu(t){this.config.pointer.preventDefaultMenu&&t.preventDefault(),this.menu(fm.convert(t,this.getLocal(t)))}onScroll(){this.canvas.updateClientBounds()}onPointerDown(t){this.preventDefaultPointer(t),this.notPointer||(this.usePointer||(this.usePointer=!0),this.pointerDown(fm.convert(t,this.getLocal(t))))}onPointerMove(t,e){if(this.notPointer||this.preventWindowPointer(t))return;this.usePointer||(this.usePointer=!0);const i=fm.convert(t,this.getLocal(t,!0));e?this.pointerHover(i):this.pointerMove(i)}onPointerLeave(t){this.onPointerMove(t,!0)}onPointerUp(t){this.downData&&this.preventDefaultPointer(t),this.notPointer||this.preventWindowPointer(t)||this.pointerUp(fm.convert(t,this.getLocal(t)))}onPointerCancel(){this.useMultiTouch||this.pointerCancel()}onMouseDown(t){this.preventDefaultPointer(t),this.notMouse||this.pointerDown(fm.convertMouse(t,this.getLocal(t)))}onMouseMove(t){this.notMouse||this.preventWindowPointer(t)||this.pointerMove(fm.convertMouse(t,this.getLocal(t,!0)))}onMouseUp(t){this.downData&&this.preventDefaultPointer(t),this.notMouse||this.preventWindowPointer(t)||this.pointerUp(fm.convertMouse(t,this.getLocal(t)))}onMouseCancel(){this.notMouse||this.pointerCancel()}onTouchStart(t){const e=fm.getTouch(t),i=this.getLocal(e,!0),{preventDefault:n}=this.config.touch;(!0===n||"auto"===n&&_m(this.findPath(i)))&&t.preventDefault(),this.multiTouchStart(t),this.notTouch||(this.touchTimer&&(window.clearTimeout(this.touchTimer),this.touchTimer=0),this.useTouch=!0,this.pointerDown(fm.convertTouch(t,i)))}onTouchMove(t){if(this.multiTouchMove(t),this.notTouch||this.preventWindowPointer(t))return;const e=fm.getTouch(t);this.pointerMove(fm.convertTouch(t,this.getLocal(e)))}onTouchEnd(t){if(this.multiTouchEnd(),this.notTouch||this.preventWindowPointer(t))return;this.touchTimer&&clearTimeout(this.touchTimer),this.touchTimer=setTimeout(()=>{this.useTouch=!1},500);const e=fm.getTouch(t);this.pointerUp(fm.convertTouch(t,this.getLocal(e)))}onTouchCancel(){this.notTouch||this.pointerCancel()}multiTouchStart(t){this.useMultiTouch=t.touches.length>1,this.touches=this.useMultiTouch?this.getTouches(t.touches):void 0,this.useMultiTouch&&this.pointerCancel()}multiTouchMove(t){if(this.useMultiTouch&&t.touches.length>1){const e=this.getTouches(t.touches),i=this.getKeepTouchList(this.touches,e);i.length>1&&(this.multiTouch(uv.getBase(t),i),this.touches=e)}}multiTouchEnd(){this.touches=null,this.useMultiTouch=!1,this.transformEnd()}getKeepTouchList(t,e){let i;const n=[];return t.forEach(t=>{i=e.find(e=>e.identifier===t.identifier),i&&n.push({from:this.getLocal(t),to:this.getLocal(i)})}),n}getLocalTouchs(t){return t.map(t=>this.getLocal(t))}onWheel(t){this.preventDefaultWheel(t),this.wheel(Object.assign(Object.assign(Object.assign({},uv.getBase(t)),this.getLocal(t)),{deltaX:t.deltaX,deltaY:t.deltaY}))}onGesturestart(t){this.useMultiTouch||(this.preventDefaultWheel(t),this.lastGestureScale=1,this.lastGestureRotation=0)}onGesturechange(t){if(this.useMultiTouch)return;this.preventDefaultWheel(t);const e=uv.getBase(t);Object.assign(e,this.getLocal(t));const i=t.scale/this.lastGestureScale,n=(t.rotation-this.lastGestureRotation)/Math.PI*180*(Ms.within(this.config.wheel.rotateSpeed,0,1)/4+.1);this.zoom(Object.assign(Object.assign({},e),{scale:i*i})),this.rotate(Object.assign(Object.assign({},e),{rotation:n})),this.lastGestureScale=t.scale,this.lastGestureRotation=t.rotation}onGestureend(t){this.useMultiTouch||(this.preventDefaultWheel(t),this.transformEnd())}setCursor(t){super.setCursor(t);const e=[];this.eachCursor(t,e),us(e[e.length-1])&&e.push("default"),this.canvas.view.style.cursor=e.map(t=>us(t)?`url(${t.url}) ${t.x||0} ${t.y||0}`:t).join(",")}eachCursor(t,e,i=0){if(i++,ds(t))t.forEach(t=>this.eachCursor(t,e,i));else{const n=ls(t)&&Pv.get(t);n&&i<2?this.eachCursor(n,e,i):e.push(t)}}destroy(){this.view&&(super.destroy(),this.view=null,this.touches=null)}};function mm(t,e,i){t.__.__font?pg.fillText(t,e,i):t.__.windingRule?e.fill(t.__.windingRule):e.fill()}function ym(t,e,i,n,r){const o=i.__;us(t)?pg.drawStrokesStyle(t,e,!1,i,n,r):(n.setStroke(t,o.__strokeWidth*e,o),n.stroke()),o.__useArrow&&pg.strokeArrow(t,i,n,r)}function xm(t,e,i,n,r){const o=i.__;us(t)?pg.drawStrokesStyle(t,e,!0,i,n,r):(n.setStroke(t,o.__strokeWidth*e,o),pg.drawTextStroke(i,n,r))}function wm(t,e,i,n,r){const o=n.getSameCanvas(!0,!0);o.font=i.__.__font,xm(t,2,i,o,r),o.blendMode="outside"===e?"destination-out":"destination-in",pg.fillText(i,o,r),o.blendMode="normal",Yu.copyCanvasByWorld(i,n,o),o.recycle(i.__nowWorld)}var bm,{getSpread:Sm,copyAndSpread:km,toOuterOf:Em,getOuterOf:Cm,getByMove:Om,move:Lm,getIntersectData:Pm}=Wa,Tm={},{stintSet:Bm}=_s,{hasTransparent:Rm}=cg;function Am(t,e,i){if(!us(e)||!1===e.visible||0===e.opacity)return;let n;const{boxBounds:r}=i.__layout,{type:o}=e;switch(o){case"image":case"film":case"video":if(!e.url)return;n=fg.image(i,t,e,r,!bm||!bm[e.url]),"image"!==o&&fg[o](n);break;case"linear":n=gg.linearGradient(e,r);break;case"radial":n=gg.radialGradient(e,r);break;case"angular":n=gg.conicGradient(e,r);break;case"solid":const{color:s,opacity:a}=e;n={type:o,style:cg.string(s,a)};break;default:ss(e.r)||(n={type:"solid",style:cg.string(e)})}if(n&&(n.originPaint=e,ls(n.style)&&Rm(n.style)&&(n.isTransparent=!0),e.style)){if(0===e.style.strokeWidth)return;n.strokeStyle=e.style}return n}var Mm,Dm={compute:function(t,e){const i=e.__,n=[];let r,o,s,a=i.__input[t];ds(a)||(a=[a]),bm=fg.recycleImage(t,i);for(let l,h=0,c=a.length;h<c;h++)(l=Am(t,a[h],e))&&(n.push(l),l.strokeStyle&&(s||(s=1),l.strokeStyle.strokeWidth&&(s=Math.max(s,l.strokeStyle.strokeWidth))));i["_"+t]=n.length?n:void 0,n.length?(n.every(t=>t.isTransparent)&&(n.some(t=>t.image)&&(r=!0),o=!0),"fill"===t?(Bm(i,"__isAlphaPixelFill",r),Bm(i,"__isTransparentFill",o)):(Bm(i,"__isAlphaPixelStroke",r),Bm(i,"__isTransparentStroke",o),Bm(i,"__hasMultiStrokeStyle",s))):i.__removePaint(t,!1)},fill:function(t,e,i,n){i.fillStyle=t,mm(e,i,n)},fills:function(t,e,i,n){let r,o,s;for(let a=0,l=t.length;a<l;a++){if(r=t[a],o=r.originPaint,r.image){if(s?s++:s=1,fg.checkImage(r,!e.__.__font,e,i,n))continue;if(!r.style){1===s&&r.image.isPlacehold&&e.drawImagePlaceholder(r,i,n);continue}}if(i.fillStyle=r.style,r.transform||o.scaleFixed){if(i.save(),r.transform&&i.transform(r.transform),o.scaleFixed){const{scaleX:t,scaleY:n}=e.getRenderScaleData(!0,o.scaleFixed,!1);1!==t&&i.scale(t,n)}o.blendMode&&(i.blendMode=o.blendMode),mm(e,i,n),i.restore()}else o.blendMode?(i.saveBlendMode(o.blendMode),mm(e,i,n),i.restoreBlendMode()):mm(e,i,n)}},fillPathOrText:mm,fillText:function(t,e,i){const n=t.__,{rows:r,decorationY:o}=n.__textDrawData;let s;n.__isPlacehold&&n.placeholderColor&&(e.fillStyle=n.placeholderColor);for(let a=0,l=r.length;a<l;a++)s=r[a],s.text?e.fillText(s.text,s.x,s.y):s.data&&s.data.forEach(t=>{e.fillText(t.char,t.x,s.y)});if(o){const{decorationColor:t,decorationHeight:i}=n.__textDrawData;t&&(e.fillStyle=t),r.forEach(t=>o.forEach(n=>e.fillRect(t.x,t.y+n,t.width,i)))}},stroke:function(t,e,i,n){const r=e.__;if(r.__strokeWidth)if(r.__font)pg.strokeText(t,e,i,n);else if(r.__pathForStroke)pg.fillStroke(t,e,i,n);else switch(r.strokeAlign){case"center":ym(t,1,e,i,n);break;case"inside":!function(t,e,i,n){i.save(),i.clipUI(e),ym(t,2,e,i,n),i.restore()}(t,e,i,n);break;case"outside":!function(t,e,i,n){const r=e.__;if(r.__fillAfterStroke)ym(t,2,e,i,n);else{const{renderBounds:o}=e.__layout,s=i.getSameCanvas(!0,!0);e.__drawRenderPath(s),ym(t,2,e,s,n),s.clipUI(r),s.clearWorld(o),Yu.copyCanvasByWorld(e,i,s),s.recycle(e.__nowWorld)}}(t,e,i,n)}},strokes:function(t,e,i,n){pg.stroke(t,e,i,n)},strokeText:function(t,e,i,n){switch(e.__.strokeAlign){case"center":xm(t,1,e,i,n);break;case"inside":wm(t,"inside",e,i,n);break;case"outside":e.__.__fillAfterStroke?xm(t,2,e,i,n):wm(t,"outside",e,i,n)}},drawTextStroke:function(t,e,i){let n,r=t.__.__textDrawData;const{rows:o,decorationY:s}=r;for(let a=0,l=o.length;a<l;a++)n=o[a],n.text?e.strokeText(n.text,n.x,n.y):n.data&&n.data.forEach(t=>{e.strokeText(t.char,t.x,n.y)});if(s){const{decorationHeight:t}=r;o.forEach(i=>s.forEach(n=>e.strokeRect(i.x,i.y+n,i.width,t)))}},drawStrokesStyle:function(t,e,i,n,r,o){let s;const a=n.__,{__hasMultiStrokeStyle:l}=a;l||r.setStroke(void 0,a.__strokeWidth*e,a);for(let h=0,c=t.length;h<c;h++)if(s=t[h],(!s.image||!fg.checkImage(s,!1,n,r,o))&&s.style){if(l){const{strokeStyle:t}=s;t?r.setStroke(s.style,a.__getRealStrokeWidth(t)*e,a,t):r.setStroke(s.style,a.__strokeWidth*e,a)}else r.strokeStyle=s.style;s.originPaint.blendMode?(r.saveBlendMode(s.originPaint.blendMode),i?pg.drawTextStroke(n,r,o):r.stroke(),r.restoreBlendMode()):i?pg.drawTextStroke(n,r,o):r.stroke()}},shape:function(t,e,i){const n=e.getSameCanvas(),r=e.bounds,o=t.__nowWorld,s=t.__layout,a=t.__nowWorldShapeBounds||(t.__nowWorldShapeBounds={});let l,h,c,d,u,p;Em(s.strokeSpread?(km(Tm,s.boxBounds,s.strokeSpread),Tm):s.boxBounds,o,a);let{scaleX:f,scaleY:g}=t.getRenderScaleData(!0);if(r.includes(a))p=n,l=u=a,h=o;else{let n;n=$a.fullImageShadow?a:Pm(s.renderShapeSpread?Sm(r,Ss.swapAndScale(s.renderShapeSpread,f,g)):r,a),d=r.getFitMatrix(n);let{a:_,d:v}=d;d.a<1&&(p=e.getSameCanvas(),t.__renderShape(p,i),f*=_,g*=v),u=Cm(a,d),l=Om(u,-d.e,-d.f),h=Cm(o,d),Lm(h,-d.e,-d.f);const m=i.matrix;m?(c=new fa(d),c.multiply(m),_*=m.scaleX,v*=m.scaleY):c=d,c.withScale(_,v),i=Object.assign(Object.assign({},i),{matrix:c})}return t.__renderShape(n,i),{canvas:n,matrix:c,fitMatrix:d,bounds:l,renderBounds:h,worldCanvas:p,shapeBounds:u,scaleX:f,scaleY:g}}},Im=new Va,{isSame:Fm}=Wa;function Wm(t,e,i,n,r,o){let s=!0;const a=t.__;if("fill"!==e||a.__naturalWidth||(a.__naturalWidth=n.width/a.pixelRatio,a.__naturalHeight=n.height/a.pixelRatio,a.__autoSide&&(t.forceUpdate("width"),Yu.updateBounds(t),t.__proxyData&&(t.setProxyAttr("width",a.width),t.setProxyAttr("height",a.height)),s=!1)),!r.data){fg.createData(r,n,i,o);const{transform:t}=r.data,{opacity:e,blendMode:s}=i,l=t&&!t.onlyScale||a.path||a.cornerRadius;(l||e&&e<1||s)&&(r.complex=!l||2)}return i.filter&&fg.applyFilter(r,n,i.filter,t),s}function zm(t,e){Vm(t,Ep.LOAD,e)}function Nm(t,e){Vm(t,Ep.LOADED,e)}function jm(t,e,i){e.error=i,t.forceUpdate("surface"),Vm(t,Ep.ERROR,e)}function Vm(t,e,i){t.hasEvent(e)&&t.emitEvent(new Ep(e,i))}function Hm(t,e){const{leafer:i}=t;i&&i.viewReady&&(i.renderer.ignore=e)}var{get:Um,translate:Ym}=$s,Xm=new Va,Gm={},Km={};function $m(t,e,i,n){const r=ls(t)||n?(n?i-n*e:i%e)/((n||Math.floor(i/e))-1):t;return"auto"===t&&r<0?0:r}var Zm={},qm={a:1,b:0,c:0,d:1,e:0,f:0},{get:Jm,set:Qm,rotateOfOuter:ty,translate:ey,scaleOfOuter:iy,multiplyParent:ny,scale:ry,rotate:oy,skew:sy}=$s;function ay(t,e,i,n,r,o,s,a){s&&oy(t,s),a&&sy(t,a.x,a.y),r&&ry(t,r,o),ey(t,e.x+i,e.y+n)}var{get:ly,scale:hy,copy:cy}=$s,{getFloorScale:dy}=Ms,{abs:uy}=Math,py={image:function(t,e,i,n,r){let o,s;const a=Jd.get(i,i.type);return Mm&&i===Mm.paint&&Fm(n,Mm.boxBounds)?o=Mm.leafPaint:(o={type:i.type,image:a},a.hasAlphaPixel&&(o.isTransparent=!0),Mm=a.use>1?{leafPaint:o,paint:i,boxBounds:Im.set(n)}:null),(r||a.loading)&&(s={image:a,attrName:e,attrValue:i}),a.ready?(Wm(t,e,i,a,o,n),r&&(zm(t,s),Nm(t,s))):a.error?r&&jm(t,s,a.error):(r&&(Hm(t,!0),zm(t,s)),o.loadId=a.load(()=>{Hm(t,!1),t.destroyed||(Wm(t,e,i,a,o,n)&&(a.hasAlphaPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),Nm(t,s)),o.loadId=void 0},e=>{Hm(t,!1),jm(t,s,e),o.loadId=void 0},i.lod&&a.getThumbSize(i.lod)),t.placeholderColor&&(t.placeholderDelay?setTimeout(()=>{a.ready||(a.isPlacehold=!0,t.forceUpdate("surface"))},t.placeholderDelay):a.isPlacehold=!0)),o},checkImage:function(t,e,i,n,r){const{scaleX:o,scaleY:s}=fg.getImageRenderScaleData(t,i,n,r),a=t.film?t.nowIndex:o+"-"+s,{image:l,data:h,originPaint:c}=t,{exporting:d,snapshot:u}=r;return!(!h||t.patternId===a&&!d||u||(e&&(h.repeat?e=!1:c.changeful||t.film||"miniapp"===$a.name||d||(e=$a.image.isLarge(l,o,s)||l.width*o>8096||l.height*s>8096)),e?(i.__.__isFastShadow&&(n.fillStyle=t.style||"#000",n.fill()),fg.drawImage(t,o,s,i,n,r),0):(!t.style||c.sync||d?fg.createPattern(t,i,n,r):fg.createPatternTask(t,i,n,r),1)))},drawImage:function(t,e,i,n,r,o){const{data:s,image:a,complex:l}=t;let{width:h,height:c}=a;if(l){const{blendMode:o,opacity:d}=t.originPaint,{transform:u}=s;r.save(),2===l&&r.clipUI(n),o&&(r.blendMode=o),d&&(r.opacity*=d),u&&r.transform(u),a.render(r,0,0,h,c,n,t,e,i),r.restore()}else s.scaleX&&(h*=s.scaleX,c*=s.scaleY),a.render(r,0,0,h,c,n,t,e,i)},getImageRenderScaleData:function(t,e,i,n){const r=e.getRenderScaleData(!0,t.originPaint.scaleFixed),{data:o}=t;if(i){const{pixelRatio:t}=i;r.scaleX*=t,r.scaleY*=t}return o&&o.scaleX&&(r.scaleX*=Math.abs(o.scaleX),r.scaleY*=Math.abs(o.scaleY)),r},recycleImage:function(t,e){const i=e["_"+t];if(ds(i)){let n,r,o,s,a;for(let l=0,h=i.length;l<h;l++)n=i[l],r=n.image,a=r&&r.url,a&&(o||(o={}),o[a]=!0,Jd.recyclePaint(n),e.__willDestroy&&r.parent&&fg.recycleFilter(r,e.__leaf),r.loading&&(s||(s=e.__input&&e.__input[t]||[],ds(s)||(s=[s])),r.unload(i[l].loadId,!s.some(t=>t.url===a))));return o}return null},createPatternTask:function(t,e,i,n){t.patternTask||(t.patternTask=Jd.patternTasker.add(()=>Yv(this,void 0,void 0,function*(){fg.createPattern(t,e,i,n),e.forceUpdate("surface")}),0,()=>(t.patternTask=null,i.bounds.hit(e.__nowWorld))))},createPattern:function(t,e,i,n){let{scaleX:r,scaleY:o}=fg.getImageRenderScaleData(t,e,i,n),s=t.film?t.nowIndex:r+"-"+o;if(t.patternId!==s&&!e.destroyed&&(!$a.image.isLarge(t.image,r,o)||t.data.repeat)){const{image:i,data:n}=t,{opacity:a}=t.originPaint,{transform:l,gap:h}=n,c=fg.getPatternFixScale(t,r,o);let d,u,p,{width:f,height:g}=i;c&&(r*=c,o*=c),f*=r,g*=o,h&&(u=h.x*r/uy(n.scaleX||1),p=h.y*o/uy(n.scaleY||1)),(l||1!==r||1!==o)&&(r*=dy(f+(u||0)),o*=dy(g+(p||0)),d=ly(),l&&cy(d,l),hy(d,1/r,1/o));const _=i.getCanvas(f,g,a,void 0,u,p,e.leafer&&e.leafer.config.smooth,n.interlace);t.style=i.getPattern(_,n.repeat||$a.origin.noRepeat||"no-repeat",d,t),t.patternId=s}},getPatternFixScale:function(t,e,i){const{image:n}=t;let r,o=$a.image.maxPatternSize,s=n.width*n.height;return n.isSVG?e>1&&(r=Math.ceil(e)/e):o>s&&(o=s),(s*=e*i)>o&&(r=Math.sqrt(o/s)),r},createData:function(t,e,i,n){t.data=fg.getPatternData(i,n,e)},getPatternData:function(t,e,i){t.padding&&(e=Xm.set(e).shrink(t.padding)),"strench"===t.mode&&(t.mode="stretch");const{width:n,height:r}=i,{mode:o,align:s,offset:a,scale:l,size:h,rotation:c,skew:d,clipSize:u,repeat:p,gap:f,interlace:g}=t,_=e.width===n&&e.height===r,v={mode:o},m="center"!==s&&(c||0)%180==90;let y,x;switch(Wa.set(Km,0,0,m?r:n,m?n:r),o&&"cover"!==o&&"fit"!==o?((l||h)&&(Ms.getScaleData(l,h,i,Gm),y=Gm.scaleX,x=Gm.scaleY),(s||f||p)&&(y&&Wa.scale(Km,y,x,!0),s&&Ea.toPoint(s,Km,e,Km,!0,!0))):_&&!c||(y=x=Wa.getFitScale(e,Km,"fit"!==o),Wa.put(e,i,s,y,!1,Km),Wa.scale(Km,y,x,!0)),a&&aa.move(Km,a),o){case"stretch":_?y&&(y=x=void 0):(y=e.width/n,x=e.height/r,fg.stretchMode(v,e,y,x));break;case"normal":case"clip":if(Km.x||Km.y||y||u||c||d){let t,i;u&&(t=e.width/u.width,i=e.height/u.height),fg.clipMode(v,e,Km.x,Km.y,y,x,c,d,t,i),t&&(y=y?y*t:t,x=x?x*i:i)}break;case"repeat":(!_||y||c||d)&&fg.repeatMode(v,e,n,r,Km.x,Km.y,y,x,c,d,s,t.freeTransform),p||(v.repeat="repeat");const i=us(p);(f||i)&&(v.gap=function(t,e,i,n,r){let o,s;return us(t)?(o=t.x,s=t.y):o=s=t,{x:$m(o,i,r.width,e&&e.x),y:$m(s,n,r.height,e&&e.y)}}(f,i&&p,Km.width,Km.height,e));break;default:y&&fg.fillOrFitMode(v,e,Km.x,Km.y,y,x,c)}return v.transform||(e.x||e.y)&&Ym(v.transform=Um(),e.x,e.y),y&&(v.scaleX=y,v.scaleY=x),p&&(v.repeat=ls(p)?"x"===p?"repeat-x":"repeat-y":"repeat"),g&&(v.interlace=cs(g)||"percent"===g.type?{type:"x",offset:g}:g),v},stretchMode:function(t,e,i,n){const r=Jm(),{x:o,y:s}=e;o||s?ey(r,o,s):i>0&&n>0&&(r.onlyScale=!0),ry(r,i,n),t.transform=r},fillOrFitMode:function(t,e,i,n,r,o,s){const a=Jm();ey(a,e.x+i,e.y+n),ry(a,r,o),s&&ty(a,{x:e.x+e.width/2,y:e.y+e.height/2},s),t.transform=a},clipMode:function(t,e,i,n,r,o,s,a,l,h){const c=Jm();ay(c,e,i,n,r,o,s,a),l&&(s||a?(Qm(qm),iy(qm,e,l,h),ny(c,qm)):iy(c,e,l,h)),t.transform=c},repeatMode:function(t,e,i,n,r,o,s,a,l,h,c,d){const u=Jm();if(d)ay(u,e,r,o,s,a,l,h);else{if(l)if("center"===c)ty(u,{x:i/2,y:n/2},l);else switch(oy(u,l),l){case 90:ey(u,n,0);break;case 180:ey(u,i,n);break;case 270:ey(u,0,i)}Zm.x=e.x+r,Zm.y=e.y+o,ey(u,Zm.x,Zm.y),s&&iy(u,Zm,s,a)}t.transform=u}},{toPoint:fy}=ma,{hasTransparent:gy}=cg,_y={},vy={};function my(t,e,i,n){if(i){let r,o,s,a;for(let t=0,l=i.length;t<l;t++)r=i[t],ls(r)?(s=t/(l-1),o=cg.string(r,n)):(s=r.offset,o=cg.string(r.color,n)),e.addColorStop(s,o),!a&&gy(o)&&(a=!0);a&&(t.isTransparent=!0)}}var{getAngle:yy,getDistance:xy}=aa,{get:wy,rotateOfOuter:by,scaleOfOuter:Sy}=$s,{toPoint:ky}=ma,Ey={},Cy={};function Oy(t,e,i,n,r){let o;const{width:s,height:a}=t;if(s!==a||n){const t=yy(e,i);o=wy(),r?(Sy(o,e,s/a*(n||1),1),by(o,e,t+90)):(Sy(o,e,1,s/a*(n||1)),by(o,e,t))}return o}var{getDistance:Ly}=aa,{toPoint:Py}=ma,Ty={},By={},Ry={linearGradient:function(t,e){let{from:i,to:n,type:r,opacity:o}=t;fy(i||"top",e,_y),fy(n||"bottom",e,vy);const s=$a.canvas.createLinearGradient(_y.x,_y.y,vy.x,vy.y),a={type:r,style:s};return my(a,s,t.stops,o),a},radialGradient:function(t,e){let{from:i,to:n,type:r,opacity:o,stretch:s}=t;ky(i||"center",e,Ey),ky(n||"bottom",e,Cy);const a=$a.canvas.createRadialGradient(Ey.x,Ey.y,0,Ey.x,Ey.y,xy(Ey,Cy)),l={type:r,style:a};my(l,a,t.stops,o);const h=Oy(e,Ey,Cy,s,!0);return h&&(l.transform=h),l},conicGradient:function(t,e){let{from:i,to:n,type:r,opacity:o,rotation:s,stretch:a}=t;Py(i||"center",e,Ty),Py(n||"bottom",e,By);const l=$a.conicGradientSupport?$a.canvas.createConicGradient(s?s*Is:0,Ty.x,Ty.y):$a.canvas.createRadialGradient(Ty.x,Ty.y,0,Ty.x,Ty.y,Ly(Ty,By)),h={type:r,style:l};my(h,l,t.stops,o);const c=Oy(e,Ty,By,a||1,$a.conicGradientRotate90);return c&&(h.transform=c),h},getTransform:Oy},{copy:Ay,move:My,toOffsetOutBounds:Dy}=Wa,{max:Iy,abs:Fy}=Math,Wy={},zy=new fa,Ny={};function jy(t,e){let i,n,r,o,s=0,a=0,l=0,h=0;return e.forEach(t=>{i=t.x||0,n=t.y||0,o=1.5*(t.blur||0),r=Fy(t.spread||0),s=Iy(s,r+o-n),a=Iy(a,r+o+i),l=Iy(l,r+o+n),h=Iy(h,r+o-i)}),s===a&&a===l&&l===h?s:[s,a,l,h]}function Vy(t,e,i){const{shapeBounds:n}=i;let r,o;$a.fullImageShadow?(Ay(Wy,t.bounds),My(Wy,e.x-n.x,e.y-n.y),r=t.bounds,o=Wy):(r=n,o=e),t.copyWorld(i.canvas,r,o)}var Hy,{toOffsetOutBounds:Uy}=Wa,Yy={},Xy={shadow:function(t,e,i){let n,r;const{__nowWorld:o}=t,{shadow:s}=t.__,{worldCanvas:a,bounds:l,renderBounds:h,shapeBounds:c,scaleX:d,scaleY:u}=i,p=e.getSameCanvas(),f=s.length-1;Dy(l,Ny,h),s.forEach((s,g)=>{let _=1;if(s.scaleFixed){const t=Math.abs(o.scaleX);t>1&&(_=1/t)}p.setWorldShadow(Ny.offsetX+(s.x||0)*d*_,Ny.offsetY+(s.y||0)*u*_,(s.blur||0)*d*_,cg.string(s.color)),r=_g.getShadowTransform(t,p,i,s,Ny,_),r&&p.setTransform(r),Vy(p,Ny,i),r&&p.resetTransform(),n=h,s.box&&(p.restore(),p.save(),a&&(p.copyWorld(p,h,o,"copy"),n=o),a?p.copyWorld(a,o,o,"destination-out"):p.copyWorld(i.canvas,c,l,"destination-out")),Yu.copyCanvasByWorld(t,e,p,n,s.blendMode),f&&g<f&&p.clearWorld(n)}),p.recycle(n)},innerShadow:function(t,e,i){let n,r;const{__nowWorld:o}=t,{innerShadow:s}=t.__,{worldCanvas:a,bounds:l,renderBounds:h,shapeBounds:c,scaleX:d,scaleY:u}=i,p=e.getSameCanvas(),f=s.length-1;Uy(l,Yy,h),s.forEach((s,g)=>{let _=1;if(s.scaleFixed){const t=Math.abs(o.scaleX);t>1&&(_=1/t)}p.save(),p.setWorldShadow(Yy.offsetX+(s.x||0)*d*_,Yy.offsetY+(s.y||0)*u*_,(s.blur||0)*d*_),r=_g.getShadowTransform(t,p,i,s,Yy,_,!0),r&&p.setTransform(r),Vy(p,Yy,i),p.restore(),a?(p.copyWorld(p,h,o,"copy"),p.copyWorld(a,o,o,"source-out"),n=o):(p.copyWorld(i.canvas,c,l,"source-out"),n=h),p.fillWorld(n,cg.string(s.color),"source-in"),Yu.copyCanvasByWorld(t,e,p,n,s.blendMode),f&&g<f&&p.clearWorld(n)}),p.recycle(n)},blur:function(t,e,i){const{blur:n}=t.__;i.setWorldBlur(n*t.__nowWorld.a),i.copyWorldToInner(e,t.__nowWorld,t.__layout.renderBounds),i.filter="none"},backgroundBlur:function(t,e,i){},getShadowRenderSpread:jy,getShadowTransform:function(t,e,i,n,r,o,s){if(n.spread){const i=2*n.spread*o*(s?-1:1),{width:a,height:l}=t.__layout.strokeBounds;return zy.set().scaleOfOuter({x:(r.x+r.width/2)*e.pixelRatio,y:(r.y+r.height/2)*e.pixelRatio},1+i/a,1+i/l),zy}},isTransformShadow(t){},getInnerShadowSpread:jy},{excludeRenderBounds:Gy}=tp;function Ky(t,e,i,n,r,o,s,a){switch(e){case"grayscale":Hy||(Hy=!0,r.useGrayscaleAlpha(t.__nowWorld));case"alpha":!function(t,e,i,n,r,o){const s=t.__nowWorld;i.resetTransform(),i.opacity=1,i.useMask(n,s),o&&n.recycle(s),Zy(t,e,i,1,r,o)}(t,i,n,r,s,a);break;case"opacity-path":Zy(t,i,n,o,s,a);break;case"path":a&&i.restore()}}function $y(t){return t.getSameCanvas(!1,!0)}function Zy(t,e,i,n,r,o){const s=t.__nowWorld;e.resetTransform(),e.opacity=n,e.copyWorld(i,s,void 0,r),o?i.recycle(s):i.clearWorld(s)}Hg.prototype.__renderMask=function(t,e){let i,n,r,o,s,a;const{children:l}=this;for(let h=0,c=l.length;h<c;h++){if(i=l[h],a=i.__.mask,a){s&&(Ky(this,s,t,r,n,o,void 0,!0),n=r=null),"clipping"!==a&&"clipping-path"!==a||Gy(i,e)||i.__render(t,e),o=i.__.opacity,Hy=!1,"path"===a||"clipping-path"===a?(o<1?(s="opacity-path",r||(r=$y(t))):(s="path",t.save()),i.__clip(r||t,e)):(s="grayscale"===a?"grayscale":"alpha",n||(n=$y(t)),r||(r=$y(t)),i.__render(n,e));continue}const c=1===o&&i.__.__blendMode;c&&Ky(this,s,t,r,n,o,void 0,!1),Gy(i,e)||i.__render(r||t,e),c&&Ky(this,s,t,r,n,o,c,!1)}Ky(this,s,t,r,n,o,void 0,!0)};var qy=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",Jy=qy+"_#~&*+\\=|≮≯≈≠=…",Qy=new RegExp([[19968,40959],[13312,19903],[131072,173791],[173824,177983],[177984,178207],[178208,183983],[183984,191471],[196608,201551],[201552,205743],[11904,12031],[12032,12255],[12272,12287],[12288,12351],[12736,12783],[12800,13055],[13056,13311],[63744,64255],[65072,65103],[127488,127743],[194560,195103]].map(([t,e])=>`[\\u${t.toString(16)}-\\u${e.toString(16)}]`).join("|"));function tx(t){const e={};return t.split("").forEach(t=>e[t]=!0),e}var ex,ix=tx("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),nx=tx("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),rx=tx(qy),ox=tx(Jy),sx=tx("- —/~|┆·");!function(t){t[t.Letter=0]="Letter",t[t.Single=1]="Single",t[t.Before=2]="Before",t[t.After=3]="After",t[t.Symbol=4]="Symbol",t[t.Break=5]="Break"}(ex||(ex={}));var{Letter:ax,Single:lx,Before:hx,After:cx,Symbol:dx,Break:ux}=ex;function px(t){return ix[t]?ax:sx[t]?ux:nx[t]?hx:rx[t]?cx:ox[t]?dx:Qy.test(t)?lx:ax}var fx={trimRight(t){const{words:e}=t;let i,n=0,r=e.length;for(let o=r-1;o>-1&&(i=e[o].data[0]," "===i.char);o--)n++,t.width-=i.width;n&&e.splice(r-n,n)}};function gx(t,e,i){switch(e){case"title":return i?t.toUpperCase():t;case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();default:return t}}var _x,vx,mx,yx,xx,wx,bx,Sx,kx,Ex,Cx,Ox,Lx,Px,Tx,Bx,Rx,{trimRight:Ax}=fx,{Letter:Mx,Single:Dx,Before:Ix,After:Fx,Symbol:Wx,Break:zx}=ex,Nx=[];function jx(t,e){kx&&!Sx&&(Sx=kx),_x.data.push({char:t,width:e}),mx+=e}function Vx(){yx+=mx,_x.width=mx,vx.words.push(_x),_x={data:[]},mx=0}function Hx(){Px&&(Tx.paraNumber++,vx.paraStart=!0,Px=!1),kx&&(vx.startCharSize=Sx,vx.endCharSize=kx,Sx=0),vx.width=yx,Bx.width?Ax(vx):Rx&&Ux(),Nx.push(vx),vx={words:[]},yx=0}function Ux(){yx>(Tx.maxWidth||0)&&(Tx.maxWidth=yx)}var{top:Yx,right:Xx,bottom:Gx,left:Kx}=Gs;function $x(t,e,i){const{bounds:n,rows:r}=t;n[e]+=i;for(let o=0;o<r.length;o++)r[o][e]+=i}Object.assign(hg,{getDrawData:function(t,e){ls(t)||(t=String(t));let i=0,n=0,r=e.__getInput("width")||0,o=e.__getInput("height")||0;const{__padding:s}=e;s&&(r?(i=s[Kx],r-=s[Xx]+s[Kx],!r&&(r=.01)):e.autoSizeAlign||(i=s[Kx]),o?(n=s[Yx],o-=s[Yx]+s[Gx],!o&&(o=.01)):e.autoSizeAlign||(n=s[Yx]));const a={bounds:{x:i,y:n,width:r,height:o},rows:[],paraNumber:0,font:$a.canvas.font=e.__font};return function(t,e,i){Tx=t,Nx=t.rows,Rx=!(Bx=t.bounds).width&&!i.autoSizeAlign;const{__letterSpacing:n,paraIndent:r,textCase:o}=i,{canvas:s}=$a,{width:a}=Bx;if(i.__isCharMode){const t="none"!==i.textWrap,l="break"===i.textWrap;Px=!0,Cx=null,Sx=bx=kx=mx=yx=0,_x={data:[]},vx={words:[]};for(let i=0,h=(e=[...e]).length;i<h;i++)"\n"===(wx=e[i])?(mx&&Vx(),vx.paraEnd=!0,Hx(),Px=!0):((Ex=px(wx))===Mx&&"none"!==o&&(wx=gx(wx,o,!mx)),bx=s.measureText(wx).width,n&&(n<0&&(kx=bx),bx+=n),Ox=Ex===Dx&&(Cx===Dx||Cx===Mx)||Cx===Dx&&Ex!==Fx,Lx=!(Ex!==Ix&&Ex!==Dx||Cx!==Wx&&Cx!==Fx),xx=Px&&r?a-r:a,t&&a&&yx+mx+bx>xx&&(l?(mx&&Vx(),yx&&Hx()):(Lx||(Lx=Ex===Mx&&Cx==Fx),Ox||Lx||Ex===zx||Ex===Ix||Ex===Dx||mx+bx>xx?(mx&&Vx(),yx&&Hx()):yx&&Hx()))," "===wx&&!0!==Px&&yx+mx===0||(Ex===zx?(" "===wx&&mx&&Vx(),jx(wx,bx),Vx()):Ox||Lx?(mx&&Vx(),jx(wx,bx)):jx(wx,bx)),Cx=Ex);mx&&Vx(),yx&&Hx(),Nx.length>0&&(Nx[Nx.length-1].paraEnd=!0)}else e.split("\n").forEach(t=>{Tx.paraNumber++,yx=s.measureText(t).width,Nx.push({x:r||0,text:t,width:yx,paraStart:!0}),Rx&&Ux()})}(a,t,e),s&&function(t,e,i,n,r){if(!n&&i.autoSizeAlign)switch(i.textAlign){case"left":$x(e,"x",t[Kx]);break;case"right":$x(e,"x",-t[Xx])}if(!r&&i.autoSizeAlign)switch(i.verticalAlign){case"top":$x(e,"y",t[Yx]);break;case"bottom":$x(e,"y",-t[Gx])}}(s,a,e,r,o),function(t,e){const{rows:i,bounds:n}=t,r=i.length,{__lineHeight:o,__baseLine:s,__letterSpacing:a,__clipText:l,textAlign:h,verticalAlign:c,paraSpacing:d,autoSizeAlign:u}=e;let{x:p,y:f,width:g,height:_}=n,v=o*r+(d?d*(t.paraNumber-1):0),m=s;if(l&&v>_)v=Math.max(e.__autoHeight?v:_,o),r>1&&(t.overflow=r);else if(_||u)switch(c){case"middle":f+=(_-v)/2;break;case"bottom":f+=_-v}m+=f;let y,x,w,b=g||u?g:t.maxWidth;for(let S=0,k=r;S<k;S++){if(y=i[S],y.x=p,y.width<g||y.width>g&&!l)switch(h){case"center":y.x+=(b-y.width)/2;break;case"right":y.x+=b-y.width}y.paraStart&&d&&S>0&&(m+=d),y.y=m,m+=o,t.overflow>S&&m>v&&(y.isOverflow=!0,t.overflow=S+1),x=y.x,w=y.width,a<0&&(y.width<0?(w=-y.width+e.fontSize+a,x-=w,w+=e.fontSize):w-=a),x<n.x&&(n.x=x),w>n.width&&(n.width=w),l&&g&&g<w&&(y.isOverflow=!0,t.overflow||(t.overflow=i.length))}n.y=f,n.height=v}(a,e),e.__isCharMode&&function(t,e,i){const{rows:n}=t,{textAlign:r,paraIndent:o,__letterSpacing:s}=e,a=i&&r.includes("both"),l=a||i&&r.includes("justify"),h=l&&r.includes("letter");let c,d,u,p,f,g,_,v,m,y;n.forEach(t=>{t.words&&(f=o&&t.paraStart?o:0,v=t.words.length,l&&(y=!t.paraEnd||a,d=i-t.width-f,h?p=d/(t.words.reduce((t,e)=>t+e.data.length,0)-1):u=v>1?d/(v-1):0),g=s||t.isOverflow||h?0:u?1:2,t.isOverflow&&!s&&(t.textMode=!0),2===g?(t.x+=f,function(t){t.text="",t.words.forEach(e=>{e.data.forEach(e=>{t.text+=e.char})})}(t)):(t.x+=f,c=t.x,t.data=[],t.words.forEach((e,i)=>{1===g?(_={char:"",x:c},c=function(t,e,i){return t.forEach(t=>{i.char+=t.char,e+=t.width}),e}(e.data,c,_),(t.isOverflow||" "!==_.char)&&t.data.push(_)):c=function(t,e,i,n,r){return t.forEach(t=>{(n||" "!==t.char)&&(t.x=e,i.push(t)),e+=t.width,r&&(e+=r)}),e}(e.data,c,t.data,t.isOverflow,y&&p),y&&(m=i===v-1,u?m||(c+=u,t.width+=u):p&&(t.width+=p*(e.data.length-(m?1:0))))})),t.words=null)})}(a,e,r),a.overflow&&function(t,e,i,n){const{rows:r,overflow:o}=t;let{textOverflow:s}=e;if(o&&r.splice(o),n&&s&&"show"!==s){let t,a;"hide"===s?s="":"ellipsis"===s&&(s="...");const l=s?$a.canvas.measureText(s).width:0,h=i+n-l;("none"===e.textWrap?r:[r[o-1]]).forEach(e=>{if(e.isOverflow&&e.data){let i=e.data.length-1;for(let n=i;n>-1&&(t=e.data[n],a=t.x+t.width,!(n===i&&a<h));n--){if(a<h&&" "!==t.char||!n){e.data.splice(n+1),e.width-=t.width;break}e.width-=t.width}e.width+=l,e.data.push({char:s,x:a}),e.textMode&&function(t){t.text="",t.data.forEach(e=>{t.text+=e.char}),t.data=null}(e)}})}}(a,e,i,r),"none"!==e.textDecoration&&function(t,e){let i,n=0;const{fontSize:r,textDecoration:o}=e;switch(t.decorationHeight=r/11,us(o)?(i=o.type,o.color&&(t.decorationColor=cg.string(o.color)),o.offset&&(n=Math.min(.3*r,Math.max(o.offset,.15*-r)))):i=o,i){case"under":t.decorationY=[.15*r+n];break;case"delete":t.decorationY=[.35*-r];break;case"under-delete":t.decorationY=[.15*r+n,.35*-r]}}(a,e),a}}),Object.assign(cg,{string:function(t,e){if(!t)return"#000";const i=cs(e)&&e<1;if(ls(t)){if(!i||!cg.object)return t;t=cg.object(t)}let n=ss(t.a)?1:t.a;i&&(n*=e);const r=t.r+","+t.g+","+t.b;return 1===n?"rgb("+r+")":"rgba("+r+","+n+")"}}),Object.assign(pg,Dm),Object.assign(fg,py),Object.assign(gg,Ry),Object.assign(_g,Xy),Object.assign(sl,{interaction:(t,e,i,n)=>new vm(t,e,i,n),hitCanvas:(t,e)=>new Gv(t,e),hitCanvasManager:()=>new Tv}),$a.origin={createCanvas(t,e){const i=document.createElement("canvas");return i.width=t,i.height=e,i},canvasToDataURL:(t,e,i)=>{const n=Ud.mimeType(e),r=t.toDataURL(n,i);return"image/bmp"===n?r.replace("image/png;","image/bmp;"):r},canvasToBolb:(t,e,i)=>new Promise(n=>t.toBlob(n,Ud.mimeType(e),i)),canvasSaveAs:(t,e,i)=>{const n=t.toDataURL(Ud.mimeType(Ud.fileType(e)),i);return $a.origin.download(n,e)},download(t,e){return Yv(this,void 0,void 0,function*(){let i=document.createElement("a");i.href=t,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i)})},loadImage:(t,e,i)=>new Promise((i,n)=>{const r=new $a.origin.Image;e&&(r.setAttribute("crossOrigin",e),r.crossOrigin=e),r.onload=()=>{i(r)},r.onerror=t=>{n(t)},r.src=$a.image.getRealURL(t)}),loadContent(t){return Yv(this,arguments,void 0,function*(t,e="text"){const i=yield fetch(t);if(!i.ok)throw new Error(`${i.status}`);return yield i[e]()})},Image:Image,PointerEvent:PointerEvent,DragEvent:DragEvent},$a.event={stopDefault(t){t.preventDefault()},stopNow(t){t.stopImmediatePropagation()},stop(t){t.stopPropagation()}},$a.canvas=sl.canvas(),$a.conicGradientSupport=!!$a.canvas.context.createConicGradient;var{M:Zx,L:qx,C:Jx,Q:Qx,Z:tw,N:ew,D:iw,X:nw,G:rw,F:ow,O:sw,P:aw,U:lw}=Rl,hw={scale(t,e,i){if(!t)return;let n,r=0,o=t.length;for(;r<o;)switch(n=t[r],n){case Zx:case qx:cw(t,e,i,r,1),r+=3;break;case Jx:cw(t,e,i,r,3),r+=7;break;case Qx:cw(t,e,i,r,2),r+=5;break;case tw:r+=1;break;case ew:cw(t,e,i,r,2),r+=5;break;case iw:cw(t,e,i,r,2),r+=9;break;case nw:cw(t,e,i,r,2),r+=6;break;case rw:cw(t,e,i,r,2),r+=9;break;case ow:cw(t,e,i,r,2),r+=5;break;case sw:t[r]=rw,t.splice(r+4,0,t[r+3],0),cw(t,e,i,r,2),r+=9,o+=2;break;case aw:t[r]=ow,t.splice(r+4,0,t[r+3]),cw(t,e,i,r,2),r+=5,o+=1;break;case lw:cw(t,e,i,r,2),r+=6}},scalePoints(t,e,i,n,r){for(let o=r?n+1:0,s=r?o+2*r:t.length;o<s;o+=2)t[o]*=e,t[o+1]*=i}},{scalePoints:cw}=hw,dw=$s.get(),{topLeft:uw,top:pw,topRight:fw,right:gw,bottom:_w,left:vw}=Ks;function mw(t,e,i){t.pathInputed?xw(t,e,i):(1!==e&&(t.width*=e),1!==i&&(t.height*=i))}function yw(t,e,i,n){let r=e;if(!ss(n)){const o=t.__layout;let{width:s,height:a}=o.boxBounds;switch(s*=i-e,a*=e-i,n){case pw:case _w:r=i,o.affectScaleOrRotation?t.moveInner(-s/2,0):t.x-=s/2;break;case vw:case gw:o.affectScaleOrRotation?t.moveInner(0,-a/2):t.y-=a/2;break;case uw:case fw:o.affectScaleOrRotation?t.moveInner(0,-a):t.y-=a}}t.fontSize*=r;const o=t.__,{padding:s,lineHeight:a,letterSpacing:l}=o;s&&(t.padding=ds(s)?s.map(t=>t*r):s*r),o.__autoWidth||(t.width*=r),o.__autoHeight||(t.height*=r),us(a)?"px"===a.type&&(o.lineHeight={type:"px",value:a.value*r}):a&&(o.lineHeight=a*r),us(l)?"px"===l.type&&(o.letterSpacing={type:"px",value:l.value*r}):l&&(o.letterSpacing=l*r)}function xw(t,e,i){hw.scale(t.__.path,e,i),t.path=t.__.path}function ww(t,e,i){const{points:n}=t;us(n[0])?n.forEach(t=>{t.x*=e,t.y*=i}):hw.scalePoints(n,e,i),t.points=n}function bw(t,e,i){const{children:n}=t;for(let r=0;r<n.length;r++)dw.a=e,dw.d=i,n[r].transform(dw,!0)}var Sw=Gf.prototype;function kw(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s}function Ew(t){return t?ds(t)?t:[t]:[]}Sw.scaleResize=function(t,e=t,i){const n=this;i||n.editConfig&&"scale"===n.editConfig.editSize?(n.scaleX*=t,n.scaleY*=e):(t<0&&(n.scaleX*=-1,t=-t),e<0&&(n.scaleY*=-1,e=-e),this.__scaleResize(t,e))},Sw.__scaleResize=function(t,e){mw(this,t,e)},Sw.resizeWidth=function(t){const e=t/this.getBounds("box","local").width||1;this.scaleOf(this.__layout.boxBounds,e,this.__.lockRatio?e:1,!0)},Sw.resizeHeight=function(t){const e=t/this.getBounds("box","local").height||1;this.scaleOf(this.__layout.boxBounds,this.__.lockRatio?e:1,e,!0)},M_.prototype.__scaleResize=function(t,e){const{app:i,editConfig:n}=this,r=i&&i.editor,o=r&&r.dragPoint;if(this.__.resizeFontSize||n&&"font-size"===n.editSize||o&&"font-size"===r.mergedConfig.editSize)yw(this,t,e,o&&o.direction);else{const{__autoWidth:i,__autoHeight:n,textAlign:r,verticalAlign:o}=this.__,{boxBounds:s}=this.__layout;i&&"left"!==r&&1!==t&&(this.x+=s.x),n&&"top"!==o&&1!==e&&(this.y+=s.y),mw(this,t,e)}},D_.prototype.__scaleResize=function(t,e){xw(this,t,e)},C_.prototype.__scaleResize=function(t,e){this.pathInputed?xw(this,t,e):this.points?ww(this,t,e):this.width*=t},d_.prototype.__scaleResize=function(t,e){this.pathInputed?xw(this,t,e):this.points?ww(this,t,e):mw(this,t,e)},Hg.prototype.__scaleResize=function(t,e){bw(this,t,e)},Jg.prototype.__scaleResize=function(t,e){const{resizeChildren:i,__autoSize:n}=this.__;n&&i||mw(this,t,e),i&&bw(this,t,e)},ol.add("resize");var Cw=class extends xp{get list(){return Ew(this.value)}get oldList(){return Ew(this.oldValue)}constructor(t,e){super(t),e&&Object.assign(this,e)}};function Ow(t){return(e,i)=>{const n="_"+i;nu(e,i,{get(){return this[n]},set(e){const r=this[n];if(r!==e){const o=this;if(o.config){const t="target"===i;if(t){const{beforeSelect:t}=o.config;if(t){const i=t({target:e});if(us(i))e=i;else if(!1===i)return}o.hasDimOthers&&o.cancelDimOthers(),ds(e)&&e.length>1&&e[0].locked&&e.splice(0,1),o.single&&(delete o.element.syncEventer,delete o.element.__world.ignorePixelSnap)}const n=t?Cw.BEFORE_SELECT:Cw.BEFORE_HOVER;this.hasEvent(n)&&this.emitEvent(new Cw(n,{editor:o,value:e,oldValue:r}))}this[n]=e,t(this,r)}}})}}Cw.BEFORE_SELECT="editor.before_select",Cw.SELECT="editor.select",Cw.AFTER_SELECT="editor.after_select",Cw.BEFORE_HOVER="editor.before_hover",Cw.HOVER="editor.hover";var{abs:Lw}=Math,{copy:Pw}=$s,{setListWithFn:Tw}=Wa,{worldBounds:Bw}=tp,Rw={a:1,b:0,c:0,d:1,e:0,f:0},Aw={x:0,y:0,width:0,height:0},Mw=class extends jg{constructor(){super(),this.list=[],this.visible=0,this.hittable=!1,this.strokeAlign="center"}setTarget(t,e){e&&this.set(e),this.target=t,this.update()}update(t){const{list:e}=this;e.length?(Tw(Aw,e,Bw),t&&this.set(t),this.set(Aw),this.visible=!0):this.visible=0}__draw(t,e){const{list:i}=this;if(i.length){let n;const r=this.__,{stroke:o,strokeWidth:s,fill:a}=r,{bounds:l}=e;for(let h=0;h<i.length;h++){n=i[h];const{worldTransform:c,worldRenderBounds:d}=n;if(d.width&&d.height&&(!l||l.hit(d,e.matrix))){const i=Lw(c.scaleX),l=Lw(c.scaleY);if(Pw(Rw,c),Rw.half=s%2,t.setWorld(Rw,e.matrix),t.beginPath(),"path"===this.strokePathType||n.__.__useArrow?n.__drawPath(t):n.__.__pathForRender?n.__drawRenderPath(t):n.__drawPathByBox(t),r.strokeWidth=s/Math.max(i,l),r.shadow){const e=r.shadow[0],{scaleX:i,scaleY:n}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*i,e.y*n,e.blur*i,cg.string(e.color))}o&&(ls(o)?pg.stroke(o,this,t,e):pg.strokes(o,this,t,e)),a&&(ls(a)?pg.fill(a,this,t,e):pg.fills(a,this,t,e)),r.shadow&&t.restore()}}r.strokeWidth=s}}destroy(){this.target=null,super.destroy()}};kw([Ow(function(t){const e=t.target;t.list=e?ds(e)?e:[e]:[]})],Mw.prototype,"target",void 0),kw([mu("render-path")],Mw.prototype,"strokePathType",void 0);var Dw=class extends Hg{constructor(t){super(t),this.strokeArea=new Xg({strokeAlign:"center"}),this.fillArea=new Xg,this.visible=0,this.hittable=!1,this.addMany(this.fillArea,this.strokeArea)}setStyle(t,e){const{visible:i,stroke:n,strokeWidth:r}=t;this.visible=i,this.strokeArea.reset(Object.assign({stroke:n,strokeWidth:r},e||{})),this.fillArea.reset({visible:!e,fill:n,opacity:.2})}setBounds(t){this.strokeArea.set(t),this.fillArea.set(t)}},Iw={findOne:t=>t.list.find(t=>t.editable),findByBounds(t,e){const i=[];return Fw([t],i,e),i}};function Fw(t,e,i){let n,r;for(let o=0,s=t.length;o<s;o++)if(n=t[o],r=n.__,r.hittable&&r.visible&&!r.locked&&i.hit(n.__world)){if(r.editable){if(n.isBranch&&!r.hitChildren){r.hitSelf&&e.push(n);continue}if(n.isFrame){if(i.includes(n.__layout.boxBounds,n.__world)){e.push(n);continue}}else i.hit(n.__layout.boxBounds,n.__world)&&r.hitSelf&&e.push(n)}n.isBranch&&Fw(n.children,e,i)}}var{findOne:Ww,findByBounds:zw}=Iw,Nw=class extends Hg{get dragging(){return!!this.originList}get running(){const{editor:t,app:e}=this;return this.hittable&&t.visible&&t.hittable&&t.mergeConfig.selector&&e&&"normal"===e.mode}get isMoveMode(){const{app:t}=this;return t&&t.interaction.moveMode}constructor(t){super(),this.hoverStroker=new Mw,this.targetStroker=new Mw,this.bounds=new Va,this.selectArea=new Dw,this.__eventIds=[],this.editor=t,this.addMany(this.targetStroker,this.hoverStroker,this.selectArea),this.__listenEvents()}onHover(){const{editor:t}=this;if(!this.running||this.dragging||t.dragging)this.hoverStroker.target=null;else{const{hoverTarget:e,mergeConfig:i}=t,n=Object.assign({},i);e&&e.editConfig&&Object.assign(n,e.editConfig);const{stroke:r,strokeWidth:o,hover:s,hoverStyle:a}=n;this.hoverStroker.setTarget(s?e:null,Object.assign({stroke:r,strokeWidth:o},a||{}))}}onSelect(){this.running&&(this.targetStroker.setTarget(this.editor.list),this.hoverStroker.target=null)}update(){this.hoverStroker.update();const{stroke:t,strokeWidth:e,selectedPathType:i,selectedStyle:n}=this.editor.mergedConfig;this.targetStroker.update(Object.assign({stroke:t,strokeWidth:e&&Math.max(1,e/2),strokePathType:i},n||{}))}onPointerMove(t){const{app:e,editor:i}=this;if(this.running&&!this.isMoveMode&&e.interaction.canHover&&!e.interaction.dragging){const e=this.findUI(t);i.hoverTarget=i.hasItem(e)?null:e}this.isMoveMode&&(i.hoverTarget=null)}onBeforeDown(t){if(t.multiTouch)return;const{select:e}=this.editor.mergeConfig;"press"===e&&(this.app.config.mobile?this.waitSelect=()=>this.checkAndSelect(t):this.checkAndSelect(t))}onTap(t){if(t.multiTouch)return;const{editor:e}=this,{select:i,selectKeep:n}=e.mergeConfig;"tap"===i?this.checkAndSelect(t):this.waitSelect&&this.waitSelect(),this.needRemoveItem?e.removeItem(this.needRemoveItem):this.isMoveMode&&(n||(e.target=null))}checkAndSelect(t){if(this.needRemoveItem=null,this.allowSelect(t)){const{editor:e}=this,i=this.findUI(t);i?(this.isMultipleSelect(t)?e.hasItem(i)?this.needRemoveItem=i:e.addItem(i):e.target=i,t.path.needUpdate=!0):this.allow(t.target)&&(this.isHoldMultipleSelectKey(t)||this.editor.mergedConfig.selectKeep||(e.target=null))}}onDragStart(t){if(!t.multiTouch&&(this.waitSelect&&this.waitSelect(),this.allowDrag(t))){const{editor:e}=this,{stroke:i,area:n}=e.mergeConfig,{x:r,y:o}=t.getInnerPoint(this);this.bounds.set(r,o),this.selectArea.setStyle({visible:!0,stroke:i,x:r,y:o},n),this.selectArea.setBounds(this.bounds.get()),this.originList=e.leafList.clone()}}onDrag(t){if(!t.multiTouch){if(this.editor.dragging)return this.onDragEnd(t);if(this.dragging){const{editor:e}=this,i=t.getInnerTotal(this),n=this.bounds.clone().unsign(),r=new rg(zw(e.app,n));if(this.bounds.width=i.x,this.bounds.height=i.y,this.selectArea.setBounds(n.get()),r.length){const t=[];this.originList.forEach(e=>{r.has(e)||t.push(e)}),r.forEach(e=>{this.originList.has(e)||t.push(e)}),(t.length!==e.list.length||e.list.some((e,i)=>e!==t[i]))&&(e.target=t)}else e.target=this.originList.list}}}onDragEnd(t){t.multiTouch||this.dragging&&(this.originList=null,this.selectArea.visible=0)}onAutoMove(t){if(this.dragging){const{x:e,y:i}=t.getLocalMove(this);this.bounds.x+=e,this.bounds.y+=i}}allow(t){return t.leafer!==this.editor.leafer}allowDrag(t){const{boxSelect:e,multipleSelect:i}=this.editor.mergeConfig;return!(!(this.running&&i&&e)||t.target.draggable)&&(!this.editor.editing&&this.allow(t.target)||this.isHoldMultipleSelectKey(t)&&!Ww(t.path))}allowSelect(t){return this.running&&!this.isMoveMode&&!t.middle}findDeepOne(t){const e={exclude:new rg(this.editor.editBox.rect)};return Ww(t.target.leafer.interaction.findPath(t,e))}findUI(t){return this.isMultipleSelect(t)?this.findDeepOne(t):Ww(t.path)}isMultipleSelect(t){const{multipleSelect:e,continuousSelect:i}=this.editor.mergeConfig;return e&&(this.isHoldMultipleSelectKey(t)||i)}isHoldMultipleSelectKey(t){const{multipleSelectKey:e}=this.editor.mergedConfig;return e?t.isHoldKeys(e):t.shiftKey}__listenEvents(){const{editor:t}=this;t.waitLeafer(()=>{const{app:e}=t;e.selector.proxy=t,this.__eventIds=[t.on_([[Cw.HOVER,this.onHover,this],[Cw.SELECT,this.onSelect,this]]),e.on_([[iv.MOVE,this.onPointerMove,this],[iv.BEFORE_DOWN,this.onBeforeDown,this],[iv.TAP,this.onTap,this],[rv.START,this.onDragStart,this,!0],[rv.DRAG,this.onDrag,this],[rv.END,this.onDragEnd,this],[sv.MOVE,this.onAutoMove,this],[[cv.ZOOM,sv.MOVE],()=>{this.editor.hoverTarget=null}]])]})}__removeListenEvents(){this.off_(this.__eventIds)}destroy(){this.editor=this.originList=this.needRemoveItem=null,this.__removeListenEvents(),super.destroy()}},{topLeft:jw,top:Vw,topRight:Hw,right:Uw,bottomRight:Yw,bottom:Xw,bottomLeft:Gw,left:Kw}=Ks,{toPoint:$w}=ma,{within:Zw,sign:qw}=Ms,{abs:Jw}=Math,Qw={getScaleData(t,e,i,n,r,o,s,a){let l,h,c={},d=1,u=1;const{boxBounds:p,widthRange:f,heightRange:g,dragBounds:_,worldBoxBounds:v}=t,{width:m,height:y}=e,x=t.scaleX/e.scaleX,w=t.scaleY/e.scaleY,b=qw(x),S=qw(w),k=a?x:b*p.width/m,E=a?w:S*p.height/y;if(cs(n))d=u=Math.sqrt(n);else{o&&(n.x*=2,n.y*=2),n.x*=a?x:b,n.y*=a?w:S;const t=(-n.y+y)/y,e=(n.x+m)/m,s=(n.y+y)/y,c=(-n.x+m)/m;switch(i){case Vw:u=t,l="bottom";break;case Uw:d=e,l="left";break;case Xw:u=s,l="top";break;case Kw:d=c,l="right";break;case jw:u=t,d=c,l="bottom-right";break;case Hw:u=t,d=e,l="bottom-left";break;case Yw:u=s,d=e,l="top-left";break;case Gw:u=s,d=c,l="top-right"}if(r)if("corner"===r&&i%2)r=!1;else switch(i){case Vw:case Xw:d=u;break;case Kw:case Uw:u=d;break;default:h=Math.sqrt(Jw(d*u)),d=qw(d)*h,u=qw(u)*h}}const C=1!==d,O=1!==u;if(C&&(d/=k),O&&(u/=E),!s){const{worldTransform:e}=t;d<0&&(d=1/p.width/e.scaleX),u<0&&(u=1/p.height/e.scaleY)}if($w(o||l,p,c,!0),_){const e={x:d,y:u};tv.limitScaleOf(t,c,e,r),d=e.x,u=e.y}if(C&&f){const e=p.width*t.scaleX;d=Zw(e*d,f)/e}if(O&&g){const e=p.height*t.scaleY;u=Zw(e*u,g)/e}return C&&Jw(d*v.width)<1&&(d=qw(d)/v.width),O&&Jw(u*v.height)<1&&(u=qw(u)/v.height),r&&d!==u&&(h=Math.min(Jw(d),Jw(u)),d=qw(d)*h,u=qw(u)*h),isFinite(d)||(d=1),isFinite(u)||(u=1),{origin:c,scaleX:d,scaleY:u,direction:i,lockRatio:r,around:o}},getRotateData(t,e,i,n,r){let o,s={};switch(e){case jw:o="bottom-right";break;case Hw:o="bottom-left";break;case Yw:o="top-left";break;case Gw:o="top-right";break;default:o="center"}return $w(r||o,t.boxBounds,s,!0),{origin:s,rotation:aa.getRotation(n,t.getWorldPointByBox(s),i)}},getSkewData(t,e,i,n){let r,o,s={},a=0,l=0;switch(e){case Vw:case jw:o={x:.5,y:0},r="bottom",a=1;break;case Xw:case Yw:o={x:.5,y:1},r="top",a=1;break;case Kw:case Gw:o={x:0,y:.5},r="right",l=1;break;case Uw:case Hw:o={x:1,y:.5},r="left",l=1}const{width:h,height:c}=t;o.x=o.x*h,o.y=o.y*c,$w(n||r,t,s,!0);const d=aa.getRotation(o,s,{x:o.x+(a?i.x:0),y:o.y+(l?i.y:0)});return a?a=-d:l=d,{origin:s,skewX:a,skewY:l}},getAround:(t,e)=>e&&!t?"center":t,getRotateDirection:(t,e,i=8)=>((t=(t+Math.round(e/(360/i)))%i)<0&&(t+=i),t),getFlipDirection(t,e,i){if(e)switch(t){case Kw:t=Uw;break;case jw:t=Hw;break;case Gw:t=Yw;break;case Uw:t=Kw;break;case Hw:t=jw;break;case Yw:t=Gw}if(i)switch(t){case Vw:t=Xw;break;case jw:t=Gw;break;case Hw:t=Yw;break;case Xw:t=Vw;break;case Gw:t=jw;break;case Yw:t=Hw}return t}},tb={};function eb(t,e){const{enterPoint:i,dragging:n,skewing:r,resizing:o,flippedX:s,flippedY:a}=t;if(!i||!t.editor.editing||!t.canUse)return;if("rect"===i.name)return ib(t);if("circle"===i.name)return;let{rotation:l}=t;const{pointType:h}=i,{moveCursor:c,resizeCursor:d,rotateCursor:u,skewCursor:p,moveable:f,resizeable:g,rotateable:_,skewable:v}=t.mergeConfig;if("move"===h)return i.cursor=c,void(f||(i.visible=!1));if("button"===h)return void(i.cursor||(i.cursor="pointer"));let m=h.includes("resize");m&&_&&(t.isHoldRotateKey(e)||!g)&&(m=!1);const y=v&&!m&&("resize-line"===i.name||"skew"===h),x=n?r?p:o?d:u:y?p:m?d:u;l+=45*(Qw.getFlipDirection(i.direction,s,a)+1),l=2*Math.round(Ms.formatRotation(l,!0)/2);const{url:w,x:b,y:S}=x,k=w+l;tb[k]?i.cursor=tb[k]:tb[k]=i.cursor={url:nb(w,l),x:b,y:S}}function ib(t){const{moveCursor:e,moveable:i}=t.mergeConfig;t.canUse&&(t.rect.cursor=i?e:void 0)}function nb(t,e){return'"data:image/svg+xml,'+encodeURIComponent(t.replace("{{rotation}}",e.toString()))+'"'}var rb=class extends Jg{constructor(t){super(t),this.useFastShadow=!0}},ob=["top","right","bottom","left"],sb=void 0,ab=class extends Hg{get mergeConfig(){const{config:t}=this,{mergeConfig:e,editBox:i}=this.editor;return this.mergedConfig=t&&i!==this?Object.assign(Object.assign({},e),t):e}get target(){return this._target||this.editor.element}set target(t){this._target=t}get single(){return!!this._target||this.editor.single}get transformTool(){return this._transformTool||this.editor}set transformTool(t){this._transformTool=t}get flipped(){return this.flippedX||this.flippedY}get flippedX(){return this.scaleX<0}get flippedY(){return this.scaleY<0}get flippedOne(){return this.scaleX*this.scaleY<0}get canUse(){return this.app&&this.editor.editing}get canGesture(){if(!this.canUse)return!1;const{moveable:t,resizeable:e,rotateable:i}=this.mergeConfig;return ls(t)||ls(e)||ls(i)}get canDragLimitAnimate(){return this.moving&&this.mergeConfig.dragLimitAnimate&&this.target.dragBounds}constructor(t){super(),this.view=new Hg,this.rect=new rb({name:"rect",hitFill:"all",hitStroke:"none",strokeAlign:"center",hitRadius:5}),this.circle=new rb({name:"circle",strokeAlign:"center",around:"center",cursor:"crosshair",hitRadius:5}),this.buttons=new Hg({around:"center",hitSelf:!1,visible:0}),this.resizePoints=[],this.rotatePoints=[],this.resizeLines=[],this.dragStartData={},this.__eventIds=[],this.editor=t,this.visible=!1,this.create(),this.__listenEvents()}create(){let t,e,i;const{view:n,resizePoints:r,rotatePoints:o,resizeLines:s,rect:a,circle:l,buttons:h}=this,c=["bottom-right","bottom","bottom-left","left","top-left","top","top-right","right"];for(let d=0;d<8;d++)t=new rb({name:"rotate-point",around:c[d],width:15,height:15,hitFill:"all"}),o.push(t),this.listenPointEvents(t,"rotate",d),d%2&&(e=new rb({name:"resize-line",around:"center",width:10,height:10,hitFill:"all"}),s.push(e),this.listenPointEvents(e,"resize",d)),i=new rb({name:"resize-point",hitRadius:5}),r.push(i),this.listenPointEvents(i,"resize",d);this.listenPointEvents(l,"rotate",2),this.listenPointEvents(a,"move",8),n.addMany(...o,a,l,h,...s,...r),this.add(n)}load(){const{target:t,mergeConfig:e,single:i,rect:n,circle:r,resizePoints:o,resizeLines:s}=this,{stroke:a,strokeWidth:l,ignorePixelSnap:h}=e,c=this.getPointsStyle(),d=this.getMiddlePointsStyle(),u=this.getResizeLinesStyle();let p;this.visible=!t.locked;for(let g=0;g<8;g++)p=o[g],p.set(this.getPointStyle(g%2?d[(g-1)/2%d.length]:c[g/2%c.length])),p.rotation=(g-(g%2?1:0))/2*90,g%2&&s[(g-1)/2].set(Object.assign({pointType:"resize",rotation:(g-1)/2*90},u[(g-1)/2%u.length]||{}));r.set(this.getPointStyle(e.circle||e.rotatePoint||c[0])),n.set(Object.assign({stroke:a,strokeWidth:l,opacity:1,editConfig:sb},e.rect||{}));const f=as(e.rectThrough)?i:e.rectThrough;n.hittable=!f,f&&(t.syncEventer=n,this.app.interaction.bottomList=[{target:n,proxy:t}]),i&&_s.stintSet(t.__world,"ignorePixelSnap",h),ib(this)}update(){const{editor:t}=this,{x:e,y:i,scaleX:n,scaleY:r,rotation:o,skewX:s,skewY:a,width:l,height:h}=this.target.getLayoutBounds("box",t,!0);this.visible=!this.target.locked,this.set({x:e,y:i,scaleX:n,scaleY:r,rotation:o,skewX:s,skewY:a}),this.updateBounds({x:0,y:0,width:l,height:h})}unload(){this.visible=!1,this.app&&(this.rect.syncEventer=this.app.interaction.bottomList=null)}updateBounds(t){const{editor:e,mergeConfig:i,single:n,rect:r,circle:o,buttons:s,resizePoints:a,rotatePoints:l,resizeLines:h}=this,{editMask:c}=e,{middlePoint:d,resizeable:u,rotateable:p,hideOnSmall:f,editBox:g,mask:_,dimOthers:v,bright:m,spread:y,hideRotatePoints:x,hideResizeLines:w}=i;if(c.visible=!!_||0,ss(v)&&ss(m)?e.hasDimOthers&&e.cancelDimOthers():(e.setDimOthers(v),e.setBright(!!v||m),e.hasDimOthers=!0),y&&Wa.spread(t,y),this.view.worldOpacity){const{width:e,height:c}=t,_=cs(f)?f:10,v=g&&!(f&&e<_&&c<_);let m,y,b,S={};for(let i=0;i<8;i++)ma.toPoint(ma.directionData[i],t,S),y=a[i],m=l[i],y.set(S),m.set(S),y.visible=v&&!(!u&&!p),m.visible=v&&p&&u&&!x,i%2&&(b=h[(i-1)/2],b.set(S),b.visible=y.visible&&!w,y.visible&&(y.visible=!!d),m.visible&&(m.visible=!!d),(i+1)/2%2?(b.width=e+b.height,f&&2*y.width>e&&(y.visible=!1)):(b.width=c+b.height,f&&2*y.width>c&&(y.visible=!1)));o.visible=v&&p&&!(!i.circle&&!i.rotatePoint),o.visible&&this.layoutCircle(),r.path&&(r.path=null),r.set(Object.assign(Object.assign({},t),{visible:!n||g})),s.visible=v&&s.children.length>0||0,s.visible&&this.layoutButtons()}else r.set(t)}layoutCircle(){const{circleDirection:t,circleMargin:e,buttonsMargin:i,buttonsDirection:n,middlePoint:r}=this.mergedConfig,o=ob.indexOf(t||(this.buttons.children.length&&"bottom"===n?"top":"bottom"));this.setButtonPosition(this.circle,o,e||i,!!r)}layoutButtons(){const{buttons:t}=this,{buttonsDirection:e,buttonsFixed:i,buttonsMargin:n,middlePoint:r}=this.mergedConfig,{flippedX:o,flippedY:s}=this;let a=ob.indexOf(e);(a%2&&o||(a+1)%2&&s)&&i&&(a=(a+2)%4);const l=i?Qw.getRotateDirection(a,this.flippedOne?this.rotation:-this.rotation,4):a;this.setButtonPosition(t,l,n,!!r),i&&(t.rotation=90*(l-a)),t.scaleX=o?-1:1,t.scaleY=s?-1:1}setButtonPosition(t,e,i,n){const r=this.resizePoints[2*e+1],o=e%2,s=e&&3!==e?1:-1,a=(i+(e%2?(n?r.width:0)+t.boxBounds.width:(n?r.height:0)+t.boxBounds.height)/2)*s;o?(t.x=r.x+a,t.y=r.y):(t.x=r.x,t.y=r.y+a)}getPointStyle(t){const{stroke:e,strokeWidth:i,pointFill:n,pointSize:r,pointRadius:o}=this.mergedConfig,s={fill:n,stroke:e,strokeWidth:i,around:"center",strokeAlign:"center",opacity:1,width:r,height:r,cornerRadius:o,offsetX:0,offsetY:0,editConfig:sb};return t?Object.assign(s,t):s}getPointsStyle(){const{point:t}=this.mergedConfig;return ds(t)?t:[t]}getMiddlePointsStyle(){const{middlePoint:t}=this.mergedConfig;return ds(t)?t:t?[t]:this.getPointsStyle()}getResizeLinesStyle(){const{resizeLine:t}=this.mergedConfig;return ds(t)?t:[t]}onDragStart(t){this.dragging=!0;const e=this.dragPoint=t.current,{pointType:i}=e,{moveable:n,resizeable:r,rotateable:o,skewable:s,onCopy:a}=this.mergeConfig;"move"===i?(t.altKey&&a&&a()&&this.editor.single&&this.app.interaction.replaceDownTarget(this.target),n&&(this.moving=!0)):(i.includes("rotate")||this.isHoldRotateKey(t)||!r?(o&&(this.rotating=!0),"resize-rotate"===i?r&&(this.resizing=!0):"resize-line"===e.name&&(s&&(this.skewing=!0),this.rotating=!1)):"resize"===i&&r&&(this.resizing=!0),"skew"===i&&s&&(this.skewing=!0)),this.onTransformStart(t)}onDrag(t){const{transformTool:e,moving:i,resizing:n,rotating:r,skewing:o}=this;if(i)e.onMove(t);else if(n||r||o){const i=t.current;i.pointType&&(this.enterPoint=i),r&&e.onRotate(t),n&&e.onScale(t),o&&e.onSkew(t)}eb(this,t)}onDragEnd(t){this.onTransformEnd(t),this.dragPoint=null}onTransformStart(t){(this.moving||this.gesturing)&&(this.editor.opacity=this.mergedConfig.hideOnMove?0:1),this.resizing&&(Rp.resizingKeys=this.editor.leafList.keys);const{dragStartData:e,target:i}=this;e.x=t.x,e.y=t.y,e.totalOffset={x:0,y:0},e.point={x:i.x,y:i.y},e.bounds=Object.assign({},i.getLayoutBounds("box","local")),e.rotation=i.rotation}onTransformEnd(t){this.canDragLimitAnimate&&(t instanceof rv||t instanceof sv)&&this.transformTool.onMove(t),this.resizing&&(Rp.resizingKeys=null),this.dragging=this.gesturing=this.moving=this.resizing=this.rotating=this.skewing=!1,this.editor.opacity=1,this.editor.update()}onMove(t){if(this.canGesture&&"drag"!==t.moveType&&(t.stop(),ls(this.mergedConfig.moveable)))switch(this.gesturing=this.moving=!0,t.type){case sv.START:this.onTransformStart(t);break;case sv.END:this.onTransformEnd(t);break;default:this.transformTool.onMove(t)}}onScale(t){if(this.canGesture&&(t.stop(),ls(this.mergedConfig.resizeable)))switch(this.gesturing=this.resizing=!0,t.type){case cv.START:this.onTransformStart(t);break;case cv.END:this.onTransformEnd(t);break;default:this.transformTool.onScale(t)}}onRotate(t){if(this.canGesture&&(t.stop(),ls(this.mergedConfig.rotateable)))switch(this.gesturing=this.rotating=!0,t.type){case cv.START:this.onTransformStart(t);break;case cv.END:this.onTransformEnd(t);break;default:this.transformTool.onRotate(t)}}isHoldRotateKey(t){const{rotateKey:e}=this.mergedConfig;return e?t.isHoldKeys(e):t.metaKey||t.ctrlKey}onKey(t){eb(this,t)}onArrow(t){if(this.canUse){let e=0,i=0;switch(t.code){case"ArrowDown":i=1;break;case"ArrowUp":i=-1;break;case"ArrowLeft":e=-1;break;case"ArrowRight":e=1}if(e||i){const{keyEvent:n,arrowStep:r,arrowFastStep:o}=this.mergeConfig;if(n){const n=t.shiftKey?o:r;this.transformTool.move(e*n,i*n)}}}}onDoubleTap(t){const{openInner:e,preventEditInner:i}=this.mergeConfig;"double"!==e||i||this.openInner(t)}onLongPress(t){const{openInner:e,preventEditInner:i}=this.mergeConfig;"long"===e&&i&&this.openInner(t)}openInner(t){const{editor:e,target:i}=this;if(this.single){if(i.locked)return;if(i.isBranch&&!i.editInner){if(i.textBox){const{children:t}=i,n=t.find(t=>t.editable&&t instanceof M_)||t.find(t=>t instanceof M_);if(n)return e.openInnerEditor(n)}e.openGroup(i),e.target=e.selector.findDeepOne(t)}else e.openInnerEditor()}}listenPointEvents(t,e,i){t.direction=i,t.pointType=e,this.__eventIds.push(t.on_([[rv.START,this.onDragStart,this],[rv.DRAG,this.onDrag,this],[rv.END,this.onDragEnd,this],[iv.ENTER,e=>{this.enterPoint=t,eb(this,e)}],[iv.LEAVE,()=>{this.enterPoint=null}]]))}__listenEvents(){const{rect:t,editor:e,__eventIds:i}=this;i.push(t.on_([[iv.DOUBLE_TAP,this.onDoubleTap,this],[iv.LONG_PRESS,this.onLongPress,this]])),this.waitLeafer(()=>{i.push(e.app.on_([[[dv.HOLD,dv.UP],this.onKey,this],[dv.DOWN,this.onArrow,this],[[sv.START,sv.BEFORE_MOVE,sv.END],this.onMove,this,!0],[[cv.START,cv.BEFORE_ZOOM,cv.END],this.onScale,this,!0],[[lv.START,lv.BEFORE_ROTATE,lv.END],this.onRotate,this,!0]]))})}__removeListenEvents(){this.off_(this.__eventIds)}destroy(){this.editor=null,this.__removeListenEvents(),super.destroy()}},lb={x:0,y:0,width:1e5,height:1e5},hb=class extends jg{constructor(t){super(),this.editor=t,this.hittable=!1,this.visible=0}__updateWorldBounds(){Object.assign(this.__local,lb),Object.assign(this.__world,lb)}__draw(t,e){const{editor:i}=this,{mask:n}=i.mergedConfig;if(n&&i.editing){if(t.fillWorld(t.bounds,!0===n?"rgba(0,0,0,0.8)":n),e.bounds&&!e.bounds.hit(i.editBox.rect.__world,e.matrix))return;t.saveBlendMode("destination-out"),e=Object.assign(Object.assign({},e),{shape:!0}),i.list.forEach(i=>{i.__render(t,e);const{parent:n}=i;n&&n.textBox&&n.__renderShape(t,e)}),t.restoreBlendMode()}}destroy(){this.editor=null,super.destroy()}},cb='\n<feOffset dy="1"/>\n<feGaussianBlur stdDeviation="1.5"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"/>\n<feBlend mode="normal" in="SourceGraphic" result="shape"/>',db={editSize:"size",keyEvent:!0,stroke:"#836DFF",strokeWidth:2,pointFill:"#FFFFFF",pointSize:10,pointRadius:16,rotateGap:45,arrowStep:1,arrowFastStep:10,buttonsDirection:"bottom",buttonsMargin:12,hideOnSmall:!0,moveCursor:"move",resizeCursor:{url:`\n<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#f)">\n<g transform="rotate({{rotation}},12,12)">\n<path d="M7.5 8.0H8.5V5.9L6.8 7.2L7.5 8.0ZM3 11.4L2.3 10.6L1.3 11.4L2.3 12.2L3 11.4ZM7.5 10.4H6.5V11.4H7.5V10.4ZM16.5 10.4V11.4H17.5V10.4H16.5ZM16.5 8.0L17.1 7.2L15.5 5.9V8.0H16.5ZM21 11.4L21.6 12.2L22.6 11.4L21.6 10.6L21 11.4ZM16.5 14.9H15.5V16.9L17.1 15.7L16.5 14.9ZM16.5 12.4H17.5V11.4H16.5V12.4ZM7.5 12.4V11.4H6.5V12.4H7.5ZM7.5 14.9L6.8 15.7L8.5 16.9V14.9H7.5ZM6.8 7.2L2.3 10.6L3.6 12.2L8.1 8.7L6.8 7.2ZM8.5 10.4V8.0H6.5V10.4H8.5ZM16.5 9.4H7.5V11.4H16.5V9.4ZM17.5 10.4V8.0H15.5V10.4H17.5ZM15.8 8.7L20.3 12.2L21.6 10.6L17.1 7.2L15.8 8.7ZM20.3 10.6L15.8 14.1L17.1 15.7L21.6 12.2L20.3 10.6ZM17.5 14.9V12.4H15.5V14.9H17.5ZM7.5 13.4H16.5V11.4H7.5V13.4ZM8.5 14.9V12.4H6.5V14.9H8.5ZM2.3 12.2L6.8 15.7L8.1 14.1L3.6 10.6L2.3 12.2Z" fill="white"/>\n<path fill-rule="evenodd" d="M3 11.4L7.5 8.0V10.4H16.5V8.0L21 11.4L16.5 14.9V12.4H7.5V14.9L3 11.4Z" fill="black"/>\n</g>\n</g>\n<defs>\n<filter id="f" x="-1.6" y="3.9" width="27.2" height="16.9" filterUnits="userSpaceOnUse">\n${cb}\n</filter>\n</defs>\n</svg>\n`,x:12,y:12},rotateCursor:{url:`\n<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#f)">\n<g transform="rotate(135,12,12),rotate({{rotation}},12,12)">\n<path d="M20.4 8H21.4L20.8 7.1L17.3 2.6L17 2.1L16.6 2.6L13.1 7.1L12.5 8H13.5H15.4C14.9 11.8 11.8 14.9 8 15.4V13.5V12.5L7.1 13.1L2.6 16.6L2.1 17L2.6 17.3L7.1 20.8L8 21.4V20.4V18.4C13.5 17.9 17.9 13.5 18.4 8H20.4Z" stroke="white"/>\n<path fill-rule="evenodd" d="M17 3L20.4 7.5H17.9C17.7 13.1 13.1 17.7 7.5 17.9V20.4L3 17L7.5 13.5V15.9C12.0 15.7 15.7 12.0 15.9 7.5H13.5L17 3Z" fill="black"/>\n</g>\n</g>\n<defs>\n<filter id="f" x="-1.6" y="-0.6" width="27.1" height="27.1" filterUnits="userSpaceOnUse">\n${cb}\n</filter>\n</defs>\n</svg>\n`,x:12,y:12},skewCursor:{url:`\n<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#f)">\n<g transform="rotate(90,12,12),rotate({{rotation}},12,12)">\n<path d="M21 10.4L21 11.4L23.8 11.4L21.6 9.6L21 10.4ZM17 10.4V11.4L17 11.4L17 10.4ZM15.5 6L16.1 5.2L14.5 3.9V6H15.5ZM15.5 8.4V9.4H16.5V8.4H15.5ZM6 8.4V7.4H5V8.4H6ZM6 10.4H5V11.4H6V10.4ZM7 14.4V13.4L7 13.4L7 14.4ZM3 14.4L3 13.4L0.1 13.4L2.3 15.2L3 14.4ZM8.5 18.9L7.8 19.7L9.5 21.0V18.9H8.5ZM8.5 16.4V15.4H7.5V16.4H8.5ZM19 16.4V17.4H20V16.4H19ZM19 14.4H20V13.4H19V14.4ZM21 9.4L17 9.4L17 11.4L21 11.4L21 9.4ZM14.8 6.7L20.3 11.2L21.6 9.6L16.1 5.2L14.8 6.7ZM16.5 8.4V6H14.5V8.4H16.5ZM6 9.4H15.5V7.4H6V9.4ZM7 10.4V8.4H5V10.4H7ZM15.5 9.4H6V11.4H15.5V9.4ZM17 9.4H15.5V11.4H17V9.4ZM7 15.4H8.5V13.4H7V15.4ZM3 15.4L7 15.4L7 13.4L3 13.4L3 15.4ZM9.1 18.1L3.6 13.6L2.3 15.2L7.8 19.7L9.1 18.1ZM7.5 16.4V18.9H9.5V16.4H7.5ZM19 15.4H8.5V17.4H19V15.4ZM18 14.4V16.4H20V14.4H18ZM8.5 15.4H19V13.4H8.5V15.4Z" fill="white"/>\n<path fill-rule="evenodd" d="M17 10.4L21 10.4L15.5 6V8.4H6V10.4H15.5H17ZM8.5 14.4H7L3 14.4L8.5 18.9V16.4H19V14.4H8.5Z" fill="black"/>\n</g>\n</g>\n<defs>\n<filter x="-2.8" y="1.9" width="29.6" height="23.1" filterUnits="userSpaceOnUse" >\n${cb}\n</filter>\n</defs>\n</svg>\n`,x:12,y:12},selector:!0,editBox:!0,hover:!0,select:"press",openInner:"double",multipleSelect:!0,boxSelect:!0,moveable:!0,resizeable:!0,flipable:!0,rotateable:!0,skewable:!0},ub=new Va;function pb(t){const{simulateTarget:e,list:i}=t,{zoomLayer:n}=i[0].leafer;e.safeChange(()=>{ub.setListWithFn(i,t=>t.getBounds("box","page")),0===ub.width&&(ub.width=.1),0===ub.height&&(ub.height=.1),e.reset(ub.get())}),n.add(e)}var fb=(t,e)=>t.parent.children.indexOf(t)-e.parent.children.indexOf(e),gb=(t,e)=>e.parent.children.indexOf(e)-t.parent.children.indexOf(t),_b={group(t,e,i){t.sort(gb);const{app:n,parent:r}=t[0];let o;o=i&&i.add?i:new Hg(i),r.addAt(o,r.children.indexOf(t[0])),t.sort(fb);const s=new fa(e.worldTransform);return s.divideParent(r.scrollWorldTransform),o.setTransform(s),o.editable=!0,o.hitChildren=!1,n.lockLayout(),t.forEach(t=>t.dropTo(o)),n.unlockLayout(),o},ungroup(t){const{app:e}=t[0],i=[];return e.lockLayout(),t.forEach(t=>{if(t.isBranch){const{parent:e,children:n}=t;for(;n.length;)i.push(n[0]),n[0].dropTo(e,e.children.indexOf(t));t.isBranchLeaf?i.push(t):t.remove()}else i.push(t)}),e.unlockLayout(),i},toTop(t){t.sort(fb),t.forEach(t=>{t.parent&&t.parent.add(t)})},toBottom(t){t.sort(gb),t.forEach(t=>{t.parent&&t.parent.addAt(t,0)})}},vb=Ja.get("EditToolCreator");function mb(){return t=>{xb.register(t)}}var yb=mb,xb={list:{},register(t){const{tag:e}=t.prototype;wb[e]&&vb.repeat(e),wb[e]=t},get:(t,e)=>new wb[t](e)},{list:wb}=xb,bb=class extends Cw{constructor(t,e){super(t,e)}};bb.BEFORE_OPEN="innerEditor.before_open",bb.OPEN="innerEditor.open",bb.BEFORE_CLOSE="innerEditor.before_close",bb.CLOSE="innerEditor.close";var Sb=class extends Cw{constructor(t,e){super(t,e)}};Sb.BEFORE_GROUP="editor.before_group",Sb.GROUP="editor.group",Sb.BEFORE_UNGROUP="editor.before_ungroup",Sb.UNGROUP="editor.ungroup",Sb.BEFORE_OPEN="editor.before_open_group",Sb.OPEN="editor.open_group",Sb.BEFORE_CLOSE="editor.before_close_group",Sb.CLOSE="editor.close_group";var{updateMatrix:kb}=Yu,Eb={x:1,y:1,scaleX:1,scaleY:1,rotation:1,skewX:1,skewY:1},Cb="top-left",Ob=class extends Xg{get __tag(){return"SimulateElement"}constructor(t){super(),this.checkChange=!0,this.canChange=!0,this.visible=this.hittable=!1,this.skipJSON=!0,this.on(Sp.CHANGE,e=>{if(this.checkChange&&Eb[e.attrName]){const{attrName:i,newValue:n,oldValue:r}=e,o="s"===i[0]?(n||1)/(r||1):(n||0)-(r||0);this.canChange=!1;const s=this.__;s[i]=r,kb(this.parent),kb(this);const a=new fa(this.__world);switch(s[i]=n,this.__layout.rotationChange(),kb(this),this.changedTransform=new fa(this.__world).divide(a),i){case"x":t.move(o,0);break;case"y":t.move(0,o);break;case"rotation":t.rotateOf(Cb,o);break;case"scaleX":t.scaleOf(Cb,o,1);break;case"scaleY":t.scaleOf(Cb,1,o);break;case"skewX":t.skewOf(Cb,o,0);break;case"skewY":t.skewOf(Cb,0,o)}this.canChange=!0}})}safeChange(t){this.canChange&&(this.checkChange=!1,t(),this.checkChange=!0)}},Lb=class extends Cw{constructor(t,e){super(t,e)}};Lb.BEFORE_MOVE="editor.before_move",Lb.MOVE="editor.move";var Pb=class extends Cw{constructor(t,e){super(t,e)}};Pb.BEFORE_SCALE="editor.before_scale",Pb.SCALE="editor.scale";var Tb=class extends Cw{constructor(t,e){super(t,e)}};Tb.BEFORE_ROTATE="editor.before_rotate",Tb.ROTATE="editor.rotate";var Bb=class extends Cw{constructor(t,e){super(t,e)}};Bb.BEFORE_SKEW="editor.before_skew",Bb.SKEW="editor.skew";var Rb=class extends Hg{get list(){return this.leafList.list}get dragHoverExclude(){return[this.editBox.rect]}get editing(){return!!this.list.length}get groupOpening(){return!!this.openedGroupList.length}get multiple(){return this.list.length>1}get single(){return 1===this.list.length}get dragPoint(){return this.editBox.dragPoint}get dragging(){return this.editBox.dragging}get gesturing(){return this.editBox.gesturing}get moving(){return this.editBox.moving}get resizing(){return this.editBox.resizing}get rotating(){return this.editBox.rotating}get skewing(){return this.editBox.skewing}get element(){return this.multiple?this.simulateTarget:this.list[0]}get buttons(){return this.editBox.buttons}get targetLeafer(){const t=this.list[0];return t&&t.leafer}constructor(t,e){super(e),this.leafList=new rg,this.openedGroupList=new rg,this.simulateTarget=new Ob(this),this.editBox=new ab(this),this.editToolList={},this.selector=new Nw(this),this.editMask=new hb(this),this.targetEventIds=[];let i=_s.clone(db);t&&(i=_s.default(t,i)),this.mergedConfig=this.config=i,this.addMany(this.editMask,this.selector,this.editBox),ol.has("resize")||(this.config.editSize="scale")}select(t){this.target=t}cancel(){this.target=null}hasItem(t){return this.leafList.has(t)}getItem(t){return this.list[t||0]}addItem(t){this.hasItem(t)||t.locked||(this.leafList.add(t),this.target=this.leafList.list)}removeItem(t){this.hasItem(t)&&(this.leafList.remove(t),this.target=this.leafList.list)}shiftItem(t){this.hasItem(t)?this.removeItem(t):this.addItem(t)}setDimOthers(t,e="dim",i){if(!i){const{dimTarget:t,targetLeafer:e}=this;i=t?ds(t)?t:[t]:[e]}i[0]&&i[0][e]!==(t||!1)&&i.forEach(i=>_s.stintSet(i,e,t))}setBright(t){this.setDimOthers(t,"bright",this.list)}cancelDimOthers(){this.setDimOthers(!1),this.setBright(!1),this.hasDimOthers=void 0}update(){if(this.editing){if(!this.element.parent)return this.cancel();this.innerEditing&&this.innerEditor.update(),this.editTool.update(),this.selector.update()}}updateEditBox(){this.multiple&&pb(this),this.update()}getEditTool(t){return this.editToolList[t]=this.editToolList[t]||xb.get(t,this)}updateEditTool(){if(this.unloadEditTool(),this.editing){const t=this.element;let e=t.editOuter||"EditTool";const{beforeEditOuter:i}=this.mergeConfig;if(i){const n=i({target:t,name:e});if(ls(n))e=n;else if(!1===n)return}if(xb.list[e]){const t=this.editTool=this.getEditTool(e);this.editBox.load(),t.load(),this.update()}}}unloadEditTool(){let t=this.editTool;t&&(this.editBox.unload(),t.unload(),this.editTool=null)}getEditSize(t){return this.mergeConfig.editSize}onMove(t){}onScale(t){}onRotate(t){}onSkew(t){}move(t,e=0){}scaleWithDrag(t){}scaleOf(t,e,i=e,n){}flip(t){}rotateOf(t,e){}skewOf(t,e,i=0,n){}checkTransform(t){}getWorldOrigin(t){}getChangedTransform(t){}group(t){return this.multiple&&(this.emitGroupEvent(Sb.BEFORE_GROUP),this.target=_b.group(this.list,this.element,t),this.emitGroupEvent(Sb.GROUP,this.target)),this.target}ungroup(){const{list:t}=this;return t.length&&(t.forEach(t=>t.isBranch&&this.emitGroupEvent(Sb.BEFORE_UNGROUP,t)),this.target=_b.ungroup(t),t.forEach(t=>t.isBranch&&this.emitGroupEvent(Sb.UNGROUP,t))),this.list}openGroup(t){this.emitGroupEvent(Sb.BEFORE_OPEN,t),this.openedGroupList.add(t),t.hitChildren=!0,this.emitGroupEvent(Sb.OPEN,t)}closeGroup(t){this.emitGroupEvent(Sb.BEFORE_CLOSE,t),this.openedGroupList.remove(t),t.hitChildren=!1,this.emitGroupEvent(Sb.CLOSE,t)}checkOpenedGroups(){const t=this.openedGroupList;if(t.length){let{list:e}=t;this.editing&&(e=[],t.forEach(t=>this.list.every(e=>!Yu.hasParent(e,t))&&e.push(t))),e.forEach(t=>this.closeGroup(t))}this.editing&&!this.selector.dragging&&this.checkDeepSelect()}checkDeepSelect(){let t,{list:e}=this;for(let i=0;i<e.length;i++)for(t=e[i].parent;t&&!t.hitChildren;)this.openGroup(t),t=t.parent}emitGroupEvent(t,e){const i=new Sb(t,{editTarget:e});this.emitEvent(i),e&&e.emitEvent(i)}getInnerEditor(t){return this.editToolList[t]=this.editToolList[t]||xb.get(t,this)}openInnerEditor(t,e,i){let n;if(ls(e)?n=e:i||(i=e),t&&i&&(this.target=t),this.single){t||(t=this.element),n||(n=t.editInner);const{beforeEditInner:e}=this.mergeConfig;if(e){const i=e({target:t,name:n});if(ls(i))n=i;else if(!1===i)return}xb.list[n]&&(this.editTool.unload(),this.innerEditing=!0,this.innerEditor=this.getInnerEditor(n),this.innerEditor.editTarget=t,this.emitInnerEvent(bb.BEFORE_OPEN),this.innerEditor.load(),this.emitInnerEvent(bb.OPEN))}}closeInnerEditor(t){this.innerEditing&&(this.innerEditing=!1,this.emitInnerEvent(bb.BEFORE_CLOSE),this.innerEditor.unload(),this.emitInnerEvent(bb.CLOSE),t||this.updateEditTool(),this.innerEditor=null)}emitInnerEvent(t){const{innerEditor:e}=this,{editTarget:i}=e,n=new bb(t,{editTarget:i,innerEditor:e});this.emitEvent(n),i.emitEvent(n)}lock(){this.list.forEach(t=>t.locked=!0),this.update()}unlock(){this.list.forEach(t=>t.locked=!1),this.update()}toTop(){this.list.length&&(_b.toTop(this.list),this.leafList.update())}toBottom(){this.list.length&&(_b.toBottom(this.list),this.leafList.update())}onAppRenderStart(t){(this.targetChanged=t.children.some(t=>t!==this.leafer&&t.renderer.changed))&&this.editBox.forceRender()}onRenderStart(){this.targetChanged&&this.update()}onChildScroll(){this.multiple&&this.updateEditBox()}listenTargetEvents(){if(!this.targetEventIds.length){const{app:t,leafer:e,targetLeafer:i,editMask:n}=this;this.targetEventIds=[e.on_(Dp.START,this.onRenderStart,this),i&&i.on_(Sp.SCROLL,this.onChildScroll,this),t.on_(Dp.CHILD_START,this.onAppRenderStart,this),t.on_(Ip.UPDATE_MODE,t=>{t.mode&&"normal"!==t.mode&&this.cancel()})],n.visible&&n.forceRender()}}removeTargetEvents(){const{targetEventIds:t,editMask:e}=this;t.length&&(this.off_(t),e.visible&&e.forceRender())}destroy(){this.destroyed||(this.target=this.hoverTarget=null,Object.values(this.editToolList).forEach(t=>t.destroy()),this.simulateTarget.destroy(),this.editToolList={},this.simulateTarget=this.editTool=this.innerEditor=null,super.destroy())}};kw([(t,e)=>{nu(t,e,{get(){const{config:t,element:e,dragPoint:i,editBox:n,editTool:r,innerEditor:o,app:s}=this,a=Object.assign({},t);if(o?o.editConfig&&Object.assign(a,o.editConfig):r&&r.editConfig&&Object.assign(a,r.editConfig),e&&e.editConfig){let{editConfig:t}=e;(t.hover||t.hoverStyle)&&(t=Object.assign({},t),delete t.hover,delete t.hoverStyle),Object.assign(a,t)}return n.config&&Object.assign(a,n.config),i&&(i.editConfig&&Object.assign(a,i.editConfig),"font-size"===a.editSize&&(a.lockRatio=!0),"resize-rotate"===i.pointType&&(a.around||(a.around="center"),as(a.lockRatio)&&(a.lockRatio=!0))),ss(a.dragLimitAnimate)&&(a.dragLimitAnimate=s&&s.config.pointer.dragLimitAnimate),this.mergedConfig=a}})}],Rb.prototype,"mergeConfig",void 0),kw([Ow(function(t,e){const{target:i}=t;i?(t.leafList=i instanceof rg?i:new rg(i),t.multiple&&pb(t)):(t.simulateTarget.remove(),t.leafList.reset()),t.closeInnerEditor(!0),t.unloadEditTool();const n={editor:t,value:i,oldValue:e};t.emitEvent(new Cw(Cw.SELECT,n)),t.checkOpenedGroups(),t.editing?t.waitLeafer(()=>{t.updateEditTool(),t.listenTargetEvents()}):(t.updateEditTool(),t.removeTargetEvents()),t.emitEvent(new Cw(Cw.AFTER_SELECT,n))})],Rb.prototype,"target",void 0),kw([Ow(function(t,e){t.emitEvent(new Cw(Cw.HOVER,{editor:t,value:t.hoverTarget,oldValue:e}))})],Rb.prototype,"hoverTarget",void 0),Rb=kw([Bu(class{onMove(t){const{target:e,mergeConfig:i,dragStartData:n}=this.editBox;let r,{dragLimitAnimate:o}=i;const s=t.type===sv.END||t.type===rv.END,a=ls(e.draggable),l=!o||s||a,h={x:t.totalX,y:t.totalY};t instanceof sv&&aa.move(h,e.getWorldPointByLocal(n.totalOffset,null,!0)),t.shiftKey&&(Math.abs(h.x)>Math.abs(h.y)?h.y=0:h.x=0),r=rv.getValidMove(e,n.point,h,l),(r.x||r.y)&&(o&&!a&&s?Yu.animateMove(this,r,cs(o)?o:.3):this.move(r))}onScale(t){const{target:e,mergeConfig:i,single:n,dragStartData:r}=this.editBox;let o,{around:s,lockRatio:a,flipable:l,editSize:h}=i;t instanceof cv?(s||(s=e.getBoxPoint(t)),o=t.totalScale):o=t.getInnerTotal(e);const{direction:c}=t.current;(t.shiftKey||e.lockRatio)&&(a=!0);const d=Qw.getScaleData(e,r.bounds,c,o,a,Qw.getAround(s,t.altKey),l,!n||"scale"===h),u=e.x,p=e.y;t instanceof rv&&this.editTool&&this.editTool.onScaleWithDrag?(d.drag=t,this.scaleWithDrag(d)):this.scaleOf(d.origin,d.scaleX,d.scaleY),aa.move(r.totalOffset,e.x-u,e.y-p)}onRotate(t){const{target:e,mergeConfig:i,dragStartData:n}=this.editBox,{around:r,rotateAround:o,rotateGap:s,diagonalRotateKey:a}=i,{direction:l}=t.current;let h,c;if(t instanceof lv)c=t.rotation,h=o?ma.getPoint(o,e.boxBounds):e.getBoxPoint(t);else{const i=a?t.isHoldKeys(a):t.shiftKey,s=Qw.getRotateData(e,l,t,n,i?null:o||e.around||e.origin||r||"center");c=n.rotation+s.rotation-e.rotation,h=s.origin}if(c=Ms.float(Ms.getGapRotation(c,s,e.rotation),2),!c)return;const d=e.x,u=e.y;this.rotateOf(h,c),aa.move(n.totalOffset,e.x-d,e.y-u)}onSkew(t){const{target:e,mergeConfig:i}=this.editBox,{around:n}=i,{origin:r,skewX:o,skewY:s}=Qw.getSkewData(e.boxBounds,t.current.direction,t.getInnerMove(e),Qw.getAround(n,t.altKey));(o||s)&&this.skewOf(r,o,s)}move(t,e=0){if(!this.checkTransform("moveable"))return;us(t)&&(e=t.y,t=t.x);const{target:i,mergeConfig:n,single:r,editor:o}=this.editBox,{beforeMove:s}=n;if(s){const n=s({target:i,x:t,y:e});if(us(n))t=n.x,e=n.y;else if(!1===n)return}const a=i.getWorldPointByLocal({x:t,y:e},null,!0);r||i.safeChange(()=>i.move(t,e));const l={target:i,editor:o,moveX:a.x,moveY:a.y};this.emitEvent(new Lb(Lb.BEFORE_MOVE,l));const h=new Lb(Lb.MOVE,l);this.doMove(h),this.emitEvent(h)}scaleWithDrag(t){if(!this.checkTransform("resizeable"))return;const{target:e,mergeConfig:i,editor:n}=this.editBox,{beforeScale:r}=i;if(r){const{origin:i,scaleX:n,scaleY:o,drag:s}=t;if(!1===r({target:e,drag:s,origin:i,scaleX:n,scaleY:o}))return}t=Object.assign(Object.assign({},t),{target:e,editor:n,worldOrigin:e.getWorldPoint(t.origin)}),this.emitEvent(new Pb(Pb.BEFORE_SCALE,t));const o=new Pb(Pb.SCALE,t);this.editTool.onScaleWithDrag(o),this.emitEvent(o)}scaleOf(t,e,i=e,n){if(!this.checkTransform("resizeable"))return;const{target:r,mergeConfig:o,single:s,editor:a}=this.editBox,{beforeScale:l}=o;if(l){const n=l({target:r,origin:t,scaleX:e,scaleY:i});if(us(n))e=n.scaleX,i=n.scaleY;else if(!1===n)return}const h=this.getWorldOrigin(t),c=!s&&this.getChangedTransform(()=>r.safeChange(()=>r.scaleOf(t,e,i))),d={target:r,editor:a,worldOrigin:h,scaleX:e,scaleY:i,transform:c};this.emitEvent(new Pb(Pb.BEFORE_SCALE,d));const u=new Pb(Pb.SCALE,d);this.doScale(u),this.emitEvent(u)}flip(t){if(!this.checkTransform("resizeable"))return;const{target:e,single:i,editor:n}=this.editBox,r=this.getWorldOrigin("center"),o=i?new fa(Yu.getFlipTransform(e,t)):this.getChangedTransform(()=>e.safeChange(()=>e.flip(t))),s={target:e,editor:n,worldOrigin:r,scaleX:"x"===t?-1:1,scaleY:"y"===t?-1:1,transform:o};this.emitEvent(new Pb(Pb.BEFORE_SCALE,s));const a=new Pb(Pb.SCALE,s);this.doScale(a),this.emitEvent(a)}rotateOf(t,e){if(!this.checkTransform("rotateable"))return;const{target:i,mergeConfig:n,single:r,editor:o}=this.editBox,{beforeRotate:s}=n;if(s){const n=s({target:i,origin:t,rotation:e});if(cs(n))e=n;else if(!1===n)return}const a=this.getWorldOrigin(t),l=!r&&this.getChangedTransform(()=>i.safeChange(()=>i.rotateOf(t,e))),h={target:i,editor:o,worldOrigin:a,rotation:e,transform:l};this.emitEvent(new Tb(Tb.BEFORE_ROTATE,h));const c=new Tb(Tb.ROTATE,h);this.doRotate(c),this.emitEvent(c)}skewOf(t,e,i=0,n){if(!this.checkTransform("skewable"))return;const{target:r,mergeConfig:o,single:s,editor:a}=this.editBox,{beforeSkew:l}=o;if(l){const n=l({target:r,origin:t,skewX:e,skewY:i});if(us(n))e=n.skewX,i=n.skewY;else if(!1===n)return}const h=this.getWorldOrigin(t),c=!s&&this.getChangedTransform(()=>r.safeChange(()=>r.skewOf(t,e,i))),d={target:r,editor:a,worldOrigin:h,skewX:e,skewY:i,transform:c};this.emitEvent(new Bb(Bb.BEFORE_SKEW,d));const u=new Bb(Bb.SKEW,d);this.doSkew(u),this.emitEvent(u)}doMove(t){this.editTool.onMove(t)}doScale(t){this.editTool.onScale(t)}doRotate(t){this.editTool.onRotate(t)}doSkew(t){this.editTool.onSkew(t)}checkTransform(t){const{target:e,mergeConfig:i}=this.editBox;return e&&!e.locked&&i[t]}getWorldOrigin(t){const{target:e}=this.editBox;return e.getWorldPoint(Yu.getInnerOrigin(e,t))}getChangedTransform(t){const{target:e,single:i}=this.editBox;if(!i&&!e.canChange)return e.changedTransform;const n=new fa(e.worldTransform);return t(),new fa(e.worldTransform).divide(n)}emitEvent(t,e){this.editBox.editor.emitEvent(t,e)}},["editBox","editTool","emitEvent"])],Rb);var Ab=class{static registerInnerEditor(){xb.register(this)}get tag(){return"InnerEditor"}get mode(){return"focus"}get editBox(){return this._editBox||this.editor.editBox}set editBox(t){this._editBox=t}constructor(t){this.eventIds=[],this.editor=t,this.create()}onCreate(){}create(){this.view=new Hg,this.onCreate()}onLoad(){}load(){const{editor:t}=this;t&&(t.app&&"focus"===this.mode&&(t.selector.hittable=t.app.tree.hitChildren=!1),this.onLoad())}onUpdate(){}update(){this.onUpdate()}onUnload(){}unload(){const{editor:t}=this;t&&(t.app&&"focus"===this.mode&&(t.selector.hittable=t.app.tree.hitChildren=!0),this.onUnload())}onDestroy(){}destroy(){this.onDestroy(),this.editor&&(this.view&&this.view.destroy(),this.eventIds&&this.editor.off_(this.eventIds),this.editor=this.view=this.eventIds=null)}},Mb=class extends Ab{static registerEditTool(){xb.register(this)}get tag(){return"EditTool"}onMove(t){const{moveX:e,moveY:i,editor:n}=t,{app:r,list:o}=n;r.lockLayout(),o.forEach(t=>{t.moveWorld(e,i)}),r.unlockLayout()}onScale(t){const{scaleX:e,scaleY:i,transform:n,worldOrigin:r,editor:o}=t,{app:s,list:a}=o;s.lockLayout(),a.forEach(t=>{const s="scale"!==o.getEditSize(t);n?t.transformWorld(n,s):t.scaleOfWorld(r,e,i,s)}),s.unlockLayout()}onRotate(t){const{rotation:e,transform:i,worldOrigin:n,editor:r}=t,{app:o,list:s}=r;o.lockLayout(),s.forEach(t=>{const o="scale"!==r.getEditSize(t);i?t.transformWorld(i,o):t.rotateOfWorld(n,e)}),o.unlockLayout()}onSkew(t){const{skewX:e,skewY:i,transform:n,worldOrigin:r,editor:o}=t,{app:s,list:a}=o;s.lockLayout(),a.forEach(t=>{const s="scale"!==o.getEditSize(t);n?t.transformWorld(n,s):t.skewOfWorld(r,e,i,s)}),s.unlockLayout()}load(){this.editBox.view.visible=!0,this.onLoad()}update(){this.editBox.update(),this.onUpdate()}unload(){this.editBox.view.visible=!1,this.onUnload()}};Mb=kw([mb()],Mb);var{left:Db,right:Ib}=Ks,{move:Fb,copy:Wb,toNumberPoints:zb}=aa,Nb=class extends Mb{constructor(){super(...arguments),this.scaleOfEvent=!0}get tag(){return"LineEditTool"}onScaleWithDrag(t){const{drag:e,direction:i,lockRatio:n,around:r}=t,o=t.target,s=i===Db;if(o.pathInputed){const{path:t}=o.__,{from:i,to:a}=this.getFromToByPath(t);this.dragPoint(i,a,s,r,this.getInnerMove(o,e,n)),t[1]=i.x,t[2]=i.y,t[4]=a.x,t[5]=a.y,o.path=t}else if(o.points){const{points:t}=o,{from:i,to:a}=this.getFromToByPoints(t);this.dragPoint(i,a,s,r,this.getInnerMove(o,e,n)),t[0]=i.x,t[1]=i.y,t[2]=a.x,t[3]=a.y,o.points=t}else{const t={x:0,y:0},{toPoint:i}=o;o.rotation=0,this.dragPoint(t,i,s,r,this.getInnerMove(o,e,n)),o.getLocalPointByInner(t,null,null,!0),o.getLocalPointByInner(i,null,null,!0),o.x=t.x,o.y=t.y,o.getInnerPointByLocal(i,null,null,!0),o.toPoint=i}}getInnerMove(t,e,i){const n=e.getInnerMove(t);return i&&(Math.abs(n.x)>Math.abs(n.y)?n.y=0:n.x=0),n}getFromToByPath(t){return{from:{x:t[1],y:t[2]},to:{x:t[4],y:t[5]}}}getFromToByPoints(t){const e=zb(t);return{from:{x:e[0],y:e[1]},to:{x:e[2],y:e[3]}}}dragPoint(t,e,i,n,r){const{x:o,y:s}=r;i?(Fb(t,o,s),n&&Fb(e,-o,-s)):(n&&Fb(t,-o,-s),Fb(e,o,s))}onSkew(t){}onUpdate(){const{editBox:t}=this,{rotatePoints:e,resizeLines:i,resizePoints:n,rect:r}=t,o=t.target;let s,a;if(o.pathInputed?s=this.getFromToByPath(o.__.path):o.points&&(s=this.getFromToByPoints(o.__.points)),s){const{from:i,to:a}=s;o.innerToWorld(i,i,!1,t),o.innerToWorld(a,a,!1,t),r.pen.clearPath().moveTo(i.x,i.y).lineTo(a.x,a.y),Wb(n[7],i),Wb(e[7],i),Wb(n[3],a),Wb(e[3],a)}for(let l=0;l<8;l++)l<4&&(i[l].visible=!1),a=l===Db||l===Ib,n[l].visible=a,e[l].visible=!s&&a}};function jb(t){const{scroll:e,disabled:i}=t.app.config.move;return!e||i?"":!0===e?"free":e}function Vb(t,e,i){(function(t,e){const i={wheel:{preventDefault:!0},touch:{preventDefault:!0},pointer:{preventDefaultMenu:!0}};e&&_s.assign(i,e),_s.assign(t.config,i,t.userConfig)})(t.parentApp?t.parentApp:t,e),t.isApp||i||t.__eventIds.push(t.on_(sv.BEFORE_MOVE,e=>{const i=t.getValidMove(e.moveX,e.moveY,!1);if(jb(t).includes("limit")){const n=t.getValidMove(0,0);if(n.x||n.y){const t=100,r=200,o="drag"===e.moveType?.3:.05;Math.abs(n.x)>t?i.x=0:i.x*=o,Math.abs(n.y)>r?i.y=0:i.y*=o}}t.zoomLayer.move(i)}),t.on_(sv.DRAG_ANIMATE,()=>{const e=t.getValidMove(0,0);(e.x||e.y)&&t.interaction.stopDragAnimate()}),t.on_(sv.END,e=>{Yu.animateMove(t.zoomLayer,t.getValidMove(e.moveX,e.moveY))}),t.on_(cv.BEFORE_ZOOM,e=>{const{zoomLayer:i,layouter:n}=t,r=t.getValidScale(e.scale);1!==r&&(n.stop(),Yu.updateMatrix(t),i.scaleOfWorld(e,r),n.start())}))}Nb=kw([mb()],Nb),ol.add("editor","resize"),sl.editor=function(t,e){const i=new Rb(t);return e&&e.sky.add(e.editor=i),i},Jg.addAttr("textBox",!1,su),jg.addAttr("editConfig",void 0,su),jg.addAttr("editOuter",t=>(t.updateLayout(),t.__.__isLinePath?"LineEditTool":"EditTool"),su),jg.addAttr("editInner","PathEditor",su),Hg.addAttr("editInner","",su),M_.addAttr("editInner","TextEditor",su),jg.setEditConfig=function(t){this.changeAttr("editConfig",t)},jg.setEditOuter=function(t){this.changeAttr("editOuter",t)},jg.setEditInner=function(t){this.changeAttr("editInner",t)};var Hb=Ja.get("LeaferTypeCreator"),Ub={list:{},register(t,e){Yb[t]&&Hb.repeat(t),Yb[t]=e},run(t,e){const i=Yb[t];i&&i(e)}},{list:Yb,register:Xb}=Ub;Xb("viewport",Vb),Xb("custom",function(t){Vb(t,null,!0)}),Xb("design",function(t){Vb(t,{zoom:{min:.01,max:256},move:{holdSpaceKey:!0,holdMiddleKey:!0}})}),Xb("document",function(t){Vb(t,{zoom:{min:1},move:{scroll:"limit"}})});var Gb,Kb,$b,Zb,qb={state:{type:"none",typeCount:0,startTime:0,totalData:null,center:{}},getData(t){const e=t[0],i=t[1],n=aa.getCenter(e.from,i.from),r=aa.getCenter(e.to,i.to),o={x:r.x-n.x,y:r.y-n.y},s=aa.getDistance(e.from,i.from);return{move:o,scale:aa.getDistance(e.to,i.to)/s,rotation:aa.getRotation(e.from,i.from,e.to,i.to),center:r}},getType(t,e){const i=Math.hypot(t.move.x,t.move.y)/(e.move||5),n=Math.abs(t.scale-1)/(e.scale||.03),r=Math.abs(t.rotation)/(e.rotation||2);return i<1&&n<1&&r<1?"none":i>=n&&i>=r?"move":n>=r?"zoom":"rotate"},detect(t,e){const{state:i}=Jb,n=Jb.getType(t,e);if(i.totalData||(i.startTime=Date.now(),i.center=t.center),Jb.add(t,i.totalData),i.totalData=t,n===i.type){if(i.typeCount++,i.typeCount>=(e.count||3)&&"none"!==n)return n}else i.type=n,i.typeCount=1;return Date.now()-i.startTime>=(e.time||160)?Jb.getType(i.totalData,e):"none"},add(t,e){e&&(aa.move(t.move,e.move),t.scale*=e.scale,t.rotation+=e.rotation,t.center=e.center)},reset(){const{state:t}=Jb;t.type="none",t.typeCount=0,t.startTime=0,t.totalData=null}},Jb=qb,{abs:Qb,max:tS}=Math,{sign:eS,within:iS}=Ms,nS={getMove(t,e){let{moveSpeed:i}=e,{deltaX:n,deltaY:r}=t;t.shiftKey&&!n&&(n=r,r=0);const o=Qb(n),s=Qb(r);return o>50&&(n=tS(50,o/3)*eS(n)),s>50&&(r=tS(50,s/3)*eS(r)),{x:-n*i*2,y:-r*i*2}},getScale(t,e){let i,n=1,{zoomMode:r,zoomSpeed:o}=e;const s=t.deltaY||t.deltaX;if(r?(i="mouse"===r||!t.deltaX&&($a.intWheelDeltaY?Math.abs(s)>17:Math.ceil(s)!==s),(t.shiftKey||t.metaKey||t.ctrlKey)&&(i=!0)):i=!t.shiftKey&&(t.metaKey||t.ctrlKey),i){o=iS(o,0,1);const i=t.deltaY?e.delta.y:e.delta.x,r=iS(1-Qb(s)/(4*i)*o,.5,2);n=s>0?r:1/r}return n}},rS=class{get transforming(){return this.moving||this.zooming||this.rotating}get moving(){return!!this.moveData}get zooming(){return!!this.zoomData}get rotating(){return!!this.rotateData}constructor(t){this.interaction=t}move(t){const{interaction:e}=this;t.moveType||(t.moveType="move"),this.moveData||(this.setPath(t),Gb=0,Kb=0,this.moveData=Object.assign(Object.assign({},t),{moveX:0,moveY:0,totalX:Gb,totalY:Kb}),e.emit(sv.START,this.moveData)),t.path=this.moveData.path,t.totalX=Gb+=t.moveX,t.totalY=Kb+=t.moveY,e.emit(sv.BEFORE_MOVE,t),e.emit(sv.MOVE,t),this.transformEndWait()}zoom(t){const{interaction:e}=this;this.zoomData||(this.setPath(t),$b=1,this.zoomData=Object.assign(Object.assign({},t),{scale:1,totalScale:$b}),e.emit(cv.START,this.zoomData)),t.path=this.zoomData.path,t.totalScale=$b*=t.scale,e.emit(cv.BEFORE_ZOOM,t),e.emit(cv.ZOOM,t),this.transformEndWait()}rotate(t){const{interaction:e}=this;this.rotateData||(this.setPath(t),Zb=0,this.rotateData=Object.assign(Object.assign({},t),{rotation:0,totalRotation:Zb}),e.emit(lv.START,this.rotateData)),t.path=this.rotateData.path,t.totalRotation=Zb+=t.rotation,e.emit(lv.BEFORE_ROTATE,t),e.emit(lv.ROTATE,t),this.transformEndWait()}setPath(t){const{interaction:e}=this,{path:i}=e.selector.getByPoint(t,e.hitRadius);t.path=i,e.cancelHover()}transformEndWait(){clearTimeout(this.transformTimer),this.transformTimer=setTimeout(()=>{this.transformEnd()},this.interaction.p.transformTime)}transformEnd(){const{interaction:t,moveData:e,zoomData:i,rotateData:n}=this;e&&t.emit(sv.END,Object.assign(Object.assign({},e),{totalX:Gb,totalY:Kb})),i&&t.emit(cv.END,Object.assign(Object.assign({},i),{totalScale:$b})),n&&t.emit(lv.END,Object.assign(Object.assign({},n),{totalRotation:Zb})),this.reset()}reset(){this.zoomData=this.moveData=this.rotateData=null}destroy(){this.reset()}},oS=Yg.prototype,sS=new Va,aS=new pa;function lS(t,e){return Object.assign(Object.assign({},e),{moveX:t.x,moveY:t.y})}function hS(t,e){return Object.assign(Object.assign({},e),{scale:t})}oS.initType=function(t){Ub.run(t,this)},oS.getValidMove=function(t,e,i=!0){const{disabled:n,scrollSpread:r}=this.app.config.move;aS.set(t,e);const o=jb(this);return o&&(o.includes("x")?aS.y=0:o.includes("y")?aS.x=0:Math.abs(aS.x)>Math.abs(aS.y)?aS.y=0:aS.x=0,i&&o.includes("limit")&&(sS.set(this.__world).addPoint(this.zoomLayer),r&&sS.spread(r),tv.getValidMove(sS,this.canvas.bounds,"auto",aS,!0),o.includes("x")?aS.y=0:o.includes("y")&&(aS.x=0))),{x:n?0:aS.x,y:n?0:aS.y}},oS.getValidScale=function(t){const{scaleX:e}=this.zoomLayer.__,{min:i,max:n,disabled:r}=this.app.config.zoom,o=Math.abs(e*t);return i&&o<i?t=i/e:n&&o>n&&(t=n/e),r?1:t};var cS=Lv.prototype;cS.createTransformer=function(){this.transformer=new rS(this)},cS.move=function(t){this.transformer.move(t)},cS.zoom=function(t){this.transformer.zoom(t)},cS.rotate=function(t){this.transformer.rotate(t)},cS.transformEnd=function(){this.transformer.transformEnd()},cS.wheel=function(t){const{wheel:e,pointer:i}=this.config,{posDeltaSpeed:n,negDeltaSpeed:r}=e;if(e.disabled)return;t.deltaX>0?n&&(t.deltaX*=n):r&&(t.deltaX*=r),t.deltaY>0?n&&(t.deltaY*=n):r&&(t.deltaY*=r);const o=e.getScale?e.getScale(t,e):nS.getScale(t,e);if(1!==o)this.zoom(hS(o,t));else{const n=e.getMove?e.getMove(t,e):nS.getMove(t,e);i.snap&&aa.round(n),this.move(lS(n,t))}},cS.multiTouch=function(t,e){const{disabled:i,singleGesture:n}=this.config.multiTouch;if(i)return;this.pointerWaitCancel();let r=qb.getData(e),{moving:o,zooming:s,rotating:a}=this.transformer;if(n){if(!this.transformer.transforming){switch(qb.detect(r,us(n)?n:{})){case"move":o=!0;break;case"zoom":s=!0;break;case"rotate":a=!0;break;default:return}qb.reset()}o||(r.center=qb.state.center)}else o=s=a=!0;var l,h;Object.assign(t,r.center),t.multiTouch=!0,a&&this.rotate((l=r.rotation,h=t,Object.assign(Object.assign({},h),{rotation:l}))),s&&this.zoom(hS(r.scale,t)),o&&this.move(lS(r.move,t))};var dS=mv.prototype,{abs:uS,min:pS,max:fS,hypot:gS}=Math;function _S(t,e){let i=1;const n="out"===e,r=Math.abs(t);if(r>1){for(;n?i<r:i<=r;)i*=2;n&&(i/=2)}else{for(;n?i>=r:i>r;)i/=2;n||(i*=2)}return i/t}dS.checkDragEndAnimate=function(t){const{interaction:e}=this,i=this.canAnimate&&this.moving&&e.m.dragAnimate;if(i){const n=cs(i)?i:.95,r=.15,o=150;let s,a,l,h=0,c=0,d=0,u=0,p=3;const{dragDataList:f}=this,g=f.length;for(let t=g-1;t>=fS(g-3,0)&&(l=f[t],!(l.time&&Date.now()-l.time>100));t--)s=p--,h+=l.moveX*s,c+=l.moveY*s,u+=s,a=gS(l.moveX,l.moveY),a>d&&(d=a);if(u&&(h/=u,c/=u),d>8){const t=1.15+.4500000000000002*pS((d-8)/17,1);h*=t,c*=t}const _=fS(uS(h),uS(c));_>o&&(a=o/_,h*=a,c*=a);const v=()=>{if(h*=n,c*=n,t=Object.assign({},t),uS(h)<r&&uS(c)<r)return this.dragEndReal(t);aa.move(t,h,c),this.drag(t),this.animate(v),e.emit(sv.DRAG_ANIMATE,t)};this.animate(v)}return i},dS.animate=function(t,e){const i=t||this.animateWait;i&&this.interaction.target.nextRender(i,null,e),this.animateWait=t},dS.stopAnimate=function(){this.animate(null,"off"),this.interaction.target.nextRender(()=>{this.dragData&&this.dragEndReal(this.dragData)})},dS.checkDragOut=function(t){const{interaction:e}=this;this.autoMoveCancel(),this.dragging&&!e.shrinkCanvasBounds.hitPoint(t)&&this.autoMoveOnDragOut(t)},dS.autoMoveOnDragOut=function(t){const{interaction:e,downData:i,canDragOut:n}=this,{autoDistance:r,dragOut:o}=e.m;if(!o||!n||!r)return;const s=e.shrinkCanvasBounds,{x:a,y:l}=s,h=Wa.maxX(s),c=Wa.maxY(s),d=t.x<a?r:h<t.x?-r:0,u=t.y<l?r:c<t.y?-r:0;let p=0,f=0;this.autoMoveTimer=setInterval(()=>{p+=d,f+=u,aa.move(i,d,u),aa.move(this.dragData,d,u),e.move(Object.assign(Object.assign({},t),{moveX:d,moveY:u,totalX:p,totalY:f,moveType:"drag"})),e.pointerMoveReal(t)},10)},dS.autoMoveCancel=function(){this.autoMoveTimer&&(clearInterval(this.autoMoveTimer),this.autoMoveTimer=0)},ol.add("viewport"),ol.add("view"),Yg.prototype.zoom=function(t,e,i,n){let r;!function(t){return us(t)&&!ds(t)}(e)?r=e:(r=e.padding,i=e.scroll,n=e.transition);const{zoomLayer:o}=this,s=this.canvas.bounds.clone().shrink(as(r)?30:r),a=new Va,l={x:s.x+s.width/2,y:s.y+s.height/2};let h;o.killAnimate();const{x:c,y:d,scaleX:u,scaleY:p}=o.__,{boxBounds:f}=o;if(ls(t))switch(t){case"in":h=_S(u,"in");break;case"out":h=_S(u,"out");break;case"fit":t=f;break;case"fit-width":(t=new Va(f)).height=0;break;case"fit-height":(t=new Va(f)).width=0}else cs(t)&&(h=t/u);if(h)h=this.getValidScale(h),o.scaleOfWorld(l,h,h,!1,n);else if(us(t)){const e={x:c,y:d,scaleX:u,scaleY:p},r=ds(t);if(r||t.tag){const e=r?t:[t];a.setListWithFn(e,tp.worldBounds)}else{const e=function(t,e){let i,{x:n,y:r,width:o,height:s}=t;return s||(s=o*(e.height/e.width),i=!0),o||(o=s*(e.width/e.height),i=!0),i?{x:n,y:r,width:o,height:s}:t}(t,s);a.set(o.getWorldBounds(e))}const{width:l,height:f}=a;let g=s.x-a.x,_=s.y-a.y;return i?(g+=Math.max((s.width-l)/2,0),_+=Math.max((s.height-f)/2,0)):(h=this.getValidScale(Math.min(s.width/l,s.height/f)),g+=(s.width-l*h)/2,_+=(s.height-f*h)/2,aa.scaleOf(e,a,h),a.scaleOf(a,h),e.scaleX*=h,e.scaleY*=h),"x"===i?_=0:"y"===i&&(g=0),aa.move(e,g,_),a.move(g,_),o.set(e,n),a}return o.worldBoxBounds};var vS=class{constructor(t){this.undoStack=[],this.redoStack=[],this.limit=50,void 0!==t&&t>0&&(this.limit=t)}executeCommand(t){t.execute(),this.undoStack.push(t),this.redoStack=[],this.undoStack.length>this.limit&&this.undoStack.shift()}undo(){if(this.canUndo()){const t=this.undoStack.pop();t&&(t.undo(),this.redoStack.push(t))}}redo(){if(this.canRedo()){const t=this.redoStack.pop();t&&(t.execute(),this.undoStack.push(t))}}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}clear(){this.undoStack=[],this.redoStack=[]}},mS=class{container;element;dataArray;pointData;constructor(t,e,i,n){this.container=t,this.element=e,this.dataArray=i,this.pointData=n}execute(){this.container.add(this.element),this.dataArray.push(this.pointData)}undo(){this.container.remove(this.element);const t=this.dataArray.findIndex(t=>t.id===this.pointData.id);t>-1&&this.dataArray.splice(t,1)}},yS=class{container;element;dataArray;insertIndex;constructor(t,e,i){this.container=t,this.element=e,this.dataArray=i,this.insertIndex=i.findIndex(t=>t.id===e.data.id)}execute(){this.container.remove(this.element);const t=this.dataArray.findIndex(t=>t.id===this.element.data.id);t>-1&&this.dataArray.splice(t,1)}undo(){this.container.add(this.element),this.insertIndex>-1&&this.insertIndex<=this.dataArray.length?this.dataArray.splice(this.insertIndex,0,this.element.data):this.dataArray.push(this.element.data)}},xS=class{canvasBrush;beforeSnapshot;afterSnapshot;isFirstExecute;isClearOperation;constructor(t,e,i=!1){this.canvasBrush=t,this.beforeSnapshot=e,this.afterSnapshot="",this.isFirstExecute=!0,this.isClearOperation=i}execute(){this.isFirstExecute?(this.isClearOperation?this.afterSnapshot="":this.afterSnapshot=this.canvasBrush.getImageData(),this.isFirstExecute=!1):this.afterSnapshot?this.canvasBrush.restoreImageData(this.afterSnapshot):this.canvasBrush.clear()}undo(){this.canvasBrush.restoreImageData(this.beforeSnapshot)}redo(){this.afterSnapshot?this.canvasBrush.restoreImageData(this.afterSnapshot):this.canvasBrush.clear()}};var wS=["Shift","Meta","Alt","Control"],bS="object"==typeof navigator?navigator.platform:"",SS=/Mac|iPod|iPhone|iPad/.test(bS),kS=SS?"Meta":"Control",ES="Win32"===bS?["Control","Alt"]:SS?["Alt"]:[];function CS(t,e){return"function"==typeof t.getModifierState&&(t.getModifierState(e)||ES.includes(e)&&t.getModifierState("AltGraph"))}function OS(t){return t.trim().split(" ").map(function(t){var e=t.split(/\b\+/),i=e.pop(),n=i.match(/^\((.+)\)$/);return n&&(i=new RegExp("^"+n[1]+"$")),[e=e.map(function(t){return"$mod"===t?kS:t}),i]})}function LS(t,e){var i=e[0],n=e[1];return!((n instanceof RegExp?!n.test(t.key)&&!n.test(t.code):n.toUpperCase()!==t.key.toUpperCase()&&n!==t.code)||i.find(function(e){return!CS(t,e)})||wS.find(function(e){return!i.includes(e)&&n!==e&&CS(t,e)}))}function PS(t,e){var i;void 0===e&&(e={});var n=null!=(i=e.timeout)?i:1e3,r=Object.keys(t).map(function(e){return[OS(e),t[e]]}),o=new Map,s=null;return function(t){t instanceof KeyboardEvent&&(r.forEach(function(e){var i=e[0],n=e[1],r=o.get(i)||i;LS(t,r[0])?r.length>1?o.set(i,r.slice(1)):(o.delete(i),n(t)):CS(t,t.key)||o.delete(i)}),s&&clearTimeout(s),s=setTimeout(o.clear.bind(o),n))}}var TS={circleRadius:12,circleFill:"#ff4d4f",circleStroke:"#ffffff",circleStrokeWidth:2,hoverCircleFill:"#ff7875",hoverCircleStroke:"#ffffff",selectedCircleFill:"#1890ff",selectedCircleStroke:"#ffffff",selectedCircleScale:1.2,labelBackgroundColor:"#ffffff",labelTextColor:"#333333",labelFontSize:12,labelPadding:[2,4],fixedSizeOnZoom:!1,fixedSizeScale:1},BS={color:"rgba(255,0,0,1)",opacity:.55,size:100,minSize:50,maxSize:150,continuity:28};function RS(t,e){return ou(t,t=>({set(i){this.__setAttr(t,i),this.leaferIsReady?e?yg.setStyleName(this,e,i):yg.set(this,i):this.__layout.stateStyleChanged=!0}}))}function AS(t){return ou(t,t=>({set(e){this.__setAttr(t,e),this.__layout.stateStyleChanged=!0}}))}function MS(t,e){if(e&&!0!==e)return e;if(!t.button){let{parent:e}=t;for(let t=0;t<2;t++)if(e){if(e.button)return e;e=e.parent}}return null}function DS(t,e){us(e)||(e=void 0),WS(t,e,"in")}function IS(t,e){const{normalStyle:i}=t;us(e)||(e=void 0),i&&(e||(e=i),WS(t,e,"out"))}var FS={};function WS(t,e,i){const{normalStyle:n}=t;e||(e=FS),e.scale&&(Ms.assignScale(e,e.scale),delete e.scale),e!==FS&&yg.canAnimate||(i=null);let r=!!i&&function(t,e,i){let n="in"===t?"transition":"transitionOut";return"out"===t&&as(i[n])&&as(e[n])&&(n="transition"),as(e[n])?i[n]:e[n]}(i,e,t);const o=r?function(t,e){const i=jS(e,t),n=t.animate();return n&&jS(i,t,n.fromStyle),i}(t,e):void 0;yg.canAnimate&&zS(t)&&t.killAnimate("transition"),n&&t.set(n,"temp");const s=zS(t);if(s){const{animation:n}=s;if(n){const o=t.animate(n,void 0,"animation",!0);Object.assign(s,o.endingStyle),"in"!==i||e.animation!==n?o.kill():r=!1,delete s.animation}t.normalStyle=NS(s,t),t.set(s,"temp")}else t.normalStyle=void 0;if(r){const e=NS(o,t);t.set(o,"temp"),t.animate([o,e],r,"transition",!0)}t.__layout.stateStyleChanged=!1}function zS(t){let e;const i={},n=MS(t),r=n?t.state||n.state:t.state,o=r&&t.states[r];o&&yg.isState(r,t,n)&&(e=VS(i,o));const s=i.selectedStyle||t.selectedStyle;s&&yg.isSelected(t,n)&&(e=VS(i,s));const a=i.placeholderStyle||t.placeholderStyle;if(a&&yg.isPlacehold(t,n)&&(e=VS(i,a)),yg.isDisabled(t,n)){const n=i.disabledStyle||t.disabledStyle;n&&(e=VS(i,n))}else{const r=i.focusStyle||t.focusStyle;r&&yg.isFocus(t,n)&&(e=VS(i,r));const o=i.hoverStyle||t.hoverStyle;o&&yg.isHover(t,n)&&(e=VS(i,o));const s=i.pressStyle||t.pressStyle;s&&yg.isPress(t,n)&&(e=VS(i,s))}return e?i:void 0}function NS(t,e,i,n){const r=i?t:{},o=i||t;for(let s in o)n&&yg.animateExcludes[s]||(r[s]=e[s]);return r}function jS(t,e,i){return NS(t,e,i,!0)}function VS(t,e){return Object.assign(t,e),!0}function HS(t,e){const i=t[e];i&&DS(t,i),t.button&&YS(t.children,e)}function US(t,e,i){i||(i=t.states[e]),DS(t,i),t.button&&YS(t.children,null,e)}function YS(t,e,i){if(!t)return;let n,r;for(let o=0,s=t.length;o<s;o++){if(n=t[o],e){switch(r=!0,e){case"hoverStyle":yg.isHover(n)&&(r=!1);break;case"pressStyle":yg.isPress(n)&&(r=!1);break;case"focusStyle":yg.isFocus(n)&&(r=!1)}r&&HS(n,e)}else ss(i)||US(n,i);n.isBranch&&YS(n.children,e,i)}}function XS(t,e){const i=t[e];i&&IS(t,i),t.button&&KS(t.children,e)}function GS(t,e,i){IS(t,i),t.button&&KS(t.children,null,e)}function KS(t,e,i){if(!t)return;let n;for(let r=0,o=t.length;r<o;r++)n=t[r],e?XS(n,e):ss(i)||GS(n,i),n.isBranch&&KS(n.children,e,i)}function $S(t,e,i){let n;const r=e.leafer?e.leafer.interaction:null;if(r&&(n=r[t](e),!n&&i)){const o=MS(e,i);o&&(n=r[t](o))}return n}function ZS(t,e,i){let n=e[t];if(!n&&i){const r=MS(e,i);r&&(n=r[t])}return n}ol.add("state"),yg.animateExcludes={animation:1,animationOut:1,transition:1,transitionOut:1,states:1,state:1,placeholder:1,normalStyle:1,hoverStyle:1,pressStyle:1,focusStyle:1,selectedStyle:1,disabledStyle:1,placeholderStyle:1},yg.isState=function(t,e,i){return function(t,e,i){let n=e.states[t];if(!n&&i){const r=MS(e,i);r&&(n=r.states[t])}return!!n}(t,e,i)},yg.isSelected=function(t,e){return ZS("selected",t,e)},yg.isDisabled=function(t,e){return ZS("disabled",t,e)},yg.isFocus=function(t,e){return $S("isFocus",t,e)},yg.isHover=function(t,e){return $S("isHover",t,e)},yg.isPress=function(t,e){return $S("isPress",t,e)},yg.isPlacehold=function(t,e){return t.__.__isPlacehold},yg.isDrag=function(t,e){return $S("isDrag",t,e)},yg.setStyleName=function(t,e,i){i?US(t,e,t[e]):GS(t,e,t[e])},yg.set=function(t,e){const i=t.states[e];i?US(t,e,i):GS(t,e,i)},yg.getStyle=zS,yg.updateStyle=WS,yg.updateEventStyle=function(t,e){switch(e){case iv.ENTER:HS(t,"hoverStyle");break;case iv.LEAVE:XS(t,"hoverStyle");break;case iv.DOWN:HS(t,"pressStyle");break;case iv.UP:XS(t,"pressStyle")}};var qS=jg.prototype;jg.addAttr("selected",!1,RS,"selectedStyle"),jg.addAttr("disabled",!1,RS,"disabledStyle"),jg.addAttr("states",{},AS),jg.addAttr("state","",RS),jg.addAttr("normalStyle",void 0,su),jg.addAttr("hoverStyle",void 0,AS),jg.addAttr("pressStyle",void 0,AS),jg.addAttr("focusStyle",void 0,AS),jg.addAttr("selectedStyle",void 0,AS),jg.addAttr("disabledStyle",void 0,AS),jg.addAttr("placeholderStyle",void 0,AS),jg.addAttr("button",!1,su),qS.set=function(t,e){t&&(e?"temp"===e?(this.lockNormalStyle=!0,Object.assign(this,t),this.lockNormalStyle=!1):this.animate(t,e):Object.assign(this,t))},qS.focus=function(t=!0){this.waitLeafer(()=>{let{focusData:e}=this.app.interaction;t?(e&&e.focus(!1),e=this):e=null,this.app.interaction.focusData=e,t?HS(this,"focusStyle"):XS(this,"focusStyle")})},qS.updateState=function(){yg.updateStyle(this,void 0,"in")};var JS=M_.prototype,QS="text";nu(JS,QS,Object.assign(Object.assign({},ru(JS,QS)),{set(t){const e=this,i=e.text;e.__setAttr(QS,t)&&(pu(e),e.placeholderStyle&&e.placeholder&&(""===i||""===t)&&(e.__layout.stateStyleChanged=!0))}}));var tk={none:"none",title:"capitalize",upper:"uppercase",lower:"lowercase","small-caps":"small-caps"},ek={top:"flex-start",middle:"center",bottom:"flex-end"},ik={none:"none",under:"underline",delete:"line-through","under-delete":"underline line-through"};function nk(t,e,i){const{style:n}=t,{fill:r,padding:o,textWrap:s,textOverflow:a,textDecoration:l}=e;let h;n.fontFamily=e.fontFamily,n.fontSize=e.fontSize*i+"px",function(t,e){let i="black";if(ds(e)&&(e=e[0]),us(e))switch(e.type){case"solid":i=cg.string(e.color);break;case"image":case"film":case"video":break;case"linear":case"radial":case"angular":const t=e.stops[0];i=cg.string(ls(t)?t:t.color);break;default:ss(e.r)||(i=cg.string(e))}else i=e;t.color=i}(n,r),n.fontStyle=e.italic?"italic":"normal",n.fontWeight=e.fontWeight,us(l)?(h=l.type,l.color&&(n.textDecorationColor=cg.string(l.color))):h=l,n.textDecoration=ik[h],n.textTransform=tk[e.textCase],n.textAlign="both"===e.textAlign?"justify":e.textAlign,n.display="flex",n.flexDirection="column",n.justifyContent=ek[e.verticalAlign],n.lineHeight=(e.__.__lineHeight||0)*i+"px",n.letterSpacing=(e.__.__letterSpacing||0)*i+"px",n.whiteSpace="none"===s||e.__.__autoWidth?"nowrap":"normal",n.wordBreak="break"===s?"break-all":"normal",n.textIndent=(e.paraIndent||0)*i+"px",n.padding=ds(o)?o.map(t=>t*i+"px").join(" "):(o||0)*i+"px",n.textOverflow="show"===a?"":"hide"===a?"clip":a}var rk=class extends Ab{constructor(){super(...arguments),this.config={selectAll:!0},this.eventIds=[]}get tag(){return"TextEditor"}onLoad(){const{editor:t}=this,{config:e}=t.app,i=this.editTarget;i.textEditing=!0,this.isHTMLText=!(i instanceof M_),this._keyEvent=e.keyEvent,e.keyEvent=!1;const n=this.editDom=document.createElement("div");n.classList.add("leafer-text-editor");const{style:r}=n;n.contentEditable="true",r.position="fixed",r.transformOrigin="left top",r.boxSizing="border-box",this.isHTMLText?n.innerHTML=String(i.text):n.innerText=String(i.text);const{view:o}=t.app;(this.inBody=o instanceof HTMLCanvasElement)?document.body.appendChild(n):o.appendChild(n),this.eventIds=[t.app.on_(iv.DOWN,e=>{let i,{target:r}=e.origin;for(;r;)r===n&&(i=!0),r=r.parentElement;i||t.closeInnerEditor()})],this.onFocus=this.onFocus.bind(this),this.onInput=this.onInput.bind(this),this.onPaste=this.onPaste.bind(this),this.onUpdate=this.onUpdate.bind(this),this.onKeydown=this.onKeydown.bind(this),n.addEventListener("focus",this.onFocus),n.addEventListener("input",this.onInput),n.addEventListener("paste",this.onPaste),window.addEventListener("keydown",this.onKeydown),window.addEventListener("scroll",this.onUpdate);const s=window.getSelection(),a=document.createRange();if(this.config.selectAll)a.selectNodeContents(n);else{const t=n.childNodes[0];t&&(a.setStartAfter(t),a.setEndAfter(t)),a.collapse(!0)}s.removeAllRanges(),s.addRange(a)}onInput(){const{editDom:t}=this;this.editTarget.text=this.isHTMLText?t.innerHTML:t.innerText}onFocus(){this.editDom.style.outline="none"}onKeydown(t){if("Escape"===t.code&&this.editor.closeInnerEditor(),"Enter"===t.key){t.preventDefault();const e=document.createElement("br"),i=document.createTextNode(""),n=window.getSelection().getRangeAt(0);n.deleteContents(),n.insertNode(i),n.insertNode(e),n.setStartAfter(e),n.setEndAfter(e),this.onInput()}}onPaste(t){if(this.isHTMLText)return;t.preventDefault();const e=t.clipboardData;if(!e)return;let i=e.getData("text/plain").replace(/\r\n?/g,"\n");const n=window.getSelection();if(!n||!n.rangeCount)return;const r=n.getRangeAt(0);r.deleteContents();const o=i.split("\n"),s=document.createDocumentFragment();o.forEach((t,e)=>{e>0&&s.appendChild(document.createElement("br")),s.appendChild(document.createTextNode(t))}),r.insertNode(s),r.collapse(!1),n.removeAllRanges(),n.addRange(r),this.onInput()}onUpdate(){const{editTarget:t}=this;let e=1;if(!this.isHTMLText){const{scaleX:i,scaleY:n}=t.worldTransform;e=Math.max(Math.abs(i),Math.abs(n)),t.fontSize*e<12&&(e*=12/t.fontSize)}this.textScale=e;let{width:i,height:n}=t,r=0,o=0;i*=e,n*=e;const s=t.__;if(s.__autoWidth)switch(i+=20,s.textAlign){case"center":r=s.autoSizeAlign?-i/2:-10;break;case"right":r=s.autoSizeAlign?-i:-20}if(s.__autoHeight)switch(n+=20,s.verticalAlign){case"middle":o=s.autoSizeAlign?-n/2:-10;break;case"bottom":o=s.autoSizeAlign?-n:-20}const{x:a,y:l}=this.inBody?t.app.clientBounds:t.app.tree.clientBounds,{a:h,b:c,c:d,d:u,e:p,f:f}=new fa(t.worldTransform).scale(1/e).translateInner(r,o),{style:g}=this.editDom;g.transform=`matrix(${h},${c},${d},${u},${p},${f})`,g.left=a+"px",g.top=l+"px",g.width=i+"px",g.height=n+"px",this.isHTMLText||nk(this.editDom,t,e)}onUnload(){const{editTarget:t,editor:e,editDom:i}=this;t&&(this.onInput(),"\n"===t.text&&(t.text=""),t.textEditing=void 0,e.app&&(e.app.config.keyEvent=this._keyEvent),e.off_(this.eventIds),i.removeEventListener("focus",this.onFocus),i.removeEventListener("input",this.onInput),i.removeEventListener("paste",this.onPaste),window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("scroll",this.onUpdate),i.remove(),this.editDom=this.eventIds=void 0)}};rk=function(t,e,i,n){var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s}([yb()],rk),ol.add("text-editor","editor");var ok=class extends Hg{circle;label;data;style;_element_tag;_lastValidLabel;constructor(t,e){super(),this.data=t,this.style={...TS,...e},this._lastValidLabel=t.label,this.circle=new n_({x:0,y:0,width:this.style.circleRadius,height:this.style.circleRadius,fill:this.style.circleFill,stroke:this.style.circleStroke,strokeWidth:this.style.circleStrokeWidth,draggable:!1,editable:!1,around:"center",hoverStyle:{fill:this.style.hoverCircleFill?this.style.hoverCircleFill:this.style.circleFill}}),this.label=new M_({x:this.style.circleRadius/2-2,y:-this.style.circleRadius/2+2,text:t.label,fontSize:this.style.labelFontSize,fill:this.style.labelTextColor,padding:this.style.labelPadding,editable:!0,editConfig:{strokeWidth:0,moveable:!1,resizeable:!1},around:"bottom-left",boxStyle:{fill:this.style.labelBackgroundColor,cornerRadius:4,whiteSpace:"nowrap",shadow:{x:1,y:1,blur:2,color:"rgba(0,0,0, .2)"}}}),this.add(this.circle),this.add(this.label),this.x=t.pixel.x,this.y=t.pixel.y,this.draggable=!0,this.editable=!0,this.editConfig={strokeWidth:0,resizeable:!1},this._element_tag="point-annotation",this.bindEvents()}bindEvents(){this.label.on("property.change",t=>{const e=t.data||t;"text"===e.attrName&&this.handleLabelChange(e.newValue)})}handlePointAnnotationSelected(t){const e=t?this.style.selectedCircleFill:this.style.circleFill,i=t?this.style.selectedCircleStroke:this.style.circleStroke,n=t?this.style.selectedCircleScale:1;this.circle.set({fill:e,stroke:i,scale:n})}handleLabelChange(t){const e=t.trim();e?(this._lastValidLabel=e,this.data.label=e,this.data.updatedAt=Date.now()):this.label.text=this._lastValidLabel}updatePosition(t,e){this.x=t,this.y=e,this.data.pixel={x:t,y:e},this.data.updatedAt=Date.now()}updateLabel(t){this.label.text=t,this._lastValidLabel=t,this.data.label=t,this.data.updatedAt=Date.now()}getLabel(){return this.data.label}getLastValidLabel(){return this._lastValidLabel}},sk=class{canvas;group;width;height;lastPoint=null;constructor(t,e,i){this.width=t,this.height=e,this.canvas=new L_({width:t,height:e}),this.canvas.set({pointerEvents:!1}),this.group=new Hg({opacity:i.opacity}),this.group.add(this.canvas)}getCanvas(){return this.canvas}getGroup(){return this.group}setOpacity(t){this.group.set({opacity:t})}setPointerEvents(t){this.canvas.set({pointerEvents:t})}resetLastPoint(){this.lastPoint=null}draw(t,e,i,n,r,o){const{context:s}=this.canvas;if(s.save(),s.fillStyle=n,s.globalAlpha=1,this.lastPoint){const n=t-this.lastPoint.x,r=e-this.lastPoint.y,a=Math.sqrt(n*n+r*r);if(a>o){const t=Math.ceil(a/(i/2));for(let e=1;e<=t;e++){const o=e/t,a=this.lastPoint.x+n*o,l=this.lastPoint.y+r*o;s.beginPath(),s.arc(a,l,i/2,0,2*Math.PI),s.fill()}}}s.beginPath(),s.arc(t,e,i/2,0,2*Math.PI),s.fill(),s.restore(),this.lastPoint={x:t,y:e}}erase(t,e,i,n){const{context:r}=this.canvas;if(r.save(),r.globalCompositeOperation="destination-out",this.lastPoint){const o=t-this.lastPoint.x,s=e-this.lastPoint.y,a=Math.sqrt(o*o+s*s);if(a>n){const t=Math.ceil(a/(i/2));for(let e=1;e<=t;e++){const n=e/t,a=this.lastPoint.x+o*n,l=this.lastPoint.y+s*n;r.beginPath(),r.arc(a,l,i/2,0,2*Math.PI),r.fill()}}}r.beginPath(),r.arc(t,e,i/2,0,2*Math.PI),r.fill(),r.restore(),this.lastPoint={x:t,y:e}}clear(){const{context:t}=this.canvas;t.clearRect(0,0,this.width,this.height),this.resetLastPoint(),this.canvas.paint(),this.group.set({dirty:!0})}getImageData(){return this.canvas.context.canvas.toDataURL("image/png")}restoreImageData(t,e){const i=new Image;i.onload=()=>{const{context:t}=this.canvas;t.clearRect(0,0,this.width,this.height),t.drawImage(i,0,0),this.canvas.paint(),this.group.set({dirty:!0}),e&&e()},i.src=t}hasContent(){if(0===this.width||0===this.height)return!1;const t=this.canvas.context.getImageData(0,0,this.width,this.height).data;for(let e=3;e<t.length;e+=4)if(t[e]>0)return!0;return!1}},ak="bottom",lk="right",hk="left",ck=["top",ak,lk,hk],dk="start",uk="popper",pk=ck.reduce(function(t,e){return t.concat([e+"-"+dk,e+"-end"])},[]),fk=[].concat(ck,["auto"]).reduce(function(t,e){return t.concat([e,e+"-"+dk,e+"-end"])},[]),gk=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function _k(t){return t?(t.nodeName||"").toLowerCase():null}function vk(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function mk(t){return t instanceof vk(t).Element||t instanceof Element}function yk(t){return t instanceof vk(t).HTMLElement||t instanceof HTMLElement}function xk(t){return"undefined"!=typeof ShadowRoot&&(t instanceof vk(t).ShadowRoot||t instanceof ShadowRoot)}var wk={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},r=e.elements[t];yk(r)&&_k(r)&&(Object.assign(r.style,i),Object.keys(n).forEach(function(t){var e=n[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(t){var n=e.elements[t],r=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce(function(t,e){return t[e]="",t},{});yk(n)&&_k(n)&&(Object.assign(n.style,o),Object.keys(r).forEach(function(t){n.removeAttribute(t)}))})}},requires:["computeStyles"]};function bk(t){return t.split("-")[0]}var Sk=Math.max,kk=Math.min,Ek=Math.round;function Ck(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Ok(){return!/^((?!chrome|android).)*safari/i.test(Ck())}function Lk(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),r=1,o=1;e&&yk(t)&&(r=t.offsetWidth>0&&Ek(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Ek(n.height)/t.offsetHeight||1);var s=(mk(t)?vk(t):window).visualViewport,a=!Ok()&&i,l=(n.left+(a&&s?s.offsetLeft:0))/r,h=(n.top+(a&&s?s.offsetTop:0))/o,c=n.width/r,d=n.height/o;return{width:c,height:d,top:h,right:l+c,bottom:h+d,left:l,x:l,y:h}}function Pk(t){var e=Lk(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Tk(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&xk(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Bk(t){return vk(t).getComputedStyle(t)}function Rk(t){return["table","td","th"].indexOf(_k(t))>=0}function Ak(t){return((mk(t)?t.ownerDocument:t.document)||window.document).documentElement}function Mk(t){return"html"===_k(t)?t:t.assignedSlot||t.parentNode||(xk(t)?t.host:null)||Ak(t)}function Dk(t){return yk(t)&&"fixed"!==Bk(t).position?t.offsetParent:null}function Ik(t){for(var e=vk(t),i=Dk(t);i&&Rk(i)&&"static"===Bk(i).position;)i=Dk(i);return i&&("html"===_k(i)||"body"===_k(i)&&"static"===Bk(i).position)?e:i||function(t){var e=/firefox/i.test(Ck());if(/Trident/i.test(Ck())&&yk(t)&&"fixed"===Bk(t).position)return null;var i=Mk(t);for(xk(i)&&(i=i.host);yk(i)&&["html","body"].indexOf(_k(i))<0;){var n=Bk(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function Fk(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Wk(t,e,i){return Sk(t,kk(e,i))}function zk(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Nk(t,e){return e.reduce(function(e,i){return e[i]=t,e},{})}var jk={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,r=t.options,o=i.elements.arrow,s=i.modifiersData.popperOffsets,a=bk(i.placement),l=Fk(a),h=["left","right"].indexOf(a)>=0?"height":"width";if(o&&s){var c=function(t,e){return zk("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Nk(t,ck))}(r.padding,i),d=Pk(o),u="y"===l?"top":hk,p="y"===l?ak:lk,f=i.rects.reference[h]+i.rects.reference[l]-s[l]-i.rects.popper[h],g=s[l]-i.rects.reference[l],_=Ik(o),v=_?"y"===l?_.clientHeight||0:_.clientWidth||0:0,m=f/2-g/2,y=c[u],x=v-d[h]-c[p],w=v/2-d[h]/2+m,b=Wk(y,w,x),S=l;i.modifiersData[n]=((e={})[S]=b,e.centerOffset=b-w,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Tk(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Vk(t){return t.split("-")[1]}var Hk={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Uk(t){var e,i=t.popper,n=t.popperRect,r=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,h=t.adaptive,c=t.roundOffsets,d=t.isFixed,u=s.x,p=void 0===u?0:u,f=s.y,g=void 0===f?0:f,_="function"==typeof c?c({x:p,y:g}):{x:p,y:g};p=_.x,g=_.y;var v=s.hasOwnProperty("x"),m=s.hasOwnProperty("y"),y=hk,x="top",w=window;if(h){var b=Ik(i),S="clientHeight",k="clientWidth";if(b===vk(i)&&"static"!==Bk(b=Ak(i)).position&&"absolute"===a&&(S="scrollHeight",k="scrollWidth"),"top"===r||("left"===r||"right"===r)&&"end"===o)x=ak,g-=(d&&b===w&&w.visualViewport?w.visualViewport.height:b[S])-n.height,g*=l?1:-1;if("left"===r||("top"===r||"bottom"===r)&&"end"===o)y=lk,p-=(d&&b===w&&w.visualViewport?w.visualViewport.width:b[k])-n.width,p*=l?1:-1}var E,C=Object.assign({position:a},h&&Hk),O=!0===c?function(t,e){var i=t.x,n=t.y,r=e.devicePixelRatio||1;return{x:Ek(i*r)/r||0,y:Ek(n*r)/r||0}}({x:p,y:g},vk(i)):{x:p,y:g};return p=O.x,g=O.y,l?Object.assign({},C,((E={})[x]=m?"0":"",E[y]=v?"0":"",E.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",E)):Object.assign({},C,((e={})[x]=m?g+"px":"",e[y]=v?p+"px":"",e.transform="",e))}var Yk={passive:!0};var Xk={left:"right",right:"left",bottom:"top",top:"bottom"};function Gk(t){return t.replace(/left|right|bottom|top/g,function(t){return Xk[t]})}var Kk={start:"end",end:"start"};function $k(t){return t.replace(/start|end/g,function(t){return Kk[t]})}function Zk(t){var e=vk(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function qk(t){return Lk(Ak(t)).left+Zk(t).scrollLeft}function Jk(t){var e=Bk(t),i=e.overflow,n=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function Qk(t){return["html","body","#document"].indexOf(_k(t))>=0?t.ownerDocument.body:yk(t)&&Jk(t)?t:Qk(Mk(t))}function tE(t,e){var i;void 0===e&&(e=[]);var n=Qk(t),r=n===(null==(i=t.ownerDocument)?void 0:i.body),o=vk(n),s=r?[o].concat(o.visualViewport||[],Jk(n)?n:[]):n,a=e.concat(s);return r?a:a.concat(tE(Mk(s)))}function eE(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function iE(t,e,i){return"viewport"===e?eE(function(t,e){var i=vk(t),n=Ak(t),r=i.visualViewport,o=n.clientWidth,s=n.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var h=Ok();(h||!h&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+qk(t),y:l}}(t,i)):mk(e)?function(t,e){var i=Lk(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):eE(function(t){var e,i=Ak(t),n=Zk(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=Sk(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=Sk(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+qk(t),l=-n.scrollTop;return"rtl"===Bk(r||i).direction&&(a+=Sk(i.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(Ak(t)))}function nE(t,e,i,n){var r="clippingParents"===e?function(t){var e=tE(Mk(t)),i=["absolute","fixed"].indexOf(Bk(t).position)>=0&&yk(t)?Ik(t):t;return mk(i)?e.filter(function(t){return mk(t)&&Tk(t,i)&&"body"!==_k(t)}):[]}(t):[].concat(e),o=[].concat(r,[i]),s=o[0],a=o.reduce(function(e,i){var r=iE(t,i,n);return e.top=Sk(r.top,e.top),e.right=kk(r.right,e.right),e.bottom=kk(r.bottom,e.bottom),e.left=Sk(r.left,e.left),e},iE(t,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function rE(t){var e,i=t.reference,n=t.element,r=t.placement,o=r?bk(r):null,s=r?Vk(r):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case"top":e={x:a,y:i.y-n.height};break;case ak:e={x:a,y:i.y+i.height};break;case lk:e={x:i.x+i.width,y:l};break;case hk:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var h=o?Fk(o):null;if(null!=h){var c="y"===h?"height":"width";switch(s){case dk:e[h]=e[h]-(i[c]/2-n[c]/2);break;case"end":e[h]=e[h]+(i[c]/2-n[c]/2)}}return e}function oE(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=void 0===n?t.placement:n,o=i.strategy,s=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?"clippingParents":a,h=i.rootBoundary,c=void 0===h?"viewport":h,d=i.elementContext,u=void 0===d?uk:d,p=i.altBoundary,f=void 0!==p&&p,g=i.padding,_=void 0===g?0:g,v=zk("number"!=typeof _?_:Nk(_,ck)),m="popper"===u?"reference":uk,y=t.rects.popper,x=t.elements[f?m:u],w=nE(mk(x)?x:x.contextElement||Ak(t.elements.popper),l,c,s),b=Lk(t.elements.reference),S=rE({reference:b,element:y,strategy:"absolute",placement:r}),k=eE(Object.assign({},y,S)),E="popper"===u?k:b,C={top:w.top-E.top+v.top,bottom:E.bottom-w.bottom+v.bottom,left:w.left-E.left+v.left,right:E.right-w.right+v.right},O=t.modifiersData.offset;if("popper"===u&&O){var L=O[r];Object.keys(C).forEach(function(t){var e=["right","bottom"].indexOf(t)>=0?1:-1,i=["top","bottom"].indexOf(t)>=0?"y":"x";C[t]+=L[i]*e})}return C}function sE(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=i.boundary,o=i.rootBoundary,s=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,h=void 0===l?fk:l,c=Vk(n),d=c?a?pk:pk.filter(function(t){return Vk(t)===c}):ck,u=d.filter(function(t){return h.indexOf(t)>=0});0===u.length&&(u=d);var p=u.reduce(function(e,i){return e[i]=oE(t,{placement:i,boundary:r,rootBoundary:o,padding:s})[bk(i)],e},{});return Object.keys(p).sort(function(t,e){return p[t]-p[e]})}var aE={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var r=i.mainAxis,o=void 0===r||r,s=i.altAxis,a=void 0===s||s,l=i.fallbackPlacements,h=i.padding,c=i.boundary,d=i.rootBoundary,u=i.altBoundary,p=i.flipVariations,f=void 0===p||p,g=i.allowedAutoPlacements,_=e.options.placement,v=bk(_)===_,m=l||(v||!f?[Gk(_)]:function(t){if("auto"===bk(t))return[];var e=Gk(t);return[$k(t),e,$k(e)]}(_)),y=[_].concat(m).reduce(function(t,i){return t.concat("auto"===bk(i)?sE(e,{placement:i,boundary:c,rootBoundary:d,padding:h,flipVariations:f,allowedAutoPlacements:g}):i)},[]),x=e.rects.reference,w=e.rects.popper,b=new Map,S=!0,k=y[0],E=0;E<y.length;E++){var C=y[E],O=bk(C),L=Vk(C)===dk,P=["top",ak].indexOf(O)>=0,T=P?"width":"height",B=oE(e,{placement:C,boundary:c,rootBoundary:d,altBoundary:u,padding:h}),R=P?L?lk:hk:L?ak:"top";x[T]>w[T]&&(R=Gk(R));var A=Gk(R),M=[];if(o&&M.push(B[O]<=0),a&&M.push(B[R]<=0,B[A]<=0),M.every(function(t){return t})){k=C,S=!1;break}b.set(C,M)}if(S)for(var D=function(t){var e=y.find(function(e){var i=b.get(e);if(i)return i.slice(0,t).every(function(t){return t})});if(e)return k=e,"break"},I=f?3:1;I>0&&"break"!==D(I);I--);e.placement!==k&&(e.modifiersData[n]._skip=!0,e.placement=k,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function lE(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function hE(t){return["top",lk,ak,hk].some(function(e){return t[e]>=0})}var cE={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,r=i.offset,o=void 0===r?[0,0]:r,s=fk.reduce(function(t,i){return t[i]=function(t,e,i){var n=bk(t),r=["left","top"].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,["left","right"].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}(i,e.rects,o),t},{}),a=s[e.placement],l=a.x,h=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=h),e.modifiersData[n]=s}};var dE={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,r=i.mainAxis,o=void 0===r||r,s=i.altAxis,a=void 0!==s&&s,l=i.boundary,h=i.rootBoundary,c=i.altBoundary,d=i.padding,u=i.tether,p=void 0===u||u,f=i.tetherOffset,g=void 0===f?0:f,_=oE(e,{boundary:l,rootBoundary:h,padding:d,altBoundary:c}),v=bk(e.placement),m=Vk(e.placement),y=!m,x=Fk(v),w="x"===x?"y":"x",b=e.modifiersData.popperOffsets,S=e.rects.reference,k=e.rects.popper,E="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,C="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(b){if(o){var P,T="y"===x?"top":hk,B="y"===x?ak:lk,R="y"===x?"height":"width",A=b[x],M=A+_[T],D=A-_[B],I=p?-k[R]/2:0,F="start"===m?S[R]:k[R],W="start"===m?-k[R]:-S[R],z=e.elements.arrow,N=p&&z?Pk(z):{width:0,height:0},j=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=j[T],H=j[B],U=Wk(0,S[R],N[R]),Y=y?S[R]/2-I-U-V-C.mainAxis:F-U-V-C.mainAxis,X=y?-S[R]/2+I+U+H+C.mainAxis:W+U+H+C.mainAxis,G=e.elements.arrow&&Ik(e.elements.arrow),K=G?"y"===x?G.clientTop||0:G.clientLeft||0:0,$=null!=(P=null==O?void 0:O[x])?P:0,Z=A+X-$,q=Wk(p?kk(M,A+Y-$-K):M,A,p?Sk(D,Z):D);b[x]=q,L[x]=q-A}if(a){var J,Q="x"===x?"top":hk,tt="x"===x?ak:lk,et=b[w],it="y"===w?"height":"width",nt=et+_[Q],rt=et-_[tt],ot=-1!==["top",hk].indexOf(v),st=null!=(J=null==O?void 0:O[w])?J:0,at=ot?nt:et-S[it]-k[it]-st+C.altAxis,lt=ot?et+S[it]+k[it]-st-C.altAxis:rt,ht=p&&ot?function(t,e,i){var n=Wk(t,e,i);return n>i?i:n}(at,et,lt):Wk(p?at:nt,et,p?lt:rt);b[w]=ht,L[w]=ht-et}e.modifiersData[n]=L}},requiresIfExists:["offset"]};function uE(t,e,i){void 0===i&&(i=!1);var n,r,o=yk(e),s=yk(e)&&function(t){var e=t.getBoundingClientRect(),i=Ek(e.width)/t.offsetWidth||1,n=Ek(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=Ak(e),l=Lk(t,s,i),h={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!i)&&(("body"!==_k(e)||Jk(a))&&(h=(n=e)!==vk(n)&&yk(n)?{scrollLeft:(r=n).scrollLeft,scrollTop:r.scrollTop}:Zk(n)),yk(e)?((c=Lk(e,!0)).x+=e.clientLeft,c.y+=e.clientTop):a&&(c.x=qk(a))),{x:l.left+h.scrollLeft-c.x,y:l.top+h.scrollTop-c.y,width:l.width,height:l.height}}function pE(t){var e=new Map,i=new Set,n=[];function r(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!i.has(t)){var n=e.get(t);n&&r(n)}}),n.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){i.has(t.name)||r(t)}),n}function fE(t){var e;return function(){return e||(e=new Promise(function(i){Promise.resolve().then(function(){e=void 0,i(t())})})),e}}var gE={placement:"bottom",modifiers:[],strategy:"absolute"};function _E(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function vE(t){void 0===t&&(t={});var e=t,i=e.defaultModifiers,n=void 0===i?[]:i,r=e.defaultOptions,o=void 0===r?gE:r;return function(t,e,i){void 0===i&&(i=o);var r={placement:"bottom",orderedModifiers:[],options:Object.assign({},gE,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},s=[],a=!1,l={state:r,setOptions:function(i){var a="function"==typeof i?i(r.options):i;h(),r.options=Object.assign({},o,r.options,a),r.scrollParents={reference:mk(t)?tE(t):t.contextElement?tE(t.contextElement):[],popper:tE(e)};var c,d,u=function(t){var e=pE(t);return gk.reduce(function(t,i){return t.concat(e.filter(function(t){return t.phase===i}))},[])}((c=[].concat(n,r.options.modifiers),d=c.reduce(function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t},{}),Object.keys(d).map(function(t){return d[t]})));return r.orderedModifiers=u.filter(function(t){return t.enabled}),r.orderedModifiers.forEach(function(t){var e=t.name,i=t.options,n=void 0===i?{}:i,o=t.effect;if("function"==typeof o){var a=o({state:r,name:e,instance:l,options:n});s.push(a||function(){})}}),l.update()},forceUpdate:function(){if(!a){var t=r.elements,e=t.reference,i=t.popper;if(_E(e,i)){r.rects={reference:uE(e,Ik(i),"fixed"===r.options.strategy),popper:Pk(i)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach(function(t){return r.modifiersData[t.name]=Object.assign({},t.data)});for(var n=0;n<r.orderedModifiers.length;n++)if(!0!==r.reset){var o=r.orderedModifiers[n],s=o.fn,h=o.options,c=void 0===h?{}:h,d=o.name;"function"==typeof s&&(r=s({state:r,options:c,name:d,instance:l})||r)}else r.reset=!1,n=-1}}},update:fE(function(){return new Promise(function(t){l.forceUpdate(),t(r)})}),destroy:function(){h(),a=!0}};if(!_E(t,e))return l;function h(){s.forEach(function(t){return t()}),s=[]}return l.setOptions(i).then(function(t){!a&&i.onFirstUpdate&&i.onFirstUpdate(t)}),l}}var mE=vE({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,r=n.scroll,o=void 0===r||r,s=n.resize,a=void 0===s||s,l=vk(e.elements.popper),h=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&h.forEach(function(t){t.addEventListener("scroll",i.update,Yk)}),a&&l.addEventListener("resize",i.update,Yk),function(){o&&h.forEach(function(t){t.removeEventListener("scroll",i.update,Yk)}),a&&l.removeEventListener("resize",i.update,Yk)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=rE({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,r=void 0===n||n,o=i.adaptive,s=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,h={placement:bk(e.placement),variation:Vk(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Uk(Object.assign({},h,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Uk(Object.assign({},h,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},wk,cE,aE,dE,jk,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=oE(e,{elementContext:"reference"}),a=oE(e,{altBoundary:!0}),l=lE(s,n),h=lE(a,r,o),c=hE(l),d=hE(h);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:h,isReferenceHidden:c,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}}]});function yE(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function xE(t,e){if(t){if("string"==typeof t)return yE(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?yE(t,e):void 0}}function wE(t){return function(t){if(Array.isArray(t))return yE(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||xE(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bE(t){return bE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bE(t)}function SE(t,e,i,n,r,o,s){try{var a=t[o](s),l=a.value}catch(t){return void i(t)}a.done?e(l):Promise.resolve(l).then(n,r)}function kE(t){return function(){var e=this,i=arguments;return new Promise(function(n,r){var o=t.apply(e,i);function s(t){SE(o,n,r,s,a,"next",t)}function a(t){SE(o,n,r,s,a,"throw",t)}s(void 0)})}}var EE={exports:{}},CE={exports:{}};(function(t){function e(i){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(i)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(CE),function(t){var e=CE.exports.default;function i(){t.exports=i=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var n,r={},o=Object.prototype,s=o.hasOwnProperty,a=Object.defineProperty||function(t,e,i){t[e]=i.value},l="function"==typeof Symbol?Symbol:{},h=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",d=l.toStringTag||"@@toStringTag";function u(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(n){u=function(t,e,i){return t[e]=i}}function p(t,e,i,n){var r=e&&e.prototype instanceof x?e:x,o=Object.create(r.prototype);return a(o,"_invoke",{value:P(t,i,new A(n||[]))}),o}function f(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var g="suspendedStart",_="suspendedYield",v="executing",m="completed",y={};function x(){}function w(){}function b(){}var S={};u(S,h,function(){return this});var k=Object.getPrototypeOf,E=k&&k(k(M([])));E&&E!==o&&s.call(E,h)&&(S=E);var C=b.prototype=x.prototype=Object.create(S);function O(t){["next","throw","return"].forEach(function(e){u(t,e,function(t){return this._invoke(e,t)})})}function L(t,i){function n(r,o,a,l){var h=f(t[r],t,o);if("throw"!==h.type){var c=h.arg,d=c.value;return d&&"object"==e(d)&&s.call(d,"__await")?i.resolve(d.__await).then(function(t){n("next",t,a,l)},function(t){n("throw",t,a,l)}):i.resolve(d).then(function(t){c.value=t,a(c)},function(t){return n("throw",t,a,l)})}l(h.arg)}var r;a(this,"_invoke",{value:function(t,e){function o(){return new i(function(i,r){n(t,e,i,r)})}return r=r?r.then(o,o):o()}})}function P(t,e,i){var r=g;return function(o,s){if(r===v)throw Error("Generator is already running");if(r===m){if("throw"===o)throw s;return{value:n,done:!0}}for(i.method=o,i.arg=s;;){var a=i.delegate;if(a){var l=T(a,i);if(l){if(l===y)continue;return l}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===g)throw r=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=v;var h=f(t,e,i);if("normal"===h.type){if(r=i.done?m:_,h.arg===y)continue;return{value:h.arg,done:i.done}}"throw"===h.type&&(r=m,i.method="throw",i.arg=h.arg)}}}function T(t,e){var i=e.method,r=t.iterator[i];if(r===n)return e.delegate=null,"throw"===i&&t.iterator.return&&(e.method="return",e.arg=n,T(t,e),"throw"===e.method)||"return"!==i&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var o=f(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,y;var s=o.arg;return s?s.done?(e[t.resultName]=s.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,y):s:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}function B(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(B,this),this.reset(!0)}function M(t){if(t||""===t){var i=t[h];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(s.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=n,e.done=!0,e};return o.next=o}}throw new TypeError(e(t)+" is not iterable")}return w.prototype=b,a(C,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:w,configurable:!0}),w.displayName=u(b,d,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,d,"GeneratorFunction")),t.prototype=Object.create(C),t},r.awrap=function(t){return{__await:t}},O(L.prototype),u(L.prototype,c,function(){return this}),r.AsyncIterator=L,r.async=function(t,e,i,n,o){void 0===o&&(o=Promise);var s=new L(p(t,e,i,n),o);return r.isGeneratorFunction(e)?s:s.next().then(function(t){return t.done?t.value:s.next()})},O(C),u(C,d,"Generator"),u(C,h,function(){return this}),u(C,"toString",function(){return"[object Generator]"}),r.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=M,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(R),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(i,r){return a.type="throw",a.arg=t,e.next=i,r&&(e.method="next",e.arg=n),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=s.call(o,"catchLoc"),h=s.call(o,"finallyLoc");if(l&&h){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!h)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var r=n;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var o=r?r.completion:{};return o.type=t,o.arg=e,r?(this.method="next",this.next=r.finallyLoc,y):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),R(i),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;R(i)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:M(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=n),y}},r}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}(EE);var OE=EE.exports(),LE=OE;try{regeneratorRuntime=OE}catch(bS){"object"==typeof globalThis?globalThis.regeneratorRuntime=OE:Function("r","regeneratorRuntime = r")(OE)}function PE(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,o,s,a=[],l=!0,h=!1;try{if(o=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){h=!0,r=t}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(h)throw r}}return a}}(t,e)||xE(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function TE(t,e,i){return(e=function(t){var e=function(t){if("object"!=bE(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=bE(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bE(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var BE=Ri({name:"Saturation",props:{size:{type:Number,default:160},hue:{type:Number,default:0},saturation:{type:Number,default:0},value:{type:Number,default:0}},emits:["change"],setup:function(t,e){var i=e.emit;return{saturationStyle:$r(function(){return{width:"".concat(t.size,"px"),height:"".concat(t.size,"px"),background:"hsl(".concat(t.hue,", 100%, 50%)")}}),sliderStyle:$r(function(){return{top:"".concat((100-t.value)/100*t.size-5,"px"),left:"".concat(t.saturation*t.size/100-5,"px"),width:"".concat(10,"px"),height:"".concat(10,"px")}}),onSelect:function(e){var n=e.target.getBoundingClientRect(),r=n.left,o=n.top,s=function(e){var n,s;e instanceof MouseEvent?(n=e.clientX,s=e.clientY):e instanceof TouchEvent&&(n=e.touches[0].clientX,s=e.touches[0].clientY);var a=n-r,l=s-o;a<0&&(a=0),l<0&&(l=0),a>t.size&&(a=t.size),l>t.size&&(l=t.size),i("change",a/t.size*100,100-l/t.size*100)};s(e);var a=function(){document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",a)};s(e),e instanceof MouseEvent&&(document.addEventListener("mousemove",s),document.addEventListener("mouseup",a)),e instanceof TouchEvent&&(e.preventDefault(),document.addEventListener("touchmove",s,{passive:!1}),document.addEventListener("touchend",a))}}}});function RE(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===i&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}RE(".saturation[data-v-24517fec]{position:relative}.saturation-black[data-v-24517fec],.saturation-white[data-v-24517fec]{cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%}.saturation-white[data-v-24517fec]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.saturation-black[data-v-24517fec]{background:linear-gradient(0deg,#000,transparent)}.slider[data-v-24517fec]{border:1px solid #fff;border-radius:50%;box-shadow:0 0 1px 1px rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;top:0;z-index:1}"),BE.render=function(t,e,i,n,r,o){return fr(),mr("div",{class:"saturation",style:W(t.saturationStyle),onMousedown:e[0]||(e[0]=ts(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"])),onTouchstart:e[1]||(e[1]=ts(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"]))},[e[2]||(e[2]=kr("div",{class:"saturation-white"},null,-1)),e[3]||(e[3]=kr("div",{class:"saturation-black"},null,-1)),kr("div",{class:"slider",style:W(t.sliderStyle)},null,4)],36)},BE.__scopeId="data-v-24517fec",BE.__file="src/picker/Saturation.vue";var AE=Ri({name:"Hue",props:{width:{type:Number,default:15},height:{type:Number,default:160},hue:{type:Number,default:0}},emits:["change"],setup:function(t,e){var i=e.emit,n=$r(function(){return{top:"".concat((1-t.hue/360)*t.height-2,"px"),height:"".concat(4,"px")}}),r=xe();return Gi(function(){!function(){if(r.value){r.value.width=t.width,r.value.height=t.height;var e=r.value.getContext("2d");if(e){var i=e.createLinearGradient(0,0,0,t.height);i.addColorStop(0,"#FF0000"),i.addColorStop(.17,"#FF00FF"),i.addColorStop(.34,"#0000FF"),i.addColorStop(.51,"#00FFFF"),i.addColorStop(.68,"#00FF00"),i.addColorStop(.17*5,"#FFFF00"),i.addColorStop(1,"#FF0000"),e.fillStyle=i,e.fillRect(0,0,t.width,t.height)}}}()}),{canvas:r,sliderStyle:n,onSelect:function(e){var n=e.target.getBoundingClientRect().top,r=function(e){var r;e instanceof MouseEvent?r=e.clientY:e instanceof TouchEvent&&(r=e.touches[0].clientY);var o=r-n;o<0&&(o=0),o>t.height&&(o=t.height),i("change",360*(-100*o/t.height+100)/100)},o=function(){document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",o),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",o)};r(e),e instanceof MouseEvent&&(document.addEventListener("mousemove",r),document.addEventListener("mouseup",o)),e instanceof TouchEvent&&(e.preventDefault(),document.addEventListener("touchmove",r,{passive:!1}),document.addEventListener("touchend",o))}}}}),ME={ref:"canvas"};RE(".hue[data-v-78b9f4f0]{position:relative;touch-action:none}.slider[data-v-78b9f4f0]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),AE.render=function(t,e,i,n,r,o){return fr(),mr("div",{class:"hue",onMousedown:e[0]||(e[0]=ts(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"])),onTouchstart:e[1]||(e[1]=ts(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"]))},[kr("canvas",ME,null,512),kr("div",{class:"slider",style:W(t.sliderStyle)},null,4)],32)},AE.__scopeId="data-v-78b9f4f0",AE.__file="src/picker/Hue.vue";var DE=Ri({name:"Alpha",props:{width:{type:Number,default:15},height:{type:Number,default:160},color:{type:String,default:"#000000"},alpha:{type:Number,default:1}},setup:function(t,e){var i=e.emit,n=$r(function(){return{top:"".concat(t.alpha*t.height-2,"px"),height:"".concat(4,"px")}}),r=xe(),o=function(){var e=r.value.getContext("2d");r.value.width=t.width,r.value.height=t.height;var i=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=10,t.height=10,e.fillStyle="#ffffff",e.fillRect(0,0,10,10),e.fillStyle="#ccd5db",e.fillRect(0,0,5,5),e.fillRect(5,5,5,5),t}();e.fillStyle=e.createPattern(i,"repeat"),e.fillRect(0,0,t.width,t.height);var n=e.createLinearGradient(0,0,0,t.height);n.addColorStop(.01,"rgba(255,255,255,0)"),n.addColorStop(.99,t.color),e.fillStyle=n,e.fillRect(0,0,t.width,t.height)};return ni(function(){return t.color},function(){o()}),Gi(function(){o()}),{canvas:r,sliderStyle:n,onSelect:function(e){var n=e.target.getBoundingClientRect().top,r=function(e){var r;e instanceof MouseEvent?r=e.clientY:e instanceof TouchEvent&&(r=e.touches[0].clientY);var o=r-n;o<0&&(o=0),o>t.height&&(o=t.height),i("change",parseFloat((o/t.height).toFixed(2)))},o=function(){document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",o),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",o)};r(e),e instanceof MouseEvent&&(document.addEventListener("mousemove",r),document.addEventListener("mouseup",o)),e instanceof TouchEvent&&(e.preventDefault(),document.addEventListener("touchmove",r,{passive:!1}),document.addEventListener("touchend",o))}}}}),IE={ref:"canvas"};RE(".alpha[data-v-24dc9656]{position:relative;touch-action:none}.slider[data-v-24dc9656]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),DE.render=function(t,e,i,n,r,o){return fr(),mr("div",{class:"alpha",onMousedown:e[0]||(e[0]=ts(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"])),onTouchstart:e[1]||(e[1]=ts(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"]))},[kr("canvas",IE,null,512),kr("div",{class:"slider",style:W(t.sliderStyle)},null,4)],32)},DE.__scopeId="data-v-24dc9656",DE.__file="src/picker/Alpha.vue";var FE={rgb:"RGBA",hex:"HEX",hsl:"HSLA",hsv:"HSVA"},WE={rgb:"RGB",hex:"HEX",hsl:"HSL",hsv:"HSV"},zE={RGB:"rgb",RGBA:"rgb",HEX:"hex",HSL:"hsl",HSLA:"hsl",HSV:"hsv",HSVA:"hsv"};function NE(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function jE(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?NE(Object(i),!0).forEach(function(e){TE(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):NE(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}var VE=null,HE=function(t,e,i){var n=xe({}),r=i||{},o=r.placement,s=r.defaultStyle,a={strategy:r.strategy||"absolute",placement:o||"auto",onFirstUpdate:function(){VE.update()},modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"computeStyles",options:{gpuAcceleration:!1,adaptive:!0}},{name:"flip",options:{allowedAutoPlacements:["top","bottom"]}},{name:"applyStyles",enabled:!1},{name:"updateState",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(t){var e=t.state,i=e.styles,r=e.placement,o=i.popper;n.value=jE(jE(jE({},o),s),{},{transformOrigin:"top"===r?"center bottom":"center top"})}}]};return ni(function(){return[be(t),be(e)]},function(t,e){var i,n=PE(t,2),r=n[0],o=n[1],s=PE(e,2),l=s[0],h=s[1];if(r&&o&&(l!==r||h!==l)){null===(i=VE)||void 0===i||i.destroy();var c=r.$el||r,d=o.$el||o;je(function(){VE=mE(c,d,a)})}}),Zi(function(){var t;VE&&(null===(t=VE)||void 0===t||t.destroy(),VE=null)}),{instance:VE,style:n}},UE=Ri({props:{value:{type:String,default:"RGBA"},showAlpha:{type:Boolean},options:{type:[Boolean,Array]}},emits:["change"],setup:function(t,e){var i=e.emit,n=xe(null),r=xe(null),o=xe(!1),s=HE(n,r,{strategy:"fixed",defaultStyle:{zIndex:2}}).style,a=$r(function(){return Array.isArray(t.options)&&t.options.length>1}),l=$r(function(){var e=t.options,i=t.showAlpha,n=t.value;return Array.isArray(e)?i?e.map(function(t){return FE[t]}).filter(function(t){return!t.includes(n)}):e.map(function(t){return WE[t]}).filter(function(t){return!t.includes(n)}):[]}),h=function(t){var e,i,r=t.target;(null===(e=be(n))||void 0===e||!e.isEqualNode(r))&&null!==(i=be(n))&&void 0!==i&&i.contains(r)||(o.value=!1)};return Gi(function(){document.addEventListener("mouseup",h,!1)}),qi(function(){document.removeEventListener("mouseup",h,!1)}),{targetRef:n,selectorRef:r,selectorStyle:s,isShowSelector:o,isNeedSelect:a,formatOptions:l,onShow:function(){a.value&&(o.value=!0)},onFormatChange:function(t){i("change",zE[t])}}}}),YE={class:"format"},XE={key:0,class:"arrow"},GE=["onClick"];RE(".format[data-v-5f6e8f5e]{position:relative}.label[data-v-5f6e8f5e]{align-items:center;background:#e7e8e9;color:#999;display:flex;float:left;font-weight:500;height:30px;justify-content:center;position:relative;width:60px}[pick-colors-theme=dark] .label[data-v-5f6e8f5e]{background:#252930;color:#999}.arrow[data-v-5f6e8f5e]{height:6px;margin-bottom:4px;margin-left:5px;transform:rotate(135deg);width:6px}.arrow[data-v-5f6e8f5e],[pick-colors-theme=dark] .arrow[data-v-5f6e8f5e]{border-right:1px solid #999;border-top:1px solid #999}.selector[data-v-5f6e8f5e]{align-items:center;background:#f7f8f9;border-radius:5px;box-shadow:0 0 16px 0 rgba(0,0,0,.16);cursor:pointer;display:flex;flex-direction:column;font-weight:400;justify-content:center;padding:4px}[pick-colors-theme=dark] .selector[data-v-5f6e8f5e]{background:#252930;color:#999}.selector-item[data-v-5f6e8f5e]{align-items:center;display:flex;height:30px;justify-content:center;width:60px}.selector-item[data-v-5f6e8f5e]:hover{background:#e1f2fe}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]{color:#fff}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]:hover{background:#0087fa}.active-selector-item[data-v-5f6e8f5e]{background:#e1f2fe}[pick-colors-theme=dark] .active-selector-item[data-v-5f6e8f5e]{background:#0087fa}.v-enter-active[data-v-5f6e8f5e],.v-leave-active[data-v-5f6e8f5e]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-5f6e8f5e],.v-leave-to[data-v-5f6e8f5e]{opacity:0;transform:scaleY(0)}"),UE.render=function(t,e,i,n,r,o){return fr(),mr("div",YE,[kr("div",{class:"label",ref:"targetRef",onClick:e[0]||(e[0]=function(){return t.onShow&&t.onShow.apply(t,arguments)})},[kr("span",null,J(t.value),1),t.isNeedSelect?(fr(),mr("div",XE)):Lr("v-if",!0)],512),Er(ho,null,{default:qe(function(){return[t.isShowSelector?(fr(),mr("div",{key:0,class:"selector",ref:"selectorRef",style:W(t.selectorStyle)},[(fr(!0),mr(lr,null,an(t.formatOptions,function(e){return fr(),mr("div",{class:"selector-item",key:e,onClick:function(i){return t.onFormatChange(e)}},J(e),9,GE)}),128))],4)):Lr("v-if",!0)]}),_:1})])},UE.__scopeId="data-v-5f6e8f5e",UE.__file="src/picker/input-value/FormatValue.vue";var KE=Ri({name:"Input",components:{FormatValue:UE},props:{format:{type:String,default:"RGBA"},value:{type:String,default:""},width:{type:Number},showAlpha:{type:Boolean},formatOptions:{type:[Boolean,Array]}},emits:["change","focus","blur","enter","formatChange"],setup:function(t,e){var i=e.emit;return{onInput:function(t){var e;i("change",null===(e=t.target)||void 0===e?void 0:e.value)},valueStyle:$r(function(){return{minWidth:"".concat(t.width,"px"),maxWidth:"".concat(t.width,"px"),width:"".concat(t.width,"px")}}),onFocus:function(){i("focus")},onBlur:function(){i("blur")},onEnter:function(){i("enter")},onFormatChange:function(t){i("formatChange",t)}}}}),$E={class:"input"},ZE=[".value"];function qE(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function JE(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?qE(Object(i),!0).forEach(function(e){TE(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):qE(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}RE(".input[data-v-2c454c00]{display:flex;font-size:12px}.value[data-v-2c454c00]{background:#eceef0;border:1px solid #eceef0;box-sizing:border-box;color:#666;flex:1;height:30px;text-align:center}[pick-colors-theme=dark] .value[data-v-2c454c00]{background:#2e333a;border:1px solid #2e333a;color:#fff}.value[data-v-2c454c00]:focus{border:1px solid #1890ff;outline:none}"),KE.render=function(t,e,i,n,r,o){var s=rn("FormatValue");return fr(),mr("div",$E,[Er(s,{value:t.format,showAlpha:t.showAlpha,options:t.formatOptions,onChange:t.onFormatChange},null,8,["value","showAlpha","options","onChange"]),kr("input",{class:"value",style:W(t.valueStyle),".value":t.value,onFocus:e[0]||(e[0]=function(){return t.onFocus&&t.onFocus.apply(t,arguments)}),onInput:e[1]||(e[1]=function(){return t.onInput&&t.onInput.apply(t,arguments)}),onBlur:e[2]||(e[2]=function(){return t.onBlur&&t.onBlur.apply(t,arguments)}),onKeydown:e[3]||(e[3]=is(function(){return t.onEnter&&t.onEnter.apply(t,arguments)},["enter"]))},null,44,ZE)])},KE.__scopeId="data-v-2c454c00",KE.__file="src/picker/input-value/InputValue.vue";var QE=function(t,e,i){return[t,e*i/((t=(2-e)*i)<1?t:2-t)||0,t/2]},tC={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},eC=function(t){t=Math.min(Math.round(t),255);var e=Math.floor(t/16),i=t%16;return"".concat(tC[e]||e).concat(tC[i]||i)},iC=function(t){var e=t.r,i=t.g,n=t.b;return isNaN(e)||isNaN(i)||isNaN(n)?"":"#".concat(eC(e)).concat(eC(i)).concat(eC(n))},nC=function(t,e){var i;"string"==typeof(i=t)&&-1!==i.indexOf(".")&&1===parseFloat(i)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!==t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat("".concat(t)))),n&&(t=parseInt("".concat(t*e),10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)},rC=function(t,e,i){t=6*nC(t,360),e=nC(e,100),i=nC(i,100);var n=Math.floor(t),r=t-n,o=i*(1-e),s=i*(1-r*e),a=i*(1-(1-r)*e),l=n%6,h=[i,s,o,o,a,i][l],c=[a,i,i,s,o,o][l],d=[o,o,a,i,i,s][l];return{r:Math.round(255*h),g:Math.round(255*c),b:Math.round(255*d)}},oC=function(t,e,i){var n,r,o=t.h,s=t.s,a=t.v,l=t.a;if(i)switch(["hsl","hsv","rga"].includes(e)&&(l=(r=(n=l).toString().match(/\.(\d{1,2})(\d*)/))&&r[2].length>0?parseFloat(n.toFixed(2)):n),e){case"hsl":var h=QE(o,s/100,a/100);return"hsla(".concat(o.toFixed(0),", ").concat(Math.round(100*h[1]),"%, ").concat(Math.round(100*h[2]),"%, ").concat(l,")");case"hsv":return"hsva(".concat(o.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(a),"%, ").concat(l,")");case"rgb":var c=rC(o,s,a),d=c.r,u=c.g,p=c.b;return"rgba(".concat(d,", ").concat(u,", ").concat(p,", ").concat(l,")");default:return"".concat(iC(rC(o,s,a))).concat(eC(255*l))}else switch(e){case"hsl":var f=QE(o,s/100,a/100);return"hsl(".concat(o.toFixed(0),", ").concat(Math.round(100*f[1]),"%, ").concat(Math.round(100*f[2]),"%)");case"hsv":return"hsv(".concat(o.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(a),"%)");case"rgb":var g=rC(o,s,a),_=g.r,v=g.g,m=g.b;return"rgb(".concat(_,", ").concat(v,", ").concat(m,")");default:return iC(rC(o,s,a))}},sC=function(t){var e=t.r,i=t.g,n=t.b;e=nC(e,255),i=nC(i,255),n=nC(n,255);var r,o=Math.max(e,i,n),s=Math.min(e,i,n),a=o,l=o-s,h=0===o?0:l/o;if(o===s)r=0;else{switch(o){case e:r=(i-n)/l+(i<n?6:0);break;case i:r=(n-e)/l+2;break;case n:r=(e-i)/l+4}r/=6}return{h:360*r,s:100*h,v:100*a}},aC=function(t){var e=t.h,i=t.s,n=t.l;n/=100;var r=i/=100,o=Math.max(n,.01);return i*=(n*=2)<=1?n:2-n,r*=o<=1?o:2-o,{h:+e,s:100*(0===n?2*r/(o+r):2*i/(n+i)),v:(n+i)/2*100}},lC=function(t){var e=[];if(t.match(/^#([0-9a-fA-f]{3,4})$/g))for(var i=1;i<t.length;i++)e.push(parseInt("0x"+t[i].repeat(2)));else if(t.match(/^#([0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/g))for(var n=1;n<t.length;n+=2)e.push(parseInt("0x"+t.slice(n,n+2)));return{r:e[0],g:e[1],b:e[2],a:e[3]}},hC=function(t,e,i){if("string"==typeof t&&""!==t){var n=gC(pC(t,fC(t),i));return null==n?"":oC(n,e,i)}return""},cC=function(t){var e=PE(t.match(/(\d(\.\d+)?)+/g),4);return{r:e[0],g:e[1],b:e[2],a:e[3]}},dC=function(t){var e=PE(t.match(/(\d(\.\d+)?)+/g),4),i=e[0],n=e[1],r=e[2],o=e[3];return{h:i,s:parseFloat(n),l:parseFloat(r),a:o}},uC=function(t){var e=PE(t.match(/(\d(\.\d+)?)+/g),4),i=e[0],n=e[1],r=e[2],o=e[3];return{h:parseFloat(i),s:parseFloat(n),v:parseFloat(r),a:parseFloat(o)}},pC=function(t,e){if(arguments.length>2&&void 0!==arguments[2]&&!arguments[2])switch(e){case"rgb":return JE(JE({},sC(cC(t))),{},{a:1});case"hsv":var i=uC(t);return{h:i.h,s:i.s,v:i.v,a:1};case"hsl":return JE(JE({},aC(dC(t))),{},{a:1});default:return JE(JE({},sC(lC(t))),{},{a:1})}else switch(e){case"rgb":var n=cC(t),r=n.r,o=n.g,s=n.b,a=n.a;return JE(JE({},sC({r:r,g:o,b:s})),{},{a:+a});case"hsv":var l=uC(t);return{h:l.h,s:l.s,v:l.v,a:l.a};case"hsl":var h=dC(t),c=h.h,d=h.s,u=h.l,p=h.a;return JE(JE({},aC({h:c,s:d,l:u})),{},{a:+p});default:var f=lC(t),g=f.r,_=f.g,v=f.b,m=f.a;return JE(JE({},sC({r:g,g:_,b:v})),{},{a:m/255})}},fC=function(t){return t.match(/^#/)?"hex":t.match(/^rgb/)?"rgb":t.match(/^hsl/)?"hsl":t.match(/^hsv/)?"hsv":"hex"},gC=function(t){var e=t.h,i=t.s,n=t.v,r=t.a;return isNaN(e)&&isNaN(i)&&isNaN(n)?null:(isNaN(e)&&(e=0),isNaN(i)&&(i=0),isNaN(n)&&(n=0),isNaN(r)&&(r=1),{h:e,s:i,v:n,a:r})},_C=Ri({name:"ColorItem",props:{size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},value:{type:String,default:""},border:{type:Boolean,default:!0},borderRadius:{type:Number,default:5},selected:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:["select"],setup:function(t){var e=xe(),i=ei("theme",{theme:"light"}).theme,n=$r(function(){return parseFloat((t.width||t.size)+"")}),r=$r(function(){return parseFloat((t.height||t.size)+"")}),o=$r(function(){return{width:"".concat(be(n),"px"),height:"".concat(be(r),"px"),border:t.border?"1px solid ".concat("dark"===be(i)?"#434345":"#d9d9d9"):"",borderRadius:"".concat(t.borderRadius,"px"),boxShadow:t.selected?"0 0 3px 2px ".concat("dark"===be(i)?"#2681ff":"#1890ff"):""}}),s=function(){var i=e.value.getContext("2d");e.value.width=be(n),e.value.height=be(r);var o=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=10,t.height=10,e.fillStyle="#ffffff",e.fillRect(0,0,10,10),e.fillStyle="#ccd5db",e.fillRect(0,0,5,5),e.fillRect(5,5,5,5),t}();i.fillStyle=i.createPattern(o,"repeat"),i.fillRect(0,0,be(n),be(r)),i.fillStyle=t.value,i.fillRect(0,0,be(n),be(r))};return ni(function(){return t.value},function(){s()}),Gi(function(){s()}),{canvas:e,colorItemStyle:o}}}),vC=["draggable"];RE(".color-item[data-v-02da71fd]{display:inline-block;vertical-align:top}"),_C.render=function(t,e,i,n,r,o){return fr(),mr("canvas",{class:"color-item",style:W(t.colorItemStyle),ref:"canvas",draggable:t.draggable},null,12,vC)},_C.__scopeId="data-v-02da71fd",_C.__file="src/color-item/ColorItem.vue";var mC=Ri({name:"Colors",components:{ColorItem:_C},props:{colors:{type:Array,default:function(){return[]}},selectedIndex:{type:Number,default:-1}},emits:["change"],setup:function(t,e){var i=e.emit;return{onSelectColor:function(t,e){i("change",t,e)},useColors:$r(function(){return t.colors.map(function(t){return hC(t,"hex",!0)})})}}}),yC={class:"colors"};function xC(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function wC(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?xC(Object(i),!0).forEach(function(e){TE(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):xC(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}RE(".colors[data-v-0f8b52a8]{align-items:center;display:flex;flex-wrap:wrap;margin-top:5px}.color-item[data-v-0f8b52a8]{margin:5px}"),mC.render=function(t,e,i,n,r,o){var s=rn("color-item");return fr(),mr("div",yC,[(fr(!0),mr(lr,null,an(t.useColors,function(e,i){return fr(),yr(s,{key:i,class:"color-item",size:16,value:e,border:!1,"border-radius":3,selected:t.selectedIndex===i,onClick:ts(function(n){return t.onSelectColor(e,+i)},["stop","prevent"])},null,8,["value","selected","onClick"])}),128))])},mC.__scopeId="data-v-0f8b52a8",mC.__file="src/picker/Colors.vue";var bC=Ri({name:"Picker",components:{Colors:mC,Saturation:BE,Hue:AE,Alpha:DE,InputValue:KE},props:{format:{type:String,default:"hex"},showAlpha:{type:Boolean,default:!1},value:{type:String,default:""},colors:{type:Array,default:function(){return[]}},style:{type:Object,default:function(){return{}}},formatOptions:{type:[Boolean,Array]}},emits:["change","formatChange"],setup:function(t,e){var i=e.emit,n=$r(function(){return wC(wC({},t.style),{},{width:t.showAlpha?"230px":"205px"})}),r=xe(),o=xe(),s=xe(),a=function(){var e,i=null===(e=t.value)||void 0===e?void 0:e.trim();return null!=i&&""!==i?gC(pC(i,fC(i),t.showAlpha)):null};ni(function(){return t.value},function(){t.value!==be(s)&&(r.value=a())},{immediate:!0}),ni(function(){return[be(r),t.format]},function(e){var n=PE(e,2),r=n[0],l=n[1],h="";null!=r?(h=oC(wC({},r),t.format,t.showAlpha),o.value=wC({},r)):o.value=null,s.value=h;var c=a();JSON.stringify(r)!==JSON.stringify(c)&&JSON.stringify(r)!==JSON.stringify(l)&&i("change",h)},{immediate:!0});var l=$r(function(){var t;return(null===(t=be(r))||void 0===t?void 0:t.h)||0}),h=$r(function(){var t;return(null===(t=be(r))||void 0===t?void 0:t.s)||0}),c=$r(function(){var t;return(null===(t=be(r))||void 0===t?void 0:t.v)||0}),d=$r(function(){var t,e;return null!=(null===(t=be(r))||void 0===t?void 0:t.a)?null===(e=be(r))||void 0===e?void 0:e.a:1}),u=$r(function(){return rC(be(l),be(h),be(c))}),p=$r(function(){return"rgb(".concat(be(u).r,", ").concat(be(u).g,", ").concat(be(u).b,")")}),f=xe(-1);return{h:l,s:h,v:c,a:d,rgbStr:p,onSelectSaturation:function(t,e){f.value=-1,null==be(r)?r.value={h:be(l),s:t,v:e,a:be(d)}:r.value=wC(wC({},be(r)),{},{s:t,v:e})},onSelectHue:function(t){f.value=-1,be(r)??(r.value={h:t,s:be(h),v:be(c),a:be(d)}),r.value=wC(wC({},be(r)),{},{h:t})},onSelectAlpha:function(t){f.value=-1,null==be(r)?r.value={h:be(l),s:be(h),v:be(c),a:t}:r.value=wC(wC({},be(r)),{},{a:t})},handleInputFormat:function(e){return t.showAlpha?FE[e]:WE[e]},colorValue:s,pickerStyle:n,onInputChange:function(t){f.value=-1,s.value=t},handleChange:function(){var e,i=null===(e=be(s))||void 0===e?void 0:e.trim();if(""!==i){var n=t.showAlpha,a=gC(pC(i,fC(i),n));!function(t){if(!t)return!1;var e=t.h,i=t.s,n=t.v,r=t.a;return!(isNaN(e)||isNaN(i)||isNaN(n)||isNaN(r))}(a)?null!=be(o)?r.value=be(o):s.value="":r.value=a}else r.value=null},selectColorIndex:f,onSelectColor:function(t,e){if(f.value=e,""===(t=t.trim()))r.value=null;else{var i=fC(t);i?function(t,e){if(0!==t.length){var i=pC(t,e,!0),n=i.h,o=i.s,s=i.v;if(!(isNaN(n)||isNaN(o)||isNaN(s))){var a=1,l=i.a;isNaN(l)||(a=l),r.value={h:n,s:o,v:s,a:a}}}}(t,i):r.value=null}},onFormatChange:function(t){i("formatChange",t)}}}}),SC={class:"picker-inner"},kC={class:"picker-header"};RE(".picker[data-v-6ceadec6]{background:#f7f8f9;border-radius:4px;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-inner[data-v-6ceadec6]{padding:10px}[pick-colors-theme=dark] .picker-inner[data-v-6ceadec6]{background:#1d2024;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-header[data-v-6ceadec6]{display:flex;margin-bottom:5px}.alpha[data-v-6ceadec6],.hue[data-v-6ceadec6]{margin-left:10px}.colors[data-v-6ceadec6]{margin-top:5px}"),bC.render=function(t,e,i,n,r,o){var s=rn("saturation"),a=rn("hue"),l=rn("alpha"),h=rn("input-value"),c=rn("Colors");return fr(),mr("div",{class:"picker",style:W(t.pickerStyle)},[kr("div",SC,[kr("div",kC,[Er(s,{class:"saturation",hue:t.h,saturation:t.s,value:t.v,onChange:t.onSelectSaturation},null,8,["hue","saturation","value","onChange"]),Er(a,{class:"hue",hue:t.h,onChange:t.onSelectHue},null,8,["hue","onChange"]),t.showAlpha?(fr(),yr(l,{key:0,class:"alpha",alpha:t.a,color:t.rgbStr,onChange:t.onSelectAlpha},null,8,["alpha","color","onChange"])):Lr("v-if",!0)]),Er(h,{format:t.handleInputFormat(t.format),value:t.colorValue,showAlpha:t.showAlpha,width:t.showAlpha?150:125,formatOptions:t.formatOptions,onChange:t.onInputChange,onBlur:t.handleChange,onEnter:t.handleChange,onFormatChange:t.onFormatChange},null,8,["format","value","showAlpha","width","formatOptions","onChange","onBlur","onEnter","onFormatChange"]),t.colors.length>0?(fr(),yr(c,{key:0,class:"colors",colors:t.colors,"selected-index":t.selectColorIndex,onChange:t.onSelectColor},null,8,["colors","selected-index","onChange"])):Lr("v-if",!0)])],4)},bC.__scopeId="data-v-6ceadec6",bC.__file="src/picker/Picker.vue";var EC=Ri({name:"AddColorItem",props:{size:{type:Number,default:20},selected:{type:Boolean,default:!1}},setup:function(t){var e=ei("theme",{theme:"light"}).theme;return{addColorItemStyle:$r(function(){return{width:"".concat(t.size,"px"),height:"".concat(t.size,"px"),lineHeight:"".concat(t.size,"px"),boxShadow:t.selected?"0 0 3px 2px ".concat("dark"===be(e)?"#2681ff":"#1890ff"):""}})}}});RE(".add-color-item[data-v-ceb1719c]{background:#fff;border:1px solid #d9d9d9;border-radius:5px;vertical-align:top}.container[data-v-ceb1719c]{pointer-events:none;transform:scale(.9);transform-origin:center}[pick-colors-theme=dark] .add-color-item[data-v-ceb1719c]{background:#141414;border:1px solid #434343}path[data-v-ceb1719c]{fill:#000}[pick-colors-theme=dark] path[data-v-ceb1719c]{fill:#fff}"),EC.render=function(t,e,i,n,r,o){return fr(),mr("svg",{class:"add-color-item",style:W(t.addColorItemStyle),viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},e[0]||(e[0]=[kr("g",{class:"container"},[kr("path",{d:"M544 464V160h-80v304H160v80h304v304h80V544h304v-80z"})],-1)]),4)},EC.__scopeId="data-v-ceb1719c",EC.__file="src/add-color-item/AddColorItem.vue";var CC=Ri({name:"ColorPicker",components:{ColorItem:_C,Picker:bC,AddColorItem:EC},props:{value:{type:[String,Array]},theme:{type:String,default:"light"},size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},format:{type:String},showPicker:{type:Boolean,default:void 0},showAlpha:{type:Boolean,default:!1},addColor:{type:Boolean,default:!1},deleteColor:{type:Boolean,default:!0},max:{type:Number,default:13},popupContainer:{type:[String,Object,Boolean],default:"body"},zIndex:{type:Number,default:1e3},colors:{type:Array,default:function(){return["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#ff4500","#ff7d4d","#00babd","#1f93ff","#fa64c3"]}},position:{type:String},placement:{type:String},formatOptions:{type:[Boolean,Array],default:!1}},emits:["change","update:value","update:showPicker","overflowMax","closePicker","formatChange"],setup:function(t,e){var i=e.emit,n=xe([]),r=$r(function(){return be(n).map(function(e){return hC(e,"hex",t.showAlpha)})}),o=xe("hex");ni(function(){return t.format},function(){o.value=t.format},{immediate:!0}),ni(function(){return t.value},function(){var e=t.value||"";n.value=(Array.isArray(e)?e:[e]).map(function(e){return hC(e,be(o),t.showAlpha)})},{immediate:!0});var s=xe(void 0),a=$r(function(){return be(n)[be(s)]}),l=xe(!1);ni(function(){return t.showPicker},function(){l.value=t.showPicker},{immediate:!0});var h,c,d=xe(null),u=xe(null),p=HE(d,u,{defaultStyle:{zIndex:t.zIndex},strategy:t.position,placement:t.placement}).style,f=function(){be(d)??(d.value=be(k)[0]),be(s)??(s.value=0),void 0===t.showPicker?l.value=!0:i("update:showPicker",!0)},g=function(){s.value=void 0,void 0===t.showPicker?l.value=!1:i("update:showPicker",!1),i("closePicker",_e(Array.isArray(t.value)||t.addColor?be(n):be(n)[0]))},_=xe(),v=function(){var t=kE(LE.mark(function t(e){var i,n,r,o;return LE.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.target,null!=(r=null===(i=n.dataset)||void 0===i?void 0:i.index)&&""!==r){t.next=4;break}return t.abrupt("return");case 4:if(o=+r,be(s)!==o){t.next=7;break}return t.abrupt("return");case 7:null!=be(s)&&be(s)!==o?(g(),h&&clearTimeout(h),h=setTimeout(function(){f(),clearTimeout(h)},100)):f(),s.value=o,d.value=n;case 10:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),m=function(){var t=kE(LE.mark(function t(e){var i,n,r,o,s;return LE.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.target,null!==(i=be(_))&&void 0!==i&&i.isEqualNode(o)||!(null===(n=be(_))||void 0===n?void 0:n.contains(o))){t.next=4;break}return t.abrupt("return");case 4:if(!(null==(s=null===(r=be(u))||void 0===r?void 0:r.$el)?void 0:s.contains(o))){t.next=8;break}return t.abrupt("return");case 8:c&&clearTimeout(c),c=setTimeout(function(){be(l)&&g()},0);case 10:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}();ni(l,function(){be(l)&&(f(),clearTimeout(c))});var y,x=xe(t.max>be(n).length),w=$r(function(){return"string"==typeof t.popupContainer||"object"===bE(t.popupContainer)&&null!=t.popupContainer?t.popupContainer:"body"}),b=$r(function(){return"boolean"==typeof t.popupContainer&&!1===t.popupContainer}),S=$r(function(){return t.theme});ni(function(){return[t.theme,be(u)]},function(){je(function(){var t,e;null===(t=be(_))||void 0===t||t.setAttribute("pick-colors-theme",be(S)),null===(e=be(u))||void 0===e||null===(e=e.$el)||void 0===e||e.setAttribute("pick-colors-theme",be(S))})},{immediate:!0}),ti("theme",{theme:S});var k=xe([]);return Gi(function(){document.addEventListener("mouseup",m,!1),t.showPicker&&f()}),qi(function(){document.removeEventListener("mouseup",m,!1),h&&(clearTimeout(h),h=null),c&&(clearTimeout(c),c=null)}),{valueList:n,colorItemSelected:function(e){return(t.addColor?be(n).length>0:be(n).length>1)&&be(s)===e},selectedColor:a,selectedIndex:s,isShowPicker:l,addColorItemShow:x,onPickerChange:function(e){var r=be(s),o=be(n).slice(),a=be(n).length;if(null!=r){r>=0?o[r]=e:(s.value=a,o.push(e));var l;l=Array.isArray(t.value)||t.addColor?o:e,n.value=Array.isArray(l)?l:[l],i("update:value",l),i("change",l,e,r),t.addColor&&a>=t.max&&(x.value=!1,i("overflowMax"))}},colorPicker:_,onColorClick:v,pickerRef:u,onColorItemDragStart:function(t){t.dataTransfer.effectAllowed="move",y=+t.target.dataset.index},onColorItemDragOver:function(t){},onColorItemDrop:function(t){var e=+t.target.dataset.index,r=wE(be(n)),o=r[y];r.splice(y,1);var s=r.slice(0,e),a=r.splice(e),l=s.concat([o]).concat(a);i("update:value",l),i("change",l,l[y],y)},colorItemsRef:k,pickerStyle:p,values:r,teleportDisabled:b,toPopupContainer:w,formatValue:o,onFormatChange:function(t){o.value=t,i("formatChange",t)}}}});RE(".color-picker[data-v-3c43ade8]{display:inline-block}.color-item[data-v-3c43ade8]{margin:5px}.add-color-item[data-v-3c43ade8]{display:inline-block;margin:5px}.picker[data-v-3c43ade8]{overflow:hidden}.v-enter-active[data-v-3c43ade8],.v-leave-active[data-v-3c43ade8]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-3c43ade8],.v-leave-to[data-v-3c43ade8]{opacity:0;transform:scaleY(0)}"),CC.render=function(t,e,i,n,r,o){var s=rn("color-item"),a=rn("add-color-item"),l=rn("picker");return fr(),mr("div",{class:"color-picker",ref:"colorPicker",onDragstart:e[0]||(e[0]=ts(function(){return t.onColorItemDragStart&&t.onColorItemDragStart.apply(t,arguments)},["stop"])),onDragover:e[1]||(e[1]=ts(function(){return t.onColorItemDragOver&&t.onColorItemDragOver.apply(t,arguments)},["prevent","stop"])),onDrop:e[2]||(e[2]=ts(function(){return t.onColorItemDrop&&t.onColorItemDrop.apply(t,arguments)},["prevent","stop"])),onClick:e[3]||(e[3]=ts(function(){return t.onColorClick&&t.onColorClick.apply(t,arguments)},["stop"]))},[(fr(!0),mr(lr,null,an(t.values,function(e,i){return fr(),yr(s,{class:"color-item",key:i,ref_for:!0,ref:function(e){return t.colorItemsRef[i]=e},size:t.size,width:t.width,height:t.height,value:e,selected:t.colorItemSelected(i),"data-index":i,draggable:t.valueList.length>1,format:t.formatValue},null,8,["size","width","height","value","selected","data-index","draggable","format"])}),128)),t.addColor&&t.addColorItemShow?(fr(),yr(a,{key:0,class:"add-color-item",ref:"addColorItem",selected:t.colorItemSelected(-1),"data-index":-1},null,8,["selected"])):Lr("v-if",!0),(fr(),yr(_i,{to:t.toPopupContainer,disabled:t.teleportDisabled},[Er(ho,null,{default:qe(function(){return[t.isShowPicker?(fr(),yr(l,{key:0,class:"picker",style:W(t.pickerStyle),ref:"pickerRef",value:t.selectedColor,format:t.formatValue,"show-alpha":t.showAlpha,colors:t.colors,formatOptions:t.formatOptions,onChange:t.onPickerChange,onFormatChange:t.onFormatChange},null,8,["style","value","format","show-alpha","colors","formatOptions","onChange","onFormatChange"])):Lr("v-if",!0)]}),_:1})],8,["to","disabled"]))],544)},CC.__scopeId="data-v-3c43ade8",CC.__file="src/ColorPicker.vue";var OC={class:"panel-header"},LC={class:"panel-content"},PC={class:"config-item"},TC={class:"color-picker-wrapper"},BC={class:"config-item"},RC={class:"config-value"},AC={class:"config-item"},MC=["min","max"],DC={class:"config-value"},IC={class:"config-item"},FC={class:"config-value"},WC=Ri({__name:"BrushStylePanel",props:{visible:{type:Boolean},brushStyle:{},buttonRect:{}},emits:["close","update"],setup(t,{emit:e}){const i=t,n=e,r=["#FF4D4F","#FF7875","#FFA940","#FFC53D","#A0D911","#52C41A","#34D399","#10B981","#06B6D4","#0EA5E9","#3B82F6","#6366F1","#8B5CF6","#A855F7","#D946EF","#EC4899","#000000","#666666","#999999","#CCCCCC"],o=xe(i.brushStyle.color),s=xe(i.brushStyle.opacity),a=xe(i.brushStyle.size),l=xe(i.brushStyle.continuity);ni(()=>i.brushStyle,t=>{o.value=t.color,s.value=t.opacity,a.value=t.size,l.value=t.continuity},{deep:!0,immediate:!0});ni([o,s,a,l],()=>{(()=>{let t=o.value;if(t.startsWith("rgba")){const e=t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);e&&(t="#"+parseInt(e[1]).toString(16).padStart(2,"0")+parseInt(e[2]).toString(16).padStart(2,"0")+parseInt(e[3]).toString(16).padStart(2,"0"))}else if(t.startsWith("rgb")){const e=t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);e&&(t="#"+parseInt(e[1]).toString(16).padStart(2,"0")+parseInt(e[2]).toString(16).padStart(2,"0")+parseInt(e[3]).toString(16).padStart(2,"0"))}n("update",{color:t,opacity:s.value,size:a.value,continuity:l.value})})()});const h=$r(()=>{if(!i.buttonRect)return{left:"50%",top:"50%",transform:"translate(-50%, -50%)"};return{left:`${i.buttonRect.left+i.buttonRect.width/2}px`,bottom:`calc(100vh - ${i.buttonRect.top-10}px)`,transform:"translateX(-50%)"}});return(e,i)=>(fr(),yr(_i,{to:"body"},[t.visible?(fr(),mr("div",{key:0,class:"brush-panel-overlay",onClick:i[0]||(i[0]=t=>e.$emit("close"))})):Lr("",!0),t.visible?(fr(),mr("div",{key:1,class:"brush-style-panel",style:W(h.value),onClick:i[6]||(i[6]=ts(()=>{},["stop"]))},[kr("div",OC,[i[7]||(i[7]=kr("span",null,"笔刷配置",-1)),kr("button",{class:"close-btn",onClick:i[1]||(i[1]=t=>e.$emit("close"))},"×")]),kr("div",LC,[kr("div",PC,[i[8]||(i[8]=kr("label",{class:"config-label"},"颜色: ",-1)),kr("div",TC,[Er(be(CC),{value:o.value,"onUpdate:value":i[2]||(i[2]=t=>o.value=t),"predefine-colors":r,placement:"right","z-index":2001,popupContainer:!1},null,8,["value"])])]),kr("div",BC,[i[9]||(i[9]=kr("label",{class:"config-label"},"透明度: ",-1)),Je(kr("input",{type:"range",class:"config-slider","onUpdate:modelValue":i[3]||(i[3]=t=>s.value=t),min:"0.1",max:"1",step:"0.01"},null,512),[[Go,s.value,void 0,{number:!0}]]),kr("span",RC,J(Math.round(100*s.value))+"%",1)]),kr("div",AC,[i[10]||(i[10]=kr("label",{class:"config-label"},"大小:",-1)),Je(kr("input",{type:"range",class:"config-slider","onUpdate:modelValue":i[4]||(i[4]=t=>a.value=t),min:t.brushStyle.minSize,max:t.brushStyle.maxSize},null,8,MC),[[Go,a.value,void 0,{number:!0}]]),kr("span",DC,J(a.value),1)]),kr("div",IC,[i[11]||(i[11]=kr("label",{class:"config-label"},"连续性: ",-1)),Je(kr("input",{type:"range",class:"config-slider","onUpdate:modelValue":i[5]||(i[5]=t=>l.value=t),min:"5",max:"50"},null,512),[[Go,l.value,void 0,{number:!0}]]),kr("span",FC,J(l.value),1)])])],4)):Lr("",!0)]))}}),zC=(t,e)=>{const i=t.__vccOpts||t;for(const[n,r]of e)i[n]=r;return i},NC=zC(WC,[["__scopeId","data-v-10bc9982"]]),jC={key:0,class:"loading-overlay"},VC={key:1,class:"error-overlay"},HC={class:"zoom-controller"},UC={key:0,class:"hotkey-hint"},YC={key:0,class:"hotkey-hint"},XC={key:0,class:"hotkey-hint"},GC={class:"toolbar"},KC={key:0,class:"hotkey-hint"},$C={key:0,class:"hotkey-hint"},ZC={key:0,class:"hotkey-hint"},qC={key:0,class:"hotkey-hint"},JC={key:0,class:"hotkey-hint"},QC={key:0,class:"hotkey-hint"},tO={key:0,class:"hotkey-hint"},eO=Ri({__name:"PointAnnotation",props:{imageSource:{type:Object,required:!0},options:{type:Object,default:()=>({})}},emits:["pointChange","loadStart","loadSuccess","loadError","undoStateChange","redoStateChange"],setup(t,{expose:e,emit:i}){const n=t,r=i,o=xe(void 0),s=xe("idle"),a=xe(null),l=xe(null);let h=null,c=null;const d=new Hg({name:"contentLayer"}),u=new Hg({name:"pointLayer"}),p=xe({x:0,y:0}),f=xe(!1),g=xe(!1),_=xe(!1),v=xe("select"),m=xe(100),y=xe(void 0),x=xe(!1),w=xe(null),b=xe([]),S=xe(1),k=$r(()=>({...TS,...n.options?.pointStyle})),E=$r(()=>({...BS,...n.options?.brushStyle})),C=xe({...BS,...n.options?.brushStyle});ni(E,t=>{C.value={...t}},{immediate:!0}),ni(()=>C.value.opacity,t=>{O&&O.setOpacity(t)});let O=null;const L=xe(!1);let P=null;const T=t=>{if(k.value.fixedSizeOnZoom&&t&&t.children&&t.children.length){const e=h?.tree.scaleX||1,i=k.value.fixedSizeScale||1;t.children.forEach(t=>{t.scale=i/e})}},B=async t=>{const e=t||n.imageSource.url;if(h&&e){c&&(d.clear(),c.destroy()),s.value="loading",r("loadStart"),a.value=null,l.value=null;try{const t=await(i=e,new Promise((t,e)=>{const n=new window.Image;n.onload=()=>{t({width:n.width,height:n.height})},n.onerror=e,n.src=i}));a.value=t.width,l.value=t.height,c=new O_({url:e,draggable:!1,editable:!1,lazy:!0,zIndex:-1,placeholderColor:"transparent"}),c.on(Ep.LOADED,function(){s.value="success",r("loadSuccess"),A(),U()}),c.on(Ep.ERROR,function(t){s.value="error",r("loadError",t)}),d.add(c)}catch(o){s.value="error",r("loadError",o)}var i}};Gi(()=>{je(()=>{h=new W_({view:o.value,width:o.value?.clientWidth||800,height:o.value?.clientHeight||600,fill:"#e3e3e3",zoom:{min:.2,max:4},editor:{rotateable:!1,middlePoint:{}},tree:{type:"design"}}),h?.tree.add(d),h?.tree.add(u),u.zIndex=1e4,h&&(h.on(cv.ZOOM,()=>{at()}),h.on(iv.TAP,$),h.editor.on(Cw.SELECT,Z),h.on(iv.DOWN,X),h.on(iv.MOVE,G),h.on(iv.UP,K)),B(),P=new vS(100),window.addEventListener("keydown",M),window.addEventListener("mousemove",R),window.addEventListener("focusout",D);const t=function(t,e,i){var n=void 0===i?{}:i,r=n.event,o=void 0===r?"keydown":r,s=n.capture,a=PS(e,{timeout:n.timeout});return t.addEventListener(o,a,s),function(){t.removeEventListener(o,a,s)}}(window,{v:t=>{(f.value||g.value)&&(t.preventDefault(),F())},p:t=>{(f.value||g.value)&&(t.preventDefault(),W())},b:t=>{(f.value||g.value)&&(t.preventDefault(),z())},e:t=>{(f.value||g.value)&&(t.preventDefault(),V())},"$mod+KeyZ":t=>{(f.value||g.value)&&(t.preventDefault(),t.stopPropagation(),it())},"$mod+KeyY":t=>{(f.value||g.value)&&(t.preventDefault(),t.stopPropagation(),nt())},Delete:t=>{(f.value||g.value)&&(t.preventDefault(),t.stopPropagation(),Q())},"$mod+Equal":t=>{(f.value||g.value)&&(t.preventDefault(),t.stopPropagation(),ot())},"$mod+Minus":t=>{(f.value||g.value)&&(t.preventDefault(),t.stopPropagation(),rt())},"$mod+0":t=>{(f.value||g.value)&&(t.preventDefault(),t.stopPropagation(),st())},Alt:t=>{(f.value||g.value)&&(t.preventDefault(),_.value=!_.value)}});window.__pointAnnotationHotkeysUnsubscribe=t})});const R=t=>{p.value={x:t.clientX,y:t.clientY}},A=()=>{if(!(h&&c&&a.value&&l.value))return;const t=h.width,e=h.height,i=a.value,n=l.value,r=t/i,o=e/n,s=Math.min(r,o,1),d=(t-i*Number(s.toFixed(2)))/2,u=(e-n*Number(s.toFixed(2)))/2;h.tree.scale=Number(s.toFixed(2)),h.tree.x=d,h.tree.y=u,at()},M=t=>{if("Space"===t.code&&(()=>{if(!o.value)return!1;const t=o.value.getBoundingClientRect();return p.value.x>=t.left&&p.value.x<=t.right&&p.value.y>=t.top&&p.value.y<=t.bottom})())return t.preventDefault(),!1},D=t=>{const e=t.target;e instanceof HTMLElement&&"leafer-text-editor"===e.classList[0]&&h?.editor.cancel()},I=t=>{u&&u.children&&u.children.forEach(e=>{"point-annotation"===e._element_tag&&e.label&&(e.label.editable=t)})};qi(()=>{c&&(h?.tree.remove(c),c=null),h?.destroy(),h=null,window.removeEventListener("keydown",M),window.removeEventListener("mousemove",R),window.removeEventListener("focusout",D),window.__pointAnnotationHotkeysUnsubscribe&&(window.__pointAnnotationHotkeysUnsubscribe(),delete window.__pointAnnotationHotkeysUnsubscribe)});const F=()=>{v.value="select",x.value=!1,h&&(h.editor.config.moveable=!1,h.editor.config.resizeable=!1,h.editor.config.multipleSelect=!0,O?.setPointerEvents(!1),I(!0))},W=()=>{v.value="point",x.value=!1,h&&(h.editor.config.moveable=!0,h.editor.config.multipleSelect=!1,O?.setPointerEvents(!1),I(!0))},z=()=>{v.value="brush",h&&(h.editor.config.moveable=!1,h.editor.config.resizeable=!1,h.editor.config.multipleSelect=!1,O?.setPointerEvents(!0),I(!1),x.value=!x.value,x.value&&je(()=>{y.value&&(w.value=y.value.getBoundingClientRect())}))},N=()=>{x.value=!1},j=t=>{Object.assign(C.value,t)},V=()=>{v.value="eraser",x.value=!1,h&&(h.editor.config.moveable=!1,h.editor.config.resizeable=!1,h.editor.config.multipleSelect=!1,O?.setPointerEvents(!0),I(!1))},U=()=>{a.value&&l.value&&h&&(O&&O.getGroup().remove(),O=new sk(a.value,l.value,C.value),d.add(O.getGroup()))};let Y=null;const X=t=>{if("brush"!==v.value&&"eraser"!==v.value)return;if(!h||!c||!O)return;L.value=!0,P&&(Y=O.getImageData());const e=d.getBoxPoint({x:t.x,y:t.y});"eraser"===v.value?O.erase(e.x,e.y,C.value.size,C.value.continuity):O.draw(e.x,e.y,C.value.size,C.value.color,C.value.opacity,C.value.continuity),O.getCanvas().paint()},G=t=>{if(!L.value||!O||!c)return;const e=d.getBoxPoint({x:t.x,y:t.y});"eraser"===v.value?O.erase(e.x,e.y,C.value.size,C.value.continuity):O.draw(e.x,e.y,C.value.size,C.value.color,C.value.opacity,C.value.continuity),O.getCanvas().paint()},K=()=>{if(L.value=!1,P&&O&&Y){const t=new xS(O,Y);P.executeCommand(t),Y=null}O?.resetLastPoint()},$=t=>{if("point"!==v.value||!h||!c)return;if(h.editor&&h.editor.list&&h.editor.list.length>0)return;let e=t.target;for(;e;){if("point-annotation"===e._element_tag)return;e=e.parent}const i=d.getBoxPoint({x:t.x,y:t.y});i.x<0||i.x>(a.value||0)||i.y<0||i.y>(l.value||0)||q(i.x,i.y)},Z=t=>{if("brush"!==v.value&&"eraser"!==v.value&&h&&c){if(t.value)if(Array.isArray(t.value))t.value.forEach(t=>{t.circle&&t.circle.set({fill:k.value.selectedCircleFill,stroke:k.value.selectedCircleStroke})});else{const e=t.value.circle||t.value.parent.circle;if(!e)return;e.set({fill:k.value.selectedCircleFill,stroke:k.value.selectedCircleStroke})}if(t.oldValue&&(!Array.isArray(t.oldValue)||!t.value))if(Array.isArray(t.oldValue))t.oldValue.forEach(t=>{t.circle&&t.circle.set({fill:k.value.circleFill,stroke:k.value.circleStroke})});else{const e=t.oldValue.circle||t.oldValue.parent.circle;if(!e||t.oldValue===t.value?.parent)return;e.set({fill:k.value.circleFill,stroke:k.value.circleStroke})}}},q=(t,e)=>{if(!a.value||!l.value)return null;const i=`point_${"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}`,n=`#${S.value}`,o={id:i,pixel:{x:t,y:e},normalized:{x:t/a.value,y:e/l.value},label:n,createdAt:Date.now(),updatedAt:Date.now()},s=new ok(o,k.value);if("brush"!==v.value&&"eraser"!==v.value||(s.label.editable=!1),P){const t=new mS(u,s,b.value,o);P.executeCommand(t)}else u.add(s),b.value.push(o);return T(u),S.value++,r("pointChange",[...b.value]),h?.editor&&h.editor.select(s),i},Q=()=>{if("brush"===v.value||"eraser"===v.value)return void et();if("select"===v.value&&0===(h?.editor?.list||[]).length&&(b.value.length>0||O?.hasContent()))return void(confirm("确定清除所有标注和笔刷绘制区域吗?")&&tt());if(!h?.editor)return;const t=h.editor.list;0!==t.length&&(t.forEach(t=>{if("point-annotation"===t._element_tag)if(P){const e=new yS(u,t,b.value);P.executeCommand(e)}else{u.remove(t),t.destroy();const e=b.value.findIndex(e=>e.id===t.data.id);e>-1&&b.value.splice(e,1)}}),h.editor.cancel(),r("pointChange",[...b.value]))},tt=()=>{b.value.forEach(t=>{const e=u.children.find(e=>e.data?.id===t.id);e&&(u.remove(e),e.destroy())}),b.value=[],O?.clear(),r("pointChange",[])},et=()=>{if(O){if(P){const t=O.getImageData(),e=new xS(O,t,!0);P.executeCommand(e)}O.clear(),O.getCanvas().paint()}},it=()=>{P?.canUndo()&&P.undo()},nt=()=>{P?.canRedo()&&P.redo()},rt=()=>{h&&(h.tree.zoom("out"),at())},ot=()=>{h&&(h.tree.zoom("in"),at())},st=()=>{h&&(h.tree.zoom(1),at())},at=()=>{h&&h.tree&&void 0!==h.tree.scaleX&&(m.value=Math.round(100*h.tree.scaleX),T(u))};return e({getPointAnnotations:()=>[...b.value],getImageInfo:()=>({id:n.imageSource.id,url:n.imageSource.url,width:a.value,height:l.value}),exportCanvasJSON:()=>{const t={version:"1.0",imageUrl:n.imageSource.url||"",imageWidth:a.value,imageHeight:l.value,pointAnnotations:[...b.value],brushMask:O?.getImageData()||null,exportTime:Date.now()};return JSON.stringify(t,null,2)},exportMaskImage:(t,e)=>new Promise(i=>{if(!O)return void i(null);const r=t||n.options?.maskExportFormat||"png",o=e||n.options?.maskExportForeground||"black",s=O.getImageData();if(!s)return void i(null);const h=document.createElement("img");h.onload=()=>{const t=document.createElement("canvas");t.width=a.value||0,t.height=l.value||0;const e=t.getContext("2d");if(!e)return void i(null);e.drawImage(h,0,0);const n="white"===o,s=e.getImageData(0,0,t.width,t.height),c=s.data;for(let i=0;i<c.length;i+=4)c[i+3]>0?(c[i]=n?255:0,c[i+1]=n?255:0,c[i+2]=n?255:0,c[i+3]=255):"png"!==r&&(c[i]=n?0:255,c[i+1]=n?0:255,c[i+2]=n?0:255,c[i+3]=255);e.putImageData(s,0,0),i("png"===r?t.toDataURL("image/png"):t.toDataURL("image/jpeg",.95))},h.onerror=()=>{i(null)},h.src=s}),exportCOCO:()=>{const t=function(t,e,i,n,r){const o=r?.imageId||1,s=r?.categoryName||"point";return{info:{year:(new Date).getFullYear(),version:"1.0",contributor:"leafer-point-annotation",date_created:(new Date).toISOString().split("T")[0]},images:[{id:o,file_name:(t=>{try{return new URL(t).pathname.split("/").pop()||"image.jpg"}catch{return"image.jpg"}})(e),width:i,height:n}],annotations:t.map((t,e)=>({id:e+1,image_id:o,category_id:1,keypoints:[t.pixel.x,t.pixel.y,2],num_keypoints:1,iscrowd:0})),categories:[{id:1,name:s,supercategory:"annotation",keypoints:["point"],skeleton:[]}]}}(b.value,n.imageSource.url||"",a.value||0,l.value||0);return JSON.stringify(t,null,2)},exportYOLO:()=>{const t=function(t,e,i,n){const r=n?.className||"point",o=n?.pointSize||20;return{annotations:t.map(t=>{const n=t.normalized.x,r=t.normalized.y,s=o/e,a=o/i;return`0 ${n.toFixed(6)} ${r.toFixed(6)} ${s.toFixed(6)} ${a.toFixed(6)}`}).join("\n"),classNames:r,imageWidth:e,imageHeight:i}}(b.value,a.value||0,l.value||0);return{annotations:t.annotations,classNames:t.classNames}},importCanvasJSON:async(t,e)=>{try{const i=JSON.parse(t);if(e?.resetZoom&&(st(),A()),b.value.forEach(t=>{const e=u.findOne(`#${t.id}`);e&&(u.remove(e),e.destroy())}),b.value=[],O?.clear(),i.imageUrl&&i.imageUrl!==n.imageSource.url&&await B(i.imageUrl),i.pointAnnotations&&Array.isArray(i.pointAnnotations))for(const t of i.pointAnnotations){const e=new ok(t,k.value);"brush"!==v.value&&"eraser"!==v.value||(e.label.editable=!1),u.add(e),b.value.push(t)}return i.brushMask&&O&&O.restoreImageData(i.brushMask),T(u),!0}catch(i){return!1}},loadImage:B,clearBrush:et,zoomIn:ot,zoomOut:rt,resetZoom:st,undo:it,redo:nt,getCurrentTool:()=>v.value,setTool:t=>{v.value=t},createPointAnnotation:q,removePointAnnotation:t=>{const e=b.value.findIndex(e=>e.id===t);if(-1===e)return!1;const i=u.children[e];if(!i)return!1;if(P){const t=new yS(u,i,b.value);P.executeCommand(t)}else u.remove(i),i.destroy(),b.value.splice(e,1);return r("pointChange",[...b.value]),!0}}),(t,e)=>(fr(),mr(lr,null,[kr("div",{class:"point-annotation",onFocus:e[1]||(e[1]=t=>f.value=!0),onBlur:e[2]||(e[2]=t=>f.value=!1),onMouseenter:e[3]||(e[3]=t=>g.value=!0),onMouseleave:e[4]||(e[4]=t=>g.value=!1)},[kr("div",{ref_key:"canvasContainer",ref:o,class:"canvas-container",tabindex:"0"},["loading"===s.value?(fr(),mr("div",jC,[...e[5]||(e[5]=[kr("div",{class:"gradient-animation"},null,-1),kr("div",{class:"loading-text"},"图片加载中",-1)])])):Lr("",!0),"error"===s.value?(fr(),mr("div",VC,[e[6]||(e[6]=kr("p",null,"加载失败",-1)),kr("button",{onClick:e[0]||(e[0]=t=>B())},"重试")])):Lr("",!0),kr("div",HC,[kr("button",{class:"zoom-button",title:"缩小 (Ctrl+-)",onClick:rt},[e[7]||(e[7]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[kr("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)),_.value?(fr(),mr("span",UC,"Ctrl+-")):Lr("",!0)]),kr("div",{class:"zoom-value",onClick:st,title:"点击重置为100% (Ctrl+0)"},[Or(J(m.value)+"% ",1),_.value?(fr(),mr("span",YC,"Ctrl+0")):Lr("",!0)]),kr("button",{class:"zoom-button",title:"放大 (Ctrl++)",onClick:ot},[e[8]||(e[8]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[kr("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),kr("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)),_.value?(fr(),mr("span",XC,"Ctrl++")):Lr("",!0)])])],512),kr("div",GC,[kr("button",{class:H(["tool-button",{active:"select"===v.value}]),title:"选择工具 (V)",onClick:F},[e[9]||(e[9]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-mouse-pointer2-icon lucide-mouse-pointer-2"},[kr("path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z"})],-1)),_.value?(fr(),mr("span",KC,"V")):Lr("",!0)],2),kr("button",{class:H(["tool-button",{active:"point"===v.value}]),title:"点标注工具 (P)",onClick:W},[e[10]||(e[10]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[kr("circle",{cx:"12",cy:"12",r:"10"}),kr("circle",{cx:"12",cy:"12",r:"3"})],-1)),_.value?(fr(),mr("span",$C,"P")):Lr("",!0)],2),kr("button",{class:H(["tool-button",{active:"brush"===v.value}]),title:"笔刷工具 (B)",onClick:z,ref_key:"brushButtonRef",ref:y},[e[11]||(e[11]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[kr("path",{d:"M9.06 11.9l8.07-8.06a2.85 2.85 0 1 1 4.03 4.03l-8.06 8.08"}),kr("path",{d:"M7.07 14.94c-1.66 0-3 1.35-3 3.02 0 1.33-2.5 1.52-2 2.02 1.08 1.1 2.49 2.02 4 2.02 2.2 0 4-1.8 4-4.04a3.01 3.01 0 0 0-3-3.02z"})],-1)),_.value?(fr(),mr("span",ZC,"B")):Lr("",!0)],2),kr("button",{class:H(["tool-button",{active:"eraser"===v.value}]),title:"橡皮擦工具 (E)",onClick:V},[e[12]||(e[12]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[kr("path",{d:"M20 20H7L3 16C2.4 15.4 2.4 14.4 3 13.8L13.8 3C14.4 2.4 15.4 2.4 16 3L21 8C21.6 8.6 21.6 9.6 21 10.2L10.2 21C9.6 21.6 8.6 21.6 8 21L3 16"})],-1)),_.value?(fr(),mr("span",qC,"E")):Lr("",!0)],2),kr("button",{class:"tool-button",title:"撤销 (Ctrl+Z)",onClick:it},[e[13]||(e[13]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[kr("path",{d:"M3 7v6h6"}),kr("path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})],-1)),_.value?(fr(),mr("span",JC,"Ctrl+Z")):Lr("",!0)]),kr("button",{class:"tool-button",title:"重做 (Ctrl+Y)",onClick:nt},[e[14]||(e[14]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[kr("path",{d:"M21 7v6h-6"}),kr("path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7"})],-1)),_.value?(fr(),mr("span",QC,"Ctrl+Y")):Lr("",!0)]),kr("button",{class:"tool-button",title:"删除 (Delete)",onClick:Q},[e[15]||(e[15]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[kr("path",{d:"M3 6h18"}),kr("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),kr("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})],-1)),_.value?(fr(),mr("span",tO,"Del")):Lr("",!0)])])],32),Er(NC,{visible:x.value,"brush-style":C.value,"button-rect":w.value,onClose:N,onUpdate:j},null,8,["visible","brush-style","button-rect"])],64))}}),iO=zC(eO,[["__scopeId","data-v-b7ee4495"]]),nO={class:"app"},rO={class:"editor-container"},oO={class:"controls"},sO={class:"control-group"},aO={class:"control-group"},lO={class:"control-group"},hO={class:"mask-options"},cO={class:"control-group"},dO={class:"api-row"},uO={class:"api-row"},pO={class:"output"},fO={class:"status"},gO=Ri({__name:"App",setup(t){const e=xe("https://picsum.photos/1280/1080"),i=$r(()=>({id:"test-image",url:e.value})),n=xe({pointStyle:{fill:"#f00",stroke:"#fff",strokeWidth:2,width:16,height:16,radius:8},selectedPointStyle:{fill:"#00f",stroke:"#fff",strokeWidth:2,radius:10}}),r=xe("idle"),o=xe(""),s=xe(null),a=xe("png"),l=xe("black"),h=xe("select"),c=xe("select"),d=xe(null),u=t=>{o.value=JSON.stringify(t,null,2)},p=()=>{r.value="loading"},f=()=>{r.value="success"},g=t=>{r.value="error"},_=()=>{s.value&&s.value.loadImage()},v=()=>{if(s.value){const t=s.value.getPointAnnotations(),e=JSON.stringify(t,null,2),i=new Blob([e],{type:"application/json"}),n=URL.createObjectURL(i),r=document.createElement("a");r.href=n,r.download="point-data.json",r.click(),URL.revokeObjectURL(n)}},m=()=>{if(s.value){const t=s.value.getPointAnnotations();o.value=JSON.stringify(t,null,2)}},y=()=>{if(s.value){const t=s.value.exportCanvasJSON(),e=new Blob([t],{type:"application/json"}),i=URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download="canvas-data.json",n.click(),URL.revokeObjectURL(i)}},x=xe(null),w=()=>{x.value?.click()},b=async t=>{const e=t.target,i=e.files?.[0];if(i){const t=new FileReader;t.onload=async t=>{const e=t.target?.result;s.value&&(await s.value.importCanvasJSON(e,{resetZoom:!0})?alert("Canvas imported successfully!"):alert("Failed to import canvas."))},t.readAsText(i)}e.value=""},S=async()=>{if(s.value){const t=await s.value.exportMaskImage(a.value,l.value);if(t){const e="png"===a.value?"png":"jpg",i=document.createElement("a");i.href=t,i.download=`brush-mask.${e}`,i.click()}else alert("No brush data to export.")}},k=()=>{if(s.value){const t=s.value.exportCOCO(),e=new Blob([t],{type:"application/json"}),i=URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download="annotation-coco.json",n.click(),URL.revokeObjectURL(i)}},E=()=>{if(s.value){const t=s.value.exportYOLO(),e=new Blob([t.annotations],{type:"text/plain"}),i=URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download="annotation-yolo.txt",n.click(),URL.revokeObjectURL(i);const r=new Blob([t.classNames],{type:"text/plain"}),o=URL.createObjectURL(r),a=document.createElement("a");a.href=o,a.download="class-names.txt",a.click(),URL.revokeObjectURL(o)}},C=()=>{s.value&&(s.value.clearBrush?.(),alert("Brush cleared!"))},O=()=>{s.value&&s.value.undo()},L=()=>{s.value&&s.value.redo()},P=()=>{s.value&&(s.value.setTool(h.value),c.value=h.value)},T=()=>{if(s.value){const t=s.value.createPointAnnotation(100,100);t&&(d.value=t,alert(`Point added with id: ${t}`))}},B=()=>{if(s.value&&d.value)s.value.removePointAnnotation(d.value)&&(d.value=null,alert("Point removed"));else{const t=s.value?.getPointAnnotations();if(t&&t.length>0){const e=t[t.length-1];s.value?.removePointAnnotation(e.id)&&alert("Last point removed")}else alert("No points to remove")}};return(t,d)=>(fr(),mr("div",nO,[d[18]||(d[18]=kr("h1",null,"LeaferJS Point Annotation Test",-1)),kr("div",rO,[Er(iO,{ref_key:"pointAnnotation",ref:s,imageSource:i.value,options:n.value,onPointChange:u,onLoadStart:p,onLoadSuccess:f,onLoadError:g},null,8,["imageSource","options"])]),kr("div",oO,[d[15]||(d[15]=kr("h2",null,"Controls",-1)),kr("div",sO,[d[4]||(d[4]=kr("label",{for:"imageUrl"},"Image URL:",-1)),Je(kr("input",{type:"text",id:"imageUrl","onUpdate:modelValue":d[0]||(d[0]=t=>e.value=t),placeholder:"Enter image URL"},null,512),[[Go,e.value]])]),kr("div",{class:"control-group"},[kr("button",{onClick:m},"Get Point Data"),kr("button",{onClick:v},"Export Point Data"),kr("button",{onClick:_},"Refresh Image")]),kr("div",aO,[d[5]||(d[5]=kr("h3",null,"Canvas Export/Import",-1)),kr("button",{onClick:y},"Export Canvas JSON"),kr("input",{type:"file",ref_key:"fileInput",ref:x,style:{display:"none"},accept:".json",onChange:b},null,544),kr("button",{onClick:w},"Import Canvas JSON")]),kr("div",lO,[d[10]||(d[10]=kr("h3",null,"Brush Mask Export",-1)),kr("div",hO,[kr("label",null,[d[7]||(d[7]=Or(" Format: ",-1)),Je(kr("select",{"onUpdate:modelValue":d[1]||(d[1]=t=>a.value=t)},[...d[6]||(d[6]=[kr("option",{value:"png"},"PNG",-1),kr("option",{value:"jpeg"},"JPEG",-1)])],512),[[Ko,a.value]])]),kr("label",null,[d[9]||(d[9]=Or(" Foreground: ",-1)),Je(kr("select",{"onUpdate:modelValue":d[2]||(d[2]=t=>l.value=t)},[...d[8]||(d[8]=[kr("option",{value:"black"},"Black",-1),kr("option",{value:"white"},"White",-1)])],512),[[Ko,l.value]])])]),kr("button",{onClick:S},"Export Mask Image"),kr("button",{onClick:C},"Clear Brush")]),kr("div",{class:"control-group"},[d[11]||(d[11]=kr("h3",null,"Annotation Format Export",-1)),kr("button",{onClick:k},"Export COCO JSON"),kr("button",{onClick:E},"Export YOLO")]),kr("div",cO,[d[14]||(d[14]=kr("h3",null,"API Methods",-1)),kr("div",{class:"api-row"},[kr("button",{onClick:O},"Undo"),kr("button",{onClick:L},"Redo")]),kr("div",dO,[d[13]||(d[13]=kr("label",null,"Tool:",-1)),Je(kr("select",{"onUpdate:modelValue":d[3]||(d[3]=t=>h.value=t)},[...d[12]||(d[12]=[kr("option",{value:"select"},"Select",-1),kr("option",{value:"point"},"Point",-1),kr("option",{value:"brush"},"Brush",-1),kr("option",{value:"eraser"},"Eraser",-1)])],512),[[Ko,h.value]]),kr("button",{onClick:P},"Set Tool")]),kr("div",{class:"api-row"},[kr("button",{onClick:T},"Add Point (100,100)"),kr("button",{onClick:B},"Remove Last Point")]),kr("div",uO,[kr("span",null,"Current Tool: "+J(c.value),1)])])]),kr("div",pO,[d[16]||(d[16]=kr("h2",null,"Point Data",-1)),kr("pre",null,J(o.value),1)]),kr("div",fO,[d[17]||(d[17]=kr("h2",null,"Status",-1)),kr("p",null,"Image Load Status: "+J(r.value),1)])]))}});((...t)=>{const e=(qo||(qo=tr(ns))).createApp(...t),{mount:i}=e;return e.mount=t=>{const n=function(t){return v(t)?document.querySelector(t):t}(t);if(!n)return;const r=e._component;_(r)||r.render||r.template||(r.template=n.innerHTML),1===n.nodeType&&(n.textContent="");const o=i(n,!1,function(t){if(t instanceof SVGElement)return"svg";if("function"==typeof MathMLElement&&t instanceof MathMLElement)return"mathml"}(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),o},e})(zC(gO,[["__scopeId","data-v-c05a47b7"]])).mount("#app");
|