@zyzgroup/core-web 0.0.70 → 0.0.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/better.css +2 -0
- package/dist/font.css +21 -0
- package/dist/zyzgroup_core_web.iife.js +18 -18
- package/dist/zyzgroup_core_web.iife.js.map +1 -1
- package/dist/zyzgroup_core_web.js +8724 -7456
- package/dist/zyzgroup_core_web.js.map +1 -1
- package/dist/zyzgroup_core_web.umd.cjs +18 -18
- package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/types/Pagination.d.ts +36 -0
- package/types/Pagination.d.ts.map +1 -0
- package/types/YZMessageChannel.d.ts +21 -0
- package/types/YZMessageChannel.d.ts.map +1 -0
- package/types/YZRequestIdleCallback.d.ts +14 -0
- package/types/YZRequestIdleCallback.d.ts.map +1 -0
- package/types/YZWorker.d.ts +16 -0
- package/types/YZWorker.d.ts.map +1 -0
- package/types/animate/{AnimateOperation.d.ts → YZAnimate.d.ts} +25 -26
- package/types/animate/YZAnimate.d.ts.map +1 -0
- package/types/animate/index.d.ts +2 -2
- package/types/animate/index.d.ts.map +1 -1
- package/types/animate/requestAnimationFrameCycle.d.ts +14 -0
- package/types/animate/requestAnimationFrameCycle.d.ts.map +1 -0
- package/types/animate/tween/cubicBezierToEase.d.ts +3 -5
- package/types/animate/tween/cubicBezierToEase.d.ts.map +1 -1
- package/types/cache.d.ts +1 -1
- package/types/cache.d.ts.map +1 -1
- package/types/canvas/CustomCanvasContext.d.ts.map +1 -1
- package/types/canvas/{Canvas.d.ts → YZCanvas.d.ts} +7 -6
- package/types/canvas/YZCanvas.d.ts.map +1 -0
- package/types/canvas/{CanvasOperation.d.ts → YZCanvasContext.d.ts} +13 -15
- package/types/canvas/YZCanvasContext.d.ts.map +1 -0
- package/types/canvas/index.d.ts +2 -2
- package/types/canvas/index.d.ts.map +1 -1
- package/types/dom/DOMEventBus.d.ts +4 -0
- package/types/dom/DOMEventBus.d.ts.map +1 -1
- package/types/dom/DOMUtil.d.ts +11 -4
- package/types/dom/DOMUtil.d.ts.map +1 -1
- package/types/env.d.ts +3 -1
- package/types/env.d.ts.map +1 -1
- package/types/image/bitmap.d.ts +10 -1
- package/types/image/bitmap.d.ts.map +1 -1
- package/types/index.d.ts +5 -1
- package/types/index.d.ts.map +1 -1
- package/types/math/Arc.d.ts +2 -2
- package/types/math/Arc.d.ts.map +1 -1
- package/types/math/ComboConfetti.d.ts +25 -0
- package/types/math/ComboConfetti.d.ts.map +1 -0
- package/types/math/CubicBezier.d.ts +2 -2
- package/types/math/Ellipse.d.ts +2 -2
- package/types/math/Ellipse.d.ts.map +1 -1
- package/types/math/{Light3d.d.ts → Light3D.d.ts} +7 -7
- package/types/math/{Light3d.d.ts.map → Light3D.d.ts.map} +1 -1
- package/types/math/Line.d.ts +6 -2
- package/types/math/Line.d.ts.map +1 -1
- package/types/math/Matrix.d.ts +93 -18
- package/types/math/Matrix.d.ts.map +1 -1
- package/types/math/PathD.d.ts +27 -11
- package/types/math/PathD.d.ts.map +1 -1
- package/types/math/PathDGroup.d.ts +2 -2
- package/types/math/PathDGroup.d.ts.map +1 -1
- package/types/math/Point.d.ts +39 -11
- package/types/math/Point.d.ts.map +1 -1
- package/types/math/Point3D.d.ts +78 -0
- package/types/math/Point3D.d.ts.map +1 -0
- package/types/math/Point3Ds.d.ts +19 -0
- package/types/math/{Point3ds.d.ts.map → Point3Ds.d.ts.map} +1 -1
- package/types/math/Points.d.ts +2 -2
- package/types/math/QuadraticBezier.d.ts +2 -2
- package/types/math/Rect.d.ts +2 -2
- package/types/math/Rect.d.ts.map +1 -1
- package/types/math/RenderGroup.d.ts +18 -0
- package/types/math/RenderGroup.d.ts.map +1 -0
- package/types/math/Shape.d.ts +79 -33
- package/types/math/Shape.d.ts.map +1 -1
- package/types/math/ShapeGroup.d.ts +10 -2
- package/types/math/ShapeGroup.d.ts.map +1 -1
- package/types/math/Text.d.ts +6 -7
- package/types/math/Text.d.ts.map +1 -1
- package/types/math/index.d.ts +4 -4
- package/types/math/index.d.ts.map +1 -1
- package/types/math/math.d.ts +4 -3
- package/types/math/math.d.ts.map +1 -1
- package/types/math/shapes/Arrow.d.ts +2 -2
- package/types/math/shapes/Fox.d.ts +2 -2
- package/types/math/shapes/Ring.d.ts +22 -0
- package/types/math/shapes/Ring.d.ts.map +1 -0
- package/types/math/{Sector.d.ts → shapes/Sector.d.ts} +8 -7
- package/types/math/shapes/Sector.d.ts.map +1 -0
- package/types/math/shapes/Segment.d.ts +15 -0
- package/types/math/shapes/Segment.d.ts.map +1 -0
- package/types/math/shapes/Ship.d.ts +11 -0
- package/types/math/shapes/Ship.d.ts.map +1 -0
- package/types/math/shapes/Slider.d.ts +29 -0
- package/types/math/shapes/Slider.d.ts.map +1 -0
- package/types/math/shapes/Star.d.ts.map +1 -1
- package/types/math/shapes/Tip.d.ts +23 -0
- package/types/math/shapes/Tip.d.ts.map +1 -0
- package/types/math/shapes/index.d.ts +6 -0
- package/types/math/shapes/index.d.ts.map +1 -1
- package/types/nextTick.d.ts +3 -0
- package/types/nextTick.d.ts.map +1 -0
- package/types/patch.d.ts +4 -4
- package/types/patch.d.ts.map +1 -1
- package/types/position.d.ts +9 -5
- package/types/position.d.ts.map +1 -1
- package/types/reactive.d.ts.map +1 -1
- package/types/svg/DOMSVGUtil.d.ts.map +1 -1
- package/types/svg/{SVG.d.ts → YZSVG.d.ts} +3 -3
- package/types/svg/YZSVG.d.ts.map +1 -0
- package/types/svg/index.d.ts +1 -1
- package/types/svg/index.d.ts.map +1 -1
- package/types/theme.d.ts +9 -1
- package/types/theme.d.ts.map +1 -1
- package/types/animate/AnimateOperation.d.ts.map +0 -1
- package/types/animate/animateInWeb.d.ts +0 -13
- package/types/animate/animateInWeb.d.ts.map +0 -1
- package/types/canvas/Canvas.d.ts.map +0 -1
- package/types/canvas/CanvasOperation.d.ts.map +0 -1
- package/types/math/Point3d.d.ts +0 -44
- package/types/math/Point3d.d.ts.map +0 -1
- package/types/math/Point3ds.d.ts +0 -19
- package/types/math/Sector.d.ts.map +0 -1
- package/types/math/Vector.d.ts +0 -12
- package/types/math/Vector.d.ts.map +0 -1
- package/types/shapes/ShapeShip.d.ts +0 -12
- package/types/shapes/ShapeShip.d.ts.map +0 -1
- package/types/shapes/ShapeSlider.d.ts +0 -27
- package/types/shapes/ShapeSlider.d.ts.map +0 -1
- package/types/shapes/ShapeSpirograph.d.ts +0 -9
- package/types/shapes/ShapeSpirograph.d.ts.map +0 -1
- package/types/svg/SVG.d.ts.map +0 -1
- package/types/worker.d.ts +0 -9
- package/types/worker.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(p,
|
|
1
|
+
(function(p,ne){typeof exports=="object"&&typeof module<"u"?ne(exports):typeof define=="function"&&define.amd?define(["exports"],ne):(p=typeof globalThis<"u"?globalThis:p||self,ne(p.ZYZGroupCoreWeb={}))})(this,function(p){"use strict";function ne(){return typeof window<"u"?window:typeof global<"u"?global:this||{}}const va=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,tn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function ts(i){this.message=i}ts.prototype=new Error,ts.prototype.name="InvalidCharacterError";function Sa(i){const t=String(i);let e="";for(let s,n,r=0,a=tn;t.charAt(r|0)||(a="=",r%1);e+=a.charAt(63&s>>8-r%1*8)){if(n=t.charCodeAt(r+=3/4),n>255)throw new ts("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");s=s<<8|n}return e}function Ca(i){const t=String(i).replace(/[=]+$/,"");if(t.length%4===1)throw new ts("'atob' failed: The string to be decoded is not correctly encoded.");let e="";for(let s=0,n,r,a=0;r=t.charAt(a++);~r&&(n=s%4?n*64+r:r,s++%4)?e+=String.fromCharCode(255&n>>(-2*s&6)):0)r=tn.indexOf(r);return e}class es{maps=new Map;mapsAddedDuringUpdate=new Map;constructor(){}entries(){return Array.from(this.maps.entries())}keys(){return Array.from(this.maps.keys())}values(){return Array.from(this.maps.values())}get length(){return this.entries().length}set(t,e){this.maps.set(t,e),this.mapsAddedDuringUpdate.set(t,e)}get(t){return this.maps.get(t)}shift(){const t=this.entries();if(t.length){const[e,s]=t[0];return this.delete(e),s}}delete(t){return this.mapsAddedDuringUpdate.delete(t),this.maps.delete(t)}deleteAll(){this.maps=new Map,this.mapsAddedDuringUpdate=new Map}filter(t){let e=this.entries();for(;e.length>0;){this.mapsAddedDuringUpdate=new Map;for(let s=0,n=e.length;s<n;s++){const[r,a]=e[s];t(r,a)===!1&&this.delete(r)}e=Array.from(this.mapsAddedDuringUpdate.entries())}}}const re=new es,Ys=i=>{let t=null;switch(i){case"any-character":t=/[^]/;break;case"bin":t=/^(0b)?[0-1]+$/;break;case"oct":t=/^(0o)?[0-7]+$/i;break;case"hex":t=/^(0x)?[0-9a-fA-F]+$/i;break;case"ascii":t=/^[\x00-\xFF]+$/i;break;case"int":t=/^[-+]?[0-9]+$/;break;case"number":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;break;case"number-single":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/i;break;case"split":t=/\s*,\s*/gi;break;case"svg-segment":t=/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi;break;case"mobile-china":t=/^\+[1-9]{1}[0-9]{10}$/g;break;case"phone-number":t=/^[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}$/gi;break;case"email":t=/^[A-Za-z0-9_!#$%&'*+/=?`{|}~^.-]+@[A-Za-z0-9._-]+$/gm;break;case"ip":t=/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;break;case"url":t=/^http[s]?:\/\/([\w-]+\.)+[\w-]+([\w-./?%&=]*)?$/;break;case"date":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})$/;break;case"whitespace":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]/g;break;case"commaSpaces":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/;break;case"trim":t=/^\s+|\s+$/g;break;case"base64-data":t=/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i;break;case"var-name":t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;break;case"element-url":t=/^url\(['"]?(.+?)['"]?\)$/i;break;case"hex-color":t=/^#([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;break;case"color":t=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i;break;case"bezier":t=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/;break;case"chinese-name":t=/^(?:[\u4e00-\u9fa5·]{2,16})$/;break;case"chinese":t=new RegExp(String.raw`
|
|
2
2
|
[\u{FA0E}\u{FA0F}\u{FA11}\u{FA13}\u{FA14}\u{FA1F}\u{FA21}\u{FA23}\u{FA24}\u{FA27}-\u{FA29}]
|
|
3
3
|
|[\u{4E00}-\u{9FCC}]
|
|
4
4
|
|[\u{3400}-\u{4DB5}]
|
|
@@ -7,40 +7,40 @@
|
|
|
7
7
|
|[\u{2B740}-\u{2B81D}]
|
|
8
8
|
|[\u{2B820}-\u{2CEAF}]
|
|
9
9
|
|[\u{2CEB0}-\u{2EBEF}]
|
|
10
|
-
`.replace(/\s+/g,""),"u");break;case"mime-image":t=/^image\//;break;case"mime-video":t=/^video\//;break;case"mime-audio":t=/^audio\//;break;case"mime-document-word":t=/^application\/(?:vnd\.openxmlformats-officedocument\.wordprocessingml\.document|msword|vnd\.ms-word\.document\.macroenabled\.12|vnd\.openxmlformats-officedocument\.wordprocessingml\.template|vnd\.ms-word\.template\.macroenabled\.12)$/;break;case"mime-document-excel":t=/^application\/(?:vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|vnd\.ms-excel|vnd\.ms-excel\.sheet\.macroenabled\.12|vnd\.openxmlformats-officedocument\.spreadsheetml\.template|vnd\.ms-excel\.template\.macroenabled\.12)$/;break;case"mime-document-ppt":t=/^application\/(?:vnd\.ms-powerpoint|vnd\.openxmlformats-officedocument\.presentationml\.presentation|vnd\.ms-powerpoint\.presentation\.macroenabled\.12|vnd\.openxmlformats-officedocument\.presentationml\.template|vnd\.ms-powerpoint\.template\.macroenabled\.12)$/;break;case"mime-document-json":t=/^application\/json$/;break;case"mime-document-xml":t=/^(?:application|text)\/(?:xml|xhtml\+xml)$/;break}return t},
|
|
11
|
-
`);s=~U?M.length-U:s+M.length}function r(){var M={line:e,column:s};return function(_){return _.position=new a(M),m(),_}}function a(M){this.start=M,this.end={line:e,column:s},this.source=t.source}a.prototype.content=n;var o=[];function c(M){var _=new Error(t.source+":"+e+":"+s+": "+M);if(_.reason=M,_.filename=t.source,_.line=e,_.column=s,_.source=n,t.silent)o.push(_);else throw _}function h(){var M=g();return{type:"stylesheet",stylesheet:{source:t.source,rules:M,parsingErrors:o}}}function l(){return y(/^{\s*/)}function f(){return y(/^}/)}function g(){var M,_=[];for(m(),v(_);n.length&&n.charAt(0)!="}"&&(M=Kt()||D());)M!==!1&&(_.push(M),v(_));return _}function y(M){var _=M.exec(n);if(_){var U=_[0];return i(U),n=n.slice(U.length),_}}function m(){y(/^\s*/)}function v(M){var _;for(M=M||[];_=b();)_!==!1&&M.push(_);return M}function b(){var M=r();if(!(n.charAt(0)!="/"||n.charAt(1)!="*")){for(var _=2;n.charAt(_)!=""&&(n.charAt(_)!="*"||n.charAt(_+1)!="/");)++_;if(_+=2,n.charAt(_-1)==="")return c("End of comment missing");var U=n.slice(2,_-2);return s+=2,i(U),n=n.slice(_),s+=2,M({type:"comment",comment:U})}}function S(){var M=y(/^([^{]+)/);if(M)return Ot(M[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(_){return _.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(_){return _.replace(/\u200C/g,",")})}function C(){var M=r(),_=y(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(_){if(_=Ot(_[0]),!y(/^:\s*/))return c("property missing ':'");var U=y(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),V=M({type:"declaration",property:_.replace(Xn,""),value:U?Ot(U[0]).replace(Xn,""):""});return y(/^[;\s]*/),V}}function k(){var M=[];if(!l())return c("missing '{'");v(M);for(var _;_=C();)_!==!1&&(M.push(_),v(M));return f()?M:c("missing '}'")}function R(){for(var M,_=[],U=r();M=y(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)_.push(M[1]),y(/^,\s*/);if(_.length)return U({type:"keyframe",values:_,declarations:k()})}function F(){var M=r(),_=y(/^@([-\w]+)?keyframes\s*/);if(_){var U=_[1];if(_=y(/^([-\w]+)\s*/),!_)return c("@keyframes missing name");var V=_[1];if(!l())return c("@keyframes missing '{'");for(var vt,Ht=v();vt=R();)Ht.push(vt),Ht=Ht.concat(v());return f()?M({type:"keyframes",name:V,vendor:U,keyframes:Ht}):c("@keyframes missing '}'")}}function L(){var M=r(),_=y(/^@supports *([^{]+)/);if(_){var U=Ot(_[1]);if(!l())return c("@supports missing '{'");var V=v().concat(g());return f()?M({type:"supports",supports:U,rules:V}):c("@supports missing '}'")}}function j(){var M=r(),_=y(/^@host\s*/);if(_){if(!l())return c("@host missing '{'");var U=v().concat(g());return f()?M({type:"host",rules:U}):c("@host missing '}'")}}function Q(){var M=r(),_=y(/^@media *([^{]+)/);if(_){var U=Ot(_[1]);if(!l())return c("@media missing '{'");var V=v().concat(g());return f()?M({type:"media",media:U,rules:V}):c("@media missing '}'")}}function q(){var M=r(),_=y(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(_)return M({type:"custom-media",name:Ot(_[1]),media:Ot(_[2])})}function Y(){var M=r(),_=y(/^@page */);if(_){var U=S()||[];if(!l())return c("@page missing '{'");for(var V=v(),vt;vt=C();)V.push(vt),V=V.concat(v());return f()?M({type:"page",selectors:U,declarations:V}):c("@page missing '}'")}}function H(){var M=r(),_=y(/^@([-\w]+)?document *([^{]+)/);if(_){var U=Ot(_[1]),V=Ot(_[2]);if(!l())return c("@document missing '{'");var vt=v().concat(g());return f()?M({type:"document",document:V,vendor:U,rules:vt}):c("@document missing '}'")}}function nt(){var M=r(),_=y(/^@font-face\s*/);if(_){if(!l())return c("@font-face missing '{'");for(var U=v(),V;V=C();)U.push(V),U=U.concat(v());return f()?M({type:"font-face",declarations:U}):c("@font-face missing '}'")}}var wt=_t("import"),ct=_t("charset"),fe=_t("namespace");function _t(M){var _=new RegExp("^@"+M+"\\s*([^;]+);");return function(){var U=r(),V=y(_);if(V){var vt={type:M};return vt[M]=V[1].trim(),U(vt)}}}function Kt(){if(n[0]=="@")return F()||Q()||q()||L()||wt()||ct()||fe()||H()||Y()||j()||nt()}function D(){var M=r(),_=S();return _?(v(),M({type:"rule",selectors:_,declarations:k()})):c("selector missing")}return Ls(h())}function Ot(n){return n?n.replace(/^\s+|\s+$/g,""):""}function Ls(n,t){var e=n&&typeof n.type=="string",s=e?n:t;for(var i in n){var r=n[i];Array.isArray(r)?r.forEach(function(a){Ls(a,s)}):r&&typeof r=="object"&&Ls(r,s)}return e&&Object.defineProperty(n,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),n}const Ns=(n,t="image/svg+xml",e="utf-8")=>e==="base64"?new Blob([n],{type:`${t};${e}`}):new Blob([n],{type:`${t};charset=${e}`}),Fs=n=>new XMLSerializer().serializeToString(n),ua=(n,t="text/html")=>new DOMParser().parseFromString(n,t),qn=(n,t="image/svg+xml",e="utf-8")=>Ns(Fs(n),t,e),Bs=(n,t)=>new Promise(e=>{const s=document.createElement("a");s.style.visibility="hidden",document.body.appendChild(s),s.download=t,typeof n=="string"?s.href=n:s.href=window.URL.createObjectURL(n),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(s.href),e()});function Yn(n=["*"],t){return new Promise((e,s)=>{if(!globalThis.document||!(globalThis.document instanceof Document))return s(new Error("This is not a browser environment"));const i=globalThis.document.createElement("input");i.setAttribute("type","file"),i.setAttribute("visibility","hidden"),Array.isArray(n)&&n.length>0&&i.setAttribute("accept",n.join(",")),t&&i.setAttribute("multiple","true"),globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!i.files||i.files?.length===0)&&s(new Error("Cancel select"))},1e3)},{once:!0});const r=()=>{if(i.removeEventListener("change",r),!i.files||i.files?.length===0)s(new Error("Cancel select"));else{const a=Array.from(i.files);!n.includes("*")&&a.some(o=>!n.includes(`.${Hn(o)}`))&&s(new Error(`Please select files in ${n} format`)),i.remove(),e(a)}};i.addEventListener("change",r),i.click()})}function We(n,t="text",e){return new Promise((s,i)=>{const r=new FileReader;switch(r.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),r.addEventListener("load",a=>{s(a.target?.result)}),r.addEventListener("error",a=>{i(a)}),t){case"dataURL":r.readAsDataURL(n);break;case"binaryString":r.readAsBinaryString(n);break;case"arrayBuffer":r.readAsArrayBuffer(n);break;case"text":default:r.readAsText(n)}})}async function fa(n){const t=await We(n,"arrayBuffer");return Vn(t)}const Hn=n=>{let t;return n instanceof File?t=n.name:t=n,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function da(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(t=>setTimeout(()=>{throw t}))}function ma(n,t={},e=[]){return{tag:n,props:t,children:e}}function ge(n,t){if(n.el)return;const e=n.el=document.createElement(n.tag);if(n.props)for(const s in n.props){const i=n.props[s];s.startsWith("on")?e.addEventListener(s.slice(2).toLowerCase(),i):e.setAttribute(s,i)}n.children&&(typeof n.children=="string"?e.textContent=n.children:n.children.forEach(s=>{ge(s,e)})),t.appendChild(e)}function Wn(n,t){if(n.tag!==t.tag){if(!n.el)return;const e=n.el.parentElement||document.body;e.removeChild(n.el),ge(t,e)}else{const e=t.el=n.el;if(!e)return;const s=n.props,i=t.props;for(const o in s)o in i||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),s[o]):e.removeAttribute(o));for(const o in i){const c=s[o],h=i[o];h!=c&&(o.startsWith("on")?e.addEventListener(o.slice(2).toLowerCase(),h):e.setAttribute(o,h))}const r=n.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof r=="string")e.innerHTML="",a.forEach(o=>{ge(o,e)});else{const o=Math.min(r.length,a.length);for(let c=0;c<o;c++)Wn(r[c],a[c]);a.length>r.length&&a.slice(r.length).forEach(c=>{ge(c,e)}),a.length<r.length&&r.slice(a.length).forEach(c=>{c.el&&e.removeChild(c.el)})}}}function $n(n,t,e){if(!n){e&&t&&e.appendChild(t);return}if(!n.isEqualNode(t)){if(n.nodeName!==t.nodeName){e.replaceChild(t,n);return}if(n.nodeType===Node.TEXT_NODE){n.textContent!==t.textContent&&(n.textContent=t.textContent);return}for(let s=n.attributes.length-1;s>=0;s--){const i=n.attributes[s].name;!t.hasAttribute(i)&&i!=="open"&&n.removeAttribute(i)}for(let s=0;s<t.attributes.length;s++){const i=t.attributes[s].name,r=t.attributes[s].value;n.setAttribute(i,r)}for(let s=0;s<t.childNodes.length;s++)n.childNodes[s]?$n(n.childNodes[s],t.childNodes[s],n):n.appendChild(t.childNodes[s].cloneNode(!0));for(;n.childNodes.length>t.childNodes.length;)n.lastChild&&n.removeChild(n.lastChild)}}class pa{url;socket;waitingResponse={};sendMessageQueue=[];constructor(t){this.url=t,this.createSocket()}createSocket(){console.log("Socket Create Attempted"),this.socket=new WebSocket(this.url),this.socket.onopen=()=>{this.sendMessageQueue.forEach(t=>this.socket?.send(t)),this.sendMessageQueue=[]},this.socket.onclose=t=>{const{code:e,reason:s,wasClean:i}=t;console.log(`ws closed : ${e} ${s} ${i}`)},this.socket.onerror=t=>{console.log(`ws error : ${t.type}`)},this.socket.onmessage=t=>{this.processMessage(t)}}recreateSocket(t){console.log("Socket Recreate Attempted"),this.sendMessageQueue.push(t),this.createSocket()}closeSocket(){this.socket&&(this.socket.close(),console.log("Socket closed"))}openSocket(){this.createSocket(),console.log("Socket opened manually")}sendWithRetry(t){this.socket?.readyState===WebSocket.OPEN?this.socket.send(t):this.recreateSocket(t)}async processMessage(t){if(typeof t.data=="string")try{const e=JSON.parse(t.data);if(Object.prototype.hasOwnProperty.call(e,"requestid")){const s=this.waitingResponse[e.requestid];s?s.resolve?.(e):console.warn("Got data but found no associated request, already timed out?",e)}else console.warn("Got data without request id",e)}catch{console.log(`Received String : ${t.data}`)}else t.data instanceof ArrayBuffer?console.log(`Received ArrayBuffer : ${t.data}`):t.data instanceof Blob&&console.log(`Received Blob : ${t.data}`)}async sendPayload(t){const e=+new Date,s=this.waitingResponse[e]={requestid:e};try{let i;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?i=t:i=JSON.stringify({...s,...t});const r=await new Promise((a,o)=>{s.resolve=a,this.sendWithRetry(i),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-s.requestid)/1e3),r}catch(i){return Promise.reject(i)}finally{delete this.waitingResponse[e]}}async send(t,e,s=i=>{console.log(i)}){this.sendPayload(t).then(e,s)}}function ga(){const n=window.screen;return{screenWidth:n.width,screenHeight:n.height,screenX:window.screenX,screenY:window.screenY}}function ya(){const n=document.body;return{clientWidth:n.clientWidth,clientHeight:n.clientHeight,clientTop:n.clientTop,clientLeft:n.clientLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,pageX:n.getBoundingClientRect().x,pageY:n.getBoundingClientRect().y}}function se(){const n=document.documentElement;return{clientWidth:n.clientWidth,clientHeight:n.clientHeight,clientTop:n.clientTop,clientLeft:n.clientLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,offsetWidth:n.offsetWidth,offsetHeight:n.offsetHeight,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft,offsetParent:n.offsetParent,clientX:n.getBoundingClientRect().x,clientY:n.getBoundingClientRect().y}}function wa(){const{clientWidth:n,clientHeight:t}=se();return{width:n||window.innerWidth,height:t||window.innerHeight}}function va(){const{scrollWidth:n,scrollHeight:t}=se();return{width:n,height:t}}function Jn(n){const{top:t,left:e}=n.getBoundingClientRect(),{scrollLeft:s,scrollTop:i}=se();return{x:e+s,y:t+i}}function ba(n){return{x:Zn(n),y:Kn(n)}}function Zn(n){let t=0;for(;n!==null;)t+=n.offsetLeft,n=n.offsetParent;return t}function Kn(n){let t=0;for(;n!==null;)t+=n.offsetTop,n=n.offsetParent;return t}function xa(n){const t=n.getBoundingClientRect();return{x:t.left,y:t.top}}function Sa(n,t){const e=n.getBoundingClientRect(),s=t.getBoundingClientRect();return{x:s.x-e.x,y:s.y-e.y,width:s.width||s.right-s.left,height:s.height||s.bottom-s.top}}function Ca(){const{clientHeight:n,scrollTop:t,scrollHeight:e}=se(),s=e-n;return s<=0?0:t/s*100}function Ta(n){return{x:n.clientX,y:n.clientY}}function Qn(n){if("center"in n)return n.center;if(n.pageX&&n.pageY)return{x:n.pageX,y:n.pageY};const{scrollLeft:t,scrollTop:e}=se();return{x:n.clientX+t,y:n.clientY+e}}function ti(n,t){const e=Qn(t),s=Jn(n);return{x:e.x-s.x,y:e.y-s.y}}function Us(){return typeof window<"u"?window:this||{}}const $e=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/mac/i.test(n)?t="macOS":/win/i.test(n)?t="Windows":/android/i.test(n)?t="Android":/iphone|ipad|ipod/i.test(n)?t="iOS":/linux/i.test(n)?t="Linux":/bsd/i.test(n)&&(t="BSD"),t.toLowerCase()},Ea=()=>{const n=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(n)){const e=n.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(n)){const e=n.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(n)){const e=n.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(n)){const e=n.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},Vs=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(n)||/opera/i.test(n)?t="Opera":/chrome/i.test(n)?t="Chrome":/firefox/i.test(n)?t="Firefox":/safari/i.test(n)?t="Safari":/edge/i.test(n)?t="Edge":/msie|trident/i.test(n)?t="IE":/MicroMessenger/i.test(n)?t="Wechat":/alipay/i.test(n)&&(t="Ali"),t.toLowerCase()},Pa=()=>{const n=navigator.userAgent;let t="Unknown";if(/Chrome/.test(n)){const e=n.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(n)){const e=n.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(n)){const e=n.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(n)){const e=n.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(n)){const e=n.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t},Aa=()=>"geolocation"in navigator?new Promise((n,t)=>{navigator.geolocation.getCurrentPosition(e=>{const s=e.coords.latitude,i=e.coords.longitude;n({latitude:s,longitude:i})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function _a(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function Da(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Gs(){return $e()==="ios"}function zs(){return $e()==="macos"}function ka(){return Gs()|zs()}function ei(){return $e()==="android"}function Ia(){return Gs()||ei()}function Ma(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function si(){const n=window.navigator.userAgent,t=n.indexOf("MSIE ");if(t>0)return parseInt(n.substring(t+5,n.indexOf(".",t)),10);if(n.indexOf("Trident/")>0){const i=n.indexOf("rv:");return parseInt(n.substring(i+3,n.indexOf(".",i)),10)}const s=n.indexOf("Edge/");return s>0?parseInt(n.substring(s+5,n.indexOf(".",s)),10):-1}const Ra=si()!==-1;function Oa(){const n=document.documentMode;return n&&(n===9||n===10)}function ni(){return Vs()==="wechat"}function ii(){return Vs()==="ali"}function La(){return ni()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function Na(){return ii()&&navigator.userAgent.match(/miniprogram/i)}const Fa=typeof document<"u",ri=typeof window<"u",Ba=typeof history<"u",Ua=ri&&window.File&&window.FileReader&&window.FileList&&window.Blob,ai=(()=>{const n=Us();return!!(n.Worker&&n.Blob&&n.Promise&&n.OffscreenCanvas&&n.OffscreenCanvasRenderingContext2D&&n.HTMLCanvasElement&&n.HTMLCanvasElement.prototype.transferControlToOffscreen&&n.URL&&n.URL.createObjectURL)})(),Va=typeof Path2D=="function"&&typeof DOMMatrix=="function",oi=function(){if(!Us().OffscreenCanvas)return!1;const t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);const s=t.transferToImageBitmap();try{e.createPattern(s,"no-repeat")}catch{return!1}return!0}();function Ga(n){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let s=100;const i=function(){const r=Math.min(t.clientWidth,n);t.dataset.width=r,t.dataset.rem=s=Math.round(100*(r/n)),t.style.fontSize=s+"px"};i(),window.rem2px=function(r){return r=parseFloat(r),r*s},window.px2rem=function(r){return r=parseFloat(r),r/s},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",i,!1)}function st(n){return n*Math.PI/180}function J(n){return n*180/Math.PI}function Je(n,t,e=0){return Math.sqrt(n*n+t*t+e*e)}function Ze(n,t,e,s){const i=n-e,r=t-s;return Je(i,r)}function ye(n,t,e,s){const i=e-n,r=s-t;let a=Math.atan2(r,i);return a<0&&(a+=Math.PI*2),a}function Gt(n,t){return{x:Math.cos(n)*t,y:Math.sin(n)*t}}function za(n,t){const e=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return{x:n/=e,y:t/=e}}function ja(n,t,e,s,i=10){if(Math.abs(e-n)<i&&Math.abs(s-t)<i)return"no";const r=J(ye(n,t,e,s));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":r>=-45&&r<=45?"right":"no"}const ci=[1,0,0,1,0,0],hi=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class Z{value;matrix3d;isEverTo3d=!1;constructor(t=ci){this.value=Array.from(t),this.matrix3d=this.toMatrix3D()}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return 0}get m21(){return this.value[2]}get m22(){return this.value[3]}get m23(){return 0}get m31(){return this.value[4]}get m32(){return this.value[5]}get m33(){return 1}toMatrix3D(t=this.matrix3d){const e=[this.value[0],this.value[1],0,0,this.value[2],this.value[3],0,0,0,0,1,0,this.value[4],this.value[5],0,1];return t?(t.value=e,t):new Jt(e)}unit(){return this.value=Array.from(ci),this.matrix3d=this.toMatrix3D(),this}multiplyPoint(t,e,s=0,i=0){const r=t-s,a=e-i;return t=this.m11*r+this.m21*a+this.m31,e=this.m12*r+this.m22*a+this.m32,{x:t+s,y:e+i}}fromString(t){const e=Ln("number",t);return e.length===6?e.forEach((s,i)=>{s.fullMatch&&(this.value[i]=parseFloat(s.fullMatch))}):this.unit(),this}clone(){return new Z(this.value)}multiply(t){const e=this.value;let s;t instanceof Z?s=t.value:s=t;const i=e[0]*s[0]+e[2]*s[1],r=e[1]*s[0]+e[3]*s[1],a=e[0]*s[2]+e[2]*s[3],o=e[1]*s[2]+e[3]*s[3],c=e[0]*s[4]+e[2]*s[5]+e[4],h=e[1]*s[4]+e[3]*s[5]+e[5];return e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=c,e[5]=h,this}inverse(){const t=new Z(this.value),e=t.value,s=1/(e[0]*e[3]-e[1]*e[2]),i=e[3]*s,r=-e[1]*s,a=-e[2]*s,o=e[0]*s,c=s*(e[2]*e[5]-e[3]*e[4]),h=s*(e[1]*e[4]-e[0]*e[5]);return e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=c,e[5]=h,t}offset(t=0,e=0){return{x:t-this.m31,y:e-this.m32}}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix3D(),this}translateTo(t,e){const s=this.offset(t,e);return this.translate(s.x,s.y)}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.m32)}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.m31,t)}translateZ(t){return this.isEverTo3d=!0,this.matrix3d.translate(0,0,t),this.matrix3d.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix3d.m43),this}translate3d(t,e,s){return this.isEverTo3d=!0,this.matrix3d.translate(t,e,s),this.matrix3d.toMatrix(this),this}translate3dTo(t,e,s){return this.translate3d(t-this.matrix3d.m41,e-this.matrix3d.m42,s-this.matrix3d.m43),this}rotate(t,e=0,s=0){const i=st(t),r=Math.cos(i),a=Math.sin(i);return this.multiply([r,a,-a,r,e,s]),this.translate(-e,-s),this.toMatrix3D(),this}rotateTo(t,e=0,s=0){const{rotateZ:i}=this.matrix3d.split();return this.rotate(t-i,e,s),this}rotateX(t){return this.isEverTo3d=!0,this.matrix3d.rotate("x",t),this.matrix3d.toMatrix(this),this}rotateXTo(t){const{rotateX:e}=this.matrix3d.split();return this.rotateX(t-e),this}rotateY(t){return this.isEverTo3d=!0,this.matrix3d.rotate("y",t),this.matrix3d.toMatrix(this),this}rotateYTo(t){const{rotateY:e}=this.matrix3d.split();return this.rotateY(t-e),this}rotateZ(t){return this.isEverTo3d=!0,this.matrix3d.rotate("z",t),this.matrix3d.toMatrix(this),this}rotateZTo(t){const{rotateZ:e}=this.matrix3d.split();return this.rotateZ(t-e),this}rotate3d(t,e,s){return this.isEverTo3d=!0,this.matrix3d.rotate("x",t).rotate("y",e).rotate("z",s),this.matrix3d.toMatrix(this),this}rotate3dTo(t,e,s){const{rotateX:i,rotateY:r,rotateZ:a}=this.matrix3d.split();return this.rotate3d(t-i,e-r,s-a),this}scale(t,e=t,s=0,i=0){return this.translate(s,i),this.multiply([t,0,0,e,0,0]),this.translate(-s,-i),this.toMatrix3D(),this}scaleTo(t,e=t,s=0,i=0){return this.scale(t/this.m11,e/this.m22,s,i)}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.m11,1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.m22)}scaleZ(t){return this.isEverTo3d=!0,this.matrix3d.scale(1,1,t),this.matrix3d.toMatrix(this),this}scaleZTo(t){const{scaleZ:e}=this.matrix3d.split();return this.scaleZ(t/e),this}scale3d(t,e=t,s=t){return this.isEverTo3d=!0,this.matrix3d.scale(t,e,s),this.matrix3d.toMatrix(this),this}scale3dTo(t,e=t,s=t){const{scaleX:i,scaleY:r,scaleZ:a}=this.matrix3d.split();return this.scale3d(t/i,e/r,s/a),this}skew(t,e=t){const s=Math.tan(st(t)),i=Math.tan(st(e));return this.multiply([1,i,s,1,0,0]),this.toMatrix3D(),this}skewTo(t,e=t){return this.skew(t-J(this.m21),e-J(this.m12))}skewX(t){return this.skew(t,J(this.m12))}skewXTo(t){return this.skewTo(t,J(this.m12))}skewY(t){return this.skew(J(this.m21),t)}skewYTo(t){return this.skewTo(J(this.m21),t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,s){return this}skew3dTo(t,e,s){return this}getGroupCoords(t){const e=this.value[0],s=this.value[1],i=this.value[2],r=this.value[3],a=this.value[4],o=this.value[5],c=t.value[0],h=t.value[1],l=t.value[2],f=t.value[3],g=t.value[4],y=t.value[5],m=c*f,v=h*l,b=(l*s-e*f)/(v-m),S=(c*s-e*h)/(m-v),C=(l*r-i*f)/(v-m),k=(c*r-i*h)/(m-v),R=(l*(o-y)+f*(g-a))/(v-m),F=(c*(o-y)+h*(g-a))/(m-v),L=[b,S,C,k,R,F];return new Z(L)}toString(){return this.isEverTo3d?this.matrix3d.toString():`matrix(${this.value.map(t=>Vt(t,6)).join(",")})`}toFilter(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.value[0]+", M12="+this.value[2]+", M21="+this.value[1]+", M22="+this.value[3]+", Dx="+this.value[4]+", Dy="+this.value[5]+", sizingmethod='auto expand')"}}class Jt{value;constructor(t=hi){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m14(){return this.value[3]}get m21(){return this.value[4]}get m22(){return this.value[5]}get m23(){return this.value[6]}get m24(){return this.value[7]}get m31(){return this.value[8]}get m32(){return this.value[9]}get m33(){return this.value[10]}get m34(){return this.value[11]}get m41(){return this.value[12]}get m42(){return this.value[13]}get m43(){return this.value[14]}get m44(){return this.value[15]}unit(){return this.value=Array.from(hi),this}fromString(t){const e=Ln("number",t);return e.length===16?e.forEach((s,i)=>{s.fullMatch&&(this.value[i]=parseFloat(s.fullMatch))}):this.unit(),this}toMatrix(t){const{scaleX:e,scaleY:s,skewX:i,skewY:r,x:a,y:o}=this.split(),c=[e,r,i,s,a,o];return t?(t.value=c,t):new Z(c)}multiplyMatrix(t){const e=t.value[0],s=t.value[1],i=t.value[2],r=t.value[3],a=e*this.m11+s*this.m21+i*this.m31+r*this.m41,o=e*this.m12+s*this.m22+i*this.m32+r*this.m42,c=e*this.m13+s*this.m23+i*this.m33+r*this.m43,h=e*this.m14+s*this.m24+i*this.m34+r*this.m44;return new Z([a,o,c,h,0,0])}multiply(t){const e=new Z([t.value[0],t.value[1],t.value[2],t.value[3],0,0]),s=new Z([t.value[4],t.value[5],t.value[6],t.value[7],0,0]),i=new Z([t.value[8],t.value[9],t.value[10],t.value[11],0,0]),r=new Z([t.value[12],t.value[13],t.value[14],t.value[15],0,0]),a=this.multiplyMatrix(e),o=this.multiplyMatrix(s),c=this.multiplyMatrix(i),h=this.multiplyMatrix(r);return this.value[0]=a.value[0],this.value[1]=a.value[1],this.value[2]=a.value[2],this.value[3]=a.value[3],this.value[4]=o.value[0],this.value[5]=o.value[1],this.value[6]=o.value[2],this.value[7]=o.value[3],this.value[8]=c.value[0],this.value[9]=c.value[1],this.value[10]=c.value[2],this.value[11]=c.value[3],this.value[12]=h.value[0],this.value[13]=h.value[1],this.value[14]=h.value[2],this.value[15]=h.value[3],this}translate(t=0,e=0,s=0){return this.multiply(new Jt([1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1]))}scale(t=1,e=1,s=1){return this.multiply(new Jt([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}rotate(t,e){const s=st(e),i=Math.sin,r=Math.cos;let a;switch(t){case"x":a=[1,0,0,0,0,r(s),i(s),0,0,-i(s),r(s),0,0,0,0,1];break;case"y":a=[r(s),0,-i(s),0,0,1,0,0,i(s),0,r(s),0,0,0,0,1];break;case"z":a=[r(s),i(s),0,0,-i(s),r(s),0,0,0,0,1,0,0,0,0,1];break}return this.multiply(new Jt(a))}toString(){return`matrix3d(${this.value.map(t=>Vt(t,6)).join(",")})`}split(){let t=J(lt(Math.asin(-this.m13),-1,1)),e=J(Math.atan2(this.m23,this.m33)),s=J(Math.atan2(this.m12,this.m11));return Math.cos(t)===0&&(e=J(Math.atan2(-this.m31,this.m22)),s=0),{x:this.m41,y:this.m42,z:this.m43,rotateX:e,rotateY:t,rotateZ:s,scaleX:Math.sqrt(this.m11*this.m11+this.m12*this.m12+this.m13*this.m13),scaleY:Math.sqrt(this.m21*this.m21+this.m22*this.m22+this.m23*this.m23),scaleZ:Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),skewX:J(this.m14),skewY:J(this.m24),skewZ:J(this.m34),skewW:this.m44}}inverse(){const t=[],e=this.m11,s=this.m12,i=this.m13,r=this.m14,a=this.m21,o=this.m22,c=this.m23,h=this.m24,l=this.m31,f=this.m32,g=this.m33,y=this.m34,m=this.m41,v=this.m42,b=this.m43,S=this.m44;t[0]=c*y*v-h*g*v+h*f*b-o*y*b-c*f*S+o*g*S,t[1]=r*g*v-i*y*v-r*f*b+s*y*b+i*f*S-s*g*S,t[2]=i*h*v-r*c*v+r*o*b-s*h*b-i*o*S+s*c*S,t[3]=r*c*f-i*h*f-r*o*g+s*h*g+i*o*y-s*c*y;const C=e*t[0]+a*t[1]+l*t[2]+m*t[3];if(C==0)return console.warn("Can't invert matrix, determinant is 0");t[4]=h*g*m-c*y*m-h*l*b+a*y*b+c*l*S-a*g*S,t[5]=i*y*m-r*g*m+r*l*b-e*y*b-i*l*S+e*g*S,t[6]=r*c*m-i*h*m-r*a*b+e*h*b+i*a*S-e*c*S,t[7]=i*h*l-r*c*l+r*a*g-e*h*g-i*a*y+e*c*y,t[8]=o*y*m-h*f*m+h*l*v-a*y*v-o*l*S+a*f*S,t[9]=r*f*m-s*y*m-r*l*v+e*y*v+s*l*S-e*f*S,t[10]=s*h*m-r*o*m+r*a*v-e*h*v-s*a*S+e*o*S,t[11]=r*o*l-s*h*l-r*a*f+e*h*f+s*a*y-e*o*y,t[12]=c*f*m-o*g*m-c*l*v+a*g*v+o*l*b-a*f*b,t[13]=s*g*m-i*f*m+i*l*v-e*g*v-s*l*b+e*f*b,t[14]=i*o*m-s*c*m-i*a*v+e*c*v+s*a*b-e*o*b,t[15]=s*c*l-i*o*l+i*a*f-e*c*f-s*a*g+e*o*g,this.value=t;const k=1/C;this.value.map(R=>R*k)}}function js(n){const t=new Z;return n.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,s,i){i.indexOf(",")>=0?i=i.split(/\s*,\s*/):i=i.split(/\s+/);const r=[];for(let a=0,o=i.length;a<o;a++)i[a].trim()&&r.push(parseFloat(""+i[a]));switch(s.toLowerCase()){case"t":case"translate":t.translate(r[0],r[1]);break;case"translatex":t.translateX(r[0]);break;case"translatey":t.translateY(r[0]);break;case"translatez":t.translateZ(r[0]);break;case"translate3d":t.translate3d(r[0],r[1],r[2]);break;case"r":case"rotate":t.rotate(r[0],r[1]??0,r[2]??0);break;case"rotatex":t.rotateX(r[0]);break;case"rotatey":t.rotateY(r[0]);break;case"rotatez":t.rotateZ(r[0]);break;case"rotate3d":t.rotate3d(r[0],r[1],r[2]);break;case"s":case"scale":t.scale(r[0],r[1]??r[0]);break;case"scalex":t.scaleX(r[0]);break;case"scaley":t.scaleY(r[0]);break;case"scalez":t.scaleZ(r[0]);break;case"scale3d":t.scale3d(r[0],r[1],r[2]);break;case"skew":t.skew(r[0],r[1]??0);break;case"skewx":t.skewX(r[0]);break;case"skewy":t.skewY(r[0]);break;case"skewz":t.skewZ(r[0]);break;case"skew3d":t.skew3d(r[0],r[1],r[2]);break;case"m":case"matrix":t.multiply([r[0],r[1],r[2],r[3],r[4],r[5]]),t.toMatrix3D();break;case"matrix3d":t.matrix3d.multiply(new Jt(r)),t.matrix3d.toMatrix(t);break}return""}),t}function St(n,t,e,s=0,i=0){const r=new Z;return r.rotate(J(n),s,i),r.multiplyPoint(t,e,s,i)}class A{static onDocumentReady(t){let e=!1;function s(){document.readyState==="loading"||e||(e=!0,t(),document.removeEventListener("DOMContentLoaded",s))}typeof document<"u"&&(document.addEventListener("DOMContentLoaded",s),s())}static onBeforeUnload(t){function e(){t(),document.removeEventListener("beforeunload",e)}typeof document<"u"&&document.addEventListener("beforeunload",e)}static getCSSVar(t){return getComputedStyle(document.documentElement).getPropertyValue(t)}static setCSSVar(t,e){document.documentElement.style.setProperty(t,e)}static add3DSupport(t,e="1000px"){if(t.parentElement){const s=A.getStyle(t.parentElement,"position");A.setStyle(t.parentElement,{position:s=="static"?"relative":s,perspective:e})}A.setStyle(t,{"transform-style":"preserve-3d"})}static convertAttrs(t,e,s={}){s.hasOwnProperty("transform")||Object.assign(s,{transform:A.getStyle(t,"transform")||""});const i=js(s.transform),r={};for(let a in e){const o=e[a];switch(a){case"transform":break;case"translate":i.translate(o[0]||0,o[1]||0);break;case"translateTo":i.translateTo(o[0]||0,o[1]||0);break;case"translateX":i.translateX(o||0);break;case"translateXTo":i.translateXTo(o||0);break;case"translateY":i.translateY(o||0);break;case"translateYTo":i.translateYTo(o||0);break;case"translateZ":i.translateZ(o||0);break;case"translateZTo":i.translateZTo(o||0);break;case"translate3d":i.translate3d(o[0]||0,o[1]||0,o[2]||0);break;case"translate3dTo":i.translate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotate":typeof o=="number"?i.rotate(o||0):i.rotate(o[0]||0,o[1]||0,o[2]||0);break;case"rotateTo":typeof o=="number"?i.rotateTo(o||0):i.rotateTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotateX":i.rotateX(o||0);break;case"rotateXTo":i.rotateXTo(o||0);break;case"rotateY":i.rotateY(o||0);break;case"rotateYTo":i.rotateYTo(o||0);break;case"rotateZ":i.rotateZ(o||0);break;case"rotateZTo":i.rotateZTo(o||0);break;case"rotate3d":i.rotate3d(o[0]||0,o[1]||0,o[2]||0);break;case"rotate3dTo":i.rotate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"scale":typeof o=="number"?i.scale(o||1):i.scale(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleTo":typeof o=="number"?i.scaleTo(o||1):i.scaleTo(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleX":i.scaleX(o||1);break;case"scaleXTo":i.scaleXTo(o||1);break;case"scaleY":i.scaleY(o||1);break;case"scaleYTo":i.scaleYTo(o||1);break;case"scaleZ":i.scaleZ(o||1);break;case"scaleZTo":i.scaleZTo(o||1);break;case"scale3d":typeof o=="number"?i.scale3d(o||1):i.scale3d(o[0]||1,o[1]||1,o[2]||1);break;case"scale3dTo":typeof o=="number"?i.scale3dTo(o||1):i.scale3dTo(o[0]||1,o[1]||1,o[2]||1);break;case"skew":typeof o=="number"?i.skew(o||0):i.skew(o[0]||0,o[1]||0);break;case"skewTo":typeof o=="number"?i.skewTo(o||0):i.skewTo(o[0]||0,o[1]||0);break;case"skewX":i.skewX(o||0);break;case"skewXTo":i.skewXTo(o||0);break;case"skewY":i.skewY(o||0);break;case"skewYTo":i.skewYTo(o||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;default:s.hasOwnProperty(a)||(s[a]=A.getStyle(t,a)),Object.assign(r,{[a]:`${o}`});break}}return Object.assign(r,{transform:i.toString()}),r}static attrsToCanvas(t,e){for(const s in e){const i=e[s];switch(it(s)){case"fill":i!=="none"&&(t.fillStyle=i);break;case"stroke":i!=="none"&&(t.strokeStyle=i);break;case"stroke-width":t.lineWidth=Number(i);break;case"stroke-linecap":t.lineCap=i;break;case"stroke-linejoin":switch(i){case"round":case"bevel":case"miter":t.lineJoin=i;break;default:t.lineJoin="miter";break}break;case"stroke-miterlimit":t.miterLimit=Number(i);break;case"stroke-opacity":break;case"stroke-dashoffset":t.lineDashOffset=Number(i);break;case"stroke-dasharray":t.setLineDash(i.split(/\s+/).map(r=>Number(r)));break;case"cursor":break;case"font":t.font=i;break;case"font-size":t.font+=` ${i}`;break;case"font-family":t.font+=` ${i}`;break;case"font-weight":break;case"font-style":break;case"text-anchor":switch(i){case"middle":t.textAlign="center";break;case"end":t.textAlign="end";break;case"start":t.textAlign="start";break}break;case"alignment-baseline":switch(i){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":t.textBaseline=i;break;default:t.textBaseline="alphabetic";break}break}}}static getStyle(t,e,s){const i=t;if(getComputedStyle)if(e){e=it(e);const r=getComputedStyle(i,s).getPropertyPriority(e);return getComputedStyle(i,s).getPropertyValue(e).trim()+(r?"!"+r:"")}else{const r=[],a=getComputedStyle(i,"");for(let o=0;o<a.length;o++)r.push(a[o]+":"+a.getPropertyValue(a[o]));return r.push(...(i.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(c=>c.trim()))||[])}else if(t.currentStyle){if(e)return e=Bn(e),t.currentStyle[e];{const r=[],a=i.currentStyle;for(let o in a)r.push(o+":"+a[o]);return r.push(...(i.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(c=>c.trim()))||[])}}}static setStyle(t,e,s){if(typeof e=="string"&&s){const i=String(s).toLowerCase().includes("!important")?"important":"";t.style.setProperty(it(e),s.replace(/!important/i,""),i)}else e instanceof Object&&Object.keys(e).forEach(i=>{const r=String(e[i]).toLowerCase().includes("!important")?"important":"";t.style.setProperty(it(i),String(e[i]).replace(/!important/i,""),r)})}static setStyleSheet(t,e){let s;if(typeof e=="string"){const r=document.querySelector(e)?.shadowRoot;r?s=r:s=document.querySelector(e)}else s=e;const i=document.createElement("style");if(i.innerHTML=t,s)return s.appendChild(i),()=>{(s instanceof HTMLElement||s instanceof ShadowRoot)&&s.removeChild(i)};{const r=document.styleSheets[0].insertRule(t);return()=>{document.styleSheets[0].deleteRule(r)}}}static toggleClass(t,e,s="toggle"){e.split(/[,\s]+/).forEach(i=>{i.trim()!==""&&t.classList[s](i.trim())})}static addClass(t,e){this.toggleClass(t,e,"add")}static removeClass(t,e){this.toggleClass(t,e,"remove")}static hasClass(t,e){return e.split(/[,\s]+/).every(s=>s.trim()!==""?Array.from(t.classList||[]).includes(s.trim()):!0)}static toggleDisplay(t,e){this.getStyle(t,"display")=="none"&&e===void 0||e===!0?t.style.setProperty("display",t instanceof HTMLTableRowElement?"table-row":t instanceof HTMLTableCellElement?"table-cell":"block"):t.style.setProperty("display","none")}static show(t){this.toggleDisplay(t,!0)}static hide(t){this.toggleDisplay(t,!1)}static attribute(t,e,s){let i={};if(e===void 0&&s===void 0){for(let r=0,a=t.attributes,o=a.length;r<o;r++){const c=a[r];c.nodeName&&c.nodeValue&&(i[c.nodeName]=c.nodeValue)}return i}if(typeof e=="string"&&s===void 0)return t.getAttribute(it(e));typeof e=="object"?i=e:typeof e=="string"&&s!==void 0&&(i[e]=s),Object.entries(i).forEach(([r,a])=>{t.setAttribute(it(r),a)})}static removeAttribute(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&t.removeAttribute(s.trim())})}static fixProp(t){const e={cellpadding:"cellPadding",cellspacing:"cellSpacing",class:"className",colspan:"colSpan",contenteditable:"contentEditable",for:"htmlFor",frameborder:"frameBorder",maxlength:"maxLength",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"};return e[t]?e[t]:t}static prop(t,e,s){if(s===void 0&&typeof e=="string")return t[e];{let i={};typeof e=="object"?i=e:typeof e=="string"&&s!==void 0&&(i[e]=s),Object.entries(i).forEach(([r,a])=>{const o=this.fixProp(r);t[o]=a,o=="innerHTML"&&this.scriptConvert(t)})}}static removeProp(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&delete t[this.fixProp(s.trim())]})}static data(t,e,s){if(typeof e=="string"&&(e=Bn(e)),(typeof e=="string"||e===void 0)&&s===void 0){const i=Object.assign({},t.dataset);return Object.keys(i).forEach(r=>{if(i[r]?.startsWith("[")||i[r]?.startsWith("{"))try{i[r]=JSON.parse(i[r]||"")}catch{}}),typeof e=="string"?i[e]:i}else{let i={};typeof e=="object"?i=e:typeof e=="string"&&(i[e]=s),Object.entries(i).forEach(([r,a])=>{a!=null?t.dataset[r]=a instanceof Object?JSON.stringify(a):a:delete t.dataset[r]})}}static removeData(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&delete t.dataset[s.trim()]})}static empty(t){this.html(t,"")}static html(t,e){e instanceof HTMLElement||e instanceof SVGElement?this.insert(t,e,"replaceWith"):this.prop(t,"innerHTML",e)}static text(t,e){return this.prop(t,"textContent",e)}static value(t,e){return this.prop(t,"value",e)}static dispatchEvent(t,e,s){let i;const r=["click","dblclick","mousedown","mouseup","mousemove"],a=["keydown","keyup","keypress"];typeof e=="string"?r.includes(e)?i=new MouseEvent(e,s):a.includes(e)?i=new KeyboardEvent(e,s):i=new Event(e,s):i=e,t.dispatchEvent(i)}static scriptConvert(t){const e=s=>{const r=s.ownerDocument.createElement("script");r.text=s.text;const a=s.attributes;for(let o=0;o<a.length;o++)r.setAttribute(a[o].name,a[o].value);return r};return t.tagName=="SCRIPT"&&(t=e(t)),t.querySelectorAll&&t.querySelectorAll("script").forEach(s=>{s.parentNode?.replaceChild(e(s),s)}),t}static fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(s=>{const i=this.scriptConvert(s);i!=s&&e.content.replaceChild(i,s)}),e.content}static insert(t,e,s="append"){return typeof e=="string"?t[s](this.fragment(e)):(e instanceof HTMLElement||e instanceof SVGElement)&&t[s](e),this}static createElement(t){return document.createElement.call(document,t)}static createTextNode(t){return document.createTextNode.call(document,t)}static createDocumentFragment(){return document.createDocumentFragment.call(document)}static remove(t){return t.remove()}static siblings=t=>Array.prototype.slice.call(t.parentElement?.children).filter(e=>e!==t);static nextElementSibling(t){return t.nextElementSibling}static previousElementSibling(t){return t.previousElementSibling}static closest(t,e){return t.closest(e)}static shadowRoot(t){return t.shadowRoot}static parentElement=t=>t.parentElement;static changeSelectSelected(t,e){if(t instanceof HTMLSelectElement){const s=t.options;for(let i=0,r=s.length;i<r;i++)s[i].value==e?s[i].selected=!0:s[i].selected=!1}}static changeRadioChecked(t,e){t instanceof HTMLInputElement&&(t.value==e?t.checked=!0:t.checked=!1)}static entity2text(t){const e={lt:60,"lt;":60,"AMP;":38,AMP:38,"GT;":62,GT:62,"QUOT;":34,QUOT:34,"apos;":39,"bull;":8226,"bullet;":8226,"copy;":169,copy:169,"deg;":176,deg:176};let s;return t.charAt(0)=="#"?t.charAt(1).toLowerCase()=="x"?s=parseInt(t.substring(2),16):s=parseInt(t.substring(1),10):s=e[t],s?String.fromCharCode(s):"&"+t}static waitForStyleSheetsLoaded=()=>new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let s=document.styleSheets.length||0;const i=()=>s>=e.length?(t(),!0):!1;i()||e.forEach(r=>{r.onload=()=>{s+=1,i()}})});static loadScript(t,e=()=>{},s=(i,r,a,o,c)=>{}){const i=document.createElement("script");i.type="text/javascript",i.src=t,i.async=!1,i.onload=e,i.onerror=s,document.body.appendChild(i)}static runInSafe(t){const e=new Proxy(window,{get(s,i,r){if(typeof i=="string"&&["open","location","document"].includes(i))throw new Error(`禁止访问 key: ${i}`);return i==="window"?e:Reflect.get(s,i,r)},set(s,i,r,a){return Reflect.set(s,i,r,a)}});new Function("window",`with(window) { ${t} }`)(e,null)}static dom=new Proxy({},{get(t,e){return function(s={},...i){const r=document.createElement(e);for(const a of Object.keys(s))r.setAttribute(a,s[a]);for(const a of i)typeof a=="string"?r.appendChild(document.createTextNode(a)):r.appendChild(a);return r}}});static compileTemplate(t){return t=t.replace(/<%=(.+?)%>/g,"`); \n echo( $1 ); \n echo(`").replace(/<%([\s\S]+?)%>/g,"`); \n $1 \n echo(`"),t="echo(`"+t+"`);",`(function parse(data){
|
|
10
|
+
`.replace(/\s+/g,""),"u");break;case"mime-image":t=/^image\//;break;case"mime-video":t=/^video\//;break;case"mime-audio":t=/^audio\//;break;case"mime-document-word":t=/^application\/(?:vnd\.openxmlformats-officedocument\.wordprocessingml\.document|msword|vnd\.ms-word\.document\.macroenabled\.12|vnd\.openxmlformats-officedocument\.wordprocessingml\.template|vnd\.ms-word\.template\.macroenabled\.12)$/;break;case"mime-document-excel":t=/^application\/(?:vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|vnd\.ms-excel|vnd\.ms-excel\.sheet\.macroenabled\.12|vnd\.openxmlformats-officedocument\.spreadsheetml\.template|vnd\.ms-excel\.template\.macroenabled\.12)$/;break;case"mime-document-ppt":t=/^application\/(?:vnd\.ms-powerpoint|vnd\.openxmlformats-officedocument\.presentationml\.presentation|vnd\.ms-powerpoint\.presentation\.macroenabled\.12|vnd\.openxmlformats-officedocument\.presentationml\.template|vnd\.ms-powerpoint\.template\.macroenabled\.12)$/;break;case"mime-document-json":t=/^application\/json$/;break;case"mime-document-xml":t=/^(?:application|text)\/(?:xml|xhtml\+xml)$/;break}return t},Rt=(i,t)=>(typeof i=="string"&&(i=Ys(i)||new RegExp(i)),i.test(t)),en=(i,t)=>{if(typeof i=="string"&&(i=Ys(i)||new RegExp(i)),!t)return null;const e=t.match(i);return e?i.flags.toLowerCase().indexOf("g")>=0?e.map(s=>({matchIndex:-1,fullMatch:s,groupMatchs:[]})):{matchIndex:typeof e.index=="number"?e.index:-1,fullMatch:e[0],groupMatchs:e.slice(1)}:null},sn=(i,t)=>{typeof i=="string"&&(i=Ys(i)||new RegExp(i));const e=[],s=t.matchAll(i);for(const n of s)e.push({matchIndex:typeof n.index=="number"?n.index:-1,fullMatch:n[0],groupMatchs:n.slice(1)});return e};function nn(i){const t=i.match(/[\s\S]/gu);return t?t.length:0}function rn(i,t){const e=i.codePointAt(t);return e?String.fromCodePoint(e):void 0}function Ta(i=12){const t="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghijklmnopqrstuvwxyz0123456789",e=t.length;let s="";for(let n=0;n<i;n++)s+=t[Math.floor(Math.random()*e)];return s}function Ea(i){const t=re.get(i);if(t)return t;const e=i.replace(/(^\w)/g,function(s){return s.toLowerCase()});return re.set(i,e),e}const nt=(i,t="-")=>{const e=re.get(i);if(e)return e;let s=i.replace(new RegExp(`${t}?([A-Z])`,"g"),t+"$1").toLowerCase();return s=s.replace(new RegExp(`^${t}`),""),re.set(i,s),s};function qs(i){const t=re.get(i);if(t)return t;const e=i.replace(/(^\w|[_-]\w)/g,function(s){return s.slice(-1).toUpperCase()});return re.set(i,e),e}function an(i){return Ea(qs(i))}function Pa(i,t,e="0",s="left"){const n=nn(i);if(t>n){const r=t-n;switch(s){case"left":i=Array(r+1).join(e)+i;break;case"right":i=i+Array(r+1).join(e);break;default:const a=Math.ceil(r/2),o=r-a;i=Array(o+1).join(e)+i+Array(a+1).join(e);break}}return i}function on(i){let t="";for(let e=0,s=i.length;e<s;e++){const n=i.charCodeAt(e);n>=1&&n<=127?t+=i.charAt(e):n>2047?(t+=String.fromCharCode(224|n>>12&15),t+=String.fromCharCode(128|n>>6&63),t+=String.fromCharCode(128|n>>0&63)):(t+=String.fromCharCode(192|n>>6&31),t+=String.fromCharCode(128|n>>0&63))}return t}var Lt=(i=>(i.UNKNOWN="",i.HTML="text/html",i.CSS="text/css",i.TEXT="text/plain",i.MD="text/plain",i.JPEG="image/jpeg",i.PNG="image/png",i.GIF="image/gif",i.WEBP="image/webp",i.SVG="image/svg+xml",i.ICO="image/x-icon",i.MPEG="audio/mpeg",i.MP3="audio/mpeg",i.OGG="audio/ogg",i.WAV="audio/wav",i.MP4="video/mp4",i.WEBM="video/webm",i.JSON="application/json",i.XWWW="application/x-www-form-urlencoded",i.XHTML="application/xhtml+xml",i.XML="application/xml",i.XML_TEXT="text/xml",i.JAVASCRIPT="application/javascript",i.ECMASCRIPT="application/ecmascript",i.DOC="application/msword",i.CSV="application/x-csv",i.EXCEL="application/vnb.ms-excel",i.PDF="application/pdf",i.ZIP="application/zip",i.TGZ="application/x-gtar",i.TAR_GZ="application/x-gzip",i.EOT="appliaction/vnd.ms-fontobject",i.TTF="aplication/font-sfnt",i))(Lt||{});const Aa=(i,t=16)=>i.toString(t),Kt=(i,t=16)=>{let e=i.toLowerCase();const s=e.indexOf("0b")==0,n=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(s||n||r)&&(e=e.slice(2));const a=parseInt(e,t);if(isNaN(a))throw new Error(`radixStringToNumber(${i}, ${t}) 无法解析!`);return a};function ss(i,t){if(i instanceof ArrayBuffer)return Array.from(new Uint8Array(i));let e=[];if(Array.isArray(i))return i.forEach(s=>{typeof s=="number"?e.push(s):e=e.concat(ss(s,t))}),e;if(typeof i=="number")for(;i>0;){const s=i&255;e.unshift(s),i=(i-s)/256}if(typeof i=="string")if(t){let s=i.toLowerCase();switch(t){case 16:default:s.indexOf("0x")==0&&(s=s.slice(2));for(let n=0,r=s.length;n<r;n+=2)e.push(Kt(s.slice(n,n+2),t));break}}else for(const s of i){const n=s.codePointAt(0);n&&e.push(n)}return e}function Da(i,t){if(i instanceof ArrayBuffer)return i;const e=ss(i,t);return new Uint8Array(e).buffer}function ka(i,t){const e=ss(i,t);return va?Buffer.from(e).toString("utf8"):String.fromCodePoint.apply(null,e)}function Ma(i,t){const e=ss(i,t);let s="";for(let n=0,r=e.length;n<r;n++)s+=Aa(e[n],16).padStart(2,"0");return s}function _a(){const i=Uint32Array.of(305419896),t=new Uint8Array(i.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}const hn=i=>{let t=Lt.UNKNOWN;switch(new DataView(i).getUint32(0,_a()).toString(16).toUpperCase()){case"FFD8FFDB":t=Lt.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Lt.JPEG;break;case"89504E47":t=Lt.PNG;break;case"47494638":t=Lt.GIF;break;case"52494646":t=Lt.WEBP;break;case"25504446":t=Lt.PDF;break;case"504B0304":t=Lt.ZIP;break}return t};function Ia(i){const t=typeof i;return t!=="object"?t:Object.prototype.toString.call(i).replace(/^\[object (\S+)\]$/,"$1").toLowerCase()}function Oa(i){return i!=null}function Ee(i){return Ia(i)==="object"}function Ra(i,t){for(const e of Reflect.ownKeys(t))if(e!=="constructor"&&e!=="prototype"&&e!=="name"&&e!=="displayName"){const s=Object.getOwnPropertyDescriptor(t,e);s&&Object.defineProperty(i,e,s)}}function cn(i,t=new WeakMap){if(i==null)return i;if(i.constructor===Date)return new Date(i);if(i.constructor===RegExp)return new RegExp(i);if(typeof i!="object")return i;if(t.has(i))return t.get(i);const e=Object.create(Object.getPrototypeOf(i),Object.getOwnPropertyDescriptors(i));for(const s of Reflect.ownKeys(i))e[s]=Ee(i[s])?cn(i[s],t):i[s];return t.set(i,e),e}function Hs(i,t){for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(Ee(t[e])?(typeof i[e]>"u"&&(i[e]={}),Hs(i[e],t[e])):typeof i[e]>"u"&&(i[e]=t[e]));return i}function ln(i,t){for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&!t(e,i[e])&&delete i[e];return i}function is(i,t){const e=i.findIndex(s=>s===t);return e>=0&&i.splice(e,1),i}function La(i,t){if(i=parseFloat(i),isNaN(i)){if(typeof t=="number")return t;throw new Error(`parseNumber(${i}) isNaN!`)}return i}function Pe(i,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(i-t)<e}const lt=(i,t,e)=>i<t?t:i>e?e:i,Na=(i,t,e)=>s=>{const n=Math.min(Math.max(i,s),t);return t-n<e?t:Math.round(n/e)*e};function Fa(i,t=12){return La(i).toFixed(t)}function jt(i,t=12){return+Fa(i,t)}function un(i,t){const e=en("number-single",String(i));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):Oa(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?i.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?i.substring(e.matchIndex+e.fullMatch.length):""}}function fn(i){const t=en("number",i);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}function Ba(i,t){let e;return function(...s){clearTimeout(e),e=setTimeout(()=>{i.apply(this,s)},t)}}class ns{events;constructor(){this.events={}}on(t,e){return this.events[t]||(this.events[t]=[]),this.events[t].push(e),this}addListener(t,e){return this.on(t,e),this}prependListener(t,e){return this.events[t]||(this.events[t]=[]),this.events[t].unshift(e),this}removeListener(t,e){if(this.events[t])return this.events[t]=this.events[t].filter(s=>s!==e),this}off(t,e){return this.removeListener(t,e),this}removeAllListeners(t){return t?this.events[t]=[]:this.events={},this}emit(t,...e){return this.events[t]&&this.events[t].forEach(s=>{Reflect.apply(s,this,e)}),this}once(t,e){const n=(()=>{let r=!1;return(...a)=>{r||(r=!0,Reflect.apply(e,this,a),this.off(t,n))}})();return this.on(t,n),this}}var dn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Ga(i,t={}){var e=1,s=1;function n(I){var k=I.match(/\n/g);k&&(e+=k.length);var B=I.lastIndexOf(`
|
|
11
|
+
`);s=~B?I.length-B:s+I.length}function r(){var I={line:e,column:s};return function(k){return k.position=new a(I),m(),k}}function a(I){this.start=I,this.end={line:e,column:s},this.source=t.source}a.prototype.content=i;var o=[];function h(I){var k=new Error(t.source+":"+e+":"+s+": "+I);if(k.reason=I,k.filename=t.source,k.line=e,k.column=s,k.source=i,t.silent)o.push(k);else throw k}function c(){var I=g();return{type:"stylesheet",stylesheet:{source:t.source,rules:I,parsingErrors:o}}}function l(){return y(/^{\s*/)}function u(){return y(/^}/)}function g(){var I,k=[];for(m(),x(k);i.length&&i.charAt(0)!="}"&&(I=te()||Ce());)I!==!1&&(k.push(I),x(k));return k}function y(I){var k=I.exec(i);if(k){var B=k[0];return n(B),i=i.slice(B.length),k}}function m(){y(/^\s*/)}function x(I){var k;for(I=I||[];k=b();)k!==!1&&I.push(k);return I}function b(){var I=r();if(!(i.charAt(0)!="/"||i.charAt(1)!="*")){for(var k=2;i.charAt(k)!=""&&(i.charAt(k)!="*"||i.charAt(k+1)!="/");)++k;if(k+=2,i.charAt(k-1)==="")return h("End of comment missing");var B=i.slice(2,k-2);return s+=2,n(B),i=i.slice(k),s+=2,I({type:"comment",comment:B})}}function S(){var I=y(/^([^{]+)/);if(I)return Nt(I[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(k){return k.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(k){return k.replace(/\u200C/g,",")})}function C(){var I=r(),k=y(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(k){if(k=Nt(k[0]),!y(/^:\s*/))return h("property missing ':'");var B=y(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),P=I({type:"declaration",property:k.replace(dn,""),value:B?Nt(B[0]).replace(dn,""):""});return y(/^[;\s]*/),P}}function M(){var I=[];if(!l())return h("missing '{'");x(I);for(var k;k=C();)k!==!1&&(I.push(k),x(I));return u()?I:h("missing '}'")}function O(){for(var I,k=[],B=r();I=y(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)k.push(I[1]),y(/^,\s*/);if(k.length)return B({type:"keyframe",values:k,declarations:M()})}function F(){var I=r(),k=y(/^@([-\w]+)?keyframes\s*/);if(k){var B=k[1];if(k=y(/^([-\w]+)\s*/),!k)return h("@keyframes missing name");var P=k[1];if(!l())return h("@keyframes missing '{'");for(var bt,Jt=x();bt=O();)Jt.push(bt),Jt=Jt.concat(x());return u()?I({type:"keyframes",name:P,vendor:B,keyframes:Jt}):h("@keyframes missing '}'")}}function L(){var I=r(),k=y(/^@supports *([^{]+)/);if(k){var B=Nt(k[1]);if(!l())return h("@supports missing '{'");var P=x().concat(g());return u()?I({type:"supports",supports:B,rules:P}):h("@supports missing '}'")}}function V(){var I=r(),k=y(/^@host\s*/);if(k){if(!l())return h("@host missing '{'");var B=x().concat(g());return u()?I({type:"host",rules:B}):h("@host missing '}'")}}function Z(){var I=r(),k=y(/^@media *([^{]+)/);if(k){var B=Nt(k[1]);if(!l())return h("@media missing '{'");var P=x().concat(g());return u()?I({type:"media",media:B,rules:P}):h("@media missing '}'")}}function X(){var I=r(),k=y(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(k)return I({type:"custom-media",name:Nt(k[1]),media:Nt(k[2])})}function Y(){var I=r(),k=y(/^@page */);if(k){var B=S()||[];if(!l())return h("@page missing '{'");for(var P=x(),bt;bt=C();)P.push(bt),P=P.concat(x());return u()?I({type:"page",selectors:B,declarations:P}):h("@page missing '}'")}}function q(){var I=r(),k=y(/^@([-\w]+)?document *([^{]+)/);if(k){var B=Nt(k[1]),P=Nt(k[2]);if(!l())return h("@document missing '{'");var bt=x().concat(g());return u()?I({type:"document",document:P,vendor:B,rules:bt}):h("@document missing '}'")}}function it(){var I=r(),k=y(/^@font-face\s*/);if(k){if(!l())return h("@font-face missing '{'");for(var B=x(),P;P=C();)B.push(P),B=B.concat(x());return u()?I({type:"font-face",declarations:B}):h("@font-face missing '}'")}}var xt=$t("import"),ht=$t("charset"),Se=$t("namespace");function $t(I){var k=new RegExp("^@"+I+"\\s*([^;]+);");return function(){var B=r(),P=y(k);if(P){var bt={type:I};return bt[I]=P[1].trim(),B(bt)}}}function te(){if(i[0]=="@")return F()||Z()||X()||L()||xt()||ht()||Se()||q()||Y()||V()||it()}function Ce(){var I=r(),k=S();return k?(x(),I({type:"rule",selectors:k,declarations:M()})):h("selector missing")}return Ws(c())}function Nt(i){return i?i.replace(/^\s+|\s+$/g,""):""}function Ws(i,t){var e=i&&typeof i.type=="string",s=e?i:t;for(var n in i){var r=i[n];Array.isArray(r)?r.forEach(function(a){Ws(a,s)}):r&&typeof r=="object"&&Ws(r,s)}return e&&Object.defineProperty(i,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),i}const $s=(i,t="image/svg+xml",e="utf-8")=>e==="base64"?new Blob([i],{type:`${t};${e}`}):new Blob([i],{type:`${t};charset=${e}`}),Js=i=>new XMLSerializer().serializeToString(i),Ua=(i,t="text/html")=>new DOMParser().parseFromString(i,t),mn=(i,t="image/svg+xml",e="utf-8")=>$s(Js(i),t,e),Zs=(i,t)=>new Promise(e=>{const s=document.createElement("a");s.style.visibility="hidden",document.body.appendChild(s),s.download=t,typeof i=="string"?s.href=i:s.href=window.URL.createObjectURL(i),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(s.href),e()});function pn(i=["*"],t){return new Promise((e,s)=>{if(!globalThis.document||!(globalThis.document instanceof Document))return s(new Error("This is not a browser environment"));const n=globalThis.document.createElement("input");n.setAttribute("type","file"),n.setAttribute("visibility","hidden"),Array.isArray(i)&&i.length>0&&n.setAttribute("accept",i.join(",")),t&&n.setAttribute("multiple","true"),globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!n.files||n.files?.length===0)&&s(new Error("Cancel select"))},1e3)},{once:!0});const r=()=>{if(n.removeEventListener("change",r),!n.files||n.files?.length===0)s(new Error("Cancel select"));else{const a=Array.from(n.files);!i.includes("*")&&a.some(o=>!i.includes(`.${gn(o)}`))&&s(new Error(`Please select files in ${i} format`)),n.remove(),e(a)}};n.addEventListener("change",r),n.click()})}function rs(i,t="text",e){return new Promise((s,n)=>{const r=new FileReader;switch(r.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),r.addEventListener("load",a=>{s(a.target?.result)}),r.addEventListener("error",a=>{n(a)}),t){case"dataURL":r.readAsDataURL(i);break;case"binaryString":r.readAsBinaryString(i);break;case"arrayBuffer":r.readAsArrayBuffer(i);break;case"text":default:r.readAsText(i)}})}async function Va(i){const t=await rs(i,"arrayBuffer");return hn(t)}const gn=i=>{let t;return i instanceof File?t=i.name:t=i,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function za(i){typeof queueMicrotask=="function"?queueMicrotask(i):Promise.resolve().then(i).catch(t=>setTimeout(()=>{throw t}))}function ae(i,t={},e=[],s){return{tag:i,props:t,children:e,el:s}}function oe(i,t){if(i.el)return i.el;if(i.el=document.createElement(i.tag),i.props)for(const e in i.props){const s=i.props[e];e.startsWith("on")?i.el.addEventListener(e.slice(2).toLowerCase(),s):i.el.setAttribute(e,s)}return i.children&&(typeof i.children=="string"?i.el.textContent=i.children:i.children.forEach(e=>{oe(e,i.el)})),t?.appendChild(i.el),i.el}function Ks(i,t){if(!i.el)return;if(i.tag!==t.tag){(i.el.parentElement||document.body).replaceChild(oe(t),i.el);return}const e=t.el=i.el,s=i.props,n=t.props;for(const o in s)o in n||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),s[o]):e.removeAttribute(o));for(const o in n){const h=s[o],c=n[o];if(c!=h)if(o.startsWith("on")){const l=o.slice(2).toLowerCase();e.removeEventListener(l,h),e.addEventListener(l,c)}else e.setAttribute(o,c)}const r=i.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof r=="string")e.innerHTML="",a.forEach(o=>{oe(o,e)});else{const o=Math.min(r.length,a.length);for(let h=0;h<o;h++)Ks(r[h],a[h]);a.length>r.length&&a.slice(r.length).forEach(h=>{oe(h,e)}),a.length<r.length&&r.slice(a.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}function yn(i,t){if(!i.isEqualNode(t)){if(i.nodeName!==t.nodeName){(i.parentElement||document.body).replaceChild(t,i);return}if(i.nodeType===Node.TEXT_NODE){i.textContent!==t.textContent&&(i.textContent=t.textContent);return}for(let e=i.attributes.length-1;e>=0;e--){const s=i.attributes[e].name;!t.hasAttribute(s)&&s!=="open"&&i.removeAttribute(s)}for(let e=0;e<t.attributes.length;e++){const s=t.attributes[e].name,n=t.attributes[e].value;i.setAttribute(s,n)}for(let e=0;e<t.childNodes.length;e++)i.childNodes[e]?yn(i.childNodes[e],t.childNodes[e]):i.appendChild(t.childNodes[e].cloneNode(!0));for(;i.childNodes.length>t.childNodes.length;)i.lastChild&&i.removeChild(i.lastChild)}}class ja{url;socket;waitingResponse={};sendMessageQueue=[];constructor(t){this.url=t,this.createSocket()}createSocket(){console.log("Socket Create Attempted"),this.socket=new WebSocket(this.url),this.socket.onopen=()=>{this.sendMessageQueue.forEach(t=>this.socket?.send(t)),this.sendMessageQueue=[]},this.socket.onclose=t=>{const{code:e,reason:s,wasClean:n}=t;console.log(`ws closed : ${e} ${s} ${n}`)},this.socket.onerror=t=>{console.log(`ws error : ${t.type}`)},this.socket.onmessage=t=>{this.processMessage(t)}}recreateSocket(t){console.log("Socket Recreate Attempted"),this.sendMessageQueue.push(t),this.createSocket()}closeSocket(){this.socket&&(this.socket.close(),console.log("Socket closed"))}openSocket(){this.createSocket(),console.log("Socket opened manually")}sendWithRetry(t){this.socket?.readyState===WebSocket.OPEN?this.socket.send(t):this.recreateSocket(t)}async processMessage(t){if(typeof t.data=="string")try{const e=JSON.parse(t.data);if(Object.prototype.hasOwnProperty.call(e,"requestid")){const s=this.waitingResponse[e.requestid];s?s.resolve?.(e):console.warn("Got data but found no associated request, already timed out?",e)}else console.warn("Got data without request id",e)}catch{console.log(`Received String : ${t.data}`)}else t.data instanceof ArrayBuffer?console.log(`Received ArrayBuffer : ${t.data}`):t.data instanceof Blob&&console.log(`Received Blob : ${t.data}`)}async sendPayload(t){const e=+new Date,s=this.waitingResponse[e]={requestid:e};try{let n;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?n=t:n=JSON.stringify({...s,...t});const r=await new Promise((a,o)=>{s.resolve=a,this.sendWithRetry(n),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-s.requestid)/1e3),r}catch(n){return Promise.reject(n)}finally{delete this.waitingResponse[e]}}async send(t,e,s=n=>{console.log(n)}){this.sendPayload(t).then(e,s)}}function Xa(){const i=window.screen;return{screenWidth:i.width,screenHeight:i.height,screenX:window.screenX,screenY:window.screenY}}function Ya(){const i=document.body;return{clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,pageX:i.getBoundingClientRect().x,pageY:i.getBoundingClientRect().y}}function he(){const i=document.documentElement;return{clientX:i.getBoundingClientRect().x,clientY:i.getBoundingClientRect().y,clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,offsetWidth:i.offsetWidth,offsetHeight:i.offsetHeight,offsetTop:i.offsetTop,offsetLeft:i.offsetLeft,offsetParent:i.offsetParent}}function qa(){const{clientWidth:i,clientHeight:t}=he();return{width:i||window.innerWidth,height:t||window.innerHeight}}function Ha(){const{scrollWidth:i,scrollHeight:t}=he();return{width:i,height:t}}function wn(i){const{top:t,left:e,width:s,height:n}=i.getBoundingClientRect(),{scrollLeft:r,scrollTop:a}=he();return{x:e+r,y:t+a,width:s,height:n}}function Wa(i){let t=0,e=0;i&&(t=i.offsetWidth,e=i.offsetHeight);let s=0,n=0;for(;i!==null;)s+=i.offsetLeft,n+=i.offsetTop,i.offsetParent instanceof HTMLElement?i=i.offsetParent:i=null;return{x:s,y:n,width:t,height:e}}function $a(i){const t=i.getBoundingClientRect();return{x:t.left,y:t.top,width:t.width,height:t.height}}function Ja(i,t){const e=i.getBoundingClientRect(),s=t.getBoundingClientRect();return{x:s.x-e.x,y:s.y-e.y,width:s.width||s.right-s.left,height:s.height||s.bottom-s.top}}function Za(){const{clientHeight:i,scrollTop:t,scrollHeight:e}=he(),s=e-i;return s<=0?0:t/s*100}function Ka(i){return{x:i.clientX,y:i.clientY}}function xn(i){if("center"in i)return i.center;if(i.pageX&&i.pageY)return{x:i.pageX,y:i.pageY};const{scrollLeft:t,scrollTop:e}=he();return{x:i.clientX+t,y:i.clientY+e}}function bn(i,t){const e=xn(t),s=wn(i);return{x:e.x-s.x,y:e.y-s.y}}const as=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return/mac/i.test(i)?t="macOS":/win/i.test(i)?t="Windows":/android/i.test(i)?t="Android":/iphone|ipad|ipod/i.test(i)?t="iOS":/linux/i.test(i)?t="Linux":/bsd/i.test(i)&&(t="BSD"),t.toLowerCase()},Qa=()=>{const i=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(i)){const e=i.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(i)){const e=i.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(i)){const e=i.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(i)){const e=i.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},Qs=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(i)||/opera/i.test(i)?t="Opera":/chrome/i.test(i)?t="Chrome":/firefox/i.test(i)?t="Firefox":/safari/i.test(i)?t="Safari":/edge/i.test(i)?t="Edge":/msie|trident/i.test(i)?t="IE":/MicroMessenger/i.test(i)?t="Wechat":/alipay/i.test(i)&&(t="Ali"),t.toLowerCase()},to=()=>{const i=navigator.userAgent;let t="Unknown";if(/Chrome/.test(i)){const e=i.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(i)){const e=i.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(i)){const e=i.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(i)){const e=i.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(i)){const e=i.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t},eo=()=>"geolocation"in navigator?new Promise((i,t)=>{navigator.geolocation.getCurrentPosition(e=>{const s=e.coords.latitude,n=e.coords.longitude;i({latitude:s,longitude:n})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function so(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function io(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function ti(){return as()==="ios"}function ei(){return as()==="macos"}function no(){return ti()|ei()}function vn(){return as()==="android"}function ro(){return ti()||vn()}function ao(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function Sn(){const i=window.navigator.userAgent,t=i.indexOf("MSIE ");if(t>0)return parseInt(i.substring(t+5,i.indexOf(".",t)),10);if(i.indexOf("Trident/")>0){const n=i.indexOf("rv:");return parseInt(i.substring(n+3,i.indexOf(".",n)),10)}const s=i.indexOf("Edge/");return s>0?parseInt(i.substring(s+5,i.indexOf(".",s)),10):-1}const oo=Sn()!==-1;function ho(){const i=document.documentMode;return i&&(i===9||i===10)}function Cn(){return Qs()==="wechat"}function Tn(){return Qs()==="ali"}function co(){return Cn()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function lo(){return Tn()&&navigator.userAgent.match(/miniprogram/i)}const uo=typeof document<"u",En=typeof window<"u",fo=typeof history<"u",mo=En&&window.File&&window.FileReader&&window.FileList&&window.Blob,Pn=(()=>{const i=ne();return!!(i.Worker&&i.Blob&&i.Promise&&i.OffscreenCanvas&&i.OffscreenCanvasRenderingContext2D&&i.HTMLCanvasElement&&i.HTMLCanvasElement.prototype.transferControlToOffscreen&&i.URL&&i.URL.createObjectURL)})(),po=typeof Path2D=="function"&&typeof DOMMatrix=="function",An=function(){if(!ne().OffscreenCanvas)return!1;const t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);const s=t.transferToImageBitmap();try{e.createPattern(s,"no-repeat")}catch{return!1}return!0}(),go=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},yo="webkit moz ms o".split(" ");function os(i){return typeof i=="function"&&/native code/.test(i.toString())}function wo(i){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let s=100;const n=function(){const r=Math.min(t.clientWidth,i);t.dataset.width=r,t.dataset.rem=s=Math.round(100*(r/i)),t.style.fontSize=s+"px"};n(),window.rem2px=function(r){return r=parseFloat(r),r*s},window.px2rem=function(r){return r=parseFloat(r),r/s},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",n,!1)}function N(i){return i*Math.PI/180}function et(i){return i*180/Math.PI}function hs(i,t,e=0){return Math.sqrt(i*i+t*t+e*e)}function cs(i,t,e,s){const n=i-e,r=t-s;return hs(n,r)}function ls(i,t,e,s){const n=i-e,r=t-s;return n*n+r*r}function Xt(i,t,e,s){const n=e-i,r=s-t;let a=Math.atan2(r,n);return a<0&&(a+=Math.PI*2),a}function Pt(i,t){return{dx:Math.cos(i)*t,dy:Math.sin(i)*t}}function xo(i,t){const e=Math.sqrt(Math.pow(i,2)+Math.pow(t,2));return{x:i/=e,y:t/=e}}function bo(i,t,e,s,n=10){if(Math.abs(e-i)<n&&Math.abs(s-t)<n)return"no";const r=et(Xt(i,t,e,s));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":r>=-45&&r<=45?"right":"no"}const Ae=Math.PI*2;function Dn(i,t,e,s){const n=i*s-t*e<0?-1:1;let r=i*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),n*Math.acos(r)}function vo(i,t,e,s,n,r,a,o,h,c){const l=c*(i-e)/2+h*(t-s)/2,u=-h*(i-e)/2+c*(t-s)/2,g=a*a,y=o*o,m=l*l,x=u*u;let b=g*y-g*x-y*m;b<0&&(b=0),b/=g*x+y*m,b=Math.sqrt(b)*(n===r?-1:1);const S=b*a/o*u,C=b*-o/a*l,M=c*S-h*C+(i+e)/2,O=h*S+c*C+(t+s)/2,F=(l-S)/a,L=(u-C)/o,V=(-l-S)/a,Z=(-u-C)/o,X=Dn(1,0,F,L);let Y=Dn(F,L,V,Z);return r===0&&Y>0&&(Y-=Ae),r===1&&Y<0&&(Y+=Ae),[M,O,X,Y]}function So(i,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(i),n=Math.sin(i),r=Math.cos(i+t),a=Math.sin(i+t);return[s,n,s-n*e,n+s*e,r+a*e,a-r*e,r,a]}function kn(i,t,e,s,n,r,a,o,h){const c=Math.sin(h*Ae/360),l=Math.cos(h*Ae/360),u=l*(i-e)/2+c*(t-s)/2,g=-c*(i-e)/2+l*(t-s)/2;if(u===0&&g===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const y=u*u/(a*a)+g*g/(o*o);y>1&&(a*=Math.sqrt(y),o*=Math.sqrt(y));const m=vo(i,t,e,s,n,r,a,o,c,l),x=[];let b=m[2],S=m[3];const C=Math.max(Math.ceil(Math.abs(S)/(Ae/4)),1);S/=C;for(let M=0;M<C;M++)x.push(So(b,S)),b+=S;return x.map(M=>{for(let O=0;O<M.length;O+=2){let F=M[O+0],L=M[O+1];F*=a,L*=o;const V=l*F-c*L,Z=c*F+l*L;M[O+0]=V+m[0],M[O+1]=Z+m[1]}return M})}function si(i,t,e,s,n,r){return[i/3+2/3*e,t/3+2/3*s,n/3+2/3*e,r/3+2/3*s,n,r]}function De(i,t,e,s){return[i,t,e,s,e,s]}const ke={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class ce{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&D.attribute(s,e),s}static createSvgPath(t){return this.createSVGElement("path",{d:t})}static downloadFromSVGElement(t,e="shape"){return Zs(mn(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return Zs($s(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return Js(t)}static isSVGPath(t){return typeof t!="string"?!1:(t=t.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(t)&&/[\dz]$/i.test(t))}static SVGPathDataToD(t){return t.map(e=>{if(!e[0])return"";switch(e[0].toLowerCase()){case"a":return`${e[0]} ${e[1]},${e[2]} ${e[3]} ${e[4]},${e[5]} ${e[6]},${e[7]}`;case"c":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]} ${e[5]},${e[6]}`;case"s":case"q":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]}`;default:return e[0]+" "+e.slice(1).join(",")}}).join(" ")}static parseSVGPath(t){const e=[];return t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,n,r)=>{let a=n.toLowerCase();const o=fn(r);for(a=="m"&&o.length>ke[a]&&(e.push([n,...o.splice(0,ke[a])]),a="l",n=n=="m"?"l":"L");o.length;){if(o.length<ke[a])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${n} } args:{ ${o} }`);e.push([n,...o.splice(0,ke[a])])}return a=="z"&&e.push([n]),""}),e}static absolutizeSVGPath(t){let e=0,s=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toUpperCase();if(o!=h)switch(a[0]=h,o){case"a":a[6]+=n,a[7]+=r;break;case"v":a[1]+=r;break;case"h":a[1]+=n;break;default:for(let c=1;c<a.length;)a[c++]+=n,a[c++]+=r}switch(h){case"Z":n=e,r=s;break;case"H":n=a[1];break;case"V":r=a[1];break;case"M":n=e=a[1],r=s=a[2];break;default:n=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,s=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toLowerCase();if(o!=h)switch(a[0]=h,o){case"A":a[6]-=n,a[7]-=r;break;case"V":a[1]-=r;break;case"H":a[1]-=n;break;default:for(let c=1;c<a.length;)a[c++]-=n,a[c++]-=r}switch(h){case"z":n=e,r=s;break;case"h":n+=a[1];break;case"v":r+=a[1];break;case"m":n+=a[1],r+=a[2],e+=a[1],s+=a[2];break;default:n+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){let e=[],s=0,n=0,r=0,a=0,o=0,h=0,c=0,l=0,u;for(let g=0,y=t.length;g<y;g++){let m=t[g];const x=m[0];switch(x){case"M":s=m[1],n=m[2];break;case"A":const b=kn(r,a,m[6],m[7],m[4],m[5],m[1],m[2],m[3]);if(!b.length)continue;b.forEach((M,O)=>{const[F,L,V,Z,X,Y,q,it]=M;m=["C",V,Z,X,Y,q,it],O<b.length-1&&e.push(m)});break;case"S":let S=r,C=a;(u=="C"||u=="S")&&(S+=S-c,C+=C-l),m=["C",S,C,m[1],m[2],m[3],m[4]];break;case"T":u=="Q"||u=="T"?(o=r*2-o,h=a*2-h):(o=r,h=a),m=["C",...si(r,a,o,h,m[1],m[2])];break;case"Q":o=m[1],h=m[2],m=["C",...si(r,a,m[1],m[2],m[3],m[4])];break;case"L":m=["C",...De(r,a,m[1],m[2])];break;case"H":m=["C",...De(r,a,m[1],a)];break;case"V":m=["C",...De(r,a,r,m[1])];break;case"Z":m=["C",...De(r,a,s,n)];break}u=x,r=m[m.length-2],a=m[m.length-1],m.length>4?(c=m[m.length-4],l=m[m.length-3]):(c=r,l=a),e.push(m)}return e}static catmullRom2bezier(t){let e=[];for(let s=0,n=t.length;n-2>s;s+=2){let r;s==0?r=[{x:t[s],y:t[s+1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}]:n-4==s?r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+2],y:t[s+3]}]:r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}];const a=[{x:r[1].x,y:r[1].y},{x:(-r[0].x+6*r[1].x+r[2].x)/6,y:(-r[0].y+6*r[1].y+r[2].y)/6},{x:(r[1].x+6*r[2].x-r[3].x)/6,y:(r[1].y+6*r[2].y-r[3].y)/6},{x:r[2].x,y:r[2].y}];e.push(["C",a[1].x,a[1].y,a[2].x,a[2].y,a[3].x,a[3].y])}return e}static zvhToLSVGPath(t){let e=[],s=["L",0,0],n;for(let r=0,a=t.length;r<a;r++){let o=t[r];switch(o[0]){case"M":s=["L",o[1],o[2]],e.push(o);break;case"Z":e.push(s);break;case"H":n=e[e.length-1]||["L",0,0],e.push(["L",o[1],n[n.length-1]]);break;case"V":n=e[e.length-1]||["L",0,0],e.push(["L",n[n.length-2],o[1]]);break;default:e.push(o)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let s,n=0,r=0;for(let a=0,o=t.length;a<o;a++){const h=t[a],c=e[h[0]];c&&(h[0]=c.to,s&&(s[0]===c.to?(n=2*Number(s[c.x+2])-Number(s[c.x]),r=2*Number(s[c.x+3])-Number(s[c.x+1])):(n=Number(s[s.length-2]),r=Number(s[s.length-1]))),h.splice(1,0,n,r)),s=h}return t}static curveDim(t,e,s,n,r,a,o,h){const c=[],l=[[],[]];let u,g,y,m,x,b,S,C;for(let L=0;L<2;++L){if(L===0?(g=6*t-12*s+6*r,u=-3*t+9*s-9*r+3*o,y=3*s-3*t):(g=6*e-12*n+6*a,u=-3*e+9*n-9*a+3*h,y=3*n-3*e),Math.abs(u)<1e-12){if(Math.abs(g)<1e-12)continue;m=-y/g,m>0&&m<1&&c.push(m);continue}S=g*g-4*y*u,C=Math.sqrt(S),!(S<0)&&(x=(-g+C)/(2*u),x>0&&x<1&&c.push(x),b=(-g-C)/(2*u),b>0&&b<1&&c.push(b))}let M=c.length,O;const F=M;for(;M--;)m=c[M],O=1-m,l[0][M]=O*O*O*t+3*O*O*m*s+3*O*m*m*r+m*m*m*o,l[1][M]=O*O*O*e+3*O*O*m*n+3*O*m*m*a+m*m*m*h;return l[0][F]=t,l[1][F]=e,l[0][F+1]=o,l[1][F+1]=h,l[0].length=l[1].length=F+2,{min:{x:Math.min.apply(0,l[0]),y:Math.min.apply(0,l[1])},max:{x:Math.max.apply(0,l[0]),y:Math.max.apply(0,l[1])}}}static base3(t,e,s,n,r){const a=-3*e+9*s-9*n+3*r,o=t*a+6*e-12*s+6*n;return t*o-3*e+3*s}static bezlen(t,e,s,n,r,a,o,h,c=1){c=Math.max(0,Math.min(c,1));const l=c/2,u=12,g=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],y=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let m=0;for(let x=0;x<u;x++){const b=l*g[x]+l,S=this.base3(b,t,s,r,o),C=this.base3(b,e,n,a,h),M=S*S+C*C;m+=y[x]*Math.sqrt(M)}return l*m}}const z=ce;class ii extends ns{shapes=[];removes=[];x;y;constructor(t){super(),this.x=t?.x||0,this.y=t?.y||0}register(...t){this.shapes.push(...t);const e=s=>(n,r)=>{this.shapes.forEach(a=>{a.id!==s.id&&a.enableDrag&&(a.x+=n,a.y+=r)}),this.x+=n,this.y+=r};t.forEach(s=>{const n=e(s);s.on("moving",n),this.removes.push(()=>{s.off("moving",n)})})}destroy(){this.removes.forEach(t=>t())}}class H extends ns{id;cX;cY;x;prevX;y;prevY;degree;prevDegree;scalexOnOrigin;scaleyOnOrigin;prevScalexOnOrigin;prevScaleyOnOrigin;skewxDegreeOnOrigin;skewyDegreeOnOrigin;prevSkewxDegreeOnOrigin;prevSkewyDegreeOnOrigin;transformBaseOnSelfInRenderGroup;vx;vy;ax;ay;mass;attrs;enableDrag;alongPath;isDragging=!1;isMouseIn=!1;mouseX=0;mouseY=0;targetToAfterDragFree;followMouse;isShow=!0;now=new Date().getTime();frameRate=60;strokeArmyAnts;strokeArmyAntsOffset=0;history=[];path2d=new Path2D;el;pathd;renderGroup;shapeGroup;autoRender;constructor(t){super(),this.id=Ta(),this.cX=t?.cX||0,this.cY=t?.cY||0,this.prevX=this.x=t?.x||0,this.prevY=this.y=t?.y||0,this.prevDegree=this.degree=t?.degree||0,this.prevScalexOnOrigin=this.scalexOnOrigin=1,this.prevScaleyOnOrigin=this.scaleyOnOrigin=1,t?.scaleOnOrigin!==void 0&&(this.prevScalexOnOrigin=this.scalexOnOrigin=t.scaleOnOrigin,this.prevScaleyOnOrigin=this.scaleyOnOrigin=t.scaleOnOrigin),t?.scalexOnOrigin!==void 0&&(this.prevScalexOnOrigin=this.scalexOnOrigin=t.scalexOnOrigin),t?.scaleyOnOrigin!==void 0&&(this.prevScaleyOnOrigin=this.scaleyOnOrigin=t.scaleyOnOrigin),this.prevSkewxDegreeOnOrigin=this.skewxDegreeOnOrigin=t?.skewxDegreeOnOrigin||0,this.prevSkewyDegreeOnOrigin=this.skewyDegreeOnOrigin=t?.skewyDegreeOnOrigin||0,this.transformBaseOnSelfInRenderGroup=typeof t?.transformBaseOnSelfInRenderGroup=="boolean"?t.transformBaseOnSelfInRenderGroup:!1,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||1,this.attrs=Object.assign({paintOrder:"stroke",stroke:"none",fill:"none"},Object.fromEntries(Object.entries(t?.attrs||{}).map(([e,s])=>[nt(e),s]))),this.enableDrag=t?.enableDrag||!1,this.alongPath=t?.alongPath,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.strokeArmyAnts=t?.strokeArmyAnts||!1,this.renderGroup=t?.renderGroup,this.shapeGroup=t?.shapeGroup,this.autoRender=typeof t?.autoRender=="boolean"?t?.autoRender:!1}save(){this.history.push(cn(this))}restore(){const t=this.history.pop();t&&Ra(this,t)}group(...t){this.renderGroup||(this.renderGroup=new ii({x:this.x,y:this.y}),this.renderGroup.register(this)),t.forEach(e=>{e.renderGroup=this.renderGroup,this.renderGroup?.register(e)})}ungroup(){this.renderGroup&&(this.renderGroup.shapes.forEach(t=>delete t.renderGroup),this.renderGroup.destroy(),this.renderGroup=void 0)}setAttr(t,e){Ee(t)?Object.assign(this.attrs,Object.fromEntries(Object.entries(t).map(([s,n])=>[nt(s),n]))):typeof t=="string"&&e&&(this.attrs[nt(t)]=e)}getAttr(t,e){return this.attrs[nt(t)]||e}hasAttr(t){return!!this.attrs[nt(t)]}get centerX(){const t=this.getBoundingClientRect();return t?t.x+t.width/2:this.x}get centerY(){const t=this.getBoundingClientRect();return t?t.y+t.height/2:this.y}get centerDiff(){return{dx:this.centerX-this.x,dy:this.centerY-this.y}}getBoundingClientRect(){return null}frameUpdate(){const t=new Date().getTime();if(!(t-this.now<1e3/this.frameRate)&&(this.now=t,this.strokeArmyAnts&&!this.isMouseIn)){const e=this.getAttr("stroke-dasharray","4 4");if(typeof e=="string"){this.setAttr("stroke-dasharray",e);const s=fn(e);this.setAttr("stroke-dashoffset",String(this.strokeArmyAntsOffset++)),this.strokeArmyAntsOffset>s.reduce((n,r)=>n+r,0)&&(this.strokeArmyAntsOffset=0)}}}toSVGPathD(t=!1){let e=[];const s=this.toSVGPathData();return s[0]&&Array.isArray(s[0])?e.push(...s):e.push(s),t&&(e=z.relativeSVGPath(e)),z.SVGPathDataToD(e)}distance(t){return cs(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=et(Xt(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:s,dy:n}=Pt(N(this.degree),e);this.vx=s,this.vy=n,this.nextFrame()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:s,dy:n}=Pt(N(this.degree),e);this.ax=s,this.ay=n,this.nextFrame()}checkCollision(t){}gravitate(t){const e=t.x-this.x,s=t.y-this.y,n=e*e+s*s,r=Math.sqrt(n),a=this.mass*t.mass/n,o=a*e/r,h=a*s/r;this.vx+=o/this.mass,this.vy+=h/this.mass,t.vx-=o/t.mass,t.vy-=h/t.mass}static comboGravitate(t){const e=t.length;t.forEach((s,n)=>{s.nextFrame();for(let r=n+1;r<e;r++)s.checkCollision(t[r]),s.gravitate(t[r])})}nextFrame(t){this.vx+=this.ax,this.vy+=this.ay;const e=t?.gravity??0;this.vy+=e;const s=t?.friction??1;this.vx*=s,this.vy*=s,this.x+=this.vx,this.y+=this.vy}nextFrameEaseTo(t,e){const s=e?.easing??.05,{dx:n,dy:r}=this.centerDiff,a=t.x-n-this.x,o=t.y-r-this.y;this.vx=a*s,this.vy=o*s,this.nextFrame(e)}nextFrameSpringTo(t,e){const s=e?.spring??.03,{dx:n,dy:r}=this.centerDiff;(Array.isArray(t)?t:[t]).forEach(a=>{const o=a.x-n-this.x,h=a.y-r-this.y,c=o*s,l=h*s;this.vx+=c,this.vy+=l}),this.nextFrame({friction:.9,...e})}static comboSpringChain(t,e){t.forEach((s,n)=>{n>0&&s.nextFrameSpringTo(t[n-1],e)})}static comboSpringConnect(t,e){const s=e?.springLength??100;t.forEach(n=>{n.isDragging||t.filter(r=>r.id!==n.id).forEach(r=>{const a=Xt(n.x,n.y,r.x,r.y);n.nextFrameSpringTo({x:r.x-Math.cos(a)*s,y:r.y-Math.sin(a)*s},e)})})}spring(t,e){const s=e?.springLength??100,n=e?.spring??1e-4;let r=[0,0,0,0,0];const a=t.x-this.x,o=t.y-this.y,h=Math.sqrt(a*a+o*o);if(h<s){r=[this.x,this.y,t.x,t.y,1-h/s];const c=a*n,l=o*n;this.vx+=c/this.mass,this.vy+=l/this.mass,t.vx-=c/t.mass,t.vy-=l/t.mass}return r}static comboSpringMass(t,e,s){const n=[];return t.forEach((r,a)=>{r.nextFrame(s),r.x>e.x+e.width?r.x=e.x:r.x<e.x&&(r.x=e.x+e.width),r.y>e.y+e.height?r.y=e.y:r.y<e.y&&(r.y=e.y+e.height);for(let o=a+1,h=t.length;o<h;o++)n.push(r.spring(t[o],s))}),n}}class Qt extends H{x;y;z;fl;vpX;vpY;cX;cY;cZ;radius;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.fl=t?.fl||250,this.vpX=t?.vpX||0,this.vpY=t?.vpY||0,this.cX=t?.cX||0,this.cY=t?.cY||0,this.cZ=t?.cZ||0,this.radius=t?.radius||0}getBoundingClientRect(){return null}toSVGPathData(){return this.radius?[["M",this.getScreenX(),this.getScreenY()-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:["M",this.getScreenX(),this.getScreenY()]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,s){this.cX=t,this.cY=e,this.cZ=s}rotateX(t){({x:this.y,y:this.z}=Ct(N(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=Ct(N(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=Ct(N(t),this.x,this.y))}getScreenX(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*t}getScreenY(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*t}eq(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.radius===t.radius&&this.mass===t.mass}length(){return hs(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,s=t.y-this.y,n=t.z-this.z;return Math.sqrt(e*e+s*s+n*n)}scalar(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y,n=this.z;return{x:s*t.z-n*t.y,y:n*t.x-e*t.z,z:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y,z:this.z*t.z}}div(t){return{x:this.x/t.x,y:this.y/t.y,z:this.z/t.z}}add(t){return{x:this.x+t.x,y:this.y+t.y,z:this.z+t.z}}sub(t){return{x:this.x-t.x,y:this.y-t.y,z:this.z-t.z}}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y,z:this.z-2*e*t.z}}clone(t){return new Qt({x:t.x,y:t.y,z:t.z,radius:t.radius,mass:t.mass})}}class Q extends H{width;height;borderRadius;constructor(t){super(t),this.width=t.width,this.height=t.height,this.borderRadius=t.borderRadius||0}static fromBezier(t,e,s,n,r,a,o,h){const c=ce.curveDim(t,e,s,n,r,a,o,h);return new Q({x:c.min.x,y:c.min.y,width:c.max.x-c.min.x,height:c.max.y-c.min.y})}getBoundingClientRect(){return new Q({x:this.x,y:this.y,width:this.width,height:this.height})}toSVGPathData(){return this.borderRadius?[["M",this.x+this.borderRadius,this.y],["l",this.width-this.borderRadius*2,0],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,this.borderRadius],["l",0,this.height-this.borderRadius*2],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,this.borderRadius],["l",this.borderRadius*2-this.width,0],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,-this.borderRadius],["l",0,this.borderRadius*2-this.height],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,-this.borderRadius],["z"]]:[["M",this.x,this.y],["l",this.width,0],["l",0,this.height],["l",-this.width,0],["z"]]}toCanvasContext(t){t.beginPath(),this.borderRadius<=0?t.rect(0,0,this.width,this.height):(t.moveTo(0,this.borderRadius),t.lineTo(0,this.height-this.borderRadius),t.quadraticCurveTo(0,this.height,this.borderRadius,this.height),t.lineTo(this.width-this.borderRadius,this.height),t.quadraticCurveTo(this.width,this.height,this.width,this.height-this.borderRadius),t.lineTo(this.width,this.borderRadius),t.quadraticCurveTo(this.width,0,this.width-this.borderRadius,0),t.lineTo(this.borderRadius,0),t.quadraticCurveTo(0,0,0,this.borderRadius)),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height&&this.borderRadius===t.borderRadius}isIntersectRect(t){return!(this.x+this.width<t.x||t.x+t.width<this.x||this.y+this.height<t.y||t.y+t.height<this.y)}isContainPoint(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}clone(t){return new Q({x:t.x,y:t.y,width:t.width,height:t.height,borderRadius:t.borderRadius})}toArray(){return[this.x,this.y,this.width,this.height,this.borderRadius]}}const Mn=[1,0,0,1,0,0],_n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class st{value;m13_value=0;m23_value=0;m33_value=1;matrix3d;constructor(t=Mn){this.value=Array.from(t),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D()}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.m13_value}get m21(){return this.value[2]}get m22(){return this.value[3]}get m23(){return this.m23_value}get m31(){return this.value[4]}get m32(){return this.value[5]}get m33(){return this.m33_value}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.m13_value=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set m23(t){this.m23_value=t}set m31(t){this.value[4]=t}set m32(t){this.value[5]=t}set m33(t){this.m33_value=t}toMatrix3D(t=this.matrix3d){const e=[this.m11,this.m12,0,this.m13,this.m21,this.m22,0,this.m23,0,0,1,0,this.m31,this.m32,0,this.m33];return t?(t.value=e,t):new At(e)}identity(){return this.value=Array.from(Mn),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D(),this}isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m31==0&&this.m32==0&&this.m33==1}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m31*=t,this.m32*=t,this.m33*=t,this}normalize(){const t=this.m33||1e-4;return this.scalar(1/t)}applyToPoint(t,e,s=0,n=0){const r=t-s,a=e-n;return t=this.m11*r+this.m21*a+this.m31,e=this.m12*r+this.m22*a+this.m32,{x:t+s,y:e+n}}fromString(t){const e=sn("number",t);return e.length===6?(e.forEach((s,n)=>{s.fullMatch&&(this.value[n]=parseFloat(s.fullMatch))}),this.m13=0,this.m23=0,this.m33=1):this.identity(),this}clone(){const t=new st;return t.m11=this.m11,t.m12=this.m12,t.m13=this.m13,t.m21=this.m21,t.m22=this.m22,t.m23=this.m23,t.m31=this.m31,t.m32=this.m32,t.m33=this.m33,t}multiply(t){const e=this.clone();let s;return t instanceof st?s=t:s=new st(t),this.m11=s.m11*e.m11+s.m12*e.m21+s.m13*e.m31,this.m12=s.m11*e.m12+s.m12*e.m22+s.m13*e.m32,this.m13=s.m11*e.m13+s.m12*e.m23+s.m13*e.m33,this.m21=s.m21*e.m11+s.m22*e.m21+s.m23*e.m31,this.m22=s.m21*e.m12+s.m22*e.m22+s.m23*e.m32,this.m23=s.m21*e.m13+s.m22*e.m23+s.m23*e.m33,this.m31=s.m31*e.m11+s.m32*e.m21+s.m33*e.m31,this.m32=s.m31*e.m12+s.m32*e.m22+s.m33*e.m32,this.m33=s.m31*e.m13+s.m32*e.m23+s.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}inverse(){const t=this.m11,e=this.m12,s=this.m21,n=this.m22,r=this.m31,a=this.m32,o=t*n-e*s;return this.m11=n/o,this.m12=-e/o,this.m21=-s/o,this.m22=t/o,this.m31=(s*a-n*r)/o,this.m32=-(t*a-e*r)/o,this.m13=0,this.m23=0,this.m33=1,this}adjugate(){const t=new st;return t.m11=this.m22*this.m33-this.m32*this.m23,t.m12=this.m32*this.m13-this.m12*this.m33,t.m13=this.m12*this.m23-this.m22*this.m13,t.m21=this.m31*this.m23-this.m21*this.m33,t.m22=this.m11*this.m33-this.m31*this.m13,t.m23=this.m21*this.m13-this.m11*this.m23,t.m31=this.m21*this.m32-this.m31*this.m22,t.m32=this.m31*this.m12-this.m11*this.m32,t.m33=this.m11*this.m22-this.m21*this.m12,t}split(){let t=et(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(t+=180),{x:this.m31,y:this.m32,rotate:t,scaleX:Math.sqrt(this.m11*this.m11+this.m12*this.m12),scaleY:Math.sqrt(this.m21*this.m21+this.m22*this.m22),skewX:et(Math.atan2(-this.m21,this.m22)),skewY:et(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],s=this.value[1],n=this.value[2],r=this.value[3],a=this.value[4],o=this.value[5],h=t.value[0],c=t.value[1],l=t.value[2],u=t.value[3],g=t.value[4],y=t.value[5],m=h*u,x=c*l,b=(l*s-e*u)/(x-m),S=(h*s-e*c)/(m-x),C=(l*r-n*u)/(x-m),M=(h*r-n*c)/(m-x),O=(l*(o-y)+u*(g-a))/(x-m),F=(h*(o-y)+c*(g-a))/(m-x),L=[b,S,C,M,O,F];return new st(L)}toString(t=6){return this.matrix3d.is2D()?`matrix(${this.value.map(e=>jt(e,t)).join(",")})`:this.matrix3d.toString()}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix3D(),this}translateTo(t,e){return this.translate(t-this.m31,e-this.m32)}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.m32)}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.m31,t)}translateZ(t){return this.matrix3d.translate(0,0,t),this.matrix3d.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix3d.m43),this}translate3d(t,e,s){return this.matrix3d.translate(t,e,s),this.matrix3d.toMatrix(this),this}translate3dTo(t,e,s){return this.translate3d(t-this.matrix3d.m41,e-this.matrix3d.m42,s-this.matrix3d.m43),this}rotate(t,e=0,s=0){const n=N(t),r=Math.cos(n),a=Math.sin(n);return this.multiply([r,a,-a,r,e,s]),this.translate(-e,-s),this.toMatrix3D(),this}rotateTo(t,e=0,s=0){const{rotate:n}=this.split();return this.rotate(t-n,e,s),this}rotateX(t){return this.matrix3d.rotate(t,0,0),this.matrix3d.toMatrix(this),this}rotateXTo(t){const{rotateX:e}=this.matrix3d.split();return this.rotateX(t-e),this}rotateY(t){return this.matrix3d.rotate(0,t,0),this.matrix3d.toMatrix(this),this}rotateYTo(t){const{rotateY:e}=this.matrix3d.split();return this.rotateY(t-e),this}rotateZ(t){return this.matrix3d.rotate(0,0,t),this.matrix3d.toMatrix(this),this}rotateZTo(t){const{rotateZ:e}=this.matrix3d.split();return this.rotateZ(t-e),this}rotate3d(t,e,s){return this.matrix3d.rotate(t,e,s),this.matrix3d.toMatrix(this),this}rotate3dTo(t,e,s){const{rotateX:n,rotateY:r,rotateZ:a}=this.matrix3d.split();return this.rotate3d(t-n,e-r,s-a),this}scale(t,e=t,s=0,n=0){return this.multiply([t,0,0,e,s,n]),this.translate(-s,-n),this.toMatrix3D(),this}scaleTo(t,e=t,s=0,n=0){return this.scale(t/this.m11,e/this.m22,s,n)}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.m11,1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.m22)}scaleZ(t){return this.matrix3d.scale(1,1,t),this.matrix3d.toMatrix(this),this}scaleZTo(t){const{scaleZ:e}=this.matrix3d.split();return this.scaleZ(t/e),this}scale3d(t,e=t,s=t){return this.matrix3d.scale(t,e,s),this.matrix3d.toMatrix(this),this}scale3dTo(t,e=t,s=t){const{scaleX:n,scaleY:r,scaleZ:a}=this.matrix3d.split();return this.scale3d(t/n,e/r,s/a),this}skew(t,e=t){return this.multiply([Math.cos(N(e)),Math.sin(N(e)),-Math.sin(N(t)),Math.cos(N(t)),0,0]),this.toMatrix3D(),this}skewTo(t,e=t){const{skewX:s,skewY:n}=this.split();return this.skew(t-s,e-n)}skewX(t){const{skewY:e}=this.split();return this.skew(t,e)}skewXTo(t){const{skewY:e}=this.split();return this.skewTo(t,e)}skewY(t){const{skewX:e}=this.split();return this.skew(e,t)}skewYTo(t){const{skewX:e}=this.split();return this.skewTo(e,t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,s){return this}skew3dTo(t,e,s){return this}perspective(t){return this.matrix3d.perspective(t),this.matrix3d.toMatrix(this),this}}class At{value;is3dSpecial=!1;constructor(t=_n){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m14(){return this.value[3]}get m21(){return this.value[4]}get m22(){return this.value[5]}get m23(){return this.value[6]}get m24(){return this.value[7]}get m31(){return this.value[8]}get m32(){return this.value[9]}get m33(){return this.value[10]}get m34(){return this.value[11]}get m41(){return this.value[12]}get m42(){return this.value[13]}get m43(){return this.value[14]}get m44(){return this.value[15]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m14(t){this.value[3]=t}set m21(t){this.value[4]=t}set m22(t){this.value[5]=t}set m23(t){this.value[6]=t}set m24(t){this.value[7]=t}set m31(t){this.value[8]=t}set m32(t){this.value[9]=t}set m33(t){this.value[10]=t}set m34(t){this.value[11]=t}set m41(t){this.value[12]=t}set m42(t){this.value[13]=t}set m43(t){this.value[14]=t}set m44(t){this.value[15]=t}is2D(){return!this.is3dSpecial&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m43==0&&this.m44==1}is3D(){return!this.is2D()}identity(){return this.value=Array.from(_n),this}isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m14==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m24==0&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m41==0&&this.m42==0&&this.m43==0&&this.m44==1}clone(){const t=new At;return t.m11=this.m11,t.m12=this.m12,t.m13=this.m13,t.m14=this.m14,t.m21=this.m21,t.m22=this.m22,t.m23=this.m23,t.m24=this.m24,t.m31=this.m31,t.m32=this.m32,t.m33=this.m33,t.m34=this.m34,t.m41=this.m41,t.m42=this.m42,t.m43=this.m43,t.m44=this.m44,t}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m14*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m24*=t,this.m31*=t,this.m32*=t,this.m33*=t,this.m34*=t,this.m41*=t,this.m42*=t,this.m43*=t,this.m44*=t,this}normalize(){return this.scalar(1/(this.m44||1e-4))}applyToPoint(t){const e=t.x*this.m11+t.y*this.m21+t.z*this.m31+t.mass*this.m41,s=t.x*this.m12+t.y*this.m22+t.z*this.m32+t.mass*this.m42,n=t.x*this.m13+t.y*this.m23+t.z*this.m33+t.mass*this.m43,r=t.x*this.m14+t.y*this.m24+t.z*this.m34+t.mass*this.m44;t.x=e,t.y=s,t.z=n,t.mass=r}fromString(t){const e=sn("number",t);return e.length===16?e.forEach((s,n)=>{s.fullMatch&&(this.value[n]=parseFloat(s.fullMatch))}):this.identity(),this}toMatrix(t){const{scaleX:e,scaleY:s,skewX:n,skewY:r,x:a,y:o}=this.split(),h=[e,r,n,s,a,o];return t?(t.value=h,t):new st(h)}flatten(){return this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m14=0,this.m24=0,this.m43=0,this.m44=1,this}toString(t=6){return`matrix3d(${this.value.map(e=>jt(e,t)).join(",")})`}split(){const t=Math.sqrt(this.m11*this.m11+this.m12*this.m12+this.m13*this.m13),e=Math.sqrt(this.m21*this.m21+this.m22*this.m22+this.m23*this.m23),s=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33);let n=et(lt(Math.asin(-this.m13),-1,1)),r=et(Math.atan2(this.m23,this.m33));Math.cos(N(n))===0&&(r=et(Math.atan2(-this.m31,this.m22)));let a=et(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(a+=180),{x:this.m41,y:this.m42,z:this.m43,scaleX:t,scaleY:e,scaleZ:s,rotateX:r,rotateY:n,rotateZ:a,skewX:et(this.m14),skewY:et(this.m24),skewZ:et(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}inverse(){const t=[],e=this.m11,s=this.m12,n=this.m13,r=this.m14,a=this.m21,o=this.m22,h=this.m23,c=this.m24,l=this.m31,u=this.m32,g=this.m33,y=this.m34,m=this.m41,x=this.m42,b=this.m43,S=this.m44;t[0]=h*y*x-c*g*x+c*u*b-o*y*b-h*u*S+o*g*S,t[1]=r*g*x-n*y*x-r*u*b+s*y*b+n*u*S-s*g*S,t[2]=n*c*x-r*h*x+r*o*b-s*c*b-n*o*S+s*h*S,t[3]=r*h*u-n*c*u-r*o*g+s*c*g+n*o*y-s*h*y;const C=e*t[0]+a*t[1]+l*t[2]+m*t[3];if(C==0)return console.warn("Can't invert matrix, determinant is 0");t[4]=c*g*m-h*y*m-c*l*b+a*y*b+h*l*S-a*g*S,t[5]=n*y*m-r*g*m+r*l*b-e*y*b-n*l*S+e*g*S,t[6]=r*h*m-n*c*m-r*a*b+e*c*b+n*a*S-e*h*S,t[7]=n*c*l-r*h*l+r*a*g-e*c*g-n*a*y+e*h*y,t[8]=o*y*m-c*u*m+c*l*x-a*y*x-o*l*S+a*u*S,t[9]=r*u*m-s*y*m-r*l*x+e*y*x+s*l*S-e*u*S,t[10]=s*c*m-r*o*m+r*a*x-e*c*x-s*a*S+e*o*S,t[11]=r*o*l-s*c*l-r*a*u+e*c*u+s*a*y-e*o*y,t[12]=h*u*m-o*g*m-h*l*x+a*g*x+o*l*b-a*u*b,t[13]=s*g*m-n*u*m+n*l*x-e*g*x-s*l*b+e*u*b,t[14]=n*o*m-s*h*m-n*a*x+e*h*x+s*a*b-e*o*b,t[15]=s*h*l-n*o*l+n*a*u-e*h*u-s*a*g+e*o*g,this.value=t,this.scalar(1/C)}multiply(t){const e=this.clone(),s=t.m11*e.m11+t.m12*e.m21+t.m13*e.m31+t.m14*e.m41,n=t.m11*e.m12+t.m12*e.m22+t.m13*e.m32+t.m14*e.m42,r=t.m11*e.m13+t.m12*e.m23+t.m13*e.m33+t.m14*e.m43,a=t.m11*e.m14+t.m12*e.m24+t.m13*e.m34+t.m14*e.m44,o=t.m21*e.m11+t.m22*e.m21+t.m23*e.m31+t.m24*e.m41,h=t.m21*e.m12+t.m22*e.m22+t.m23*e.m32+t.m24*e.m42,c=t.m21*e.m13+t.m22*e.m23+t.m23*e.m33+t.m24*e.m43,l=t.m21*e.m14+t.m22*e.m24+t.m23*e.m34+t.m24*e.m44,u=t.m31*e.m11+t.m32*e.m21+t.m33*e.m31+t.m34*e.m41,g=t.m31*e.m12+t.m32*e.m22+t.m33*e.m32+t.m34*e.m42,y=t.m31*e.m13+t.m32*e.m23+t.m33*e.m33+t.m34*e.m43,m=t.m31*e.m14+t.m32*e.m24+t.m33*e.m34+t.m34*e.m44,x=t.m41*e.m11+t.m42*e.m21+t.m43*e.m31+t.m44*e.m41,b=t.m41*e.m12+t.m42*e.m22+t.m43*e.m32+t.m44*e.m42,S=t.m41*e.m13+t.m42*e.m23+t.m43*e.m33+t.m44*e.m43,C=t.m41*e.m14+t.m42*e.m24+t.m43*e.m34+t.m44*e.m44;return this.m11=s,this.m12=n,this.m13=r,this.m14=a,this.m21=o,this.m22=h,this.m23=c,this.m24=l,this.m31=u,this.m32=g,this.m33=y,this.m34=m,this.m41=x,this.m42=b,this.m43=S,this.m44=C,this}translate(t=0,e=0,s=0){return this.multiply(new At([1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1]))}scale(t=1,e=1,s=1){return this.multiply(new At([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}skew(t=0,e=0,s=0){return this.multiply(new At([1,0,0,N(t),0,1,0,N(e),0,0,1,N(s),0,0,0,1]))}rotate(t=0,e=0,s=0){s&&(this.is3dSpecial=!0);const n=N(t),r=N(e),a=N(s),o=Math.cos(n),h=Math.sin(n),c=Math.cos(r),l=Math.sin(r),u=Math.cos(a),g=Math.sin(a),y=o*u,m=o*g,x=h*u,b=h*g;return this.m11=c*u,this.m21=-c*g,this.m31=l,this.m12=m+x*l,this.m22=y-b*l,this.m32=-h*c,this.m13=b-y*l,this.m23=x+m*l,this.m33=o*c,this}perspective(t){return this.multiply(new At([1,0,0,0,0,1,0,0,0,0,1,t?-(1/t):0,0,0,0,1]))}unproject(t){let e=t.x*this.m11+t.y*this.m21+this.m41,s=t.x*this.m12+t.y*this.m22+this.m42,n=t.x*this.m13+t.y*this.m23+this.m43,r=t.x*this.m14+t.y*this.m24+this.m44,a=e+this.m31,o=s+this.m32,h=n+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,s/=r,n/=r,c==0&&(c=1e-4),a/=c,o/=c,h/=c;const l=h-n;if(l==0)return{x:e,y:s,z:n,mass:r};const u=-n/l;return e+=u*(a-e),s+=u*(o-s),{x:e,y:s,z:n,mass:r}}project(t){let e=t.z,s=t.x*this.m11+t.y*this.m21+e*this.m31+this.m41,n=t.x*this.m12+t.y*this.m22+e*this.m32+this.m42,r=t.x*this.m14+t.y*this.m24+e*this.m34+this.m44;return r==0&&(r=1e-4),s/=r,n/=r,r<0&&(s-=this.m41,n-=this.m42,s*=1/r,n*=1/r,s+=this.m41,n+=this.m42),{x:s,y:n,z:e,mass:r}}bounds(t,e,s,n){const r=new Qt({x:t,y:e}),a=new Qt({x:t+s,y:e}),o=new Qt({x:t+s,y:e+n}),h=new Qt({x:t,y:e+n});({x:r.x,y:r.y,z:r.z,mass:r.mass}=this.project(r)),{x:a.x,y:a.y,z:a.z,mass:a.mass}=this.project(a),{x:o.x,y:o.y,z:o.z,mass:o.mass}=this.project(o),{x:h.x,y:h.y,z:h.z,mass:h.mass}=this.project(h);const c=Math.min(r.x,a.x,o.x,h.x),l=Math.min(r.y,a.y,o.y,h.y),u=Math.max(r.x,a.x,o.x,h.x)-c,g=Math.max(r.y,a.y,o.y,h.y)-l;return new Q({x:c,y:l,width:u,height:g})}}function ni(i){const t=new st;return i.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,s,n){n.indexOf(",")>=0?n=n.split(/\s*,\s*/):n=n.split(/\s+/);const r=[];for(let a=0,o=n.length;a<o;a++)n[a].trim()&&r.push(parseFloat(""+n[a]));switch(s.toLowerCase()){case"t":case"translate":t.translate(r[0],r[1]);break;case"translatex":t.translateX(r[0]);break;case"translatey":t.translateY(r[0]);break;case"translatez":t.translateZ(r[0]);break;case"translate3d":t.translate3d(r[0],r[1],r[2]);break;case"r":case"rotate":t.rotate(r[0],r[1]??0,r[2]??0);break;case"rotatex":t.rotateX(r[0]);break;case"rotatey":t.rotateY(r[0]);break;case"rotatez":t.rotateZ(r[0]);break;case"rotate3d":t.rotate3d(r[0],r[1],r[2]);break;case"s":case"scale":t.scale(r[0],r[1]??r[0]);break;case"scalex":t.scaleX(r[0]);break;case"scaley":t.scaleY(r[0]);break;case"scalez":t.scaleZ(r[0]);break;case"scale3d":t.scale3d(r[0],r[1],r[2]);break;case"skew":t.skew(r[0],r[1]??0);break;case"skewx":t.skewX(r[0]);break;case"skewy":t.skewY(r[0]);break;case"skewz":t.skewZ(r[0]);break;case"skew3d":t.skew3d(r[0],r[1],r[2]);break;case"m":case"matrix":t.multiply([r[0],r[1],r[2],r[3],r[4],r[5]]),t.toMatrix3D();break;case"matrix3d":t.matrix3d.multiply(new At(r)),t.matrix3d.toMatrix(t);break}return""}),t}function Ct(i,t,e,s=0,n=0){const r=new st;return r.rotate(et(i),s,n),r.applyToPoint(t,e,s,n)}function ri(i){const{tx:t,ty:e,scaleX:s,scaleY:n,degree:r}=Hs(i||{},{tx:0,ty:0,scaleX:1,scaleY:1,degree:0}),a=new DOMMatrix([Math.cos(N(r))*s,Math.sin(N(r))*s,-Math.sin(N(r))*n,Math.cos(N(r))*n,t,e]);return a.multiplySelf(new DOMMatrix(i?.originMatrix)),a}function Co(i){let t,e,s,n=i.length,r=i[0].length;for(t=0;t<n-1;++t){let o=t;for(e=t+1;e<n;++e)Math.abs(i[e][t])>Math.abs(i[o][t])&&(o=e);let h=i[o];if(i[o]=i[t],i[t]=h,Math.abs(i[t][t])<=1e-10)return!1;for(e=t+1;e<n;++e){var a=i[e][t]/i[t][t];for(s=t;s<r;++s)i[e][s]-=i[t][s]*a}}for(t=n-1;t>=0;--t){for(a=i[t][t],e=0;e<t;++e)for(s=r-1;s>=t;--s)i[e][s]-=i[t][s]*i[e][t]/a;for(i[t][t]/=a,s=n;s<r;++s)i[t][s]/=a}return!0}function In(i,t){if(i.length!=t.length||i.length<1)throw new Error("Size missmatch: 'from' and 'to' must be of same size.");if(i[0].length!=t[0].length)throw new Error("Dimension missmatch: 'from' has the dimension "+i[0].length+" and 'to' "+t[0].length+".");if(i.length<i[0].length+1)throw new Error("Too few points: under-determined system, you need "+(i[0].length+1-i.length)+" more reference points for a 'overconstrained' system.");let e=i[0].length,s,n,r,a,o=[];for(s=0;s<e+1;++s)for(o[s]=[],n=0;n<e;++n)o[s][n]=0;for(s=0;s<e+1;++s)for(n=0;n<e;++n)for(r=0;r<i.length;++r)a=i[r].slice(),a.push(1),o[s][n]+=a[s]*t[r][n];let h=[];for(s=0;s<e+1;++s)for(h[s]=[],n=0;n<e+1;++n)h[s][n]=0;for(r=0;r<i.length;++r)for(a=i[r].slice(),a.push(1),s=0;s<e+1;++s)for(n=0;n<e+1;++n)h[s][n]+=a[s]*a[n];let c=[];for(s=0;s<e+1;++s)for(c[s]=h[s].slice(),n=0;n<e;++n)c[s].push(o[s][n]);if(!Co(c))throw new Error("Could not solve affine transformation. Singular matrix: points are probably coplanar.");let u=c.length,g=c[0].length-e;for(s=0;s<u;++s)c[s]=c[s].slice(g);return c}function To(i,t){if(i.length!=t.length||i.length<1)throw new Error("Size missmatch: 'from' and 'to' must be of same size.");const e=[],s=[],n=i.length;for(let o=0;o<n;++o)e.push([i[o].x,i[o].y]),s.push([t[o].x,t[o].y]);const r=In(e,s),a=new st;return a.m11=r[0][0],a.m12=r[0][1],a.m21=r[1][0],a.m22=r[1][1],a.m31=r[2][0],a.m32=r[2][1],a}function Eo(i,t){if(i.length!=t.length||i.length<1)throw new Error("Size missmatch: 'from' and 'to' must be of same size.");const e=[],s=[],n=i.length;for(let o=0;o<n;++o)e.push([i[o].x,i[o].y,i[o].z]),s.push([t[o].x,t[o].y,t[o].z]);const r=In(e,s),a=new At;return a.m11=r[0][0],a.m12=r[0][1],a.m13=r[0][2],a.m14=0,a.m21=r[1][0],a.m22=r[1][1],a.m23=r[1][2],a.m24=0,a.m31=r[2][0],a.m32=r[2][1],a.m33=r[2][2],a.m34=0,a.m41=r[3][0],a.m42=r[3][1],a.m43=r[3][2],a.m44=1,a}class D{static onDocumentReady(t){let e=!1;function s(){document.readyState==="loading"||e||(e=!0,t(),document.removeEventListener("DOMContentLoaded",s))}typeof document<"u"&&(document.addEventListener("DOMContentLoaded",s),s())}static onBeforeUnload(t){function e(){t(),document.removeEventListener("beforeunload",e)}typeof document<"u"&&document.addEventListener("beforeunload",e)}static getCSSVar(t){return getComputedStyle(document.documentElement).getPropertyValue(t)}static setCSSVar(t,e){document.documentElement.style.setProperty(t,e)}static add3DSupport(t,e="1000px"){if(t.parentElement){const s=D.getStyle(t.parentElement,"position");D.setStyle(t.parentElement,{position:s=="static"?"relative":s,perspective:e})}D.setStyle(t,{"transform-style":"preserve-3d"})}static convertAttrs(t,e,s={}){s.hasOwnProperty("transform")||Object.assign(s,{transform:D.getStyle(t,"transform")||""});const n=ni(s.transform),r={};for(let a in e){const o=e[a];switch(a){case"transform":break;case"translate":n.translate(o[0]||0,o[1]||0);break;case"translateTo":n.translateTo(o[0]||0,o[1]||0);break;case"translateX":n.translateX(o||0);break;case"translateXTo":n.translateXTo(o||0);break;case"translateY":n.translateY(o||0);break;case"translateYTo":n.translateYTo(o||0);break;case"translateZ":n.translateZ(o||0);break;case"translateZTo":n.translateZTo(o||0);break;case"translate3d":n.translate3d(o[0]||0,o[1]||0,o[2]||0);break;case"translate3dTo":n.translate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotate":typeof o=="number"?n.rotate(o||0):n.rotate(o[0]||0,o[1]||0,o[2]||0);break;case"rotateTo":typeof o=="number"?n.rotateTo(o||0):n.rotateTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotateX":n.rotateX(o||0);break;case"rotateXTo":n.rotateXTo(o||0);break;case"rotateY":n.rotateY(o||0);break;case"rotateYTo":n.rotateYTo(o||0);break;case"rotateZ":n.rotateZ(o||0);break;case"rotateZTo":n.rotateZTo(o||0);break;case"rotate3d":n.rotate3d(o[0]||0,o[1]||0,o[2]||0);break;case"rotate3dTo":n.rotate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"scale":typeof o=="number"?n.scale(o||1):n.scale(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleTo":typeof o=="number"?n.scaleTo(o||1):n.scaleTo(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleX":n.scaleX(o||1);break;case"scaleXTo":n.scaleXTo(o||1);break;case"scaleY":n.scaleY(o||1);break;case"scaleYTo":n.scaleYTo(o||1);break;case"scaleZ":n.scaleZ(o||1);break;case"scaleZTo":n.scaleZTo(o||1);break;case"scale3d":typeof o=="number"?n.scale3d(o||1):n.scale3d(o[0]||1,o[1]||1,o[2]||1);break;case"scale3dTo":typeof o=="number"?n.scale3dTo(o||1):n.scale3dTo(o[0]||1,o[1]||1,o[2]||1);break;case"skew":typeof o=="number"?n.skew(o||0):n.skew(o[0]||0,o[1]||0);break;case"skewTo":typeof o=="number"?n.skewTo(o||0):n.skewTo(o[0]||0,o[1]||0);break;case"skewX":n.skewX(o||0);break;case"skewXTo":n.skewXTo(o||0);break;case"skewY":n.skewY(o||0);break;case"skewYTo":n.skewYTo(o||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;case"perspective":n.perspective(o||0);break;default:s.hasOwnProperty(a)||(s[a]=D.getStyle(t,a)),Object.assign(r,{[a]:`${o}`});break}}return Object.assign(r,{transform:n.toString()}),r}static attrsToCanvas(t,e){for(const s in e){const n=e[s];switch(nt(s)){case"fill":n!=="none"&&(t.fillStyle=n);break;case"stroke":n!=="none"&&(t.strokeStyle=n);break;case"stroke-width":t.lineWidth=Number(n);break;case"stroke-linecap":t.lineCap=n;break;case"stroke-linejoin":switch(n){case"round":case"bevel":case"miter":t.lineJoin=n;break;default:t.lineJoin="miter";break}break;case"stroke-miterlimit":t.miterLimit=Number(n);break;case"stroke-opacity":break;case"stroke-dashoffset":t.lineDashOffset=Number(n);break;case"stroke-dasharray":typeof n=="string"&&t.setLineDash(n.split(/\s+/).map(r=>Number(r)));break;case"cursor":break;case"font":typeof n=="string"&&(t.font=n);break;case"font-size":t.font+=` ${n}`;break;case"font-family":t.font+=` ${n}`;break;case"font-weight":break;case"font-style":break;case"text-anchor":switch(n){case"middle":t.textAlign="center";break;case"end":t.textAlign="end";break;case"start":t.textAlign="start";break}break;case"alignment-baseline":switch(n){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":t.textBaseline=n;break;default:t.textBaseline="alphabetic";break}break}}}static getStyle(t,e,s){const n=t;if(getComputedStyle)if(e){e=nt(e);const r=getComputedStyle(n,s).getPropertyPriority(e);return getComputedStyle(n,s).getPropertyValue(e).trim()+(r?"!"+r:"")}else{const r=[],a=getComputedStyle(n,"");for(let o=0;o<a.length;o++)r.push(a[o]+":"+a.getPropertyValue(a[o]));return r.push(...(n.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(h=>h.trim()))||[])}else if(t.currentStyle){if(e)return e=an(e),t.currentStyle[e];{const r=[],a=n.currentStyle;for(let o in a)r.push(o+":"+a[o]);return r.push(...(n.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(h=>h.trim()))||[])}}}static setStyle(t,e,s){if(typeof e=="string"&&s){const n=String(s).toLowerCase().includes("!important")?"important":"";t.style.setProperty(nt(e),s.replace(/!important/i,""),n)}else e instanceof Object&&Object.keys(e).forEach(n=>{const r=String(e[n]).toLowerCase().includes("!important")?"important":"";t.style.setProperty(nt(n),String(e[n]).replace(/!important/i,""),r)})}static setStyleSheet(t,e){let s;if(typeof e=="string"){const r=document.querySelector(e)?.shadowRoot;r?s=r:s=document.querySelector(e)}else s=e;const n=document.createElement("style");if(n.innerHTML=t,s)return s.appendChild(n),()=>{(s instanceof HTMLElement||s instanceof ShadowRoot)&&s.removeChild(n)};{const r=document.styleSheets[0].insertRule(t);return()=>{document.styleSheets[0].deleteRule(r)}}}static toggleClass(t,e,s="toggle"){e.split(/[,\s]+/).forEach(n=>{n.trim()!==""&&t.classList[s](n.trim())})}static addClass(t,e){this.toggleClass(t,e,"add")}static removeClass(t,e){this.toggleClass(t,e,"remove")}static hasClass(t,e){return e.split(/[,\s]+/).every(s=>s.trim()!==""?Array.from(t.classList||[]).includes(s.trim()):!0)}static toggleDisplay(t,e){this.getStyle(t,"display")=="none"&&e===void 0||e===!0?t.style.setProperty("display",t instanceof HTMLTableRowElement?"table-row":t instanceof HTMLTableCellElement?"table-cell":"block"):t.style.setProperty("display","none")}static show(t){t.style.setProperty("display",t instanceof HTMLTableRowElement?"table-row":t instanceof HTMLTableCellElement?"table-cell":"block")}static hide(t){t.style.setProperty("display","none")}static origins=new es;static updates=new es;static attribute(t,e,s){let n={};if(e===void 0&&s===void 0){for(let r=0,a=t.attributes,o=a.length;r<o;r++){const h=a[r];h.nodeName&&h.nodeValue&&(n[h.nodeName]=h.nodeValue)}return n}if(typeof e=="string"&&s===void 0)return t.getAttribute(nt(e));typeof e=="object"?n=e:typeof e=="string"&&s!==void 0&&(n[e]=s),Object.entries(n).forEach(([r,a])=>{t.setAttribute(nt(r),a)})}static removeAttribute(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&t.removeAttribute(s.trim())})}static fixProp(t){const e={cellpadding:"cellPadding",cellspacing:"cellSpacing",class:"className",colspan:"colSpan",contenteditable:"contentEditable",for:"htmlFor",frameborder:"frameBorder",maxlength:"maxLength",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"};return e[t]?e[t]:t}static prop(t,e,s){if(s===void 0&&typeof e=="string")return t[e];{let n={};typeof e=="object"?n=e:typeof e=="string"&&s!==void 0&&(n[e]=s),Object.entries(n).forEach(([r,a])=>{const o=this.fixProp(r);t[o]=a,o=="innerHTML"&&this.scriptConvert(t)})}}static removeProp(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&delete t[this.fixProp(s.trim())]})}static data(t,e,s){if(typeof e=="string"&&(e=an(e)),(typeof e=="string"||e===void 0)&&s===void 0){const n=Object.assign({},t.dataset);return Object.keys(n).forEach(r=>{if(n[r]?.startsWith("[")||n[r]?.startsWith("{"))try{n[r]=JSON.parse(n[r]||"")}catch{}}),typeof e=="string"?n[e]:n}else{let n={};typeof e=="object"?n=e:typeof e=="string"&&(n[e]=s),Object.entries(n).forEach(([r,a])=>{a!=null?t.dataset[r]=a instanceof Object?JSON.stringify(a):a:delete t.dataset[r]})}}static removeData(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&delete t.dataset[s.trim()]})}static empty(t){this.html(t,"")}static html(t,e){e instanceof HTMLElement||e instanceof SVGElement?this.insert(t,e,"replaceWith"):this.prop(t,"innerHTML",e)}static text(t,e){return this.prop(t,"textContent",e)}static value(t,e){return this.prop(t,"value",e)}static dispatchEvent(t,e,s){let n;const r=["click","dblclick","mousedown","mouseup","mousemove"],a=["keydown","keyup","keypress"];typeof e=="string"?r.includes(e)?n=new MouseEvent(e,s):a.includes(e)?n=new KeyboardEvent(e,s):n=new Event(e,s):n=e,t.dispatchEvent(n)}static scriptConvert(t){const e=s=>{const r=s.ownerDocument.createElement("script");r.text=s.text;const a=s.attributes;for(let o=0;o<a.length;o++)r.setAttribute(a[o].name,a[o].value);return r};return t.tagName=="SCRIPT"&&(t=e(t)),t.querySelectorAll&&t.querySelectorAll("script").forEach(s=>{s.parentNode?.replaceChild(e(s),s)}),t}static insert(t,e,s="append"){return typeof e=="string"?t[s](this.fragment(e)):(e instanceof HTMLElement||e instanceof SVGElement)&&t[s](e),this}static createElement(t){return document.createElement.call(document,t)}static createTextNode(t){return document.createTextNode.call(document,t)}static createDocumentFragment(){return document.createDocumentFragment.call(document)}static fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(s=>{const n=this.scriptConvert(s);n!=s&&e.content.replaceChild(n,s)}),e.content}static remove(t){return t.remove()}static siblings=t=>Array.prototype.slice.call(t.parentElement?.children).filter(e=>e!==t);static nextElementSibling(t){return t.nextElementSibling}static previousElementSibling(t){return t.previousElementSibling}static closest(t,e){return t.closest(e)}static shadowRoot(t){return t.shadowRoot}static parentElement=t=>t.parentElement;static changeSelectSelected(t,e){if(t instanceof HTMLSelectElement){const s=t.options;for(let n=0,r=s.length;n<r;n++)s[n].value==e?s[n].selected=!0:s[n].selected=!1}}static changeRadioChecked(t,e){t instanceof HTMLInputElement&&(t.value==e?t.checked=!0:t.checked=!1)}static entity2text(t){const e={lt:60,"lt;":60,"AMP;":38,AMP:38,"GT;":62,GT:62,"QUOT;":34,QUOT:34,"apos;":39,"bull;":8226,"bullet;":8226,"copy;":169,copy:169,"deg;":176,deg:176};let s;return t.charAt(0)=="#"?t.charAt(1).toLowerCase()=="x"?s=parseInt(t.substring(2),16):s=parseInt(t.substring(1),10):s=e[t],s?String.fromCharCode(s):"&"+t}static waitForStyleSheetsLoaded=()=>new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let s=document.styleSheets.length||0;const n=()=>s>=e.length?(t(),!0):!1;n()||e.forEach(r=>{r.onload=()=>{s+=1,n()}})});static loadScript(t,e=()=>{},s=(n,r,a,o,h)=>{}){const n=document.createElement("script");n.type="text/javascript",n.src=t,n.async=!1,n.onload=e,n.onerror=s,document.body.appendChild(n)}static runInSafe(t){const e=new Proxy(window,{get(s,n,r){if(typeof n=="string"&&["open","location","document"].includes(n))throw new Error(`禁止访问 key: ${n}`);return n==="window"?e:Reflect.get(s,n,r)},set(s,n,r,a){return Reflect.set(s,n,r,a)}});new Function("window",`with(window) { ${t} }`)(e,null)}static dom=new Proxy({},{get(t,e){return function(s={},...n){const r=document.createElement(e);for(const a of Object.keys(s))r.setAttribute(a,s[a]);for(const a of n)typeof a=="string"?r.appendChild(document.createTextNode(a)):r.appendChild(a);return r}}});static compileTemplate(t){return t=t.replace(/<%=(.+?)%>/g,"`); \n echo( $1 ); \n echo(`").replace(/<%([\s\S]+?)%>/g,"`); \n $1 \n echo(`"),t="echo(`"+t+"`);",`(function parse(data){
|
|
12
12
|
let output = "";
|
|
13
13
|
function echo(html){
|
|
14
14
|
output += html;
|
|
15
15
|
}
|
|
16
16
|
${t}
|
|
17
17
|
return output;
|
|
18
|
-
})`}static escape(t,e="encode"){const s={"&":"&","<":"<",">":">",'"':""","'":"'"};for(const
|
|
18
|
+
})`}static escape(t,e="encode"){const s={"&":"&","<":"<",">":">",'"':""","'":"'"};for(const n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t=t.replace(new RegExp(e=="encode"?n:s[n],"g"),e=="encode"?s[n]:n));return t}static getInnerText=t=>{let e=t.innerText;if(!e){const s=t.querySelector("slot")?.assignedNodes()||[];let n=0;for(;!e&&n<=s.length-1;)"innerText"in s[n]&&(e=s[n].innerText),n++}return e};static copyToClipboard=t=>new Promise((e,s)=>{if(navigator.clipboard)navigator.clipboard.writeText(t).then(e).catch(s);else{const n=document.createElement("textarea");n.value=t,n.style.opacity="0",n.style.top="0",n.style.left="0",n.style.position="fixed",document.body.appendChild(n),n.focus(),n.select();try{document.execCommand("copy")?e():s()}catch(r){s(r)}document.body.removeChild(n)}});static scrollTo=(t,e)=>window.scrollTo(t,e);static setScrollRestoration(t){try{window.history.scrollRestoration=t}catch{}}static getLocation(){return new Promise((t,e)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(s=>{t(s.coords)}):e("Geolocation is not supported by this browser")})}static vibrate(t=200){"vibrate"in navigator?window.navigator.vibrate(t):console.error("Your device is not support vibrate on this browser.")}static getSelectedText=()=>window.getSelection()?.toString();static isElementFocus=t=>t===document.activeElement;static isTabInView=()=>!document.hidden;static navigateBack=()=>history.back();static navigateBack2=()=>history.go(-1);static iframePostMessage(t,e="http://test.com/localstorage.html"){const s=document.createElement("iframe");s.src=e,document.body.append(s),setTimeout(function(){s.contentWindow?.postMessage(t,e)},4e3),setTimeout(function(){s.remove()},6e3)}static measureText=(t,e=12,s=400)=>{const n=document.createElement("span");n.style.visibility="hidden",n.style.margin="0",n.style.padding="0",n.style.inset="0",n.style.whiteSpace="nowrap",n.style.overflow="visible",n.style.fontSize=e+"px",n.style.fontWeight=s.toString(),n.innerText=t,document.body.appendChild(n);const r=n.offsetWidth,a=n.offsetHeight;return document.body.removeChild(n),{width:r,height:a}};static getFixedWidthText=(t,e,s=12,n=400,r=!0)=>{let a="";if(!t||e<s)return a;const o=t.split(""),h="...";let c=r?D.measureText(h,s,n).width:0;for(let l=0,u=o.length;l<u;l++)if(c+=D.measureText(o[l],s,n).width,c>e){r&&(a+=h);break}else a+=o[l];return a}}function Po(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var On={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
19
19
|
* http://hammerjs.github.io/
|
|
20
20
|
*
|
|
21
21
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
22
|
-
* Licensed under the MIT license */(function(
|
|
22
|
+
* Licensed under the MIT license */(function(i){(function(t,e,s,n){var r=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),o="function",h=Math.round,c=Math.abs,l=Date.now;function u(f,d,w){return setTimeout(M(f,w),d)}function g(f,d,w){return Array.isArray(f)?(y(f,w[d],w),!0):!1}function y(f,d,w){var v;if(f)if(f.forEach)f.forEach(d,w);else if(f.length!==n)for(v=0;v<f.length;)d.call(w,f[v],v,f),v++;else for(v in f)f.hasOwnProperty(v)&&d.call(w,f[v],v,f)}function m(f,d,w){var v="DEPRECATED METHOD: "+d+`
|
|
23
23
|
`+w+` AT
|
|
24
|
-
`;return function(){var P=new Error("get-stack-trace"),I=P&&P.stack?P.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",N=t.console&&(t.console.warn||t.console.log);return N&&N.call(t.console,x,I),u.apply(this,arguments)}}var v;typeof Object.assign!="function"?v=function(d){if(d===i||d===null)throw new TypeError("Cannot convert undefined or null to object");for(var w=Object(d),x=1;x<arguments.length;x++){var P=arguments[x];if(P!==i&&P!==null)for(var I in P)P.hasOwnProperty(I)&&(w[I]=P[I])}return w}:v=Object.assign;var b=m(function(d,w,x){for(var P=Object.keys(w),I=0;I<P.length;)(!x||x&&d[P[I]]===i)&&(d[P[I]]=w[P[I]]),I++;return d},"extend","Use `assign`."),S=m(function(d,w){return b(d,w,!0)},"merge","Use `assign`.");function C(u,d,w){var x=d.prototype,P;P=u.prototype=Object.create(x),P.constructor=u,P._super=x,w&&v(P,w)}function k(u,d){return function(){return u.apply(d,arguments)}}function R(u,d){return typeof u==o?u.apply(d&&d[0]||i,d):u}function F(u,d){return u===i?d:u}function L(u,d,w){y(Y(d),function(x){u.addEventListener(x,w,!1)})}function j(u,d,w){y(Y(d),function(x){u.removeEventListener(x,w,!1)})}function Q(u,d){for(;u;){if(u==d)return!0;u=u.parentNode}return!1}function q(u,d){return u.indexOf(d)>-1}function Y(u){return u.trim().split(/\s+/g)}function H(u,d,w){if(u.indexOf&&!w)return u.indexOf(d);for(var x=0;x<u.length;){if(w&&u[x][w]==d||!w&&u[x]===d)return x;x++}return-1}function nt(u){return Array.prototype.slice.call(u,0)}function wt(u,d,w){for(var x=[],P=[],I=0;I<u.length;){var N=d?u[I][d]:u[I];H(P,N)<0&&x.push(u[I]),P[I]=N,I++}return w&&(d?x=x.sort(function(et,ot){return et[d]>ot[d]}):x=x.sort()),x}function ct(u,d){for(var w,x,P=d[0].toUpperCase()+d.slice(1),I=0;I<r.length;){if(w=r[I],x=w?w+P:d,x in u)return x;I++}return i}var fe=1;function _t(){return fe++}function Kt(u){var d=u.ownerDocument||u;return d.defaultView||d.parentWindow||t}var D=/mobile|tablet|ip(ad|hone|od)|android/i,M="ontouchstart"in t,_=ct(t,"PointerEvent")!==i,U=M&&D.test(navigator.userAgent),V="touch",vt="pen",Ht="mouse",Ul="kinect",Vl=25,at=1,Qt=2,$=4,ht=8,Ss=1,Be=2,Ue=4,Ve=8,Ge=16,Dt=Be|Ue,te=Ve|Ge,Dr=Dt|te,kr=["x","y"],Cs=["clientX","clientY"];function bt(u,d){var w=this;this.manager=u,this.callback=d,this.element=u.element,this.target=u.options.inputTarget,this.domHandler=function(x){R(u.options.enable,[u])&&w.handler(x)},this.init()}bt.prototype={handler:function(){},init:function(){this.evEl&&L(this.element,this.evEl,this.domHandler),this.evTarget&&L(this.target,this.evTarget,this.domHandler),this.evWin&&L(Kt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&j(this.element,this.evEl,this.domHandler),this.evTarget&&j(this.target,this.evTarget,this.domHandler),this.evWin&&j(Kt(this.element),this.evWin,this.domHandler)}};function Gl(u){var d,w=u.options.inputClass;return w?d=w:_?d=Tn:U?d=Ps:M?d=En:d=Es,new d(u,zl)}function zl(u,d,w){var x=w.pointers.length,P=w.changedPointers.length,I=d&at&&x-P===0,N=d&($|ht)&&x-P===0;w.isFirst=!!I,w.isFinal=!!N,I&&(u.session={}),w.eventType=d,jl(u,w),u.emit("hammer.input",w),u.recognize(w),u.session.prevInput=w}function jl(u,d){var w=u.session,x=d.pointers,P=x.length;w.firstInput||(w.firstInput=Ir(d)),P>1&&!w.firstMultiple?w.firstMultiple=Ir(d):P===1&&(w.firstMultiple=!1);var I=w.firstInput,N=w.firstMultiple,tt=N?N.center:I.center,et=d.center=Mr(x);d.timeStamp=l(),d.deltaTime=d.timeStamp-I.timeStamp,d.angle=Cn(tt,et),d.distance=Ts(tt,et),Xl(w,d),d.offsetDirection=Or(d.deltaX,d.deltaY);var ot=Rr(d.deltaTime,d.deltaX,d.deltaY);d.overallVelocityX=ot.x,d.overallVelocityY=ot.y,d.overallVelocity=h(ot.x)>h(ot.y)?ot.x:ot.y,d.scale=N?Hl(N.pointers,x):1,d.rotation=N?Yl(N.pointers,x):0,d.maxPointers=w.prevInput?d.pointers.length>w.prevInput.maxPointers?d.pointers.length:w.prevInput.maxPointers:d.pointers.length,ql(w,d);var It=u.element;Q(d.srcEvent.target,It)&&(It=d.srcEvent.target),d.target=It}function Xl(u,d){var w=d.center,x=u.offsetDelta||{},P=u.prevDelta||{},I=u.prevInput||{};(d.eventType===at||I.eventType===$)&&(P=u.prevDelta={x:I.deltaX||0,y:I.deltaY||0},x=u.offsetDelta={x:w.x,y:w.y}),d.deltaX=P.x+(w.x-x.x),d.deltaY=P.y+(w.y-x.y)}function ql(u,d){var w=u.lastInterval||d,x=d.timeStamp-w.timeStamp,P,I,N,tt;if(d.eventType!=ht&&(x>Vl||w.velocity===i)){var et=d.deltaX-w.deltaX,ot=d.deltaY-w.deltaY,It=Rr(x,et,ot);I=It.x,N=It.y,P=h(It.x)>h(It.y)?It.x:It.y,tt=Or(et,ot),u.lastInterval=d}else P=w.velocity,I=w.velocityX,N=w.velocityY,tt=w.direction;d.velocity=P,d.velocityX=I,d.velocityY=N,d.direction=tt}function Ir(u){for(var d=[],w=0;w<u.pointers.length;)d[w]={clientX:c(u.pointers[w].clientX),clientY:c(u.pointers[w].clientY)},w++;return{timeStamp:l(),pointers:d,center:Mr(d),deltaX:u.deltaX,deltaY:u.deltaY}}function Mr(u){var d=u.length;if(d===1)return{x:c(u[0].clientX),y:c(u[0].clientY)};for(var w=0,x=0,P=0;P<d;)w+=u[P].clientX,x+=u[P].clientY,P++;return{x:c(w/d),y:c(x/d)}}function Rr(u,d,w){return{x:d/u||0,y:w/u||0}}function Or(u,d){return u===d?Ss:h(u)>=h(d)?u<0?Be:Ue:d<0?Ve:Ge}function Ts(u,d,w){w||(w=kr);var x=d[w[0]]-u[w[0]],P=d[w[1]]-u[w[1]];return Math.sqrt(x*x+P*P)}function Cn(u,d,w){w||(w=kr);var x=d[w[0]]-u[w[0]],P=d[w[1]]-u[w[1]];return Math.atan2(P,x)*180/Math.PI}function Yl(u,d){return Cn(d[1],d[0],Cs)+Cn(u[1],u[0],Cs)}function Hl(u,d){return Ts(d[0],d[1],Cs)/Ts(u[0],u[1],Cs)}var Wl={mousedown:at,mousemove:Qt,mouseup:$},$l="mousedown",Jl="mousemove mouseup";function Es(){this.evEl=$l,this.evWin=Jl,this.pressed=!1,bt.apply(this,arguments)}C(Es,bt,{handler:function(d){var w=Wl[d.type];w&at&&d.button===0&&(this.pressed=!0),w&Qt&&d.which!==1&&(w=$),this.pressed&&(w&$&&(this.pressed=!1),this.callback(this.manager,w,{pointers:[d],changedPointers:[d],pointerType:Ht,srcEvent:d}))}});var Zl={pointerdown:at,pointermove:Qt,pointerup:$,pointercancel:ht,pointerout:ht},Kl={2:V,3:vt,4:Ht,5:Ul},Lr="pointerdown",Nr="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Lr="MSPointerDown",Nr="MSPointerMove MSPointerUp MSPointerCancel");function Tn(){this.evEl=Lr,this.evWin=Nr,bt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}C(Tn,bt,{handler:function(d){var w=this.store,x=!1,P=d.type.toLowerCase().replace("ms",""),I=Zl[P],N=Kl[d.pointerType]||d.pointerType,tt=N==V,et=H(w,d.pointerId,"pointerId");I&at&&(d.button===0||tt)?et<0&&(w.push(d),et=w.length-1):I&($|ht)&&(x=!0),!(et<0)&&(w[et]=d,this.callback(this.manager,I,{pointers:w,changedPointers:[d],pointerType:N,srcEvent:d}),x&&w.splice(et,1))}});var Ql={touchstart:at,touchmove:Qt,touchend:$,touchcancel:ht},tu="touchstart",eu="touchstart touchmove touchend touchcancel";function Fr(){this.evTarget=tu,this.evWin=eu,this.started=!1,bt.apply(this,arguments)}C(Fr,bt,{handler:function(d){var w=Ql[d.type];if(w===at&&(this.started=!0),!!this.started){var x=su.call(this,d,w);w&($|ht)&&x[0].length-x[1].length===0&&(this.started=!1),this.callback(this.manager,w,{pointers:x[0],changedPointers:x[1],pointerType:V,srcEvent:d})}}});function su(u,d){var w=nt(u.touches),x=nt(u.changedTouches);return d&($|ht)&&(w=wt(w.concat(x),"identifier",!0)),[w,x]}var nu={touchstart:at,touchmove:Qt,touchend:$,touchcancel:ht},iu="touchstart touchmove touchend touchcancel";function Ps(){this.evTarget=iu,this.targetIds={},bt.apply(this,arguments)}C(Ps,bt,{handler:function(d){var w=nu[d.type],x=ru.call(this,d,w);x&&this.callback(this.manager,w,{pointers:x[0],changedPointers:x[1],pointerType:V,srcEvent:d})}});function ru(u,d){var w=nt(u.touches),x=this.targetIds;if(d&(at|Qt)&&w.length===1)return x[w[0].identifier]=!0,[w,w];var P,I,N=nt(u.changedTouches),tt=[],et=this.target;if(I=w.filter(function(ot){return Q(ot.target,et)}),d===at)for(P=0;P<I.length;)x[I[P].identifier]=!0,P++;for(P=0;P<N.length;)x[N[P].identifier]&&tt.push(N[P]),d&($|ht)&&delete x[N[P].identifier],P++;if(tt.length)return[wt(I.concat(tt),"identifier",!0),tt]}var au=2500,Br=25;function En(){bt.apply(this,arguments);var u=k(this.handler,this);this.touch=new Ps(this.manager,u),this.mouse=new Es(this.manager,u),this.primaryTouch=null,this.lastTouches=[]}C(En,bt,{handler:function(d,w,x){var P=x.pointerType==V,I=x.pointerType==Ht;if(!(I&&x.sourceCapabilities&&x.sourceCapabilities.firesTouchEvents)){if(P)ou.call(this,w,x);else if(I&&cu.call(this,x))return;this.callback(d,w,x)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function ou(u,d){u&at?(this.primaryTouch=d.changedPointers[0].identifier,Ur.call(this,d)):u&($|ht)&&Ur.call(this,d)}function Ur(u){var d=u.changedPointers[0];if(d.identifier===this.primaryTouch){var w={x:d.clientX,y:d.clientY};this.lastTouches.push(w);var x=this.lastTouches,P=function(){var I=x.indexOf(w);I>-1&&x.splice(I,1)};setTimeout(P,au)}}function cu(u){for(var d=u.srcEvent.clientX,w=u.srcEvent.clientY,x=0;x<this.lastTouches.length;x++){var P=this.lastTouches[x],I=Math.abs(d-P.x),N=Math.abs(w-P.y);if(I<=Br&&N<=Br)return!0}return!1}var Vr=ct(a.style,"touchAction"),Gr=Vr!==i,zr="compute",jr="auto",Pn="manipulation",ee="none",ze="pan-x",je="pan-y",As=lu();function An(u,d){this.manager=u,this.set(d)}An.prototype={set:function(u){u==zr&&(u=this.compute()),Gr&&this.manager.element.style&&As[u]&&(this.manager.element.style[Vr]=u),this.actions=u.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var u=[];return y(this.manager.recognizers,function(d){R(d.options.enable,[d])&&(u=u.concat(d.getTouchAction()))}),hu(u.join(" "))},preventDefaults:function(u){var d=u.srcEvent,w=u.offsetDirection;if(this.manager.session.prevented){d.preventDefault();return}var x=this.actions,P=q(x,ee)&&!As[ee],I=q(x,je)&&!As[je],N=q(x,ze)&&!As[ze];if(P){var tt=u.pointers.length===1,et=u.distance<2,ot=u.deltaTime<250;if(tt&&et&&ot)return}if(!(N&&I)&&(P||I&&w&Dt||N&&w&te))return this.preventSrc(d)},preventSrc:function(u){this.manager.session.prevented=!0,u.preventDefault()}};function hu(u){if(q(u,ee))return ee;var d=q(u,ze),w=q(u,je);return d&&w?ee:d||w?d?ze:je:q(u,Pn)?Pn:jr}function lu(){if(!Gr)return!1;var u={},d=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(w){u[w]=d?t.CSS.supports("touch-action",w):!0}),u}var _s=1,xt=2,de=4,Wt=8,Ft=Wt,Xe=16,kt=32;function Bt(u){this.options=v({},this.defaults,u||{}),this.id=_t(),this.manager=null,this.options.enable=F(this.options.enable,!0),this.state=_s,this.simultaneous={},this.requireFail=[]}Bt.prototype={defaults:{},set:function(u){return v(this.options,u),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(u){if(g(u,"recognizeWith",this))return this;var d=this.simultaneous;return u=Ds(u,this),d[u.id]||(d[u.id]=u,u.recognizeWith(this)),this},dropRecognizeWith:function(u){return g(u,"dropRecognizeWith",this)?this:(u=Ds(u,this),delete this.simultaneous[u.id],this)},requireFailure:function(u){if(g(u,"requireFailure",this))return this;var d=this.requireFail;return u=Ds(u,this),H(d,u)===-1&&(d.push(u),u.requireFailure(this)),this},dropRequireFailure:function(u){if(g(u,"dropRequireFailure",this))return this;u=Ds(u,this);var d=H(this.requireFail,u);return d>-1&&this.requireFail.splice(d,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(u){return!!this.simultaneous[u.id]},emit:function(u){var d=this,w=this.state;function x(P){d.manager.emit(P,u)}w<Wt&&x(d.options.event+Xr(w)),x(d.options.event),u.additionalEvent&&x(u.additionalEvent),w>=Wt&&x(d.options.event+Xr(w))},tryEmit:function(u){if(this.canEmit())return this.emit(u);this.state=kt},canEmit:function(){for(var u=0;u<this.requireFail.length;){if(!(this.requireFail[u].state&(kt|_s)))return!1;u++}return!0},recognize:function(u){var d=v({},u);if(!R(this.options.enable,[this,d])){this.reset(),this.state=kt;return}this.state&(Ft|Xe|kt)&&(this.state=_s),this.state=this.process(d),this.state&(xt|de|Wt|Xe)&&this.tryEmit(d)},process:function(u){},getTouchAction:function(){},reset:function(){}};function Xr(u){return u&Xe?"cancel":u&Wt?"end":u&de?"move":u&xt?"start":""}function qr(u){return u==Ge?"down":u==Ve?"up":u==Be?"left":u==Ue?"right":""}function Ds(u,d){var w=d.manager;return w?w.get(u):u}function Et(){Bt.apply(this,arguments)}C(Et,Bt,{defaults:{pointers:1},attrTest:function(u){var d=this.options.pointers;return d===0||u.pointers.length===d},process:function(u){var d=this.state,w=u.eventType,x=d&(xt|de),P=this.attrTest(u);return x&&(w&ht||!P)?d|Xe:x||P?w&$?d|Wt:d&xt?d|de:xt:kt}});function ks(){Et.apply(this,arguments),this.pX=null,this.pY=null}C(ks,Et,{defaults:{event:"pan",threshold:10,pointers:1,direction:Dr},getTouchAction:function(){var u=this.options.direction,d=[];return u&Dt&&d.push(je),u&te&&d.push(ze),d},directionTest:function(u){var d=this.options,w=!0,x=u.distance,P=u.direction,I=u.deltaX,N=u.deltaY;return P&d.direction||(d.direction&Dt?(P=I===0?Ss:I<0?Be:Ue,w=I!=this.pX,x=Math.abs(u.deltaX)):(P=N===0?Ss:N<0?Ve:Ge,w=N!=this.pY,x=Math.abs(u.deltaY))),u.direction=P,w&&x>d.threshold&&P&d.direction},attrTest:function(u){return Et.prototype.attrTest.call(this,u)&&(this.state&xt||!(this.state&xt)&&this.directionTest(u))},emit:function(u){this.pX=u.deltaX,this.pY=u.deltaY;var d=qr(u.direction);d&&(u.additionalEvent=this.options.event+d),this._super.emit.call(this,u)}});function _n(){Et.apply(this,arguments)}C(_n,Et,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ee]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.scale-1)>this.options.threshold||this.state&xt)},emit:function(u){if(u.scale!==1){var d=u.scale<1?"in":"out";u.additionalEvent=this.options.event+d}this._super.emit.call(this,u)}});function Dn(){Bt.apply(this,arguments),this._timer=null,this._input=null}C(Dn,Bt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[jr]},process:function(u){var d=this.options,w=u.pointers.length===d.pointers,x=u.distance<d.threshold,P=u.deltaTime>d.time;if(this._input=u,!x||!w||u.eventType&($|ht)&&!P)this.reset();else if(u.eventType&at)this.reset(),this._timer=f(function(){this.state=Ft,this.tryEmit()},d.time,this);else if(u.eventType&$)return Ft;return kt},reset:function(){clearTimeout(this._timer)},emit:function(u){this.state===Ft&&(u&&u.eventType&$?this.manager.emit(this.options.event+"up",u):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function kn(){Et.apply(this,arguments)}C(kn,Et,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ee]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.rotation)>this.options.threshold||this.state&xt)}});function In(){Et.apply(this,arguments)}C(In,Et,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Dt|te,pointers:1},getTouchAction:function(){return ks.prototype.getTouchAction.call(this)},attrTest:function(u){var d=this.options.direction,w;return d&(Dt|te)?w=u.overallVelocity:d&Dt?w=u.overallVelocityX:d&te&&(w=u.overallVelocityY),this._super.attrTest.call(this,u)&&d&u.offsetDirection&&u.distance>this.options.threshold&&u.maxPointers==this.options.pointers&&h(w)>this.options.velocity&&u.eventType&$},emit:function(u){var d=qr(u.offsetDirection);d&&this.manager.emit(this.options.event+d,u),this.manager.emit(this.options.event,u)}});function Is(){Bt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}C(Is,Bt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Pn]},process:function(u){var d=this.options,w=u.pointers.length===d.pointers,x=u.distance<d.threshold,P=u.deltaTime<d.time;if(this.reset(),u.eventType&at&&this.count===0)return this.failTimeout();if(x&&P&&w){if(u.eventType!=$)return this.failTimeout();var I=this.pTime?u.timeStamp-this.pTime<d.interval:!0,N=!this.pCenter||Ts(this.pCenter,u.center)<d.posThreshold;this.pTime=u.timeStamp,this.pCenter=u.center,!N||!I?this.count=1:this.count+=1,this._input=u;var tt=this.count%d.taps;if(tt===0)return this.hasRequireFailures()?(this._timer=f(function(){this.state=Ft,this.tryEmit()},d.interval,this),xt):Ft}return kt},failTimeout:function(){return this._timer=f(function(){this.state=kt},this.options.interval,this),kt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Ft&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Ut(u,d){return d=d||{},d.recognizers=F(d.recognizers,Ut.defaults.preset),new Mn(u,d)}Ut.VERSION="2.0.7",Ut.defaults={domEvents:!1,touchAction:zr,enable:!0,inputTarget:null,inputClass:null,preset:[[kn,{enable:!1}],[_n,{enable:!1},["rotate"]],[In,{direction:Dt}],[ks,{direction:Dt},["swipe"]],[Is],[Is,{event:"doubletap",taps:2},["tap"]],[Dn]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var uu=1,Yr=2;function Mn(u,d){this.options=v({},Ut.defaults,d||{}),this.options.inputTarget=this.options.inputTarget||u,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=u,this.input=Gl(this),this.touchAction=new An(this,this.options.touchAction),Hr(this,!0),y(this.options.recognizers,function(w){var x=this.add(new w[0](w[1]));w[2]&&x.recognizeWith(w[2]),w[3]&&x.requireFailure(w[3])},this)}Mn.prototype={set:function(u){return v(this.options,u),u.touchAction&&this.touchAction.update(),u.inputTarget&&(this.input.destroy(),this.input.target=u.inputTarget,this.input.init()),this},stop:function(u){this.session.stopped=u?Yr:uu},recognize:function(u){var d=this.session;if(!d.stopped){this.touchAction.preventDefaults(u);var w,x=this.recognizers,P=d.curRecognizer;(!P||P&&P.state&Ft)&&(P=d.curRecognizer=null);for(var I=0;I<x.length;)w=x[I],d.stopped!==Yr&&(!P||w==P||w.canRecognizeWith(P))?w.recognize(u):w.reset(),!P&&w.state&(xt|de|Wt)&&(P=d.curRecognizer=w),I++}},get:function(u){if(u instanceof Bt)return u;for(var d=this.recognizers,w=0;w<d.length;w++)if(d[w].options.event==u)return d[w];return null},add:function(u){if(g(u,"add",this))return this;var d=this.get(u.options.event);return d&&this.remove(d),this.recognizers.push(u),u.manager=this,this.touchAction.update(),u},remove:function(u){if(g(u,"remove",this))return this;if(u=this.get(u),u){var d=this.recognizers,w=H(d,u);w!==-1&&(d.splice(w,1),this.touchAction.update())}return this},on:function(u,d){if(u!==i&&d!==i){var w=this.handlers;return y(Y(u),function(x){w[x]=w[x]||[],w[x].push(d)}),this}},off:function(u,d){if(u!==i){var w=this.handlers;return y(Y(u),function(x){d?w[x]&&w[x].splice(H(w[x],d),1):delete w[x]}),this}},emit:function(u,d){this.options.domEvents&&fu(u,d);var w=this.handlers[u]&&this.handlers[u].slice();if(!(!w||!w.length)){d.type=u,d.preventDefault=function(){d.srcEvent.preventDefault()};for(var x=0;x<w.length;)w[x](d),x++}},destroy:function(){this.element&&Hr(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Hr(u,d){var w=u.element;if(w.style){var x;y(u.options.cssProps,function(P,I){x=ct(w.style,I),d?(u.oldCssProps[x]=w.style[x],w.style[x]=P):w.style[x]=u.oldCssProps[x]||""}),d||(u.oldCssProps={})}}function fu(u,d){var w=e.createEvent("Event");w.initEvent(u,!0,!0),w.gesture=d,d.target.dispatchEvent(w)}v(Ut,{INPUT_START:at,INPUT_MOVE:Qt,INPUT_END:$,INPUT_CANCEL:ht,STATE_POSSIBLE:_s,STATE_BEGAN:xt,STATE_CHANGED:de,STATE_ENDED:Wt,STATE_RECOGNIZED:Ft,STATE_CANCELLED:Xe,STATE_FAILED:kt,DIRECTION_NONE:Ss,DIRECTION_LEFT:Be,DIRECTION_RIGHT:Ue,DIRECTION_UP:Ve,DIRECTION_DOWN:Ge,DIRECTION_HORIZONTAL:Dt,DIRECTION_VERTICAL:te,DIRECTION_ALL:Dr,Manager:Mn,Input:bt,TouchAction:An,TouchInput:Ps,MouseInput:Es,PointerEventInput:Tn,TouchMouseInput:En,SingleTouchInput:Fr,Recognizer:Bt,AttrRecognizer:Et,Tap:Is,Pan:ks,Swipe:In,Pinch:_n,Rotate:kn,Press:Dn,on:L,off:j,each:y,merge:S,extend:b,assign:v,inherit:C,bindFn:k,prefixed:ct});var du=typeof t<"u"?t:typeof self<"u"?self:{};du.Hammer=Ut,typeof i=="function"&&i.amd?i(function(){return Ut}):n.exports?n.exports=Ut:t[s]=Ut})(window,document,"Hammer")})(li);var qa=li.exports;const Ya=Xa(qa),we=Math.PI*2;function ui(n,t,e,s){const i=n*s-t*e<0?-1:1;let r=n*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function Ha(n,t,e,s,i,r,a,o,c,h){const l=h*(n-e)/2+c*(t-s)/2,f=-c*(n-e)/2+h*(t-s)/2,g=a*a,y=o*o,m=l*l,v=f*f;let b=g*y-g*v-y*m;b<0&&(b=0),b/=g*v+y*m,b=Math.sqrt(b)*(i===r?-1:1);const S=b*a/o*f,C=b*-o/a*l,k=h*S-c*C+(n+e)/2,R=c*S+h*C+(t+s)/2,F=(l-S)/a,L=(f-C)/o,j=(-l-S)/a,Q=(-f-C)/o,q=ui(1,0,F,L);let Y=ui(F,L,j,Q);return r===0&&Y>0&&(Y-=we),r===1&&Y<0&&(Y+=we),[k,R,q,Y]}function Wa(n,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(n),i=Math.sin(n),r=Math.cos(n+t),a=Math.sin(n+t);return[s,i,s-i*e,i+s*e,r+a*e,a-r*e,r,a]}function fi(n,t,e,s,i,r,a,o,c){const h=Math.sin(c*we/360),l=Math.cos(c*we/360),f=l*(n-e)/2+h*(t-s)/2,g=-h*(n-e)/2+l*(t-s)/2;if(f===0&&g===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const y=f*f/(a*a)+g*g/(o*o);y>1&&(a*=Math.sqrt(y),o*=Math.sqrt(y));const m=Ha(n,t,e,s,i,r,a,o,h,l),v=[];let b=m[2],S=m[3];const C=Math.max(Math.ceil(Math.abs(S)/(we/4)),1);S/=C;for(let k=0;k<C;k++)v.push(Wa(b,S)),b+=S;return v.map(k=>{for(let R=0;R<k.length;R+=2){let F=k[R+0],L=k[R+1];F*=a,L*=o;const j=l*F-h*L,Q=h*F+l*L;k[R+0]=j+m[0],k[R+1]=Q+m[1]}return k})}function Xs(n,t,e,s,i,r){return[n/3+2/3*e,t/3+2/3*s,i/3+2/3*e,r/3+2/3*s,i,r]}function ve(n,t,e,s){return[n,t,e,s,e,s]}const be={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class ne{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&A.attribute(s,e),s}static createSvgPath(t){return this.createSVGElement("path",{d:t})}static downloadFromSVGElement(t,e="shape"){return Bs(qn(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return Bs(Ns(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return Fs(t)}static isSVGPath(t){return typeof t!="string"?!1:(t=t.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(t)&&/[\dz]$/i.test(t))}static SVGPathDataToD(t){return t.map(e=>{if(!e[0])return"";switch(e[0].toLowerCase()){case"a":return`${e[0]} ${e[1]},${e[2]} ${e[3]} ${e[4]},${e[5]} ${e[6]},${e[7]}`;case"c":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]} ${e[5]},${e[6]}`;case"s":case"q":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]}`;default:return e[0]+" "+e.slice(1).join(",")}}).join(" ")}static parseSVGPath(t){const e=[];return t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,i,r)=>{let a=i.toLowerCase();const o=jn(r);for(a=="m"&&o.length>be[a]&&(e.push([i,...o.splice(0,be[a])]),a="l",i=i=="m"?"l":"L");o.length;){if(o.length<be[a])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${i} } args:{ ${o} }`);e.push([i,...o.splice(0,be[a])])}return a=="z"&&e.push([i]),""}),e}static absolutizeSVGPath(t){let e=0,s=0,i=0,r=0;return t.map(function(a){const o=a[0],c=o.toUpperCase();if(o!=c)switch(a[0]=c,o){case"a":a[6]+=i,a[7]+=r;break;case"v":a[1]+=r;break;case"h":a[1]+=i;break;default:for(let h=1;h<a.length;)a[h++]+=i,a[h++]+=r}switch(c){case"Z":i=e,r=s;break;case"H":i=a[1];break;case"V":r=a[1];break;case"M":i=e=a[1],r=s=a[2];break;default:i=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,s=0,i=0,r=0;return t.map(function(a){const o=a[0],c=o.toLowerCase();if(o!=c)switch(a[0]=c,o){case"A":a[6]-=i,a[7]-=r;break;case"V":a[1]-=r;break;case"H":a[1]-=i;break;default:for(let h=1;h<a.length;)a[h++]-=i,a[h++]-=r}switch(c){case"z":i=e,r=s;break;case"h":i+=a[1];break;case"v":r+=a[1];break;case"m":i+=a[1],r+=a[2],e+=a[1],s+=a[2];break;default:i+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){let e=[],s=0,i=0,r=0,a=0,o=0,c=0,h=0,l=0,f;for(let g=0,y=t.length;g<y;g++){let m=t[g];const v=m[0];switch(v){case"M":s=m[1],i=m[2];break;case"A":const b=fi(r,a,m[6],m[7],m[4],m[5],m[1],m[2],m[3]);if(!b.length)continue;b.forEach((k,R)=>{const[F,L,j,Q,q,Y,H,nt]=k;m=["C",j,Q,q,Y,H,nt],R<b.length-1&&e.push(m)});break;case"S":let S=r,C=a;(f=="C"||f=="S")&&(S+=S-h,C+=C-l),m=["C",S,C,m[1],m[2],m[3],m[4]];break;case"T":f=="Q"||f=="T"?(o=r*2-o,c=a*2-c):(o=r,c=a),m=["C",...Xs(r,a,o,c,m[1],m[2])];break;case"Q":o=m[1],c=m[2],m=["C",...Xs(r,a,m[1],m[2],m[3],m[4])];break;case"L":m=["C",...ve(r,a,m[1],m[2])];break;case"H":m=["C",...ve(r,a,m[1],a)];break;case"V":m=["C",...ve(r,a,r,m[1])];break;case"Z":m=["C",...ve(r,a,s,i)];break}f=v,r=m[m.length-2],a=m[m.length-1],m.length>4?(h=m[m.length-4],l=m[m.length-3]):(h=r,l=a),e.push(m)}return e}static catmullRom2bezier(t){let e=[];for(let s=0,i=t.length;i-2>s;s+=2){let r;s==0?r=[{x:t[s],y:t[s+1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}]:i-4==s?r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+2],y:t[s+3]}]:r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}];const a=[{x:r[1].x,y:r[1].y},{x:(-r[0].x+6*r[1].x+r[2].x)/6,y:(-r[0].y+6*r[1].y+r[2].y)/6},{x:(r[1].x+6*r[2].x-r[3].x)/6,y:(r[1].y+6*r[2].y-r[3].y)/6},{x:r[2].x,y:r[2].y}];e.push(["C",a[1].x,a[1].y,a[2].x,a[2].y,a[3].x,a[3].y])}return e}static zvhToLSVGPath(t){let e=[],s=["L",0,0],i;for(let r=0,a=t.length;r<a;r++){let o=t[r];switch(o[0]){case"M":s=["L",o[1],o[2]],e.push(o);break;case"Z":e.push(s);break;case"H":i=e[e.length-1]||["L",0,0],e.push(["L",o[1],i[i.length-1]]);break;case"V":i=e[e.length-1]||["L",0,0],e.push(["L",i[i.length-2],o[1]]);break;default:e.push(o)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let s,i=0,r=0;for(let a=0,o=t.length;a<o;a++){const c=t[a],h=e[c[0]];h&&(c[0]=h.to,s&&(s[0]===h.to?(i=2*Number(s[h.x+2])-Number(s[h.x]),r=2*Number(s[h.x+3])-Number(s[h.x+1])):(i=Number(s[s.length-2]),r=Number(s[s.length-1]))),c.splice(1,0,i,r)),s=c}return t}static curveDim(t,e,s,i,r,a,o,c){const h=[],l=[[],[]];let f,g,y,m,v,b,S,C;for(let L=0;L<2;++L){if(L===0?(g=6*t-12*s+6*r,f=-3*t+9*s-9*r+3*o,y=3*s-3*t):(g=6*e-12*i+6*a,f=-3*e+9*i-9*a+3*c,y=3*i-3*e),Math.abs(f)<1e-12){if(Math.abs(g)<1e-12)continue;m=-y/g,m>0&&m<1&&h.push(m);continue}S=g*g-4*y*f,C=Math.sqrt(S),!(S<0)&&(v=(-g+C)/(2*f),v>0&&v<1&&h.push(v),b=(-g-C)/(2*f),b>0&&b<1&&h.push(b))}let k=h.length,R;const F=k;for(;k--;)m=h[k],R=1-m,l[0][k]=R*R*R*t+3*R*R*m*s+3*R*m*m*r+m*m*m*o,l[1][k]=R*R*R*e+3*R*R*m*i+3*R*m*m*a+m*m*m*c;return l[0][F]=t,l[1][F]=e,l[0][F+1]=o,l[1][F+1]=c,l[0].length=l[1].length=F+2,{min:{x:Math.min.apply(0,l[0]),y:Math.min.apply(0,l[1])},max:{x:Math.max.apply(0,l[0]),y:Math.max.apply(0,l[1])}}}static base3(t,e,s,i,r){const a=-3*e+9*s-9*i+3*r,o=t*a+6*e-12*s+6*i;return t*o-3*e+3*s}static bezlen(t,e,s,i,r,a,o,c,h=1){h=Math.max(0,Math.min(h,1));const l=h/2,f=12,g=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],y=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let m=0;for(let v=0;v<f;v++){const b=l*g[v]+l,S=this.base3(b,t,s,r,o),C=this.base3(b,e,i,a,c),k=S*S+C*C;m+=y[v]*Math.sqrt(k)}return l*m}}const G=ne;class X extends Os{id;x;prevX;y;prevY;degree;prevDegree;scaleOnOrigin;prevScaleOnOrigin;skewDegreeOnOrigin;prevSkewDegreeOnOrigin;vx;vy;ax;ay;mass;attrs;enableDrag;isDragging=!1;isMouseIn=!1;targetToAfterDragFree;followMouse;isShow=!0;now=new Date().getTime();frameRate=60;strokeArmyAnts;strokeArmyAntsOffset=0;history=[];path2d=new Path2D;el;pathd;constructor(t){super(),this.id=Jr(),this.prevX=this.x=t?.x||0,this.prevY=this.y=t?.y||0,this.prevDegree=this.degree=t?.degree||0,this.prevScaleOnOrigin=this.scaleOnOrigin=t?.scaleOnOrigin||1,this.prevSkewDegreeOnOrigin=this.skewDegreeOnOrigin=t?.skewDegreeOnOrigin||0,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||0,this.attrs=Object.assign({paintOrder:"stroke",stroke:"none",fill:"none"},Object.fromEntries(Object.entries(t?.attrs||{}).map(([e,s])=>[it(e),s]))),this.enableDrag=t?.enableDrag||!1,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.strokeArmyAnts=t?.strokeArmyAnts||!1}save(){this.history.push(zn(this))}restore(){const t=this.history.pop();t&&aa(this,t)}setAttr(t,e){He(t)?Object.assign(this.attrs,Object.fromEntries(Object.entries(t).map(([s,i])=>[it(s),i]))):typeof t=="string"&&e&&(this.attrs[it(t)]=e)}getAttr(t,e){return this.attrs[it(t)]||e}hasAttr(t){return!!this.attrs[it(t)]}get centerX(){const t=this.getBoundingClientRect();return t?t.x+t.width/2:this.x}get centerY(){const t=this.getBoundingClientRect();return t?t.y+t.height/2:this.y}get centerDiff(){return{dx:this.centerX-this.x,dy:this.centerY-this.y}}getBoundingClientRect(){return null}frameUpdate(){const t=new Date().getTime();if(!(t-this.now<1e3/this.frameRate)&&(this.now=t,this.strokeArmyAnts&&!this.isMouseIn)){const e=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",e);const s=jn(e);this.setAttr("stroke-dashoffset",String(this.strokeArmyAntsOffset++)),this.strokeArmyAntsOffset>s.reduce((i,r)=>i+r,0)&&(this.strokeArmyAntsOffset=0)}}toSVGPathD(t=!1){let e=[];const s=this.toSVGPathData();return s[0]&&Array.isArray(s[0])?e.push(...s):e.push(s),t&&(e=G.relativeSVGPath(e)),G.SVGPathDataToD(e)}distanceTo(t){return Ze(this.x,this.y,t.x,t.y)}angleTo(t){return this.degree=J(ye(this.x,this.y,t.x,t.y)),this.degree}followTo(t,e=3){const s=this.angleTo(t),{x:i,y:r}=Gt(st(s),e);this.vx=i,this.vy=r,this.nextFrame()}followAccelerationTo(t,e=.05){const s=this.angleTo(t),{x:i,y:r}=Gt(st(s),e);this.ax=i,this.ay=r,this.nextFrame()}nextFrame(t){const e=t?.gravity??0,s=t?.friction??0;if(this.vx+=this.ax,this.vy+=this.ay,this.vy+=e,s>0){const i=Math.atan2(this.vy,this.vx);let r=Math.sqrt(this.vx*this.vx+this.vy*this.vy);r>s?r-=s:r=0,this.vx=Math.cos(i)*r,this.vy=Math.sin(i)*r}this.x+=this.vx,this.y+=this.vy}nextFrameEaseTo(t,e){const s=e?.gravity??0,i=e?.friction??1,r=e?.easing??.05,{dx:a,dy:o}=this.centerDiff,c=t.x-this.x-a,h=t.y-this.y-o;this.vx=c*r,this.vy=h*r,this.vy+=s,this.vx*=i,this.vy*=i,this.x+=this.vx,this.y+=this.vy}nextFrameSpringTo(t,e){const s=e?.gravity??0,i=e?.friction??.95,r=e?.spring??.03,{dx:a,dy:o}=this.centerDiff;(Array.isArray(t)?t:[t]).forEach(h=>{const l=h.x-this.x-a,f=h.y-this.y-o,g=l*r,y=f*r;this.vx+=g,this.vy+=y}),this.vy+=s,this.vx*=i,this.vy*=i,this.x+=this.vx,this.y+=this.vy}static nextFrameSpringConnect(t,e){const s=e?.springLength??100,i=e?.spring??.03,r=e?.gravity??0,a=e?.friction??.95;t.forEach(o=>{o.isDragging||t.filter(c=>c.id!==o.id).forEach(c=>{const h=o.angleTo(c);o.nextFrameSpringTo(new di({x:c.x-Math.cos(st(h))*s,y:c.y-Math.sin(st(h))*s}),{spring:i,gravity:r,friction:a})})})}}class Ct extends X{width;height;borderRadius;constructor(t){super(t),this.width=t.width,this.height=t.height,this.borderRadius=t.borderRadius||0}static fromBezier(t,e,s,i,r,a,o,c){const h=ne.curveDim(t,e,s,i,r,a,o,c);return new Ct({x:h.min.x,y:h.min.y,width:h.max.x-h.min.x,height:h.max.y-h.min.y})}getBoundingClientRect(){return this}toSVGPathData(){return this.borderRadius?[["M",this.x+this.borderRadius,this.y],["l",this.width-this.borderRadius*2,0],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,this.borderRadius],["l",0,this.height-this.borderRadius*2],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,this.borderRadius],["l",this.borderRadius*2-this.width,0],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,-this.borderRadius],["l",0,this.borderRadius*2-this.height],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,-this.borderRadius],["z"]]:[["M",this.x,this.y],["l",this.width,0],["l",0,this.height],["l",-this.width,0],["z"]]}toCanvasContext(t){t.beginPath(),this.borderRadius<=0?t.rect(0,0,this.width,this.height):(t.moveTo(0,this.borderRadius),t.lineTo(0,this.height-this.borderRadius),t.quadraticCurveTo(0,this.height,this.borderRadius,this.height),t.lineTo(this.width-this.borderRadius,this.height),t.quadraticCurveTo(this.width,this.height,this.width,this.height-this.borderRadius),t.lineTo(this.width,this.borderRadius),t.quadraticCurveTo(this.width,0,this.width-this.borderRadius,0),t.lineTo(this.borderRadius,0),t.quadraticCurveTo(0,0,0,this.borderRadius)),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height&&this.borderRadius===t.borderRadius}isIntersectRect(t){return!(this.x+this.width<t.x||t.x+t.width<this.x||this.y+this.height<t.y||t.y+t.height<this.y)}isContainPoint(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}clone(t){return new Ct({x:t.x,y:t.y,width:t.width,height:t.height,borderRadius:t.borderRadius})}toArray(){return[this.x,this.y,this.width,this.height,this.borderRadius]}}class ut extends X{radius;constructor(t){super(t),this.radius=t?.radius||0}getBoundingClientRect(){return new Ct({x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2})}toSVGPathData(){return this.radius?[["M",this.x,this.y-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:["M",this.x,this.y]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}toArray(){return[this.x,this.y,this.radius]}setX(t){this.x=t}setY(t){this.y=t}setXY(t,e){this.x=t,this.y=e}eq(t){return this.x===t.x&&this.y===t.y&&this.radius===t.radius}midPointBtw(t){return new ut({x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2})}cross(t){const e=this.x,s=this.y;return this.x=s*t.x-e*t.y,this.y=e*t.y-s*t.x,this}normalize(t=1){const e=Je(this.x,this.y);if(e){const s=t/e;this.x*=s,this.y*=s}return this}reflect(t,e){const s=t.x*e.x+t.y*e.y;return this.x=t.x-2*s*e.x,this.y=t.y-2*s*e.y,this}clone(t){return new ut({x:t.x,y:t.y,radius:t.radius})}nextFrameCollisionTo(t){const e=t.x-this.x,s=t.y-this.y;if(Math.sqrt(e*e+s*s)<this.radius+t.radius){const r=Math.atan2(s,e),a={x:0,y:0},o=St(-r,e,s),c=St(-r,this.vx,this.vy),h=St(-r,t.vx,t.vy),l=c.x-h.x;c.x=((this.mass-t.mass)*c.x+2*t.mass*h.x)/(this.mass+t.mass),h.x=l+c.x;const f=Math.abs(c.x)+Math.abs(h.x),g=this.radius+t.radius-Math.abs(a.x-o.x);a.x+=c.x/f*g,o.x+=h.x/f*g;const y=St(r,a.x,a.y),m=St(r,o.x,o.y);t.x=this.x+m.x,t.y=this.y+m.y,this.x=this.x+y.x,this.y=this.y+y.y;const v=St(r,c.x,c.y),b=St(r,h.x,h.y);this.vx=v.x,this.vy=v.y,t.vx=b.x,t.vy=b.y}}nextFrameBounce(t,e){const s=e?.bounce??-1,i=t.x,r=t.y,a=t.x+t.width,o=t.y+t.height;this.x+this.radius>a?(this.x=a-this.radius,this.vx*=s):this.x-this.radius<i&&(this.x=i+this.radius,this.vx*=s),this.y+this.radius>o?(this.y=o-this.radius,this.vy*=s):this.y-this.radius<r&&(this.y=r+this.radius,this.vy*=s)}}const di=ut;class mi{constructor(){}static getFormatKeyNames(t){const e=zs(),s=[];return t.ctrl&&s.push(e?"Cmd":"Ctrl"),t.shift&&s.push("Shift"),t.alt&&s.push("Alt"),typeof t.key=="string"?s.push(Rs(t.key)):Array.isArray(t.key)&&(t.key.map(i=>Rs(i)),s.push(...t.key)),s}static matchKeyScheme(t,e){const s=t.ctrl??!1,i=t.shift??!1,r=t.alt??!1;if(t.exact)return(s===e.metaKey||s===e.ctrlKey)&&i===e.shiftKey&&r===e.altKey;const a=[];return s&&a.push(s===e.metaKey||s===e.ctrlKey),i&&a.push(i===e.shiftKey),r&&a.push(r===e.altKey),a.every(o=>o)}static on(t,e){if(t?.key===void 0||t?.key===null)return e;const s=t?.target??window;let i=!1;const r=this.getFormatKeyNames(t),a=o=>{if(o.stopPropagation(),!i&&o.key!=="Control"&&o.key!=="Meta"&&o.key!=="Shift"&&o.key!=="Option"&&o.key!=="Alt"&&r.find(c=>c.toLowerCase()===o.key.toLowerCase())&&this.matchKeyScheme(t,o)){o.preventDefault();const c=e(o);if(typeof c!="function")return;const h=l=>{l.preventDefault(),c(l),s.removeEventListener("keyup",h)};s.addEventListener("keyup",h)}};return e.title=t?.title??"",e.formatedKeyNames=r,e.pause=()=>i=!0,e.restart=()=>i=!1,e.removeListener=()=>s.removeEventListener("keydown",a),s.addEventListener("keydown",a),e}}let mt;const ie=[];class xe extends Os{container;width;height;mousePoint;hammer;domEventBusRemoves=[];constructor(t=document.documentElement,e=!0){super(),this.container=t,this.width=this.container.clientWidth,this.height=this.container.clientHeight,this.hammer=new Ya(this.container),this.mousePoint=new ut({x:0,y:0}),e&&this.start()}emitDebounce=ha((t,...e)=>super.emit(t,...e),50);emit(t,...e){switch(t){case"panLeft":case"panRight":this.emitDebounce(t,...e);break;default:super.emit(t,...e);break}return this}static get page(){if(mt)return mt;mt=new xe,window.addEventListener("hashchange",()=>{mt.emit("hashchange",location.hash)}),window.addEventListener("popstate",()=>{mt.emit("popstate")}),mt.registerKeyDown({title:"打开",key:"o",ctrl:!0,exact:!0},()=>{Yn().then(e=>We(e[0])).then(e=>{mt.emit("openFile",e)}).catch(e=>{mt.emit("openFileError",e)})}),mt.registerMatchMediaChange("(prefers-color-scheme: dark)");const t=()=>ie.forEach(e=>e());return mt.registerGlobalScrollChange=e=>{ie.push(e),ie.length==1&&document.addEventListener("scroll",t)},mt.removeGlobalScrollChange=e=>{const s=ie.findIndex(i=>i==e);s>=0&&(ie.splice(s,1),ie.length==0&&document.removeEventListener("scroll",t))},mt}start(){this.registerMouseEventListeners(),this.registerInputEventListeners(),this.registerTransitionEventListeners(),this.on("pointerMove",this.setMousePoint),this.addDOMEventBusRemoves(()=>{this.off("pointerMove",this.setMousePoint)}),this.registerResizeObserver(),this.registerElementDisplayInParent()}restart(){this.destroy(),this.start()}destroy(){this.domEventBusRemoves.forEach(t=>t()),this.domEventBusRemoves=[],this.removeAllListeners()}addDOMEventBusRemoves(t){this.domEventBusRemoves.push(t)}setMousePoint(t){const e=ti(this.container,t);return this.mousePoint.x=e.x,this.mousePoint.y=e.y,e}registerMouseEventListeners(){const t=D=>{this.emit("mouseDown",D),this.container.style.userSelect="none"},e=D=>{this.emit("mouseUp",D),this.container.style.userSelect=""},s=D=>{this.emit("mouseMove",D)},i=D=>{this.emit("mouseOver",D)},r=D=>{this.emit("mouseOut",D),this.container.style.userSelect=""},a=D=>{this.emit("mouseClick",D)},o=D=>{this.emit("mouseDoubleClick",D)},c=D=>{this.emit("mouseWheel",D)},h=D=>{this.emit("mouseContextMenu",D)},l=D=>{this.emit("touchStart",D),this.container.style.userSelect="none"},f=D=>{this.emit("touchEnd",D),this.container.style.userSelect=""},g=D=>{this.emit("touchCancel",D),this.container.style.userSelect=""},y=D=>{this.emit("touchMove",D)},m=D=>{this.emit("pointerDown",D),this.container.style.userSelect="none"},v=D=>{this.emit("pointerUp",D),this.container.style.userSelect=""},b=D=>{this.emit("pointerCancel",D),this.container.style.userSelect=""},S=D=>{this.emit("pointerMove",D)},C=D=>{this.emit("pan",D)},k=D=>{this.emit("panStart",D),this.container.style.userSelect="none"},R=D=>{this.emit("panMove",D)},F=D=>{this.emit("panEnd",D),this.container.style.userSelect=""},L=D=>{this.emit("panCancel",D),this.container.style.userSelect=""},j=D=>{this.emit("panLeft",D)},Q=D=>{this.emit("panRight",D)},q=D=>{this.emit("panUp",D),this.container.style.userSelect=""},Y=D=>{this.emit("panDown",D),this.container.style.userSelect="none"},H=D=>{this.emit("pinch",D)},nt=D=>{this.emit("press",D)},wt=D=>{this.emit("rotate",D)},ct=D=>{this.emit("swipe",D)},fe=D=>{this.emit("tap",D)},_t=D=>{!D.target||this.container==D.target||this.container.contains(D.target)||this.emit("tapOutSide",D)};this.container.addEventListener("mousedown",t),this.container.addEventListener("mouseup",e),this.container.addEventListener("mousemove",s),this.container.addEventListener("mouseover",i),this.container.addEventListener("mouseout",r),this.container.addEventListener("click",a),this.container.addEventListener("dblclick",o),this.container.addEventListener("wheel",c),this.container.addEventListener("contextmenu",h),this.container.addEventListener("touchstart",l),this.container.addEventListener("touchend",f),this.container.addEventListener("touchcancel",g),this.container.addEventListener("touchmove",y),this.container.addEventListener("pointerdown",m),this.container.addEventListener("pointerup",v),this.container.addEventListener("pointercancel",b),this.container.addEventListener("pointermove",S),this.hammer.on("pan",C),this.hammer.on("panstart",k),this.hammer.on("panmove",R),this.hammer.on("panend",F),this.hammer.on("pancancel",L),this.hammer.on("panleft",j),this.hammer.on("panright",Q),this.hammer.on("panup",q),this.hammer.on("pandown",Y),this.hammer.on("pinch",H),this.hammer.on("press",nt),this.hammer.on("rotate",wt),this.hammer.on("swipe",ct),this.hammer.on("tap",fe),document.addEventListener("pointerdown",_t,!1);const Kt=()=>{this.container.removeEventListener("mousedown",t),this.container.removeEventListener("mouseup",e),this.container.removeEventListener("mousemove",s),this.container.removeEventListener("mouseover",i),this.container.removeEventListener("mouseout",r),this.container.removeEventListener("click",a),this.container.removeEventListener("dblclick",o),this.container.removeEventListener("wheel",c),this.container.removeEventListener("contextmenu",h),this.container.removeEventListener("touchstart",l),this.container.removeEventListener("touchend",f),this.container.removeEventListener("touchcancel",g),this.container.removeEventListener("touchmove",y),this.container.removeEventListener("pointerdown",m),this.container.removeEventListener("pointerup",v),this.container.removeEventListener("pointercancel",b),this.container.removeEventListener("pointermove",S),this.hammer.off("pan",C),this.hammer.off("panstart",k),this.hammer.off("panmove",R),this.hammer.off("panend",F),this.hammer.off("pancancel",L),this.hammer.off("panleft",j),this.hammer.off("panright",Q),this.hammer.off("panup",q),this.hammer.off("pandown",Y),this.hammer.off("pinch",H),this.hammer.off("press",nt),this.hammer.off("rotate",wt),this.hammer.off("swipe",ct),this.hammer.off("tap",fe),document.removeEventListener("pointerdown",_t,!1),document.removeEventListener("touchstart",_t,!1),document.removeEventListener("mousedown",_t,!1)};return this.addDOMEventBusRemoves(Kt),Kt}registerInputEventListeners(){const t=c=>{this.emit("inputChange",c,this.container.files)},e=c=>{this.emit("dragstart",c)},s=c=>{c.stopPropagation(),c.preventDefault(),c.dataTransfer&&(c.dataTransfer.dropEffect="copy"),this.emit("dragover",c)},i=c=>{this.emit("dragenter",c)},r=c=>{this.emit("dragend",c)},a=c=>{c.stopPropagation(),c.preventDefault(),c.dataTransfer,this.emit("drop",c,c.dataTransfer?.files)};this.container instanceof HTMLInputElement&&this.container.addEventListener("change",t,!1),this.container.addEventListener("dragstart",e,!1),this.container.addEventListener("dragover",s,!1),this.container.addEventListener("dragenter",i,!1),this.container.addEventListener("dragend",r,!1),this.container.addEventListener("drop",a,!1);const o=()=>{this.container instanceof HTMLInputElement&&this.container.removeEventListener("change",t,!1),this.container.removeEventListener("dragstart",e,!1),this.container.removeEventListener("dragover",s,!1),this.container.removeEventListener("dragenter",i,!1),this.container.removeEventListener("dragend",r,!1),this.container.removeEventListener("drop",a,!1)};return this.addDOMEventBusRemoves(o),o}registerTransitionEventListeners(){const t=s=>{this.emit("transitionend",s)};this.container.addEventListener("transitionend",t);const e=()=>{this.container.removeEventListener("transitionend",t)};return this.addDOMEventBusRemoves(e),e}registerKeyDown(t,e,s){const i=mi.on(t,a=>(e(a,i.formatedKeyNames,i.pause,i.restart),s)),r=()=>{i.removeListener?.()};return this.addDOMEventBusRemoves(r),r}registerResizeObserver(){const t=new ResizeObserver(s=>{const{width:i,height:r}=s[0].contentRect;this.width=i,this.height=r,this.emit("resize",i,r)});t.observe(this.container);const e=()=>{t.unobserve(this.container)};return this.addDOMEventBusRemoves(e),e}registerMatchMediaChange(t){let e="";switch(t){case"(prefers-color-scheme: dark)":e="matchMediaChangePrefersColorSchemeDark";break;default:e=t;break}const s=r=>{this.emit(e,r.matches)};window.matchMedia(t).addEventListener("change",s);const i=()=>{window.matchMedia(t).removeEventListener("change",s)};return this.addDOMEventBusRemoves(i),i}registerElementDisplayInParent(t){const e={threshold:t?.threshold||.5,root:t?.parentElement},s=new IntersectionObserver((r,a)=>{let o=r[0];if(r.length>1){const h=r.find(l=>l.isIntersecting);h&&(o=h)}o.isIntersecting&&o.intersectionRatio>=e.threshold?this.emit("showInParent"):this.emit("showOffParent")},e);s.observe(this.container);const i=()=>{s.unobserve(this.container)};return this.addDOMEventBusRemoves(i),i}registerPullDownRefresh(t){const e=t?.distance||50;let s=0,i=0;return this.captureMove({start:r=>{s=this.setMousePoint(r).y},move:()=>{i=this.mousePoint.y-s,i>0&&i<e&&this.emit("pullDownIng",i)},end:()=>{i>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;let s=0,i=0;return this.captureMove({start:r=>{s=this.setMousePoint(r).y},move:()=>{i=s-this.mousePoint.y,i>0&&i<e&&this.emit("pullUpIng",i)},end:()=>{i>=e&&this.emit("pullUp")}})}static isTouchEnabled(){return"ontouchstart"in window||navigator.maxTouchPoints>0}captureMove(t){return this.captureMoveUsePointer(t)}captureMoveUsePointer(t){const e=a=>{this.container.setPointerCapture(a.pointerId),this.container.style.userSelect="none",t?.start?.(a)},s=a=>{this.container.style.userSelect="",t?.end?.(a)},i=a=>{t?.move?.(a)};this.on("pointerDown",e),this.on("pointerUp",s),this.on("pointerCancel",s),this.on("pointerMove",i);const r=()=>{this.off("pointerDown",e),this.off("pointerUp",s),this.off("pointerCancel",s),this.off("pointerMove",i)};return this.addDOMEventBusRemoves(r),r}captureMoveUseMouse(t){const e=a=>{document.addEventListener("mousemove",i,!1),document.addEventListener("mouseup",s,!1),this.container.style.userSelect="none",t?.start?.(a)},s=a=>{document.removeEventListener("mousemove",i,!1),document.removeEventListener("mouseup",s,!1),this.container.style.userSelect="",t?.end?.(a)},i=a=>{t?.move?.(a)};this.on("mouseDown",e);const r=()=>{this.off("mouseDown",e)};return this.addDOMEventBusRemoves(r),r}captureMoveUseTouch(t){const e=a=>{a.preventDefault(),t?.start?.(a)},s=a=>{t?.end?.(a)},i=a=>{t?.move?.(a)};this.on("touchStart",e),this.on("touchEnd",s),this.on("touchCancel",s),this.on("touchMove",i);const r=()=>{this.off("touchStart",e),this.off("touchEnd",s),this.off("touchCancel",s),this.off("touchMove",i)};return this.addDOMEventBusRemoves(r),r}static getMouseButton(t){if(document.implementation.hasFeature("MouseEvents","2.0"))return t.button;switch(t.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}}class Se{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{e.target}),this.video.srcObject=t}captureWebCamera(){navigator.mediaDevices.getUserMedia({video:!0}).then(t=>{this.setSrcObject(t)})}static async videoMediaChangeSupport(){return new Promise(t=>{const e=document.createElement("iframe"),s=document.createElement("video"),i=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),i.src=URL.createObjectURL(r),i.media="(min-width:10px)",s.append(i),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(s),setTimeout(()=>{e.width="15"}),setTimeout(()=>{e.remove(),t(!1)},1e3)})}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(()=>{Se.setAutoPlayWhenClick(t),e(!1)})})}static setAutoPlayWhenClick(t){function e(){t.autoplay=!0,t.play(),document.removeEventListener("click",e),document.removeEventListener("touchend",e)}document.addEventListener("click",e),document.addEventListener("touchend",e)}}class pi extends Os{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=Nn(this.source);if(t===0){this.emit("finish");return}let e,s,i=Fn(this.source,0);for(let r=1;r<t;r++)e=s,s=i,i=Fn(this.source,r),this.raw+=s,s&&this.step(s,i,e);i&&this.step(i,void 0,s),this.emit("finish")}step(t,e,s){t==`
|
|
25
|
-
`&&this.emit("newline"),this.act(t,e,s)}act(t,e,s){switch(this.mode){case"text":switch(t){case"<":case"eof":this.nodename="",this.attrs={},this.mode="tag name start",this.raw=this.raw.slice(0,-1),this.textchunk&&this.emit("text",this.textchunk),this.raw+=t,this.textchunk="";break;case"&":this.mode="entity",this.entity="";break;default:this.textchunk+=t;break}break;case"entity":Mt("whitespace",t)?(this.textchunk+=A.entity2text(this.entity),this.mode="text"):t==";"?(this.textchunk+=A.entity2text(this.entity+t),this.mode="text"):this.entity+=t;break;case"special":if(s=="!"&&t=="-"&&e=="-"){this.mode="comment start";break}if(this.textchunk=="[CDATA"&&t=="["){this.mode="cdata",this.textchunk="";break}if(t==">"||t=="eof"){this.emit("special",this.textchunk),this.mode="text",this.textchunk="";break}this.textchunk+=t;break;case"cdata":if(s=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,s)),this.textchunk+=t;break;case"cdata end":this.emit("cdata",this.textchunk),this.textchunk="",this.mode="text";break;case"comment start":e==">"||t=="eof"?(this.emit("comment",""),this.mode="skip"):this.mode="comment";break;case"skip":this.mode="text";break;case"comment":t=="-"&&s=="-"&&e==">"?(this.mode="comment end",this.textchunk=this.textchunk.slice(0,-1)):t=="eof"?this.emit("comment",this.textchunk):this.textchunk+=t;break;case"comment end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"declaration":if(t=="?"&&e==">"){this.mode="declaration end";break}t=="eof"&&this.emit("comment",this.textchunk),this.textchunk+=t;break;case"declaration end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"tag name start":if(t=="eof"){this.emit("text","<");break}if(!Mt("whitespace",t)){if(this.mode="tag name",t=="/"){this.mode="close tag name start";break}else if(t=="!"){this.mode="special",this.textchunk="";break}else if(t=="?"){this.mode="declaration";break}this.act(t,e,s)}break;case"close tag name start":Mt("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,s));break;case"close tag name":if(Mt("whitespace",t))this.tagname=this.nodename;else switch(t){case">":this.emit("/tag",this.tagname||this.nodename,this.attrs),this.mode="text";break;default:!this.tagname&&(this.nodename+=t);break}break;case"tag name":if(Mt("whitespace",t))this.tagname=this.nodename,this.nodename="",this.mode="attr start";else switch(t){case">":this.emit("tag",this.nodename,this.attrs),this.mode="text";break;case"/":this.raw+=e,this.emit("tag",this.nodename,this.attrs),this.emit("/tag",this.nodename,this.attrs),this.mode="skip";break;default:this.nodename+=t;break}break;case"attr start":Mt("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,s));break;case"attr":if(Mt("whitespace",t)||t=="=")this.attrs[this.nodename]="",this.mode="attr value start";else switch(t){case">":this.nodename=="/"?(delete this.attrs["/"],this.emit("tag",this.tagname,this.attrs),this.emit("/tag",this.tagname,this.attrs)):(this.nodename&&(this.attrs[this.nodename]=""),this.emit("tag",this.tagname,this.attrs)),this.mode="text";break;default:this.nodename+=t;break}break;case"attr value start":if(!Mt("whitespace",t)){if(this.mode="attr value",this.quote="",t=="'"||t=='"'){this.quote=t;return}this.act(t,e,s)}break;case"attr value":if(Mt("whitespace",t)&&!this.quote)this.mode="attr start";else if(t==">"&&!this.quote)this.emit("tag",this.tagname,this.attrs),this.mode="text";else switch(t){case'"':case"'":this.quote==t&&s!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function qs(n,t){if(typeof t<"u")window.localStorage.setItem(n,t);else return window.localStorage.getItem(n)??void 0}function $a(n,t,e){const s=new Date;s.setTime(s.getTime()+e*24*60*60*1e3);const i="expires="+s.toUTCString();document.cookie=n+"="+t+"; "+i}function Ja(n){const t=n+"=",e=document.cookie.split(";");for(let s=0,i=e.length;s<i;s++){const r=e[s].trim();if(r.indexOf(t)==0)return r.substring(t.length,r.length)}return""}const Za=()=>document.cookie.split(";").map(n=>n.split("=")).reduce((n,[t,e])=>(n[t.trim().replace('"',"")]=e,n),{}),Ka=()=>document.cookie.split(";").forEach(n=>document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));xe.page.on("matchMediaChangePrefersColorSchemeDark",n=>{Ke(n?"dark":"light")}),gi();function Ke(n){qs("colorScheme",n),document.documentElement.classList.toggle("dark",n=="dark")}function gi(){const n=qs("colorScheme");if(n=="dark"||n=="light")return Ke(n),n;{const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return Ke(t),t}}const Qa={safeAreaTop:A.getCSSVar("--safe-area-inset-top"),safeAreaRight:A.getCSSVar("--safe-area-inset-right"),safeAreaBottom:A.getCSSVar("--safe-area-inset-bottom"),safeAreaLeft:A.getCSSVar("--safe-area-inset-left"),colorPrimary:A.getCSSVar("--color-primary")||"#5078f0",colorRed:A.getCSSVar("--color-red")||"#ff5050",colorOrange:A.getCSSVar("--color-orange")||"#fa8c00",colorYellow:A.getCSSVar("--color-yellow")||"#fadc32",colorGreen:A.getCSSVar("--color-green")||"#00c878",colorBlue:A.getCSSVar("--color-blue")||"#00b4fa",colorPurple:A.getCSSVar("--color-purple")||"#6464fa",colorBlack:A.getCSSVar("--color-black")||"#001428",colorGray00:A.getCSSVar("--color-gray-00")||"#000000",colorGray33:A.getCSSVar("--color-gray-33")||"#333333",colorGray66:A.getCSSVar("--color-gray-66")||"#666666",colorGray99:A.getCSSVar("--color-gray-99")||"#999999",colorGrayCC:A.getCSSVar("--color-gray-cc")||"#cccccc",colorGrayDD:A.getCSSVar("--color-gray-dd")||"#dddddd",colorGrayE6:A.getCSSVar("--color-gray-e6")||"#e6e6e6",colorGrayEE:A.getCSSVar("--color-gray-ee")||"#eeeeee",colorGrayEF:A.getCSSVar("--color-gray-ef")||"#efefef",colorGrayF5:A.getCSSVar("--color-gray-f5")||"#f5f5f5",colorGrayFF:A.getCSSVar("--color-gray-ff")||"#ffffff",fontLineHeight:A.getCSSVar("--font-line-height")||"1,4",fontSize32:A.getCSSVar("--font-size-32")||"32px",fontSize24:A.getCSSVar("--font-size-24")||"24px",fontSize20:A.getCSSVar("--font-size-20")||"20px",fontSize18:A.getCSSVar("--font-size-18")||"18px",fontSize16:A.getCSSVar("--font-size-16")||"16px",fontSize14:A.getCSSVar("--font-size-14")||"14px",fontSize12:A.getCSSVar("--font-size-12")||"12px",fontSize11:A.getCSSVar("--font-size-11")||"11px",gap4:A.getCSSVar("--gap-4")||"4px",gap8:A.getCSSVar("--gap-8")||"8px",gap12:A.getCSSVar("--gap-12")||"12px",gap16:A.getCSSVar("--gap-16")||"16px",gap20:A.getCSSVar("--gap-20")||"20px",gap40:A.getCSSVar("--gap-40")||"40px",height44:A.getCSSVar("--height-44")||"44px",height32:A.getCSSVar("--height-32")||"32px",borderRadius:A.getCSSVar("--border-radius")||"4px"},to=["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"];function zt(n,t){if(n.hasOwnProperty("r")&&n.hasOwnProperty("g")&&n.hasOwnProperty("b"))return n.r=Math.round(lt(n.r,0,255)),n.g=Math.round(lt(n.g,0,255)),n.b=Math.round(lt(n.b,0,255)),n.hasOwnProperty("a")?n.a=typeof t=="number"?t:n.a:n.a=typeof t=="number"?t:1,n.a=lt(n.a,0,1),n;const e={r:0,g:0,b:0,a:1};let s=-1;if(typeof n=="number")s=n;else if(typeof n=="string")if(n[0].toLowerCase()==="r"){const i=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,?\s*(\d?\.?\d*)?\s*\)/gi.exec(n);i&&(s=(parseInt(i[1])<<16)+(parseInt(i[2])<<8)+parseInt(i[3]),i[4]&&(e.a=Vt(parseFloat(i[4]),2)))}else if(n[0]==="#")s=parseInt(n.slice(1,7),16),n.length>7&&(e.a=Vt(parseInt(n.slice(7,9),16)/255,2));else throw new Error("getColor 不支持的颜色解析:"+n);return s>=0&&(e.r=s>>16&255,e.g=s>>8&255,e.b=s&255),typeof t=="number"&&(e.a=t),e.a=lt(e.a,0,1),e}function eo(n,t){const e=zt(n,t);return e.a===1?`rgb(${e.r},${e.g},${e.b})`:`rgba(${e.r},${e.g},${e.b},${e.a})`}function Qe(n){return Kr(n.toString(16),2,"0","left")}function Ce(n,t){const e=zt(n,t);let s=`#${Qe(e.r)}${Qe(e.g)}${Qe(e.b)}`;return e.a===1?s:s+`${Qe(Math.ceil(e.a*255))}`}const yi=()=>Math.random()*16777215,so=()=>Ce(yi());function no(n,t){const e=zt(n);return e.r==0&&(e.r=32),e.g==0&&(e.g=32),e.b==0&&(e.b=32),e.r=e.r*(100+t)/100,e.g=e.g*(100+t)/100,e.b=e.b*(100+t)/100,e.r=Math.round(lt(e.r,0,255)),e.g=Math.round(lt(e.g,0,255)),e.b=Math.round(lt(e.b,0,255)),Ce(e)}function Ys(n,t,e){try{const s=zt(n),i=zt(t);return Ce({r:(i.r-s.r)*e+s.r,g:(i.g-s.g)*e+s.g,b:(i.b-s.b)*e+s.b,a:(i.a-s.a)*e+s.a})}catch{return t}}function io(n,t,e,s){let i,r,a;n=n/360,t=t/100,e=e/100;const o=Math.floor(n*6),c=n*6-o,h=e*(1-t),l=e*(1-c*t),f=e*(1-(1-c)*t);switch(o%6){case 0:i=e,r=f,a=h;break;case 1:i=l,r=e,a=h;break;case 2:i=h,r=e,a=f;break;case 3:i=h,r=l,a=e;break;case 4:i=f,r=h,a=e;break;case 5:default:i=e,r=h,a=l;break}return{r:Math.round(i*255),g:Math.round(r*255),b:Math.round(a*255),opacity:s??1}}function ro(n,t,e,s){n*=360;let i,r,a,o,c;return n=n%360/60,c=e*t,o=c*(1-Math.abs(n%2-1)),i=r=a=e-c,n=~~n,i+=[c,o,0,0,o,c][n],r+=[o,c,c,o,0,0][n],a+=[0,0,o,c,c,o][n],{r:i,g:r,b:a,opacity:s??1}}function ao(n,t,e,s){(n>1||t>1||e>1)&&(n/=360,t/=100,e/=100),n*=360;var i,r,a,o,c;return n=n%360/60,c=2*t*(e<.5?e:1-e),o=c*(1-Math.abs(n%2-1)),i=r=a=e-c/2,n=~~n,i+=[c,o,0,0,o,c][n],r+=[o,c,c,o,0,0][n],a+=[0,0,o,c,c,o][n],{r:i,g:r,b:a,opacity:s??1}}function oo(n,t,e,s){const i=Math.max(n,t,e),r=Math.min(n,t,e),a=i-r,o=i===0?0:a/i,c=i/255;let h;switch(i){case r:h=0;break;case n:h=t-e+a*(t<e?6:0),h/=6*a;break;case t:h=e-n+a*2,h/=6*a;break;case e:default:h=n-t+a*4,h/=6*a;break}return{h:Math.round(h*360),s:Math.round(o*100),v:Math.round(c*100),opacity:s??1}}function co(n,t,e){let s,i,r,a;return r=Math.max(n,t,e),a=r-Math.min(n,t,e),s=a==0?0:r==n?(t-e)/a:r==t?(e-n)/a+2:(n-t)/a+4,s=(s+360)%6*60/360,i=a==0?0:a/r,{h:s,s:i,b:r}}function ho(n,t,e){let s,i,r,a,o,c;return a=Math.max(n,t,e),o=Math.min(n,t,e),c=a-o,s=c==0?0:a==n?(t-e)/c:a==t?(e-n)/c+2:(n-t)/c+4,s=(s+360)%6*60/360,r=(a+o)/2,i=c==0?0:r<.5?c/(2*r):c/(2-2*r),{h:s,s:i,l:r}}function ts(n=window.location.href){return He(URL)?new URL(n):wi(n)}function wi(n=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",s="(?<pathname>(?:\\/[^/#?]+)*\\/?)",i="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${s}${i}${r}$`).exec(n);return{href:n,protocol:o?.groups?.protocol??"",host:o?.groups?.host??"",hostname:o?.groups?.hostname??"",port:o?.groups?.port??"",pathname:o?.groups?.pathname??"",search:o?.groups?.search??"",hash:o?.groups?.hash??""}}function lo(n){const t=ts(n);return t.protocol==="http:"||t.protocol==="https:"}function vi(n=window.location.href){const t=ts(n),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function uo(n=ts().search){n=decodeURIComponent(n).replace(/^[#?&]/,"");const t={};if(!n)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let s=e.exec(n);for(;s;)t[s[1]]=s[2],s=e.exec(n);return t}function bi(n){return"?"+Object.entries(n).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function xi(n){return"?"+[...n.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function fo(n,t){return n.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function Si(n,t){return n+t.replace(/^[&?]/,n.indexOf("?")>=0?"&":"?")}const es=new Map,Ci={transform:function(n){if(oi)return n;if(es.has(n))return es.get(n);const t=new OffscreenCanvas(n.width,n.height);return t.getContext("2d")?.drawImage(n,0,0),es.set(n,t),t},clear:function(){es.clear()}};function mo(n){let t=null;if(ai)try{t=new Worker(URL.createObjectURL(new Blob([n])))}catch(e){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),null}return t}const po={resolves:{},promise:null,init:function(n,t){const e=t.transferControlToOffscreen();n.postMessage({canvas:e},[e])},reset:function(n){n.postMessage({reset:!0});for(const t in this.resolves)this.resolves[t](),delete this.resolves[t]},fire:function(n,t,e){if(this.promise)return n.postMessage({options:t}),this.promise;const s=Math.random().toString(36).slice(2);return this.promise=new Promise(i=>{const r=a=>{a.data.callback===s&&(delete this.resolves[s],n.removeEventListener("message",r),this.promise=null,Ci.clear(),e(),i())};n.addEventListener("message",r),n.postMessage({options:t,callback:s}),this.resolves[s]=r.bind(this,{data:{callback:s}})}),this.promise}};function Ti(){let n=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0;e<t.length;e++)try{n=new window.ActiveXObject(t[e]);break}catch{continue}}else n=new XMLHttpRequest;return n}function go(n){return new Promise((t,e)=>{fetch(n,{}).then(s=>s.text()).then(t).catch(e)})}function yo(n,t){return new Promise((e,s)=>{const{method:i="GET",data:r={},segments:a=[],headers:o={},withCredentials:c=!1,responseType:h="json",timeout:l=3e4}=t||{},f=Ti();f.timeout=l,f.responseType=h,f.onreadystatechange=function(C){f.readyState===4&&(f.status===200?e(f.response):s(f.statusText))},f.ontimeout=function(){s(`${n} is timed out for ${l}ms.`)},f.addEventListener("error",function(C){s(C)},!1),f.addEventListener("progress",function(C){if(C.lengthComputable){const k=Math.round(C.loaded*100/C.total);t?.progress?.(k,f)}},!1),f.addEventListener("load",function(C){t?.load?.(C,f)},!1),f.addEventListener("loadstart",function(C){t?.loadstart?.(C,f)},!1),f.addEventListener("loadend",function(C){t?.loadend?.(C,f)},!1),f.addEventListener("abort",function(C){t?.abort?.(C,f)},!1);const g=i.toUpperCase();Object.assign(o,{Accept:"*/*"});const y="---------------------------"+Date.now().toString(16);let m=!1,v=!1,b=!1;function S(){c&&(f.withCredentials=!0);for(const C in o)it(C).toLowerCase()=="content-type"&&o[C].toLowerCase()=="multipart/form-data"?(m=!0,f.setRequestHeader("Content-Type","multipart/form-data; boundary="+y)):(it(C).toLowerCase()=="content-type"&&(o[C].toLowerCase().indexOf("text/plain")>=0?v=!0:o[C].toLowerCase().indexOf("application/json")>=0&&(b=!0)),f.setRequestHeader(C,o[C]))}switch(g){case"GET":let C="";r instanceof FormData?C=xi(r):C=bi(r),f.open("GET",Si(n,C),!0),S(),f.send(null);break;case"POST":default:f.open(g,n,!0),S(),m&&a.length?f.sendAsBinary("--"+y+`\r
|
|
24
|
+
`;return function(){var A=new Error("get-stack-trace"),_=A&&A.stack?A.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",G=t.console&&(t.console.warn||t.console.log);return G&&G.call(t.console,v,_),f.apply(this,arguments)}}var x;typeof Object.assign!="function"?x=function(d){if(d===n||d===null)throw new TypeError("Cannot convert undefined or null to object");for(var w=Object(d),v=1;v<arguments.length;v++){var A=arguments[v];if(A!==n&&A!==null)for(var _ in A)A.hasOwnProperty(_)&&(w[_]=A[_])}return w}:x=Object.assign;var b=m(function(d,w,v){for(var A=Object.keys(w),_=0;_<A.length;)(!v||v&&d[A[_]]===n)&&(d[A[_]]=w[A[_]]),_++;return d},"extend","Use `assign`."),S=m(function(d,w){return b(d,w,!0)},"merge","Use `assign`.");function C(f,d,w){var v=d.prototype,A;A=f.prototype=Object.create(v),A.constructor=f,A._super=v,w&&x(A,w)}function M(f,d){return function(){return f.apply(d,arguments)}}function O(f,d){return typeof f==o?f.apply(d&&d[0]||n,d):f}function F(f,d){return f===n?d:f}function L(f,d,w){y(Y(d),function(v){f.addEventListener(v,w,!1)})}function V(f,d,w){y(Y(d),function(v){f.removeEventListener(v,w,!1)})}function Z(f,d){for(;f;){if(f==d)return!0;f=f.parentNode}return!1}function X(f,d){return f.indexOf(d)>-1}function Y(f){return f.trim().split(/\s+/g)}function q(f,d,w){if(f.indexOf&&!w)return f.indexOf(d);for(var v=0;v<f.length;){if(w&&f[v][w]==d||!w&&f[v]===d)return v;v++}return-1}function it(f){return Array.prototype.slice.call(f,0)}function xt(f,d,w){for(var v=[],A=[],_=0;_<f.length;){var G=d?f[_][d]:f[_];q(A,G)<0&&v.push(f[_]),A[_]=G,_++}return w&&(d?v=v.sort(function(tt,ot){return tt[d]>ot[d]}):v=v.sort()),v}function ht(f,d){for(var w,v,A=d[0].toUpperCase()+d.slice(1),_=0;_<r.length;){if(w=r[_],v=w?w+A:d,v in f)return v;_++}return n}var Se=1;function $t(){return Se++}function te(f){var d=f.ownerDocument||f;return d.defaultView||d.parentWindow||t}var Ce=/mobile|tablet|ip(ad|hone|od)|android/i,I="ontouchstart"in t,k=ht(t,"PointerEvent")!==n,B=I&&Ce.test(navigator.userAgent),P="touch",bt="pen",Jt="mouse",Pu="kinect",Au=25,at=1,ee=2,$=4,ct=8,Ls=1,He=2,We=4,$e=8,Je=16,_t=He|We,se=$e|Je,sa=_t|se,ia=["x","y"],Ns=["clientX","clientY"];function vt(f,d){var w=this;this.manager=f,this.callback=d,this.element=f.element,this.target=f.options.inputTarget,this.domHandler=function(v){O(f.options.enable,[f])&&w.handler(v)},this.init()}vt.prototype={handler:function(){},init:function(){this.evEl&&L(this.element,this.evEl,this.domHandler),this.evTarget&&L(this.target,this.evTarget,this.domHandler),this.evWin&&L(te(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&V(this.element,this.evEl,this.domHandler),this.evTarget&&V(this.target,this.evTarget,this.domHandler),this.evWin&&V(te(this.element),this.evWin,this.domHandler)}};function Du(f){var d,w=f.options.inputClass;return w?d=w:k?d=Yi:B?d=Gs:I?d=qi:d=Bs,new d(f,ku)}function ku(f,d,w){var v=w.pointers.length,A=w.changedPointers.length,_=d&at&&v-A===0,G=d&($|ct)&&v-A===0;w.isFirst=!!_,w.isFinal=!!G,_&&(f.session={}),w.eventType=d,Mu(f,w),f.emit("hammer.input",w),f.recognize(w),f.session.prevInput=w}function Mu(f,d){var w=f.session,v=d.pointers,A=v.length;w.firstInput||(w.firstInput=na(d)),A>1&&!w.firstMultiple?w.firstMultiple=na(d):A===1&&(w.firstMultiple=!1);var _=w.firstInput,G=w.firstMultiple,K=G?G.center:_.center,tt=d.center=ra(v);d.timeStamp=l(),d.deltaTime=d.timeStamp-_.timeStamp,d.angle=Xi(K,tt),d.distance=Fs(K,tt),_u(w,d),d.offsetDirection=oa(d.deltaX,d.deltaY);var ot=aa(d.deltaTime,d.deltaX,d.deltaY);d.overallVelocityX=ot.x,d.overallVelocityY=ot.y,d.overallVelocity=c(ot.x)>c(ot.y)?ot.x:ot.y,d.scale=G?Ru(G.pointers,v):1,d.rotation=G?Ou(G.pointers,v):0,d.maxPointers=w.prevInput?d.pointers.length>w.prevInput.maxPointers?d.pointers.length:w.prevInput.maxPointers:d.pointers.length,Iu(w,d);var Ot=f.element;Z(d.srcEvent.target,Ot)&&(Ot=d.srcEvent.target),d.target=Ot}function _u(f,d){var w=d.center,v=f.offsetDelta||{},A=f.prevDelta||{},_=f.prevInput||{};(d.eventType===at||_.eventType===$)&&(A=f.prevDelta={x:_.deltaX||0,y:_.deltaY||0},v=f.offsetDelta={x:w.x,y:w.y}),d.deltaX=A.x+(w.x-v.x),d.deltaY=A.y+(w.y-v.y)}function Iu(f,d){var w=f.lastInterval||d,v=d.timeStamp-w.timeStamp,A,_,G,K;if(d.eventType!=ct&&(v>Au||w.velocity===n)){var tt=d.deltaX-w.deltaX,ot=d.deltaY-w.deltaY,Ot=aa(v,tt,ot);_=Ot.x,G=Ot.y,A=c(Ot.x)>c(Ot.y)?Ot.x:Ot.y,K=oa(tt,ot),f.lastInterval=d}else A=w.velocity,_=w.velocityX,G=w.velocityY,K=w.direction;d.velocity=A,d.velocityX=_,d.velocityY=G,d.direction=K}function na(f){for(var d=[],w=0;w<f.pointers.length;)d[w]={clientX:h(f.pointers[w].clientX),clientY:h(f.pointers[w].clientY)},w++;return{timeStamp:l(),pointers:d,center:ra(d),deltaX:f.deltaX,deltaY:f.deltaY}}function ra(f){var d=f.length;if(d===1)return{x:h(f[0].clientX),y:h(f[0].clientY)};for(var w=0,v=0,A=0;A<d;)w+=f[A].clientX,v+=f[A].clientY,A++;return{x:h(w/d),y:h(v/d)}}function aa(f,d,w){return{x:d/f||0,y:w/f||0}}function oa(f,d){return f===d?Ls:c(f)>=c(d)?f<0?He:We:d<0?$e:Je}function Fs(f,d,w){w||(w=ia);var v=d[w[0]]-f[w[0]],A=d[w[1]]-f[w[1]];return Math.sqrt(v*v+A*A)}function Xi(f,d,w){w||(w=ia);var v=d[w[0]]-f[w[0]],A=d[w[1]]-f[w[1]];return Math.atan2(A,v)*180/Math.PI}function Ou(f,d){return Xi(d[1],d[0],Ns)+Xi(f[1],f[0],Ns)}function Ru(f,d){return Fs(d[0],d[1],Ns)/Fs(f[0],f[1],Ns)}var Lu={mousedown:at,mousemove:ee,mouseup:$},Nu="mousedown",Fu="mousemove mouseup";function Bs(){this.evEl=Nu,this.evWin=Fu,this.pressed=!1,vt.apply(this,arguments)}C(Bs,vt,{handler:function(d){var w=Lu[d.type];w&at&&d.button===0&&(this.pressed=!0),w&ee&&d.which!==1&&(w=$),this.pressed&&(w&$&&(this.pressed=!1),this.callback(this.manager,w,{pointers:[d],changedPointers:[d],pointerType:Jt,srcEvent:d}))}});var Bu={pointerdown:at,pointermove:ee,pointerup:$,pointercancel:ct,pointerout:ct},Gu={2:P,3:bt,4:Jt,5:Pu},ha="pointerdown",ca="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(ha="MSPointerDown",ca="MSPointerMove MSPointerUp MSPointerCancel");function Yi(){this.evEl=ha,this.evWin=ca,vt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}C(Yi,vt,{handler:function(d){var w=this.store,v=!1,A=d.type.toLowerCase().replace("ms",""),_=Bu[A],G=Gu[d.pointerType]||d.pointerType,K=G==P,tt=q(w,d.pointerId,"pointerId");_&at&&(d.button===0||K)?tt<0&&(w.push(d),tt=w.length-1):_&($|ct)&&(v=!0),!(tt<0)&&(w[tt]=d,this.callback(this.manager,_,{pointers:w,changedPointers:[d],pointerType:G,srcEvent:d}),v&&w.splice(tt,1))}});var Uu={touchstart:at,touchmove:ee,touchend:$,touchcancel:ct},Vu="touchstart",zu="touchstart touchmove touchend touchcancel";function la(){this.evTarget=Vu,this.evWin=zu,this.started=!1,vt.apply(this,arguments)}C(la,vt,{handler:function(d){var w=Uu[d.type];if(w===at&&(this.started=!0),!!this.started){var v=ju.call(this,d,w);w&($|ct)&&v[0].length-v[1].length===0&&(this.started=!1),this.callback(this.manager,w,{pointers:v[0],changedPointers:v[1],pointerType:P,srcEvent:d})}}});function ju(f,d){var w=it(f.touches),v=it(f.changedTouches);return d&($|ct)&&(w=xt(w.concat(v),"identifier",!0)),[w,v]}var Xu={touchstart:at,touchmove:ee,touchend:$,touchcancel:ct},Yu="touchstart touchmove touchend touchcancel";function Gs(){this.evTarget=Yu,this.targetIds={},vt.apply(this,arguments)}C(Gs,vt,{handler:function(d){var w=Xu[d.type],v=qu.call(this,d,w);v&&this.callback(this.manager,w,{pointers:v[0],changedPointers:v[1],pointerType:P,srcEvent:d})}});function qu(f,d){var w=it(f.touches),v=this.targetIds;if(d&(at|ee)&&w.length===1)return v[w[0].identifier]=!0,[w,w];var A,_,G=it(f.changedTouches),K=[],tt=this.target;if(_=w.filter(function(ot){return Z(ot.target,tt)}),d===at)for(A=0;A<_.length;)v[_[A].identifier]=!0,A++;for(A=0;A<G.length;)v[G[A].identifier]&&K.push(G[A]),d&($|ct)&&delete v[G[A].identifier],A++;if(K.length)return[xt(_.concat(K),"identifier",!0),K]}var Hu=2500,ua=25;function qi(){vt.apply(this,arguments);var f=M(this.handler,this);this.touch=new Gs(this.manager,f),this.mouse=new Bs(this.manager,f),this.primaryTouch=null,this.lastTouches=[]}C(qi,vt,{handler:function(d,w,v){var A=v.pointerType==P,_=v.pointerType==Jt;if(!(_&&v.sourceCapabilities&&v.sourceCapabilities.firesTouchEvents)){if(A)Wu.call(this,w,v);else if(_&&$u.call(this,v))return;this.callback(d,w,v)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Wu(f,d){f&at?(this.primaryTouch=d.changedPointers[0].identifier,fa.call(this,d)):f&($|ct)&&fa.call(this,d)}function fa(f){var d=f.changedPointers[0];if(d.identifier===this.primaryTouch){var w={x:d.clientX,y:d.clientY};this.lastTouches.push(w);var v=this.lastTouches,A=function(){var _=v.indexOf(w);_>-1&&v.splice(_,1)};setTimeout(A,Hu)}}function $u(f){for(var d=f.srcEvent.clientX,w=f.srcEvent.clientY,v=0;v<this.lastTouches.length;v++){var A=this.lastTouches[v],_=Math.abs(d-A.x),G=Math.abs(w-A.y);if(_<=ua&&G<=ua)return!0}return!1}var da=ht(a.style,"touchAction"),ma=da!==n,pa="compute",ga="auto",Hi="manipulation",ie="none",Ze="pan-x",Ke="pan-y",Us=Zu();function Wi(f,d){this.manager=f,this.set(d)}Wi.prototype={set:function(f){f==pa&&(f=this.compute()),ma&&this.manager.element.style&&Us[f]&&(this.manager.element.style[da]=f),this.actions=f.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var f=[];return y(this.manager.recognizers,function(d){O(d.options.enable,[d])&&(f=f.concat(d.getTouchAction()))}),Ju(f.join(" "))},preventDefaults:function(f){var d=f.srcEvent,w=f.offsetDirection;if(this.manager.session.prevented){d.preventDefault();return}var v=this.actions,A=X(v,ie)&&!Us[ie],_=X(v,Ke)&&!Us[Ke],G=X(v,Ze)&&!Us[Ze];if(A){var K=f.pointers.length===1,tt=f.distance<2,ot=f.deltaTime<250;if(K&&tt&&ot)return}if(!(G&&_)&&(A||_&&w&_t||G&&w&se))return this.preventSrc(d)},preventSrc:function(f){this.manager.session.prevented=!0,f.preventDefault()}};function Ju(f){if(X(f,ie))return ie;var d=X(f,Ze),w=X(f,Ke);return d&&w?ie:d||w?d?Ze:Ke:X(f,Hi)?Hi:ga}function Zu(){if(!ma)return!1;var f={},d=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(w){f[w]=d?t.CSS.supports("touch-action",w):!0}),f}var Vs=1,St=2,Te=4,Zt=8,Ut=Zt,Qe=16,It=32;function Vt(f){this.options=x({},this.defaults,f||{}),this.id=$t(),this.manager=null,this.options.enable=F(this.options.enable,!0),this.state=Vs,this.simultaneous={},this.requireFail=[]}Vt.prototype={defaults:{},set:function(f){return x(this.options,f),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(f){if(g(f,"recognizeWith",this))return this;var d=this.simultaneous;return f=zs(f,this),d[f.id]||(d[f.id]=f,f.recognizeWith(this)),this},dropRecognizeWith:function(f){return g(f,"dropRecognizeWith",this)?this:(f=zs(f,this),delete this.simultaneous[f.id],this)},requireFailure:function(f){if(g(f,"requireFailure",this))return this;var d=this.requireFail;return f=zs(f,this),q(d,f)===-1&&(d.push(f),f.requireFailure(this)),this},dropRequireFailure:function(f){if(g(f,"dropRequireFailure",this))return this;f=zs(f,this);var d=q(this.requireFail,f);return d>-1&&this.requireFail.splice(d,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(f){return!!this.simultaneous[f.id]},emit:function(f){var d=this,w=this.state;function v(A){d.manager.emit(A,f)}w<Zt&&v(d.options.event+ya(w)),v(d.options.event),f.additionalEvent&&v(f.additionalEvent),w>=Zt&&v(d.options.event+ya(w))},tryEmit:function(f){if(this.canEmit())return this.emit(f);this.state=It},canEmit:function(){for(var f=0;f<this.requireFail.length;){if(!(this.requireFail[f].state&(It|Vs)))return!1;f++}return!0},recognize:function(f){var d=x({},f);if(!O(this.options.enable,[this,d])){this.reset(),this.state=It;return}this.state&(Ut|Qe|It)&&(this.state=Vs),this.state=this.process(d),this.state&(St|Te|Zt|Qe)&&this.tryEmit(d)},process:function(f){},getTouchAction:function(){},reset:function(){}};function ya(f){return f&Qe?"cancel":f&Zt?"end":f&Te?"move":f&St?"start":""}function wa(f){return f==Je?"down":f==$e?"up":f==He?"left":f==We?"right":""}function zs(f,d){var w=d.manager;return w?w.get(f):f}function Et(){Vt.apply(this,arguments)}C(Et,Vt,{defaults:{pointers:1},attrTest:function(f){var d=this.options.pointers;return d===0||f.pointers.length===d},process:function(f){var d=this.state,w=f.eventType,v=d&(St|Te),A=this.attrTest(f);return v&&(w&ct||!A)?d|Qe:v||A?w&$?d|Zt:d&St?d|Te:St:It}});function js(){Et.apply(this,arguments),this.pX=null,this.pY=null}C(js,Et,{defaults:{event:"pan",threshold:10,pointers:1,direction:sa},getTouchAction:function(){var f=this.options.direction,d=[];return f&_t&&d.push(Ke),f&se&&d.push(Ze),d},directionTest:function(f){var d=this.options,w=!0,v=f.distance,A=f.direction,_=f.deltaX,G=f.deltaY;return A&d.direction||(d.direction&_t?(A=_===0?Ls:_<0?He:We,w=_!=this.pX,v=Math.abs(f.deltaX)):(A=G===0?Ls:G<0?$e:Je,w=G!=this.pY,v=Math.abs(f.deltaY))),f.direction=A,w&&v>d.threshold&&A&d.direction},attrTest:function(f){return Et.prototype.attrTest.call(this,f)&&(this.state&St||!(this.state&St)&&this.directionTest(f))},emit:function(f){this.pX=f.deltaX,this.pY=f.deltaY;var d=wa(f.direction);d&&(f.additionalEvent=this.options.event+d),this._super.emit.call(this,f)}});function $i(){Et.apply(this,arguments)}C($i,Et,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ie]},attrTest:function(f){return this._super.attrTest.call(this,f)&&(Math.abs(f.scale-1)>this.options.threshold||this.state&St)},emit:function(f){if(f.scale!==1){var d=f.scale<1?"in":"out";f.additionalEvent=this.options.event+d}this._super.emit.call(this,f)}});function Ji(){Vt.apply(this,arguments),this._timer=null,this._input=null}C(Ji,Vt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ga]},process:function(f){var d=this.options,w=f.pointers.length===d.pointers,v=f.distance<d.threshold,A=f.deltaTime>d.time;if(this._input=f,!v||!w||f.eventType&($|ct)&&!A)this.reset();else if(f.eventType&at)this.reset(),this._timer=u(function(){this.state=Ut,this.tryEmit()},d.time,this);else if(f.eventType&$)return Ut;return It},reset:function(){clearTimeout(this._timer)},emit:function(f){this.state===Ut&&(f&&f.eventType&$?this.manager.emit(this.options.event+"up",f):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Zi(){Et.apply(this,arguments)}C(Zi,Et,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ie]},attrTest:function(f){return this._super.attrTest.call(this,f)&&(Math.abs(f.rotation)>this.options.threshold||this.state&St)}});function Ki(){Et.apply(this,arguments)}C(Ki,Et,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:_t|se,pointers:1},getTouchAction:function(){return js.prototype.getTouchAction.call(this)},attrTest:function(f){var d=this.options.direction,w;return d&(_t|se)?w=f.overallVelocity:d&_t?w=f.overallVelocityX:d&se&&(w=f.overallVelocityY),this._super.attrTest.call(this,f)&&d&f.offsetDirection&&f.distance>this.options.threshold&&f.maxPointers==this.options.pointers&&c(w)>this.options.velocity&&f.eventType&$},emit:function(f){var d=wa(f.offsetDirection);d&&this.manager.emit(this.options.event+d,f),this.manager.emit(this.options.event,f)}});function Xs(){Vt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}C(Xs,Vt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Hi]},process:function(f){var d=this.options,w=f.pointers.length===d.pointers,v=f.distance<d.threshold,A=f.deltaTime<d.time;if(this.reset(),f.eventType&at&&this.count===0)return this.failTimeout();if(v&&A&&w){if(f.eventType!=$)return this.failTimeout();var _=this.pTime?f.timeStamp-this.pTime<d.interval:!0,G=!this.pCenter||Fs(this.pCenter,f.center)<d.posThreshold;this.pTime=f.timeStamp,this.pCenter=f.center,!G||!_?this.count=1:this.count+=1,this._input=f;var K=this.count%d.taps;if(K===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=Ut,this.tryEmit()},d.interval,this),St):Ut}return It},failTimeout:function(){return this._timer=u(function(){this.state=It},this.options.interval,this),It},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Ut&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function zt(f,d){return d=d||{},d.recognizers=F(d.recognizers,zt.defaults.preset),new Qi(f,d)}zt.VERSION="2.0.7",zt.defaults={domEvents:!1,touchAction:pa,enable:!0,inputTarget:null,inputClass:null,preset:[[Zi,{enable:!1}],[$i,{enable:!1},["rotate"]],[Ki,{direction:_t}],[js,{direction:_t},["swipe"]],[Xs],[Xs,{event:"doubletap",taps:2},["tap"]],[Ji]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Ku=1,xa=2;function Qi(f,d){this.options=x({},zt.defaults,d||{}),this.options.inputTarget=this.options.inputTarget||f,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=f,this.input=Du(this),this.touchAction=new Wi(this,this.options.touchAction),ba(this,!0),y(this.options.recognizers,function(w){var v=this.add(new w[0](w[1]));w[2]&&v.recognizeWith(w[2]),w[3]&&v.requireFailure(w[3])},this)}Qi.prototype={set:function(f){return x(this.options,f),f.touchAction&&this.touchAction.update(),f.inputTarget&&(this.input.destroy(),this.input.target=f.inputTarget,this.input.init()),this},stop:function(f){this.session.stopped=f?xa:Ku},recognize:function(f){var d=this.session;if(!d.stopped){this.touchAction.preventDefaults(f);var w,v=this.recognizers,A=d.curRecognizer;(!A||A&&A.state&Ut)&&(A=d.curRecognizer=null);for(var _=0;_<v.length;)w=v[_],d.stopped!==xa&&(!A||w==A||w.canRecognizeWith(A))?w.recognize(f):w.reset(),!A&&w.state&(St|Te|Zt)&&(A=d.curRecognizer=w),_++}},get:function(f){if(f instanceof Vt)return f;for(var d=this.recognizers,w=0;w<d.length;w++)if(d[w].options.event==f)return d[w];return null},add:function(f){if(g(f,"add",this))return this;var d=this.get(f.options.event);return d&&this.remove(d),this.recognizers.push(f),f.manager=this,this.touchAction.update(),f},remove:function(f){if(g(f,"remove",this))return this;if(f=this.get(f),f){var d=this.recognizers,w=q(d,f);w!==-1&&(d.splice(w,1),this.touchAction.update())}return this},on:function(f,d){if(f!==n&&d!==n){var w=this.handlers;return y(Y(f),function(v){w[v]=w[v]||[],w[v].push(d)}),this}},off:function(f,d){if(f!==n){var w=this.handlers;return y(Y(f),function(v){d?w[v]&&w[v].splice(q(w[v],d),1):delete w[v]}),this}},emit:function(f,d){this.options.domEvents&&Qu(f,d);var w=this.handlers[f]&&this.handlers[f].slice();if(!(!w||!w.length)){d.type=f,d.preventDefault=function(){d.srcEvent.preventDefault()};for(var v=0;v<w.length;)w[v](d),v++}},destroy:function(){this.element&&ba(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function ba(f,d){var w=f.element;if(w.style){var v;y(f.options.cssProps,function(A,_){v=ht(w.style,_),d?(f.oldCssProps[v]=w.style[v],w.style[v]=A):w.style[v]=f.oldCssProps[v]||""}),d||(f.oldCssProps={})}}function Qu(f,d){var w=e.createEvent("Event");w.initEvent(f,!0,!0),w.gesture=d,d.target.dispatchEvent(w)}x(zt,{INPUT_START:at,INPUT_MOVE:ee,INPUT_END:$,INPUT_CANCEL:ct,STATE_POSSIBLE:Vs,STATE_BEGAN:St,STATE_CHANGED:Te,STATE_ENDED:Zt,STATE_RECOGNIZED:Ut,STATE_CANCELLED:Qe,STATE_FAILED:It,DIRECTION_NONE:Ls,DIRECTION_LEFT:He,DIRECTION_RIGHT:We,DIRECTION_UP:$e,DIRECTION_DOWN:Je,DIRECTION_HORIZONTAL:_t,DIRECTION_VERTICAL:se,DIRECTION_ALL:sa,Manager:Qi,Input:vt,TouchAction:Wi,TouchInput:Gs,MouseInput:Bs,PointerEventInput:Yi,TouchMouseInput:qi,SingleTouchInput:la,Recognizer:Vt,AttrRecognizer:Et,Tap:Xs,Pan:js,Swipe:Ki,Pinch:$i,Rotate:Zi,Press:Ji,on:L,off:V,each:y,merge:S,extend:b,assign:x,inherit:C,bindFn:M,prefixed:ht});var tf=typeof t<"u"?t:typeof self<"u"?self:{};tf.Hammer=zt,typeof n=="function"&&n.amd?n(function(){return zt}):i.exports?i.exports=zt:t[s]=zt})(window,document,"Hammer")})(On);var Ao=On.exports;const Do=Po(Ao);class ut extends H{radius;constructor(t){super(t),this.radius=t?.radius||0}getBoundingClientRect(){return new Q({x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2})}toSVGPathData(){return this.radius?[["M",this.x,this.y-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:["M",this.x,this.y]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.radius===t.radius&&this.mass===t.mass}midPointBtw(t){return{x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2}}length(){return hs(this.x,this.y)}scalar(t){return this.x*=t,this.y*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y;return{x:s*t.x-e*t.y,y:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y}}div(t){return{x:this.x/t.x,y:this.y/t.y}}add(t){return{x:this.x+t.x,y:this.y+t.y}}sub(t){return{x:this.x-t.x,y:this.y-t.y}}dot(t){return this.x*t.x+this.y*t.y}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y}}clone(t){return new ut({x:t.x,y:t.y,radius:t.radius,mass:t.mass})}checkCollision(t){const e=t.x-this.x,s=t.y-this.y;if(Math.sqrt(e*e+s*s)<this.radius+t.radius){const r=Math.atan2(s,e),a={x:0,y:0},o=Ct(-r,e,s),h=Ct(-r,this.vx,this.vy),c=Ct(-r,t.vx,t.vy),l=h.x-c.x;h.x=((this.mass-t.mass)*h.x+2*t.mass*c.x)/(this.mass+t.mass),c.x=l+h.x;const u=Math.abs(h.x)+Math.abs(c.x),g=this.radius+t.radius-Math.abs(a.x-o.x);a.x+=h.x/u*g,o.x+=c.x/u*g;const y=Ct(r,a.x,a.y),m=Ct(r,o.x,o.y);t.x=this.x+m.x,t.y=this.y+m.y,this.x=this.x+y.x,this.y=this.y+y.y;const x=Ct(r,h.x,h.y),b=Ct(r,c.x,c.y);this.vx=x.x,this.vy=x.y,t.vx=b.x,t.vy=b.y}}checkWalls(t,e){const s=e?.bounce??-1,n=t.x,r=t.y,a=t.x+t.width,o=t.y+t.height;this.x+this.radius>a?(this.x=a-this.radius,this.vx*=s):this.x-this.radius<n&&(this.x=n+this.radius,this.vx*=s),this.y+this.radius>o?(this.y=o-this.radius,this.vy*=s):this.y-this.radius<r&&(this.y=r+this.radius,this.vy*=s)}static comboMove(t,e,s){t.forEach(r=>{r.nextFrame(),e&&r.checkWalls(e,s)});const n=t.length;for(let r=0,a=n-1;r<a;r++){const o=t[r];for(let h,c=r+1;c<n;c++)h=t[c],o.checkCollision(h)}}}class Rn{constructor(){}static getFormatKeyNames(t){const e=ei(),s=[];return t.ctrl&&s.push(e?"Cmd":"Ctrl"),t.shift&&s.push("Shift"),t.alt&&s.push("Alt"),typeof t.key=="string"?s.push(qs(t.key)):Array.isArray(t.key)&&(t.key.map(n=>qs(n)),s.push(...t.key)),s}static matchKeyScheme(t,e){const s=t.ctrl??!1,n=t.shift??!1,r=t.alt??!1;if(t.exact)return(s===e.metaKey||s===e.ctrlKey)&&n===e.shiftKey&&r===e.altKey;const a=[];return s&&a.push(s===e.metaKey||s===e.ctrlKey),n&&a.push(n===e.shiftKey),r&&a.push(r===e.altKey),a.every(o=>o)}static on(t,e){if(t?.key===void 0||t?.key===null)return e;const s=t?.target??window;let n=!1;const r=this.getFormatKeyNames(t),a=o=>{if(o.stopPropagation(),!n&&o.key!=="Control"&&o.key!=="Meta"&&o.key!=="Shift"&&o.key!=="Option"&&o.key!=="Alt"&&r.find(h=>h.toLowerCase()===o.key.toLowerCase())&&this.matchKeyScheme(t,o)){o.preventDefault();const h=e(o);if(typeof h!="function")return;const c=l=>{l.preventDefault(),h(l),s.removeEventListener("keyup",c)};s.addEventListener("keyup",c)}};return e.title=t?.title??"",e.formatedKeyNames=r,e.pause=()=>n=!0,e.restart=()=>n=!1,e.removeListener=()=>s.removeEventListener("keydown",a),s.addEventListener("keydown",a),e}}let mt;const le=[];class Me extends ns{container;width;height;mousePoint;hammer;domEventBusRemoves=[];constructor(t=document.documentElement,e=!0){super(),this.container=t,this.width=this.container.offsetWidth,this.height=this.container.offsetHeight;const s=D.getStyle(this.container,"position");D.setStyle(this.container,{position:s=="static"?"relative":s}),this.hammer=new Do(this.container),this.mousePoint=new ut({x:0,y:0}),e&&this.start()}emitDebounce=Ba((t,...e)=>super.emit(t,...e),50);emit(t,...e){switch(t){case"panLeft":case"panRight":this.emitDebounce(t,...e);break;default:super.emit(t,...e);break}return this}static get page(){if(mt)return mt;mt=new Me,window.addEventListener("hashchange",()=>{mt.emit("hashchange",location.hash)}),window.addEventListener("popstate",()=>{mt.emit("popstate")}),mt.registerKeyDown({title:"打开",key:"o",ctrl:!0,exact:!0},()=>{pn().then(e=>rs(e[0])).then(e=>{mt.emit("openFile",e)}).catch(e=>{mt.emit("openFileError",e)})}),mt.registerMatchMediaChange("(prefers-color-scheme: dark)");const t=()=>le.forEach(e=>e());return mt.registerGlobalScrollChange=e=>{le.push(e),le.length==1&&document.addEventListener("scroll",t)},mt.removeGlobalScrollChange=e=>{const s=le.findIndex(n=>n==e);s>=0&&(le.splice(s,1),le.length==0&&document.removeEventListener("scroll",t))},mt}start(){this.registerMouseEventListeners(),this.registerInputEventListeners(),this.registerTransitionEventListeners(),this.on("pointerMove",this.setMousePoint),this.addDOMEventBusRemoves(()=>{this.off("pointerMove",this.setMousePoint)}),this.registerResizeObserver(),this.registerElementDisplayInParent()}restart(){this.destroy(),this.start()}destroy(){this.domEventBusRemoves.forEach(t=>t()),this.domEventBusRemoves=[],this.removeAllListeners()}addDOMEventBusRemoves(t){this.domEventBusRemoves.push(t)}setMousePoint(t){const e=bn(this.container,t);return this.mousePoint.x=e.x,this.mousePoint.y=e.y,e}registerMouseEventListeners(){const t=P=>{this.emit("mouseDown",P)},e=P=>{this.emit("mouseUp",P)},s=P=>{this.emit("mouseMove",P)},n=P=>{this.emit("mouseOver",P)},r=P=>{this.emit("mouseOut",P)},a=P=>{this.emit("mouseClick",P)},o=P=>{this.emit("mouseDoubleClick",P)},h=P=>{this.emit("mouseWheel",P)},c=P=>{this.emit("mouseContextMenu",P)},l=P=>{this.emit("touchStart",P)},u=P=>{this.emit("touchEnd",P)},g=P=>{this.emit("touchCancel",P)},y=P=>{this.emit("touchMove",P)},m=P=>{this.emit("pointerDown",P)},x=P=>{this.emit("pointerUp",P)},b=P=>{this.emit("pointerCancel",P)},S=P=>{this.emit("pointerMove",P)},C=P=>{this.emit("pan",P)},M=P=>{this.emit("panStart",P)},O=P=>{this.emit("panMove",P)},F=P=>{this.emit("panEnd",P)},L=P=>{this.emit("panCancel",P)},V=P=>{this.emit("panLeft",P)},Z=P=>{this.emit("panRight",P)},X=P=>{this.emit("panUp",P)},Y=P=>{this.emit("panDown",P)},q=P=>{this.emit("pinch",P)},it=P=>{this.emit("press",P)},xt=P=>{this.emit("rotate",P)},ht=P=>{this.emit("swipe",P)},Se=P=>{this.emit("swipeLeft",P)},$t=P=>{this.emit("swipeRight",P)},te=P=>{this.emit("swipeUp",P)},Ce=P=>{this.emit("swipeDown",P)},I=P=>{this.emit("tap",P)},k=P=>{!P.target||this.container==P.target||this.container.contains(P.target)||this.emit("tapOutSide",P)};this.container.addEventListener("mousedown",t),this.container.addEventListener("mouseup",e),this.container.addEventListener("mousemove",s),this.container.addEventListener("mouseover",n),this.container.addEventListener("mouseout",r),this.container.addEventListener("click",a),this.container.addEventListener("dblclick",o),this.container.addEventListener("wheel",h),this.container.addEventListener("contextmenu",c),this.container.addEventListener("touchstart",l),this.container.addEventListener("touchend",u),this.container.addEventListener("touchcancel",g),this.container.addEventListener("touchmove",y),this.container.addEventListener("pointerdown",m),this.container.addEventListener("pointerup",x),this.container.addEventListener("pointercancel",b),this.container.addEventListener("pointermove",S),this.hammer.on("pan",C),this.hammer.on("panstart",M),this.hammer.on("panmove",O),this.hammer.on("panend",F),this.hammer.on("pancancel",L),this.hammer.on("panleft",V),this.hammer.on("panright",Z),this.hammer.on("panup",X),this.hammer.on("pandown",Y),this.hammer.on("pinch",q),this.hammer.on("press",it),this.hammer.on("rotate",xt),this.hammer.on("swipe",ht),this.hammer.on("swipeleft",Se),this.hammer.on("swiperight",$t),this.hammer.on("swipeup",te),this.hammer.on("swipedown",Ce),this.hammer.on("tap",I),document.addEventListener("pointerdown",k,!1);const B=()=>{this.container.removeEventListener("mousedown",t),this.container.removeEventListener("mouseup",e),this.container.removeEventListener("mousemove",s),this.container.removeEventListener("mouseover",n),this.container.removeEventListener("mouseout",r),this.container.removeEventListener("click",a),this.container.removeEventListener("dblclick",o),this.container.removeEventListener("wheel",h),this.container.removeEventListener("contextmenu",c),this.container.removeEventListener("touchstart",l),this.container.removeEventListener("touchend",u),this.container.removeEventListener("touchcancel",g),this.container.removeEventListener("touchmove",y),this.container.removeEventListener("pointerdown",m),this.container.removeEventListener("pointerup",x),this.container.removeEventListener("pointercancel",b),this.container.removeEventListener("pointermove",S),this.hammer.off("pan",C),this.hammer.off("panstart",M),this.hammer.off("panmove",O),this.hammer.off("panend",F),this.hammer.off("pancancel",L),this.hammer.off("panleft",V),this.hammer.off("panright",Z),this.hammer.off("panup",X),this.hammer.off("pandown",Y),this.hammer.off("pinch",q),this.hammer.off("press",it),this.hammer.off("rotate",xt),this.hammer.off("swipe",ht),this.hammer.off("swipeleft",Se),this.hammer.off("swiperight",$t),this.hammer.off("swipeup",te),this.hammer.off("swipedown",Ce),this.hammer.off("tap",I),document.removeEventListener("pointerdown",k,!1),document.removeEventListener("touchstart",k,!1),document.removeEventListener("mousedown",k,!1)};return this.addDOMEventBusRemoves(B),B}registerInputEventListeners(){const t=h=>{this.emit("inputChange",h,this.container.files)},e=h=>{this.emit("dragstart",h)},s=h=>{h.stopPropagation(),h.preventDefault(),h.dataTransfer&&(h.dataTransfer.dropEffect="copy"),this.emit("dragover",h)},n=h=>{this.emit("dragenter",h)},r=h=>{this.emit("dragend",h)},a=h=>{h.stopPropagation(),h.preventDefault(),h.dataTransfer,this.emit("drop",h,h.dataTransfer?.files)};this.container instanceof HTMLInputElement&&this.container.addEventListener("change",t,!1),this.container.addEventListener("dragstart",e,!1),this.container.addEventListener("dragover",s,!1),this.container.addEventListener("dragenter",n,!1),this.container.addEventListener("dragend",r,!1),this.container.addEventListener("drop",a,!1);const o=()=>{this.container instanceof HTMLInputElement&&this.container.removeEventListener("change",t,!1),this.container.removeEventListener("dragstart",e,!1),this.container.removeEventListener("dragover",s,!1),this.container.removeEventListener("dragenter",n,!1),this.container.removeEventListener("dragend",r,!1),this.container.removeEventListener("drop",a,!1)};return this.addDOMEventBusRemoves(o),o}registerTransitionEventListeners(){const t=s=>{this.emit("transitionend",s)};this.container.addEventListener("transitionend",t);const e=()=>{this.container.removeEventListener("transitionend",t)};return this.addDOMEventBusRemoves(e),e}registerKeyDown(t,e,s){const n=Rn.on(t,a=>(e(a,n.formatedKeyNames,n.pause,n.restart),s)),r=()=>{n.removeListener?.()};return this.addDOMEventBusRemoves(r),r}registerResizeObserver(){const t=new ResizeObserver(s=>{const{width:n,height:r}=s[0].contentRect;this.width=n,this.height=r,this.emit("resize",n,r)});t.observe(this.container);const e=()=>{t.unobserve(this.container)};return this.addDOMEventBusRemoves(e),e}registerMatchMediaChange(t){let e="";switch(t){case"(prefers-color-scheme: dark)":e="matchMediaChangePrefersColorSchemeDark";break;default:e=t;break}const s=r=>{this.emit(e,r.matches)};window.matchMedia(t).addEventListener("change",s);const n=()=>{window.matchMedia(t).removeEventListener("change",s)};return this.addDOMEventBusRemoves(n),n}registerElementDisplayInParent(t){const e={threshold:t?.threshold||.5,root:t?.parentElement},s=new IntersectionObserver((r,a)=>{let o=r[0];if(r.length>1){const c=r.find(l=>l.isIntersecting);c&&(o=c)}o.isIntersecting&&o.intersectionRatio>=e.threshold?this.emit("showInParent"):this.emit("showOffParent")},e);s.observe(this.container);const n=()=>{s.unobserve(this.container)};return this.addDOMEventBusRemoves(n),n}registerPullDownRefresh(t){const e=t?.distance||50;let s=0,n=0;return this.captureMove({start:r=>{s=this.setMousePoint(r).y},move:()=>{n=this.mousePoint.y-s,n>0&&n<e&&this.emit("pullDownIng",n)},end:()=>{n>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;let s=0,n=0;return this.captureMove({start:r=>{s=this.setMousePoint(r).y},move:()=>{n=s-this.mousePoint.y,n>0&&n<e&&this.emit("pullUpIng",n)},end:()=>{n>=e&&this.emit("pullUp")}})}static isTouchEnabled(){return"ontouchstart"in window||navigator.maxTouchPoints>0}captureMove(t){return this.captureMoveUsePointer(t)}captureMoveUsePointer(t){const e=a=>{this.container.setPointerCapture(a.pointerId),t?.start?.(a)},s=a=>{t?.end?.(a)},n=a=>{t?.move?.(a)};this.on("pointerDown",e),this.on("pointerUp",s),this.on("pointerCancel",s),this.on("pointerMove",n);const r=()=>{this.off("pointerDown",e),this.off("pointerUp",s),this.off("pointerCancel",s),this.off("pointerMove",n)};return this.addDOMEventBusRemoves(r),r}captureMoveUseMouse(t){const e=a=>{document.addEventListener("mousemove",n,!1),document.addEventListener("mouseup",s,!1),t?.start?.(a)},s=a=>{document.removeEventListener("mousemove",n,!1),document.removeEventListener("mouseup",s,!1),t?.end?.(a)},n=a=>{t?.move?.(a)};this.on("mouseDown",e);const r=()=>{this.off("mouseDown",e)};return this.addDOMEventBusRemoves(r),r}captureMoveUseTouch(t){const e=a=>{a.preventDefault(),t?.start?.(a)},s=a=>{t?.end?.(a)},n=a=>{t?.move?.(a)};this.on("touchStart",e),this.on("touchEnd",s),this.on("touchCancel",s),this.on("touchMove",n);const r=()=>{this.off("touchStart",e),this.off("touchEnd",s),this.off("touchCancel",s),this.off("touchMove",n)};return this.addDOMEventBusRemoves(r),r}static getMouseButton(t){if(document.implementation.hasFeature("MouseEvents","2.0"))return t.button;switch(t.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}}class _e{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{e.target}),this.video.srcObject=t}captureWebCamera(){navigator.mediaDevices.getUserMedia({video:!0}).then(t=>{this.setSrcObject(t)})}static async videoMediaChangeSupport(){return new Promise(t=>{const e=document.createElement("iframe"),s=document.createElement("video"),n=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),n.src=URL.createObjectURL(r),n.media="(min-width:10px)",s.append(n),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(s),setTimeout(()=>{e.width="15"}),setTimeout(()=>{e.remove(),t(!1)},1e3)})}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(()=>{_e.setAutoPlayWhenClick(t),e(!1)})})}static setAutoPlayWhenClick(t){function e(){t.autoplay=!0,t.play(),document.removeEventListener("click",e),document.removeEventListener("touchend",e)}document.addEventListener("click",e),document.addEventListener("touchend",e)}}class Ln extends ns{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=nn(this.source);if(t===0){this.emit("finish");return}let e,s,n=rn(this.source,0);for(let r=1;r<t;r++)e=s,s=n,n=rn(this.source,r),this.raw+=s,s&&this.step(s,n,e);n&&this.step(n,void 0,s),this.emit("finish")}step(t,e,s){t==`
|
|
25
|
+
`&&this.emit("newline"),this.act(t,e,s)}act(t,e,s){switch(this.mode){case"text":switch(t){case"<":case"eof":this.nodename="",this.attrs={},this.mode="tag name start",this.raw=this.raw.slice(0,-1),this.textchunk&&this.emit("text",this.textchunk),this.raw+=t,this.textchunk="";break;case"&":this.mode="entity",this.entity="";break;default:this.textchunk+=t;break}break;case"entity":Rt("whitespace",t)?(this.textchunk+=D.entity2text(this.entity),this.mode="text"):t==";"?(this.textchunk+=D.entity2text(this.entity+t),this.mode="text"):this.entity+=t;break;case"special":if(s=="!"&&t=="-"&&e=="-"){this.mode="comment start";break}if(this.textchunk=="[CDATA"&&t=="["){this.mode="cdata",this.textchunk="";break}if(t==">"||t=="eof"){this.emit("special",this.textchunk),this.mode="text",this.textchunk="";break}this.textchunk+=t;break;case"cdata":if(s=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,s)),this.textchunk+=t;break;case"cdata end":this.emit("cdata",this.textchunk),this.textchunk="",this.mode="text";break;case"comment start":e==">"||t=="eof"?(this.emit("comment",""),this.mode="skip"):this.mode="comment";break;case"skip":this.mode="text";break;case"comment":t=="-"&&s=="-"&&e==">"?(this.mode="comment end",this.textchunk=this.textchunk.slice(0,-1)):t=="eof"?this.emit("comment",this.textchunk):this.textchunk+=t;break;case"comment end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"declaration":if(t=="?"&&e==">"){this.mode="declaration end";break}t=="eof"&&this.emit("comment",this.textchunk),this.textchunk+=t;break;case"declaration end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"tag name start":if(t=="eof"){this.emit("text","<");break}if(!Rt("whitespace",t)){if(this.mode="tag name",t=="/"){this.mode="close tag name start";break}else if(t=="!"){this.mode="special",this.textchunk="";break}else if(t=="?"){this.mode="declaration";break}this.act(t,e,s)}break;case"close tag name start":Rt("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,s));break;case"close tag name":if(Rt("whitespace",t))this.tagname=this.nodename;else switch(t){case">":this.emit("/tag",this.tagname||this.nodename,this.attrs),this.mode="text";break;default:!this.tagname&&(this.nodename+=t);break}break;case"tag name":if(Rt("whitespace",t))this.tagname=this.nodename,this.nodename="",this.mode="attr start";else switch(t){case">":this.emit("tag",this.nodename,this.attrs),this.mode="text";break;case"/":this.raw+=e,this.emit("tag",this.nodename,this.attrs),this.emit("/tag",this.nodename,this.attrs),this.mode="skip";break;default:this.nodename+=t;break}break;case"attr start":Rt("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,s));break;case"attr":if(Rt("whitespace",t)||t=="=")this.attrs[this.nodename]="",this.mode="attr value start";else switch(t){case">":this.nodename=="/"?(delete this.attrs["/"],this.emit("tag",this.tagname,this.attrs),this.emit("/tag",this.tagname,this.attrs)):(this.nodename&&(this.attrs[this.nodename]=""),this.emit("tag",this.tagname,this.attrs)),this.mode="text";break;default:this.nodename+=t;break}break;case"attr value start":if(!Rt("whitespace",t)){if(this.mode="attr value",this.quote="",t=="'"||t=='"'){this.quote=t;return}this.act(t,e,s)}break;case"attr value":if(Rt("whitespace",t)&&!this.quote)this.mode="attr start";else if(t==">"&&!this.quote)this.emit("tag",this.tagname,this.attrs),this.mode="text";else switch(t){case'"':case"'":this.quote==t&&s!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function ai(i,t,e){if(typeof t<"u")window.localStorage.setItem(i,JSON.stringify({value:t,expires:typeof e=="number"?e:-1}));else{const s=window.localStorage.getItem(i);try{const n=JSON.parse(s||"");return"expires"in n&&parseInt(n.expires)>=0&&new Date().getTime()>parseInt(n.expires)?void 0:n.value||void 0}catch{return s||void 0}}}function ko(i,t,e){const s=new Date;s.setTime(s.getTime()+e*24*60*60*1e3);const n="expires="+s.toUTCString();document.cookie=i+"="+t+"; "+n}function Mo(i){const t=i+"=",e=document.cookie.split(";");for(let s=0,n=e.length;s<n;s++){const r=e[s].trim();if(r.indexOf(t)==0)return r.substring(t.length,r.length)}return""}const _o=()=>document.cookie.split(";").map(i=>i.split("=")).reduce((i,[t,e])=>(i[t.trim().replace('"',"")]=e,i),{}),Io=()=>document.cookie.split(";").forEach(i=>document.cookie=i.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));Me.page.on("matchMediaChangePrefersColorSchemeDark",i=>{us(i?"dark":"light")}),Nn();function us(i){ai("colorScheme",i),document.documentElement.classList.toggle("dark",i=="dark")}function Nn(){const i=ai("colorScheme");if(i=="dark"||i=="light")return us(i),i;{const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return us(t),t}}const oi={safeAreaTop:D.getCSSVar("--safe-area-inset-top"),safeAreaRight:D.getCSSVar("--safe-area-inset-right"),safeAreaBottom:D.getCSSVar("--safe-area-inset-bottom"),safeAreaLeft:D.getCSSVar("--safe-area-inset-left"),colorPrimary:D.getCSSVar("--color-primary")||"#5078f0",colorRed:D.getCSSVar("--color-red")||"#ff5050",colorOrange:D.getCSSVar("--color-orange")||"#fa8c00",colorYellow:D.getCSSVar("--color-yellow")||"#fadc32",colorGreen:D.getCSSVar("--color-green")||"#00c878",colorBlue:D.getCSSVar("--color-blue")||"#00b4fa",colorPurple:D.getCSSVar("--color-purple")||"#6464fa",colorBlack:D.getCSSVar("--color-black")||"#001428",colorGray00:D.getCSSVar("--color-gray-00")||"#000000",colorGray33:D.getCSSVar("--color-gray-33")||"#333333",colorGray66:D.getCSSVar("--color-gray-66")||"#666666",colorGray99:D.getCSSVar("--color-gray-99")||"#999999",colorGrayCC:D.getCSSVar("--color-gray-cc")||"#cccccc",colorGrayDD:D.getCSSVar("--color-gray-dd")||"#dddddd",colorGrayE6:D.getCSSVar("--color-gray-e6")||"#e6e6e6",colorGrayEE:D.getCSSVar("--color-gray-ee")||"#eeeeee",colorGrayEF:D.getCSSVar("--color-gray-ef")||"#efefef",colorGrayF5:D.getCSSVar("--color-gray-f5")||"#f5f5f5",colorGrayFF:D.getCSSVar("--color-gray-ff")||"#ffffff",fontLineHeight:D.getCSSVar("--font-line-height")||"1,4",fontSize32:D.getCSSVar("--font-size-32")||"32px",fontSize24:D.getCSSVar("--font-size-24")||"24px",fontSize20:D.getCSSVar("--font-size-20")||"20px",fontSize18:D.getCSSVar("--font-size-18")||"18px",fontSize16:D.getCSSVar("--font-size-16")||"16px",fontSize14:D.getCSSVar("--font-size-14")||"14px",fontSize12:D.getCSSVar("--font-size-12")||"12px",fontSize11:D.getCSSVar("--font-size-11")||"11px",gap4:D.getCSSVar("--gap-4")||"4px",gap8:D.getCSSVar("--gap-8")||"8px",gap12:D.getCSSVar("--gap-12")||"12px",gap16:D.getCSSVar("--gap-16")||"16px",gap20:D.getCSSVar("--gap-20")||"20px",gap40:D.getCSSVar("--gap-40")||"40px",height44:D.getCSSVar("--height-44")||"44px",height32:D.getCSSVar("--height-32")||"32px",borderRadius:D.getCSSVar("--border-radius")||"4px"},Fn=["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff","#dc4916","#6871b1","#d1b935","#1bbc9b","#FF7F50","#4BBFC3","#ff9900"];function Dt(i,t){if(i.hasOwnProperty("r")&&i.hasOwnProperty("g")&&i.hasOwnProperty("b"))return i.r=Math.round(lt(i.r,0,255)),i.g=Math.round(lt(i.g,0,255)),i.b=Math.round(lt(i.b,0,255)),i.hasOwnProperty("a")?i.a=typeof t=="number"?t:i.a:i.a=typeof t=="number"?t:1,i.a=lt(i.a,0,1),i;const e={r:0,g:0,b:0,a:1};let s=-1;if(typeof i=="number")s=i;else if(typeof i=="string")if(i[0].toLowerCase()==="r"){const n=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,?\s*(\d?\.?\d*)?\s*\)/gi.exec(i);n&&(s=(parseInt(n[1])<<16)+(parseInt(n[2])<<8)+parseInt(n[3]),n[4]&&(e.a=jt(parseFloat(n[4]),2)))}else if(i[0]==="#")s=parseInt(i.slice(1,7),16),i.length>7&&(e.a=jt(parseInt(i.slice(7,9),16)/255,2));else throw new Error("getColor 不支持的颜色解析:"+i);return s>=0&&(e.r=s>>16&255,e.g=s>>8&255,e.b=s&255),typeof t=="number"&&(e.a=t),e.a=lt(e.a,0,1),e}function hi(i,t=!1){let e=Dt(i);return t?e=Dt(e.r*.299+e.g*.587+e.b*.114>186?"#000000":"#FFFFFF"):(e.r=255-e.r,e.g=255-e.g,e.b=255-e.b),e}function ci(i,t){const e=Dt(i,t);return e.a===1?`rgb(${e.r},${e.g},${e.b})`:`rgba(${e.r},${e.g},${e.b},${e.a})`}function Oo(i,t=!1){return ci(hi(i,t))}function fs(i){return Pa(i.toString(16),2,"0","left")}function ue(i,t){const e=Dt(i,t);let s=`#${fs(e.r)}${fs(e.g)}${fs(e.b)}`;return e.a===1?s:s+`${fs(Math.ceil(e.a*255))}`}function Bn(i,t=!1){return ue(hi(i,t))}const Gn=()=>Math.random()*16777215,Ro=()=>ue(Gn());function Lo(i,t){const e=Dt(i);return e.r==0&&(e.r=32),e.g==0&&(e.g=32),e.b==0&&(e.b=32),e.r=e.r*(100+t)/100,e.g=e.g*(100+t)/100,e.b=e.b*(100+t)/100,e.r=Math.round(lt(e.r,0,255)),e.g=Math.round(lt(e.g,0,255)),e.b=Math.round(lt(e.b,0,255)),ue(e)}function li(i,t,e){try{const s=Dt(i),n=Dt(t);return ue({r:(n.r-s.r)*e+s.r,g:(n.g-s.g)*e+s.g,b:(n.b-s.b)*e+s.b,a:(n.a-s.a)*e+s.a})}catch{return t}}function No(i,t,e,s){let n,r,a;i=i/360,t=t/100,e=e/100;const o=Math.floor(i*6),h=i*6-o,c=e*(1-t),l=e*(1-h*t),u=e*(1-(1-h)*t);switch(o%6){case 0:n=e,r=u,a=c;break;case 1:n=l,r=e,a=c;break;case 2:n=c,r=e,a=u;break;case 3:n=c,r=l,a=e;break;case 4:n=u,r=c,a=e;break;case 5:default:n=e,r=c,a=l;break}return{r:Math.round(n*255),g:Math.round(r*255),b:Math.round(a*255),opacity:s??1}}function Fo(i,t,e,s){i*=360;let n,r,a,o,h;return i=i%360/60,h=e*t,o=h*(1-Math.abs(i%2-1)),n=r=a=e-h,i=~~i,n+=[h,o,0,0,o,h][i],r+=[o,h,h,o,0,0][i],a+=[0,0,o,h,h,o][i],{r:n,g:r,b:a,opacity:s??1}}function Bo(i,t,e,s){(i>1||t>1||e>1)&&(i/=360,t/=100,e/=100),i*=360;var n,r,a,o,h;return i=i%360/60,h=2*t*(e<.5?e:1-e),o=h*(1-Math.abs(i%2-1)),n=r=a=e-h/2,i=~~i,n+=[h,o,0,0,o,h][i],r+=[o,h,h,o,0,0][i],a+=[0,0,o,h,h,o][i],{r:n,g:r,b:a,opacity:s??1}}function Go(i,t,e,s){const n=Math.max(i,t,e),r=Math.min(i,t,e),a=n-r,o=n===0?0:a/n,h=n/255;let c;switch(n){case r:c=0;break;case i:c=t-e+a*(t<e?6:0),c/=6*a;break;case t:c=e-i+a*2,c/=6*a;break;case e:default:c=i-t+a*4,c/=6*a;break}return{h:Math.round(c*360),s:Math.round(o*100),v:Math.round(h*100),opacity:s??1}}function Uo(i,t,e){let s,n,r,a;return r=Math.max(i,t,e),a=r-Math.min(i,t,e),s=a==0?0:r==i?(t-e)/a:r==t?(e-i)/a+2:(i-t)/a+4,s=(s+360)%6*60/360,n=a==0?0:a/r,{h:s,s:n,b:r}}function Vo(i,t,e){let s,n,r,a,o,h;return a=Math.max(i,t,e),o=Math.min(i,t,e),h=a-o,s=h==0?0:a==i?(t-e)/h:a==t?(e-i)/h+2:(i-t)/h+4,s=(s+360)%6*60/360,r=(a+o)/2,n=h==0?0:r<.5?h/(2*r):h/(2-2*r),{h:s,s:n,l:r}}function ds(i=window.location.href){return Ee(URL)?new URL(i):Un(i)}function Un(i=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",s="(?<pathname>(?:\\/[^/#?]+)*\\/?)",n="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${s}${n}${r}$`).exec(i);return{href:i,protocol:o?.groups?.protocol??"",host:o?.groups?.host??"",hostname:o?.groups?.hostname??"",port:o?.groups?.port??"",pathname:o?.groups?.pathname??"",search:o?.groups?.search??"",hash:o?.groups?.hash??""}}function zo(i){const t=ds(i);return t.protocol==="http:"||t.protocol==="https:"}function Vn(i=window.location.href){const t=ds(i),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function jo(i=ds().search){i=decodeURIComponent(i).replace(/^[#?&]/,"");const t={};if(!i)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let s=e.exec(i);for(;s;)t[s[1]]=s[2],s=e.exec(i);return t}function zn(i){return"?"+Object.entries(i).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function jn(i){return"?"+[...i.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function Xo(i,t){return i.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function Xn(i,t){return i+t.replace(/^[&?]/,i.indexOf("?")>=0?"&":"?")}function Yo(i){if(typeof setImmediate<"u"&&os(setImmediate))setImmediate(i);else if(typeof MessageChannel<"u"&&(os(MessageChannel)||MessageChannel.toString()==="[object MessageChannelConstructor]")){const{port1:t,port2:e}=new MessageChannel;e.onmessage=i,t.postMessage(null)}else typeof Promise<"u"&&os(Promise)?Promise.resolve().then(i):setTimeout(i,0)}function fe(){return typeof performance=="object"&&typeof performance.now=="function"?performance.now():Date.now()}(function(){let i=fe();window.requestAnimationFrame||(window.requestAnimationFrame=function(t){const e=fe(),s=Math.max(0,16-(e-i)),n=window.setTimeout(function(){t(e+s)},s);return i=e+s,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})})();const Yn=i=>{let t=!1;return window.requestAnimationFrame(function e(s){i(s),t||window.requestAnimationFrame(e)}),()=>{t=!0}};class qo{id=0;cbs={};cancelAnimateCycle;constructor(){}get length(){return Object.keys(this.cbs).length}run(t){this.cbs[this.id++]=t,!this.cancelAnimateCycle&&(this.cancelAnimateCycle=Yn(e=>{const s=[];for(let n in this.cbs)this.cbs[n](e)===!1&&s.push(parseInt(n));for(let n of s)delete this.cbs[n];!this.length&&this.cancelAnimateCycle&&(this.cancelAnimateCycle(),this.cancelAnimateCycle=void 0)}))}runAccurateSetTimeout(t,e=0){let s=!1,n=fe();return this.run(r=>s?!1:r-n>=e?(t(),!1):!0),()=>{s=!0}}}const de=new qo,Ft=new es;function Ho(i,t,e){const s=Ft.get(i);s&&s.timeout&&clearTimeout(s.timeout);const n={key:i,cb:t};return e?.timeout&&(n.timeout=setTimeout(()=>{Ft.delete(n.key),n.cb()},e.timeout)),Ft.set(n.key,n),ui(),n}let me=!1;function qn(){me||(me=!0,requestIdleCallback(i=>{for(me=!1,console.log("idle call",i);i.timeRemaining()>0&&Ft.length>0;){const t=Ft.shift();t&&(t.cb(),t.timeout&&clearTimeout(t.timeout))}Ft.length>0&&qn()}))}function ui(){me||(me=!0,Wn(i=>{for(me=!1,console.log("yz idle call",i);i.timeRemaining()>0&&Ft.length>0;){const t=Ft.shift();t&&(t.cb(),t.timeout&&clearTimeout(t.timeout))}Ft.length>0&&ui()}))}let ms,fi=!1,di=!1,mi=33,Ie=33,ps=0;const Hn=new MessageChannel,Wo=Hn.port2;Hn.port1.onmessage=i=>{di=!1,ms!==null&&(ms({didTimeout:ps<=fe(),timeRemaining:()=>Math.max(0,ps-fe())}),ms=null)};function Wn(i){return ms=i,fi?0:(fi=!0,requestAnimationFrame(t=>{fi=!1;let e=t-ps+Ie;e<Ie&&mi<Ie?(e<8&&(e=8),Ie=Math.max(mi,e)):mi=e,ps=t+Ie,di||(di=!0,Wo.postMessage(null))}))}function $o(i){return cancelAnimationFrame(i)}class Jo{worker;cbs={};constructor(t){if(Pn)try{this.worker=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){throw e}else throw new Error("Your environment do not support Worker !")}postMessage(t,e=[]){this.worker.postMessage(t,e)}onmessage(t){this.worker.addEventListener("message",t)}offmessage(t){this.worker.removeEventListener("message",t)}onmessageerror(t){this.worker.addEventListener("messageerror",t)}offmessageerror(t){this.worker.removeEventListener("messageerror",t)}postCanvas(t){const e=t.transferControlToOffscreen();this.worker.postMessage({canvas:e},[e])}postPort(t){this.worker.postMessage({port:t},[t])}postReset(){this.worker.postMessage({reset:!0});for(const t in this.cbs)this.cbs[t](),delete this.cbs[t]}fire(t,e){return new Promise(s=>{if(e){const n=Math.random().toString(36).slice(2),r=a=>{a.data.id===n&&(this.worker.removeEventListener("message",r),delete this.cbs[n],e(),s())};this.cbs[n]=r.bind(this,{data:{id:n}}),this.worker.addEventListener("message",r),this.worker.postMessage({...t,id:n})}else this.worker.postMessage(t),s()})}}class Zo{port1;port2;port1MessageCbs=[];port2MessageCbs=[];port1MessageErrorCbs=[];port2MessageErrorCbs=[];constructor(){const{port1:t,port2:e}=new MessageChannel;this.port1=t,this.port2=e,this.port1.addEventListener("message",s=>{this.port1MessageCbs.forEach(n=>n(this.port1,s))}),this.port1.addEventListener("messageerror",s=>{this.port1MessageErrorCbs.forEach(n=>n(this.port1,s))}),this.port1.start(),this.port2.addEventListener("message",s=>{this.port2MessageCbs.forEach(n=>n(this.port2,s))}),this.port2.addEventListener("messageerror",s=>{this.port2MessageErrorCbs.forEach(n=>n(this.port2,s))}),this.port2.start()}close(){this.port1.close(),this.port2.close()}onPort1Message(t){this.port1MessageCbs.push(t)}onPort1MessageError(t){this.port1MessageErrorCbs.push(t)}offPort1Message(t){is(this.port1MessageCbs,t)}offPort1MessageError(t){is(this.port1MessageErrorCbs,t)}onPort2Message(t){this.port2MessageCbs.push(t)}onPort2MessageError(t){this.port2MessageErrorCbs.push(t)}offPort2Message(t){is(this.port2MessageCbs,t)}offPort2MessageError(t){is(this.port2MessageErrorCbs,t)}}function $n(){let i=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0;e<t.length;e++)try{i=new window.ActiveXObject(t[e]);break}catch{continue}}else i=new XMLHttpRequest;return i}function Ko(i){return new Promise((t,e)=>{fetch(i,{}).then(s=>s.text()).then(t).catch(e)})}function Qo(i,t){return new Promise((e,s)=>{const{method:n="GET",data:r={},segments:a=[],headers:o={},withCredentials:h=!1,responseType:c="json",timeout:l=3e4}=t||{},u=$n();u.timeout=l,u.responseType=c,u.onreadystatechange=function(C){u.readyState===4&&(u.status===200?e(u.response):s(u.statusText))},u.ontimeout=function(){s(`${i} is timed out for ${l}ms.`)},u.addEventListener("error",function(C){s(C)},!1),u.addEventListener("progress",function(C){if(C.lengthComputable){const M=Math.round(C.loaded*100/C.total);t?.progress?.(M,u)}},!1),u.addEventListener("load",function(C){t?.load?.(C,u)},!1),u.addEventListener("loadstart",function(C){t?.loadstart?.(C,u)},!1),u.addEventListener("loadend",function(C){t?.loadend?.(C,u)},!1),u.addEventListener("abort",function(C){t?.abort?.(C,u)},!1);const g=n.toUpperCase();Object.assign(o,{Accept:"*/*"});const y="---------------------------"+Date.now().toString(16);let m=!1,x=!1,b=!1;function S(){h&&(u.withCredentials=!0);for(const C in o)nt(C).toLowerCase()=="content-type"&&o[C].toLowerCase()=="multipart/form-data"?(m=!0,u.setRequestHeader("Content-Type","multipart/form-data; boundary="+y)):(nt(C).toLowerCase()=="content-type"&&(o[C].toLowerCase().indexOf("text/plain")>=0?x=!0:o[C].toLowerCase().indexOf("application/json")>=0&&(b=!0)),u.setRequestHeader(C,o[C]))}switch(g){case"GET":let C="";r instanceof FormData?C=jn(r):C=zn(r),u.open("GET",Xn(i,C),!0),S(),u.send(null);break;case"POST":default:u.open(g,i,!0),S(),m&&a.length?u.sendAsBinary("--"+y+`\r
|
|
26
26
|
`+a.join("--"+y+`\r
|
|
27
27
|
`)+"--"+y+`--\r
|
|
28
|
-
`):b?
|
|
29
|
-
`:"&"));break}})}async function
|
|
30
|
-
Content-Type: `+
|
|
28
|
+
`):b?u.send(JSON.stringify(r)):u.send(Object.entries(r).map(([M,O])=>`${encodeURIComponent(M)}=${encodeURIComponent(O)}`).join(x?`\r
|
|
29
|
+
`:"&"));break}})}async function th(i){const t={url:"",data:{},segments:[],contentType:""};if(!i.action)return t;t.url=i.action;const e=i.method.toLowerCase()==="post";t.contentType=e&&i.enctype?i.enctype:"application/x-www-form-urlencoded";const s=t.contentType=="multipart/form-data";for(let n=0;n<i.elements.length;n++){const r=i.elements[n];if(!r.hasAttribute("name"))continue;const a=r.nodeName.toUpperCase()==="INPUT"&&r.getAttribute("type")?r.getAttribute("type").toUpperCase():"";if(a==="FILE"){const o=r.files?r.files.length:0;if(o==0)continue;if(s)for(let h=0;h<o;h++){const c=r.files[h],l=await rs(c,"binaryString");t.segments.push('Content-Disposition: form-data; name="'+r.name+'"; filename="'+c.name+`"\r
|
|
30
|
+
Content-Type: `+c.type+`\r
|
|
31
31
|
\r
|
|
32
32
|
`+l+`\r
|
|
33
|
-
`)}else for(let
|
|
33
|
+
`)}else for(let h=0;h<o;h++)t.data[r.name]=r.files[h].name}else(a!=="RADIO"&&a!=="CHECKBOX"||(a=="RADIO"||a=="CHECKBOX")&&r.checked)&&(s?t.segments.push('Content-Disposition: form-data; name="'+r.name+`"\r
|
|
34
34
|
\r
|
|
35
35
|
`+r.value+`\r
|
|
36
|
-
`):t.data[r.name]=r.value)}return t}function Ei(n,t){return function(){return n.apply(t,arguments)}}const{toString:vo}=Object.prototype,{getPrototypeOf:Hs}=Object,ss=(n=>t=>{const e=vo.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Pt=n=>(n=n.toLowerCase(),t=>ss(t)===n),ns=n=>t=>typeof t===n,{isArray:re}=Array,Te=ns("undefined");function bo(n){return n!==null&&!Te(n)&&n.constructor!==null&&!Te(n.constructor)&&pt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const Pi=Pt("ArrayBuffer");function xo(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&Pi(n.buffer),t}const So=ns("string"),pt=ns("function"),Ai=ns("number"),is=n=>n!==null&&typeof n=="object",Co=n=>n===!0||n===!1,rs=n=>{if(ss(n)!=="object")return!1;const t=Hs(n);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},To=Pt("Date"),Eo=Pt("File"),Po=Pt("Blob"),Ao=Pt("FileList"),_o=n=>is(n)&&pt(n.pipe),Do=n=>{let t;return n&&(typeof FormData=="function"&&n instanceof FormData||pt(n.append)&&((t=ss(n))==="formdata"||t==="object"&&pt(n.toString)&&n.toString()==="[object FormData]"))},ko=Pt("URLSearchParams"),Io=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ee(n,t,{allOwnKeys:e=!1}={}){if(n===null||typeof n>"u")return;let s,i;if(typeof n!="object"&&(n=[n]),re(n))for(s=0,i=n.length;s<i;s++)t.call(null,n[s],s,n);else{const r=e?Object.getOwnPropertyNames(n):Object.keys(n),a=r.length;let o;for(s=0;s<a;s++)o=r[s],t.call(null,n[o],o,n)}}function _i(n,t){t=t.toLowerCase();const e=Object.keys(n);let s=e.length,i;for(;s-- >0;)if(i=e[s],t===i.toLowerCase())return i;return null}const Di=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),ki=n=>!Te(n)&&n!==Di;function Ws(){const{caseless:n}=ki(this)&&this||{},t={},e=(s,i)=>{const r=n&&_i(t,i)||i;rs(t[r])&&rs(s)?t[r]=Ws(t[r],s):rs(s)?t[r]=Ws({},s):re(s)?t[r]=s.slice():t[r]=s};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Ee(arguments[s],e);return t}const Mo=(n,t,e,{allOwnKeys:s}={})=>(Ee(t,(i,r)=>{e&&pt(i)?n[r]=Ei(i,e):n[r]=i},{allOwnKeys:s}),n),Ro=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Oo=(n,t,e,s)=>{n.prototype=Object.create(t.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:t.prototype}),e&&Object.assign(n.prototype,e)},Lo=(n,t,e,s)=>{let i,r,a;const o={};if(t=t||{},n==null)return t;do{for(i=Object.getOwnPropertyNames(n),r=i.length;r-- >0;)a=i[r],(!s||s(a,n,t))&&!o[a]&&(t[a]=n[a],o[a]=!0);n=e!==!1&&Hs(n)}while(n&&(!e||e(n,t))&&n!==Object.prototype);return t},No=(n,t,e)=>{n=String(n),(e===void 0||e>n.length)&&(e=n.length),e-=t.length;const s=n.indexOf(t,e);return s!==-1&&s===e},Fo=n=>{if(!n)return null;if(re(n))return n;let t=n.length;if(!Ai(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=n[t];return e},Bo=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&Hs(Uint8Array)),Uo=(n,t)=>{const s=(n&&n[Symbol.iterator]).call(n);let i;for(;(i=s.next())&&!i.done;){const r=i.value;t.call(n,r[0],r[1])}},Vo=(n,t)=>{let e;const s=[];for(;(e=n.exec(t))!==null;)s.push(e);return s},Go=Pt("HTMLFormElement"),zo=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,i){return s.toUpperCase()+i}),Ii=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),jo=Pt("RegExp"),Mi=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),s={};Ee(e,(i,r)=>{let a;(a=t(i,r,n))!==!1&&(s[r]=a||i)}),Object.defineProperties(n,s)},Xo=n=>{Mi(n,(t,e)=>{if(pt(n)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=n[e];if(pt(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},qo=(n,t)=>{const e={},s=i=>{i.forEach(r=>{e[r]=!0})};return re(n)?s(n):s(String(n).split(t)),e},Yo=()=>{},Ho=(n,t)=>(n=+n,Number.isFinite(n)?n:t),$s="abcdefghijklmnopqrstuvwxyz",Ri="0123456789",Oi={DIGIT:Ri,ALPHA:$s,ALPHA_DIGIT:$s+$s.toUpperCase()+Ri},Wo=(n=16,t=Oi.ALPHA_DIGIT)=>{let e="";const{length:s}=t;for(;n--;)e+=t[Math.random()*s|0];return e};function $o(n){return!!(n&&pt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const Jo=n=>{const t=new Array(10),e=(s,i)=>{if(is(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[i]=s;const r=re(s)?[]:{};return Ee(s,(a,o)=>{const c=e(a,i+1);!Te(c)&&(r[o]=c)}),t[i]=void 0,r}}return s};return e(n,0)},Zo=Pt("AsyncFunction"),E={isArray:re,isArrayBuffer:Pi,isBuffer:bo,isFormData:Do,isArrayBufferView:xo,isString:So,isNumber:Ai,isBoolean:Co,isObject:is,isPlainObject:rs,isUndefined:Te,isDate:To,isFile:Eo,isBlob:Po,isRegExp:jo,isFunction:pt,isStream:_o,isURLSearchParams:ko,isTypedArray:Bo,isFileList:Ao,forEach:Ee,merge:Ws,extend:Mo,trim:Io,stripBOM:Ro,inherits:Oo,toFlatObject:Lo,kindOf:ss,kindOfTest:Pt,endsWith:No,toArray:Fo,forEachEntry:Uo,matchAll:Vo,isHTMLForm:Go,hasOwnProperty:Ii,hasOwnProp:Ii,reduceDescriptors:Mi,freezeMethods:Xo,toObjectSet:qo,toCamelCase:zo,noop:Yo,toFiniteNumber:Ho,findKey:_i,global:Di,isContextDefined:ki,ALPHABET:Oi,generateString:Wo,isSpecCompliantForm:$o,toJSONObject:Jo,isAsyncFn:Zo,isThenable:n=>n&&(is(n)||pt(n))&&pt(n.then)&&pt(n.catch)};function B(n,t,e,s,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),s&&(this.request=s),i&&(this.response=i)}E.inherits(B,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:E.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Li=B.prototype,Ni={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{Ni[n]={value:n}}),Object.defineProperties(B,Ni),Object.defineProperty(Li,"isAxiosError",{value:!0}),B.from=(n,t,e,s,i,r)=>{const a=Object.create(Li);return E.toFlatObject(n,a,function(c){return c!==Error.prototype},o=>o!=="isAxiosError"),B.call(a,n.message,t,e,s,i),a.cause=n,a.name=n.name,r&&Object.assign(a,r),a};const Ko=null;function Js(n){return E.isPlainObject(n)||E.isArray(n)}function Fi(n){return E.endsWith(n,"[]")?n.slice(0,-2):n}function Bi(n,t,e){return n?n.concat(t).map(function(i,r){return i=Fi(i),!e&&r?"["+i+"]":i}).join(e?".":""):t}function Qo(n){return E.isArray(n)&&!n.some(Js)}const tc=E.toFlatObject(E,{},null,function(t){return/^is[A-Z]/.test(t)});function as(n,t,e){if(!E.isObject(n))throw new TypeError("target must be an object");t=t||new FormData,e=E.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,b){return!E.isUndefined(b[v])});const s=e.metaTokens,i=e.visitor||l,r=e.dots,a=e.indexes,c=(e.Blob||typeof Blob<"u"&&Blob)&&E.isSpecCompliantForm(t);if(!E.isFunction(i))throw new TypeError("visitor must be a function");function h(m){if(m===null)return"";if(E.isDate(m))return m.toISOString();if(!c&&E.isBlob(m))throw new B("Blob is not supported. Use a Buffer instead.");return E.isArrayBuffer(m)||E.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function l(m,v,b){let S=m;if(m&&!b&&typeof m=="object"){if(E.endsWith(v,"{}"))v=s?v:v.slice(0,-2),m=JSON.stringify(m);else if(E.isArray(m)&&Qo(m)||(E.isFileList(m)||E.endsWith(v,"[]"))&&(S=E.toArray(m)))return v=Fi(v),S.forEach(function(k,R){!(E.isUndefined(k)||k===null)&&t.append(a===!0?Bi([v],R,r):a===null?v:v+"[]",h(k))}),!1}return Js(m)?!0:(t.append(Bi(b,v,r),h(m)),!1)}const f=[],g=Object.assign(tc,{defaultVisitor:l,convertValue:h,isVisitable:Js});function y(m,v){if(!E.isUndefined(m)){if(f.indexOf(m)!==-1)throw Error("Circular reference detected in "+v.join("."));f.push(m),E.forEach(m,function(S,C){(!(E.isUndefined(S)||S===null)&&i.call(t,S,E.isString(C)?C.trim():C,v,g))===!0&&y(S,v?v.concat(C):[C])}),f.pop()}}if(!E.isObject(n))throw new TypeError("data must be an object");return y(n),t}function Ui(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Zs(n,t){this._pairs=[],n&&as(n,this,t)}const Vi=Zs.prototype;Vi.append=function(t,e){this._pairs.push([t,e])},Vi.toString=function(t){const e=t?function(s){return t.call(this,s,Ui)}:Ui;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function ec(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Gi(n,t,e){if(!t)return n;const s=e&&e.encode||ec,i=e&&e.serialize;let r;if(i?r=i(t,e):r=E.isURLSearchParams(t)?t.toString():new Zs(t,e).toString(s),r){const a=n.indexOf("#");a!==-1&&(n=n.slice(0,a)),n+=(n.indexOf("?")===-1?"?":"&")+r}return n}class sc{constructor(){this.handlers=[]}use(t,e,s){return this.handlers.push({fulfilled:t,rejected:e,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){E.forEach(this.handlers,function(s){s!==null&&t(s)})}}const zi=sc,ji={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},nc=typeof URLSearchParams<"u"?URLSearchParams:Zs,ic=typeof FormData<"u"?FormData:null,rc=typeof Blob<"u"?Blob:null,ac=(()=>{let n;return typeof navigator<"u"&&((n=navigator.product)==="ReactNative"||n==="NativeScript"||n==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),oc=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),At={isBrowser:!0,classes:{URLSearchParams:nc,FormData:ic,Blob:rc},isStandardBrowserEnv:ac,isStandardBrowserWebWorkerEnv:oc,protocols:["http","https","file","blob","url","data"]};function cc(n,t){return as(n,new At.classes.URLSearchParams,Object.assign({visitor:function(e,s,i,r){return At.isNode&&E.isBuffer(e)?(this.append(s,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function hc(n){return E.matchAll(/\w+|\[(\w*)]/g,n).map(t=>t[0]==="[]"?"":t[1]||t[0])}function lc(n){const t={},e=Object.keys(n);let s;const i=e.length;let r;for(s=0;s<i;s++)r=e[s],t[r]=n[r];return t}function Xi(n){function t(e,s,i,r){let a=e[r++];const o=Number.isFinite(+a),c=r>=e.length;return a=!a&&E.isArray(i)?i.length:a,c?(E.hasOwnProp(i,a)?i[a]=[i[a],s]:i[a]=s,!o):((!i[a]||!E.isObject(i[a]))&&(i[a]=[]),t(e,s,i[a],r)&&E.isArray(i[a])&&(i[a]=lc(i[a])),!o)}if(E.isFormData(n)&&E.isFunction(n.entries)){const e={};return E.forEachEntry(n,(s,i)=>{t(hc(s),i,e,0)}),e}return null}function uc(n,t,e){if(E.isString(n))try{return(t||JSON.parse)(n),E.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(e||JSON.stringify)(n)}const Ks={transitional:ji,adapter:["xhr","http"],transformRequest:[function(t,e){const s=e.getContentType()||"",i=s.indexOf("application/json")>-1,r=E.isObject(t);if(r&&E.isHTMLForm(t)&&(t=new FormData(t)),E.isFormData(t))return i&&i?JSON.stringify(Xi(t)):t;if(E.isArrayBuffer(t)||E.isBuffer(t)||E.isStream(t)||E.isFile(t)||E.isBlob(t))return t;if(E.isArrayBufferView(t))return t.buffer;if(E.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(r){if(s.indexOf("application/x-www-form-urlencoded")>-1)return cc(t,this.formSerializer).toString();if((o=E.isFileList(t))||s.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return as(o?{"files[]":t}:t,c&&new c,this.formSerializer)}}return r||i?(e.setContentType("application/json",!1),uc(t)):t}],transformResponse:[function(t){const e=this.transitional||Ks.transitional,s=e&&e.forcedJSONParsing,i=this.responseType==="json";if(t&&E.isString(t)&&(s&&!this.responseType||i)){const a=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?B.from(o,B.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:At.classes.FormData,Blob:At.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};E.forEach(["delete","get","head","post","put","patch"],n=>{Ks.headers[n]={}});const Qs=Ks,fc=E.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),dc=n=>{const t={};let e,s,i;return n&&n.split(`
|
|
37
|
-
`).forEach(function(a){
|
|
38
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(
|
|
39
|
-
`+r.map(
|
|
40
|
-
`):" "+$i(r[0]):"as no adapter specified";throw new B("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:sn};function nn(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Ae(null,n)}function Zi(n){return nn(n),n.headers=Lt.from(n.headers),n.data=en.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),Ji.getAdapter(n.adapter||Qs.adapter)(n).then(function(s){return nn(n),s.data=en.call(n,n.transformResponse,s),s.headers=Lt.from(s.headers),s},function(s){return Yi(s)||(nn(n),s&&s.response&&(s.response.data=en.call(n,n.transformResponse,s.response),s.response.headers=Lt.from(s.response.headers))),Promise.reject(s)})}const Ki=n=>n instanceof Lt?n.toJSON():n;function ae(n,t){t=t||{};const e={};function s(h,l,f){return E.isPlainObject(h)&&E.isPlainObject(l)?E.merge.call({caseless:f},h,l):E.isPlainObject(l)?E.merge({},l):E.isArray(l)?l.slice():l}function i(h,l,f){if(E.isUndefined(l)){if(!E.isUndefined(h))return s(void 0,h,f)}else return s(h,l,f)}function r(h,l){if(!E.isUndefined(l))return s(void 0,l)}function a(h,l){if(E.isUndefined(l)){if(!E.isUndefined(h))return s(void 0,h)}else return s(void 0,l)}function o(h,l,f){if(f in t)return s(h,l);if(f in n)return s(void 0,h)}const c={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(h,l)=>i(Ki(h),Ki(l),!0)};return E.forEach(Object.keys(Object.assign({},n,t)),function(l){const f=c[l]||i,g=f(n[l],t[l],l);E.isUndefined(g)&&f!==o||(e[l]=g)}),e}const Qi="1.5.1",rn={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{rn[n]=function(s){return typeof s===n||"a"+(t<1?"n ":" ")+n}});const tr={};rn.transitional=function(t,e,s){function i(r,a){return"[Axios v"+Qi+"] Transitional option '"+r+"'"+a+(s?". "+s:"")}return(r,a,o)=>{if(t===!1)throw new B(i(a," has been removed"+(e?" in "+e:"")),B.ERR_DEPRECATED);return e&&!tr[a]&&(tr[a]=!0,console.warn(i(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,a,o):!0}};function Pc(n,t,e){if(typeof n!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let i=s.length;for(;i-- >0;){const r=s[i],a=t[r];if(a){const o=n[r],c=o===void 0||a(o,r,n);if(c!==!0)throw new B("option "+r+" must be "+c,B.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new B("Unknown option "+r,B.ERR_BAD_OPTION)}}const an={assertOptions:Pc,validators:rn},jt=an.validators;class hs{constructor(t){this.defaults=t,this.interceptors={request:new zi,response:new zi}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=ae(this.defaults,e);const{transitional:s,paramsSerializer:i,headers:r}=e;s!==void 0&&an.assertOptions(s,{silentJSONParsing:jt.transitional(jt.boolean),forcedJSONParsing:jt.transitional(jt.boolean),clarifyTimeoutError:jt.transitional(jt.boolean)},!1),i!=null&&(E.isFunction(i)?e.paramsSerializer={serialize:i}:an.assertOptions(i,{encode:jt.function,serialize:jt.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&E.merge(r.common,r[e.method]);r&&E.forEach(["delete","get","head","post","put","patch","common"],m=>{delete r[m]}),e.headers=Lt.concat(a,r);const o=[];let c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(e)===!1||(c=c&&v.synchronous,o.unshift(v.fulfilled,v.rejected))});const h=[];this.interceptors.response.forEach(function(v){h.push(v.fulfilled,v.rejected)});let l,f=0,g;if(!c){const m=[Zi.bind(this),void 0];for(m.unshift.apply(m,o),m.push.apply(m,h),g=m.length,l=Promise.resolve(e);f<g;)l=l.then(m[f++],m[f++]);return l}g=o.length;let y=e;for(f=0;f<g;){const m=o[f++],v=o[f++];try{y=m(y)}catch(b){v.call(this,b);break}}try{l=Zi.call(this,y)}catch(m){return Promise.reject(m)}for(f=0,g=h.length;f<g;)l=l.then(h[f++],h[f++]);return l}getUri(t){t=ae(this.defaults,t);const e=Hi(t.baseURL,t.url);return Gi(e,t.params,t.paramsSerializer)}}E.forEach(["delete","get","head","options"],function(t){hs.prototype[t]=function(e,s){return this.request(ae(s||{},{method:t,url:e,data:(s||{}).data}))}}),E.forEach(["post","put","patch"],function(t){function e(s){return function(r,a,o){return this.request(ae(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}hs.prototype[t]=e(),hs.prototype[t+"Form"]=e(!0)});const ls=hs;class on{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const s=this;this.promise.then(i=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](i);s._listeners=null}),this.promise.then=i=>{let r;const a=new Promise(o=>{s.subscribe(o),r=o}).then(i);return a.cancel=function(){s.unsubscribe(r)},a},t(function(r,a,o){s.reason||(s.reason=new Ae(r,a,o),e(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}static source(){let t;return{token:new on(function(i){t=i}),cancel:t}}}const Ac=on;function _c(n){return function(e){return n.apply(null,e)}}function Dc(n){return E.isObject(n)&&n.isAxiosError===!0}const cn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(cn).forEach(([n,t])=>{cn[t]=n});const kc=cn;function er(n){const t=new ls(n),e=Ei(ls.prototype.request,t);return E.extend(e,ls.prototype,t,{allOwnKeys:!0}),E.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return er(ae(n,i))},e}const W=er(Qs);W.Axios=ls,W.CanceledError=Ae,W.CancelToken=Ac,W.isCancel=Yi,W.VERSION=Qi,W.toFormData=as,W.AxiosError=B,W.Cancel=W.CanceledError,W.all=function(t){return Promise.all(t)},W.spread=_c,W.isAxiosError=Dc,W.mergeConfig=ae,W.AxiosHeaders=Lt,W.formToJSON=n=>Xi(E.isHTMLForm(n)?new FormData(n):n),W.getAdapter=Ji.getAdapter,W.HttpStatusCode=kc,W.default=W;const Ic=W,Xt=window.crypto.subtle;Xt||console.warn("Crypto API not supported");function sr(n){return Wr(encodeURIComponent(n)).replaceAll("+","*").replaceAll("/","-").replaceAll("=","")}function nr(n){let t=n.replaceAll("*","+").replaceAll("-","/");const e=t.length%4;return e&&(t=t.padEnd(t.length+(4-e),"=")),decodeURIComponent($r(t))}function Mc(n){return sr(ea(n))}function Rc(n){return ta(nr(n))}function us(n){return new TextEncoder().encode(n)}function ir(n,t="utf-8"){return new TextDecoder(t).decode(n)}async function Oc(n,t="AES-GCM"){const e=crypto.getRandomValues(new Uint8Array(12)),s=await Xt.generateKey({name:t,length:256},!1,["encrypt","decrypt"]),i=await Xt.encrypt({name:t,iv:e},s,us(n));return{algorithm:t,iv:e,key:s,encryptedData:i}}async function Lc(n){const t=await Xt.decrypt({name:n.algorithm,iv:n.iv},n.key,n.encryptedData);return ir(t)}async function Nc(n,t="ECDSA",e="SHA-384"){const{privateKey:s,publicKey:i}=await Xt.generateKey({name:t,namedCurve:"P-384"},!1,["sign","verify"]),r=us(JSON.stringify(n)),a=await Xt.sign({name:t,hash:{name:e}},s,r);return{algorithm:t,hash:e,publicKey:i,signature:a,encodedData:r}}async function Fc(n){return await Xt.verify({name:n.algorithm,hash:{name:n.hash}},n.publicKey,n.signature,n.encodedData)}async function rr(n,t="SHA-256"){const e=await Xt.digest(t,us(n));return sa(e)}async function ar(n,t="SHA-256"){const e=JSON.stringify(n);return rr(e,t)}class Bc{instance;interceptors;requestCanceler;constructor(t){this.instance=Ic.create(t),this.interceptors=t?.interceptors,this.requestCanceler=new or,this.instance.interceptors.request.use(e=>(this.requestCanceler.pendingRequest(e),e),e=>(this.requestCanceler.cancelRequest(e.config),e)),this.instance.interceptors.request.use(this.interceptors?.requestInterceptor,this.interceptors?.requestInterceptorCatch),this.instance.interceptors.response.use(this.interceptors?.responseInterceptor,this.interceptors?.responseInterceptorCatch),this.instance.interceptors.response.use(e=>new Promise((s,i)=>{this.requestCanceler.confirmRequest(e.config),e.status===200?s(e.data):i(e.data)}),async e=>{const{code:s="",config:i}=e;return!i||!i.retry||!i.retryStatus?.includes(s)||(i.retryCounted=i.retryCounted??0,i.retryCounted>=i.retry)?Promise.reject(e):(i.retryCounted++,await new Promise(r=>{setTimeout(()=>{r(void 0)},i.retryDelay)}),await this.request(i))})}request(t){return new Promise((e,s)=>{try{t.interceptors?.requestInterceptor&&(t=t.interceptors?.requestInterceptor(t)),this.instance.request(t).then(i=>{t.interceptors?.responseInterceptor&&(i=t.interceptors.responseInterceptor(i)),e(i)}).catch(i=>{t.interceptors?.responseInterceptorCatch&&(i=t.interceptors?.responseInterceptorCatch(i)),s(i)})}catch(i){t.interceptors?.requestInterceptorCatch&&t.interceptors.requestInterceptorCatch(i)}})}get(t,e){return this.request({...e,method:"get",url:t})}delete(t,e){return this.request({...e,method:"delete",url:t})}head(t,e){return this.request({...e,method:"head",url:t})}options(t,e){return this.request({...e,method:"options",url:t})}post(t,e,s){return this.request({...s,method:"post",url:t,data:e})}put(t,e,s){return this.request({...s,method:"put",url:t,data:e})}patch(t,e,s){return this.request({...s,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class or{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}async pendingRequest(t){const e=await this.getRequestId(t);if(this.pendingRequestMap.has(e))t.signal=this.pendingRequestMap.get(e)?.signal;else{const s=new AbortController;t.signal=s.signal,this.pendingRequestMap.set(e,s)}}async confirmRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&this.pendingRequestMap.delete(e)}async cancelRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&(this.pendingRequestMap.get(e)?.abort(),this.pendingRequestMap.delete(e))}async cancelAllRequest(){for(const t of this.pendingRequestMap.values())t.abort();this.pendingRequestMap.clear()}async getRequestId(t){const{url:e,method:s,params:i,data:r}=t;return await ar({url:e,method:s,params:i,data:r})}}const fs=new Map;async function Uc(n){return new Promise((t,e)=>{ds(n,(s,i)=>s?e(s):t({width:i.width,height:i.height,aspectRatio:i.width/i.height}))})}const ds=(n,t)=>{if(fs.has(n))return t(null,fs.get(n));const e=new Image;e.onload=function(){fs.set(n,{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height,element:e}),t(null,fs.get(n))},e.onerror=function(s){t(s,null)},e.src=n},Vc=(n,t)=>{for(let e=0,s=n.length;e<s;e++){const i=n[e],{type:r}=i;if(r.split("/")[0]!=="image")continue;const a=new FileReader;a.onload=function(o){if(!o.target)return t("no reader target",null);const c=o.target.result,h=Vn(c),l=new Blob([c]);hn(l,(f,g)=>{if(!g)return t(f,null);ds(g,(y,m)=>{if(!m)return t(y,null);cr(g,(v,b)=>{if(!b)return t(v,null);const S={name:i.name,fileType:h,size:i.size,width:m.width,height:m.height,imgUrl:g,imageData:b,blob:l};return t(null,S)})})})},a.readAsArrayBuffer(i)}},cr=(n,t)=>{ds(n,(e,s)=>{if(!s)return t(e,null);const i=document.createElement("canvas"),r=i.getContext("2d");i.width=s.width,i.height=s.height,r.drawImage(s.element,0,0,i.width,i.height);const a=r.getImageData(0,0,i.width,i.height);return t(null,a)})},Gc=(n,t=0,e=0)=>{const s=document.createElement("canvas"),i=s.getContext("2d");return s.width=t,s.height=e,i.drawImage(n,0,0,t,e),i.getImageData(0,0,t,e)},zc=(n,t=0,e=0)=>{const s=document.createElement("canvas"),i=s.getContext("2d");return s.width=t,s.height=e,i.drawImage(n,0,0,t,e),i.getImageData(0,0,t,e)},jc=n=>{const t=n.width,e=n.height,s=t*e*3,i=s+54,r=[66,77,i&255,i>>8&255,i>>16&255,i>>24&255,0,0,0,0,54,0,0,0],a=[40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,1,0,24,0,0,0,0,0,s&255,s>>8&255,s>>16&255,s>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=(4-t*3%4)%4,c=n.data;let h="";const l=t<<2;let f=e;const g=String.fromCharCode;do{const m=l*(f-1);let v="";for(let b=0;b<t;b++){const S=b<<2;v+=g(c[m+S+2])+g(c[m+S+1])+g(c[m+S])}for(let b=0;b<o;b++)v+=String.fromCharCode(0);h+=v}while(--f);function y(m){if(!window.btoa)throw"btoa undefined";let v="";if(typeof m=="string")v=m;else for(let b=0;b<m.length;b++)v+=String.fromCharCode(m[b]);return btoa(v)}return y(r.concat(a))+y(h)},Xc=n=>{const{width:t,height:e}=n,s=document.createElement("canvas"),i=s.getContext("2d");return s.width=t,s.height=e,i.putImageData(n,0,0,0,0,t,e),s.toDataURL("image/png")},qc=(n,t,e)=>{const{width:s,height:i}=n,r=document.createElement("canvas"),a=r.getContext("2d");r.width=s,r.height=i,a.putImageData(n,0,0,0,0,s,i);const o=`image/${t?t.toLowerCase():"png"}`;r.toBlob(c=>{e?.(null,c)},o,1)},hn=(n,t)=>{const e=new FileReader;e.onload=function(s){s.target?t(null,s.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(n)},Yc=(n,t)=>{hn(n,function(e,s){if(s){const i=new Image;i.src=s}else t(e)})};function Hc(n){const t=[],e=[],s=[];let i=0;for(let c=0,h=n.data.length;c<h;c+=4)t[i]=n.data[c],e[i]=n.data[c+1],s[i]=n.data[c+2],i+=1;const r=ln(t),a=ln(e),o=ln(s);return"rgb("+r+","+a+","+o+")"}function ln(n){const t={},e=[],s=[];for(let o=0;o<n.length;o++)t[n[o]]?e.push(n[o]):t[n[o]]=1;let i=0;for(let o=0;o<e.length;o++){i=0;for(let c=0;c<e.length;c++)e[o]===e[c]&&(i+=1),s[o]=i}const r=Math.max.apply(null,s);let a=0;for(;a<s.length;a++)if(s[a]===r)return;return e[a]}const Wc=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[(a*e+e-o-1)*4],i[c+1]=t[(a*e+e-o-1)*4+1],i[c+2]=t[(a*e+e-o-1)*4+2],i[c+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(i,e,s)},$c=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[((s-a-1)*e+o)*4],i[c+1]=t[((s-a-1)*e+o)*4+1],i[c+2]=t[((s-a-1)*e+o)*4+2],i[c+3]=t[((s-a-1)*e+o)*4+3]}return new ImageData(i,e,s)},Jc=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const c=(a*s+o)*4;i[c]=t[(o*e+e-a-1)*4],i[c+1]=t[(o*e+e-a-1)*4+1],i[c+2]=t[(o*e+e-a-1)*4+2],i[c+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(i,s,e)},Zc=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const c=(a*s+o)*4;i[c]=t[((s-o-1)*e+a)*4],i[c+1]=t[((s-o-1)*e+a)*4+1],i[c+2]=t[((s-o-1)*e+a)*4+2],i[c+3]=t[((s-o-1)*e+a)*4+3]}return new ImageData(i,s,e)},Kc=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,h=(t[c]+t[c+1]+t[c+2])/3;i[c]=h,i[c+1]=h,i[c+2]=h,i[c+3]=t[c+3]}return new ImageData(i,e,s)},Qc=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,h=.2126*t[c]+.7152*t[c+1]+.0722*t[c+2];i[c]=h,i[c+1]=h,i[c+2]=h,i[c+3]=t[c+3]}return new ImageData(i,e,s)},th=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,l=(t[c]+t[c+1]+t[c+2])/3>127?255:0;i[c]=l,i[c+1]=l,i[c+2]=l,i[c+3]=t[c+3]}return new ImageData(i,e,s)},eh=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=255-t[c],i[c+1]=255-t[c+1],i[c+2]=255-t[c+2],i[c+3]=t[c+3]}return new ImageData(i,e,s)},sh=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[c],i[c+1]=0,i[c+2]=0,i[c+3]=t[c+3]}return new ImageData(i,e,s)},nh=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=0,i[c+1]=t[c+1],i[c+2]=0,i[c+3]=t[c+3]}return new ImageData(i,e,s)},ih=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=0,i[c+1]=0,i[c+2]=t[c+2],i[c+3]=t[c+3]}return new ImageData(i,e,s)},rh=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[c],i[c+1]=t[c+1],i[c+2]=0,i[c+3]=t[c+3]}return new ImageData(i,e,s)},ah=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[c],i[c+1]=0,i[c+2]=t[c+1],i[c+3]=t[c+3]}return new ImageData(i,e,s)},oh=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=0,i[c+1]=t[c+1],i[c+2]=t[c+1],i[c+3]=t[c+3]}return new ImageData(i,e,s)},ch=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,h=(t[c+1]+t[c+2])/2;i[c]=t[c],i[c+1]=h,i[c+2]=h,i[c+3]=t[c+3]}return new ImageData(i,e,s)},hh=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,h=(t[c]+t[c+2])/2;i[c]=h,i[c+1]=t[c+1],i[c+2]=h,i[c+3]=t[c+3]}return new ImageData(i,e,s)},lh=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,h=(t[c]+t[c+1])/2;i[c]=h,i[c+1]=h,i[c+2]=t[c+2],i[c+3]=t[c+3]}return new ImageData(i,e,s)},uh=n=>hr(n,[-1,-1,-1,-1,9,-1,-1,-1,-1]),fh=n=>hr(n,[-1,-1,-1,-1,8,-1,-1,-1,-1]),dh=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[c],i[c+1]=t[c+1],i[c+2]=t[c+2],i[c+3]=255}return new ImageData(i,e,s)},mh=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;if(t[c+3]===0)i[c]=255,i[c+1]=255,i[c+2]=255,i[c+3]=255;else{const h=lr([t[c],t[c+1],t[c+2],t[c+3]],[255,255,255,255]);i[c]=h[0],i[c+1]=h[1],i[c+2]=h[2],i[c+3]=h[3]}}return new ImageData(i,e,s)},ph=(n,t,e,s,i,r=!1,a)=>{const{data:o,width:c,height:h}=n;let l=i,f=s,g=t,y=e;if(l<0?l=0:l>c&&(l=c),f<0?f=0:f>h&&(f=h),g<1?g=1:g>c&&(g=c),y<1?y=1:y>h&&(y=h),l+g>c&&(g=c-l),f+y>h&&(y=h-f),r){const m=new Uint8ClampedArray(o.length);for(let b=0;b<h;b++)for(let S=0;S<c;S++){const C=(b*c+S)*4;S>=l&&S<=l+g&&b>=f&&b<=f+y?(m[C]=o[C],m[C+1]=o[C+1],m[C+2]=o[C+2],m[C+3]=o[C+3]):(m[C]=255,m[C+1]=255,m[C+2]=255,m[C+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(m,c,h)}else{const m=new Uint8ClampedArray(g*y*4);for(let b=f;b<=f+y;b++)for(let S=l;S<=l+g;S++){const C=((b-f)*g+S-l)*4,k=(b*c+S)*4;m[C]=o[k],m[C+1]=o[k+1],m[C+2]=o[k+2],m[C+3]=o[k+3]}return new ImageData(m,g,y)}},gh=(n,t,e,s)=>{const{data:i,width:r,height:a}=n;let o=t;o>Math.floor(r/2)&&(o=Math.floor(r/2)),o>Math.floor(a/2)&&(o=Math.floor(a/2)),o<0&&(o=0);const c=new Uint8ClampedArray(i.length);for(let l=0;l<a;l++)for(let f=0;f<r;f++){const g=(l*r+f)*4;let y=-1;f<o?l<o?y=Math.sqrt(Math.pow(o-f-1,2)+Math.pow(o-l-1,2)):l>a-o-1&&(y=Math.sqrt(Math.pow(o-f-1,2)+Math.pow(l-(a-o),2))):f>r-o-1&&(l<o?y=Math.sqrt(Math.pow(f-(r-o),2)+Math.pow(o-l-1,2)):l>a-o-1&&(y=Math.sqrt(Math.pow(f-(r-o),2)+Math.pow(l-(a-o),2)))),Math.round(y)>o?(c[g]=255,c[g+1]=255,c[g+2]=255,c[g+3]=s||e.toUpperCase()==="PNG"?0:255):(c[g]=i[g],c[g+1]=i[g+1],c[g+2]=i[g+2],c[g+3]=s||e.toUpperCase()==="PNG"?i[g+3]:255)}return new ImageData(c,r,a)},yh=(n,t,e,s,i,r=1e4)=>{const a=new Image;a.src=n;const o=document.createElement("canvas"),c=o.getContext("2d");return o.width=r,o.height=r,c.drawImage(a,0,0,t,e,0,0,s,i),c.getImageData(0,0,s,i)},wh=(n,t)=>{const{data:e,width:s,height:i}=n,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;o++)for(let c=0;c<s;c++){const h=(o*s+c)*4;r[h]=Math.max(Math.min(e[h]+t,255),0),r[h+1]=Math.max(Math.min(e[h+1]+t,255),0),r[h+2]=Math.max(Math.min(e[h+2]+t,255),0),r[h+3]=e[h+3]}return new ImageData(r,s,i)},vh=(n,t,e=!1)=>{const{data:s,width:i,height:r}=n,a=new Uint8ClampedArray(s.length);for(let c=0;c<r;c++)for(let h=0;h<i;h++){const l=(c*i+h)*4;s[l+3]===0?(a[l]=255,a[l+1]=255,a[l+2]=255):(a[l]=s[l],a[l+1]=s[l+1],a[l+2]=s[l+2]);let f=s[l+3];e?f=Math.max(Math.min(Math.floor(255*t),255),0):f=Math.max(Math.min(Math.floor(f+255*t),255),0),a[l+3]=f}return new ImageData(a,i,r)},bh=(n,t,e,s)=>{const{data:i,width:r,height:a}=n,{data:o,width:c,height:h}=t;let l=e,f=s;e+h>a&&(l=a-h),s+c>r&&(f=r-c);const g=new Uint8ClampedArray(i.length);for(let m=0;m<a;m++)for(let v=0;v<r;v++){const b=(m*r+v)*4;if(v<f||v>f+c||m<=l||m>=l+h)g[b]=i[b],g[b+1]=i[b+1],g[b+2]=i[b+2],g[b+3]=i[b+3];else{const S=(m*r+v-((l+1)*r+(m-(l+1))*(r-c))+c-f-1)*4,C=[o[S],o[S+1],o[S+2],o[S+3]],k=[i[b],i[b+1],i[b+2],i[b+3]],R=lr(C,k);g[b]=R[0],g[b+1]=R[1],g[b+2]=R[2],g[b+3]=R[3]}}return new ImageData(g,r,a)},xh=(n,t,e,s,i,r=10)=>{const{data:a,width:o,height:c}=n;let h=i,l=s,f=t,g=e;h<0?h=0:h>o&&(h=o),l<0?l=0:l>c&&(l=c),f<1?f=1:f>o&&(f=o),g<1?g=1:g>c&&(g=c),h+f>o&&(f=o-h),l+g>c&&(g=c-l);const y=new Uint8ClampedArray(a.length);for(let v=0;v<c;v++)for(let b=0;b<o;b++){const S=(v*o+b)*4;if(b>=h&&b<=h+f&&v>=l&&v<=l+g){const C=Math.floor((b-h)/r),k=Math.floor((v-l)/r);let R=Math.floor(r*(C+1)-r/2+h),F=Math.floor(r*(k+1)-r/2+l);R>o-1&&(R=o-1),F>c-1&&(F=c-1);const L=(F*o+R)*4;y[S]=a[L],y[S+1]=a[L+1],y[S+2]=a[L+2],y[S+3]=a[L+3]}else y[S]=a[S],y[S+1]=a[S+1],y[S+2]=a[S+2],y[S+3]=a[S+3]}return new ImageData(y,o,c)},Sh=(n,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}})=>{if(t&&e){const{data:s,width:i,height:r}=n,{data:a}=t,o=new Uint8ClampedArray(s.length),{backgroundColor:c,changeIntoColor:h}=e;for(let f=0;f<r;f++)for(let g=0;g<i;g++){const y=(f*i+g)*4,m=a[y],v=a[y+1],b=a[y+2],S=a[y+3];m===c.r&&v===c.g&&b===c.b&&S===c.a&&h.a!==0?(o[y]=h.r,o[y+1]=h.g,o[y+2]=h.b,o[y+3]=h.a):(o[y]=s[y],o[y+1]=s[y+1],o[y+2]=s[y+2],o[y+3]=s[y+3])}return new ImageData(o,i,r)}return n},hr=(n,t)=>{const{data:e,width:s,height:i}=n,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;o++)for(let c=0;c<s;c++){const h=(o*s+c)*4;for(let l=0;l<3;l++){const f=h+l;c===0||c===s-1||o===0||o===i-1?r[f]=e[f]:r[f]=t[0]*e[f-s*4-4]+t[1]*e[f-s*4]+t[2]*e[f-s*4+4]+t[3]*e[f-4]+t[4]*e[f]+t[5]*e[f+4]+t[6]*e[f+s*4-4]+t[7]*e[f+s*4]+t[8]*e[f+s*4+4]}r[h+3]=e[h+3]}return new ImageData(r,s,i)},lr=(n,t)=>{if(n&&n.length===4&&t&&t.length===4){const e=n[3],s=t[3];if(e===255||s===0)return n;if(e===0)return t;{const i=e/255,r=s/255,a=Math.max(Math.min(Math.floor(n[0]*i+t[0]*r*(1-i)),255),0),o=Math.max(Math.min(Math.floor(n[1]*i+t[1]*r*(1-i)),255),0),c=Math.max(Math.min(Math.floor(n[2]*i+t[2]*r*(1-i)),255),0),h=Math.max(Math.min(Math.floor((i+r*(1-i))*255),255),0);return[a,o,c,h]}}return[255,255,255,255]},un=function(){const n=[];return{writeByte(t){n.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,s=t.length){for(let i=0;i<s;i++)this.writeByte(t[i+e])},writeString(t){for(let e=0,s=t.length;e<s;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return n},toString(){let t="[";for(let e=0,s=n.length;e<s;e++)e>0&&(t+=","),t+=n[e];return t+="]",t}}},ur=function(){let n=0,t=0,e=0,s="";const i=function(a){if(!(a<0)){if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47}throw new Error("n:"+a)},r=function(a){s+=String.fromCharCode(i(a&63))};return{writeByte(a){for(n=n<<8|a&255,t+=8,e+=1;t>=6;)r(n>>>t-6),t-=6},flush(){if(t>0&&(r(n<<6-t),n=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)s+="="}},toString(){return s}}},fr=function(n,t,e){const s=new Array(n*n),i=function(o){const c=o;let h=0,l=0;return{write(f,g){if(f>>>g)throw new Error("length over");for(;h+g>=8;)c.writeByte(255&(f<<h|l)),g-=8-h,f>>>=8-h,l=0,h=0;l=f<<h|l,h=h+g},flush(){h>0&&c.writeByte(l)}}},r=function(o){const c=1<<o,h=(1<<o)+1;let l=o+1;const f=a();for(let b=0;b<c;b++)f.add(String.fromCharCode(b));f.add(String.fromCharCode(c)),f.add(String.fromCharCode(h));const g=un(),y=i(g);y.write(c,l);let m=0,v=String.fromCharCode(s[m]);for(m+=1;m<s.length;){const b=String.fromCharCode(s[m]);m+=1,f.contains(v+b)?v=v+b:(y.write(f.indexOf(v),l),f.size()<4095&&(f.size()==1<<l&&(l+=1),f.add(v+b)),v=b)}return y.write(f.indexOf(v),l),y.write(h,l),y.flush(),g.toByteArray()},a=function(){const o={};let c=0;return{add(h){if(this.contains(h))throw new Error("dup key:"+h);o[h]=c,c+=1},size(){return c},indexOf(h){return o[h]},contains(h){return typeof o[h]<"u"}}};return{setPixel(o,c,h){s[c*n+o]=h},write(o){o.writeString("GIF87a"),o.writeShort(n),o.writeShort(n),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte($t("0x"+t[1]+t[2])),o.writeByte($t("0x"+t[3]+t[4])),o.writeByte($t("0x"+t[5]+t[6])),o.writeByte($t("0x"+e[1]+e[2])),o.writeByte($t("0x"+e[3]+e[4])),o.writeByte($t("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(n),o.writeShort(n),o.writeByte(0);const c=2,h=r(c);o.writeByte(c);let l=0;for(;h.length-l>255;)o.writeByte(255),o.writeBytes(h,l,255),l+=255;o.writeByte(h.length-l),o.writeBytes(h,l,h.length-l),o.writeByte(0),o.writeString(";")}}},dr=function(n,t,e,s){const i=fr(n,t,e);for(let h=0;h<n;h++)for(let l=0;l<n;l++)i.setPixel(l,h,s(l,h));const r=un();i.write(r);const a=ur(),o=r.toByteArray();for(let h=0,l=o.length;h<l;h++)a.writeByte(o[h]);a.flush();let c="";return c+="data:image/gif;base64,",c+=a,c},ft={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},_e={M:0,L:1,H:2,Q:3},qt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},K={glog:function(n){if(n<1)throw new Error("glog("+n+")");return K.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return K.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let n=0;n<8;n++)K.EXP_TABLE[n]=1<<n;for(let n=8;n<256;n++)K.EXP_TABLE[n]=K.EXP_TABLE[n-4]^K.EXP_TABLE[n-5]^K.EXP_TABLE[n-6]^K.EXP_TABLE[n-8];for(let n=0;n<255;n++)K.LOG_TABLE[K.EXP_TABLE[n]]=n;const z={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(n){let t=n<<10;for(;z.getBCHDigit(t)-z.getBCHDigit(z.G15)>=0;)t^=z.G15<<z.getBCHDigit(t)-z.getBCHDigit(z.G15);return(n<<10|t)^z.G15_MASK},getBCHTypeNumber:function(n){let t=n<<12;for(;z.getBCHDigit(t)-z.getBCHDigit(z.G18)>=0;)t^=z.G18<<z.getBCHDigit(t)-z.getBCHDigit(z.G18);return n<<12|t},getBCHDigit:function(n){let t=0;for(;n!=0;)t++,n>>>=1;return t},getPatternPosition:function(n){return z.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,t,e){switch(n){case qt.PATTERN000:return(t+e)%2==0;case qt.PATTERN001:return t%2==0;case qt.PATTERN010:return e%3==0;case qt.PATTERN011:return(t+e)%3==0;case qt.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case qt.PATTERN101:return t*e%2+t*e%3==0;case qt.PATTERN110:return(t*e%2+t*e%3)%2==0;case qt.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){let t=new oe([1],0);for(let e=0;e<n;e++)t=t.multiply(new oe([1,K.gexp(e)],0));return t},getLengthInBits:function(n,t){if(1<=t&&t<10)switch(n){case ft.MODE_NUMBER:return 10;case ft.MODE_ALPHA_NUM:return 9;case ft.MODE_8BIT_BYTE:return 8;case ft.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(t<27)switch(n){case ft.MODE_NUMBER:return 12;case ft.MODE_ALPHA_NUM:return 11;case ft.MODE_8BIT_BYTE:return 16;case ft.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(t<41)switch(n){case ft.MODE_NUMBER:return 14;case ft.MODE_ALPHA_NUM:return 13;case ft.MODE_8BIT_BYTE:return 16;case ft.MODE_KANJI:return 12;default:throw new Error("mode:"+n)}else throw new Error("type:"+t)},getLostPoint:function(n){const t=n.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++){let o=0;const c=n.isDark(r,a);for(let h=-1;h<=1;h++)if(!(r+h<0||t<=r+h))for(let l=-1;l<=1;l++)a+l<0||t<=a+l||h==0&&l==0||c==n.isDark(r+h,a+l)&&o++;o>5&&(e+=3+o-5)}for(let r=0;r<t-1;r++)for(let a=0;a<t-1;a++){let o=0;n.isDark(r,a)&&o++,n.isDark(r+1,a)&&o++,n.isDark(r,a+1)&&o++,n.isDark(r+1,a+1)&&o++,(o==0||o==4)&&(e+=3)}for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)n.isDark(r,a)&&!n.isDark(r,a+1)&&n.isDark(r,a+2)&&n.isDark(r,a+3)&&n.isDark(r,a+4)&&!n.isDark(r,a+5)&&n.isDark(r,a+6)&&(e+=40);for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)n.isDark(a,r)&&!n.isDark(a+1,r)&&n.isDark(a+2,r)&&n.isDark(a+3,r)&&n.isDark(a+4,r)&&!n.isDark(a+5,r)&&n.isDark(a+6,r)&&(e+=40);let s=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++)n.isDark(a,r)&&s++;const i=Math.abs(100*s/t/t-50)/5;return e+=i*10,e}};class oe{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let s=0;for(;s<t.length&&t[s]==0;)s++;this.num=new Array(t.length-s+e);for(let i=0;i<t.length-s;i++)this.num[i]=t[i+s]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let s=0;s<this.getLength();s++)for(let i=0;i<t.getLength();i++)e[s+i]^=K.gexp(K.glog(this.get(s))+K.glog(t.get(i)));return new oe(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=K.glog(this.get(0))-K.glog(t.get(0)),s=new Array(this.getLength());for(let i=0;i<this.getLength();i++)s[i]=this.get(i);for(let i=0;i<t.getLength();i++)s[i]^=K.gexp(K.glog(t.get(i))+e);return new oe(s,0).mod(t)}}class Nt{totalCount;dataCount;constructor(t,e){this.totalCount=t,this.dataCount=e}static RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];static getRSBlocks(t,e){const s=Nt.getRsBlockTable(t,e);if(s==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const i=s.length/3,r=[];for(let a=0;a<i;a++){const o=s[a*3+0],c=s[a*3+1],h=s[a*3+2];for(let l=0;l<o;l++)r.push(new Nt(c,h))}return r}static getRsBlockTable(t,e){switch(e){case _e.L:return Nt.RS_BLOCK_TABLE[(t-1)*4+0];case _e.M:return Nt.RS_BLOCK_TABLE[(t-1)*4+1];case _e.Q:return Nt.RS_BLOCK_TABLE[(t-1)*4+2];case _e.H:return Nt.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class mr{buffer;length;constructor(){this.buffer=[],this.length=0}get(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1}put(t,e){for(let s=0;s<e;s++)this.putBit((t>>>e-s-1&1)==1)}getLengthInBits(){return this.length}putBit(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}class Ch{mode;data;constructor(t){this.mode=ft.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,s=this.data.length;e<s;e++)t.put(this.data.charCodeAt(e),8)}}class Yt{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=_e[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new Ch(t);this.dataList.push(e),this.dataCache=null}isDark(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]}getModuleCount(){return this.moduleCount}make(){if(this.typeNumber<1){let t=1;for(t=1;t<40;t++){const e=Nt.getRSBlocks(t,this.errorCorrectLevel),s=new mr;let i=0;for(let r=0;r<e.length;r++)i+=e[r].dataCount;for(let r=0;r<this.dataList.length;r++){const a=this.dataList[r];s.put(a.mode,4),s.put(a.getLength(),z.getLengthInBits(a.mode,t)),a.write(s)}if(s.getLengthInBits()<=i*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let s=0;s<this.moduleCount;s++){this.modules[s]=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++)this.modules[s][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=Yt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let s=-1;s<=7;s++)if(!(t+s<=-1||this.moduleCount<=t+s))for(let i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=s&&s<=6&&(i==0||i==6)||0<=i&&i<=6&&(s==0||s==6)||2<=s&&s<=4&&2<=i&&i<=4?this.modules[t+s][e+i]=!0:this.modules[t+s][e+i]=!1)}getBestMaskPattern(){let t=0,e=0;for(let s=0;s<8;s++){this.makeImpl(!0,s);const i=z.getLostPoint(this);(s==0||t>i)&&(t=i,e=s)}return e}createMovieClip(t,e,s){const i=t.createEmptyMovieClip(e,s),r=1;this.make();for(let a=0;a<this.modules.length;a++){const o=a*r;for(let c=0;c<this.modules[a].length;c++){const h=c*r;this.modules[a][c]&&(i.beginFill(0,100),i.moveTo(h,o),i.lineTo(h+r,o),i.lineTo(h+r,o+r),i.lineTo(h,o+r),i.endFill())}}return i}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=z.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let s=0;s<t.length;s++){const i=t[e],r=t[s];if(this.modules[i][r]==null)for(let a=-2;a<=2;a++)for(let o=-2;o<=2;o++)a==-2||a==2||o==-2||o==2||a==0&&o==0?this.modules[i+a][r+o]=!0:this.modules[i+a][r+o]=!1}}setupTypeNumber(t){const e=z.getBCHTypeNumber(this.typeNumber);for(let s=0;s<18;s++){const i=!t&&(e>>s&1)==1;this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=i}for(let s=0;s<18;s++){const i=!t&&(e>>s&1)==1;this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=i}}setupTypeInfo(t,e){const s=this.errorCorrectLevel<<3|e,i=z.getBCHTypeInfo(s);for(let r=0;r<15;r++){const a=!t&&(i>>r&1)==1;r<6?this.modules[r][8]=a:r<8?this.modules[r+1][8]=a:this.modules[this.moduleCount-15+r][8]=a}for(let r=0;r<15;r++){const a=!t&&(i>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=a:r<9?this.modules[8][15-r-1+1]=a:this.modules[8][15-r-1]=a}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let s=-1,i=this.moduleCount-1,r=7,a=0;for(let o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(let c=0;c<2;c++)if(this.modules[i][o-c]==null){let h=!1;a<t.length&&(h=(t[a]>>>r&1)==1),z.getMask(e,i,o-c)&&(h=!h),this.modules[i][o-c]=h,r--,r==-1&&(a++,r=7)}if(i+=s,i<0||this.moduleCount<=i){i-=s,s=-s;break}}}static createData(t,e,s){const i=Nt.getRSBlocks(t,e),r=new mr;for(let o=0;o<s.length;o++){const c=s[o];r.put(c.mode,4),r.put(c.getLength(),z.getLengthInBits(c.mode,t)),c.write(r)}let a=0;for(let o=0;o<i.length;o++)a+=i[o].dataCount;if(r.getLengthInBits()>a*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+a*8+")");for(r.getLengthInBits()+4<=a*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=a*8||(r.put(Yt.PAD0,8),r.getLengthInBits()>=a*8));)r.put(Yt.PAD1,8);return Yt.createBytes(r,i)}static createBytes(t,e){let s=0,i=0,r=0;const a=new Array(e.length),o=new Array(e.length);for(let f=0;f<e.length;f++){const g=e[f].dataCount,y=e[f].totalCount-g;i=Math.max(i,g),r=Math.max(r,y),a[f]=new Array(g);for(let S=0;S<a[f].length;S++)a[f][S]=255&t.buffer[S+s];s+=g;const m=z.getErrorCorrectPolynomial(y),b=new oe(a[f],m.getLength()-1).mod(m);o[f]=new Array(m.getLength()-1);for(let S=0;S<o[f].length;S++){const C=S+b.getLength()-o[f].length;o[f][S]=C>=0?b.get(C):0}}let c=0;for(let f=0;f<e.length;f++)c+=e[f].totalCount;const h=new Array(c);let l=0;for(let f=0;f<i;f++)for(let g=0;g<e.length;g++)f<a[g].length&&(h[l++]=a[g][f]);for(let f=0;f<r;f++)for(let g=0;g<e.length;g++)f<o[g].length&&(h[l++]=o[g][f]);return h}}const pr=Math.ceil,De=Math.floor,gr=Math.round;function Th(n,t){const e=Un(n),s=t?.ecc||"H",i=t?.size||256,r=-1,a=t?.padding||0,o=t?.color||"#000000",c=t?.background||"#ffffff",h=new Yt(r,s);h.addData(e),h.make();const l=h.getModuleCount(),f=(i-a*2)/l,g=a,y=i-a;return dr(i,o,c,function(m,v){if(g<=m&&m<y&&g<=v&&v<y){const b=De((m-g)/f),S=De((v-g)/f);return h.isDark(S,b)?0:1}else return 1})}function Eh(n,t){const e=t.x||0,s=t.y||0,i=Un(n),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?De(t.size):256,c=t.padding||0,h=-1,l=t.color||"#000000",f=t.background||"#ffffff",g=new Yt(h,a);g.addData(i),g.make();const y=g.getModuleCount(),m=(o-c*2)/y;r.fillStyle=f,r.fillRect(e,s,o,o);for(let v=0;v<y;v++)for(let b=0;b<y;b++){const S=pr((b+1)*m)-De(b*m),C=pr((v+1)*m)-De(v*m);r.fillStyle=g.isDark(v,b)?l:f,r.fillRect(e+gr(b*m)+c,s+gr(v*m)+c,S,C)}}let ms;const yr=new WeakMap;function fn(n,t){let e=yr.get(n);e||(e=new Map,yr.set(n,e));let s=e.get(t);return s||(s=new wr,e.set(t,s)),s}class wr{subscribers;constructor(){this.subscribers=new Set}depend(){ms&&this.subscribers.add(ms)}notify(){this.subscribers.forEach(t=>t())}}function Ph(n){ms=n,n(),ms=null}function Ah(n){return Object.keys(n).forEach(t=>{let e=n[t];const s=fn(n,t);Object.defineProperty(n,t,{get(){return s.depend(),e},set(i){i!=e&&(e=i,s.notify())}})}),n}function vr(n){return new Proxy(n,{get(t,e,s){return fn(n,e).depend(),Reflect.get(t,e,s)},set(t,e,s,i){const r=fn(n,e);return n[e]!=s&&(n[e]=s,r.notify()),Reflect.set(t,e,s,i)}})}const _h=vr;class ps{x;y;z;constructor(t=[0,0,0],e=[0,0,0]){const[s,i,r]=t,[a,o,c]=e;this.x=s-a,this.y=i-o,this.z=r-c}get length(){const{x:t,y:e,z:s}=this;return Math.sqrt(t*t+e*e+s*s)}unit(){const t=this.length;return new ps([this.x/t,this.y/t,this.z/t])}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){const e=this.x,s=this.y,i=this.z,r=t.x,a=t.y,o=t.z;return new ps([s*o-i*a,i*r-e*o,e*a-r*s])}}class Zt extends X{shapes=[];constructor(t){super(t)}setAttrs(t,e){this.shapes.forEach(s=>{He(t)?s.setAttr(t):typeof t=="string"&&e&&s.setAttr(t,e)})}addShape(t){this.shapes.push(...Array.isArray(t)?t:[t])}toSVGPathData(){return this.shapes.reduce((t,e,s)=>{const i=e.toSVGPathData();return Array.isArray(i[0])?t.push(...i):t.push(i),t},[])}toCanvasContext(t){this.shapes.forEach(e=>e.toCanvasContext(t))}}let ke;typeof self>"u"&&typeof process<"u"&&process.hrtime?ke=function(){const n=process.hrtime();return n[0]*1e3+n[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?ke=self.performance.now.bind(self.performance):Date.now!==void 0?ke=Date.now:ke=function(){return new Date().getTime()};const ce=ke;class Ie{static _nextId=0;static nextId(){return Ie._nextId++}}const gs={Linear:{None:function(n){return n}},Ease:{In:function(n){return Math.pow(n,1.7)}},Quadratic:{In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}},Cubic:{In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}},Quartic:{In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}},Quintic:{In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}},Sinusoidal:{In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}},Exponential:{In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}},Circular:{In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}},Elastic:{In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}},Back:{In:function(n){return n===1?1:n*n*((1.70158+1)*n-1.70158)},Out:function(n){return n===0?0:--n*n*((1.70158+1)*n+1.70158)+1},InOut:function(n){const t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)}},Bounce:{In:function(n){return 1-gs.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?gs.Bounce.In(n*2)*.5:gs.Bounce.Out(n*2-1)*.5+.5}},generatePow:function(n=4){return n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(t){return t**n},Out:function(t){return 1-(1-t)**n},InOut:function(t){return t<.5?(t*2)**n/2:(1-(2-t*2)**n)/2+.5}}},random:function(n){return Math.random()},createStep:function(n){return function(t){return Math.floor(t*n)/n}},createNoisyEasing:function(n,t=.1){const e=1-t;return function(s){return t*Math.random()+e*n(s)}},swing:function(n){return n+Math.sin(n*Math.PI*2)/2},causeSeizures:function(n){return n+.2*Math.random()-.1}},dn=gs,Me={Utils:{Linear:function(n,t,e){return(t-n)*e+n},Factorial:function(){const n=[1];return function(t){let e=1;if(n[t])return n[t];for(let s=t;s>1;s--)e*=s;return n[t]=e,e}}(),Bernstein:function(n,t){const e=Me.Utils.Factorial;return e(n)/e(t)/e(n-t)},CatmullRom:function(n,t,e,s,i){const r=(e-n)*.5,a=(s-t)*.5,o=i*i,c=i*o;return(2*t-2*e+r+a)*c+(-3*t+3*e-2*r-a)*o+r*i+t}},Linear:function(n,t){const e=n.length-1,s=e*t,i=Math.floor(s),r=Me.Utils.Linear;return t<0?r(n[0],n[1],s):t>1?r(n[e],n[e-1],e-s):r(n[i],n[i+1>e?e:i+1],s-i)},Bezier:function(n,t){let e=0;const s=n.length-1,i=Math.pow,r=Me.Utils.Bernstein;for(let a=0;a<=s;a++)e+=i(1-t,s-a)*i(t,a)*n[a]*r(s,a);return e},CatmullRom:function(n,t){const e=n.length-1;let s=e*t,i=Math.floor(s);const r=Me.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(i=Math.floor(s=e*(1+t))),r(n[(i-1+e)%e],n[i],n[(i+1)%e],n[(i+2)%e],s-i)):t<0?n[0]-(r(n[0],n[0],n[1],n[1],-s)-n[0]):t>1?n[e]-(r(n[e],n[e],n[e-1],n[e-1],s-e)-n[e]):r(n[i?i-1:0],n[i],n[e<i+1?e:i+1],n[e<i+2?e:i+2],s-i)}},mn=Me;class br{_tweens={};_tweensAddedDuringUpdate={};getAll(){return Object.keys(this._tweens).map(t=>this._tweens[t])}removeAll(){this._tweens={}}add(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t}remove(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]}update(t=ce(),e=!1){let s=Object.keys(this._tweens);for(let i=0;i<s.length;i++){const r=this._tweens[s[i]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[s[i]]}return!!Object.keys(this._tweens).length}}const gt=new br;class pn{constructor(t,e=gt){this._object=t,this._group=e}_id=Ie.nextId();_isPlaying=!1;_startTime=0;_delayTime=0;_durationTime=1e3;_isPaused=!1;_pauseStartTime=0;_initialRepeat=0;_repeat=0;_repeatDelayTime;_yoyo=!1;_reversed=!1;_valuesStart={};_valuesEnd={};_valuesStartRepeat={};_easingFunction=dn.Linear.None;_interpolationFunction=mn.Linear;_chainedTweens=[];_isChainStopped=!1;_onStartCallback;_onStartCallbackFired=!1;_onEveryStartCallback;_onEveryStartCallbackFired=!1;_onUpdateCallback;_onRepeatCallback;_onCompleteCallback;_onStopCallback;_goToEnd=!1;getId(){return this._id}isPlaying(){return this._isPlaying}isPaused(){return this._isPaused}to(t,e){return this._valuesEnd=Object.create(t),e!==void 0&&(this._durationTime=e),this}duration(t=1e3){return this._durationTime=t,this}start(t=ce()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,s,i){for(const r in s){const a=t[r],o=Array.isArray(a),c=o?"array":typeof a,h=!o&&Array.isArray(s[r]);if(!(c==="undefined"||c==="function")){if(h){let l=s[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,a)),s[r]=[a].concat(l)}if((c==="object"||o)&&a&&!h){e[r]=o?[]:{};for(const l in a)e[r][l]=a[l];i[r]=o?[]:{},this._setupProperties(a,e[r],s[r],i[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),h?i[r]=s[r].slice().reverse():i[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=ce()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=ce()){return!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStartTime,this._pauseStartTime=0,this._group&&this._group.add(this),this)}stopChainedTweens(){for(let t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this}group(t=gt){return this._group=t,this}delay(t=0){return this._delayTime=t,this}repeat(t=0){return this._initialRepeat=t,this._repeat=t,this}repeatDelay(t){return this._repeatDelayTime=t,this}yoyo(t=!1){return this._yoyo=t,this}easing(t=dn.Linear.None){return this._easingFunction=t,this}interpolation(t=mn.Linear){return this._interpolationFunction=t,this}chain(...t){return this._chainedTweens=t,this}onStart(t){return this._onStartCallback=t,this}onEveryStart(t){return this._onEveryStartCallback=t,this}onUpdate(t){return this._onUpdateCallback=t,this}onRepeat(t){return this._onRepeatCallback=t,this}onComplete(t){return this._onCompleteCallback=t,this}onStop(t){return this._onStopCallback=t,this}update(t=ce(),e=!0){if(this._isPaused)return!0;let s,i;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),i=(t-this._startTime)/this._durationTime,i=this._durationTime===0||i>1?1:i;const a=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),i===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let o=0,c=this._chainedTweens.length;o<c;o++)this._chainedTweens[o].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,s,i){for(const r in s){if(e[r]===void 0)continue;const a=e[r]||0;let o=s[r];const c=Array.isArray(t[r]),h=Array.isArray(o);!c&&h?t[r]=this._interpolationFunction(o,i):typeof o=="object"&&o?this._updateProperties(t[r],a,o,i):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[r]=a+(o-a)*i))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],s=this._valuesEnd[t];typeof s=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(s):this._valuesStartRepeat[t]=s,this._valuesEnd[t]=e}}const Dh=Ie.nextId,kh=gt.getAll.bind(gt),Ih=gt.removeAll.bind(gt),Mh=gt.add.bind(gt),Rh=gt.remove.bind(gt),Oh=gt.update.bind(gt),Re={now:ce,Sequence:Ie,Easing:dn,Interpolation:mn,Group:br,Tween:pn,nextId:Dh,getAll:kh,removeAll:Ih,add:Mh,remove:Rh,update:Oh};function Lh(n){switch(n){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}(function(){let n=0;window.requestAnimationFrame||(window.requestAnimationFrame=function(t){const e=new Date().getTime(),s=Math.max(0,16-(e-n)),i=window.setTimeout(function(){t(e+s)},s);return n=e+s,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})})();const xr=n=>{let t=window.requestAnimationFrame(function e(s){n(s),t=window.requestAnimationFrame(e)});return()=>window.cancelAnimationFrame(t)};class Nh{id=0;renders={};cancelAnimateInWeb;constructor(){}get length(){return Object.keys(this.renders).length}run(t){this.renders[this.id++]=t,!this.cancelAnimateInWeb&&(this.cancelAnimateInWeb=xr(e=>{const s=[];for(let i in this.renders)this.renders[i](e)===!1&&s.push(parseInt(i));for(let i of s)delete this.renders[i];!this.length&&this.cancelAnimateInWeb&&(this.cancelAnimateInWeb(),this.cancelAnimateInWeb=void 0)}))}runAccurateSetTimeout(t,e=0){let s=!1,i;return this.run(r=>s?!1:(i||(i=r),r-i>=e?(t(),!1):!0)),()=>{s=!0}}}const he=new Nh,Fh={attributeName:["display"],values:[["block","block"]],immediate:!1},dt={easeName:"linear",begin:0,dur:300,repeatCount:1,direction:"normal",fill:"freeze",keyTimes:[0,1]};class le{objects=[];animateObjects=[];currentAnimateName;constructor(){}hasObjects(){return this.objects.length>0}fromDOM(t){return Array.isArray(t)||(t=[t]),this.objects.forEach(e=>{e.app.destroy()}),this.objects=[],t.forEach(e=>{this.objects.push({el:e,app:new xe(e),originAttrs:{}})}),this}static toTween(t,e,s){const i=s?.onStart||(()=>{}),r=s?.onUpdate||(()=>{}),a=s?.onComplete||(()=>{}),o=s?.duration||1e3,c=s?.delay||0,h=s?.easeFunction||Re.Easing.Linear.None,l=s?.repeat||0,f=s?.yoyo||!1,g=new Re.Tween(t).to(e,o).delay(c).easing(h).repeat(l).yoyo(f).onStart(i).onUpdate((y,m)=>{r(y,m)}).onComplete(a);return s?.interpolationFunction&&g.interpolation(s.interpolationFunction),{tween:g,startAuto:y=>{g.start(y?.()),he.run(()=>{const m=g.update(y?.());if(s?.precision){let v=!0;for(let b in t)pe(t[b],e[b],s.precision)||(v=!1);return v?!1:m}return m})}}}static toTweenGroup(t,e){if(t instanceof pn)return s=>{t.start(),e?.onGroupStart?.(),he.run(()=>{const i=Re.update(s?.());return i?e?.onGroupUpdate?.():e?.onGroupComplete?.(),i})};{const s=new Re.Group;return t.forEach(i=>{s.add(i)}),i=>{t.forEach(r=>r.start()),e?.onGroupStart?.(),he.run(()=>{const r=s.update(i?.());return r?e?.onGroupUpdate?.():e?.onGroupComplete?.(),r})}}}static toTweenCSS(t,e,s,i){A.add3DSupport(t);const r=i?.onUpdate||(()=>{});return le.toTween(e,s,Object.assign(i||{},{onUpdate:(a,o)=>{const c=A.convertAttrs(t,a);A.setStyle(t,c),r(a,o)}}))}addAnimateObject(t=Fh,e=dt,s=0,i=!1){const r=e.easeName||"linear",a=e.dur||300,o=e.keyTimes||[0,1],c=[];o.forEach((l,f)=>{f>0&&c.push(Lh(r))});const h=this.objects[s];return this.animateObjects=i?[]:this.animateObjects,this.animateObjects.push({el:h.el,app:h.app,originAttrs:h.originAttrs,attributeName:t.attributeName,values:t.values,immediate:t.immediate||!1,easeName:r,begin:e.begin||0,dur:a,repeatCount:e.repeatCount||1,direction:e.direction||"normal",fill:e.fill||"freeze",keyTimes:o,realKeyTimes:o.map(l=>a*l),keySplines:c,calcMode:e.calcMode||"linear",onComplete:e.onComplete||(()=>{})}),this}resetAnimateObjects(t,e,s,i,r=dt,a=this.objects.length-1){let o=!0,c=!1,h=!1,l=!1;const f=this.objects.length-1;a=lt(a,0,f);let g=a-1;g=lt(g,0,f);let y=a+1;y=lt(y,0,f);const m=this.objects[a],v=this.objects[g],b=this.objects[y];if(v&&g!==a){const S=t(v);S&&(this.addAnimateObject(S,r,g,o),o=!1,c=!0)}if(m){const S=e(m);S&&(this.addAnimateObject(S,r,a,o),o=!1,h=!0)}if(b&&y!==a){const S=s(b);S&&(this.addAnimateObject(S,r,y,o),o=!1,l=!0)}this.objects.forEach((S,C)=>{if(!(C==g&&c||C==a&&h||C==y&&l)){const k=i(S);k&&(this.addAnimateObject(k,r,C,o),o=!1)}})}toCSS(t,...e){if(!this.hasObjects())return;this.currentAnimateName=t,this[t](...e),A.add3DSupport(this.objects[0].el),this.objects.forEach((r,a)=>{A.setStyle(r.el,{position:"absolute","z-index":String(2e3+a),"transform-style":"preserve-3d","backface-visibility":"hidden"})});let s=0;const i=()=>{this.animateObjects.forEach((r,a)=>{let o=[],c=[];Array.isArray(r.attributeName)?(o=r.attributeName,c=r.values):r.attributeName&&(o=[r.attributeName],c=[r.values]);const h=r.keyTimes.length;let l=r.begin;r.keyTimes.forEach((f,g)=>{if(g==0||r.immediate){const y={};o.forEach((v,b)=>{const S=c[b][r.direction=="reverse"?h-1-g:g];y[v]=S});const m=A.convertAttrs(r.el,y,r.originAttrs);A.setStyle(r.el,Object.assign(m,{transition:"none"}))}else he.runAccurateSetTimeout(()=>{const y={};o.forEach((v,b)=>{const S=c[b][r.direction=="reverse"?h-1-g:g];y[v]=S});const m=A.convertAttrs(r.el,y,r.originAttrs);A.setStyle(r.el,Object.assign(m,{transition:`all ${r.realKeyTimes[g]}ms cubic-bezier(${r.keySplines[g-1].join(",")})`}))},l),l+=r.realKeyTimes[g]}),he.runAccurateSetTimeout(()=>{r.fill==="remove"&&A.setStyle(r.el,r.originAttrs||{}),a==this.animateObjects.length-1&&(r.onComplete?.(),this.currentAnimateName==t&&(r.repeatCount=="infinite"||typeof r.repeatCount=="number"&&++s<r.repeatCount)&&i())},r.begin+r.dur)})};i()}slideLeft(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[-s.app.width,0]]]}),s=>({attributeName:["opacity","translateTo"],values:[[1,1],[[s.app.width,0],[0,0]]]}),s=>{},s=>({attributeName:["opacity","translateTo"],values:[[0,0],[[s.app.width,0],[s.app.width,0]]],immediate:!0}),t,e)}slideRight(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>{},s=>({attributeName:["opacity","translateTo"],values:[[1,1],[[-s.app.width,0],[0,0]]]}),s=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[s.app.width,0]]]}),s=>({attributeName:["opacity","translateTo"],values:[[0,0],[[-s.app.width,0],[-s.app.width,0]]],immediate:!0}),t,e)}slideDown(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[0,s.app.height]]]}),s=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,-s.app.height],[0,0]]]}),s=>{},s=>({attributeName:["opacity","translateTo"],values:[[0,0],[[0,-s.app.height],[0,-s.app.height]]],immediate:!0}),t,e)}slideUp(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[0,-s.app.height]]]}),s=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,s.app.height],[0,0]]]}),s=>{},s=>({attributeName:["opacity","translateTo"],values:[[0,0],[[0,s.app.height],[0,s.app.height]]],immediate:!0}),t,e)}flipLeft(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,180]]}),s=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[-180,0]]}),s=>{},s=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipRight(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,-180]]}),s=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[180,0]]}),s=>{},s=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipDown(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,-180]]}),s=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[180,0]]}),s=>{},s=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipUp(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,180]]}),s=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[-180,0]]}),s=>{},s=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}popIn(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>{},s=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[.8,1],[0,1]]}),s=>{},s=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}popOut(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>{},s=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[1,1.2],[1,0]]}),s=>{},s=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}rotate(t=dt,e=this.objects.length-1){Object.assign(t,{keyTimes:[0,1]});const s=t.degree||360;this.resetAnimateObjects(i=>{},i=>({attributeName:["opacity","rotate"],values:[[1,1],[0,s]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}}class Sr extends pi{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,s)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,s)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const s=la(e);for(let i of s.stylesheet.rules)for(let r of i.declarations)for(let a of i.selectors)this.globalStyles[a]=this.globalStyles[a]||[],this.globalStyles[a].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,s)=>{let i=this.groups.length;for(;i--;)if(this.groups[i]!=this.currentItem){let r="",a="";for(let o in this.groups[i])o=="transform"?r=this.groups[i].transform:o=="class"&&this.globalStyles["."+this.groups[i][o]]?a=this.globalStyles["."+this.groups[i][o]].join(";")+";"+a:o=="id"&&this.globalStyles["#"+this.groups[i][o]]?a=this.globalStyles["#"+this.groups[i][o]].join(";")+";"+a:typeof this.currentItem[o]>"u"&&(this.currentItem[o]=this.groups[i][o]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=a:this.currentItem.style=a+this.currentItem.style,this.currentItem.class&&this.globalStyles["."+this.currentItem.class]?this.currentItem.style=this.globalStyles["."+this.currentItem.class].join(";")+";"+this.currentItem.style:this.currentItem.id&&this.globalStyles["#"+this.currentItem.id]&&(this.currentItem.style=this.globalStyles["#"+this.currentItem.id].join(";")+";"+this.currentItem.style),yn(this.currentItem.style,this.currentItem,wn)}switch(this.processAttrs(e,s),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let s=[],i;switch(t){case"svg":let r="",a="";if(e.width&&e.height)r=e.width,a=e.height;else if(e.viewBox){const o=e.viewBox.split(/\s+/gi);o.length==4&&(r=String(parseFloat(o[2])-parseFloat(o[0])),a=String(parseFloat(o[3])-parseFloat(o[1])))}r&&a&&this.items.push({type:"viewbox",width:r,height:a});break;case"line":typeof e.x1=="number"&&typeof e.y1=="number"&&typeof e.x2=="number"&&typeof e.y2=="number"&&(this.currentItem.path="M"+[e.x1,e.y1,e.x2,e.y2]);break;case"stop":i={},e.style&&yn(e.style,i),i.offset=i.offset||e.offset,i.color=i["stop-color"]||e["stop-color"],i.opacity=i["stop-opacity"]||e["stop-opacity"],~(i.offset+"").indexOf("%")?i.offset=parseFloat(i.offset):i.offset=parseFloat(i.offset)*100,i.offset=+i.offset.toFixed(2),this.grad.stops.push(i);break;case"linearGradient":this.grad.angle=(360+gn(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),s=[this.grad.angle];for(let o=0,c=this.grad.stops.length;o<c;o++)i=this.grad.stops[o],o&&o!=c-1?s.push(i.color+":"+i.offset):s.push(i.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break;case"radialGradient":s=[];for(let o=0,c=this.grad.stops.length;o<c;o++)i=this.grad.stops[o],o&&o!=c-1?s.push(i.color+":"+i.offset):s.push(i.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break}for(let r in e){const a=e[r];if(wn.includes(r)&&(this.currentItem[r]=a),r==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:r,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:r,stops:[]})),r==="style"&&yn(a,this.currentItem,wn),r==="transform"&&(this.currentItem.transform=a+(this.currentItem.transform||" ")),r==="fill"){const o=a.match(/url\(#([^)]+)\)/);if(o){const c=o[1];this.currentItem.fillid=c,this.idtops[c]&&(this.currentItem.fill=this.idtops[c])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+a+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=a),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=a)}}addToItems(){this.items.push(this.currentItem)}}function gn(n,t,e,s,i,r){if(typeof i>"u"||typeof r>"u"){const a=n-e,o=t-s;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return gn(n,t,i,r)-gn(e,s,i,r)}function yn(n,t,e){const s=(n+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,a=s.length;r<a;r++){let o=s[r].split(":"),c=o[0].replace(i,"").replace(/[A-Z]/g,function(h){return"-"+h.toLowerCase()});(!e||e.includes(c))&&(t[c]=o[1].replace(i,""))}}const wn=["id","class","viewBox","width","height","x","y","cx","cy","r","rx","ry","cursor","opacity","src","fill","fill-opacity","stroke","stroke-dasharray","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","font","font-family","font-size","font-style","font-weight","letter-spacing"];class Bh{app;rootEl;shapes=[];isMouseDown=!1;currentMouseInShapeID="";currentEnableDragMouseInShapeID="";constructor(t,e,s){this.app=t,this.rootEl=G.createSVGElement("svg"),A.empty(this.app.container),A.insert(this.app.container,this.rootEl),e&&s?this.setSize(e,s):(this.setSize(this.app.width,this.app.height),this.app.on("resize",()=>{this.setSize(this.app.width,this.app.height)})),this.app.captureMove({start:()=>{this.isMouseDown=!0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.setCursor()},move:()=>{if(this.isMouseDown&&this.currentEnableDragMouseInShapeID){this.setCursor();return}this.currentMouseInShapeID="";let i=0,r=this.shapes.length;for(;i<r;i++){const a=this.shapes[i];if(!(a instanceof O)&&!a.pathd){a.isMouseIn=!1;continue}const o=a instanceof O&&a.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||a.pathd instanceof O&&a.pathd.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||!1;if(a.isMouseIn=o,o&&(this.currentMouseInShapeID=a.id,a.enableDrag)){this.currentEnableDragMouseInShapeID=a.id,this.shapes.filter(c=>c.id!==a.id).forEach(c=>{c instanceof X&&(c.isMouseIn=!1)});break}}i>=r&&(this.currentEnableDragMouseInShapeID=""),this.setCursor()}})}setCursor(){this.currentEnableDragMouseInShapeID?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShapeID?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}setSize(t,e){return A.attribute(this.rootEl,{viewBox:`0 0 ${t} ${e}`,width:`${t}`,height:`${e}`}),this}download(){return G.downloadFromSVGElement(this.rootEl)}path(t){[...Array.isArray(t)?t:[t]].forEach(e=>{if(e instanceof Zt){e.shapes.forEach(s=>this.path(s));return}if(e instanceof xs)e.el=this.text(e.text,e.x,e.y,e.attrs);else if(e instanceof yt)e.el=G.createSvgPath(`M ${e.fromX} ${e.fromY} `+e.toSVGPathD()),A.insert(this.rootEl,e.el);else if(e instanceof O)e.el=G.createSvgPath(e.toSVGPathD()),A.insert(this.rootEl,e.el);else if(e instanceof X){const s=O.fromShape(e)||e;s.el=e.el=G.createSvgPath(s.toSVGPathD()),A.insert(this.rootEl,e.el),s instanceof O&&(e.pathd=s)}this.update(e),this.shapes.push(e)})}update(t){[...Array.isArray(t)?t:[t]].forEach(e=>{const s=[];e instanceof Zt?(e.frameUpdate(),s.push(...e.shapes)):s.push(e),s.forEach(i=>{if(i.followMouse&&(!pe(i.x,this.app.mousePoint.x,5)||!pe(i.y,this.app.mousePoint.y,5))&&(i.angleTo(this.app.mousePoint),i.followTo(this.app.mousePoint)),i.targetToAfterDragFree&&(this.isMouseDown||i.nextFrameEaseTo(new ut({x:i.targetToAfterDragFree.targetX,y:i.targetToAfterDragFree.targetY}),{easing:i.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShapeID==i.id){const{dx:r,dy:a}=i.centerDiff;i.x=this.app.mousePoint.x,i.y=this.app.mousePoint.y,i.x-=r,i.y-=a,i.isDragging=!0,this.shapes.filter(o=>o.id!=i.id).forEach(o=>{o instanceof X&&(o.isDragging=!1)})}else this.shapes.forEach(r=>{r instanceof X&&(r.isDragging=!1)});i.frameUpdate(),i instanceof O?i.updateTransform():i.pathd&&i.pathd.updateFromShape(i),(i instanceof yt||i instanceof O||i.pathd instanceof O)&&this.attr(i,"d",i instanceof yt?`M ${i.fromX} ${i.fromY} `+i.toSVGPathD():i.pathd instanceof O?i.pathd.toSVGPathD():i.toSVGPathD()),i instanceof xs&&(i.setAttr("x",String(i.x)),i.setAttr("y",String(i.y))),this.attr(i,i.attrs),i.el&&(i.isShow?A.show(i.el):A.hide(i.el))})})}click(t){const e=()=>{this.shapes.forEach(s=>{(s instanceof O&&s.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||s.pathd instanceof O&&s.pathd.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl))&&t(s)})};return this.app.on("tap",e),()=>{this.app.off("tap",e)}}delete(t){[...t instanceof Zt?t.shapes:[t]].forEach(e=>{e.el&&A.remove(e.el),delete e.el,delete e.pathd?.el,this.shapes=this.shapes.filter(s=>s.id!=e.id)})}clear(){this.shapes.forEach(t=>{delete t.el,delete t.pathd?.el}),A.empty(this.rootEl),this.shapes=[]}attr(t,e,s){const i=t.el||t;return i instanceof SVGElement?e===void 0&&s===void 0?A.attribute(i):typeof e=="string"&&s===void 0?A.attribute(i,it(e))||"":(typeof e=="object"?A.attribute(i,e):typeof e=="string"&&s!==void 0&&A.attribute(i,it(e),s),this):this}circle(t,e,s){return this.path(new ut({x:t,y:e,radius:s}))}circleEl(t,e,s){const i=G.createSVGElement("circle",{cx:String(t),cy:String(e),r:String(s)});return A.insert(this.rootEl,i),i}ellipse(t,e,s,i){return this.path(new Tr({x:t,y:e,rx:s,ry:i}))}ellipseEl(t,e,s,i){const r=G.createSVGElement("ellipse",{cx:String(t),cy:String(e),rx:String(s),ry:String(i)});return A.insert(this.rootEl,r),r}rect(t,e,s,i){return this.path(new Ct({x:t,y:e,width:s,height:i}))}rectEl(t,e,s,i){const r=G.createSVGElement("rect",{x:String(t),y:String(e),width:String(s),height:String(i)});return A.insert(this.rootEl,r),r}image(t,e,s,i,r){}text(t,e,s,i){const r=G.createSVGElement("text",{x:String(e),y:String(s)});return A.html(r,t),this.attr(r,Object.assign({"alignment-baseline":"middle"},i)),A.insert(this.rootEl,r),r}textWithTspan(t,e,s,i){const r=i?.["line-height"]||"1.2em",a=G.createSVGElement("text",{x:String(e),y:String(s)});return t.split(`
|
|
41
|
-
`).forEach((o,c)=>{if(o.trim()){const h=G.createSVGElement("tspan",{x:String(e),dy:c>0?r:"0"});A.html(h,o),A.insert(a,h),this.attr(h,Object.assign({"alignment-baseline":"middle"},i))}}),A.insert(this.rootEl,a),a}}const Cr=Uh("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);function Uh(n,t=10){const e={},s=n.split(",");for(let i=0;i<s.length;i+=2){const r="&"+s[i+1]+";",a=parseInt(s[i],t);e[r]="&#"+a+";"}return e["\\xa0"]=" ",e}function rt(n,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)n=n.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return n}function ys(n){let t,e;if(!n)throw new Error("cannot create a random attribute name for an undefined object");const s="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=s[Math.floor(Math.random()*s.length)];while(n[t]);return t}function Vh(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function Gh(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const Oe={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"},lineDashOffset:{svgAttr:"stroke-dashoffset",canvas:0,svg:0,apply:"stroke"}};class ws{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const s=this.__ctx.__createElement("stop");if(s.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(s.setAttribute("stop-color",rt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),s.setAttribute("stop-opacity",r[4]))}else s.setAttribute("stop-color",e);this.__root.appendChild(s)}}class vn{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Le{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:s=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=s),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(Oe);for(let e=0,s=t.length;e<s;e++){const i=t[e];this[i]=Oe[i].canvas}}__getStyleState(){const t={},e=Object.keys(Oe);for(let s=0,i=e.length;s<i;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,i=e.length;s<i;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let a=0;a<r.length;a++){const o=r[a];i.setAttribute(o,e[o])}return i}__applyStyleToCurrentElement(t){let e=this.__currentElement;const s=this.__currentElementsToStyle;s&&(e.setAttribute(t,""),e=s.element,s.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(Oe);for(let r=0;r<i.length;r++){const a=Oe[i[r]],o=this[i[r]];if(a.apply){if(o instanceof vn){if(o.__ctx)for(;o.__ctx.__SVGdefs.childNodes.length;){const c=o.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[c]=c,this.__SVGdefs.appendChild(o.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(a.apply,rt("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof ws)e.setAttribute(a.apply,rt("url(#{id})",{id:o.__root.getAttribute("id")}));else if(a.apply.indexOf(t)!==-1&&a.svg!==o)if((a.svgAttr==="stroke"||a.svgAttr==="fill")&&o.indexOf("rgba")!==-1){const h=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(o);e.setAttribute(a.svgAttr,rt("rgb({r},{g},{b})",{r:h[1],g:h[2],b:h[3]}));let l=parseFloat(h[4]);const f=this.globalAlpha;f!=null&&(l*=f),e.setAttribute(a.svgAttr+"-opacity",""+l)}else{let c=a.svgAttr;if(i[r]==="globalAlpha"&&(c=t+"-"+a.svgAttr,e.getAttribute(c)))continue;c&&e.setAttribute(c,o)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const i=Object.keys(Cr);for(let r=0,a=i.length;r<a;r++){const o=i[r],c=Cr[o],h=new RegExp(o,"gi");h.test(e)&&(e=e.replace(h,c))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const i=this.__createElement("g");e.appendChild(i),this.__currentElement=i}let s=this.__currentElement.getAttribute("transform");s?s+=" ":s="",s+=t,this.__currentElement.setAttribute("transform",s)}scale(t,e){e===void 0&&(e=t),this.__addTransform(rt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(rt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(rt("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,i,r,a){this.__addTransform(rt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,d:i,e:r,f:a}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(rt("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(rt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(rt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,i,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(rt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:i,x:r,y:a}))}quadraticCurveTo(t,e,s,i){this.__currentPosition={x:s,y:i},this.__addPathCommand(rt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,y:i}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,s,i,r){const a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(typeof a>"u"||typeof o>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(a===t&&o===e||t===s&&e===i||r===0){this.lineTo(t,e);return}const c=this.normalize([a-t,o-e]),h=this.normalize([s-t,i-e]);if(c[0]*h[1]===c[1]*h[0]){this.lineTo(t,e);return}const l=c[0]*h[0]+c[1]*h[1],f=Math.acos(Math.abs(l)),g=this.normalize([c[0]+h[0],c[1]+h[1]]),y=r/Math.sin(f/2),m=t+y*g[0],v=e+y*g[1],b=[-c[1],c[0]],S=[h[1],-h[0]],C=function(F){const L=F[0];return F[1]>=0?Math.acos(L):-Math.acos(L)},k=C(b),R=C(S);this.lineTo(m+b[0]*r,v+b[1]*r),this.arc(m,v,r,k,R)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,s,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],i=s.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&s.removeChild(i[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,i){if(t===0&&e===0&&s===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:s,height:i,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,s,i){const r=this.__createElement("linearGradient",{id:ys(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new ws(r,this)}createRadialGradient(t,e,s,i,r,a){const o=this.__createElement("radialGradient",{id:ys(this.__ids),cx:i+"px",cy:r+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new ws(o,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),s={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(s.decoration="underline"),this.__fontHref&&(s.href=this.__fontHref),s}__wrapTextLink(t,e){if(t.href){const s=this.__createElement("a");return s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),s.appendChild(e),s}return e}__applyText(t,e,s,i){const r=this.__parseFont(),a=this.__closestGroupOrSvg(),o=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:s,"text-anchor":Vh(this.textAlign),"dominant-baseline":Gh(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(i),a.appendChild(this.__wrapTextLink(r,o))}fillText(t,e,s){this.__applyText(t,e,s,"fill")}strokeText(t,e,s){this.__applyText(t,e,s,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,s,i,r,a){if(i===r)return;i=i%(2*Math.PI),r=r%(2*Math.PI),i===r&&(r=(r+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+s*Math.cos(r),c=e+s*Math.sin(r),h=t+s*Math.cos(i),l=e+s*Math.sin(i),f=a?0:1;let g=0,y=r-i;y<0&&(y+=2*Math.PI),a?g=y>Math.PI?0:1:g=y>Math.PI?1:0,this.lineTo(h,l),this.__addPathCommand(rt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:g,sweepFlag:f,endX:o,endY:c})),this.__currentPosition={x:o,y:c}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=ys(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",s),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",rt("url(#{id})",{id:s})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],s,i,r,a,o=0,c=0,h,l,f,g,y,m,v,b;if(t.length===3)s=t[1],i=t[2],h=e.width,l=e.height,r=h,a=l;else if(t.length===5)s=t[1],i=t[2],r=t[3],a=t[4],h=e.width,l=e.height;else if(t.length===9)o=t[1],c=t[2],h=t[3],l=t[4],s=t[5],i=t[6],r=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const S=this.__closestGroupOrSvg();this.__currentElement;const C="translate("+s+", "+i+")";if(e instanceof Le){if(f=e.getSvg().cloneNode(!0),f.childNodes&&f.childNodes.length>1){for(g=f.childNodes[0];g.childNodes.length;)b=g.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(g.childNodes[0]);if(y=f.childNodes[1],y){const k=y.getAttribute("transform");let R;k?R=k+" "+C:R=C,y.setAttribute("transform",R),S.appendChild(y)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(m=this.__createElement("image"),m.setAttribute("width",r),m.setAttribute("height",a),m.setAttribute("preserveAspectRatio","none"),(o||c||h!==e.width||l!==e.height)&&(v=this.__document.createElement("canvas"),v.width=r,v.height=a,v.getContext("2d")?.drawImage(e,o,c,h,l,0,0,r,a),e=v),m.setAttribute("transform",C),m.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),S.appendChild(m))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=ys(this.__ids);let r;return s.setAttribute("id",i),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),s.appendChild(r),this.__SVGdefs.appendChild(s)):t instanceof Le&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new vn(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class vs{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,s){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),this.customContext=new Le({canvas:this.canvas,width:e||this.canvas.width,height:s||this.canvas.height})}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext.lineWidth=t}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext.lineCap=t}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext.lineCap=t}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext.lineDashOffset=t}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext.miterLimit=t}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext.globalAlpha=t}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext.fillStyle=t):(this.context.fillStyle=t.gradient,this.customContext.fillStyle=t.gradientCustom)}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext.strokeStyle=t):(this.context.strokeStyle=t.gradient,this.customContext.strokeStyle=t.gradientCustom)}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext.font=t}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext.textBaseline=t}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext.textAlign=t}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext.fill()),this}fillRect(t,e,s,i){return this.context.fillRect(t,e,s,i),this.customContext.fillRect(t,e,s,i),this}fillText(t,e,s,i){return this.context.fillText(t,e,s,i),this.customContext.fillText(t,e,s),this}setLineDash(t){return this.context.setLineDash(t),this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext.stroke()),this}strokeText(t,e,s,i){return this.context.strokeText(t,e,s,i),this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,i){return this.context.strokeRect(t,e,s,i),this.customContext.strokeRect(t,e,s,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,s,i),this.customContext.clearRect(t,e,s,i),this}save(){return this.context.save(),this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.currentPath2D=this.path2Ds.pop()||new Path2D,this}beginPath(){return this.context.beginPath(),this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const s=new Path2D;s.addPath(t,e),this.currentPath2D=s}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t){return this.context.rotate(t),this.customContext.rotate(t),this.currentMatrix.rotate(t),this.changePath2D(),this}scale(t,e=t){return this.context.scale(t,e),this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,s,i,r,a){return this.context.arc(t,e,s,i,r,a),this.customContext.arc(t,e,s,i,r,a?-1:1),this.currentPath2D.arc(t,e,s,i,r,a),this}arcTo(t,e,s,i,r){return this.context.arcTo(t,e,s,i,r),this.customContext.arcTo(t,e,s,i,r),this.currentPath2D.arcTo(t,e,s,i,r),this}ellipse(t,e,s,i,r,a,o,c){return this.context.ellipse(t,e,s,i,r,a,o,c),this.currentPath2D.ellipse(t,e,s,i,r,a,o,c),this}quadraticCurveTo(t,e,s,i){return this.context.quadraticCurveTo(t,e,s,i),this.customContext.quadraticCurveTo(t,e,s,i),this.currentPath2D.quadraticCurveTo(t,e,s,i),this}bezierCurveTo(t,e,s,i,r,a){return this.context.bezierCurveTo(t,e,s,i,r,a),this.customContext.bezierCurveTo(t,e,s,i,r,a),this.currentPath2D.bezierCurveTo(t,e,s,i,r,a),this}rect(t,e,s,i){return this.context.rect(t,e,s,i),this.customContext.rect(t,e,s,i),this.currentPath2D.rect(t,e,s,i),this}createLinearGradient(t,e,s,i,r){const a=this.context.createLinearGradient(t,e,s,i),o=this.customContext.createLinearGradient(t,e,s,i);return r&&Object.keys(r).forEach(c=>{const h=parseFloat(c);a.addColorStop(h,r[h]),o.addColorStop(h,r[h])}),{gradient:a,gradientCustom:o}}createRadialGradient(t,e,s,i,r,a,o){const c=this.context.createRadialGradient(t,e,s,i,r,a),h=this.customContext.createRadialGradient(t,e,s,i,r,a);return o&&Object.keys(o).forEach(l=>{const f=parseFloat(l);c.addColorStop(f,o[f]),h.addColorStop(f,o[f])}),{gradient:c,gradientCustom:h}}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const s=e[0],i=e[1];this.context.drawImage(t,s,i)}else if(e.length===4){const s=e[0],i=e[1],r=e[2],a=e[3];this.context.drawImage(t,s,i,r,a)}else if(e.length===8){const s=e[0],i=e[1],r=e[2],a=e[3],o=e[4],c=e[5],h=e[6],l=e[7];this.context.drawImage(t,s,i,r,a,o,c,h,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,s=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,s,i,r)}putImageData(t,e=0,s=0){return this.context.putImageData(t,e,s)}toRawSVG(){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}}class yt extends X{fromX;fromY;constructor(t){super(t),this.fromX=t?.fromX||0,this.fromY=t?.fromY||0}static fromSVGPathData(t,e){if(t.length<3)throw new Error("Line 参数个数错误");if(t[0].toUpperCase()!=="L")throw new Error("Line command 错误");return new yt({x:t[1],y:t[2],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["L",this.x,this.y]}toCanvasContext(t){t.beginPath(),t.moveTo(this.fromX,this.fromY),t.lineTo(this.x,this.y)}getBoundingClientRect(){const t=ye(this.fromX,this.fromY,this.x,this.y);if(t===0){const e=Math.min(this.x,this.fromX),s=Math.min(this.y,this.fromY),i=Math.max(this.x,this.fromX),r=Math.max(this.y,this.fromY);return new Ct({x:e,y:s,width:i-e,height:r-s})}else{const e=Math.sin(t),s=Math.cos(t),i=s*this.fromX-e*this.fromY,r=s*this.x-e*this.y,a=s*this.fromY+e*this.fromX,o=s*this.y+e*this.x;return new Ct({x:Math.min(i,r),y:Math.min(a,o),width:Math.max(i,r)-Math.min(i,r),height:Math.max(a,o)-Math.min(a,o)})}}interpolate(t){return{x:this.fromX+t*(this.x-this.fromX),y:this.fromY+t*(this.y-this.fromY)}}}class Tt extends yt{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}static fromSVGPathData(t,e){if(t.length<7)throw new Error("CubicBezier 参数个数错误");if(t[0].toUpperCase()!=="C")throw new Error("CubicBezier command 错误");return new Tt({c1x:t[1],c1y:t[2],c2x:t[3],c2y:t[4],x:t[5],y:t[6],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["C",this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y]}toCanvasContext(t){t.beginPath(),t.moveTo(this.fromX,this.fromY),t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y)}getBoundingClientRect(){const t=G.curveDim(this.fromX,this.fromY,this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y);return new Ct({x:t.min.x,y:t.min.y,width:t.max.x-t.min.x,height:t.max.y-t.min.y})}interpolate(t){return{x:Math.pow(1-t,3)*this.fromX+3*Math.pow(1-t,2)*t*this.c1x+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2x+Math.pow(t,3)*this.x,y:Math.pow(1-t,3)*this.fromY+3*Math.pow(1-t,2)*t*this.c1y+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2y+Math.pow(t,3)*this.y}}length(t=1){return G.bezlen(this.fromX,this.fromY,this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y,t)}getTatLen(t){const e=this.fromX,s=this.fromY,i=this.c1x,r=this.c1y,a=this.c2x,o=this.c2y,c=this.x,h=this.y;if(t<0||G.bezlen(e,s,i,r,a,o,c,h)<t)return 0;let l=1,f=l/2,g=l-f,y,m=.01;for(y=G.bezlen(e,s,i,r,a,o,c,h,g);Math.abs(y-t)>m;)f/=2,g+=(y<t?1:-1)*f,y=G.bezlen(e,s,i,r,a,o,c,h,g);return g}getPointAtSegmentLength(t){const e=this.getTatLen(t),s=this.fromX,i=this.fromY,r=this.c1x,a=this.c1y,o=this.c2x,c=this.c2y,h=this.x,l=this.y;let f=1-e,g=Math.pow(f,3),y=Math.pow(f,2),m=e*e,v=m*e,b=g*s+y*3*e*r+f*3*e*e*o+v*h,S=g*i+y*3*e*a+f*3*e*e*c+v*l,C=s+2*e*(r-s)+m*(o-2*r+s),k=i+2*e*(a-i)+m*(c-2*a+i),R=r+2*e*(o-r)+m*(h-2*o+r),F=a+2*e*(c-a)+m*(l-2*c+a),L=f*s+e*r,j=f*i+e*a,Q=f*o+e*h,q=f*c+e*l,Y=90-Math.atan2(C-R,k-F)*180/Math.PI;return{x:b,y:S,m:{x:C,y:k},n:{x:R,y:F},start:{x:L,y:j},end:{x:Q,y:q},alpha:Y}}}class bs extends yt{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!0}static fromSVGPathData(t,e){if(t.length<5)throw new Error("QuadraticBezier 参数个数错误");if(t[0].toUpperCase()!=="Q")throw new Error("QuadraticBezier command 错误");return new bs({cx:t[1],cy:t[2],x:t[3],y:t[4],fromX:e?.x,fromY:e?.y})}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.fromX+this.x)/2,e=this.cy*2-(this.fromY+this.y)/2;return["Q",t,e,this.x,this.y]}else return["Q",this.cx,this.cy,this.x,this.y]}toCanvasContext(t){if(t.beginPath(),t.moveTo(this.fromX,this.fromY),this.isLineThrough){const e=this.cx*2-(this.fromX+this.x)/2,s=this.cy*2-(this.fromY+this.y)/2;t.quadraticCurveTo(e,s,this.x,this.y)}else t.quadraticCurveTo(this.cx,this.cy,this.x,this.y)}interpolate(t){return{x:(1-t)*(1-t)*this.fromX+2*(1-t)*t*this.cx+t*t*this.x,y:(1-t)*(1-t)*this.fromY+2*(1-t)*t*this.cy+t*t*this.y}}}class ue extends yt{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1}static fromSVGPathData(t,e){if(t.length<8)throw new Error("Arc 参数个数错误");if(t[0].toUpperCase()!=="A")throw new Error("Arc command 错误");return new ue({rx:t[1],ry:t[2],xAxisRotate:t[3],largeArcFlag:t[4],sweepFlag:t[5],x:t[6],y:t[7],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.x,this.y]}toCanvasContext(t){t.beginPath();const[e,s,i,r,a,o,c]=this.convertSVGToCanvas(this.fromX,this.fromY,this.x,this.y,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,s,i,r,a,o,c,!this.sweepFlag)}convertSVGToCanvas(t,e,s,i,r,a,o,c,h){const l=o/180*Math.PI,f=(t-s)/2,g=(e-i)/2,y=Math.cos(l)*f+Math.sin(l)*g,m=-Math.sin(l)*f+Math.cos(l)*g,v=y*y/(r*r)+m*m/(a*a);if(v>1){const H=Math.sqrt(v);throw r=H*r,a=H*a,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${a}.`)}const b=Math.sqrt((r*r*a*a-r*r*m*m-a*a*y*y)/(r*r*m*m+a*a*y*y)),S=c!=h?1:-1,C=S*b*r*m/a,k=S*b*-a*y/r,R=(t+s)/2,F=(e+i)/2,L=Math.cos(l)*C-Math.sin(l)*k+R,j=Math.sin(l)*C+Math.cos(l)*k+F,Q=(H,nt,wt,ct)=>(H*ct>=nt*wt?1:-1)*Math.acos((H*wt+nt*ct)/(Math.sqrt(H*H+nt*nt)*Math.sqrt(wt*wt+ct*ct))),q=Q(1,0,t-L,e-j)-l,Y=Q(t-L,e-j,s-L,i-j);return[L,j,r,a,l,q,q+Y]}}class O extends X{startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){super(t),this.prevPathX=this.startPathX=this.x,this.prevPathY=this.startPathY=this.y}appendLine(t){if(t instanceof ue){fi(this.prevPathX,this.prevPathY,t.x,t.y,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(h=>{const[l,f,g,y,m,v,b,S]=h;this.normalizedLines.push(new Tt({c1x:g,c1y:y,c2x:m,c2y:v,x:b,y:S,fromX:this.prevPathX,fromY:this.prevPathY})),this.prevPathX=b,this.prevPathY=S});return}let e,s,i,r,a,o;t instanceof Tt?(e=t.c1x,s=t.c1y,i=t.c2x,r=t.c2y,a=t.x,o=t.y):t instanceof bs?[e,s,i,r,a,o]=Xs(this.prevPathX,this.prevPathY,t.cx,t.cy,t.x,t.y):[e,s,i,r,a,o]=ve(this.prevPathX,this.prevPathY,t.x,t.y),this.normalizedLines.push(new Tt({c1x:e,c1y:s,c2x:i,c2y:r,x:a,y:o,fromX:this.prevPathX,fromY:this.prevPathY})),this.prevPathX=a,this.prevPathY=o}static fromShape(t,e){const s=new O(Object.assign({attrs:{...t.attrs}},e));return s.updateFromShape(t),s}updateFromShape(t){this.degree=t.degree,this.scaleOnOrigin=t.scaleOnOrigin,this.skewDegreeOnOrigin=t.skewDegreeOnOrigin,this.updateFromSVGPathD(t.toSVGPathD())}static fromSVGPathD(t="M0,0",e){const s=new O(e);return s.updateFromSVGPathD(t),s}static fromSVGPathData(t,e){const s=new O(e);return s.updateFromSVGPathData(t),s}updateFromSVGPathD(t){G.isSVGPath(t)&&this.updateFromSVGPathData(G.parseSVGPath(t))}updateFromSVGPathData(t){this.normalizedLines=[];const e=G.normalizeSVGPath(G.absolutizeSVGPath(t));for(let s=0,i=e.length;s<i;s++){const r=e[s];if(r[0]=="M"){this.prevPathX=this.startPathX=r[1],this.prevPathY=this.startPathY=r[2];continue}this.appendLine(new Tt({c1x:r[1],c1y:r[2],c2x:r[3],c2y:r[4],x:r[5],y:r[6]}))}this.prevDegree=0,this.prevScaleOnOrigin=1,this.prevSkewDegreeOnOrigin=0,this.updateTransform()}toSVGPathData(t=!1){let e=[];e.push(["M",this.startPathX,this.startPathY]);for(let s=0,i=this.normalizedLines.length;s<i;s++)e.push(this.normalizedLines[s].toSVGPathData());return t&&(e=G.relativeSVGPath(e)),e}toCanvasContext(t){t.beginPath(),t.moveTo(this.startPathX,this.startPathY),this.normalizedLines.forEach(e=>{const[s,...i]=e.toSVGPathData();t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])})}updateTransform(){if((this.x!=this.prevX||this.y!=this.prevY)&&this.translate(this.x-this.prevX,this.y-this.prevY),this.degree!=this.prevDegree){const t=this.getBoundingClientRect();this.rotate(this.degree-this.prevDegree,t.x+t.width/2,t.y+t.height/2)}if(this.scaleOnOrigin!=this.prevScaleOnOrigin){const t=this.getBoundingClientRect(),e=this.scaleOnOrigin/this.prevScaleOnOrigin;this.scale(e,e,t.x+t.width/2,t.y+t.height/2)}}transform(t){return{x:this.startPathX,y:this.startPathY}=t.multiplyPoint(this.startPathX,this.startPathY),{x:this.prevPathX,y:this.prevPathY}=t.multiplyPoint(this.prevPathX,this.prevPathY),this.normalizedLines.forEach(e=>{({x:e.fromX,y:e.fromY}=t.multiplyPoint(e.fromX,e.fromY)),{x:e.c1x,y:e.c1y}=t.multiplyPoint(e.c1x,e.c1y),{x:e.c2x,y:e.c2y}=t.multiplyPoint(e.c2x,e.c2y),{x:e.x,y:e.y}=t.multiplyPoint(e.x,e.y)}),this}translate(t,e){const s=new Z().translate(t,e);return this.transform(s),this.prevX=this.x,this.prevY=this.y,this}rotate(t,e=0,s=0){const i=new Z().rotate(t,e,s);return this.transform(i),this.prevDegree=this.degree,this}scale(t,e=t,s=0,i=0){const r=new Z().scale(t,e,s,i);return this.transform(r),this.prevScaleOnOrigin=this.scaleOnOrigin,this}skew(t,e=0){const s=new Z().skew(t,e);return this.transform(s),this.prevSkewDegreeOnOrigin=this.skewDegreeOnOrigin,this}trim(){const t=this.getBoundingClientRect();return this.translate(-t.x,-t.y),this}getBoundingClientRect(){let t=0,e=0,s=[],i=[];t=this.startPathX,e=this.startPathY,s.push(t),i.push(e),this.normalizedLines.forEach(h=>{const l=G.curveDim(t,e,h.c1x,h.c1y,h.c2x,h.c2y,h.x,h.y);s=s.concat(l.min.x,l.max.x),i=i.concat(l.min.y,l.max.y),t=h.x,e=h.y});const r=Math.min.apply(0,s),a=Math.min.apply(0,i),o=Math.max.apply(0,s),c=Math.max.apply(0,i);return new Ct({x:r,y:a,width:o-r,height:c-a})}getTotalLength(){return this.normalizedLines.reduce((t,e)=>t+=e.length(),0)}interpolate(t){if(this.normalizedLines.length===0)return{x:this.startPathX,y:this.startPathX};if(this.normalizedLines.length===1)return this.normalizedLines[0].interpolate(t);{let e=t*this.normalizedLines.length,s=this.normalizedLines[0];if(e--,e>1)for(let i=1,r=this.normalizedLines.length;i<r&&(s=this.normalizedLines[i],e>1);i++)e-=1;return s.interpolate(e)}}getPointAtLength(t){let e=0;const s=this.normalizedLines.length;for(let i=0;i<s;i++){const r=this.normalizedLines[i],a=r.length();if(e+a>=t)return r.getPointAtSegmentLength(t-e);e+=a}return this.normalizedLines[s-1].getPointAtSegmentLength(1)}getSubpathsAtLength(t,e,s){let i=null,r=0;const a=new O;a.prevPathX=a.startPathX=t.x,a.prevPathY=a.startPathY=t.y;for(let o=0,c=t.normalizedLines.length;o<c;o++){const h=t.normalizedLines[o],l=h.length();if(r+l>e&&!i){const f=h.getPointAtSegmentLength(e-r);if(a.appendLine(new Tt({c1x:f.start.x,c1y:f.start.y,c2x:f.m.x,c2y:f.m.y,x:f.x,y:f.y})),s)return a;i=a,a.prevPathX=f.x,a.prevPathY=f.y,a.appendLine(new Tt({c1x:f.n.x,c1y:f.n.y,c2x:f.end.x,c2y:f.end.y,x:h.x,y:h.y})),r+=l;continue}r+=l,a.appendLine(h)}return a}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const s=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(s,t):s}}trailPath(t,e=0){const s=this.getTotalLength();return t.updateFromSVGPathD(this.getSubpath(0,e*s).toSVGPathD()),this.getPointAtLength(e*s)}isPointInPath(t,e,s){if(s instanceof vs)return s.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=s.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInFill(i):!1}isPointInStroke(t,e,s){if(s instanceof vs)return s.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=s.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(i):!1}strokeDashToTween(t){const e=+this.getTotalLength().toFixed(0);this.setAttr({strokeDasharray:`${e} ${e}`,strokeDashoffset:`${e}`});const s=t?.onUpdate;return le.toTween({offset:e},{offset:0},Object.assign(t||{},{onUpdate:(i,r)=>{this.setAttr("strokeDashoffset",""+Vt(i.offset,2)),s?.(i,r)}}))}get polymorphPoints(){return[this.startPathX,this.startPathY].concat(this.normalizedLines.reduce((t,e)=>t.concat([e.c1x,e.c1y,e.c2x,e.c2y,e.x,e.y]),[]))}static fromPolymorphPoints(t){const e=new O({x:t[0],y:t[1]});for(let s=2;s+5<t.length;s+=6)e.appendLine(new Tt({c1x:t[s],c1y:t[s+1],c2x:t[s+2],c2y:t[s+3],x:t[s+4],y:t[s+5]}));return e}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let s=t[e-2],i=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=Ze(t[a],t[a+1],s,i),s=t[a],i=t[a+1];return Math.floor(r)}fillPathD(t){const e=this.polymorphPoints,s=e.length;let i=t-s;const r=Math.ceil(t/s),a=[];a.push(["M",e[0],e[1]]);let o=2;for(;o+5<=s-1;){const c=e[o++],h=e[o++],l=e[o++],f=e[o++],g=e[o++],y=e[o++];a.push(["C",c,h,l,f,g,y]);let m=0;for(;m<r&&i>0;)a.push(["C",g,y,g,y,g,y]),i-=6,m++}return O.fromSVGPathData(a)}static mixPoints(t,e,s){const i=t.length,r=new Array(i);for(let a=0;a<i;a++)r[a]=Vt(t[a]+(e[a]-t[a])*s,6);return r}static getPathInterpolator(t,e){return s=>Math.abs(s-0)<Number.EPSILON?t.toSVGPathD():Math.abs(s-1)<Number.EPSILON?e.toSVGPathD():O.fromPolymorphPoints(this.mixPoints(t.polymorphPoints,e.polymorphPoints,s)).toSVGPathD()}static polymorph(t){if(!t.length)throw new Error("paths 为空!");const e=t.length-1,s=new Array(e);for(let r=0;r<e;r++){const a=Math.max(t[r].polymorphPoints.length,t[r+1].polymorphPoints.length);s[r]=this.getPathInterpolator(t[r].fillPathD(a),t[r+1].fillPathD(a))}const i=O.fromSVGPathD(s[0](0));return r=>{const a=Vt(e*r,6),o=Math.min(Math.floor(a),e-1),c=Vt(a-o,6);return i.updateFromSVGPathD(s[o](c)),i.setAttr("fill",Ys(t[o].getAttr("fill","none"),t[o+1].getAttr("fill","none"),c)),i.setAttr("stroke",Ys(t[o].getAttr("stroke","none"),t[o+1].getAttr("stroke","none"),c)),i}}static generateRosetta(t,e,s,i,r){if(r==0)throw new Error("no dividing by zero, please");const a=new O({x:t,y:e}),o=360/r;for(let c=0;c<r;c+=1){const h=o*c*Math.PI/180,l=t+2*s*Math.cos(h),f=e+2*s*Math.sin(h);a.appendLine(new ue({x:l,y:f,rx:s,ry:i,xAxisRotate:o*c,largeArcFlag:1,sweepFlag:1})),a.appendLine(new ue({x:t,y:e,rx:s,ry:i,xAxisRotate:o*c,largeArcFlag:1,sweepFlag:1}))}return a}}class Ne extends Zt{svgWidth=0;svgHeight=0;width=0;height=0;shapes=[];constructor(t){if(super(t),!t?.svg)return;const e=new Sr(t.svg).parse();for(let s=0,i=e.length;s<i;s++){const r=e[s];if(r.type=="viewbox"&&r.width&&r.height){if(this.svgWidth=parseFloat(r.width),this.svgHeight=parseFloat(r.height),t.width){const l=this.svgWidth/this.svgHeight;this.width=t.width,this.height=this.width/l}else this.width=this.svgWidth,this.height=this.svgHeight;continue}if(r.type!="path"||!ne.isSVGPath(r.path))continue;const a={};for(const l in r)l==="type"||l==="path"||l==="transform"||(a[l]=r[l]);const o=ne.absolutizeSVGPath(ne.parseSVGPath(r.path));let c=[],h=[];for(let l=0,f=o.length;l<f;l++){const g=o[l];h.push(g),g[0].toLowerCase()=="z"&&(c.push(h),h=[])}h.length&&c.push(h),c.forEach(l=>{const f=O.fromSVGPathData(l,t),g=js(r.transform??"");f.transform(g),f.attrs={...f.attrs,...a,...t.attrs},this.width&&this.svgWidth&&f.scale(this.width/this.svgWidth),this.shapes.push(f)})}}static fromShape(t,e){const s=new Ne;if(t instanceof X){const i=O.fromShape(t,e);i&&s.shapes.push(i)}else t.forEach(i=>{const r=O.fromShape(i,e);r&&s.shapes.push(r)});return s}addShape(t,e){(Array.isArray(t)?t:[t]).forEach(s=>{if(s instanceof O)this.shapes.push(s);else{const i=O.fromShape(s,e);i&&this.shapes.push(i)}})}strokeDashToTween(t){const e=t?.type||"parallel",s=this.shapes.map(i=>i.strokeDashToTween({...t}).tween);switch(e){case"sequence":return s.forEach((i,r)=>{r>0&&s[r-1].chain(i)}),{startAuto:le.toTweenGroup(s[0],t)};case"parallel":default:return{startAuto:le.toTweenGroup(s,t)}}}sortPathD(){this.shapes=this.shapes.map(t=>({path:t,perimeter:t.perimeterPoints()})).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.path)}fillPathDGroup(t){const e=t.shapes.length,s=this.shapes.length;if(e<s)return t.fillPathDGroup(this);for(let i=s;i<e;i++){const r=t.shapes[i].polymorphPoints,a=r[0],o=r[1],c=new O({x:a,y:o,attrs:{...t.shapes[i].attrs}});for(let h=2;h+5<r.length;h+=6)c.appendLine(new Tt({c1x:a,c1y:o,c2x:a,c2y:o,x:a,y:o}));this.shapes.push(c)}}static polymorph(t){if(!t.length)throw new Error("groups 为空!");let e=-1,s=0;t.forEach((o,c)=>{o.sortPathD(),s<o.shapes.length&&(s=o.shapes.length,e=c)}),t.forEach(o=>o.fillPathDGroup(t[e]));const i=[];t.forEach((o,c)=>{o.shapes.forEach((h,l)=>{i[l]=i[l]||[],i[l][c]=h})});const r=[];i.forEach(o=>r.push(O.polymorph(o)));const a=new Ne;return r.forEach(o=>{a.shapes.push(o(0))}),o=>(r.forEach(c=>{c(o)}),a)}}class Tr extends X{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}getBoundingClientRect(){return new Ct({x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2})}toSVGPathData(){return[["M",this.x,this.y],["m",0,-this.ry],["a",this.rx,this.ry,0,1,1,0,2*this.ry],["a",this.rx,this.ry,0,1,1,0,-2*this.ry],["z"]]}toCanvasContext(t){t.beginPath(),t.ellipse(this.x,this.y,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class bn extends X{points;constructor(t=[]){if(!t.length)throw new Error("points can't be null");super(t[0]),this.points=t}toSVGPathData(){const t=this.points.length;if(t<3)throw new Error("points length must >= 3");const e=[];e.push(["M",this.points[0].x,this.points[0].y]);for(let s=0;s<=t-1;s++)e.push(["L",this.points[s].x,this.points[s].y]);return e.push(["L",this.points[0].x,this.points[0].y]),e}toCanvasContext(t){const e=this.points.length;if(e<3)throw new Error("points length must >= 3");t.beginPath(),t.moveTo(0,0);for(let s=0;s<=e-1;s++)t.lineTo(this.points[s].x-this.points[0].x,this.points[s].y-this.points[0].y);t.lineTo(0,0)}get length(){return this.points.length}addPoint(t){this.points.push(t)}getPoint(t){return this.points[t]}isContainPoint(t,e){const s=this.length;let i=!1;const r=2e-10;for(let a=0,o=s-1;a<s;o=a,a++){const c=this.points[a].x,h=this.points[a].y,l=this.points[o].x,f=this.points[o].y;if(c===t&&h===e||l===t&&f===e||e===h&&e===f)return!0;if(e>=h&&e<f||e<h&&e>=f){const g=(l-c)/(f-h),y=c+g*(e-h);if(y===t||Math.abs(y-t)<r)return!0;y>t&&(i=!i)}}return i}[Symbol.iterator](){let t=0;return{next:()=>({value:t>=this.length-1?this.points[++t]:void 0,done:t>=this.length})}}static generatePoints(t,e,s,i){const r=[];for(let a=0;a<i;a++){const o=a/i*2*Math.PI,{x:c,y:h}=Gt(o,s);r.push(new di({x:t+c,y:e+h}))}return new bn(r)}}class zh extends X{x;y;z;fl;vpX;vpY;cX;cY;cZ;radius;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.fl=t?.fl||250,this.vpX=t?.vpX||0,this.vpY=t?.vpY||0,this.cX=t?.cX||0,this.cY=t?.cY||0,this.cZ=t?.cZ||0,this.radius=t?.radius||0}getBoundingClientRect(){return null}toSVGPathData(){return this.radius?[["M",this.getScreenX(),this.getScreenY()-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:["M",this.getScreenX(),this.getScreenY()]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}toArray(){return[this.x,this.y,this.z]}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,s){this.cX=t,this.cY=e,this.cZ=s}rotateX(t){({x:this.y,y:this.z}=St(t,this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=St(t,this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=St(t,this.x,this.y))}getScreenX(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*t}getScreenY(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*t}cross(t){const e=this.x,s=this.y,i=this.z;return this.x=s*t.z-i*t.y,this.y=i*t.x-e*t.z,this.z=e*t.y-s*t.x,this}normalize(t=1){const e=Je(this.x,this.y,this.z);if(e){const s=t/e;this.x*=s,this.y*=s,this.z*=s}return this}reflect(t,e){const s=t.x*e.x+t.y*e.y+t.z*e.z;return this.x=t.x-2*s*e.x,this.y=t.y-2*s*e.y,this.z=t.z-2*s*e.z,this}}class jh extends X{x;y;z;brightness;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.brightness=this.setBrightness(t?.brightness||1)}setBrightness(t){return this.brightness=lt(t,0,1),this.brightness}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){}}const Xh=jh;class qh extends X{points;light;constructor(t=[]){if(t.length<3)throw new Error("points length must >= 3");super(t[0]),this.points=t,this.light=new Xh({x:0,y:0,z:0,brightness:1})}toSVGPathData(){const t=[];t.push(["M",this.points[0].getScreenX(),this.points[0].getScreenY()]);for(let e=0,s=this.points.length;e<=s-1;e++)t.push(["L",this.points[e].getScreenX(),this.points[e].getScreenY()]);return t.push(["L",this.points[0].getScreenX(),this.points[0].getScreenY()]),t}toCanvasContext(t){t.beginPath(),t.moveTo(0,0);for(let e=0,s=this.points.length;e<=s-1;e++)t.lineTo(this.points[e].getScreenX()-this.points[0].getScreenX(),this.points[e].getScreenY()-this.points[0].getScreenY());t.lineTo(0,0)}get length(){return this.points.length}getDepth(){return Math.min(...this.points.map(t=>t.z))}isBackface(){const t=this.points[2].getScreenX()-this.points[0].getScreenX(),e=this.points[2].getScreenY()-this.points[0].getScreenY(),s=this.points[1].getScreenX()-this.points[2].getScreenX(),i=this.points[1].getScreenY()-this.points[2].getScreenY();return t*i>e*s}getLightFactor(){const t={x:this.points[0].x-this.points[1].x,y:this.points[0].y-this.points[1].y,z:this.points[0].z-this.points[1].z},e={x:this.points[1].x-this.points[2].x,y:this.points[1].y-this.points[2].y,z:this.points[1].z-this.points[2].z},s={x:t.y*e.z-t.z*e.y,y:-(t.x*e.z-t.z*e.x),z:t.x*e.y-t.y*e.x},i=s.x*this.light.x+s.y*this.light.y+s.z*this.light.z,r=Math.sqrt(s.x*s.x+s.y*s.y+s.z*s.z),a=Math.sqrt(this.light.x*this.light.x+this.light.y*this.light.y+this.light.z*this.light.z);return Math.acos(i/(r*a))/Math.PI*this.light.brightness}getAdjustedColor(t){const e=zt(t),s=this.getLightFactor();return e.r*=s,e.g*=s,e.b*=s,Ce(e)}}class xs extends X{text;width=0;height=0;bitmap=null;constructor(t){super(t),this.text=t.text,this.attrs={fontSize:"10px",fontFamily:'system-ui, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',emojiFontFamily:'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif',fill:"#666666","alignment-baseline":"middle",textAnchor:"start",...this.attrs};const e=ca(this.attrs.fontSize,10).number,s=new OffscreenCanvas(e,e),i=s.getContext("2d");if(i){i.font=""+this.attrs.fontSize+" "+this.attrs.fontFamily,this.bitmap=s.transferToImageBitmap();const r=i.measureText(this.text);let a=Math.ceil(r.actualBoundingBoxRight+r.actualBoundingBoxLeft),o=Math.ceil(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);const c=2;a+=c+c,o+=c+c,this.width=a,this.height=o}}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){t.fillText(this.text,0,0)}}class Yh extends Zt{radius;expandRaidus;startDegree;endDegree;text="";defaultShowText;p1=new ut;p1Offset=10;p2=new ut;p2Offset=40;p3=new ut;p3Offset=10;p4=new ut;p4Offset=10;direction=1;constructor(t){super(t),this.radius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.text=t.text||"",this.defaultShowText=typeof t?.defaultShowText=="boolean"?t.defaultShowText:!1;const e=Object.assign({...this.attrs},{fill:"none"});this.line12=new yt({fromX:this.p1.x,fromY:this.p1.y,x:this.p2.x,y:this.p2.y,attrs:{...e},isShow:this.defaultShowText}),this.line23=new yt({fromX:this.p2.x,fromY:this.p2.y,x:this.p3.x,y:this.p3.y,attrs:{...e},isShow:this.defaultShowText}),this.textShape=new xs({x:this.p4.x,y:this.p4.y,text:this.text,attrs:{...e,textAnchor:this.direction==1?"start":"end"},isShow:this.defaultShowText}),this.sector=new Er({x:this.x,y:this.y,radius:this.radius,expandRaidus:this.expandRaidus,startDegree:this.startDegree,endDegree:this.endDegree,attrs:Object.assign({...this.attrs},{strokeWidth:"0"})}),this.shapes.push(this.sector),this.text&&(this.shapes.push(this.line12),this.shapes.push(this.line23),this.shapes.push(this.textShape)),this.update()}frameUpdate(){this.text&&!this.defaultShowText&&(this.line12.isShow=this.sector.isMouseIn,this.line23.isShow=this.sector.isMouseIn,this.textShape.isShow=this.sector.isMouseIn),this.update()}update(){const t=this.startDegree+(this.endDegree-this.startDegree)/2,{x:e,y:s}=Gt(st(t),this.sector.radius+this.p1Offset);this.p1.x=this.x+e,this.p1.y=this.y+s;const{x:i,y:r}=Gt(st(t),this.sector.radius+this.p1Offset+this.p2Offset);this.p2.x=this.x+i,this.p2.y=this.y+r,this.line12.fromX=this.p1.x,this.line12.fromY=this.p1.y,this.line12.x=this.p2.x,this.line12.y=this.p2.y,this.direction=this.p1.x>this.x?1:-1,this.p3.x=this.p2.x+this.direction*this.p3Offset,this.p3.y=this.p2.y,this.p4.x=this.p3.x+this.direction*this.p4Offset,this.p4.y=this.p3.y,this.line23.fromX=this.p2.x,this.line23.fromY=this.p2.y,this.line23.x=this.p3.x,this.line23.y=this.p3.y,this.textShape.x=this.p4.x,this.textShape.y=this.p4.y,this.textShape.setAttr("textAnchor",this.direction==1?"start":"end")}}class Er extends X{radius;realRadius;expandRaidus;startDegree;endDegree;vr;ar;bounce;dur;status;constructor(t){super(t),this.radius=0,this.realRadius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.vr=0,this.ar=.03,this.bounce=.6,this.dur=1e3/120,this.status=0}frameUpdate(){this.status==0&&this.radius<this.realRadius?(this.expand(this.realRadius),this.radius>=this.realRadius&&(this.status=1)):this.isMouseIn?this.expand(this.realRadius+this.expandRaidus):this.shrink(this.realRadius)}expand(t){this.vr+=this.ar,this.radius+=this.vr*this.dur,this.radius>t&&(this.radius=t,this.vr*=-this.bounce)}shrink(t){this.vr-=this.ar,this.radius+=this.vr*this.dur,this.radius<t&&(this.radius=t,this.vr*=-this.bounce)}toSVGPathData(){const{x:t,y:e}=Gt(st(this.startDegree),this.radius),{x:s,y:i}=Gt(st(this.endDegree),this.radius);return[["M",this.x,this.y],["l",t,e],["A",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,this.x+s,this.y+i],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.arc(0,0,this.radius,st(this.startDegree),st(this.endDegree),!1),t.closePath()}containPoint(t,e){const s=Ze(this.x,this.y,t,e),i=J(ye(this.x,this.y,t,e));return s<this.radius&&i>this.startDegree&&i<this.endDegree}}class Hh extends X{constructor(t){super(t)}toSVGPathData(){return[["M",this.x,this.y],["m",-50,-25],["l",50,0],["l",0,-25],["l",50,50],["l",-50,50],["l",0,-25],["l",-50,0],["l",0,-50],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(-50,-25),t.lineTo(0,-25),t.lineTo(0,-50),t.lineTo(50,0),t.lineTo(0,50),t.lineTo(0,25),t.lineTo(-50,25),t.lineTo(-50,-25),t.closePath()}}class Wh extends X{constructor(t){super(t)}toSVGPathData(){return[["M",this.x,this.y],["m",4,24],["l",4,-8],["l",6,-6],["l",1,-10],["l",-6,-10],["l",-7,10],["l",-4,0],["l",-7,-10],["l",-6,10],["l",1,10],["l",6,6],["l",4,8],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(4,24),t.lineTo(8,16),t.lineTo(14,10),t.lineTo(15,0),t.lineTo(9,-10),t.lineTo(2,0),t.lineTo(-2,0),t.lineTo(-9,-10),t.lineTo(-15,0),t.lineTo(-14,10),t.lineTo(-8,16),t.lineTo(-4,24),t.closePath()}}class $h extends O{constructor(t){super(t),this.rx=t?.rx??10,this.ry=t?.ry??10,this.updateFromSVGPathData([["M",this.x,this.y],["l",this.rx*2.4,-this.ry*3.14],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,-this.ry*1.5],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,this.ry*1.5],["l",this.rx*2.4,this.ry*3.14],["z"]])}}class Jh extends O{constructor(t){super(t),this.rx=t?.rx??50,this.ry=t?.ry??50,this.updateFromSVGPathData([["M",this.x,this.y+this.ry*.3],["C",this.x,this.y,this.x-this.rx/2,this.y,this.x-this.rx/2,this.y+this.ry*.3],["C",this.x-this.rx/2,this.y+(this.ry+this.ry*.3)/2,this.x,this.y+(this.ry+this.ry*.3)/1.4,this.x,this.y+this.ry],["C",this.x,this.y+(this.ry+this.ry*.3)/1.8,this.x+this.rx/2,this.y+(this.ry+this.ry*.3)/2,this.x+this.rx/2,this.y+this.ry*.3],["C",this.x+this.rx/2,this.y,this.x,this.y,this.x,this.y+this.ry*.3],["z"]])}}class Zh extends O{constructor(t){super(t),this.r=t?.r??20;let e="M"+this.x+","+(this.y-this.r);for(let s=0;s<6;s+=1){const i=270+s*144,r=this.x+this.r*Math.cos(i*Math.PI/180),a=this.y+this.r*Math.sin(i*Math.PI/180);e+="L"+r+","+a}this.updateFromSVGPathD(e)}}class Kh extends O{constructor(t){super(t),this.updateFromSVGPathData([["M",this.x,this.y],["C",this.x+15,this.y,this.x+15,this.y-40,this.x+5,this.y+-30],["L",this.x,this.y],["C",this.x-15,this.y,this.x-15,this.y-40,this.x-5,this.y-30],["L",this.x,this.y],["a",15,15,0,1,1,0,2*15],["a",15,15,0,1,1,0,-2*15]])}}class Qh extends O{constructor(t){super(t),this.updateFromSVGPathD(`M${this.x} ${this.y}m5.068 9.267-3.08-.77a.512.512 0 0 1 0-.994l3.08-.77a2.289 2.289 0 0 0 1.665-1.665l.77-3.08a.512.512 0 0 1 .994 0l.77 3.08c.205.82.845 1.46 1.665 1.665l3.08.77a.512.512 0 0 1 0 .994l-3.08.77a2.29 2.29 0 0 0-1.665 1.665l-.77 3.08a.512.512 0 0 1-.994 0l-.77-3.08a2.289 2.289 0 0 0-1.665-1.665Z`)}}class tl extends Ne{constructor(t){super(t),this.addShape(O.fromSVGPathData([["M",this.x,this.y],["L",this.x,this.y-140-Math.random()*20]],t)),this.addShape(O.fromSVGPathData([["M",this.x,this.y-30-Math.random()*30],["L",this.x+Math.random()*80-40,this.y-100-Math.random()*40]],t)),this.addShape(O.fromSVGPathData([["M",this.x,this.y-60-Math.random()*40],["L",this.x+Math.random()*60-30,this.y-110-Math.random()*20]],t))}}class el{app;ctx;shapes=[];isMouseDown=!1;currentMouseInShapeID="";currentEnableDragMouseInShapeID="";constructor(t){this.app=t,this.ctx=new vs(this.app.container,this.app.width,this.app.height),this.app.captureMove({start:()=>{this.isMouseDown=!0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.setCursor()},move:()=>{if(this.isMouseDown&&this.currentEnableDragMouseInShapeID){this.setCursor();return}this.currentMouseInShapeID="";let e=0,s=this.shapes.length;for(;e<s;e++){const i=this.shapes[e];this.ctx.save(),this.transformCtxBaseOnShape(i);const r=this.ctx.isPointInPath(i.path2d,this.app.mousePoint.x,this.app.mousePoint.y)||!1;if(this.ctx.restore(),i.isMouseIn=r,r&&(this.currentMouseInShapeID=i.id,i.enableDrag)){this.currentEnableDragMouseInShapeID=i.id,this.shapes.filter(a=>a.id!==i.id).forEach(a=>{a instanceof X&&(a.isMouseIn=!1)});break}}e>=s&&(this.currentEnableDragMouseInShapeID=""),this.setCursor()}})}setCursor(){this.currentEnableDragMouseInShapeID?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShapeID?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}transformCtxBaseOnShape(t){!(t instanceof yt)&&!(t instanceof O)&&this.ctx.translate(t.x,t.y),this.ctx.rotate(st(t.degree)),this.ctx.scale(t.scaleOnOrigin,t.scaleOnOrigin)}draw(t=[]){const e=[];ia(t)?e.push(...t):e.push(t),this.shapes=[],e.forEach(s=>{s instanceof Zt?(s.frameUpdate(),this.shapes.push(...s.shapes)):this.shapes.push(s)});for(let s of this.shapes)if(s.isShow){if(this.ctx.save(),A.attrsToCanvas(this.ctx,s.attrs),s.followMouse&&(!pe(s.x,this.app.mousePoint.x,5)||!pe(s.y,this.app.mousePoint.y,5))&&(s.angleTo(this.app.mousePoint),s.followTo(this.app.mousePoint)),s.targetToAfterDragFree&&(this.isMouseDown||s.nextFrameEaseTo(new ut({x:s.targetToAfterDragFree.targetX,y:s.targetToAfterDragFree.targetY}),{easing:s.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShapeID==s.id){const{dx:i,dy:r}=s.centerDiff;s.x=this.app.mousePoint.x,s.y=this.app.mousePoint.y,s.x-=i,s.y-=r,s.isDragging=!0,this.shapes.filter(a=>a.id!=s.id).forEach(a=>a.isDragging=!1)}else this.shapes.forEach(i=>i.isDragging=!1);s.frameUpdate(),this.transformCtxBaseOnShape(s),s.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill(),s.path2d=this.ctx.currentPath2D,this.ctx.restore()}return this}click(t){const e=()=>{this.shapes.forEach(s=>{(s instanceof O&&s.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.ctx)||this.currentMouseInShapeID==s.id)&&t(s)})};return this.app.on("tap",e),()=>{this.app.off("tap",e)}}drawMouseMoveLine(t="line",e){switch(t){case"brush":const s=e?.brushSize??10,i=e?.brushDensity??50,r=e?.brushColor??"#000000",a=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),o=a.data,c=zt(r);return this.app.captureMove({move:()=>{if(this.isMouseDown){for(let h=0;h<i;h++){const l=Math.random()*Math.PI*2,f=Math.random()*s,g=this.app.mousePoint.x+Math.cos(l)*f|0,y=this.app.mousePoint.y+Math.sin(l)*f|0,m=(g+y*a.width)*4;o[m]=c.r,o[m+1]=c.g,o[m+2]=c.b,o[m+3]=255}this.ctx.putImageData(a)}}});case"line":default:return this.app.captureMove({start:h=>{this.ctx.beginPath(),this.app.setMousePoint(h),this.ctx.moveTo(this.app.mousePoint.x,this.app.mousePoint.y)},end:()=>{this.ctx.closePath()},move:()=>{this.isMouseDown&&(this.ctx.lineTo(this.app.mousePoint.x,this.app.mousePoint.y),this.ctx.stroke())}})}}}class sl{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new Se(t),this.remoteVideoUtil=new Se(e)}start(){this.getLocalMediaStream().then(t=>{this.call(t)})}end(){this.localPeerConnection?.close(),this.remotePeerConnection?.close(),this.localPeerConnection=null,this.remotePeerConnection=null,this.trace("Ending call.")}getLocalMediaStream(){return new Promise((t,e)=>{navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then(s=>{this.localVideoUtil.setSrcObject(s),t(s)}).catch(s=>{this.trace(`navigator.getUserMedia error: ${s}.`),e(s)})})}gotRemoteMediaStream(t){const e=t.streams[0];this.remoteVideoUtil.setSrcObject(e),this.trace("Remote peer connection received remote stream.")}call(t){const e=t.getVideoTracks(),s=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),s.length>0&&this.trace(`Using audio device: ${s[0].label}.`);const i=void 0,r=new RTCPeerConnection(i);this.localPeerConnection=r,this.trace("Created local peer connection object localPeerConnection."),r.addEventListener("icecandidate",this.handleConnection),r.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const a=new RTCPeerConnection(i);this.remotePeerConnection=a,this.trace("Created remote peer connection object remotePeerConnection."),a.addEventListener("icecandidate",this.handleConnection),a.addEventListener("iceconnectionstatechange",this.handleConnectionChange),a.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),r.addTrack(e[0],t),r.addTrack(s[0],t),this.trace("localPeerConnection createOffer start."),r.createOffer({offerToReceiveVideo:!0}).then(o=>this.createdOffer(o)).catch(o=>this.setSessionDescriptionError(o))}handleConnection(t){const e=t.target,s=t.candidate;if(e&&s){const i=new RTCIceCandidate(s),r=this.getOtherPeer(e);r&&(r.addIceCandidate(i).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
|
|
36
|
+
`):t.data[r.name]=r.value)}return t}function Jn(i,t){return function(){return i.apply(t,arguments)}}const{toString:eh}=Object.prototype,{getPrototypeOf:pi}=Object,gs=(i=>t=>{const e=eh.call(t);return i[e]||(i[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),kt=i=>(i=i.toLowerCase(),t=>gs(t)===i),ys=i=>t=>typeof t===i,{isArray:pe}=Array,Oe=ys("undefined");function sh(i){return i!==null&&!Oe(i)&&i.constructor!==null&&!Oe(i.constructor)&&pt(i.constructor.isBuffer)&&i.constructor.isBuffer(i)}const Zn=kt("ArrayBuffer");function ih(i){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(i):t=i&&i.buffer&&Zn(i.buffer),t}const nh=ys("string"),pt=ys("function"),Kn=ys("number"),ws=i=>i!==null&&typeof i=="object",rh=i=>i===!0||i===!1,xs=i=>{if(gs(i)!=="object")return!1;const t=pi(i);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)},ah=kt("Date"),oh=kt("File"),hh=kt("Blob"),ch=kt("FileList"),lh=i=>ws(i)&&pt(i.pipe),uh=i=>{let t;return i&&(typeof FormData=="function"&&i instanceof FormData||pt(i.append)&&((t=gs(i))==="formdata"||t==="object"&&pt(i.toString)&&i.toString()==="[object FormData]"))},fh=kt("URLSearchParams"),dh=i=>i.trim?i.trim():i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Re(i,t,{allOwnKeys:e=!1}={}){if(i===null||typeof i>"u")return;let s,n;if(typeof i!="object"&&(i=[i]),pe(i))for(s=0,n=i.length;s<n;s++)t.call(null,i[s],s,i);else{const r=e?Object.getOwnPropertyNames(i):Object.keys(i),a=r.length;let o;for(s=0;s<a;s++)o=r[s],t.call(null,i[o],o,i)}}function Qn(i,t){t=t.toLowerCase();const e=Object.keys(i);let s=e.length,n;for(;s-- >0;)if(n=e[s],t===n.toLowerCase())return n;return null}const tr=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),er=i=>!Oe(i)&&i!==tr;function gi(){const{caseless:i}=er(this)&&this||{},t={},e=(s,n)=>{const r=i&&Qn(t,n)||n;xs(t[r])&&xs(s)?t[r]=gi(t[r],s):xs(s)?t[r]=gi({},s):pe(s)?t[r]=s.slice():t[r]=s};for(let s=0,n=arguments.length;s<n;s++)arguments[s]&&Re(arguments[s],e);return t}const mh=(i,t,e,{allOwnKeys:s}={})=>(Re(t,(n,r)=>{e&&pt(n)?i[r]=Jn(n,e):i[r]=n},{allOwnKeys:s}),i),ph=i=>(i.charCodeAt(0)===65279&&(i=i.slice(1)),i),gh=(i,t,e,s)=>{i.prototype=Object.create(t.prototype,s),i.prototype.constructor=i,Object.defineProperty(i,"super",{value:t.prototype}),e&&Object.assign(i.prototype,e)},yh=(i,t,e,s)=>{let n,r,a;const o={};if(t=t||{},i==null)return t;do{for(n=Object.getOwnPropertyNames(i),r=n.length;r-- >0;)a=n[r],(!s||s(a,i,t))&&!o[a]&&(t[a]=i[a],o[a]=!0);i=e!==!1&&pi(i)}while(i&&(!e||e(i,t))&&i!==Object.prototype);return t},wh=(i,t,e)=>{i=String(i),(e===void 0||e>i.length)&&(e=i.length),e-=t.length;const s=i.indexOf(t,e);return s!==-1&&s===e},xh=i=>{if(!i)return null;if(pe(i))return i;let t=i.length;if(!Kn(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=i[t];return e},bh=(i=>t=>i&&t instanceof i)(typeof Uint8Array<"u"&&pi(Uint8Array)),vh=(i,t)=>{const s=(i&&i[Symbol.iterator]).call(i);let n;for(;(n=s.next())&&!n.done;){const r=n.value;t.call(i,r[0],r[1])}},Sh=(i,t)=>{let e;const s=[];for(;(e=i.exec(t))!==null;)s.push(e);return s},Ch=kt("HTMLFormElement"),Th=i=>i.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,n){return s.toUpperCase()+n}),sr=(({hasOwnProperty:i})=>(t,e)=>i.call(t,e))(Object.prototype),Eh=kt("RegExp"),ir=(i,t)=>{const e=Object.getOwnPropertyDescriptors(i),s={};Re(e,(n,r)=>{let a;(a=t(n,r,i))!==!1&&(s[r]=a||n)}),Object.defineProperties(i,s)},Ph=i=>{ir(i,(t,e)=>{if(pt(i)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=i[e];if(pt(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},Ah=(i,t)=>{const e={},s=n=>{n.forEach(r=>{e[r]=!0})};return pe(i)?s(i):s(String(i).split(t)),e},Dh=()=>{},kh=(i,t)=>(i=+i,Number.isFinite(i)?i:t),yi="abcdefghijklmnopqrstuvwxyz",nr="0123456789",rr={DIGIT:nr,ALPHA:yi,ALPHA_DIGIT:yi+yi.toUpperCase()+nr},Mh=(i=16,t=rr.ALPHA_DIGIT)=>{let e="";const{length:s}=t;for(;i--;)e+=t[Math.random()*s|0];return e};function _h(i){return!!(i&&pt(i.append)&&i[Symbol.toStringTag]==="FormData"&&i[Symbol.iterator])}const Ih=i=>{const t=new Array(10),e=(s,n)=>{if(ws(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[n]=s;const r=pe(s)?[]:{};return Re(s,(a,o)=>{const h=e(a,n+1);!Oe(h)&&(r[o]=h)}),t[n]=void 0,r}}return s};return e(i,0)},Oh=kt("AsyncFunction"),E={isArray:pe,isArrayBuffer:Zn,isBuffer:sh,isFormData:uh,isArrayBufferView:ih,isString:nh,isNumber:Kn,isBoolean:rh,isObject:ws,isPlainObject:xs,isUndefined:Oe,isDate:ah,isFile:oh,isBlob:hh,isRegExp:Eh,isFunction:pt,isStream:lh,isURLSearchParams:fh,isTypedArray:bh,isFileList:ch,forEach:Re,merge:gi,extend:mh,trim:dh,stripBOM:ph,inherits:gh,toFlatObject:yh,kindOf:gs,kindOfTest:kt,endsWith:wh,toArray:xh,forEachEntry:vh,matchAll:Sh,isHTMLForm:Ch,hasOwnProperty:sr,hasOwnProp:sr,reduceDescriptors:ir,freezeMethods:Ph,toObjectSet:Ah,toCamelCase:Th,noop:Dh,toFiniteNumber:kh,findKey:Qn,global:tr,isContextDefined:er,ALPHABET:rr,generateString:Mh,isSpecCompliantForm:_h,toJSONObject:Ih,isAsyncFn:Oh,isThenable:i=>i&&(ws(i)||pt(i))&&pt(i.then)&&pt(i.catch)};function U(i,t,e,s,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=i,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),s&&(this.request=s),n&&(this.response=n)}E.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:E.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const ar=U.prototype,or={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(i=>{or[i]={value:i}}),Object.defineProperties(U,or),Object.defineProperty(ar,"isAxiosError",{value:!0}),U.from=(i,t,e,s,n,r)=>{const a=Object.create(ar);return E.toFlatObject(i,a,function(h){return h!==Error.prototype},o=>o!=="isAxiosError"),U.call(a,i.message,t,e,s,n),a.cause=i,a.name=i.name,r&&Object.assign(a,r),a};const Rh=null;function wi(i){return E.isPlainObject(i)||E.isArray(i)}function hr(i){return E.endsWith(i,"[]")?i.slice(0,-2):i}function cr(i,t,e){return i?i.concat(t).map(function(n,r){return n=hr(n),!e&&r?"["+n+"]":n}).join(e?".":""):t}function Lh(i){return E.isArray(i)&&!i.some(wi)}const Nh=E.toFlatObject(E,{},null,function(t){return/^is[A-Z]/.test(t)});function bs(i,t,e){if(!E.isObject(i))throw new TypeError("target must be an object");t=t||new FormData,e=E.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,b){return!E.isUndefined(b[x])});const s=e.metaTokens,n=e.visitor||l,r=e.dots,a=e.indexes,h=(e.Blob||typeof Blob<"u"&&Blob)&&E.isSpecCompliantForm(t);if(!E.isFunction(n))throw new TypeError("visitor must be a function");function c(m){if(m===null)return"";if(E.isDate(m))return m.toISOString();if(!h&&E.isBlob(m))throw new U("Blob is not supported. Use a Buffer instead.");return E.isArrayBuffer(m)||E.isTypedArray(m)?h&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function l(m,x,b){let S=m;if(m&&!b&&typeof m=="object"){if(E.endsWith(x,"{}"))x=s?x:x.slice(0,-2),m=JSON.stringify(m);else if(E.isArray(m)&&Lh(m)||(E.isFileList(m)||E.endsWith(x,"[]"))&&(S=E.toArray(m)))return x=hr(x),S.forEach(function(M,O){!(E.isUndefined(M)||M===null)&&t.append(a===!0?cr([x],O,r):a===null?x:x+"[]",c(M))}),!1}return wi(m)?!0:(t.append(cr(b,x,r),c(m)),!1)}const u=[],g=Object.assign(Nh,{defaultVisitor:l,convertValue:c,isVisitable:wi});function y(m,x){if(!E.isUndefined(m)){if(u.indexOf(m)!==-1)throw Error("Circular reference detected in "+x.join("."));u.push(m),E.forEach(m,function(S,C){(!(E.isUndefined(S)||S===null)&&n.call(t,S,E.isString(C)?C.trim():C,x,g))===!0&&y(S,x?x.concat(C):[C])}),u.pop()}}if(!E.isObject(i))throw new TypeError("data must be an object");return y(i),t}function lr(i){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function xi(i,t){this._pairs=[],i&&bs(i,this,t)}const ur=xi.prototype;ur.append=function(t,e){this._pairs.push([t,e])},ur.toString=function(t){const e=t?function(s){return t.call(this,s,lr)}:lr;return this._pairs.map(function(n){return e(n[0])+"="+e(n[1])},"").join("&")};function Fh(i){return encodeURIComponent(i).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function fr(i,t,e){if(!t)return i;const s=e&&e.encode||Fh,n=e&&e.serialize;let r;if(n?r=n(t,e):r=E.isURLSearchParams(t)?t.toString():new xi(t,e).toString(s),r){const a=i.indexOf("#");a!==-1&&(i=i.slice(0,a)),i+=(i.indexOf("?")===-1?"?":"&")+r}return i}class Bh{constructor(){this.handlers=[]}use(t,e,s){return this.handlers.push({fulfilled:t,rejected:e,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){E.forEach(this.handlers,function(s){s!==null&&t(s)})}}const dr=Bh,mr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Gh=typeof URLSearchParams<"u"?URLSearchParams:xi,Uh=typeof FormData<"u"?FormData:null,Vh=typeof Blob<"u"?Blob:null,zh=(()=>{let i;return typeof navigator<"u"&&((i=navigator.product)==="ReactNative"||i==="NativeScript"||i==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),jh=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Mt={isBrowser:!0,classes:{URLSearchParams:Gh,FormData:Uh,Blob:Vh},isStandardBrowserEnv:zh,isStandardBrowserWebWorkerEnv:jh,protocols:["http","https","file","blob","url","data"]};function Xh(i,t){return bs(i,new Mt.classes.URLSearchParams,Object.assign({visitor:function(e,s,n,r){return Mt.isNode&&E.isBuffer(e)?(this.append(s,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function Yh(i){return E.matchAll(/\w+|\[(\w*)]/g,i).map(t=>t[0]==="[]"?"":t[1]||t[0])}function qh(i){const t={},e=Object.keys(i);let s;const n=e.length;let r;for(s=0;s<n;s++)r=e[s],t[r]=i[r];return t}function pr(i){function t(e,s,n,r){let a=e[r++];const o=Number.isFinite(+a),h=r>=e.length;return a=!a&&E.isArray(n)?n.length:a,h?(E.hasOwnProp(n,a)?n[a]=[n[a],s]:n[a]=s,!o):((!n[a]||!E.isObject(n[a]))&&(n[a]=[]),t(e,s,n[a],r)&&E.isArray(n[a])&&(n[a]=qh(n[a])),!o)}if(E.isFormData(i)&&E.isFunction(i.entries)){const e={};return E.forEachEntry(i,(s,n)=>{t(Yh(s),n,e,0)}),e}return null}function Hh(i,t,e){if(E.isString(i))try{return(t||JSON.parse)(i),E.trim(i)}catch(s){if(s.name!=="SyntaxError")throw s}return(e||JSON.stringify)(i)}const bi={transitional:mr,adapter:["xhr","http"],transformRequest:[function(t,e){const s=e.getContentType()||"",n=s.indexOf("application/json")>-1,r=E.isObject(t);if(r&&E.isHTMLForm(t)&&(t=new FormData(t)),E.isFormData(t))return n&&n?JSON.stringify(pr(t)):t;if(E.isArrayBuffer(t)||E.isBuffer(t)||E.isStream(t)||E.isFile(t)||E.isBlob(t))return t;if(E.isArrayBufferView(t))return t.buffer;if(E.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(r){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Xh(t,this.formSerializer).toString();if((o=E.isFileList(t))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return bs(o?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||n?(e.setContentType("application/json",!1),Hh(t)):t}],transformResponse:[function(t){const e=this.transitional||bi.transitional,s=e&&e.forcedJSONParsing,n=this.responseType==="json";if(t&&E.isString(t)&&(s&&!this.responseType||n)){const a=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?U.from(o,U.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mt.classes.FormData,Blob:Mt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};E.forEach(["delete","get","head","post","put","patch"],i=>{bi.headers[i]={}});const vi=bi,Wh=E.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),$h=i=>{const t={};let e,s,n;return i&&i.split(`
|
|
37
|
+
`).forEach(function(a){n=a.indexOf(":"),e=a.substring(0,n).trim().toLowerCase(),s=a.substring(n+1).trim(),!(!e||t[e]&&Wh[e])&&(e==="set-cookie"?t[e]?t[e].push(s):t[e]=[s]:t[e]=t[e]?t[e]+", "+s:s)}),t},gr=Symbol("internals");function Le(i){return i&&String(i).trim().toLowerCase()}function vs(i){return i===!1||i==null?i:E.isArray(i)?i.map(vs):String(i)}function Jh(i){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=e.exec(i);)t[s[1]]=s[2];return t}const Zh=i=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(i.trim());function Si(i,t,e,s,n){if(E.isFunction(s))return s.call(this,t,e);if(n&&(t=e),!!E.isString(t)){if(E.isString(s))return t.indexOf(s)!==-1;if(E.isRegExp(s))return s.test(t)}}function Kh(i){return i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,s)=>e.toUpperCase()+s)}function Qh(i,t){const e=E.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(i,s+e,{value:function(n,r,a){return this[s].call(this,t,n,r,a)},configurable:!0})})}class Ss{constructor(t){t&&this.set(t)}set(t,e,s){const n=this;function r(o,h,c){const l=Le(h);if(!l)throw new Error("header name must be a non-empty string");const u=E.findKey(n,l);(!u||n[u]===void 0||c===!0||c===void 0&&n[u]!==!1)&&(n[u||h]=vs(o))}const a=(o,h)=>E.forEach(o,(c,l)=>r(c,l,h));return E.isPlainObject(t)||t instanceof this.constructor?a(t,e):E.isString(t)&&(t=t.trim())&&!Zh(t)?a($h(t),e):t!=null&&r(e,t,s),this}get(t,e){if(t=Le(t),t){const s=E.findKey(this,t);if(s){const n=this[s];if(!e)return n;if(e===!0)return Jh(n);if(E.isFunction(e))return e.call(this,n,s);if(E.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Le(t),t){const s=E.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||Si(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let n=!1;function r(a){if(a=Le(a),a){const o=E.findKey(s,a);o&&(!e||Si(s,s[o],o,e))&&(delete s[o],n=!0)}}return E.isArray(t)?t.forEach(r):r(t),n}clear(t){const e=Object.keys(this);let s=e.length,n=!1;for(;s--;){const r=e[s];(!t||Si(this,this[r],r,t,!0))&&(delete this[r],n=!0)}return n}normalize(t){const e=this,s={};return E.forEach(this,(n,r)=>{const a=E.findKey(s,r);if(a){e[a]=vs(n),delete e[r];return}const o=t?Kh(r):String(r).trim();o!==r&&delete e[r],e[o]=vs(n),s[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return E.forEach(this,(s,n)=>{s!=null&&s!==!1&&(e[n]=t&&E.isArray(s)?s.join(", "):s)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
|
|
38
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(n=>s.set(n)),s}static accessor(t){const s=(this[gr]=this[gr]={accessors:{}}).accessors,n=this.prototype;function r(a){const o=Le(a);s[o]||(Qh(n,a),s[o]=!0)}return E.isArray(t)?t.forEach(r):r(t),this}}Ss.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),E.reduceDescriptors(Ss.prototype,({value:i},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>i,set(s){this[e]=s}}}),E.freezeMethods(Ss);const Bt=Ss;function Ci(i,t){const e=this||vi,s=t||e,n=Bt.from(s.headers);let r=s.data;return E.forEach(i,function(o){r=o.call(e,r,n.normalize(),t?t.status:void 0)}),n.normalize(),r}function yr(i){return!!(i&&i.__CANCEL__)}function Ne(i,t,e){U.call(this,i??"canceled",U.ERR_CANCELED,t,e),this.name="CanceledError"}E.inherits(Ne,U,{__CANCEL__:!0});function tc(i,t,e){const s=e.config.validateStatus;!e.status||!s||s(e.status)?i(e):t(new U("Request failed with status code "+e.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}const ec=Mt.isStandardBrowserEnv?function(){return{write:function(e,s,n,r,a,o){const h=[];h.push(e+"="+encodeURIComponent(s)),E.isNumber(n)&&h.push("expires="+new Date(n).toGMTString()),E.isString(r)&&h.push("path="+r),E.isString(a)&&h.push("domain="+a),o===!0&&h.push("secure"),document.cookie=h.join("; ")},read:function(e){const s=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function sc(i){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i)}function ic(i,t){return t?i.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):i}function wr(i,t){return i&&!sc(t)?ic(i,t):t}const nc=Mt.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let s;function n(r){let a=r;return t&&(e.setAttribute("href",a),a=e.href),e.setAttribute("href",a),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return s=n(window.location.href),function(a){const o=E.isString(a)?n(a):a;return o.protocol===s.protocol&&o.host===s.host}}():function(){return function(){return!0}}();function rc(i){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i);return t&&t[1]||""}function ac(i,t){i=i||10;const e=new Array(i),s=new Array(i);let n=0,r=0,a;return t=t!==void 0?t:1e3,function(h){const c=Date.now(),l=s[r];a||(a=c),e[n]=h,s[n]=c;let u=r,g=0;for(;u!==n;)g+=e[u++],u=u%i;if(n=(n+1)%i,n===r&&(r=(r+1)%i),c-a<t)return;const y=l&&c-l;return y?Math.round(g*1e3/y):void 0}}function xr(i,t){let e=0;const s=ac(50,250);return n=>{const r=n.loaded,a=n.lengthComputable?n.total:void 0,o=r-e,h=s(o),c=r<=a;e=r;const l={loaded:r,total:a,progress:a?r/a:void 0,bytes:o,rate:h||void 0,estimated:h&&a&&c?(a-r)/h:void 0,event:n};l[t?"download":"upload"]=!0,i(l)}}const Ti={http:Rh,xhr:typeof XMLHttpRequest<"u"&&function(i){return new Promise(function(e,s){let n=i.data;const r=Bt.from(i.headers).normalize(),a=i.responseType;let o;function h(){i.cancelToken&&i.cancelToken.unsubscribe(o),i.signal&&i.signal.removeEventListener("abort",o)}let c;E.isFormData(n)&&(Mt.isStandardBrowserEnv||Mt.isStandardBrowserWebWorkerEnv?r.setContentType(!1):r.getContentType(/^\s*multipart\/form-data/)?E.isString(c=r.getContentType())&&r.setContentType(c.replace(/^\s*(multipart\/form-data);+/,"$1")):r.setContentType("multipart/form-data"));let l=new XMLHttpRequest;if(i.auth){const m=i.auth.username||"",x=i.auth.password?unescape(encodeURIComponent(i.auth.password)):"";r.set("Authorization","Basic "+btoa(m+":"+x))}const u=wr(i.baseURL,i.url);l.open(i.method.toUpperCase(),fr(u,i.params,i.paramsSerializer),!0),l.timeout=i.timeout;function g(){if(!l)return;const m=Bt.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),b={data:!a||a==="text"||a==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:m,config:i,request:l};tc(function(C){e(C),h()},function(C){s(C),h()},b),l=null}if("onloadend"in l?l.onloadend=g:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(g)},l.onabort=function(){l&&(s(new U("Request aborted",U.ECONNABORTED,i,l)),l=null)},l.onerror=function(){s(new U("Network Error",U.ERR_NETWORK,i,l)),l=null},l.ontimeout=function(){let x=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const b=i.transitional||mr;i.timeoutErrorMessage&&(x=i.timeoutErrorMessage),s(new U(x,b.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,i,l)),l=null},Mt.isStandardBrowserEnv){const m=(i.withCredentials||nc(u))&&i.xsrfCookieName&&ec.read(i.xsrfCookieName);m&&r.set(i.xsrfHeaderName,m)}n===void 0&&r.setContentType(null),"setRequestHeader"in l&&E.forEach(r.toJSON(),function(x,b){l.setRequestHeader(b,x)}),E.isUndefined(i.withCredentials)||(l.withCredentials=!!i.withCredentials),a&&a!=="json"&&(l.responseType=i.responseType),typeof i.onDownloadProgress=="function"&&l.addEventListener("progress",xr(i.onDownloadProgress,!0)),typeof i.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",xr(i.onUploadProgress)),(i.cancelToken||i.signal)&&(o=m=>{l&&(s(!m||m.type?new Ne(null,i,l):m),l.abort(),l=null)},i.cancelToken&&i.cancelToken.subscribe(o),i.signal&&(i.signal.aborted?o():i.signal.addEventListener("abort",o)));const y=rc(u);if(y&&Mt.protocols.indexOf(y)===-1){s(new U("Unsupported protocol "+y+":",U.ERR_BAD_REQUEST,i));return}l.send(n||null)})}};E.forEach(Ti,(i,t)=>{if(i){try{Object.defineProperty(i,"name",{value:t})}catch{}Object.defineProperty(i,"adapterName",{value:t})}});const br=i=>`- ${i}`,oc=i=>E.isFunction(i)||i===null||i===!1,vr={getAdapter:i=>{i=E.isArray(i)?i:[i];const{length:t}=i;let e,s;const n={};for(let r=0;r<t;r++){e=i[r];let a;if(s=e,!oc(e)&&(s=Ti[(a=String(e)).toLowerCase()],s===void 0))throw new U(`Unknown adapter '${a}'`);if(s)break;n[a||"#"+r]=s}if(!s){const r=Object.entries(n).map(([o,h])=>`adapter ${o} `+(h===!1?"is not supported by the environment":"is not available in the build"));let a=t?r.length>1?`since :
|
|
39
|
+
`+r.map(br).join(`
|
|
40
|
+
`):" "+br(r[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:Ti};function Ei(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new Ne(null,i)}function Sr(i){return Ei(i),i.headers=Bt.from(i.headers),i.data=Ci.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),vr.getAdapter(i.adapter||vi.adapter)(i).then(function(s){return Ei(i),s.data=Ci.call(i,i.transformResponse,s),s.headers=Bt.from(s.headers),s},function(s){return yr(s)||(Ei(i),s&&s.response&&(s.response.data=Ci.call(i,i.transformResponse,s.response),s.response.headers=Bt.from(s.response.headers))),Promise.reject(s)})}const Cr=i=>i instanceof Bt?i.toJSON():i;function ge(i,t){t=t||{};const e={};function s(c,l,u){return E.isPlainObject(c)&&E.isPlainObject(l)?E.merge.call({caseless:u},c,l):E.isPlainObject(l)?E.merge({},l):E.isArray(l)?l.slice():l}function n(c,l,u){if(E.isUndefined(l)){if(!E.isUndefined(c))return s(void 0,c,u)}else return s(c,l,u)}function r(c,l){if(!E.isUndefined(l))return s(void 0,l)}function a(c,l){if(E.isUndefined(l)){if(!E.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function o(c,l,u){if(u in t)return s(c,l);if(u in i)return s(void 0,c)}const h={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(c,l)=>n(Cr(c),Cr(l),!0)};return E.forEach(Object.keys(Object.assign({},i,t)),function(l){const u=h[l]||n,g=u(i[l],t[l],l);E.isUndefined(g)&&u!==o||(e[l]=g)}),e}const Tr="1.5.1",Pi={};["object","boolean","number","function","string","symbol"].forEach((i,t)=>{Pi[i]=function(s){return typeof s===i||"a"+(t<1?"n ":" ")+i}});const Er={};Pi.transitional=function(t,e,s){function n(r,a){return"[Axios v"+Tr+"] Transitional option '"+r+"'"+a+(s?". "+s:"")}return(r,a,o)=>{if(t===!1)throw new U(n(a," has been removed"+(e?" in "+e:"")),U.ERR_DEPRECATED);return e&&!Er[a]&&(Er[a]=!0,console.warn(n(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,a,o):!0}};function hc(i,t,e){if(typeof i!="object")throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const s=Object.keys(i);let n=s.length;for(;n-- >0;){const r=s[n],a=t[r];if(a){const o=i[r],h=o===void 0||a(o,r,i);if(h!==!0)throw new U("option "+r+" must be "+h,U.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new U("Unknown option "+r,U.ERR_BAD_OPTION)}}const Ai={assertOptions:hc,validators:Pi},Yt=Ai.validators;class Cs{constructor(t){this.defaults=t,this.interceptors={request:new dr,response:new dr}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=ge(this.defaults,e);const{transitional:s,paramsSerializer:n,headers:r}=e;s!==void 0&&Ai.assertOptions(s,{silentJSONParsing:Yt.transitional(Yt.boolean),forcedJSONParsing:Yt.transitional(Yt.boolean),clarifyTimeoutError:Yt.transitional(Yt.boolean)},!1),n!=null&&(E.isFunction(n)?e.paramsSerializer={serialize:n}:Ai.assertOptions(n,{encode:Yt.function,serialize:Yt.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&E.merge(r.common,r[e.method]);r&&E.forEach(["delete","get","head","post","put","patch","common"],m=>{delete r[m]}),e.headers=Bt.concat(a,r);const o=[];let h=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(e)===!1||(h=h&&x.synchronous,o.unshift(x.fulfilled,x.rejected))});const c=[];this.interceptors.response.forEach(function(x){c.push(x.fulfilled,x.rejected)});let l,u=0,g;if(!h){const m=[Sr.bind(this),void 0];for(m.unshift.apply(m,o),m.push.apply(m,c),g=m.length,l=Promise.resolve(e);u<g;)l=l.then(m[u++],m[u++]);return l}g=o.length;let y=e;for(u=0;u<g;){const m=o[u++],x=o[u++];try{y=m(y)}catch(b){x.call(this,b);break}}try{l=Sr.call(this,y)}catch(m){return Promise.reject(m)}for(u=0,g=c.length;u<g;)l=l.then(c[u++],c[u++]);return l}getUri(t){t=ge(this.defaults,t);const e=wr(t.baseURL,t.url);return fr(e,t.params,t.paramsSerializer)}}E.forEach(["delete","get","head","options"],function(t){Cs.prototype[t]=function(e,s){return this.request(ge(s||{},{method:t,url:e,data:(s||{}).data}))}}),E.forEach(["post","put","patch"],function(t){function e(s){return function(r,a,o){return this.request(ge(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}Cs.prototype[t]=e(),Cs.prototype[t+"Form"]=e(!0)});const Ts=Cs;class Di{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const s=this;this.promise.then(n=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](n);s._listeners=null}),this.promise.then=n=>{let r;const a=new Promise(o=>{s.subscribe(o),r=o}).then(n);return a.cancel=function(){s.unsubscribe(r)},a},t(function(r,a,o){s.reason||(s.reason=new Ne(r,a,o),e(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}static source(){let t;return{token:new Di(function(n){t=n}),cancel:t}}}const cc=Di;function lc(i){return function(e){return i.apply(null,e)}}function uc(i){return E.isObject(i)&&i.isAxiosError===!0}const ki={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ki).forEach(([i,t])=>{ki[t]=i});const fc=ki;function Pr(i){const t=new Ts(i),e=Jn(Ts.prototype.request,t);return E.extend(e,Ts.prototype,t,{allOwnKeys:!0}),E.extend(e,t,null,{allOwnKeys:!0}),e.create=function(n){return Pr(ge(i,n))},e}const W=Pr(vi);W.Axios=Ts,W.CanceledError=Ne,W.CancelToken=cc,W.isCancel=yr,W.VERSION=Tr,W.toFormData=bs,W.AxiosError=U,W.Cancel=W.CanceledError,W.all=function(t){return Promise.all(t)},W.spread=lc,W.isAxiosError=uc,W.mergeConfig=ge,W.AxiosHeaders=Bt,W.formToJSON=i=>pr(E.isHTMLForm(i)?new FormData(i):i),W.getAdapter=vr.getAdapter,W.HttpStatusCode=fc,W.default=W;const dc=W,qt=window.crypto.subtle;qt||console.warn("Crypto API not supported");function Ar(i){return Sa(encodeURIComponent(i)).replaceAll("+","*").replaceAll("/","-").replaceAll("=","")}function Dr(i){let t=i.replaceAll("*","+").replaceAll("-","/");const e=t.length%4;return e&&(t=t.padEnd(t.length+(4-e),"=")),decodeURIComponent(Ca(t))}function mc(i){return Ar(ka(i))}function pc(i){return Da(Dr(i))}function Es(i){return new TextEncoder().encode(i)}function kr(i,t="utf-8"){return new TextDecoder(t).decode(i)}async function gc(i,t="AES-GCM"){const e=crypto.getRandomValues(new Uint8Array(12)),s=await qt.generateKey({name:t,length:256},!1,["encrypt","decrypt"]),n=await qt.encrypt({name:t,iv:e},s,Es(i));return{algorithm:t,iv:e,key:s,encryptedData:n}}async function yc(i){const t=await qt.decrypt({name:i.algorithm,iv:i.iv},i.key,i.encryptedData);return kr(t)}async function wc(i,t="ECDSA",e="SHA-384"){const{privateKey:s,publicKey:n}=await qt.generateKey({name:t,namedCurve:"P-384"},!1,["sign","verify"]),r=Es(JSON.stringify(i)),a=await qt.sign({name:t,hash:{name:e}},s,r);return{algorithm:t,hash:e,publicKey:n,signature:a,encodedData:r}}async function xc(i){return await qt.verify({name:i.algorithm,hash:{name:i.hash}},i.publicKey,i.signature,i.encodedData)}async function Mr(i,t="SHA-256"){const e=await qt.digest(t,Es(i));return Ma(e)}async function _r(i,t="SHA-256"){const e=JSON.stringify(i);return Mr(e,t)}class bc{instance;interceptors;requestCanceler;constructor(t){this.instance=dc.create(t),this.interceptors=t?.interceptors,this.requestCanceler=new Ir,this.instance.interceptors.request.use(e=>(this.requestCanceler.pendingRequest(e),e),e=>(this.requestCanceler.cancelRequest(e.config),e)),this.instance.interceptors.request.use(this.interceptors?.requestInterceptor,this.interceptors?.requestInterceptorCatch),this.instance.interceptors.response.use(this.interceptors?.responseInterceptor,this.interceptors?.responseInterceptorCatch),this.instance.interceptors.response.use(e=>new Promise((s,n)=>{this.requestCanceler.confirmRequest(e.config),e.status===200?s(e.data):n(e.data)}),async e=>{const{code:s="",config:n}=e;return!n||!n.retry||!n.retryStatus?.includes(s)||(n.retryCounted=n.retryCounted??0,n.retryCounted>=n.retry)?Promise.reject(e):(n.retryCounted++,await new Promise(r=>{setTimeout(()=>{r(void 0)},n.retryDelay)}),await this.request(n))})}request(t){return new Promise((e,s)=>{try{t.interceptors?.requestInterceptor&&(t=t.interceptors?.requestInterceptor(t)),this.instance.request(t).then(n=>{t.interceptors?.responseInterceptor&&(n=t.interceptors.responseInterceptor(n)),e(n)}).catch(n=>{t.interceptors?.responseInterceptorCatch&&(n=t.interceptors?.responseInterceptorCatch(n)),s(n)})}catch(n){t.interceptors?.requestInterceptorCatch&&t.interceptors.requestInterceptorCatch(n)}})}get(t,e){return this.request({...e,method:"get",url:t})}delete(t,e){return this.request({...e,method:"delete",url:t})}head(t,e){return this.request({...e,method:"head",url:t})}options(t,e){return this.request({...e,method:"options",url:t})}post(t,e,s){return this.request({...s,method:"post",url:t,data:e})}put(t,e,s){return this.request({...s,method:"put",url:t,data:e})}patch(t,e,s){return this.request({...s,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class Ir{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}async pendingRequest(t){const e=await this.getRequestId(t);if(this.pendingRequestMap.has(e))t.signal=this.pendingRequestMap.get(e)?.signal;else{const s=new AbortController;t.signal=s.signal,this.pendingRequestMap.set(e,s)}}async confirmRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&this.pendingRequestMap.delete(e)}async cancelRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&(this.pendingRequestMap.get(e)?.abort(),this.pendingRequestMap.delete(e))}async cancelAllRequest(){for(const t of this.pendingRequestMap.values())t.abort();this.pendingRequestMap.clear()}async getRequestId(t){const{url:e,method:s,params:n,data:r}=t;return await _r({url:e,method:s,params:n,data:r})}}const Ps=new Map;async function vc(i){return new Promise((t,e)=>{As(i,(s,n)=>s?e(s):t({width:n.width,height:n.height,aspectRatio:n.width/n.height}))})}const As=(i,t)=>{if(Ps.has(i))return t(null,Ps.get(i));const e=new Image;e.onload=function(){Ps.set(i,{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height,element:e}),t(null,Ps.get(i))},e.onerror=function(s){t(s,null)},e.src=i},Sc=(i,t)=>{for(let e=0,s=i.length;e<s;e++){const n=i[e],{type:r}=n;if(r.split("/")[0]!=="image")continue;const a=new FileReader;a.onload=function(o){if(!o.target)return t("no reader target",null);const h=o.target.result,c=hn(h),l=new Blob([h]);Mi(l,(u,g)=>{if(!g)return t(u,null);As(g,(y,m)=>{if(!m)return t(y,null);Or(g,(x,b)=>{if(!b)return t(x,null);const S={name:n.name,fileType:c,size:n.size,width:m.width,height:m.height,imgUrl:g,imageData:b,blob:l};return t(null,S)})})})},a.readAsArrayBuffer(n)}},Or=(i,t)=>{As(i,(e,s)=>{if(!s)return t(e,null);const n=document.createElement("canvas"),r=n.getContext("2d");n.width=s.width,n.height=s.height,r.drawImage(s.element,0,0,n.width,n.height);const a=r.getImageData(0,0,n.width,n.height);return t(null,a)})},Cc=(i,t=0,e=0)=>{const s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.drawImage(i,0,0,t,e),n.getImageData(0,0,t,e)},Tc=(i,t=0,e=0)=>{const s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.drawImage(i,0,0,t,e),n.getImageData(0,0,t,e)},Ec=i=>{const t=i.width,e=i.height,s=t*e*3,n=s+54,r=[66,77,n&255,n>>8&255,n>>16&255,n>>24&255,0,0,0,0,54,0,0,0],a=[40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,1,0,24,0,0,0,0,0,s&255,s>>8&255,s>>16&255,s>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=(4-t*3%4)%4,h=i.data;let c="";const l=t<<2;let u=e;const g=String.fromCharCode;do{const m=l*(u-1);let x="";for(let b=0;b<t;b++){const S=b<<2;x+=g(h[m+S+2])+g(h[m+S+1])+g(h[m+S])}for(let b=0;b<o;b++)x+=String.fromCharCode(0);c+=x}while(--u);function y(m){if(!window.btoa)throw"btoa undefined";let x="";if(typeof m=="string")x=m;else for(let b=0;b<m.length;b++)x+=String.fromCharCode(m[b]);return btoa(x)}return y(r.concat(a))+y(c)},Pc=i=>{const{width:t,height:e}=i,s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.putImageData(i,0,0,0,0,t,e),s.toDataURL("image/png")},Ac=(i,t,e)=>{const{width:s,height:n}=i,r=document.createElement("canvas"),a=r.getContext("2d");r.width=s,r.height=n,a.putImageData(i,0,0,0,0,s,n);const o=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},o,1)},Mi=(i,t)=>{const e=new FileReader;e.onload=function(s){s.target?t(null,s.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(i)},Dc=(i,t)=>{Mi(i,function(e,s){if(s){const n=new Image;n.src=s}else t(e)})};function kc(i){const t=[],e=[],s=[];let n=0;for(let h=0,c=i.data.length;h<c;h+=4)t[n]=i.data[h],e[n]=i.data[h+1],s[n]=i.data[h+2],n+=1;const r=_i(t),a=_i(e),o=_i(s);return"rgb("+r+","+a+","+o+")"}function _i(i){const t={},e=[],s=[];for(let o=0;o<i.length;o++)t[i[o]]?e.push(i[o]):t[i[o]]=1;let n=0;for(let o=0;o<e.length;o++){n=0;for(let h=0;h<e.length;h++)e[o]===e[h]&&(n+=1),s[o]=n}const r=Math.max.apply(null,s);let a=0;for(;a<s.length;a++)if(s[a]===r)return;return e[a]}const Mc=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[(a*e+e-o-1)*4],n[h+1]=t[(a*e+e-o-1)*4+1],n[h+2]=t[(a*e+e-o-1)*4+2],n[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(n,e,s)},_c=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[((s-a-1)*e+o)*4],n[h+1]=t[((s-a-1)*e+o)*4+1],n[h+2]=t[((s-a-1)*e+o)*4+2],n[h+3]=t[((s-a-1)*e+o)*4+3]}return new ImageData(n,e,s)},Ic=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;n[h]=t[(o*e+e-a-1)*4],n[h+1]=t[(o*e+e-a-1)*4+1],n[h+2]=t[(o*e+e-a-1)*4+2],n[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(n,s,e)},Oc=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;n[h]=t[((s-o-1)*e+a)*4],n[h+1]=t[((s-o-1)*e+a)*4+1],n[h+2]=t[((s-o-1)*e+a)*4+2],n[h+3]=t[((s-o-1)*e+a)*4+3]}return new ImageData(n,s,e)},Rc=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1]+t[h+2])/3;n[h]=c,n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Lc=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=.2126*t[h]+.7152*t[h+1]+.0722*t[h+2];n[h]=c,n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Nc=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=(t[h]+t[h+1]+t[h+2])/3>127?255:0;n[h]=l,n[h+1]=l,n[h+2]=l,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Fc=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=255-t[h],n[h+1]=255-t[h+1],n[h+2]=255-t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Bc=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=0,n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Gc=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=t[h+1],n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Uc=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=0,n[h+2]=t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Vc=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=t[h+1],n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},zc=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=0,n[h+2]=t[h+1],n[h+3]=t[h+3]}return new ImageData(n,e,s)},jc=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=t[h+1],n[h+2]=t[h+1],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Xc=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h+1]+t[h+2])/2;n[h]=t[h],n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Yc=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+2])/2;n[h]=c,n[h+1]=t[h+1],n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},qc=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1])/2;n[h]=c,n[h+1]=c,n[h+2]=t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Hc=i=>Rr(i,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Wc=i=>Rr(i,[-1,-1,-1,-1,8,-1,-1,-1,-1]),$c=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=t[h+1],n[h+2]=t[h+2],n[h+3]=255}return new ImageData(n,e,s)},Jc=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;if(t[h+3]===0)n[h]=255,n[h+1]=255,n[h+2]=255,n[h+3]=255;else{const c=Lr([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);n[h]=c[0],n[h+1]=c[1],n[h+2]=c[2],n[h+3]=c[3]}}return new ImageData(n,e,s)},Zc=(i,t,e,s,n,r=!1,a)=>{const{data:o,width:h,height:c}=i;let l=n,u=s,g=t,y=e;if(l<0?l=0:l>h&&(l=h),u<0?u=0:u>c&&(u=c),g<1?g=1:g>h&&(g=h),y<1?y=1:y>c&&(y=c),l+g>h&&(g=h-l),u+y>c&&(y=c-u),r){const m=new Uint8ClampedArray(o.length);for(let b=0;b<c;b++)for(let S=0;S<h;S++){const C=(b*h+S)*4;S>=l&&S<=l+g&&b>=u&&b<=u+y?(m[C]=o[C],m[C+1]=o[C+1],m[C+2]=o[C+2],m[C+3]=o[C+3]):(m[C]=255,m[C+1]=255,m[C+2]=255,m[C+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(m,h,c)}else{const m=new Uint8ClampedArray(g*y*4);for(let b=u;b<=u+y;b++)for(let S=l;S<=l+g;S++){const C=((b-u)*g+S-l)*4,M=(b*h+S)*4;m[C]=o[M],m[C+1]=o[M+1],m[C+2]=o[M+2],m[C+3]=o[M+3]}return new ImageData(m,g,y)}},Kc=(i,t,e,s)=>{const{data:n,width:r,height:a}=i;let o=t;o>Math.floor(r/2)&&(o=Math.floor(r/2)),o>Math.floor(a/2)&&(o=Math.floor(a/2)),o<0&&(o=0);const h=new Uint8ClampedArray(n.length);for(let l=0;l<a;l++)for(let u=0;u<r;u++){const g=(l*r+u)*4;let y=-1;u<o?l<o?y=Math.sqrt(Math.pow(o-u-1,2)+Math.pow(o-l-1,2)):l>a-o-1&&(y=Math.sqrt(Math.pow(o-u-1,2)+Math.pow(l-(a-o),2))):u>r-o-1&&(l<o?y=Math.sqrt(Math.pow(u-(r-o),2)+Math.pow(o-l-1,2)):l>a-o-1&&(y=Math.sqrt(Math.pow(u-(r-o),2)+Math.pow(l-(a-o),2)))),Math.round(y)>o?(h[g]=255,h[g+1]=255,h[g+2]=255,h[g+3]=s||e.toUpperCase()==="PNG"?0:255):(h[g]=n[g],h[g+1]=n[g+1],h[g+2]=n[g+2],h[g+3]=s||e.toUpperCase()==="PNG"?n[g+3]:255)}return new ImageData(h,r,a)},Qc=(i,t,e,s,n,r=1e4)=>{const a=new Image;a.src=i;const o=document.createElement("canvas"),h=o.getContext("2d");return o.width=r,o.height=r,h.drawImage(a,0,0,t,e,0,0,s,n),h.getImageData(0,0,s,n)},tl=(i,t)=>{const{data:e,width:s,height:n}=i,r=new Uint8ClampedArray(e.length);for(let o=0;o<n;o++)for(let h=0;h<s;h++){const c=(o*s+h)*4;r[c]=Math.max(Math.min(e[c]+t,255),0),r[c+1]=Math.max(Math.min(e[c+1]+t,255),0),r[c+2]=Math.max(Math.min(e[c+2]+t,255),0),r[c+3]=e[c+3]}return new ImageData(r,s,n)},el=(i,t,e=!1)=>{const{data:s,width:n,height:r}=i,a=new Uint8ClampedArray(s.length);for(let h=0;h<r;h++)for(let c=0;c<n;c++){const l=(h*n+c)*4;s[l+3]===0?(a[l]=255,a[l+1]=255,a[l+2]=255):(a[l]=s[l],a[l+1]=s[l+1],a[l+2]=s[l+2]);let u=s[l+3];e?u=Math.max(Math.min(Math.floor(255*t),255),0):u=Math.max(Math.min(Math.floor(u+255*t),255),0),a[l+3]=u}return new ImageData(a,n,r)},sl=(i,t,e,s)=>{const{data:n,width:r,height:a}=i,{data:o,width:h,height:c}=t;let l=e,u=s;e+c>a&&(l=a-c),s+h>r&&(u=r-h);const g=new Uint8ClampedArray(n.length);for(let m=0;m<a;m++)for(let x=0;x<r;x++){const b=(m*r+x)*4;if(x<u||x>u+h||m<=l||m>=l+c)g[b]=n[b],g[b+1]=n[b+1],g[b+2]=n[b+2],g[b+3]=n[b+3];else{const S=(m*r+x-((l+1)*r+(m-(l+1))*(r-h))+h-u-1)*4,C=[o[S],o[S+1],o[S+2],o[S+3]],M=[n[b],n[b+1],n[b+2],n[b+3]],O=Lr(C,M);g[b]=O[0],g[b+1]=O[1],g[b+2]=O[2],g[b+3]=O[3]}}return new ImageData(g,r,a)},il=(i,t,e,s,n,r=10)=>{const{data:a,width:o,height:h}=i;let c=n,l=s,u=t,g=e;c<0?c=0:c>o&&(c=o),l<0?l=0:l>h&&(l=h),u<1?u=1:u>o&&(u=o),g<1?g=1:g>h&&(g=h),c+u>o&&(u=o-c),l+g>h&&(g=h-l);const y=new Uint8ClampedArray(a.length);for(let x=0;x<h;x++)for(let b=0;b<o;b++){const S=(x*o+b)*4;if(b>=c&&b<=c+u&&x>=l&&x<=l+g){const C=Math.floor((b-c)/r),M=Math.floor((x-l)/r);let O=Math.floor(r*(C+1)-r/2+c),F=Math.floor(r*(M+1)-r/2+l);O>o-1&&(O=o-1),F>h-1&&(F=h-1);const L=(F*o+O)*4;y[S]=a[L],y[S+1]=a[L+1],y[S+2]=a[L+2],y[S+3]=a[L+3]}else y[S]=a[S],y[S+1]=a[S+1],y[S+2]=a[S+2],y[S+3]=a[S+3]}return new ImageData(y,o,h)},nl=(i,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}})=>{if(t&&e){const{data:s,width:n,height:r}=i,{data:a}=t,o=new Uint8ClampedArray(s.length),{backgroundColor:h,changeIntoColor:c}=e;for(let u=0;u<r;u++)for(let g=0;g<n;g++){const y=(u*n+g)*4,m=a[y],x=a[y+1],b=a[y+2],S=a[y+3];m===h.r&&x===h.g&&b===h.b&&S===h.a&&c.a!==0?(o[y]=c.r,o[y+1]=c.g,o[y+2]=c.b,o[y+3]=c.a):(o[y]=s[y],o[y+1]=s[y+1],o[y+2]=s[y+2],o[y+3]=s[y+3])}return new ImageData(o,n,r)}return i},Rr=(i,t)=>{const{data:e,width:s,height:n}=i,r=new Uint8ClampedArray(e.length);for(let o=0;o<n;o++)for(let h=0;h<s;h++){const c=(o*s+h)*4;for(let l=0;l<3;l++){const u=c+l;h===0||h===s-1||o===0||o===n-1?r[u]=e[u]:r[u]=t[0]*e[u-s*4-4]+t[1]*e[u-s*4]+t[2]*e[u-s*4+4]+t[3]*e[u-4]+t[4]*e[u]+t[5]*e[u+4]+t[6]*e[u+s*4-4]+t[7]*e[u+s*4]+t[8]*e[u+s*4+4]}r[c+3]=e[c+3]}return new ImageData(r,s,n)},Lr=(i,t)=>{if(i&&i.length===4&&t&&t.length===4){const e=i[3],s=t[3];if(e===255||s===0)return i;if(e===0)return t;{const n=e/255,r=s/255,a=Math.max(Math.min(Math.floor(i[0]*n+t[0]*r*(1-n)),255),0),o=Math.max(Math.min(Math.floor(i[1]*n+t[1]*r*(1-n)),255),0),h=Math.max(Math.min(Math.floor(i[2]*n+t[2]*r*(1-n)),255),0),c=Math.max(Math.min(Math.floor((n+r*(1-n))*255),255),0);return[a,o,h,c]}}return[255,255,255,255]},Ii=function(){const i=[];return{writeByte(t){i.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,s=t.length){for(let n=0;n<s;n++)this.writeByte(t[n+e])},writeString(t){for(let e=0,s=t.length;e<s;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return i},toString(){let t="[";for(let e=0,s=i.length;e<s;e++)e>0&&(t+=","),t+=i[e];return t+="]",t}}},Nr=function(){let i=0,t=0,e=0,s="";const n=function(a){if(!(a<0)){if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47}throw new Error("n:"+a)},r=function(a){s+=String.fromCharCode(n(a&63))};return{writeByte(a){for(i=i<<8|a&255,t+=8,e+=1;t>=6;)r(i>>>t-6),t-=6},flush(){if(t>0&&(r(i<<6-t),i=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)s+="="}},toString(){return s}}},Fr=function(i,t,e){const s=new Array(i*i),n=function(o){const h=o;let c=0,l=0;return{write(u,g){if(u>>>g)throw new Error("length over");for(;c+g>=8;)h.writeByte(255&(u<<c|l)),g-=8-c,u>>>=8-c,l=0,c=0;l=u<<c|l,c=c+g},flush(){c>0&&h.writeByte(l)}}},r=function(o){const h=1<<o,c=(1<<o)+1;let l=o+1;const u=a();for(let b=0;b<h;b++)u.add(String.fromCharCode(b));u.add(String.fromCharCode(h)),u.add(String.fromCharCode(c));const g=Ii(),y=n(g);y.write(h,l);let m=0,x=String.fromCharCode(s[m]);for(m+=1;m<s.length;){const b=String.fromCharCode(s[m]);m+=1,u.contains(x+b)?x=x+b:(y.write(u.indexOf(x),l),u.size()<4095&&(u.size()==1<<l&&(l+=1),u.add(x+b)),x=b)}return y.write(u.indexOf(x),l),y.write(c,l),y.flush(),g.toByteArray()},a=function(){const o={};let h=0;return{add(c){if(this.contains(c))throw new Error("dup key:"+c);o[c]=h,h+=1},size(){return h},indexOf(c){return o[c]},contains(c){return typeof o[c]<"u"}}};return{setPixel(o,h,c){s[h*i+o]=c},write(o){o.writeString("GIF87a"),o.writeShort(i),o.writeShort(i),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte(Kt("0x"+t[1]+t[2])),o.writeByte(Kt("0x"+t[3]+t[4])),o.writeByte(Kt("0x"+t[5]+t[6])),o.writeByte(Kt("0x"+e[1]+e[2])),o.writeByte(Kt("0x"+e[3]+e[4])),o.writeByte(Kt("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(i),o.writeShort(i),o.writeByte(0);const h=2,c=r(h);o.writeByte(h);let l=0;for(;c.length-l>255;)o.writeByte(255),o.writeBytes(c,l,255),l+=255;o.writeByte(c.length-l),o.writeBytes(c,l,c.length-l),o.writeByte(0),o.writeString(";")}}},Br=function(i,t,e,s){const n=Fr(i,t,e);for(let c=0;c<i;c++)for(let l=0;l<i;l++)n.setPixel(l,c,s(l,c));const r=Ii();n.write(r);const a=Nr(),o=r.toByteArray();for(let c=0,l=o.length;c<l;c++)a.writeByte(o[c]);a.flush();let h="";return h+="data:image/gif;base64,",h+=a,h},ft={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Fe={M:0,L:1,H:2,Q:3},Ht={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},J={glog:function(i){if(i<1)throw new Error("glog("+i+")");return J.LOG_TABLE[i]},gexp:function(i){for(;i<0;)i+=255;for(;i>=256;)i-=255;return J.EXP_TABLE[i]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let i=0;i<8;i++)J.EXP_TABLE[i]=1<<i;for(let i=8;i<256;i++)J.EXP_TABLE[i]=J.EXP_TABLE[i-4]^J.EXP_TABLE[i-5]^J.EXP_TABLE[i-6]^J.EXP_TABLE[i-8];for(let i=0;i<255;i++)J.LOG_TABLE[J.EXP_TABLE[i]]=i;const j={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(i){let t=i<<10;for(;j.getBCHDigit(t)-j.getBCHDigit(j.G15)>=0;)t^=j.G15<<j.getBCHDigit(t)-j.getBCHDigit(j.G15);return(i<<10|t)^j.G15_MASK},getBCHTypeNumber:function(i){let t=i<<12;for(;j.getBCHDigit(t)-j.getBCHDigit(j.G18)>=0;)t^=j.G18<<j.getBCHDigit(t)-j.getBCHDigit(j.G18);return i<<12|t},getBCHDigit:function(i){let t=0;for(;i!=0;)t++,i>>>=1;return t},getPatternPosition:function(i){return j.PATTERN_POSITION_TABLE[i-1]},getMask:function(i,t,e){switch(i){case Ht.PATTERN000:return(t+e)%2==0;case Ht.PATTERN001:return t%2==0;case Ht.PATTERN010:return e%3==0;case Ht.PATTERN011:return(t+e)%3==0;case Ht.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case Ht.PATTERN101:return t*e%2+t*e%3==0;case Ht.PATTERN110:return(t*e%2+t*e%3)%2==0;case Ht.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+i)}},getErrorCorrectPolynomial:function(i){let t=new ye([1],0);for(let e=0;e<i;e++)t=t.multiply(new ye([1,J.gexp(e)],0));return t},getLengthInBits:function(i,t){if(1<=t&&t<10)switch(i){case ft.MODE_NUMBER:return 10;case ft.MODE_ALPHA_NUM:return 9;case ft.MODE_8BIT_BYTE:return 8;case ft.MODE_KANJI:return 8;default:throw new Error("mode:"+i)}else if(t<27)switch(i){case ft.MODE_NUMBER:return 12;case ft.MODE_ALPHA_NUM:return 11;case ft.MODE_8BIT_BYTE:return 16;case ft.MODE_KANJI:return 10;default:throw new Error("mode:"+i)}else if(t<41)switch(i){case ft.MODE_NUMBER:return 14;case ft.MODE_ALPHA_NUM:return 13;case ft.MODE_8BIT_BYTE:return 16;case ft.MODE_KANJI:return 12;default:throw new Error("mode:"+i)}else throw new Error("type:"+t)},getLostPoint:function(i){const t=i.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++){let o=0;const h=i.isDark(r,a);for(let c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(let l=-1;l<=1;l++)a+l<0||t<=a+l||c==0&&l==0||h==i.isDark(r+c,a+l)&&o++;o>5&&(e+=3+o-5)}for(let r=0;r<t-1;r++)for(let a=0;a<t-1;a++){let o=0;i.isDark(r,a)&&o++,i.isDark(r+1,a)&&o++,i.isDark(r,a+1)&&o++,i.isDark(r+1,a+1)&&o++,(o==0||o==4)&&(e+=3)}for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)i.isDark(r,a)&&!i.isDark(r,a+1)&&i.isDark(r,a+2)&&i.isDark(r,a+3)&&i.isDark(r,a+4)&&!i.isDark(r,a+5)&&i.isDark(r,a+6)&&(e+=40);for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)i.isDark(a,r)&&!i.isDark(a+1,r)&&i.isDark(a+2,r)&&i.isDark(a+3,r)&&i.isDark(a+4,r)&&!i.isDark(a+5,r)&&i.isDark(a+6,r)&&(e+=40);let s=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++)i.isDark(a,r)&&s++;const n=Math.abs(100*s/t/t-50)/5;return e+=n*10,e}};class ye{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let s=0;for(;s<t.length&&t[s]==0;)s++;this.num=new Array(t.length-s+e);for(let n=0;n<t.length-s;n++)this.num[n]=t[n+s]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let s=0;s<this.getLength();s++)for(let n=0;n<t.getLength();n++)e[s+n]^=J.gexp(J.glog(this.get(s))+J.glog(t.get(n)));return new ye(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=J.glog(this.get(0))-J.glog(t.get(0)),s=new Array(this.getLength());for(let n=0;n<this.getLength();n++)s[n]=this.get(n);for(let n=0;n<t.getLength();n++)s[n]^=J.gexp(J.glog(t.get(n))+e);return new ye(s,0).mod(t)}}class Gt{totalCount;dataCount;constructor(t,e){this.totalCount=t,this.dataCount=e}static RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];static getRSBlocks(t,e){const s=Gt.getRsBlockTable(t,e);if(s==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const n=s.length/3,r=[];for(let a=0;a<n;a++){const o=s[a*3+0],h=s[a*3+1],c=s[a*3+2];for(let l=0;l<o;l++)r.push(new Gt(h,c))}return r}static getRsBlockTable(t,e){switch(e){case Fe.L:return Gt.RS_BLOCK_TABLE[(t-1)*4+0];case Fe.M:return Gt.RS_BLOCK_TABLE[(t-1)*4+1];case Fe.Q:return Gt.RS_BLOCK_TABLE[(t-1)*4+2];case Fe.H:return Gt.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Gr{buffer;length;constructor(){this.buffer=[],this.length=0}get(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1}put(t,e){for(let s=0;s<e;s++)this.putBit((t>>>e-s-1&1)==1)}getLengthInBits(){return this.length}putBit(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}class rl{mode;data;constructor(t){this.mode=ft.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,s=this.data.length;e<s;e++)t.put(this.data.charCodeAt(e),8)}}class Wt{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Fe[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new rl(t);this.dataList.push(e),this.dataCache=null}isDark(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]}getModuleCount(){return this.moduleCount}make(){if(this.typeNumber<1){let t=1;for(t=1;t<40;t++){const e=Gt.getRSBlocks(t,this.errorCorrectLevel),s=new Gr;let n=0;for(let r=0;r<e.length;r++)n+=e[r].dataCount;for(let r=0;r<this.dataList.length;r++){const a=this.dataList[r];s.put(a.mode,4),s.put(a.getLength(),j.getLengthInBits(a.mode,t)),a.write(s)}if(s.getLengthInBits()<=n*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let s=0;s<this.moduleCount;s++){this.modules[s]=new Array(this.moduleCount);for(let n=0;n<this.moduleCount;n++)this.modules[s][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=Wt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let s=-1;s<=7;s++)if(!(t+s<=-1||this.moduleCount<=t+s))for(let n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=s&&s<=6&&(n==0||n==6)||0<=n&&n<=6&&(s==0||s==6)||2<=s&&s<=4&&2<=n&&n<=4?this.modules[t+s][e+n]=!0:this.modules[t+s][e+n]=!1)}getBestMaskPattern(){let t=0,e=0;for(let s=0;s<8;s++){this.makeImpl(!0,s);const n=j.getLostPoint(this);(s==0||t>n)&&(t=n,e=s)}return e}createMovieClip(t,e,s){const n=t.createEmptyMovieClip(e,s),r=1;this.make();for(let a=0;a<this.modules.length;a++){const o=a*r;for(let h=0;h<this.modules[a].length;h++){const c=h*r;this.modules[a][h]&&(n.beginFill(0,100),n.moveTo(c,o),n.lineTo(c+r,o),n.lineTo(c+r,o+r),n.lineTo(c,o+r),n.endFill())}}return n}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=j.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let s=0;s<t.length;s++){const n=t[e],r=t[s];if(this.modules[n][r]==null)for(let a=-2;a<=2;a++)for(let o=-2;o<=2;o++)a==-2||a==2||o==-2||o==2||a==0&&o==0?this.modules[n+a][r+o]=!0:this.modules[n+a][r+o]=!1}}setupTypeNumber(t){const e=j.getBCHTypeNumber(this.typeNumber);for(let s=0;s<18;s++){const n=!t&&(e>>s&1)==1;this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=n}for(let s=0;s<18;s++){const n=!t&&(e>>s&1)==1;this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=n}}setupTypeInfo(t,e){const s=this.errorCorrectLevel<<3|e,n=j.getBCHTypeInfo(s);for(let r=0;r<15;r++){const a=!t&&(n>>r&1)==1;r<6?this.modules[r][8]=a:r<8?this.modules[r+1][8]=a:this.modules[this.moduleCount-15+r][8]=a}for(let r=0;r<15;r++){const a=!t&&(n>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=a:r<9?this.modules[8][15-r-1+1]=a:this.modules[8][15-r-1]=a}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let s=-1,n=this.moduleCount-1,r=7,a=0;for(let o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(let h=0;h<2;h++)if(this.modules[n][o-h]==null){let c=!1;a<t.length&&(c=(t[a]>>>r&1)==1),j.getMask(e,n,o-h)&&(c=!c),this.modules[n][o-h]=c,r--,r==-1&&(a++,r=7)}if(n+=s,n<0||this.moduleCount<=n){n-=s,s=-s;break}}}static createData(t,e,s){const n=Gt.getRSBlocks(t,e),r=new Gr;for(let o=0;o<s.length;o++){const h=s[o];r.put(h.mode,4),r.put(h.getLength(),j.getLengthInBits(h.mode,t)),h.write(r)}let a=0;for(let o=0;o<n.length;o++)a+=n[o].dataCount;if(r.getLengthInBits()>a*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+a*8+")");for(r.getLengthInBits()+4<=a*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=a*8||(r.put(Wt.PAD0,8),r.getLengthInBits()>=a*8));)r.put(Wt.PAD1,8);return Wt.createBytes(r,n)}static createBytes(t,e){let s=0,n=0,r=0;const a=new Array(e.length),o=new Array(e.length);for(let u=0;u<e.length;u++){const g=e[u].dataCount,y=e[u].totalCount-g;n=Math.max(n,g),r=Math.max(r,y),a[u]=new Array(g);for(let S=0;S<a[u].length;S++)a[u][S]=255&t.buffer[S+s];s+=g;const m=j.getErrorCorrectPolynomial(y),b=new ye(a[u],m.getLength()-1).mod(m);o[u]=new Array(m.getLength()-1);for(let S=0;S<o[u].length;S++){const C=S+b.getLength()-o[u].length;o[u][S]=C>=0?b.get(C):0}}let h=0;for(let u=0;u<e.length;u++)h+=e[u].totalCount;const c=new Array(h);let l=0;for(let u=0;u<n;u++)for(let g=0;g<e.length;g++)u<a[g].length&&(c[l++]=a[g][u]);for(let u=0;u<r;u++)for(let g=0;g<e.length;g++)u<o[g].length&&(c[l++]=o[g][u]);return c}}const Ur=Math.ceil,Be=Math.floor,Vr=Math.round;function al(i,t){const e=on(i),s=t?.ecc||"H",n=t?.size||256,r=-1,a=t?.padding||0,o=t?.color||"#000000",h=t?.background||"#ffffff",c=new Wt(r,s);c.addData(e),c.make();const l=c.getModuleCount(),u=(n-a*2)/l,g=a,y=n-a;return Br(n,o,h,function(m,x){if(g<=m&&m<y&&g<=x&&x<y){const b=Be((m-g)/u),S=Be((x-g)/u);return c.isDark(S,b)?0:1}else return 1})}function ol(i,t){const e=t.x||0,s=t.y||0,n=on(i),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?Be(t.size):256,h=t.padding||0,c=-1,l=t.color||"#000000",u=t.background||"#ffffff",g=new Wt(c,a);g.addData(n),g.make();const y=g.getModuleCount(),m=(o-h*2)/y;r.fillStyle=u,r.fillRect(e,s,o,o);for(let x=0;x<y;x++)for(let b=0;b<y;b++){const S=Ur((b+1)*m)-Be(b*m),C=Ur((x+1)*m)-Be(x*m);r.fillStyle=g.isDark(x,b)?l:u,r.fillRect(e+Vr(b*m)+h,s+Vr(x*m)+h,S,C)}}class gt extends H{shapes=[];renderGroup;constructor(t){super(t),this.renderGroup=new ii({x:this.x,y:this.y})}setAttrs(t,e){this.shapes.forEach(s=>{Ee(t)?s.setAttr(t):typeof t=="string"&&e&&s.setAttr(t,e)})}addShape(t){this.shapes.push(...(Array.isArray(t)?t:[t]).map(e=>(e.shapeGroup=this,e.renderGroup=this.renderGroup,this.renderGroup.register(e),e)))}toSVGPathData(){return this.shapes.reduce((t,e,s)=>{const n=e.toSVGPathData();return Array.isArray(n[0])?t.push(...n):t.push(n),t},[])}toCanvasContext(t){}frameUpdate(){super.frameUpdate()}groupTranslate(t,e){this.x+=t,this.y+=e,this.renderGroup.x=this.x,this.renderGroup.y=this.y,this.shapes.forEach(s=>{s.x+=t,s.y+=e})}groupTranslateTo(t,e){this.groupTranslate(t-this.x,e-this.y)}groupRotate(t){this.degree+=t,this.shapes.forEach(e=>{e.degree+=t})}groupRotateTo(t){this.groupRotate(t-this.degree)}groupScaleTo(t){this.scalexOnOrigin=t,this.scaleyOnOrigin=t,this.shapes.forEach(e=>{e.scalexOnOrigin=t,e.scaleyOnOrigin=t})}}let Ge;typeof self>"u"&&typeof process<"u"&&process.hrtime?Ge=function(){const i=process.hrtime();return i[0]*1e3+i[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?Ge=self.performance.now.bind(self.performance):Date.now!==void 0?Ge=Date.now:Ge=function(){return new Date().getTime()};const we=Ge;class Ue{static _nextId=0;static nextId(){return Ue._nextId++}}const Ds={Linear:{None:function(i){return i}},Ease:{In:function(i){return Math.pow(i,1.7)}},Quadratic:{In:function(i){return i*i},Out:function(i){return i*(2-i)},InOut:function(i){return(i*=2)<1?.5*i*i:-.5*(--i*(i-2)-1)}},Cubic:{In:function(i){return i*i*i},Out:function(i){return--i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i:.5*((i-=2)*i*i+2)}},Quartic:{In:function(i){return i*i*i*i},Out:function(i){return 1- --i*i*i*i},InOut:function(i){return(i*=2)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2)}},Quintic:{In:function(i){return i*i*i*i*i},Out:function(i){return--i*i*i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2)}},Sinusoidal:{In:function(i){return 1-Math.sin((1-i)*Math.PI/2)},Out:function(i){return Math.sin(i*Math.PI/2)},InOut:function(i){return .5*(1-Math.sin(Math.PI*(.5-i)))}},Exponential:{In:function(i){return i===0?0:Math.pow(1024,i-1)},Out:function(i){return i===1?1:1-Math.pow(2,-10*i)},InOut:function(i){return i===0?0:i===1?1:(i*=2)<1?.5*Math.pow(1024,i-1):.5*(-Math.pow(2,-10*(i-1))+2)}},Circular:{In:function(i){return 1-Math.sqrt(1-i*i)},Out:function(i){return Math.sqrt(1- --i*i)},InOut:function(i){return(i*=2)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1)}},Elastic:{In:function(i){return i===0?0:i===1?1:-Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI)},Out:function(i){return i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i-.1)*5*Math.PI)+1},InOut:function(i){return i===0?0:i===1?1:(i*=2,i<1?-.5*Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI):.5*Math.pow(2,-10*(i-1))*Math.sin((i-1.1)*5*Math.PI)+1)}},Back:{In:function(i){return i===1?1:i*i*((1.70158+1)*i-1.70158)},Out:function(i){return i===0?0:--i*i*((1.70158+1)*i+1.70158)+1},InOut:function(i){const t=2.5949095;return(i*=2)<1?.5*(i*i*((t+1)*i-t)):.5*((i-=2)*i*((t+1)*i+t)+2)}},Bounce:{In:function(i){return 1-Ds.Bounce.Out(1-i)},Out:function(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},InOut:function(i){return i<.5?Ds.Bounce.In(i*2)*.5:Ds.Bounce.Out(i*2-1)*.5+.5}},generatePow:function(i=4){return i=i<Number.EPSILON?Number.EPSILON:i,i=i>1e4?1e4:i,{In:function(t){return t**i},Out:function(t){return 1-(1-t)**i},InOut:function(t){return t<.5?(t*2)**i/2:(1-(2-t*2)**i)/2+.5}}},random:function(i){return Math.random()},createStep:function(i){return function(t){return Math.floor(t*i)/i}},createNoisyEasing:function(i,t=.1){const e=1-t;return function(s){return t*Math.random()+e*i(s)}},swing:function(i){return i+Math.sin(i*Math.PI*2)/2},causeSeizures:function(i){return i+.2*Math.random()-.1}},Oi=Ds,Ve={Utils:{Linear:function(i,t,e){return(t-i)*e+i},Factorial:function(){const i=[1];return function(t){let e=1;if(i[t])return i[t];for(let s=t;s>1;s--)e*=s;return i[t]=e,e}}(),Bernstein:function(i,t){const e=Ve.Utils.Factorial;return e(i)/e(t)/e(i-t)},CatmullRom:function(i,t,e,s,n){const r=(e-i)*.5,a=(s-t)*.5,o=n*n,h=n*o;return(2*t-2*e+r+a)*h+(-3*t+3*e-2*r-a)*o+r*n+t}},Linear:function(i,t){const e=i.length-1,s=e*t,n=Math.floor(s),r=Ve.Utils.Linear;return t<0?r(i[0],i[1],s):t>1?r(i[e],i[e-1],e-s):r(i[n],i[n+1>e?e:n+1],s-n)},Bezier:function(i,t){let e=0;const s=i.length-1,n=Math.pow,r=Ve.Utils.Bernstein;for(let a=0;a<=s;a++)e+=n(1-t,s-a)*n(t,a)*i[a]*r(s,a);return e},CatmullRom:function(i,t){const e=i.length-1;let s=e*t,n=Math.floor(s);const r=Ve.Utils.CatmullRom;return i[0]===i[e]?(t<0&&(n=Math.floor(s=e*(1+t))),r(i[(n-1+e)%e],i[n],i[(n+1)%e],i[(n+2)%e],s-n)):t<0?i[0]-(r(i[0],i[0],i[1],i[1],-s)-i[0]):t>1?i[e]-(r(i[e],i[e],i[e-1],i[e-1],s-e)-i[e]):r(i[n?n-1:0],i[n],i[e<n+1?e:n+1],i[e<n+2?e:n+2],s-n)}},Ri=Ve;class zr{_tweens={};_tweensAddedDuringUpdate={};getAll(){return Object.keys(this._tweens).map(t=>this._tweens[t])}removeAll(){this._tweens={}}add(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t}remove(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]}update(t=we(),e=!1){let s=Object.keys(this._tweens);for(let n=0;n<s.length;n++){const r=this._tweens[s[n]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[s[n]]}return!!Object.keys(this._tweens).length}}const yt=new zr;class Li{constructor(t,e=yt){this._object=t,this._group=e}_id=Ue.nextId();_isPlaying=!1;_startTime=0;_delayTime=0;_durationTime=1e3;_isPaused=!1;_pauseStartTime=0;_initialRepeat=0;_repeat=0;_repeatDelayTime;_yoyo=!1;_reversed=!1;_valuesStart={};_valuesEnd={};_valuesStartRepeat={};_easingFunction=Oi.Linear.None;_interpolationFunction=Ri.Linear;_chainedTweens=[];_isChainStopped=!1;_onStartCallback;_onStartCallbackFired=!1;_onEveryStartCallback;_onEveryStartCallbackFired=!1;_onUpdateCallback;_onRepeatCallback;_onCompleteCallback;_onStopCallback;_goToEnd=!1;getId(){return this._id}isPlaying(){return this._isPlaying}isPaused(){return this._isPaused}to(t,e){return this._valuesEnd=Object.create(t),e!==void 0&&(this._durationTime=e),this}duration(t=1e3){return this._durationTime=t,this}start(t=we()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,s,n){for(const r in s){const a=t[r],o=Array.isArray(a),h=o?"array":typeof a,c=!o&&Array.isArray(s[r]);if(!(h==="undefined"||h==="function")){if(c){let l=s[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,a)),s[r]=[a].concat(l)}if((h==="object"||o)&&a&&!c){e[r]=o?[]:{};for(const l in a)e[r][l]=a[l];n[r]=o?[]:{},this._setupProperties(a,e[r],s[r],n[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),c?n[r]=s[r].slice().reverse():n[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=we()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=we()){return!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStartTime,this._pauseStartTime=0,this._group&&this._group.add(this),this)}stopChainedTweens(){for(let t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this}group(t=yt){return this._group=t,this}delay(t=0){return this._delayTime=t,this}repeat(t=0){return this._initialRepeat=t,this._repeat=t,this}repeatDelay(t){return this._repeatDelayTime=t,this}yoyo(t=!1){return this._yoyo=t,this}easing(t=Oi.Linear.None){return this._easingFunction=t,this}interpolation(t=Ri.Linear){return this._interpolationFunction=t,this}chain(...t){return this._chainedTweens=t,this}onStart(t){return this._onStartCallback=t,this}onEveryStart(t){return this._onEveryStartCallback=t,this}onUpdate(t){return this._onUpdateCallback=t,this}onRepeat(t){return this._onRepeatCallback=t,this}onComplete(t){return this._onCompleteCallback=t,this}onStop(t){return this._onStopCallback=t,this}update(t=we(),e=!0){if(this._isPaused)return!0;let s,n;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),n=(t-this._startTime)/this._durationTime,n=this._durationTime===0||n>1?1:n;const a=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),n===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let o=0,h=this._chainedTweens.length;o<h;o++)this._chainedTweens[o].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,s,n){for(const r in s){if(e[r]===void 0)continue;const a=e[r]||0;let o=s[r];const h=Array.isArray(t[r]),c=Array.isArray(o);!h&&c?t[r]=this._interpolationFunction(o,n):typeof o=="object"&&o?this._updateProperties(t[r],a,o,n):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[r]=a+(o-a)*n))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],s=this._valuesEnd[t];typeof s=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(s):this._valuesStartRepeat[t]=s,this._valuesEnd[t]=e}}const hl=Ue.nextId,cl=yt.getAll.bind(yt),ll=yt.removeAll.bind(yt),ul=yt.add.bind(yt),fl=yt.remove.bind(yt),dl=yt.update.bind(yt),ze={now:we,Sequence:Ue,Easing:Oi,Interpolation:Ri,Group:zr,Tween:Li,nextId:hl,getAll:cl,removeAll:ll,add:ul,remove:fl,update:dl};function ml(i){switch(i){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}const pl={attributeName:["display"],values:[["block","block"]],immediate:!1},dt={easeName:"linear",begin:0,dur:300,repeatCount:1,direction:"normal",fill:"freeze",keyTimes:[0,1]};class xe{objects=[];animateObjects=[];currentAnimateName;constructor(){}fromDOM(t){return this.objects.forEach(e=>{e.app.destroy()}),this.objects=[],(Array.isArray(t)?t:[t]).forEach(e=>{this.objects.push({el:e,app:new Me(e),originAttrs:{}})}),this}static toTween(t,e,s){const n=s?.onStart||(()=>{}),r=s?.onUpdate||(()=>{}),a=s?.onComplete||(()=>{}),o=s?.duration||1e3,h=s?.delay||0,c=s?.easeFunction||ze.Easing.Linear.None,l=s?.repeat||0,u=s?.yoyo||!1,g=new ze.Tween(t).to(e,o).delay(h).easing(c).repeat(l).yoyo(u).onStart(n).onUpdate((y,m)=>{r(y,m)}).onComplete(a);return s?.interpolationFunction&&g.interpolation(s.interpolationFunction),{tween:g,startAuto:y=>{g.start(y?.()),de.run(()=>{const m=g.update(y?.());if(s?.precision){let x=!0;for(let b in t)Pe(t[b],e[b],s.precision)||(x=!1);return x?!1:m}return m})}}}static toTweenGroup(t,e){if(t instanceof Li)return s=>{t.start(),e?.onGroupStart?.(),de.run(()=>{const n=ze.update(s?.());return n?e?.onGroupUpdate?.():e?.onGroupComplete?.(),n})};{const s=new ze.Group;return t.forEach(n=>{s.add(n)}),n=>{t.forEach(r=>r.start()),e?.onGroupStart?.(),de.run(()=>{const r=s.update(n?.());return r?e?.onGroupUpdate?.():e?.onGroupComplete?.(),r})}}}static toTweenCSS(t,e,s,n){D.add3DSupport(t);const r=n?.onUpdate||(()=>{});return xe.toTween(e,s,Object.assign(n||{},{onUpdate:(a,o)=>{const h=D.convertAttrs(t,a);D.setStyle(t,h),r(a,o)}}))}addAnimateObject(t=pl,e=dt,s=0,n=!1){const r=e.easeName||"linear",a=e.dur||300,o=e.keyTimes||[0,1],h=[];o.forEach((l,u)=>{u>0&&h.push(ml(r))});const c=this.objects[s];return this.animateObjects=n?[]:this.animateObjects,this.animateObjects.push({el:c.el,app:c.app,originAttrs:c.originAttrs,attributeName:t.attributeName,values:t.values,immediate:t.immediate||!1,easeName:r,begin:e.begin||0,dur:a,repeatCount:e.repeatCount||1,direction:e.direction||"normal",fill:e.fill||"freeze",keyTimes:o,realKeyTimes:o.map(l=>a*l),keySplines:h,calcMode:e.calcMode||"linear",onComplete:e.onComplete||(()=>{})}),this}resetAnimateObjects(t,e,s,n,r=dt,a=this.objects.length-1){let o=!0,h=!1,c=!1,l=!1;const u=this.objects.length-1;a=lt(a,0,u);let g=a-1;g=lt(g,0,u);let y=a+1;y=lt(y,0,u);const m=this.objects[a],x=this.objects[g],b=this.objects[y];if(x&&g!==a){const S=t(x);S&&(this.addAnimateObject(S,r,g,o),o=!1,h=!0)}if(m){const S=e(m);S&&(this.addAnimateObject(S,r,a,o),o=!1,c=!0)}if(b&&y!==a){const S=s(b);S&&(this.addAnimateObject(S,r,y,o),o=!1,l=!0)}this.objects.forEach((S,C)=>{if(!(C==g&&h||C==a&&c||C==y&&l)){const M=n(S);M&&(this.addAnimateObject(M,r,C,o),o=!1)}})}toCSS(t,...e){if(this.objects.length==0)return;this.currentAnimateName=t,this[t](...e),D.add3DSupport(this.objects[0].el),this.objects.forEach((r,a)=>{D.setStyle(r.el,{position:"absolute","z-index":String(2e3+a),"transform-style":"preserve-3d","backface-visibility":"hidden"})});let s=0;const n=()=>{this.animateObjects.forEach((r,a)=>{let o=[],h=[];Array.isArray(r.attributeName)?(o=r.attributeName,h=r.values):r.attributeName&&(o=[r.attributeName],h=[r.values]);const c=r.keyTimes.length;let l=r.begin;r.keyTimes.forEach((u,g)=>{const y={};o.forEach((x,b)=>{const S=h[b][r.direction=="reverse"?c-1-g:g];y[x]=S});const m=D.convertAttrs(r.el,y,r.originAttrs);g==0||r.immediate?D.setStyle(r.el,Object.assign(m,{transition:"none"})):(de.runAccurateSetTimeout(()=>{D.setStyle(r.el,Object.assign(m,{transition:`all ${r.realKeyTimes[g]}ms cubic-bezier(${r.keySplines[g-1].join(",")})`}))},l),l+=r.realKeyTimes[g])}),de.runAccurateSetTimeout(()=>{r.fill==="remove"&&D.setStyle(r.el,r.originAttrs||{}),a==this.animateObjects.length-1&&(r.onComplete?.(),this.currentAnimateName==t&&(r.repeatCount=="infinite"||typeof r.repeatCount=="number"&&++s<r.repeatCount)&&n())},r.begin+r.dur)})};n()}slideLeft(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[-s.app.width,0]]]}),s=>({attributeName:["opacity","translateTo"],values:[[1,1],[[s.app.width,0],[0,0]]]}),s=>{},s=>({attributeName:["opacity","translateTo"],values:[[0,0],[[s.app.width,0],[s.app.width,0]]],immediate:!0}),t,e)}slideRight(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>{},s=>({attributeName:["opacity","translateTo"],values:[[1,1],[[-s.app.width,0],[0,0]]]}),s=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[s.app.width,0]]]}),s=>({attributeName:["opacity","translateTo"],values:[[0,0],[[-s.app.width,0],[-s.app.width,0]]],immediate:!0}),t,e)}slideDown(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[0,s.app.height]]]}),s=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,-s.app.height],[0,0]]]}),s=>{},s=>({attributeName:["opacity","translateTo"],values:[[0,0],[[0,-s.app.height],[0,-s.app.height]]],immediate:!0}),t,e)}slideUp(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[0,-s.app.height]]]}),s=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,s.app.height],[0,0]]]}),s=>{},s=>({attributeName:["opacity","translateTo"],values:[[0,0],[[0,s.app.height],[0,s.app.height]]],immediate:!0}),t,e)}flipLeft(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,180]]}),s=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[-180,0]]}),s=>{},s=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipRight(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,-180]]}),s=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[180,0]]}),s=>{},s=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipDown(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,-180]]}),s=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[180,0]]}),s=>{},s=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipUp(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,180]]}),s=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[-180,0]]}),s=>{},s=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}popIn(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>{},s=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[.8,1],[0,1]]}),s=>{},s=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}popOut(t=dt,e=this.objects.length-1){this.resetAnimateObjects(s=>{},s=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[1,1.2],[1,0]]}),s=>{},s=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}rotate(t=dt,e=this.objects.length-1){Object.assign(t,{keyTimes:[0,1]});const s=t.degree||360;this.resetAnimateObjects(n=>{},n=>({attributeName:["opacity","rotate"],values:[[1,1],[0,s]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}}class jr extends Ln{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,s)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,s)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const s=Ga(e);for(let n of s.stylesheet.rules)for(let r of n.declarations)for(let a of n.selectors)this.globalStyles[a]=this.globalStyles[a]||[],this.globalStyles[a].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,s)=>{let n=this.groups.length;for(;n--;)if(this.groups[n]!=this.currentItem){let r="",a="";for(let o in this.groups[n])o=="transform"?r=this.groups[n].transform:o=="class"&&this.globalStyles["."+this.groups[n][o]]?a=this.globalStyles["."+this.groups[n][o]].join(";")+";"+a:o=="id"&&this.globalStyles["#"+this.groups[n][o]]?a=this.globalStyles["#"+this.groups[n][o]].join(";")+";"+a:typeof this.currentItem[o]>"u"&&(this.currentItem[o]=this.groups[n][o]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=a:this.currentItem.style=a+this.currentItem.style,this.currentItem.class&&this.globalStyles["."+this.currentItem.class]?this.currentItem.style=this.globalStyles["."+this.currentItem.class].join(";")+";"+this.currentItem.style:this.currentItem.id&&this.globalStyles["#"+this.currentItem.id]&&(this.currentItem.style=this.globalStyles["#"+this.currentItem.id].join(";")+";"+this.currentItem.style),Fi(this.currentItem.style,this.currentItem,Bi)}switch(this.processAttrs(e,s),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let s=[],n;switch(t){case"svg":let r="",a="";if(e.width&&e.height)r=e.width,a=e.height;else if(e.viewBox){const o=e.viewBox.split(/\s+/gi);o.length==4&&(r=String(parseFloat(o[2])-parseFloat(o[0])),a=String(parseFloat(o[3])-parseFloat(o[1])))}r&&a&&this.items.push({type:"viewbox",width:r,height:a});break;case"line":typeof e.x1=="number"&&typeof e.y1=="number"&&typeof e.x2=="number"&&typeof e.y2=="number"&&(this.currentItem.path="M"+[e.x1,e.y1,e.x2,e.y2]);break;case"stop":n={},e.style&&Fi(e.style,n),n.offset=n.offset||e.offset,n.color=n["stop-color"]||e["stop-color"],n.opacity=n["stop-opacity"]||e["stop-opacity"],~(n.offset+"").indexOf("%")?n.offset=parseFloat(n.offset):n.offset=parseFloat(n.offset)*100,n.offset=+n.offset.toFixed(2),this.grad.stops.push(n);break;case"linearGradient":this.grad.angle=(360+Ni(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),s=[this.grad.angle];for(let o=0,h=this.grad.stops.length;o<h;o++)n=this.grad.stops[o],o&&o!=h-1?s.push(n.color+":"+n.offset):s.push(n.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break;case"radialGradient":s=[];for(let o=0,h=this.grad.stops.length;o<h;o++)n=this.grad.stops[o],o&&o!=h-1?s.push(n.color+":"+n.offset):s.push(n.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break}for(let r in e){const a=e[r];if(Bi.includes(r)&&(this.currentItem[r]=a),r==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:r,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:r,stops:[]})),r==="style"&&Fi(a,this.currentItem,Bi),r==="transform"&&(this.currentItem.transform=a+(this.currentItem.transform||" ")),r==="fill"){const o=a.match(/url\(#([^)]+)\)/);if(o){const h=o[1];this.currentItem.fillid=h,this.idtops[h]&&(this.currentItem.fill=this.idtops[h])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+a+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=a),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=a)}}addToItems(){this.items.push(this.currentItem)}}function Ni(i,t,e,s,n,r){if(typeof n>"u"||typeof r>"u"){const a=i-e,o=t-s;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return Ni(i,t,n,r)-Ni(e,s,n,r)}function Fi(i,t,e){const s=(i+"").split(";"),n=/^\s+|\s+$/g;for(let r=0,a=s.length;r<a;r++){let o=s[r].split(":"),h=o[0].replace(n,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=o[1].replace(n,""))}}const Bi=["id","class","viewBox","width","height","x","y","cx","cy","r","rx","ry","cursor","opacity","src","fill","fill-opacity","stroke","stroke-dasharray","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","font","font-family","font-size","font-style","font-weight","letter-spacing"];class gl{app;rootEl;shapes=[];isMouseDown=!1;currentMouseInShapeID="";currentEnableDragMouseInShapeID="";constructor(t,e,s){this.app=t,this.rootEl=z.createSVGElement("svg"),D.empty(this.app.container),D.insert(this.app.container,this.rootEl),e&&s?this.setSize(e,s):(this.setSize(this.app.width,this.app.height),this.app.on("resize",()=>{this.setSize(this.app.width,this.app.height)})),this.app.captureMove({start:()=>{this.isMouseDown=!0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.setCursor()},move:()=>{if(this.isMouseDown&&this.currentEnableDragMouseInShapeID){this.setCursor();return}this.currentMouseInShapeID="";const n=this.shapes.length;let r=0;for(;r<n;r++){const a=this.shapes[r];if(!(a instanceof R)&&!a.pathd){a.isMouseIn=!1,a.mouseX=0,a.mouseY=0;continue}const o=a instanceof R&&(a.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||a.isPointInStroke(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl))||a.pathd instanceof R&&(a.pathd.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||a.pathd.isPointInStroke(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl))||!1;if(a.isMouseIn=o,a.mouseX=this.app.mousePoint.x,a.mouseY=this.app.mousePoint.y,o&&(this.currentMouseInShapeID=a.id,a.enableDrag)){this.currentEnableDragMouseInShapeID=a.id,this.shapes.filter(h=>h.id!==a.id).forEach(h=>{h instanceof H&&(h.isMouseIn=!1,h.mouseX=0,h.mouseY=0)});break}}r>=n&&(this.currentEnableDragMouseInShapeID=""),this.setCursor()}})}setCursor(){this.currentEnableDragMouseInShapeID?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing",this.shapes.forEach(t=>{t.autoRender&&this.path(t.shapeGroup||t)}))):this.currentMouseInShapeID?this.app.container.style.cursor="default":this.app.container.style.cursor="default"}setSize(t,e){return D.attribute(this.rootEl,{viewBox:`0 0 ${t} ${e}`,width:`${t}`,height:`${e}`}),this}download(){return z.downloadFromSVGElement(this.rootEl)}path(t){[...Array.isArray(t)?t:[t]].forEach(e=>{if(e instanceof gt){e.frameUpdate(),e.shapes.forEach(s=>this.path(s));return}if(!e.el){if(e instanceof Ye)e.el=this.text(e.text,e.x,e.y,ln(e.attrs,(s,n)=>typeof n=="string"));else if(e instanceof wt)e.el=z.createSvgPath(`M ${e.fromX} ${e.fromY} `+e.toSVGPathD()),D.insert(this.rootEl,e.el);else if(e instanceof R)e.el=z.createSvgPath(e.toSVGPathD()),D.insert(this.rootEl,e.el);else if(e instanceof H){const s=R.fromShape(e)||e;e.el=s.el=z.createSvgPath(s.toSVGPathD()),D.insert(this.rootEl,e.el),s instanceof R&&(e.pathd=s)}}this.shapes.find(s=>s.id==e.id)||this.shapes.push(e),this.update(e)})}update(t){[...Array.isArray(t)?t:[t]].forEach(e=>{const s=[];e instanceof gt?(e.frameUpdate(),s.push(...e.shapes)):s.push(e),s.forEach(n=>{if(n.followMouse&&(!Pe(n.x,this.app.mousePoint.x,5)||!Pe(n.y,this.app.mousePoint.y,5))&&(n.rotateTo(this.app.mousePoint),n.followTo(this.app.mousePoint)),n.targetToAfterDragFree&&(this.isMouseDown||n.nextFrameEaseTo({x:n.targetToAfterDragFree.targetX,y:n.targetToAfterDragFree.targetY},{easing:n.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShapeID==n.id){const{dx:r,dy:a}=n.centerDiff,o=n.x,h=n.y;if(n.x=this.app.mousePoint.x-r,n.y=this.app.mousePoint.y-a,n.alongPath){const c=n.alongPath.closestPoint(n.x,n.y);n.x=c.point.x,n.y=c.point.y}n.isDragging=!0,n.emit("moving",n.x-o,n.y-h)}else n instanceof H&&(n.isDragging=!1);(n instanceof wt||n instanceof R||n.pathd instanceof R)&&this.attr(n,"d",n instanceof wt?`M ${n.fromX} ${n.fromY} `+n.toSVGPathD():n.pathd instanceof R?n.pathd.toSVGPathD():n.toSVGPathD()),n instanceof Ye&&(n.setAttr("x",String(n.x)),n.setAttr("y",String(n.y))),this.attr(n,ln(n.attrs,(r,a)=>typeof a=="string")),n.frameUpdate(),n instanceof R?n.updateTransform():n.pathd&&n.pathd.updateFromShape(n),n.el&&(n.isShow?D.show(n.el):D.hide(n.el))})})}click(t){const e=()=>{this.shapes.forEach(s=>{(s instanceof R&&(s.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||s.isPointInStroke(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl))||s.pathd instanceof R&&(s.pathd.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||s.pathd.isPointInStroke(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)))&&t(s)})};return this.app.on("tap",e),()=>{this.app.off("tap",e)}}delete(t){[...t instanceof gt?t.shapes:[t]].forEach(e=>{e.el&&D.remove(e.el),e.pathd?.el&&D.remove(e.pathd?.el),delete e.el,delete e.pathd,this.shapes=this.shapes.filter(s=>s.id!==e.id)})}clear(){this.shapes.forEach(t=>{t.el&&D.remove(t.el),t.pathd?.el&&D.remove(t.pathd?.el),delete t.el,delete t.pathd}),D.empty(this.rootEl),this.shapes=[]}attr(t,e,s){const n=t.el||t;return n instanceof SVGElement?e===void 0&&s===void 0?D.attribute(n):typeof e=="string"&&s===void 0?D.attribute(n,nt(e))||"":(typeof e=="object"?D.attribute(n,e):typeof e=="string"&&s!==void 0&&D.attribute(n,nt(e),s),this):this}circle(t,e,s){return this.path(new ut({x:t,y:e,radius:s}))}circleEl(t,e,s){const n=z.createSVGElement("circle",{cx:String(t),cy:String(e),r:String(s)});return D.insert(this.rootEl,n),n}ellipse(t,e,s,n){return this.path(new Yr({x:t,y:e,rx:s,ry:n}))}ellipseEl(t,e,s,n){const r=z.createSVGElement("ellipse",{cx:String(t),cy:String(e),rx:String(s),ry:String(n)});return D.insert(this.rootEl,r),r}rect(t,e,s,n){return this.path(new Q({x:t,y:e,width:s,height:n}))}rectEl(t,e,s,n){const r=z.createSVGElement("rect",{x:String(t),y:String(e),width:String(s),height:String(n)});return D.insert(this.rootEl,r),r}image(t,e,s,n,r){}text(t,e,s,n){const r=z.createSVGElement("text",{x:String(e),y:String(s)});return D.html(r,t),this.attr(r,Object.assign({"alignment-baseline":"middle"},n)),D.insert(this.rootEl,r),r}textWithTspan(t,e,s,n){const r=n?.["line-height"]||"1.2em",a=z.createSVGElement("text",{x:String(e),y:String(s)});return t.split(`
|
|
41
|
+
`).forEach((o,h)=>{if(o.trim()){const c=z.createSVGElement("tspan",{x:String(e),dy:h>0?r:"0"});D.html(c,o),D.insert(a,c),this.attr(c,Object.assign({"alignment-baseline":"middle"},n))}}),D.insert(this.rootEl,a),a}}const Xr=yl("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);function yl(i,t=10){const e={},s=i.split(",");for(let n=0;n<s.length;n+=2){const r="&"+s[n+1]+";",a=parseInt(s[n],t);e[r]="&#"+a+";"}return e["\\xa0"]=" ",e}function rt(i,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)i=i.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return i}function ks(i){let t,e;if(!i)throw new Error("cannot create a random attribute name for an undefined object");const s="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=s[Math.floor(Math.random()*s.length)];while(i[t]);return t}function wl(i){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[i]||t.start}function xl(i){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[i]||t.alphabetic}const je={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"},lineDashOffset:{svgAttr:"stroke-dashoffset",canvas:0,svg:0,apply:"stroke"}};class Ms{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const s=this.__ctx.__createElement("stop");if(s.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(s.setAttribute("stop-color",rt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),s.setAttribute("stop-opacity",r[4]))}else s.setAttribute("stop-color",e);this.__root.appendChild(s)}}class Gi{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Xe{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:s=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=s),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(je);for(let e=0,s=t.length;e<s;e++){const n=t[e];this[n]=je[n].canvas}}__getStyleState(){const t={},e=Object.keys(je);for(let s=0,n=e.length;s<n;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,n=e.length;s<n;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const n=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(n.setAttribute("fill","none"),n.setAttribute("stroke","none"));for(let a=0;a<r.length;a++){const o=r[a];n.setAttribute(o,e[o])}return n}__applyStyleToCurrentElement(t){let e=this.__currentElement;const s=this.__currentElementsToStyle;s&&(e.setAttribute(t,""),e=s.element,s.children.forEach(r=>{r.setAttribute(t,"")}));const n=Object.keys(je);for(let r=0;r<n.length;r++){const a=je[n[r]],o=this[n[r]];if(a.apply){if(o instanceof Gi){if(o.__ctx)for(;o.__ctx.__SVGdefs.childNodes.length;){const h=o.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(o.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(a.apply,rt("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof Ms)e.setAttribute(a.apply,rt("url(#{id})",{id:o.__root.getAttribute("id")}));else if(a.apply.indexOf(t)!==-1&&a.svg!==o)if((a.svgAttr==="stroke"||a.svgAttr==="fill")&&o.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(o);if(c){e.setAttribute(a.svgAttr,rt("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const u=this.globalAlpha;u!=null&&(l*=u),e.setAttribute(a.svgAttr+"-opacity",""+l)}}else{let h=a.svgAttr;if(n[r]==="globalAlpha"&&(h=t+"-"+a.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,o)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const n=Object.keys(Xr);for(let r=0,a=n.length;r<a;r++){const o=n[r],h=Xr[o],c=new RegExp(o,"gi");c.test(e)&&(e=e.replace(c,h))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const n=this.__createElement("g");e.appendChild(n),this.__currentElement=n}let s=this.__currentElement.getAttribute("transform");s?s+=" ":s="",s+=t,this.__currentElement.setAttribute("transform",s)}scale(t,e){e===void 0&&(e=t),this.__addTransform(rt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(rt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(rt("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,n,r,a){this.__addTransform(rt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,d:n,e:r,f:a}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(rt("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(rt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(rt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,n,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(rt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:n,x:r,y:a}))}quadraticCurveTo(t,e,s,n){this.__currentPosition={x:s,y:n},this.__addPathCommand(rt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,y:n}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,s,n,r){const a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(typeof a>"u"||typeof o>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(a===t&&o===e||t===s&&e===n||r===0){this.lineTo(t,e);return}const h=this.normalize([a-t,o-e]),c=this.normalize([s-t,n-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const l=h[0]*c[0]+h[1]*c[1],u=Math.acos(Math.abs(l)),g=this.normalize([h[0]+c[0],h[1]+c[1]]),y=r/Math.sin(u/2),m=t+y*g[0],x=e+y*g[1],b=[-h[1],h[0]],S=[c[1],-c[0]],C=function(F){const L=F[0];return F[1]>=0?Math.acos(L):-Math.acos(L)},M=C(b),O=C(S);this.lineTo(m+b[0]*r,x+b[1]*r),this.arc(m,x,r,M,O)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,s,n){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+n),this.lineTo(t,e+n),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,n){const r=this.__createElement("rect",{x:t,y:e,width:s,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,n){const r=this.__createElement("rect",{x:t,y:e,width:s,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],n=s.childNodes;for(let r=n.length-1;r>=0;r--)n[r]&&s.removeChild(n[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,n){if(t===0&&e===0&&s===this.width&&n===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:s,height:n,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,s,n){const r=this.__createElement("linearGradient",{id:ks(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:n+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new Ms(r,this)}createRadialGradient(t,e,s,n,r,a){const o=this.__createElement("radialGradient",{id:ks(this.__ids),cx:n+"px",cy:r+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new Ms(o,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),s={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(s.decoration="underline"),this.__fontHref&&(s.href=this.__fontHref),s}__wrapTextLink(t,e){if(t.href){const s=this.__createElement("a");return s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),s.appendChild(e),s}return e}__applyText(t,e,s,n){const r=this.__parseFont(),a=this.__closestGroupOrSvg(),o=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:s,"text-anchor":wl(this.textAlign),"dominant-baseline":xl(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(n),a.appendChild(this.__wrapTextLink(r,o))}fillText(t,e,s){this.__applyText(t,e,s,"fill")}strokeText(t,e,s){this.__applyText(t,e,s,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,s,n,r,a){if(n===r)return;n=n%(2*Math.PI),r=r%(2*Math.PI),n===r&&(r=(r+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+s*Math.cos(r),h=e+s*Math.sin(r),c=t+s*Math.cos(n),l=e+s*Math.sin(n),u=a?0:1;let g=0,y=r-n;y<0&&(y+=2*Math.PI),a?g=y>Math.PI?0:1:g=y>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(rt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:g,sweepFlag:u,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=ks(this.__ids),n=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",s),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",rt("url(#{id})",{id:s})),t.appendChild(n),this.__currentElement=n}drawImage(...t){let e=t[0],s,n,r,a,o=0,h=0,c,l,u,g,y,m,x,b;if(t.length===3)s=t[1],n=t[2],c=e.width,l=e.height,r=c,a=l;else if(t.length===5)s=t[1],n=t[2],r=t[3],a=t[4],c=e.width,l=e.height;else if(t.length===9)o=t[1],h=t[2],c=t[3],l=t[4],s=t[5],n=t[6],r=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const S=this.__closestGroupOrSvg();this.__currentElement;const C="translate("+s+", "+n+")";if(e instanceof Xe){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(g=u.childNodes[0];g.childNodes.length;)b=g.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(g.childNodes[0]);if(y=u.childNodes[1],y){const M=y.getAttribute("transform");let O;M?O=M+" "+C:O=C,y.setAttribute("transform",O),S.appendChild(y)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(m=this.__createElement("image"),m.setAttribute("width",r),m.setAttribute("height",a),m.setAttribute("preserveAspectRatio","none"),(o||h||c!==e.width||l!==e.height)&&(x=this.__document.createElement("canvas"),x.width=r,x.height=a,x.getContext("2d")?.drawImage(e,o,h,c,l,0,0,r,a),e=x),m.setAttribute("transform",C),m.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),S.appendChild(m))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),n=ks(this.__ids);let r;return s.setAttribute("id",n),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),s.appendChild(r),this.__SVGdefs.appendChild(s)):t instanceof Xe&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new Gi(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class _s{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,s,n=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),n&&(this.customContext=new Xe({canvas:this.canvas,width:e||this.canvas.width,height:s||this.canvas.height}))}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(this.customContext.globalAlpha=t)}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(this.customContext.fillStyle=t.gradientCustom))}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,s,n){return this.context.fillRect(t,e,s,n),this.customContext&&this.customContext.fillRect(t,e,s,n),this}fillText(t,e,s,n){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,s,n),this.customContext&&this.customContext.fillText(t,e,s),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,s,n){return this.context.strokeText(t,e,s,n),this.customContext&&this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,n){return this.context.strokeRect(t,e,s,n),this.customContext&&this.customContext.strokeRect(t,e,s,n),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,n=this.canvas.height){return this.context.clearRect(t,e,s,n),this.customContext&&this.customContext.clearRect(t,e,s,n),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext&&this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.currentPath2D=this.path2Ds.pop()||new Path2D,this}beginPath(){return this.context.beginPath(),this.customContext&&this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext&&this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const s=new Path2D;s.addPath(t,e),this.currentPath2D=s}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,s=0){return this.translate(e,s),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-s),this.changePath2D(),this}scale(t,e=t,s=0,n=0){return this.translate(s,n),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-s,-n),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,s,n,r,a){return this.context.arc(t,e,s,n,r,a),this.customContext&&this.customContext.arc(t,e,s,n,r,a?-1:1),this.currentPath2D.arc(t,e,s,n,r,a),this}arcTo(t,e,s,n,r){return this.context.arcTo(t,e,s,n,r),this.customContext&&this.customContext.arcTo(t,e,s,n,r),this.currentPath2D.arcTo(t,e,s,n,r),this}ellipse(t,e,s,n,r,a,o,h){return this.context.ellipse(t,e,s,n,r,a,o,h),this.currentPath2D.ellipse(t,e,s,n,r,a,o,h),this}quadraticCurveTo(t,e,s,n){return this.context.quadraticCurveTo(t,e,s,n),this.customContext&&this.customContext.quadraticCurveTo(t,e,s,n),this.currentPath2D.quadraticCurveTo(t,e,s,n),this}bezierCurveTo(t,e,s,n,r,a){return this.context.bezierCurveTo(t,e,s,n,r,a),this.customContext&&this.customContext.bezierCurveTo(t,e,s,n,r,a),this.currentPath2D.bezierCurveTo(t,e,s,n,r,a),this}rect(t,e,s,n){return this.context.rect(t,e,s,n),this.customContext&&this.customContext.rect(t,e,s,n),this.currentPath2D.rect(t,e,s,n),this}createLinearGradient(t,e,s,n,r){const a=this.context.createLinearGradient(t,e,s,n);return r&&Object.entries(r).forEach(([o,h])=>{a.addColorStop(parseFloat(o),h)}),a}createRadialGradient(t,e,s,n,r,a,o){const h=this.context.createRadialGradient(t,e,s,n,r,a);return o&&Object.entries(o).forEach(([c,l])=>{h.addColorStop(parseFloat(c),l)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const s=e[0],n=e[1];this.context.drawImage(t,s,n)}else if(e.length===4){const s=e[0],n=e[1],r=e[2],a=e[3];this.context.drawImage(t,s,n,r,a)}else if(e.length===8){const s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],h=e[5],c=e[6],l=e[7];this.context.drawImage(t,s,n,r,a,o,h,c,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,s=this.canvas.width,n=this.canvas.height,r){return this.context.getImageData(t,e,s,n,r)}putImageData(t,e=0,s=0){return this.context.putImageData(t,e,s)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}}class wt extends H{fromX;fromY;constructor(t){super(t),this.fromX=t?.fromX||0,this.fromY=t?.fromY||0}static fromSVGPathData(t,e){if(t.length<3)throw new Error("Line 参数个数错误");if(t[0].toUpperCase()!=="L")throw new Error("Line command 错误");return new wt({x:t[1],y:t[2],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["L",this.x,this.y]}toCanvasContext(t){t.beginPath(),t.moveTo(this.fromX,this.fromY),t.lineTo(this.x,this.y)}getBoundingClientRect(){const t=Xt(this.fromX,this.fromY,this.x,this.y);if(t===0){const e=Math.min(this.x,this.fromX),s=Math.min(this.y,this.fromY),n=Math.max(this.x,this.fromX),r=Math.max(this.y,this.fromY);return new Q({x:e,y:s,width:n-e,height:r-s})}else{const e=Math.sin(t),s=Math.cos(t),n=s*this.fromX-e*this.fromY,r=s*this.x-e*this.y,a=s*this.fromY+e*this.fromX,o=s*this.y+e*this.x;return new Q({x:Math.min(n,r),y:Math.min(a,o),width:Math.max(n,r)-Math.min(n,r),height:Math.max(a,o)-Math.min(a,o)})}}interpolate(t){return{x:this.fromX+t*(this.x-this.fromX),y:this.fromY+t*(this.y-this.fromY)}}intersection(t){const e=this.fromX,s=this.fromY,n=t.x,r=t.y,a=this.x-e,o=t.fromX-n;if(!a&&!o)return null;const h=(this.y-s)/a,c=(t.fromY-r)/o;if(a){if(!o)return{x:n,y:h*(n-e)+s}}else return{x:e,y:c*(e-n)+r};const l=(-c*n+r+h*e-s)/(h-c),u=h*(l-e)+s;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}}class Tt extends wt{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}static fromSVGPathData(t,e){if(t.length<7)throw new Error("CubicBezier 参数个数错误");if(t[0].toUpperCase()!=="C")throw new Error("CubicBezier command 错误");return new Tt({c1x:t[1],c1y:t[2],c2x:t[3],c2y:t[4],x:t[5],y:t[6],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["C",this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y]}toCanvasContext(t){t.beginPath(),t.moveTo(this.fromX,this.fromY),t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y)}getBoundingClientRect(){const t=z.curveDim(this.fromX,this.fromY,this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y);return new Q({x:t.min.x,y:t.min.y,width:t.max.x-t.min.x,height:t.max.y-t.min.y})}interpolate(t){return{x:Math.pow(1-t,3)*this.fromX+3*Math.pow(1-t,2)*t*this.c1x+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2x+Math.pow(t,3)*this.x,y:Math.pow(1-t,3)*this.fromY+3*Math.pow(1-t,2)*t*this.c1y+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2y+Math.pow(t,3)*this.y}}length(t=1){return z.bezlen(this.fromX,this.fromY,this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y,t)}getTatLen(t){const e=this.fromX,s=this.fromY,n=this.c1x,r=this.c1y,a=this.c2x,o=this.c2y,h=this.x,c=this.y;if(t<0||z.bezlen(e,s,n,r,a,o,h,c)<t)return 0;let l=1,u=l/2,g=l-u,y,m=.01;for(y=z.bezlen(e,s,n,r,a,o,h,c,g);Math.abs(y-t)>m;)u/=2,g+=(y<t?1:-1)*u,y=z.bezlen(e,s,n,r,a,o,h,c,g);return g}getPointAtSegmentLength(t){const e=this.getTatLen(t),s=this.fromX,n=this.fromY,r=this.c1x,a=this.c1y,o=this.c2x,h=this.c2y,c=this.x,l=this.y;let u=1-e,g=Math.pow(u,3),y=Math.pow(u,2),m=e*e,x=m*e,b=g*s+y*3*e*r+u*3*e*e*o+x*c,S=g*n+y*3*e*a+u*3*e*e*h+x*l,C=s+2*e*(r-s)+m*(o-2*r+s),M=n+2*e*(a-n)+m*(h-2*a+n),O=r+2*e*(o-r)+m*(c-2*o+r),F=a+2*e*(h-a)+m*(l-2*h+a),L=u*s+e*r,V=u*n+e*a,Z=u*o+e*c,X=u*h+e*l,Y=90-Math.atan2(C-O,M-F)*180/Math.PI;return{x:b,y:S,m:{x:C,y:M},n:{x:O,y:F},start:{x:L,y:V},end:{x:Z,y:X},alpha:Y}}}class Is extends wt{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!0}static fromSVGPathData(t,e){if(t.length<5)throw new Error("QuadraticBezier 参数个数错误");if(t[0].toUpperCase()!=="Q")throw new Error("QuadraticBezier command 错误");return new Is({cx:t[1],cy:t[2],x:t[3],y:t[4],fromX:e?.x,fromY:e?.y})}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.fromX+this.x)/2,e=this.cy*2-(this.fromY+this.y)/2;return["Q",t,e,this.x,this.y]}else return["Q",this.cx,this.cy,this.x,this.y]}toCanvasContext(t){if(t.beginPath(),t.moveTo(this.fromX,this.fromY),this.isLineThrough){const e=this.cx*2-(this.fromX+this.x)/2,s=this.cy*2-(this.fromY+this.y)/2;t.quadraticCurveTo(e,s,this.x,this.y)}else t.quadraticCurveTo(this.cx,this.cy,this.x,this.y)}interpolate(t){return{x:(1-t)*(1-t)*this.fromX+2*(1-t)*t*this.cx+t*t*this.x,y:(1-t)*(1-t)*this.fromY+2*(1-t)*t*this.cy+t*t*this.y}}}class be extends wt{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1}static fromSVGPathData(t,e){if(t.length<8)throw new Error("Arc 参数个数错误");if(t[0].toUpperCase()!=="A")throw new Error("Arc command 错误");return new be({rx:t[1],ry:t[2],xAxisRotate:t[3],largeArcFlag:t[4],sweepFlag:t[5],x:t[6],y:t[7],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.x,this.y]}toCanvasContext(t){t.beginPath();const[e,s,n,r,a,o,h]=this.convertSVGToCanvas(this.fromX,this.fromY,this.x,this.y,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e-this.x,s-this.y,n,r,a,o,h,!this.sweepFlag)}convertSVGToCanvas(t,e,s,n,r,a,o,h,c){const l=o/180*Math.PI,u=(t-s)/2,g=(e-n)/2,y=Math.cos(l)*u+Math.sin(l)*g,m=-Math.sin(l)*u+Math.cos(l)*g,x=y*y/(r*r)+m*m/(a*a);if(x>1){const q=Math.sqrt(x);throw r=q*r,a=q*a,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${a}.`)}const b=Math.sqrt((r*r*a*a-r*r*m*m-a*a*y*y)/(r*r*m*m+a*a*y*y)),S=h!=c?1:-1,C=S*b*r*m/a,M=S*b*-a*y/r,O=(t+s)/2,F=(e+n)/2,L=Math.cos(l)*C-Math.sin(l)*M+O,V=Math.sin(l)*C+Math.cos(l)*M+F,Z=(q,it,xt,ht)=>(q*ht>=it*xt?1:-1)*Math.acos((q*xt+it*ht)/(Math.sqrt(q*q+it*it)*Math.sqrt(xt*xt+ht*ht))),X=Z(1,0,t-L,e-V)-l,Y=Z(t-L,e-V,s-L,n-V);return[L,V,r,a,l,X,X+Y]}}class R extends H{startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){super(t),this.prevPathX=this.startPathX=this.x,this.prevPathY=this.startPathY=this.y}appendLine(t){if(t instanceof be){kn(this.prevPathX,this.prevPathY,t.x,t.y,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,u,g,y,m,x,b,S]=c;this.normalizedLines.push(new Tt({c1x:g,c1y:y,c2x:m,c2y:x,x:b,y:S,fromX:this.prevPathX,fromY:this.prevPathY})),this.prevPathX=b,this.prevPathY=S});return}let e,s,n,r,a,o;t instanceof Tt?(e=t.c1x,s=t.c1y,n=t.c2x,r=t.c2y,a=t.x,o=t.y):t instanceof Is?[e,s,n,r,a,o]=si(this.prevPathX,this.prevPathY,t.cx,t.cy,t.x,t.y):[e,s,n,r,a,o]=De(this.prevPathX,this.prevPathY,t.x,t.y),this.normalizedLines.push(new Tt({c1x:e,c1y:s,c2x:n,c2y:r,x:a,y:o,fromX:this.prevPathX,fromY:this.prevPathY})),this.prevPathX=a,this.prevPathY=o}static fromSVGPathD(t="M0,0",e){const s=new R(e);return s.updateFromSVGPathD(t),s}static fromSVGPathData(t,e){const s=new R(e);return s.updateFromSVGPathData(t),s}static fromShape(t,e){const s=new R(Object.assign({attrs:{...t.attrs}},e));return s.updateFromShape(t),s}updateFromShape(t){this.degree=t.degree,this.scalexOnOrigin=t.scalexOnOrigin,this.scaleyOnOrigin=t.scaleyOnOrigin,this.skewxDegreeOnOrigin=t.skewxDegreeOnOrigin,this.skewyDegreeOnOrigin=t.skewyDegreeOnOrigin,this.updateFromSVGPathD(t.toSVGPathD())}updateFromSVGPathD(t){z.isSVGPath(t)&&this.updateFromSVGPathData(z.parseSVGPath(t))}updateFromSVGPathData(t){this.normalizedLines=[];const e=z.normalizeSVGPath(z.absolutizeSVGPath(t));for(let s=0,n=e.length;s<n;s++){const r=e[s];if(r[0]=="M"){this.prevPathX=this.startPathX=r[1],this.prevPathY=this.startPathY=r[2];continue}this.appendLine(new Tt({c1x:r[1],c1y:r[2],c2x:r[3],c2y:r[4],x:r[5],y:r[6]}))}this.prevDegree=0,this.prevScalexOnOrigin=1,this.prevScaleyOnOrigin=1,this.prevSkewxDegreeOnOrigin=0,this.prevSkewyDegreeOnOrigin=0,this.updateTransform()}toSVGPathData(t=!1){let e=[];e.push(["M",this.startPathX,this.startPathY]);for(let s=0,n=this.normalizedLines.length;s<n;s++)e.push(this.normalizedLines[s].toSVGPathData());return t&&(e=z.relativeSVGPath(e)),e}toCanvasContext(t){t.beginPath(),t.moveTo(this.startPathX,this.startPathY),this.normalizedLines.forEach(e=>{const[s,...n]=e.toSVGPathData();t.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5])})}static toCanvasContextUsePath2D(t,e,s,n){t.beginPath();const r=new Path2D(e),a=new Path2D;a.addPath(r,new DOMMatrix(s));const o=new Path2D;return o.addPath(a,ri(n)),t.fill(o),o}updateTransform(){if((this.x!=this.prevX||this.y!=this.prevY)&&this.translate(this.x-this.prevX,this.y-this.prevY),this.scalexOnOrigin!=this.prevScalexOnOrigin||this.scaleyOnOrigin!=this.prevScaleyOnOrigin){const t=this.getBoundingClientRect();this.scale(this.scalexOnOrigin/this.prevScalexOnOrigin,this.scaleyOnOrigin/this.prevScaleyOnOrigin,this.renderGroup&&!this.transformBaseOnSelfInRenderGroup?this.renderGroup.x:t.x+t.width/2,this.renderGroup&&!this.transformBaseOnSelfInRenderGroup?this.renderGroup.y:t.y+t.height/2)}if(this.degree!=this.prevDegree){const t=this.getBoundingClientRect();this.rotate(this.degree-this.prevDegree,this.renderGroup&&!this.transformBaseOnSelfInRenderGroup?this.renderGroup.x:t.x+t.width/2,this.renderGroup&&!this.transformBaseOnSelfInRenderGroup?this.renderGroup.y:t.y+t.height/2)}this.skewxDegreeOnOrigin!=this.prevSkewxDegreeOnOrigin&&this.skewx(this.skewxDegreeOnOrigin-this.prevSkewxDegreeOnOrigin),this.skewyDegreeOnOrigin!=this.prevSkewyDegreeOnOrigin&&this.skewy(this.skewyDegreeOnOrigin-this.prevSkewyDegreeOnOrigin)}transform(t){return{x:this.startPathX,y:this.startPathY}=t.applyToPoint(this.startPathX,this.startPathY),{x:this.prevPathX,y:this.prevPathY}=t.applyToPoint(this.prevPathX,this.prevPathY),this.normalizedLines.forEach(e=>{({x:e.fromX,y:e.fromY}=t.applyToPoint(e.fromX,e.fromY)),{x:e.c1x,y:e.c1y}=t.applyToPoint(e.c1x,e.c1y),{x:e.c2x,y:e.c2y}=t.applyToPoint(e.c2x,e.c2y),{x:e.x,y:e.y}=t.applyToPoint(e.x,e.y)}),this}translate(t,e){const s=new st().translate(t,e);return this.transform(s),this.prevX=this.x,this.prevY=this.y,this}rotate(t,e=0,s=0){const n=new st().rotate(t,e,s);return this.transform(n),this.prevDegree=this.degree,this}scale(t,e=t,s=0,n=0){const r=new st().scale(t,e,s,n);return this.transform(r),this.prevScalexOnOrigin=this.scalexOnOrigin,this.prevScaleyOnOrigin=this.scaleyOnOrigin,this}skewx(t){const e=new st().skew(t,0);return this.transform(e),this.prevSkewxDegreeOnOrigin=this.skewxDegreeOnOrigin,this}skewy(t){const e=new st().skew(0,t);return this.transform(e),this.prevSkewyDegreeOnOrigin=this.skewyDegreeOnOrigin,this}trim(){const t=this.getBoundingClientRect();return this.translate(-t.x,-t.y),this}getBoundingClientRect(){let t=0,e=0,s=[],n=[];t=this.startPathX,e=this.startPathY,s.push(t),n.push(e),this.normalizedLines.forEach(c=>{const l=z.curveDim(t,e,c.c1x,c.c1y,c.c2x,c.c2y,c.x,c.y);s=s.concat(l.min.x,l.max.x),n=n.concat(l.min.y,l.max.y),t=c.x,e=c.y});const r=Math.min.apply(0,s),a=Math.min.apply(0,n),o=Math.max.apply(0,s),h=Math.max.apply(0,n);return new Q({x:r,y:a,width:o-r,height:h-a})}getTotalLength(){return this.normalizedLines.reduce((t,e)=>t+=e.length(),0)}getPointAtLength(t){let e=0;const s=this.normalizedLines.length;for(let n=0;n<s;n++){const r=this.normalizedLines[n],a=r.length();if(e+a>=t)return r.getPointAtSegmentLength(t-e);e+=a}return this.normalizedLines[s-1].getPointAtSegmentLength(1)}interpolate(t){if(this.normalizedLines.length===0)return{x:this.startPathX,y:this.startPathX};if(this.normalizedLines.length===1)return this.normalizedLines[0].interpolate(t);{let e=t*this.normalizedLines.length,s=this.normalizedLines[0];if(e--,e>1)for(let n=1,r=this.normalizedLines.length;n<r&&(s=this.normalizedLines[n],e>1);n++)e-=1;return s.interpolate(e)}}getSubpathsAtLength(t,e,s){let n=null,r=0;const a=new R;a.prevPathX=a.startPathX=t.x,a.prevPathY=a.startPathY=t.y;for(let o=0,h=t.normalizedLines.length;o<h;o++){const c=t.normalizedLines[o],l=c.length();if(r+l>e&&!n){const u=c.getPointAtSegmentLength(e-r);if(a.appendLine(new Tt({c1x:u.start.x,c1y:u.start.y,c2x:u.m.x,c2y:u.m.y,x:u.x,y:u.y})),s)return a;n=a,a.prevPathX=u.x,a.prevPathY=u.y,a.appendLine(new Tt({c1x:u.n.x,c1y:u.n.y,c2x:u.end.x,c2y:u.end.y,x:c.x,y:c.y})),r+=l;continue}r+=l,a.appendLine(c)}return a}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const s=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(s,t):s}}trailPath(t,e=0){const s=this.getTotalLength();return t.updateFromSVGPathD(this.getSubpath(0,e*s).toSVGPathD()),this.getPointAtLength(e*s)}closestPoint(t,e){const s=this.getTotalLength();let n={x:t,y:e},r=0,a=1/0,o=8;for(let c=0;c<=s;c+=o){let l=this.getPointAtLength(c),u=ls(l.x,l.y,t,e);u<a&&(n=l,r=c,a=u)}for(o/=2;o>.5;){let c=r-o,l=this.getPointAtLength(c),u=ls(l.x,l.y,t,e),g=r+o,y=this.getPointAtLength(g),m=ls(y.x,y.y,t,e);c>=0&&u<a?(n=l,r=c,a=u):g<=s&&m<a?(n=y,r=g,a=m):o/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:n,rotation:r>=s?Xt(h.x,h.y,n.x,n.y):Xt(n.x,n.y,h.x,h.y),distance:Math.sqrt(a)}}isPointInPath(t,e,s){if(s instanceof _s)return s.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let n;try{n=new SVGPoint(t,e)}catch{n=s.createSVGPoint(),n.x=t,n.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInFill(n):!1}isPointInStroke(t,e,s){if(s instanceof _s)return s.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let n;try{n=new SVGPoint(t,e)}catch{n=s.createSVGPoint(),n.x=t,n.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(n):!1}strokeDashToTween(t){const e=+this.getTotalLength().toFixed(0);this.setAttr({strokeDasharray:`${e} ${e}`,strokeDashoffset:`${e}`});const s=t?.onUpdate;return xe.toTween({offset:e},{offset:0},Object.assign(t||{},{onUpdate:(n,r)=>{this.setAttr("strokeDashoffset",""+jt(n.offset,2)),s?.(n,r)}}))}get polymorphPoints(){return[this.startPathX,this.startPathY].concat(this.normalizedLines.reduce((t,e)=>t.concat([e.c1x,e.c1y,e.c2x,e.c2y,e.x,e.y]),[]))}static fromPolymorphPoints(t){const e=new R({x:t[0],y:t[1]});for(let s=2;s+5<t.length;s+=6)e.appendLine(new Tt({c1x:t[s],c1y:t[s+1],c2x:t[s+2],c2y:t[s+3],x:t[s+4],y:t[s+5]}));return e}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let s=t[e-2],n=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=cs(t[a],t[a+1],s,n),s=t[a],n=t[a+1];return Math.floor(r)}fillPathD(t){const e=this.polymorphPoints,s=e.length;let n=t-s;const r=Math.ceil(t/s),a=[];a.push(["M",e[0],e[1]]);let o=2;for(;o+5<=s-1;){const h=e[o++],c=e[o++],l=e[o++],u=e[o++],g=e[o++],y=e[o++];a.push(["C",h,c,l,u,g,y]);let m=0;for(;m<r&&n>0;)a.push(["C",g,y,g,y,g,y]),n-=6,m++}return R.fromSVGPathData(a)}static mixPoints(t,e,s){const n=t.length,r=new Array(n);for(let a=0;a<n;a++)r[a]=jt(t[a]+(e[a]-t[a])*s,6);return r}static getPathInterpolator(t,e){return s=>Math.abs(s-0)<Number.EPSILON?t.toSVGPathD():Math.abs(s-1)<Number.EPSILON?e.toSVGPathD():R.fromPolymorphPoints(this.mixPoints(t.polymorphPoints,e.polymorphPoints,s)).toSVGPathD()}static polymorph(t){if(!t.length)throw new Error("paths 为空!");const e=t.length-1,s=new Array(e);for(let r=0;r<e;r++){const a=Math.max(t[r].polymorphPoints.length,t[r+1].polymorphPoints.length);s[r]=this.getPathInterpolator(t[r].fillPathD(a),t[r+1].fillPathD(a))}const n=R.fromSVGPathD(s[0](0));return r=>{const a=jt(e*r,6),o=Math.min(Math.floor(a),e-1),h=jt(a-o,6);n.updateFromSVGPathD(s[o](h));const c=t[o].getAttr("fill","none"),l=t[o+1].getAttr("fill","none");typeof c=="string"&&typeof l=="string"&&n.setAttr("fill",li(c,l,h));const u=t[o].getAttr("stroke","none"),g=t[o+1].getAttr("stroke","none");return typeof u=="string"&&typeof g=="string"&&n.setAttr("stroke",li(u,g,h)),n}}static generateRosetta(t,e,s,n,r){if(r==0)throw new Error("no dividing by zero, please");const a=new R({x:t,y:e}),o=360/r;for(let h=0;h<r;h+=1){const c=o*h*Math.PI/180,l=t+2*s*Math.cos(c),u=e+2*s*Math.sin(c);a.appendLine(new be({x:l,y:u,rx:s,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1})),a.appendLine(new be({x:t,y:e,rx:s,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1}))}return a}}class ve extends gt{svgWidth=0;svgHeight=0;width=0;height=0;shapes=[];constructor(t){if(super(t),!t?.svg)return;const e=new jr(t.svg).parse();for(let s=0,n=e.length;s<n;s++){const r=e[s];if(r.type=="viewbox"&&r.width&&r.height){if(this.svgWidth=parseFloat(r.width),this.svgHeight=parseFloat(r.height),t.width){const l=this.svgWidth/this.svgHeight;this.width=t.width,this.height=this.width/l}else this.width=this.svgWidth,this.height=this.svgHeight;continue}if(r.type!="path"||!ce.isSVGPath(r.path))continue;const a={};for(const l in r)l==="type"||l==="path"||l==="transform"||(a[l]=r[l]);const o=ce.absolutizeSVGPath(ce.parseSVGPath(r.path));let h=[],c=[];for(let l=0,u=o.length;l<u;l++){const g=o[l];c.push(g),g[0].toLowerCase()=="z"&&(h.push(c),c=[])}c.length&&h.push(c),h.forEach(l=>{const u=R.fromSVGPathData(l,t),g=ni(r.transform??"");u.transform(g),u.attrs={...u.attrs,...a,...t.attrs},this.width&&this.svgWidth&&u.scale(this.width/this.svgWidth),this.addShape(u)})}}addShape(t,e){(Array.isArray(t)?t:[t]).forEach(s=>{if(s instanceof R)super.addShape(s);else{const n=R.fromShape(s,{...e});n&&super.addShape(n)}})}static fromShape(t,e){const s=new ve;return s.addShape(t,e),s}strokeDashToTween(t){const e=t?.type||"parallel",s=this.shapes.map(n=>n.strokeDashToTween({...t}).tween);switch(e){case"sequence":return s.forEach((n,r)=>{r>0&&s[r-1].chain(n)}),{startAuto:xe.toTweenGroup(s[0],t)};case"parallel":default:return{startAuto:xe.toTweenGroup(s,t)}}}sortPathD(){this.shapes=this.shapes.map(t=>({path:t,perimeter:t.perimeterPoints()})).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.path)}fillPathDGroup(t){const e=t.shapes.length,s=this.shapes.length;if(e<s)return t.fillPathDGroup(this);for(let n=s;n<e;n++){const r=t.shapes[n].polymorphPoints,a=r[0],o=r[1],h=new R({x:a,y:o,attrs:{...t.shapes[n].attrs}});for(let c=2;c+5<r.length;c+=6)h.appendLine(new Tt({c1x:a,c1y:o,c2x:a,c2y:o,x:a,y:o}));this.addShape(h)}}static polymorph(t){if(!t.length)throw new Error("groups 为空!");let e=-1,s=0;t.forEach((o,h)=>{o.sortPathD(),s<o.shapes.length&&(s=o.shapes.length,e=h)}),t.forEach(o=>o.fillPathDGroup(t[e]));const n=[];t.forEach((o,h)=>{o.shapes.forEach((c,l)=>{n[l]=n[l]||[],n[l][h]=c})});const r=[];n.forEach(o=>r.push(R.polymorph(o)));const a=new ve;return r.forEach(o=>{a.addShape(o(0))}),o=>(r.forEach(h=>{h(o)}),a)}}class Yr extends H{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}getBoundingClientRect(){return new Q({x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2})}toSVGPathData(){return[["M",this.x,this.y],["m",0,-this.ry],["a",this.rx,this.ry,0,1,1,0,2*this.ry],["a",this.rx,this.ry,0,1,1,0,-2*this.ry],["z"]]}toCanvasContext(t){t.beginPath(),t.ellipse(0,0,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class Ui extends H{points;constructor(t=[]){if(!t.length)throw new Error("points can't be null");super(t[0]),this.points=t}toSVGPathData(){const t=this.points.length;if(t<3)throw new Error("points length must >= 3");const e=[];e.push(["M",this.points[0].x,this.points[0].y]);for(let s=0;s<=t-1;s++)e.push(["L",this.points[s].x,this.points[s].y]);return e.push(["L",this.points[0].x,this.points[0].y]),e}toCanvasContext(t){const e=this.points.length;if(e<3)throw new Error("points length must >= 3");t.beginPath(),t.moveTo(0,0);for(let s=0;s<=e-1;s++)t.lineTo(this.points[s].x-this.points[0].x,this.points[s].y-this.points[0].y);t.lineTo(0,0)}get length(){return this.points.length}addPoint(t){this.points.push(t)}getPoint(t){return this.points[t]}isContainPoint(t,e){const s=this.length;let n=!1;const r=2e-10;for(let a=0,o=s-1;a<s;o=a,a++){const h=this.points[a].x,c=this.points[a].y,l=this.points[o].x,u=this.points[o].y;if(h===t&&c===e||l===t&&u===e||e===c&&e===u)return!0;if(e>=c&&e<u||e<c&&e>=u){const g=(l-h)/(u-c),y=h+g*(e-c);if(y===t||Math.abs(y-t)<r)return!0;y>t&&(n=!n)}}return n}[Symbol.iterator](){let t=0;return{next:()=>({value:t>=this.length-1?this.points[++t]:void 0,done:t>=this.length})}}static generatePoints(t,e,s,n){const r=[];for(let a=0;a<n;a++){const o=a/n*2*Math.PI,{dx:h,dy:c}=Pt(o,s);r.push(new ut({x:t+h,y:e+c}))}return new Ui(r)}}class bl extends H{x;y;z;brightness;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.brightness=this.setBrightness(t?.brightness||1)}setBrightness(t){return this.brightness=lt(t,0,1),this.brightness}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){}}const vl=bl;class Sl extends H{points;light;constructor(t=[]){if(t.length<3)throw new Error("points length must >= 3");super(t[0]),this.points=t,this.light=new vl({x:0,y:0,z:0,brightness:1})}toSVGPathData(){const t=[];t.push(["M",this.points[0].getScreenX(),this.points[0].getScreenY()]);for(let e=0,s=this.points.length;e<=s-1;e++)t.push(["L",this.points[e].getScreenX(),this.points[e].getScreenY()]);return t.push(["L",this.points[0].getScreenX(),this.points[0].getScreenY()]),t}toCanvasContext(t){t.beginPath(),t.moveTo(0,0);for(let e=0,s=this.points.length;e<=s-1;e++)t.lineTo(this.points[e].getScreenX()-this.points[0].getScreenX(),this.points[e].getScreenY()-this.points[0].getScreenY());t.lineTo(0,0)}get length(){return this.points.length}getDepth(){return Math.min(...this.points.map(t=>t.z))}isBackface(){const t=this.points[2].getScreenX()-this.points[0].getScreenX(),e=this.points[2].getScreenY()-this.points[0].getScreenY(),s=this.points[1].getScreenX()-this.points[2].getScreenX(),n=this.points[1].getScreenY()-this.points[2].getScreenY();return t*n>e*s}getLightFactor(){const t={x:this.points[0].x-this.points[1].x,y:this.points[0].y-this.points[1].y,z:this.points[0].z-this.points[1].z},e={x:this.points[1].x-this.points[2].x,y:this.points[1].y-this.points[2].y,z:this.points[1].z-this.points[2].z},s={x:t.y*e.z-t.z*e.y,y:-(t.x*e.z-t.z*e.x),z:t.x*e.y-t.y*e.x},n=s.x*this.light.x+s.y*this.light.y+s.z*this.light.z,r=Math.sqrt(s.x*s.x+s.y*s.y+s.z*s.z),a=Math.sqrt(this.light.x*this.light.x+this.light.y*this.light.y+this.light.z*this.light.z);return Math.acos(n/(r*a))/Math.PI*this.light.brightness}getAdjustedColor(t){const e=Dt(t),s=this.getLightFactor();return e.r*=s,e.g*=s,e.b*=s,ue(e)}}class Ye extends H{text;width=0;height=0;constructor(t){super(t),this.text=t.text,this.setAttr({fontSize:"10px",fontFamily:'system-ui, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',emojiFontFamily:'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif',fill:"#666666",stroke:"none","alignment-baseline":"middle",textAnchor:"start",...this.attrs});const e=un(this.getAttr("fontSize"),10).number,s=un(this.getAttr("fontWeight"),400).number,n=D.measureText(this.text,e,s);this.width=n.width,this.height=n.height,this.frameUpdate()}frameUpdate(){super.frameUpdate()}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){t.fillText(this.text,0,0)}}class Cl extends H{constructor(t){super(t)}toSVGPathData(){return[["M",this.x,this.y],["m",-50,-25],["l",50,0],["l",0,-25],["l",50,50],["l",-50,50],["l",0,-25],["l",-50,0],["l",0,-50],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(-50,-25),t.lineTo(0,-25),t.lineTo(0,-50),t.lineTo(50,0),t.lineTo(0,50),t.lineTo(0,25),t.lineTo(-50,25),t.lineTo(-50,-25),t.closePath()}}class Tl extends H{constructor(t){super(t)}toSVGPathData(){return[["M",this.x,this.y],["m",4,24],["l",4,-8],["l",6,-6],["l",1,-10],["l",-6,-10],["l",-7,10],["l",-4,0],["l",-7,-10],["l",-6,10],["l",1,10],["l",6,6],["l",4,8],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(4,24),t.lineTo(8,16),t.lineTo(14,10),t.lineTo(15,0),t.lineTo(9,-10),t.lineTo(2,0),t.lineTo(-2,0),t.lineTo(-9,-10),t.lineTo(-15,0),t.lineTo(-14,10),t.lineTo(-8,16),t.lineTo(-4,24),t.closePath()}}class El extends R{constructor(t){super(t),this.rx=t?.rx??10,this.ry=t?.ry??10,this.updateFromSVGPathData([["M",this.x,this.y],["l",this.rx*2.4,-this.ry*3.14],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,-this.ry*1.5],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,this.ry*1.5],["l",this.rx*2.4,this.ry*3.14],["z"]])}}class Pl extends R{constructor(t){super(t),this.rx=t?.rx??50,this.ry=t?.ry??50,this.updateFromSVGPathData([["M",this.x,this.y+this.ry*.3],["C",this.x,this.y,this.x-this.rx/2,this.y,this.x-this.rx/2,this.y+this.ry*.3],["C",this.x-this.rx/2,this.y+(this.ry+this.ry*.3)/2,this.x,this.y+(this.ry+this.ry*.3)/1.4,this.x,this.y+this.ry],["C",this.x,this.y+(this.ry+this.ry*.3)/1.8,this.x+this.rx/2,this.y+(this.ry+this.ry*.3)/2,this.x+this.rx/2,this.y+this.ry*.3],["C",this.x+this.rx/2,this.y,this.x,this.y,this.x,this.y+this.ry*.3],["z"]])}}class qr extends R{constructor(t){super(t),this.r=t?.r??20;let e="M"+this.x+","+(this.y-this.r);for(let s=0;s<6;s+=1){const n=270+s*144,r=this.x+this.r*Math.cos(N(n)),a=this.y+this.r*Math.sin(N(n));e+="L"+r+","+a}this.updateFromSVGPathD(e)}}class Al extends R{constructor(t){super(t),this.updateFromSVGPathData([["M",this.x,this.y],["C",this.x+15,this.y,this.x+15,this.y-40,this.x+5,this.y+-30],["L",this.x,this.y],["C",this.x-15,this.y,this.x-15,this.y-40,this.x-5,this.y-30],["L",this.x,this.y],["a",15,15,0,1,1,0,2*15],["a",15,15,0,1,1,0,-2*15]])}}class Dl extends R{constructor(t){super(t),this.updateFromSVGPathD(`M${this.x} ${this.y}m5.068 9.267-3.08-.77a.512.512 0 0 1 0-.994l3.08-.77a2.289 2.289 0 0 0 1.665-1.665l.77-3.08a.512.512 0 0 1 .994 0l.77 3.08c.205.82.845 1.46 1.665 1.665l3.08.77a.512.512 0 0 1 0 .994l-3.08.77a2.29 2.29 0 0 0-1.665 1.665l-.77 3.08a.512.512 0 0 1-.994 0l-.77-3.08a2.289 2.289 0 0 0-1.665-1.665Z`)}}class kl extends ve{constructor(t){super(t),this.addShape(R.fromSVGPathData([["M",this.x,this.y],["L",this.x,this.y-140-Math.random()*20]],{renderGroup:this.renderGroup,...t})),this.addShape(R.fromSVGPathData([["M",this.x,this.y-30-Math.random()*30],["L",this.x+Math.random()*80-40,this.y-100-Math.random()*40]],{renderGroup:this.renderGroup,...t})),this.addShape(R.fromSVGPathData([["M",this.x,this.y-60-Math.random()*40],["L",this.x+Math.random()*60-30,this.y-110-Math.random()*20]],{renderGroup:this.renderGroup,...t}))}}class Hr extends gt{width=0;height=0;bg;padding;offset;constructor(t){super(t),this.text=t.text,this.bg=t.bg||"rgba(0,0,0,0.5)",this.padding=t.padding||4,this.offset=t.offset||20,this.textShape=new Ye({...t,x:this.x+this.offset,y:this.y+this.offset,text:this.text,attrs:{...this.attrs,fill:Bn(this.bg,!0),textAnchor:"start"}}),this.bgShape=new Q({...t,x:this.textShape.x-this.padding,y:this.textShape.y-this.textShape.height/2-this.padding,width:this.textShape.width+this.padding*2,height:this.textShape.height+this.padding*2,attrs:{...this.attrs,fill:this.bg}}),this.addShape([this.bgShape,this.textShape])}frameUpdate(){super.frameUpdate(),this.textShape.x=this.x+this.offset,this.textShape.y=this.y+this.offset,this.textShape.isShow=this.isShow,this.bgShape.x=this.textShape.x-this.padding,this.bgShape.y=this.textShape.y-this.textShape.height/2-this.padding,this.bgShape.isShow=this.isShow}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){}}class Ml extends gt{radius;expandRaidus;startDegree;endDegree;text="";defaultShowText;tip="";p1=new ut;p1Offset=10;p2=new ut;p2Offset=40;p3=new ut;p3Offset=10;p4=new ut;p4Offset=10;direction=1;constructor(t){super(t),this.radius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.text=t.text||"",this.defaultShowText=typeof t?.defaultShowText=="boolean"?t.defaultShowText:!!this.text,this.tip=t.tip||"";const e=Object.assign({...this.attrs},{fill:"none"});this.line12=new wt({fromX:this.p1.x,fromY:this.p1.y,x:this.p2.x,y:this.p2.y,attrs:{...e},isShow:this.defaultShowText}),this.line23=new wt({fromX:this.p2.x,fromY:this.p2.y,x:this.p3.x,y:this.p3.y,attrs:{...e},isShow:this.defaultShowText}),this.textShape=new Ye({x:this.p4.x,y:this.p4.y,text:this.text,attrs:{stroke:e.stroke,textAnchor:this.direction==1?"start":"end"},isShow:this.defaultShowText}),this.tipShape=new Hr({x:0,y:0,text:this.tip,isShow:!1}),this.sector=new Wr({x:this.x,y:this.y,radius:this.radius,expandRaidus:this.expandRaidus,startDegree:this.startDegree,endDegree:this.endDegree,attrs:Object.assign({...this.attrs},{strokeWidth:"0"})}),this.addShape(this.sector),this.text&&(this.addShape(this.line12),this.addShape(this.line23),this.addShape(this.textShape)),this.tip&&this.addShape(this.tipShape),this.frameUpdate()}frameUpdate(){this.text&&!this.defaultShowText&&(this.line12.isShow=this.sector.isMouseIn,this.line23.isShow=this.sector.isMouseIn,this.textShape.isShow=this.sector.isMouseIn);const t=this.startDegree+(this.endDegree-this.startDegree)/2,{dx:e,dy:s}=Pt(N(t),this.sector.radius+this.p1Offset);this.p1.x=this.x+e,this.p1.y=this.y+s;const{dx:n,dy:r}=Pt(N(t),this.sector.radius+this.p1Offset+this.p2Offset);this.p2.x=this.x+n,this.p2.y=this.y+r,this.line12.fromX=this.p1.x,this.line12.fromY=this.p1.y,this.line12.x=this.p2.x,this.line12.y=this.p2.y,this.direction=this.p1.x>this.x?1:-1,this.p3.x=this.p2.x+this.direction*this.p3Offset,this.p3.y=this.p2.y,this.p4.x=this.p3.x+this.direction*this.p4Offset,this.p4.y=this.p3.y,this.line23.fromX=this.p2.x,this.line23.fromY=this.p2.y,this.line23.x=this.p3.x,this.line23.y=this.p3.y,this.textShape.x=this.p4.x,this.textShape.y=this.p4.y,this.textShape.setAttr("textAnchor",this.direction==1?"start":"end"),this.sector.isMouseIn?(this.tipShape.isShow=!0,this.tipShape.x=this.sector.mouseX,this.tipShape.y=this.sector.mouseY):(this.tipShape.isShow=!1,this.tipShape.x=this.sector.mouseX,this.tipShape.y=this.sector.mouseY)}}class Wr extends H{radius;realRadius;expandRaidus;startDegree;endDegree;vr;ar;bounce;dur;status;constructor(t){super(t),this.radius=0,this.realRadius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.vr=0,this.ar=.03,this.bounce=.6,this.dur=1e3/120,this.status=0}frameUpdate(){this.status==0&&this.radius<this.realRadius?(this.expand(this.realRadius),this.radius>=this.realRadius&&(this.status=1)):this.isMouseIn?this.expand(this.realRadius+this.expandRaidus):this.shrink(this.realRadius)}expand(t){this.vr+=this.ar,this.radius+=this.vr*this.dur,this.radius>t&&(this.radius=t,this.vr*=-this.bounce)}shrink(t){this.vr-=this.ar,this.radius+=this.vr*this.dur,this.radius<t&&(this.radius=t,this.vr*=-this.bounce)}toSVGPathData(){const{dx:t,dy:e}=Pt(N(this.startDegree),this.radius),{dx:s,dy:n}=Pt(N(this.endDegree),this.radius);return[["M",this.x,this.y],["l",t,e],["A",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,this.x+s,this.y+n],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.arc(0,0,this.radius,N(this.startDegree),N(this.endDegree),!1),t.closePath()}containPoint(t,e){const s=cs(this.x,this.y,t,e),n=et(Xt(this.x,this.y,t,e));return s<this.radius&&n>this.startDegree&&n<this.endDegree}}class _l extends gt{showFlame;constructor(t){super(t),this.showFlame=typeof t?.showFlame=="boolean"?t.showFlame:!1,this.ship=R.fromSVGPathData([["M",this.x+10,this.y],["L",this.x-10,this.y+10],["L",this.x-5,this.y],["L",this.x-10,this.y-10],["L",this.x+10,this.y],["Z"]],{renderGroup:this.renderGroup,...t}),this.flame=R.fromSVGPathData([["M",this.x-7.5,this.y-5],["L",this.x-15,this.y],["L",this.x-7.5,this.y+5],["Z"]],{renderGroup:this.renderGroup,...t,isShow:this.showFlame}),this.addShape(this.ship),this.addShape(this.flame),this.frameUpdate()}frameUpdate(){this.flame.isShow=this.showFlame}}class Il extends gt{min;max;step;value;percent;barWidth;barHeight;barColor;handleSize;handleColor;realBarWidth;constructor(t){super(t),this.min=t?.min||0,this.max=t?.max||100,this.step=t?.step||1,this.stepNumber=Na(this.min,this.max,this.step),this.value=this.stepNumber(t?.defaultValue||this.min),this.percent=this.value/(this.max-this.min),this.barColor=t?.barColor||oi.colorGrayF5,this.handleColor=t?.handleColor||oi.colorPrimary,this.barWidth=t?.barWidth||100,this.barHeight=t?.barHeight||4,this.handleSize=t?.handleSize||20,this.realBarWidth=this.barWidth-this.handleSize,this.fullRect=new Q({x:this.x,y:this.y-this.barHeight*.5,width:this.handleSize*.5+this.realBarWidth*this.percent,height:this.barHeight,borderRadius:this.barHeight*.5,attrs:{fill:this.handleColor}}),this.addShape(this.fullRect),this.emptyRect=new Q({x:this.x+this.handleSize*.5+this.realBarWidth*this.percent,y:this.y-this.barHeight*.5,width:this.handleSize*.5+this.realBarWidth*(1-this.percent),height:this.barHeight,borderRadius:this.barHeight*.5,attrs:{fill:this.barColor}}),this.addShape(this.emptyRect),this.alongPath=R.fromSVGPathData([["M",this.x+this.handleSize*.5,this.y],["l",this.realBarWidth,0]]),this.handle=new ut({x:this.x+this.handleSize*.5+this.realBarWidth*this.percent,y:this.y,radius:this.handleSize*.5,enableDrag:!0,autoRender:t?.autoRender,alongPath:this.alongPath,attrs:{fill:this.handleColor}}),this.addShape(this.handle),this.frameUpdate()}frameUpdate(){const t=this.handle.x-this.x-this.handleSize*.5;this.realBarWidth=this.barWidth-this.handleSize,this.percent=t/this.realBarWidth,this.fullRect.width=t+this.handleSize*.5,this.emptyRect.x=this.handle.x,this.emptyRect.width=this.barWidth-this.fullRect.width;const e=this.stepNumber(this.percent*(this.max-this.min)+this.min);e!=this.value&&(this.value=e,this.emit("change",this.value))}}class Ol extends ve{constructor(t){super(t),this.width=t.width,this.height=t.height,this.cornerRadius=this.height/2,this.addShape([R.fromShape(new Q({...t,x:this.x-this.cornerRadius,y:this.y-this.cornerRadius,width:this.width+this.cornerRadius*2,height:this.height,borderRadius:this.cornerRadius}),{renderGroup:this.renderGroup,...t}),R.fromShape(new ut({...t,x:this.x,y:this.y,radius:2}),{renderGroup:this.renderGroup,...t}),R.fromShape(new ut({...t,x:this.x+this.width,y:this.y,radius:2}),{renderGroup:this.renderGroup,...t})])}frameUpdate(){super.frameUpdate()}getPin(){return{x:this.x+Math.cos(N(this.degree))*this.width,y:this.y+Math.sin(N(this.degree))*this.width}}}class Rl extends H{constructor(t){super(t),this.update(t)}update(t){this.x=t.x,this.y=t.y,this.radius=t.radius,this.startDegree=t.startDegree+180,this.endDegree=t.endDegree+180,this.setAttr({"stroke-linecap":"round","stroke-width":String(t.lineWidth),stroke:t.colorGradient||t.color||"none"})}frameUpdate(){}toSVGPathData(){const{dx:t,dy:e}=Pt(N(this.startDegree),this.radius),{dx:s,dy:n}=Pt(N(this.endDegree),this.radius);return[["M",this.x+t,this.y+e],["A",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,this.x+s,this.y+n]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,N(this.startDegree),N(this.endDegree),!1)}}class Ll extends gt{fettis=[];constructor(t,e,s){super();const{shape:n,x:r,y:a,particleCount:o,angle:h,spread:c,startVelocity:l,decay:u,gravity:g,drift:y,ticks:m,colors:x,scalar:b,flat:S}=Hs(s||{},{shape:qr,x:.5,y:.6,particleCount:100,angle:90,spread:70,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,colors:Fn,scalar:1,flat:!1}),C=t*r,M=e*a,O=N(h),F=N(c);let L=o;for(;L--;){const V=new n({x:C,y:M,transformBaseOnSelfInRenderGroup:!0,scaleOnOrigin:b,attrs:{fill:x[L%x.length]}});this.addShape(V),this.fettis.push({shape:V,x:C,y:M,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:l*.5+Math.random()*l,angle2D:-O+(.5*F-Math.random()*F),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,tick:0,totalTicks:m,decay:u,drift:y,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:g*3,scalar:b,flat:S})}}frameUpdate(){super.frameUpdate(),this.fettis.length&&(this.fettis=this.fettis.filter(t=>this.updateFetti(t)))}updateFetti(t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.shape.x=t.x,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.shape.y=t.y,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);const e=t.tick++/t.totalTicks,s=t.x+t.random*t.tiltCos,n=t.y+t.random*t.tiltSin,r=t.wobbleX+t.random*t.tiltCos,a=t.wobbleY+t.random*t.tiltSin;return t.shape.setAttr("fill",ci(t.shape.getAttr("fill"),1-e)),t.shape.scalexOnOrigin=Math.abs(r-s)*.1*t.shape.prevScalexOnOrigin,t.shape.scaleyOnOrigin=Math.abs(a-n)*.1*t.shape.prevScalexOnOrigin,t.shape.degree=et(Math.PI/10*t.wobble),t.shape.x=t.x,t.shape.y=t.y,t.tick<t.totalTicks}}const Os=new Map,$r={transform:function(i){if(An)return i;if(Os.has(i))return Os.get(i);const t=new OffscreenCanvas(i.width,i.height);return t.getContext("2d")?.drawImage(i,0,0),Os.set(i,t),t},clear:function(){Os.clear()}};function Nl(i,t,e){const s=new OffscreenCanvas(i,t),n=s.getContext("2d");if(n)return e(n),s.transferToImageBitmap()}function Fl(i,t,e){const s=i.createPattern($r.transform(t),"no-repeat");if(s){const n=ri(e);s.setTransform(n),i.fillStyle=s}}let Rs;class Jr{subscribers;constructor(){this.subscribers=new Set}depend(){Rs&&this.subscribers.add(Rs)}notify(){this.subscribers.forEach(t=>t())}}const Zr=new WeakMap;function Vi(i,t){let e=Zr.get(i);e||(e=new Map,Zr.set(i,e));let s=e.get(t);return s||(s=new Jr,e.set(t,s)),s}function Bl(i){Rs=i,i(),Rs=null}function Gl(i){return Object.keys(i).forEach(t=>{let e=i[t];const s=Vi(i,t);Object.defineProperty(i,t,{get(){return s.depend(),e},set(n){n!=e&&(e=n,s.notify())}})}),i}function Kr(i){return new Proxy(i,{get(t,e,s){return Vi(i,e).depend(),Reflect.get(t,e,s)},set(t,e,s,n){const r=Vi(i,e);return i[e]!=s&&(i[e]=s,r.notify()),Reflect.set(t,e,s,n)}})}const Ul=Kr;class Vl{app;ctx;shapes=[];isMouseDown=!1;currentMouseInShapeID="";currentEnableDragMouseInShapeID="";constructor(t,e=!1){if(this.app=t,!(this.app.container instanceof HTMLCanvasElement))throw new Error("app.container 应该为 HTMLCanvasElement!");this.ctx=new _s(this.app.container,this.app.width,this.app.height,e),this.app.captureMove({start:()=>{this.isMouseDown=!0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.setCursor()},move:()=>{if(this.isMouseDown&&this.currentEnableDragMouseInShapeID){this.setCursor();return}this.currentMouseInShapeID="";const s=this.shapes.length;let n=0;for(;n<s;n++){const r=this.shapes[n];this.ctx.save(),this.transformCtxBaseOnShape(r);const a=this.ctx.isPointInPath(r.path2d,this.app.mousePoint.x,this.app.mousePoint.y)||this.ctx.isPointInStroke(r.path2d,this.app.mousePoint.x,this.app.mousePoint.y)||!1;if(this.ctx.restore(),r.isMouseIn=a,r.mouseX=this.app.mousePoint.x,r.mouseY=this.app.mousePoint.y,a&&(this.currentMouseInShapeID=r.id,r.enableDrag)){this.currentEnableDragMouseInShapeID=r.id,this.shapes.filter(o=>o.id!==r.id).forEach(o=>{o instanceof H&&(o.isMouseIn=!1,o.mouseX=this.app.mousePoint.x,o.mouseY=this.app.mousePoint.y)});break}}n>=s&&(this.currentEnableDragMouseInShapeID=""),this.setCursor()}})}setCursor(){this.currentEnableDragMouseInShapeID?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShapeID?this.app.container.style.cursor="default":this.app.container.style.cursor="default"}transformCtxBaseOnShape(t){t instanceof R||(t instanceof wt||this.ctx.translate(t.x,t.y),this.ctx.rotate(N(t.degree),t.cX,t.cY),this.ctx.scale(t.scalexOnOrigin,t.scaleyOnOrigin,t.cX,t.cY))}_addShape(t){t instanceof gt?(t.frameUpdate(),t.shapes.forEach(e=>{e instanceof gt?this._addShape(e):this.shapes.push(e)})):this.shapes.push(t)}draw(t=[]){this.shapes=[],(Array.isArray(t)?t:[t]).forEach(e=>{this._addShape(e)});for(let e of this.shapes)if(e.isShow){if(this.ctx.save(),D.attrsToCanvas(this.ctx,e.attrs),e.followMouse&&(!Pe(e.x,this.app.mousePoint.x,5)||!Pe(e.y,this.app.mousePoint.y,5))&&(e.rotateTo(this.app.mousePoint),e.followTo(this.app.mousePoint)),e.targetToAfterDragFree&&(this.isMouseDown||e.nextFrameEaseTo({x:e.targetToAfterDragFree.targetX,y:e.targetToAfterDragFree.targetY},{easing:e.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShapeID==e.id){const{dx:s,dy:n}=e.centerDiff,r=e.x,a=e.y;if(e.x=this.app.mousePoint.x-s,e.y=this.app.mousePoint.y-n,e.alongPath){const o=e.alongPath.closestPoint(e.x,e.y);e.x=o.point.x,e.y=o.point.y}e.isDragging=!0,e.emit("moving",e.x-r,e.y-a)}else e.isDragging=!1;e.frameUpdate(),this.transformCtxBaseOnShape(e),e.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill(),e.path2d=this.ctx.currentPath2D,this.ctx.restore()}return this}click(t){const e=()=>{this.shapes.forEach(s=>{(s instanceof R&&(s.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.ctx)||s.isPointInStroke(this.app.mousePoint.x,this.app.mousePoint.y,this.ctx))||this.currentMouseInShapeID==s.id)&&t(s)})};return this.app.on("tap",e),()=>{this.app.off("tap",e)}}drawMouseMoveLine(t="line",e){switch(t){case"brush":const s=e?.brushSize??10,n=e?.brushDensity??50,r=e?.brushColor??"#000000",a=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),o=a.data,h=Dt(r);return this.app.captureMove({move:()=>{if(this.isMouseDown){for(let c=0;c<n;c++){const l=Math.random()*Math.PI*2,u=Math.random()*s,g=this.app.mousePoint.x+Math.cos(l)*u|0,y=this.app.mousePoint.y+Math.sin(l)*u|0,m=(g+y*a.width)*4;o[m]=h.r,o[m+1]=h.g,o[m+2]=h.b,o[m+3]=255}this.ctx.putImageData(a)}}});case"line":default:return this.app.captureMove({start:c=>{this.ctx.beginPath(),this.app.setMousePoint(c),this.ctx.moveTo(this.app.mousePoint.x,this.app.mousePoint.y)},end:()=>{this.ctx.closePath()},move:()=>{this.isMouseDown&&(this.ctx.lineTo(this.app.mousePoint.x,this.app.mousePoint.y),this.ctx.stroke())}})}}}class zl{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new _e(t),this.remoteVideoUtil=new _e(e)}start(){this.getLocalMediaStream().then(t=>{this.call(t)})}end(){this.localPeerConnection?.close(),this.remotePeerConnection?.close(),this.localPeerConnection=null,this.remotePeerConnection=null,this.trace("Ending call.")}getLocalMediaStream(){return new Promise((t,e)=>{navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then(s=>{this.localVideoUtil.setSrcObject(s),t(s)}).catch(s=>{this.trace(`navigator.getUserMedia error: ${s}.`),e(s)})})}gotRemoteMediaStream(t){const e=t.streams[0];this.remoteVideoUtil.setSrcObject(e),this.trace("Remote peer connection received remote stream.")}call(t){const e=t.getVideoTracks(),s=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),s.length>0&&this.trace(`Using audio device: ${s[0].label}.`);const n=void 0,r=new RTCPeerConnection(n);this.localPeerConnection=r,this.trace("Created local peer connection object localPeerConnection."),r.addEventListener("icecandidate",this.handleConnection),r.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const a=new RTCPeerConnection(n);this.remotePeerConnection=a,this.trace("Created remote peer connection object remotePeerConnection."),a.addEventListener("icecandidate",this.handleConnection),a.addEventListener("iceconnectionstatechange",this.handleConnectionChange),a.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),r.addTrack(e[0],t),r.addTrack(s[0],t),this.trace("localPeerConnection createOffer start."),r.createOffer({offerToReceiveVideo:!0}).then(o=>this.createdOffer(o)).catch(o=>this.setSessionDescriptionError(o))}handleConnection(t){const e=t.target,s=t.candidate;if(e&&s){const n=new RTCIceCandidate(s),r=this.getOtherPeer(e);r&&(r.addIceCandidate(n).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
|
|
42
42
|
${t.candidate.candidate}.`))}}handleConnectionSuccess(t){this.trace(`${this.getPeerName(t)} addIceCandidate success.`)}handleConnectionFailure(t,e){this.trace(`${this.getPeerName(t)} failed to add ICE Candidate:
|
|
43
43
|
${e.toString()}.`)}handleConnectionChange(t){const e=t.target;console.log("ICE state change event: ",t),e&&this.trace(`${this.getPeerName(e)} ICE state: ${e.iceConnectionState}.`)}createdOffer(t){this.trace(`Offer from localPeerConnection:
|
|
44
44
|
${t.sdp}`),this.localPeerConnection&&(this.trace("localPeerConnection setLocalDescription start."),this.localPeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.remotePeerConnection&&(this.trace("remotePeerConnection setRemoteDescription start."),this.remotePeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e)),this.trace("remotePeerConnection createAnswer start."),this.remotePeerConnection.createAnswer().then(e=>this.createdAnswer(e)).catch(e=>this.setSessionDescriptionError(e)))}createdAnswer(t){this.trace(`Answer from remotePeerConnection:
|
|
45
|
-
${t.sdp}.`),this.remotePeerConnection&&(this.trace("remotePeerConnection setLocalDescription start."),this.remotePeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.localPeerConnection&&(this.trace("localPeerConnection setRemoteDescription start."),this.localPeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e)))}setSessionDescriptionError(t){this.trace(`Failed to create session description: ${t.toString()}.`)}setDescriptionSuccess(t,e){const s=this.getPeerName(t);this.trace(`${s} ${e} complete.`)}setLocalDescriptionSuccess(t){this.setDescriptionSuccess(t,"setLocalDescription")}setRemoteDescriptionSuccess(t){this.setDescriptionSuccess(t,"setRemoteDescription")}trace(t){t=t.trim();const e=(window.performance.now()/1e3).toFixed(3);console.log(e,t);const s=document.createElement("div");s.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(s)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class nl{canvas;gl;constructor(t){this.canvas=t;const e={alpha:!0,premultipliedAlpha:!1};if(this.gl=this.canvas.getContext("webgl",e),!this.gl)throw new Error("WebGL failed to initialize.")}}function Pr(n,t){return!n||n.parentElement===null?t:Pr(n.parentElement,t.concat([n]))}const xn=function(n,t){return getComputedStyle(n,null).getPropertyValue(t)},il=function(n){return xn(n,"overflow")+xn(n,"overflow-y")+xn(n,"overflow-x")},rl=function(n){return/(auto|scroll)/.test(il(n))};function al(n){if(!(n instanceof HTMLElement||n instanceof SVGElement))return;const t=Pr(n.parentElement,[]);for(let e=0;e<t.length;e+=1)if(rl(t[e]))return t[e];return document.scrollingElement||document.documentElement}const Ar=[],_r={};function Sn(n){Ar.push(n)}function ol(n,t=!1){const e=vi();if(_r[e])return;wx.error(r=>{console.log(r.errMsg??JSON.stringify(r))}),wx.ready(()=>{Ar.forEach(r=>r())});const s=["updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","openProductSpecificView","addCard","chooseCard","openCard"],i=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(n,{debug:t,jsApiList:s,openTagList:i})),_r[e]=!0}function cl(n){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[n],success:function(s){s.checkResult[n]?t(!0):e(!1)},fail:function(){e(!1)}})})}function hl(n){Sn(function(){wx.updateAppMessageShareData(n)})}function ll(n){Sn(function(){wx.updateTimelineShareData(n)})}function ul(n){wx.chooseImage(n)}function fl(n){wx.previewImage(n)}function dl(n){wx.uploadImage(n)}function ml(n){wx.downloadImage(n)}function pl(n){wx.getLocalImgData(n)}function gl(){wx.startRecord()}function yl(n){wx.stopRecord(n)}function wl(n){wx.onVoiceRecordEnd(n)}function vl(n){wx.playVoice(n)}function bl(n){wx.pauseVoice(n)}function xl(n){wx.stopVoice(n)}function Sl(n){wx.onVoicePlayEnd(n)}function Cl(n){wx.uploadVoice(n)}function Tl(n){wx.downloadVoice(n)}function El(n){wx.translateVoice(n)}function Pl(n){wx.getNetworkType(n)}function Al(n){wx.openLocation(n)}function _l(n){wx.getLocation(n)}function Dl(n){wx.scanQRCode(n)}function kl(n,t,e){function s(){WeixinJSBridge.invoke("getBrandWCPayRequest",n,function(i){i.err_msg=="get_brand_wcpay_request:ok"?t():e(i.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",s,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",s),document.attachEvent("onWeixinJSBridgeReady",s)):s()}function Il(n){window.AlipayJSBridge?n&&n():document.addEventListener("AlipayJSBridgeReady",n,!1)}function Fe(n,t){let e="未知错误";switch(n.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${n.error}(${e}): ${n.errorMessage}`}function Ml(n,t,e){ap.tradePay(Object.assign(n,{}),function(s){let i="未知错误";switch(s.resultCode){case 9e3:return i="订单支付成功",t?.(i);case 8e3:i="正在处理中";break;case 4e3:i="订单支付失败";break;case 6001:i="用户中途取消";break;case 6002:i="网络连接出错";break;case 99:i="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(i)})}function Rl(n,t,e){ap.scan(Object.assign(n,{fail:s=>{e?.(Fe(s))}}),function(s){t?.(s.code)})}function Ol(n,t,e){ap.getLocation(Object.assign(n,{fail:s=>{e?.(Fe(s))}}),function(s){t?.(s)})}function Ll(n,t,e){ap.openLocation(Object.assign(n,{fail:s=>{e?.(Fe(s))}}),function(){t?.()})}function Nl(n,t,e){ap.chooseImage(Object.assign(n,{fail:s=>{e?.(Fe(s,"chooseImage"))}}),function(s){t?.(s)})}function Fl(n,t,e){ap.previewImage(Object.assign(n,{fail:s=>{e?.(Fe(s))}}),function(){t?.()})}class Bl{map;constructor(t,e=120.619585,s=31.299379,i=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,s),i)}}p.AnimateOperation=le,p.Arc=ue,p.Arrow=Hh,p.BEAUTIFUL_COLORS=to,p.Canvas=el,p.CanvasOperation=vs,p.Cross=Qh,p.CubicBezier=Tt,p.CustomCanvasContext=Le,p.CustomCanvasGradient=ws,p.CustomCanvasPattern=vn,p.DOMEventBus=xe,p.DOMKey=mi,p.DOMParse=pi,p.DOMSVGUtil=ne,p.DOMToBlob=qn,p.DOMToString=Fs,p.DOMUtil=A,p.DOMVideo=Se,p.Dep=wr,p.Ellipse=Tr,p.FetchWithAxios=Bc,p.FetchWithAxiosRequestCancel=or,p.Fox=Wh,p.Heart=$h,p.HeartVariant=Jh,p.Line=yt,p.Matrix=Z,p.Matrix3D=Jt,p.PathD=O,p.PathDGroup=Ne,p.Point=ut,p.Point3d=zh,p.Point3ds=qh,p.Points=bn,p.QRCode=Yt,p.QuadraticBezier=bs,p.Rabbit=Kh,p.Rect=Ct,p.SVG=Bh,p.SVGParse=Sr,p.SVGParsedPathArgsLength=be,p.Sector=Yh,p.SectorArc=Er,p.Shape=X,p.ShapeGroup=Zt,p.Star=Zh,p.TWEEN=Re,p.Text=xs,p.Tree=tl,p.Tween=pn,p.Vector=ps,p.WebGLRenderer=nl,p.WebRTCClient=sl,p.WebSocketClient=pa,p.addWatermark=bh,p.addWxJsReadyFnBeforeConfig=Sn,p.ajax=yo,p.aliJsChooseImage=Nl,p.aliJsGetLocation=Ol,p.aliJsOpenLocation=Ll,p.aliJsPreviewImage=Fl,p.aliJsReady=Il,p.aliJsScan=Rl,p.aliJsTradePay=Ml,p.angle=ye,p.animateInWeb=xr,p.appendURLSearchString=Si,p.base64EncodeOutputStream=ur,p.base64URLDecode=nr,p.base64URLEncode=sr,p.bitmapMapper=Ci,p.blobToRawImage=Yc,p.byteArrayOutputStream=un,p.canDrawBitmap=oi,p.canUsePaths=Va,p.canUseWorker=ai,p.canvasWorkerActions=po,p.changeBrightness=wh,p.changeDiaphaneity=vh,p.changeSize=yh,p.checkWxJsApi=cl,p.clearCookies=Ka,p.createXMLHttpRequest=Ti,p.decodeUseTextDecoder=ir,p.decryptInCommon=Lc,p.distance=Ze,p.drawQRCodeToCanvas=Eh,p.encodeUseTextEncoder=us,p.encryptInCommon=Oc,p.fileOrBlobToDataURL=hn,p.flipSideToSide=Wc,p.flipUpsideDown=$c,p.flushURLSearchString=fo,p.formDataToSearchString=xi,p.fromRadianAndLength=Gt,p.getBrowserClient=Vs,p.getBrowserClientVersion=Pa,p.getBrowserLanguage=_a,p.getColor=zt,p.getColorScheme=gi,p.getCookie=Ja,p.getCookieObject=Za,p.getDirection=ja,p.getElementLeftPositionInPage2=Zn,p.getElementPositionInPage=Jn,p.getElementPositionInPage2=ba,p.getElementPositionInViewport=xa,p.getElementTopPositionInPage2=Kn,p.getFileExtension=Hn,p.getFileString=go,p.getFileTypeFromFile=fa,p.getFilesImageInfo=Vc,p.getFormSubmitData=wo,p.getGlobal=Us,p.getHexColorString=Ce,p.getImageAspectRatio=Uc,p.getImageDataByAIData=Sh,p.getImageDataFromBitmap=zc,p.getImageDataFromUrl=cr,p.getImageDataFromVideo=Gc,p.getImageMainColor=Hc,p.getInternetExplorerVersion=si,p.getMousePositionInElement=ti,p.getMousePositionInPage=Qn,p.getMousePositionInViewport=Ta,p.getOperatingSystem=$e,p.getOperatingSystemVersion=Ea,p.getPageBodyElement=ya,p.getPageDocumentElement=se,p.getPageSize=va,p.getRGBColorString=eo,p.getRawImageInfo=ds,p.getRelativeBoundingClientRect=Sa,p.getScreenElement=ga,p.getScrollParent=al,p.getTimeZone=Da,p.getURL=ts,p.getUserGeolocationPromise=Aa,p.getVerticalScrollPercentInPage=Ca,p.getViewportSize=wa,p.getWorker=mo,p.gifImage=fr,p.gradientColor=Ys,p.h=ma,p.hasDocument=Fa,p.hasHistory=Ba,p.hasWindow=ri,p.hsb2rgb=ro,p.hsl2rgb=ao,p.hsv2rgb=io,p.imageDataToBitmap=jc,p.imageDataToBlob=qc,p.imageDataToDataURL=Xc,p.injectWxJsConfig=ol,p.isAliBrowser=ii,p.isAliMiniProgram=Na,p.isAndroid=ei,p.isAppleDevice=ka,p.isBrowserSupportFileAPI=Ua,p.isDarkMode=Ma,p.isIE=Ra,p.isIE9or10=Oa,p.isIOS=Gs,p.isMacOS=zs,p.isMobile=Ia,p.isURL=lo,p.isWxBrowser=ni,p.isWxMiniProgram=La,p.jpgToPng=dh,p.leftRotate=Jc,p.length=Je,p.linkExport=Bs,p.localstorage=qs,p.mapTDTJSSDK=Bl,p.marginSharpen=fh,p.microTask=da,p.mosaic=xh,p.mount=ge,p.normalizePoint=za,p.objectHash=ar,p.outputGifBase64=dr,p.outputQRCodeBase64=Th,p.pack=Mc,p.parseTransformToMatrix=js,p.parseURL=wi,p.patch=Wn,p.patchDOM=$n,p.pngToJpg=mh,p.radiusClip=gh,p.randomColorHexString=so,p.randomColorNumber=yi,p.reactive=_h,p.reactiveVue2=Ah,p.reactiveVue3=vr,p.readFileInBrowser=We,p.recordToSearchString=bi,p.rectClip=ph,p.rgb2hsb=co,p.rgb2hsl=ho,p.rgb2hsv=oo,p.rightRotate=Zc,p.rotatePoint=St,p.searchStringToRecord=uo,p.selectFileInBrowser=Yn,p.setColorScheme=Ke,p.setCookie=$a,p.setRem=Ga,p.shadeColor=no,p.sharpen=uh,p.signInCommon=Nc,p.singletonGlobalAnimateInWeb=he,p.stringHash=rr,p.stringToBlob=Ns,p.stringToDOM=ua,p.theme=Qa,p.toBlackAndWhite=th,p.toBlue=ih,p.toBlueAndGreen=oh,p.toBlueAndGrey=lh,p.toDegree=J,p.toGreen=nh,p.toGreenAndGrey=hh,p.toGrey=Kc,p.toGrey2=Qc,p.toOpposite=eh,p.toRadian=st,p.toRed=sh,p.toRedAndBlue=ah,p.toRedAndGreen=rh,p.toRedAndGrey=ch,p.trimURLHash=vi,p.unpack=Rc,p.verifyInCommon=Fc,p.watchEffect=Ph,p.wxJsChooseImage=ul,p.wxJsDownloadImage=ml,p.wxJsDownloadVoice=Tl,p.wxJsGetLocalImgData=pl,p.wxJsGetLocation=_l,p.wxJsGetNetworkType=Pl,p.wxJsOnVoicePlayEnd=Sl,p.wxJsOnVoiceRecordEnd=wl,p.wxJsOpenLocation=Al,p.wxJsPauseVoice=bl,p.wxJsPay=kl,p.wxJsPlayVoice=vl,p.wxJsPreviewImage=fl,p.wxJsScanQRCode=Dl,p.wxJsStartRecord=gl,p.wxJsStopRecord=yl,p.wxJsStopVoice=xl,p.wxJsTranslateVoice=El,p.wxJsUpdateAppMessageShareData=hl,p.wxJsUpdateTimelineShareData=ll,p.wxJsUploadImage=dl,p.wxJsUploadVoice=Cl,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
|
|
45
|
+
${t.sdp}.`),this.remotePeerConnection&&(this.trace("remotePeerConnection setLocalDescription start."),this.remotePeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.localPeerConnection&&(this.trace("localPeerConnection setRemoteDescription start."),this.localPeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e)))}setSessionDescriptionError(t){this.trace(`Failed to create session description: ${t.toString()}.`)}setDescriptionSuccess(t,e){const s=this.getPeerName(t);this.trace(`${s} ${e} complete.`)}setLocalDescriptionSuccess(t){this.setDescriptionSuccess(t,"setLocalDescription")}setRemoteDescriptionSuccess(t){this.setDescriptionSuccess(t,"setRemoteDescription")}trace(t){t=t.trim();const e=(window.performance.now()/1e3).toFixed(3);console.log(e,t);const s=document.createElement("div");s.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(s)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class jl{canvas;gl;constructor(t){this.canvas=t;const e={alpha:!0,premultipliedAlpha:!1};if(this.gl=this.canvas.getContext("webgl",e),!this.gl)throw new Error("WebGL failed to initialize.")}}function Qr(i,t){return!i||i.parentElement===null?t:Qr(i.parentElement,t.concat([i]))}const zi=function(i,t){return getComputedStyle(i,null).getPropertyValue(t)},Xl=function(i){return zi(i,"overflow")+zi(i,"overflow-y")+zi(i,"overflow-x")},Yl=function(i){return/(auto|scroll)/.test(Xl(i))};function ql(i){if(!(i instanceof HTMLElement||i instanceof SVGElement))return;const t=Qr(i.parentElement,[]);for(let e=0;e<t.length;e+=1)if(Yl(t[e]))return t[e];return document.scrollingElement||document.documentElement}const ta=[],ea={};function ji(i){ta.push(i)}function Hl(i,t=!1){const e=Vn();if(ea[e])return;wx.error(r=>{console.log(r.errMsg??JSON.stringify(r))}),wx.ready(()=>{ta.forEach(r=>r())});const s=["updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","openProductSpecificView","addCard","chooseCard","openCard"],n=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(i,{debug:t,jsApiList:s,openTagList:n})),ea[e]=!0}function Wl(i){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[i],success:function(s){s.checkResult[i]?t(!0):e(!1)},fail:function(){e(!1)}})})}function $l(i){ji(function(){wx.updateAppMessageShareData(i)})}function Jl(i){ji(function(){wx.updateTimelineShareData(i)})}function Zl(i){wx.chooseImage(i)}function Kl(i){wx.previewImage(i)}function Ql(i){wx.uploadImage(i)}function tu(i){wx.downloadImage(i)}function eu(i){wx.getLocalImgData(i)}function su(){wx.startRecord()}function iu(i){wx.stopRecord(i)}function nu(i){wx.onVoiceRecordEnd(i)}function ru(i){wx.playVoice(i)}function au(i){wx.pauseVoice(i)}function ou(i){wx.stopVoice(i)}function hu(i){wx.onVoicePlayEnd(i)}function cu(i){wx.uploadVoice(i)}function lu(i){wx.downloadVoice(i)}function uu(i){wx.translateVoice(i)}function fu(i){wx.getNetworkType(i)}function du(i){wx.openLocation(i)}function mu(i){wx.getLocation(i)}function pu(i){wx.scanQRCode(i)}function gu(i,t,e){function s(){WeixinJSBridge.invoke("getBrandWCPayRequest",i,function(n){n.err_msg=="get_brand_wcpay_request:ok"?t():e(n.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",s,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",s),document.attachEvent("onWeixinJSBridgeReady",s)):s()}function yu(i){window.AlipayJSBridge?i&&i():document.addEventListener("AlipayJSBridgeReady",i,!1)}function qe(i,t){let e="未知错误";switch(i.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${i.error}(${e}): ${i.errorMessage}`}function wu(i,t,e){ap.tradePay(Object.assign(i,{}),function(s){let n="未知错误";switch(s.resultCode){case 9e3:return n="订单支付成功",t?.(n);case 8e3:n="正在处理中";break;case 4e3:n="订单支付失败";break;case 6001:n="用户中途取消";break;case 6002:n="网络连接出错";break;case 99:n="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(n)})}function xu(i,t,e){ap.scan(Object.assign(i,{fail:s=>{e?.(qe(s))}}),function(s){t?.(s.code)})}function bu(i,t,e){ap.getLocation(Object.assign(i,{fail:s=>{e?.(qe(s))}}),function(s){t?.(s)})}function vu(i,t,e){ap.openLocation(Object.assign(i,{fail:s=>{e?.(qe(s))}}),function(){t?.()})}function Su(i,t,e){ap.chooseImage(Object.assign(i,{fail:s=>{e?.(qe(s,"chooseImage"))}}),function(s){t?.(s)})}function Cu(i,t,e){ap.previewImage(Object.assign(i,{fail:s=>{e?.(qe(s))}}),function(){t?.()})}class Tu{map;constructor(t,e=120.619585,s=31.299379,n=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,s),n)}}class Eu{currentPage;itemsPerPage;entriesInterval;entriesEdge;linkTo;prevText;nextText;ellipseText;prevShowAlways;nextShowAlways;callback;totalPages;parentVNode;constructor(t,e,s){this.currentPage=s?.currentPage||0,this.itemsPerPage=s?.itemsPerPage||10,this.entriesInterval=s?.entriesInterval||5,this.entriesEdge=s?.entriesEdge||1,this.linkTo=s?.linkTo||"javascript:;",this.prevText=s?.prevText||"上一页",this.nextText=s?.nextText||"下一页",this.ellipseText=s?.ellipseText||"...",this.prevShowAlways=typeof s?.prevShowAlways=="boolean"?s?.prevShowAlways:!0,this.nextShowAlways=typeof s?.nextShowAlways=="boolean"?s?.nextShowAlways:!0,this.callback=s?.callback||(n=>!1),this.totalPages=Math.ceil(e/this.itemsPerPage),this.parentVNode=this.createParentVNode(),oe(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return ae("div",{class:"pagination"},[])}appendVNode(t,e,s){e=e<0?0:e<this.totalPages?e:this.totalPages-1;const n=s?.text||String(e+1),r=s?.classes||"";t.children.push(e==this.currentPage&&r.indexOf("prev")==-1&&r.indexOf("next")==-1?ae("span",{class:`current ${r}`},n):ae("a",{class:r,href:this.linkTo.replace(/__id__/,String(e)),onClick:a=>this.selectPage(e,a)},n))}drawLinks(){const t=this.createParentVNode(),e=Math.ceil(this.entriesInterval/2),s=this.currentPage>e?Math.max(Math.min(this.currentPage-e,this.totalPages-this.entriesInterval),0):0,n=this.currentPage>e?Math.min(this.currentPage+e,this.totalPages):Math.min(this.entriesInterval,this.totalPages);if(this.prevText&&(this.currentPage>0||this.prevShowAlways)&&this.appendVNode(t,this.currentPage-1,{text:this.prevText,classes:"prev"}),s>0&&this.entriesEdge>0){const r=Math.min(this.entriesEdge,s);for(let a=0;a<r;a++)this.appendVNode(t,a);this.entriesEdge<s&&this.ellipseText&&t.children.push(ae("span",{},this.ellipseText))}for(let r=s;r<n;r++)this.appendVNode(t,r);if(n<this.totalPages&&this.entriesEdge>0){this.totalPages-this.entriesEdge>n&&this.ellipseText&&t.children.push(ae("span",{},this.ellipseText));const r=Math.max(this.totalPages-this.entriesEdge,n);for(let a=r;a<this.totalPages;a++)this.appendVNode(t,a)}this.nextText&&(this.currentPage<this.totalPages-1||this.nextShowAlways)&&this.appendVNode(t,this.currentPage+1,{text:this.nextText,classes:"next"}),Ks(this.parentVNode,t),this.parentVNode=t}selectPage(t,e){this.currentPage=t=t<0?0:t<this.totalPages?t:this.totalPages-1,this.drawLinks();const s=this.callback(t);return e&&(s||(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)),s}prevPage(){return this.selectPage(this.currentPage-1)}nextPage(){return this.selectPage(this.currentPage+1)}}p.Arc=be,p.Arrow=Cl,p.COLORS=Fn,p.ComboConfetti=Ll,p.Cross=Dl,p.CubicBezier=Tt,p.CustomCanvasContext=Xe,p.CustomCanvasGradient=Ms,p.CustomCanvasPattern=Gi,p.DOMEventBus=Me,p.DOMKey=Rn,p.DOMParse=Ln,p.DOMSVGUtil=ce,p.DOMToBlob=mn,p.DOMToString=Js,p.DOMUtil=D,p.DOMVideo=_e,p.Dep=Jr,p.Ellipse=Yr,p.FetchWithAxios=bc,p.FetchWithAxiosRequestCancel=Ir,p.Fox=Tl,p.Heart=El,p.HeartVariant=Pl,p.Line=wt,p.Matrix=st,p.Matrix3D=At,p.Pagination=Eu,p.PathD=R,p.PathDGroup=ve,p.Point=ut,p.Point3D=Qt,p.Point3Ds=Sl,p.Points=Ui,p.QRCode=Wt,p.QuadraticBezier=Is,p.Rabbit=Al,p.Rect=Q,p.RenderGroup=ii,p.Ring=Rl,p.SVGParse=jr,p.SVGParsedPathArgsLength=ke,p.Sector=Ml,p.SectorArc=Wr,p.Segment=Ol,p.Shape=H,p.ShapeGroup=gt,p.Ship=_l,p.Slider=Il,p.Star=qr,p.TWEEN=ze,p.Text=Ye,p.Tip=Hr,p.Tree=kl,p.Tween=Li,p.WebGLRenderer=jl,p.WebRTCClient=zl,p.WebSocketClient=ja,p.YZAnimate=xe,p.YZCancelIdleCallback=$o,p.YZCanvas=Vl,p.YZCanvasContext=_s,p.YZMessageChannel=Zo,p.YZRequestIdleCallback=Wn,p.YZSVG=gl,p.YZWorker=Jo,p.addWatermark=sl,p.addWxJsReadyFnBeforeConfig=ji,p.affine2D=To,p.affine3D=Eo,p.ajax=Qo,p.aliJsChooseImage=Su,p.aliJsGetLocation=bu,p.aliJsOpenLocation=vu,p.aliJsPreviewImage=Cu,p.aliJsReady=yu,p.aliJsScan=xu,p.aliJsTradePay=wu,p.angle=Xt,p.appendIdleTask=Ho,p.appendURLSearchString=Xn,p.base64EncodeOutputStream=Nr,p.base64URLDecode=Dr,p.base64URLEncode=Ar,p.bitmapMapper=$r,p.blobToRawImage=Dc,p.byteArrayOutputStream=Ii,p.canDrawBitmap=An,p.canUsePaths=po,p.canUseWorker=Pn,p.changeBrightness=tl,p.changeDiaphaneity=el,p.changeSize=Qc,p.checkWxJsApi=Wl,p.clearCookies=Io,p.createXMLHttpRequest=$n,p.decodeUseTextDecoder=kr,p.decryptInCommon=yc,p.distance=cs,p.distance2=ls,p.drawBitmapInCanvas=Fl,p.drawQRCodeToCanvas=ol,p.encodeUseTextEncoder=Es,p.encryptInCommon=gc,p.fileOrBlobToDataURL=Mi,p.flipSideToSide=Mc,p.flipUpsideDown=_c,p.flushURLSearchString=Xo,p.formDataToSearchString=jn,p.getBitmapFromCanvas=Nl,p.getBrowserClient=Qs,p.getBrowserClientVersion=to,p.getBrowserLanguage=so,p.getColor=Dt,p.getColorScheme=Nn,p.getCookie=Mo,p.getCookieObject=_o,p.getCurrentDOMHighResTimeStamp=fe,p.getDOMMatrix=ri,p.getDirection=bo,p.getElementPositionInPage=wn,p.getElementPositionInPage2=Wa,p.getElementPositionInViewport=$a,p.getFileExtension=gn,p.getFileString=Ko,p.getFileTypeFromFile=Va,p.getFilesImageInfo=Sc,p.getFormSubmitData=th,p.getHexColorString=ue,p.getImageAspectRatio=vc,p.getImageDataByAIData=nl,p.getImageDataFromBitmap=Tc,p.getImageDataFromUrl=Or,p.getImageDataFromVideo=Cc,p.getImageMainColor=kc,p.getInternetExplorerVersion=Sn,p.getMousePositionInElement=bn,p.getMousePositionInPage=xn,p.getMousePositionInViewport=Ka,p.getOperatingSystem=as,p.getOperatingSystemVersion=Qa,p.getOppositeColor=hi,p.getOppositeHexColorString=Bn,p.getOppositeRGBColorString=Oo,p.getPageBodyElement=Ya,p.getPageDocumentElement=he,p.getPageSize=Ha,p.getRGBColorString=ci,p.getRawImageInfo=As,p.getRelativeBoundingClientRect=Ja,p.getScreenElement=Xa,p.getScrollParent=ql,p.getTimeZone=io,p.getURL=ds,p.getUserGeolocationPromise=eo,p.getVerticalScrollPercentInPage=Za,p.getViewportSize=qa,p.gifImage=Fr,p.gradientColor=li,p.h=ae,p.hasDocument=uo,p.hasHistory=fo,p.hasWindow=En,p.hsb2rgb=Fo,p.hsl2rgb=Bo,p.hsv2rgb=No,p.imageDataToBitmap=Ec,p.imageDataToBlob=Ac,p.imageDataToDataURL=Pc,p.injectWxJsConfig=Hl,p.isAliBrowser=Tn,p.isAliMiniProgram=lo,p.isAndroid=vn,p.isAppleDevice=no,p.isBrowserSupportFileAPI=mo,p.isDarkMode=ao,p.isElement=go,p.isIE=oo,p.isIE9or10=ho,p.isIOS=ti,p.isMacOS=ei,p.isMobile=ro,p.isNative=os,p.isURL=zo,p.isWxBrowser=Cn,p.isWxMiniProgram=co,p.jpgToPng=$c,p.leftRotate=Ic,p.length=hs,p.linkExport=Zs,p.localstorage=ai,p.mapTDTJSSDK=Tu,p.marginSharpen=Wc,p.microTask=za,p.mosaic=il,p.mount=oe,p.nextTick=Yo,p.normalizePoint=xo,p.objectHash=_r,p.outputGifBase64=Br,p.outputQRCodeBase64=al,p.pack=mc,p.parseTransformToMatrix=ni,p.parseURL=Un,p.patch=Ks,p.patchDOM=yn,p.pngToJpg=Jc,p.polar=Pt,p.prefixes=yo,p.radiusClip=Kc,p.randomColorHexString=Ro,p.randomColorNumber=Gn,p.reactive=Ul,p.reactiveVue2=Gl,p.reactiveVue3=Kr,p.readFileInBrowser=rs,p.recordToSearchString=zn,p.rectClip=Zc,p.requestAnimationFrameCycle=Yn,p.rgb2hsb=Uo,p.rgb2hsl=Vo,p.rgb2hsv=Go,p.rightRotate=Oc,p.rotatePoint=Ct,p.scheduleIdle=qn,p.scheduleYZIdle=ui,p.searchStringToRecord=jo,p.selectFileInBrowser=pn,p.setColorScheme=us,p.setCookie=ko,p.setRem=wo,p.shadeColor=Lo,p.sharpen=Hc,p.signInCommon=wc,p.singletonGlobalAnimateCycle=de,p.stringHash=Mr,p.stringToBlob=$s,p.stringToDOM=Ua,p.theme=oi,p.toBlackAndWhite=Nc,p.toBlue=Uc,p.toBlueAndGreen=jc,p.toBlueAndGrey=qc,p.toDegree=et,p.toGreen=Gc,p.toGreenAndGrey=Yc,p.toGrey=Rc,p.toGrey2=Lc,p.toOpposite=Fc,p.toRadian=N,p.toRed=Bc,p.toRedAndBlue=zc,p.toRedAndGreen=Vc,p.toRedAndGrey=Xc,p.trimURLHash=Vn,p.unpack=pc,p.verifyInCommon=xc,p.watchEffect=Bl,p.wxJsChooseImage=Zl,p.wxJsDownloadImage=tu,p.wxJsDownloadVoice=lu,p.wxJsGetLocalImgData=eu,p.wxJsGetLocation=mu,p.wxJsGetNetworkType=fu,p.wxJsOnVoicePlayEnd=hu,p.wxJsOnVoiceRecordEnd=nu,p.wxJsOpenLocation=du,p.wxJsPauseVoice=au,p.wxJsPay=gu,p.wxJsPlayVoice=ru,p.wxJsPreviewImage=Kl,p.wxJsScanQRCode=pu,p.wxJsStartRecord=su,p.wxJsStopRecord=iu,p.wxJsStopVoice=ou,p.wxJsTranslateVoice=uu,p.wxJsUpdateAppMessageShareData=$l,p.wxJsUpdateTimelineShareData=Jl,p.wxJsUploadImage=Ql,p.wxJsUploadVoice=cu,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
|
|
46
46
|
//# sourceMappingURL=zyzgroup_core_web.umd.cjs.map
|