@zyzgroup/core-web 0.0.68 → 0.0.70
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/zyzgroup_core_web.iife.js +20 -20
- package/dist/zyzgroup_core_web.iife.js.map +1 -1
- package/dist/zyzgroup_core_web.js +6729 -6412
- package/dist/zyzgroup_core_web.js.map +1 -1
- package/dist/zyzgroup_core_web.umd.cjs +20 -20
- package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/types/animate/AnimateOperation.d.ts +8 -5
- package/types/animate/AnimateOperation.d.ts.map +1 -1
- package/types/animate/animateInWeb.d.ts.map +1 -1
- package/types/animate/tween/Group.d.ts.map +1 -1
- package/types/canvas/Canvas.d.ts.map +1 -1
- package/types/canvas/CanvasOperation.d.ts +1 -1
- package/types/canvas/CanvasOperation.d.ts.map +1 -1
- package/types/canvas/CustomCanvasContext.d.ts.map +1 -1
- package/types/dom/DOMEventBus.d.ts +1 -1
- package/types/dom/DOMEventBus.d.ts.map +1 -1
- package/types/dom/DOMUtil.d.ts.map +1 -1
- package/types/file.d.ts +1 -1
- package/types/file.d.ts.map +1 -1
- package/types/image/bitmap.d.ts +5 -0
- package/types/image/bitmap.d.ts.map +1 -0
- package/types/image/index.d.ts +1 -0
- package/types/image/index.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/math/Arc.d.ts.map +1 -1
- package/types/math/Light3d.d.ts +1 -1
- package/types/math/Light3d.d.ts.map +1 -1
- package/types/math/PathD.d.ts +18 -6
- package/types/math/PathD.d.ts.map +1 -1
- package/types/math/PathDGroup.d.ts +11 -1
- package/types/math/PathDGroup.d.ts.map +1 -1
- package/types/math/Sector.d.ts +14 -0
- package/types/math/Sector.d.ts.map +1 -1
- package/types/math/Shape.d.ts +21 -6
- package/types/math/Shape.d.ts.map +1 -1
- package/types/math/ShapeGroup.d.ts +2 -0
- package/types/math/ShapeGroup.d.ts.map +1 -1
- package/types/math/Text.d.ts +3 -0
- package/types/math/Text.d.ts.map +1 -1
- package/types/math/shapes/Cross.d.ts +7 -0
- package/types/math/shapes/Cross.d.ts.map +1 -0
- package/types/math/shapes/Heart.d.ts +10 -0
- package/types/math/shapes/Heart.d.ts.map +1 -0
- package/types/math/shapes/HeartVariant.d.ts +10 -0
- package/types/math/shapes/HeartVariant.d.ts.map +1 -0
- package/types/math/shapes/Rabbit.d.ts +7 -0
- package/types/math/shapes/Rabbit.d.ts.map +1 -0
- package/types/math/shapes/Star.d.ts +9 -0
- package/types/math/shapes/Star.d.ts.map +1 -0
- package/types/math/shapes/Tree.d.ts +7 -0
- package/types/math/shapes/Tree.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/signature.d.ts +35 -0
- package/types/signature.d.ts.map +1 -0
- package/types/svg/DOMSVGUtil.d.ts +2 -2
- package/types/svg/DOMSVGUtil.d.ts.map +1 -1
- package/types/svg/SVG.d.ts +13 -24
- package/types/svg/SVG.d.ts.map +1 -1
- package/types/theme.d.ts +1 -0
- package/types/theme.d.ts.map +1 -1
- package/types/worker.d.ts +7 -0
- package/types/worker.d.ts.map +1 -1
- package/types/shapes/ShapeArmyAnts.d.ts +0 -10
- package/types/shapes/ShapeArmyAnts.d.ts.map +0 -1
- package/types/shapes/ShapeBase.d.ts +0 -30
- package/types/shapes/ShapeBase.d.ts.map +0 -1
- package/types/shapes/ShapeHeart.d.ts +0 -15
- package/types/shapes/ShapeHeart.d.ts.map +0 -1
- package/types/shapes/ShapePoint3d.d.ts +0 -20
- package/types/shapes/ShapePoint3d.d.ts.map +0 -1
- package/types/shapes/ShapeRabbit.d.ts +0 -8
- package/types/shapes/ShapeRabbit.d.ts.map +0 -1
- package/types/shapes/ShapeTiger.d.ts +0 -6
- package/types/shapes/ShapeTiger.d.ts.map +0 -1
- package/types/shapes/ShapeTree.d.ts +0 -13
- package/types/shapes/ShapeTree.d.ts.map +0 -1
- package/types/shapes/index.d.ts +0 -9
- package/types/shapes/index.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ZYZGroupCoreWeb=function(p){"use strict";typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function
|
|
1
|
+
var ZYZGroupCoreWeb=function(p){"use strict";const Hr=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Mn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Xe(n){this.message=n}Xe.prototype=new Error,Xe.prototype.name="InvalidCharacterError";function Wr(n){const t=String(n);let e="";for(let s,i,r=0,a=Mn;t.charAt(r|0)||(a="=",r%1);e+=a.charAt(63&s>>8-r%1*8)){if(i=t.charCodeAt(r+=.75),i>255)throw new Xe("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");s=s<<8|i}return e}function $r(n){const t=String(n).replace(/[=]+$/,"");if(t.length%4===1)throw new Xe("'atob' failed: The string to be decoded is not correctly encoded.");let e="";for(let s=0,i,r,a=0;r=t.charAt(a++);~r&&(i=s%4?i*64+r:r,s++%4)?e+=String.fromCharCode(255&i>>(-2*s&6)):0)r=Mn.indexOf(r);return e}const Is=n=>{let t=null;switch(n){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"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"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 @@ var ZYZGroupCoreWeb=function(p){"use strict";typeof process<"u"&&process.version
|
|
|
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
|
-
`);n=~F?k.length-F:n+k.length}function r(){var k={line:e,column:n};return function(_){return _.position=new a(k),m(),_}}function a(k){this.start=k,this.end={line:e,column:n},this.source=t.source}a.prototype.content=s;var o=[];function c(k){var _=new Error(t.source+":"+e+":"+n+": "+k);if(_.reason=k,_.filename=t.source,_.line=e,_.column=n,_.source=s,t.silent)o.push(_);else throw _}function h(){var k=g();return{type:"stylesheet",stylesheet:{source:t.source,rules:k,parsingErrors:o}}}function l(){return w(/^{\s*/)}function f(){return w(/^}/)}function g(){var k,_=[];for(m(),v(_);s.length&&s.charAt(0)!="}"&&(k=U()||A());)k!==!1&&(_.push(k),v(_));return _}function w(k){var _=k.exec(s);if(_){var F=_[0];return i(F),s=s.slice(F.length),_}}function m(){w(/^\s*/)}function v(k){var _;for(k=k||[];_=b();)_!==!1&&k.push(_);return k}function b(){var k=r();if(!(s.charAt(0)!="/"||s.charAt(1)!="*")){for(var _=2;s.charAt(_)!=""&&(s.charAt(_)!="*"||s.charAt(_+1)!="/");)++_;if(_+=2,s.charAt(_-1)==="")return c("End of comment missing");var F=s.slice(2,_-2);return n+=2,i(F),s=s.slice(_),n+=2,k({type:"comment",comment:F})}}function S(){var k=w(/^([^{]+)/);if(k)return Nt(k[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 k=r(),_=w(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(_){if(_=Nt(_[0]),!w(/^:\s*/))return c("property missing ':'");var F=w(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),G=k({type:"declaration",property:_.replace(Ns,""),value:F?Nt(F[0]).replace(Ns,""):""});return w(/^[;\s]*/),G}}function M(){var k=[];if(!l())return c("missing '{'");v(k);for(var _;_=C();)_!==!1&&(k.push(_),v(k));return f()?k:c("missing '}'")}function R(){for(var k,_=[],F=r();k=w(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)_.push(k[1]),w(/^,\s*/);if(_.length)return F({type:"keyframe",values:_,declarations:M()})}function B(){var k=r(),_=w(/^@([-\w]+)?keyframes\s*/);if(_){var F=_[1];if(_=w(/^([-\w]+)\s*/),!_)return c("@keyframes missing name");var G=_[1];if(!l())return c("@keyframes missing '{'");for(var St,Ht=v();St=R();)Ht.push(St),Ht=Ht.concat(v());return f()?k({type:"keyframes",name:G,vendor:F,keyframes:Ht}):c("@keyframes missing '}'")}}function N(){var k=r(),_=w(/^@supports *([^{]+)/);if(_){var F=Nt(_[1]);if(!l())return c("@supports missing '{'");var G=v().concat(g());return f()?k({type:"supports",supports:F,rules:G}):c("@supports missing '}'")}}function W(){var k=r(),_=w(/^@host\s*/);if(_){if(!l())return c("@host missing '{'");var F=v().concat(g());return f()?k({type:"host",rules:F}):c("@host missing '}'")}}function it(){var k=r(),_=w(/^@media *([^{]+)/);if(_){var F=Nt(_[1]);if(!l())return c("@media missing '{'");var G=v().concat(g());return f()?k({type:"media",media:F,rules:G}):c("@media missing '}'")}}function q(){var k=r(),_=w(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(_)return k({type:"custom-media",name:Nt(_[1]),media:Nt(_[2])})}function nt(){var k=r(),_=w(/^@page */);if(_){var F=S()||[];if(!l())return c("@page missing '{'");for(var G=v(),St;St=C();)G.push(St),G=G.concat(v());return f()?k({type:"page",selectors:F,declarations:G}):c("@page missing '}'")}}function Y(){var k=r(),_=w(/^@([-\w]+)?document *([^{]+)/);if(_){var F=Nt(_[1]),G=Nt(_[2]);if(!l())return c("@document missing '{'");var St=v().concat(g());return f()?k({type:"document",document:G,vendor:F,rules:St}):c("@document missing '}'")}}function $(){var k=r(),_=w(/^@font-face\s*/);if(_){if(!l())return c("@font-face missing '{'");for(var F=v(),G;G=C();)F.push(G),F=F.concat(v());return f()?k({type:"font-face",declarations:F}):c("@font-face missing '}'")}}var ht=V("import"),rt=V("charset"),j=V("namespace");function V(k){var _=new RegExp("^@"+k+"\\s*([^;]+);");return function(){var F=r(),G=w(_);if(G){var St={type:k};return St[k]=G[1].trim(),F(St)}}}function U(){if(s[0]=="@")return B()||it()||q()||N()||ht()||rt()||j()||Y()||nt()||W()||$()}function A(){var k=r(),_=S();return _?(v(),k({type:"rule",selectors:_,declarations:M()})):c("selector missing")}return En(h())}function Nt(s){return s?s.replace(/^\s+|\s+$/g,""):""}function En(s,t){var e=s&&typeof s.type=="string",n=e?s:t;for(var i in s){var r=s[i];Array.isArray(r)?r.forEach(function(a){En(a,n)}):r&&typeof r=="object"&&En(r,n)}return e&&Object.defineProperty(s,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),s}const Fs=crypto.subtle;Fs||console.warn("Crypto API not supported");function Yr(s){return new TextEncoder().encode(s)}async function Hr(s,t="SHA-256"){const e=await Fs.digest(t,Yr(s));return Br(e)}async function Wr(s,t="SHA-256"){const e=JSON.stringify(s);return Hr(e,t)}const Pn=(s,t="image/svg+xml",e="utf-8")=>e==="base64"?new Blob([s],{type:`${t};${e}`}):new Blob([s],{type:`${t};charset=${e}`}),_n=s=>new XMLSerializer().serializeToString(s),$r=(s,t="text/html")=>new DOMParser().parseFromString(s,t),Bs=(s,t="image/svg+xml",e="utf-8")=>Pn(_n(s),t,e),Dn=(s,t)=>{const e=document.createElement("a");e.style.visibility="hidden",document.body.appendChild(e),e.download=t,typeof s=="string"?e.href=s:e.href=window.URL.createObjectURL(s),e.click(),document.body.removeChild(e),window.URL.revokeObjectURL(e.href)};function Us(s=["*"],t){return new Promise((e,n)=>{if(!globalThis.document||!(globalThis.document instanceof Document))return n(new Error("This is not a browser environment"));const i=globalThis.document.createElement("input");i.setAttribute("type","file"),i.setAttribute("visibility","hidden"),Array.isArray(s)&&s.length>0&&i.setAttribute("accept",s.join(",")),t&&i.setAttribute("multiple","true"),globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!i.files||i.files?.length===0)&&n(new Error("Cancel select"))},1e3)},{once:!0});const r=()=>{if(i.removeEventListener("change",r),!i.files||i.files?.length===0)n(new Error("Cancel select"));else{const a=Array.from(i.files);!s.includes("*")&&a.some(o=>!s.includes(`.${Vs(o)}`))&&n(new Error(`Please select files in ${s} format`)),i.remove(),e(a)}};i.addEventListener("change",r),i.click()})}function Ge(s,t="text",e){return new Promise((n,i)=>{const r=new FileReader;switch(r.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),r.addEventListener("load",a=>{n(a.target?.result)}),r.addEventListener("error",a=>{i(a)}),t){case"dataURL":r.readAsDataURL(s);break;case"binaryString":r.readAsBinaryString(s);break;case"arrayBuffer":r.readAsArrayBuffer(s);break;case"text":default:r.readAsText(s)}})}async function Jr(s){const t=await Ge(s,"arrayBuffer");return Is(t)}const Vs=s=>{let t;return s instanceof File?t=s.name:t=s,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function Zr(s){typeof queueMicrotask=="function"?queueMicrotask(s):Promise.resolve().then(s).catch(t=>setTimeout(()=>{throw t}))}function Kr(s,t={},e=[]){return{tag:s,props:t,children:e}}function fe(s,t){if(s.el)return;const e=s.el=document.createElement(s.tag);if(s.props)for(const n in s.props){const i=s.props[n];n.startsWith("on")?e.addEventListener(n.slice(2).toLowerCase(),i):e.setAttribute(n,i)}s.children&&(typeof s.children=="string"?e.textContent=s.children:s.children.forEach(n=>{fe(n,e)})),t.appendChild(e)}function Gs(s,t){if(s.tag!==t.tag){if(!s.el)return;const e=s.el.parentElement||document.body;e.removeChild(s.el),fe(t,e)}else{const e=t.el=s.el;if(!e)return;const n=s.props,i=t.props;for(const o in n)o in i||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),n[o]):e.removeAttribute(o));for(const o in i){const c=n[o],h=i[o];h!=c&&(o.startsWith("on")?e.addEventListener(o.slice(2).toLowerCase(),h):e.setAttribute(o,h))}const r=s.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof r=="string")e.innerHTML="",a.forEach(o=>{fe(o,e)});else{const o=Math.min(r.length,a.length);for(let c=0;c<o;c++)Gs(r[c],a[c]);a.length>r.length&&a.slice(r.length).forEach(c=>{fe(c,e)}),a.length<r.length&&r.slice(a.length).forEach(c=>{c.el&&e.removeChild(c.el)})}}}function zs(s,t,e){if(!s){e&&t&&e.appendChild(t);return}if(!s.isEqualNode(t)){if(s.nodeName!==t.nodeName){e.replaceChild(t,s);return}if(s.nodeType===Node.TEXT_NODE){s.textContent!==t.textContent&&(s.textContent=t.textContent);return}for(let n=s.attributes.length-1;n>=0;n--){const i=s.attributes[n].name;!t.hasAttribute(i)&&i!=="open"&&s.removeAttribute(i)}for(let n=0;n<t.attributes.length;n++){const i=t.attributes[n].name,r=t.attributes[n].value;s.setAttribute(i,r)}for(let n=0;n<t.childNodes.length;n++)s.childNodes[n]?zs(s.childNodes[n],t.childNodes[n],s):s.appendChild(t.childNodes[n].cloneNode(!0));for(;s.childNodes.length>t.childNodes.length;)s.lastChild&&s.removeChild(s.lastChild)}}class Qr{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:n,wasClean:i}=t;console.log(`ws closed : ${e} ${n} ${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 n=this.waitingResponse[e.requestid];n?n.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,n=this.waitingResponse[e]={requestid:e};try{let i;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?i=t:i=JSON.stringify({...n,...t});const r=await new Promise((a,o)=>{n.resolve=a,this.sendWithRetry(i),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-n.requestid)/1e3),r}catch(i){return Promise.reject(i)}finally{delete this.waitingResponse[e]}}async send(t,e,n=i=>{console.log(i)}){this.sendPayload(t).then(e,n)}}function ta(){const s=window.screen;return{screenWidth:s.width,screenHeight:s.height,screenX:window.screenX,screenY:window.screenY}}function ea(){const s=document.body;return{clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,pageX:s.getBoundingClientRect().x,pageY:s.getBoundingClientRect().y}}function ee(){const s=document.documentElement;return{clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,offsetWidth:s.offsetWidth,offsetHeight:s.offsetHeight,offsetTop:s.offsetTop,offsetLeft:s.offsetLeft,offsetParent:s.offsetParent,clientX:s.getBoundingClientRect().x,clientY:s.getBoundingClientRect().y}}function na(){const{clientWidth:s,clientHeight:t}=ee();return{width:s||window.innerWidth,height:t||window.innerHeight}}function sa(){const{scrollWidth:s,scrollHeight:t}=ee();return{width:s,height:t}}function js(s){const{top:t,left:e}=s.getBoundingClientRect(),{scrollLeft:n,scrollTop:i}=ee();return{x:e+n,y:t+i}}function ia(s){return{x:Xs(s),y:qs(s)}}function Xs(s){let t=0;for(;s!==null;)t+=s.offsetLeft,s=s.offsetParent;return t}function qs(s){let t=0;for(;s!==null;)t+=s.offsetTop,s=s.offsetParent;return t}function ra(s){const t=s.getBoundingClientRect();return{x:t.left,y:t.top}}function aa(s,t){const e=s.getBoundingClientRect(),n=t.getBoundingClientRect();return{x:n.x-e.x,y:n.y-e.y,width:n.width||n.right-n.left,height:n.height||n.bottom-n.top}}function oa(){const{clientHeight:s,scrollTop:t,scrollHeight:e}=ee(),n=e-s;return n<=0?0:t/n*100}function ca(s){return{x:s.clientX,y:s.clientY}}function Ys(s){if("center"in s)return s.center;if(s.pageX&&s.pageY)return{x:s.pageX,y:s.pageY};const{scrollLeft:t,scrollTop:e}=ee();return{x:s.clientX+t,y:s.clientY+e}}function Hs(s,t){const e=Ys(t),n=js(s);return{x:e.x-n.x,y:e.y-n.y}}function An(){return typeof window<"u"?window:this||{}}const ze=()=>{const s=navigator.userAgent.toLowerCase();let t="Unknown";return/mac/i.test(s)?t="macOS":/win/i.test(s)?t="Windows":/android/i.test(s)?t="Android":/iphone|ipad|ipod/i.test(s)?t="iOS":/linux/i.test(s)?t="Linux":/bsd/i.test(s)&&(t="BSD"),t.toLowerCase()},ha=()=>{const s=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(s)){const e=s.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(s)){const e=s.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(s)){const e=s.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(s)){const e=s.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},kn=()=>{const s=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(s)||/opera/i.test(s)?t="Opera":/chrome/i.test(s)?t="Chrome":/firefox/i.test(s)?t="Firefox":/safari/i.test(s)?t="Safari":/edge/i.test(s)?t="Edge":/msie|trident/i.test(s)?t="IE":/MicroMessenger/i.test(s)?t="Wechat":/alipay/i.test(s)&&(t="Ali"),t.toLowerCase()},la=()=>{const s=navigator.userAgent;let t="Unknown";if(/Chrome/.test(s)){const e=s.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(s)){const e=s.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(s)){const e=s.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(s)){const e=s.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(s)){const e=s.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t},ua=()=>"geolocation"in navigator?new Promise((s,t)=>{navigator.geolocation.getCurrentPosition(e=>{const n=e.coords.latitude,i=e.coords.longitude;s({latitude:n,longitude:i})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function fa(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function da(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function In(){return ze()==="ios"}function Mn(){return ze()==="macos"}function ma(){return In()|Mn()}function Ws(){return ze()==="android"}function pa(){return In()||Ws()}function ga(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function $s(){const s=window.navigator.userAgent,t=s.indexOf("MSIE ");if(t>0)return parseInt(s.substring(t+5,s.indexOf(".",t)),10);if(s.indexOf("Trident/")>0){const i=s.indexOf("rv:");return parseInt(s.substring(i+3,s.indexOf(".",i)),10)}const n=s.indexOf("Edge/");return n>0?parseInt(s.substring(n+5,s.indexOf(".",n)),10):-1}const ya=$s()!==-1;function wa(){const s=document.documentMode;return s&&(s===9||s===10)}function Js(){return kn()==="wechat"}function Zs(){return kn()==="ali"}function va(){return Js()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function ba(){return Zs()&&navigator.userAgent.match(/miniprogram/i)}const xa=typeof document<"u",Ks=typeof window<"u",Sa=typeof history<"u",Ca=Ks&&window.File&&window.FileReader&&window.FileList&&window.Blob,Qs=(()=>{const s=An();return!!(s.Worker&&s.Blob&&s.Promise&&s.OffscreenCanvas&&s.OffscreenCanvasRenderingContext2D&&s.HTMLCanvasElement&&s.HTMLCanvasElement.prototype.transferControlToOffscreen&&s.URL&&s.URL.createObjectURL)})(),Ta=typeof Path2D=="function"&&typeof DOMMatrix=="function",Ea=function(){if(!An().OffscreenCanvas)return!1;var t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);var n=t.transferToImageBitmap();try{e.createPattern(n,"no-repeat")}catch{return!1}return!0}();function Pa(s){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let n=100;const i=function(){const r=Math.min(t.clientWidth,s);t.dataset.width=r,t.dataset.rem=n=Math.round(100*(r/s)),t.style.fontSize=n+"px"};i(),window.rem2px=function(r){return r=parseFloat(r),r*n},window.px2rem=function(r){return r=parseFloat(r),r/n},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",i,!1)}function ot(s){return s*Math.PI/180}function Q(s){return s*180/Math.PI}function je(s,t,e=0){return Math.sqrt(s*s+t*t+e*e)}function Rn(s,t,e,n){const i=s-e,r=t-n;return je(i,r)}function de(s,t,e,n){const i=e-s,r=n-t;let a=Math.atan2(r,i);return a<0&&(a+=Math.PI*2),a}function zt(s,t){return{x:Math.cos(s)*t,y:Math.sin(s)*t}}function _a(s,t){const e=Math.sqrt(Math.pow(s,2)+Math.pow(t,2));return{x:s/=e,y:t/=e}}function Da(s,t,e,n,i=10){if(Math.abs(e-s)<i&&Math.abs(n-t)<i)return"no";const r=Q(de(s,t,e,n));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 ti=[1,0,0,1,0,0],ei=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class tt{value;matrix3d;isEverTo3d=!1;constructor(t=ti){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 Zt(e)}unit(){return this.value=Array.from(ti),this.matrix3d=this.toMatrix3D(),this}multiplyPoint(t,e,n=0,i=0){const r=t-n,a=e-i;return t=this.m11*r+this.m21*a+this.m31,e=this.m12*r+this.m22*a+this.m32,{x:t+n,y:e+i}}fromString(t){const e=Es("number",t);return e.length===6?e.forEach((n,i)=>{n.fullMatch&&(this.value[i]=parseFloat(n.fullMatch))}):this.unit(),this}clone(){return new tt(this.value)}multiply(t){const e=this.value;let n;t instanceof tt?n=t.value:n=t;const i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],a=e[0]*n[2]+e[2]*n[3],o=e[1]*n[2]+e[3]*n[3],c=e[0]*n[4]+e[2]*n[5]+e[4],h=e[1]*n[4]+e[3]*n[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 tt(this.value),e=t.value,n=1/(e[0]*e[3]-e[1]*e[2]),i=e[3]*n,r=-e[1]*n,a=-e[2]*n,o=e[0]*n,c=n*(e[2]*e[5]-e[3]*e[4]),h=n*(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 n=this.offset(t,e);return this.translate(n.x,n.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,n){return this.isEverTo3d=!0,this.matrix3d.translate(t,e,n),this.matrix3d.toMatrix(this),this}translate3dTo(t,e,n){return this.translate3d(t-this.matrix3d.m41,e-this.matrix3d.m42,n-this.matrix3d.m43),this}rotate(t,e=0,n=0){const i=ot(t),r=Math.cos(i),a=Math.sin(i);return this.multiply([r,a,-a,r,e,n]),this.translate(-e,-n),this.toMatrix3D(),this}rotateTo(t,e=0,n=0){const{rotateZ:i}=this.matrix3d.split();return this.rotate(t-i,e,n),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,n){return this.isEverTo3d=!0,this.matrix3d.rotate("x",t).rotate("y",e).rotate("z",n),this.matrix3d.toMatrix(this),this}rotate3dTo(t,e,n){const{rotateX:i,rotateY:r,rotateZ:a}=this.matrix3d.split();return this.rotate3d(t-i,e-r,n-a),this}scale(t,e=t,n=0,i=0){return this.translate(n,i),this.multiply([t,0,0,e,0,0]),this.translate(-n,-i),this.toMatrix3D(),this}scaleTo(t,e=t,n=0,i=0){return this.scale(t/this.m11,e/this.m22,n,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,n=t){return this.isEverTo3d=!0,this.matrix3d.scale(t,e,n),this.matrix3d.toMatrix(this),this}scale3dTo(t,e=t,n=t){const{scaleX:i,scaleY:r,scaleZ:a}=this.matrix3d.split();return this.scale3d(t/i,e/r,n/a),this}skew(t,e=t){const n=Math.tan(ot(t)),i=Math.tan(ot(e));return this.multiply([1,i,n,1,0,0]),this.toMatrix3D(),this}skewTo(t,e=t){return this.skew(t-Q(this.m21),e-Q(this.m12))}skewX(t){return this.skew(t,Q(this.m12))}skewXTo(t){return this.skewTo(t,Q(this.m12))}skewY(t){return this.skew(Q(this.m21),t)}skewYTo(t){return this.skewTo(Q(this.m21),t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,n){return this}skew3dTo(t,e,n){return this}getGroupCoords(t){const e=this.value[0],n=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],w=t.value[5],m=c*f,v=h*l,b=(l*n-e*f)/(v-m),S=(c*n-e*h)/(m-v),C=(l*r-i*f)/(v-m),M=(c*r-i*h)/(m-v),R=(l*(o-w)+f*(g-a))/(v-m),B=(c*(o-w)+h*(g-a))/(m-v),N=[b,S,C,M,R,B];return new tt(N)}toString(){return this.isEverTo3d?this.matrix3d.toString():`matrix(${this.value.map(t=>Jt(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 Zt{value;constructor(t=ei){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(ei),this}fromString(t){const e=Es("number",t);return e.length===16?e.forEach((n,i)=>{n.fullMatch&&(this.value[i]=parseFloat(n.fullMatch))}):this.unit(),this}toMatrix(t){const{scaleX:e,scaleY:n,skewX:i,skewY:r,x:a,y:o}=this.split(),c=[e,r,i,n,a,o];return t?(t.value=c,t):new tt(c)}multiplyMatrix(t){const e=t.value[0],n=t.value[1],i=t.value[2],r=t.value[3],a=e*this.m11+n*this.m21+i*this.m31+r*this.m41,o=e*this.m12+n*this.m22+i*this.m32+r*this.m42,c=e*this.m13+n*this.m23+i*this.m33+r*this.m43,h=e*this.m14+n*this.m24+i*this.m34+r*this.m44;return new tt([a,o,c,h,0,0])}multiply(t){const e=new tt([t.value[0],t.value[1],t.value[2],t.value[3],0,0]),n=new tt([t.value[4],t.value[5],t.value[6],t.value[7],0,0]),i=new tt([t.value[8],t.value[9],t.value[10],t.value[11],0,0]),r=new tt([t.value[12],t.value[13],t.value[14],t.value[15],0,0]),a=this.multiplyMatrix(e),o=this.multiplyMatrix(n),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,n=0){return this.multiply(new Zt([1,0,0,0,0,1,0,0,0,0,1,0,t,e,n,1]))}scale(t=1,e=1,n=1){return this.multiply(new Zt([t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1]))}rotate(t,e){const n=ot(e),i=Math.sin,r=Math.cos;let a;switch(t){case"x":a=[1,0,0,0,0,r(n),i(n),0,0,-i(n),r(n),0,0,0,0,1];break;case"y":a=[r(n),0,-i(n),0,0,1,0,0,i(n),0,r(n),0,0,0,0,1];break;case"z":a=[r(n),i(n),0,0,-i(n),r(n),0,0,0,0,1,0,0,0,0,1];break}return this.multiply(new Zt(a))}toString(){return`matrix3d(${this.value.map(t=>Jt(t,6)).join(",")})`}split(){let t=Q(yt(Math.asin(-this.m13),-1,1)),e=Q(Math.atan2(this.m23,this.m33)),n=Q(Math.atan2(this.m12,this.m11));return Math.cos(t)===0&&(e=Q(Math.atan2(-this.m31,this.m22)),n=0),{x:this.m41,y:this.m42,z:this.m43,rotateX:e,rotateY:t,rotateZ:n,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:Q(this.m14),skewY:Q(this.m24),skewZ:Q(this.m34),skewW:this.m44}}inverse(){const t=[],e=this.m11,n=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,w=this.m34,m=this.m41,v=this.m42,b=this.m43,S=this.m44;t[0]=c*w*v-h*g*v+h*f*b-o*w*b-c*f*S+o*g*S,t[1]=r*g*v-i*w*v-r*f*b+n*w*b+i*f*S-n*g*S,t[2]=i*h*v-r*c*v+r*o*b-n*h*b-i*o*S+n*c*S,t[3]=r*c*f-i*h*f-r*o*g+n*h*g+i*o*w-n*c*w;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*w*m-h*l*b+a*w*b+c*l*S-a*g*S,t[5]=i*w*m-r*g*m+r*l*b-e*w*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*w+e*c*w,t[8]=o*w*m-h*f*m+h*l*v-a*w*v-o*l*S+a*f*S,t[9]=r*f*m-n*w*m-r*l*v+e*w*v+n*l*S-e*f*S,t[10]=n*h*m-r*o*m+r*a*v-e*h*v-n*a*S+e*o*S,t[11]=r*o*l-n*h*l-r*a*f+e*h*f+n*a*w-e*o*w,t[12]=c*f*m-o*g*m-c*l*v+a*g*v+o*l*b-a*f*b,t[13]=n*g*m-i*f*m+i*l*v-e*g*v-n*l*b+e*f*b,t[14]=i*o*m-n*c*m-i*a*v+e*c*v+n*a*b-e*o*b,t[15]=n*c*l-i*o*l+i*a*f-e*c*f-n*a*g+e*o*g,this.value=t;const M=1/C;this.value.map(R=>R*M)}}function On(s){const t=new tt;return s.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,n,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(n.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 Zt(r)),t.matrix3d.toMatrix(t);break}return""}),t}function Et(s,t,e,n=0,i=0){const r=new tt;return r.rotate(Q(s),n,i),r.multiplyPoint(t,e,n,i)}class D{static onDocumentReady(t){let e=!1;function n(){document.readyState==="loading"||e||(e=!0,t(),document.removeEventListener("DOMContentLoaded",n))}typeof document<"u"&&(document.addEventListener("DOMContentLoaded",n),n())}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 n=D.getStyle(t.parentElement,"position");D.setStyle(t.parentElement,{position:n=="static"?"relative":n,perspective:e})}D.setStyle(t,{"transform-style":"preserve-3d"})}static convertAttrs(t,e,n={}){n.hasOwnProperty("transform")||Object.assign(n,{transform:D.getStyle(t,"transform")||""});const i=On(n.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:n.hasOwnProperty(a)||(n[a]=D.getStyle(t,a)),Object.assign(r,{[a]:`${o}`});break}}return Object.assign(r,{transform:i.toString()}),r}static attrsToCanvas(t,e){for(const n in e){const i=e[n];switch(ft(n)){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"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,n){const i=t;if(getComputedStyle)if(e){e=ft(e);const r=getComputedStyle(i,n).getPropertyPriority(e);return getComputedStyle(i,n).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=Ds(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,n){if(typeof e=="string"&&n){const i=String(n).toLowerCase().includes("!important")?"important":"";t.style.setProperty(ft(e),n.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(ft(i),String(e[i]).replace(/!important/i,""),r)})}static setStyleSheet(t,e){let n;if(typeof e=="string"){const r=document.querySelector(e)?.shadowRoot;r?n=r:n=document.querySelector(e)}else n=e;const i=document.createElement("style");if(i.innerHTML=t,n)return n.appendChild(i),()=>{(n instanceof HTMLElement||n instanceof ShadowRoot)&&n.removeChild(i)};{const r=document.styleSheets[0].insertRule(t);return()=>{document.styleSheets[0].deleteRule(r)}}}static toggleClass(t,e,n="toggle"){e.split(/[,\s]+/).forEach(i=>{i.trim()!==""&&t.classList[n](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(n=>n.trim()!==""?Array.from(t.classList||[]).includes(n.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,n){let i={};if(e===void 0&&n===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"&&n===void 0)return t.getAttribute(ft(e));typeof e=="object"?i=e:typeof e=="string"&&n!==void 0&&(i[e]=n),Object.entries(i).forEach(([r,a])=>{t.setAttribute(ft(r),a)})}static removeAttribute(t,e){e.split(/[,\s]+/).forEach(n=>{n.trim()!=""&&t.removeAttribute(n.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,n){if(n===void 0&&typeof e=="string")return t[e];{let i={};typeof e=="object"?i=e:typeof e=="string"&&n!==void 0&&(i[e]=n),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(n=>{n.trim()!=""&&delete t[this.fixProp(n.trim())]})}static data(t,e,n){if(typeof e=="string"&&(e=Ds(e)),(typeof e=="string"||e===void 0)&&n===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]=n),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(n=>{n.trim()!=""&&delete t.dataset[n.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,n){let i;const r=["click","dblclick","mousedown","mouseup","mousemove"],a=["keydown","keyup","keypress"];typeof e=="string"?r.includes(e)?i=new MouseEvent(e,n):a.includes(e)?i=new KeyboardEvent(e,n):i=new Event(e,n):i=e,t.dispatchEvent(i)}static scriptConvert(t){const e=n=>{const r=n.ownerDocument.createElement("script");r.text=n.text;const a=n.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(n=>{n.parentNode?.replaceChild(e(n),n)}),t}static fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(n=>{const i=this.scriptConvert(n);i!=n&&e.content.replaceChild(i,n)}),e.content}static insert(t,e,n="append"){return typeof e=="string"?t[n](this.fragment(e)):(e instanceof HTMLElement||e instanceof SVGElement)&&t[n](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 n=t.options;for(let i=0,r=n.length;i<r;i++)n[i].value==e?n[i].selected=!0:n[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 n;return t.charAt(0)=="#"?t.charAt(1).toLowerCase()=="x"?n=parseInt(t.substring(2),16):n=parseInt(t.substring(1),10):n=e[t],n?String.fromCharCode(n):"&"+t}static waitForStyleSheetsLoaded=()=>new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let n=document.styleSheets.length||0;const i=()=>n>=e.length?(t(),!0):!1;i()||e.forEach(r=>{r.onload=()=>{n+=1,i()}})});static loadScript(t,e=()=>{},n=(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=n,document.body.appendChild(i)}static runInSafe(t){const e=new Proxy(window,{get(n,i,r){if(typeof i=="string"&&["open","location","document"].includes(i))throw new Error(`禁止访问 key: ${i}`);return i==="window"?e:Reflect.get(n,i,r)},set(n,i,r,a){return Reflect.set(n,i,r,a)}});new Function("window",`with(window) { ${t} }`)(e,null)}static dom=new Proxy({},{get(t,e){return function(n={},...i){const r=document.createElement(e);for(const a of Object.keys(n))r.setAttribute(a,n[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},Mt=(n,t)=>(typeof n=="string"&&(n=Is(n)||new RegExp(n)),n.test(t)),Rn=(n,t)=>{typeof n=="string"&&(n=Is(n)||new RegExp(n));const e=t.match(n);return e?n.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},On=(n,t)=>{typeof n=="string"&&(n=Is(n)||new RegExp(n));const e=[],s=t.matchAll(n);for(const i of s)e.push({matchIndex:typeof i.index=="number"?i.index:-1,fullMatch:i[0],groupMatchs:i.slice(1)});return e};function Ln(n){const t=n.match(/[\s\S]/gu);return t?t.length:0}function Nn(n,t){const e=n.codePointAt(t);return e?String.fromCodePoint(e):void 0}function Jr(){let n=new Date().getTime();return"xxxxxxxx_xxxx_xxxx_yxxx_xxxxxxxxxxxx".replace(/[xy]/g,function(e){const s=(n+Math.random()*16)%16|0;return n=Math.floor(n/16),(e=="x"?s:s&3|8).toString(16)})}function Zr(n){return n.replace(/(^\w)/g,function(t){return t.toLowerCase()})}const it=(n,t="-")=>{const e=new RegExp(`${t}?([A-Z])`,"g");return n=n.replace(e,t+"$1").toLowerCase(),n.indexOf(t)==0?n.slice(1):n};function Ms(n){return n.replace(/(^\w|[_-]\w)/g,function(t){return t.slice(-1).toUpperCase()})}function Fn(n){return Zr(Ms(n))}function Kr(n,t,e="0",s="left"){const i=Ln(n);if(t>i){const r=t-i;switch(s){case"left":n=Array(r+1).join(e)+n;break;case"right":n=n+Array(r+1).join(e);break;default:const a=Math.ceil(r/2),o=r-a;n=Array(o+1).join(e)+n+Array(a+1).join(e);break}}return n}function Bn(n){let t="";for(let e=0,s=n.length;e<s;e++){const i=n.charCodeAt(e);i>=1&&i<=127?t+=n.charAt(e):i>2047?(t+=String.fromCharCode(224|i>>12&15),t+=String.fromCharCode(128|i>>6&63),t+=String.fromCharCode(128|i>>0&63)):(t+=String.fromCharCode(192|i>>6&31),t+=String.fromCharCode(128|i>>0&63))}return t}var Rt=(n=>(n.UNKNOWN="",n.HTML="text/html",n.CSS="text/css",n.TEXT="text/plain",n.MD="text/plain",n.JPEG="image/jpeg",n.PNG="image/png",n.GIF="image/gif",n.WEBP="image/webp",n.SVG="image/svg+xml",n.ICO="image/x-icon",n.MPEG="audio/mpeg",n.MP3="audio/mpeg",n.OGG="audio/ogg",n.WAV="audio/wav",n.MP4="video/mp4",n.WEBM="video/webm",n.JSON="application/json",n.XWWW="application/x-www-form-urlencoded",n.XHTML="application/xhtml+xml",n.XML="application/xml",n.XML_TEXT="text/xml",n.JAVASCRIPT="application/javascript",n.ECMASCRIPT="application/ecmascript",n.DOC="application/msword",n.CSV="application/x-csv",n.EXCEL="application/vnb.ms-excel",n.PDF="application/pdf",n.ZIP="application/zip",n.TGZ="application/x-gtar",n.TAR_GZ="application/x-gzip",n.EOT="appliaction/vnd.ms-fontobject",n.TTF="aplication/font-sfnt",n))(Rt||{});const Qr=(n,t=16)=>n.toString(t),$t=(n,t=16)=>{let e=n.toLowerCase();const s=e.indexOf("0b")==0,i=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(s||i||r)&&(e=e.slice(2));const a=parseInt(e,t);if(isNaN(a))throw new Error(`radixStringToNumber(${n}, ${t}) 无法解析!`);return a};function qe(n,t){if(n instanceof ArrayBuffer)return Array.from(new Uint8Array(n));let e=[];if(Array.isArray(n))return n.forEach(s=>{typeof s=="number"?e.push(s):e=e.concat(qe(s,t))}),e;if(typeof n=="number")for(;n>0;){const s=n&255;e.unshift(s),n=(n-s)/256}if(typeof n=="string")if(t){let s=n.toLowerCase();switch(t){case 16:default:s.indexOf("0x")==0&&(s=s.slice(2));for(let i=0,r=s.length;i<r;i+=2)e.push($t(s.slice(i,i+2),t));break}}else for(const s of n){const i=s.codePointAt(0);i&&e.push(i)}return e}function ta(n,t){if(n instanceof ArrayBuffer)return n;const e=qe(n,t);return new Uint8Array(e).buffer}function ea(n,t){const e=qe(n,t);return Hr?Buffer.from(e).toString("utf8"):String.fromCodePoint.apply(null,e)}function sa(n,t){const e=qe(n,t);let s="";for(let i=0,r=e.length;i<r;i++)s+=Qr(e[i],16).padStart(2,"0");return s}function na(){const n=Uint32Array.of(305419896),t=new Uint8Array(n.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}const Un=n=>{let t=Rt.UNKNOWN;switch(new DataView(n).getUint32(0,na()).toString(16).toUpperCase()){case"FFD8FFDB":t=Rt.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Rt.JPEG;break;case"89504E47":t=Rt.PNG;break;case"47494638":t=Rt.GIF;break;case"52494646":t=Rt.WEBP;break;case"25504446":t=Rt.PDF;break;case"504B0304":t=Rt.ZIP;break}return t};function Vn(n){const t=typeof n;return t!=="object"?t:Object.prototype.toString.call(n).replace(/^\[object (\S+)\]$/,"$1").toLowerCase()}function ia(n){return Vn(n)==="array"}function ra(n){return n!=null}function Ye(n){return Vn(n)==="object"}function aa(n,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(n,e,s)}}function Gn(n,t=new WeakMap){if(n==null)return n;if(n.constructor===Date)return new Date(n);if(n.constructor===RegExp)return new RegExp(n);if(typeof n!="object")return n;if(t.has(n))return t.get(n);const e=Object.create(Object.getPrototypeOf(n),Object.getOwnPropertyDescriptors(n));for(const s of Reflect.ownKeys(n))e[s]=Ye(n[s])?Gn(n[s],t):n[s];return t.set(n,e),e}function oa(n){if(n=parseFloat(n),isNaN(n))throw new Error(`${n}不能转换为number!`);return n}function me(n,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(n-t)<e}const lt=(n,t,e)=>n<t?t:n>e?e:n;function Vt(n,t=12){return+oa(n).toFixed(t)}function ca(n,t){const e=Rn("number-single",n);return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):ra(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?n.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?n.substring(e.matchIndex+e.fullMatch.length):""}}function zn(n){const t=Rn("number",n);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}function ha(n,t){let e;return function(...s){clearTimeout(e),e=setTimeout(()=>{n.apply(this,s)},t)}}class Rs{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 i=(()=>{let r=!1;return(...a)=>{r||(r=!0,Reflect.apply(e,this,a),this.off(t,i))}})();return this.on(t,i),this}}var jn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function la(n,t={}){var e=1,s=1;function i(M){var _=M.match(/\n/g);_&&(e+=_.length);var U=M.lastIndexOf(`
|
|
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(jn,""),value:U?Ot(U[0]).replace(jn,""):""});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 Os(h())}function Ot(n){return n?n.replace(/^\s+|\s+$/g,""):""}function Os(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){Os(a,s)}):r&&typeof r=="object"&&Os(r,s)}return e&&Object.defineProperty(n,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),n}const Ls=(n,t="image/svg+xml",e="utf-8")=>e==="base64"?new Blob([n],{type:`${t};${e}`}):new Blob([n],{type:`${t};charset=${e}`}),Ns=n=>new XMLSerializer().serializeToString(n),ua=(n,t="text/html")=>new DOMParser().parseFromString(n,t),Xn=(n,t="image/svg+xml",e="utf-8")=>Ls(Ns(n),t,e),Fs=(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 qn(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(`.${Yn(o)}`))&&s(new Error(`Please select files in ${n} format`)),i.remove(),e(a)}};i.addEventListener("change",r),i.click()})}function He(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 He(n,"arrayBuffer");return Un(t)}const Yn=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 pe(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=>{pe(s,e)})),t.appendChild(e)}function Hn(n,t){if(n.tag!==t.tag){if(!n.el)return;const e=n.el.parentElement||document.body;e.removeChild(n.el),pe(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=>{pe(o,e)});else{const o=Math.min(r.length,a.length);for(let c=0;c<o;c++)Hn(r[c],a[c]);a.length>r.length&&a.slice(r.length).forEach(c=>{pe(c,e)}),a.length<r.length&&r.slice(a.length).forEach(c=>{c.el&&e.removeChild(c.el)})}}}function Wn(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]?Wn(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 $n(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:Jn(n),y:Zn(n)}}function Jn(n){let t=0;for(;n!==null;)t+=n.offsetLeft,n=n.offsetParent;return t}function Zn(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 Kn(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 Qn(n,t){const e=Kn(t),s=$n(n);return{x:e.x-s.x,y:e.y-s.y}}function Bs(){return typeof window<"u"?window:this||{}}const We=()=>{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()},Us=()=>{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 Vs(){return We()==="ios"}function Gs(){return We()==="macos"}function ka(){return Vs()|Gs()}function ti(){return We()==="android"}function Ia(){return Vs()||ti()}function Ma(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function ei(){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=ei()!==-1;function Oa(){const n=document.documentMode;return n&&(n===9||n===10)}function si(){return Us()==="wechat"}function ni(){return Us()==="ali"}function La(){return si()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function Na(){return ni()&&navigator.userAgent.match(/miniprogram/i)}const Fa=typeof document<"u",ii=typeof window<"u",Ba=typeof history<"u",Ua=ii&&window.File&&window.FileReader&&window.FileList&&window.Blob,ri=(()=>{const n=Bs();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",ai=function(){if(!Bs().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 $e(n,t,e=0){return Math.sqrt(n*n+t*t+e*e)}function Je(n,t,e,s){const i=n-e,r=t-s;return $e(i,r)}function ge(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(ge(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 oi=[1,0,0,1,0,0],ci=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class Z{value;matrix3d;isEverTo3d=!1;constructor(t=oi){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(oi),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=On("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=ci){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(ci),this}fromString(t){const e=On("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 zs(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=zs(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=Fn(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=Fn(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){
|
|
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
|
|
18
|
+
})`}static escape(t,e="encode"){const s={"&":"&","<":"<",">":">",'"':""","'":"'"};for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t=t.replace(new RegExp(e=="encode"?i:s[i],"g"),e=="encode"?s[i]:i));return t}static getInnerText=t=>{let e=t.innerText;if(!e){const s=t.querySelector("slot")?.assignedNodes()||[];let i=0;for(;!e&&i<=s.length-1;)"innerText"in s[i]&&(e=s[i].innerText),i++}return e};static copyToClipboard=t=>new Promise((e,s)=>{if(navigator.clipboard)navigator.clipboard.writeText(t).then(e).catch(s);else{const i=document.createElement("textarea");i.value=t,i.style.opacity="0",i.style.top="0",i.style.left="0",i.style.position="fixed",document.body.appendChild(i),i.focus(),i.select();try{document.execCommand("copy")?e():s()}catch(r){s(r)}document.body.removeChild(i)}});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 i=document.createElement("span");i.style.visibility="hidden",i.style.padding="0",i.style.whiteSpace="nowrap",i.style.overflow="visible",i.style.fontSize=e>12?e+"px":"12px",i.style.fontWeight=s.toString(),i.innerText=t,document.body.appendChild(i);const r=i.offsetWidth;return document.body.removeChild(i),r};static getFixedWidthText=(t,e,s=12,i=400,r=!0)=>{let a="";if(!t||e<s)return a;const o=t.split(""),c="...";let h=r?A.measureText(c,s,i):0;for(let l=0,f=o.length;l<f;l++)if(h+=A.measureText(o[l],s,i),h>e){r&&(a+=c);break}else a+=o[l];return a}}function Xa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var hi={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(
|
|
23
|
-
`+
|
|
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",O=t.console&&(t.console.warn||t.console.log);return O&&O.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 y=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)&&(y[I]=P[I])}return y}:v=Object.assign;var b=m(function(d,y,x){for(var P=Object.keys(y),I=0;I<P.length;)(!x||x&&d[P[I]]===i)&&(d[P[I]]=y[P[I]]),I++;return d},"extend","Use `assign`."),S=m(function(d,y){return b(d,y,!0)},"merge","Use `assign`.");function C(u,d,y){var x=d.prototype,P;P=u.prototype=Object.create(x),P.constructor=u,P._super=x,y&&v(P,y)}function M(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 B(u,d){return u===i?d:u}function N(u,d,y){w(nt(d),function(x){u.addEventListener(x,y,!1)})}function W(u,d,y){w(nt(d),function(x){u.removeEventListener(x,y,!1)})}function it(u,d){for(;u;){if(u==d)return!0;u=u.parentNode}return!1}function q(u,d){return u.indexOf(d)>-1}function nt(u){return u.trim().split(/\s+/g)}function Y(u,d,y){if(u.indexOf&&!y)return u.indexOf(d);for(var x=0;x<u.length;){if(y&&u[x][y]==d||!y&&u[x]===d)return x;x++}return-1}function $(u){return Array.prototype.slice.call(u,0)}function ht(u,d,y){for(var x=[],P=[],I=0;I<u.length;){var O=d?u[I][d]:u[I];Y(P,O)<0&&x.push(u[I]),P[I]=O,I++}return y&&(d?x=x.sort(function(at,ut){return at[d]>ut[d]}):x=x.sort()),x}function rt(u,d){for(var y,x,P=d[0].toUpperCase()+d.slice(1),I=0;I<r.length;){if(y=r[I],x=y?y+P:d,x in u)return x;I++}return i}var j=1;function V(){return j++}function U(u){var d=u.ownerDocument||u;return d.defaultView||d.parentWindow||t}var A=/mobile|tablet|ip(ad|hone|od)|android/i,k="ontouchstart"in t,_=rt(t,"PointerEvent")!==i,F=k&&A.test(navigator.userAgent),G="touch",St="pen",Ht="mouse",hl="kinect",ll=25,lt=1,Kt=2,K=4,dt=8,dn=1,Re=2,Oe=4,Le=8,Ne=16,It=Re|Oe,Qt=Le|Ne,mr=It|Qt,pr=["x","y"],mn=["clientX","clientY"];function Ct(u,d){var y=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])&&y.handler(x)},this.init()}Ct.prototype={handler:function(){},init:function(){this.evEl&&N(this.element,this.evEl,this.domHandler),this.evTarget&&N(this.target,this.evTarget,this.domHandler),this.evWin&&N(U(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&W(this.element,this.evEl,this.domHandler),this.evTarget&&W(this.target,this.evTarget,this.domHandler),this.evWin&&W(U(this.element),this.evWin,this.domHandler)}};function ul(u){var d,y=u.options.inputClass;return y?d=y:_?d=ps:F?d=yn:k?d=gs:d=gn,new d(u,fl)}function fl(u,d,y){var x=y.pointers.length,P=y.changedPointers.length,I=d<&&x-P===0,O=d&(K|dt)&&x-P===0;y.isFirst=!!I,y.isFinal=!!O,I&&(u.session={}),y.eventType=d,dl(u,y),u.emit("hammer.input",y),u.recognize(y),u.session.prevInput=y}function dl(u,d){var y=u.session,x=d.pointers,P=x.length;y.firstInput||(y.firstInput=gr(d)),P>1&&!y.firstMultiple?y.firstMultiple=gr(d):P===1&&(y.firstMultiple=!1);var I=y.firstInput,O=y.firstMultiple,st=O?O.center:I.center,at=d.center=yr(x);d.timeStamp=l(),d.deltaTime=d.timeStamp-I.timeStamp,d.angle=ms(st,at),d.distance=pn(st,at),ml(y,d),d.offsetDirection=vr(d.deltaX,d.deltaY);var ut=wr(d.deltaTime,d.deltaX,d.deltaY);d.overallVelocityX=ut.x,d.overallVelocityY=ut.y,d.overallVelocity=h(ut.x)>h(ut.y)?ut.x:ut.y,d.scale=O?yl(O.pointers,x):1,d.rotation=O?gl(O.pointers,x):0,d.maxPointers=y.prevInput?d.pointers.length>y.prevInput.maxPointers?d.pointers.length:y.prevInput.maxPointers:d.pointers.length,pl(y,d);var Rt=u.element;it(d.srcEvent.target,Rt)&&(Rt=d.srcEvent.target),d.target=Rt}function ml(u,d){var y=d.center,x=u.offsetDelta||{},P=u.prevDelta||{},I=u.prevInput||{};(d.eventType===lt||I.eventType===K)&&(P=u.prevDelta={x:I.deltaX||0,y:I.deltaY||0},x=u.offsetDelta={x:y.x,y:y.y}),d.deltaX=P.x+(y.x-x.x),d.deltaY=P.y+(y.y-x.y)}function pl(u,d){var y=u.lastInterval||d,x=d.timeStamp-y.timeStamp,P,I,O,st;if(d.eventType!=dt&&(x>ll||y.velocity===i)){var at=d.deltaX-y.deltaX,ut=d.deltaY-y.deltaY,Rt=wr(x,at,ut);I=Rt.x,O=Rt.y,P=h(Rt.x)>h(Rt.y)?Rt.x:Rt.y,st=vr(at,ut),u.lastInterval=d}else P=y.velocity,I=y.velocityX,O=y.velocityY,st=y.direction;d.velocity=P,d.velocityX=I,d.velocityY=O,d.direction=st}function gr(u){for(var d=[],y=0;y<u.pointers.length;)d[y]={clientX:c(u.pointers[y].clientX),clientY:c(u.pointers[y].clientY)},y++;return{timeStamp:l(),pointers:d,center:yr(d),deltaX:u.deltaX,deltaY:u.deltaY}}function yr(u){var d=u.length;if(d===1)return{x:c(u[0].clientX),y:c(u[0].clientY)};for(var y=0,x=0,P=0;P<d;)y+=u[P].clientX,x+=u[P].clientY,P++;return{x:c(y/d),y:c(x/d)}}function wr(u,d,y){return{x:d/u||0,y:y/u||0}}function vr(u,d){return u===d?dn:h(u)>=h(d)?u<0?Re:Oe:d<0?Le:Ne}function pn(u,d,y){y||(y=pr);var x=d[y[0]]-u[y[0]],P=d[y[1]]-u[y[1]];return Math.sqrt(x*x+P*P)}function ms(u,d,y){y||(y=pr);var x=d[y[0]]-u[y[0]],P=d[y[1]]-u[y[1]];return Math.atan2(P,x)*180/Math.PI}function gl(u,d){return ms(d[1],d[0],mn)+ms(u[1],u[0],mn)}function yl(u,d){return pn(d[0],d[1],mn)/pn(u[0],u[1],mn)}var wl={mousedown:lt,mousemove:Kt,mouseup:K},vl="mousedown",bl="mousemove mouseup";function gn(){this.evEl=vl,this.evWin=bl,this.pressed=!1,Ct.apply(this,arguments)}C(gn,Ct,{handler:function(d){var y=wl[d.type];y<&&d.button===0&&(this.pressed=!0),y&Kt&&d.which!==1&&(y=K),this.pressed&&(y&K&&(this.pressed=!1),this.callback(this.manager,y,{pointers:[d],changedPointers:[d],pointerType:Ht,srcEvent:d}))}});var xl={pointerdown:lt,pointermove:Kt,pointerup:K,pointercancel:dt,pointerout:dt},Sl={2:G,3:St,4:Ht,5:hl},br="pointerdown",xr="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(br="MSPointerDown",xr="MSPointerMove MSPointerUp MSPointerCancel");function ps(){this.evEl=br,this.evWin=xr,Ct.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}C(ps,Ct,{handler:function(d){var y=this.store,x=!1,P=d.type.toLowerCase().replace("ms",""),I=xl[P],O=Sl[d.pointerType]||d.pointerType,st=O==G,at=Y(y,d.pointerId,"pointerId");I<&&(d.button===0||st)?at<0&&(y.push(d),at=y.length-1):I&(K|dt)&&(x=!0),!(at<0)&&(y[at]=d,this.callback(this.manager,I,{pointers:y,changedPointers:[d],pointerType:O,srcEvent:d}),x&&y.splice(at,1))}});var Cl={touchstart:lt,touchmove:Kt,touchend:K,touchcancel:dt},Tl="touchstart",El="touchstart touchmove touchend touchcancel";function Sr(){this.evTarget=Tl,this.evWin=El,this.started=!1,Ct.apply(this,arguments)}C(Sr,Ct,{handler:function(d){var y=Cl[d.type];if(y===lt&&(this.started=!0),!!this.started){var x=Pl.call(this,d,y);y&(K|dt)&&x[0].length-x[1].length===0&&(this.started=!1),this.callback(this.manager,y,{pointers:x[0],changedPointers:x[1],pointerType:G,srcEvent:d})}}});function Pl(u,d){var y=$(u.touches),x=$(u.changedTouches);return d&(K|dt)&&(y=ht(y.concat(x),"identifier",!0)),[y,x]}var _l={touchstart:lt,touchmove:Kt,touchend:K,touchcancel:dt},Dl="touchstart touchmove touchend touchcancel";function yn(){this.evTarget=Dl,this.targetIds={},Ct.apply(this,arguments)}C(yn,Ct,{handler:function(d){var y=_l[d.type],x=Al.call(this,d,y);x&&this.callback(this.manager,y,{pointers:x[0],changedPointers:x[1],pointerType:G,srcEvent:d})}});function Al(u,d){var y=$(u.touches),x=this.targetIds;if(d&(lt|Kt)&&y.length===1)return x[y[0].identifier]=!0,[y,y];var P,I,O=$(u.changedTouches),st=[],at=this.target;if(I=y.filter(function(ut){return it(ut.target,at)}),d===lt)for(P=0;P<I.length;)x[I[P].identifier]=!0,P++;for(P=0;P<O.length;)x[O[P].identifier]&&st.push(O[P]),d&(K|dt)&&delete x[O[P].identifier],P++;if(st.length)return[ht(I.concat(st),"identifier",!0),st]}var kl=2500,Cr=25;function gs(){Ct.apply(this,arguments);var u=M(this.handler,this);this.touch=new yn(this.manager,u),this.mouse=new gn(this.manager,u),this.primaryTouch=null,this.lastTouches=[]}C(gs,Ct,{handler:function(d,y,x){var P=x.pointerType==G,I=x.pointerType==Ht;if(!(I&&x.sourceCapabilities&&x.sourceCapabilities.firesTouchEvents)){if(P)Il.call(this,y,x);else if(I&&Ml.call(this,x))return;this.callback(d,y,x)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Il(u,d){u<?(this.primaryTouch=d.changedPointers[0].identifier,Tr.call(this,d)):u&(K|dt)&&Tr.call(this,d)}function Tr(u){var d=u.changedPointers[0];if(d.identifier===this.primaryTouch){var y={x:d.clientX,y:d.clientY};this.lastTouches.push(y);var x=this.lastTouches,P=function(){var I=x.indexOf(y);I>-1&&x.splice(I,1)};setTimeout(P,kl)}}function Ml(u){for(var d=u.srcEvent.clientX,y=u.srcEvent.clientY,x=0;x<this.lastTouches.length;x++){var P=this.lastTouches[x],I=Math.abs(d-P.x),O=Math.abs(y-P.y);if(I<=Cr&&O<=Cr)return!0}return!1}var Er=rt(a.style,"touchAction"),Pr=Er!==i,_r="compute",Dr="auto",ys="manipulation",te="none",Fe="pan-x",Be="pan-y",wn=Ol();function ws(u,d){this.manager=u,this.set(d)}ws.prototype={set:function(u){u==_r&&(u=this.compute()),Pr&&this.manager.element.style&&wn[u]&&(this.manager.element.style[Er]=u),this.actions=u.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var u=[];return w(this.manager.recognizers,function(d){R(d.options.enable,[d])&&(u=u.concat(d.getTouchAction()))}),Rl(u.join(" "))},preventDefaults:function(u){var d=u.srcEvent,y=u.offsetDirection;if(this.manager.session.prevented){d.preventDefault();return}var x=this.actions,P=q(x,te)&&!wn[te],I=q(x,Be)&&!wn[Be],O=q(x,Fe)&&!wn[Fe];if(P){var st=u.pointers.length===1,at=u.distance<2,ut=u.deltaTime<250;if(st&&at&&ut)return}if(!(O&&I)&&(P||I&&y&It||O&&y&Qt))return this.preventSrc(d)},preventSrc:function(u){this.manager.session.prevented=!0,u.preventDefault()}};function Rl(u){if(q(u,te))return te;var d=q(u,Fe),y=q(u,Be);return d&&y?te:d||y?d?Fe:Be:q(u,ys)?ys:Dr}function Ol(){if(!Pr)return!1;var u={},d=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(y){u[y]=d?t.CSS.supports("touch-action",y):!0}),u}var vn=1,Tt=2,le=4,Wt=8,Ut=Wt,Ue=16,Mt=32;function Vt(u){this.options=v({},this.defaults,u||{}),this.id=V(),this.manager=null,this.options.enable=B(this.options.enable,!0),this.state=vn,this.simultaneous={},this.requireFail=[]}Vt.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=bn(u,this),d[u.id]||(d[u.id]=u,u.recognizeWith(this)),this},dropRecognizeWith:function(u){return g(u,"dropRecognizeWith",this)?this:(u=bn(u,this),delete this.simultaneous[u.id],this)},requireFailure:function(u){if(g(u,"requireFailure",this))return this;var d=this.requireFail;return u=bn(u,this),Y(d,u)===-1&&(d.push(u),u.requireFailure(this)),this},dropRequireFailure:function(u){if(g(u,"dropRequireFailure",this))return this;u=bn(u,this);var d=Y(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,y=this.state;function x(P){d.manager.emit(P,u)}y<Wt&&x(d.options.event+Ar(y)),x(d.options.event),u.additionalEvent&&x(u.additionalEvent),y>=Wt&&x(d.options.event+Ar(y))},tryEmit:function(u){if(this.canEmit())return this.emit(u);this.state=Mt},canEmit:function(){for(var u=0;u<this.requireFail.length;){if(!(this.requireFail[u].state&(Mt|vn)))return!1;u++}return!0},recognize:function(u){var d=v({},u);if(!R(this.options.enable,[this,d])){this.reset(),this.state=Mt;return}this.state&(Ut|Ue|Mt)&&(this.state=vn),this.state=this.process(d),this.state&(Tt|le|Wt|Ue)&&this.tryEmit(d)},process:function(u){},getTouchAction:function(){},reset:function(){}};function Ar(u){return u&Ue?"cancel":u&Wt?"end":u&le?"move":u&Tt?"start":""}function kr(u){return u==Ne?"down":u==Le?"up":u==Re?"left":u==Oe?"right":""}function bn(u,d){var y=d.manager;return y?y.get(u):u}function Dt(){Vt.apply(this,arguments)}C(Dt,Vt,{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,y=u.eventType,x=d&(Tt|le),P=this.attrTest(u);return x&&(y&dt||!P)?d|Ue:x||P?y&K?d|Wt:d&Tt?d|le:Tt:Mt}});function xn(){Dt.apply(this,arguments),this.pX=null,this.pY=null}C(xn,Dt,{defaults:{event:"pan",threshold:10,pointers:1,direction:mr},getTouchAction:function(){var u=this.options.direction,d=[];return u&It&&d.push(Be),u&Qt&&d.push(Fe),d},directionTest:function(u){var d=this.options,y=!0,x=u.distance,P=u.direction,I=u.deltaX,O=u.deltaY;return P&d.direction||(d.direction&It?(P=I===0?dn:I<0?Re:Oe,y=I!=this.pX,x=Math.abs(u.deltaX)):(P=O===0?dn:O<0?Le:Ne,y=O!=this.pY,x=Math.abs(u.deltaY))),u.direction=P,y&&x>d.threshold&&P&d.direction},attrTest:function(u){return Dt.prototype.attrTest.call(this,u)&&(this.state&Tt||!(this.state&Tt)&&this.directionTest(u))},emit:function(u){this.pX=u.deltaX,this.pY=u.deltaY;var d=kr(u.direction);d&&(u.additionalEvent=this.options.event+d),this._super.emit.call(this,u)}});function vs(){Dt.apply(this,arguments)}C(vs,Dt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[te]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.scale-1)>this.options.threshold||this.state&Tt)},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 bs(){Vt.apply(this,arguments),this._timer=null,this._input=null}C(bs,Vt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Dr]},process:function(u){var d=this.options,y=u.pointers.length===d.pointers,x=u.distance<d.threshold,P=u.deltaTime>d.time;if(this._input=u,!x||!y||u.eventType&(K|dt)&&!P)this.reset();else if(u.eventType<)this.reset(),this._timer=f(function(){this.state=Ut,this.tryEmit()},d.time,this);else if(u.eventType&K)return Ut;return Mt},reset:function(){clearTimeout(this._timer)},emit:function(u){this.state===Ut&&(u&&u.eventType&K?this.manager.emit(this.options.event+"up",u):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function xs(){Dt.apply(this,arguments)}C(xs,Dt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[te]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.rotation)>this.options.threshold||this.state&Tt)}});function Ss(){Dt.apply(this,arguments)}C(Ss,Dt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:It|Qt,pointers:1},getTouchAction:function(){return xn.prototype.getTouchAction.call(this)},attrTest:function(u){var d=this.options.direction,y;return d&(It|Qt)?y=u.overallVelocity:d&It?y=u.overallVelocityX:d&Qt&&(y=u.overallVelocityY),this._super.attrTest.call(this,u)&&d&u.offsetDirection&&u.distance>this.options.threshold&&u.maxPointers==this.options.pointers&&h(y)>this.options.velocity&&u.eventType&K},emit:function(u){var d=kr(u.offsetDirection);d&&this.manager.emit(this.options.event+d,u),this.manager.emit(this.options.event,u)}});function Sn(){Vt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}C(Sn,Vt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ys]},process:function(u){var d=this.options,y=u.pointers.length===d.pointers,x=u.distance<d.threshold,P=u.deltaTime<d.time;if(this.reset(),u.eventType<&&this.count===0)return this.failTimeout();if(x&&P&&y){if(u.eventType!=K)return this.failTimeout();var I=this.pTime?u.timeStamp-this.pTime<d.interval:!0,O=!this.pCenter||pn(this.pCenter,u.center)<d.posThreshold;this.pTime=u.timeStamp,this.pCenter=u.center,!O||!I?this.count=1:this.count+=1,this._input=u;var st=this.count%d.taps;if(st===0)return this.hasRequireFailures()?(this._timer=f(function(){this.state=Ut,this.tryEmit()},d.interval,this),Tt):Ut}return Mt},failTimeout:function(){return this._timer=f(function(){this.state=Mt},this.options.interval,this),Mt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Ut&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Gt(u,d){return d=d||{},d.recognizers=B(d.recognizers,Gt.defaults.preset),new Cs(u,d)}Gt.VERSION="2.0.7",Gt.defaults={domEvents:!1,touchAction:_r,enable:!0,inputTarget:null,inputClass:null,preset:[[xs,{enable:!1}],[vs,{enable:!1},["rotate"]],[Ss,{direction:It}],[xn,{direction:It},["swipe"]],[Sn],[Sn,{event:"doubletap",taps:2},["tap"]],[bs]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Ll=1,Ir=2;function Cs(u,d){this.options=v({},Gt.defaults,d||{}),this.options.inputTarget=this.options.inputTarget||u,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=u,this.input=ul(this),this.touchAction=new ws(this,this.options.touchAction),Mr(this,!0),w(this.options.recognizers,function(y){var x=this.add(new y[0](y[1]));y[2]&&x.recognizeWith(y[2]),y[3]&&x.requireFailure(y[3])},this)}Cs.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?Ir:Ll},recognize:function(u){var d=this.session;if(!d.stopped){this.touchAction.preventDefaults(u);var y,x=this.recognizers,P=d.curRecognizer;(!P||P&&P.state&Ut)&&(P=d.curRecognizer=null);for(var I=0;I<x.length;)y=x[I],d.stopped!==Ir&&(!P||y==P||y.canRecognizeWith(P))?y.recognize(u):y.reset(),!P&&y.state&(Tt|le|Wt)&&(P=d.curRecognizer=y),I++}},get:function(u){if(u instanceof Vt)return u;for(var d=this.recognizers,y=0;y<d.length;y++)if(d[y].options.event==u)return d[y];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,y=Y(d,u);y!==-1&&(d.splice(y,1),this.touchAction.update())}return this},on:function(u,d){if(u!==i&&d!==i){var y=this.handlers;return w(nt(u),function(x){y[x]=y[x]||[],y[x].push(d)}),this}},off:function(u,d){if(u!==i){var y=this.handlers;return w(nt(u),function(x){d?y[x]&&y[x].splice(Y(y[x],d),1):delete y[x]}),this}},emit:function(u,d){this.options.domEvents&&Nl(u,d);var y=this.handlers[u]&&this.handlers[u].slice();if(!(!y||!y.length)){d.type=u,d.preventDefault=function(){d.srcEvent.preventDefault()};for(var x=0;x<y.length;)y[x](d),x++}},destroy:function(){this.element&&Mr(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Mr(u,d){var y=u.element;if(y.style){var x;w(u.options.cssProps,function(P,I){x=rt(y.style,I),d?(u.oldCssProps[x]=y.style[x],y.style[x]=P):y.style[x]=u.oldCssProps[x]||""}),d||(u.oldCssProps={})}}function Nl(u,d){var y=e.createEvent("Event");y.initEvent(u,!0,!0),y.gesture=d,d.target.dispatchEvent(y)}v(Gt,{INPUT_START:lt,INPUT_MOVE:Kt,INPUT_END:K,INPUT_CANCEL:dt,STATE_POSSIBLE:vn,STATE_BEGAN:Tt,STATE_CHANGED:le,STATE_ENDED:Wt,STATE_RECOGNIZED:Ut,STATE_CANCELLED:Ue,STATE_FAILED:Mt,DIRECTION_NONE:dn,DIRECTION_LEFT:Re,DIRECTION_RIGHT:Oe,DIRECTION_UP:Le,DIRECTION_DOWN:Ne,DIRECTION_HORIZONTAL:It,DIRECTION_VERTICAL:Qt,DIRECTION_ALL:mr,Manager:Cs,Input:Ct,TouchAction:ws,TouchInput:yn,MouseInput:gn,PointerEventInput:ps,TouchMouseInput:gs,SingleTouchInput:Sr,Recognizer:Vt,AttrRecognizer:Dt,Tap:Sn,Pan:xn,Swipe:Ss,Pinch:vs,Rotate:xs,Press:bs,on:N,off:W,each:w,merge:S,extend:b,assign:v,inherit:C,bindFn:M,prefixed:rt});var Fl=typeof t<"u"?t:typeof self<"u"?self:{};Fl.Hammer=Gt,typeof i=="function"&&i.amd?i(function(){return Gt}):s.exports?s.exports=Gt:t[n]=Gt})(window,document,"Hammer")})(ni);var ka=ni.exports;const Ia=Aa(ka);function Ln(s,t,e,n,i,r,a,o,c,h){let l=Math.PI*120/180,f=Math.PI/180*(+i||0),g=[],w,m=function(j,V,U){const A=j*Math.cos(U)-V*Math.sin(U),k=j*Math.sin(U)+V*Math.cos(U);return{x:A,y:k}},v,b,S,C;if(h)v=h[0],b=h[1],S=h[2],C=h[3];else{w=m(s,t,-f),s=w.x,t=w.y,w=m(o,c,-f),o=w.x,c=w.y;let j=(s-o)/2,V=(t-c)/2,U=j*j/(e*e)+V*V/(n*n);U>1&&(U=Math.sqrt(U),e=U*e,n=U*n);let A=e*e,k=n*n,_=(r==a?-1:1)*Math.sqrt(Math.abs((A*k-A*V*V-k*j*j)/(A*V*V+k*j*j)));S=_*e*V/n+(s+o)/2,C=_*-n*j/e+(t+c)/2,v=Math.asin(Number(((t-C)/n).toFixed(9))),b=Math.asin(Number(((c-C)/n).toFixed(9))),v=s<S?Math.PI-v:v,b=o<S?Math.PI-b:b,v<0&&(v=Math.PI*2+v),b<0&&(b=Math.PI*2+b),a&&v>b&&(v=v-Math.PI*2),!a&&b>v&&(b=b-Math.PI*2)}let M=b-v;if(Math.abs(M)>l){let j=b,V=o,U=c;b=v+l*(a&&b>v?1:-1),o=S+e*Math.cos(b),c=C+n*Math.sin(b),g=Ln(o,c,e,n,i,0,a,V,U,[b,j,S,C])}M=b-v;let R=Math.cos(v),B=Math.sin(v),N=Math.cos(b),W=Math.sin(b),it=Math.tan(M/4),q=4/3*e*it,nt=4/3*n*it,Y=[s,t],$=[s+q*B,t-nt*R],ht=[o+q*W,c-nt*N],rt=[o,c];return $[0]=2*Y[0]-$[0],$[1]=2*Y[1]-$[1],h?[[...$,...ht,...rt]].concat(g):[[...$,...ht,...rt]].concat(g).map(j=>{const V=[];for(let U=0,A=j.length;U<A;U++)V[U]=U%2?m(j[U-1],j[U],f).y:m(j[U],j[U+1],f).x;return V})}function Nn(s,t,e,n,i,r){return[s/3+.6666666666666666*e,t/3+.6666666666666666*n,i/3+.6666666666666666*e,r/3+.6666666666666666*n,i,r]}function me(s,t,e,n){return[s,t,e,n,e,n]}const pe={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 n=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&D.attribute(n,e),n}static createSvgPath(t){return this.createSVGElement("path",{d:t})}static downloadFromSVGElement(t,e="shape"){return Dn(Bs(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return Dn(Pn(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return _n(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,(n,i,r)=>{let a=i.toLowerCase();const o=jr(r);for(a=="m"&&o.length>pe[a]&&(e.push([i,...o.splice(0,pe[a])]),a="l",i=i=="m"?"l":"L");o.length;){if(o.length<pe[a])throw new Error(`parseSVGPath substring:{ ${n} } command:{ ${i} } args:{ ${o} }`);e.push([i,...o.splice(0,pe[a])])}return a=="z"&&e.push([i]),""}),e}static absolutizeSVGPath(t){let e=0,n=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=n;break;case"H":i=a[1];break;case"V":r=a[1];break;case"M":i=e=a[1],r=n=a[2];break;default:i=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,n=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=n;break;case"h":i+=a[1];break;case"v":r+=a[1];break;case"m":i+=a[1],r+=a[2],e+=a[1],n+=a[2];break;default:i+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){let e=[],n=0,i=0,r=0,a=0,o=0,c=0,h=0,l=0,f;for(let g=0,w=t.length;g<w;g++){let m=t[g];const v=m[0];switch(v){case"M":n=m[1],i=m[2];break;case"A":const b=Ln(r,a,m[1],m[2],m[3],m[4],m[5],m[6],m[7]);if(!b.length)continue;b.forEach((M,R)=>{const[B,N,W,it,q,nt]=M;m=["C",B,N,W,it,q,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",...Nn(r,a,o,c,m[1],m[2])];break;case"Q":o=m[1],c=m[2],m=["C",...Nn(r,a,m[1],m[2],m[3],m[4])];break;case"L":m=["C",...me(r,a,m[1],m[2])];break;case"H":m=["C",...me(r,a,m[1],a)];break;case"V":m=["C",...me(r,a,r,m[1])];break;case"Z":m=["C",...me(r,a,n,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 n=0,i=t.length;i-2>n;n+=2){let r;n==0?r=[{x:t[n],y:t[n+1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+4],y:t[n+5]}]:i-4==n?r=[{x:t[n-2],y:t[n-1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+2],y:t[n+3]}]:r=[{x:t[n-2],y:t[n-1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+4],y:t[n+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=[],n=["L",0,0],i;for(let r=0,a=t.length;r<a;r++){let o=t[r];switch(o[0]){case"M":n=["L",o[1],o[2]],e.push(o);break;case"Z":e.push(n);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 n,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,n&&(n[0]===h.to?(i=2*Number(n[h.x+2])-Number(n[h.x]),r=2*Number(n[h.x+3])-Number(n[h.x+1])):(i=Number(n[n.length-2]),r=Number(n[n.length-1]))),c.splice(1,0,i,r)),n=c}return t}static curveDim(t,e,n,i,r,a,o,c){const h=[],l=[[],[]];let f,g,w,m,v,b,S,C;for(let N=0;N<2;++N){if(N===0?(g=6*t-12*n+6*r,f=-3*t+9*n-9*r+3*o,w=3*n-3*t):(g=6*e-12*i+6*a,f=-3*e+9*i-9*a+3*c,w=3*i-3*e),Math.abs(f)<1e-12){if(Math.abs(g)<1e-12)continue;m=-w/g,m>0&&m<1&&h.push(m);continue}S=g*g-4*w*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 M=h.length,R;const B=M;for(;M--;)m=h[M],R=1-m,l[0][M]=R*R*R*t+3*R*R*m*n+3*R*m*m*r+m*m*m*o,l[1][M]=R*R*R*e+3*R*R*m*i+3*R*m*m*a+m*m*m*c;return l[0][B]=t,l[1][B]=e,l[0][B+1]=o,l[1][B+1]=c,l[0].length=l[1].length=B+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,n,i,r){const a=-3*e+9*n-9*i+3*r,o=t*a+6*e-12*n+6*i;return t*o-3*e+3*n}static bezlen(t,e,n,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],w=[.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,n,r,o),C=this.base3(b,e,i,a,c),M=S*S+C*C;m+=w[v]*Math.sqrt(M)}return l*m}}const H=ne;class J{id;x;prevX;y;prevY;degree;prevDegree;scaleOnOrigin;prevScaleOnOrigin;skewDegreeOnOrigin;prevSkewDegreeOnOrigin;vx;vy;ax;ay;mass;attrs;enableDrag;targetToAfterDragFree;followMouse;isShow=!0;mouseMove;history=[];path2d=new Path2D;isDragging=!1;el;constructor(t){this.id=Or(),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({fill:"none",stroke:"none"},t?.attrs),this.enableDrag=t?.enableDrag||!1,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.mouseMove=t?.mouseMove}save(){this.history.push(Os(this))}restore(){const t=this.history.pop();t&&Ve(this,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}toSVGPathD(){const t=[],e=this.toSVGPathData();return e[0]&&Array.isArray(e[0])?t.push(...e):t.push(e),H.SVGPathDataToD(t)}distanceTo(t){return Rn(this.x,this.y,t.x,t.y)}angleTo(t){return this.degree=Q(de(this.x,this.y,t.x,t.y)),this.degree}followTo(t,e=3){const n=this.angleTo(t),{x:i,y:r}=zt(ot(n),e);this.vx=i,this.vy=r,this.nextFrame()}followAccelerationTo(t,e=.05){const n=this.angleTo(t),{x:i,y:r}=zt(ot(n),e);this.ax=i,this.ay=r,this.nextFrame()}nextFrame(t){const e=t?.gravity??0,n=t?.friction??0;if(this.vx+=this.ax,this.vy+=this.ay,this.vy+=e,n>0){const i=Math.atan2(this.vy,this.vx);let r=Math.sqrt(this.vx*this.vx+this.vy*this.vy);r>n?r-=n: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 n=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+=n,this.vx*=i,this.vy*=i,this.x+=this.vx,this.y+=this.vy}nextFrameSpringTo(t,e){const n=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,w=f*r;this.vx+=g,this.vy+=w}),this.vy+=n,this.vx*=i,this.vy*=i,this.x+=this.vx,this.y+=this.vy}static nextFrameSpringConnect(t,e){const n=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 si({x:c.x-Math.cos(ot(h))*n,y:c.y-Math.sin(ot(h))*n}),{spring:i,gravity:r,friction:a})})})}}class Pt extends J{width;height;borderRadius;constructor(t){super(t),this.width=t.width,this.height=t.height,this.borderRadius=t.borderRadius||0}static fromBezier(t,e,n,i,r,a,o,c){const h=ne.curveDim(t,e,n,i,r,a,o,c);return new Pt({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 Pt({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 mt extends J{radius;constructor(t){super(t),this.radius=t?.radius||0}getBoundingClientRect(){return new Pt({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 mt({x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2})}cross(t){const e=this.x,n=this.y;return this.x=n*t.x-e*t.y,this.y=e*t.y-n*t.x,this}normalize(t=1){const e=je(this.x,this.y);if(e){const n=t/e;this.x*=n,this.y*=n}return this}reflect(t,e){const n=t.x*e.x+t.y*e.y;return this.x=t.x-2*n*e.x,this.y=t.y-2*n*e.y,this}clone(t){return new mt({x:t.x,y:t.y,radius:t.radius})}nextFrameCollisionTo(t){const e=t.x-this.x,n=t.y-this.y;if(Math.sqrt(e*e+n*n)<this.radius+t.radius){const r=Math.atan2(n,e),a={x:0,y:0},o=Et(-r,e,n),c=Et(-r,this.vx,this.vy),h=Et(-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 w=Et(r,a.x,a.y),m=Et(r,o.x,o.y);t.x=this.x+m.x,t.y=this.y+m.y,this.x=this.x+w.x,this.y=this.y+w.y;const v=Et(r,c.x,c.y),b=Et(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 n=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*=n):this.x-this.radius<i&&(this.x=i+this.radius,this.vx*=n),this.y+this.radius>o?(this.y=o-this.radius,this.vy*=n):this.y-this.radius<r&&(this.y=r+this.radius,this.vy*=n)}}const si=mt;class ii{constructor(){}static getFormatKeyNames(t){const e=Mn(),n=[];return t.ctrl&&n.push(e?"Cmd":"Ctrl"),t.shift&&n.push("Shift"),t.alt&&n.push("Alt"),typeof t.key=="string"?n.push(Tn(t.key)):Array.isArray(t.key)&&(t.key.map(i=>Tn(i)),n.push(...t.key)),n}static matchKeyScheme(t,e){const n=t.ctrl??!1,i=t.shift??!1,r=t.alt??!1;if(t.exact)return(n===e.metaKey||n===e.ctrlKey)&&i===e.shiftKey&&r===e.altKey;const a=[];return n&&a.push(n===e.metaKey||n===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 n=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),n.removeEventListener("keyup",h)};n.addEventListener("keyup",h)}};return e.title=t?.title??"",e.formatedKeyNames=r,e.pause=()=>i=!0,e.restart=()=>i=!1,e.removeListener=()=>n.removeEventListener("keydown",a),n.addEventListener("keydown",a),e}}let wt;const se=[];class ge extends Ls{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 Ia(this.container),this.mousePoint=new mt({x:0,y:0}),e&&this.start()}emitDebounce=Xr((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(wt)return wt;wt=new ge,window.addEventListener("hashchange",()=>{wt.emit("hashchange",location.hash)}),window.addEventListener("popstate",()=>{wt.emit("popstate")}),wt.registerKeyDown({title:"打开",key:"o",ctrl:!0,exact:!0},()=>{Us().then(e=>Ge(e[0])).then(e=>{wt.emit("openFile",e)}).catch(e=>{wt.emit("openFileError",e)})}),wt.registerMatchMediaChange("(prefers-color-scheme: dark)");const t=()=>se.forEach(e=>e());return wt.registerGlobalScrollChange=e=>{se.push(e),se.length==1&&document.addEventListener("scroll",t)},wt.removeGlobalScrollChange=e=>{const n=se.findIndex(i=>i==e);n>=0&&(se.splice(n,1),se.length==0&&document.removeEventListener("scroll",t))},wt}start(){this.registerMouseEventListeners(),this.registerInputEventListeners(),this.registerTransitionEventListeners(),this.on("pointerMove",this.setMousePoint),this.addDOMEventBusRemoves(()=>{this.off("pointerMove",this.setMousePoint)}),this.registerResizeObserver(),this.registerElementDisplayInParentWhenScrollChange()}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=Hs(this.container,t);return this.mousePoint.x=e.x,this.mousePoint.y=e.y,e}registerMouseEventListeners(){const t=A=>{this.emit("mouseDown",A),this.container.style.userSelect="none"},e=A=>{this.emit("mouseUp",A),this.container.style.userSelect=""},n=A=>{this.emit("mouseMove",A)},i=A=>{this.emit("mouseOver",A)},r=A=>{this.emit("mouseOut",A),this.container.style.userSelect=""},a=A=>{this.emit("mouseClick",A)},o=A=>{this.emit("mouseDoubleClick",A)},c=A=>{this.emit("mouseWheel",A)},h=A=>{this.emit("mouseContextMenu",A)},l=A=>{this.emit("touchStart",A),this.container.style.userSelect="none"},f=A=>{this.emit("touchEnd",A),this.container.style.userSelect=""},g=A=>{this.emit("touchCancel",A),this.container.style.userSelect=""},w=A=>{this.emit("touchMove",A)},m=A=>{this.emit("pointerDown",A),this.container.style.userSelect="none"},v=A=>{this.emit("pointerUp",A),this.container.style.userSelect=""},b=A=>{this.emit("pointerCancel",A),this.container.style.userSelect=""},S=A=>{this.emit("pointerMove",A)},C=A=>{this.emit("pan",A)},M=A=>{this.emit("panStart",A),this.container.style.userSelect="none"},R=A=>{this.emit("panMove",A)},B=A=>{this.emit("panEnd",A),this.container.style.userSelect=""},N=A=>{this.emit("panCancel",A),this.container.style.userSelect=""},W=A=>{this.emit("panLeft",A)},it=A=>{this.emit("panRight",A)},q=A=>{this.emit("panUp",A),this.container.style.userSelect=""},nt=A=>{this.emit("panDown",A),this.container.style.userSelect="none"},Y=A=>{this.emit("pinch",A)},$=A=>{this.emit("press",A)},ht=A=>{this.emit("rotate",A)},rt=A=>{this.emit("swipe",A)},j=A=>{this.emit("tap",A)},V=A=>{!A.target||this.container==A.target||this.container.contains(A.target)||this.emit("tapOutSide",A)};this.container.addEventListener("mousedown",t),this.container.addEventListener("mouseup",e),this.container.addEventListener("mousemove",n),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",w),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",M),this.hammer.on("panmove",R),this.hammer.on("panend",B),this.hammer.on("pancancel",N),this.hammer.on("panleft",W),this.hammer.on("panright",it),this.hammer.on("panup",q),this.hammer.on("pandown",nt),this.hammer.on("pinch",Y),this.hammer.on("press",$),this.hammer.on("rotate",ht),this.hammer.on("swipe",rt),this.hammer.on("tap",j),document.addEventListener("pointerdown",V,!1);const U=()=>{this.container.removeEventListener("mousedown",t),this.container.removeEventListener("mouseup",e),this.container.removeEventListener("mousemove",n),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",w),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",M),this.hammer.off("panmove",R),this.hammer.off("panend",B),this.hammer.off("pancancel",N),this.hammer.off("panleft",W),this.hammer.off("panright",it),this.hammer.off("panup",q),this.hammer.off("pandown",nt),this.hammer.off("pinch",Y),this.hammer.off("press",$),this.hammer.off("rotate",ht),this.hammer.off("swipe",rt),this.hammer.off("tap",j),document.removeEventListener("pointerdown",V,!1),document.removeEventListener("touchstart",V,!1),document.removeEventListener("mousedown",V,!1)};return this.addDOMEventBusRemoves(U),U}registerInputEventListeners(){const t=c=>{this.emit("inputChange",c,this.container.files)},e=c=>{this.emit("dragstart",c)},n=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",n,!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",n,!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=n=>{this.emit("transitionend",n)};this.container.addEventListener("transitionend",t);const e=()=>{this.container.removeEventListener("transitionend",t)};return this.addDOMEventBusRemoves(e),e}registerKeyDown(t,e,n){const i=ii.on(t,a=>(e(a,i.formatedKeyNames,i.pause,i.restart),n)),r=()=>{i.removeListener?.()};return this.addDOMEventBusRemoves(r),r}registerResizeObserver(){const t=new ResizeObserver(n=>{const{width:i,height:r}=n[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 n=r=>{this.emit(e,r.matches)};window.matchMedia(t).addEventListener("change",n);const i=()=>{window.matchMedia(t).removeEventListener("change",n)};return this.addDOMEventBusRemoves(i),i}registerElementDisplayInParentWhenScrollChange(t){const e={threshold:t?.threshold||.5,root:t?.parentElement},n=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);n.observe(this.container);const i=()=>{n.unobserve(this.container)};return this.addDOMEventBusRemoves(i),i}registerPullDownRefresh(t){const e=t?.distance||50;let n=0,i=0;return this.captureMove({start:r=>{n=this.setMousePoint(r).y},move:()=>{i=this.mousePoint.y-n,i>0&&i<e&&this.emit("pullDownIng",i)},end:()=>{i>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;let n=0,i=0;return this.captureMove({start:r=>{n=this.setMousePoint(r).y},move:()=>{i=n-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)},n=a=>{this.container.style.userSelect="",t?.end?.(a)},i=a=>{t?.move?.(a)};this.on("pointerDown",e),this.on("pointerUp",n),this.on("pointerCancel",n),this.on("pointerMove",i);const r=()=>{this.off("pointerDown",e),this.off("pointerUp",n),this.off("pointerCancel",n),this.off("pointerMove",i)};return this.addDOMEventBusRemoves(r),r}captureMoveUseMouse(t){const e=a=>{document.addEventListener("mousemove",i,!1),document.addEventListener("mouseup",n,!1),this.container.style.userSelect="none",t?.start?.(a)},n=a=>{document.removeEventListener("mousemove",i,!1),document.removeEventListener("mouseup",n,!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)},n=a=>{t?.end?.(a)},i=a=>{t?.move?.(a)};this.on("touchStart",e),this.on("touchEnd",n),this.on("touchCancel",n),this.on("touchMove",i);const r=()=>{this.off("touchStart",e),this.off("touchEnd",n),this.off("touchCancel",n),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 ye{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"),n=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)",n.append(i),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(n),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(()=>{ye.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 ri extends Ls{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=Ps(this.source);if(t===0){this.emit("finish");return}let e,n,i=_s(this.source,0);for(let r=1;r<t;r++)e=n,n=i,i=_s(this.source,r),this.raw+=n,n&&this.step(n,i,e);i&&this.step(i,void 0,n),this.emit("finish")}step(t,e,n){t==`
|
|
25
|
-
`&&this.emit("newline"),this.act(t,e,n)}act(t,e,n){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":Ot("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(n=="!"&&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(n=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,n)),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=="-"&&n=="-"&&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(!Ot("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,n)}break;case"close tag name start":Ot("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,n));break;case"close tag name":if(Ot("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(Ot("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":Ot("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,n));break;case"attr":if(Ot("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(!Ot("whitespace",t)){if(this.mode="attr value",this.quote="",t=="'"||t=='"'){this.quote=t;return}this.act(t,e,n)}break;case"attr value":if(Ot("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&&n!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function Fn(s,t){if(typeof t<"u")window.localStorage.setItem(s,t);else return window.localStorage.getItem(s)??void 0}function Ma(s,t,e){const n=new Date;n.setTime(n.getTime()+e*24*60*60*1e3);const i="expires="+n.toUTCString();document.cookie=s+"="+t+"; "+i}function Ra(s){const t=s+"=",e=document.cookie.split(";");for(let n=0,i=e.length;n<i;n++){const r=e[n].trim();if(r.indexOf(t)==0)return r.substring(t.length,r.length)}return""}const Oa=()=>document.cookie.split(";").map(s=>s.split("=")).reduce((s,[t,e])=>(s[t.trim().replace('"',"")]=e,s),{}),La=()=>document.cookie.split(";").forEach(s=>document.cookie=s.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));ge.page.on("matchMediaChangePrefersColorSchemeDark",s=>{Xe(s?"dark":"light")}),ai();function Xe(s){Fn("colorScheme",s),document.documentElement.classList.toggle("dark",s=="dark")}function ai(){const s=Fn("colorScheme");if(s=="dark"||s=="light")return Xe(s),s;{const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return Xe(t),t}}const Na={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"};function jt(s,t){if(s.hasOwnProperty("r")&&s.hasOwnProperty("g")&&s.hasOwnProperty("b"))return s.r=Math.round(yt(s.r,0,255)),s.g=Math.round(yt(s.g,0,255)),s.b=Math.round(yt(s.b,0,255)),s.hasOwnProperty("a")?s.a=typeof t=="number"?t:s.a:s.a=typeof t=="number"?t:1,s.a=yt(s.a,0,1),s;const e={r:0,g:0,b:0,a:1};let n=-1;if(typeof s=="number")n=s;else if(typeof s=="string")if(s[0].toLowerCase()==="r"){const i=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,?\s*(\d?\.?\d*)?\s*\)/gi.exec(s);i&&(n=(parseInt(i[1])<<16)+(parseInt(i[2])<<8)+parseInt(i[3]),i[4]&&(e.a=Jt(parseFloat(i[4]),2)))}else if(s[0]==="#")n=parseInt(s.slice(1,7),16),s.length>7&&(e.a=Jt(parseInt(s.slice(7,9),16)/255,2));else throw new Error("getColor 不支持的颜色解析:"+s);return n>=0&&(e.r=n>>16&255,e.g=n>>8&255,e.b=n&255),typeof t=="number"&&(e.a=t),e.a=yt(e.a,0,1),e}function Fa(s,t){const e=jt(s,t);return e.a===1?`rgb(${e.r},${e.g},${e.b})`:`rgba(${e.r},${e.g},${e.b},${e.a})`}function qe(s){return Nr(s.toString(16),2,"0","left")}function we(s,t){const e=jt(s,t);let n=`#${qe(e.r)}${qe(e.g)}${qe(e.b)}`;return e.a===1?n:n+`${qe(Math.ceil(e.a*255))}`}const oi=()=>Math.random()*16777215,Ba=()=>we(oi());function Ua(s,t){const e=jt(s);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(yt(e.r,0,255)),e.g=Math.round(yt(e.g,0,255)),e.b=Math.round(yt(e.b,0,255)),we(e)}function Va(s,t,e){const n=jt(s),i=jt(t);return we({r:(i.r-n.r)*e+n.r,g:(i.g-n.g)*e+n.g,b:(i.b-n.b)*e+n.b})}function Ga(s,t,e,n){let i,r,a;s=s/360,t=t/100,e=e/100;const o=Math.floor(s*6),c=s*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:n??1}}function za(s,t,e,n){s*=360;let i,r,a,o,c;return s=s%360/60,c=e*t,o=c*(1-Math.abs(s%2-1)),i=r=a=e-c,s=~~s,i+=[c,o,0,0,o,c][s],r+=[o,c,c,o,0,0][s],a+=[0,0,o,c,c,o][s],{r:i,g:r,b:a,opacity:n??1}}function ja(s,t,e,n){(s>1||t>1||e>1)&&(s/=360,t/=100,e/=100),s*=360;var i,r,a,o,c;return s=s%360/60,c=2*t*(e<.5?e:1-e),o=c*(1-Math.abs(s%2-1)),i=r=a=e-c/2,s=~~s,i+=[c,o,0,0,o,c][s],r+=[o,c,c,o,0,0][s],a+=[0,0,o,c,c,o][s],{r:i,g:r,b:a,opacity:n??1}}function Xa(s,t,e,n){const i=Math.max(s,t,e),r=Math.min(s,t,e),a=i-r,o=i===0?0:a/i,c=i/255;let h;switch(i){case r:h=0;break;case s:h=t-e+a*(t<e?6:0),h/=6*a;break;case t:h=e-s+a*2,h/=6*a;break;case e:default:h=s-t+a*4,h/=6*a;break}return{h:Math.round(h*360),s:Math.round(o*100),v:Math.round(c*100),opacity:n??1}}function qa(s,t,e){let n,i,r,a;return r=Math.max(s,t,e),a=r-Math.min(s,t,e),n=a==0?0:r==s?(t-e)/a:r==t?(e-s)/a+2:(s-t)/a+4,n=(n+360)%6*60/360,i=a==0?0:a/r,{h:n,s:i,b:r}}function Ya(s,t,e){let n,i,r,a,o,c;return a=Math.max(s,t,e),o=Math.min(s,t,e),c=a-o,n=c==0?0:a==s?(t-e)/c:a==t?(e-s)/c+2:(s-t)/c+4,n=(n+360)%6*60/360,r=(a+o)/2,i=c==0?0:r<.5?c/(2*r):c/(2-2*r),{h:n,s:i,l:r}}function Ye(s=window.location.href){return Rs(URL)?new URL(s):ci(s)}function ci(s=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",n="(?<pathname>(?:\\/[^/#?]+)*\\/?)",i="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${n}${i}${r}$`).exec(s);return{href:s,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 Ha(s){const t=Ye(s);return t.protocol==="http:"||t.protocol==="https:"}function hi(s=window.location.href){const t=Ye(s),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function Wa(s=Ye().search){s=decodeURIComponent(s).replace(/^[#?&]/,"");const t={};if(!s)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let n=e.exec(s);for(;n;)t[n[1]]=n[2],n=e.exec(s);return t}function li(s){return"?"+Object.entries(s).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function ui(s){return"?"+[...s.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function $a(s,t){return s.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function fi(s,t){return s+t.replace(/^[&?]/,s.indexOf("?")>=0?"&":"?")}function Ja(s){let t=null;if(Qs)try{t=new Worker(URL.createObjectURL(new Blob([s])))}catch(e){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),null}return t}function di(){let s=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{s=new window.ActiveXObject(t[e]);break}catch{continue}}else s=new XMLHttpRequest;return s}function Za(s){return new Promise((t,e)=>{fetch(s,{}).then(n=>n.text()).then(t).catch(e)})}function Ka(s,t){return new Promise((e,n)=>{const{method:i="GET",data:r={},segments:a=[],headers:o={},withCredentials:c=!1,responseType:h="json",timeout:l=3e4}=t||{},f=di();f.timeout=l,f.responseType=h,f.onreadystatechange=function(C){f.readyState===4&&(f.status===200?e(f.response):n(f.statusText))},f.ontimeout=function(){n(`${s} is timed out for ${l}ms.`)},f.addEventListener("error",function(C){n(C)},!1),f.addEventListener("progress",function(C){if(C.lengthComputable){const M=Math.round(C.loaded*100/C.total);t?.progress?.(M,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 w="---------------------------"+Date.now().toString(16);let m=!1,v=!1,b=!1;function S(){c&&(f.withCredentials=!0);for(const C in o)ft(C).toLowerCase()=="content-type"&&o[C].toLowerCase()=="multipart/form-data"?(m=!0,f.setRequestHeader("Content-Type","multipart/form-data; boundary="+w)):(ft(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=ui(r):C=li(r),f.open("GET",fi(s,C),!0),S(),f.send(null);break;case"POST":default:f.open(g,s,!0),S(),m&&a.length?f.sendAsBinary("--"+w+`\r
|
|
26
|
-
`+a.join("--"+
|
|
27
|
-
`)+"--"+
|
|
28
|
-
`):b?f.send(JSON.stringify(r)):f.send(Object.entries(r).map(([
|
|
29
|
-
`:"&"));break}})}async function
|
|
22
|
+
* Licensed under the MIT license */(function(n){(function(t,e,s,i){var r=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),o="function",c=Math.round,h=Math.abs,l=Date.now;function f(u,d,w){return setTimeout(k(u,w),d)}function g(u,d,w){return Array.isArray(u)?(y(u,w[d],w),!0):!1}function y(u,d,w){var x;if(u)if(u.forEach)u.forEach(d,w);else if(u.length!==i)for(x=0;x<u.length;)d.call(w,u[x],x,u),x++;else for(x in u)u.hasOwnProperty(x)&&d.call(w,u[x],x,u)}function m(u,d,w){var x="DEPRECATED METHOD: "+d+`
|
|
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,xs=1,Fe=2,Be=4,Ue=8,Ve=16,Dt=Fe|Be,te=Ue|Ve,_r=Dt|te,Dr=["x","y"],Ss=["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=Cn:U?d=Es:M?d=Tn:d=Ts,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=kr(d)),P>1&&!w.firstMultiple?w.firstMultiple=kr(d):P===1&&(w.firstMultiple=!1);var I=w.firstInput,N=w.firstMultiple,tt=N?N.center:I.center,et=d.center=Ir(x);d.timeStamp=l(),d.deltaTime=d.timeStamp-I.timeStamp,d.angle=Sn(tt,et),d.distance=Cs(tt,et),Xl(w,d),d.offsetDirection=Rr(d.deltaX,d.deltaY);var ot=Mr(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=Mr(x,et,ot);I=It.x,N=It.y,P=h(It.x)>h(It.y)?It.x:It.y,tt=Rr(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 kr(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:Ir(d),deltaX:u.deltaX,deltaY:u.deltaY}}function Ir(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 Mr(u,d,w){return{x:d/u||0,y:w/u||0}}function Rr(u,d){return u===d?xs:h(u)>=h(d)?u<0?Fe:Be:d<0?Ue:Ve}function Cs(u,d,w){w||(w=Dr);var x=d[w[0]]-u[w[0]],P=d[w[1]]-u[w[1]];return Math.sqrt(x*x+P*P)}function Sn(u,d,w){w||(w=Dr);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 Sn(d[1],d[0],Ss)+Sn(u[1],u[0],Ss)}function Hl(u,d){return Cs(d[0],d[1],Ss)/Cs(u[0],u[1],Ss)}var Wl={mousedown:at,mousemove:Qt,mouseup:$},$l="mousedown",Jl="mousemove mouseup";function Ts(){this.evEl=$l,this.evWin=Jl,this.pressed=!1,bt.apply(this,arguments)}C(Ts,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},Or="pointerdown",Lr="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Or="MSPointerDown",Lr="MSPointerMove MSPointerUp MSPointerCancel");function Cn(){this.evEl=Or,this.evWin=Lr,bt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}C(Cn,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 Nr(){this.evTarget=tu,this.evWin=eu,this.started=!1,bt.apply(this,arguments)}C(Nr,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 Es(){this.evTarget=iu,this.targetIds={},bt.apply(this,arguments)}C(Es,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,Fr=25;function Tn(){bt.apply(this,arguments);var u=k(this.handler,this);this.touch=new Es(this.manager,u),this.mouse=new Ts(this.manager,u),this.primaryTouch=null,this.lastTouches=[]}C(Tn,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,Br.call(this,d)):u&($|ht)&&Br.call(this,d)}function Br(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<=Fr&&N<=Fr)return!0}return!1}var Ur=ct(a.style,"touchAction"),Vr=Ur!==i,Gr="compute",zr="auto",En="manipulation",ee="none",Ge="pan-x",ze="pan-y",Ps=lu();function Pn(u,d){this.manager=u,this.set(d)}Pn.prototype={set:function(u){u==Gr&&(u=this.compute()),Vr&&this.manager.element.style&&Ps[u]&&(this.manager.element.style[Ur]=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)&&!Ps[ee],I=q(x,ze)&&!Ps[ze],N=q(x,Ge)&&!Ps[Ge];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,Ge),w=q(u,ze);return d&&w?ee:d||w?d?Ge:ze:q(u,En)?En:zr}function lu(){if(!Vr)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 As=1,xt=2,de=4,Wt=8,Ft=Wt,je=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=As,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=_s(u,this),d[u.id]||(d[u.id]=u,u.recognizeWith(this)),this},dropRecognizeWith:function(u){return g(u,"dropRecognizeWith",this)?this:(u=_s(u,this),delete this.simultaneous[u.id],this)},requireFailure:function(u){if(g(u,"requireFailure",this))return this;var d=this.requireFail;return u=_s(u,this),H(d,u)===-1&&(d.push(u),u.requireFailure(this)),this},dropRequireFailure:function(u){if(g(u,"dropRequireFailure",this))return this;u=_s(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+jr(w)),x(d.options.event),u.additionalEvent&&x(u.additionalEvent),w>=Wt&&x(d.options.event+jr(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|As)))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|je|kt)&&(this.state=As),this.state=this.process(d),this.state&(xt|de|Wt|je)&&this.tryEmit(d)},process:function(u){},getTouchAction:function(){},reset:function(){}};function jr(u){return u&je?"cancel":u&Wt?"end":u&de?"move":u&xt?"start":""}function Xr(u){return u==Ve?"down":u==Ue?"up":u==Fe?"left":u==Be?"right":""}function _s(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|je:x||P?w&$?d|Wt:d&xt?d|de:xt:kt}});function Ds(){Et.apply(this,arguments),this.pX=null,this.pY=null}C(Ds,Et,{defaults:{event:"pan",threshold:10,pointers:1,direction:_r},getTouchAction:function(){var u=this.options.direction,d=[];return u&Dt&&d.push(ze),u&te&&d.push(Ge),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?xs:I<0?Fe:Be,w=I!=this.pX,x=Math.abs(u.deltaX)):(P=N===0?xs:N<0?Ue:Ve,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=Xr(u.direction);d&&(u.additionalEvent=this.options.event+d),this._super.emit.call(this,u)}});function An(){Et.apply(this,arguments)}C(An,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 _n(){Bt.apply(this,arguments),this._timer=null,this._input=null}C(_n,Bt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[zr]},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 Dn(){Et.apply(this,arguments)}C(Dn,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 kn(){Et.apply(this,arguments)}C(kn,Et,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Dt|te,pointers:1},getTouchAction:function(){return Ds.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=Xr(u.offsetDirection);d&&this.manager.emit(this.options.event+d,u),this.manager.emit(this.options.event,u)}});function ks(){Bt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}C(ks,Bt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[En]},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||Cs(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 In(u,d)}Ut.VERSION="2.0.7",Ut.defaults={domEvents:!1,touchAction:Gr,enable:!0,inputTarget:null,inputClass:null,preset:[[Dn,{enable:!1}],[An,{enable:!1},["rotate"]],[kn,{direction:Dt}],[Ds,{direction:Dt},["swipe"]],[ks],[ks,{event:"doubletap",taps:2},["tap"]],[_n]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var uu=1,qr=2;function In(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 Pn(this,this.options.touchAction),Yr(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)}In.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?qr: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!==qr&&(!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&&Yr(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Yr(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:As,STATE_BEGAN:xt,STATE_CHANGED:de,STATE_ENDED:Wt,STATE_RECOGNIZED:Ft,STATE_CANCELLED:je,STATE_FAILED:kt,DIRECTION_NONE:xs,DIRECTION_LEFT:Fe,DIRECTION_RIGHT:Be,DIRECTION_UP:Ue,DIRECTION_DOWN:Ve,DIRECTION_HORIZONTAL:Dt,DIRECTION_VERTICAL:te,DIRECTION_ALL:_r,Manager:In,Input:bt,TouchAction:Pn,TouchInput:Es,MouseInput:Ts,PointerEventInput:Cn,TouchMouseInput:Tn,SingleTouchInput:Nr,Recognizer:Bt,AttrRecognizer:Et,Tap:ks,Pan:Ds,Swipe:kn,Pinch:An,Rotate:Dn,Press:_n,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")})(hi);var qa=hi.exports;const Ya=Xa(qa),ye=Math.PI*2;function li(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=li(1,0,F,L);let Y=li(F,L,j,Q);return r===0&&Y>0&&(Y-=ye),r===1&&Y<0&&(Y+=ye),[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 ui(n,t,e,s,i,r,a,o,c){const h=Math.sin(c*ye/360),l=Math.cos(c*ye/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)/(ye/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 js(n,t,e,s,i,r){return[n/3+.6666666666666666*e,t/3+.6666666666666666*s,i/3+.6666666666666666*e,r/3+.6666666666666666*s,i,r]}function we(n,t,e,s){return[n,t,e,s,e,s]}const ve={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 Fs(Xn(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return Fs(Ls(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return Ns(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=zn(r);for(a=="m"&&o.length>ve[a]&&(e.push([i,...o.splice(0,ve[a])]),a="l",i=i=="m"?"l":"L");o.length;){if(o.length<ve[a])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${i} } args:{ ${o} }`);e.push([i,...o.splice(0,ve[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=ui(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",...js(r,a,o,c,m[1],m[2])];break;case"Q":o=m[1],c=m[2],m=["C",...js(r,a,m[1],m[2],m[3],m[4])];break;case"L":m=["C",...we(r,a,m[1],m[2])];break;case"H":m=["C",...we(r,a,m[1],a)];break;case"V":m=["C",...we(r,a,r,m[1])];break;case"Z":m=["C",...we(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 Rs{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(Gn(this))}restore(){const t=this.history.pop();t&&aa(this,t)}setAttr(t,e){Ye(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=zn(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 Je(this.x,this.y,t.x,t.y)}angleTo(t){return this.degree=J(ge(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 fi({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=$e(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 fi=ut;class di{constructor(){}static getFormatKeyNames(t){const e=Gs(),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(Ms(t.key)):Array.isArray(t.key)&&(t.key.map(i=>Ms(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 be extends Rs{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 be,window.addEventListener("hashchange",()=>{mt.emit("hashchange",location.hash)}),window.addEventListener("popstate",()=>{mt.emit("popstate")}),mt.registerKeyDown({title:"打开",key:"o",ctrl:!0,exact:!0},()=>{qn().then(e=>He(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=Qn(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=di.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 xe{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(()=>{xe.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 mi extends Rs{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=Ln(this.source);if(t===0){this.emit("finish");return}let e,s,i=Nn(this.source,0);for(let r=1;r<t;r++)e=s,s=i,i=Nn(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 Xs(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=/`));be.page.on("matchMediaChangePrefersColorSchemeDark",n=>{Ze(n?"dark":"light")}),pi();function Ze(n){Xs("colorScheme",n),document.documentElement.classList.toggle("dark",n=="dark")}function pi(){const n=Xs("colorScheme");if(n=="dark"||n=="light")return Ze(n),n;{const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return Ze(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 Ke(n){return Kr(n.toString(16),2,"0","left")}function Se(n,t){const e=zt(n,t);let s=`#${Ke(e.r)}${Ke(e.g)}${Ke(e.b)}`;return e.a===1?s:s+`${Ke(Math.ceil(e.a*255))}`}const gi=()=>Math.random()*16777215,so=()=>Se(gi());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)),Se(e)}function qs(n,t,e){try{const s=zt(n),i=zt(t);return Se({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 Qe(n=window.location.href){return Ye(URL)?new URL(n):yi(n)}function yi(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=Qe(n);return t.protocol==="http:"||t.protocol==="https:"}function wi(n=window.location.href){const t=Qe(n),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function uo(n=Qe().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 vi(n){return"?"+Object.entries(n).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function bi(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 xi(n,t){return n+t.replace(/^[&?]/,n.indexOf("?")>=0?"&":"?")}const ts=new Map,Si={transform:function(n){if(ai)return n;if(ts.has(n))return ts.get(n);const t=new OffscreenCanvas(n.width,n.height);return t.getContext("2d")?.drawImage(n,0,0),ts.set(n,t),t},clear:function(){ts.clear()}};function mo(n){let t=null;if(ri)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,Si.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 Ci(){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=Ci();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=bi(r):C=vi(r),f.open("GET",xi(n,C),!0),S(),f.send(null);break;case"POST":default:f.open(g,n,!0),S(),m&&a.length?f.sendAsBinary("--"+y+`\r
|
|
26
|
+
`+a.join("--"+y+`\r
|
|
27
|
+
`)+"--"+y+`--\r
|
|
28
|
+
`):b?f.send(JSON.stringify(r)):f.send(Object.entries(r).map(([k,R])=>`${encodeURIComponent(k)}=${encodeURIComponent(R)}`).join(v?`\r
|
|
29
|
+
`:"&"));break}})}async function wo(n){const t={url:"",data:{},segments:[],contentType:""};if(!n.action)return t;t.url=n.action;const e=n.method.toLowerCase()==="post";t.contentType=e&&n.enctype?n.enctype:"application/x-www-form-urlencoded";const s=t.contentType=="multipart/form-data";for(let i=0;i<n.elements.length;i++){const r=n.elements[i];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 c=0;c<o;c++){const h=r.files[c],l=await He(h,"binaryString");t.segments.push('Content-Disposition: form-data; name="'+r.name+'"; filename="'+h.name+`"\r
|
|
30
30
|
Content-Type: `+h.type+`\r
|
|
31
31
|
\r
|
|
32
32
|
`+l+`\r
|
|
33
|
-
`)}else for(let c=0;c<o;c++)t.data[r.name]=r.files[c].name}else(a!=="RADIO"&&a!=="CHECKBOX"||(a=="RADIO"||a=="CHECKBOX")&&r.checked)&&(
|
|
33
|
+
`)}else for(let c=0;c<o;c++)t.data[r.name]=r.files[c].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 mi(s,t){return function(){return s.apply(t,arguments)}}const{toString:to}=Object.prototype,{getPrototypeOf:Bn}=Object,He=(s=>t=>{const e=to.call(t);return s[e]||(s[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),At=s=>(s=s.toLowerCase(),t=>He(t)===s),We=s=>t=>typeof t===s,{isArray:ie}=Array,ve=We("undefined");function eo(s){return s!==null&&!ve(s)&&s.constructor!==null&&!ve(s.constructor)&&vt(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const pi=At("ArrayBuffer");function no(s){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(s):t=s&&s.buffer&&pi(s.buffer),t}const so=We("string"),vt=We("function"),gi=We("number"),$e=s=>s!==null&&typeof s=="object",io=s=>s===!0||s===!1,Je=s=>{if(He(s)!=="object")return!1;const t=Bn(s);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)},ro=At("Date"),ao=At("File"),oo=At("Blob"),co=At("FileList"),ho=s=>$e(s)&&vt(s.pipe),lo=s=>{let t;return s&&(typeof FormData=="function"&&s instanceof FormData||vt(s.append)&&((t=He(s))==="formdata"||t==="object"&&vt(s.toString)&&s.toString()==="[object FormData]"))},uo=At("URLSearchParams"),fo=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function be(s,t,{allOwnKeys:e=!1}={}){if(s===null||typeof s>"u")return;let n,i;if(typeof s!="object"&&(s=[s]),ie(s))for(n=0,i=s.length;n<i;n++)t.call(null,s[n],n,s);else{const r=e?Object.getOwnPropertyNames(s):Object.keys(s),a=r.length;let o;for(n=0;n<a;n++)o=r[n],t.call(null,s[o],o,s)}}function yi(s,t){t=t.toLowerCase();const e=Object.keys(s);let n=e.length,i;for(;n-- >0;)if(i=e[n],t===i.toLowerCase())return i;return null}const wi=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),vi=s=>!ve(s)&&s!==wi;function Un(){const{caseless:s}=vi(this)&&this||{},t={},e=(n,i)=>{const r=s&&yi(t,i)||i;Je(t[r])&&Je(n)?t[r]=Un(t[r],n):Je(n)?t[r]=Un({},n):ie(n)?t[r]=n.slice():t[r]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&be(arguments[n],e);return t}const mo=(s,t,e,{allOwnKeys:n}={})=>(be(t,(i,r)=>{e&&vt(i)?s[r]=mi(i,e):s[r]=i},{allOwnKeys:n}),s),po=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),go=(s,t,e,n)=>{s.prototype=Object.create(t.prototype,n),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:t.prototype}),e&&Object.assign(s.prototype,e)},yo=(s,t,e,n)=>{let i,r,a;const o={};if(t=t||{},s==null)return t;do{for(i=Object.getOwnPropertyNames(s),r=i.length;r-- >0;)a=i[r],(!n||n(a,s,t))&&!o[a]&&(t[a]=s[a],o[a]=!0);s=e!==!1&&Bn(s)}while(s&&(!e||e(s,t))&&s!==Object.prototype);return t},wo=(s,t,e)=>{s=String(s),(e===void 0||e>s.length)&&(e=s.length),e-=t.length;const n=s.indexOf(t,e);return n!==-1&&n===e},vo=s=>{if(!s)return null;if(ie(s))return s;let t=s.length;if(!gi(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=s[t];return e},bo=(s=>t=>s&&t instanceof s)(typeof Uint8Array<"u"&&Bn(Uint8Array)),xo=(s,t)=>{const n=(s&&s[Symbol.iterator]).call(s);let i;for(;(i=n.next())&&!i.done;){const r=i.value;t.call(s,r[0],r[1])}},So=(s,t)=>{let e;const n=[];for(;(e=s.exec(t))!==null;)n.push(e);return n},Co=At("HTMLFormElement"),To=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,n,i){return n.toUpperCase()+i}),bi=(({hasOwnProperty:s})=>(t,e)=>s.call(t,e))(Object.prototype),Eo=At("RegExp"),xi=(s,t)=>{const e=Object.getOwnPropertyDescriptors(s),n={};be(e,(i,r)=>{let a;(a=t(i,r,s))!==!1&&(n[r]=a||i)}),Object.defineProperties(s,n)},Po=s=>{xi(s,(t,e)=>{if(vt(s)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const n=s[e];if(vt(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},_o=(s,t)=>{const e={},n=i=>{i.forEach(r=>{e[r]=!0})};return ie(s)?n(s):n(String(s).split(t)),e},Do=()=>{},Ao=(s,t)=>(s=+s,Number.isFinite(s)?s:t),Vn="abcdefghijklmnopqrstuvwxyz",Si="0123456789",Ci={DIGIT:Si,ALPHA:Vn,ALPHA_DIGIT:Vn+Vn.toUpperCase()+Si},ko=(s=16,t=Ci.ALPHA_DIGIT)=>{let e="";const{length:n}=t;for(;s--;)e+=t[Math.random()*n|0];return e};function Io(s){return!!(s&&vt(s.append)&&s[Symbol.toStringTag]==="FormData"&&s[Symbol.iterator])}const Mo=s=>{const t=new Array(10),e=(n,i)=>{if($e(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const r=ie(n)?[]:{};return be(n,(a,o)=>{const c=e(a,i+1);!ve(c)&&(r[o]=c)}),t[i]=void 0,r}}return n};return e(s,0)},Ro=At("AsyncFunction"),E={isArray:ie,isArrayBuffer:pi,isBuffer:eo,isFormData:lo,isArrayBufferView:no,isString:so,isNumber:gi,isBoolean:io,isObject:$e,isPlainObject:Je,isUndefined:ve,isDate:ro,isFile:ao,isBlob:oo,isRegExp:Eo,isFunction:vt,isStream:ho,isURLSearchParams:uo,isTypedArray:bo,isFileList:co,forEach:be,merge:Un,extend:mo,trim:fo,stripBOM:po,inherits:go,toFlatObject:yo,kindOf:He,kindOfTest:At,endsWith:wo,toArray:vo,forEachEntry:xo,matchAll:So,isHTMLForm:Co,hasOwnProperty:bi,hasOwnProp:bi,reduceDescriptors:xi,freezeMethods:Po,toObjectSet:_o,toCamelCase:To,noop:Do,toFiniteNumber:Ao,findKey:yi,global:wi,isContextDefined:vi,ALPHABET:Ci,generateString:ko,isSpecCompliantForm:Io,toJSONObject:Mo,isAsyncFn:Ro,isThenable:s=>s&&($e(s)||vt(s))&&vt(s.then)&&vt(s.catch)};function L(s,t,e,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),n&&(this.request=n),i&&(this.response=i)}E.inherits(L,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 Ti=L.prototype,Ei={};["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(s=>{Ei[s]={value:s}}),Object.defineProperties(L,Ei),Object.defineProperty(Ti,"isAxiosError",{value:!0}),L.from=(s,t,e,n,i,r)=>{const a=Object.create(Ti);return E.toFlatObject(s,a,function(c){return c!==Error.prototype},o=>o!=="isAxiosError"),L.call(a,s.message,t,e,n,i),a.cause=s,a.name=s.name,r&&Object.assign(a,r),a};const Oo=null;function Gn(s){return E.isPlainObject(s)||E.isArray(s)}function Pi(s){return E.endsWith(s,"[]")?s.slice(0,-2):s}function _i(s,t,e){return s?s.concat(t).map(function(i,r){return i=Pi(i),!e&&r?"["+i+"]":i}).join(e?".":""):t}function Lo(s){return E.isArray(s)&&!s.some(Gn)}const No=E.toFlatObject(E,{},null,function(t){return/^is[A-Z]/.test(t)});function Ze(s,t,e){if(!E.isObject(s))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 n=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 L("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=n?v:v.slice(0,-2),m=JSON.stringify(m);else if(E.isArray(m)&&Lo(m)||(E.isFileList(m)||E.endsWith(v,"[]"))&&(S=E.toArray(m)))return v=Pi(v),S.forEach(function(M,R){!(E.isUndefined(M)||M===null)&&t.append(a===!0?_i([v],R,r):a===null?v:v+"[]",h(M))}),!1}return Gn(m)?!0:(t.append(_i(b,v,r),h(m)),!1)}const f=[],g=Object.assign(No,{defaultVisitor:l,convertValue:h,isVisitable:Gn});function w(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&&w(S,v?v.concat(C):[C])}),f.pop()}}if(!E.isObject(s))throw new TypeError("data must be an object");return w(s),t}function Di(s){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function zn(s,t){this._pairs=[],s&&Ze(s,this,t)}const Ai=zn.prototype;Ai.append=function(t,e){this._pairs.push([t,e])},Ai.toString=function(t){const e=t?function(n){return t.call(this,n,Di)}:Di;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function Fo(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ki(s,t,e){if(!t)return s;const n=e&&e.encode||Fo,i=e&&e.serialize;let r;if(i?r=i(t,e):r=E.isURLSearchParams(t)?t.toString():new zn(t,e).toString(n),r){const a=s.indexOf("#");a!==-1&&(s=s.slice(0,a)),s+=(s.indexOf("?")===-1?"?":"&")+r}return s}class Bo{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:!1,runWhen:n?n.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(n){n!==null&&t(n)})}}const Ii=Bo,Mi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Uo=typeof URLSearchParams<"u"?URLSearchParams:zn,Vo=typeof FormData<"u"?FormData:null,Go=typeof Blob<"u"?Blob:null,zo=(()=>{let s;return typeof navigator<"u"&&((s=navigator.product)==="ReactNative"||s==="NativeScript"||s==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),jo=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),kt={isBrowser:!0,classes:{URLSearchParams:Uo,FormData:Vo,Blob:Go},isStandardBrowserEnv:zo,isStandardBrowserWebWorkerEnv:jo,protocols:["http","https","file","blob","url","data"]};function Xo(s,t){return Ze(s,new kt.classes.URLSearchParams,Object.assign({visitor:function(e,n,i,r){return kt.isNode&&E.isBuffer(e)?(this.append(n,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function qo(s){return E.matchAll(/\w+|\[(\w*)]/g,s).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Yo(s){const t={},e=Object.keys(s);let n;const i=e.length;let r;for(n=0;n<i;n++)r=e[n],t[r]=s[r];return t}function Ri(s){function t(e,n,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],n]:i[a]=n,!o):((!i[a]||!E.isObject(i[a]))&&(i[a]=[]),t(e,n,i[a],r)&&E.isArray(i[a])&&(i[a]=Yo(i[a])),!o)}if(E.isFormData(s)&&E.isFunction(s.entries)){const e={};return E.forEachEntry(s,(n,i)=>{t(qo(n),i,e,0)}),e}return null}function Ho(s,t,e){if(E.isString(s))try{return(t||JSON.parse)(s),E.trim(s)}catch(n){if(n.name!=="SyntaxError")throw n}return(e||JSON.stringify)(s)}const jn={transitional:Mi,adapter:["xhr","http"],transformRequest:[function(t,e){const n=e.getContentType()||"",i=n.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(Ri(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(n.indexOf("application/x-www-form-urlencoded")>-1)return Xo(t,this.formSerializer).toString();if((o=E.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Ze(o?{"files[]":t}:t,c&&new c,this.formSerializer)}}return r||i?(e.setContentType("application/json",!1),Ho(t)):t}],transformResponse:[function(t){const e=this.transitional||jn.transitional,n=e&&e.forcedJSONParsing,i=this.responseType==="json";if(t&&E.isString(t)&&(n&&!this.responseType||i)){const a=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?L.from(o,L.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:kt.classes.FormData,Blob:kt.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"],s=>{jn.headers[s]={}});const Xn=jn,Wo=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"]),$o=s=>{const t={};let e,n,i;return s&&s.split(`
|
|
37
|
-
`).forEach(function(a){i=a.indexOf(":"),e=a.substring(0,i).trim().toLowerCase(),
|
|
38
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const
|
|
39
|
-
`+r.map(
|
|
40
|
-
`):" "+Bi(r[0]):"as no adapter specified";throw new L("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n},adapters:Hn};function Wn(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new Se(null,s)}function Vi(s){return Wn(s),s.headers=Ft.from(s.headers),s.data=Yn.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),Ui.getAdapter(s.adapter||Xn.adapter)(s).then(function(n){return Wn(s),n.data=Yn.call(s,s.transformResponse,n),n.headers=Ft.from(n.headers),n},function(n){return Li(n)||(Wn(s),n&&n.response&&(n.response.data=Yn.call(s,s.transformResponse,n.response),n.response.headers=Ft.from(n.response.headers))),Promise.reject(n)})}const Gi=s=>s instanceof Ft?s.toJSON():s;function re(s,t){t=t||{};const e={};function n(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 n(void 0,h,f)}else return n(h,l,f)}function r(h,l){if(!E.isUndefined(l))return n(void 0,l)}function a(h,l){if(E.isUndefined(l)){if(!E.isUndefined(h))return n(void 0,h)}else return n(void 0,l)}function o(h,l,f){if(f in t)return n(h,l);if(f in s)return n(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(Gi(h),Gi(l),!0)};return E.forEach(Object.keys(Object.assign({},s,t)),function(l){const f=c[l]||i,g=f(s[l],t[l],l);E.isUndefined(g)&&f!==o||(e[l]=g)}),e}const zi="1.5.1",$n={};["object","boolean","number","function","string","symbol"].forEach((s,t)=>{$n[s]=function(n){return typeof n===s||"a"+(t<1?"n ":" ")+s}});const ji={};$n.transitional=function(t,e,n){function i(r,a){return"[Axios v"+zi+"] Transitional option '"+r+"'"+a+(n?". "+n:"")}return(r,a,o)=>{if(t===!1)throw new L(i(a," has been removed"+(e?" in "+e:"")),L.ERR_DEPRECATED);return e&&!ji[a]&&(ji[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 cc(s,t,e){if(typeof s!="object")throw new L("options must be an object",L.ERR_BAD_OPTION_VALUE);const n=Object.keys(s);let i=n.length;for(;i-- >0;){const r=n[i],a=t[r];if(a){const o=s[r],c=o===void 0||a(o,r,s);if(c!==!0)throw new L("option "+r+" must be "+c,L.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new L("Unknown option "+r,L.ERR_BAD_OPTION)}}const Jn={assertOptions:cc,validators:$n},Xt=Jn.validators;class tn{constructor(t){this.defaults=t,this.interceptors={request:new Ii,response:new Ii}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=re(this.defaults,e);const{transitional:n,paramsSerializer:i,headers:r}=e;n!==void 0&&Jn.assertOptions(n,{silentJSONParsing:Xt.transitional(Xt.boolean),forcedJSONParsing:Xt.transitional(Xt.boolean),clarifyTimeoutError:Xt.transitional(Xt.boolean)},!1),i!=null&&(E.isFunction(i)?e.paramsSerializer={serialize:i}:Jn.assertOptions(i,{encode:Xt.function,serialize:Xt.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=Ft.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=[Vi.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 w=e;for(f=0;f<g;){const m=o[f++],v=o[f++];try{w=m(w)}catch(b){v.call(this,b);break}}try{l=Vi.call(this,w)}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=re(this.defaults,t);const e=Ni(t.baseURL,t.url);return ki(e,t.params,t.paramsSerializer)}}E.forEach(["delete","get","head","options"],function(t){tn.prototype[t]=function(e,n){return this.request(re(n||{},{method:t,url:e,data:(n||{}).data}))}}),E.forEach(["post","put","patch"],function(t){function e(n){return function(r,a,o){return this.request(re(o||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}tn.prototype[t]=e(),tn.prototype[t+"Form"]=e(!0)});const en=tn;class Zn{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 n=this;this.promise.then(i=>{if(!n._listeners)return;let r=n._listeners.length;for(;r-- >0;)n._listeners[r](i);n._listeners=null}),this.promise.then=i=>{let r;const a=new Promise(o=>{n.subscribe(o),r=o}).then(i);return a.cancel=function(){n.unsubscribe(r)},a},t(function(r,a,o){n.reason||(n.reason=new Se(r,a,o),e(n.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 Zn(function(i){t=i}),cancel:t}}}const hc=Zn;function lc(s){return function(e){return s.apply(null,e)}}function uc(s){return E.isObject(s)&&s.isAxiosError===!0}const Kn={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(Kn).forEach(([s,t])=>{Kn[t]=s});const fc=Kn;function Xi(s){const t=new en(s),e=mi(en.prototype.request,t);return E.extend(e,en.prototype,t,{allOwnKeys:!0}),E.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return Xi(re(s,i))},e}const Z=Xi(Xn);Z.Axios=en,Z.CanceledError=Se,Z.CancelToken=hc,Z.isCancel=Li,Z.VERSION=zi,Z.toFormData=Ze,Z.AxiosError=L,Z.Cancel=Z.CanceledError,Z.all=function(t){return Promise.all(t)},Z.spread=lc,Z.isAxiosError=uc,Z.mergeConfig=re,Z.AxiosHeaders=Ft,Z.formToJSON=s=>Ri(E.isHTMLForm(s)?new FormData(s):s),Z.getAdapter=Ui.getAdapter,Z.HttpStatusCode=fc,Z.default=Z;const dc=Z;class mc{instance;interceptors;requestCanceler;constructor(t){this.instance=dc.create(t),this.interceptors=t?.interceptors,this.requestCanceler=new qi,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((n,i)=>{this.requestCanceler.confirmRequest(e.config),e.status===200?n(e.data):i(e.data)}),async e=>{const{code:n="",config:i}=e;return!i||!i.retry||!i.retryStatus?.includes(n)||(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,n)=>{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)),n(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,n){return this.request({...n,method:"post",url:t,data:e})}put(t,e,n){return this.request({...n,method:"put",url:t,data:e})}patch(t,e,n){return this.request({...n,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class qi{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 n=new AbortController;t.signal=n.signal,this.pendingRequestMap.set(e,n)}}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:n,params:i,data:r}=t;return await Wr({url:e,method:n,params:i,data:r})}}const nn=new Map;async function pc(s){return new Promise((t,e)=>{sn(s,(n,i)=>n?e(n):t({width:i.width,height:i.height,aspectRatio:i.width/i.height}))})}const sn=(s,t)=>{if(nn.has(s))return t(null,nn.get(s));const e=new Image;e.onload=function(){nn.set(s,{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height,element:e}),t(null,nn.get(s))},e.onerror=function(n){t(n,null)},e.src=s},gc=(s,t)=>{for(let e=0,n=s.length;e<n;e++){const i=s[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=Is(c),l=new Blob([c]);Qn(l,(f,g)=>{if(!g)return t(f,null);sn(g,(w,m)=>{if(!m)return t(w,null);Yi(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)}},Yi=(s,t)=>{sn(s,(e,n)=>{if(!n)return t(e,null);const i=document.createElement("canvas"),r=i.getContext("2d");i.width=n.width,i.height=n.height,r.drawImage(n.element,0,0,i.width,i.height);const a=r.getImageData(0,0,i.width,i.height);return t(null,a)})},yc=(s,t=0,e=0)=>{const n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=e,i.drawImage(s,0,0,t,e),i.getImageData(0,0,t,e)},wc=(s,t=0,e=0)=>{const n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=e,i.drawImage(s,0,0,t,e),i.getImageData(0,0,t,e)},vc=s=>{const t=s.width,e=s.height,n=t*e*3,i=n+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,n&255,n>>8&255,n>>16&255,n>>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=s.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 w(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 w(r.concat(a))+w(h)},bc=s=>{const{width:t,height:e}=s,n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=e,i.putImageData(s,0,0,0,0,t,e),n.toDataURL("image/png")},xc=(s,t,e)=>{const{width:n,height:i}=s,r=document.createElement("canvas"),a=r.getContext("2d");r.width=n,r.height=i,a.putImageData(s,0,0,0,0,n,i);const o=`image/${t?t.toLowerCase():"png"}`;r.toBlob(c=>{e?.(null,c)},o,1)},Qn=(s,t)=>{const e=new FileReader;e.onload=function(n){n.target?t(null,n.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(s)},Sc=(s,t)=>{Qn(s,function(e,n){if(n){const i=new Image;i.src=n}else t(e)})};function Cc(s){const t=[],e=[],n=[];let i=0;for(let c=0,h=s.data.length;c<h;c+=4)t[i]=s.data[c],e[i]=s.data[c+1],n[i]=s.data[c+2],i+=1;const r=ts(t),a=ts(e),o=ts(n);return"rgb("+r+","+a+","+o+")"}function ts(s){const t={},e=[],n=[];for(let o=0;o<s.length;o++)t[s[o]]?e.push(s[o]):t[s[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),n[o]=i}const r=Math.max.apply(null,n);let a=0;for(;a<n.length;a++)if(n[a]===r)return;return e[a]}const Tc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;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,n)},Ec=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[((n-a-1)*e+o)*4],i[c+1]=t[((n-a-1)*e+o)*4+1],i[c+2]=t[((n-a-1)*e+o)*4+2],i[c+3]=t[((n-a-1)*e+o)*4+3]}return new ImageData(i,e,n)},Pc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<n;o++){const c=(a*n+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,n,e)},_c=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<n;o++){const c=(a*n+o)*4;i[c]=t[((n-o-1)*e+a)*4],i[c+1]=t[((n-o-1)*e+a)*4+1],i[c+2]=t[((n-o-1)*e+a)*4+2],i[c+3]=t[((n-o-1)*e+a)*4+3]}return new ImageData(i,n,e)},Dc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;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,n)},Ac=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;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,n)},kc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;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,n)},Ic=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;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,n)},Mc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;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,n)},Rc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;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,n)},Oc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;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,n)},Lc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;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,n)},Nc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;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,n)},Fc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;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,n)},Bc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;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,n)},Uc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;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,n)},Vc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;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,n)},Gc=s=>Hi(s,[-1,-1,-1,-1,9,-1,-1,-1,-1]),zc=s=>Hi(s,[-1,-1,-1,-1,8,-1,-1,-1,-1]),jc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;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,n)},Xc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;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=Wi([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,n)},qc=(s,t,e,n,i,r=!1,a)=>{const{data:o,width:c,height:h}=s;let l=i,f=n,g=t,w=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),w<1?w=1:w>h&&(w=h),l+g>c&&(g=c-l),f+w>h&&(w=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+w?(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*w*4);for(let b=f;b<=f+w;b++)for(let S=l;S<=l+g;S++){const C=((b-f)*g+S-l)*4,M=(b*c+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,w)}},Yc=(s,t,e,n)=>{const{data:i,width:r,height:a}=s;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 w=-1;f<o?l<o?w=Math.sqrt(Math.pow(o-f-1,2)+Math.pow(o-l-1,2)):l>a-o-1&&(w=Math.sqrt(Math.pow(o-f-1,2)+Math.pow(l-(a-o),2))):f>r-o-1&&(l<o?w=Math.sqrt(Math.pow(f-(r-o),2)+Math.pow(o-l-1,2)):l>a-o-1&&(w=Math.sqrt(Math.pow(f-(r-o),2)+Math.pow(l-(a-o),2)))),Math.round(w)>o?(c[g]=255,c[g+1]=255,c[g+2]=255,c[g+3]=n||e.toUpperCase()==="PNG"?0:255):(c[g]=i[g],c[g+1]=i[g+1],c[g+2]=i[g+2],c[g+3]=n||e.toUpperCase()==="PNG"?i[g+3]:255)}return new ImageData(c,r,a)},Hc=(s,t,e,n,i,r=1e4)=>{const a=new Image;a.src=s;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,n,i),c.getImageData(0,0,n,i)},Wc=(s,t)=>{const{data:e,width:n,height:i}=s,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;o++)for(let c=0;c<n;c++){const h=(o*n+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,n,i)},$c=(s,t,e=!1)=>{const{data:n,width:i,height:r}=s,a=new Uint8ClampedArray(n.length);for(let c=0;c<r;c++)for(let h=0;h<i;h++){const l=(c*i+h)*4;n[l+3]===0?(a[l]=255,a[l+1]=255,a[l+2]=255):(a[l]=n[l],a[l+1]=n[l+1],a[l+2]=n[l+2]);let f=n[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)},Jc=(s,t,e,n)=>{const{data:i,width:r,height:a}=s,{data:o,width:c,height:h}=t;let l=e,f=n;e+h>a&&(l=a-h),n+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]],M=[i[b],i[b+1],i[b+2],i[b+3]],R=Wi(C,M);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)},Zc=(s,t,e,n,i,r=10)=>{const{data:a,width:o,height:c}=s;let h=i,l=n,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 w=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),M=Math.floor((v-l)/r);let R=Math.floor(r*(C+1)-r/2+h),B=Math.floor(r*(M+1)-r/2+l);R>o-1&&(R=o-1),B>c-1&&(B=c-1);const N=(B*o+R)*4;w[S]=a[N],w[S+1]=a[N+1],w[S+2]=a[N+2],w[S+3]=a[N+3]}else w[S]=a[S],w[S+1]=a[S+1],w[S+2]=a[S+2],w[S+3]=a[S+3]}return new ImageData(w,o,c)},Kc=(s,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:n,width:i,height:r}=s,{data:a}=t,o=new Uint8ClampedArray(n.length),{backgroundColor:c,changeIntoColor:h}=e;for(let f=0;f<r;f++)for(let g=0;g<i;g++){const w=(f*i+g)*4,m=a[w],v=a[w+1],b=a[w+2],S=a[w+3];m===c.r&&v===c.g&&b===c.b&&S===c.a&&h.a!==0?(o[w]=h.r,o[w+1]=h.g,o[w+2]=h.b,o[w+3]=h.a):(o[w]=n[w],o[w+1]=n[w+1],o[w+2]=n[w+2],o[w+3]=n[w+3])}return new ImageData(o,i,r)}return s},Hi=(s,t)=>{const{data:e,width:n,height:i}=s,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;o++)for(let c=0;c<n;c++){const h=(o*n+c)*4;for(let l=0;l<3;l++){const f=h+l;c===0||c===n-1||o===0||o===i-1?r[f]=e[f]:r[f]=t[0]*e[f-n*4-4]+t[1]*e[f-n*4]+t[2]*e[f-n*4+4]+t[3]*e[f-4]+t[4]*e[f]+t[5]*e[f+4]+t[6]*e[f+n*4-4]+t[7]*e[f+n*4]+t[8]*e[f+n*4+4]}r[h+3]=e[h+3]}return new ImageData(r,n,i)},Wi=(s,t)=>{if(s&&s.length===4&&t&&t.length===4){const e=s[3],n=t[3];if(e===255||n===0)return s;if(e===0)return t;{const i=e/255,r=n/255,a=Math.max(Math.min(Math.floor(s[0]*i+t[0]*r*(1-i)),255),0),o=Math.max(Math.min(Math.floor(s[1]*i+t[1]*r*(1-i)),255),0),c=Math.max(Math.min(Math.floor(s[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]},es=function(){const s=[];return{writeByte(t){s.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,n=t.length){for(let i=0;i<n;i++)this.writeByte(t[i+e])},writeString(t){for(let e=0,n=t.length;e<n;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return s},toString(){let t="[";for(let e=0,n=s.length;e<n;e++)e>0&&(t+=","),t+=s[e];return t+="]",t}}},$i=function(){let s=0,t=0,e=0,n="";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){n+=String.fromCharCode(i(a&63))};return{writeByte(a){for(s=s<<8|a&255,t+=8,e+=1;t>=6;)r(s>>>t-6),t-=6},flush(){if(t>0&&(r(s<<6-t),s=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)n+="="}},toString(){return n}}},Ji=function(s,t,e){const n=new Array(s*s),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=es(),w=i(g);w.write(c,l);let m=0,v=String.fromCharCode(n[m]);for(m+=1;m<n.length;){const b=String.fromCharCode(n[m]);m+=1,f.contains(v+b)?v=v+b:(w.write(f.indexOf(v),l),f.size()<4095&&(f.size()==1<<l&&(l+=1),f.add(v+b)),v=b)}return w.write(f.indexOf(v),l),w.write(h,l),w.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){n[c*s+o]=h},write(o){o.writeString("GIF87a"),o.writeShort(s),o.writeShort(s),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(s),o.writeShort(s),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(";")}}},Zi=function(s,t,e,n){const i=Ji(s,t,e);for(let h=0;h<s;h++)for(let l=0;l<s;l++)i.setPixel(l,h,n(l,h));const r=es();i.write(r);const a=$i(),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},pt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ce={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},et={glog:function(s){if(s<1)throw new Error("glog("+s+")");return et.LOG_TABLE[s]},gexp:function(s){for(;s<0;)s+=255;for(;s>=256;)s-=255;return et.EXP_TABLE[s]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let s=0;s<8;s++)et.EXP_TABLE[s]=1<<s;for(let s=8;s<256;s++)et.EXP_TABLE[s]=et.EXP_TABLE[s-4]^et.EXP_TABLE[s-5]^et.EXP_TABLE[s-6]^et.EXP_TABLE[s-8];for(let s=0;s<255;s++)et.LOG_TABLE[et.EXP_TABLE[s]]=s;const X={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(s){let t=s<<10;for(;X.getBCHDigit(t)-X.getBCHDigit(X.G15)>=0;)t^=X.G15<<X.getBCHDigit(t)-X.getBCHDigit(X.G15);return(s<<10|t)^X.G15_MASK},getBCHTypeNumber:function(s){let t=s<<12;for(;X.getBCHDigit(t)-X.getBCHDigit(X.G18)>=0;)t^=X.G18<<X.getBCHDigit(t)-X.getBCHDigit(X.G18);return s<<12|t},getBCHDigit:function(s){let t=0;for(;s!=0;)t++,s>>>=1;return t},getPatternPosition:function(s){return X.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,t,e){switch(s){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:"+s)}},getErrorCorrectPolynomial:function(s){let t=new ae([1],0);for(let e=0;e<s;e++)t=t.multiply(new ae([1,et.gexp(e)],0));return t},getLengthInBits:function(s,t){if(1<=t&&t<10)switch(s){case pt.MODE_NUMBER:return 10;case pt.MODE_ALPHA_NUM:return 9;case pt.MODE_8BIT_BYTE:return 8;case pt.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(t<27)switch(s){case pt.MODE_NUMBER:return 12;case pt.MODE_ALPHA_NUM:return 11;case pt.MODE_8BIT_BYTE:return 16;case pt.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(t<41)switch(s){case pt.MODE_NUMBER:return 14;case pt.MODE_ALPHA_NUM:return 13;case pt.MODE_8BIT_BYTE:return 16;case pt.MODE_KANJI:return 12;default:throw new Error("mode:"+s)}else throw new Error("type:"+t)},getLostPoint:function(s){const t=s.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++){let o=0;const c=s.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==s.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;s.isDark(r,a)&&o++,s.isDark(r+1,a)&&o++,s.isDark(r,a+1)&&o++,s.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++)s.isDark(r,a)&&!s.isDark(r,a+1)&&s.isDark(r,a+2)&&s.isDark(r,a+3)&&s.isDark(r,a+4)&&!s.isDark(r,a+5)&&s.isDark(r,a+6)&&(e+=40);for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)s.isDark(a,r)&&!s.isDark(a+1,r)&&s.isDark(a+2,r)&&s.isDark(a+3,r)&&s.isDark(a+4,r)&&!s.isDark(a+5,r)&&s.isDark(a+6,r)&&(e+=40);let n=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++)s.isDark(a,r)&&n++;const i=Math.abs(100*n/t/t-50)/5;return e+=i*10,e}};class ae{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let n=0;for(;n<t.length&&t[n]==0;)n++;this.num=new Array(t.length-n+e);for(let i=0;i<t.length-n;i++)this.num[i]=t[i+n]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let n=0;n<this.getLength();n++)for(let i=0;i<t.getLength();i++)e[n+i]^=et.gexp(et.glog(this.get(n))+et.glog(t.get(i)));return new ae(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=et.glog(this.get(0))-et.glog(t.get(0)),n=new Array(this.getLength());for(let i=0;i<this.getLength();i++)n[i]=this.get(i);for(let i=0;i<t.getLength();i++)n[i]^=et.gexp(et.glog(t.get(i))+e);return new ae(n,0).mod(t)}}class Bt{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 n=Bt.getRsBlockTable(t,e);if(n==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const i=n.length/3,r=[];for(let a=0;a<i;a++){const o=n[a*3+0],c=n[a*3+1],h=n[a*3+2];for(let l=0;l<o;l++)r.push(new Bt(c,h))}return r}static getRsBlockTable(t,e){switch(e){case Ce.L:return Bt.RS_BLOCK_TABLE[(t-1)*4+0];case Ce.M:return Bt.RS_BLOCK_TABLE[(t-1)*4+1];case Ce.Q:return Bt.RS_BLOCK_TABLE[(t-1)*4+2];case Ce.H:return Bt.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Ki{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 n=0;n<e;n++)this.putBit((t>>>e-n-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 Qc{mode;data;constructor(t){this.mode=pt.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,n=this.data.length;e<n;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=Ce[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new Qc(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=Bt.getRSBlocks(t,this.errorCorrectLevel),n=new Ki;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];n.put(a.mode,4),n.put(a.getLength(),X.getLengthInBits(a.mode,t)),a.write(n)}if(n.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 n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++)this.modules[n][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 n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(let i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=n&&n<=6&&(i==0||i==6)||0<=i&&i<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=i&&i<=4?this.modules[t+n][e+i]=!0:this.modules[t+n][e+i]=!1)}getBestMaskPattern(){let t=0,e=0;for(let n=0;n<8;n++){this.makeImpl(!0,n);const i=X.getLostPoint(this);(n==0||t>i)&&(t=i,e=n)}return e}createMovieClip(t,e,n){const i=t.createEmptyMovieClip(e,n),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=X.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let n=0;n<t.length;n++){const i=t[e],r=t[n];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=X.getBCHTypeNumber(this.typeNumber);for(let n=0;n<18;n++){const i=!t&&(e>>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(let n=0;n<18;n++){const i=!t&&(e>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i}}setupTypeInfo(t,e){const n=this.errorCorrectLevel<<3|e,i=X.getBCHTypeInfo(n);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 n=-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),X.getMask(e,i,o-c)&&(h=!h),this.modules[i][o-c]=h,r--,r==-1&&(a++,r=7)}if(i+=n,i<0||this.moduleCount<=i){i-=n,n=-n;break}}}static createData(t,e,n){const i=Bt.getRSBlocks(t,e),r=new Ki;for(let o=0;o<n.length;o++){const c=n[o];r.put(c.mode,4),r.put(c.getLength(),X.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 n=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,w=e[f].totalCount-g;i=Math.max(i,g),r=Math.max(r,w),a[f]=new Array(g);for(let S=0;S<a[f].length;S++)a[f][S]=255&t.buffer[S+n];n+=g;const m=X.getErrorCorrectPolynomial(w),b=new ae(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 Qi=Math.ceil,Te=Math.floor,tr=Math.round;function th(s,t){const e=As(s),n=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,n);h.addData(e),h.make();const l=h.getModuleCount(),f=(i-a*2)/l,g=a,w=i-a;return Zi(i,o,c,function(m,v){if(g<=m&&m<w&&g<=v&&v<w){const b=Te((m-g)/f),S=Te((v-g)/f);return h.isDark(S,b)?0:1}else return 1})}function eh(s,t){const e=t.x||0,n=t.y||0,i=As(s),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?Te(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 w=g.getModuleCount(),m=(o-c*2)/w;r.fillStyle=f,r.fillRect(e,n,o,o);for(let v=0;v<w;v++)for(let b=0;b<w;b++){const S=Qi((b+1)*m)-Te(b*m),C=Qi((v+1)*m)-Te(v*m);r.fillStyle=g.isDark(v,b)?l:f,r.fillRect(e+tr(b*m)+c,n+tr(v*m)+c,S,C)}}let rn;const er=new WeakMap;function ns(s,t){let e=er.get(s);e||(e=new Map,er.set(s,e));let n=e.get(t);return n||(n=new nr,e.set(t,n)),n}class nr{subscribers;constructor(){this.subscribers=new Set}depend(){rn&&this.subscribers.add(rn)}notify(){this.subscribers.forEach(t=>t())}}function nh(s){rn=s,s(),rn=null}function sh(s){return Object.keys(s).forEach(t=>{let e=s[t];const n=ns(s,t);Object.defineProperty(s,t,{get(){return n.depend(),e},set(i){i!=e&&(e=i,n.notify())}})}),s}function sr(s){return new Proxy(s,{get(t,e,n){return ns(s,e).depend(),Reflect.get(t,e,n)},set(t,e,n,i){const r=ns(s,e);return s[e]!=n&&(s[e]=n,r.notify()),Reflect.set(t,e,n,i)}})}const ih=sr;class an{x;y;z;constructor(t=[0,0,0],e=[0,0,0]){const[n,i,r]=t,[a,o,c]=e;this.x=n-a,this.y=i-o,this.z=r-c}get length(){const{x:t,y:e,z:n}=this;return Math.sqrt(t*t+e*e+n*n)}unit(){const t=this.length;return new an([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,n=this.y,i=this.z,r=t.x,a=t.y,o=t.z;return new an([n*o-i*a,i*r-e*o,e*a-r*n])}}class oe extends J{shapes=[];constructor(t){super(t)}toSVGPathData(){return this.shapes.reduce((t,e,n)=>{const i=e.toSVGPathData();return Array.isArray(i[0])?t.push(...i):t.push(i),t},[])}toCanvasContext(t){}}class ir extends ri{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,n)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,n)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const n=qr(e);for(let i of n.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,n)=>{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),is(this.currentItem.style,this.currentItem,rs)}switch(this.processAttrs(e,n),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 n=[],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&&is(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+ss(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),n=[this.grad.angle];for(let o=0,c=this.grad.stops.length;o<c;o++)i=this.grad.stops[o],o&&o!=c-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break;case"radialGradient":n=[];for(let o=0,c=this.grad.stops.length;o<c;o++)i=this.grad.stops[o],o&&o!=c-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.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(rs.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"&&is(a,this.currentItem,rs),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 ss(s,t,e,n,i,r){if(typeof i>"u"||typeof r>"u"){const a=s-e,o=t-n;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return ss(s,t,i,r)-ss(e,n,i,r)}function is(s,t,e){const n=(s+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,a=n.length;r<a;r++){let o=n[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 rs=["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 rh{app;rootEl;shapes=[];allShapes=[];isMouseDown=!1;currentMouseInShapeID="";currentEnableDragMouseInShapeID="";constructor(t,e,n){this.app=t,this.rootEl=H.createSVGElement("svg"),D.empty(this.app.container),D.insert(this.app.container,this.rootEl),e&&n?this.setSize(e,n):(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.currentMouseInShapeID="",this.isMouseDown&&this.currentEnableDragMouseInShapeID){this.setCursor();return}let i=0,r=this.shapes.length;for(;i<r;i++){const a=this.shapes[i];if(!(a instanceof z))continue;const o=a.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||!1;if(o&&(this.currentMouseInShapeID=a.id),a.mouseMove&&a.mouseMove(o),o&&a.enableDrag){this.currentEnableDragMouseInShapeID=a.id;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 D.attribute(this.rootEl,{viewBox:`0 0 ${t} ${e}`,width:`${t}`,height:`${e}`}),this}download(){return H.downloadFromSVGElement(this.rootEl)}attr(t,e,n){const i=t.el||t;if(!(i instanceof SVGElement))return this;if(e===void 0&&n===void 0)return D.attribute(i);if(typeof e=="string"&&n===void 0)return D.attribute(i,ft(e))||"";if(typeof e=="object"){const r=D.attribute(i);if(D.attribute(i,e),t instanceof J){t.attrs={...e};for(let a in e)ft(a)===r[ft(a)]&&delete r[ft(a)];for(let a in r)a!=="d"&&a!=="fill"&&a!=="stroke"&&D.removeAttribute(i,a)}}else typeof e=="string"&&n!==void 0&&(D.attribute(i,ft(e),n),t instanceof J&&(t.attrs[ft(e)]=n));return this}path(t,e){const n=typeof e?.addToShapes=="boolean"?e?.addToShapes:!0;if(t instanceof cs){t.el=this.text(t.text,t.x,t.y),this.attr(t.el,t.attrs),this.allShapes.push(t);return}if(t instanceof bt){const r=`M ${t.fromX} ${t.fromY} `+t.toSVGPathD();t.el=H.createSvgPath(r),D.insert(this.rootEl,t.el),this.update(t),this.allShapes.push(t),n&&this.shapes.push(t);return}if(t instanceof _e){t.shapes.forEach(r=>{r.el=H.createSvgPath(r.toSVGPathD()),D.insert(this.rootEl,r.el),this.update(r),this.allShapes.push(r),n&&this.shapes.push(r)});return}if(t instanceof oe){t.shapes.forEach(r=>this.path(r,e));return}let i;return t instanceof z?i=t:t instanceof J?i=z.fromShape(t):(i=z.fromSVGPathD(t||"M0,0"),Ve(i,e||{})),i.el=H.createSvgPath(i.toSVGPathD()),D.insert(this.rootEl,i.el),this.update(i),this.allShapes.push(i),n&&this.shapes.push(i),i}update(t){if(!t)return;const e=[];t instanceof oe?e.push(...t.shapes):e.push(t),e.forEach(n=>{if(n instanceof z){if(n.followMouse&&(!ue(n.x,this.app.mousePoint.x,5)||!ue(n.y,this.app.mousePoint.y,5))&&(n.angleTo(this.app.mousePoint),n.followTo(this.app.mousePoint)),n.targetToAfterDragFree&&(this.isMouseDown||n.nextFrameEaseTo(new mt({x:n.targetToAfterDragFree.targetX,y:n.targetToAfterDragFree.targetY}),{easing:n.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShapeID==n.id){const{dx:i,dy:r}=n.centerDiff;n.x=this.app.mousePoint.x,n.y=this.app.mousePoint.y,n.x-=i,n.y-=r,n.isDragging=!0,this.shapes.filter(a=>a.id!=n.id).forEach(a=>{a instanceof J&&(a.isDragging=!1)})}n.updateTransform()}(n instanceof bt||n instanceof z)&&(this.attr(n,"d",n instanceof bt?`M ${n.fromX} ${n.fromY} `+n.toSVGPathD():n.toSVGPathD()),this.attr(n,n.attrs)),n.el&&(n.isShow?D.show(n.el):D.hide(n.el))})}click(t){const e=()=>{this.shapes.forEach(n=>{n instanceof z&&n.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)&&t(n)})};return this.app.on("tap",e),()=>{this.app.off("tap",e)}}delete(t){t.el&&D.remove(t.el),this.shapes=this.shapes.filter(e=>e.id!=t.id),this.allShapes=this.allShapes.filter(e=>e.id!=t.id)}clear(){this.allShapes.forEach(t=>{t instanceof SVGElement?D.remove(t):t.el&&D.remove(t.el)}),this.shapes=[],this.allShapes=[]}pathRosetta(t,e,n,i,r){if(r==0)throw new Error("no dividing by zero, please");const a=new z({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*n*Math.cos(h),f=e+2*n*Math.sin(h);a.appendLine(new ce({x:l,y:f,rx:n,ry:i,xAxisRotate:o*c,largeArcFlag:1,sweepFlag:1})),a.appendLine(new ce({x:t,y:e,rx:n,ry:i,xAxisRotate:o*c,largeArcFlag:1,sweepFlag:1}))}return this.path(a),a}trailPath(t,e,n=0){const i=t.getTotalLength();return this.attr(e,"d",t.getSubpath(0,n*i).toSVGPathD()),t.getPointAtLength(n*i)}circle(t,e,n){return this.path(new mt({x:t,y:e,radius:n}))}circleEl(t,e,n){const i=H.createSVGElement("circle",{cx:String(t),cy:String(e),r:String(n)});return D.insert(this.rootEl,i),i}ellipse(t,e,n,i){return this.path(new ar({x:t,y:e,rx:n,ry:i}))}ellipseEl(t,e,n,i){const r=H.createSVGElement("ellipse",{cx:String(t),cy:String(e),rx:String(n),ry:String(i)});return D.insert(this.rootEl,r),r}rect(t,e,n,i){return this.path(new Pt({x:t,y:e,width:n,height:i}))}rectEl(t,e,n,i){const r=H.createSVGElement("rect",{x:String(t),y:String(e),width:String(n),height:String(i)});return D.insert(this.rootEl,r),r}image(t,e,n,i,r){}text(t,e,n,i="1.2em"){const r=H.createSVGElement("text",{x:String(e),y:String(n)});return t.split(`
|
|
41
|
-
`).forEach((a,o)=>{if(a.trim()){const c=H.createSVGElement("tspan",{x:String(e),dy:o>0?i:"0"});D.html(c,a),D.insert(r,c),this.attr(c,{"alignment-baseline":"middle"})}}),D.insert(this.rootEl,r),r}}const rr=ah("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 ah(s,t=10){const e={},n=s.split(",");for(let i=0;i<n.length;i+=2){const r="&"+n[i+1]+";",a=parseInt(n[i],t);e[r]="&#"+a+";"}return e["\\xa0"]=" ",e}function ct(s,t){const e=Object.keys(t);for(let n=0;n<e.length;n++)s=s.replace(new RegExp("{"+e[n]+"}","gi"),""+t[e[n]]);return s}function on(s){let t,e;if(!s)throw new Error("cannot create a random attribute name for an undefined object");const n="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=n[Math.floor(Math.random()*n.length)];while(s[t]);return t}function oh(s){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[s]||t.start}function ch(s){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[s]||t.alphabetic}const Ee={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"}};class cn{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const n=this.__ctx.__createElement("stop");if(n.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&&(n.setAttribute("stop-color",ct("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),n.setAttribute("stop-opacity",r[4]))}else n.setAttribute("stop-color",e);this.__root.appendChild(n)}}class as{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Pe{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:n=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=n),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(Ee);for(let e=0,n=t.length;e<n;e++){const i=t[e];this[i]=Ee[i].canvas}}__getStyleState(){const t={},e=Object.keys(Ee);for(let n=0,i=e.length;n<i;n++){const r=e[n];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let n=0,i=e.length;n<i;n++){const r=e[n];this[r]=t[r]}}__createElement(t,e={},n=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);n&&(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 n=this.__currentElementsToStyle;n&&(e.setAttribute(t,""),e=n.element,n.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(Ee);for(let r=0;r<i.length;r++){const a=Ee[i[r]],o=this[i[r]];if(a.apply){if(o instanceof as){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,ct("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof cn)e.setAttribute(a.apply,ct("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,ct("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(rr);for(let r=0,a=i.length;r<a;r++){const o=i[r],c=rr[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 n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=t,this.__currentElement.setAttribute("transform",n)}scale(t,e){e===void 0&&(e=t),this.__addTransform(ct("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(ct("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(ct("translate({x},{y})",{x:t,y:e}))}transform(t,e,n,i,r,a){this.__addTransform(ct("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:n,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(ct("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(ct("L {x} {y}",this.__currentPosition)):this.__addPathCommand(ct("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,n,i,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(ct("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:n,cp2y:i,x:r,y:a}))}quadraticCurveTo(t,e,n,i){this.__currentPosition={x:n,y:i},this.__addPathCommand(ct("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:n,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,n,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===n&&e===i||r===0){this.lineTo(t,e);return}const c=this.normalize([a-t,o-e]),h=this.normalize([n-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]]),w=r/Math.sin(f/2),m=t+w*g[0],v=e+w*g[1],b=[-c[1],c[0]],S=[h[1],-h[0]],C=function(B){const N=B[0];return B[1]>=0?Math.acos(N):-Math.acos(N)},M=C(b),R=C(S);this.lineTo(m+b[0]*r,v+b[1]*r),this.arc(m,v,r,M,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,n,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),n=this.__rootSVG.childNodes[1],i=n.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&n.removeChild(i[r]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,n,i){if(t===0&&e===0&&n===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:n,height:i,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,n,i){const r=this.__createElement("linearGradient",{id:on(this.__ids),x1:t+"px",x2:n+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new cn(r,this)}createRadialGradient(t,e,n,i,r,a){const o=this.__createElement("radialGradient",{id:on(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 cn(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),n={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"&&(n.decoration="underline"),this.__fontHref&&(n.href=this.__fontHref),n}__wrapTextLink(t,e){if(t.href){const n=this.__createElement("a");return n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),n.appendChild(e),n}return e}__applyText(t,e,n,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:n,"text-anchor":oh(this.textAlign),"dominant-baseline":ch(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(i),a.appendChild(this.__wrapTextLink(r,o))}fillText(t,e,n){this.__applyText(t,e,n,"fill")}strokeText(t,e,n){this.__applyText(t,e,n,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,n,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+n*Math.cos(r),c=e+n*Math.sin(r),h=t+n*Math.cos(i),l=e+n*Math.sin(i),f=a?0:1;let g=0,w=r-i;w<0&&(w+=2*Math.PI),a?g=w>Math.PI?0:1:g=w>Math.PI?1:0,this.lineTo(h,l),this.__addPathCommand(ct("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,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"),n=on(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",n),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",ct("url(#{id})",{id:n})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],n,i,r,a,o=0,c=0,h,l,f,g,w,m,v,b;if(t.length===3)n=t[1],i=t[2],h=e.width,l=e.height,r=h,a=l;else if(t.length===5)n=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],n=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("+n+", "+i+")";if(e instanceof Pe){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(w=f.childNodes[1],w){const M=w.getAttribute("transform");let R;M?R=M+" "+C:R=C,w.setAttribute("transform",R),S.appendChild(w)}}}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 n=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=on(this.__ids);let r;return n.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")),n.appendChild(r),this.__SVGdefs.appendChild(n)):t instanceof Pe&&(n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(n)),new as(n,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class hn{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),this.customContext=new Pe({canvas:this.canvas,width:this.canvas.width,height: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,n,i){return this.context.fillRect(t,e,n,i),this.customContext.fillRect(t,e,n,i),this}fillText(t,e,n,i){return this.context.fillText(t,e,n,i),this.customContext.fillText(t,e,n),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,n,i){return this.context.strokeText(t,e,n,i),this.customContext.strokeText(t,e,n),this}strokeRect(t,e,n,i){return this.context.strokeRect(t,e,n,i),this.customContext.strokeRect(t,e,n,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,n=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,n,i),this.customContext.clearRect(t,e,n,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 n=new Path2D;n.addPath(t,e),this.currentPath2D=n}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,n,i,r,a){return this.context.arc(t,e,n,i,r,a),this.customContext.arc(t,e,n,i,r,a?-1:1),this.currentPath2D.arc(t,e,n,i,r,a),this}arcTo(t,e,n,i,r){return this.context.arcTo(t,e,n,i,r),this.customContext.arcTo(t,e,n,i,r),this.currentPath2D.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,a,o,c){return this.context.ellipse(t,e,n,i,r,a,o,c),this.currentPath2D.ellipse(t,e,n,i,r,a,o,c),this}quadraticCurveTo(t,e,n,i){return this.context.quadraticCurveTo(t,e,n,i),this.customContext.quadraticCurveTo(t,e,n,i),this.currentPath2D.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,a){return this.context.bezierCurveTo(t,e,n,i,r,a),this.customContext.bezierCurveTo(t,e,n,i,r,a),this.currentPath2D.bezierCurveTo(t,e,n,i,r,a),this}rect(t,e,n,i){return this.context.rect(t,e,n,i),this.customContext.rect(t,e,n,i),this.currentPath2D.rect(t,e,n,i),this}createLinearGradient(t,e,n,i,r){const a=this.context.createLinearGradient(t,e,n,i),o=this.customContext.createLinearGradient(t,e,n,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,n,i,r,a,o){const c=this.context.createRadialGradient(t,e,n,i,r,a),h=this.customContext.createRadialGradient(t,e,n,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 n=e[0],i=e[1];this.context.drawImage(t,n,i)}else if(e.length===4){const n=e[0],i=e[1],r=e[2],a=e[3];this.context.drawImage(t,n,i,r,a)}else if(e.length===8){const n=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,n,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,n=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,n,i,r)}putImageData(t,e=0,n=0){return this.context.putImageData(t,e,n)}toRawSVG(){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}}class bt extends J{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 bt({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=de(this.fromX,this.fromY,this.x,this.y);if(t===0){const e=Math.min(this.x,this.fromX),n=Math.min(this.y,this.fromY),i=Math.max(this.x,this.fromX),r=Math.max(this.y,this.fromY);return new Pt({x:e,y:n,width:i-e,height:r-n})}else{const e=Math.sin(t),n=Math.cos(t),i=n*this.fromX-e*this.fromY,r=n*this.x-e*this.y,a=n*this.fromY+e*this.fromX,o=n*this.y+e*this.x;return new Pt({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 _t extends bt{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 _t({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=H.curveDim(this.fromX,this.fromY,this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y);return new Pt({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 H.bezlen(this.fromX,this.fromY,this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y,t)}getTatLen(t){const e=this.fromX,n=this.fromY,i=this.c1x,r=this.c1y,a=this.c2x,o=this.c2y,c=this.x,h=this.y;if(t<0||H.bezlen(e,n,i,r,a,o,c,h)<t)return 0;let l=1,f=l/2,g=l-f,w,m=.01;for(w=H.bezlen(e,n,i,r,a,o,c,h,g);Math.abs(w-t)>m;)f/=2,g+=(w<t?1:-1)*f,w=H.bezlen(e,n,i,r,a,o,c,h,g);return g}getPointAtSegmentLength(t){const e=this.getTatLen(t),n=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),w=Math.pow(f,2),m=e*e,v=m*e,b=g*n+w*3*e*r+f*3*e*e*o+v*h,S=g*i+w*3*e*a+f*3*e*e*c+v*l,C=n+2*e*(r-n)+m*(o-2*r+n),M=i+2*e*(a-i)+m*(c-2*a+i),R=r+2*e*(o-r)+m*(h-2*o+r),B=a+2*e*(c-a)+m*(l-2*c+a),N=f*n+e*r,W=f*i+e*a,it=f*o+e*h,q=f*c+e*l,nt=90-Math.atan2(C-R,M-B)*180/Math.PI;return{x:b,y:S,m:{x:C,y:M},n:{x:R,y:B},start:{x:N,y:W},end:{x:it,y:q},alpha:nt}}}class ln extends bt{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 ln({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,n=this.cy*2-(this.fromY+this.y)/2;t.quadraticCurveTo(e,n,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 ce extends bt{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 ce({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,n,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,n,i,r,a,o,c,!this.sweepFlag)}convertSVGToCanvas(t,e,n,i,r,a,o,c,h){const l=o/180*Math.PI,f=(t-n)/2,g=(e-i)/2,w=Math.cos(l)*f+Math.sin(l)*g,m=-Math.sin(l)*f+Math.cos(l)*g,v=w*w/(r*r)+m*m/(a*a);if(v>1){const Y=Math.sqrt(v);throw r=Y*r,a=Y*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*w*w)/(r*r*m*m+a*a*w*w)),S=c!=h?1:-1,C=S*b*r*m/a,M=S*b*-a*w/r,R=(t+n)/2,B=(e+i)/2,N=Math.cos(l)*C-Math.sin(l)*M+R,W=Math.sin(l)*C+Math.cos(l)*M+B,it=(Y,$,ht,rt)=>(Y*rt>=$*ht?1:-1)*Math.acos((Y*ht+$*rt)/(Math.sqrt(Y*Y+$*$)*Math.sqrt(ht*ht+rt*rt))),q=it(1,0,t-N,e-W)-l,nt=it(t-N,e-W,n-N,i-W);return[N,W,r,a,l,q,q+nt]}}class z extends J{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 ce){Ln(this.prevPathX,this.prevPathY,t.rx,t.ry,t.xAxisRotate,t.largeArcFlag,t.sweepFlag,t.x,t.y).forEach(h=>{const[l,f,g,w,m,v]=h;this.normalizedLines.push(new _t({c1x:l,c1y:f,c2x:g,c2y:w,x:m,y:v,fromX:this.prevPathX,fromY:this.prevPathY})),this.prevPathX=m,this.prevPathY=v});return}let e,n,i,r,a,o;t instanceof _t?(e=t.c1x,n=t.c1y,i=t.c2x,r=t.c2y,a=t.x,o=t.y):t instanceof ln?[e,n,i,r,a,o]=Nn(this.prevPathX,this.prevPathY,t.cx,t.cy,t.x,t.y):[e,n,i,r,a,o]=me(this.prevPathX,this.prevPathY,t.x,t.y),this.normalizedLines.push(new _t({c1x:e,c1y:n,c2x:i,c2y:r,x:a,y:o,fromX:this.prevPathX,fromY:this.prevPathY})),this.prevPathX=a,this.prevPathY=o}static fromShape(t){const e=z.fromSVGPathD(t.toSVGPathD());return Ve(e,t),Gr(e,t),e.prevDegree=0,e.prevScaleOnOrigin=1,e.prevSkewDegreeOnOrigin=0,e.updateTransform(),e}static fromSVGPathD(t,e){const n=new z;return n.updateFromSVGPathD(t,e),n}static fromSVGPathData(t,e){const n=new z;return n.updateFromSVGPathData(t,e),n}updateFromSVGPathD(t,e){if(!H.isSVGPath(t))throw new Error("Not a SVG path!");return this.updateFromSVGPathData(H.parseSVGPath(t),e)}updateFromSVGPathData(t,e){this.normalizedLines=[];const n=H.normalizeSVGPath(H.absolutizeSVGPath(t));for(let r=0,a=n.length;r<a;r++){const o=n[r];if(o[0]=="M"){this.prevPathX=this.startPathX=o[1],this.prevPathY=this.startPathY=o[2];continue}this.appendLine(new _t({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],x:o[5],y:o[6]}))}const i=On(e??"");return this.transform(i)}toSVGPathData(){const t=[];t.push(["M",this.startPathX,this.startPathY]);for(let e=0,n=this.normalizedLines.length;e<n;e++)t.push(this.normalizedLines[e].toSVGPathData());return t}toCanvasContext(t){t.beginPath(),t.moveTo(this.startPathX,this.startPathY),this.normalizedLines.forEach(e=>{const[n,...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 n=new tt().translate(t,e);return this.transform(n),this.prevX=this.x,this.prevY=this.y,this}rotate(t,e=0,n=0){const i=new tt().rotate(t,e,n);return this.transform(i),this.prevDegree=this.degree,this}scale(t,e=t,n=0,i=0){const r=new tt().scale(t,e,n,i);return this.transform(r),this.prevScaleOnOrigin=this.scaleOnOrigin,this}skew(t,e=0){const n=new tt().skew(t,e);return this.transform(n),this.prevSkewDegreeOnOrigin=this.skewDegreeOnOrigin,this}trim(){const t=this.getBoundingClientRect();return this.translate(-t.x,-t.y),this}getBoundingClientRect(){let t=0,e=0,n=[],i=[];t=this.startPathX,e=this.startPathY,n.push(t),i.push(e),this.normalizedLines.forEach(h=>{const l=H.curveDim(t,e,h.c1x,h.c1y,h.c2x,h.c2y,h.x,h.y);n=n.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,n),a=Math.min.apply(0,i),o=Math.max.apply(0,n),c=Math.max.apply(0,i);return new Pt({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,n=this.normalizedLines[0];if(e--,e>1)for(let i=1,r=this.normalizedLines.length;i<r&&(n=this.normalizedLines[i],e>1);i++)e-=1;return n.interpolate(e)}}getPointAtLength(t){let e={x:0,y:0,alpha:0},n=0;for(let i=0,r=this.normalizedLines.length;i<r;i++){const a=this.normalizedLines[i],o=a.length();if(n+o>t){e=a.getPointAtSegmentLength(t-n);break}n+=o}return e}getSubpathsAtLength(t,e,n){let i=null,r=0;const a=new z;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 _t({c1x:f.start.x,c1y:f.start.y,c2x:f.m.x,c2y:f.m.y,x:f.x,y:f.y})),n)return a;i=a,a.prevPathX=f.x,a.prevPathY=f.y,a.appendLine(new _t({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 n=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(n,t):n}}isPointInPath(t,e,n){if(n instanceof hn)return n.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=n.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInFill(i):!1}isPointInStroke(t,e,n){if(n instanceof hn)return n.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=n.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(i):!1}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 z({x:t[0],y:t[1]});for(let n=2;n+5<t.length;n+=6)e.appendLine(new _t({c1x:t[n],c1y:t[n+1],c2x:t[n+2],c2y:t[n+3],x:t[n+4],y:t[n+5]}));return e}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let n=t[e-2],i=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=Rn(t[a],t[a+1],n,i),n=t[a],i=t[a+1];return Math.floor(r)}fillPathD(t){const e=this.polymorphPoints,n=e.length;let i=t-n;const r=Math.ceil(t/n),a=[];a.push(["M",e[0],e[1]]);let o=2;for(;o+5<=n-1;){const c=e[o++],h=e[o++],l=e[o++],f=e[o++],g=e[o++],w=e[o++];a.push(["C",c,h,l,f,g,w]);let m=0;for(;m<r&&i>0;)a.push(["C",g,w,g,w,g,w]),i-=6,m++}return z.fromSVGPathData(a)}static mixPoints(t,e,n){const i=t.length,r=new Array(i);for(let a=0;a<i;a++)r[a]=Jt(t[a]+(e[a]-t[a])*n,6);return r}static getPathInterpolator(t,e){return n=>Math.abs(n-0)<Number.EPSILON?t.toSVGPathD():Math.abs(n-1)<Number.EPSILON?e.toSVGPathD():z.fromPolymorphPoints(this.mixPoints(t.polymorphPoints,e.polymorphPoints,n)).toSVGPathD()}static polymorph(t){if(!t.length)throw new Error("paths 为空!");const e=t.length-1,n=new Array(e);for(let r=0;r<e;r++){const a=Math.max(t[r].polymorphPoints.length,t[r+1].polymorphPoints.length);n[r]=this.getPathInterpolator(t[r].fillPathD(a),t[r+1].fillPathD(a))}const i=z.fromSVGPathD(n[0](0));return r=>{const a=Jt(e*r,6),o=Math.min(Math.floor(a),e-1),c=Jt(a-o,6);return i.updateFromSVGPathD(n[o](c)),i.attrs=t[o+1].attrs,i}}}class _e extends oe{svgWidth=0;svgHeight=0;width=0;height=0;shapes=[];constructor(t){if(super(t),!t?.svg)return;const e=new ir(t.svg).parse();for(let n=0,i=e.length;n<i;n++){const r=e[n];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=z.fromSVGPathData(l,r.transform);Ve(f,t),f.attrs={...f.attrs,...a,...t.attrs},this.width&&this.svgWidth&&f.scale(this.width/this.svgWidth),this.shapes.push(f)})}}static fromShape(t){const e=new _e;return t instanceof J?e.shapes.push(z.fromShape(t)):e.shapes.push(...t.map(n=>z.fromShape(n))),e}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,n=this.shapes.length;if(e<n)return t.fillPathDGroup(this);for(let i=n;i<e;i++){const r=t.shapes[i].polymorphPoints,a=r[0],o=r[1],c=new z({x:a,y:o,attrs:t.shapes[i].attrs});for(let h=2;h+5<r.length;h+=6)c.appendLine(new _t({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,n=0;t.forEach((o,c)=>{o.sortPathD(),n<o.shapes.length&&(n=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(z.polymorph(o)));const a=new _e;return r.forEach(o=>{a.shapes.push(o(0))}),o=>(r.forEach(c=>{c(o)}),a)}}class ar extends J{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}getBoundingClientRect(){return new Pt({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 os extends J{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 n=0;n<=t-1;n++)e.push(["L",this.points[n].x,this.points[n].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 n=0;n<=e-1;n++)t.lineTo(this.points[n].x-this.points[0].x,this.points[n].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 n=this.length;let i=!1;const r=2e-10;for(let a=0,o=n-1;a<n;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),w=c+g*(e-h);if(w===t||Math.abs(w-t)<r)return!0;w>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,n,i){const r=[];for(let a=0;a<i;a++){const o=a/i*2*Math.PI,{x:c,y:h}=zt(o,n);r.push(new si({x:t+c,y:e+h}))}return new os(r)}}class hh extends J{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,n){this.cX=t,this.cY=e,this.cZ=n}rotateX(t){({x:this.y,y:this.z}=Et(t,this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=Et(t,this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=Et(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,n=this.y,i=this.z;return this.x=n*t.z-i*t.y,this.y=i*t.x-e*t.z,this.z=e*t.y-n*t.x,this}normalize(t=1){const e=je(this.x,this.y,this.z);if(e){const n=t/e;this.x*=n,this.y*=n,this.z*=n}return this}reflect(t,e){const n=t.x*e.x+t.y*e.y+t.z*e.z;return this.x=t.x-2*n*e.x,this.y=t.y-2*n*e.y,this.z=t.z-2*n*e.z,this}}class lh extends J{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=t?.brightness||1}setBrightness(t){this.brightness=Math.min(Math.max(t,0),1)}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){}}const uh=lh;class fh extends J{points;light;constructor(t=[]){if(t.length<3)throw new Error("points length must >= 3");super(t[0]),this.points=t,this.light=new uh({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,n=this.points.length;e<=n-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,n=this.points.length;e<=n-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(),n=this.points[1].getScreenX()-this.points[2].getScreenX(),i=this.points[1].getScreenY()-this.points[2].getScreenY();return t*i>e*n}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},n={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=n.x*this.light.x+n.y*this.light.y+n.z*this.light.z,r=Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.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=jt(t),n=this.getLightFactor();return e.r*=n,e.g*=n,e.b*=n,we(e)}}class cs extends J{text;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',fill:"#666666","alignment-baseline":"middle",...this.attrs}}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){t.fillText(this.text,0,0)}}class dh extends oe{radius;startDegree;endDegree;text="";defaultShowText;p1=new mt;p1Offset=10;p2=new mt;p2Offset=40;p3=new mt;p3Offset=10;p4=new mt;p4Offset=10;direction=1;constructor(t){super(t),this.radius=t.radius,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.text=t.text||"",this.defaultShowText=typeof t?.defaultShowText=="boolean"?t.defaultShowText:!1;const e=this.startDegree+(this.endDegree-this.startDegree)/2,{x:n,y:i}=zt(ot(e),this.radius+this.p1Offset);this.p1.x=this.x+n,this.p1.y=this.y+i;const{x:r,y:a}=zt(ot(e),this.radius+this.p1Offset+this.p2Offset);this.p2.x=this.x+r,this.p2.y=this.y+a,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;const o=Object.assign({...this.attrs},{fill:"none"}),c=new bt({fromX:this.p1.x,fromY:this.p1.y,x:this.p2.x,y:this.p2.y,attrs:o,isShow:this.defaultShowText}),h=new bt({fromX:this.p2.x,fromY:this.p2.y,x:this.p3.x,y:this.p3.y,attrs:o,isShow:this.defaultShowText}),l=new cs({x:this.p4.x,y:this.p4.y,text:this.text,attrs:{...o,textAnchor:this.direction==1?"start":"end"},isShow:this.defaultShowText});this.shapes.push(new or({x:this.x,y:this.y,radius:this.radius,startDegree:this.startDegree,endDegree:this.endDegree,attrs:Object.assign({...this.attrs},{strokeWidth:"0"}),mouseMove:f=>{this.text&&!this.defaultShowText&&(c.isShow=f,h.isShow=f,l.isShow=f)}})),this.text&&(this.shapes.push(c),this.shapes.push(h),this.shapes.push(l))}}class or extends J{radius;startDegree;endDegree;constructor(t){super(t),this.radius=t.radius,this.startDegree=t.startDegree,this.endDegree=t.endDegree}toSVGPathData(){const{x:t,y:e}=zt(ot(this.startDegree),this.radius),{x:n,y:i}=zt(ot(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+n,this.y+i],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.arc(0,0,this.radius,ot(this.startDegree),ot(this.endDegree),!1),t.closePath()}containPoint(t,e){const[n,i]=[t-this.x,e-this.y],r=Math.sqrt(n*n+i*i);let a=de(this.x,this.y,t,e);a<0&&(a+=Math.PI*2);const o=Q(a);return r<this.radius&&o>this.startDegree&&o<this.endDegree}}class mh extends J{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 ph extends J{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()}}(function(){let s=0;window.requestAnimationFrame||(window.requestAnimationFrame=function(t){const e=new Date().getTime(),n=Math.max(0,16-(e-s)),i=window.setTimeout(function(){t(e+n)},n);return s=e+n,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})})();const cr=s=>{let t=window.requestAnimationFrame(function e(n){s(n),t=window.requestAnimationFrame(e)});return()=>window.cancelAnimationFrame(t)};class gh{id=0;renders={};cancelAnimateInWeb;constructor(){}get length(){let t=0;for(let e in this.renders)t++;return t}run(t){const e=this.id++;this.renders[e]=t,!this.cancelAnimateInWeb&&(this.cancelAnimateInWeb=cr(n=>{const i=[];for(let r in this.renders)this.renders[r](n)===!1&&i.push(parseInt(r));for(let r of i)delete this.renders[r];!this.length&&this.cancelAnimateInWeb&&(this.cancelAnimateInWeb(),this.cancelAnimateInWeb=void 0)}))}runAccurateSetTimeout(t,e=0){let n=!1,i;return this.run(r=>n?!1:(i||(i=r),r-i>=e?(t(),!1):!0)),()=>{n=!0}}}const De=new gh;let Ae;typeof self>"u"&&typeof process<"u"&&process.hrtime?Ae=function(){const s=process.hrtime();return s[0]*1e3+s[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?Ae=self.performance.now.bind(self.performance):Date.now!==void 0?Ae=Date.now:Ae=function(){return new Date().getTime()};const he=Ae;class ke{static _nextId=0;static nextId(){return ke._nextId++}}const un={Linear:{None:function(s){return s}},Ease:{In:function(s){return Math.pow(s,1.7)}},Quadratic:{In:function(s){return s*s},Out:function(s){return s*(2-s)},InOut:function(s){return(s*=2)<1?.5*s*s:-.5*(--s*(s-2)-1)}},Cubic:{In:function(s){return s*s*s},Out:function(s){return--s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s:.5*((s-=2)*s*s+2)}},Quartic:{In:function(s){return s*s*s*s},Out:function(s){return 1- --s*s*s*s},InOut:function(s){return(s*=2)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2)}},Quintic:{In:function(s){return s*s*s*s*s},Out:function(s){return--s*s*s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2)}},Sinusoidal:{In:function(s){return 1-Math.sin((1-s)*Math.PI/2)},Out:function(s){return Math.sin(s*Math.PI/2)},InOut:function(s){return .5*(1-Math.sin(Math.PI*(.5-s)))}},Exponential:{In:function(s){return s===0?0:Math.pow(1024,s-1)},Out:function(s){return s===1?1:1-Math.pow(2,-10*s)},InOut:function(s){return s===0?0:s===1?1:(s*=2)<1?.5*Math.pow(1024,s-1):.5*(-Math.pow(2,-10*(s-1))+2)}},Circular:{In:function(s){return 1-Math.sqrt(1-s*s)},Out:function(s){return Math.sqrt(1- --s*s)},InOut:function(s){return(s*=2)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1)}},Elastic:{In:function(s){return s===0?0:s===1?1:-Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI)},Out:function(s){return s===0?0:s===1?1:Math.pow(2,-10*s)*Math.sin((s-.1)*5*Math.PI)+1},InOut:function(s){return s===0?0:s===1?1:(s*=2,s<1?-.5*Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI):.5*Math.pow(2,-10*(s-1))*Math.sin((s-1.1)*5*Math.PI)+1)}},Back:{In:function(s){return s===1?1:s*s*((1.70158+1)*s-1.70158)},Out:function(s){return s===0?0:--s*s*((1.70158+1)*s+1.70158)+1},InOut:function(s){const t=2.5949095;return(s*=2)<1?.5*(s*s*((t+1)*s-t)):.5*((s-=2)*s*((t+1)*s+t)+2)}},Bounce:{In:function(s){return 1-un.Bounce.Out(1-s)},Out:function(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},InOut:function(s){return s<.5?un.Bounce.In(s*2)*.5:un.Bounce.Out(s*2-1)*.5+.5}},generatePow:function(s=4){return s=s<Number.EPSILON?Number.EPSILON:s,s=s>1e4?1e4:s,{In:function(t){return t**s},Out:function(t){return 1-(1-t)**s},InOut:function(t){return t<.5?(t*2)**s/2:(1-(2-t*2)**s)/2+.5}}},random:function(s){return Math.random()},createStep:function(s){return function(t){return Math.floor(t*s)/s}},createNoisyEasing:function(s,t=.1){const e=1-t;return function(n){return t*Math.random()+e*s(n)}},swing:function(s){return s+Math.sin(s*Math.PI*2)/2},causeSeizures:function(s){return s+.2*Math.random()-.1}},hs=un,Ie={Utils:{Linear:function(s,t,e){return(t-s)*e+s},Factorial:function(){const s=[1];return function(t){let e=1;if(s[t])return s[t];for(let n=t;n>1;n--)e*=n;return s[t]=e,e}}(),Bernstein:function(s,t){const e=Ie.Utils.Factorial;return e(s)/e(t)/e(s-t)},CatmullRom:function(s,t,e,n,i){const r=(e-s)*.5,a=(n-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(s,t){const e=s.length-1,n=e*t,i=Math.floor(n),r=Ie.Utils.Linear;return t<0?r(s[0],s[1],n):t>1?r(s[e],s[e-1],e-n):r(s[i],s[i+1>e?e:i+1],n-i)},Bezier:function(s,t){let e=0;const n=s.length-1,i=Math.pow,r=Ie.Utils.Bernstein;for(let a=0;a<=n;a++)e+=i(1-t,n-a)*i(t,a)*s[a]*r(n,a);return e},CatmullRom:function(s,t){const e=s.length-1;let n=e*t,i=Math.floor(n);const r=Ie.Utils.CatmullRom;return s[0]===s[e]?(t<0&&(i=Math.floor(n=e*(1+t))),r(s[(i-1+e)%e],s[i],s[(i+1)%e],s[(i+2)%e],n-i)):t<0?s[0]-(r(s[0],s[0],s[1],s[1],-n)-s[0]):t>1?s[e]-(r(s[e],s[e],s[e-1],s[e-1],n-e)-s[e]):r(s[i?i-1:0],s[i],s[e<i+1?e:i+1],s[e<i+2?e:i+2],n-i)}},ls=Ie;class hr{_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=he(),e=!1){let n=Object.keys(this._tweens);if(n.length===0)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(let i=0;i<n.length;i++){const r=this._tweens[n[i]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[n[i]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0}}const xt=new hr;class lr{constructor(t,e=xt){this._object=t,this._group=e}_id=ke.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=hs.Linear.None;_interpolationFunction=ls.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=he()){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,n,i){for(const r in n){const a=t[r],o=Array.isArray(a),c=o?"array":typeof a,h=!o&&Array.isArray(n[r]);if(!(c==="undefined"||c==="function")){if(h){let l=n[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,a)),n[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],n[r],i[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),h?i[r]=n[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=he()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=he()){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=xt){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=hs.Linear.None){return this._easingFunction=t,this}interpolation(t=ls.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=he(),e=!0){if(this._isPaused)return!0;let n,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(n in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[n]=="string"&&(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];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,n,i){for(const r in n){if(e[r]===void 0)continue;const a=e[r]||0;let o=n[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],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=n,this._valuesEnd[t]=e}}const yh=ke.nextId,wh=xt.getAll.bind(xt),vh=xt.removeAll.bind(xt),bh=xt.add.bind(xt),xh=xt.remove.bind(xt),Sh=xt.update.bind(xt),fn={now:he,Sequence:ke,Easing:hs,Interpolation:ls,Group:hr,Tween:lr,nextId:yh,getAll:wh,removeAll:vh,add:bh,remove:xh,update:Sh};function Ch(s){switch(s){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 Th={attributeName:["display"],values:[["block","block"]],immediate:!1},gt={easeName:"linear",begin:0,dur:300,repeatCount:1,direction:"normal",fill:"freeze",keyTimes:[0,1]};class us{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 ge(e),originAttrs:{}})}),this}static isRunningGlobalTween=!1;static runGlobalTween(t){this.isRunningGlobalTween||De.run(()=>(this.isRunningGlobalTween=fn.update(t?.()),this.isRunningGlobalTween))}static toTween(t,e,n){const i=n?.onStart||(()=>{}),r=n?.onUpdate||(()=>{}),a=n?.onComplete||(()=>{}),o=n?.duration||1e3,c=n?.delay||0,h=n?.easeFunction||fn.Easing.Linear.None,l=n?.repeat||0,f=n?.yoyo||!1,g=new fn.Tween(t).to(e,o).delay(c).easing(h).repeat(l).yoyo(f).onStart(i).onUpdate((w,m)=>{r(w,m)}).onComplete(a);return n?.interpolationFunction&&g.interpolation(n.interpolationFunction),{tween:g,startAuto:w=>{g.start(w?.()),De.run(()=>{const m=g.update(w?.());if(n?.precision){let v=!0;for(let b in t)ue(t[b],e[b],n.precision)||(v=!1);return v?!1:m}return m})}}}static toTweenCSS(t,e,n,i){D.add3DSupport(t);const r=i?.onUpdate||(()=>{});return us.toTween(e,n,Object.assign(i||{},{onUpdate:(a,o)=>{const c=D.convertAttrs(t,a);D.setStyle(t,c),r(a,o)}}))}addAnimateObject(t=Th,e=gt,n=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(Ch(r))});const h=this.objects[n];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,n,i,r=gt,a=this.objects.length-1){let o=!0,c=!1,h=!1,l=!1;const f=this.objects.length-1;a=yt(a,0,f);let g=a-1;g=yt(g,0,f);let w=a+1;w=yt(w,0,f);const m=this.objects[a],v=this.objects[g],b=this.objects[w];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&&w!==a){const S=n(b);S&&(this.addAnimateObject(S,r,w,o),o=!1,l=!0)}this.objects.forEach((S,C)=>{if(!(C==g&&c||C==a&&h||C==w&&l)){const M=i(S);M&&(this.addAnimateObject(M,r,C,o),o=!1)}})}toCSS(t,...e){if(!this.hasObjects())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 n=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 w={};o.forEach((v,b)=>{const S=c[b][r.direction=="reverse"?h-1-g:g];w[v]=S});const m=D.convertAttrs(r.el,w,r.originAttrs);D.setStyle(r.el,Object.assign(m,{transition:"none"}))}else De.runAccurateSetTimeout(()=>{const w={};o.forEach((v,b)=>{const S=c[b][r.direction=="reverse"?h-1-g:g];w[v]=S});const m=D.convertAttrs(r.el,w,r.originAttrs);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"&&++n<r.repeatCount)&&i())},r.begin+r.dur)})};i()}slideLeft(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[-n.app.width,0]]]}),n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[n.app.width,0],[0,0]]]}),n=>{},n=>({attributeName:["opacity","translateTo"],values:[[0,0],[[n.app.width,0],[n.app.width,0]]],immediate:!0}),t,e)}slideRight(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>{},n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[-n.app.width,0],[0,0]]]}),n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[n.app.width,0]]]}),n=>({attributeName:["opacity","translateTo"],values:[[0,0],[[-n.app.width,0],[-n.app.width,0]]],immediate:!0}),t,e)}slideDown(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[0,n.app.height]]]}),n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,-n.app.height],[0,0]]]}),n=>{},n=>({attributeName:["opacity","translateTo"],values:[[0,0],[[0,-n.app.height],[0,-n.app.height]]],immediate:!0}),t,e)}slideUp(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[0,-n.app.height]]]}),n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,n.app.height],[0,0]]]}),n=>{},n=>({attributeName:["opacity","translateTo"],values:[[0,0],[[0,n.app.height],[0,n.app.height]]],immediate:!0}),t,e)}flipLeft(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,180]]}),n=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[-180,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipRight(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,-180]]}),n=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[180,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipDown(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,-180]]}),n=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[180,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipUp(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,180]]}),n=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[-180,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}popIn(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>{},n=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[.8,1],[0,1]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}popOut(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>{},n=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[1,1.2],[1,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}rotate(t=gt,e=this.objects.length-1){Object.assign(t,{keyTimes:[0,1]});const n=t.degree||360;this.resetAnimateObjects(i=>{},i=>({attributeName:["opacity","rotate"],values:[[1,1],[0,n]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}}class Eh{app;ctx;shapes=[];isMouseDown=!1;currentMouseInShapeID="";currentEnableDragMouseInShapeID="";constructor(t){this.app=t,this.ctx=new hn(this.app.container),this.app.captureMove({start:()=>{this.isMouseDown=!0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.setCursor()},move:()=>{if(this.currentMouseInShapeID="",this.isMouseDown&&this.currentEnableDragMouseInShapeID){this.setCursor();return}let e=0,n=this.shapes.length;for(;e<n;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(),r&&(this.currentMouseInShapeID=i.id),i.mouseMove&&i.mouseMove(r),r&&i.enableDrag){this.currentEnableDragMouseInShapeID=i.id;break}}e>=n&&(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 bt)&&!(t instanceof z)&&this.ctx.translate(t.x,t.y),this.ctx.rotate(ot(t.degree)),this.ctx.scale(t.scaleOnOrigin,t.scaleOnOrigin)}draw(t=[]){const e=[];Vr(t)?e.push(...t):e.push(t),this.shapes=[],e.forEach(n=>{n instanceof oe?this.shapes.push(...n.shapes):this.shapes.push(n)});for(let n of this.shapes)if(n.isShow){if(this.ctx.save(),D.attrsToCanvas(this.ctx,n.attrs),n.followMouse&&(!ue(n.x,this.app.mousePoint.x,5)||!ue(n.y,this.app.mousePoint.y,5))&&(n.angleTo(this.app.mousePoint),n.followTo(this.app.mousePoint)),n.targetToAfterDragFree&&(this.isMouseDown||n.nextFrameEaseTo(new mt({x:n.targetToAfterDragFree.targetX,y:n.targetToAfterDragFree.targetY}),{easing:n.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShapeID==n.id){const{dx:i,dy:r}=n.centerDiff;n.x=this.app.mousePoint.x,n.y=this.app.mousePoint.y,n.x-=i,n.y-=r,n.isDragging=!0,this.shapes.filter(a=>a.id!=n.id).forEach(a=>a.isDragging=!1)}this.transformCtxBaseOnShape(n),n.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill(),n.path2d=this.ctx.currentPath2D,this.ctx.restore()}return this}click(t){const e=()=>{this.shapes.forEach(n=>{(n instanceof z&&n.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.ctx)||this.currentMouseInShapeID==n.id)&&t(n)})};return this.app.on("tap",e),()=>{this.app.off("tap",e)}}drawMouseMoveLine(t="line",e){switch(t){case"brush":const n=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=jt(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()*n,g=this.app.mousePoint.x+Math.cos(l)*f|0,w=this.app.mousePoint.y+Math.sin(l)*f|0,m=(g+w*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 Ph{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new ye(t),this.remoteVideoUtil=new ye(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(n=>{this.localVideoUtil.setSrcObject(n),t(n)}).catch(n=>{this.trace(`navigator.getUserMedia error: ${n}.`),e(n)})})}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(),n=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),n.length>0&&this.trace(`Using audio device: ${n[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(n[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,n=t.candidate;if(e&&n){const i=new RTCIceCandidate(n),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 Ti(n,t){return function(){return n.apply(t,arguments)}}const{toString:vo}=Object.prototype,{getPrototypeOf:Ys}=Object,es=(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=>es(t)===n),ss=n=>t=>typeof t===n,{isArray:re}=Array,Ce=ss("undefined");function bo(n){return n!==null&&!Ce(n)&&n.constructor!==null&&!Ce(n.constructor)&&pt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const Ei=Pt("ArrayBuffer");function xo(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&Ei(n.buffer),t}const So=ss("string"),pt=ss("function"),Pi=ss("number"),ns=n=>n!==null&&typeof n=="object",Co=n=>n===!0||n===!1,is=n=>{if(es(n)!=="object")return!1;const t=Ys(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=>ns(n)&&pt(n.pipe),Do=n=>{let t;return n&&(typeof FormData=="function"&&n instanceof FormData||pt(n.append)&&((t=es(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 Te(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 Ai(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 _i=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Di=n=>!Ce(n)&&n!==_i;function Hs(){const{caseless:n}=Di(this)&&this||{},t={},e=(s,i)=>{const r=n&&Ai(t,i)||i;is(t[r])&&is(s)?t[r]=Hs(t[r],s):is(s)?t[r]=Hs({},s):re(s)?t[r]=s.slice():t[r]=s};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Te(arguments[s],e);return t}const Mo=(n,t,e,{allOwnKeys:s}={})=>(Te(t,(i,r)=>{e&&pt(i)?n[r]=Ti(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&&Ys(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(!Pi(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"&&Ys(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}),ki=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),jo=Pt("RegExp"),Ii=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),s={};Te(e,(i,r)=>{let a;(a=t(i,r,n))!==!1&&(s[r]=a||i)}),Object.defineProperties(n,s)},Xo=n=>{Ii(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),Ws="abcdefghijklmnopqrstuvwxyz",Mi="0123456789",Ri={DIGIT:Mi,ALPHA:Ws,ALPHA_DIGIT:Ws+Ws.toUpperCase()+Mi},Wo=(n=16,t=Ri.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(ns(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[i]=s;const r=re(s)?[]:{};return Te(s,(a,o)=>{const c=e(a,i+1);!Ce(c)&&(r[o]=c)}),t[i]=void 0,r}}return s};return e(n,0)},Zo=Pt("AsyncFunction"),E={isArray:re,isArrayBuffer:Ei,isBuffer:bo,isFormData:Do,isArrayBufferView:xo,isString:So,isNumber:Pi,isBoolean:Co,isObject:ns,isPlainObject:is,isUndefined:Ce,isDate:To,isFile:Eo,isBlob:Po,isRegExp:jo,isFunction:pt,isStream:_o,isURLSearchParams:ko,isTypedArray:Bo,isFileList:Ao,forEach:Te,merge:Hs,extend:Mo,trim:Io,stripBOM:Ro,inherits:Oo,toFlatObject:Lo,kindOf:es,kindOfTest:Pt,endsWith:No,toArray:Fo,forEachEntry:Uo,matchAll:Vo,isHTMLForm:Go,hasOwnProperty:ki,hasOwnProp:ki,reduceDescriptors:Ii,freezeMethods:Xo,toObjectSet:qo,toCamelCase:zo,noop:Yo,toFiniteNumber:Ho,findKey:Ai,global:_i,isContextDefined:Di,ALPHABET:Ri,generateString:Wo,isSpecCompliantForm:$o,toJSONObject:Jo,isAsyncFn:Zo,isThenable:n=>n&&(ns(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 Oi=B.prototype,Li={};["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=>{Li[n]={value:n}}),Object.defineProperties(B,Li),Object.defineProperty(Oi,"isAxiosError",{value:!0}),B.from=(n,t,e,s,i,r)=>{const a=Object.create(Oi);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 $s(n){return E.isPlainObject(n)||E.isArray(n)}function Ni(n){return E.endsWith(n,"[]")?n.slice(0,-2):n}function Fi(n,t,e){return n?n.concat(t).map(function(i,r){return i=Ni(i),!e&&r?"["+i+"]":i}).join(e?".":""):t}function Qo(n){return E.isArray(n)&&!n.some($s)}const tc=E.toFlatObject(E,{},null,function(t){return/^is[A-Z]/.test(t)});function rs(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=Ni(v),S.forEach(function(k,R){!(E.isUndefined(k)||k===null)&&t.append(a===!0?Fi([v],R,r):a===null?v:v+"[]",h(k))}),!1}return $s(m)?!0:(t.append(Fi(b,v,r),h(m)),!1)}const f=[],g=Object.assign(tc,{defaultVisitor:l,convertValue:h,isVisitable:$s});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 Bi(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Js(n,t){this._pairs=[],n&&rs(n,this,t)}const Ui=Js.prototype;Ui.append=function(t,e){this._pairs.push([t,e])},Ui.toString=function(t){const e=t?function(s){return t.call(this,s,Bi)}:Bi;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 Vi(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 Js(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 Gi=sc,zi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},nc=typeof URLSearchParams<"u"?URLSearchParams:Js,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 rs(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 ji(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 Zs={transitional:zi,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(ji(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 rs(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||Zs.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=>{Zs.headers[n]={}});const Ks=Zs,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){i=a.indexOf(":"),e=a.substring(0,i).trim().toLowerCase(),s=a.substring(i+1).trim(),!(!e||t[e]&&fc[e])&&(e==="set-cookie"?t[e]?t[e].push(s):t[e]=[s]:t[e]=t[e]?t[e]+", "+s:s)}),t},Xi=Symbol("internals");function Ee(n){return n&&String(n).trim().toLowerCase()}function as(n){return n===!1||n==null?n:E.isArray(n)?n.map(as):String(n)}function mc(n){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=e.exec(n);)t[s[1]]=s[2];return t}const pc=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function Qs(n,t,e,s,i){if(E.isFunction(s))return s.call(this,t,e);if(i&&(t=e),!!E.isString(t)){if(E.isString(s))return t.indexOf(s)!==-1;if(E.isRegExp(s))return s.test(t)}}function gc(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,s)=>e.toUpperCase()+s)}function yc(n,t){const e=E.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(n,s+e,{value:function(i,r,a){return this[s].call(this,t,i,r,a)},configurable:!0})})}class os{constructor(t){t&&this.set(t)}set(t,e,s){const i=this;function r(o,c,h){const l=Ee(c);if(!l)throw new Error("header name must be a non-empty string");const f=E.findKey(i,l);(!f||i[f]===void 0||h===!0||h===void 0&&i[f]!==!1)&&(i[f||c]=as(o))}const a=(o,c)=>E.forEach(o,(h,l)=>r(h,l,c));return E.isPlainObject(t)||t instanceof this.constructor?a(t,e):E.isString(t)&&(t=t.trim())&&!pc(t)?a(dc(t),e):t!=null&&r(e,t,s),this}get(t,e){if(t=Ee(t),t){const s=E.findKey(this,t);if(s){const i=this[s];if(!e)return i;if(e===!0)return mc(i);if(E.isFunction(e))return e.call(this,i,s);if(E.isRegExp(e))return e.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Ee(t),t){const s=E.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||Qs(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let i=!1;function r(a){if(a=Ee(a),a){const o=E.findKey(s,a);o&&(!e||Qs(s,s[o],o,e))&&(delete s[o],i=!0)}}return E.isArray(t)?t.forEach(r):r(t),i}clear(t){const e=Object.keys(this);let s=e.length,i=!1;for(;s--;){const r=e[s];(!t||Qs(this,this[r],r,t,!0))&&(delete this[r],i=!0)}return i}normalize(t){const e=this,s={};return E.forEach(this,(i,r)=>{const a=E.findKey(s,r);if(a){e[a]=as(i),delete e[r];return}const o=t?gc(r):String(r).trim();o!==r&&delete e[r],e[o]=as(i),s[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return E.forEach(this,(s,i)=>{s!=null&&s!==!1&&(e[i]=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(i=>s.set(i)),s}static accessor(t){const s=(this[Xi]=this[Xi]={accessors:{}}).accessors,i=this.prototype;function r(a){const o=Ee(a);s[o]||(yc(i,a),s[o]=!0)}return E.isArray(t)?t.forEach(r):r(t),this}}os.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),E.reduceDescriptors(os.prototype,({value:n},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(s){this[e]=s}}}),E.freezeMethods(os);const Lt=os;function tn(n,t){const e=this||Ks,s=t||e,i=Lt.from(s.headers);let r=s.data;return E.forEach(n,function(o){r=o.call(e,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function qi(n){return!!(n&&n.__CANCEL__)}function Pe(n,t,e){B.call(this,n??"canceled",B.ERR_CANCELED,t,e),this.name="CanceledError"}E.inherits(Pe,B,{__CANCEL__:!0});function wc(n,t,e){const s=e.config.validateStatus;!e.status||!s||s(e.status)?n(e):t(new B("Request failed with status code "+e.status,[B.ERR_BAD_REQUEST,B.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}const vc=At.isStandardBrowserEnv?function(){return{write:function(e,s,i,r,a,o){const c=[];c.push(e+"="+encodeURIComponent(s)),E.isNumber(i)&&c.push("expires="+new Date(i).toGMTString()),E.isString(r)&&c.push("path="+r),E.isString(a)&&c.push("domain="+a),o===!0&&c.push("secure"),document.cookie=c.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 bc(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function xc(n,t){return t?n.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):n}function Yi(n,t){return n&&!bc(t)?xc(n,t):t}const Sc=At.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let s;function i(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=i(window.location.href),function(a){const o=E.isString(a)?i(a):a;return o.protocol===s.protocol&&o.host===s.host}}():function(){return function(){return!0}}();function Cc(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}function Tc(n,t){n=n||10;const e=new Array(n),s=new Array(n);let i=0,r=0,a;return t=t!==void 0?t:1e3,function(c){const h=Date.now(),l=s[r];a||(a=h),e[i]=c,s[i]=h;let f=r,g=0;for(;f!==i;)g+=e[f++],f=f%n;if(i=(i+1)%n,i===r&&(r=(r+1)%n),h-a<t)return;const y=l&&h-l;return y?Math.round(g*1e3/y):void 0}}function Hi(n,t){let e=0;const s=Tc(50,250);return i=>{const r=i.loaded,a=i.lengthComputable?i.total:void 0,o=r-e,c=s(o),h=r<=a;e=r;const l={loaded:r,total:a,progress:a?r/a:void 0,bytes:o,rate:c||void 0,estimated:c&&a&&h?(a-r)/c:void 0,event:i};l[t?"download":"upload"]=!0,n(l)}}const en={http:Ko,xhr:typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(e,s){let i=n.data;const r=Lt.from(n.headers).normalize(),a=n.responseType;let o;function c(){n.cancelToken&&n.cancelToken.unsubscribe(o),n.signal&&n.signal.removeEventListener("abort",o)}let h;E.isFormData(i)&&(At.isStandardBrowserEnv||At.isStandardBrowserWebWorkerEnv?r.setContentType(!1):r.getContentType(/^\s*multipart\/form-data/)?E.isString(h=r.getContentType())&&r.setContentType(h.replace(/^\s*(multipart\/form-data);+/,"$1")):r.setContentType("multipart/form-data"));let l=new XMLHttpRequest;if(n.auth){const m=n.auth.username||"",v=n.auth.password?unescape(encodeURIComponent(n.auth.password)):"";r.set("Authorization","Basic "+btoa(m+":"+v))}const f=Yi(n.baseURL,n.url);l.open(n.method.toUpperCase(),Vi(f,n.params,n.paramsSerializer),!0),l.timeout=n.timeout;function g(){if(!l)return;const m=Lt.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:n,request:l};wc(function(C){e(C),c()},function(C){s(C),c()},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 B("Request aborted",B.ECONNABORTED,n,l)),l=null)},l.onerror=function(){s(new B("Network Error",B.ERR_NETWORK,n,l)),l=null},l.ontimeout=function(){let v=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const b=n.transitional||zi;n.timeoutErrorMessage&&(v=n.timeoutErrorMessage),s(new B(v,b.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,n,l)),l=null},At.isStandardBrowserEnv){const m=(n.withCredentials||Sc(f))&&n.xsrfCookieName&&vc.read(n.xsrfCookieName);m&&r.set(n.xsrfHeaderName,m)}i===void 0&&r.setContentType(null),"setRequestHeader"in l&&E.forEach(r.toJSON(),function(v,b){l.setRequestHeader(b,v)}),E.isUndefined(n.withCredentials)||(l.withCredentials=!!n.withCredentials),a&&a!=="json"&&(l.responseType=n.responseType),typeof n.onDownloadProgress=="function"&&l.addEventListener("progress",Hi(n.onDownloadProgress,!0)),typeof n.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",Hi(n.onUploadProgress)),(n.cancelToken||n.signal)&&(o=m=>{l&&(s(!m||m.type?new Pe(null,n,l):m),l.abort(),l=null)},n.cancelToken&&n.cancelToken.subscribe(o),n.signal&&(n.signal.aborted?o():n.signal.addEventListener("abort",o)));const y=Cc(f);if(y&&At.protocols.indexOf(y)===-1){s(new B("Unsupported protocol "+y+":",B.ERR_BAD_REQUEST,n));return}l.send(i||null)})}};E.forEach(en,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch{}Object.defineProperty(n,"adapterName",{value:t})}});const Wi=n=>`- ${n}`,Ec=n=>E.isFunction(n)||n===null||n===!1,$i={getAdapter:n=>{n=E.isArray(n)?n:[n];const{length:t}=n;let e,s;const i={};for(let r=0;r<t;r++){e=n[r];let a;if(s=e,!Ec(e)&&(s=en[(a=String(e)).toLowerCase()],s===void 0))throw new B(`Unknown adapter '${a}'`);if(s)break;i[a||"#"+r]=s}if(!s){const r=Object.entries(i).map(([o,c])=>`adapter ${o} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=t?r.length>1?`since :
|
|
39
|
+
`+r.map(Wi).join(`
|
|
40
|
+
`):" "+Wi(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:en};function sn(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Pe(null,n)}function Ji(n){return sn(n),n.headers=Lt.from(n.headers),n.data=tn.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),$i.getAdapter(n.adapter||Ks.adapter)(n).then(function(s){return sn(n),s.data=tn.call(n,n.transformResponse,s),s.headers=Lt.from(s.headers),s},function(s){return qi(s)||(sn(n),s&&s.response&&(s.response.data=tn.call(n,n.transformResponse,s.response),s.response.headers=Lt.from(s.response.headers))),Promise.reject(s)})}const Zi=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(Zi(h),Zi(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 Ki="1.5.1",nn={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{nn[n]=function(s){return typeof s===n||"a"+(t<1?"n ":" ")+n}});const Qi={};nn.transitional=function(t,e,s){function i(r,a){return"[Axios v"+Ki+"] 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&&!Qi[a]&&(Qi[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 rn={assertOptions:Pc,validators:nn},jt=rn.validators;class cs{constructor(t){this.defaults=t,this.interceptors={request:new Gi,response:new Gi}}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&&rn.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}:rn.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=[Ji.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=Ji.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=Yi(t.baseURL,t.url);return Vi(e,t.params,t.paramsSerializer)}}E.forEach(["delete","get","head","options"],function(t){cs.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}))}}cs.prototype[t]=e(),cs.prototype[t+"Form"]=e(!0)});const hs=cs;class an{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 Pe(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 an(function(i){t=i}),cancel:t}}}const Ac=an;function _c(n){return function(e){return n.apply(null,e)}}function Dc(n){return E.isObject(n)&&n.isAxiosError===!0}const on={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(on).forEach(([n,t])=>{on[t]=n});const kc=on;function tr(n){const t=new hs(n),e=Ti(hs.prototype.request,t);return E.extend(e,hs.prototype,t,{allOwnKeys:!0}),E.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return tr(ae(n,i))},e}const W=tr(Ks);W.Axios=hs,W.CanceledError=Pe,W.CancelToken=Ac,W.isCancel=qi,W.VERSION=Ki,W.toFormData=rs,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=>ji(E.isHTMLForm(n)?new FormData(n):n),W.getAdapter=$i.getAdapter,W.HttpStatusCode=kc,W.default=W;const Ic=W,Xt=window.crypto.subtle;Xt||console.warn("Crypto API not supported");function er(n){return Wr(encodeURIComponent(n)).replaceAll("+","*").replaceAll("/","-").replaceAll("=","")}function sr(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 er(ea(n))}function Rc(n){return ta(sr(n))}function ls(n){return new TextEncoder().encode(n)}function nr(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,ls(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 nr(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=ls(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 ir(n,t="SHA-256"){const e=await Xt.digest(t,ls(n));return sa(e)}async function rr(n,t="SHA-256"){const e=JSON.stringify(n);return ir(e,t)}class Bc{instance;interceptors;requestCanceler;constructor(t){this.instance=Ic.create(t),this.interceptors=t?.interceptors,this.requestCanceler=new ar,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 ar{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 rr({url:e,method:s,params:i,data:r})}}const us=new Map;async function Uc(n){return new Promise((t,e)=>{fs(n,(s,i)=>s?e(s):t({width:i.width,height:i.height,aspectRatio:i.width/i.height}))})}const fs=(n,t)=>{if(us.has(n))return t(null,us.get(n));const e=new Image;e.onload=function(){us.set(n,{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height,element:e}),t(null,us.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=Un(c),l=new Blob([c]);cn(l,(f,g)=>{if(!g)return t(f,null);fs(g,(y,m)=>{if(!m)return t(y,null);or(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)}},or=(n,t)=>{fs(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)},cn=(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)=>{cn(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=hn(t),a=hn(e),o=hn(s);return"rgb("+r+","+a+","+o+")"}function hn(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=>cr(n,[-1,-1,-1,-1,9,-1,-1,-1,-1]),fh=n=>cr(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=hr([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=hr(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},cr=(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)},hr=(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]},ln=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}}},lr=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}}},ur=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=ln(),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(";")}}},fr=function(n,t,e,s){const i=ur(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=ln();i.write(r);const a=lr(),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},Ae={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 Ae.L:return Nt.RS_BLOCK_TABLE[(t-1)*4+0];case Ae.M:return Nt.RS_BLOCK_TABLE[(t-1)*4+1];case Ae.Q:return Nt.RS_BLOCK_TABLE[(t-1)*4+2];case Ae.H:return Nt.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class dr{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=Ae[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 dr;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 dr;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 mr=Math.ceil,_e=Math.floor,pr=Math.round;function Th(n,t){const e=Bn(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 fr(i,o,c,function(m,v){if(g<=m&&m<y&&g<=v&&v<y){const b=_e((m-g)/f),S=_e((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=Bn(n),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?_e(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=mr((b+1)*m)-_e(b*m),C=mr((v+1)*m)-_e(v*m);r.fillStyle=g.isDark(v,b)?l:f,r.fillRect(e+pr(b*m)+c,s+pr(v*m)+c,S,C)}}let ds;const gr=new WeakMap;function un(n,t){let e=gr.get(n);e||(e=new Map,gr.set(n,e));let s=e.get(t);return s||(s=new yr,e.set(t,s)),s}class yr{subscribers;constructor(){this.subscribers=new Set}depend(){ds&&this.subscribers.add(ds)}notify(){this.subscribers.forEach(t=>t())}}function Ph(n){ds=n,n(),ds=null}function Ah(n){return Object.keys(n).forEach(t=>{let e=n[t];const s=un(n,t);Object.defineProperty(n,t,{get(){return s.depend(),e},set(i){i!=e&&(e=i,s.notify())}})}),n}function wr(n){return new Proxy(n,{get(t,e,s){return un(n,e).depend(),Reflect.get(t,e,s)},set(t,e,s,i){const r=un(n,e);return n[e]!=s&&(n[e]=s,r.notify()),Reflect.set(t,e,s,i)}})}const _h=wr;class ms{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 ms([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 ms([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=>{Ye(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 De;typeof self>"u"&&typeof process<"u"&&process.hrtime?De=function(){const n=process.hrtime();return n[0]*1e3+n[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?De=self.performance.now.bind(self.performance):Date.now!==void 0?De=Date.now:De=function(){return new Date().getTime()};const ce=De;class ke{static _nextId=0;static nextId(){return ke._nextId++}}const ps={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-ps.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?ps.Bounce.In(n*2)*.5:ps.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}},fn=ps,Ie={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=Ie.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=Ie.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=Ie.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=Ie.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)}},dn=Ie;class vr{_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 vr;class mn{constructor(t,e=gt){this._object=t,this._group=e}_id=ke.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=fn.Linear.None;_interpolationFunction=dn.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=fn.Linear.None){return this._easingFunction=t,this}interpolation(t=dn.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=ke.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),Me={now:ce,Sequence:ke,Easing:fn,Interpolation:dn,Group:vr,Tween:mn,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 br=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=br(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 be(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||Me.Easing.Linear.None,l=s?.repeat||0,f=s?.yoyo||!1,g=new Me.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)me(t[b],e[b],s.precision)||(v=!1);return v?!1:m}return m})}}}static toTweenGroup(t,e){if(t instanceof mn)return s=>{t.start(),e?.onGroupStart?.(),he.run(()=>{const i=Me.update(s?.());return i?e?.onGroupUpdate?.():e?.onGroupComplete?.(),i})};{const s=new Me.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 xr extends mi{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),gn(this.currentItem.style,this.currentItem,yn)}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&&gn(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+pn(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(yn.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"&&gn(a,this.currentItem,yn),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 pn(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 pn(n,t,i,r)-pn(e,s,i,r)}function gn(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 yn=["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 bs)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&&(!me(i.x,this.app.mousePoint.x,5)||!me(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 bs&&(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 Cr({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 Sr=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 gs(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 Re={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 ys{__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 wn{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Oe{__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(Re);for(let e=0,s=t.length;e<s;e++){const i=t[e];this[i]=Re[i].canvas}}__getStyleState(){const t={},e=Object.keys(Re);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(Re);for(let r=0;r<i.length;r++){const a=Re[i[r]],o=this[i[r]];if(a.apply){if(o instanceof wn){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 ys)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(Sr);for(let r=0,a=i.length;r<a;r++){const o=i[r],c=Sr[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:gs(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new ys(r,this)}createRadialGradient(t,e,s,i,r,a){const o=this.__createElement("radialGradient",{id:gs(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 ys(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=gs(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 Oe){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=gs(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 Oe&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new wn(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class ws{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 Oe({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=ge(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 vs 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 vs({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){ui(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 vs?[e,s,i,r,a,o]=js(this.prevPathX,this.prevPathY,t.cx,t.cy,t.x,t.y):[e,s,i,r,a,o]=we(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 ws)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 ws)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+=Je(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",qs(t[o].getAttr("fill","none"),t[o+1].getAttr("fill","none"),c)),i.setAttr("stroke",qs(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 Le extends Zt{svgWidth=0;svgHeight=0;width=0;height=0;shapes=[];constructor(t){if(super(t),!t?.svg)return;const e=new xr(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=zs(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 Le;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 Le;return r.forEach(o=>{a.shapes.push(o(0))}),o=>(r.forEach(c=>{c(o)}),a)}}class Cr 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 vn 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 fi({x:t+c,y:e+h}))}return new vn(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=$e(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,Se(e)}}class bs 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 bs({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 Tr({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 Tr 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=8.333333333333334,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=Je(this.x,this.y,t,e),i=J(ge(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,30],["a",15,15,0,1,1,0,-30]])}}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 Le{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 ws(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&&(!me(s.x,this.app.mousePoint.x,5)||!me(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 xe(t),this.remoteVideoUtil=new xe(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:
|
|
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 n=this.getPeerName(t);this.trace(`${n} ${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 n=document.createElement("div");n.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(n)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class _h{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 ur(s,t){return!s||s.parentElement===null?t:ur(s.parentElement,t.concat([s]))}const fs=function(s,t){return getComputedStyle(s,null).getPropertyValue(t)},Dh=function(s){return fs(s,"overflow")+fs(s,"overflow-y")+fs(s,"overflow-x")},Ah=function(s){return/(auto|scroll)/.test(Dh(s))};function kh(s){if(!(s instanceof HTMLElement||s instanceof SVGElement))return;const t=ur(s.parentElement,[]);for(let e=0;e<t.length;e+=1)if(Ah(t[e]))return t[e];return document.scrollingElement||document.documentElement}const fr=[],dr={};function ds(s){fr.push(s)}function Ih(s,t=!1){const e=hi();if(dr[e])return;wx.error(r=>{console.log(r.errMsg??JSON.stringify(r))}),wx.ready(()=>{fr.forEach(r=>r())});const n=["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(s,{debug:t,jsApiList:n,openTagList:i})),dr[e]=!0}function Mh(s){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[s],success:function(n){n.checkResult[s]?t(!0):e(!1)},fail:function(){e(!1)}})})}function Rh(s){ds(function(){wx.updateAppMessageShareData(s)})}function Oh(s){ds(function(){wx.updateTimelineShareData(s)})}function Lh(s){wx.chooseImage(s)}function Nh(s){wx.previewImage(s)}function Fh(s){wx.uploadImage(s)}function Bh(s){wx.downloadImage(s)}function Uh(s){wx.getLocalImgData(s)}function Vh(){wx.startRecord()}function Gh(s){wx.stopRecord(s)}function zh(s){wx.onVoiceRecordEnd(s)}function jh(s){wx.playVoice(s)}function Xh(s){wx.pauseVoice(s)}function qh(s){wx.stopVoice(s)}function Yh(s){wx.onVoicePlayEnd(s)}function Hh(s){wx.uploadVoice(s)}function Wh(s){wx.downloadVoice(s)}function $h(s){wx.translateVoice(s)}function Jh(s){wx.getNetworkType(s)}function Zh(s){wx.openLocation(s)}function Kh(s){wx.getLocation(s)}function Qh(s){wx.scanQRCode(s)}function tl(s,t,e){function n(){WeixinJSBridge.invoke("getBrandWCPayRequest",s,function(i){i.err_msg=="get_brand_wcpay_request:ok"?t():e(i.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",n,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",n),document.attachEvent("onWeixinJSBridgeReady",n)):n()}function el(s){window.AlipayJSBridge?s&&s():document.addEventListener("AlipayJSBridgeReady",s,!1)}function Me(s,t){let e="未知错误";switch(s.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`${s.error}(${e}): ${s.errorMessage}`}function nl(s,t,e){ap.tradePay(Object.assign(s,{}),function(n){let i="未知错误";switch(n.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 sl(s,t,e){ap.scan(Object.assign(s,{fail:n=>{e?.(Me(n))}}),function(n){t?.(n.code)})}function il(s,t,e){ap.getLocation(Object.assign(s,{fail:n=>{e?.(Me(n))}}),function(n){t?.(n)})}function rl(s,t,e){ap.openLocation(Object.assign(s,{fail:n=>{e?.(Me(n))}}),function(){t?.()})}function al(s,t,e){ap.chooseImage(Object.assign(s,{fail:n=>{e?.(Me(n,"chooseImage"))}}),function(n){t?.(n)})}function ol(s,t,e){ap.previewImage(Object.assign(s,{fail:n=>{e?.(Me(n))}}),function(){t?.()})}class cl{map;constructor(t,e=120.619585,n=31.299379,i=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,n),i)}}return p.AnimateOperation=us,p.Arc=ce,p.Arrow=mh,p.Canvas=Eh,p.CanvasOperation=hn,p.CubicBezier=_t,p.CustomCanvasContext=Pe,p.CustomCanvasGradient=cn,p.CustomCanvasPattern=as,p.DOMEventBus=ge,p.DOMKey=ii,p.DOMParse=ri,p.DOMSVGUtil=ne,p.DOMToBlob=Bs,p.DOMToString=_n,p.DOMUtil=D,p.DOMVideo=ye,p.Dep=nr,p.Ellipse=ar,p.FetchWithAxios=mc,p.FetchWithAxiosRequestCancel=qi,p.Fox=ph,p.Line=bt,p.Matrix=tt,p.Matrix3D=Zt,p.PathD=z,p.PathDGroup=_e,p.Point=mt,p.Point3d=hh,p.Point3ds=fh,p.Points=os,p.QRCode=Yt,p.QuadraticBezier=ln,p.Rect=Pt,p.SVG=rh,p.SVGParse=ir,p.SVGParsedPathArgsLength=pe,p.Sector=dh,p.SectorArc=or,p.Shape=J,p.ShapeGroup=oe,p.TWEEN=fn,p.Text=cs,p.Tween=lr,p.Vector=an,p.WebGLRenderer=_h,p.WebRTCClient=Ph,p.WebSocketClient=Qr,p.addWatermark=Jc,p.addWxJsReadyFnBeforeConfig=ds,p.ajax=Ka,p.aliJsChooseImage=al,p.aliJsGetLocation=il,p.aliJsOpenLocation=rl,p.aliJsPreviewImage=ol,p.aliJsReady=el,p.aliJsScan=sl,p.aliJsTradePay=nl,p.angle=de,p.animateInWeb=cr,p.appendURLSearchString=fi,p.base64EncodeOutputStream=$i,p.blobToRawImage=Sc,p.byteArrayOutputStream=es,p.canDrawBitmap=Ea,p.canUsePaths=Ta,p.canUseWorker=Qs,p.changeBrightness=Wc,p.changeDiaphaneity=$c,p.changeSize=Hc,p.checkWxJsApi=Mh,p.clearCookies=La,p.createXMLHttpRequest=di,p.distance=Rn,p.drawQRCodeToCanvas=eh,p.fileOrBlobToDataURL=Qn,p.flipSideToSide=Tc,p.flipUpsideDown=Ec,p.flushURLSearchString=$a,p.formDataToSearchString=ui,p.fromRadianAndLength=zt,p.getBrowserClient=kn,p.getBrowserClientVersion=la,p.getBrowserLanguage=fa,p.getColor=jt,p.getColorScheme=ai,p.getCookie=Ra,p.getCookieObject=Oa,p.getDirection=Da,p.getElementLeftPositionInPage2=Xs,p.getElementPositionInPage=js,p.getElementPositionInPage2=ia,p.getElementPositionInViewport=ra,p.getElementTopPositionInPage2=qs,p.getFileExtension=Vs,p.getFileString=Za,p.getFileTypeFromFile=Jr,p.getFilesImageInfo=gc,p.getFormSubmitData=Qa,p.getGlobal=An,p.getHexColorString=we,p.getImageAspectRatio=pc,p.getImageDataByAIData=Kc,p.getImageDataFromBitmap=wc,p.getImageDataFromUrl=Yi,p.getImageDataFromVideo=yc,p.getImageMainColor=Cc,p.getInternetExplorerVersion=$s,p.getMousePositionInElement=Hs,p.getMousePositionInPage=Ys,p.getMousePositionInViewport=ca,p.getOperatingSystem=ze,p.getOperatingSystemVersion=ha,p.getPageBodyElement=ea,p.getPageDocumentElement=ee,p.getPageSize=sa,p.getRGBColorString=Fa,p.getRawImageInfo=sn,p.getRelativeBoundingClientRect=aa,p.getScreenElement=ta,p.getScrollParent=kh,p.getTimeZone=da,p.getURL=Ye,p.getUserGeolocationPromise=ua,p.getVerticalScrollPercentInPage=oa,p.getViewportSize=na,p.getWorker=Ja,p.gifImage=Ji,p.gradientColor=Va,p.h=Kr,p.hasDocument=xa,p.hasHistory=Sa,p.hasWindow=Ks,p.hsb2rgb=za,p.hsl2rgb=ja,p.hsv2rgb=Ga,p.imageDataToBitmap=vc,p.imageDataToBlob=xc,p.imageDataToDataURL=bc,p.injectWxJsConfig=Ih,p.isAliBrowser=Zs,p.isAliMiniProgram=ba,p.isAndroid=Ws,p.isAppleDevice=ma,p.isBrowserSupportFileAPI=Ca,p.isDarkMode=ga,p.isIE=ya,p.isIE9or10=wa,p.isIOS=In,p.isMacOS=Mn,p.isMobile=pa,p.isURL=Ha,p.isWxBrowser=Js,p.isWxMiniProgram=va,p.jpgToPng=jc,p.leftRotate=Pc,p.length=je,p.linkExport=Dn,p.localstorage=Fn,p.mapTDTJSSDK=cl,p.marginSharpen=zc,p.microTask=Zr,p.mosaic=Zc,p.mount=fe,p.normalizePoint=_a,p.outputGifBase64=Zi,p.outputQRCodeBase64=th,p.parseTransformToMatrix=On,p.parseURL=ci,p.patch=Gs,p.patchDOM=zs,p.pngToJpg=Xc,p.radiusClip=Yc,p.randomColorHexString=Ba,p.randomColorNumber=oi,p.reactive=ih,p.reactiveVue2=sh,p.reactiveVue3=sr,p.readFileInBrowser=Ge,p.recordToSearchString=li,p.rectClip=qc,p.rgb2hsb=qa,p.rgb2hsl=Ya,p.rgb2hsv=Xa,p.rightRotate=_c,p.rotatePoint=Et,p.searchStringToRecord=Wa,p.selectFileInBrowser=Us,p.setColorScheme=Xe,p.setCookie=Ma,p.setRem=Pa,p.shadeColor=Ua,p.sharpen=Gc,p.singletonGlobalAnimateInWeb=De,p.stringToBlob=Pn,p.stringToDOM=$r,p.theme=Na,p.toBlackAndWhite=kc,p.toBlue=Oc,p.toBlueAndGreen=Fc,p.toBlueAndGrey=Vc,p.toDegree=Q,p.toGreen=Rc,p.toGreenAndGrey=Uc,p.toGrey=Dc,p.toGrey2=Ac,p.toOpposite=Ic,p.toRadian=ot,p.toRed=Mc,p.toRedAndBlue=Nc,p.toRedAndGreen=Lc,p.toRedAndGrey=Bc,p.trimURLHash=hi,p.watchEffect=nh,p.wxJsChooseImage=Lh,p.wxJsDownloadImage=Bh,p.wxJsDownloadVoice=Wh,p.wxJsGetLocalImgData=Uh,p.wxJsGetLocation=Kh,p.wxJsGetNetworkType=Jh,p.wxJsOnVoicePlayEnd=Yh,p.wxJsOnVoiceRecordEnd=zh,p.wxJsOpenLocation=Zh,p.wxJsPauseVoice=Xh,p.wxJsPay=tl,p.wxJsPlayVoice=jh,p.wxJsPreviewImage=Nh,p.wxJsScanQRCode=Qh,p.wxJsStartRecord=Vh,p.wxJsStopRecord=Gh,p.wxJsStopVoice=qh,p.wxJsTranslateVoice=$h,p.wxJsUpdateAppMessageShareData=Rh,p.wxJsUpdateTimelineShareData=Oh,p.wxJsUploadImage=Fh,p.wxJsUploadVoice=Hh,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),p}({});
|
|
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 Er(n,t){return!n||n.parentElement===null?t:Er(n.parentElement,t.concat([n]))}const bn=function(n,t){return getComputedStyle(n,null).getPropertyValue(t)},il=function(n){return bn(n,"overflow")+bn(n,"overflow-y")+bn(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=Er(n.parentElement,[]);for(let e=0;e<t.length;e+=1)if(rl(t[e]))return t[e];return document.scrollingElement||document.documentElement}const Pr=[],Ar={};function xn(n){Pr.push(n)}function ol(n,t=!1){const e=wi();if(Ar[e])return;wx.error(r=>{console.log(r.errMsg??JSON.stringify(r))}),wx.ready(()=>{Pr.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})),Ar[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){xn(function(){wx.updateAppMessageShareData(n)})}function ll(n){xn(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 Ne(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?.(Ne(s))}}),function(s){t?.(s.code)})}function Ol(n,t,e){ap.getLocation(Object.assign(n,{fail:s=>{e?.(Ne(s))}}),function(s){t?.(s)})}function Ll(n,t,e){ap.openLocation(Object.assign(n,{fail:s=>{e?.(Ne(s))}}),function(){t?.()})}function Nl(n,t,e){ap.chooseImage(Object.assign(n,{fail:s=>{e?.(Ne(s,"chooseImage"))}}),function(s){t?.(s)})}function Fl(n,t,e){ap.previewImage(Object.assign(n,{fail:s=>{e?.(Ne(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)}}return p.AnimateOperation=le,p.Arc=ue,p.Arrow=Hh,p.BEAUTIFUL_COLORS=to,p.Canvas=el,p.CanvasOperation=ws,p.Cross=Qh,p.CubicBezier=Tt,p.CustomCanvasContext=Oe,p.CustomCanvasGradient=ys,p.CustomCanvasPattern=wn,p.DOMEventBus=be,p.DOMKey=di,p.DOMParse=mi,p.DOMSVGUtil=ne,p.DOMToBlob=Xn,p.DOMToString=Ns,p.DOMUtil=A,p.DOMVideo=xe,p.Dep=yr,p.Ellipse=Cr,p.FetchWithAxios=Bc,p.FetchWithAxiosRequestCancel=ar,p.Fox=Wh,p.Heart=$h,p.HeartVariant=Jh,p.Line=yt,p.Matrix=Z,p.Matrix3D=Jt,p.PathD=O,p.PathDGroup=Le,p.Point=ut,p.Point3d=zh,p.Point3ds=qh,p.Points=vn,p.QRCode=Yt,p.QuadraticBezier=vs,p.Rabbit=Kh,p.Rect=Ct,p.SVG=Bh,p.SVGParse=xr,p.SVGParsedPathArgsLength=ve,p.Sector=Yh,p.SectorArc=Tr,p.Shape=X,p.ShapeGroup=Zt,p.Star=Zh,p.TWEEN=Me,p.Text=bs,p.Tree=tl,p.Tween=mn,p.Vector=ms,p.WebGLRenderer=nl,p.WebRTCClient=sl,p.WebSocketClient=pa,p.addWatermark=bh,p.addWxJsReadyFnBeforeConfig=xn,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=ge,p.animateInWeb=br,p.appendURLSearchString=xi,p.base64EncodeOutputStream=lr,p.base64URLDecode=sr,p.base64URLEncode=er,p.bitmapMapper=Si,p.blobToRawImage=Yc,p.byteArrayOutputStream=ln,p.canDrawBitmap=ai,p.canUsePaths=Va,p.canUseWorker=ri,p.canvasWorkerActions=po,p.changeBrightness=wh,p.changeDiaphaneity=vh,p.changeSize=yh,p.checkWxJsApi=cl,p.clearCookies=Ka,p.createXMLHttpRequest=Ci,p.decodeUseTextDecoder=nr,p.decryptInCommon=Lc,p.distance=Je,p.drawQRCodeToCanvas=Eh,p.encodeUseTextEncoder=ls,p.encryptInCommon=Oc,p.fileOrBlobToDataURL=cn,p.flipSideToSide=Wc,p.flipUpsideDown=$c,p.flushURLSearchString=fo,p.formDataToSearchString=bi,p.fromRadianAndLength=Gt,p.getBrowserClient=Us,p.getBrowserClientVersion=Pa,p.getBrowserLanguage=_a,p.getColor=zt,p.getColorScheme=pi,p.getCookie=Ja,p.getCookieObject=Za,p.getDirection=ja,p.getElementLeftPositionInPage2=Jn,p.getElementPositionInPage=$n,p.getElementPositionInPage2=ba,p.getElementPositionInViewport=xa,p.getElementTopPositionInPage2=Zn,p.getFileExtension=Yn,p.getFileString=go,p.getFileTypeFromFile=fa,p.getFilesImageInfo=Vc,p.getFormSubmitData=wo,p.getGlobal=Bs,p.getHexColorString=Se,p.getImageAspectRatio=Uc,p.getImageDataByAIData=Sh,p.getImageDataFromBitmap=zc,p.getImageDataFromUrl=or,p.getImageDataFromVideo=Gc,p.getImageMainColor=Hc,p.getInternetExplorerVersion=ei,p.getMousePositionInElement=Qn,p.getMousePositionInPage=Kn,p.getMousePositionInViewport=Ta,p.getOperatingSystem=We,p.getOperatingSystemVersion=Ea,p.getPageBodyElement=ya,p.getPageDocumentElement=se,p.getPageSize=va,p.getRGBColorString=eo,p.getRawImageInfo=fs,p.getRelativeBoundingClientRect=Sa,p.getScreenElement=ga,p.getScrollParent=al,p.getTimeZone=Da,p.getURL=Qe,p.getUserGeolocationPromise=Aa,p.getVerticalScrollPercentInPage=Ca,p.getViewportSize=wa,p.getWorker=mo,p.gifImage=ur,p.gradientColor=qs,p.h=ma,p.hasDocument=Fa,p.hasHistory=Ba,p.hasWindow=ii,p.hsb2rgb=ro,p.hsl2rgb=ao,p.hsv2rgb=io,p.imageDataToBitmap=jc,p.imageDataToBlob=qc,p.imageDataToDataURL=Xc,p.injectWxJsConfig=ol,p.isAliBrowser=ni,p.isAliMiniProgram=Na,p.isAndroid=ti,p.isAppleDevice=ka,p.isBrowserSupportFileAPI=Ua,p.isDarkMode=Ma,p.isIE=Ra,p.isIE9or10=Oa,p.isIOS=Vs,p.isMacOS=Gs,p.isMobile=Ia,p.isURL=lo,p.isWxBrowser=si,p.isWxMiniProgram=La,p.jpgToPng=dh,p.leftRotate=Jc,p.length=$e,p.linkExport=Fs,p.localstorage=Xs,p.mapTDTJSSDK=Bl,p.marginSharpen=fh,p.microTask=da,p.mosaic=xh,p.mount=pe,p.normalizePoint=za,p.objectHash=rr,p.outputGifBase64=fr,p.outputQRCodeBase64=Th,p.pack=Mc,p.parseTransformToMatrix=zs,p.parseURL=yi,p.patch=Hn,p.patchDOM=Wn,p.pngToJpg=mh,p.radiusClip=gh,p.randomColorHexString=so,p.randomColorNumber=gi,p.reactive=_h,p.reactiveVue2=Ah,p.reactiveVue3=wr,p.readFileInBrowser=He,p.recordToSearchString=vi,p.rectClip=ph,p.rgb2hsb=co,p.rgb2hsl=ho,p.rgb2hsv=oo,p.rightRotate=Zc,p.rotatePoint=St,p.searchStringToRecord=uo,p.selectFileInBrowser=qn,p.setColorScheme=Ze,p.setCookie=$a,p.setRem=Ga,p.shadeColor=no,p.sharpen=uh,p.signInCommon=Nc,p.singletonGlobalAnimateInWeb=he,p.stringHash=ir,p.stringToBlob=Ls,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=wi,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"}),p}({});
|
|
46
46
|
//# sourceMappingURL=zyzgroup_core_web.iife.js.map
|