@zyzgroup/core-web 0.0.92 → 0.0.93
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 +14 -14
- package/dist/zyzgroup_core_web.iife.js.map +1 -1
- package/dist/zyzgroup_core_web.js +4270 -4257
- package/dist/zyzgroup_core_web.js.map +1 -1
- package/dist/zyzgroup_core_web.umd.cjs +14 -14
- package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/types/canvas/CustomCanvasContext.d.ts +1 -1
- package/types/dom/DOMEventBus.d.ts.map +1 -1
- package/types/dom/DOMParse.d.ts.map +1 -1
- package/types/dom/DOMUtil.d.ts +2 -38
- package/types/dom/DOMUtil.d.ts.map +1 -1
- package/types/env.d.ts +0 -1
- package/types/env.d.ts.map +1 -1
- package/types/hooks/index.d.ts +7 -1
- package/types/hooks/index.d.ts.map +1 -1
- package/types/hooks/useAttribute.d.ts +1 -0
- package/types/hooks/useAttribute.d.ts.map +1 -1
- package/types/hooks/useClass.d.ts +6 -0
- package/types/hooks/useClass.d.ts.map +1 -0
- package/types/hooks/useDisplay.d.ts +5 -0
- package/types/hooks/useDisplay.d.ts.map +1 -0
- package/types/hooks/useElement.d.ts +22 -0
- package/types/hooks/useElement.d.ts.map +1 -0
- package/types/hooks/useEventListener.d.ts +1 -1
- package/types/hooks/useLocation.d.ts +2 -0
- package/types/hooks/useLocation.d.ts.map +1 -0
- package/types/hooks/useResize.d.ts +12 -0
- package/types/hooks/useResize.d.ts.map +1 -0
- package/types/hooks/useScroll.d.ts +2 -0
- package/types/hooks/useScroll.d.ts.map +1 -1
- package/types/hooks/useVibrate.d.ts +2 -0
- package/types/hooks/useVibrate.d.ts.map +1 -0
- package/types/hooks/useWindowChange.d.ts +10 -18
- package/types/hooks/useWindowChange.d.ts.map +1 -1
- package/types/vnode.d.ts.map +1 -1
- package/types/bom.d.ts +0 -1
- package/types/bom.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(d,we){typeof exports=="object"&&typeof module<"u"?we(exports):typeof define=="function"&&define.amd?define(["exports"],we):(d=typeof globalThis<"u"?globalThis:d||self,we(d.ZYZGroupCoreWeb={}))})(this,function(d){"use strict";function we(){return typeof window<"u"?window:typeof global<"u"?global:this||{}}const
|
|
1
|
+
(function(d,we){typeof exports=="object"&&typeof module<"u"?we(exports):typeof define=="function"&&define.amd?define(["exports"],we):(d=typeof globalThis<"u"?globalThis:d||self,we(d.ZYZGroupCoreWeb={}))})(this,function(d){"use strict";function we(){return typeof window<"u"?window:typeof global<"u"?global:this||{}}const os=i=>{let t=null;switch(i){case"any-character":t=/[^]/;break;case"bin":t=/^(0b)?[0-1]+$/i;break;case"oct":t=/^(0o)?[0-7]+$/i;break;case"hex":t=/^(0x)?[0-9a-fA-F]+$/i;break;case"ascii":t=/^[\x00-\xFF]+$/i;break;case"int":t=/^[-+]?[0-9]+$/;break;case"number":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;break;case"number-single":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/i;break;case"split":t=/\s*,\s*/gi;break;case"trim":t=/^\s+|\s+$/g;break;case"regexp":t=/[\\^$.*+?()[\]{}|]/g;break;case"regexp-flags":t=/\w*$/;break;case"native-method":t=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(os("regexp"),"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");break;case"svg-segment":t=/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi;break;case"mobile-china":t=/^\+?[1-9]{1}[0-9]{10}$/g;break;case"email":t=/^[A-Za-z0-9_!#$%&'*+/=?`{|}~^.-]+\@[A-Za-z0-9._-]+\.[A-Za-z0-9]+$/gm;break;case"ip":t=/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;break;case"url":t=/^http[s]?:\/\/([\w-]+\.)+[\w-]+([\w-./?%&=]*)?$/;break;case"element-url":t=/^url\(['"]?(.+?)['"]?\)$/i;break;case"date":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})$/;break;case"time":t=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/;break;case"datetime":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})\s+(\d{1,2}):(\d{1,2}):(\d{1,2})$/;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"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"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"var-name":t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;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,27 +7,27 @@
|
|
|
7
7
|
|[\u{2B740}-\u{2B81D}]
|
|
8
8
|
|[\u{2B820}-\u{2CEAF}]
|
|
9
9
|
|[\u{2CEB0}-\u{2EBEF}]
|
|
10
|
-
`.replace(/\s+/g,""),"u");break;case"mime-image":t=/^image\//;break;case"mime-video":t=/^video\//;break;case"mime-audio":t=/^audio\//;break;case"mime-document-word":t=/^application\/(?:vnd\.openxmlformats-officedocument\.wordprocessingml\.document|msword|vnd\.ms-word\.document\.macroenabled\.12|vnd\.openxmlformats-officedocument\.wordprocessingml\.template|vnd\.ms-word\.template\.macroenabled\.12)$/;break;case"mime-document-excel":t=/^application\/(?:vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|vnd\.ms-excel|vnd\.ms-excel\.sheet\.macroenabled\.12|vnd\.openxmlformats-officedocument\.spreadsheetml\.template|vnd\.ms-excel\.template\.macroenabled\.12)$/;break;case"mime-document-ppt":t=/^application\/(?:vnd\.ms-powerpoint|vnd\.openxmlformats-officedocument\.presentationml\.presentation|vnd\.ms-powerpoint\.presentation\.macroenabled\.12|vnd\.openxmlformats-officedocument\.presentationml\.template|vnd\.ms-powerpoint\.template\.macroenabled\.12)$/;break;case"mime-document-json":t=/^application\/json$/;break;case"mime-document-xml":t=/^(?:application|text)\/(?:xml|xhtml\+xml)$/;break}return t},
|
|
11
|
-
`);s=~Y?F.length-Y:s+F.length}function r(){var F={line:e,column:s};return function(k){return k.position=new a(F),p(),k}}function a(F){this.start=F,this.end={line:e,column:s},this.source=t.source}a.prototype.content=i;var o=[];function h(F){var k=new Error(t.source+":"+e+":"+s+": "+F);if(k.reason=F,k.filename=t.source,k.line=e,k.column=s,k.source=i,t.silent)o.push(k);else throw k}function c(){var F=y();return{type:"stylesheet",stylesheet:{source:t.source,rules:F,parsingErrors:o}}}function l(){return b(/^{\s*/)}function f(){return b(/^}/)}function y(){var F,k=[];for(p(),E(k);i.length&&i.charAt(0)!="}"&&(F=pe()||Ee());)F!==!1&&(k.push(F),E(k));return k}function b(F){var k=F.exec(i);if(k){var Y=k[0];return n(Y),i=i.slice(Y.length),k}}function p(){b(/^\s*/)}function E(F){var k;for(F=F||[];k=_();)k!==!1&&F.push(k);return F}function _(){var F=r();if(!(i.charAt(0)!="/"||i.charAt(1)!="*")){for(var k=2;i.charAt(k)!=""&&(i.charAt(k)!="*"||i.charAt(k+1)!="/");)++k;if(k+=2,i.charAt(k-1)==="")return h("End of comment missing");var Y=i.slice(2,k-2);return s+=2,n(Y),i=i.slice(k),s+=2,F({type:"comment",comment:Y})}}function v(){var F=b(/^([^{]+)/);if(F)return Ut(F[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(k){return k.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(k){return k.replace(/\u200C/g,",")})}function x(){var F=r(),k=b(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(k){if(k=Ut(k[0]),!b(/^:\s*/))return h("property missing ':'");var Y=b(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),V=F({type:"declaration",property:k.replace(kn,""),value:Y?Ut(Y[0]).replace(kn,""):""});return b(/^[;\s]*/),V}}function w(){var F=[];if(!l())return h("missing '{'");E(F);for(var k;k=x();)k!==!1&&(F.push(k),E(F));return f()?F:h("missing '}'")}function g(){for(var F,k=[],Y=r();F=b(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)k.push(F[1]),b(/^,\s*/);if(k.length)return Y({type:"keyframe",values:k,declarations:w()})}function P(){var F=r(),k=b(/^@([-\w]+)?keyframes\s*/);if(k){var Y=k[1];if(k=b(/^([-\w]+)\s*/),!k)return h("@keyframes missing name");var V=k[1];if(!l())return h("@keyframes missing '{'");for(var ut,At=E();ut=g();)At.push(ut),At=At.concat(E());return f()?F({type:"keyframes",name:V,vendor:Y,keyframes:At}):h("@keyframes missing '}'")}}function C(){var F=r(),k=b(/^@supports *([^{]+)/);if(k){var Y=Ut(k[1]);if(!l())return h("@supports missing '{'");var V=E().concat(y());return f()?F({type:"supports",supports:Y,rules:V}):h("@supports missing '}'")}}function B(){var F=r(),k=b(/^@host\s*/);if(k){if(!l())return h("@host missing '{'");var Y=E().concat(y());return f()?F({type:"host",rules:Y}):h("@host missing '}'")}}function q(){var F=r(),k=b(/^@media *([^{]+)/);if(k){var Y=Ut(k[1]);if(!l())return h("@media missing '{'");var V=E().concat(y());return f()?F({type:"media",media:Y,rules:V}):h("@media missing '}'")}}function G(){var F=r(),k=b(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(k)return F({type:"custom-media",name:Ut(k[1]),media:Ut(k[2])})}function J(){var F=r(),k=b(/^@page */);if(k){var Y=v()||[];if(!l())return h("@page missing '{'");for(var V=E(),ut;ut=x();)V.push(ut),V=V.concat(E());return f()?F({type:"page",selectors:Y,declarations:V}):h("@page missing '}'")}}function Z(){var F=r(),k=b(/^@([-\w]+)?document *([^{]+)/);if(k){var Y=Ut(k[1]),V=Ut(k[2]);if(!l())return h("@document missing '{'");var ut=E().concat(y());return f()?F({type:"document",document:V,vendor:Y,rules:ut}):h("@document missing '}'")}}function at(){var F=r(),k=b(/^@font-face\s*/);if(k){if(!l())return h("@font-face missing '{'");for(var Y=E(),V;V=x();)Y.push(V),Y=Y.concat(E());return f()?F({type:"font-face",declarations:Y}):h("@font-face missing '}'")}}var Ct=ae("import"),pt=ae("charset"),Pe=ae("namespace");function ae(F){var k=new RegExp("^@"+F+"\\s*([^;]+);");return function(){var Y=r(),V=b(k);if(V){var ut={type:F};return ut[F]=V[1].trim(),Y(ut)}}}function pe(){if(i[0]=="@")return P()||q()||G()||C()||Ct()||pt()||Pe()||Z()||J()||B()||at()}function Ee(){var F=r(),k=v();return k?(E(),F({type:"rule",selectors:k,declarations:w()})):h("selector missing")}return ri(c())}function Ut(i){return i?i.replace(/^\s+|\s+$/g,""):""}function ri(i,t){var e=i&&typeof i.type=="string",s=e?i:t;for(var n in i){var r=i[n];Array.isArray(r)?r.forEach(function(a){ri(a,s)}):r&&typeof r=="object"&&ri(r,s)}return e&&Object.defineProperty(i,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),i}const bo={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:i=>{const t=["th","st","nd","rd"],e=i%100;return`[${i}${t[(e-20)%10]||t[e]||t[0]}]`}};let os="en";const hs={};hs[os]=bo;function Ln(i,t){if(!i)return os;let e;if(typeof i=="string"){const s=i.toLowerCase();hs[s]&&(e=s),t&&(hs[s]=t,e=s);const n=i.split("-");if(!e&&n.length>1)return Ln(n[0])}else{const{name:s}=i;hs[s]=i,e=s}return e&&(os=e),e||os}const vo={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:(i,t)=>{switch(t){case"W":return`${i}周`;default:return`${i}日`}},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:(i,t)=>{const e=i*100+t;return e<600?"凌晨":e<900?"早上":e<1100?"上午":e<1300?"中午":e<1800?"下午":"晚上"}};Ln(vo);function So(i,t=(e,s)=>e<=s){const e=i.length;let s=Math.floor(e/2);for(;s>0;){for(let n=s;n<e;n++){const r=i[n];let a=n;for(;a>=s&&!t(i[a-s],r);)i[a]=i[a-s],a-=s;i[a]=r}s=Math.floor(s/2)}}function Co(){const i={};return i.promise=new Promise((t,e)=>{i.resolve=t,i.reject=e}),i}let Rn;try{Rn=Promise}catch{Rn=function(){}}class On{maps=new Map;mapsAddedDuringUpdate=new Map;entries(){return Array.from(this.maps.entries())}keys(){return Array.from(this.maps.keys())}values(){return Array.from(this.maps.values())}get length(){return this.entries().length}set(t,e){this.maps.set(t,e),this.mapsAddedDuringUpdate.set(t,e)}get(t){return this.maps.get(t)}shift(){const t=this.entries();if(t.length){const[e,s]=t[0];return this.delete(e),[e,s]}}delete(t){return this.mapsAddedDuringUpdate.delete(t),this.maps.delete(t)}deleteAll(){this.maps=new Map,this.mapsAddedDuringUpdate=new Map}filter(t){let e=Array.from(this.maps.entries());for(;e.length>0;){this.mapsAddedDuringUpdate=new Map;for(let s=0,n=e.length;s<n;s++){const[r,a]=e[s];t(r,a)===!1&&this.delete(r)}e=Array.from(this.mapsAddedDuringUpdate.entries())}}}function Fn(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Nn={exports:{}};(function(i,t){(function(e){i.exports=e()})(function(e){var s=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(v,x){var w=v[0],g=v[1],P=v[2],C=v[3];w+=(g&P|~g&C)+x[0]-680876936|0,w=(w<<7|w>>>25)+g|0,C+=(w&g|~w&P)+x[1]-389564586|0,C=(C<<12|C>>>20)+w|0,P+=(C&w|~C&g)+x[2]+606105819|0,P=(P<<17|P>>>15)+C|0,g+=(P&C|~P&w)+x[3]-1044525330|0,g=(g<<22|g>>>10)+P|0,w+=(g&P|~g&C)+x[4]-176418897|0,w=(w<<7|w>>>25)+g|0,C+=(w&g|~w&P)+x[5]+1200080426|0,C=(C<<12|C>>>20)+w|0,P+=(C&w|~C&g)+x[6]-1473231341|0,P=(P<<17|P>>>15)+C|0,g+=(P&C|~P&w)+x[7]-45705983|0,g=(g<<22|g>>>10)+P|0,w+=(g&P|~g&C)+x[8]+1770035416|0,w=(w<<7|w>>>25)+g|0,C+=(w&g|~w&P)+x[9]-1958414417|0,C=(C<<12|C>>>20)+w|0,P+=(C&w|~C&g)+x[10]-42063|0,P=(P<<17|P>>>15)+C|0,g+=(P&C|~P&w)+x[11]-1990404162|0,g=(g<<22|g>>>10)+P|0,w+=(g&P|~g&C)+x[12]+1804603682|0,w=(w<<7|w>>>25)+g|0,C+=(w&g|~w&P)+x[13]-40341101|0,C=(C<<12|C>>>20)+w|0,P+=(C&w|~C&g)+x[14]-1502002290|0,P=(P<<17|P>>>15)+C|0,g+=(P&C|~P&w)+x[15]+1236535329|0,g=(g<<22|g>>>10)+P|0,w+=(g&C|P&~C)+x[1]-165796510|0,w=(w<<5|w>>>27)+g|0,C+=(w&P|g&~P)+x[6]-1069501632|0,C=(C<<9|C>>>23)+w|0,P+=(C&g|w&~g)+x[11]+643717713|0,P=(P<<14|P>>>18)+C|0,g+=(P&w|C&~w)+x[0]-373897302|0,g=(g<<20|g>>>12)+P|0,w+=(g&C|P&~C)+x[5]-701558691|0,w=(w<<5|w>>>27)+g|0,C+=(w&P|g&~P)+x[10]+38016083|0,C=(C<<9|C>>>23)+w|0,P+=(C&g|w&~g)+x[15]-660478335|0,P=(P<<14|P>>>18)+C|0,g+=(P&w|C&~w)+x[4]-405537848|0,g=(g<<20|g>>>12)+P|0,w+=(g&C|P&~C)+x[9]+568446438|0,w=(w<<5|w>>>27)+g|0,C+=(w&P|g&~P)+x[14]-1019803690|0,C=(C<<9|C>>>23)+w|0,P+=(C&g|w&~g)+x[3]-187363961|0,P=(P<<14|P>>>18)+C|0,g+=(P&w|C&~w)+x[8]+1163531501|0,g=(g<<20|g>>>12)+P|0,w+=(g&C|P&~C)+x[13]-1444681467|0,w=(w<<5|w>>>27)+g|0,C+=(w&P|g&~P)+x[2]-51403784|0,C=(C<<9|C>>>23)+w|0,P+=(C&g|w&~g)+x[7]+1735328473|0,P=(P<<14|P>>>18)+C|0,g+=(P&w|C&~w)+x[12]-1926607734|0,g=(g<<20|g>>>12)+P|0,w+=(g^P^C)+x[5]-378558|0,w=(w<<4|w>>>28)+g|0,C+=(w^g^P)+x[8]-2022574463|0,C=(C<<11|C>>>21)+w|0,P+=(C^w^g)+x[11]+1839030562|0,P=(P<<16|P>>>16)+C|0,g+=(P^C^w)+x[14]-35309556|0,g=(g<<23|g>>>9)+P|0,w+=(g^P^C)+x[1]-1530992060|0,w=(w<<4|w>>>28)+g|0,C+=(w^g^P)+x[4]+1272893353|0,C=(C<<11|C>>>21)+w|0,P+=(C^w^g)+x[7]-155497632|0,P=(P<<16|P>>>16)+C|0,g+=(P^C^w)+x[10]-1094730640|0,g=(g<<23|g>>>9)+P|0,w+=(g^P^C)+x[13]+681279174|0,w=(w<<4|w>>>28)+g|0,C+=(w^g^P)+x[0]-358537222|0,C=(C<<11|C>>>21)+w|0,P+=(C^w^g)+x[3]-722521979|0,P=(P<<16|P>>>16)+C|0,g+=(P^C^w)+x[6]+76029189|0,g=(g<<23|g>>>9)+P|0,w+=(g^P^C)+x[9]-640364487|0,w=(w<<4|w>>>28)+g|0,C+=(w^g^P)+x[12]-421815835|0,C=(C<<11|C>>>21)+w|0,P+=(C^w^g)+x[15]+530742520|0,P=(P<<16|P>>>16)+C|0,g+=(P^C^w)+x[2]-995338651|0,g=(g<<23|g>>>9)+P|0,w+=(P^(g|~C))+x[0]-198630844|0,w=(w<<6|w>>>26)+g|0,C+=(g^(w|~P))+x[7]+1126891415|0,C=(C<<10|C>>>22)+w|0,P+=(w^(C|~g))+x[14]-1416354905|0,P=(P<<15|P>>>17)+C|0,g+=(C^(P|~w))+x[5]-57434055|0,g=(g<<21|g>>>11)+P|0,w+=(P^(g|~C))+x[12]+1700485571|0,w=(w<<6|w>>>26)+g|0,C+=(g^(w|~P))+x[3]-1894986606|0,C=(C<<10|C>>>22)+w|0,P+=(w^(C|~g))+x[10]-1051523|0,P=(P<<15|P>>>17)+C|0,g+=(C^(P|~w))+x[1]-2054922799|0,g=(g<<21|g>>>11)+P|0,w+=(P^(g|~C))+x[8]+1873313359|0,w=(w<<6|w>>>26)+g|0,C+=(g^(w|~P))+x[15]-30611744|0,C=(C<<10|C>>>22)+w|0,P+=(w^(C|~g))+x[6]-1560198380|0,P=(P<<15|P>>>17)+C|0,g+=(C^(P|~w))+x[13]+1309151649|0,g=(g<<21|g>>>11)+P|0,w+=(P^(g|~C))+x[4]-145523070|0,w=(w<<6|w>>>26)+g|0,C+=(g^(w|~P))+x[11]-1120210379|0,C=(C<<10|C>>>22)+w|0,P+=(w^(C|~g))+x[2]+718787259|0,P=(P<<15|P>>>17)+C|0,g+=(C^(P|~w))+x[9]-343485551|0,g=(g<<21|g>>>11)+P|0,v[0]=w+v[0]|0,v[1]=g+v[1]|0,v[2]=P+v[2]|0,v[3]=C+v[3]|0}function r(v){var x=[],w;for(w=0;w<64;w+=4)x[w>>2]=v.charCodeAt(w)+(v.charCodeAt(w+1)<<8)+(v.charCodeAt(w+2)<<16)+(v.charCodeAt(w+3)<<24);return x}function a(v){var x=[],w;for(w=0;w<64;w+=4)x[w>>2]=v[w]+(v[w+1]<<8)+(v[w+2]<<16)+(v[w+3]<<24);return x}function o(v){var x=v.length,w=[1732584193,-271733879,-1732584194,271733878],g,P,C,B,q,G;for(g=64;g<=x;g+=64)n(w,r(v.substring(g-64,g)));for(v=v.substring(g-64),P=v.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0;g<P;g+=1)C[g>>2]|=v.charCodeAt(g)<<(g%4<<3);if(C[g>>2]|=128<<(g%4<<3),g>55)for(n(w,C),g=0;g<16;g+=1)C[g]=0;return B=x*8,B=B.toString(16).match(/(.*?)(.{0,8})$/),q=parseInt(B[2],16),G=parseInt(B[1],16)||0,C[14]=q,C[15]=G,n(w,C),w}function h(v){var x=v.length,w=[1732584193,-271733879,-1732584194,271733878],g,P,C,B,q,G;for(g=64;g<=x;g+=64)n(w,a(v.subarray(g-64,g)));for(v=g-64<x?v.subarray(g-64):new Uint8Array(0),P=v.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0;g<P;g+=1)C[g>>2]|=v[g]<<(g%4<<3);if(C[g>>2]|=128<<(g%4<<3),g>55)for(n(w,C),g=0;g<16;g+=1)C[g]=0;return B=x*8,B=B.toString(16).match(/(.*?)(.{0,8})$/),q=parseInt(B[2],16),G=parseInt(B[1],16)||0,C[14]=q,C[15]=G,n(w,C),w}function c(v){var x="",w;for(w=0;w<4;w+=1)x+=s[v>>w*8+4&15]+s[v>>w*8&15];return x}function l(v){var x;for(x=0;x<v.length;x+=1)v[x]=c(v[x]);return v.join("")}l(o("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function v(x,w){return x=x|0||0,x<0?Math.max(x+w,0):Math.min(x,w)}ArrayBuffer.prototype.slice=function(x,w){var g=this.byteLength,P=v(x,g),C=g,B,q,G,J;return w!==e&&(C=v(w,g)),P>C?new ArrayBuffer(0):(B=C-P,q=new ArrayBuffer(B),G=new Uint8Array(q),J=new Uint8Array(this,P,B),G.set(J),q)}}();function f(v){return/[\u0080-\uFFFF]/.test(v)&&(v=unescape(encodeURIComponent(v))),v}function y(v,x){var w=v.length,g=new ArrayBuffer(w),P=new Uint8Array(g),C;for(C=0;C<w;C+=1)P[C]=v.charCodeAt(C);return x?P:g}function b(v){return String.fromCharCode.apply(null,new Uint8Array(v))}function p(v,x,w){var g=new Uint8Array(v.byteLength+x.byteLength);return g.set(new Uint8Array(v)),g.set(new Uint8Array(x),v.byteLength),w?g:g.buffer}function E(v){var x=[],w=v.length,g;for(g=0;g<w-1;g+=2)x.push(parseInt(v.substr(g,2),16));return String.fromCharCode.apply(String,x)}function _(){this.reset()}return _.prototype.append=function(v){return this.appendBinary(f(v)),this},_.prototype.appendBinary=function(v){this._buff+=v,this._length+=v.length;var x=this._buff.length,w;for(w=64;w<=x;w+=64)n(this._hash,r(this._buff.substring(w-64,w)));return this._buff=this._buff.substring(w-64),this},_.prototype.end=function(v){var x=this._buff,w=x.length,g,P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],C;for(g=0;g<w;g+=1)P[g>>2]|=x.charCodeAt(g)<<(g%4<<3);return this._finish(P,w),C=l(this._hash),v&&(C=E(C)),this.reset(),C},_.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},_.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},_.prototype.setState=function(v){return this._buff=v.buff,this._length=v.length,this._hash=v.hash,this},_.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},_.prototype._finish=function(v,x){var w=x,g,P,C;if(v[w>>2]|=128<<(w%4<<3),w>55)for(n(this._hash,v),w=0;w<16;w+=1)v[w]=0;g=this._length*8,g=g.toString(16).match(/(.*?)(.{0,8})$/),P=parseInt(g[2],16),C=parseInt(g[1],16)||0,v[14]=P,v[15]=C,n(this._hash,v)},_.hash=function(v,x){return _.hashBinary(f(v),x)},_.hashBinary=function(v,x){var w=o(v),g=l(w);return x?E(g):g},_.ArrayBuffer=function(){this.reset()},_.ArrayBuffer.prototype.append=function(v){var x=p(this._buff.buffer,v,!0),w=x.length,g;for(this._length+=v.byteLength,g=64;g<=w;g+=64)n(this._hash,a(x.subarray(g-64,g)));return this._buff=g-64<w?new Uint8Array(x.buffer.slice(g-64)):new Uint8Array(0),this},_.ArrayBuffer.prototype.end=function(v){var x=this._buff,w=x.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],P,C;for(P=0;P<w;P+=1)g[P>>2]|=x[P]<<(P%4<<3);return this._finish(g,w),C=l(this._hash),v&&(C=E(C)),this.reset(),C},_.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},_.ArrayBuffer.prototype.getState=function(){var v=_.prototype.getState.call(this);return v.buff=b(v.buff),v},_.ArrayBuffer.prototype.setState=function(v){return v.buff=y(v.buff,!0),_.prototype.setState.call(this,v)},_.ArrayBuffer.prototype.destroy=_.prototype.destroy,_.ArrayBuffer.prototype._finish=_.prototype._finish,_.ArrayBuffer.hash=function(v,x){var w=h(new Uint8Array(v)),g=l(w);return x?E(g):g},_})})(Nn);var To=Nn.exports;const Po=Fn(To);function Bn(i,t){return function(){return i.apply(t,arguments)}}const{toString:Eo}=Object.prototype,{getPrototypeOf:ai}=Object,cs=(i=>t=>{const e=Eo.call(t);return i[e]||(i[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),kt=i=>(i=i.toLowerCase(),t=>cs(t)===i),ls=i=>t=>typeof t===i,{isArray:ve}=Array,Ie=ls("undefined");function _o(i){return i!==null&&!Ie(i)&&i.constructor!==null&&!Ie(i.constructor)&&vt(i.constructor.isBuffer)&&i.constructor.isBuffer(i)}const Yn=kt("ArrayBuffer");function Ao(i){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(i):t=i&&i.buffer&&Yn(i.buffer),t}const Do=ls("string"),vt=ls("function"),Un=ls("number"),us=i=>i!==null&&typeof i=="object",Io=i=>i===!0||i===!1,fs=i=>{if(cs(i)!=="object")return!1;const t=ai(i);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)},Mo=kt("Date"),ko=kt("File"),Lo=kt("Blob"),Ro=kt("FileList"),Oo=i=>us(i)&&vt(i.pipe),Fo=i=>{let t;return i&&(typeof FormData=="function"&&i instanceof FormData||vt(i.append)&&((t=cs(i))==="formdata"||t==="object"&&vt(i.toString)&&i.toString()==="[object FormData]"))},No=kt("URLSearchParams"),Bo=i=>i.trim?i.trim():i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Me(i,t,{allOwnKeys:e=!1}={}){if(i===null||typeof i>"u")return;let s,n;if(typeof i!="object"&&(i=[i]),ve(i))for(s=0,n=i.length;s<n;s++)t.call(null,i[s],s,i);else{const r=e?Object.getOwnPropertyNames(i):Object.keys(i),a=r.length;let o;for(s=0;s<a;s++)o=r[s],t.call(null,i[o],o,i)}}function Xn(i,t){t=t.toLowerCase();const e=Object.keys(i);let s=e.length,n;for(;s-- >0;)if(n=e[s],t===n.toLowerCase())return n;return null}const Vn=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Gn=i=>!Ie(i)&&i!==Vn;function oi(){const{caseless:i}=Gn(this)&&this||{},t={},e=(s,n)=>{const r=i&&Xn(t,n)||n;fs(t[r])&&fs(s)?t[r]=oi(t[r],s):fs(s)?t[r]=oi({},s):ve(s)?t[r]=s.slice():t[r]=s};for(let s=0,n=arguments.length;s<n;s++)arguments[s]&&Me(arguments[s],e);return t}const Yo=(i,t,e,{allOwnKeys:s}={})=>(Me(t,(n,r)=>{e&&vt(n)?i[r]=Bn(n,e):i[r]=n},{allOwnKeys:s}),i),Uo=i=>(i.charCodeAt(0)===65279&&(i=i.slice(1)),i),Xo=(i,t,e,s)=>{i.prototype=Object.create(t.prototype,s),i.prototype.constructor=i,Object.defineProperty(i,"super",{value:t.prototype}),e&&Object.assign(i.prototype,e)},Vo=(i,t,e,s)=>{let n,r,a;const o={};if(t=t||{},i==null)return t;do{for(n=Object.getOwnPropertyNames(i),r=n.length;r-- >0;)a=n[r],(!s||s(a,i,t))&&!o[a]&&(t[a]=i[a],o[a]=!0);i=e!==!1&&ai(i)}while(i&&(!e||e(i,t))&&i!==Object.prototype);return t},Go=(i,t,e)=>{i=String(i),(e===void 0||e>i.length)&&(e=i.length),e-=t.length;const s=i.indexOf(t,e);return s!==-1&&s===e},zo=i=>{if(!i)return null;if(ve(i))return i;let t=i.length;if(!Un(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=i[t];return e},Ho=(i=>t=>i&&t instanceof i)(typeof Uint8Array<"u"&&ai(Uint8Array)),qo=(i,t)=>{const s=(i&&i[Symbol.iterator]).call(i);let n;for(;(n=s.next())&&!n.done;){const r=n.value;t.call(i,r[0],r[1])}},jo=(i,t)=>{let e;const s=[];for(;(e=i.exec(t))!==null;)s.push(e);return s},$o=kt("HTMLFormElement"),Wo=i=>i.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,n){return s.toUpperCase()+n}),zn=(({hasOwnProperty:i})=>(t,e)=>i.call(t,e))(Object.prototype),Jo=kt("RegExp"),Hn=(i,t)=>{const e=Object.getOwnPropertyDescriptors(i),s={};Me(e,(n,r)=>{let a;(a=t(n,r,i))!==!1&&(s[r]=a||n)}),Object.defineProperties(i,s)},Zo=i=>{Hn(i,(t,e)=>{if(vt(i)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=i[e];if(vt(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+"'")})}})},Ko=(i,t)=>{const e={},s=n=>{n.forEach(r=>{e[r]=!0})};return ve(i)?s(i):s(String(i).split(t)),e},Qo=()=>{},th=(i,t)=>(i=+i,Number.isFinite(i)?i:t),hi="abcdefghijklmnopqrstuvwxyz",qn="0123456789",jn={DIGIT:qn,ALPHA:hi,ALPHA_DIGIT:hi+hi.toUpperCase()+qn},eh=(i=16,t=jn.ALPHA_DIGIT)=>{let e="";const{length:s}=t;for(;i--;)e+=t[Math.random()*s|0];return e};function sh(i){return!!(i&&vt(i.append)&&i[Symbol.toStringTag]==="FormData"&&i[Symbol.iterator])}const ih=i=>{const t=new Array(10),e=(s,n)=>{if(us(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[n]=s;const r=ve(s)?[]:{};return Me(s,(a,o)=>{const h=e(a,n+1);!Ie(h)&&(r[o]=h)}),t[n]=void 0,r}}return s};return e(i,0)},nh=kt("AsyncFunction"),D={isArray:ve,isArrayBuffer:Yn,isBuffer:_o,isFormData:Fo,isArrayBufferView:Ao,isString:Do,isNumber:Un,isBoolean:Io,isObject:us,isPlainObject:fs,isUndefined:Ie,isDate:Mo,isFile:ko,isBlob:Lo,isRegExp:Jo,isFunction:vt,isStream:Oo,isURLSearchParams:No,isTypedArray:Ho,isFileList:Ro,forEach:Me,merge:oi,extend:Yo,trim:Bo,stripBOM:Uo,inherits:Xo,toFlatObject:Vo,kindOf:cs,kindOfTest:kt,endsWith:Go,toArray:zo,forEachEntry:qo,matchAll:jo,isHTMLForm:$o,hasOwnProperty:zn,hasOwnProp:zn,reduceDescriptors:Hn,freezeMethods:Zo,toObjectSet:Ko,toCamelCase:Wo,noop:Qo,toFiniteNumber:th,findKey:Xn,global:Vn,isContextDefined:Gn,ALPHABET:jn,generateString:eh,isSpecCompliantForm:sh,toJSONObject:ih,isAsyncFn:nh,isThenable:i=>i&&(us(i)||vt(i))&&vt(i.then)&&vt(i.catch)};function X(i,t,e,s,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=i,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),s&&(this.request=s),n&&(this.response=n)}D.inherits(X,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:D.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const $n=X.prototype,Wn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(i=>{Wn[i]={value:i}}),Object.defineProperties(X,Wn),Object.defineProperty($n,"isAxiosError",{value:!0}),X.from=(i,t,e,s,n,r)=>{const a=Object.create($n);return D.toFlatObject(i,a,function(h){return h!==Error.prototype},o=>o!=="isAxiosError"),X.call(a,i.message,t,e,s,n),a.cause=i,a.name=i.name,r&&Object.assign(a,r),a};const rh=null;function ci(i){return D.isPlainObject(i)||D.isArray(i)}function Jn(i){return D.endsWith(i,"[]")?i.slice(0,-2):i}function Zn(i,t,e){return i?i.concat(t).map(function(n,r){return n=Jn(n),!e&&r?"["+n+"]":n}).join(e?".":""):t}function ah(i){return D.isArray(i)&&!i.some(ci)}const oh=D.toFlatObject(D,{},null,function(t){return/^is[A-Z]/.test(t)});function ds(i,t,e){if(!D.isObject(i))throw new TypeError("target must be an object");t=t||new FormData,e=D.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,_){return!D.isUndefined(_[E])});const s=e.metaTokens,n=e.visitor||l,r=e.dots,a=e.indexes,h=(e.Blob||typeof Blob<"u"&&Blob)&&D.isSpecCompliantForm(t);if(!D.isFunction(n))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(D.isDate(p))return p.toISOString();if(!h&&D.isBlob(p))throw new X("Blob is not supported. Use a Buffer instead.");return D.isArrayBuffer(p)||D.isTypedArray(p)?h&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,E,_){let v=p;if(p&&!_&&typeof p=="object"){if(D.endsWith(E,"{}"))E=s?E:E.slice(0,-2),p=JSON.stringify(p);else if(D.isArray(p)&&ah(p)||(D.isFileList(p)||D.endsWith(E,"[]"))&&(v=D.toArray(p)))return E=Jn(E),v.forEach(function(w,g){!(D.isUndefined(w)||w===null)&&t.append(a===!0?Zn([E],g,r):a===null?E:E+"[]",c(w))}),!1}return ci(p)?!0:(t.append(Zn(_,E,r),c(p)),!1)}const f=[],y=Object.assign(oh,{defaultVisitor:l,convertValue:c,isVisitable:ci});function b(p,E){if(!D.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+E.join("."));f.push(p),D.forEach(p,function(v,x){(!(D.isUndefined(v)||v===null)&&n.call(t,v,D.isString(x)?x.trim():x,E,y))===!0&&b(v,E?E.concat(x):[x])}),f.pop()}}if(!D.isObject(i))throw new TypeError("data must be an object");return b(i),t}function Kn(i){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function li(i,t){this._pairs=[],i&&ds(i,this,t)}const Qn=li.prototype;Qn.append=function(t,e){this._pairs.push([t,e])},Qn.toString=function(t){const e=t?function(s){return t.call(this,s,Kn)}:Kn;return this._pairs.map(function(n){return e(n[0])+"="+e(n[1])},"").join("&")};function hh(i){return encodeURIComponent(i).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function tr(i,t,e){if(!t)return i;const s=e&&e.encode||hh,n=e&&e.serialize;let r;if(n?r=n(t,e):r=D.isURLSearchParams(t)?t.toString():new li(t,e).toString(s),r){const a=i.indexOf("#");a!==-1&&(i=i.slice(0,a)),i+=(i.indexOf("?")===-1?"?":"&")+r}return i}class ch{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){D.forEach(this.handlers,function(s){s!==null&&t(s)})}}const er=ch,sr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},lh=typeof URLSearchParams<"u"?URLSearchParams:li,uh=typeof FormData<"u"?FormData:null,fh=typeof Blob<"u"?Blob:null,dh=(()=>{let i;return typeof navigator<"u"&&((i=navigator.product)==="ReactNative"||i==="NativeScript"||i==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),mh=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Lt={isBrowser:!0,classes:{URLSearchParams:lh,FormData:uh,Blob:fh},isStandardBrowserEnv:dh,isStandardBrowserWebWorkerEnv:mh,protocols:["http","https","file","blob","url","data"]};function ph(i,t){return ds(i,new Lt.classes.URLSearchParams,Object.assign({visitor:function(e,s,n,r){return Lt.isNode&&D.isBuffer(e)?(this.append(s,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function gh(i){return D.matchAll(/\w+|\[(\w*)]/g,i).map(t=>t[0]==="[]"?"":t[1]||t[0])}function yh(i){const t={},e=Object.keys(i);let s;const n=e.length;let r;for(s=0;s<n;s++)r=e[s],t[r]=i[r];return t}function ir(i){function t(e,s,n,r){let a=e[r++];const o=Number.isFinite(+a),h=r>=e.length;return a=!a&&D.isArray(n)?n.length:a,h?(D.hasOwnProp(n,a)?n[a]=[n[a],s]:n[a]=s,!o):((!n[a]||!D.isObject(n[a]))&&(n[a]=[]),t(e,s,n[a],r)&&D.isArray(n[a])&&(n[a]=yh(n[a])),!o)}if(D.isFormData(i)&&D.isFunction(i.entries)){const e={};return D.forEachEntry(i,(s,n)=>{t(gh(s),n,e,0)}),e}return null}function wh(i,t,e){if(D.isString(i))try{return(t||JSON.parse)(i),D.trim(i)}catch(s){if(s.name!=="SyntaxError")throw s}return(e||JSON.stringify)(i)}const ui={transitional:sr,adapter:["xhr","http"],transformRequest:[function(t,e){const s=e.getContentType()||"",n=s.indexOf("application/json")>-1,r=D.isObject(t);if(r&&D.isHTMLForm(t)&&(t=new FormData(t)),D.isFormData(t))return n&&n?JSON.stringify(ir(t)):t;if(D.isArrayBuffer(t)||D.isBuffer(t)||D.isStream(t)||D.isFile(t)||D.isBlob(t))return t;if(D.isArrayBufferView(t))return t.buffer;if(D.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 ph(t,this.formSerializer).toString();if((o=D.isFileList(t))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return ds(o?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||n?(e.setContentType("application/json",!1),wh(t)):t}],transformResponse:[function(t){const e=this.transitional||ui.transitional,s=e&&e.forcedJSONParsing,n=this.responseType==="json";if(t&&D.isString(t)&&(s&&!this.responseType||n)){const a=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?X.from(o,X.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:Lt.classes.FormData,Blob:Lt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};D.forEach(["delete","get","head","post","put","patch"],i=>{ui.headers[i]={}});const fi=ui,xh=D.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"]),bh=i=>{const t={};let e,s,n;return i&&i.split(`
|
|
12
|
-
`).forEach(function(a){n=a.indexOf(":"),e=a.substring(0,n).trim().toLowerCase(),s=a.substring(n+1).trim(),!(!e||t[e]&&
|
|
13
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(n=>s.set(n)),s}static accessor(t){const s=(this[
|
|
14
|
-
`+r.map(
|
|
15
|
-
`):" "+hr(r[0]):"as no adapter specified";throw new X("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:pi};function gi(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new Le(null,i)}function lr(i){return gi(i),i.headers=Xt.from(i.headers),i.data=mi.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),cr.getAdapter(i.adapter||fi.adapter)(i).then(function(s){return gi(i),s.data=mi.call(i,i.transformResponse,s),s.headers=Xt.from(s.headers),s},function(s){return rr(s)||(gi(i),s&&s.response&&(s.response.data=mi.call(i,i.transformResponse,s.response),s.response.headers=Xt.from(s.response.headers))),Promise.reject(s)})}const ur=i=>i instanceof Xt?i.toJSON():i;function Se(i,t){t=t||{};const e={};function s(c,l,f){return D.isPlainObject(c)&&D.isPlainObject(l)?D.merge.call({caseless:f},c,l):D.isPlainObject(l)?D.merge({},l):D.isArray(l)?l.slice():l}function n(c,l,f){if(D.isUndefined(l)){if(!D.isUndefined(c))return s(void 0,c,f)}else return s(c,l,f)}function r(c,l){if(!D.isUndefined(l))return s(void 0,l)}function a(c,l){if(D.isUndefined(l)){if(!D.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function o(c,l,f){if(f in t)return s(c,l);if(f in i)return s(void 0,c)}const h={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(c,l)=>n(ur(c),ur(l),!0)};return D.forEach(Object.keys(Object.assign({},i,t)),function(l){const f=h[l]||n,y=f(i[l],t[l],l);D.isUndefined(y)&&f!==o||(e[l]=y)}),e}const fr="1.5.1",yi={};["object","boolean","number","function","string","symbol"].forEach((i,t)=>{yi[i]=function(s){return typeof s===i||"a"+(t<1?"n ":" ")+i}});const dr={};yi.transitional=function(t,e,s){function n(r,a){return"[Axios v"+fr+"] Transitional option '"+r+"'"+a+(s?". "+s:"")}return(r,a,o)=>{if(t===!1)throw new X(n(a," has been removed"+(e?" in "+e:"")),X.ERR_DEPRECATED);return e&&!dr[a]&&(dr[a]=!0,console.warn(n(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,a,o):!0}};function Lh(i,t,e){if(typeof i!="object")throw new X("options must be an object",X.ERR_BAD_OPTION_VALUE);const s=Object.keys(i);let n=s.length;for(;n-- >0;){const r=s[n],a=t[r];if(a){const o=i[r],h=o===void 0||a(o,r,i);if(h!==!0)throw new X("option "+r+" must be "+h,X.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new X("Unknown option "+r,X.ERR_BAD_OPTION)}}const wi={assertOptions:Lh,validators:yi},Zt=wi.validators;class gs{constructor(t){this.defaults=t,this.interceptors={request:new er,response:new er}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=Se(this.defaults,e);const{transitional:s,paramsSerializer:n,headers:r}=e;s!==void 0&&wi.assertOptions(s,{silentJSONParsing:Zt.transitional(Zt.boolean),forcedJSONParsing:Zt.transitional(Zt.boolean),clarifyTimeoutError:Zt.transitional(Zt.boolean)},!1),n!=null&&(D.isFunction(n)?e.paramsSerializer={serialize:n}:wi.assertOptions(n,{encode:Zt.function,serialize:Zt.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&D.merge(r.common,r[e.method]);r&&D.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),e.headers=Xt.concat(a,r);const o=[];let h=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(e)===!1||(h=h&&E.synchronous,o.unshift(E.fulfilled,E.rejected))});const c=[];this.interceptors.response.forEach(function(E){c.push(E.fulfilled,E.rejected)});let l,f=0,y;if(!h){const p=[lr.bind(this),void 0];for(p.unshift.apply(p,o),p.push.apply(p,c),y=p.length,l=Promise.resolve(e);f<y;)l=l.then(p[f++],p[f++]);return l}y=o.length;let b=e;for(f=0;f<y;){const p=o[f++],E=o[f++];try{b=p(b)}catch(_){E.call(this,_);break}}try{l=lr.call(this,b)}catch(p){return Promise.reject(p)}for(f=0,y=c.length;f<y;)l=l.then(c[f++],c[f++]);return l}getUri(t){t=Se(this.defaults,t);const e=ar(t.baseURL,t.url);return tr(e,t.params,t.paramsSerializer)}}D.forEach(["delete","get","head","options"],function(t){gs.prototype[t]=function(e,s){return this.request(Se(s||{},{method:t,url:e,data:(s||{}).data}))}}),D.forEach(["post","put","patch"],function(t){function e(s){return function(r,a,o){return this.request(Se(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}gs.prototype[t]=e(),gs.prototype[t+"Form"]=e(!0)});const ys=gs;class xi{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const s=this;this.promise.then(n=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](n);s._listeners=null}),this.promise.then=n=>{let r;const a=new Promise(o=>{s.subscribe(o),r=o}).then(n);return a.cancel=function(){s.unsubscribe(r)},a},t(function(r,a,o){s.reason||(s.reason=new Le(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 xi(function(n){t=n}),cancel:t}}}const Rh=xi;function Oh(i){return function(e){return i.apply(null,e)}}function Fh(i){return D.isObject(i)&&i.isAxiosError===!0}const bi={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(bi).forEach(([i,t])=>{bi[t]=i});const Nh=bi;function mr(i){const t=new ys(i),e=Bn(ys.prototype.request,t);return D.extend(e,ys.prototype,t,{allOwnKeys:!0}),D.extend(e,t,null,{allOwnKeys:!0}),e.create=function(n){return mr(Se(i,n))},e}const K=mr(fi);K.Axios=ys,K.CanceledError=Le,K.CancelToken=Rh,K.isCancel=rr,K.VERSION=fr,K.toFormData=ds,K.AxiosError=X,K.Cancel=K.CanceledError,K.all=function(t){return Promise.all(t)},K.spread=Oh,K.isAxiosError=Fh,K.mergeConfig=Se,K.AxiosHeaders=Xt,K.formToJSON=i=>ir(D.isHTMLForm(i)?new FormData(i):i),K.getAdapter=cr.getAdapter,K.HttpStatusCode=Nh,K.default=K;const Bh=K,pr=window.crypto.subtle;pr||console.warn("Crypto API not supported");async function gr(i,t="SHA-256"){const e=await pr.digest(t,oo(i));return ho(e)}async function yr(i,t="SHA-256"){const e=JSON.stringify(so(i));return gr(e,t)}class wr{instance;constructor(t){this.instance=Bh.create(t);const e=new xr;this.instance.interceptors.request.use(s=>(e.pendingRequest(s),s),s=>(e.cancelRequest(s.config),s)),t?.interceptor&&(this.instance.interceptors.request.use(t.interceptor.request,t.interceptor.requestError),this.instance.interceptors.response.use(t.interceptor.response,t.interceptor.responseError)),this.instance.interceptors.response.use(async s=>(await e.confirmRequest(s.config),s.data),async s=>{const{code:n="",config:r}=s;return!r||!r.retry||(r.retryCounted=r.retryCounted||0,r.retryCounted>=r.retry)?Promise.reject(s):(r.retryCounted++,await new Promise(a=>{setTimeout(a,r.retryDelay)}),await this.request(r))})}async request(t){return await this.instance.request(t)}async get(t,e){return this.request({...e,method:"get",url:t})}async delete(t,e){return this.request({...e,method:"delete",url:t})}async head(t,e){return this.request({...e,method:"head",url:t})}async options(t,e){return this.request({...e,method:"options",url:t})}async post(t,e,s){return this.request({...s,method:"post",url:t,data:e})}async postBlob(t,e,s){return s={...s,headers:{...s?.headers,"Content-Type":"multipart/form-data"}},this.request({...s,method:"post",url:t,data:e})}async postForm(t,e,s){return this.instance.postForm(t,e,{...s})}async put(t,e,s){return this.request({...s,method:"put",url:t,data:e})}async patch(t,e,s){return this.request({...s,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class xr{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}async getRequestId(t){const{url:e,method:s,params:n,data:r}=t;return await yr({url:e,method:s,params:n,data:r})}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(){const t=this.pendingRequestMap.values();for(const e of t)e.abort();this.pendingRequestMap.clear()}}const vi=i=>new XMLSerializer().serializeToString(i),Yh=(i,t="text/html")=>new DOMParser().parseFromString(i,t),br=(i,t=Mt.SVG,e=Ae.utf8)=>si(vi(i),t,e);function ws(i,t){const e=document.createElement("a");e.style.visibility="hidden",e.download=t,typeof i=="string"?e.href=i:e.href=window.URL.createObjectURL(i),e.click(),window.URL.revokeObjectURL(e.href)}async function vr(i=["*"],t){if(!document||!(document instanceof Document))throw new Error("This is not a browser environment");let e=[];const s=document.createElement("input");return s.setAttribute("type","file"),s.setAttribute("visibility","hidden"),s.setAttribute("accept",i.join(",")),t&&s.setAttribute("multiple","true"),s.addEventListener("click",n=>{s.value=""},!1),new Promise((n,r)=>{s.addEventListener("change",a=>{e=Array.from(a.target.files||[]),e.length===0?r(new Error("Cancel")):!i.includes("*")&&e.some(o=>!i.includes(`.${Sr(o)}`))?r(new Error(`Please select files in ${i} format`)):n(e)},!1),window.addEventListener("focus",()=>{setTimeout(()=>{e.length===0&&r(new Error("Cancel"))},1e3)},{once:!0}),s.click()}).then(n=>(s.remove(),n)).catch(n=>{throw s.remove(),n})}function xs(i,t=he.text,e){return new Promise((s,n)=>{const r=new FileReader;switch(r.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),r.addEventListener("load",a=>{s(r.result)}),r.addEventListener("error",a=>{n(a)}),t){case"dataURL":r.readAsDataURL(i);break;case"binaryString":r.readAsBinaryString(i);break;case"arrayBuffer":r.readAsArrayBuffer(i);break;case"text":default:r.readAsText(i)}})}async function Uh(i){const t=await xs(i,he.arrayBuffer);return Dn(t)}const Sr=i=>{let t;return i instanceof File?t=i.name:t=i,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function Cr(i,t,e,s,n,r,a){const o=new FileReader;o.addEventListener("load",h=>{if(!h.target||!h.target.result)return t(h);if(e.append(h.target.result),a<s.size)Cr(i,t,e,s,n,a,Math.min(a+n,s.size));else return i(e.end())}),o.addEventListener("error",h=>t(h)),o.readAsArrayBuffer(s.slice(r,a))}async function Tr(i,t=1*1024*1024){return await new Promise((e,s)=>Cr(e,s,new Po.ArrayBuffer,i,t,0,Math.min(t,i.size)))}class Xh{axios;checkURL;uploadURL;file;fileHash;chunkSize;chunks;currentChunk=0;isUploading=!1;begin=0;end=0;timer;timeData=[0,0,0,0,0,0];onExist;onStart;onProgress;onComplete;onTime;constructor(t){this.axios=new wr({baseURL:t.baseURL,interceptor:{request:e=>e,response:e=>(e.config.url==this.uploadURL&&e.status==200&&(this.onProgress?.(this.currentChunk++,this.chunks),this.end==this.file.size?(this.isUploading=!1,this.stopTimeCount(),this.onComplete?.()):this.isUploading&&this.uploadChunk()),e)}}),this.checkURL=t.checkURL,this.uploadURL=t.uploadURL,this.file=t.file,this.chunkSize=t.chunkSize||1*1024*1024,this.chunks=Math.ceil(this.file.size/this.chunkSize),this.onExist=t.onExist,this.onStart=t.onStart,this.onProgress=t.onProgress,this.onComplete=t.onComplete,this.onTime=t.onTime}async start(){this.fileHash||(this.fileHash=await Tr(this.file,this.chunkSize)),(await this.axios.post(this.checkURL,{fileName:this.file.name,fileHash:this.fileHash})).isExist?(this.isUploading=!1,this.onExist?.()):this.isUploading||(this.onStart?.(),this.startTimeCount(),await this.uploadChunk())}pause(){this.isUploading&&(this.isUploading=!1,this.stopTimeCount())}async uploadChunk(){this.isUploading=!0,this.begin=this.currentChunk*this.chunkSize,this.end=Math.min(this.begin+this.chunkSize,this.file.size);const t=this.file.slice(this.begin,this.end),e=new FormData;e.append("fileData",t),e.append("fileName",this.file.name),e.append("fileHash",this.fileHash),e.append("chunkIndex",String(this.currentChunk)),e.append("chunks",String(this.chunks)),await this.axios.postBlob(this.uploadURL,e)}startTimeCount(){this.stopTimeCount(),this.timer=setInterval(()=>{fo(this.timeData,1),this.onTime?.(mo(this.timeData))},1e3)}stopTimeCount(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}}function Pr(i,t){const e=ni(t||"");if(!t)try{let s=window.localStorage.getItem(i);s&&(s=JSON.parse(s),e.value=s?s.value:"")}catch{}return gt(()=>{e.value&&window.localStorage.setItem(i,JSON.stringify(e))}),e}function Vh(i,t){const e=ni(t?.value||"");if(!e.value){const s=`; ${document.cookie}`.split(`; ${i}=`).pop()?.split(";").shift();s&&(e.value=decodeURIComponent(s))}return gt(()=>{if(e.value&&t?.days){const s="; expires="+new Date(Date.now()+t.days*864e5).toUTCString(),n=t?.domain?"; domain="+t?.domain:"",r=t?.path?"; path="+t?.path:"",a=t?.secure==!0?"; secure":"";document.cookie=i+"="+encodeURIComponent(e.value)+s+n+r+a}}),e}function Gh(){const i=document.cookie.split("; ");for(let t=0;t<i.length;t++){const e=window.location.hostname.split(".");for(;e.length>0;){const s=encodeURIComponent(i[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+e.join(".")+" ;path=",n=location.pathname.split("/");for(document.cookie=s+"/";n.length>0;)document.cookie=s+n.join("/"),n.pop();e.shift()}}}const yt=(i,t,e)=>{const s=async n=>{await e(n)};return i.addEventListener(t,s,!1),()=>{i.removeEventListener(t,s,!1)}},zh=["click","dblclick","wheel","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"],Hh=["keydown","keyup","keypress"],qh=["touchstart","touchend","touchcancel","touchmove"],jh=["pointerdown","pointerup","pointercancel","pointermove"],$h=["dragstart","dragend","dragenter","dragover","drop"],Wh=["change"];function Jh(i,t,e={bubbles:!0,detail:{}}){let s;zh.includes(t)?s=new MouseEvent(t,e):Hh.includes(t)?s=new KeyboardEvent(t,e):qh.includes(t)?s=new TouchEvent(t,e):jh.includes(t)?s=new PointerEvent(t,e):$h.includes(t)?s=new DragEvent(t,e):Wh.includes(t)?s=new Event(t,e):s=new CustomEvent(t,e),Er(i,s)}function Er(i,t){i.dispatchEvent(t)}function Zh(i,t){const e=i.changedTouches[0];return new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null})}function bs(){const i=new rs;return{on:(t,e)=>{i.on(t,e)},off:(t,e)=>{i.off(t,e)},emit:(t,...e)=>{i.emit(t,...e)}}}function _r(i="(prefers-color-scheme: dark)"){const t=window.matchMedia(i),e=ni(t.matches);return yt(t,"change",s=>{e.value=s.matches}),e}const Kt=Pr("__theme__");if(!Kt.value){const i=_r("(prefers-color-scheme: dark)");Kt.value=i.value?"dark":"light"}const Ar=()=>{switch(Kt.value){case"dark":document.documentElement.classList.add("dark");break;default:document.documentElement.classList.remove("dark");break}};gt(()=>{Ar()}),setTimeout(Ar);function Kh(i){return i&&(Kt.value=i),Kt}function Qh(){return Kt.value=Kt.value=="light"?"dark":"light",Kt}const z=bs();let Dr="";new MutationObserver(i=>{location.href!==Dr&&(Dr=location.href,z.emit("urlchange",location.href))}).observe(document,{attributes:!0,childList:!0,subtree:!0}),yt(window,"hashchange",()=>{z.emit("hashchange",location.hash)}),yt(window,"popstate",()=>{z.emit("popstate")}),yt(window,"beforeunload",i=>{z.emit("beforeunload",i)}),yt(window,"pagehide",i=>{z.emit("pagehide",i)}),yt(window,"focus",i=>{z.emit("focus",i)}),yt(window,"blur",i=>{z.emit("blur",i)}),yt(window,"visibilitychange",i=>{document.hidden?z.emit("hidden",i):z.emit("visible",i)});function tc(){return{onurlchange:i=>{z.on("urlchange",i)},offurlchange:i=>{z.off("urlchange",i)},onhashchange:i=>{z.on("hashchange",i)},offhashchange:i=>{z.off("hashchange",i)},onpopstate:i=>{z.on("popstate",i)},offpopstate:i=>{z.off("popstate",i)},onbeforeunload:i=>{z.on("beforeunload",i)},offbeforeunload:i=>{z.off("beforeunload",i)},onpagehide:i=>{z.on("pagehide",i)},offpagehide:i=>{z.off("pagehide",i)},onfocus:i=>{z.on("focus",i)},offfocus:i=>{z.off("focus",i)},onblur:i=>{z.on("blur",i)},offblur:i=>{z.off("blur",i)},onvisibel:i=>{z.on("visible",i)},offvisible:i=>{z.off("visible",i)},onhidden:i=>{z.on("hidden",i)},offhidden:i=>{z.off("hidden",i)}}}const Si=bs();function ec(){return{remove:yt(document,"scroll",i=>{Si.emit("scroll",i)}),on:i=>{Si.on("scroll",i)},off:i=>{Si.off("scroll",i)}}}function sc(){return yt(document,"touchmove",i=>{i.preventDefault()})}async function Ci(i=he.text){const e=(await vr())[0],s=await xs(e,i);return{type:e.type,name:e.name,size:e.size,data:s}}const vs=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return/mac/i.test(i)?t="macOS":/win/i.test(i)?t="Windows":/android/i.test(i)?t="Android":/iphone|ipad|ipod/i.test(i)?t="iOS":/linux/i.test(i)?t="Linux":/bsd/i.test(i)&&(t="BSD"),t.toLowerCase()},ic=()=>{const i=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(i)){const e=i.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(i)){const e=i.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(i)){const e=i.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(i)){const e=i.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},Ti=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(i)||/opera/i.test(i)?t="Opera":/chrome/i.test(i)?t="Chrome":/firefox/i.test(i)?t="Firefox":/safari/i.test(i)?t="Safari":/edge/i.test(i)?t="Edge":/msie|trident/i.test(i)?t="IE":/MicroMessenger/i.test(i)?t="Wechat":/alipay/i.test(i)&&(t="Ali"),t.toLowerCase()},nc=()=>{const i=navigator.userAgent;let t="Unknown";if(/Chrome/.test(i)){const e=i.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(i)){const e=i.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(i)){const e=i.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(i)){const e=i.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(i)){const e=i.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t},rc=()=>"geolocation"in navigator?new Promise((i,t)=>{navigator.geolocation.getCurrentPosition(e=>{const s=e.coords.latitude,n=e.coords.longitude;i({latitude:s,longitude:n})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function ac(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function oc(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Pi(){return vs()==="ios"}function Ei(){return vs()==="macos"}function hc(){return Pi()|Ei()}function Ir(){return vs()==="android"}function cc(){return Pi()||Ir()}function Mr(){const i=window.navigator.userAgent,t=i.indexOf("MSIE ");if(t>0)return parseInt(i.substring(t+5,i.indexOf(".",t)),10);if(i.indexOf("Trident/")>0){const n=i.indexOf("rv:");return parseInt(i.substring(n+3,i.indexOf(".",n)),10)}const s=i.indexOf("Edge/");return s>0?parseInt(i.substring(s+5,i.indexOf(".",s)),10):-1}const lc=Mr()!==-1;function uc(){const i=document.documentMode;return i&&(i===9||i===10)}function kr(){return Ti()==="wechat"}function Lr(){return Ti()==="ali"}function fc(){return kr()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function dc(){return Lr()&&navigator.userAgent.match(/miniprogram/i)}const mc=typeof document<"u",Rr=typeof window<"u",pc=typeof history<"u",gc=Rr&&window.File&&window.FileReader&&window.FileList&&window.Blob,Or=(()=>{const i=we();return!!(i.Worker&&i.Blob&&i.Promise&&i.OffscreenCanvas&&i.OffscreenCanvasRenderingContext2D&&i.HTMLCanvasElement&&i.HTMLCanvasElement.prototype.transferControlToOffscreen&&i.URL&&i.URL.createObjectURL)})(),yc=typeof Path2D=="function"&&typeof DOMMatrix=="function",Fr=function(){if(!we().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}(),wc=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},xc="webkit moz ms o".split(" ");function Ss(i){return typeof i=="function"&&/native code/.test(i.toString())}function bc(i,t){const e=t.ctrl||!1,s=t.shift||!1,n=t.alt||!1;return(e===i.metaKey||e===i.ctrlKey)&&s===i.shiftKey&&n===i.altKey&&t.keys.map(r=>r.toLowerCase()).includes(i.key.toLowerCase())}function vc(i){const t=[];return i.ctrl&&t.push(Ei()?"Cmd":"Ctrl"),i.shift&&t.push("Shift"),i.alt&&t.push("Alt"),t.push(...i.keys),t}function _i(i,t,e){const s=i.target||document||window;let n=!1,r=!1;const a=yt(s,"keydown",async h=>{r||(n=bc(h,i),n&&(h.stopPropagation(),h.preventDefault(),await t()))}),o=yt(s,"keyup",async h=>{r||n&&e&&(h.stopPropagation(),h.preventDefault(),await e())});return{hotKeys:vc(i),remove:()=>{a(),o()},pause:()=>r=!0,resume:()=>r=!1}}const Sc={BACKSPACE:8,TAB:9,COMMA:188,DELETE:46,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,UP:38,DOWN:40,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32};async function Cc(i={keys:["o"]},t=he.text){const e=Co(),s=_i(i,async()=>{try{e.resolve(await Ci(t))}catch(n){e.reject(n)}s.remove()},()=>{});return await e.promise}function Tc(i={keys:["o"]},t=he.text){const e=bs();return _i(i,async()=>{try{e.emit("file",await Ci(t))}catch{}},()=>{}),{on:s=>{e.on("file",s)},off:s=>{e.off("file",s)}}}function Pc(i){const t=window.URL.createObjectURL(i);return()=>{window.URL.revokeObjectURL(t)}}function Ec(i,t="下载文件",e,s){let n;i instanceof Blob?n=i:n=si(i,e,s),ws(n,t)}function _c(i){let t=!1;function e(){if(document.readyState!=="loading"){if(t){document.removeEventListener("DOMContentLoaded",e,!1);return}t=!0,document.removeEventListener("DOMContentLoaded",e,!1),i()}}document.addEventListener("DOMContentLoaded",e,!1),e()}function Ac(i,t,e){const s=document.createElement("script");s.type="text/javascript",s.src=i,s.async=!1,s.onload=t||as,s.onerror=e||as,document.body.appendChild(s)}function Dc(i,t,e){const s=document.createElement("link");s.type="text/css",s.rel="stylesheet",s.href=i,s.onload=t||as,s.onerror=e||as,document.getElementsByTagName("head")[0].appendChild(s)}function Ic(){return new Promise(i=>{const t=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let e=document.styleSheets.length||0;const s=()=>e>=t.length?(i(),!0):!1;s()||t.forEach(n=>{n.onload=()=>{e+=1,s()}})})}(function(){if(!window.requestAnimationFrame){let i=Q();window.requestAnimationFrame=function(t){const e=Q(),s=Math.max(0,16-(e-i)),n=window.setTimeout(function(){t(e+s)},s);return i=e+s,n}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(i){clearTimeout(i)})})();const Ai=i=>{let t=!1;return window.requestAnimationFrame(function e(s){!t&&i(s)&&window.requestAnimationFrame(e)}),()=>{t=!0}};function Di(i,t=0){if(t==0)return i(Q()),()=>{};{const e=Q();return Ai(s=>s-e>=t?(i(s),!1):!0)}}function Mc(i,t=0){let e=!1,s=0;const n=Q(),r=a=>{if(e)return;s++;const o=a-n-s*t;i(a,s,t<=o),Di(r,Math.max(0,t-o))};return Di(r,t),()=>{e=!0}}function kc(i,t=20){const e=1e3/t;let s=0,n;return()=>(Q()-s>=e&&(s=Q(),n=i()),n)}const Qt=new On;let Ii=!1;function Nr(i,t,e){i&&t&&Qt.set(i,t),!Ii&&(Ii=!0,requestIdleCallback(s=>{for(Ii=!1;s.timeRemaining()>0&&Qt.length>0;){const n=Qt.shift();n&&n[1]()}Qt.length>0&&Nr()},{timeout:e}))}let Mi=!1;function ki(i,t,e){if(i&&t&&Qt.set(i,t),Mi)return;Mi=!0;const s=Q();Rc(n=>{for(Mi=!1;(n.timeRemaining()>0||e&&Q()-s>=e)&&Qt.length>0;){const r=Qt.shift();r&&r[1]()}Qt.length>0&&ki()})}let Cs=0,ce=33,te=33,Li;const Br=new MessageChannel,Lc=Br.port2;Br.port1.onmessage=i=>{Li!==null&&Li({didTimeout:Cs<=Q(),timeRemaining:()=>Math.max(0,Cs-Q())})};function Rc(i){return Li=i,requestAnimationFrame(t=>{let e=t-Cs+te;e<te&&ce<te?(e<8&&(e=8),te=e<ce?ce:e):e>te&&ce>te?te=e<ce?ce:e:ce=e,Cs=t+te,Lc.postMessage(null)})}function Oc(i){if(typeof setImmediate<"u"&&Ss(setImmediate))setImmediate(i);else if(typeof MessageChannel<"u"&&(Ss(MessageChannel)||MessageChannel.toString()==="[object MessageChannelConstructor]")){const{port1:t,port2:e}=new MessageChannel;e.onmessage=i,t.postMessage(null)}else typeof Promise<"u"&&Ss(Promise)?Promise.resolve().then(i):setTimeout(i,0)}function Fc(i){typeof queueMicrotask=="function"?queueMicrotask(i):Promise.resolve().then(i).catch(t=>setTimeout(()=>{throw t}))}class Re{static _nextId=0;static nextId(){return Re._nextId++}}const R={Linear:{None:function(i){return i}},Ease:{In:function(i){return Math.pow(i,1.7)}},Quadratic:{In:function(i){return i*i},Out:function(i){return i*(2-i)},InOut:function(i){return(i*=2)<1?.5*i*i:-.5*(--i*(i-2)-1)}},Cubic:{In:function(i){return i*i*i},Out:function(i){return--i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i:.5*((i-=2)*i*i+2)}},Quartic:{In:function(i){return i*i*i*i},Out:function(i){return 1- --i*i*i*i},InOut:function(i){return(i*=2)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2)}},Quintic:{In:function(i){return i*i*i*i*i},Out:function(i){return--i*i*i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2)}},Sinusoidal:{In:function(i){return 1-Math.sin((1-i)*Math.PI/2)},Out:function(i){return Math.sin(i*Math.PI/2)},InOut:function(i){return .5*(1-Math.sin(Math.PI*(.5-i)))}},Exponential:{In:function(i){return i===0?0:Math.pow(1024,i-1)},Out:function(i){return i===1?1:1-Math.pow(2,-10*i)},InOut:function(i){return i===0?0:i===1?1:(i*=2)<1?.5*Math.pow(1024,i-1):.5*(-Math.pow(2,-10*(i-1))+2)}},Circular:{In:function(i){return 1-Math.sqrt(1-i*i)},Out:function(i){return Math.sqrt(1- --i*i)},InOut:function(i){return(i*=2)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1)}},Elastic:{In:function(i){return i===0?0:i===1?1:-Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI)},Out:function(i){return i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i-.1)*5*Math.PI)+1},InOut:function(i){return i===0?0:i===1?1:(i*=2,i<1?-.5*Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI):.5*Math.pow(2,-10*(i-1))*Math.sin((i-1.1)*5*Math.PI)+1)}},Back:{In:function(i){return i===1?1:i*i*((1.70158+1)*i-1.70158)},Out:function(i){return i===0?0:--i*i*((1.70158+1)*i+1.70158)+1},InOut:function(i){const t=2.5949095;return(i*=2)<1?.5*(i*i*((t+1)*i-t)):.5*((i-=2)*i*((t+1)*i+t)+2)}},Bounce:{In:function(i){return 1-R.Bounce.Out(1-i)},Out:function(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},InOut:function(i){return i<.5?R.Bounce.In(i*2)*.5:R.Bounce.Out(i*2-1)*.5+.5}},generatePow:function(i=4){return i=i<Number.EPSILON?Number.EPSILON:i,i=i>1e4?1e4:i,{In:function(t){return t**i},Out:function(t){return 1-(1-t)**i},InOut:function(t){return t<.5?(t*2)**i/2:(1-(2-t*2)**i)/2+.5}}},random:function(i){return Math.random()},createStep:function(i){return function(t){return Math.floor(t*i)/i}},createNoisyEasing:function(i,t=.1){const e=1-t;return function(s){return t*Math.random()+e*i(s)}},swing:function(i){return i+Math.sin(i*Math.PI*2)/2},causeSeizures:function(i){return i+.2*Math.random()-.1}};function Yr(i){switch(i){case R.Quadratic.In:return R.Quadratic.Out;case R.Quadratic.Out:return R.Quadratic.In;case R.Quadratic.InOut:return R.Quadratic.InOut;case R.Cubic.In:return R.Cubic.Out;case R.Cubic.Out:return R.Cubic.In;case R.Cubic.InOut:return R.Cubic.InOut;case R.Quartic.In:return R.Quartic.Out;case R.Quartic.Out:return R.Quartic.In;case R.Quartic.InOut:return R.Quartic.InOut;case R.Quintic.In:return R.Quintic.Out;case R.Quintic.Out:return R.Quintic.In;case R.Quintic.InOut:return R.Quintic.InOut;case R.Sinusoidal.In:return R.Sinusoidal.Out;case R.Sinusoidal.Out:return R.Sinusoidal.In;case R.Sinusoidal.InOut:return R.Sinusoidal.InOut;case R.Exponential.In:return R.Exponential.Out;case R.Exponential.Out:return R.Exponential.In;case R.Exponential.InOut:return R.Exponential.InOut;case R.Circular.In:return R.Circular.Out;case R.Circular.Out:return R.Circular.In;case R.Circular.InOut:return R.Circular.InOut;case R.Elastic.In:return R.Elastic.Out;case R.Elastic.Out:return R.Elastic.In;case R.Elastic.InOut:return R.Elastic.InOut;case R.Back.In:return R.Back.Out;case R.Back.Out:return R.Back.In;case R.Back.InOut:return R.Back.InOut;case R.Bounce.In:return R.Bounce.Out;case R.Bounce.Out:return R.Bounce.In;case R.Bounce.InOut:return R.Bounce.InOut;default:return i}}const Nc=4,Bc=.001,Yc=1e-7,Uc=10,Oe=11,Ts=1/(Oe-1),Xc=typeof Float32Array=="function";function Ur(i,t){return 1-3*t+3*i}function Xr(i,t){return 3*t-6*i}function Vr(i){return 3*i}function Ps(i,t,e){return((Ur(t,e)*i+Xr(t,e))*i+Vr(t))*i}function Gr(i,t,e){return 3*Ur(t,e)*i*i+2*Xr(t,e)*i+Vr(t)}function Vc(i,t,e,s,n){let r,a,o=0;do a=t+(e-t)/2,r=Ps(a,s,n)-i,r>0?e=a:t=a;while(Math.abs(r)>Yc&&++o<Uc);return a}function Gc(i,t,e,s){for(let n=0;n<Nc;++n){const r=Gr(t,e,s);if(r===0)return t;const a=Ps(t,e,s)-i;t-=a/r}return t}function zc(i){return i}function Ri(i,t,e,s){if(!(0<=i&&i<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(i===t&&e===s)return zc;const n=Xc?new Float32Array(Oe):new Array(Oe);for(let a=0;a<Oe;++a)n[a]=Ps(a*Ts,i,e);function r(a){let o=0,h=1;const c=Oe-1;for(;h!==c&&n[h]<=a;++h)o+=Ts;--h;const l=(a-n[h])/(n[h+1]-n[h]),f=o+l*Ts,y=Gr(f,i,e);return y>=Bc?Gc(a,f,i,e):y===0?f:Vc(a,o,o+Ts,i,e)}return a=>a===0||a===1?a:Ps(r(a),t,s)}function Oi(i){switch(i){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}function zr(i){const[t,e,s,n]=Oi(i);return[1-s,1-n,1-t,1-e]}function Hc(i){return Ri(...Oi(i))}function qc(i){return Ri(...zr(i))}const Vt={Utils:{Linear:function(i,t,e){return(t-i)*e+i},Factorial:function(){const i=[1];return function(t){let e=1;if(i[t])return i[t];for(let s=t;s>1;s--)e*=s;return i[t]=e,e}}(),Bernstein:function(i,t){const e=Vt.Utils.Factorial;return e(i)/e(t)/e(i-t)},CatmullRom:function(i,t,e,s,n){const r=(e-i)*.5,a=(s-t)*.5,o=n*n,h=n*o;return(2*t-2*e+r+a)*h+(-3*t+3*e-2*r-a)*o+r*n+t},QuadraticBezier:(i,t,e,s)=>{const n=1-s;return n*n*i+2*n*s*t+s*s*e},CubicBezier:(i,t,e,s,n)=>{const r=1-n;return r*r*r*i+3*r*r*n*t+3*r*n*n*e+n*n*n*s}},Linear:function(i,t){const e=i.length-1,s=e*t,n=Math.floor(s),r=Vt.Utils.Linear;return t<0?r(i[0],i[1],s):t>1?r(i[e],i[e-1],e-s):r(i[n],i[n+1>e?e:n+1],s-n)},Bezier:function(i,t){let e=0;const s=i.length-1,n=Math.pow,r=Vt.Utils.Bernstein;for(let a=0;a<=s;a++)e+=n(1-t,s-a)*n(t,a)*i[a]*r(s,a);return e},CatmullRom:function(i,t){const e=i.length-1;let s=e*t,n=Math.floor(s);const r=Vt.Utils.CatmullRom;return i[0]===i[e]?(t<0&&(n=Math.floor(s=e*(1+t))),r(i[(n-1+e)%e],i[n],i[(n+1)%e],i[(n+2)%e],s-n)):t<0?i[0]-(r(i[0],i[0],i[1],i[1],-s)-i[0]):t>1?i[e]-(r(i[e],i[e],i[e-1],i[e-1],s-e)-i[e]):r(i[n?n-1:0],i[n],i[e<n+1?e:n+1],i[e<n+2?e:n+2],s-n)}};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=Q(),e=!1){const s=Object.keys(this._tweens);for(let n=0;n<s.length;n++){const r=this._tweens[s[n]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[s[n]]}return!!Object.keys(this._tweens).length}}const St=new Hr;class Fi{constructor(t,e=St){this._object=t,this._group=e}_id=Re.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=R.Linear.None;_interpolationFunction=Vt.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=Q()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,s,n){for(const r in s){const a=t[r],o=Array.isArray(a),h=o?"array":typeof a,c=!o&&Array.isArray(s[r]);if(!(h==="undefined"||h==="function")){if(c){let l=s[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,a)),s[r]=[a].concat(l)}if((h==="object"||o)&&a&&!c){e[r]=o?[]:{};for(const l in a)e[r][l]=a[l];n[r]=o?[]:{},this._setupProperties(a,e[r],s[r],n[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),c?n[r]=s[r].slice().reverse():n[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=Q()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=Q()){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=St){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=R.Linear.None){return this._easingFunction=t,this}interpolation(t=Vt.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=Q(),e=!0){if(this._isPaused)return!0;let s,n;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),n=(t-this._startTime)/this._durationTime,n=this._durationTime===0||n>1?1:n;const a=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),n===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let o=0,h=this._chainedTweens.length;o<h;o++)this._chainedTweens[o].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,s,n){for(const r in s){if(e[r]===void 0)continue;const a=e[r]||0;let o=s[r];const h=Array.isArray(t[r]),c=Array.isArray(o);!h&&c?t[r]=this._interpolationFunction(o,n):typeof o=="object"&&o?this._updateProperties(t[r],a,o,n):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[r]=a+(o-a)*n))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],s=this._valuesEnd[t];typeof s=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(s):this._valuesStartRepeat[t]=s,this._valuesEnd[t]=e}}const jc=Re.nextId,$c=St.getAll.bind(St),Wc=St.removeAll.bind(St),Jc=St.add.bind(St),Zc=St.remove.bind(St),Kc=St.update.bind(St),Qc={now:Q,Sequence:Re,Easing:R,Interpolation:Vt,Group:Hr,Tween:Fi,nextId:jc,getAll:$c,removeAll:Wc,add:Jc,remove:Zc,update:Kc};class Ni{autoStart;startTime;oldTime;elapsedTime;running;constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Q(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=Q();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class Es{tweens=[];frameDuration;onGroupStart;onGroupComplete;constructor(t){this.frameDuration=t?.frameDuration||1e3,this.onGroupStart=t?.onGroupStart,this.onGroupComplete=t?.onGroupComplete}get count(){return this.tweens.length}clear(){this.tweens=[]}sort(t=!1){So(this.tweens,(e,s)=>t?e.delay>s.delay:e.delay<=s.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(s=>{const n={...s};delete n.tween,n.fromValues={...n.fromValues},n.toValues={...n.toValues},e.push(n)}),e}addTween(t,e,s){const n={fromValues:t,toValues:e,frames:typeof s?.frames=="number"?s.frames:1,delay:typeof s?.delay=="number"?s.delay:this.tweens.length,easeFunction:s?.easeFunction||R.Linear.None,interpolationFunction:s?.interpolationFunction||Vt.Linear,repeat:typeof s?.repeat=="number"?s.repeat:0,yoyo:s?.yoyo||!1,onStart:s?.onStart||(()=>{}),onUpdate:s?.onUpdate||(()=>{}),onComplete:s?.onComplete||(()=>{})};return this.tweens.push(n),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new Ni,s=this.frameDuration;return new Promise(n=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=Ai(r=>{if(!this.isPaused){const o=Math.max(0,r-this.pausedDuration),h=Math.max(0,e.getElapsedTime()-this.pausedDuration);t.filter(c=>c.delay*s<=h).forEach(c=>{c.tween||(c.tween=new Fi({...c.fromValues}).to({...c.toValues},c.frames*s).easing(c.easeFunction).interpolation(c.interpolationFunction).repeat(c.repeat).yoyo(c.yoyo).onStart(c.onStart).onUpdate(c.onUpdate).onComplete(c.onComplete),c.tween.start(o)),(c.delay+c.frames*(c.repeat+1))*s>h?c.tween.update(o):(c.tween.isPlaying()&&c.tween.end(),xe(t,c))})}const a=!!t.length;return a||(this.onGroupComplete?.(),n()),a})})}isPaused=!1;pausedClock=new Ni;pausedDuration=0;play(t=this.cloneTweens(this.tweens)){this.isPaused=!1,this.pausedDuration=0,this.runTweens(t)}reverse(){const t=this.cloneTweens(this.tweens);let e=0;t.forEach(s=>{e=Math.max(e,s.delay+s.frames),s.easeFunction=Yr(s.easeFunction);const n={...s.toValues};s.toValues={...s.fromValues},s.fromValues={...n}}),t.forEach(s=>{s.delay=e-s.frames}),this.play(t)}pause(){this.pausedClock.start(),this.isPaused=!0}resume(){this.pausedDuration+=this.pausedClock.getElapsedTime(),this.pausedClock.stop(),this.isPaused=!1}}const _s=new On,qr=(i=!0)=>{_s.filter((t,e)=>(e.alternate&&(Is(e,e.alternate),i&&_s.set(t,e.alternate),e.alternate=void 0),i))};function Bi(i){let t=_s.get(i);return t||(t=Ds(i),_s.set(i,t)),t}function jr(i){const t=Bi(i);return t.alternate||(t.alternate=Ds(i)),t.alternate}function Yi(i,t,e=!0){t(jr(i)),ki("FLUSH_DOM_ACTION",()=>qr(e),50)}function tl(i,t,e=!0){t(jr(i)),qr(e)}function ee(i,t,e){const s=Bi(i);return t?s.props.style[t]||s.props.style[is(t)]||s.props.style[ot(t)]:s.props.style}function Ui(i,t,e){Yi(i,s=>{typeof t=="string"&&e?s.props.style[t]=e:t instanceof Object&&Object.keys(t).forEach(n=>{s.props.style[n]=t[n]})},!0)}function Xi(i){const t=[];if(getComputedStyle){const e=getComputedStyle(i);for(let s=0,n=e.length;s<n;s++)t.push(e[s]+":"+e.getPropertyValue(e[s]))}else{const e=i.currentStyle;for(const s in e)t.push(s+":"+e[s])}return t.push(...(i.style.cssText||"").split(";")),Object.fromEntries(t.filter(e=>!!e).map(e=>e.split(":").map((s,n)=>n==0?is(s).trim():s.trim())))}function el(i,t,e){if(getComputedStyle){t=ot(t);const s=getComputedStyle(i,e),n=s.getPropertyPriority(t);return s.getPropertyValue(t).trim()+(n?"!"+n:"")}else return i.currentStyle[is(t)]}function As(i,t,e){typeof t=="string"&&e?i.style.setProperty(ot(t),e.replace(/!important/i,""),String(e).toLowerCase().includes("!important")?"important":""):t instanceof Object&&Object.keys(t).forEach(s=>{As(i,s,t[s])})}function Vi(i,t){typeof t=="string"?i.style.removeProperty(ot(t)):Object.keys(t).forEach(e=>{Vi(i,e)})}function sl(i,t){let e;if(typeof t=="string"){const n=document.querySelector(t)?.shadowRoot;n?e=n:e=document.querySelector(t)}else e=t||document.getElementsByTagName("head")[0];const s=document.createElement("style");if(s.innerHTML=i,e)return e.appendChild(s),()=>{(e instanceof HTMLElement||e instanceof ShadowRoot)&&e.removeChild(s)};{const n=document.styleSheets[0].insertRule(i);return()=>{document.styleSheets[0].deleteRule(n)}}}function le(i,t,e){if(t===void 0&&e===void 0)return Gi(i);if(typeof t=="string"&&e===void 0)return $r(i,t);let s={};typeof t=="object"?s=t:typeof t=="string"&&typeof e=="string"&&(s[t]=e),Yi(i,n=>{Object.entries(s).forEach(([r,a])=>{n.props[r]=a})})}function Gi(i){const t={};for(let e=0,s=i.attributes,n=s.length;e<n;e++){const r=s[e];r.nodeName&&r.nodeValue&&(r.nodeName==="style"?t[r.nodeName]=Xi(i):t[r.nodeName]=r.nodeValue)}return t}function $r(i,t){return t==="style"?Xi(i):i.getAttribute(ot(t))}function il(i,t){t.split(/[,\s]+/).forEach(e=>{e.trim()!=""&&i.removeAttribute(e.trim())})}function nl(i,t,e){if(typeof t=="string"&&(t=is(t)),(typeof t=="string"||t===void 0)&&e===void 0){const s=Object.assign({},i.dataset);return Object.keys(s).forEach(n=>{if(s[n]?.startsWith("[")||s[n]?.startsWith("{"))try{s[n]=JSON.parse(s[n]||"")}catch{}}),typeof t=="string"?s[t]:s}else{let s={};typeof t=="object"?s=t:typeof t=="string"&&(s[t]=e),Object.entries(s).forEach(([n,r])=>{r?i.dataset[n]=r instanceof Object?JSON.stringify(r):r:delete i.dataset[n]})}}function rl(i,t){t.split(/[,\s]+/).forEach(e=>{e.trim()!=""&&delete i.dataset[e.trim()]})}async function al(i){if(navigator.clipboard)return await navigator.clipboard.writeText(i);{const t=document.createElement("textarea");return t.value=i,t.style.opacity="0",t.style.position="fixed",t.style.top="0",t.style.left="0",t.focus(),t.select(),document.execCommand("copy")}}function ol(i){const t=new Proxy(window,{get(e,s,n){if(typeof s=="string"&&["open","location","document"].includes(s))throw new Error(`禁止访问 key: ${s}`);return s==="window"?t:Reflect.get(e,s,n)},set(e,s,n,r){return Reflect.set(e,s,n,r)}});new Function("window",`with(window) { ${i} }`)(t,null)}function ue(i,t={},e=[],s){return{tag:i,props:t,children:e,el:s}}function Ds(i){return ue(i.tagName,Gi(i),Array.from(i.children).map(t=>Ds(t)),i)}function Ce(i,t=document.documentElement){if(i.el)return i.el;if(i.el=document.createElement(i.tag),i.props)for(const e in i.props){const s=i.props[e];e.startsWith("on")?i.el.addEventListener(e.slice(2).toLowerCase(),s):e==="style"?As(i.el,i.props[e]):i.el.setAttribute(ot(e),s)}return i.children&&(typeof i.children=="string"?i.el.appendChild(document.createTextNode(i.children)):i.children.forEach(e=>{Ce(e,i.el)})),t.appendChild(i.el),i.el}function Is(i,t){if(!i.el)return;if(i.tag!==t.tag){(i.el.parentElement||document.body).replaceChild(Ce(t),i.el);return}const e=t.el=i.el,s=i.props,n=t.props;for(const o in s)o in n||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),s[o]):e.removeAttribute(o));for(const o in n){const h=s[o],c=n[o];if(c!=h)if(o.startsWith("on")){const l=o.slice(2).toLowerCase();e.removeEventListener(l,h),e.addEventListener(l,c)}else if(o==="style"){for(const l in h)l in c||Vi(e,l);As(e,c)}else e.setAttribute(ot(o),c)}const r=i.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof r=="string")e.innerHTML="",a.forEach(o=>{Ce(o,e)});else{const o=Math.min(r.length,a.length);for(let h=0;h<o;h++)Is(r[h],a[h]);a.length>r.length&&a.slice(r.length).forEach(h=>{Ce(h,e)}),a.length<r.length&&r.slice(a.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}function N(i){return i*Math.PI/180}function nt(i){return i*180/Math.PI}function Ms(i,t,e=0){return Math.sqrt(i*i+t*t+e*e)}function ks(i,t,e,s){return Ms(e-i,s-t)}function Ls(i,t,e,s){const n=e-i,r=s-t;return n*n+r*r}function se(i,t,e,s){let n=Math.atan2(s-t,e-i);return n<0&&(n+=Math.PI*2),n}function Rt(i,t){return{dx:Math.cos(i)*t,dy:Math.sin(i)*t}}function hl(i,t,e){if(typeof e=="number"){const s=Math.sqrt(Math.pow(i,2)+Math.pow(t,2)+Math.pow(e,2));return{x:i/=s,y:t/=s,z:e/=s}}else{const s=Math.sqrt(Math.pow(i,2)+Math.pow(t,2));return{x:i/=s,y:t/=s}}}function cl(i,t,e,s,n=10){if(Math.abs(e-i)<n&&Math.abs(s-t)<n)return"no";const r=nt(se(i,t,e,s));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":"right"}const Wr=ll("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 ll(i,t=10){const e={},s=i.split(",");for(let n=0;n<s.length;n+=2){const r="&"+s[n+1]+";",a=parseInt(s[n],t);e[r]="&#"+a+";"}return e["\\xa0"]=" ",e}function ht(i,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)i=i.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return i}function Rs(i){let t,e;if(!i)throw new Error("cannot create a random attribute name for an undefined object");const s="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=s[Math.floor(Math.random()*s.length)];while(i[t]);return t}function ul(i){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[i]||t.start}function fl(i){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[i]||t.alphabetic}const Fe={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 Os{__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",ht("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 zi{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Ne{__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(Fe);for(let e=0,s=t.length;e<s;e++){const n=t[e];this[n]=Fe[n].canvas}}__getStyleState(){const t={},e=Object.keys(Fe);for(let s=0,n=e.length;s<n;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,n=e.length;s<n;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const n=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(n.setAttribute("fill","none"),n.setAttribute("stroke","none"));for(let a=0;a<r.length;a++){const o=r[a];n.setAttribute(o,e[o])}return n}__applyStyleToCurrentElement(t){let e=this.__currentElement;const s=this.__currentElementsToStyle;s&&(e.setAttribute(t,""),e=s.element,s.children.forEach(r=>{r.setAttribute(t,"")}));const n=Object.keys(Fe);for(let r=0;r<n.length;r++){const a=Fe[n[r]],o=this[n[r]];if(a.apply){if(o instanceof zi){if(o.__ctx)for(;o.__ctx.__SVGdefs.childNodes.length;){const h=o.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(o.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(a.apply,ht("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof Os)e.setAttribute(a.apply,ht("url(#{id})",{id:o.__root.getAttribute("id")}));else if(a.apply.indexOf(t)!==-1&&a.svg!==o)if((a.svgAttr==="stroke"||a.svgAttr==="fill")&&o.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(o);if(c){e.setAttribute(a.svgAttr,ht("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const f=this.globalAlpha;f!=null&&(l*=f),e.setAttribute(a.svgAttr+"-opacity",""+l)}}else{let h=a.svgAttr;if(n[r]==="globalAlpha"&&(h=t+"-"+a.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,o)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const n=Object.keys(Wr);for(let r=0,a=n.length;r<a;r++){const o=n[r],h=Wr[o],c=new RegExp(o,"gi");c.test(e)&&(e=e.replace(c,h))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const n=this.__createElement("g");e.appendChild(n),this.__currentElement=n}let s=this.__currentElement.getAttribute("transform");s?s+=" ":s="",s+=t,this.__currentElement.setAttribute("transform",s)}scale(t,e){e===void 0&&(e=t),this.__addTransform(ht("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(ht("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(ht("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,n,r,a){this.__addTransform(ht("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,d:n,e:r,f:a}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(ht("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(ht("L {x} {y}",this.__currentPosition)):this.__addPathCommand(ht("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,n,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(ht("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:n,x:r,y:a}))}quadraticCurveTo(t,e,s,n){this.__currentPosition={x:s,y:n},this.__addPathCommand(ht("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,y:n}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,s,n,r){const a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(typeof a>"u"||typeof o>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(a===t&&o===e||t===s&&e===n||r===0){this.lineTo(t,e);return}const h=this.normalize([a-t,o-e]),c=this.normalize([s-t,n-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const l=h[0]*c[0]+h[1]*c[1],f=Math.acos(Math.abs(l)),y=this.normalize([h[0]+c[0],h[1]+c[1]]),b=r/Math.sin(f/2),p=t+b*y[0],E=e+b*y[1],_=[-h[1],h[0]],v=[c[1],-c[0]],x=function(P){const C=P[0];return P[1]>=0?Math.acos(C):-Math.acos(C)},w=x(_),g=x(v);this.lineTo(p+_[0]*r,E+_[1]*r),this.arc(p,E,r,w,g)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,s,n){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+n),this.lineTo(t,e+n),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,n){const r=this.__createElement("rect",{x:t,y:e,width:s,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,n){const r=this.__createElement("rect",{x:t,y:e,width:s,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],n=s.childNodes;for(let r=n.length-1;r>=0;r--)n[r]&&s.removeChild(n[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,n){if(t===0&&e===0&&s===this.width&&n===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:s,height:n,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,s,n){const r=this.__createElement("linearGradient",{id:Rs(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:n+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new Os(r,this)}createRadialGradient(t,e,s,n,r,a){const o=this.__createElement("radialGradient",{id:Rs(this.__ids),cx:n+"px",cy:r+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new Os(o,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),s={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(s.decoration="underline"),this.__fontHref&&(s.href=this.__fontHref),s}__wrapTextLink(t,e){if(t.href){const s=this.__createElement("a");return s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),s.appendChild(e),s}return e}__applyText(t,e,s,n){const r=this.__parseFont(),a=this.__closestGroupOrSvg(),o=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:s,"text-anchor":ul(this.textAlign),"dominant-baseline":fl(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(n),a.appendChild(this.__wrapTextLink(r,o))}fillText(t,e,s){this.__applyText(t,e,s,"fill")}strokeText(t,e,s){this.__applyText(t,e,s,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,s,n,r,a){if(n===r)return;n=n%(2*Math.PI),r=r%(2*Math.PI),n===r&&(r=(r+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+s*Math.cos(r),h=e+s*Math.sin(r),c=t+s*Math.cos(n),l=e+s*Math.sin(n),f=a?0:1;let y=0,b=r-n;b<0&&(b+=2*Math.PI),a?y=b>Math.PI?0:1:y=b>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(ht("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:y,sweepFlag:f,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=Rs(this.__ids),n=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",s),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",ht("url(#{id})",{id:s})),t.appendChild(n),this.__currentElement=n}drawImage(...t){let e=t[0],s,n,r,a,o=0,h=0,c,l,f,y,b,p,E,_;if(t.length===3)s=t[1],n=t[2],c=e.width,l=e.height,r=c,a=l;else if(t.length===5)s=t[1],n=t[2],r=t[3],a=t[4],c=e.width,l=e.height;else if(t.length===9)o=t[1],h=t[2],c=t[3],l=t[4],s=t[5],n=t[6],r=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const v=this.__closestGroupOrSvg();this.__currentElement;const x="translate("+s+", "+n+")";if(e instanceof Ne){if(f=e.getSvg().cloneNode(!0),f.childNodes&&f.childNodes.length>1){for(y=f.childNodes[0];y.childNodes.length;)_=y.childNodes[0].getAttribute("id"),this.__ids[_]=_,this.__SVGdefs.appendChild(y.childNodes[0]);if(b=f.childNodes[1],b){const w=b.getAttribute("transform");let g;w?g=w+" "+x:g=x,b.setAttribute("transform",g),v.appendChild(b)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",a),p.setAttribute("preserveAspectRatio","none"),(o||h||c!==e.width||l!==e.height)&&(E=this.__document.createElement("canvas"),E.width=r,E.height=a,E.getContext("2d")?.drawImage(e,o,h,c,l,0,0,r,a),e=E),p.setAttribute("transform",x),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),v.appendChild(p))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),n=Rs(this.__ids);let r;return s.setAttribute("id",n),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),s.appendChild(r),this.__SVGdefs.appendChild(s)):t instanceof Ne&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new zi(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class Fs{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,s,n=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),n&&(this.customContext=new Ne({canvas:this.canvas,width:e||this.canvas.width,height:s||this.canvas.height}))}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(this.customContext.globalAlpha=t)}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(this.customContext.fillStyle=t.gradientCustom))}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,s,n){return this.context.fillRect(t,e,s,n),this.customContext&&this.customContext.fillRect(t,e,s,n),this}fillText(t,e,s,n){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,s,n),this.customContext&&this.customContext.fillText(t,e,s),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,s,n){return this.context.strokeText(t,e,s,n),this.customContext&&this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,n){return this.context.strokeRect(t,e,s,n),this.customContext&&this.customContext.strokeRect(t,e,s,n),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,n=this.canvas.height){return this.context.clearRect(t,e,s,n),this.customContext&&this.customContext.clearRect(t,e,s,n),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext&&this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.currentPath2D=this.path2Ds.pop()||new Path2D,this}beginPath(){return this.context.beginPath(),this.customContext&&this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext&&this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const s=new Path2D;s.addPath(t,e),this.currentPath2D=s}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,s=0){return this.translate(e,s),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-s),this.changePath2D(),this}scale(t,e=t,s=0,n=0){return this.translate(s,n),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-s,-n),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,s,n,r,a){return this.context.arc(t,e,s,n,r,a),this.customContext&&this.customContext.arc(t,e,s,n,r,a?-1:1),this.currentPath2D.arc(t,e,s,n,r,a),this}arcTo(t,e,s,n,r){return this.context.arcTo(t,e,s,n,r),this.customContext&&this.customContext.arcTo(t,e,s,n,r),this.currentPath2D.arcTo(t,e,s,n,r),this}ellipse(t,e,s,n,r,a,o,h){return this.context.ellipse(t,e,s,n,r,a,o,h),this.currentPath2D.ellipse(t,e,s,n,r,a,o,h),this}quadraticCurveTo(t,e,s,n){return this.context.quadraticCurveTo(t,e,s,n),this.customContext&&this.customContext.quadraticCurveTo(t,e,s,n),this.currentPath2D.quadraticCurveTo(t,e,s,n),this}bezierCurveTo(t,e,s,n,r,a){return this.context.bezierCurveTo(t,e,s,n,r,a),this.customContext&&this.customContext.bezierCurveTo(t,e,s,n,r,a),this.currentPath2D.bezierCurveTo(t,e,s,n,r,a),this}rect(t,e,s,n){return this.context.rect(t,e,s,n),this.customContext&&this.customContext.rect(t,e,s,n),this.currentPath2D.rect(t,e,s,n),this}createLinearGradient(t,e,s,n,r){const a=this.context.createLinearGradient(t,e,s,n);return r&&Object.entries(r).forEach(([o,h])=>{a.addColorStop(parseFloat(o),h)}),a}createRadialGradient(t,e,s,n,r,a,o){const h=this.context.createRadialGradient(t,e,s,n,r,a);return o&&Object.entries(o).forEach(([c,l])=>{h.addColorStop(parseFloat(c),l)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const s=e[0],n=e[1];this.context.drawImage(t,s,n)}else if(e.length===4){const s=e[0],n=e[1],r=e[2],a=e[3];this.context.drawImage(t,s,n,r,a)}else if(e.length===8){const s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],h=e[5],c=e[6],l=e[7];this.context.drawImage(t,s,n,r,a,o,h,c,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,s=this.canvas.width,n=this.canvas.height,r){return this.context.getImageData(t,e,s,n,r)}putImageData(t,e=0,s=0){return this.context.putImageData(t,e,s)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}}class Ns{x;y;toX;toY;constructor(t){this.x=t?.x||0,this.y=t?.y||0,this.toX=t?.toX||0,this.toY=t?.toY||0}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(){const t=se(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),s=Math.min(this.y,this.toY),n=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:s,width:n-e,height:r-s}}else{const e=Math.sin(t),s=Math.cos(t),n=s*this.x-e*this.y,r=s*this.toX-e*this.toY,a=s*this.y+e*this.x,o=s*this.toY+e*this.toX;return{x:Math.min(n,r),y:Math.min(a,o),width:Math.max(n,r)-Math.min(n,r),height:Math.max(a,o)-Math.min(a,o)}}}interpolate(t){return{x:this.x+t*(this.toX-this.x),y:this.y+t*(this.toY-this.y)}}intersection(t){const e=this.x,s=this.y,n=t.toX,r=t.toY,a=this.toX-e,o=t.x-n;if(!a&&!o)return null;const h=(this.toY-s)/a,c=(t.y-r)/o;if(a){if(!o)return{x:n,y:h*(n-e)+s}}else return{x:e,y:c*(e-n)+r};const l=(-c*n+r+h*e-s)/(h-c),f=h*(l-e)+s;return isNaN(l)||isNaN(f)?null:{x:l,y:f}}}const Jr=Ns;class Hi extends Ns{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,this.toX=t.toX,this.toY=t.toY}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,s,n,r,a,o,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,s,n,r,a,o,h,!this.sweepFlag)}convert(t,e,s,n,r,a,o,h,c){const l=o/180*Math.PI,f=(t-s)/2,y=(e-n)/2,b=Math.cos(l)*f+Math.sin(l)*y,p=-Math.sin(l)*f+Math.cos(l)*y,E=b*b/(r*r)+p*p/(a*a);if(E>1){const Z=Math.sqrt(E);throw r=Z*r,a=Z*a,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${a}.`)}const _=Math.sqrt((r*r*a*a-r*r*p*p-a*a*b*b)/(r*r*p*p+a*a*b*b)),v=h!=c?1:-1,x=v*_*r*p/a,w=v*_*-a*b/r,g=(t+s)/2,P=(e+n)/2,C=Math.cos(l)*x-Math.sin(l)*w+g,B=Math.sin(l)*x+Math.cos(l)*w+P,q=(Z,at,Ct,pt)=>(Z*pt>=at*Ct?1:-1)*Math.acos((Z*Ct+at*pt)/(Math.sqrt(Z*Z+at*at)*Math.sqrt(Ct*Ct+pt*pt))),G=q(1,0,t-C,e-B)-l,J=q(t-C,e-B,s-C,n-B);return[C,B,r,a,l,G,G+J]}}class dl extends Ns{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["Q",t,e,this.toX,this.toY]]}else return[["Q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,s,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(){const t=[this.x,this.toX],e=[this.y,this.toY];let s,n,r,a;for(let c=0;c<2;++c)s=c==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,n=c==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,r=c==0?this.x:this.y,Math.abs(s)>1e-12&&(a=-n/(2*s),0<a&&a<1&&[t,e][c].push(s*a*a+n*a+r));const o={x:Math.min.apply(0,t),y:Math.min.apply(0,e)},h={x:Math.max.apply(0,t),y:Math.max.apply(0,e)};return{x:o.x,y:o.y,width:h.x-o.x,height:h.y-o.y}}interpolate(t){return{x:(1-t)*(1-t)*this.x+2*(1-t)*t*this.cx+t*t*this.toX,y:(1-t)*(1-t)*this.y+2*(1-t)*t*this.cy+t*t*this.toY}}}const ml=dl;class dt extends Ns{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}toSVGPathData(){return[["C",this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY]]}toCanvasContext(t){t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY)}getBoundingClientRect(){let t=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),e=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),s=this.x-this.c1x,n=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t;const a=[this.y,this.toY],o=[this.x,this.toX];let h;const c=[];Math.abs(n)>1e12&&(n=.5),Math.abs(r)>1e12&&(r=.5),n>=0&&n<=1&&(h=this.interpolate(n),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),t=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),e=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),s=this.y-this.c1y,n=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t,Math.abs(n)>1e12&&(n=.5),Math.abs(r)>1e12&&(r=.5),n>=0&&n<=1&&(h=this.interpolate(n),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y}));let l=[],f=c.length;for(let p=0;p<f;p++){for(let E=p+1;E<f;E++)c[p].X===c[E].X&&c[p].Y===c[E].Y&&(E=++p);l.push({X:c[p].X,Y:c[p].Y})}const y={x:Math.min.apply(Math,o),y:Math.min.apply(Math,a)},b={x:Math.max.apply(Math,o),y:Math.max.apply(Math,a)};return{x:y.x,y:y.y,width:b.x-y.x,height:b.y-y.y,dots:l}}interpolate(t){return{x:Math.pow(1-t,3)*this.x+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.toX,y:Math.pow(1-t,3)*this.y+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.toY}}static base3(t,e,s,n,r){const a=-3*e+9*s-9*n+3*r,o=t*a+6*e-12*s+6*n;return t*o-3*e+3*s}static bezlen(t,e,s,n,r,a,o,h,c=1){c=Math.max(0,Math.min(c,1));const l=c/2,f=[-.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 b=0;for(let p=0;p<12;p++){const E=l*f[p]+l,_=this.base3(E,t,s,r,o),v=this.base3(E,e,n,a,h);b+=y[p]*Math.sqrt(_*_+v*v)}return l*b}length(t=1){return dt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,s=this.y,n=this.c1x,r=this.c1y,a=this.c2x,o=this.c2y,h=this.toX,c=this.toY;if(t<0||dt.bezlen(e,s,n,r,a,o,h,c)<t)return 0;let l=1,f=l/2,y=l-f,b=dt.bezlen(e,s,n,r,a,o,h,c,y);for(;Math.abs(b-t)>.01;)f/=2,y+=(b<t?1:-1)*f,b=dt.bezlen(e,s,n,r,a,o,h,c,y);return y}getPointAtSegmentLength(t){const e=this.getTatLen(t);let s=1-e,n=Math.pow(s,3),r=Math.pow(s,2),a=e*e,o=a*e,h=n*this.x+r*3*e*this.c1x+s*3*e*e*this.c2x+o*this.toX,c=n*this.y+r*3*e*this.c1y+s*3*e*e*this.c2y+o*this.toY,l=this.x+2*e*(this.c1x-this.x)+a*(this.c2x-2*this.c1x+this.x),f=this.y+2*e*(this.c1y-this.y)+a*(this.c2y-2*this.c1y+this.y),y=this.c1x+2*e*(this.c2x-this.c1x)+a*(this.toX-2*this.c2x+this.c1x),b=this.c1y+2*e*(this.c2y-this.c1y)+a*(this.toY-2*this.c2y+this.c1y),p=s*this.x+e*this.c1x,E=s*this.y+e*this.c1y,_=s*this.c2x+e*this.toX,v=s*this.c2y+e*this.toY,x=90-Math.atan2(l-y,f-b)*180/Math.PI;return{x:h,y:c,m:{x:l,y:f},n:{x:y,y:b},start:{x:p,y:E},end:{x:_,y:v},alpha:x}}}const Be=Math.PI*2;function Zr(i,t,e,s){const n=i*s-t*e<0?-1:1;let r=i*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),n*Math.acos(r)}function pl(i,t,e,s,n,r,a,o,h,c){const l=c*(i-e)/2+h*(t-s)/2,f=-h*(i-e)/2+c*(t-s)/2,y=a*a,b=o*o,p=l*l,E=f*f;let _=y*b-y*E-b*p;_<0&&(_=0),_/=y*E+b*p,_=Math.sqrt(_)*(n===r?-1:1);const v=_*a/o*f,x=_*-o/a*l,w=c*v-h*x+(i+e)/2,g=h*v+c*x+(t+s)/2,P=(l-v)/a,C=(f-x)/o,B=(-l-v)/a,q=(-f-x)/o,G=Zr(1,0,P,C);let J=Zr(P,C,B,q);return r===0&&J>0&&(J-=Be),r===1&&J<0&&(J+=Be),[w,g,G,J]}function gl(i,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(i),n=Math.sin(i),r=Math.cos(i+t),a=Math.sin(i+t);return[s,n,s-n*e,n+s*e,r+a*e,a-r*e,r,a]}function Kr(i,t,e,s,n,r,a,o,h){const c=Math.sin(h*Be/360),l=Math.cos(h*Be/360),f=l*(i-e)/2+c*(t-s)/2,y=-c*(i-e)/2+l*(t-s)/2;if(f===0&&y===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const b=f*f/(a*a)+y*y/(o*o);b>1&&(a*=Math.sqrt(b),o*=Math.sqrt(b));const p=pl(i,t,e,s,n,r,a,o,c,l),E=[];let _=p[2],v=p[3];const x=Math.max(Math.ceil(Math.abs(v)/(Be/4)),1);v/=x;for(let w=0;w<x;w++)E.push(gl(_,v)),_+=v;return E.map(w=>{for(let g=0;g<w.length;g+=2){let P=w[g+0],C=w[g+1];P*=a,C*=o;const B=l*P-c*C,q=c*P+l*C;w[g+0]=B+p[0],w[g+1]=q+p[1]}return w})}function qi(i,t,e,s,n,r){return[i/3+2/3*e,t/3+2/3*s,n/3+2/3*e,r/3+2/3*s,n,r]}function Ye(i,t,e,s){return[i,t,e,s,e,s]}const Ue={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class fe{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&le(s,e),s}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||vn()})}static downloadFromSVGElement(t,e="shape"){return ws(br(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return ws(si(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return vi(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 fe.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,n,r)=>{let a=n.toLowerCase();const o=An(r);for(a=="m"&&o.length>Ue[a]&&(e.push([n,...o.splice(0,Ue[a])]),a="l",n=n=="m"?"l":"L");o.length;){if(o.length<Ue[a])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${n} } args:{ ${o} }`);e.push([n,...o.splice(0,Ue[a])])}return a=="z"&&e.push([n]),""}),e}static absolutizeSVGPath(t){let e=0,s=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toUpperCase();if(o!=h)switch(a[0]=h,o){case"a":a[6]+=n,a[7]+=r;break;case"v":a[1]+=r;break;case"h":a[1]+=n;break;default:for(let c=1;c<a.length;)a[c++]+=n,a[c++]+=r}switch(h){case"Z":n=e,r=s;break;case"H":n=a[1];break;case"V":r=a[1];break;case"M":n=e=a[1],r=s=a[2];break;default:n=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,s=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toLowerCase();if(o!=h)switch(a[0]=h,o){case"A":a[6]-=n,a[7]-=r;break;case"V":a[1]-=r;break;case"H":a[1]-=n;break;default:for(let c=1;c<a.length;)a[c++]-=n,a[c++]-=r}switch(h){case"z":n=e,r=s;break;case"h":n+=a[1];break;case"v":r+=a[1];break;case"m":n+=a[1],r+=a[2],e+=a[1],s+=a[2];break;default:n+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){const e=[];let s=0,n=0,r=0,a=0,o=0,h=0,c=0,l=0,f;for(let y=0,b=t.length;y<b;y++){let p=t[y];const E=p[0];switch(E){case"M":s=p[1],n=p[2];break;case"A":const _=Kr(r,a,p[6],p[7],p[4],p[5],p[1],p[2],p[3]);if(!_.length)continue;_.forEach((w,g)=>{const[P,C,B,q,G,J,Z,at]=w;p=["C",B,q,G,J,Z,at],g<_.length-1&&e.push(p)});break;case"S":let v=r,x=a;(f=="C"||f=="S")&&(v+=v-c,x+=x-l),p=["C",v,x,p[1],p[2],p[3],p[4]];break;case"T":f=="Q"||f=="T"?(o=r*2-o,h=a*2-h):(o=r,h=a),p=["C",...qi(r,a,o,h,p[1],p[2])];break;case"Q":o=p[1],h=p[2],p=["C",...qi(r,a,p[1],p[2],p[3],p[4])];break;case"L":p=["C",...Ye(r,a,p[1],p[2])];break;case"H":p=["C",...Ye(r,a,p[1],a)];break;case"V":p=["C",...Ye(r,a,r,p[1])];break;case"Z":p=["C",...Ye(r,a,s,n)];break}f=E,r=p[p.length-2],a=p[p.length-1],p.length>4?(c=p[p.length-4],l=p[p.length-3]):(c=r,l=a),e.push(p)}return e}static catmullRom2bezier(t){const e=[];for(let s=0,n=t.length;n-2>s;s+=2){let r;s==0?r=[{x:t[s],y:t[s+1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}]:n-4==s?r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+2],y:t[s+3]}]:r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}];const a=[{x:r[1].x,y:r[1].y},{x:(-r[0].x+6*r[1].x+r[2].x)/6,y:(-r[0].y+6*r[1].y+r[2].y)/6},{x:(r[1].x+6*r[2].x-r[3].x)/6,y:(r[1].y+6*r[2].y-r[3].y)/6},{x:r[2].x,y:r[2].y}];e.push(["C",a[1].x,a[1].y,a[2].x,a[2].y,a[3].x,a[3].y])}return e}static zvhToLSVGPath(t){const e=[];let s=["L",0,0],n;for(let r=0,a=t.length;r<a;r++){const o=t[r];switch(o[0]){case"M":s=["L",o[1],o[2]],e.push(o);break;case"Z":e.push(s);break;case"H":n=e[e.length-1]||["L",0,0],e.push(["L",o[1],n[n.length-1]]);break;case"V":n=e[e.length-1]||["L",0,0],e.push(["L",n[n.length-2],o[1]]);break;default:e.push(o)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let s,n=0,r=0;for(let a=0,o=t.length;a<o;a++){const h=t[a],c=e[h[0]];c&&(h[0]=c.to,s&&(s[0]===c.to?(n=2*Number(s[c.x+2])-Number(s[c.x]),r=2*Number(s[c.x+3])-Number(s[c.x+1])):(n=Number(s[s.length-2]),r=Number(s[s.length-1]))),h.splice(1,0,n,r)),s=h}return t}}const wt=fe;class xt{cX;cY;x;y;degree;scalarX;scalarY;startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){this.cX=0,this.cY=0,this.x=t?.x||0,this.y=t?.y||0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&(this.cX=t.centerX-this.x,this.cY=t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.reset(t?.d,t?.originMatrix)}reset(t,e){typeof t=="string"?this.resetFromSVGPathData(wt.parseSVGPath(t),e):t instanceof xt?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const s=wt.normalizeSVGPath(wt.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let n=!1;for(let r=0,a=s.length;r<a;r++){const o=s[r];if(o[0]=="M"){n||(n=!0,this.startPathX=o[1],this.startPathY=o[2]),this.prevPathX=o[1],this.prevPathY=o[2];continue}this.appendLine(new dt({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],toX:o[5],toY:o[6]}))}e&&({x:this.startPathX,y:this.startPathY}=e.transformPoint({x:this.startPathX,y:this.startPathY}),{x:this.prevPathX,y:this.prevPathY}=e.transformPoint({x:this.prevPathX,y:this.prevPathY}),this.normalizedLines.forEach(r=>{({x:r.x,y:r.y}=e.transformPoint({x:r.x,y:r.y})),{x:r.c1x,y:r.c1y}=e.transformPoint({x:r.c1x,y:r.c1y}),{x:r.c2x,y:r.c2y}=e.transformPoint({x:r.c2x,y:r.c2y}),{x:r.toX,y:r.toY}=e.transformPoint({x:r.toX,y:r.toY})}))}static fromPolymorphPoints(t){const e=new xt;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let s=2,n=t.length;s+5<n;s+=6)e.appendLine(new dt({c1x:t[s],c1y:t[s+1],c2x:t[s+2],c2y:t[s+3],toX:t[s+4],toY:t[s+5]}));return e}static fromLines(t){const e=new xt;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let s=0,n=t.length;s<n;s++)e.appendLine(t[s]);return e}appendLine(t){if(t instanceof Hi){Kr(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,f,y,b,p,E,_,v]=c;this.normalizedLines.push(new dt({x:this.prevPathX,y:this.prevPathY,c1x:y,c1y:b,c2x:p,c2y:E,toX:_,toY:v})),this.prevPathX=_,this.prevPathY=v});return}let e,s,n,r,a,o;t instanceof dt?(e=t.c1x,s=t.c1y,n=t.c2x,r=t.c2y,a=t.toX,o=t.toY):t instanceof ml?[e,s,n,r,a,o]=qi(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,n,r,a,o]=Ye(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new dt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:n,c2y:r,toX:a,toY:o})),this.prevPathX=a,this.prevPathY=o}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform(),n=[];n.push(["M",t,e]);for(let r=0,a=s.length;r<a;r++)n.push(...s[r].toSVGPathData());return n}toSVGPathD(){return wt.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:s,normalizedLines:n}=this.updateTransform();t.beginPath(),t.moveTo(e,s),n.forEach(r=>{r.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],s=[];if(t.forEach(h=>{const c=h.getBoundingClientRect();e.push(c.x,c.x+c.width),s.push(c.y,c.y+c.height)}),e.length==0||s.length==0)return{x:0,y:0,width:0,height:0};const n=Math.min.apply(0,e),r=Math.min.apply(0,s),a=Math.max.apply(0,e),o=Math.max.apply(0,s);return{x:n,y:r,width:a-n,height:o-r}}update(t){this.cX=typeof t.cX=="number"?t.cX:this.cX,this.cY=typeof t.cY=="number"?t.cY:this.cY,this.x=t.x,this.y=t.y,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY}updateTransform(){const t=new ct;if(t.translate(this.x+this.cX,this.y+this.cY),t.rotate(this.degree),t.scale(this.scalarX,this.scalarY),t.translate(-this.cX,-this.cY),t.isIdentity)return{startPathX:this.startPathX,startPathY:this.startPathY,normalizedLines:this.normalizedLines};{let e=this.startPathX,s=this.startPathY;({x:e,y:s}=t.transformPoint({x:e,y:s}));const n=[];return this.normalizedLines.forEach(r=>{let a=r.x,o=r.y,h=r.c1x,c=r.c1y,l=r.c2x,f=r.c2y,y=r.toX,b=r.toY;({x:a,y:o}=t.transformPoint({x:a,y:o})),{x:h,y:c}=t.transformPoint({x:h,y:c}),{x:l,y:f}=t.transformPoint({x:l,y:f}),{x:y,y:b}=t.transformPoint({x:y,y:b}),n.push(new dt({x:a,y:o,c1x:h,c1y:c,c2x:l,c2y:f,toX:y,toY:b}))}),{startPathX:e,startPathY:s,normalizedLines:n}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,s)=>e+=s.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let s=0;const n=e.length;for(let r=0;r<n;r++){const a=e[r],o=a.length();if(s+o>=t)return a.getPointAtSegmentLength(t-s);s+=o}return e[n-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:s,normalizedLines:n}=this.updateTransform(),r=n.length;if(r===0)return{x:e,y:s};if(r===1)return n[0].interpolate(t);{let a=t*r,o=n[0];if(a--,a>1)for(let h=1;h<r&&(o=n[h],a>1);h++)a-=1;return o.interpolate(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}}getSubpathsAtLength(t,e,s){const{startPathX:n,startPathY:r,normalizedLines:a}=t.updateTransform();let o=null,h=0;const c=new xt;c.prevPathX=c.startPathX=n,c.prevPathY=c.startPathY=r;for(let l=0,f=a.length;l<f;l++){const y=a[l],b=y.length();if(h+b>e&&!o){const p=y.getPointAtSegmentLength(e-h);if(c.appendLine(new dt({c1x:p.start.x,c1y:p.start.y,c2x:p.m.x,c2y:p.m.y,toX:p.x,toY:p.y})),s)return c;o=c,c.appendLine(new dt({c1x:p.n.x,c1y:p.n.y,c2x:p.end.x,c2y:p.end.y,toX:y.x,toY:y.y})),h+=b;continue}h+=b,c.appendLine(y)}return c}closestPoint(t,e){const s=this.getTotalLength();let n={x:t,y:e},r=0,a=1/0,o=8;for(let c=0;c<=s;c+=o){let l=this.getPointAtLength(c),f=Ls(l.x,l.y,t,e);f<a&&(n=l,r=c,a=f)}for(o/=2;o>.5;){let c=r-o,l=this.getPointAtLength(c),f=Ls(l.x,l.y,t,e),y=r+o,b=this.getPointAtLength(y),p=Ls(b.x,b.y,t,e);c>=0&&f<a?(n=l,r=c,a=f):y<=s&&p<a?(n=b,r=y,a=p):o/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:n,rotation:r>=s?se(h.x,h.y,n.x,n.y):se(n.x,n.y,h.x,h.y),distance:Math.sqrt(a)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform();return[t,e].concat(s.reduce((n,r)=>n.concat([r.c1x,r.c1y,r.c2x,r.c2y,r.toX,r.toY]),[]))}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let s=t[e-2],n=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=ks(t[a],t[a+1],s,n),s=t[a],n=t[a+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,s=e.length;let n=t-s;const r=Math.ceil(t/s),a=[];a.push(["M",e[0],e[1]]);let o=2;for(;o+5<=s-1;){const h=e[o++],c=e[o++],l=e[o++],f=e[o++],y=e[o++],b=e[o++];a.push(["C",h,c,l,f,y,b]);let p=0;for(;p<r&&n>0;)a.push(["C",y,b,y,b,y,b]),n-=6,p++}return a}static mixPoints(t,e,s){const n=t.length,r=new Array(n);for(let a=0;a<n;a++)r[a]=It(t[a]+(e[a]-t[a])*s,6);return r}static getPathInterpolator(t,e){return s=>Math.abs(s-0)<Number.EPSILON?t:Math.abs(s-1)<Number.EPSILON?e:xt.fromPolymorphPoints(xt.mixPoints(new xt({d:t}).polymorphPoints,new xt({d:e}).polymorphPoints,s)).toSVGPathData()}}const yl=xt;class H extends rs{id;originD;originMatrix;independentTransformInGroup;forceCXY=!1;cX;cY;x;y;degree;scalarX;scalarY;diffXInGroup;diffYInGroup;diffDegreeInGroup;diffScalarXInGroup;diffScalarYInGroup;vx;vy;ax;ay;mass;attrs;enableDrag;alongPath;isDragging=!1;isMouseIn=!1;targetToAfterDragFree;followMouse;strokeArmyAnts;strokeArmyAntsOffset=0;strokeDashTotalLength=0;isShow=!0;el;pathd;usePathDtoCanvasContext=!1;parent;shapes=[];constructor(t){if(super(),this.id=vn(),t?.d&&(this.originD=t?.d),t?.originMatrix&&(this.originMatrix=t.originMatrix),this.independentTransformInGroup=typeof t?.independentTransformInGroup=="boolean"?t.independentTransformInGroup:!1,this.x=t?.x||0,this.y=t?.y||0,this.cX=0,this.cY=0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&this.forceSetCXY(t.centerX-this.x,t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.diffXInGroup=t?.diffXInGroup||0,this.diffYInGroup=t?.diffYInGroup||0,this.diffDegreeInGroup=t?.diffDegreeInGroup||0,this.diffScalarXInGroup=t?.diffScalarXInGroup||1,this.diffScalarYInGroup=t?.diffScalarYInGroup||1,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||1,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this.enableDrag=t?.enableDrag||!1,this.alongPath=t?.alongPath,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.strokeArmyAnts=t?.strokeArmyAnts||!1,this.strokeArmyAnts){const s=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",s),this.strokeDashTotalLength=An(s).reduce((n,r)=>n+r,0)}return Mn(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new xt,gt(()=>{this.pathd?.reset(this.originD||this.toSVGPathData(),this.originMatrix)}),this.pathd&&!this.forceCXY){const t=this.shapes.length==0?this.pathd.getBoundingClientRect():this.getBoundingClientRect();t&&(this.pathd.cX=this.cX=t.x+t.width/2-this.pathd.x,this.pathd.cY=this.cY=t.y+t.height/2-this.pathd.y)}this.shapeInit()}return this.pathd}frameStart(t){}frameUpdate(t,e){this.pathd=this.initPathD(),this.pathd.update(this),this.strokeArmyAnts&&(this.isMouseIn||(this.setAttr("stroke-dashoffset",String(this.strokeArmyAntsOffset++)),this.strokeArmyAntsOffset>this.strokeDashTotalLength&&(this.strokeArmyAntsOffset=0)))}frameEnd(t){}toSVGPathData(){return[]}toSVGPathD(){return this.pathd?.toSVGPathD()||""}toCanvasContext(t){this.usePathDtoCanvasContext=!0,this.pathd?.toCanvasContext(t)}getBoundingClientRect(){return this.pathd?.getBoundingClientRect()||null}get center(){const t=this.getBoundingClientRect(),e={x:this.x,y:this.y};return t&&(e.x=t.x+t.width/2,e.y=t.y+t.height/2),e}trim(){if(this.parent)return;const t=this.getBoundingClientRect();if(!t)return;this.shapes.forEach(s=>{const n=s.originMatrix?s.originMatrix.clone():new ct;n.translate(-t.x+s.x,-t.y+s.y),s.originMatrix=n});const e=this.originMatrix?this.originMatrix.clone():new ct;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,s){if(s instanceof Fs)return s.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let n;try{n=new SVGPoint(t,e)}catch{n=s.createSVGPoint(),n.x=t,n.y=e}if(this.el instanceof SVGGeometryElement)return this.el.isPointInFill(n);{const r=this.getBoundingClientRect();if(r)return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height}return!1}isPointInStroke(t,e,s){if(s instanceof Fs)return s.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let n;try{n=new SVGPoint(t,e)}catch{n=s.createSVGPoint(),n.x=t,n.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(n):!1}clone(){return eo(this).copy(this)}copy(t){return this.id=t.id,this.originD=t.originD,this.originMatrix=t.originMatrix,this.independentTransformInGroup=t.independentTransformInGroup,this.x=t.x,this.y=t.y,this.cX=t.cX,this.cY=t.cY,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY,this.diffXInGroup=t.diffXInGroup,this.diffYInGroup=t.diffYInGroup,this.diffDegreeInGroup=t.diffDegreeInGroup,this.diffScalarXInGroup=t.diffScalarXInGroup,this.diffScalarYInGroup=t.diffScalarYInGroup,this.vx=t.vx,this.vy=t.vy,this.ax=t.ax,this.ay=t.ay,this.mass=t.mass,this.attrs={...t.attrs},this.enableDrag=t.enableDrag,this.alongPath=t.alongPath,this.targetToAfterDragFree=t.targetToAfterDragFree,this.followMouse=t.followMouse,this.isShow=t.isShow,this.strokeArmyAnts=t.strokeArmyAnts,this.strokeDashTotalLength=t.strokeDashTotalLength,this}save(){}restore(){}setAttr(t,e){typeof t!="string"?Object.assign(this.attrs,Object.fromEntries(Object.entries(t).map(([s,n])=>[ot(s),n]))):e&&(this.attrs[ot(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[ot(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[ot(t)]}distance(t){return ks(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=nt(se(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:s,dy:n}=Rt(N(this.degree),e);this.vx=s,this.vy=n,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:s,dy:n}=Rt(N(this.degree),e);this.ax=s,this.ay=n,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,s=t.y-this.y,n=e*e+s*s,r=Math.sqrt(n),a=this.mass*t.mass/n,o=a*e/r,h=a*s/r;this.vx+=o/this.mass,this.vy+=h/this.mass,t.vx-=o/t.mass,t.vy-=h/t.mass}run(t){this.vx+=this.ax,this.vy+=this.ay;const e=Jt(t?.gravity,0);this.vy+=e;const s=Jt(t?.friction,1);this.vx*=s,this.vy*=s,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const s=Jt(e?.easing,.05),n=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=n*s,this.vy=r*s,this.run(e)}runSpringTo(t,e){const s=Jt(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(n=>{const r=n.x-this.cX-this.x,a=n.y-this.cY-this.y,o=r*s,h=a*s;this.vx+=o,this.vy+=h}),this.run({friction:.9,...e})}springMassTo(t,e){const s=Jt(e?.springLength,100),n=Jt(e?.spring,1e-4),r=t.x-this.x,a=t.y-this.y,o=Math.sqrt(r*r+a*a);if(o<s){const h=r*n,c=a*n;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-o/s}return 0}getTotalLength(){return this.initPathD().getTotalLength()}interpolate(t){return this.initPathD().interpolate(t)}getPointAtLength(t){return this.initPathD().getPointAtLength(t)}trailPath(t,e=0){const s=this.getTotalLength();return t.originD=this.initPathD().getSubpath(0,e*s),this.getPointAtLength(e*s)}strokeDashTween(t=1e3,e){const s=this.initPathD(),n=It(s.getTotalLength(),0);this.setAttr({strokeDasharray:`${n} ${n}`,strokeDashoffset:`${n}`});const r=e?.onUpdate,a=new Es({frameDuration:t});a.addTween({offset:n},{offset:0},Object.assign(e||{},{onUpdate:(o,h)=>{this.setAttr("strokeDashoffset",""+It(o.offset,2)),r?.(o,h)}})),a.play()}}class Xe extends H{x;y;z;fl;vpX;vpY;cX;cY;cZ;radius;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.fl=t?.fl||250,this.vpX=t?.vpX||0,this.vpY=t?.vpY||0,this.cX=t?.cX||0,this.cY=t?.cY||0,this.cZ=t?.cZ||0,this.radius=t?.radius||0}toSVGPathData(){return this.radius?[["M",this.getScreenX(),this.getScreenY()-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:[["M",this.getScreenX(),this.getScreenY()]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,s){this.cX=t,this.cY=e,this.cZ=s}rotateX(t){({x:this.y,y:this.z}=Et(N(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=Et(N(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=Et(N(t),this.x,this.y))}getScreenX(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*t}getScreenY(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*t}eq(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.radius===t.radius&&this.mass===t.mass}length(){return Ms(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,s=t.y-this.y,n=t.z-this.z;return Math.sqrt(e*e+s*s+n*n)}scalar(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y,n=this.z;return{x:s*t.z-n*t.y,y:n*t.x-e*t.z,z:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y,z:this.z*t.z}}div(t){return{x:this.x/t.x,y:this.y/t.y,z:this.z/t.z}}add(t){return{x:this.x+t.x,y:this.y+t.y,z:this.z+t.z}}sub(t){return{x:this.x-t.x,y:this.y-t.y,z:this.z-t.z}}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y,z:this.z-2*e*t.z}}}const Qr=[1,0,0,1,0,0],ta=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class ct{value;_m13=0;_m23=0;_m33=1;matrix3d;constructor(t=Qr){this.value=Array.from(t),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D()}static fromString(t){const e=new ct,s=xn("number",t);return s.length===6&&s.forEach((n,r)=>{n.fullMatch&&(e.value[r]=parseFloat(n.fullMatch))}),e}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this._m13}get m21(){return this.value[2]}get m22(){return this.value[3]}get m23(){return this._m23}get m31(){return this.value[4]}get m32(){return this.value[5]}get m33(){return this._m33}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this._m13=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set m23(t){this._m23=t}set m31(t){this.value[4]=t}set m32(t){this.value[5]=t}set m33(t){this._m33=t}toMatrix3D(t=this.matrix3d){const e=[this.m11,this.m12,0,this.m13,this.m21,this.m22,0,this.m23,0,0,1,0,this.m31,this.m32,0,this.m33];return t?(t.value=e,t):new mt(e)}identity(){return this.value=Array.from(Qr),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D(),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m31==0&&this.m32==0&&this.m33==1}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m31*=t,this.m32*=t,this.m33*=t,this}normalize(){const t=this.m33||1e-4;return this.scalar(1/t)}transformPoint(t){const e=t.z||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31,y:t.x*this.m12+t.y*this.m22+e*this.m32,z:t.x*this.m13+t.y*this.m23+e*this.m33}}clone(){return new ct([...this.value])}multiply(t){const e=this.clone(),s=t instanceof ct?t:new ct(t);return this.m11=s.m11*e.m11+s.m12*e.m21+s.m13*e.m31,this.m12=s.m11*e.m12+s.m12*e.m22+s.m13*e.m32,this.m13=s.m11*e.m13+s.m12*e.m23+s.m13*e.m33,this.m21=s.m21*e.m11+s.m22*e.m21+s.m23*e.m31,this.m22=s.m21*e.m12+s.m22*e.m22+s.m23*e.m32,this.m23=s.m21*e.m13+s.m22*e.m23+s.m23*e.m33,this.m31=s.m31*e.m11+s.m32*e.m21+s.m33*e.m31,this.m32=s.m31*e.m12+s.m32*e.m22+s.m33*e.m32,this.m33=s.m31*e.m13+s.m32*e.m23+s.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}inverse(){const t=this.m11,e=this.m12,s=this.m13,n=this.m21,r=this.m22,a=this.m23,o=this.m31,h=this.m32,c=this.m33,l=c*r-a*h,f=-c*n+a*o,y=h*n-r*o;let b=t*l+e*f+s*y;return b?(b=1/b,this.m11=l*b,this.m12=(-c*e+s*h)*b,this.m13=(a*e-s*r)*b,this.m21=f*b,this.m22=(c*t-s*o)*b,this.m23=(-a*t+s*n)*b,this.m31=y*b,this.m32=(-h*t+e*o)*b,this.m33=(r*t-e*n)*b,this):null}adjugate(){const t=new ct;return t.m11=this.m22*this.m33-this.m32*this.m23,t.m12=this.m32*this.m13-this.m12*this.m33,t.m13=this.m12*this.m23-this.m22*this.m13,t.m21=this.m31*this.m23-this.m21*this.m33,t.m22=this.m11*this.m33-this.m31*this.m13,t.m23=this.m21*this.m13-this.m11*this.m23,t.m31=this.m21*this.m32-this.m31*this.m22,t.m32=this.m31*this.m12-this.m11*this.m32,t.m33=this.m11*this.m22-this.m21*this.m12,t}split(){let t=nt(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(t+=180),{x:this.m31,y:this.m32,degree:t,scaleX:Math.sqrt(this.m11*this.m11+this.m12*this.m12),scaleY:Math.sqrt(this.m21*this.m21+this.m22*this.m22),skewX:nt(Math.atan2(-this.m21,this.m22)),skewY:nt(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],s=this.value[1],n=this.value[2],r=this.value[3],a=this.value[4],o=this.value[5],h=t.value[0],c=t.value[1],l=t.value[2],f=t.value[3],y=t.value[4],b=t.value[5],p=h*f,E=c*l,_=(l*s-e*f)/(E-p),v=(h*s-e*c)/(p-E),x=(l*r-n*f)/(E-p),w=(h*r-n*c)/(p-E),g=(l*(o-b)+f*(y-a))/(E-p),P=(h*(o-b)+c*(y-a))/(p-E),C=[_,v,x,w,g,P];return new ct(C)}toString(t=6){return this.matrix3d.is2D()?`matrix(${this.value.map(e=>It(e,t)).join(",")})`:this.matrix3d.toString()}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix3D(),this}translateTo(t,e){return this.translate(t-this.m31,e-this.m32)}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.m32)}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.m31,t)}translateZ(t){return this.matrix3d.translate(0,0,t),this.matrix3d.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix3d.m43),this}translate3d(t,e,s){return this.matrix3d.translate(t,e,s),this.matrix3d.toMatrix(this),this}translate3dTo(t,e,s){return this.translate3d(t-this.matrix3d.m41,e-this.matrix3d.m42,s-this.matrix3d.m43),this}rotate(t,e=0,s=0){const n=N(t),r=Math.cos(n),a=Math.sin(n);return this.translate(e,s),this.multiply([r,a,-a,r,0,0]),this.translate(-e,-s),this.toMatrix3D(),this}rotateTo(t,e=0,s=0){const{degree:n}=this.split();return this.rotate(t-n,e,s),this}rotateX(t){return this.matrix3d.rotateX(t),this.matrix3d.toMatrix(this),this}rotateXTo(t){const{degreeX:e}=this.matrix3d.split();return this.rotateX(t-e),this}rotateY(t){return this.matrix3d.rotateY(t),this.matrix3d.toMatrix(this),this}rotateYTo(t){const{degreeY:e}=this.matrix3d.split();return this.rotateY(t-e),this}rotateZ(t){return this.matrix3d.rotateZ(t),this.matrix3d.toMatrix(this),this}rotateZTo(t){const{degreeZ:e}=this.matrix3d.split();return this.rotateZ(t-e),this}rotate3d(t,e,s){return this.matrix3d.rotateX(t).rotateY(e).rotateZ(s),this.matrix3d.toMatrix(this),this}rotate3dTo(t,e,s){const{degreeX:n,degreeY:r,degreeZ:a}=this.matrix3d.split();return this.rotate3d(t-n,e-r,s-a),this}scale(t,e=t,s=0,n=0){return this.translate(s,n),this.multiply([t,0,0,e,0,0]),this.translate(-s,-n),this.toMatrix3D(),this}scaleTo(t,e=t,s=0,n=0){return this.scale(t/this.m11,e/this.m22,s,n)}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.m11,1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.m22)}scaleZ(t){return this.matrix3d.scale(1,1,t),this.matrix3d.toMatrix(this),this}scaleZTo(t){const{scalarZ:e}=this.matrix3d.split();return this.scaleZ(t/e),this}scale3d(t,e=t,s=t){return this.matrix3d.scale(t,e,s),this.matrix3d.toMatrix(this),this}scale3dTo(t,e=t,s=t){const{scalarX:n,scalarY:r,scalarZ:a}=this.matrix3d.split();return this.scale3d(t/n,e/r,s/a),this}skew(t,e=t){return this.multiply([Math.cos(N(e)),Math.sin(N(e)),-Math.sin(N(t)),Math.cos(N(t)),0,0]),this.toMatrix3D(),this}skewTo(t,e=t){const{skewX:s,skewY:n}=this.split();return this.skew(t-s,e-n)}skewX(t){const{skewY:e}=this.split();return this.skew(t,e)}skewXTo(t){const{skewY:e}=this.split();return this.skewTo(t,e)}skewY(t){const{skewX:e}=this.split();return this.skew(e,t)}skewYTo(t){const{skewX:e}=this.split();return this.skewTo(e,t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,s){return this}skew3dTo(t,e,s){return this}perspective(t){return this.matrix3d.perspective(t),this.matrix3d.toMatrix(this),this}}class mt{value;is3dSpecial=!1;constructor(t=ta){this.value=Array.from(t)}static fromString(t){const e=new mt,s=xn("number",t);return s.length===16&&s.forEach((n,r)=>{n.fullMatch&&(e.value[r]=parseFloat(n.fullMatch))}),e}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m14(){return this.value[3]}get m21(){return this.value[4]}get m22(){return this.value[5]}get m23(){return this.value[6]}get m24(){return this.value[7]}get m31(){return this.value[8]}get m32(){return this.value[9]}get m33(){return this.value[10]}get m34(){return this.value[11]}get m41(){return this.value[12]}get m42(){return this.value[13]}get m43(){return this.value[14]}get m44(){return this.value[15]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m14(t){this.value[3]=t}set m21(t){this.value[4]=t}set m22(t){this.value[5]=t}set m23(t){this.value[6]=t}set m24(t){this.value[7]=t}set m31(t){this.value[8]=t}set m32(t){this.value[9]=t}set m33(t){this.value[10]=t}set m34(t){this.value[11]=t}set m41(t){this.value[12]=t}set m42(t){this.value[13]=t}set m43(t){this.value[14]=t}set m44(t){this.value[15]=t}is2D(){return!this.is3dSpecial&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m43==0&&this.m44==1}is3D(){return!this.is2D()}identity(){return this.value=Array.from(ta),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m14==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m24==0&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m41==0&&this.m42==0&&this.m43==0&&this.m44==1}clone(){return new mt([...this.value])}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m14*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m24*=t,this.m31*=t,this.m32*=t,this.m33*=t,this.m34*=t,this.m41*=t,this.m42*=t,this.m43*=t,this.m44*=t,this}normalize(){return this.scalar(1/(this.m44||1e-4))}transformPoint(t){const e=t.z||1,s=t.w||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31+s*this.m41,y:t.x*this.m12+t.y*this.m22+e*this.m32+s*this.m42,z:t.x*this.m13+t.y*this.m23+e*this.m33+s*this.m43,w:t.x*this.m14+t.y*this.m24+e*this.m34+s*this.m44}}toMatrix(t){const{scalarX:e,scalarY:s,skewX:n,skewY:r,x:a,y:o}=this.split(),h=[e,r,n,s,a,o];return t?(t.value=h,t):new ct(h)}flatten(){return this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m14=0,this.m24=0,this.m43=0,this.m44=1,this}toString(t=6){return`matrix3d(${this.value.map(e=>It(e,t)).join(",")})`}split(){const t=Math.sqrt(this.m11*this.m11+this.m12*this.m12+this.m13*this.m13),e=Math.sqrt(this.m21*this.m21+this.m22*this.m22+this.m23*this.m23),s=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),n=nt(j(Math.asin(-this.m13),-1,1));let r=nt(Math.atan2(this.m23,this.m33));Math.cos(N(n))===0&&(r=nt(Math.atan2(-this.m31,this.m22)));let a=nt(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(a+=180),{x:this.m41,y:this.m42,z:this.m43,scalarX:t,scalarY:e,scalarZ:s,degreeX:r,degreeY:n,degreeZ:a,skewX:nt(this.m14),skewY:nt(this.m24),skewZ:nt(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}inverse(){const t=[],e=this.m11,s=this.m12,n=this.m13,r=this.m14,a=this.m21,o=this.m22,h=this.m23,c=this.m24,l=this.m31,f=this.m32,y=this.m33,b=this.m34,p=this.m41,E=this.m42,_=this.m43,v=this.m44;t[0]=h*b*E-c*y*E+c*f*_-o*b*_-h*f*v+o*y*v,t[1]=r*y*E-n*b*E-r*f*_+s*b*_+n*f*v-s*y*v,t[2]=n*c*E-r*h*E+r*o*_-s*c*_-n*o*v+s*h*v,t[3]=r*h*f-n*c*f-r*o*y+s*c*y+n*o*b-s*h*b;const x=e*t[0]+a*t[1]+l*t[2]+p*t[3];if(x==0)return console.warn("Can't invert matrix, determinant is 0");t[4]=c*y*p-h*b*p-c*l*_+a*b*_+h*l*v-a*y*v,t[5]=n*b*p-r*y*p+r*l*_-e*b*_-n*l*v+e*y*v,t[6]=r*h*p-n*c*p-r*a*_+e*c*_+n*a*v-e*h*v,t[7]=n*c*l-r*h*l+r*a*y-e*c*y-n*a*b+e*h*b,t[8]=o*b*p-c*f*p+c*l*E-a*b*E-o*l*v+a*f*v,t[9]=r*f*p-s*b*p-r*l*E+e*b*E+s*l*v-e*f*v,t[10]=s*c*p-r*o*p+r*a*E-e*c*E-s*a*v+e*o*v,t[11]=r*o*l-s*c*l-r*a*f+e*c*f+s*a*b-e*o*b,t[12]=h*f*p-o*y*p-h*l*E+a*y*E+o*l*_-a*f*_,t[13]=s*y*p-n*f*p+n*l*E-e*y*E-s*l*_+e*f*_,t[14]=n*o*p-s*h*p-n*a*E+e*h*E+s*a*_-e*o*_,t[15]=s*h*l-n*o*l+n*a*f-e*h*f-s*a*y+e*o*y,this.value=t,this.scalar(1/x)}multiply(t){const e=this.clone();return this.m11=t.m11*e.m11+t.m12*e.m21+t.m13*e.m31+t.m14*e.m41,this.m12=t.m11*e.m12+t.m12*e.m22+t.m13*e.m32+t.m14*e.m42,this.m13=t.m11*e.m13+t.m12*e.m23+t.m13*e.m33+t.m14*e.m43,this.m14=t.m11*e.m14+t.m12*e.m24+t.m13*e.m34+t.m14*e.m44,this.m21=t.m21*e.m11+t.m22*e.m21+t.m23*e.m31+t.m24*e.m41,this.m22=t.m21*e.m12+t.m22*e.m22+t.m23*e.m32+t.m24*e.m42,this.m23=t.m21*e.m13+t.m22*e.m23+t.m23*e.m33+t.m24*e.m43,this.m24=t.m21*e.m14+t.m22*e.m24+t.m23*e.m34+t.m24*e.m44,this.m31=t.m31*e.m11+t.m32*e.m21+t.m33*e.m31+t.m34*e.m41,this.m32=t.m31*e.m12+t.m32*e.m22+t.m33*e.m32+t.m34*e.m42,this.m33=t.m31*e.m13+t.m32*e.m23+t.m33*e.m33+t.m34*e.m43,this.m34=t.m31*e.m14+t.m32*e.m24+t.m33*e.m34+t.m34*e.m44,this.m41=t.m41*e.m11+t.m42*e.m21+t.m43*e.m31+t.m44*e.m41,this.m42=t.m41*e.m12+t.m42*e.m22+t.m43*e.m32+t.m44*e.m42,this.m43=t.m41*e.m13+t.m42*e.m23+t.m43*e.m33+t.m44*e.m43,this.m44=t.m41*e.m14+t.m42*e.m24+t.m43*e.m34+t.m44*e.m44,this}translate(t=0,e=0,s=0){return this.multiply(new mt([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 mt([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}rotateX(t){const e=N(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new mt([1,0,0,0,0,s,n,0,0,-n,s,0,0,0,0,1]))}rotateY(t){const e=N(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new mt([s,0,-n,0,0,1,0,0,n,0,s,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=N(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new mt([s,n,0,0,-n,s,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,s=0){return this.multiply(new mt([1,0,0,N(t),0,1,0,N(e),0,0,1,N(s),0,0,0,1]))}perspective(t){return this.multiply(new mt([1,0,0,0,0,1,0,0,0,0,1,t?-(1/t):0,0,0,0,1]))}unproject(t){let e=t.x*this.m11+t.y*this.m21+this.m41,s=t.x*this.m12+t.y*this.m22+this.m42,n=t.x*this.m13+t.y*this.m23+this.m43,r=t.x*this.m14+t.y*this.m24+this.m44,a=e+this.m31,o=s+this.m32,h=n+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,s/=r,n/=r,c==0&&(c=1e-4),a/=c,o/=c,h/=c;const l=h-n;if(l==0)return{x:e,y:s,z:n,mass:r};const f=-n/l;return e+=f*(a-e),s+=f*(o-s),{x:e,y:s,z:n,mass:r}}project(t){const e=t.z;let s=t.x*this.m11+t.y*this.m21+e*this.m31+this.m41,n=t.x*this.m12+t.y*this.m22+e*this.m32+this.m42,r=t.x*this.m14+t.y*this.m24+e*this.m34+this.m44;return r==0&&(r=1e-4),s/=r,n/=r,r<0&&(s-=this.m41,n-=this.m42,s*=1/r,n*=1/r,s+=this.m41,n+=this.m42),{x:s,y:n,z:e,mass:r}}bounds(t,e,s,n){const r=new Xe({x:t,y:e}),a=new Xe({x:t+s,y:e}),o=new Xe({x:t+s,y:e+n}),h=new Xe({x:t,y:e+n});({x:r.x,y:r.y,z:r.z,mass:r.mass}=this.project(r)),{x:a.x,y:a.y,z:a.z,mass:a.mass}=this.project(a),{x:o.x,y:o.y,z:o.z,mass:o.mass}=this.project(o),{x:h.x,y:h.y,z:h.z,mass:h.mass}=this.project(h);const c=Math.min(r.x,a.x,o.x,h.x),l=Math.min(r.y,a.y,o.y,h.y),f=Math.max(r.x,a.x,o.x,h.x)-c,y=Math.max(r.y,a.y,o.y,h.y)-l;return{x:c,y:l,width:f,height:y}}}function ji(i){const t=new ct;return i.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,s,n){n.indexOf(",")>=0?n=n.split(/\s*,\s*/):n=n.split(/\s+/);const r=[];for(let a=0,o=n.length;a<o;a++)n[a].trim()&&r.push(parseFloat(""+n[a]));switch(s.toLowerCase()){case"t":case"translate":t.translate(r[0],r[1]);break;case"translatex":t.translateX(r[0]);break;case"translatey":t.translateY(r[0]);break;case"translatez":t.translateZ(r[0]);break;case"translate3d":t.translate3d(r[0],r[1],r[2]);break;case"r":case"rotate":t.rotate(r[0],r[1]??0,r[2]??0);break;case"rotatex":t.rotateX(r[0]);break;case"rotatey":t.rotateY(r[0]);break;case"rotatez":t.rotateZ(r[0]);break;case"rotate3d":t.rotate3d(r[0],r[1],r[2]);break;case"s":case"scale":t.scale(r[0],r[1]??r[0]);break;case"scalex":t.scaleX(r[0]);break;case"scaley":t.scaleY(r[0]);break;case"scalez":t.scaleZ(r[0]);break;case"scale3d":t.scale3d(r[0],r[1],r[2]);break;case"skew":t.skew(r[0],r[1]??0);break;case"skewx":t.skewX(r[0]);break;case"skewy":t.skewY(r[0]);break;case"skewz":t.skewZ(r[0]);break;case"skew3d":t.skew3d(r[0],r[1],r[2]);break;case"m":case"matrix":t.multiply([r[0],r[1],r[2],r[3],r[4],r[5]]),t.toMatrix3D();break;case"matrix3d":t.matrix3d.multiply(new mt(r)),t.matrix3d.toMatrix(t);break}return""}),t}function Et(i,t,e){const s=new ct;return s.rotate(nt(i)),s.transformPoint({x:t,y:e})}function $i(i){const t=typeof i?.x=="number"?i?.x:0,e=typeof i?.y=="number"?i?.y:0,s=typeof i?.degree=="number"?i?.degree:0,n=typeof i?.scalarX=="number"?i?.scalarX:1,r=typeof i?.scalarY=="number"?i?.scalarY:1,a=N(s),o=Math.cos(a),h=Math.sin(a),c=new DOMMatrix([o*n,h*n,-h*r,o*r,t,e]);return c.multiplySelf(new DOMMatrix(i?.originMatrix||"")),c}function wl(i,t){const e=new Path2D(i),s=new Path2D;return s.addPath(e,$i(t)),s}function ea(i,t){const e={x:t.m11,y:t.m12,z:t.m13},s={x:t.m21,y:t.m22,z:t.m23},n={x:t.m31,y:t.m32,z:t.m33},r=i.transformPoint(e),a=i.transformPoint(s),o=i.transformPoint(n),h=new ct;return h.m11=r.x,h.m12=r.y,h.m13=r.z,h.m21=a.x,h.m22=a.y,h.m23=a.z,h.m31=o.x,h.m32=o.y,h.m33=o.z,h}function sa(i,t){const e={x:t.m11,y:t.m12,z:t.m13,w:t.m14},s={x:t.m21,y:t.m22,z:t.m23,w:t.m24},n={x:t.m31,y:t.m32,z:t.m33,w:t.m34},r={x:t.m41,y:t.m42,z:t.m43,w:t.m44},a=i.transformPoint(e),o=i.transformPoint(s),h=i.transformPoint(n),c=i.transformPoint(r);return new mt([a.x,a.y,a.z,a.w,o.x,o.y,o.z,o.w,h.x,h.y,h.z,h.w,c.x,c.y,c.z,c.w])}function xl(i){let t=i[0];for(let e=1,s=i.length;e<s;e++)t=ea(t,i[e]);return t}function bl(i){let t=i[0];for(let e=1,s=i.length;e<s;e++)t=sa(t,i[e]);return t}class L{static createElementNS(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}static isActive(t){return t===document.activeElement&&(t.type||t.href)}static isTouchEnabled(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}static getElement(t){const e=t.style?t.ownerDocument:t.document||t;return{el:t,document:e,window:e.defaultView,isRootNode:/(html|body)/i.test(t.tagName)||t===document}}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=ee(t.parentElement,"position");Ui(t.parentElement,{position:s=="static"?"relative":s,perspective:e})}Ui(t,{"transform-style":"preserve-3d"})}static convertAttrs(t,e,s={}){Object.prototype.hasOwnProperty.call(s,"transform")||Object.assign(s,{transform:ee(t,"transform")||""});const n=ji(s.transform),r={};for(const a in e){const o=e[a];switch(a){case"transform":break;case"translate":n.translate(o[0]||0,o[1]||0);break;case"translateTo":n.translateTo(o[0]||0,o[1]||0);break;case"translateX":n.translateX(o||0);break;case"translateXTo":n.translateXTo(o||0);break;case"translateY":n.translateY(o||0);break;case"translateYTo":n.translateYTo(o||0);break;case"translateZ":n.translateZ(o||0);break;case"translateZTo":n.translateZTo(o||0);break;case"translate3d":n.translate3d(o[0]||0,o[1]||0,o[2]||0);break;case"translate3dTo":n.translate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotate":typeof o=="number"?n.rotate(o||0):n.rotate(o[0]||0,o[1]||0,o[2]||0);break;case"rotateTo":typeof o=="number"?n.rotateTo(o||0):n.rotateTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotateX":n.rotateX(o||0);break;case"rotateXTo":n.rotateXTo(o||0);break;case"rotateY":n.rotateY(o||0);break;case"rotateYTo":n.rotateYTo(o||0);break;case"rotateZ":n.rotateZ(o||0);break;case"rotateZTo":n.rotateZTo(o||0);break;case"rotate3d":n.rotate3d(o[0]||0,o[1]||0,o[2]||0);break;case"rotate3dTo":n.rotate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"scale":typeof o=="number"?n.scale(o||1):n.scale(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleTo":typeof o=="number"?n.scaleTo(o||1):n.scaleTo(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleX":n.scaleX(o||1);break;case"scaleXTo":n.scaleXTo(o||1);break;case"scaleY":n.scaleY(o||1);break;case"scaleYTo":n.scaleYTo(o||1);break;case"scaleZ":n.scaleZ(o||1);break;case"scaleZTo":n.scaleZTo(o||1);break;case"scale3d":typeof o=="number"?n.scale3d(o||1):n.scale3d(o[0]||1,o[1]||1,o[2]||1);break;case"scale3dTo":typeof o=="number"?n.scale3dTo(o||1):n.scale3dTo(o[0]||1,o[1]||1,o[2]||1);break;case"skew":typeof o=="number"?n.skew(o||0):n.skew(o[0]||0,o[1]||0);break;case"skewTo":typeof o=="number"?n.skewTo(o||0):n.skewTo(o[0]||0,o[1]||0);break;case"skewX":n.skewX(o||0);break;case"skewXTo":n.skewXTo(o||0);break;case"skewY":n.skewY(o||0);break;case"skewYTo":n.skewYTo(o||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;case"perspective":n.perspective(o||0);break;default:Object.prototype.hasOwnProperty.call(s,a)||(s[a]=ee(t,a)),Object.assign(r,{[a]:`${o}`});break}}return Object.assign(r,{transform:n.toString()}),r}static attrsToCanvas(t,e){for(const s in e){const n=e[s];switch(s){case"fill":n!=="none"&&(t.fillStyle=n);break;case"stroke":n!=="none"&&(t.strokeStyle=n);break;case"stroke-width":case"strokeWidth":t.lineWidth=Number(n);break;case"stroke-linecap":case"strokeLinecap":t.lineCap=n;break;case"stroke-linejoin":case"strokeLinejoin":switch(n){case"round":case"bevel":case"miter":t.lineJoin=n;break;default:t.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":t.miterLimit=Number(n);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":t.lineDashOffset=Number(n);break;case"stroke-dasharray":case"strokeDasharray":typeof n=="string"&&t.setLineDash(n.split(/\s+/).map(r=>Number(r)));break;case"cursor":break;case"font":typeof n=="string"&&(t.font=n);break;case"font-size":case"fontSize":t.font+=` ${n}`;break;case"font-family":case"fontFamily":t.font+=` ${n}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(n){case"middle":t.textAlign="center";break;case"end":t.textAlign="end";break;case"start":t.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(n){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":t.textBaseline=n;break;default:t.textBaseline="alphabetic";break}break}}}static toggleClass(t,e,s="toggle"){if(t.classList)e.split(/[,\s]+/).forEach(n=>{const r=n.trim();r!==""&&t.classList[s](r)});else{const n=t.className.split(/ +/);let r=!1;e.split(/[,\s]+/).forEach(a=>{const o=a.trim();if(o!==""){const h=n.indexOf(o);switch(s){case"add":h===-1&&(n.push(o),r=!0);break;case"remove":h!==-1&&(n.splice(h,1),r=!0);break;case"toggle":h===-1?n.push(o):n.splice(h,1),r=!0;break}}}),r&&t.setAttribute("class",n.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}}static addClass(t,e){this.toggleClass(t,e,"add")}static removeClass(t,e){this.toggleClass(t,e,"remove")}static hasClass(t,e){return new RegExp("(?:^|\\s+)"+e+"(?:\\s+|$)").test(t.className)||!1}static toggleDisplay(t,e){ee(t,"display")=="none"&&e===void 0||e===!0?t.style.setProperty("display",t instanceof HTMLTableRowElement?"table-row":t instanceof HTMLTableCellElement?"table-cell":"block"):t.style.setProperty("display","none")}static show(t){t.style.setProperty("display",t instanceof HTMLTableRowElement?"table-row":t instanceof HTMLTableCellElement?"table-cell":"block")}static hide(t){t.style.setProperty("display","none")}static fixProp(t){const e={cellpadding:"cellPadding",cellspacing:"cellSpacing",class:"className",colspan:"colSpan",contenteditable:"contentEditable",for:"htmlFor",frameborder:"frameBorder",maxlength:"maxLength",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"};return e[t]?e[t]:t}static prop(t,e,s){if(s===void 0&&typeof e=="string")return t[e];{let n={};typeof e=="object"?n=e:typeof e=="string"&&s!==void 0&&(n[e]=s),Object.entries(n).forEach(([r,a])=>{const o=this.fixProp(r);t[o]=a,o=="innerHTML"&&this.scriptConvert(t)})}}static removeProp(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&delete t[this.fixProp(s.trim())]})}static 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 scriptConvert(t){const e=s=>{const r=s.ownerDocument.createElement("script");r.text=s.text;const a=s.attributes;for(let o=0;o<a.length;o++)r.setAttribute(a[o].name,a[o].value);return r};return t.tagName=="SCRIPT"&&(t=e(t)),t.querySelectorAll&&t.querySelectorAll("script").forEach(s=>{s.parentNode?.replaceChild(e(s),s)}),t}static insert(t,e,s="append"){return typeof e=="string"?t[s](this.fragment(e)):(e instanceof HTMLElement||e instanceof SVGElement)&&t[s](e),this}static createElement(t){return document.createElement.call(document,t)}static createTextNode(t){return document.createTextNode.call(document,t)}static createDocumentFragment(){return document.createDocumentFragment.call(document)}static fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(s=>{const n=this.scriptConvert(s);n!=s&&e.content.replaceChild(n,s)}),e.content}static remove(t){return t.remove()}static siblings=t=>Array.prototype.slice.call(t.parentElement?.children).filter(e=>e!==t);static nextElementSibling(t){return t.nextElementSibling}static previousElementSibling(t){return t.previousElementSibling}static closest(t,e){return t.closest(e)}static shadowRoot(t){return t.shadowRoot}static parentElement=t=>t.parentElement;static parents(t,e=[]){return!t||t.parentElement===null?e:L.parents(t.parentElement,e.concat([t]))}static overflow(t){return ee(t,"overflow")+ee(t,"overflow-y")+ee(t,"overflow-x")}static getScrollParent(t){if(!(t instanceof HTMLElement||t instanceof SVGElement))return;const e=L.parents(t.parentElement,[]);for(let s=0;s<e.length;s+=1)if(/(auto|scroll)/.test(L.overflow(e[s])))return e[s];return document.scrollingElement||document.documentElement}static contains(t,e){return t.contains?t!=e&&t.contains(e):!!(t.compareDocumentPosition(e)&16)}static isInputElement(t){return t.tagName==="INPUT"||t instanceof HTMLInputElement}static isInputCheckboxElement(t){return L.isInputElement(t)&&t.getAttribute("type")==="checkbox"}static isInputRadioElement(t){return L.isInputElement(t)&&t.getAttribute("type")==="radio"}static isInputTextElement(t){return L.isInputElement(t)&&t.getAttribute("type")==="text"}static isInputNumberElement(t){return L.isInputElement(t)&&t.getAttribute("type")==="number"}static isSelectElement(t){return t instanceof HTMLSelectElement}static isTextAreaElement(t){return t instanceof HTMLTextAreaElement}static changeSelectSelected(t,e){if(t instanceof HTMLSelectElement){const s=t.options;for(let n=0,r=s.length;n<r;n++)s[n].value==e?s[n].selected=!0:s[n].selected=!1}}static changeRadioChecked(t,e){t instanceof HTMLInputElement&&(t.value==e?t.checked=!0:t.checked=!1)}static entity2text(t){const e={lt:60,"lt;":60,"AMP;":38,AMP:38,"GT;":62,GT:62,"QUOT;":34,QUOT:34,"apos;":39,"bull;":8226,"bullet;":8226,"copy;":169,copy:169,"deg;":176,deg:176};let s;return t.charAt(0)=="#"?t.charAt(1).toLowerCase()=="x"?s=parseInt(t.substring(2),16):s=parseInt(t.substring(1),10):s=e[t],s?String.fromCharCode(s):"&"+t}static 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},Ut=(i,t)=>(typeof i=="string"&&(i=os(i)||new RegExp(i)),i.test(t)),Sn=(i,t)=>{typeof i=="string"&&(i=os(i)||new RegExp(i));const e=t.match(i);return e?i.flags.toLowerCase().indexOf("g")>=0?e.map(s=>({matchIndex:-1,fullMatch:s,groupMatchs:[]})):{matchIndex:typeof e.index=="number"?e.index:-1,fullMatch:e[0],groupMatchs:e.slice(1)}:null},Cn=(i,t)=>{typeof i=="string"&&(i=os(i)||new RegExp(i));const e=[],s=t.matchAll(i);for(const n of s)e.push({matchIndex:typeof n.index=="number"?n.index:-1,fullMatch:n[0],groupMatchs:n.slice(1)});return e};function ao(i){const t=i.match(/[\s\S]/gu);return t?t.length:0}function Tn(i,t){const e=i.codePointAt(t);return e?String.fromCodePoint(e):void 0}function Pn(i=12){const t="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghijklmnopqrstuvwxyz0123456789",e=t.length;let s="";for(let n=0;n<i;n++)s+=t[Math.floor(Math.random()*e)];return s}function oo(i){return i.replace(/(^\w)/g,t=>t.toLowerCase())}const dt=(i,t="-")=>{let e=i.replace(new RegExp(`${t}?([A-Z])`,"g"),t+"$1").toLowerCase();return e=e.replace(new RegExp(`^${t}`),""),e};function ho(i){return i.replace(/(^\w|[_-]\w)/g,t=>t.slice(-1).toUpperCase())}function hs(i){return oo(ho(i))}function En(i){let t="";for(let e=0,s=i.length;e<s;e++){const n=i.charCodeAt(e);n>=1&&n<=127?t+=i.charAt(e):n>2047?(t+=String.fromCharCode(224|n>>12&15),t+=String.fromCharCode(128|n>>6&63),t+=String.fromCharCode(128|n>>0&63)):(t+=String.fromCharCode(192|n>>6&31),t+=String.fromCharCode(128|n>>0&63))}return t}function _n(i){return i!=null}function co(i,...t){return new i.constructor(...t)}function An(i,t){for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&!t(e,i[e])&&delete i[e];return i}function lo(i,t="",e=["","sign","key"]){return Object.keys(i).filter(s=>{for(let n=0,r=e.length;n<r;n++)if(i[s]==e[n])return!1;return!0}).sort().map(s=>`${s}=${i[s]}`).join("&")+t}function xe(i,t){const e=i.findIndex(s=>s===t);return e>=0&&i.splice(e,1),i}function Dn(i,t){return i.findIndex(e=>e==t)>=0}function uo(i,...t){return t.forEach(e=>{Dn(i,e)||i.push(e)}),i}let Mn;try{Mn=Map}catch{Mn=function(){}}let In;try{In=Set}catch{In=function(){}}function Jt(i,t){if(i=parseFloat(i),isNaN(i)){if(typeof t=="number")return t;throw new Error(`parseNumber(${i}) isNaN!`)}return i}function cs(i,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(i-t)<e}const j=(i,t,e)=>i<t?t:i>e?e:i,fo=(i,t,e)=>s=>{const n=j(s,i,t);return e==0?n:t-n<e?t:Math.round(n/e)*e};function mo(i,t=12){return Jt(i).toFixed(t)}function Mt(i,t=12){return+mo(i,t)}function ni(i,t){const e=Sn("number-single",String(i));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):_n(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?i.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?i.substring(e.matchIndex+e.fullMatch.length):""}}function kn(i){const t=Sn("number",i);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}po();function po(){const i=new ArrayBuffer(4),t=new Float32Array(i),e=new Uint32Array(i),s=new Uint32Array(512),n=new Uint32Array(512);for(let h=0;h<256;++h){const c=h-127;c<-27?(s[h]=0,s[h|256]=32768,n[h]=24,n[h|256]=24):c<-14?(s[h]=1024>>-c-14,s[h|256]=1024>>-c-14|32768,n[h]=-c-1,n[h|256]=-c-1):c<=15?(s[h]=c+15<<10,s[h|256]=c+15<<10|32768,n[h]=13,n[h|256]=13):c<128?(s[h]=31744,s[h|256]=64512,n[h]=24,n[h|256]=24):(s[h]=31744,s[h|256]=64512,n[h]=13,n[h|256]=13)}const r=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let h=1;h<1024;++h){let c=h<<13,l=0;for(;!(c&8388608);)c<<=1,l-=8388608;c&=-8388609,l+=947912704,r[h]=c|l}for(let h=1024;h<2048;++h)r[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)a[h]=h<<23;a[31]=1199570944,a[32]=2147483648;for(let h=33;h<63;++h)a[h]=2147483648+(h-32<<23);a[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(o[h]=1024);return{floatView:t,uint32View:e,baseTable:s,shiftTable:n,mantissaTable:r,exponentTable:a,offsetTable:o}}var It=(i=>(i.UNKNOWN="",i.TEXT="text/plain",i.MD="text/plain",i.HTML="text/html",i.XML_TEXT="text/xml",i.CSS="text/css",i.JPEG="image/jpeg",i.PNG="image/png",i.GIF="image/gif",i.BMP="image/bmp",i.WEBP="image/webp",i.SVG="image/svg+xml",i.ICON="image/x-icon",i.MICROSOFT_ICON="image/vnd.microsoft.icon",i.MPEG="audio/mpeg",i.MP3="audio/mpeg",i.MP4="video/mp4",i.OGG="audio/ogg",i.WAV="audio/wav",i.MIDI="audio/midi",i.WEBM="video/webm",i.VIDEO_OGG="video/ogg",i.OCTET_STREAM="application/octet-stream",i.JAVASCRIPT="application/javascript",i.ECMASCRIPT="application/ecmascript",i.JSON="application/json",i.XML="application/xml",i.XHTML="application/xhtml+xml",i.XWWW="application/x-www-form-urlencoded",i.DOC="application/msword",i.CSV="application/x-csv",i.EXCEL="application/vnb.ms-excel",i.PPT="application/vnb.mspowerpoint",i.PDF="application/pdf",i.ZIP="application/zip",i.TGZ="application/x-gtar",i.TAR_GZ="application/x-gzip",i.EOT="appliaction/vnd.ms-fontobject",i.TTF="aplication/font-sfnt",i.PKCS12="aplication/pkcs12",i))(It||{}),Me=(i=>(i.ascii="ascii",i.utf8="utf8",i.utf16le="utf16le",i.ucs2="ucs2",i.base64="base64",i.base64url="base64url",i.latin1="latin1",i.binary="binary",i.hex="hex",i))(Me||{}),ce=(i=>(i.text="text",i.dataURL="dataURL",i.binaryString="binaryString",i.arrayBuffer="arrayBuffer",i))(ce||{});const be=(i,t=16)=>{let e=i.toLowerCase();const s=e.indexOf("0b")==0,n=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(s||n||r)&&(e=e.slice(2)),s&&(t=2),n&&(t=8),r&&(t=16);const a=parseInt(e,t);if(isNaN(a))throw new Error(`radixStringToNumber(${i}, ${t}) 无法解析!`);return a};function go(i){return new TextEncoder().encode(i)}function yo(i,t=Me.utf8){return new TextDecoder(t).decode(i)}const ri=(i,t,e)=>t?e===Me.base64?new Blob([i],{type:`${t};${e}`}):e===Me.utf8?new Blob([i],{type:`${t};charset=${e}`}):new Blob([i],{type:`${t}`}):new Blob([i]),Ln=i=>{let t=It.UNKNOWN;switch(new DataView(i).getUint32(0,wo()).toString(16).toUpperCase()){case"FFD8FFDB":t=It.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=It.JPEG;break;case"89504E47":t=It.PNG;break;case"47494638":t=It.GIF;break;case"52494646":t=It.WEBP;break;case"25504446":t=It.PDF;break;case"504B0304":t=It.ZIP;break}return t};function wo(){const i=Uint32Array.of(305419896),t=new Uint8Array(i.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}function Q(){return(performance||Date).now()}function xo(i){let t=0;for(let e=5;e>=0;e=e-2)e==5?t+=i[e-1]*10+i[e]:e==3?t+=(i[e-1]*10+i[e])*60:e==1&&(t+=(i[e-1]*10+i[e])*60*60);return t=Math.floor(Math.max(0,t)),t*1e3}function bo(i){let t=xo(i)/1e3;const e=t%60;i[5]=e%10,i[4]=Math.floor(e/10),t=Math.floor(t/60);const s=t%60;i[3]=s%10,i[2]=Math.floor(s/10),t=Math.floor(t/60);const n=t%60%24;return i[1]=n%10,i[0]=Math.floor(n/10),i}function vo(i,t=1){return i[5]+=t,bo(i)}const So=(i,t=":")=>{const e=`${i[0]}${i[1]}`,s=`${i[2]}${i[3]}`,n=`${i[4]}${i[5]}`;return[e,s,n].join(t)};function Co(i,t){let e;return function(...s){clearTimeout(e),e=setTimeout(()=>{i.apply(this,s)},t)}}class ls{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=>{s(...e)}),this}once(t,e){const n=(()=>{let r=!1;return(...a)=>{r||(r=!0,e(...a),this.off(t,n))}})();return this.on(t,n),this}}const ve=()=>{};let Ie;function yt(i){Ie=i,i(),Ie=null}class To{subscribers=new Set;add(){Ie&&!this.subscribers.has(Ie)&&this.subscribers.add(Ie)}notify(){this.subscribers.forEach(t=>t())}}const Rn=new WeakMap;function ai(i,t){let e=Rn.get(i);e||(e=new Map,Rn.set(i,e));let s=e.get(t);return s||(s=new To,e.set(t,s)),s}function Po(i){return Object.keys(i).forEach(t=>{let e=i[t];const s=ai(i,t);Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get(){return s.add(),e},set(n){e!=n&&(e=n,s.notify())}})}),i}function oi(i){return Po({value:i})}function Eo(i){const t={get(e,s,n){return ai(i,s).add(),Reflect.get(e,s,n)},set(e,s,n,r){const a=ai(i,s),o=Reflect.get(e,s,r),h=Reflect.set(e,s,n,r);return o!=n&&a.notify(),h}};return new Proxy(i,t)}const On=Eo;var Fn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function _o(i,t={}){var e=1,s=1;function n(O){var k=O.match(/\n/g);k&&(e+=k.length);var U=O.lastIndexOf(`
|
|
11
|
+
`);s=~U?O.length-U:s+O.length}function r(){var O={line:e,column:s};return function(k){return k.position=new a(O),p(),k}}function a(O){this.start=O,this.end={line:e,column:s},this.source=t.source}a.prototype.content=i;var o=[];function h(O){var k=new Error(t.source+":"+e+":"+s+": "+O);if(k.reason=O,k.filename=t.source,k.line=e,k.column=s,k.source=i,t.silent)o.push(k);else throw k}function c(){var O=y();return{type:"stylesheet",stylesheet:{source:t.source,rules:O,parsingErrors:o}}}function l(){return b(/^{\s*/)}function f(){return b(/^}/)}function y(){var O,k=[];for(p(),E(k);i.length&&i.charAt(0)!="}"&&(O=pe()||Ae());)O!==!1&&(k.push(O),E(k));return k}function b(O){var k=O.exec(i);if(k){var U=k[0];return n(U),i=i.slice(U.length),k}}function p(){b(/^\s*/)}function E(O){var k;for(O=O||[];k=_();)k!==!1&&O.push(k);return O}function _(){var O=r();if(!(i.charAt(0)!="/"||i.charAt(1)!="*")){for(var k=2;i.charAt(k)!=""&&(i.charAt(k)!="*"||i.charAt(k+1)!="/");)++k;if(k+=2,i.charAt(k-1)==="")return h("End of comment missing");var U=i.slice(2,k-2);return s+=2,n(U),i=i.slice(k),s+=2,O({type:"comment",comment:U})}}function v(){var O=b(/^([^{]+)/);if(O)return Yt(O[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(k){return k.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(k){return k.replace(/\u200C/g,",")})}function x(){var O=r(),k=b(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(k){if(k=Yt(k[0]),!b(/^:\s*/))return h("property missing ':'");var U=b(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),V=O({type:"declaration",property:k.replace(Fn,""),value:U?Yt(U[0]).replace(Fn,""):""});return b(/^[;\s]*/),V}}function w(){var O=[];if(!l())return h("missing '{'");E(O);for(var k;k=x();)k!==!1&&(O.push(k),E(O));return f()?O:h("missing '}'")}function g(){for(var O,k=[],U=r();O=b(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)k.push(O[1]),b(/^,\s*/);if(k.length)return U({type:"keyframe",values:k,declarations:w()})}function P(){var O=r(),k=b(/^@([-\w]+)?keyframes\s*/);if(k){var U=k[1];if(k=b(/^([-\w]+)\s*/),!k)return h("@keyframes missing name");var V=k[1];if(!l())return h("@keyframes missing '{'");for(var ut,At=E();ut=g();)At.push(ut),At=At.concat(E());return f()?O({type:"keyframes",name:V,vendor:U,keyframes:At}):h("@keyframes missing '}'")}}function C(){var O=r(),k=b(/^@supports *([^{]+)/);if(k){var U=Yt(k[1]);if(!l())return h("@supports missing '{'");var V=E().concat(y());return f()?O({type:"supports",supports:U,rules:V}):h("@supports missing '}'")}}function B(){var O=r(),k=b(/^@host\s*/);if(k){if(!l())return h("@host missing '{'");var U=E().concat(y());return f()?O({type:"host",rules:U}):h("@host missing '}'")}}function H(){var O=r(),k=b(/^@media *([^{]+)/);if(k){var U=Yt(k[1]);if(!l())return h("@media missing '{'");var V=E().concat(y());return f()?O({type:"media",media:U,rules:V}):h("@media missing '}'")}}function G(){var O=r(),k=b(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(k)return O({type:"custom-media",name:Yt(k[1]),media:Yt(k[2])})}function J(){var O=r(),k=b(/^@page */);if(k){var U=v()||[];if(!l())return h("@page missing '{'");for(var V=E(),ut;ut=x();)V.push(ut),V=V.concat(E());return f()?O({type:"page",selectors:U,declarations:V}):h("@page missing '}'")}}function Z(){var O=r(),k=b(/^@([-\w]+)?document *([^{]+)/);if(k){var U=Yt(k[1]),V=Yt(k[2]);if(!l())return h("@document missing '{'");var ut=E().concat(y());return f()?O({type:"document",document:V,vendor:U,rules:ut}):h("@document missing '}'")}}function at(){var O=r(),k=b(/^@font-face\s*/);if(k){if(!l())return h("@font-face missing '{'");for(var U=E(),V;V=x();)U.push(V),U=U.concat(E());return f()?O({type:"font-face",declarations:U}):h("@font-face missing '}'")}}var Ct=oe("import"),gt=oe("charset"),_e=oe("namespace");function oe(O){var k=new RegExp("^@"+O+"\\s*([^;]+);");return function(){var U=r(),V=b(k);if(V){var ut={type:O};return ut[O]=V[1].trim(),U(ut)}}}function pe(){if(i[0]=="@")return P()||H()||G()||C()||Ct()||gt()||_e()||Z()||J()||B()||at()}function Ae(){var O=r(),k=v();return k?(E(),O({type:"rule",selectors:k,declarations:w()})):h("selector missing")}return hi(c())}function Yt(i){return i?i.replace(/^\s+|\s+$/g,""):""}function hi(i,t){var e=i&&typeof i.type=="string",s=e?i:t;for(var n in i){var r=i[n];Array.isArray(r)?r.forEach(function(a){hi(a,s)}):r&&typeof r=="object"&&hi(r,s)}return e&&Object.defineProperty(i,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),i}const Ao={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:i=>{const t=["th","st","nd","rd"],e=i%100;return`[${i}${t[(e-20)%10]||t[e]||t[0]}]`}};let us="en";const fs={};fs[us]=Ao;function Nn(i,t){if(!i)return us;let e;if(typeof i=="string"){const s=i.toLowerCase();fs[s]&&(e=s),t&&(fs[s]=t,e=s);const n=i.split("-");if(!e&&n.length>1)return Nn(n[0])}else{const{name:s}=i;fs[s]=i,e=s}return e&&(us=e),e||us}const Do={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:(i,t)=>{switch(t){case"W":return`${i}周`;default:return`${i}日`}},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:(i,t)=>{const e=i*100+t;return e<600?"凌晨":e<900?"早上":e<1100?"上午":e<1300?"中午":e<1800?"下午":"晚上"}};Nn(Do);function Mo(i,t=(e,s)=>e<=s){const e=i.length;let s=Math.floor(e/2);for(;s>0;){for(let n=s;n<e;n++){const r=i[n];let a=n;for(;a>=s&&!t(i[a-s],r);)i[a]=i[a-s],a-=s;i[a]=r}s=Math.floor(s/2)}}function Io(){const i={};return i.promise=new Promise((t,e)=>{i.resolve=t,i.reject=e}),i}let Bn;try{Bn=Promise}catch{Bn=function(){}}class Un{maps=new Map;mapsAddedDuringUpdate=new Map;entries(){return Array.from(this.maps.entries())}keys(){return Array.from(this.maps.keys())}values(){return Array.from(this.maps.values())}get length(){return this.entries().length}set(t,e){this.maps.set(t,e),this.mapsAddedDuringUpdate.set(t,e)}get(t){return this.maps.get(t)}shift(){const t=this.entries();if(t.length){const[e,s]=t[0];return this.delete(e),[e,s]}}delete(t){return this.mapsAddedDuringUpdate.delete(t),this.maps.delete(t)}deleteAll(){this.maps=new Map,this.mapsAddedDuringUpdate=new Map}filter(t){let e=Array.from(this.maps.entries());for(;e.length>0;){this.mapsAddedDuringUpdate=new Map;for(let s=0,n=e.length;s<n;s++){const[r,a]=e[s];t(r,a)===!1&&this.delete(r)}e=Array.from(this.mapsAddedDuringUpdate.entries())}}}function Yn(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Xn={exports:{}};(function(i,t){(function(e){i.exports=e()})(function(e){var s=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(v,x){var w=v[0],g=v[1],P=v[2],C=v[3];w+=(g&P|~g&C)+x[0]-680876936|0,w=(w<<7|w>>>25)+g|0,C+=(w&g|~w&P)+x[1]-389564586|0,C=(C<<12|C>>>20)+w|0,P+=(C&w|~C&g)+x[2]+606105819|0,P=(P<<17|P>>>15)+C|0,g+=(P&C|~P&w)+x[3]-1044525330|0,g=(g<<22|g>>>10)+P|0,w+=(g&P|~g&C)+x[4]-176418897|0,w=(w<<7|w>>>25)+g|0,C+=(w&g|~w&P)+x[5]+1200080426|0,C=(C<<12|C>>>20)+w|0,P+=(C&w|~C&g)+x[6]-1473231341|0,P=(P<<17|P>>>15)+C|0,g+=(P&C|~P&w)+x[7]-45705983|0,g=(g<<22|g>>>10)+P|0,w+=(g&P|~g&C)+x[8]+1770035416|0,w=(w<<7|w>>>25)+g|0,C+=(w&g|~w&P)+x[9]-1958414417|0,C=(C<<12|C>>>20)+w|0,P+=(C&w|~C&g)+x[10]-42063|0,P=(P<<17|P>>>15)+C|0,g+=(P&C|~P&w)+x[11]-1990404162|0,g=(g<<22|g>>>10)+P|0,w+=(g&P|~g&C)+x[12]+1804603682|0,w=(w<<7|w>>>25)+g|0,C+=(w&g|~w&P)+x[13]-40341101|0,C=(C<<12|C>>>20)+w|0,P+=(C&w|~C&g)+x[14]-1502002290|0,P=(P<<17|P>>>15)+C|0,g+=(P&C|~P&w)+x[15]+1236535329|0,g=(g<<22|g>>>10)+P|0,w+=(g&C|P&~C)+x[1]-165796510|0,w=(w<<5|w>>>27)+g|0,C+=(w&P|g&~P)+x[6]-1069501632|0,C=(C<<9|C>>>23)+w|0,P+=(C&g|w&~g)+x[11]+643717713|0,P=(P<<14|P>>>18)+C|0,g+=(P&w|C&~w)+x[0]-373897302|0,g=(g<<20|g>>>12)+P|0,w+=(g&C|P&~C)+x[5]-701558691|0,w=(w<<5|w>>>27)+g|0,C+=(w&P|g&~P)+x[10]+38016083|0,C=(C<<9|C>>>23)+w|0,P+=(C&g|w&~g)+x[15]-660478335|0,P=(P<<14|P>>>18)+C|0,g+=(P&w|C&~w)+x[4]-405537848|0,g=(g<<20|g>>>12)+P|0,w+=(g&C|P&~C)+x[9]+568446438|0,w=(w<<5|w>>>27)+g|0,C+=(w&P|g&~P)+x[14]-1019803690|0,C=(C<<9|C>>>23)+w|0,P+=(C&g|w&~g)+x[3]-187363961|0,P=(P<<14|P>>>18)+C|0,g+=(P&w|C&~w)+x[8]+1163531501|0,g=(g<<20|g>>>12)+P|0,w+=(g&C|P&~C)+x[13]-1444681467|0,w=(w<<5|w>>>27)+g|0,C+=(w&P|g&~P)+x[2]-51403784|0,C=(C<<9|C>>>23)+w|0,P+=(C&g|w&~g)+x[7]+1735328473|0,P=(P<<14|P>>>18)+C|0,g+=(P&w|C&~w)+x[12]-1926607734|0,g=(g<<20|g>>>12)+P|0,w+=(g^P^C)+x[5]-378558|0,w=(w<<4|w>>>28)+g|0,C+=(w^g^P)+x[8]-2022574463|0,C=(C<<11|C>>>21)+w|0,P+=(C^w^g)+x[11]+1839030562|0,P=(P<<16|P>>>16)+C|0,g+=(P^C^w)+x[14]-35309556|0,g=(g<<23|g>>>9)+P|0,w+=(g^P^C)+x[1]-1530992060|0,w=(w<<4|w>>>28)+g|0,C+=(w^g^P)+x[4]+1272893353|0,C=(C<<11|C>>>21)+w|0,P+=(C^w^g)+x[7]-155497632|0,P=(P<<16|P>>>16)+C|0,g+=(P^C^w)+x[10]-1094730640|0,g=(g<<23|g>>>9)+P|0,w+=(g^P^C)+x[13]+681279174|0,w=(w<<4|w>>>28)+g|0,C+=(w^g^P)+x[0]-358537222|0,C=(C<<11|C>>>21)+w|0,P+=(C^w^g)+x[3]-722521979|0,P=(P<<16|P>>>16)+C|0,g+=(P^C^w)+x[6]+76029189|0,g=(g<<23|g>>>9)+P|0,w+=(g^P^C)+x[9]-640364487|0,w=(w<<4|w>>>28)+g|0,C+=(w^g^P)+x[12]-421815835|0,C=(C<<11|C>>>21)+w|0,P+=(C^w^g)+x[15]+530742520|0,P=(P<<16|P>>>16)+C|0,g+=(P^C^w)+x[2]-995338651|0,g=(g<<23|g>>>9)+P|0,w+=(P^(g|~C))+x[0]-198630844|0,w=(w<<6|w>>>26)+g|0,C+=(g^(w|~P))+x[7]+1126891415|0,C=(C<<10|C>>>22)+w|0,P+=(w^(C|~g))+x[14]-1416354905|0,P=(P<<15|P>>>17)+C|0,g+=(C^(P|~w))+x[5]-57434055|0,g=(g<<21|g>>>11)+P|0,w+=(P^(g|~C))+x[12]+1700485571|0,w=(w<<6|w>>>26)+g|0,C+=(g^(w|~P))+x[3]-1894986606|0,C=(C<<10|C>>>22)+w|0,P+=(w^(C|~g))+x[10]-1051523|0,P=(P<<15|P>>>17)+C|0,g+=(C^(P|~w))+x[1]-2054922799|0,g=(g<<21|g>>>11)+P|0,w+=(P^(g|~C))+x[8]+1873313359|0,w=(w<<6|w>>>26)+g|0,C+=(g^(w|~P))+x[15]-30611744|0,C=(C<<10|C>>>22)+w|0,P+=(w^(C|~g))+x[6]-1560198380|0,P=(P<<15|P>>>17)+C|0,g+=(C^(P|~w))+x[13]+1309151649|0,g=(g<<21|g>>>11)+P|0,w+=(P^(g|~C))+x[4]-145523070|0,w=(w<<6|w>>>26)+g|0,C+=(g^(w|~P))+x[11]-1120210379|0,C=(C<<10|C>>>22)+w|0,P+=(w^(C|~g))+x[2]+718787259|0,P=(P<<15|P>>>17)+C|0,g+=(C^(P|~w))+x[9]-343485551|0,g=(g<<21|g>>>11)+P|0,v[0]=w+v[0]|0,v[1]=g+v[1]|0,v[2]=P+v[2]|0,v[3]=C+v[3]|0}function r(v){var x=[],w;for(w=0;w<64;w+=4)x[w>>2]=v.charCodeAt(w)+(v.charCodeAt(w+1)<<8)+(v.charCodeAt(w+2)<<16)+(v.charCodeAt(w+3)<<24);return x}function a(v){var x=[],w;for(w=0;w<64;w+=4)x[w>>2]=v[w]+(v[w+1]<<8)+(v[w+2]<<16)+(v[w+3]<<24);return x}function o(v){var x=v.length,w=[1732584193,-271733879,-1732584194,271733878],g,P,C,B,H,G;for(g=64;g<=x;g+=64)n(w,r(v.substring(g-64,g)));for(v=v.substring(g-64),P=v.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0;g<P;g+=1)C[g>>2]|=v.charCodeAt(g)<<(g%4<<3);if(C[g>>2]|=128<<(g%4<<3),g>55)for(n(w,C),g=0;g<16;g+=1)C[g]=0;return B=x*8,B=B.toString(16).match(/(.*?)(.{0,8})$/),H=parseInt(B[2],16),G=parseInt(B[1],16)||0,C[14]=H,C[15]=G,n(w,C),w}function h(v){var x=v.length,w=[1732584193,-271733879,-1732584194,271733878],g,P,C,B,H,G;for(g=64;g<=x;g+=64)n(w,a(v.subarray(g-64,g)));for(v=g-64<x?v.subarray(g-64):new Uint8Array(0),P=v.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0;g<P;g+=1)C[g>>2]|=v[g]<<(g%4<<3);if(C[g>>2]|=128<<(g%4<<3),g>55)for(n(w,C),g=0;g<16;g+=1)C[g]=0;return B=x*8,B=B.toString(16).match(/(.*?)(.{0,8})$/),H=parseInt(B[2],16),G=parseInt(B[1],16)||0,C[14]=H,C[15]=G,n(w,C),w}function c(v){var x="",w;for(w=0;w<4;w+=1)x+=s[v>>w*8+4&15]+s[v>>w*8&15];return x}function l(v){var x;for(x=0;x<v.length;x+=1)v[x]=c(v[x]);return v.join("")}l(o("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function v(x,w){return x=x|0||0,x<0?Math.max(x+w,0):Math.min(x,w)}ArrayBuffer.prototype.slice=function(x,w){var g=this.byteLength,P=v(x,g),C=g,B,H,G,J;return w!==e&&(C=v(w,g)),P>C?new ArrayBuffer(0):(B=C-P,H=new ArrayBuffer(B),G=new Uint8Array(H),J=new Uint8Array(this,P,B),G.set(J),H)}}();function f(v){return/[\u0080-\uFFFF]/.test(v)&&(v=unescape(encodeURIComponent(v))),v}function y(v,x){var w=v.length,g=new ArrayBuffer(w),P=new Uint8Array(g),C;for(C=0;C<w;C+=1)P[C]=v.charCodeAt(C);return x?P:g}function b(v){return String.fromCharCode.apply(null,new Uint8Array(v))}function p(v,x,w){var g=new Uint8Array(v.byteLength+x.byteLength);return g.set(new Uint8Array(v)),g.set(new Uint8Array(x),v.byteLength),w?g:g.buffer}function E(v){var x=[],w=v.length,g;for(g=0;g<w-1;g+=2)x.push(parseInt(v.substr(g,2),16));return String.fromCharCode.apply(String,x)}function _(){this.reset()}return _.prototype.append=function(v){return this.appendBinary(f(v)),this},_.prototype.appendBinary=function(v){this._buff+=v,this._length+=v.length;var x=this._buff.length,w;for(w=64;w<=x;w+=64)n(this._hash,r(this._buff.substring(w-64,w)));return this._buff=this._buff.substring(w-64),this},_.prototype.end=function(v){var x=this._buff,w=x.length,g,P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],C;for(g=0;g<w;g+=1)P[g>>2]|=x.charCodeAt(g)<<(g%4<<3);return this._finish(P,w),C=l(this._hash),v&&(C=E(C)),this.reset(),C},_.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},_.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},_.prototype.setState=function(v){return this._buff=v.buff,this._length=v.length,this._hash=v.hash,this},_.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},_.prototype._finish=function(v,x){var w=x,g,P,C;if(v[w>>2]|=128<<(w%4<<3),w>55)for(n(this._hash,v),w=0;w<16;w+=1)v[w]=0;g=this._length*8,g=g.toString(16).match(/(.*?)(.{0,8})$/),P=parseInt(g[2],16),C=parseInt(g[1],16)||0,v[14]=P,v[15]=C,n(this._hash,v)},_.hash=function(v,x){return _.hashBinary(f(v),x)},_.hashBinary=function(v,x){var w=o(v),g=l(w);return x?E(g):g},_.ArrayBuffer=function(){this.reset()},_.ArrayBuffer.prototype.append=function(v){var x=p(this._buff.buffer,v,!0),w=x.length,g;for(this._length+=v.byteLength,g=64;g<=w;g+=64)n(this._hash,a(x.subarray(g-64,g)));return this._buff=g-64<w?new Uint8Array(x.buffer.slice(g-64)):new Uint8Array(0),this},_.ArrayBuffer.prototype.end=function(v){var x=this._buff,w=x.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],P,C;for(P=0;P<w;P+=1)g[P>>2]|=x[P]<<(P%4<<3);return this._finish(g,w),C=l(this._hash),v&&(C=E(C)),this.reset(),C},_.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},_.ArrayBuffer.prototype.getState=function(){var v=_.prototype.getState.call(this);return v.buff=b(v.buff),v},_.ArrayBuffer.prototype.setState=function(v){return v.buff=y(v.buff,!0),_.prototype.setState.call(this,v)},_.ArrayBuffer.prototype.destroy=_.prototype.destroy,_.ArrayBuffer.prototype._finish=_.prototype._finish,_.ArrayBuffer.hash=function(v,x){var w=h(new Uint8Array(v)),g=l(w);return x?E(g):g},_})})(Xn);var ko=Xn.exports;const Lo=Yn(ko);function Vn(i,t){return function(){return i.apply(t,arguments)}}const{toString:Ro}=Object.prototype,{getPrototypeOf:ci}=Object,ds=(i=>t=>{const e=Ro.call(t);return i[e]||(i[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),kt=i=>(i=i.toLowerCase(),t=>ds(t)===i),ms=i=>t=>typeof t===i,{isArray:Se}=Array,ke=ms("undefined");function Oo(i){return i!==null&&!ke(i)&&i.constructor!==null&&!ke(i.constructor)&&vt(i.constructor.isBuffer)&&i.constructor.isBuffer(i)}const zn=kt("ArrayBuffer");function Fo(i){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(i):t=i&&i.buffer&&zn(i.buffer),t}const No=ms("string"),vt=ms("function"),Gn=ms("number"),ps=i=>i!==null&&typeof i=="object",Bo=i=>i===!0||i===!1,gs=i=>{if(ds(i)!=="object")return!1;const t=ci(i);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)},Uo=kt("Date"),Yo=kt("File"),Xo=kt("Blob"),Vo=kt("FileList"),zo=i=>ps(i)&&vt(i.pipe),Go=i=>{let t;return i&&(typeof FormData=="function"&&i instanceof FormData||vt(i.append)&&((t=ds(i))==="formdata"||t==="object"&&vt(i.toString)&&i.toString()==="[object FormData]"))},qo=kt("URLSearchParams"),Ho=i=>i.trim?i.trim():i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Le(i,t,{allOwnKeys:e=!1}={}){if(i===null||typeof i>"u")return;let s,n;if(typeof i!="object"&&(i=[i]),Se(i))for(s=0,n=i.length;s<n;s++)t.call(null,i[s],s,i);else{const r=e?Object.getOwnPropertyNames(i):Object.keys(i),a=r.length;let o;for(s=0;s<a;s++)o=r[s],t.call(null,i[o],o,i)}}function qn(i,t){t=t.toLowerCase();const e=Object.keys(i);let s=e.length,n;for(;s-- >0;)if(n=e[s],t===n.toLowerCase())return n;return null}const Hn=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),jn=i=>!ke(i)&&i!==Hn;function li(){const{caseless:i}=jn(this)&&this||{},t={},e=(s,n)=>{const r=i&&qn(t,n)||n;gs(t[r])&&gs(s)?t[r]=li(t[r],s):gs(s)?t[r]=li({},s):Se(s)?t[r]=s.slice():t[r]=s};for(let s=0,n=arguments.length;s<n;s++)arguments[s]&&Le(arguments[s],e);return t}const jo=(i,t,e,{allOwnKeys:s}={})=>(Le(t,(n,r)=>{e&&vt(n)?i[r]=Vn(n,e):i[r]=n},{allOwnKeys:s}),i),$o=i=>(i.charCodeAt(0)===65279&&(i=i.slice(1)),i),Wo=(i,t,e,s)=>{i.prototype=Object.create(t.prototype,s),i.prototype.constructor=i,Object.defineProperty(i,"super",{value:t.prototype}),e&&Object.assign(i.prototype,e)},Jo=(i,t,e,s)=>{let n,r,a;const o={};if(t=t||{},i==null)return t;do{for(n=Object.getOwnPropertyNames(i),r=n.length;r-- >0;)a=n[r],(!s||s(a,i,t))&&!o[a]&&(t[a]=i[a],o[a]=!0);i=e!==!1&&ci(i)}while(i&&(!e||e(i,t))&&i!==Object.prototype);return t},Zo=(i,t,e)=>{i=String(i),(e===void 0||e>i.length)&&(e=i.length),e-=t.length;const s=i.indexOf(t,e);return s!==-1&&s===e},Ko=i=>{if(!i)return null;if(Se(i))return i;let t=i.length;if(!Gn(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=i[t];return e},Qo=(i=>t=>i&&t instanceof i)(typeof Uint8Array<"u"&&ci(Uint8Array)),th=(i,t)=>{const s=(i&&i[Symbol.iterator]).call(i);let n;for(;(n=s.next())&&!n.done;){const r=n.value;t.call(i,r[0],r[1])}},eh=(i,t)=>{let e;const s=[];for(;(e=i.exec(t))!==null;)s.push(e);return s},sh=kt("HTMLFormElement"),ih=i=>i.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,n){return s.toUpperCase()+n}),$n=(({hasOwnProperty:i})=>(t,e)=>i.call(t,e))(Object.prototype),nh=kt("RegExp"),Wn=(i,t)=>{const e=Object.getOwnPropertyDescriptors(i),s={};Le(e,(n,r)=>{let a;(a=t(n,r,i))!==!1&&(s[r]=a||n)}),Object.defineProperties(i,s)},rh=i=>{Wn(i,(t,e)=>{if(vt(i)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=i[e];if(vt(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},ah=(i,t)=>{const e={},s=n=>{n.forEach(r=>{e[r]=!0})};return Se(i)?s(i):s(String(i).split(t)),e},oh=()=>{},hh=(i,t)=>(i=+i,Number.isFinite(i)?i:t),ui="abcdefghijklmnopqrstuvwxyz",Jn="0123456789",Zn={DIGIT:Jn,ALPHA:ui,ALPHA_DIGIT:ui+ui.toUpperCase()+Jn},ch=(i=16,t=Zn.ALPHA_DIGIT)=>{let e="";const{length:s}=t;for(;i--;)e+=t[Math.random()*s|0];return e};function lh(i){return!!(i&&vt(i.append)&&i[Symbol.toStringTag]==="FormData"&&i[Symbol.iterator])}const uh=i=>{const t=new Array(10),e=(s,n)=>{if(ps(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[n]=s;const r=Se(s)?[]:{};return Le(s,(a,o)=>{const h=e(a,n+1);!ke(h)&&(r[o]=h)}),t[n]=void 0,r}}return s};return e(i,0)},fh=kt("AsyncFunction"),D={isArray:Se,isArrayBuffer:zn,isBuffer:Oo,isFormData:Go,isArrayBufferView:Fo,isString:No,isNumber:Gn,isBoolean:Bo,isObject:ps,isPlainObject:gs,isUndefined:ke,isDate:Uo,isFile:Yo,isBlob:Xo,isRegExp:nh,isFunction:vt,isStream:zo,isURLSearchParams:qo,isTypedArray:Qo,isFileList:Vo,forEach:Le,merge:li,extend:jo,trim:Ho,stripBOM:$o,inherits:Wo,toFlatObject:Jo,kindOf:ds,kindOfTest:kt,endsWith:Zo,toArray:Ko,forEachEntry:th,matchAll:eh,isHTMLForm:sh,hasOwnProperty:$n,hasOwnProp:$n,reduceDescriptors:Wn,freezeMethods:rh,toObjectSet:ah,toCamelCase:ih,noop:oh,toFiniteNumber:hh,findKey:qn,global:Hn,isContextDefined:jn,ALPHABET:Zn,generateString:ch,isSpecCompliantForm:lh,toJSONObject:uh,isAsyncFn:fh,isThenable:i=>i&&(ps(i)||vt(i))&&vt(i.then)&&vt(i.catch)};function X(i,t,e,s,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=i,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),s&&(this.request=s),n&&(this.response=n)}D.inherits(X,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:D.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Kn=X.prototype,Qn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(i=>{Qn[i]={value:i}}),Object.defineProperties(X,Qn),Object.defineProperty(Kn,"isAxiosError",{value:!0}),X.from=(i,t,e,s,n,r)=>{const a=Object.create(Kn);return D.toFlatObject(i,a,function(h){return h!==Error.prototype},o=>o!=="isAxiosError"),X.call(a,i.message,t,e,s,n),a.cause=i,a.name=i.name,r&&Object.assign(a,r),a};const dh=null;function fi(i){return D.isPlainObject(i)||D.isArray(i)}function tr(i){return D.endsWith(i,"[]")?i.slice(0,-2):i}function er(i,t,e){return i?i.concat(t).map(function(n,r){return n=tr(n),!e&&r?"["+n+"]":n}).join(e?".":""):t}function mh(i){return D.isArray(i)&&!i.some(fi)}const ph=D.toFlatObject(D,{},null,function(t){return/^is[A-Z]/.test(t)});function ys(i,t,e){if(!D.isObject(i))throw new TypeError("target must be an object");t=t||new FormData,e=D.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,_){return!D.isUndefined(_[E])});const s=e.metaTokens,n=e.visitor||l,r=e.dots,a=e.indexes,h=(e.Blob||typeof Blob<"u"&&Blob)&&D.isSpecCompliantForm(t);if(!D.isFunction(n))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(D.isDate(p))return p.toISOString();if(!h&&D.isBlob(p))throw new X("Blob is not supported. Use a Buffer instead.");return D.isArrayBuffer(p)||D.isTypedArray(p)?h&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,E,_){let v=p;if(p&&!_&&typeof p=="object"){if(D.endsWith(E,"{}"))E=s?E:E.slice(0,-2),p=JSON.stringify(p);else if(D.isArray(p)&&mh(p)||(D.isFileList(p)||D.endsWith(E,"[]"))&&(v=D.toArray(p)))return E=tr(E),v.forEach(function(w,g){!(D.isUndefined(w)||w===null)&&t.append(a===!0?er([E],g,r):a===null?E:E+"[]",c(w))}),!1}return fi(p)?!0:(t.append(er(_,E,r),c(p)),!1)}const f=[],y=Object.assign(ph,{defaultVisitor:l,convertValue:c,isVisitable:fi});function b(p,E){if(!D.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+E.join("."));f.push(p),D.forEach(p,function(v,x){(!(D.isUndefined(v)||v===null)&&n.call(t,v,D.isString(x)?x.trim():x,E,y))===!0&&b(v,E?E.concat(x):[x])}),f.pop()}}if(!D.isObject(i))throw new TypeError("data must be an object");return b(i),t}function sr(i){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function di(i,t){this._pairs=[],i&&ys(i,this,t)}const ir=di.prototype;ir.append=function(t,e){this._pairs.push([t,e])},ir.toString=function(t){const e=t?function(s){return t.call(this,s,sr)}:sr;return this._pairs.map(function(n){return e(n[0])+"="+e(n[1])},"").join("&")};function gh(i){return encodeURIComponent(i).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function nr(i,t,e){if(!t)return i;const s=e&&e.encode||gh,n=e&&e.serialize;let r;if(n?r=n(t,e):r=D.isURLSearchParams(t)?t.toString():new di(t,e).toString(s),r){const a=i.indexOf("#");a!==-1&&(i=i.slice(0,a)),i+=(i.indexOf("?")===-1?"?":"&")+r}return i}class yh{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){D.forEach(this.handlers,function(s){s!==null&&t(s)})}}const rr=yh,ar={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},wh=typeof URLSearchParams<"u"?URLSearchParams:di,xh=typeof FormData<"u"?FormData:null,bh=typeof Blob<"u"?Blob:null,vh=(()=>{let i;return typeof navigator<"u"&&((i=navigator.product)==="ReactNative"||i==="NativeScript"||i==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Sh=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Lt={isBrowser:!0,classes:{URLSearchParams:wh,FormData:xh,Blob:bh},isStandardBrowserEnv:vh,isStandardBrowserWebWorkerEnv:Sh,protocols:["http","https","file","blob","url","data"]};function Ch(i,t){return ys(i,new Lt.classes.URLSearchParams,Object.assign({visitor:function(e,s,n,r){return Lt.isNode&&D.isBuffer(e)?(this.append(s,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function Th(i){return D.matchAll(/\w+|\[(\w*)]/g,i).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Ph(i){const t={},e=Object.keys(i);let s;const n=e.length;let r;for(s=0;s<n;s++)r=e[s],t[r]=i[r];return t}function or(i){function t(e,s,n,r){let a=e[r++];const o=Number.isFinite(+a),h=r>=e.length;return a=!a&&D.isArray(n)?n.length:a,h?(D.hasOwnProp(n,a)?n[a]=[n[a],s]:n[a]=s,!o):((!n[a]||!D.isObject(n[a]))&&(n[a]=[]),t(e,s,n[a],r)&&D.isArray(n[a])&&(n[a]=Ph(n[a])),!o)}if(D.isFormData(i)&&D.isFunction(i.entries)){const e={};return D.forEachEntry(i,(s,n)=>{t(Th(s),n,e,0)}),e}return null}function Eh(i,t,e){if(D.isString(i))try{return(t||JSON.parse)(i),D.trim(i)}catch(s){if(s.name!=="SyntaxError")throw s}return(e||JSON.stringify)(i)}const mi={transitional:ar,adapter:["xhr","http"],transformRequest:[function(t,e){const s=e.getContentType()||"",n=s.indexOf("application/json")>-1,r=D.isObject(t);if(r&&D.isHTMLForm(t)&&(t=new FormData(t)),D.isFormData(t))return n&&n?JSON.stringify(or(t)):t;if(D.isArrayBuffer(t)||D.isBuffer(t)||D.isStream(t)||D.isFile(t)||D.isBlob(t))return t;if(D.isArrayBufferView(t))return t.buffer;if(D.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 Ch(t,this.formSerializer).toString();if((o=D.isFileList(t))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return ys(o?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||n?(e.setContentType("application/json",!1),Eh(t)):t}],transformResponse:[function(t){const e=this.transitional||mi.transitional,s=e&&e.forcedJSONParsing,n=this.responseType==="json";if(t&&D.isString(t)&&(s&&!this.responseType||n)){const a=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?X.from(o,X.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:Lt.classes.FormData,Blob:Lt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};D.forEach(["delete","get","head","post","put","patch"],i=>{mi.headers[i]={}});const pi=mi,_h=D.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"]),Ah=i=>{const t={};let e,s,n;return i&&i.split(`
|
|
12
|
+
`).forEach(function(a){n=a.indexOf(":"),e=a.substring(0,n).trim().toLowerCase(),s=a.substring(n+1).trim(),!(!e||t[e]&&_h[e])&&(e==="set-cookie"?t[e]?t[e].push(s):t[e]=[s]:t[e]=t[e]?t[e]+", "+s:s)}),t},hr=Symbol("internals");function Re(i){return i&&String(i).trim().toLowerCase()}function ws(i){return i===!1||i==null?i:D.isArray(i)?i.map(ws):String(i)}function Dh(i){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=e.exec(i);)t[s[1]]=s[2];return t}const Mh=i=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(i.trim());function gi(i,t,e,s,n){if(D.isFunction(s))return s.call(this,t,e);if(n&&(t=e),!!D.isString(t)){if(D.isString(s))return t.indexOf(s)!==-1;if(D.isRegExp(s))return s.test(t)}}function Ih(i){return i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,s)=>e.toUpperCase()+s)}function kh(i,t){const e=D.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(i,s+e,{value:function(n,r,a){return this[s].call(this,t,n,r,a)},configurable:!0})})}class xs{constructor(t){t&&this.set(t)}set(t,e,s){const n=this;function r(o,h,c){const l=Re(h);if(!l)throw new Error("header name must be a non-empty string");const f=D.findKey(n,l);(!f||n[f]===void 0||c===!0||c===void 0&&n[f]!==!1)&&(n[f||h]=ws(o))}const a=(o,h)=>D.forEach(o,(c,l)=>r(c,l,h));return D.isPlainObject(t)||t instanceof this.constructor?a(t,e):D.isString(t)&&(t=t.trim())&&!Mh(t)?a(Ah(t),e):t!=null&&r(e,t,s),this}get(t,e){if(t=Re(t),t){const s=D.findKey(this,t);if(s){const n=this[s];if(!e)return n;if(e===!0)return Dh(n);if(D.isFunction(e))return e.call(this,n,s);if(D.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Re(t),t){const s=D.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||gi(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let n=!1;function r(a){if(a=Re(a),a){const o=D.findKey(s,a);o&&(!e||gi(s,s[o],o,e))&&(delete s[o],n=!0)}}return D.isArray(t)?t.forEach(r):r(t),n}clear(t){const e=Object.keys(this);let s=e.length,n=!1;for(;s--;){const r=e[s];(!t||gi(this,this[r],r,t,!0))&&(delete this[r],n=!0)}return n}normalize(t){const e=this,s={};return D.forEach(this,(n,r)=>{const a=D.findKey(s,r);if(a){e[a]=ws(n),delete e[r];return}const o=t?Ih(r):String(r).trim();o!==r&&delete e[r],e[o]=ws(n),s[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return D.forEach(this,(s,n)=>{s!=null&&s!==!1&&(e[n]=t&&D.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(`
|
|
13
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(n=>s.set(n)),s}static accessor(t){const s=(this[hr]=this[hr]={accessors:{}}).accessors,n=this.prototype;function r(a){const o=Re(a);s[o]||(kh(n,a),s[o]=!0)}return D.isArray(t)?t.forEach(r):r(t),this}}xs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),D.reduceDescriptors(xs.prototype,({value:i},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>i,set(s){this[e]=s}}}),D.freezeMethods(xs);const Xt=xs;function yi(i,t){const e=this||pi,s=t||e,n=Xt.from(s.headers);let r=s.data;return D.forEach(i,function(o){r=o.call(e,r,n.normalize(),t?t.status:void 0)}),n.normalize(),r}function cr(i){return!!(i&&i.__CANCEL__)}function Oe(i,t,e){X.call(this,i??"canceled",X.ERR_CANCELED,t,e),this.name="CanceledError"}D.inherits(Oe,X,{__CANCEL__:!0});function Lh(i,t,e){const s=e.config.validateStatus;!e.status||!s||s(e.status)?i(e):t(new X("Request failed with status code "+e.status,[X.ERR_BAD_REQUEST,X.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}const Rh=Lt.isStandardBrowserEnv?function(){return{write:function(e,s,n,r,a,o){const h=[];h.push(e+"="+encodeURIComponent(s)),D.isNumber(n)&&h.push("expires="+new Date(n).toGMTString()),D.isString(r)&&h.push("path="+r),D.isString(a)&&h.push("domain="+a),o===!0&&h.push("secure"),document.cookie=h.join("; ")},read:function(e){const s=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Oh(i){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i)}function Fh(i,t){return t?i.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):i}function lr(i,t){return i&&!Oh(t)?Fh(i,t):t}const Nh=Lt.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let s;function n(r){let a=r;return t&&(e.setAttribute("href",a),a=e.href),e.setAttribute("href",a),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return s=n(window.location.href),function(a){const o=D.isString(a)?n(a):a;return o.protocol===s.protocol&&o.host===s.host}}():function(){return function(){return!0}}();function Bh(i){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i);return t&&t[1]||""}function Uh(i,t){i=i||10;const e=new Array(i),s=new Array(i);let n=0,r=0,a;return t=t!==void 0?t:1e3,function(h){const c=Date.now(),l=s[r];a||(a=c),e[n]=h,s[n]=c;let f=r,y=0;for(;f!==n;)y+=e[f++],f=f%i;if(n=(n+1)%i,n===r&&(r=(r+1)%i),c-a<t)return;const b=l&&c-l;return b?Math.round(y*1e3/b):void 0}}function ur(i,t){let e=0;const s=Uh(50,250);return n=>{const r=n.loaded,a=n.lengthComputable?n.total:void 0,o=r-e,h=s(o),c=r<=a;e=r;const l={loaded:r,total:a,progress:a?r/a:void 0,bytes:o,rate:h||void 0,estimated:h&&a&&c?(a-r)/h:void 0,event:n};l[t?"download":"upload"]=!0,i(l)}}const wi={http:dh,xhr:typeof XMLHttpRequest<"u"&&function(i){return new Promise(function(e,s){let n=i.data;const r=Xt.from(i.headers).normalize(),a=i.responseType;let o;function h(){i.cancelToken&&i.cancelToken.unsubscribe(o),i.signal&&i.signal.removeEventListener("abort",o)}let c;D.isFormData(n)&&(Lt.isStandardBrowserEnv||Lt.isStandardBrowserWebWorkerEnv?r.setContentType(!1):r.getContentType(/^\s*multipart\/form-data/)?D.isString(c=r.getContentType())&&r.setContentType(c.replace(/^\s*(multipart\/form-data);+/,"$1")):r.setContentType("multipart/form-data"));let l=new XMLHttpRequest;if(i.auth){const p=i.auth.username||"",E=i.auth.password?unescape(encodeURIComponent(i.auth.password)):"";r.set("Authorization","Basic "+btoa(p+":"+E))}const f=lr(i.baseURL,i.url);l.open(i.method.toUpperCase(),nr(f,i.params,i.paramsSerializer),!0),l.timeout=i.timeout;function y(){if(!l)return;const p=Xt.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),_={data:!a||a==="text"||a==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:p,config:i,request:l};Lh(function(x){e(x),h()},function(x){s(x),h()},_),l=null}if("onloadend"in l?l.onloadend=y:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(y)},l.onabort=function(){l&&(s(new X("Request aborted",X.ECONNABORTED,i,l)),l=null)},l.onerror=function(){s(new X("Network Error",X.ERR_NETWORK,i,l)),l=null},l.ontimeout=function(){let E=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const _=i.transitional||ar;i.timeoutErrorMessage&&(E=i.timeoutErrorMessage),s(new X(E,_.clarifyTimeoutError?X.ETIMEDOUT:X.ECONNABORTED,i,l)),l=null},Lt.isStandardBrowserEnv){const p=(i.withCredentials||Nh(f))&&i.xsrfCookieName&&Rh.read(i.xsrfCookieName);p&&r.set(i.xsrfHeaderName,p)}n===void 0&&r.setContentType(null),"setRequestHeader"in l&&D.forEach(r.toJSON(),function(E,_){l.setRequestHeader(_,E)}),D.isUndefined(i.withCredentials)||(l.withCredentials=!!i.withCredentials),a&&a!=="json"&&(l.responseType=i.responseType),typeof i.onDownloadProgress=="function"&&l.addEventListener("progress",ur(i.onDownloadProgress,!0)),typeof i.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",ur(i.onUploadProgress)),(i.cancelToken||i.signal)&&(o=p=>{l&&(s(!p||p.type?new Oe(null,i,l):p),l.abort(),l=null)},i.cancelToken&&i.cancelToken.subscribe(o),i.signal&&(i.signal.aborted?o():i.signal.addEventListener("abort",o)));const b=Bh(f);if(b&&Lt.protocols.indexOf(b)===-1){s(new X("Unsupported protocol "+b+":",X.ERR_BAD_REQUEST,i));return}l.send(n||null)})}};D.forEach(wi,(i,t)=>{if(i){try{Object.defineProperty(i,"name",{value:t})}catch{}Object.defineProperty(i,"adapterName",{value:t})}});const fr=i=>`- ${i}`,Yh=i=>D.isFunction(i)||i===null||i===!1,dr={getAdapter:i=>{i=D.isArray(i)?i:[i];const{length:t}=i;let e,s;const n={};for(let r=0;r<t;r++){e=i[r];let a;if(s=e,!Yh(e)&&(s=wi[(a=String(e)).toLowerCase()],s===void 0))throw new X(`Unknown adapter '${a}'`);if(s)break;n[a||"#"+r]=s}if(!s){const r=Object.entries(n).map(([o,h])=>`adapter ${o} `+(h===!1?"is not supported by the environment":"is not available in the build"));let a=t?r.length>1?`since :
|
|
14
|
+
`+r.map(fr).join(`
|
|
15
|
+
`):" "+fr(r[0]):"as no adapter specified";throw new X("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:wi};function xi(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new Oe(null,i)}function mr(i){return xi(i),i.headers=Xt.from(i.headers),i.data=yi.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),dr.getAdapter(i.adapter||pi.adapter)(i).then(function(s){return xi(i),s.data=yi.call(i,i.transformResponse,s),s.headers=Xt.from(s.headers),s},function(s){return cr(s)||(xi(i),s&&s.response&&(s.response.data=yi.call(i,i.transformResponse,s.response),s.response.headers=Xt.from(s.response.headers))),Promise.reject(s)})}const pr=i=>i instanceof Xt?i.toJSON():i;function Ce(i,t){t=t||{};const e={};function s(c,l,f){return D.isPlainObject(c)&&D.isPlainObject(l)?D.merge.call({caseless:f},c,l):D.isPlainObject(l)?D.merge({},l):D.isArray(l)?l.slice():l}function n(c,l,f){if(D.isUndefined(l)){if(!D.isUndefined(c))return s(void 0,c,f)}else return s(c,l,f)}function r(c,l){if(!D.isUndefined(l))return s(void 0,l)}function a(c,l){if(D.isUndefined(l)){if(!D.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function o(c,l,f){if(f in t)return s(c,l);if(f in i)return s(void 0,c)}const h={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(c,l)=>n(pr(c),pr(l),!0)};return D.forEach(Object.keys(Object.assign({},i,t)),function(l){const f=h[l]||n,y=f(i[l],t[l],l);D.isUndefined(y)&&f!==o||(e[l]=y)}),e}const gr="1.5.1",bi={};["object","boolean","number","function","string","symbol"].forEach((i,t)=>{bi[i]=function(s){return typeof s===i||"a"+(t<1?"n ":" ")+i}});const yr={};bi.transitional=function(t,e,s){function n(r,a){return"[Axios v"+gr+"] Transitional option '"+r+"'"+a+(s?". "+s:"")}return(r,a,o)=>{if(t===!1)throw new X(n(a," has been removed"+(e?" in "+e:"")),X.ERR_DEPRECATED);return e&&!yr[a]&&(yr[a]=!0,console.warn(n(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,a,o):!0}};function Xh(i,t,e){if(typeof i!="object")throw new X("options must be an object",X.ERR_BAD_OPTION_VALUE);const s=Object.keys(i);let n=s.length;for(;n-- >0;){const r=s[n],a=t[r];if(a){const o=i[r],h=o===void 0||a(o,r,i);if(h!==!0)throw new X("option "+r+" must be "+h,X.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new X("Unknown option "+r,X.ERR_BAD_OPTION)}}const vi={assertOptions:Xh,validators:bi},Zt=vi.validators;class bs{constructor(t){this.defaults=t,this.interceptors={request:new rr,response:new rr}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=Ce(this.defaults,e);const{transitional:s,paramsSerializer:n,headers:r}=e;s!==void 0&&vi.assertOptions(s,{silentJSONParsing:Zt.transitional(Zt.boolean),forcedJSONParsing:Zt.transitional(Zt.boolean),clarifyTimeoutError:Zt.transitional(Zt.boolean)},!1),n!=null&&(D.isFunction(n)?e.paramsSerializer={serialize:n}:vi.assertOptions(n,{encode:Zt.function,serialize:Zt.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&D.merge(r.common,r[e.method]);r&&D.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),e.headers=Xt.concat(a,r);const o=[];let h=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(e)===!1||(h=h&&E.synchronous,o.unshift(E.fulfilled,E.rejected))});const c=[];this.interceptors.response.forEach(function(E){c.push(E.fulfilled,E.rejected)});let l,f=0,y;if(!h){const p=[mr.bind(this),void 0];for(p.unshift.apply(p,o),p.push.apply(p,c),y=p.length,l=Promise.resolve(e);f<y;)l=l.then(p[f++],p[f++]);return l}y=o.length;let b=e;for(f=0;f<y;){const p=o[f++],E=o[f++];try{b=p(b)}catch(_){E.call(this,_);break}}try{l=mr.call(this,b)}catch(p){return Promise.reject(p)}for(f=0,y=c.length;f<y;)l=l.then(c[f++],c[f++]);return l}getUri(t){t=Ce(this.defaults,t);const e=lr(t.baseURL,t.url);return nr(e,t.params,t.paramsSerializer)}}D.forEach(["delete","get","head","options"],function(t){bs.prototype[t]=function(e,s){return this.request(Ce(s||{},{method:t,url:e,data:(s||{}).data}))}}),D.forEach(["post","put","patch"],function(t){function e(s){return function(r,a,o){return this.request(Ce(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}bs.prototype[t]=e(),bs.prototype[t+"Form"]=e(!0)});const vs=bs;class Si{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const s=this;this.promise.then(n=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](n);s._listeners=null}),this.promise.then=n=>{let r;const a=new Promise(o=>{s.subscribe(o),r=o}).then(n);return a.cancel=function(){s.unsubscribe(r)},a},t(function(r,a,o){s.reason||(s.reason=new Oe(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 Si(function(n){t=n}),cancel:t}}}const Vh=Si;function zh(i){return function(e){return i.apply(null,e)}}function Gh(i){return D.isObject(i)&&i.isAxiosError===!0}const Ci={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(Ci).forEach(([i,t])=>{Ci[t]=i});const qh=Ci;function wr(i){const t=new vs(i),e=Vn(vs.prototype.request,t);return D.extend(e,vs.prototype,t,{allOwnKeys:!0}),D.extend(e,t,null,{allOwnKeys:!0}),e.create=function(n){return wr(Ce(i,n))},e}const K=wr(pi);K.Axios=vs,K.CanceledError=Oe,K.CancelToken=Vh,K.isCancel=cr,K.VERSION=gr,K.toFormData=ys,K.AxiosError=X,K.Cancel=K.CanceledError,K.all=function(t){return Promise.all(t)},K.spread=zh,K.isAxiosError=Gh,K.mergeConfig=Ce,K.AxiosHeaders=Xt,K.formToJSON=i=>or(D.isHTMLForm(i)?new FormData(i):i),K.getAdapter=dr.getAdapter,K.HttpStatusCode=qh,K.default=K;const Hh=K,xr=window.crypto.subtle;xr||console.warn("Crypto API not supported");async function br(i,t="SHA-256"){const e=await xr.digest(t,go(i));return yo(e)}async function vr(i,t="SHA-256"){const e=JSON.stringify(lo(i));return br(e,t)}class Sr{instance;constructor(t){this.instance=Hh.create(t);const e=new Cr;this.instance.interceptors.request.use(s=>(e.pendingRequest(s),s),s=>(e.cancelRequest(s.config),s)),t?.interceptor&&(this.instance.interceptors.request.use(t.interceptor.request,t.interceptor.requestError),this.instance.interceptors.response.use(t.interceptor.response,t.interceptor.responseError)),this.instance.interceptors.response.use(async s=>(await e.confirmRequest(s.config),s.data),async s=>{const{code:n="",config:r}=s;return!r||!r.retry||(r.retryCounted=r.retryCounted||0,r.retryCounted>=r.retry)?Promise.reject(s):(r.retryCounted++,await new Promise(a=>{setTimeout(a,r.retryDelay)}),await this.request(r))})}async request(t){return await this.instance.request(t)}async get(t,e){return this.request({...e,method:"get",url:t})}async delete(t,e){return this.request({...e,method:"delete",url:t})}async head(t,e){return this.request({...e,method:"head",url:t})}async options(t,e){return this.request({...e,method:"options",url:t})}async post(t,e,s){return this.request({...s,method:"post",url:t,data:e})}async postBlob(t,e,s){return s={...s,headers:{...s?.headers,"Content-Type":"multipart/form-data"}},this.request({...s,method:"post",url:t,data:e})}async postForm(t,e,s){return this.instance.postForm(t,e,{...s})}async put(t,e,s){return this.request({...s,method:"put",url:t,data:e})}async patch(t,e,s){return this.request({...s,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class Cr{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}async getRequestId(t){const{url:e,method:s,params:n,data:r}=t;return await vr({url:e,method:s,params:n,data:r})}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(){const t=this.pendingRequestMap.values();for(const e of t)e.abort();this.pendingRequestMap.clear()}}const Ti=i=>new XMLSerializer().serializeToString(i),jh=(i,t="text/html")=>new DOMParser().parseFromString(i,t),Tr=(i,t=It.SVG,e=Me.utf8)=>ri(Ti(i),t,e);function Ss(i,t){const e=document.createElement("a");e.style.visibility="hidden",e.download=t,typeof i=="string"?e.href=i:e.href=window.URL.createObjectURL(i),e.click(),window.URL.revokeObjectURL(e.href)}async function Pr(i=["*"],t){if(!document||!(document instanceof Document))throw new Error("This is not a browser environment");let e=[];const s=document.createElement("input");return s.setAttribute("type","file"),s.setAttribute("visibility","hidden"),s.setAttribute("accept",i.join(",")),t&&s.setAttribute("multiple","true"),s.addEventListener("click",n=>{s.value=""},!1),new Promise((n,r)=>{s.addEventListener("change",a=>{e=Array.from(a.target.files||[]),e.length===0?r(new Error("Cancel")):!i.includes("*")&&e.some(o=>!i.includes(`.${Er(o)}`))?r(new Error(`Please select files in ${i} format`)):n(e)},!1),window.addEventListener("focus",()=>{setTimeout(()=>{e.length===0&&r(new Error("Cancel"))},1e3)},{once:!0}),s.click()}).then(n=>(s.remove(),n)).catch(n=>{throw s.remove(),n})}function Cs(i,t=ce.text,e){return new Promise((s,n)=>{const r=new FileReader;switch(r.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),r.addEventListener("load",a=>{s(r.result)}),r.addEventListener("error",a=>{n(a)}),t){case"dataURL":r.readAsDataURL(i);break;case"binaryString":r.readAsBinaryString(i);break;case"arrayBuffer":r.readAsArrayBuffer(i);break;case"text":default:r.readAsText(i)}})}async function $h(i){const t=await Cs(i,ce.arrayBuffer);return Ln(t)}const Er=i=>{let t;return i instanceof File?t=i.name:t=i,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function _r(i,t,e,s,n,r,a){const o=new FileReader;o.addEventListener("load",h=>{if(!h.target||!h.target.result)return t(h);if(e.append(h.target.result),a<s.size)_r(i,t,e,s,n,a,Math.min(a+n,s.size));else return i(e.end())}),o.addEventListener("error",h=>t(h)),o.readAsArrayBuffer(s.slice(r,a))}async function Ar(i,t=1*1024*1024){return await new Promise((e,s)=>_r(e,s,new Lo.ArrayBuffer,i,t,0,Math.min(t,i.size)))}class Wh{axios;checkURL;uploadURL;file;fileHash;chunkSize;chunks;currentChunk=0;isUploading=!1;begin=0;end=0;timer;timeData=[0,0,0,0,0,0];onExist;onStart;onProgress;onComplete;onTime;constructor(t){this.axios=new Sr({baseURL:t.baseURL,interceptor:{request:e=>e,response:e=>(e.config.url==this.uploadURL&&e.status==200&&(this.onProgress?.(this.currentChunk++,this.chunks),this.end==this.file.size?(this.isUploading=!1,this.stopTimeCount(),this.onComplete?.()):this.isUploading&&this.uploadChunk()),e)}}),this.checkURL=t.checkURL,this.uploadURL=t.uploadURL,this.file=t.file,this.chunkSize=t.chunkSize||1*1024*1024,this.chunks=Math.ceil(this.file.size/this.chunkSize),this.onExist=t.onExist,this.onStart=t.onStart,this.onProgress=t.onProgress,this.onComplete=t.onComplete,this.onTime=t.onTime}async start(){this.fileHash||(this.fileHash=await Ar(this.file,this.chunkSize)),(await this.axios.post(this.checkURL,{fileName:this.file.name,fileHash:this.fileHash})).isExist?(this.isUploading=!1,this.onExist?.()):this.isUploading||(this.onStart?.(),this.startTimeCount(),await this.uploadChunk())}pause(){this.isUploading&&(this.isUploading=!1,this.stopTimeCount())}async uploadChunk(){this.isUploading=!0,this.begin=this.currentChunk*this.chunkSize,this.end=Math.min(this.begin+this.chunkSize,this.file.size);const t=this.file.slice(this.begin,this.end),e=new FormData;e.append("fileData",t),e.append("fileName",this.file.name),e.append("fileHash",this.fileHash),e.append("chunkIndex",String(this.currentChunk)),e.append("chunks",String(this.chunks)),await this.axios.postBlob(this.uploadURL,e)}startTimeCount(){this.stopTimeCount(),this.timer=setInterval(()=>{vo(this.timeData,1),this.onTime?.(So(this.timeData))},1e3)}stopTimeCount(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}}function Dr(i,t){const e=oi(t||"");if(!t)try{let s=window.localStorage.getItem(i);s&&(s=JSON.parse(s),e.value=s?s.value:"")}catch{}return yt(()=>{e.value&&window.localStorage.setItem(i,JSON.stringify(e))}),e}function Jh(i,t){const e=oi(t?.value||"");if(!e.value){const s=`; ${document.cookie}`.split(`; ${i}=`).pop()?.split(";").shift();s&&(e.value=decodeURIComponent(s))}return yt(()=>{if(e.value&&t?.days){const s="; expires="+new Date(Date.now()+t.days*864e5).toUTCString(),n=t?.domain?"; domain="+t?.domain:"",r=t?.path?"; path="+t?.path:"",a=t?.secure==!0?"; secure":"";document.cookie=i+"="+encodeURIComponent(e.value)+s+n+r+a}}),e}function Zh(){const i=document.cookie.split("; ");for(let t=0;t<i.length;t++){const e=window.location.hostname.split(".");for(;e.length>0;){const s=encodeURIComponent(i[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+e.join(".")+" ;path=",n=location.pathname.split("/");for(document.cookie=s+"/";n.length>0;)document.cookie=s+n.join("/"),n.pop();e.shift()}}}const ot=(i,t,e)=>{const s=async n=>{await e(n)};return i.addEventListener(t,s,!1),()=>{i.removeEventListener(t,s,!1)}},Kh=["click","dblclick","wheel","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"],Qh=["keydown","keyup","keypress"],tc=["touchstart","touchend","touchcancel","touchmove"],ec=["pointerdown","pointerup","pointercancel","pointermove"],sc=["dragstart","dragend","dragenter","dragover","drop"],ic=["change"];function nc(i,t,e={bubbles:!0,detail:{}}){let s;Kh.includes(t)?s=new MouseEvent(t,e):Qh.includes(t)?s=new KeyboardEvent(t,e):tc.includes(t)?s=new TouchEvent(t,e):ec.includes(t)?s=new PointerEvent(t,e):sc.includes(t)?s=new DragEvent(t,e):ic.includes(t)?s=new Event(t,e):s=new CustomEvent(t,e),Mr(i,s)}function Mr(i,t){i.dispatchEvent(t)}function rc(i,t){const e=i.changedTouches[0];return new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null})}function Fe(){const i=new ls;return{on:(t,e)=>{i.on(t,e)},off:(t,e)=>{i.off(t,e)},emit:(t,...e)=>{i.emit(t,...e)}}}function Ir(i="(prefers-color-scheme: dark)"){const t=window.matchMedia(i),e=oi(t.matches);return ot(t,"change",s=>{e.value=s.matches}),e}const Kt=Dr("__theme__");if(!Kt.value){const i=Ir("(prefers-color-scheme: dark)");Kt.value=i.value?"dark":"light"}const kr=()=>{switch(Kt.value){case"dark":document.documentElement.classList.add("dark");break;default:document.documentElement.classList.remove("dark");break}};yt(()=>{kr()}),setTimeout(kr);function ac(i){return i&&(Kt.value=i),Kt}function oc(){return Kt.value=Kt.value=="light"?"dark":"light",Kt}const z=Fe();let Lr="";new MutationObserver(i=>{location.href!==Lr&&(Lr=location.href,z.emit("urlchange",location.href))}).observe(document,{attributes:!0,childList:!0,subtree:!0}),ot(window,"hashchange",()=>{z.emit("hashchange",location.hash)}),ot(window,"popstate",()=>{z.emit("popstate")}),ot(window,"load",i=>{z.emit("load",i)}),ot(window,"beforeunload",i=>{z.emit("beforeunload",i)}),ot(window,"pagehide",i=>{z.emit("pagehide",i)}),ot(window,"focus",i=>{z.emit("focus",i)}),ot(window,"blur",i=>{z.emit("blur",i)}),ot(window,"visibilitychange",i=>{document.hidden?z.emit("hidden",i):z.emit("visible",i)});function Rr(){return{onurlchange:i=>(z.on("urlchange",i),()=>{z.off("urlchange",i)}),onhashchange:i=>(z.on("hashchange",i),()=>{z.off("hashchange",i)}),onpopstate:i=>(z.on("popstate",i),()=>{z.off("popstate",i)}),onload:i=>(z.on("load",i),()=>{z.off("load",i)}),onbeforeunload:i=>(z.on("beforeunload",i),()=>{z.off("beforeunload",i)}),onpagehide:i=>(z.on("pagehide",i),()=>{z.off("pagehide",i)}),onfocus:i=>(z.on("focus",i),()=>{z.off("focus",i)}),onblur:i=>(z.on("blur",i),()=>{z.off("blur",i)}),onvisibel:i=>(z.on("visible",i),()=>{z.off("visible",i)}),onhidden:i=>(z.on("hidden",i),()=>{z.off("hidden",i)})}}const Pi=Fe(),Or=Rr();function hc(){return{remove:ot(document,"scroll",i=>{Pi.emit("scroll",i)}),on:i=>{Pi.on("scroll",i)},off:i=>{Pi.off("scroll",i)}}}function cc(){return ot(document,"touchmove",i=>{i.preventDefault()})}function lc(i,t){window.scrollTo(i,t)}function uc(){let i=ve,t=ve;return"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual",i=Or.onbeforeunload(()=>{window.history.scrollRestoration="auto"}),t=Or.onload(()=>{window.history.scrollRestoration="manual"})),()=>{i(),t()}}const Te=Fe();function fc(i){const t=new ResizeObserver(e=>{const{width:s,height:n}=e[0].contentRect;Te.emit("resize",s,n)});return t.observe(i),{on:e=>{Te.on("resize",e)},off:e=>{Te.off("resize",e)},remove:()=>t.unobserve(i)}}function dc(){const i="orientationchange"in window?"orientationchange":"resize",e=ot(window,i,s=>{const n=s.target.innerWidth,r=s.target.innerHeight;Te.emit("window-resize",n,r)});return{on:s=>{Te.on("window-resize",s)},off:s=>{Te.off("window-resize",s)},remove:e}}async function Ei(i=ce.text){const e=(await Pr())[0],s=await Cs(e,i);return{type:e.type,name:e.name,size:e.size,data:s}}const Ts=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return/mac/i.test(i)?t="macOS":/win/i.test(i)?t="Windows":/android/i.test(i)?t="Android":/iphone|ipad|ipod/i.test(i)?t="iOS":/linux/i.test(i)?t="Linux":/bsd/i.test(i)&&(t="BSD"),t.toLowerCase()},mc=()=>{const i=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(i)){const e=i.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(i)){const e=i.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(i)){const e=i.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(i)){const e=i.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},_i=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(i)||/opera/i.test(i)?t="Opera":/chrome/i.test(i)?t="Chrome":/firefox/i.test(i)?t="Firefox":/safari/i.test(i)?t="Safari":/edge/i.test(i)?t="Edge":/msie|trident/i.test(i)?t="IE":/MicroMessenger/i.test(i)?t="Wechat":/alipay/i.test(i)&&(t="Ali"),t.toLowerCase()},pc=()=>{const i=navigator.userAgent;let t="Unknown";if(/Chrome/.test(i)){const e=i.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(i)){const e=i.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(i)){const e=i.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(i)){const e=i.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(i)){const e=i.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t};function gc(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function yc(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Ai(){return Ts()==="ios"}function Di(){return Ts()==="macos"}function wc(){return Ai()|Di()}function Fr(){return Ts()==="android"}function xc(){return Ai()||Fr()}function Nr(){const i=window.navigator.userAgent,t=i.indexOf("MSIE ");if(t>0)return parseInt(i.substring(t+5,i.indexOf(".",t)),10);if(i.indexOf("Trident/")>0){const n=i.indexOf("rv:");return parseInt(i.substring(n+3,i.indexOf(".",n)),10)}const s=i.indexOf("Edge/");return s>0?parseInt(i.substring(s+5,i.indexOf(".",s)),10):-1}const bc=Nr()!==-1;function vc(){const i=document.documentMode;return i&&(i===9||i===10)}function Br(){return _i()==="wechat"}function Ur(){return _i()==="ali"}function Sc(){return Br()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function Cc(){return Ur()&&navigator.userAgent.match(/miniprogram/i)}const Tc=typeof document<"u",Yr=typeof window<"u",Pc=typeof history<"u",Ec=Yr&&window.File&&window.FileReader&&window.FileList&&window.Blob,Xr=(()=>{const i=we();return!!(i.Worker&&i.Blob&&i.Promise&&i.OffscreenCanvas&&i.OffscreenCanvasRenderingContext2D&&i.HTMLCanvasElement&&i.HTMLCanvasElement.prototype.transferControlToOffscreen&&i.URL&&i.URL.createObjectURL)})(),_c=typeof Path2D=="function"&&typeof DOMMatrix=="function",Vr=function(){if(!we().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}(),Ac=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},Dc="webkit moz ms o".split(" ");function Ps(i){return typeof i=="function"&&/native code/.test(i.toString())}function Mc(i,t){const e=t.ctrl||!1,s=t.shift||!1,n=t.alt||!1;return(e===i.metaKey||e===i.ctrlKey)&&s===i.shiftKey&&n===i.altKey&&t.keys.map(r=>r.toLowerCase()).includes(i.key.toLowerCase())}function Ic(i){const t=[];return i.ctrl&&t.push(Di()?"Cmd":"Ctrl"),i.shift&&t.push("Shift"),i.alt&&t.push("Alt"),t.push(...i.keys),t}function Mi(i,t,e){const s=i.target||document||window;let n=!1,r=!1;const a=ot(s,"keydown",async h=>{r||(n=Mc(h,i),n&&(h.stopPropagation(),h.preventDefault(),await t()))}),o=ot(s,"keyup",async h=>{r||n&&e&&(h.stopPropagation(),h.preventDefault(),await e())});return{hotKeys:Ic(i),remove:()=>{a(),o()},pause:()=>r=!0,resume:()=>r=!1}}const kc={BACKSPACE:8,TAB:9,COMMA:188,DELETE:46,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,UP:38,DOWN:40,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32};async function Lc(i={keys:["o"]},t=ce.text){const e=Io(),s=Mi(i,async()=>{try{e.resolve(await Ei(t))}catch(n){e.reject(n)}s.remove()},()=>{});return await e.promise}function Rc(i={keys:["o"]},t=ce.text){const e=Fe();return Mi(i,async()=>{try{e.emit("file",await Ei(t))}catch{}},()=>{}),{on:s=>{e.on("file",s)},off:s=>{e.off("file",s)}}}function Oc(i){const t=window.URL.createObjectURL(i);return()=>{window.URL.revokeObjectURL(t)}}function Fc(i,t="下载文件",e,s){let n;i instanceof Blob?n=i:n=ri(i,e,s),Ss(n,t)}function Nc(i){let t=!1;function e(){if(document.readyState!=="loading"){if(t){document.removeEventListener("DOMContentLoaded",e,!1);return}t=!0,document.removeEventListener("DOMContentLoaded",e,!1),i()}}document.addEventListener("DOMContentLoaded",e,!1),e()}function Bc(i,t,e){const s=document.createElement("script");s.type="text/javascript",s.src=i,s.async=!1,s.onload=t||ve,s.onerror=e||ve,document.body.appendChild(s)}function Uc(i,t,e){const s=document.createElement("link");s.type="text/css",s.rel="stylesheet",s.href=i,s.onload=t||ve,s.onerror=e||ve,document.getElementsByTagName("head")[0].appendChild(s)}function Yc(){return new Promise(i=>{const t=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let e=document.styleSheets.length||0;const s=()=>e>=t.length?(i(),!0):!1;s()||t.forEach(n=>{n.onload=()=>{e+=1,s()}})})}(function(){if(!window.requestAnimationFrame){let i=Q();window.requestAnimationFrame=function(t){const e=Q(),s=Math.max(0,16-(e-i)),n=window.setTimeout(function(){t(e+s)},s);return i=e+s,n}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(i){clearTimeout(i)})})();const Ii=i=>{let t=!1;return window.requestAnimationFrame(function e(s){!t&&i(s)&&window.requestAnimationFrame(e)}),()=>{t=!0}};function ki(i,t=0){if(t==0)return i(Q()),()=>{};{const e=Q();return Ii(s=>s-e>=t?(i(s),!1):!0)}}function Xc(i,t=0){let e=!1,s=0;const n=Q(),r=a=>{if(e)return;s++;const o=a-n-s*t;i(a,s,t<=o),ki(r,Math.max(0,t-o))};return ki(r,t),()=>{e=!0}}function Vc(i,t=20){const e=1e3/t;let s=0,n;return()=>(Q()-s>=e&&(s=Q(),n=i()),n)}const Qt=new Un;let Li=!1;function zr(i,t,e){i&&t&&Qt.set(i,t),!Li&&(Li=!0,requestIdleCallback(s=>{for(Li=!1;s.timeRemaining()>0&&Qt.length>0;){const n=Qt.shift();n&&n[1]()}Qt.length>0&&zr()},{timeout:e}))}let Ri=!1;function Oi(i,t,e){if(i&&t&&Qt.set(i,t),Ri)return;Ri=!0;const s=Q();Gc(n=>{for(Ri=!1;(n.timeRemaining()>0||e&&Q()-s>=e)&&Qt.length>0;){const r=Qt.shift();r&&r[1]()}Qt.length>0&&Oi()})}let Es=0,le=33,te=33,Fi;const Gr=new MessageChannel,zc=Gr.port2;Gr.port1.onmessage=i=>{Fi!==null&&Fi({didTimeout:Es<=Q(),timeRemaining:()=>Math.max(0,Es-Q())})};function Gc(i){return Fi=i,requestAnimationFrame(t=>{let e=t-Es+te;e<te&&le<te?(e<8&&(e=8),te=e<le?le:e):e>te&&le>te?te=e<le?le:e:le=e,Es=t+te,zc.postMessage(null)})}function qc(i){if(typeof setImmediate<"u"&&Ps(setImmediate))setImmediate(i);else if(typeof MessageChannel<"u"&&(Ps(MessageChannel)||MessageChannel.toString()==="[object MessageChannelConstructor]")){const{port1:t,port2:e}=new MessageChannel;e.onmessage=i,t.postMessage(null)}else typeof Promise<"u"&&Ps(Promise)?Promise.resolve().then(i):setTimeout(i,0)}function Hc(i){typeof queueMicrotask=="function"?queueMicrotask(i):Promise.resolve().then(i).catch(t=>setTimeout(()=>{throw t}))}class Ne{static _nextId=0;static nextId(){return Ne._nextId++}}const L={Linear:{None:function(i){return i}},Ease:{In:function(i){return Math.pow(i,1.7)}},Quadratic:{In:function(i){return i*i},Out:function(i){return i*(2-i)},InOut:function(i){return(i*=2)<1?.5*i*i:-.5*(--i*(i-2)-1)}},Cubic:{In:function(i){return i*i*i},Out:function(i){return--i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i:.5*((i-=2)*i*i+2)}},Quartic:{In:function(i){return i*i*i*i},Out:function(i){return 1- --i*i*i*i},InOut:function(i){return(i*=2)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2)}},Quintic:{In:function(i){return i*i*i*i*i},Out:function(i){return--i*i*i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2)}},Sinusoidal:{In:function(i){return 1-Math.sin((1-i)*Math.PI/2)},Out:function(i){return Math.sin(i*Math.PI/2)},InOut:function(i){return .5*(1-Math.sin(Math.PI*(.5-i)))}},Exponential:{In:function(i){return i===0?0:Math.pow(1024,i-1)},Out:function(i){return i===1?1:1-Math.pow(2,-10*i)},InOut:function(i){return i===0?0:i===1?1:(i*=2)<1?.5*Math.pow(1024,i-1):.5*(-Math.pow(2,-10*(i-1))+2)}},Circular:{In:function(i){return 1-Math.sqrt(1-i*i)},Out:function(i){return Math.sqrt(1- --i*i)},InOut:function(i){return(i*=2)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1)}},Elastic:{In:function(i){return i===0?0:i===1?1:-Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI)},Out:function(i){return i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i-.1)*5*Math.PI)+1},InOut:function(i){return i===0?0:i===1?1:(i*=2,i<1?-.5*Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI):.5*Math.pow(2,-10*(i-1))*Math.sin((i-1.1)*5*Math.PI)+1)}},Back:{In:function(i){return i===1?1:i*i*((1.70158+1)*i-1.70158)},Out:function(i){return i===0?0:--i*i*((1.70158+1)*i+1.70158)+1},InOut:function(i){const t=2.5949095;return(i*=2)<1?.5*(i*i*((t+1)*i-t)):.5*((i-=2)*i*((t+1)*i+t)+2)}},Bounce:{In:function(i){return 1-L.Bounce.Out(1-i)},Out:function(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},InOut:function(i){return i<.5?L.Bounce.In(i*2)*.5:L.Bounce.Out(i*2-1)*.5+.5}},generatePow:function(i=4){return i=i<Number.EPSILON?Number.EPSILON:i,i=i>1e4?1e4:i,{In:function(t){return t**i},Out:function(t){return 1-(1-t)**i},InOut:function(t){return t<.5?(t*2)**i/2:(1-(2-t*2)**i)/2+.5}}},random:function(i){return Math.random()},createStep:function(i){return function(t){return Math.floor(t*i)/i}},createNoisyEasing:function(i,t=.1){const e=1-t;return function(s){return t*Math.random()+e*i(s)}},swing:function(i){return i+Math.sin(i*Math.PI*2)/2},causeSeizures:function(i){return i+.2*Math.random()-.1}};function qr(i){switch(i){case L.Quadratic.In:return L.Quadratic.Out;case L.Quadratic.Out:return L.Quadratic.In;case L.Quadratic.InOut:return L.Quadratic.InOut;case L.Cubic.In:return L.Cubic.Out;case L.Cubic.Out:return L.Cubic.In;case L.Cubic.InOut:return L.Cubic.InOut;case L.Quartic.In:return L.Quartic.Out;case L.Quartic.Out:return L.Quartic.In;case L.Quartic.InOut:return L.Quartic.InOut;case L.Quintic.In:return L.Quintic.Out;case L.Quintic.Out:return L.Quintic.In;case L.Quintic.InOut:return L.Quintic.InOut;case L.Sinusoidal.In:return L.Sinusoidal.Out;case L.Sinusoidal.Out:return L.Sinusoidal.In;case L.Sinusoidal.InOut:return L.Sinusoidal.InOut;case L.Exponential.In:return L.Exponential.Out;case L.Exponential.Out:return L.Exponential.In;case L.Exponential.InOut:return L.Exponential.InOut;case L.Circular.In:return L.Circular.Out;case L.Circular.Out:return L.Circular.In;case L.Circular.InOut:return L.Circular.InOut;case L.Elastic.In:return L.Elastic.Out;case L.Elastic.Out:return L.Elastic.In;case L.Elastic.InOut:return L.Elastic.InOut;case L.Back.In:return L.Back.Out;case L.Back.Out:return L.Back.In;case L.Back.InOut:return L.Back.InOut;case L.Bounce.In:return L.Bounce.Out;case L.Bounce.Out:return L.Bounce.In;case L.Bounce.InOut:return L.Bounce.InOut;default:return i}}const jc=4,$c=.001,Wc=1e-7,Jc=10,Be=11,_s=1/(Be-1),Zc=typeof Float32Array=="function";function Hr(i,t){return 1-3*t+3*i}function jr(i,t){return 3*t-6*i}function $r(i){return 3*i}function As(i,t,e){return((Hr(t,e)*i+jr(t,e))*i+$r(t))*i}function Wr(i,t,e){return 3*Hr(t,e)*i*i+2*jr(t,e)*i+$r(t)}function Kc(i,t,e,s,n){let r,a,o=0;do a=t+(e-t)/2,r=As(a,s,n)-i,r>0?e=a:t=a;while(Math.abs(r)>Wc&&++o<Jc);return a}function Qc(i,t,e,s){for(let n=0;n<jc;++n){const r=Wr(t,e,s);if(r===0)return t;const a=As(t,e,s)-i;t-=a/r}return t}function tl(i){return i}function Ni(i,t,e,s){if(!(0<=i&&i<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(i===t&&e===s)return tl;const n=Zc?new Float32Array(Be):new Array(Be);for(let a=0;a<Be;++a)n[a]=As(a*_s,i,e);function r(a){let o=0,h=1;const c=Be-1;for(;h!==c&&n[h]<=a;++h)o+=_s;--h;const l=(a-n[h])/(n[h+1]-n[h]),f=o+l*_s,y=Wr(f,i,e);return y>=$c?Qc(a,f,i,e):y===0?f:Kc(a,o,o+_s,i,e)}return a=>a===0||a===1?a:As(r(a),t,s)}function Bi(i){switch(i){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}function Jr(i){const[t,e,s,n]=Bi(i);return[1-s,1-n,1-t,1-e]}function el(i){return Ni(...Bi(i))}function sl(i){return Ni(...Jr(i))}const Vt={Utils:{Linear:function(i,t,e){return(t-i)*e+i},Factorial:function(){const i=[1];return function(t){let e=1;if(i[t])return i[t];for(let s=t;s>1;s--)e*=s;return i[t]=e,e}}(),Bernstein:function(i,t){const e=Vt.Utils.Factorial;return e(i)/e(t)/e(i-t)},CatmullRom:function(i,t,e,s,n){const r=(e-i)*.5,a=(s-t)*.5,o=n*n,h=n*o;return(2*t-2*e+r+a)*h+(-3*t+3*e-2*r-a)*o+r*n+t},QuadraticBezier:(i,t,e,s)=>{const n=1-s;return n*n*i+2*n*s*t+s*s*e},CubicBezier:(i,t,e,s,n)=>{const r=1-n;return r*r*r*i+3*r*r*n*t+3*r*n*n*e+n*n*n*s}},Linear:function(i,t){const e=i.length-1,s=e*t,n=Math.floor(s),r=Vt.Utils.Linear;return t<0?r(i[0],i[1],s):t>1?r(i[e],i[e-1],e-s):r(i[n],i[n+1>e?e:n+1],s-n)},Bezier:function(i,t){let e=0;const s=i.length-1,n=Math.pow,r=Vt.Utils.Bernstein;for(let a=0;a<=s;a++)e+=n(1-t,s-a)*n(t,a)*i[a]*r(s,a);return e},CatmullRom:function(i,t){const e=i.length-1;let s=e*t,n=Math.floor(s);const r=Vt.Utils.CatmullRom;return i[0]===i[e]?(t<0&&(n=Math.floor(s=e*(1+t))),r(i[(n-1+e)%e],i[n],i[(n+1)%e],i[(n+2)%e],s-n)):t<0?i[0]-(r(i[0],i[0],i[1],i[1],-s)-i[0]):t>1?i[e]-(r(i[e],i[e],i[e-1],i[e-1],s-e)-i[e]):r(i[n?n-1:0],i[n],i[e<n+1?e:n+1],i[e<n+2?e:n+2],s-n)}};class Zr{_tweens={};_tweensAddedDuringUpdate={};getAll(){return Object.keys(this._tweens).map(t=>this._tweens[t])}removeAll(){this._tweens={}}add(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t}remove(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]}update(t=Q(),e=!1){const s=Object.keys(this._tweens);for(let n=0;n<s.length;n++){const r=this._tweens[s[n]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[s[n]]}return!!Object.keys(this._tweens).length}}const St=new Zr;class Ui{constructor(t,e=St){this._object=t,this._group=e}_id=Ne.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=L.Linear.None;_interpolationFunction=Vt.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=Q()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,s,n){for(const r in s){const a=t[r],o=Array.isArray(a),h=o?"array":typeof a,c=!o&&Array.isArray(s[r]);if(!(h==="undefined"||h==="function")){if(c){let l=s[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,a)),s[r]=[a].concat(l)}if((h==="object"||o)&&a&&!c){e[r]=o?[]:{};for(const l in a)e[r][l]=a[l];n[r]=o?[]:{},this._setupProperties(a,e[r],s[r],n[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),c?n[r]=s[r].slice().reverse():n[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=Q()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=Q()){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=St){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=L.Linear.None){return this._easingFunction=t,this}interpolation(t=Vt.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=Q(),e=!0){if(this._isPaused)return!0;let s,n;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),n=(t-this._startTime)/this._durationTime,n=this._durationTime===0||n>1?1:n;const a=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),n===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let o=0,h=this._chainedTweens.length;o<h;o++)this._chainedTweens[o].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,s,n){for(const r in s){if(e[r]===void 0)continue;const a=e[r]||0;let o=s[r];const h=Array.isArray(t[r]),c=Array.isArray(o);!h&&c?t[r]=this._interpolationFunction(o,n):typeof o=="object"&&o?this._updateProperties(t[r],a,o,n):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[r]=a+(o-a)*n))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],s=this._valuesEnd[t];typeof s=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(s):this._valuesStartRepeat[t]=s,this._valuesEnd[t]=e}}const il=Ne.nextId,nl=St.getAll.bind(St),rl=St.removeAll.bind(St),al=St.add.bind(St),ol=St.remove.bind(St),hl=St.update.bind(St),cl={now:Q,Sequence:Ne,Easing:L,Interpolation:Vt,Group:Zr,Tween:Ui,nextId:il,getAll:nl,removeAll:rl,add:al,remove:ol,update:hl};class Yi{autoStart;startTime;oldTime;elapsedTime;running;constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Q(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=Q();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class Ds{tweens=[];frameDuration;onGroupStart;onGroupComplete;constructor(t){this.frameDuration=t?.frameDuration||1e3,this.onGroupStart=t?.onGroupStart,this.onGroupComplete=t?.onGroupComplete}get count(){return this.tweens.length}clear(){this.tweens=[]}sort(t=!1){Mo(this.tweens,(e,s)=>t?e.delay>s.delay:e.delay<=s.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(s=>{const n={...s};delete n.tween,n.fromValues={...n.fromValues},n.toValues={...n.toValues},e.push(n)}),e}addTween(t,e,s){const n={fromValues:t,toValues:e,frames:typeof s?.frames=="number"?s.frames:1,delay:typeof s?.delay=="number"?s.delay:this.tweens.length,easeFunction:s?.easeFunction||L.Linear.None,interpolationFunction:s?.interpolationFunction||Vt.Linear,repeat:typeof s?.repeat=="number"?s.repeat:0,yoyo:s?.yoyo||!1,onStart:s?.onStart||(()=>{}),onUpdate:s?.onUpdate||(()=>{}),onComplete:s?.onComplete||(()=>{})};return this.tweens.push(n),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new Yi,s=this.frameDuration;return new Promise(n=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=Ii(r=>{if(!this.isPaused){const o=Math.max(0,r-this.pausedDuration),h=Math.max(0,e.getElapsedTime()-this.pausedDuration);t.filter(c=>c.delay*s<=h).forEach(c=>{c.tween||(c.tween=new Ui({...c.fromValues}).to({...c.toValues},c.frames*s).easing(c.easeFunction).interpolation(c.interpolationFunction).repeat(c.repeat).yoyo(c.yoyo).onStart(c.onStart).onUpdate(c.onUpdate).onComplete(c.onComplete),c.tween.start(o)),(c.delay+c.frames*(c.repeat+1))*s>h?c.tween.update(o):(c.tween.isPlaying()&&c.tween.end(),xe(t,c))})}const a=!!t.length;return a||(this.onGroupComplete?.(),n()),a})})}isPaused=!1;pausedClock=new Yi;pausedDuration=0;play(t=this.cloneTweens(this.tweens)){this.isPaused=!1,this.pausedDuration=0,this.runTweens(t)}reverse(){const t=this.cloneTweens(this.tweens);let e=0;t.forEach(s=>{e=Math.max(e,s.delay+s.frames),s.easeFunction=qr(s.easeFunction);const n={...s.toValues};s.toValues={...s.fromValues},s.fromValues={...n}}),t.forEach(s=>{s.delay=e-s.frames}),this.play(t)}pause(){this.pausedClock.start(),this.isPaused=!0}resume(){this.pausedDuration+=this.pausedClock.getElapsedTime(),this.pausedClock.stop(),this.isPaused=!1}}const Ms=new Un,Kr=(i=!0)=>{Ms.filter((t,e)=>(e.alternate&&(Ls(e,e.alternate),i&&Ms.set(t,e.alternate),e.alternate=void 0),i))};function Xi(i){let t=Ms.get(i);return t||(t=ks(i),Ms.set(i,t)),t}function Qr(i){const t=Xi(i);return t.alternate||(t.alternate=ks(i)),t.alternate}function Vi(i,t,e=!0){t(Qr(i)),Oi("FLUSH_DOM_ACTION",()=>Kr(e),50)}function ll(i,t,e=!0){t(Qr(i)),Kr(e)}function ee(i,t,e){const s=Xi(i);return t?s.props.style[t]||s.props.style[hs(t)]||s.props.style[dt(t)]:s.props.style}function Ue(i,t,e){Vi(i,s=>{typeof t=="string"&&e?s.props.style[t]=e:t instanceof Object&&Object.keys(t).forEach(n=>{s.props.style[n]=t[n]})},!0)}function zi(i){const t=[];if(getComputedStyle){const e=getComputedStyle(i);for(let s=0,n=e.length;s<n;s++)t.push(e[s]+":"+e.getPropertyValue(e[s]))}else{const e=i.currentStyle;for(const s in e)t.push(s+":"+e[s])}return t.push(...(i.style.cssText||"").split(";")),Object.fromEntries(t.filter(e=>!!e).map(e=>e.split(":").map((s,n)=>n==0?hs(s).trim():s.trim())))}function ul(i,t,e){if(getComputedStyle){t=dt(t);const s=getComputedStyle(i,e),n=s.getPropertyPriority(t);return s.getPropertyValue(t).trim()+(n?"!"+n:"")}else return i.currentStyle[hs(t)]}function Is(i,t,e){typeof t=="string"&&e?i.style.setProperty(dt(t),e.replace(/!important/i,""),String(e).toLowerCase().includes("!important")?"important":""):t instanceof Object&&Object.keys(t).forEach(s=>{Is(i,s,t[s])})}function Gi(i,t){typeof t=="string"?i.style.removeProperty(dt(t)):Object.keys(t).forEach(e=>{Gi(i,e)})}function fl(i,t){let e;if(typeof t=="string"){const n=document.querySelector(t)?.shadowRoot;n?e=n:e=document.querySelector(t)}else e=t||document.getElementsByTagName("head")[0];const s=document.createElement("style");if(s.innerHTML=i,e)return e.appendChild(s),()=>{(e instanceof HTMLElement||e instanceof ShadowRoot)&&e.removeChild(s)};{const n=document.styleSheets[0].insertRule(i);return()=>{document.styleSheets[0].deleteRule(n)}}}function se(i,t,e){if(t===void 0&&e===void 0)return qi(i);if(typeof t=="string"&&e===void 0)return ta(i,t);let s={};typeof t=="object"?s=t:typeof t=="string"&&typeof e=="string"&&(s[t]=e),Vi(i,n=>{Object.entries(s).forEach(([r,a])=>{n.props[r]=a})})}function qi(i){const t={};for(let e=0,s=i.attributes,n=s.length;e<n;e++){const r=s[e];r.nodeName&&r.nodeValue&&(r.nodeName==="style"?t[r.nodeName]=zi(i):t[r.nodeName]=r.nodeValue)}return t}function ta(i,t){return t==="style"?zi(i):i.getAttribute(dt(t))}function Hi(i,t,e){return i.setAttribute(dt(t),e)}function dl(i,t){t.split(/[,\s]+/).forEach(e=>{e.trim()!=""&&i.removeAttribute(e.trim())})}function ml(i,t,e){if(typeof t=="string"&&(t=hs(t)),(typeof t=="string"||t===void 0)&&e===void 0){const s=Object.assign({},i.dataset);return Object.keys(s).forEach(n=>{if(s[n]?.startsWith("[")||s[n]?.startsWith("{"))try{s[n]=JSON.parse(s[n]||"")}catch{}}),typeof t=="string"?s[t]:s}else{let s={};typeof t=="object"?s=t:typeof t=="string"&&(s[t]=e),Object.entries(s).forEach(([n,r])=>{r?i.dataset[n]=r instanceof Object?JSON.stringify(r):r:delete i.dataset[n]})}}function pl(i,t){t.split(/[,\s]+/).forEach(e=>{e.trim()!=""&&delete i.dataset[e.trim()]})}function ji(i,t,e="toggle"){const s=t.split(/[,\s]+/);if(i.classList)s.forEach(n=>{const r=n.trim();r!==""&&i.classList[e](r)});else{const n=i.className.split(/ +/);let r=!1;s.forEach(a=>{const o=a.trim();if(o!==""){const h=n.indexOf(o);switch(e){case"add":h===-1&&(n.push(o),r=!0);break;case"remove":h!==-1&&(n.splice(h,1),r=!0);break;case"toggle":h===-1?n.push(o):n.splice(h,1),r=!0;break}}}),r&&se(i,"class",n.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}}function gl(i,t){ji(i,t,"add")}function yl(i,t){ji(i,t,"remove")}function wl(i,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(i.className)||!1}function xl(i,t){ee(i,"display")=="none"&&t===void 0||t===!0?ea(i):sa(i)}function ea(i){Ue(i,"display",i instanceof HTMLTableRowElement?"table-row":i instanceof HTMLTableCellElement?"table-cell":"block")}function sa(i){Ue(i,"display","none")}function Ye(i){return{el:i,isRoot:/(html|body)/i.test(i.tagName)||i===document.documentElement,isActive:()=>i===document.activeElement&&(i.type||i.href),parentElement:()=>i.parentElement,parents:function(t=i,e=[]){return!t||t.parentElement===null?e:this.parents(t.parentElement,e.concat([t]))},siblings:()=>Array.prototype.slice.call(i.parentElement?.children).filter(t=>t!==i),nextElementSibling:()=>i.nextElementSibling,previousElementSibling:()=>i.previousElementSibling,closest:t=>i.closest(t),shadowRoot:()=>i.shadowRoot,isInput:()=>i.tagName==="INPUT"||i instanceof HTMLInputElement,isInputCheckbox:function(){return this.isInputElement(i)&&i.getAttribute("type")==="checkbox"},isInputRadio:function(){return this.isInputElement(i)&&i.getAttribute("type")==="radio"},isInputText:function(){return this.isInputElement(i)&&i.getAttribute("type")==="text"},isInputNumber:function(){return this.isInputElement(i)&&i.getAttribute("type")==="number"},isSelect:()=>i instanceof HTMLSelectElement,isTextArea:()=>i instanceof HTMLTextAreaElement,remove:()=>i.remove()}}async function bl(i){if(navigator.clipboard)return await navigator.clipboard.writeText(i);{const t=document.createElement("textarea");return t.value=i,t.style.opacity="0",t.style.position="fixed",t.style.top="0",t.style.left="0",t.focus(),t.select(),document.execCommand("copy")}}function vl(){return"geolocation"in navigator?new Promise((i,t)=>{navigator.geolocation.getCurrentPosition(e=>{const s=e.coords.latitude,n=e.coords.longitude;i({latitude:s,longitude:n})},e=>{t(e)})}):Promise.reject("Geolocation is not available.")}function Sl(i=200){"vibrate"in navigator?window.navigator.vibrate(i):console.error("Your device is not support vibrate on this browser.")}function Cl(i){const t=new Proxy(window,{get(e,s,n){if(typeof s=="string"&&["open","location","document"].includes(s))throw new Error(`禁止访问 key: ${s}`);return s==="window"?t:Reflect.get(e,s,n)},set(e,s,n,r){return Reflect.set(e,s,n,r)}});new Function("window",`with(window) { ${i} }`)(t,null)}function ue(i,t={},e=[],s){return{tag:i,props:t,children:e,el:s}}function ks(i){return ue(i.tagName,qi(i),Array.from(i.children).map(t=>ks(t)),i)}function Pe(i,t=document.documentElement){if(i.el)return i.el;if(i.el=document.createElement(i.tag),i.props)for(const e in i.props){const s=i.props[e];e.startsWith("on")?i.el.addEventListener(e.slice(2).toLowerCase(),s):e==="style"?Is(i.el,i.props[e]):Hi(i.el,e,s)}return i.children&&(typeof i.children=="string"?i.el.appendChild(document.createTextNode(i.children)):i.children.forEach(e=>{Pe(e,i.el)})),t.appendChild(i.el),i.el}function Ls(i,t){if(!i.el)return;if(i.tag!==t.tag){(i.el.parentElement||document.body).replaceChild(Pe(t),i.el);return}const e=t.el=i.el,s=i.props,n=t.props;for(const o in s)o in n||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),s[o]):e.removeAttribute(o));for(const o in n){const h=s[o],c=n[o];if(c!=h)if(o.startsWith("on")){const l=o.slice(2).toLowerCase();e.removeEventListener(l,h),e.addEventListener(l,c)}else if(o==="style"){for(const l in h)l in c||Gi(e,l);Is(e,c)}else Hi(e,o,c)}const r=i.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof r=="string")e.innerHTML="",a.forEach(o=>{Pe(o,e)});else{const o=Math.min(r.length,a.length);for(let h=0;h<o;h++)Ls(r[h],a[h]);a.length>r.length&&a.slice(r.length).forEach(h=>{Pe(h,e)}),a.length<r.length&&r.slice(a.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}class Tl{state;el;constructor(t,e){this.state=On(t),this.el=e,this.compile(this.el)}compile(t){t.childNodes.forEach(e=>{switch(e.nodeType){case 1:const s=e;[...s.attributes].forEach(o=>{const h=o.name,c=o.value;if(h==="v-model")if(Ye(s).isInputRadio()){const l=s;yt(()=>{l.checked=this.getStateValue(c)==l.value}),l.addEventListener("change",f=>{this.setStateValue(c,f.target.value)})}else if(Ye(s).isInputCheckbox()){const l=s;yt(()=>{l.checked=Dn(this.getStateValue(c),l.value)}),l.addEventListener("change",f=>{const y=f.target,b=y.value;y.checked?uo(this.getStateValue(c),b):xe(this.getStateValue(c),b)})}else if(Ye(s).isSelect()){const l=s;yt(()=>{l.value=this.getStateValue(c)}),l.addEventListener("change",f=>{this.setStateValue(c,f.target.value)})}else{const l=s;yt(()=>{l.value=this.getStateValue(c)});const f=y=>{this.setStateValue(c,y.target.value)};l.addEventListener("input",f)}else h==="v-text"?yt(()=>{s.innerText=this.getStateValue(c)}):h==="v-html"&&yt(()=>{s.innerHTML=this.getStateValue(c)})}),s.childNodes.length>0&&this.compile(s);break;case 3:const n=e.textContent||"",r=/\{\{\s*([^{}\s]+)\s*\}\}/g,a=r.exec(n);a&&a[1]&&yt(()=>{e.textContent=n.replace(r,this.getStateValue(a[1]))});break}})}getStateValue(t){let e=this.state;return t.split(".").forEach(s=>{e=e[s]}),e}setStateValue(t,e){let s=this.state;const n=t.split("."),r=n.length;for(let a=0;a<r-1;a++)s=s[n[a]];s[n[r-1]]=e}}class Pl{url;socket;waitingResponse={};sendMessageQueue=[];constructor(t){this.url=t,this.createSocket()}createSocket(){console.log("Socket Create Attempted"),this.socket=new WebSocket(this.url),this.socket.onopen=()=>{this.sendMessageQueue.forEach(t=>this.socket?.send(t)),this.sendMessageQueue=[]},this.socket.onclose=t=>{const{code:e,reason:s,wasClean:n}=t;console.log(`ws closed : ${e} ${s} ${n}`)},this.socket.onerror=t=>{console.log(`ws error : ${t.type}`)},this.socket.onmessage=t=>{this.processMessage(t)}}recreateSocket(t){console.log("Socket Recreate Attempted"),this.sendMessageQueue.push(t),this.createSocket()}closeSocket(){this.socket&&(this.socket.close(),console.log("Socket closed"))}openSocket(){this.createSocket(),console.log("Socket opened manually")}sendWithRetry(t){this.socket?.readyState===WebSocket.OPEN?this.socket.send(t):this.recreateSocket(t)}async processMessage(t){if(typeof t.data=="string")try{const e=JSON.parse(t.data);if(Object.prototype.hasOwnProperty.call(e,"requestid")){const s=this.waitingResponse[e.requestid];s?s.resolve?.(e):console.warn("Got data but found no associated request, already timed out?",e)}else console.warn("Got data without request id",e)}catch{console.log(`Received String : ${t.data}`)}else t.data instanceof ArrayBuffer?console.log(`Received ArrayBuffer : ${t.data}`):t.data instanceof Blob&&console.log(`Received Blob : ${t.data}`)}async sendPayload(t){const e=+new Date,s=this.waitingResponse[e]={requestid:e};try{let n;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?n=t:n=JSON.stringify({...s,...t});const r=await new Promise((a,o)=>{s.resolve=a,this.sendWithRetry(n),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-s.requestid)/1e3),r}catch(n){return Promise.reject(n)}finally{delete this.waitingResponse[e]}}async send(t,e,s=n=>{console.log(n)}){this.sendPayload(t).then(e,s)}}function El(){const i=window.screen;return{screenWidth:i.width,screenHeight:i.height,screenX:window.screenX,screenY:window.screenY}}function Xe(){const i=document.documentElement;return{clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,offsetWidth:i.offsetWidth,offsetHeight:i.offsetHeight,offsetTop:i.offsetTop,offsetLeft:i.offsetLeft,offsetParent:i.offsetParent}}function _l(){const i=document.body;return{clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,offsetWidth:i.offsetWidth,offsetHeight:i.offsetHeight,offsetTop:i.offsetTop,offsetLeft:i.offsetLeft,offsetParent:i.offsetParent}}function Al(){return typeof window.innerWidth=="number"?{width:window.innerWidth,height:window.innerHeight}:document.compatMode==="CSS1Compat"?{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}:{width:document.body.clientWidth,height:document.body.clientHeight}}function Dl(){const{scrollWidth:i,scrollHeight:t}=Xe();return{width:i,height:t}}function ia(i){const{top:t,left:e,width:s,height:n}=i.getBoundingClientRect(),{scrollLeft:r,scrollTop:a}=Xe();return{x:e+r,y:t+a,width:s,height:n}}function Ml(i){let t=i,e=0,s=0;for(;t!==null;)e+=t.offsetLeft,s+=t.offsetTop,t.offsetParent instanceof HTMLElement?t=t.offsetParent:t=null;return{x:e,y:s,width:i.offsetWidth,height:i.offsetHeight}}function na(i){return i.getBoundingClientRect()}function Il(i){const t=i.getBoundingClientRect();return{x:i.offsetLeft,y:i.offsetTop,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function kl(){const{clientHeight:i,scrollTop:t,scrollHeight:e}=Xe(),s=e-i;return s<=0?0:t/s*100}function Ll(i){if("center"in i){const t=i.center,e=na(i.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:i.clientX,y:i.clientY}}function ra(i){if("center"in i)return i.center;if(typeof i.pageX=="number"&&typeof i.pageY=="number")return{x:i.pageX,y:i.pageY};const{scrollLeft:t,scrollTop:e}=Xe();return{x:i.clientX+t,y:i.clientY+e}}function Et(i,t){if(!t&&"offsetX"in i)return{x:i.offsetX,y:i.offsetY};const e=ra(i),s=ia(t||i.target);return{x:e.x-s.x,y:e.y-s.y}}function Rl(i){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let s=100;const n=function(){const r=Math.min(t.clientWidth,i);t.dataset.width=r,t.dataset.rem=s=Math.round(100*(r/i)),t.style.fontSize=s+"px"};n(),window.rem2px=function(r){return r=parseFloat(r),r*s},window.px2rem=function(r){return r=parseFloat(r),r/s},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",n,!1)}function N(i){return i*Math.PI/180}function nt(i){return i*180/Math.PI}function Rs(i,t,e=0){return Math.sqrt(i*i+t*t+e*e)}function Os(i,t,e,s){return Rs(e-i,s-t)}function Fs(i,t,e,s){const n=e-i,r=s-t;return n*n+r*r}function ie(i,t,e,s){let n=Math.atan2(s-t,e-i);return n<0&&(n+=Math.PI*2),n}function Rt(i,t){return{dx:Math.cos(i)*t,dy:Math.sin(i)*t}}function Ol(i,t,e){if(typeof e=="number"){const s=Math.sqrt(Math.pow(i,2)+Math.pow(t,2)+Math.pow(e,2));return{x:i/=s,y:t/=s,z:e/=s}}else{const s=Math.sqrt(Math.pow(i,2)+Math.pow(t,2));return{x:i/=s,y:t/=s}}}function Fl(i,t,e,s,n=10){if(Math.abs(e-i)<n&&Math.abs(s-t)<n)return"no";const r=nt(ie(i,t,e,s));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":"right"}const aa=Nl("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 Nl(i,t=10){const e={},s=i.split(",");for(let n=0;n<s.length;n+=2){const r="&"+s[n+1]+";",a=parseInt(s[n],t);e[r]="&#"+a+";"}return e["\\xa0"]=" ",e}function ht(i,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)i=i.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return i}function Ns(i){let t,e;if(!i)throw new Error("cannot create a random attribute name for an undefined object");const s="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=s[Math.floor(Math.random()*s.length)];while(i[t]);return t}function Bl(i){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[i]||t.start}function Ul(i){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[i]||t.alphabetic}const Ve={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 Bs{__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",ht("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 $i{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class ze{__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(Ve);for(let e=0,s=t.length;e<s;e++){const n=t[e];this[n]=Ve[n].canvas}}__getStyleState(){const t={},e=Object.keys(Ve);for(let s=0,n=e.length;s<n;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,n=e.length;s<n;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const n=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(n.setAttribute("fill","none"),n.setAttribute("stroke","none"));for(let a=0;a<r.length;a++){const o=r[a];n.setAttribute(o,e[o])}return n}__applyStyleToCurrentElement(t){let e=this.__currentElement;const s=this.__currentElementsToStyle;s&&(e.setAttribute(t,""),e=s.element,s.children.forEach(r=>{r.setAttribute(t,"")}));const n=Object.keys(Ve);for(let r=0;r<n.length;r++){const a=Ve[n[r]],o=this[n[r]];if(a.apply){if(o instanceof $i){if(o.__ctx)for(;o.__ctx.__SVGdefs.childNodes.length;){const h=o.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(o.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(a.apply,ht("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof Bs)e.setAttribute(a.apply,ht("url(#{id})",{id:o.__root.getAttribute("id")}));else if(a.apply.indexOf(t)!==-1&&a.svg!==o)if((a.svgAttr==="stroke"||a.svgAttr==="fill")&&o.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(o);if(c){e.setAttribute(a.svgAttr,ht("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const f=this.globalAlpha;f!=null&&(l*=f),e.setAttribute(a.svgAttr+"-opacity",""+l)}}else{let h=a.svgAttr;if(n[r]==="globalAlpha"&&(h=t+"-"+a.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,o)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const n=Object.keys(aa);for(let r=0,a=n.length;r<a;r++){const o=n[r],h=aa[o],c=new RegExp(o,"gi");c.test(e)&&(e=e.replace(c,h))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const n=this.__createElement("g");e.appendChild(n),this.__currentElement=n}let s=this.__currentElement.getAttribute("transform");s?s+=" ":s="",s+=t,this.__currentElement.setAttribute("transform",s)}scale(t,e){e===void 0&&(e=t),this.__addTransform(ht("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(ht("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(ht("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,n,r,a){this.__addTransform(ht("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,d:n,e:r,f:a}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(ht("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(ht("L {x} {y}",this.__currentPosition)):this.__addPathCommand(ht("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,n,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(ht("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:n,x:r,y:a}))}quadraticCurveTo(t,e,s,n){this.__currentPosition={x:s,y:n},this.__addPathCommand(ht("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,y:n}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,s,n,r){const a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(typeof a>"u"||typeof o>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(a===t&&o===e||t===s&&e===n||r===0){this.lineTo(t,e);return}const h=this.normalize([a-t,o-e]),c=this.normalize([s-t,n-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const l=h[0]*c[0]+h[1]*c[1],f=Math.acos(Math.abs(l)),y=this.normalize([h[0]+c[0],h[1]+c[1]]),b=r/Math.sin(f/2),p=t+b*y[0],E=e+b*y[1],_=[-h[1],h[0]],v=[c[1],-c[0]],x=function(P){const C=P[0];return P[1]>=0?Math.acos(C):-Math.acos(C)},w=x(_),g=x(v);this.lineTo(p+_[0]*r,E+_[1]*r),this.arc(p,E,r,w,g)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,s,n){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+n),this.lineTo(t,e+n),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,n){const r=this.__createElement("rect",{x:t,y:e,width:s,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,n){const r=this.__createElement("rect",{x:t,y:e,width:s,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],n=s.childNodes;for(let r=n.length-1;r>=0;r--)n[r]&&s.removeChild(n[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,n){if(t===0&&e===0&&s===this.width&&n===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:s,height:n,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,s,n){const r=this.__createElement("linearGradient",{id:Ns(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:n+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new Bs(r,this)}createRadialGradient(t,e,s,n,r,a){const o=this.__createElement("radialGradient",{id:Ns(this.__ids),cx:n+"px",cy:r+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new Bs(o,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),s={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(s.decoration="underline"),this.__fontHref&&(s.href=this.__fontHref),s}__wrapTextLink(t,e){if(t.href){const s=this.__createElement("a");return s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),s.appendChild(e),s}return e}__applyText(t,e,s,n){const r=this.__parseFont(),a=this.__closestGroupOrSvg(),o=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:s,"text-anchor":Bl(this.textAlign),"dominant-baseline":Ul(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(n),a.appendChild(this.__wrapTextLink(r,o))}fillText(t,e,s){this.__applyText(t,e,s,"fill")}strokeText(t,e,s){this.__applyText(t,e,s,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,s,n,r,a){if(n===r)return;n=n%(2*Math.PI),r=r%(2*Math.PI),n===r&&(r=(r+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+s*Math.cos(r),h=e+s*Math.sin(r),c=t+s*Math.cos(n),l=e+s*Math.sin(n),f=a?0:1;let y=0,b=r-n;b<0&&(b+=2*Math.PI),a?y=b>Math.PI?0:1:y=b>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(ht("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:y,sweepFlag:f,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=Ns(this.__ids),n=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",s),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",ht("url(#{id})",{id:s})),t.appendChild(n),this.__currentElement=n}drawImage(...t){let e=t[0],s,n,r,a,o=0,h=0,c,l,f,y,b,p,E,_;if(t.length===3)s=t[1],n=t[2],c=e.width,l=e.height,r=c,a=l;else if(t.length===5)s=t[1],n=t[2],r=t[3],a=t[4],c=e.width,l=e.height;else if(t.length===9)o=t[1],h=t[2],c=t[3],l=t[4],s=t[5],n=t[6],r=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const v=this.__closestGroupOrSvg();this.__currentElement;const x="translate("+s+", "+n+")";if(e instanceof ze){if(f=e.getSvg().cloneNode(!0),f.childNodes&&f.childNodes.length>1){for(y=f.childNodes[0];y.childNodes.length;)_=y.childNodes[0].getAttribute("id"),this.__ids[_]=_,this.__SVGdefs.appendChild(y.childNodes[0]);if(b=f.childNodes[1],b){const w=b.getAttribute("transform");let g;w?g=w+" "+x:g=x,b.setAttribute("transform",g),v.appendChild(b)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",a),p.setAttribute("preserveAspectRatio","none"),(o||h||c!==e.width||l!==e.height)&&(E=this.__document.createElement("canvas"),E.width=r,E.height=a,E.getContext("2d")?.drawImage(e,o,h,c,l,0,0,r,a),e=E),p.setAttribute("transform",x),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),v.appendChild(p))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),n=Ns(this.__ids);let r;return s.setAttribute("id",n),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),s.appendChild(r),this.__SVGdefs.appendChild(s)):t instanceof ze&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new $i(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class Us{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,s,n=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),n&&(this.customContext=new ze({canvas:this.canvas,width:e||this.canvas.width,height:s||this.canvas.height}))}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(this.customContext.globalAlpha=t)}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(this.customContext.fillStyle=t.gradientCustom))}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,s,n){return this.context.fillRect(t,e,s,n),this.customContext&&this.customContext.fillRect(t,e,s,n),this}fillText(t,e,s,n){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,s,n),this.customContext&&this.customContext.fillText(t,e,s),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,s,n){return this.context.strokeText(t,e,s,n),this.customContext&&this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,n){return this.context.strokeRect(t,e,s,n),this.customContext&&this.customContext.strokeRect(t,e,s,n),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,n=this.canvas.height){return this.context.clearRect(t,e,s,n),this.customContext&&this.customContext.clearRect(t,e,s,n),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext&&this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.currentPath2D=this.path2Ds.pop()||new Path2D,this}beginPath(){return this.context.beginPath(),this.customContext&&this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext&&this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const s=new Path2D;s.addPath(t,e),this.currentPath2D=s}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,s=0){return this.translate(e,s),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-s),this.changePath2D(),this}scale(t,e=t,s=0,n=0){return this.translate(s,n),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-s,-n),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,s,n,r,a){return this.context.arc(t,e,s,n,r,a),this.customContext&&this.customContext.arc(t,e,s,n,r,a?-1:1),this.currentPath2D.arc(t,e,s,n,r,a),this}arcTo(t,e,s,n,r){return this.context.arcTo(t,e,s,n,r),this.customContext&&this.customContext.arcTo(t,e,s,n,r),this.currentPath2D.arcTo(t,e,s,n,r),this}ellipse(t,e,s,n,r,a,o,h){return this.context.ellipse(t,e,s,n,r,a,o,h),this.currentPath2D.ellipse(t,e,s,n,r,a,o,h),this}quadraticCurveTo(t,e,s,n){return this.context.quadraticCurveTo(t,e,s,n),this.customContext&&this.customContext.quadraticCurveTo(t,e,s,n),this.currentPath2D.quadraticCurveTo(t,e,s,n),this}bezierCurveTo(t,e,s,n,r,a){return this.context.bezierCurveTo(t,e,s,n,r,a),this.customContext&&this.customContext.bezierCurveTo(t,e,s,n,r,a),this.currentPath2D.bezierCurveTo(t,e,s,n,r,a),this}rect(t,e,s,n){return this.context.rect(t,e,s,n),this.customContext&&this.customContext.rect(t,e,s,n),this.currentPath2D.rect(t,e,s,n),this}createLinearGradient(t,e,s,n,r){const a=this.context.createLinearGradient(t,e,s,n);return r&&Object.entries(r).forEach(([o,h])=>{a.addColorStop(parseFloat(o),h)}),a}createRadialGradient(t,e,s,n,r,a,o){const h=this.context.createRadialGradient(t,e,s,n,r,a);return o&&Object.entries(o).forEach(([c,l])=>{h.addColorStop(parseFloat(c),l)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const s=e[0],n=e[1];this.context.drawImage(t,s,n)}else if(e.length===4){const s=e[0],n=e[1],r=e[2],a=e[3];this.context.drawImage(t,s,n,r,a)}else if(e.length===8){const s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],h=e[5],c=e[6],l=e[7];this.context.drawImage(t,s,n,r,a,o,h,c,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,s=this.canvas.width,n=this.canvas.height,r){return this.context.getImageData(t,e,s,n,r)}putImageData(t,e=0,s=0){return this.context.putImageData(t,e,s)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}}class Ys{x;y;toX;toY;constructor(t){this.x=t?.x||0,this.y=t?.y||0,this.toX=t?.toX||0,this.toY=t?.toY||0}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(){const t=ie(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),s=Math.min(this.y,this.toY),n=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:s,width:n-e,height:r-s}}else{const e=Math.sin(t),s=Math.cos(t),n=s*this.x-e*this.y,r=s*this.toX-e*this.toY,a=s*this.y+e*this.x,o=s*this.toY+e*this.toX;return{x:Math.min(n,r),y:Math.min(a,o),width:Math.max(n,r)-Math.min(n,r),height:Math.max(a,o)-Math.min(a,o)}}}interpolate(t){return{x:this.x+t*(this.toX-this.x),y:this.y+t*(this.toY-this.y)}}intersection(t){const e=this.x,s=this.y,n=t.toX,r=t.toY,a=this.toX-e,o=t.x-n;if(!a&&!o)return null;const h=(this.toY-s)/a,c=(t.y-r)/o;if(a){if(!o)return{x:n,y:h*(n-e)+s}}else return{x:e,y:c*(e-n)+r};const l=(-c*n+r+h*e-s)/(h-c),f=h*(l-e)+s;return isNaN(l)||isNaN(f)?null:{x:l,y:f}}}const oa=Ys;class Wi extends Ys{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,this.toX=t.toX,this.toY=t.toY}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,s,n,r,a,o,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,s,n,r,a,o,h,!this.sweepFlag)}convert(t,e,s,n,r,a,o,h,c){const l=o/180*Math.PI,f=(t-s)/2,y=(e-n)/2,b=Math.cos(l)*f+Math.sin(l)*y,p=-Math.sin(l)*f+Math.cos(l)*y,E=b*b/(r*r)+p*p/(a*a);if(E>1){const Z=Math.sqrt(E);throw r=Z*r,a=Z*a,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${a}.`)}const _=Math.sqrt((r*r*a*a-r*r*p*p-a*a*b*b)/(r*r*p*p+a*a*b*b)),v=h!=c?1:-1,x=v*_*r*p/a,w=v*_*-a*b/r,g=(t+s)/2,P=(e+n)/2,C=Math.cos(l)*x-Math.sin(l)*w+g,B=Math.sin(l)*x+Math.cos(l)*w+P,H=(Z,at,Ct,gt)=>(Z*gt>=at*Ct?1:-1)*Math.acos((Z*Ct+at*gt)/(Math.sqrt(Z*Z+at*at)*Math.sqrt(Ct*Ct+gt*gt))),G=H(1,0,t-C,e-B)-l,J=H(t-C,e-B,s-C,n-B);return[C,B,r,a,l,G,G+J]}}class Yl extends Ys{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["Q",t,e,this.toX,this.toY]]}else return[["Q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,s,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(){const t=[this.x,this.toX],e=[this.y,this.toY];let s,n,r,a;for(let c=0;c<2;++c)s=c==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,n=c==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,r=c==0?this.x:this.y,Math.abs(s)>1e-12&&(a=-n/(2*s),0<a&&a<1&&[t,e][c].push(s*a*a+n*a+r));const o={x:Math.min.apply(0,t),y:Math.min.apply(0,e)},h={x:Math.max.apply(0,t),y:Math.max.apply(0,e)};return{x:o.x,y:o.y,width:h.x-o.x,height:h.y-o.y}}interpolate(t){return{x:(1-t)*(1-t)*this.x+2*(1-t)*t*this.cx+t*t*this.toX,y:(1-t)*(1-t)*this.y+2*(1-t)*t*this.cy+t*t*this.toY}}}const Xl=Yl;class mt extends Ys{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}toSVGPathData(){return[["C",this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY]]}toCanvasContext(t){t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY)}getBoundingClientRect(){let t=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),e=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),s=this.x-this.c1x,n=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t;const a=[this.y,this.toY],o=[this.x,this.toX];let h;const c=[];Math.abs(n)>1e12&&(n=.5),Math.abs(r)>1e12&&(r=.5),n>=0&&n<=1&&(h=this.interpolate(n),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),t=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),e=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),s=this.y-this.c1y,n=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t,Math.abs(n)>1e12&&(n=.5),Math.abs(r)>1e12&&(r=.5),n>=0&&n<=1&&(h=this.interpolate(n),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y}));let l=[],f=c.length;for(let p=0;p<f;p++){for(let E=p+1;E<f;E++)c[p].X===c[E].X&&c[p].Y===c[E].Y&&(E=++p);l.push({X:c[p].X,Y:c[p].Y})}const y={x:Math.min.apply(Math,o),y:Math.min.apply(Math,a)},b={x:Math.max.apply(Math,o),y:Math.max.apply(Math,a)};return{x:y.x,y:y.y,width:b.x-y.x,height:b.y-y.y,dots:l}}interpolate(t){return{x:Math.pow(1-t,3)*this.x+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.toX,y:Math.pow(1-t,3)*this.y+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.toY}}static base3(t,e,s,n,r){const a=-3*e+9*s-9*n+3*r,o=t*a+6*e-12*s+6*n;return t*o-3*e+3*s}static bezlen(t,e,s,n,r,a,o,h,c=1){c=Math.max(0,Math.min(c,1));const l=c/2,f=[-.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 b=0;for(let p=0;p<12;p++){const E=l*f[p]+l,_=this.base3(E,t,s,r,o),v=this.base3(E,e,n,a,h);b+=y[p]*Math.sqrt(_*_+v*v)}return l*b}length(t=1){return mt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,s=this.y,n=this.c1x,r=this.c1y,a=this.c2x,o=this.c2y,h=this.toX,c=this.toY;if(t<0||mt.bezlen(e,s,n,r,a,o,h,c)<t)return 0;let l=1,f=l/2,y=l-f,b=mt.bezlen(e,s,n,r,a,o,h,c,y);for(;Math.abs(b-t)>.01;)f/=2,y+=(b<t?1:-1)*f,b=mt.bezlen(e,s,n,r,a,o,h,c,y);return y}getPointAtSegmentLength(t){const e=this.getTatLen(t);let s=1-e,n=Math.pow(s,3),r=Math.pow(s,2),a=e*e,o=a*e,h=n*this.x+r*3*e*this.c1x+s*3*e*e*this.c2x+o*this.toX,c=n*this.y+r*3*e*this.c1y+s*3*e*e*this.c2y+o*this.toY,l=this.x+2*e*(this.c1x-this.x)+a*(this.c2x-2*this.c1x+this.x),f=this.y+2*e*(this.c1y-this.y)+a*(this.c2y-2*this.c1y+this.y),y=this.c1x+2*e*(this.c2x-this.c1x)+a*(this.toX-2*this.c2x+this.c1x),b=this.c1y+2*e*(this.c2y-this.c1y)+a*(this.toY-2*this.c2y+this.c1y),p=s*this.x+e*this.c1x,E=s*this.y+e*this.c1y,_=s*this.c2x+e*this.toX,v=s*this.c2y+e*this.toY,x=90-Math.atan2(l-y,f-b)*180/Math.PI;return{x:h,y:c,m:{x:l,y:f},n:{x:y,y:b},start:{x:p,y:E},end:{x:_,y:v},alpha:x}}}const Ge=Math.PI*2;function ha(i,t,e,s){const n=i*s-t*e<0?-1:1;let r=i*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),n*Math.acos(r)}function Vl(i,t,e,s,n,r,a,o,h,c){const l=c*(i-e)/2+h*(t-s)/2,f=-h*(i-e)/2+c*(t-s)/2,y=a*a,b=o*o,p=l*l,E=f*f;let _=y*b-y*E-b*p;_<0&&(_=0),_/=y*E+b*p,_=Math.sqrt(_)*(n===r?-1:1);const v=_*a/o*f,x=_*-o/a*l,w=c*v-h*x+(i+e)/2,g=h*v+c*x+(t+s)/2,P=(l-v)/a,C=(f-x)/o,B=(-l-v)/a,H=(-f-x)/o,G=ha(1,0,P,C);let J=ha(P,C,B,H);return r===0&&J>0&&(J-=Ge),r===1&&J<0&&(J+=Ge),[w,g,G,J]}function zl(i,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(i),n=Math.sin(i),r=Math.cos(i+t),a=Math.sin(i+t);return[s,n,s-n*e,n+s*e,r+a*e,a-r*e,r,a]}function ca(i,t,e,s,n,r,a,o,h){const c=Math.sin(h*Ge/360),l=Math.cos(h*Ge/360),f=l*(i-e)/2+c*(t-s)/2,y=-c*(i-e)/2+l*(t-s)/2;if(f===0&&y===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const b=f*f/(a*a)+y*y/(o*o);b>1&&(a*=Math.sqrt(b),o*=Math.sqrt(b));const p=Vl(i,t,e,s,n,r,a,o,c,l),E=[];let _=p[2],v=p[3];const x=Math.max(Math.ceil(Math.abs(v)/(Ge/4)),1);v/=x;for(let w=0;w<x;w++)E.push(zl(_,v)),_+=v;return E.map(w=>{for(let g=0;g<w.length;g+=2){let P=w[g+0],C=w[g+1];P*=a,C*=o;const B=l*P-c*C,H=c*P+l*C;w[g+0]=B+p[0],w[g+1]=H+p[1]}return w})}function Ji(i,t,e,s,n,r){return[i/3+2/3*e,t/3+2/3*s,n/3+2/3*e,r/3+2/3*s,n,r]}function qe(i,t,e,s){return[i,t,e,s,e,s]}const He={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class fe{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&se(s,e),s}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||Pn()})}static downloadFromSVGElement(t,e="shape"){return Ss(Tr(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return Ss(ri(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return Ti(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 fe.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,n,r)=>{let a=n.toLowerCase();const o=kn(r);for(a=="m"&&o.length>He[a]&&(e.push([n,...o.splice(0,He[a])]),a="l",n=n=="m"?"l":"L");o.length;){if(o.length<He[a])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${n} } args:{ ${o} }`);e.push([n,...o.splice(0,He[a])])}return a=="z"&&e.push([n]),""}),e}static absolutizeSVGPath(t){let e=0,s=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toUpperCase();if(o!=h)switch(a[0]=h,o){case"a":a[6]+=n,a[7]+=r;break;case"v":a[1]+=r;break;case"h":a[1]+=n;break;default:for(let c=1;c<a.length;)a[c++]+=n,a[c++]+=r}switch(h){case"Z":n=e,r=s;break;case"H":n=a[1];break;case"V":r=a[1];break;case"M":n=e=a[1],r=s=a[2];break;default:n=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,s=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toLowerCase();if(o!=h)switch(a[0]=h,o){case"A":a[6]-=n,a[7]-=r;break;case"V":a[1]-=r;break;case"H":a[1]-=n;break;default:for(let c=1;c<a.length;)a[c++]-=n,a[c++]-=r}switch(h){case"z":n=e,r=s;break;case"h":n+=a[1];break;case"v":r+=a[1];break;case"m":n+=a[1],r+=a[2],e+=a[1],s+=a[2];break;default:n+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){const e=[];let s=0,n=0,r=0,a=0,o=0,h=0,c=0,l=0,f;for(let y=0,b=t.length;y<b;y++){let p=t[y];const E=p[0];switch(E){case"M":s=p[1],n=p[2];break;case"A":const _=ca(r,a,p[6],p[7],p[4],p[5],p[1],p[2],p[3]);if(!_.length)continue;_.forEach((w,g)=>{const[P,C,B,H,G,J,Z,at]=w;p=["C",B,H,G,J,Z,at],g<_.length-1&&e.push(p)});break;case"S":let v=r,x=a;(f=="C"||f=="S")&&(v+=v-c,x+=x-l),p=["C",v,x,p[1],p[2],p[3],p[4]];break;case"T":f=="Q"||f=="T"?(o=r*2-o,h=a*2-h):(o=r,h=a),p=["C",...Ji(r,a,o,h,p[1],p[2])];break;case"Q":o=p[1],h=p[2],p=["C",...Ji(r,a,p[1],p[2],p[3],p[4])];break;case"L":p=["C",...qe(r,a,p[1],p[2])];break;case"H":p=["C",...qe(r,a,p[1],a)];break;case"V":p=["C",...qe(r,a,r,p[1])];break;case"Z":p=["C",...qe(r,a,s,n)];break}f=E,r=p[p.length-2],a=p[p.length-1],p.length>4?(c=p[p.length-4],l=p[p.length-3]):(c=r,l=a),e.push(p)}return e}static catmullRom2bezier(t){const e=[];for(let s=0,n=t.length;n-2>s;s+=2){let r;s==0?r=[{x:t[s],y:t[s+1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}]:n-4==s?r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+2],y:t[s+3]}]:r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}];const a=[{x:r[1].x,y:r[1].y},{x:(-r[0].x+6*r[1].x+r[2].x)/6,y:(-r[0].y+6*r[1].y+r[2].y)/6},{x:(r[1].x+6*r[2].x-r[3].x)/6,y:(r[1].y+6*r[2].y-r[3].y)/6},{x:r[2].x,y:r[2].y}];e.push(["C",a[1].x,a[1].y,a[2].x,a[2].y,a[3].x,a[3].y])}return e}static zvhToLSVGPath(t){const e=[];let s=["L",0,0],n;for(let r=0,a=t.length;r<a;r++){const o=t[r];switch(o[0]){case"M":s=["L",o[1],o[2]],e.push(o);break;case"Z":e.push(s);break;case"H":n=e[e.length-1]||["L",0,0],e.push(["L",o[1],n[n.length-1]]);break;case"V":n=e[e.length-1]||["L",0,0],e.push(["L",n[n.length-2],o[1]]);break;default:e.push(o)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let s,n=0,r=0;for(let a=0,o=t.length;a<o;a++){const h=t[a],c=e[h[0]];c&&(h[0]=c.to,s&&(s[0]===c.to?(n=2*Number(s[c.x+2])-Number(s[c.x]),r=2*Number(s[c.x+3])-Number(s[c.x+1])):(n=Number(s[s.length-2]),r=Number(s[s.length-1]))),h.splice(1,0,n,r)),s=h}return t}}const wt=fe;class xt{cX;cY;x;y;degree;scalarX;scalarY;startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){this.cX=0,this.cY=0,this.x=t?.x||0,this.y=t?.y||0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&(this.cX=t.centerX-this.x,this.cY=t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.reset(t?.d,t?.originMatrix)}reset(t,e){typeof t=="string"?this.resetFromSVGPathData(wt.parseSVGPath(t),e):t instanceof xt?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const s=wt.normalizeSVGPath(wt.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let n=!1;for(let r=0,a=s.length;r<a;r++){const o=s[r];if(o[0]=="M"){n||(n=!0,this.startPathX=o[1],this.startPathY=o[2]),this.prevPathX=o[1],this.prevPathY=o[2];continue}this.appendLine(new mt({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],toX:o[5],toY:o[6]}))}e&&({x:this.startPathX,y:this.startPathY}=e.transformPoint({x:this.startPathX,y:this.startPathY}),{x:this.prevPathX,y:this.prevPathY}=e.transformPoint({x:this.prevPathX,y:this.prevPathY}),this.normalizedLines.forEach(r=>{({x:r.x,y:r.y}=e.transformPoint({x:r.x,y:r.y})),{x:r.c1x,y:r.c1y}=e.transformPoint({x:r.c1x,y:r.c1y}),{x:r.c2x,y:r.c2y}=e.transformPoint({x:r.c2x,y:r.c2y}),{x:r.toX,y:r.toY}=e.transformPoint({x:r.toX,y:r.toY})}))}static fromPolymorphPoints(t){const e=new xt;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let s=2,n=t.length;s+5<n;s+=6)e.appendLine(new mt({c1x:t[s],c1y:t[s+1],c2x:t[s+2],c2y:t[s+3],toX:t[s+4],toY:t[s+5]}));return e}static fromLines(t){const e=new xt;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let s=0,n=t.length;s<n;s++)e.appendLine(t[s]);return e}appendLine(t){if(t instanceof Wi){ca(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,f,y,b,p,E,_,v]=c;this.normalizedLines.push(new mt({x:this.prevPathX,y:this.prevPathY,c1x:y,c1y:b,c2x:p,c2y:E,toX:_,toY:v})),this.prevPathX=_,this.prevPathY=v});return}let e,s,n,r,a,o;t instanceof mt?(e=t.c1x,s=t.c1y,n=t.c2x,r=t.c2y,a=t.toX,o=t.toY):t instanceof Xl?[e,s,n,r,a,o]=Ji(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,n,r,a,o]=qe(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new mt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:n,c2y:r,toX:a,toY:o})),this.prevPathX=a,this.prevPathY=o}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform(),n=[];n.push(["M",t,e]);for(let r=0,a=s.length;r<a;r++)n.push(...s[r].toSVGPathData());return n}toSVGPathD(){return wt.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:s,normalizedLines:n}=this.updateTransform();t.beginPath(),t.moveTo(e,s),n.forEach(r=>{r.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],s=[];if(t.forEach(h=>{const c=h.getBoundingClientRect();e.push(c.x,c.x+c.width),s.push(c.y,c.y+c.height)}),e.length==0||s.length==0)return{x:0,y:0,width:0,height:0};const n=Math.min.apply(0,e),r=Math.min.apply(0,s),a=Math.max.apply(0,e),o=Math.max.apply(0,s);return{x:n,y:r,width:a-n,height:o-r}}update(t){this.cX=typeof t.cX=="number"?t.cX:this.cX,this.cY=typeof t.cY=="number"?t.cY:this.cY,this.x=t.x,this.y=t.y,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY}updateTransform(){const t=new ct;if(t.translate(this.x+this.cX,this.y+this.cY),t.rotate(this.degree),t.scale(this.scalarX,this.scalarY),t.translate(-this.cX,-this.cY),t.isIdentity)return{startPathX:this.startPathX,startPathY:this.startPathY,normalizedLines:this.normalizedLines};{let e=this.startPathX,s=this.startPathY;({x:e,y:s}=t.transformPoint({x:e,y:s}));const n=[];return this.normalizedLines.forEach(r=>{let a=r.x,o=r.y,h=r.c1x,c=r.c1y,l=r.c2x,f=r.c2y,y=r.toX,b=r.toY;({x:a,y:o}=t.transformPoint({x:a,y:o})),{x:h,y:c}=t.transformPoint({x:h,y:c}),{x:l,y:f}=t.transformPoint({x:l,y:f}),{x:y,y:b}=t.transformPoint({x:y,y:b}),n.push(new mt({x:a,y:o,c1x:h,c1y:c,c2x:l,c2y:f,toX:y,toY:b}))}),{startPathX:e,startPathY:s,normalizedLines:n}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,s)=>e+=s.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let s=0;const n=e.length;for(let r=0;r<n;r++){const a=e[r],o=a.length();if(s+o>=t)return a.getPointAtSegmentLength(t-s);s+=o}return e[n-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:s,normalizedLines:n}=this.updateTransform(),r=n.length;if(r===0)return{x:e,y:s};if(r===1)return n[0].interpolate(t);{let a=t*r,o=n[0];if(a--,a>1)for(let h=1;h<r&&(o=n[h],a>1);h++)a-=1;return o.interpolate(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}}getSubpathsAtLength(t,e,s){const{startPathX:n,startPathY:r,normalizedLines:a}=t.updateTransform();let o=null,h=0;const c=new xt;c.prevPathX=c.startPathX=n,c.prevPathY=c.startPathY=r;for(let l=0,f=a.length;l<f;l++){const y=a[l],b=y.length();if(h+b>e&&!o){const p=y.getPointAtSegmentLength(e-h);if(c.appendLine(new mt({c1x:p.start.x,c1y:p.start.y,c2x:p.m.x,c2y:p.m.y,toX:p.x,toY:p.y})),s)return c;o=c,c.appendLine(new mt({c1x:p.n.x,c1y:p.n.y,c2x:p.end.x,c2y:p.end.y,toX:y.x,toY:y.y})),h+=b;continue}h+=b,c.appendLine(y)}return c}closestPoint(t,e){const s=this.getTotalLength();let n={x:t,y:e},r=0,a=1/0,o=8;for(let c=0;c<=s;c+=o){let l=this.getPointAtLength(c),f=Fs(l.x,l.y,t,e);f<a&&(n=l,r=c,a=f)}for(o/=2;o>.5;){let c=r-o,l=this.getPointAtLength(c),f=Fs(l.x,l.y,t,e),y=r+o,b=this.getPointAtLength(y),p=Fs(b.x,b.y,t,e);c>=0&&f<a?(n=l,r=c,a=f):y<=s&&p<a?(n=b,r=y,a=p):o/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:n,rotation:r>=s?ie(h.x,h.y,n.x,n.y):ie(n.x,n.y,h.x,h.y),distance:Math.sqrt(a)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform();return[t,e].concat(s.reduce((n,r)=>n.concat([r.c1x,r.c1y,r.c2x,r.c2y,r.toX,r.toY]),[]))}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let s=t[e-2],n=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=Os(t[a],t[a+1],s,n),s=t[a],n=t[a+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,s=e.length;let n=t-s;const r=Math.ceil(t/s),a=[];a.push(["M",e[0],e[1]]);let o=2;for(;o+5<=s-1;){const h=e[o++],c=e[o++],l=e[o++],f=e[o++],y=e[o++],b=e[o++];a.push(["C",h,c,l,f,y,b]);let p=0;for(;p<r&&n>0;)a.push(["C",y,b,y,b,y,b]),n-=6,p++}return a}static mixPoints(t,e,s){const n=t.length,r=new Array(n);for(let a=0;a<n;a++)r[a]=Mt(t[a]+(e[a]-t[a])*s,6);return r}static getPathInterpolator(t,e){return s=>Math.abs(s-0)<Number.EPSILON?t:Math.abs(s-1)<Number.EPSILON?e:xt.fromPolymorphPoints(xt.mixPoints(new xt({d:t}).polymorphPoints,new xt({d:e}).polymorphPoints,s)).toSVGPathData()}}const Gl=xt;class q extends ls{id;originD;originMatrix;independentTransformInGroup;forceCXY=!1;cX;cY;x;y;degree;scalarX;scalarY;diffXInGroup;diffYInGroup;diffDegreeInGroup;diffScalarXInGroup;diffScalarYInGroup;vx;vy;ax;ay;mass;attrs;enableDrag;alongPath;isDragging=!1;isMouseIn=!1;targetToAfterDragFree;followMouse;strokeArmyAnts;strokeArmyAntsOffset=0;strokeDashTotalLength=0;isShow=!0;el;pathd;usePathDtoCanvasContext=!1;parent;shapes=[];constructor(t){if(super(),this.id=Pn(),t?.d&&(this.originD=t?.d),t?.originMatrix&&(this.originMatrix=t.originMatrix),this.independentTransformInGroup=typeof t?.independentTransformInGroup=="boolean"?t.independentTransformInGroup:!1,this.x=t?.x||0,this.y=t?.y||0,this.cX=0,this.cY=0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&this.forceSetCXY(t.centerX-this.x,t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.diffXInGroup=t?.diffXInGroup||0,this.diffYInGroup=t?.diffYInGroup||0,this.diffDegreeInGroup=t?.diffDegreeInGroup||0,this.diffScalarXInGroup=t?.diffScalarXInGroup||1,this.diffScalarYInGroup=t?.diffScalarYInGroup||1,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||1,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this.enableDrag=t?.enableDrag||!1,this.alongPath=t?.alongPath,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.strokeArmyAnts=t?.strokeArmyAnts||!1,this.strokeArmyAnts){const s=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",s),this.strokeDashTotalLength=kn(s).reduce((n,r)=>n+r,0)}return On(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new xt,yt(()=>{this.pathd?.reset(this.originD||this.toSVGPathData(),this.originMatrix)}),this.pathd&&!this.forceCXY){const t=this.shapes.length==0?this.pathd.getBoundingClientRect():this.getBoundingClientRect();t&&(this.pathd.cX=this.cX=t.x+t.width/2-this.pathd.x,this.pathd.cY=this.cY=t.y+t.height/2-this.pathd.y)}this.shapeInit()}return this.pathd}frameStart(t){}frameUpdate(t,e){this.pathd=this.initPathD(),this.pathd.update(this),this.strokeArmyAnts&&(this.isMouseIn||(this.setAttr("stroke-dashoffset",String(this.strokeArmyAntsOffset++)),this.strokeArmyAntsOffset>this.strokeDashTotalLength&&(this.strokeArmyAntsOffset=0)))}frameEnd(t){}toSVGPathData(){return[]}toSVGPathD(){return this.pathd?.toSVGPathD()||""}toCanvasContext(t){this.usePathDtoCanvasContext=!0,this.pathd?.toCanvasContext(t)}getBoundingClientRect(){return this.pathd?.getBoundingClientRect()||null}get center(){const t=this.getBoundingClientRect(),e={x:this.x,y:this.y};return t&&(e.x=t.x+t.width/2,e.y=t.y+t.height/2),e}trim(){if(this.parent)return;const t=this.getBoundingClientRect();if(!t)return;this.shapes.forEach(s=>{const n=s.originMatrix?s.originMatrix.clone():new ct;n.translate(-t.x+s.x,-t.y+s.y),s.originMatrix=n});const e=this.originMatrix?this.originMatrix.clone():new ct;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,s){if(s instanceof Us)return s.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let n;try{n=new SVGPoint(t,e)}catch{n=s.createSVGPoint(),n.x=t,n.y=e}if(this.el instanceof SVGGeometryElement)return this.el.isPointInFill(n);{const r=this.getBoundingClientRect();if(r)return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height}return!1}isPointInStroke(t,e,s){if(s instanceof Us)return s.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let n;try{n=new SVGPoint(t,e)}catch{n=s.createSVGPoint(),n.x=t,n.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(n):!1}clone(){return co(this).copy(this)}copy(t){return this.id=t.id,this.originD=t.originD,this.originMatrix=t.originMatrix,this.independentTransformInGroup=t.independentTransformInGroup,this.x=t.x,this.y=t.y,this.cX=t.cX,this.cY=t.cY,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY,this.diffXInGroup=t.diffXInGroup,this.diffYInGroup=t.diffYInGroup,this.diffDegreeInGroup=t.diffDegreeInGroup,this.diffScalarXInGroup=t.diffScalarXInGroup,this.diffScalarYInGroup=t.diffScalarYInGroup,this.vx=t.vx,this.vy=t.vy,this.ax=t.ax,this.ay=t.ay,this.mass=t.mass,this.attrs={...t.attrs},this.enableDrag=t.enableDrag,this.alongPath=t.alongPath,this.targetToAfterDragFree=t.targetToAfterDragFree,this.followMouse=t.followMouse,this.isShow=t.isShow,this.strokeArmyAnts=t.strokeArmyAnts,this.strokeDashTotalLength=t.strokeDashTotalLength,this}save(){}restore(){}setAttr(t,e){typeof t!="string"?Object.assign(this.attrs,Object.fromEntries(Object.entries(t).map(([s,n])=>[dt(s),n]))):e&&(this.attrs[dt(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[dt(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[dt(t)]}distance(t){return Os(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=nt(ie(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:s,dy:n}=Rt(N(this.degree),e);this.vx=s,this.vy=n,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:s,dy:n}=Rt(N(this.degree),e);this.ax=s,this.ay=n,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,s=t.y-this.y,n=e*e+s*s,r=Math.sqrt(n),a=this.mass*t.mass/n,o=a*e/r,h=a*s/r;this.vx+=o/this.mass,this.vy+=h/this.mass,t.vx-=o/t.mass,t.vy-=h/t.mass}run(t){this.vx+=this.ax,this.vy+=this.ay;const e=Jt(t?.gravity,0);this.vy+=e;const s=Jt(t?.friction,1);this.vx*=s,this.vy*=s,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const s=Jt(e?.easing,.05),n=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=n*s,this.vy=r*s,this.run(e)}runSpringTo(t,e){const s=Jt(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(n=>{const r=n.x-this.cX-this.x,a=n.y-this.cY-this.y,o=r*s,h=a*s;this.vx+=o,this.vy+=h}),this.run({friction:.9,...e})}springMassTo(t,e){const s=Jt(e?.springLength,100),n=Jt(e?.spring,1e-4),r=t.x-this.x,a=t.y-this.y,o=Math.sqrt(r*r+a*a);if(o<s){const h=r*n,c=a*n;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-o/s}return 0}getTotalLength(){return this.initPathD().getTotalLength()}interpolate(t){return this.initPathD().interpolate(t)}getPointAtLength(t){return this.initPathD().getPointAtLength(t)}trailPath(t,e=0){const s=this.getTotalLength();return t.originD=this.initPathD().getSubpath(0,e*s),this.getPointAtLength(e*s)}strokeDashTween(t=1e3,e){const s=this.initPathD(),n=Mt(s.getTotalLength(),0);this.setAttr({strokeDasharray:`${n} ${n}`,strokeDashoffset:`${n}`});const r=e?.onUpdate,a=new Ds({frameDuration:t});a.addTween({offset:n},{offset:0},Object.assign(e||{},{onUpdate:(o,h)=>{this.setAttr("strokeDashoffset",""+Mt(o.offset,2)),r?.(o,h)}})),a.play()}}class je extends q{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}toSVGPathData(){return this.radius?[["M",this.getScreenX(),this.getScreenY()-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:[["M",this.getScreenX(),this.getScreenY()]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,s){this.cX=t,this.cY=e,this.cZ=s}rotateX(t){({x:this.y,y:this.z}=_t(N(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=_t(N(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=_t(N(t),this.x,this.y))}getScreenX(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*t}getScreenY(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*t}eq(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.radius===t.radius&&this.mass===t.mass}length(){return Rs(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,s=t.y-this.y,n=t.z-this.z;return Math.sqrt(e*e+s*s+n*n)}scalar(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y,n=this.z;return{x:s*t.z-n*t.y,y:n*t.x-e*t.z,z:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y,z:this.z*t.z}}div(t){return{x:this.x/t.x,y:this.y/t.y,z:this.z/t.z}}add(t){return{x:this.x+t.x,y:this.y+t.y,z:this.z+t.z}}sub(t){return{x:this.x-t.x,y:this.y-t.y,z:this.z-t.z}}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y,z:this.z-2*e*t.z}}}const la=[1,0,0,1,0,0],ua=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class ct{value;_m13=0;_m23=0;_m33=1;matrix3d;constructor(t=la){this.value=Array.from(t),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D()}static fromString(t){const e=new ct,s=Cn("number",t);return s.length===6&&s.forEach((n,r)=>{n.fullMatch&&(e.value[r]=parseFloat(n.fullMatch))}),e}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this._m13}get m21(){return this.value[2]}get m22(){return this.value[3]}get m23(){return this._m23}get m31(){return this.value[4]}get m32(){return this.value[5]}get m33(){return this._m33}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this._m13=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set m23(t){this._m23=t}set m31(t){this.value[4]=t}set m32(t){this.value[5]=t}set m33(t){this._m33=t}toMatrix3D(t=this.matrix3d){const e=[this.m11,this.m12,0,this.m13,this.m21,this.m22,0,this.m23,0,0,1,0,this.m31,this.m32,0,this.m33];return t?(t.value=e,t):new pt(e)}identity(){return this.value=Array.from(la),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D(),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m31==0&&this.m32==0&&this.m33==1}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m31*=t,this.m32*=t,this.m33*=t,this}normalize(){const t=this.m33||1e-4;return this.scalar(1/t)}transformPoint(t){const e=t.z||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31,y:t.x*this.m12+t.y*this.m22+e*this.m32,z:t.x*this.m13+t.y*this.m23+e*this.m33}}clone(){return new ct([...this.value])}multiply(t){const e=this.clone(),s=t instanceof ct?t:new ct(t);return this.m11=s.m11*e.m11+s.m12*e.m21+s.m13*e.m31,this.m12=s.m11*e.m12+s.m12*e.m22+s.m13*e.m32,this.m13=s.m11*e.m13+s.m12*e.m23+s.m13*e.m33,this.m21=s.m21*e.m11+s.m22*e.m21+s.m23*e.m31,this.m22=s.m21*e.m12+s.m22*e.m22+s.m23*e.m32,this.m23=s.m21*e.m13+s.m22*e.m23+s.m23*e.m33,this.m31=s.m31*e.m11+s.m32*e.m21+s.m33*e.m31,this.m32=s.m31*e.m12+s.m32*e.m22+s.m33*e.m32,this.m33=s.m31*e.m13+s.m32*e.m23+s.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}inverse(){const t=this.m11,e=this.m12,s=this.m13,n=this.m21,r=this.m22,a=this.m23,o=this.m31,h=this.m32,c=this.m33,l=c*r-a*h,f=-c*n+a*o,y=h*n-r*o;let b=t*l+e*f+s*y;return b?(b=1/b,this.m11=l*b,this.m12=(-c*e+s*h)*b,this.m13=(a*e-s*r)*b,this.m21=f*b,this.m22=(c*t-s*o)*b,this.m23=(-a*t+s*n)*b,this.m31=y*b,this.m32=(-h*t+e*o)*b,this.m33=(r*t-e*n)*b,this):null}adjugate(){const t=new ct;return t.m11=this.m22*this.m33-this.m32*this.m23,t.m12=this.m32*this.m13-this.m12*this.m33,t.m13=this.m12*this.m23-this.m22*this.m13,t.m21=this.m31*this.m23-this.m21*this.m33,t.m22=this.m11*this.m33-this.m31*this.m13,t.m23=this.m21*this.m13-this.m11*this.m23,t.m31=this.m21*this.m32-this.m31*this.m22,t.m32=this.m31*this.m12-this.m11*this.m32,t.m33=this.m11*this.m22-this.m21*this.m12,t}split(){let t=nt(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(t+=180),{x:this.m31,y:this.m32,degree:t,scaleX:Math.sqrt(this.m11*this.m11+this.m12*this.m12),scaleY:Math.sqrt(this.m21*this.m21+this.m22*this.m22),skewX:nt(Math.atan2(-this.m21,this.m22)),skewY:nt(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],s=this.value[1],n=this.value[2],r=this.value[3],a=this.value[4],o=this.value[5],h=t.value[0],c=t.value[1],l=t.value[2],f=t.value[3],y=t.value[4],b=t.value[5],p=h*f,E=c*l,_=(l*s-e*f)/(E-p),v=(h*s-e*c)/(p-E),x=(l*r-n*f)/(E-p),w=(h*r-n*c)/(p-E),g=(l*(o-b)+f*(y-a))/(E-p),P=(h*(o-b)+c*(y-a))/(p-E),C=[_,v,x,w,g,P];return new ct(C)}toString(t=6){return this.matrix3d.is2D()?`matrix(${this.value.map(e=>Mt(e,t)).join(",")})`:this.matrix3d.toString()}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix3D(),this}translateTo(t,e){return this.translate(t-this.m31,e-this.m32)}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.m32)}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.m31,t)}translateZ(t){return this.matrix3d.translate(0,0,t),this.matrix3d.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix3d.m43),this}translate3d(t,e,s){return this.matrix3d.translate(t,e,s),this.matrix3d.toMatrix(this),this}translate3dTo(t,e,s){return this.translate3d(t-this.matrix3d.m41,e-this.matrix3d.m42,s-this.matrix3d.m43),this}rotate(t,e=0,s=0){const n=N(t),r=Math.cos(n),a=Math.sin(n);return this.translate(e,s),this.multiply([r,a,-a,r,0,0]),this.translate(-e,-s),this.toMatrix3D(),this}rotateTo(t,e=0,s=0){const{degree:n}=this.split();return this.rotate(t-n,e,s),this}rotateX(t){return this.matrix3d.rotateX(t),this.matrix3d.toMatrix(this),this}rotateXTo(t){const{degreeX:e}=this.matrix3d.split();return this.rotateX(t-e),this}rotateY(t){return this.matrix3d.rotateY(t),this.matrix3d.toMatrix(this),this}rotateYTo(t){const{degreeY:e}=this.matrix3d.split();return this.rotateY(t-e),this}rotateZ(t){return this.matrix3d.rotateZ(t),this.matrix3d.toMatrix(this),this}rotateZTo(t){const{degreeZ:e}=this.matrix3d.split();return this.rotateZ(t-e),this}rotate3d(t,e,s){return this.matrix3d.rotateX(t).rotateY(e).rotateZ(s),this.matrix3d.toMatrix(this),this}rotate3dTo(t,e,s){const{degreeX:n,degreeY:r,degreeZ:a}=this.matrix3d.split();return this.rotate3d(t-n,e-r,s-a),this}scale(t,e=t,s=0,n=0){return this.translate(s,n),this.multiply([t,0,0,e,0,0]),this.translate(-s,-n),this.toMatrix3D(),this}scaleTo(t,e=t,s=0,n=0){return this.scale(t/this.m11,e/this.m22,s,n)}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.m11,1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.m22)}scaleZ(t){return this.matrix3d.scale(1,1,t),this.matrix3d.toMatrix(this),this}scaleZTo(t){const{scalarZ:e}=this.matrix3d.split();return this.scaleZ(t/e),this}scale3d(t,e=t,s=t){return this.matrix3d.scale(t,e,s),this.matrix3d.toMatrix(this),this}scale3dTo(t,e=t,s=t){const{scalarX:n,scalarY:r,scalarZ:a}=this.matrix3d.split();return this.scale3d(t/n,e/r,s/a),this}skew(t,e=t){return this.multiply([Math.cos(N(e)),Math.sin(N(e)),-Math.sin(N(t)),Math.cos(N(t)),0,0]),this.toMatrix3D(),this}skewTo(t,e=t){const{skewX:s,skewY:n}=this.split();return this.skew(t-s,e-n)}skewX(t){const{skewY:e}=this.split();return this.skew(t,e)}skewXTo(t){const{skewY:e}=this.split();return this.skewTo(t,e)}skewY(t){const{skewX:e}=this.split();return this.skew(e,t)}skewYTo(t){const{skewX:e}=this.split();return this.skewTo(e,t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,s){return this}skew3dTo(t,e,s){return this}perspective(t){return this.matrix3d.perspective(t),this.matrix3d.toMatrix(this),this}}class pt{value;is3dSpecial=!1;constructor(t=ua){this.value=Array.from(t)}static fromString(t){const e=new pt,s=Cn("number",t);return s.length===16&&s.forEach((n,r)=>{n.fullMatch&&(e.value[r]=parseFloat(n.fullMatch))}),e}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m14(){return this.value[3]}get m21(){return this.value[4]}get m22(){return this.value[5]}get m23(){return this.value[6]}get m24(){return this.value[7]}get m31(){return this.value[8]}get m32(){return this.value[9]}get m33(){return this.value[10]}get m34(){return this.value[11]}get m41(){return this.value[12]}get m42(){return this.value[13]}get m43(){return this.value[14]}get m44(){return this.value[15]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m14(t){this.value[3]=t}set m21(t){this.value[4]=t}set m22(t){this.value[5]=t}set m23(t){this.value[6]=t}set m24(t){this.value[7]=t}set m31(t){this.value[8]=t}set m32(t){this.value[9]=t}set m33(t){this.value[10]=t}set m34(t){this.value[11]=t}set m41(t){this.value[12]=t}set m42(t){this.value[13]=t}set m43(t){this.value[14]=t}set m44(t){this.value[15]=t}is2D(){return!this.is3dSpecial&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m43==0&&this.m44==1}is3D(){return!this.is2D()}identity(){return this.value=Array.from(ua),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m14==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m24==0&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m41==0&&this.m42==0&&this.m43==0&&this.m44==1}clone(){return new pt([...this.value])}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m14*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m24*=t,this.m31*=t,this.m32*=t,this.m33*=t,this.m34*=t,this.m41*=t,this.m42*=t,this.m43*=t,this.m44*=t,this}normalize(){return this.scalar(1/(this.m44||1e-4))}transformPoint(t){const e=t.z||1,s=t.w||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31+s*this.m41,y:t.x*this.m12+t.y*this.m22+e*this.m32+s*this.m42,z:t.x*this.m13+t.y*this.m23+e*this.m33+s*this.m43,w:t.x*this.m14+t.y*this.m24+e*this.m34+s*this.m44}}toMatrix(t){const{scalarX:e,scalarY:s,skewX:n,skewY:r,x:a,y:o}=this.split(),h=[e,r,n,s,a,o];return t?(t.value=h,t):new ct(h)}flatten(){return this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m14=0,this.m24=0,this.m43=0,this.m44=1,this}toString(t=6){return`matrix3d(${this.value.map(e=>Mt(e,t)).join(",")})`}split(){const t=Math.sqrt(this.m11*this.m11+this.m12*this.m12+this.m13*this.m13),e=Math.sqrt(this.m21*this.m21+this.m22*this.m22+this.m23*this.m23),s=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),n=nt(j(Math.asin(-this.m13),-1,1));let r=nt(Math.atan2(this.m23,this.m33));Math.cos(N(n))===0&&(r=nt(Math.atan2(-this.m31,this.m22)));let a=nt(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(a+=180),{x:this.m41,y:this.m42,z:this.m43,scalarX:t,scalarY:e,scalarZ:s,degreeX:r,degreeY:n,degreeZ:a,skewX:nt(this.m14),skewY:nt(this.m24),skewZ:nt(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}inverse(){const t=[],e=this.m11,s=this.m12,n=this.m13,r=this.m14,a=this.m21,o=this.m22,h=this.m23,c=this.m24,l=this.m31,f=this.m32,y=this.m33,b=this.m34,p=this.m41,E=this.m42,_=this.m43,v=this.m44;t[0]=h*b*E-c*y*E+c*f*_-o*b*_-h*f*v+o*y*v,t[1]=r*y*E-n*b*E-r*f*_+s*b*_+n*f*v-s*y*v,t[2]=n*c*E-r*h*E+r*o*_-s*c*_-n*o*v+s*h*v,t[3]=r*h*f-n*c*f-r*o*y+s*c*y+n*o*b-s*h*b;const x=e*t[0]+a*t[1]+l*t[2]+p*t[3];if(x==0)return console.warn("Can't invert matrix, determinant is 0");t[4]=c*y*p-h*b*p-c*l*_+a*b*_+h*l*v-a*y*v,t[5]=n*b*p-r*y*p+r*l*_-e*b*_-n*l*v+e*y*v,t[6]=r*h*p-n*c*p-r*a*_+e*c*_+n*a*v-e*h*v,t[7]=n*c*l-r*h*l+r*a*y-e*c*y-n*a*b+e*h*b,t[8]=o*b*p-c*f*p+c*l*E-a*b*E-o*l*v+a*f*v,t[9]=r*f*p-s*b*p-r*l*E+e*b*E+s*l*v-e*f*v,t[10]=s*c*p-r*o*p+r*a*E-e*c*E-s*a*v+e*o*v,t[11]=r*o*l-s*c*l-r*a*f+e*c*f+s*a*b-e*o*b,t[12]=h*f*p-o*y*p-h*l*E+a*y*E+o*l*_-a*f*_,t[13]=s*y*p-n*f*p+n*l*E-e*y*E-s*l*_+e*f*_,t[14]=n*o*p-s*h*p-n*a*E+e*h*E+s*a*_-e*o*_,t[15]=s*h*l-n*o*l+n*a*f-e*h*f-s*a*y+e*o*y,this.value=t,this.scalar(1/x)}multiply(t){const e=this.clone();return this.m11=t.m11*e.m11+t.m12*e.m21+t.m13*e.m31+t.m14*e.m41,this.m12=t.m11*e.m12+t.m12*e.m22+t.m13*e.m32+t.m14*e.m42,this.m13=t.m11*e.m13+t.m12*e.m23+t.m13*e.m33+t.m14*e.m43,this.m14=t.m11*e.m14+t.m12*e.m24+t.m13*e.m34+t.m14*e.m44,this.m21=t.m21*e.m11+t.m22*e.m21+t.m23*e.m31+t.m24*e.m41,this.m22=t.m21*e.m12+t.m22*e.m22+t.m23*e.m32+t.m24*e.m42,this.m23=t.m21*e.m13+t.m22*e.m23+t.m23*e.m33+t.m24*e.m43,this.m24=t.m21*e.m14+t.m22*e.m24+t.m23*e.m34+t.m24*e.m44,this.m31=t.m31*e.m11+t.m32*e.m21+t.m33*e.m31+t.m34*e.m41,this.m32=t.m31*e.m12+t.m32*e.m22+t.m33*e.m32+t.m34*e.m42,this.m33=t.m31*e.m13+t.m32*e.m23+t.m33*e.m33+t.m34*e.m43,this.m34=t.m31*e.m14+t.m32*e.m24+t.m33*e.m34+t.m34*e.m44,this.m41=t.m41*e.m11+t.m42*e.m21+t.m43*e.m31+t.m44*e.m41,this.m42=t.m41*e.m12+t.m42*e.m22+t.m43*e.m32+t.m44*e.m42,this.m43=t.m41*e.m13+t.m42*e.m23+t.m43*e.m33+t.m44*e.m43,this.m44=t.m41*e.m14+t.m42*e.m24+t.m43*e.m34+t.m44*e.m44,this}translate(t=0,e=0,s=0){return this.multiply(new pt([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 pt([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}rotateX(t){const e=N(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new pt([1,0,0,0,0,s,n,0,0,-n,s,0,0,0,0,1]))}rotateY(t){const e=N(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new pt([s,0,-n,0,0,1,0,0,n,0,s,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=N(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new pt([s,n,0,0,-n,s,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,s=0){return this.multiply(new pt([1,0,0,N(t),0,1,0,N(e),0,0,1,N(s),0,0,0,1]))}perspective(t){return this.multiply(new pt([1,0,0,0,0,1,0,0,0,0,1,t?-(1/t):0,0,0,0,1]))}unproject(t){let e=t.x*this.m11+t.y*this.m21+this.m41,s=t.x*this.m12+t.y*this.m22+this.m42,n=t.x*this.m13+t.y*this.m23+this.m43,r=t.x*this.m14+t.y*this.m24+this.m44,a=e+this.m31,o=s+this.m32,h=n+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,s/=r,n/=r,c==0&&(c=1e-4),a/=c,o/=c,h/=c;const l=h-n;if(l==0)return{x:e,y:s,z:n,mass:r};const f=-n/l;return e+=f*(a-e),s+=f*(o-s),{x:e,y:s,z:n,mass:r}}project(t){const e=t.z;let s=t.x*this.m11+t.y*this.m21+e*this.m31+this.m41,n=t.x*this.m12+t.y*this.m22+e*this.m32+this.m42,r=t.x*this.m14+t.y*this.m24+e*this.m34+this.m44;return r==0&&(r=1e-4),s/=r,n/=r,r<0&&(s-=this.m41,n-=this.m42,s*=1/r,n*=1/r,s+=this.m41,n+=this.m42),{x:s,y:n,z:e,mass:r}}bounds(t,e,s,n){const r=new je({x:t,y:e}),a=new je({x:t+s,y:e}),o=new je({x:t+s,y:e+n}),h=new je({x:t,y:e+n});({x:r.x,y:r.y,z:r.z,mass:r.mass}=this.project(r)),{x:a.x,y:a.y,z:a.z,mass:a.mass}=this.project(a),{x:o.x,y:o.y,z:o.z,mass:o.mass}=this.project(o),{x:h.x,y:h.y,z:h.z,mass:h.mass}=this.project(h);const c=Math.min(r.x,a.x,o.x,h.x),l=Math.min(r.y,a.y,o.y,h.y),f=Math.max(r.x,a.x,o.x,h.x)-c,y=Math.max(r.y,a.y,o.y,h.y)-l;return{x:c,y:l,width:f,height:y}}}function Zi(i){const t=new ct;return i.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,s,n){n.indexOf(",")>=0?n=n.split(/\s*,\s*/):n=n.split(/\s+/);const r=[];for(let a=0,o=n.length;a<o;a++)n[a].trim()&&r.push(parseFloat(""+n[a]));switch(s.toLowerCase()){case"t":case"translate":t.translate(r[0],r[1]);break;case"translatex":t.translateX(r[0]);break;case"translatey":t.translateY(r[0]);break;case"translatez":t.translateZ(r[0]);break;case"translate3d":t.translate3d(r[0],r[1],r[2]);break;case"r":case"rotate":t.rotate(r[0],r[1]??0,r[2]??0);break;case"rotatex":t.rotateX(r[0]);break;case"rotatey":t.rotateY(r[0]);break;case"rotatez":t.rotateZ(r[0]);break;case"rotate3d":t.rotate3d(r[0],r[1],r[2]);break;case"s":case"scale":t.scale(r[0],r[1]??r[0]);break;case"scalex":t.scaleX(r[0]);break;case"scaley":t.scaleY(r[0]);break;case"scalez":t.scaleZ(r[0]);break;case"scale3d":t.scale3d(r[0],r[1],r[2]);break;case"skew":t.skew(r[0],r[1]??0);break;case"skewx":t.skewX(r[0]);break;case"skewy":t.skewY(r[0]);break;case"skewz":t.skewZ(r[0]);break;case"skew3d":t.skew3d(r[0],r[1],r[2]);break;case"m":case"matrix":t.multiply([r[0],r[1],r[2],r[3],r[4],r[5]]),t.toMatrix3D();break;case"matrix3d":t.matrix3d.multiply(new pt(r)),t.matrix3d.toMatrix(t);break}return""}),t}function _t(i,t,e){const s=new ct;return s.rotate(nt(i)),s.transformPoint({x:t,y:e})}function Ki(i){const t=typeof i?.x=="number"?i?.x:0,e=typeof i?.y=="number"?i?.y:0,s=typeof i?.degree=="number"?i?.degree:0,n=typeof i?.scalarX=="number"?i?.scalarX:1,r=typeof i?.scalarY=="number"?i?.scalarY:1,a=N(s),o=Math.cos(a),h=Math.sin(a),c=new DOMMatrix([o*n,h*n,-h*r,o*r,t,e]);return c.multiplySelf(new DOMMatrix(i?.originMatrix||"")),c}function ql(i,t){const e=new Path2D(i),s=new Path2D;return s.addPath(e,Ki(t)),s}function fa(i,t){const e={x:t.m11,y:t.m12,z:t.m13},s={x:t.m21,y:t.m22,z:t.m23},n={x:t.m31,y:t.m32,z:t.m33},r=i.transformPoint(e),a=i.transformPoint(s),o=i.transformPoint(n),h=new ct;return h.m11=r.x,h.m12=r.y,h.m13=r.z,h.m21=a.x,h.m22=a.y,h.m23=a.z,h.m31=o.x,h.m32=o.y,h.m33=o.z,h}function da(i,t){const e={x:t.m11,y:t.m12,z:t.m13,w:t.m14},s={x:t.m21,y:t.m22,z:t.m23,w:t.m24},n={x:t.m31,y:t.m32,z:t.m33,w:t.m34},r={x:t.m41,y:t.m42,z:t.m43,w:t.m44},a=i.transformPoint(e),o=i.transformPoint(s),h=i.transformPoint(n),c=i.transformPoint(r);return new pt([a.x,a.y,a.z,a.w,o.x,o.y,o.z,o.w,h.x,h.y,h.z,h.w,c.x,c.y,c.z,c.w])}function Hl(i){let t=i[0];for(let e=1,s=i.length;e<s;e++)t=fa(t,i[e]);return t}function jl(i){let t=i[0];for(let e=1,s=i.length;e<s;e++)t=da(t,i[e]);return t}class F{static createElementNS(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}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=ee(t.parentElement,"position");Ue(t.parentElement,{position:s=="static"?"relative":s,perspective:e})}Ue(t,{"transform-style":"preserve-3d"})}static convertAttrs(t,e,s={}){Object.prototype.hasOwnProperty.call(s,"transform")||Object.assign(s,{transform:ee(t,"transform")||""});const n=Zi(s.transform),r={};for(const a in e){const o=e[a];switch(a){case"transform":break;case"translate":n.translate(o[0]||0,o[1]||0);break;case"translateTo":n.translateTo(o[0]||0,o[1]||0);break;case"translateX":n.translateX(o||0);break;case"translateXTo":n.translateXTo(o||0);break;case"translateY":n.translateY(o||0);break;case"translateYTo":n.translateYTo(o||0);break;case"translateZ":n.translateZ(o||0);break;case"translateZTo":n.translateZTo(o||0);break;case"translate3d":n.translate3d(o[0]||0,o[1]||0,o[2]||0);break;case"translate3dTo":n.translate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotate":typeof o=="number"?n.rotate(o||0):n.rotate(o[0]||0,o[1]||0,o[2]||0);break;case"rotateTo":typeof o=="number"?n.rotateTo(o||0):n.rotateTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotateX":n.rotateX(o||0);break;case"rotateXTo":n.rotateXTo(o||0);break;case"rotateY":n.rotateY(o||0);break;case"rotateYTo":n.rotateYTo(o||0);break;case"rotateZ":n.rotateZ(o||0);break;case"rotateZTo":n.rotateZTo(o||0);break;case"rotate3d":n.rotate3d(o[0]||0,o[1]||0,o[2]||0);break;case"rotate3dTo":n.rotate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"scale":typeof o=="number"?n.scale(o||1):n.scale(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleTo":typeof o=="number"?n.scaleTo(o||1):n.scaleTo(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleX":n.scaleX(o||1);break;case"scaleXTo":n.scaleXTo(o||1);break;case"scaleY":n.scaleY(o||1);break;case"scaleYTo":n.scaleYTo(o||1);break;case"scaleZ":n.scaleZ(o||1);break;case"scaleZTo":n.scaleZTo(o||1);break;case"scale3d":typeof o=="number"?n.scale3d(o||1):n.scale3d(o[0]||1,o[1]||1,o[2]||1);break;case"scale3dTo":typeof o=="number"?n.scale3dTo(o||1):n.scale3dTo(o[0]||1,o[1]||1,o[2]||1);break;case"skew":typeof o=="number"?n.skew(o||0):n.skew(o[0]||0,o[1]||0);break;case"skewTo":typeof o=="number"?n.skewTo(o||0):n.skewTo(o[0]||0,o[1]||0);break;case"skewX":n.skewX(o||0);break;case"skewXTo":n.skewXTo(o||0);break;case"skewY":n.skewY(o||0);break;case"skewYTo":n.skewYTo(o||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;case"perspective":n.perspective(o||0);break;default:Object.prototype.hasOwnProperty.call(s,a)||(s[a]=ee(t,a)),Object.assign(r,{[a]:`${o}`});break}}return Object.assign(r,{transform:n.toString()}),r}static attrsToCanvas(t,e){for(const s in e){const n=e[s];switch(s){case"fill":n!=="none"&&(t.fillStyle=n);break;case"stroke":n!=="none"&&(t.strokeStyle=n);break;case"stroke-width":case"strokeWidth":t.lineWidth=Number(n);break;case"stroke-linecap":case"strokeLinecap":t.lineCap=n;break;case"stroke-linejoin":case"strokeLinejoin":switch(n){case"round":case"bevel":case"miter":t.lineJoin=n;break;default:t.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":t.miterLimit=Number(n);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":t.lineDashOffset=Number(n);break;case"stroke-dasharray":case"strokeDasharray":typeof n=="string"&&t.setLineDash(n.split(/\s+/).map(r=>Number(r)));break;case"cursor":break;case"font":typeof n=="string"&&(t.font=n);break;case"font-size":case"fontSize":t.font+=` ${n}`;break;case"font-family":case"fontFamily":t.font+=` ${n}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(n){case"middle":t.textAlign="center";break;case"end":t.textAlign="end";break;case"start":t.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(n){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":t.textBaseline=n;break;default:t.textBaseline="alphabetic";break}break}}}static fixProp(t){const e={cellpadding:"cellPadding",cellspacing:"cellSpacing",class:"className",colspan:"colSpan",contenteditable:"contentEditable",for:"htmlFor",frameborder:"frameBorder",maxlength:"maxLength",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"};return e[t]?e[t]:t}static prop(t,e,s){if(s===void 0&&typeof e=="string")return t[e];{let n={};typeof e=="object"?n=e:typeof e=="string"&&s!==void 0&&(n[e]=s),Object.entries(n).forEach(([r,a])=>{const o=this.fixProp(r);t[o]=a,o=="innerHTML"&&this.scriptConvert(t)})}}static removeProp(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&delete t[this.fixProp(s.trim())]})}static 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 scriptConvert(t){const e=s=>{const r=s.ownerDocument.createElement("script");r.text=s.text;const a=s.attributes;for(let o=0;o<a.length;o++)r.setAttribute(a[o].name,a[o].value);return r};return t.tagName=="SCRIPT"&&(t=e(t)),t.querySelectorAll&&t.querySelectorAll("script").forEach(s=>{s.parentNode?.replaceChild(e(s),s)}),t}static insert(t,e,s="append"){return typeof e=="string"?t[s](this.fragment(e)):(e instanceof HTMLElement||e instanceof SVGElement)&&t[s](e),this}static createElement(t){return document.createElement.call(document,t)}static createTextNode(t){return document.createTextNode.call(document,t)}static createDocumentFragment(){return document.createDocumentFragment.call(document)}static fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(s=>{const n=this.scriptConvert(s);n!=s&&e.content.replaceChild(n,s)}),e.content}static getScrollParent(t){if(!(t instanceof HTMLElement||t instanceof SVGElement))return;const e=Ye(t).parents();for(let s=0;s<e.length;s+=1)if(/(auto|scroll)/.test(ee(e[s],"overflow")+ee(e[s],"overflow-y")+ee(e[s],"overflow-x")))return e[s];return document.scrollingElement||document.documentElement}static contains(t,e){return t.contains?t!=e&&t.contains(e):!!(t.compareDocumentPosition(e)&16)}static changeSelectSelected(t,e){if(t instanceof HTMLSelectElement){const s=t.options;for(let n=0,r=s.length;n<r;n++)s[n].value==e?s[n].selected=!0:s[n].selected=!1}}static changeRadioChecked(t,e){t instanceof HTMLInputElement&&(t.value==e?t.checked=!0:t.checked=!1)}static entity2text(t){const e={lt:60,"lt;":60,"AMP;":38,AMP:38,"GT;":62,GT:62,"QUOT;":34,QUOT:34,"apos;":39,"bull;":8226,"bullet;":8226,"copy;":169,copy:169,"deg;":176,deg:176};let s;return t.charAt(0)=="#"?t.charAt(1).toLowerCase()=="x"?s=parseInt(t.substring(2),16):s=parseInt(t.substring(1),10):s=e[t],s?String.fromCharCode(s):"&"+t}static 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){
|
|
16
16
|
let output = "";
|
|
17
17
|
function echo(html){
|
|
18
18
|
output += html;
|
|
19
19
|
}
|
|
20
20
|
${t}
|
|
21
21
|
return output;
|
|
22
|
-
})`}static escape(t,e="encode"){const s={"&":"&","<":"<",">":">",'"':""","'":"'"};for(const n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t=t.replace(new RegExp(e=="encode"?n:s[n],"g"),e=="encode"?s[n]:n));return t}static getInnerText=t=>{let e=t.innerText;if(!e){const s=t.querySelector("slot")?.assignedNodes()||[];let n=0;for(;!e&&n<=s.length-1;)"innerText"in s[n]&&(e=s[n].innerText),n++}return e};static
|
|
22
|
+
})`}static escape(t,e="encode"){const s={"&":"&","<":"<",">":">",'"':""","'":"'"};for(const n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t=t.replace(new RegExp(e=="encode"?n:s[n],"g"),e=="encode"?s[n]:n));return t}static getInnerText=t=>{let e=t.innerText;if(!e){const s=t.querySelector("slot")?.assignedNodes()||[];let n=0;for(;!e&&n<=s.length-1;)"innerText"in s[n]&&(e=s[n].innerText),n++}return e};static getSelectedText=()=>window.getSelection()?.toString();static isTabInView=()=>!document.hidden;static navigateBack=()=>history.back();static navigateBack2=()=>history.go(-1);static iframePostMessage(t,e="http://test.com/localstorage.html"){const s=document.createElement("iframe");s.src=e,document.body.append(s),setTimeout(function(){s.contentWindow?.postMessage(t,e)},4e3),setTimeout(function(){s.remove()},6e3)}static measureText=(t,e=12,s=400)=>{const n=document.createElement("span");n.style.visibility="hidden",n.style.margin="0",n.style.padding="0",n.style.inset="0",n.style.whiteSpace="nowrap",n.style.overflow="visible",n.style.fontSize=e+"px",n.style.fontWeight=s.toString(),n.innerText=t,document.body.appendChild(n);const r=n.offsetWidth,a=n.offsetHeight;return document.body.removeChild(n),{width:r,height:a}};static getFixedWidthText=(t,e,s=12,n=400,r=!0)=>{let a="";if(!t||e<s)return a;const o=t.split(""),h="...";let c=r?F.measureText(h,s,n).width:0;for(let l=0,f=o.length;l<f;l++)if(c+=F.measureText(o[l],s,n).width,c>e){r&&(a+=h);break}else a+=o[l];return a};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}}}var ma={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
23
23
|
* http://hammerjs.github.io/
|
|
24
24
|
*
|
|
25
25
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
26
26
|
* Licensed under the MIT license */(function(i){(function(t,e,s,n){var r=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),o="function",h=Math.round,c=Math.abs,l=Date.now;function f(u,m,S){return setTimeout(w(u,S),m)}function y(u,m,S){return Array.isArray(u)?(b(u,S[m],S),!0):!1}function b(u,m,S){var A;if(u)if(u.forEach)u.forEach(m,S);else if(u.length!==n)for(A=0;A<u.length;)m.call(S,u[A],A,u),A++;else for(A in u)u.hasOwnProperty(A)&&m.call(S,u[A],A,u)}function p(u,m,S){var A="DEPRECATED METHOD: "+m+`
|
|
27
27
|
`+S+` AT
|
|
28
|
-
`;return function(){var M=new Error("get-stack-trace"),O=M&&M.stack?M.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",U=t.console&&(t.console.warn||t.console.log);return U&&U.call(t.console,A,O),u.apply(this,arguments)}}var E;typeof Object.assign!="function"?E=function(m){if(m===n||m===null)throw new TypeError("Cannot convert undefined or null to object");for(var S=Object(m),A=1;A<arguments.length;A++){var M=arguments[A];if(M!==n&&M!==null)for(var O in M)M.hasOwnProperty(O)&&(S[O]=M[O])}return S}:E=Object.assign;var _=p(function(m,S,A){for(var M=Object.keys(S),O=0;O<M.length;)(!A||A&&m[M[O]]===n)&&(m[M[O]]=S[M[O]]),O++;return m},"extend","Use `assign`."),v=p(function(m,S){return _(m,S,!0)},"merge","Use `assign`.");function x(u,m,S){var A=m.prototype,M;M=u.prototype=Object.create(A),M.constructor=u,M._super=A,S&&E(M,S)}function w(u,m){return function(){return u.apply(m,arguments)}}function g(u,m){return typeof u==o?u.apply(m&&m[0]||n,m):u}function P(u,m){return u===n?m:u}function C(u,m,S){b(J(m),function(A){u.addEventListener(A,S,!1)})}function B(u,m,S){b(J(m),function(A){u.removeEventListener(A,S,!1)})}function q(u,m){for(;u;){if(u==m)return!0;u=u.parentNode}return!1}function G(u,m){return u.indexOf(m)>-1}function J(u){return u.trim().split(/\s+/g)}function Z(u,m,S){if(u.indexOf&&!S)return u.indexOf(m);for(var A=0;A<u.length;){if(S&&u[A][S]==m||!S&&u[A]===m)return A;A++}return-1}function at(u){return Array.prototype.slice.call(u,0)}function Ct(u,m,S){for(var A=[],M=[],O=0;O<u.length;){var U=m?u[O][m]:u[O];Z(M,U)<0&&A.push(u[O]),M[O]=U,O++}return S&&(m?A=A.sort(function(it,ft){return it[m]>ft[m]}):A=A.sort()),A}function pt(u,m){for(var S,A,M=m[0].toUpperCase()+m.slice(1),O=0;O<r.length;){if(S=r[O],A=S?S+M:m,A in u)return A;O++}return n}var Pe=1;function ae(){return Pe++}function pe(u){var m=u.ownerDocument||u;return m.defaultView||m.parentWindow||t}var Ee=/mobile|tablet|ip(ad|hone|od)|android/i,F="ontouchstart"in t,k=pt(t,"PointerEvent")!==n,Y=F&&Ee.test(navigator.userAgent),V="touch",ut="pen",At="mouse",Gs="kinect",zs=25,et=1,Ot=2,W=4,I=8,Hs=1,We=2,Je=4,Ze=8,Ke=16,Ft=We|Je,ge=Ze|Ke,La=Ft|ge,Ra=["x","y"],qs=["clientX","clientY"];function Tt(u,m){var S=this;this.manager=u,this.callback=m,this.element=u.element,this.target=u.options.inputTarget,this.domHandler=function(A){g(u.options.enable,[u])&&S.handler(A)},this.init()}Tt.prototype={handler:function(){},init:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(pe(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&B(this.element,this.evEl,this.domHandler),this.evTarget&&B(this.target,this.evTarget,this.domHandler),this.evWin&&B(pe(this.element),this.evWin,this.domHandler)}};function zf(u){var m,S=u.options.inputClass;return S?m=S:k?m=cn:Y?m=Ws:F?m=ln:m=$s,new m(u,Hf)}function Hf(u,m,S){var A=S.pointers.length,M=S.changedPointers.length,O=m&et&&A-M===0,U=m&(W|I)&&A-M===0;S.isFirst=!!O,S.isFinal=!!U,O&&(u.session={}),S.eventType=m,qf(u,S),u.emit("hammer.input",S),u.recognize(S),u.session.prevInput=S}function qf(u,m){var S=u.session,A=m.pointers,M=A.length;S.firstInput||(S.firstInput=Oa(m)),M>1&&!S.firstMultiple?S.firstMultiple=Oa(m):M===1&&(S.firstMultiple=!1);var O=S.firstInput,U=S.firstMultiple,st=U?U.center:O.center,it=m.center=Fa(A);m.timeStamp=l(),m.deltaTime=m.timeStamp-O.timeStamp,m.angle=hn(st,it),m.distance=js(st,it),jf(S,m),m.offsetDirection=Ba(m.deltaX,m.deltaY);var ft=Na(m.deltaTime,m.deltaX,m.deltaY);m.overallVelocityX=ft.x,m.overallVelocityY=ft.y,m.overallVelocity=c(ft.x)>c(ft.y)?ft.x:ft.y,m.scale=U?Jf(U.pointers,A):1,m.rotation=U?Wf(U.pointers,A):0,m.maxPointers=S.prevInput?m.pointers.length>S.prevInput.maxPointers?m.pointers.length:S.prevInput.maxPointers:m.pointers.length,$f(S,m);var Bt=u.element;q(m.srcEvent.target,Bt)&&(Bt=m.srcEvent.target),m.target=Bt}function jf(u,m){var S=m.center,A=u.offsetDelta||{},M=u.prevDelta||{},O=u.prevInput||{};(m.eventType===et||O.eventType===W)&&(M=u.prevDelta={x:O.deltaX||0,y:O.deltaY||0},A=u.offsetDelta={x:S.x,y:S.y}),m.deltaX=M.x+(S.x-A.x),m.deltaY=M.y+(S.y-A.y)}function $f(u,m){var S=u.lastInterval||m,A=m.timeStamp-S.timeStamp,M,O,U,st;if(m.eventType!=I&&(A>zs||S.velocity===n)){var it=m.deltaX-S.deltaX,ft=m.deltaY-S.deltaY,Bt=Na(A,it,ft);O=Bt.x,U=Bt.y,M=c(Bt.x)>c(Bt.y)?Bt.x:Bt.y,st=Ba(it,ft),u.lastInterval=m}else M=S.velocity,O=S.velocityX,U=S.velocityY,st=S.direction;m.velocity=M,m.velocityX=O,m.velocityY=U,m.direction=st}function Oa(u){for(var m=[],S=0;S<u.pointers.length;)m[S]={clientX:h(u.pointers[S].clientX),clientY:h(u.pointers[S].clientY)},S++;return{timeStamp:l(),pointers:m,center:Fa(m),deltaX:u.deltaX,deltaY:u.deltaY}}function Fa(u){var m=u.length;if(m===1)return{x:h(u[0].clientX),y:h(u[0].clientY)};for(var S=0,A=0,M=0;M<m;)S+=u[M].clientX,A+=u[M].clientY,M++;return{x:h(S/m),y:h(A/m)}}function Na(u,m,S){return{x:m/u||0,y:S/u||0}}function Ba(u,m){return u===m?Hs:c(u)>=c(m)?u<0?We:Je:m<0?Ze:Ke}function js(u,m,S){S||(S=Ra);var A=m[S[0]]-u[S[0]],M=m[S[1]]-u[S[1]];return Math.sqrt(A*A+M*M)}function hn(u,m,S){S||(S=Ra);var A=m[S[0]]-u[S[0]],M=m[S[1]]-u[S[1]];return Math.atan2(M,A)*180/Math.PI}function Wf(u,m){return hn(m[1],m[0],qs)+hn(u[1],u[0],qs)}function Jf(u,m){return js(m[0],m[1],qs)/js(u[0],u[1],qs)}var Zf={mousedown:et,mousemove:Ot,mouseup:W},Kf="mousedown",Qf="mousemove mouseup";function $s(){this.evEl=Kf,this.evWin=Qf,this.pressed=!1,Tt.apply(this,arguments)}x($s,Tt,{handler:function(m){var S=Zf[m.type];S&et&&m.button===0&&(this.pressed=!0),S&Ot&&m.which!==1&&(S=W),this.pressed&&(S&W&&(this.pressed=!1),this.callback(this.manager,S,{pointers:[m],changedPointers:[m],pointerType:At,srcEvent:m}))}});var td={pointerdown:et,pointermove:Ot,pointerup:W,pointercancel:I,pointerout:I},ed={2:V,3:ut,4:At,5:Gs},Ya="pointerdown",Ua="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Ya="MSPointerDown",Ua="MSPointerMove MSPointerUp MSPointerCancel");function cn(){this.evEl=Ya,this.evWin=Ua,Tt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}x(cn,Tt,{handler:function(m){var S=this.store,A=!1,M=m.type.toLowerCase().replace("ms",""),O=td[M],U=ed[m.pointerType]||m.pointerType,st=U==V,it=Z(S,m.pointerId,"pointerId");O&et&&(m.button===0||st)?it<0&&(S.push(m),it=S.length-1):O&(W|I)&&(A=!0),!(it<0)&&(S[it]=m,this.callback(this.manager,O,{pointers:S,changedPointers:[m],pointerType:U,srcEvent:m}),A&&S.splice(it,1))}});var sd={touchstart:et,touchmove:Ot,touchend:W,touchcancel:I},id="touchstart",nd="touchstart touchmove touchend touchcancel";function Xa(){this.evTarget=id,this.evWin=nd,this.started=!1,Tt.apply(this,arguments)}x(Xa,Tt,{handler:function(m){var S=sd[m.type];if(S===et&&(this.started=!0),!!this.started){var A=rd.call(this,m,S);S&(W|I)&&A[0].length-A[1].length===0&&(this.started=!1),this.callback(this.manager,S,{pointers:A[0],changedPointers:A[1],pointerType:V,srcEvent:m})}}});function rd(u,m){var S=at(u.touches),A=at(u.changedTouches);return m&(W|I)&&(S=Ct(S.concat(A),"identifier",!0)),[S,A]}var ad={touchstart:et,touchmove:Ot,touchend:W,touchcancel:I},od="touchstart touchmove touchend touchcancel";function Ws(){this.evTarget=od,this.targetIds={},Tt.apply(this,arguments)}x(Ws,Tt,{handler:function(m){var S=ad[m.type],A=hd.call(this,m,S);A&&this.callback(this.manager,S,{pointers:A[0],changedPointers:A[1],pointerType:V,srcEvent:m})}});function hd(u,m){var S=at(u.touches),A=this.targetIds;if(m&(et|Ot)&&S.length===1)return A[S[0].identifier]=!0,[S,S];var M,O,U=at(u.changedTouches),st=[],it=this.target;if(O=S.filter(function(ft){return q(ft.target,it)}),m===et)for(M=0;M<O.length;)A[O[M].identifier]=!0,M++;for(M=0;M<U.length;)A[U[M].identifier]&&st.push(U[M]),m&(W|I)&&delete A[U[M].identifier],M++;if(st.length)return[Ct(O.concat(st),"identifier",!0),st]}var cd=2500,Va=25;function ln(){Tt.apply(this,arguments);var u=w(this.handler,this);this.touch=new Ws(this.manager,u),this.mouse=new $s(this.manager,u),this.primaryTouch=null,this.lastTouches=[]}x(ln,Tt,{handler:function(m,S,A){var M=A.pointerType==V,O=A.pointerType==At;if(!(O&&A.sourceCapabilities&&A.sourceCapabilities.firesTouchEvents)){if(M)ld.call(this,S,A);else if(O&&ud.call(this,A))return;this.callback(m,S,A)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function ld(u,m){u&et?(this.primaryTouch=m.changedPointers[0].identifier,Ga.call(this,m)):u&(W|I)&&Ga.call(this,m)}function Ga(u){var m=u.changedPointers[0];if(m.identifier===this.primaryTouch){var S={x:m.clientX,y:m.clientY};this.lastTouches.push(S);var A=this.lastTouches,M=function(){var O=A.indexOf(S);O>-1&&A.splice(O,1)};setTimeout(M,cd)}}function ud(u){for(var m=u.srcEvent.clientX,S=u.srcEvent.clientY,A=0;A<this.lastTouches.length;A++){var M=this.lastTouches[A],O=Math.abs(m-M.x),U=Math.abs(S-M.y);if(O<=Va&&U<=Va)return!0}return!1}var za=pt(a.style,"touchAction"),Ha=za!==n,qa="compute",ja="auto",un="manipulation",ye="none",Qe="pan-x",ts="pan-y",Js=dd();function fn(u,m){this.manager=u,this.set(m)}fn.prototype={set:function(u){u==qa&&(u=this.compute()),Ha&&this.manager.element.style&&Js[u]&&(this.manager.element.style[za]=u),this.actions=u.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var u=[];return b(this.manager.recognizers,function(m){g(m.options.enable,[m])&&(u=u.concat(m.getTouchAction()))}),fd(u.join(" "))},preventDefaults:function(u){var m=u.srcEvent,S=u.offsetDirection;if(this.manager.session.prevented){m.preventDefault();return}var A=this.actions,M=G(A,ye)&&!Js[ye],O=G(A,ts)&&!Js[ts],U=G(A,Qe)&&!Js[Qe];if(M){var st=u.pointers.length===1,it=u.distance<2,ft=u.deltaTime<250;if(st&&it&&ft)return}if(!(U&&O)&&(M||O&&S&Ft||U&&S&ge))return this.preventSrc(m)},preventSrc:function(u){this.manager.session.prevented=!0,u.preventDefault()}};function fd(u){if(G(u,ye))return ye;var m=G(u,Qe),S=G(u,ts);return m&&S?ye:m||S?m?Qe:ts:G(u,un)?un:ja}function dd(){if(!Ha)return!1;var u={},m=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(S){u[S]=m?t.CSS.supports("touch-action",S):!0}),u}var Zs=1,Pt=2,_e=4,oe=8,jt=oe,es=16,Nt=32;function $t(u){this.options=E({},this.defaults,u||{}),this.id=ae(),this.manager=null,this.options.enable=P(this.options.enable,!0),this.state=Zs,this.simultaneous={},this.requireFail=[]}$t.prototype={defaults:{},set:function(u){return E(this.options,u),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(u){if(y(u,"recognizeWith",this))return this;var m=this.simultaneous;return u=Ks(u,this),m[u.id]||(m[u.id]=u,u.recognizeWith(this)),this},dropRecognizeWith:function(u){return y(u,"dropRecognizeWith",this)?this:(u=Ks(u,this),delete this.simultaneous[u.id],this)},requireFailure:function(u){if(y(u,"requireFailure",this))return this;var m=this.requireFail;return u=Ks(u,this),Z(m,u)===-1&&(m.push(u),u.requireFailure(this)),this},dropRequireFailure:function(u){if(y(u,"dropRequireFailure",this))return this;u=Ks(u,this);var m=Z(this.requireFail,u);return m>-1&&this.requireFail.splice(m,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(u){return!!this.simultaneous[u.id]},emit:function(u){var m=this,S=this.state;function A(M){m.manager.emit(M,u)}S<oe&&A(m.options.event+$a(S)),A(m.options.event),u.additionalEvent&&A(u.additionalEvent),S>=oe&&A(m.options.event+$a(S))},tryEmit:function(u){if(this.canEmit())return this.emit(u);this.state=Nt},canEmit:function(){for(var u=0;u<this.requireFail.length;){if(!(this.requireFail[u].state&(Nt|Zs)))return!1;u++}return!0},recognize:function(u){var m=E({},u);if(!g(this.options.enable,[this,m])){this.reset(),this.state=Nt;return}this.state&(jt|es|Nt)&&(this.state=Zs),this.state=this.process(m),this.state&(Pt|_e|oe|es)&&this.tryEmit(m)},process:function(u){},getTouchAction:function(){},reset:function(){}};function $a(u){return u&es?"cancel":u&oe?"end":u&_e?"move":u&Pt?"start":""}function Wa(u){return u==Ke?"down":u==Ze?"up":u==We?"left":u==Je?"right":""}function Ks(u,m){var S=m.manager;return S?S.get(u):u}function Dt(){$t.apply(this,arguments)}x(Dt,$t,{defaults:{pointers:1},attrTest:function(u){var m=this.options.pointers;return m===0||u.pointers.length===m},process:function(u){var m=this.state,S=u.eventType,A=m&(Pt|_e),M=this.attrTest(u);return A&&(S&I||!M)?m|es:A||M?S&W?m|oe:m&Pt?m|_e:Pt:Nt}});function Qs(){Dt.apply(this,arguments),this.pX=null,this.pY=null}x(Qs,Dt,{defaults:{event:"pan",threshold:10,pointers:1,direction:La},getTouchAction:function(){var u=this.options.direction,m=[];return u&Ft&&m.push(ts),u&ge&&m.push(Qe),m},directionTest:function(u){var m=this.options,S=!0,A=u.distance,M=u.direction,O=u.deltaX,U=u.deltaY;return M&m.direction||(m.direction&Ft?(M=O===0?Hs:O<0?We:Je,S=O!=this.pX,A=Math.abs(u.deltaX)):(M=U===0?Hs:U<0?Ze:Ke,S=U!=this.pY,A=Math.abs(u.deltaY))),u.direction=M,S&&A>m.threshold&&M&m.direction},attrTest:function(u){return Dt.prototype.attrTest.call(this,u)&&(this.state&Pt||!(this.state&Pt)&&this.directionTest(u))},emit:function(u){this.pX=u.deltaX,this.pY=u.deltaY;var m=Wa(u.direction);m&&(u.additionalEvent=this.options.event+m),this._super.emit.call(this,u)}});function dn(){Dt.apply(this,arguments)}x(dn,Dt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ye]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.scale-1)>this.options.threshold||this.state&Pt)},emit:function(u){if(u.scale!==1){var m=u.scale<1?"in":"out";u.additionalEvent=this.options.event+m}this._super.emit.call(this,u)}});function mn(){$t.apply(this,arguments),this._timer=null,this._input=null}x(mn,$t,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ja]},process:function(u){var m=this.options,S=u.pointers.length===m.pointers,A=u.distance<m.threshold,M=u.deltaTime>m.time;if(this._input=u,!A||!S||u.eventType&(W|I)&&!M)this.reset();else if(u.eventType&et)this.reset(),this._timer=f(function(){this.state=jt,this.tryEmit()},m.time,this);else if(u.eventType&W)return jt;return Nt},reset:function(){clearTimeout(this._timer)},emit:function(u){this.state===jt&&(u&&u.eventType&W?this.manager.emit(this.options.event+"up",u):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function pn(){Dt.apply(this,arguments)}x(pn,Dt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ye]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.rotation)>this.options.threshold||this.state&Pt)}});function gn(){Dt.apply(this,arguments)}x(gn,Dt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ft|ge,pointers:1},getTouchAction:function(){return Qs.prototype.getTouchAction.call(this)},attrTest:function(u){var m=this.options.direction,S;return m&(Ft|ge)?S=u.overallVelocity:m&Ft?S=u.overallVelocityX:m&ge&&(S=u.overallVelocityY),this._super.attrTest.call(this,u)&&m&u.offsetDirection&&u.distance>this.options.threshold&&u.maxPointers==this.options.pointers&&c(S)>this.options.velocity&&u.eventType&W},emit:function(u){var m=Wa(u.offsetDirection);m&&this.manager.emit(this.options.event+m,u),this.manager.emit(this.options.event,u)}});function ti(){$t.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}x(ti,$t,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[un]},process:function(u){var m=this.options,S=u.pointers.length===m.pointers,A=u.distance<m.threshold,M=u.deltaTime<m.time;if(this.reset(),u.eventType&et&&this.count===0)return this.failTimeout();if(A&&M&&S){if(u.eventType!=W)return this.failTimeout();var O=this.pTime?u.timeStamp-this.pTime<m.interval:!0,U=!this.pCenter||js(this.pCenter,u.center)<m.posThreshold;this.pTime=u.timeStamp,this.pCenter=u.center,!U||!O?this.count=1:this.count+=1,this._input=u;var st=this.count%m.taps;if(st===0)return this.hasRequireFailures()?(this._timer=f(function(){this.state=jt,this.tryEmit()},m.interval,this),Pt):jt}return Nt},failTimeout:function(){return this._timer=f(function(){this.state=Nt},this.options.interval,this),Nt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==jt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Wt(u,m){return m=m||{},m.recognizers=P(m.recognizers,Wt.defaults.preset),new yn(u,m)}Wt.VERSION="2.0.7",Wt.defaults={domEvents:!1,touchAction:qa,enable:!0,inputTarget:null,inputClass:null,preset:[[pn,{enable:!1}],[dn,{enable:!1},["rotate"]],[gn,{direction:Ft}],[Qs,{direction:Ft},["swipe"]],[ti],[ti,{event:"doubletap",taps:2},["tap"]],[mn]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var md=1,Ja=2;function yn(u,m){this.options=E({},Wt.defaults,m||{}),this.options.inputTarget=this.options.inputTarget||u,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=u,this.input=zf(this),this.touchAction=new fn(this,this.options.touchAction),Za(this,!0),b(this.options.recognizers,function(S){var A=this.add(new S[0](S[1]));S[2]&&A.recognizeWith(S[2]),S[3]&&A.requireFailure(S[3])},this)}yn.prototype={set:function(u){return E(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?Ja:md},recognize:function(u){var m=this.session;if(!m.stopped){this.touchAction.preventDefaults(u);var S,A=this.recognizers,M=m.curRecognizer;(!M||M&&M.state&jt)&&(M=m.curRecognizer=null);for(var O=0;O<A.length;)S=A[O],m.stopped!==Ja&&(!M||S==M||S.canRecognizeWith(M))?S.recognize(u):S.reset(),!M&&S.state&(Pt|_e|oe)&&(M=m.curRecognizer=S),O++}},get:function(u){if(u instanceof $t)return u;for(var m=this.recognizers,S=0;S<m.length;S++)if(m[S].options.event==u)return m[S];return null},add:function(u){if(y(u,"add",this))return this;var m=this.get(u.options.event);return m&&this.remove(m),this.recognizers.push(u),u.manager=this,this.touchAction.update(),u},remove:function(u){if(y(u,"remove",this))return this;if(u=this.get(u),u){var m=this.recognizers,S=Z(m,u);S!==-1&&(m.splice(S,1),this.touchAction.update())}return this},on:function(u,m){if(u!==n&&m!==n){var S=this.handlers;return b(J(u),function(A){S[A]=S[A]||[],S[A].push(m)}),this}},off:function(u,m){if(u!==n){var S=this.handlers;return b(J(u),function(A){m?S[A]&&S[A].splice(Z(S[A],m),1):delete S[A]}),this}},emit:function(u,m){this.options.domEvents&&pd(u,m);var S=this.handlers[u]&&this.handlers[u].slice();if(!(!S||!S.length)){m.type=u,m.preventDefault=function(){m.srcEvent.preventDefault()};for(var A=0;A<S.length;)S[A](m),A++}},destroy:function(){this.element&&Za(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Za(u,m){var S=u.element;if(S.style){var A;b(u.options.cssProps,function(M,O){A=pt(S.style,O),m?(u.oldCssProps[A]=S.style[A],S.style[A]=M):S.style[A]=u.oldCssProps[A]||""}),m||(u.oldCssProps={})}}function pd(u,m){var S=e.createEvent("Event");S.initEvent(u,!0,!0),S.gesture=m,m.target.dispatchEvent(S)}E(Wt,{INPUT_START:et,INPUT_MOVE:Ot,INPUT_END:W,INPUT_CANCEL:I,STATE_POSSIBLE:Zs,STATE_BEGAN:Pt,STATE_CHANGED:_e,STATE_ENDED:oe,STATE_RECOGNIZED:jt,STATE_CANCELLED:es,STATE_FAILED:Nt,DIRECTION_NONE:Hs,DIRECTION_LEFT:We,DIRECTION_RIGHT:Je,DIRECTION_UP:Ze,DIRECTION_DOWN:Ke,DIRECTION_HORIZONTAL:Ft,DIRECTION_VERTICAL:ge,DIRECTION_ALL:La,Manager:yn,Input:Tt,TouchAction:fn,TouchInput:Ws,MouseInput:$s,PointerEventInput:cn,TouchMouseInput:ln,SingleTouchInput:Xa,Recognizer:$t,AttrRecognizer:Dt,Tap:ti,Pan:Qs,Swipe:gn,Pinch:dn,Rotate:pn,Press:mn,on:C,off:B,each:b,merge:v,extend:_,assign:E,inherit:x,bindFn:w,prefixed:pt});var gd=typeof t<"u"?t:typeof self<"u"?self:{};gd.Hammer=Wt,typeof n=="function"&&n.amd?n(function(){return Wt}):i.exports?i.exports=Wt:t[s]=Wt})(window,document,"Hammer")})(ia);var vl=ia.exports;const Sl=Fn(vl);function Cl(){const i=window.screen;return{screenWidth:i.width,screenHeight:i.height,screenX:window.screenX,screenY:window.screenY}}function Ve(){const i=document.documentElement;return{clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,offsetWidth:i.offsetWidth,offsetHeight:i.offsetHeight,offsetTop:i.offsetTop,offsetLeft:i.offsetLeft,offsetParent:i.offsetParent}}function Tl(){const i=document.body;return{clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,offsetWidth:i.offsetWidth,offsetHeight:i.offsetHeight,offsetTop:i.offsetTop,offsetLeft:i.offsetLeft,offsetParent:i.offsetParent}}function Pl(){return typeof window.innerWidth=="number"?{width:window.innerWidth,height:window.innerHeight}:document.compatMode==="CSS1Compat"?{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}:{width:document.body.clientWidth,height:document.body.clientHeight}}function El(){const{scrollWidth:i,scrollHeight:t}=Ve();return{width:i,height:t}}function na(i){const{top:t,left:e,width:s,height:n}=i.getBoundingClientRect(),{scrollLeft:r,scrollTop:a}=Ve();return{x:e+r,y:t+a,width:s,height:n}}function _l(i){let t=i,e=0,s=0;for(;t!==null;)e+=t.offsetLeft,s+=t.offsetTop,t.offsetParent instanceof HTMLElement?t=t.offsetParent:t=null;return{x:e,y:s,width:i.offsetWidth,height:i.offsetHeight}}function ra(i){return i.getBoundingClientRect()}function Al(i){const t=i.getBoundingClientRect();return{x:i.offsetLeft,y:i.offsetTop,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function Dl(){const{clientHeight:i,scrollTop:t,scrollHeight:e}=Ve(),s=e-i;return s<=0?0:t/s*100}function Il(i){if("center"in i){const t=i.center,e=ra(i.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:i.clientX,y:i.clientY}}function aa(i){if("center"in i)return i.center;if(typeof i.pageX=="number"&&typeof i.pageY=="number")return{x:i.pageX,y:i.pageY};const{scrollLeft:t,scrollTop:e}=Ve();return{x:i.clientX+t,y:i.clientY+e}}function _t(i,t){if(!t&&"offsetX"in i)return{x:i.offsetX,y:i.offsetY};const e=aa(i),s=na(t||i.target);return{x:e.x-s.x,y:e.y-s.y}}class oa extends rs{container;width;height;mousePoint={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0};hammer;removes=[];constructor(t=document.documentElement,e=!0,s){super(),this.container=t,this.width=t.offsetWidth,this.height=t.offsetHeight,this.hammer=new Sl(this.container),e&&this.start(s)}emitDebounce=po((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}start(t){this.registerMouseEventListeners(),this.registerTransitionEventListeners(),this.registerAnimationEventListeners(),this.registerResizeObserver(),this.registerElementDisplayInParent(),t&&t.forEach(e=>{this.addRemoves(e())}),this.on("pointerMove",e=>{this.setMousePoint(_t(e,this.container))})}destroy(){this.removes.forEach(t=>t()),this.removes=[],this.removeAllListeners()}restart(){this.destroy(),this.start()}addRemoves(t){this.removes.push(t)}registerMouseEventListeners(){const t=I=>{this.emit("mouseDown",I)},e=I=>{this.emit("mouseUp",I)},s=I=>{this.emit("mouseMove",I)},n=I=>{this.emit("mouseOver",I)},r=I=>{this.emit("mouseOut",I)},a=I=>{this.emit("mouseEnter",I)},o=I=>{this.emit("mouseLeave",I)},h=I=>{this.emit("mouseClick",I)},c=I=>{this.emit("mouseDoubleClick",I)},l=I=>{this.emit("mouseWheel",I)},f=I=>{this.emit("mouseContextMenu",I)},y=I=>{this.emit("touchStart",I)},b=I=>{this.emit("touchEnd",I)},p=I=>{this.emit("touchCancel",I)},E=I=>{this.emit("touchMove",I)},_=I=>{this.emit("pointerDown",I)},v=I=>{this.emit("pointerUp",I)},x=I=>{this.emit("pointerCancel",I)},w=I=>{this.emit("pointerMove",I)},g=I=>{this.emit("pan",I)},P=I=>{this.emit("panStart",I)},C=I=>{this.emit("panMove",I)},B=I=>{this.emit("panEnd",I)},q=I=>{this.emit("panCancel",I)},G=I=>{this.emit("panLeft",I)},J=I=>{this.emit("panRight",I)},Z=I=>{this.emit("panUp",I)},at=I=>{this.emit("panDown",I)},Ct=I=>{this.emit("pinch",I)},pt=I=>{this.emit("press",I)},Pe=I=>{this.emit("rotate",I)},ae=I=>{this.emit("swipe",I)},pe=I=>{this.emit("swipeLeft",I)},Ee=I=>{this.emit("swipeRight",I)},F=I=>{this.emit("swipeUp",I)},k=I=>{this.emit("swipeDown",I)},Y=I=>{this.emit("tap",I)},V=I=>{!I.target||this.container==I.target||this.container.contains(I.target)||this.emit("tapOutSide",I)},ut=I=>{this.emit("inputChange",I,this.container.files)},At=I=>{this.emit("dragstart",I)},Gs=I=>{I.dataTransfer&&(I.dataTransfer.dropEffect="copy"),this.emit("dragover",I)},zs=I=>{this.emit("dragenter",I)},et=I=>{this.emit("dragend",I)},Ot=I=>{I.dataTransfer,this.emit("drop",I,I.dataTransfer?.files)};this.container.addEventListener("mousedown",t,!1),this.container.addEventListener("mouseup",e,!1),this.container.addEventListener("mousemove",s,!1),this.container.addEventListener("mouseover",n,!1),this.container.addEventListener("mouseout",r,!1),this.container.addEventListener("mouseenter",a,!1),this.container.addEventListener("mouseleave",o,!1),this.container.addEventListener("click",h,!1),this.container.addEventListener("dblclick",c,!1),this.container.addEventListener("wheel",l,!1),this.container.addEventListener("contextmenu",f,!1),this.container.addEventListener("touchstart",y,!1),this.container.addEventListener("touchend",b,!1),this.container.addEventListener("touchcancel",p,!1),this.container.addEventListener("touchmove",E,!1),this.container.addEventListener("pointerdown",_,!1),this.container.addEventListener("pointerup",v,!1),this.container.addEventListener("pointercancel",x,!1),this.container.addEventListener("pointermove",w,!1),this.hammer.on("pan",g),this.hammer.on("panstart",P),this.hammer.on("panmove",C),this.hammer.on("panend",B),this.hammer.on("pancancel",q),this.hammer.on("panleft",G),this.hammer.on("panright",J),this.hammer.on("panup",Z),this.hammer.on("pandown",at),this.hammer.on("pinch",Ct),this.hammer.on("press",pt),this.hammer.on("rotate",Pe),this.hammer.on("swipe",ae),this.hammer.on("swipeleft",pe),this.hammer.on("swiperight",Ee),this.hammer.on("swipeup",F),this.hammer.on("swipedown",k),this.hammer.on("tap",Y),document.addEventListener("pointerdown",V,!1),this.container instanceof HTMLInputElement&&this.container.addEventListener("change",ut,!1),this.container.addEventListener("dragstart",At,!1),this.container.addEventListener("dragover",Gs,!1),this.container.addEventListener("dragenter",zs,!1),this.container.addEventListener("dragend",et,!1),this.container.addEventListener("drop",Ot,!1);const W=()=>{this.container.removeEventListener("mousedown",t,!1),this.container.removeEventListener("mouseup",e,!1),this.container.removeEventListener("mousemove",s,!1),this.container.removeEventListener("mouseover",n,!1),this.container.removeEventListener("mouseout",r,!1),this.container.removeEventListener("mouseenter",a,!1),this.container.removeEventListener("mouseleave",o,!1),this.container.removeEventListener("click",h,!1),this.container.removeEventListener("dblclick",c,!1),this.container.removeEventListener("wheel",l,!1),this.container.removeEventListener("contextmenu",f,!1),this.container.removeEventListener("touchstart",y,!1),this.container.removeEventListener("touchend",b,!1),this.container.removeEventListener("touchcancel",p,!1),this.container.removeEventListener("touchmove",E,!1),this.container.removeEventListener("pointerdown",_,!1),this.container.removeEventListener("pointerup",v,!1),this.container.removeEventListener("pointercancel",x),this.container.removeEventListener("pointermove",w,!1),this.hammer.off("pan",g),this.hammer.off("panstart",P),this.hammer.off("panmove",C),this.hammer.off("panend",B),this.hammer.off("pancancel",q),this.hammer.off("panleft",G),this.hammer.off("panright",J),this.hammer.off("panup",Z),this.hammer.off("pandown",at),this.hammer.off("pinch",Ct),this.hammer.off("press",pt),this.hammer.off("rotate",Pe),this.hammer.off("swipe",ae),this.hammer.off("swipeleft",pe),this.hammer.off("swiperight",Ee),this.hammer.off("swipeup",F),this.hammer.off("swipedown",k),this.hammer.off("tap",Y),document.removeEventListener("pointerdown",V,!1),document.removeEventListener("touchstart",V,!1),document.removeEventListener("mousedown",V,!1),this.container instanceof HTMLInputElement&&this.container.removeEventListener("change",ut,!1),this.container.removeEventListener("dragstart",At,!1),this.container.removeEventListener("dragover",Gs,!1),this.container.removeEventListener("dragenter",zs,!1),this.container.removeEventListener("dragend",et,!1),this.container.removeEventListener("drop",Ot,!1)};return this.addRemoves(W),W}registerTransitionEventListeners(){const t=n=>{this.emit("transitionstart",n)},e=n=>{this.emit("transitionend",n)};this.container.addEventListener("transitionstart",t,!1),this.container.addEventListener("transitionend",e,!1);const s=()=>{this.container.removeEventListener("transitionstart",t,!1),this.container.removeEventListener("transitionend",e,!1)};return this.addRemoves(s),s}registerAnimationEventListeners(){const t=n=>{this.emit("animationstart",n)},e=n=>{this.emit("animationend",n)};this.container.addEventListener("animationstart",t,!1),this.container.addEventListener("animationend",e,!1);const s=()=>{this.container.removeEventListener("animationstart",t,!1),this.container.removeEventListener("animationend",e,!1)};return this.addRemoves(s),s}registerResizeObserver(){let t;if(typeof ResizeObserver<"u"){const e=new ResizeObserver(s=>{const{width:n,height:r}=s[0].contentRect;this.width=n,this.height=r,this.emit("resize",n,r)});e.observe(this.container),t=()=>{e.unobserve(this.container)}}else{const e="orientationchange"in window?"orientationchange":"resize",s=n=>{const r=n.target.innerWidth,a=n.target.innerHeight;this.emit("resize",r,a)};window.addEventListener(e,s,!1),t=()=>{window.removeEventListener(e,s,!1)}}return this.addRemoves(t),t}registerElementDisplayInParent(t){const e={threshold:t?.threshold||.5,root:t?.parentElement},s=new IntersectionObserver((r,a)=>{let o=r[0];if(r.length>1){const c=r.find(l=>l.isIntersecting);c&&(o=c)}o.isIntersecting&&o.intersectionRatio>=e.threshold?this.emit("showInParent"):this.emit("showOffParent")},e);s.observe(this.container);const n=()=>{s.unobserve(this.container)};return this.addRemoves(n),n}registerPullDownRefresh(t){const e=t?.distance||50;return this.captureDrag({move:(s,n)=>{n.dStartY>0&&n.dStartY<e&&this.emit("pullDowning",n.dStartY)},end:(s,n)=>{n.dStartY>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;return this.captureDrag({move:(s,n)=>{n.dStartY>0&&n.dStartY<e&&this.emit("pullUping",n.dStartY)},end:(s,n)=>{n.dStartY>=e&&this.emit("pullUp")}})}setMousePoint(t){this.mousePoint.x=t.x,this.mousePoint.y=t.y,this.mousePoint.dx=typeof t.dx=="number"?t.dx:0,this.mousePoint.dy=typeof t.dy=="number"?t.dy:0,this.mousePoint.dStartX=typeof t.dStartX=="number"?t.dStartX:0,this.mousePoint.dStartY=typeof t.dStartY=="number"?t.dStartY:0}captureDrag(t){return this.captureDragUsePointer(t)}captureDragUsePointer(t){let e,s;const n=h=>{h.preventDefault(),h.stopPropagation(),this.on("pointerMove",a),this.on("pointerUp",r),this.on("pointerCancel",r),s=_t(h,this.container);const c={...s};e=c,this.setMousePoint(c),t?.start?.(h,c)},r=h=>{h.preventDefault(),h.stopPropagation(),this.off("pointerMove",a),this.off("pointerUp",r),this.off("pointerCancel",r),s=_t(h,this.container);const c={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(c),t?.end?.(h,c),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c={...s};s=_t(h,this.container);const l={...s,dx:s.x-(c.x||0),dy:s.y-(c.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.move?.(h,l)};this.on("pointerDown",n);const o=()=>{this.off("pointerDown",n)};return this.addRemoves(o),o}captureDragUseMouse(t){let e,s;const n=h=>{h.preventDefault(),h.stopPropagation(),document.addEventListener("mousemove",a,!1),document.addEventListener("mouseup",r,!1),s=_t(h,this.container);const c={...s};e=c,this.setMousePoint(c),t?.start?.(h,c)},r=h=>{h.preventDefault(),h.stopPropagation(),document.removeEventListener("mousemove",a,!1),document.removeEventListener("mouseup",r,!1),s=_t(h,this.container);const c={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(c),t?.end?.(h,c),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c={...s};s=_t(h,this.container);const l={...s,dx:s.x-(c.x||0),dy:s.y-(c.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.move?.(h,l)};this.on("mouseDown",n);const o=()=>{this.off("mouseDown",n)};return this.addRemoves(o),o}captureDragUseTouch(t){let e,s;const n=h=>{h.preventDefault(),h.stopPropagation(),this.on("touchMove",a),this.on("touchEnd",r),this.on("touchCancel",r);const c=h.changedTouches[0];s=_t(c,this.container);const l={...s};e=l,this.setMousePoint(l),t?.start?.(c,l)},r=h=>{h.preventDefault(),h.stopPropagation(),this.off("touchMove",a),this.off("touchEnd",r),this.off("touchCancel",r);const c=h.changedTouches[0];s=_t(c,this.container);const l={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.end?.(c,l),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c=h.changedTouches[0],l={...s};s=_t(c,this.container);const f={...s,dx:s.x-(l.x||0),dy:s.y-(l.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(f),t?.move?.(c,f)};this.on("touchStart",n);const o=()=>{this.off("touchStart",n)};return this.addRemoves(o),o}}const Ml=new oa(document.documentElement,!0,[]);class Ge{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{e.target}),this.video.srcObject=t}captureWebCamera(){navigator.mediaDevices.getUserMedia({video:!0}).then(t=>{this.setSrcObject(t)})}static async videoMediaChangeSupport(){return new Promise(t=>{const e=document.createElement("iframe"),s=document.createElement("video"),n=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),n.src=URL.createObjectURL(r),n.media="(min-width:10px)",s.append(n),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(s),setTimeout(()=>{e.width="15"}),setTimeout(()=>{e.remove(),t(!1)},1e3)})}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(()=>{Ge.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 ha extends rs{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=Ka(this.source);if(t===0){this.emit("finish");return}let e,s,n=bn(this.source,0);for(let r=1;r<t;r++)e=s,s=n,n=bn(this.source,r),this.raw+=s,s&&this.step(s,n,e);n&&this.step(n,void 0,s),this.emit("finish")}step(t,e,s){t==`
|
|
29
|
-
`&&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":Yt("whitespace",t)?(this.textchunk+=L.entity2text(this.entity),this.mode="text"):t==";"?(this.textchunk+=L.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(!Yt("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":Yt("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,s));break;case"close tag name":if(Yt("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(Yt("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":Yt("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,s));break;case"attr":if(Yt("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(!Yt("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(Yt("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}}}class kl{state;el;constructor(t,e){this.state=Mn(t),this.el=e,this.compile(this.el)}compile(t){t.childNodes.forEach(e=>{switch(e.nodeType){case 1:const s=e;[...s.attributes].forEach(o=>{const h=o.name,c=o.value;if(h==="v-model")if(L.isInputRadioElement(s)){const l=s;gt(()=>{l.checked=this.getStateValue(c)==l.value}),l.addEventListener("change",f=>{this.setStateValue(c,f.target.value)})}else if(L.isInputCheckboxElement(s)){const l=s;gt(()=>{l.checked=Pn(this.getStateValue(c),l.value)}),l.addEventListener("change",f=>{const y=f.target,b=y.value;y.checked?io(this.getStateValue(c),b):xe(this.getStateValue(c),b)})}else if(L.isSelectElement(s)){const l=s;gt(()=>{l.value=this.getStateValue(c)}),l.addEventListener("change",f=>{this.setStateValue(c,f.target.value)})}else{const l=s;gt(()=>{l.value=this.getStateValue(c)});const f=y=>{this.setStateValue(c,y.target.value)};l.addEventListener("input",f)}else h==="v-text"?gt(()=>{s.innerText=this.getStateValue(c)}):h==="v-html"&>(()=>{s.innerHTML=this.getStateValue(c)})}),s.childNodes.length>0&&this.compile(s);break;case 3:const n=e.textContent||"",r=/\{\{\s*([^{}\s]+)\s*\}\}/g,a=r.exec(n);a&&a[1]&>(()=>{e.textContent=n.replace(r,this.getStateValue(a[1]))});break}})}getStateValue(t){let e=this.state;return t.split(".").forEach(s=>{e=e[s]}),e}setStateValue(t,e){let s=this.state;const n=t.split("."),r=n.length;for(let a=0;a<r-1;a++)s=s[n[a]];s[n[r-1]]=e}}class Ll{url;socket;waitingResponse={};sendMessageQueue=[];constructor(t){this.url=t,this.createSocket()}createSocket(){console.log("Socket Create Attempted"),this.socket=new WebSocket(this.url),this.socket.onopen=()=>{this.sendMessageQueue.forEach(t=>this.socket?.send(t)),this.sendMessageQueue=[]},this.socket.onclose=t=>{const{code:e,reason:s,wasClean:n}=t;console.log(`ws closed : ${e} ${s} ${n}`)},this.socket.onerror=t=>{console.log(`ws error : ${t.type}`)},this.socket.onmessage=t=>{this.processMessage(t)}}recreateSocket(t){console.log("Socket Recreate Attempted"),this.sendMessageQueue.push(t),this.createSocket()}closeSocket(){this.socket&&(this.socket.close(),console.log("Socket closed"))}openSocket(){this.createSocket(),console.log("Socket opened manually")}sendWithRetry(t){this.socket?.readyState===WebSocket.OPEN?this.socket.send(t):this.recreateSocket(t)}async processMessage(t){if(typeof t.data=="string")try{const e=JSON.parse(t.data);if(Object.prototype.hasOwnProperty.call(e,"requestid")){const s=this.waitingResponse[e.requestid];s?s.resolve?.(e):console.warn("Got data but found no associated request, already timed out?",e)}else console.warn("Got data without request id",e)}catch{console.log(`Received String : ${t.data}`)}else t.data instanceof ArrayBuffer?console.log(`Received ArrayBuffer : ${t.data}`):t.data instanceof Blob&&console.log(`Received Blob : ${t.data}`)}async sendPayload(t){const e=+new Date,s=this.waitingResponse[e]={requestid:e};try{let n;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?n=t:n=JSON.stringify({...s,...t});const r=await new Promise((a,o)=>{s.resolve=a,this.sendWithRetry(n),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-s.requestid)/1e3),r}catch(n){return Promise.reject(n)}finally{delete this.waitingResponse[e]}}async send(t,e,s=n=>{console.log(n)}){this.sendPayload(t).then(e,s)}}function Rl(i){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let s=100;const n=function(){const r=Math.min(t.clientWidth,i);t.dataset.width=r,t.dataset.rem=s=Math.round(100*(r/i)),t.style.fontSize=s+"px"};n(),window.rem2px=function(r){return r=parseFloat(r),r*s},window.px2rem=function(r){return r=parseFloat(r),r/s},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",n,!1)}const Wi={safeAreaTop:L.getCSSVar("--safe-area-inset-top"),safeAreaRight:L.getCSSVar("--safe-area-inset-right"),safeAreaBottom:L.getCSSVar("--safe-area-inset-bottom"),safeAreaLeft:L.getCSSVar("--safe-area-inset-left"),colorPrimary:L.getCSSVar("--color-primary")||"#5078f0",colorRed:L.getCSSVar("--color-red")||"#ff5050",colorOrange:L.getCSSVar("--color-orange")||"#fa8c00",colorYellow:L.getCSSVar("--color-yellow")||"#fadc32",colorGreen:L.getCSSVar("--color-green")||"#00c878",colorBlue:L.getCSSVar("--color-blue")||"#00b4fa",colorPurple:L.getCSSVar("--color-purple")||"#6464fa",colorBlack:L.getCSSVar("--color-black")||"#001428",colorGray00:L.getCSSVar("--color-gray-00")||"#000000",colorGray33:L.getCSSVar("--color-gray-33")||"#333333",colorGray66:L.getCSSVar("--color-gray-66")||"#666666",colorGray99:L.getCSSVar("--color-gray-99")||"#999999",colorGrayCC:L.getCSSVar("--color-gray-cc")||"#cccccc",colorGrayDD:L.getCSSVar("--color-gray-dd")||"#dddddd",colorGrayE6:L.getCSSVar("--color-gray-e6")||"#e6e6e6",colorGrayEE:L.getCSSVar("--color-gray-ee")||"#eeeeee",colorGrayEF:L.getCSSVar("--color-gray-ef")||"#efefef",colorGrayF5:L.getCSSVar("--color-gray-f5")||"#f5f5f5",colorGrayFF:L.getCSSVar("--color-gray-ff")||"#ffffff",fontLineHeight:L.getCSSVar("--font-line-height")||"1.4",fontSize32:L.getCSSVar("--font-size-32")||"32px",fontSize24:L.getCSSVar("--font-size-24")||"24px",fontSize22:L.getCSSVar("--font-size-22")||"22px",fontSize20:L.getCSSVar("--font-size-20")||"20px",fontSize18:L.getCSSVar("--font-size-18")||"18px",fontSize16:L.getCSSVar("--font-size-16")||"16px",fontSize14:L.getCSSVar("--font-size-14")||"14px",fontSize12:L.getCSSVar("--font-size-12")||"12px",fontSize10:L.getCSSVar("--font-size-10")||"10px",d4:L.getCSSVar("--distance-4")||"4px",d8:L.getCSSVar("--distance-8")||"8px",d12:L.getCSSVar("--distance-12")||"12px",d16:L.getCSSVar("--distance-16")||"16px",d20:L.getCSSVar("--distance-20")||"20px",d32:L.getCSSVar("--distance-32")||"32px",d40:L.getCSSVar("--distance-40")||"40px",d44:L.getCSSVar("--distance-44")||"44px"};class lt{__color={r:0,g:0,b:0,a:1};constructor(t,e){t&&this.setColor(t),typeof e=="number"&&this.setAlpha(e)}get color(){return this.__color}set color(t){this.__color=Ji(t)}setColor(t){return this.color=t,this}get r(){return this.__color.r}set r(t){this.__color.r=j(Math.round(t),0,255)}get g(){return this.__color.g}set g(t){this.__color.g=j(Math.round(t),0,255)}get b(){return this.__color.b}set b(t){this.__color.b=j(Math.round(t),0,255)}get a(){return this.__color.a}set a(t){this.__color.a=j(t,0,1)}setAlpha(t){return this.a=t,this}setRGB(t,e,s){return this.r=t,this.g=e,this.b=s,this}setRGBA(t,e,s,n){return this.r=t,this.g=e,this.b=s,this.a=n,this}get hex(){return(this.r<<16)+(this.g<<8)+this.b}toString(){if(this.a===1){const t="000000"+this.hex.toString(16);return"#"+t.slice(t.length-6)}else return`rgba(${this.r},${this.g},${this.b},${It(this.a,6)})`}clone(){return new lt(this.color)}copy(t){this.setColor(t.color)}opposite(t=!1,e="#000000",s="#ffffff"){if(t)return new lt(this.r*.299+this.g*.587+this.b*.114>186?e:s);{const n=this.clone();return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,n}}lighten(t){t=j(Math.abs(t),0,1);let{r:e,g:s,b:n}=this.color;return e+=(255-e)*t,s+=(255-s)*t,n+=(255-n)*t,new lt().setRGBA(e,s,n,this.color.a)}darken(t){t=j(Math.abs(t),0,1);let{r:e,g:s,b:n}=this.color;return e=e*(1-t),s=s*(1-t),n=n*(1-t),new lt().setRGBA(e,s,n,this.color.a)}static gradient(t,e,s){try{const n=Ji(t),r=Ji(e);return new lt().setRGB((r.r-n.r)*s+n.r,(r.g-n.g)*s+n.g,(r.b-n.b)*s+n.b)}catch{return new lt(e)}}static random(){return new lt(Math.random()*16777215)}get hsv(){const{r:t,g:e,b:s,a:n}=this.color,r=Math.max(t,e,s),a=Math.min(t,e,s),o=r-a;let h;return t===r?h=(e-s)/o:e===r?h=2+(s-t)/o:h=4+(t-e)/o,h/=6,h<0&&(h+=1),{h:o==0?0:h*360,s:r===0?0:o/r,v:r/255,a:n}}set h(t){const e=this.hsv;e.h=j(t,0,360),this.setColor(e)}get h(){return this.hsv.h}set s(t){const e=this.hsv;e.s=j(t,0,1),this.setColor(e)}get s(){return this.hsv.s}set v(t){const e=this.hsv;e.v=j(t,0,1),this.setColor(e)}get v(){return this.hsv.v}}function ze(i,t){return new lt(i,t)}function Ji(i){const t=Object.prototype.hasOwnProperty.call(i,"a")?j(i.a,0,1):1;if(Object.prototype.hasOwnProperty.call(i,"r")&&Object.prototype.hasOwnProperty.call(i,"g")&&Object.prototype.hasOwnProperty.call(i,"b"))return i.r=j(Math.round(i.r),0,255),i.g=j(Math.round(i.g),0,255),i.b=j(Math.round(i.b),0,255),i.a=t,i;if(Object.prototype.hasOwnProperty.call(i,"h")&&Object.prototype.hasOwnProperty.call(i,"s")&&Object.prototype.hasOwnProperty.call(i,"v")){const s=j(i.h,0,360),n=j(i.s,0,1),r=j(i.v,0,1),a=Math.floor(s/60)%6,o=s/60-Math.floor(s/60),h=r*(1-n),c=r*(1-o*n),l=r*(1-(1-o)*n),f=[[r,l,h],[c,r,h],[h,r,l],[h,c,r],[l,h,r],[r,h,c]][a];return{r:Math.round(f[0]*255),g:Math.round(f[1]*255),b:Math.round(f[2]*255),a:t}}const e={r:0,g:0,b:0,a:t};if(typeof i=="number")i<Math.pow(2,24)?(e.r=i>>16&255,e.g=i>>8&255,e.b=i&255):(e.r=i>>24&255,e.g=i>>16&255,e.b=i>>8&255,e.a=(i&255)/255);else if(typeof i=="string"){const s=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,?\s*(\d?\.?\d*)?\s*\)/gi.exec(i);if(s)e.r=parseInt(s[1]),e.g=parseInt(s[2]),e.b=parseInt(s[3]),s[4]&&(e.a=parseFloat(s[4]));else{let n=i.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);n?(e.r=parseInt(`${n[1]}${n[1]}`,16),e.g=parseInt(`${n[2]}${n[2]}`,16),e.b=parseInt(`${n[3]}${n[3]}`,16)):(n=i.match(/^#([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})$/i),n?(e.r=parseInt(n[1],16),e.g=parseInt(n[2],16),e.b=parseInt(n[3],16)):(n=i.match(/^#([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})$/i),n?(e.r=parseInt(n[1],16),e.g=parseInt(n[2],16),e.b=parseInt(n[3],16),e.a=parseInt(n[4],16)/255):i==="none"&&(e.a=0)))}}else throw new Error("parseColor 不支持的颜色解析:"+i);return e.r=j(e.r,0,255),e.g=j(e.g,0,255),e.b=j(e.b,0,255),e.a=j(e.a,0,1),e}const ca=["#0ac2d2","#7bb7fa","#60d7a9","#fdc162","#fd6a62","#f68dbb","#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff","#dc4916","#6871b1","#d1b935","#1bbc9b","#FF7F50","#4BBFC3","#ff9900"],de={backgroundColor:"#1a1a1a",numberColor:"#2FA1D6",booleanColor:"#806787",stringColor:"#1ed36f",functionColor:"#e61d5f",saveRowColor:"#dad5cb",buttonColor:"",borderColor:"",inputColor:""};de.buttonColor=new lt(de.saveRowColor).darken(.1).toString(),de.borderColor=new lt(de.backgroundColor).lighten(.07).toString(),de.inputColor=new lt(de.backgroundColor).lighten(.085).toString();function Bs(i=window.location.href){return Cn(URL)?new URL(i):la(i)}function la(i=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",s="(?<pathname>(?:\\/[^/#?]+)*\\/?)",n="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${s}${n}${r}$`).exec(i);return{href:i,protocol:o?.groups?.protocol??"",host:o?.groups?.host??"",hostname:o?.groups?.hostname??"",port:o?.groups?.port??"",pathname:o?.groups?.pathname??"",search:o?.groups?.search??"",hash:o?.groups?.hash??""}}function Ol(i){const t=Bs(i);return t.protocol==="http:"||t.protocol==="https:"}function ua(i=window.location.href){const t=Bs(i),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function Fl(i=Bs().search){i=decodeURIComponent(i).replace(/^[#?&]/,"");const t={};if(!i)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let s=e.exec(i);for(;s;)t[s[1]]=s[2],s=e.exec(i);return t}function Ys(i){return"?"+Object.entries(i).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function fa(i){return"?"+[...i.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function da(i,t){return i.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function Nl(i,t){return da(i,Ys(t))}function Zi(i,t){return i+t.replace(/^[&?]/,i.indexOf("?")>=0?"&":"?")}function Bl(i,t){return Zi(i,Ys(t))}const Yl=(i=window.location.href)=>JSON.parse('{"'+decodeURI(i.split("?")[1]).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}');class Ul{worker;cbs={};constructor(t){if(Or)try{this.worker=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){throw typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),e}else throw new Error("Your environment do not support Worker !")}postMessage(t,e=[]){this.worker.postMessage(t,e)}onmessage(t){this.worker.addEventListener("message",t)}offmessage(t){this.worker.removeEventListener("message",t)}onmessageerror(t){this.worker.addEventListener("messageerror",t)}offmessageerror(t){this.worker.removeEventListener("messageerror",t)}postCanvas(t){const e=t.transferControlToOffscreen();this.worker.postMessage({canvas:e},[e])}postPort(t){this.worker.postMessage({port:t},[t])}postReset(){this.worker.postMessage({reset:!0});for(const t in this.cbs)this.cbs[t](),delete this.cbs[t]}fire(t,e){return new Promise(s=>{if(e){const n=Math.random().toString(36).slice(2),r=a=>{a.data.id===n&&(this.worker.removeEventListener("message",r),delete this.cbs[n],e(),s())};this.cbs[n]=r.bind(this,{data:{id:n}}),this.worker.addEventListener("message",r),this.worker.postMessage({...t,id:n})}else this.worker.postMessage(t),s()})}}class Xl{port1;port2;port1MessageCbs=[];port2MessageCbs=[];port1MessageErrorCbs=[];port2MessageErrorCbs=[];constructor(){const{port1:t,port2:e}=new MessageChannel;this.port1=t,this.port2=e,this.port1.addEventListener("message",s=>{this.port1MessageCbs.forEach(n=>n(this.port1,s))}),this.port1.addEventListener("messageerror",s=>{this.port1MessageErrorCbs.forEach(n=>n(this.port1,s))}),this.port1.start(),this.port2.addEventListener("message",s=>{this.port2MessageCbs.forEach(n=>n(this.port2,s))}),this.port2.addEventListener("messageerror",s=>{this.port2MessageErrorCbs.forEach(n=>n(this.port2,s))}),this.port2.start()}close(){this.port1.close(),this.port2.close()}onPort1Message(t){this.port1MessageCbs.push(t)}onPort1MessageError(t){this.port1MessageErrorCbs.push(t)}offPort1Message(t){xe(this.port1MessageCbs,t)}offPort1MessageError(t){xe(this.port1MessageErrorCbs,t)}onPort2Message(t){this.port2MessageCbs.push(t)}onPort2MessageError(t){this.port2MessageErrorCbs.push(t)}offPort2Message(t){xe(this.port2MessageCbs,t)}offPort2MessageError(t){xe(this.port2MessageErrorCbs,t)}}function ma(){let i=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0,s=t.length;e<s;e++)try{i=new window.ActiveXObject(t[e]);break}catch{continue}}else i=new XMLHttpRequest;return i}function Vl(i,t){return new Promise((e,s)=>{const{method:n="GET",data:r={},multipartFormDataString:a="",boundary:o="",headers:h={},withCredentials:c=!1,responseType:l="json",timeout:f=3e4}=t||{},y=ma();y.timeout=f,y.responseType=l,y.onreadystatechange=function(x){y.readyState===4&&(y.status===200?e(y.response):s(y.statusText))},y.ontimeout=()=>{s(`${i} is timed out for ${f}ms.`)},y.addEventListener("load",x=>t?.load?.(x,y),!1),y.addEventListener("loadstart",x=>t?.loadstart?.(x,y),!1),y.addEventListener("loadend",x=>t?.loadend?.(x,y),!1),y.addEventListener("progress",x=>{if(x.lengthComputable){const w=Math.round(x.loaded*100/x.total);t?.progress?.(x,y,w)}},!1),y.addEventListener("error",x=>t?.error?.(x,y),!1),y.addEventListener("abort",x=>t?.abort?.(x,y),!1);const b=n.toUpperCase();Object.assign(h,{Accept:"*/*"});let p=!1,E=!1,_=!1;function v(){c&&(y.withCredentials=!0);for(const x in h)ot(x).toLowerCase()=="content-type"&&h[x].toLowerCase()=="multipart/form-data"?(p=!0,y.setRequestHeader("Content-Type","multipart/form-data; boundary="+o)):(ot(x).toLowerCase()=="content-type"&&(h[x].toLowerCase().indexOf("text/plain")>=0?E=!0:h[x].toLowerCase().indexOf("application/json")>=0&&(_=!0)),y.setRequestHeader(x,h[x]))}switch(b){case"GET":let x="";r instanceof FormData?x=fa(r):x=Ys(r),y.open("GET",Zi(i,x),!0),v(),y.send(null);break;default:y.open(b,i,!0),v(),p?y.sendAsBinary(a):_?y.send(JSON.stringify(r)):E?y.send(Object.entries(r).map(([w,g])=>`${w}=${g}`).join(`\r
|
|
30
|
-
`)):y.send(Object.entries(r).map(([w,g])=>`${encodeURIComponent(w)}=${encodeURIComponent(g)}`).join("&"));break}})}async function
|
|
28
|
+
`;return function(){var I=new Error("get-stack-trace"),R=I&&I.stack?I.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Y=t.console&&(t.console.warn||t.console.log);return Y&&Y.call(t.console,A,R),u.apply(this,arguments)}}var E;typeof Object.assign!="function"?E=function(m){if(m===n||m===null)throw new TypeError("Cannot convert undefined or null to object");for(var S=Object(m),A=1;A<arguments.length;A++){var I=arguments[A];if(I!==n&&I!==null)for(var R in I)I.hasOwnProperty(R)&&(S[R]=I[R])}return S}:E=Object.assign;var _=p(function(m,S,A){for(var I=Object.keys(S),R=0;R<I.length;)(!A||A&&m[I[R]]===n)&&(m[I[R]]=S[I[R]]),R++;return m},"extend","Use `assign`."),v=p(function(m,S){return _(m,S,!0)},"merge","Use `assign`.");function x(u,m,S){var A=m.prototype,I;I=u.prototype=Object.create(A),I.constructor=u,I._super=A,S&&E(I,S)}function w(u,m){return function(){return u.apply(m,arguments)}}function g(u,m){return typeof u==o?u.apply(m&&m[0]||n,m):u}function P(u,m){return u===n?m:u}function C(u,m,S){b(J(m),function(A){u.addEventListener(A,S,!1)})}function B(u,m,S){b(J(m),function(A){u.removeEventListener(A,S,!1)})}function H(u,m){for(;u;){if(u==m)return!0;u=u.parentNode}return!1}function G(u,m){return u.indexOf(m)>-1}function J(u){return u.trim().split(/\s+/g)}function Z(u,m,S){if(u.indexOf&&!S)return u.indexOf(m);for(var A=0;A<u.length;){if(S&&u[A][S]==m||!S&&u[A]===m)return A;A++}return-1}function at(u){return Array.prototype.slice.call(u,0)}function Ct(u,m,S){for(var A=[],I=[],R=0;R<u.length;){var Y=m?u[R][m]:u[R];Z(I,Y)<0&&A.push(u[R]),I[R]=Y,R++}return S&&(m?A=A.sort(function(it,ft){return it[m]>ft[m]}):A=A.sort()),A}function gt(u,m){for(var S,A,I=m[0].toUpperCase()+m.slice(1),R=0;R<r.length;){if(S=r[R],A=S?S+I:m,A in u)return A;R++}return n}var _e=1;function oe(){return _e++}function pe(u){var m=u.ownerDocument||u;return m.defaultView||m.parentWindow||t}var Ae=/mobile|tablet|ip(ad|hone|od)|android/i,O="ontouchstart"in t,k=gt(t,"PointerEvent")!==n,U=O&&Ae.test(navigator.userAgent),V="touch",ut="pen",At="mouse",Hs="kinect",js=25,et=1,Ot=2,W=4,M=8,$s=1,ts=2,es=4,ss=8,is=16,Ft=ts|es,ge=ss|is,Xa=Ft|ge,Va=["x","y"],Ws=["clientX","clientY"];function Tt(u,m){var S=this;this.manager=u,this.callback=m,this.element=u.element,this.target=u.options.inputTarget,this.domHandler=function(A){g(u.options.enable,[u])&&S.handler(A)},this.init()}Tt.prototype={handler:function(){},init:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(pe(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&B(this.element,this.evEl,this.domHandler),this.evTarget&&B(this.target,this.evTarget,this.domHandler),this.evWin&&B(pe(this.element),this.evWin,this.domHandler)}};function ad(u){var m,S=u.options.inputClass;return S?m=S:k?m=dn:U?m=Ks:O?m=mn:m=Zs,new m(u,od)}function od(u,m,S){var A=S.pointers.length,I=S.changedPointers.length,R=m&et&&A-I===0,Y=m&(W|M)&&A-I===0;S.isFirst=!!R,S.isFinal=!!Y,R&&(u.session={}),S.eventType=m,hd(u,S),u.emit("hammer.input",S),u.recognize(S),u.session.prevInput=S}function hd(u,m){var S=u.session,A=m.pointers,I=A.length;S.firstInput||(S.firstInput=za(m)),I>1&&!S.firstMultiple?S.firstMultiple=za(m):I===1&&(S.firstMultiple=!1);var R=S.firstInput,Y=S.firstMultiple,st=Y?Y.center:R.center,it=m.center=Ga(A);m.timeStamp=l(),m.deltaTime=m.timeStamp-R.timeStamp,m.angle=fn(st,it),m.distance=Js(st,it),cd(S,m),m.offsetDirection=Ha(m.deltaX,m.deltaY);var ft=qa(m.deltaTime,m.deltaX,m.deltaY);m.overallVelocityX=ft.x,m.overallVelocityY=ft.y,m.overallVelocity=c(ft.x)>c(ft.y)?ft.x:ft.y,m.scale=Y?fd(Y.pointers,A):1,m.rotation=Y?ud(Y.pointers,A):0,m.maxPointers=S.prevInput?m.pointers.length>S.prevInput.maxPointers?m.pointers.length:S.prevInput.maxPointers:m.pointers.length,ld(S,m);var Bt=u.element;H(m.srcEvent.target,Bt)&&(Bt=m.srcEvent.target),m.target=Bt}function cd(u,m){var S=m.center,A=u.offsetDelta||{},I=u.prevDelta||{},R=u.prevInput||{};(m.eventType===et||R.eventType===W)&&(I=u.prevDelta={x:R.deltaX||0,y:R.deltaY||0},A=u.offsetDelta={x:S.x,y:S.y}),m.deltaX=I.x+(S.x-A.x),m.deltaY=I.y+(S.y-A.y)}function ld(u,m){var S=u.lastInterval||m,A=m.timeStamp-S.timeStamp,I,R,Y,st;if(m.eventType!=M&&(A>js||S.velocity===n)){var it=m.deltaX-S.deltaX,ft=m.deltaY-S.deltaY,Bt=qa(A,it,ft);R=Bt.x,Y=Bt.y,I=c(Bt.x)>c(Bt.y)?Bt.x:Bt.y,st=Ha(it,ft),u.lastInterval=m}else I=S.velocity,R=S.velocityX,Y=S.velocityY,st=S.direction;m.velocity=I,m.velocityX=R,m.velocityY=Y,m.direction=st}function za(u){for(var m=[],S=0;S<u.pointers.length;)m[S]={clientX:h(u.pointers[S].clientX),clientY:h(u.pointers[S].clientY)},S++;return{timeStamp:l(),pointers:m,center:Ga(m),deltaX:u.deltaX,deltaY:u.deltaY}}function Ga(u){var m=u.length;if(m===1)return{x:h(u[0].clientX),y:h(u[0].clientY)};for(var S=0,A=0,I=0;I<m;)S+=u[I].clientX,A+=u[I].clientY,I++;return{x:h(S/m),y:h(A/m)}}function qa(u,m,S){return{x:m/u||0,y:S/u||0}}function Ha(u,m){return u===m?$s:c(u)>=c(m)?u<0?ts:es:m<0?ss:is}function Js(u,m,S){S||(S=Va);var A=m[S[0]]-u[S[0]],I=m[S[1]]-u[S[1]];return Math.sqrt(A*A+I*I)}function fn(u,m,S){S||(S=Va);var A=m[S[0]]-u[S[0]],I=m[S[1]]-u[S[1]];return Math.atan2(I,A)*180/Math.PI}function ud(u,m){return fn(m[1],m[0],Ws)+fn(u[1],u[0],Ws)}function fd(u,m){return Js(m[0],m[1],Ws)/Js(u[0],u[1],Ws)}var dd={mousedown:et,mousemove:Ot,mouseup:W},md="mousedown",pd="mousemove mouseup";function Zs(){this.evEl=md,this.evWin=pd,this.pressed=!1,Tt.apply(this,arguments)}x(Zs,Tt,{handler:function(m){var S=dd[m.type];S&et&&m.button===0&&(this.pressed=!0),S&Ot&&m.which!==1&&(S=W),this.pressed&&(S&W&&(this.pressed=!1),this.callback(this.manager,S,{pointers:[m],changedPointers:[m],pointerType:At,srcEvent:m}))}});var gd={pointerdown:et,pointermove:Ot,pointerup:W,pointercancel:M,pointerout:M},yd={2:V,3:ut,4:At,5:Hs},ja="pointerdown",$a="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(ja="MSPointerDown",$a="MSPointerMove MSPointerUp MSPointerCancel");function dn(){this.evEl=ja,this.evWin=$a,Tt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}x(dn,Tt,{handler:function(m){var S=this.store,A=!1,I=m.type.toLowerCase().replace("ms",""),R=gd[I],Y=yd[m.pointerType]||m.pointerType,st=Y==V,it=Z(S,m.pointerId,"pointerId");R&et&&(m.button===0||st)?it<0&&(S.push(m),it=S.length-1):R&(W|M)&&(A=!0),!(it<0)&&(S[it]=m,this.callback(this.manager,R,{pointers:S,changedPointers:[m],pointerType:Y,srcEvent:m}),A&&S.splice(it,1))}});var wd={touchstart:et,touchmove:Ot,touchend:W,touchcancel:M},xd="touchstart",bd="touchstart touchmove touchend touchcancel";function Wa(){this.evTarget=xd,this.evWin=bd,this.started=!1,Tt.apply(this,arguments)}x(Wa,Tt,{handler:function(m){var S=wd[m.type];if(S===et&&(this.started=!0),!!this.started){var A=vd.call(this,m,S);S&(W|M)&&A[0].length-A[1].length===0&&(this.started=!1),this.callback(this.manager,S,{pointers:A[0],changedPointers:A[1],pointerType:V,srcEvent:m})}}});function vd(u,m){var S=at(u.touches),A=at(u.changedTouches);return m&(W|M)&&(S=Ct(S.concat(A),"identifier",!0)),[S,A]}var Sd={touchstart:et,touchmove:Ot,touchend:W,touchcancel:M},Cd="touchstart touchmove touchend touchcancel";function Ks(){this.evTarget=Cd,this.targetIds={},Tt.apply(this,arguments)}x(Ks,Tt,{handler:function(m){var S=Sd[m.type],A=Td.call(this,m,S);A&&this.callback(this.manager,S,{pointers:A[0],changedPointers:A[1],pointerType:V,srcEvent:m})}});function Td(u,m){var S=at(u.touches),A=this.targetIds;if(m&(et|Ot)&&S.length===1)return A[S[0].identifier]=!0,[S,S];var I,R,Y=at(u.changedTouches),st=[],it=this.target;if(R=S.filter(function(ft){return H(ft.target,it)}),m===et)for(I=0;I<R.length;)A[R[I].identifier]=!0,I++;for(I=0;I<Y.length;)A[Y[I].identifier]&&st.push(Y[I]),m&(W|M)&&delete A[Y[I].identifier],I++;if(st.length)return[Ct(R.concat(st),"identifier",!0),st]}var Pd=2500,Ja=25;function mn(){Tt.apply(this,arguments);var u=w(this.handler,this);this.touch=new Ks(this.manager,u),this.mouse=new Zs(this.manager,u),this.primaryTouch=null,this.lastTouches=[]}x(mn,Tt,{handler:function(m,S,A){var I=A.pointerType==V,R=A.pointerType==At;if(!(R&&A.sourceCapabilities&&A.sourceCapabilities.firesTouchEvents)){if(I)Ed.call(this,S,A);else if(R&&_d.call(this,A))return;this.callback(m,S,A)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Ed(u,m){u&et?(this.primaryTouch=m.changedPointers[0].identifier,Za.call(this,m)):u&(W|M)&&Za.call(this,m)}function Za(u){var m=u.changedPointers[0];if(m.identifier===this.primaryTouch){var S={x:m.clientX,y:m.clientY};this.lastTouches.push(S);var A=this.lastTouches,I=function(){var R=A.indexOf(S);R>-1&&A.splice(R,1)};setTimeout(I,Pd)}}function _d(u){for(var m=u.srcEvent.clientX,S=u.srcEvent.clientY,A=0;A<this.lastTouches.length;A++){var I=this.lastTouches[A],R=Math.abs(m-I.x),Y=Math.abs(S-I.y);if(R<=Ja&&Y<=Ja)return!0}return!1}var Ka=gt(a.style,"touchAction"),Qa=Ka!==n,to="compute",eo="auto",pn="manipulation",ye="none",ns="pan-x",rs="pan-y",Qs=Dd();function gn(u,m){this.manager=u,this.set(m)}gn.prototype={set:function(u){u==to&&(u=this.compute()),Qa&&this.manager.element.style&&Qs[u]&&(this.manager.element.style[Ka]=u),this.actions=u.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var u=[];return b(this.manager.recognizers,function(m){g(m.options.enable,[m])&&(u=u.concat(m.getTouchAction()))}),Ad(u.join(" "))},preventDefaults:function(u){var m=u.srcEvent,S=u.offsetDirection;if(this.manager.session.prevented){m.preventDefault();return}var A=this.actions,I=G(A,ye)&&!Qs[ye],R=G(A,rs)&&!Qs[rs],Y=G(A,ns)&&!Qs[ns];if(I){var st=u.pointers.length===1,it=u.distance<2,ft=u.deltaTime<250;if(st&&it&&ft)return}if(!(Y&&R)&&(I||R&&S&Ft||Y&&S&ge))return this.preventSrc(m)},preventSrc:function(u){this.manager.session.prevented=!0,u.preventDefault()}};function Ad(u){if(G(u,ye))return ye;var m=G(u,ns),S=G(u,rs);return m&&S?ye:m||S?m?ns:rs:G(u,pn)?pn:eo}function Dd(){if(!Qa)return!1;var u={},m=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(S){u[S]=m?t.CSS.supports("touch-action",S):!0}),u}var ti=1,Pt=2,De=4,he=8,jt=he,as=16,Nt=32;function $t(u){this.options=E({},this.defaults,u||{}),this.id=oe(),this.manager=null,this.options.enable=P(this.options.enable,!0),this.state=ti,this.simultaneous={},this.requireFail=[]}$t.prototype={defaults:{},set:function(u){return E(this.options,u),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(u){if(y(u,"recognizeWith",this))return this;var m=this.simultaneous;return u=ei(u,this),m[u.id]||(m[u.id]=u,u.recognizeWith(this)),this},dropRecognizeWith:function(u){return y(u,"dropRecognizeWith",this)?this:(u=ei(u,this),delete this.simultaneous[u.id],this)},requireFailure:function(u){if(y(u,"requireFailure",this))return this;var m=this.requireFail;return u=ei(u,this),Z(m,u)===-1&&(m.push(u),u.requireFailure(this)),this},dropRequireFailure:function(u){if(y(u,"dropRequireFailure",this))return this;u=ei(u,this);var m=Z(this.requireFail,u);return m>-1&&this.requireFail.splice(m,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(u){return!!this.simultaneous[u.id]},emit:function(u){var m=this,S=this.state;function A(I){m.manager.emit(I,u)}S<he&&A(m.options.event+so(S)),A(m.options.event),u.additionalEvent&&A(u.additionalEvent),S>=he&&A(m.options.event+so(S))},tryEmit:function(u){if(this.canEmit())return this.emit(u);this.state=Nt},canEmit:function(){for(var u=0;u<this.requireFail.length;){if(!(this.requireFail[u].state&(Nt|ti)))return!1;u++}return!0},recognize:function(u){var m=E({},u);if(!g(this.options.enable,[this,m])){this.reset(),this.state=Nt;return}this.state&(jt|as|Nt)&&(this.state=ti),this.state=this.process(m),this.state&(Pt|De|he|as)&&this.tryEmit(m)},process:function(u){},getTouchAction:function(){},reset:function(){}};function so(u){return u&as?"cancel":u&he?"end":u&De?"move":u&Pt?"start":""}function io(u){return u==is?"down":u==ss?"up":u==ts?"left":u==es?"right":""}function ei(u,m){var S=m.manager;return S?S.get(u):u}function Dt(){$t.apply(this,arguments)}x(Dt,$t,{defaults:{pointers:1},attrTest:function(u){var m=this.options.pointers;return m===0||u.pointers.length===m},process:function(u){var m=this.state,S=u.eventType,A=m&(Pt|De),I=this.attrTest(u);return A&&(S&M||!I)?m|as:A||I?S&W?m|he:m&Pt?m|De:Pt:Nt}});function si(){Dt.apply(this,arguments),this.pX=null,this.pY=null}x(si,Dt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Xa},getTouchAction:function(){var u=this.options.direction,m=[];return u&Ft&&m.push(rs),u&ge&&m.push(ns),m},directionTest:function(u){var m=this.options,S=!0,A=u.distance,I=u.direction,R=u.deltaX,Y=u.deltaY;return I&m.direction||(m.direction&Ft?(I=R===0?$s:R<0?ts:es,S=R!=this.pX,A=Math.abs(u.deltaX)):(I=Y===0?$s:Y<0?ss:is,S=Y!=this.pY,A=Math.abs(u.deltaY))),u.direction=I,S&&A>m.threshold&&I&m.direction},attrTest:function(u){return Dt.prototype.attrTest.call(this,u)&&(this.state&Pt||!(this.state&Pt)&&this.directionTest(u))},emit:function(u){this.pX=u.deltaX,this.pY=u.deltaY;var m=io(u.direction);m&&(u.additionalEvent=this.options.event+m),this._super.emit.call(this,u)}});function yn(){Dt.apply(this,arguments)}x(yn,Dt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ye]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.scale-1)>this.options.threshold||this.state&Pt)},emit:function(u){if(u.scale!==1){var m=u.scale<1?"in":"out";u.additionalEvent=this.options.event+m}this._super.emit.call(this,u)}});function wn(){$t.apply(this,arguments),this._timer=null,this._input=null}x(wn,$t,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[eo]},process:function(u){var m=this.options,S=u.pointers.length===m.pointers,A=u.distance<m.threshold,I=u.deltaTime>m.time;if(this._input=u,!A||!S||u.eventType&(W|M)&&!I)this.reset();else if(u.eventType&et)this.reset(),this._timer=f(function(){this.state=jt,this.tryEmit()},m.time,this);else if(u.eventType&W)return jt;return Nt},reset:function(){clearTimeout(this._timer)},emit:function(u){this.state===jt&&(u&&u.eventType&W?this.manager.emit(this.options.event+"up",u):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function xn(){Dt.apply(this,arguments)}x(xn,Dt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ye]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.rotation)>this.options.threshold||this.state&Pt)}});function bn(){Dt.apply(this,arguments)}x(bn,Dt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ft|ge,pointers:1},getTouchAction:function(){return si.prototype.getTouchAction.call(this)},attrTest:function(u){var m=this.options.direction,S;return m&(Ft|ge)?S=u.overallVelocity:m&Ft?S=u.overallVelocityX:m&ge&&(S=u.overallVelocityY),this._super.attrTest.call(this,u)&&m&u.offsetDirection&&u.distance>this.options.threshold&&u.maxPointers==this.options.pointers&&c(S)>this.options.velocity&&u.eventType&W},emit:function(u){var m=io(u.offsetDirection);m&&this.manager.emit(this.options.event+m,u),this.manager.emit(this.options.event,u)}});function ii(){$t.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}x(ii,$t,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[pn]},process:function(u){var m=this.options,S=u.pointers.length===m.pointers,A=u.distance<m.threshold,I=u.deltaTime<m.time;if(this.reset(),u.eventType&et&&this.count===0)return this.failTimeout();if(A&&I&&S){if(u.eventType!=W)return this.failTimeout();var R=this.pTime?u.timeStamp-this.pTime<m.interval:!0,Y=!this.pCenter||Js(this.pCenter,u.center)<m.posThreshold;this.pTime=u.timeStamp,this.pCenter=u.center,!Y||!R?this.count=1:this.count+=1,this._input=u;var st=this.count%m.taps;if(st===0)return this.hasRequireFailures()?(this._timer=f(function(){this.state=jt,this.tryEmit()},m.interval,this),Pt):jt}return Nt},failTimeout:function(){return this._timer=f(function(){this.state=Nt},this.options.interval,this),Nt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==jt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Wt(u,m){return m=m||{},m.recognizers=P(m.recognizers,Wt.defaults.preset),new vn(u,m)}Wt.VERSION="2.0.7",Wt.defaults={domEvents:!1,touchAction:to,enable:!0,inputTarget:null,inputClass:null,preset:[[xn,{enable:!1}],[yn,{enable:!1},["rotate"]],[bn,{direction:Ft}],[si,{direction:Ft},["swipe"]],[ii],[ii,{event:"doubletap",taps:2},["tap"]],[wn]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Md=1,no=2;function vn(u,m){this.options=E({},Wt.defaults,m||{}),this.options.inputTarget=this.options.inputTarget||u,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=u,this.input=ad(this),this.touchAction=new gn(this,this.options.touchAction),ro(this,!0),b(this.options.recognizers,function(S){var A=this.add(new S[0](S[1]));S[2]&&A.recognizeWith(S[2]),S[3]&&A.requireFailure(S[3])},this)}vn.prototype={set:function(u){return E(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?no:Md},recognize:function(u){var m=this.session;if(!m.stopped){this.touchAction.preventDefaults(u);var S,A=this.recognizers,I=m.curRecognizer;(!I||I&&I.state&jt)&&(I=m.curRecognizer=null);for(var R=0;R<A.length;)S=A[R],m.stopped!==no&&(!I||S==I||S.canRecognizeWith(I))?S.recognize(u):S.reset(),!I&&S.state&(Pt|De|he)&&(I=m.curRecognizer=S),R++}},get:function(u){if(u instanceof $t)return u;for(var m=this.recognizers,S=0;S<m.length;S++)if(m[S].options.event==u)return m[S];return null},add:function(u){if(y(u,"add",this))return this;var m=this.get(u.options.event);return m&&this.remove(m),this.recognizers.push(u),u.manager=this,this.touchAction.update(),u},remove:function(u){if(y(u,"remove",this))return this;if(u=this.get(u),u){var m=this.recognizers,S=Z(m,u);S!==-1&&(m.splice(S,1),this.touchAction.update())}return this},on:function(u,m){if(u!==n&&m!==n){var S=this.handlers;return b(J(u),function(A){S[A]=S[A]||[],S[A].push(m)}),this}},off:function(u,m){if(u!==n){var S=this.handlers;return b(J(u),function(A){m?S[A]&&S[A].splice(Z(S[A],m),1):delete S[A]}),this}},emit:function(u,m){this.options.domEvents&&Id(u,m);var S=this.handlers[u]&&this.handlers[u].slice();if(!(!S||!S.length)){m.type=u,m.preventDefault=function(){m.srcEvent.preventDefault()};for(var A=0;A<S.length;)S[A](m),A++}},destroy:function(){this.element&&ro(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function ro(u,m){var S=u.element;if(S.style){var A;b(u.options.cssProps,function(I,R){A=gt(S.style,R),m?(u.oldCssProps[A]=S.style[A],S.style[A]=I):S.style[A]=u.oldCssProps[A]||""}),m||(u.oldCssProps={})}}function Id(u,m){var S=e.createEvent("Event");S.initEvent(u,!0,!0),S.gesture=m,m.target.dispatchEvent(S)}E(Wt,{INPUT_START:et,INPUT_MOVE:Ot,INPUT_END:W,INPUT_CANCEL:M,STATE_POSSIBLE:ti,STATE_BEGAN:Pt,STATE_CHANGED:De,STATE_ENDED:he,STATE_RECOGNIZED:jt,STATE_CANCELLED:as,STATE_FAILED:Nt,DIRECTION_NONE:$s,DIRECTION_LEFT:ts,DIRECTION_RIGHT:es,DIRECTION_UP:ss,DIRECTION_DOWN:is,DIRECTION_HORIZONTAL:Ft,DIRECTION_VERTICAL:ge,DIRECTION_ALL:Xa,Manager:vn,Input:Tt,TouchAction:gn,TouchInput:Ks,MouseInput:Zs,PointerEventInput:dn,TouchMouseInput:mn,SingleTouchInput:Wa,Recognizer:$t,AttrRecognizer:Dt,Tap:ii,Pan:si,Swipe:bn,Pinch:yn,Rotate:xn,Press:wn,on:C,off:B,each:b,merge:v,extend:_,assign:E,inherit:x,bindFn:w,prefixed:gt});var kd=typeof t<"u"?t:typeof self<"u"?self:{};kd.Hammer=Wt,typeof n=="function"&&n.amd?n(function(){return Wt}):i.exports?i.exports=Wt:t[s]=Wt})(window,document,"Hammer")})(ma);var $l=ma.exports;const Wl=Yn($l);class pa extends ls{container;width;height;mousePoint={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0};hammer;removes=[];constructor(t=document.documentElement,e=!0,s){super(),this.container=t,this.width=t.offsetWidth,this.height=t.offsetHeight,this.hammer=new Wl(this.container),e&&this.start(s)}emitDebounce=Co((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}start(t){this.registerMouseEventListeners(),this.registerTransitionEventListeners(),this.registerAnimationEventListeners(),this.registerResizeObserver(),this.registerElementDisplayInParent(),t&&t.forEach(e=>{this.addRemoves(e())}),this.on("pointerMove",e=>{this.setMousePoint(Et(e,this.container))})}destroy(){this.removes.forEach(t=>t()),this.removes=[],this.removeAllListeners()}restart(){this.destroy(),this.start()}addRemoves(t){this.removes.push(t)}registerMouseEventListeners(){const t=M=>{this.emit("mouseDown",M)},e=M=>{this.emit("mouseUp",M)},s=M=>{this.emit("mouseMove",M)},n=M=>{this.emit("mouseOver",M)},r=M=>{this.emit("mouseOut",M)},a=M=>{this.emit("mouseEnter",M)},o=M=>{this.emit("mouseLeave",M)},h=M=>{this.emit("mouseClick",M)},c=M=>{this.emit("mouseDoubleClick",M)},l=M=>{this.emit("mouseWheel",M)},f=M=>{this.emit("mouseContextMenu",M)},y=M=>{this.emit("touchStart",M)},b=M=>{this.emit("touchEnd",M)},p=M=>{this.emit("touchCancel",M)},E=M=>{this.emit("touchMove",M)},_=M=>{this.emit("pointerDown",M)},v=M=>{this.emit("pointerUp",M)},x=M=>{this.emit("pointerCancel",M)},w=M=>{this.emit("pointerMove",M)},g=M=>{this.emit("pan",M)},P=M=>{this.emit("panStart",M)},C=M=>{this.emit("panMove",M)},B=M=>{this.emit("panEnd",M)},H=M=>{this.emit("panCancel",M)},G=M=>{this.emit("panLeft",M)},J=M=>{this.emit("panRight",M)},Z=M=>{this.emit("panUp",M)},at=M=>{this.emit("panDown",M)},Ct=M=>{this.emit("pinch",M)},gt=M=>{this.emit("press",M)},_e=M=>{this.emit("rotate",M)},oe=M=>{this.emit("swipe",M)},pe=M=>{this.emit("swipeLeft",M)},Ae=M=>{this.emit("swipeRight",M)},O=M=>{this.emit("swipeUp",M)},k=M=>{this.emit("swipeDown",M)},U=M=>{this.emit("tap",M)},V=M=>{!M.target||this.container==M.target||this.container.contains(M.target)||this.emit("tapOutSide",M)},ut=M=>{this.emit("inputChange",M,this.container.files)},At=M=>{this.emit("dragstart",M)},Hs=M=>{M.dataTransfer&&(M.dataTransfer.dropEffect="copy"),this.emit("dragover",M)},js=M=>{this.emit("dragenter",M)},et=M=>{this.emit("dragend",M)},Ot=M=>{M.dataTransfer,this.emit("drop",M,M.dataTransfer?.files)};this.container.addEventListener("mousedown",t,!1),this.container.addEventListener("mouseup",e,!1),this.container.addEventListener("mousemove",s,!1),this.container.addEventListener("mouseover",n,!1),this.container.addEventListener("mouseout",r,!1),this.container.addEventListener("mouseenter",a,!1),this.container.addEventListener("mouseleave",o,!1),this.container.addEventListener("click",h,!1),this.container.addEventListener("dblclick",c,!1),this.container.addEventListener("wheel",l,!1),this.container.addEventListener("contextmenu",f,!1),this.container.addEventListener("touchstart",y,!1),this.container.addEventListener("touchend",b,!1),this.container.addEventListener("touchcancel",p,!1),this.container.addEventListener("touchmove",E,!1),this.container.addEventListener("pointerdown",_,!1),this.container.addEventListener("pointerup",v,!1),this.container.addEventListener("pointercancel",x,!1),this.container.addEventListener("pointermove",w,!1),this.hammer.on("pan",g),this.hammer.on("panstart",P),this.hammer.on("panmove",C),this.hammer.on("panend",B),this.hammer.on("pancancel",H),this.hammer.on("panleft",G),this.hammer.on("panright",J),this.hammer.on("panup",Z),this.hammer.on("pandown",at),this.hammer.on("pinch",Ct),this.hammer.on("press",gt),this.hammer.on("rotate",_e),this.hammer.on("swipe",oe),this.hammer.on("swipeleft",pe),this.hammer.on("swiperight",Ae),this.hammer.on("swipeup",O),this.hammer.on("swipedown",k),this.hammer.on("tap",U),document.addEventListener("pointerdown",V,!1),this.container instanceof HTMLInputElement&&this.container.addEventListener("change",ut,!1),this.container.addEventListener("dragstart",At,!1),this.container.addEventListener("dragover",Hs,!1),this.container.addEventListener("dragenter",js,!1),this.container.addEventListener("dragend",et,!1),this.container.addEventListener("drop",Ot,!1);const W=()=>{this.container.removeEventListener("mousedown",t,!1),this.container.removeEventListener("mouseup",e,!1),this.container.removeEventListener("mousemove",s,!1),this.container.removeEventListener("mouseover",n,!1),this.container.removeEventListener("mouseout",r,!1),this.container.removeEventListener("mouseenter",a,!1),this.container.removeEventListener("mouseleave",o,!1),this.container.removeEventListener("click",h,!1),this.container.removeEventListener("dblclick",c,!1),this.container.removeEventListener("wheel",l,!1),this.container.removeEventListener("contextmenu",f,!1),this.container.removeEventListener("touchstart",y,!1),this.container.removeEventListener("touchend",b,!1),this.container.removeEventListener("touchcancel",p,!1),this.container.removeEventListener("touchmove",E,!1),this.container.removeEventListener("pointerdown",_,!1),this.container.removeEventListener("pointerup",v,!1),this.container.removeEventListener("pointercancel",x),this.container.removeEventListener("pointermove",w,!1),this.hammer.off("pan",g),this.hammer.off("panstart",P),this.hammer.off("panmove",C),this.hammer.off("panend",B),this.hammer.off("pancancel",H),this.hammer.off("panleft",G),this.hammer.off("panright",J),this.hammer.off("panup",Z),this.hammer.off("pandown",at),this.hammer.off("pinch",Ct),this.hammer.off("press",gt),this.hammer.off("rotate",_e),this.hammer.off("swipe",oe),this.hammer.off("swipeleft",pe),this.hammer.off("swiperight",Ae),this.hammer.off("swipeup",O),this.hammer.off("swipedown",k),this.hammer.off("tap",U),document.removeEventListener("pointerdown",V,!1),document.removeEventListener("touchstart",V,!1),document.removeEventListener("mousedown",V,!1),this.container instanceof HTMLInputElement&&this.container.removeEventListener("change",ut,!1),this.container.removeEventListener("dragstart",At,!1),this.container.removeEventListener("dragover",Hs,!1),this.container.removeEventListener("dragenter",js,!1),this.container.removeEventListener("dragend",et,!1),this.container.removeEventListener("drop",Ot,!1)};return this.addRemoves(W),W}registerTransitionEventListeners(){const t=n=>{this.emit("transitionstart",n)},e=n=>{this.emit("transitionend",n)};this.container.addEventListener("transitionstart",t,!1),this.container.addEventListener("transitionend",e,!1);const s=()=>{this.container.removeEventListener("transitionstart",t,!1),this.container.removeEventListener("transitionend",e,!1)};return this.addRemoves(s),s}registerAnimationEventListeners(){const t=n=>{this.emit("animationstart",n)},e=n=>{this.emit("animationend",n)};this.container.addEventListener("animationstart",t,!1),this.container.addEventListener("animationend",e,!1);const s=()=>{this.container.removeEventListener("animationstart",t,!1),this.container.removeEventListener("animationend",e,!1)};return this.addRemoves(s),s}registerResizeObserver(){let t;if(typeof ResizeObserver<"u"){const e=new ResizeObserver(s=>{const{width:n,height:r}=s[0].contentRect;this.width=n,this.height=r,this.emit("resize",n,r)});e.observe(this.container),t=()=>{e.unobserve(this.container)}}else{const e="orientationchange"in window?"orientationchange":"resize",s=n=>{const r=n.target.innerWidth,a=n.target.innerHeight;this.emit("resize",r,a)};window.addEventListener(e,s,!1),t=()=>{window.removeEventListener(e,s,!1)}}return this.addRemoves(t),t}registerElementDisplayInParent(t){const e={threshold:t?.threshold||.5,root:t?.parentElement},s=new IntersectionObserver((r,a)=>{let o=r[0];if(r.length>1){const c=r.find(l=>l.isIntersecting);c&&(o=c)}o.isIntersecting&&o.intersectionRatio>=e.threshold?this.emit("showInParent"):this.emit("showOffParent")},e);s.observe(this.container);const n=()=>{s.unobserve(this.container)};return this.addRemoves(n),n}registerPullDownRefresh(t){const e=t?.distance||50;return this.captureDrag({move:(s,n)=>{n.dStartY>0&&n.dStartY<e&&this.emit("pullDowning",n.dStartY)},end:(s,n)=>{n.dStartY>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;return this.captureDrag({move:(s,n)=>{n.dStartY>0&&n.dStartY<e&&this.emit("pullUping",n.dStartY)},end:(s,n)=>{n.dStartY>=e&&this.emit("pullUp")}})}setMousePoint(t){this.mousePoint.x=t.x,this.mousePoint.y=t.y,this.mousePoint.dx=typeof t.dx=="number"?t.dx:0,this.mousePoint.dy=typeof t.dy=="number"?t.dy:0,this.mousePoint.dStartX=typeof t.dStartX=="number"?t.dStartX:0,this.mousePoint.dStartY=typeof t.dStartY=="number"?t.dStartY:0}captureDrag(t){return this.captureDragUsePointer(t)}captureDragUsePointer(t){let e,s;const n=h=>{h.preventDefault(),h.stopPropagation(),this.on("pointerMove",a),this.on("pointerUp",r),this.on("pointerCancel",r),s=Et(h,this.container);const c={...s};e=c,this.setMousePoint(c),t?.start?.(h,c)},r=h=>{h.preventDefault(),h.stopPropagation(),this.off("pointerMove",a),this.off("pointerUp",r),this.off("pointerCancel",r),s=Et(h,this.container);const c={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(c),t?.end?.(h,c),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c={...s};s=Et(h,this.container);const l={...s,dx:s.x-(c.x||0),dy:s.y-(c.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.move?.(h,l)};this.on("pointerDown",n);const o=()=>{this.off("pointerDown",n)};return this.addRemoves(o),o}captureDragUseMouse(t){let e,s;const n=h=>{h.preventDefault(),h.stopPropagation(),document.addEventListener("mousemove",a,!1),document.addEventListener("mouseup",r,!1),s=Et(h,this.container);const c={...s};e=c,this.setMousePoint(c),t?.start?.(h,c)},r=h=>{h.preventDefault(),h.stopPropagation(),document.removeEventListener("mousemove",a,!1),document.removeEventListener("mouseup",r,!1),s=Et(h,this.container);const c={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(c),t?.end?.(h,c),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c={...s};s=Et(h,this.container);const l={...s,dx:s.x-(c.x||0),dy:s.y-(c.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.move?.(h,l)};this.on("mouseDown",n);const o=()=>{this.off("mouseDown",n)};return this.addRemoves(o),o}captureDragUseTouch(t){let e,s;const n=h=>{h.preventDefault(),h.stopPropagation(),this.on("touchMove",a),this.on("touchEnd",r),this.on("touchCancel",r);const c=h.changedTouches[0];s=Et(c,this.container);const l={...s};e=l,this.setMousePoint(l),t?.start?.(c,l)},r=h=>{h.preventDefault(),h.stopPropagation(),this.off("touchMove",a),this.off("touchEnd",r),this.off("touchCancel",r);const c=h.changedTouches[0];s=Et(c,this.container);const l={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.end?.(c,l),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c=h.changedTouches[0],l={...s};s=Et(c,this.container);const f={...s,dx:s.x-(l.x||0),dy:s.y-(l.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(f),t?.move?.(c,f)};this.on("touchStart",n);const o=()=>{this.off("touchStart",n)};return this.addRemoves(o),o}}const Jl=new pa(document.documentElement,!0,[]);class $e{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{e.target}),this.video.srcObject=t}captureWebCamera(){navigator.mediaDevices.getUserMedia({video:!0}).then(t=>{this.setSrcObject(t)})}static async videoMediaChangeSupport(){return new Promise(t=>{const e=document.createElement("iframe"),s=document.createElement("video"),n=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),n.src=URL.createObjectURL(r),n.media="(min-width:10px)",s.append(n),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(s),setTimeout(()=>{e.width="15"}),setTimeout(()=>{e.remove(),t(!1)},1e3)})}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(()=>{$e.setAutoPlayWhenClick(t),e(!1)})})}static setAutoPlayWhenClick(t){function e(){t.autoplay=!0,t.play(),document.removeEventListener("click",e),document.removeEventListener("touchend",e)}document.addEventListener("click",e),document.addEventListener("touchend",e)}}class ga extends ls{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=ao(this.source);if(t===0){this.emit("finish");return}let e,s,n=Tn(this.source,0);for(let r=1;r<t;r++)e=s,s=n,n=Tn(this.source,r),this.raw+=s,s&&this.step(s,n,e);n&&this.step(n,void 0,s),this.emit("finish")}step(t,e,s){t==`
|
|
29
|
+
`&&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":Ut("whitespace",t)?(this.textchunk+=F.entity2text(this.entity),this.mode="text"):t==";"?(this.textchunk+=F.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(!Ut("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":Ut("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,s));break;case"close tag name":if(Ut("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(Ut("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":Ut("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,s));break;case"attr":if(Ut("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(!Ut("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(Ut("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}}}const Qi={safeAreaTop:F.getCSSVar("--safe-area-inset-top"),safeAreaRight:F.getCSSVar("--safe-area-inset-right"),safeAreaBottom:F.getCSSVar("--safe-area-inset-bottom"),safeAreaLeft:F.getCSSVar("--safe-area-inset-left"),colorPrimary:F.getCSSVar("--color-primary")||"#5078f0",colorRed:F.getCSSVar("--color-red")||"#ff5050",colorOrange:F.getCSSVar("--color-orange")||"#fa8c00",colorYellow:F.getCSSVar("--color-yellow")||"#fadc32",colorGreen:F.getCSSVar("--color-green")||"#00c878",colorBlue:F.getCSSVar("--color-blue")||"#00b4fa",colorPurple:F.getCSSVar("--color-purple")||"#6464fa",colorBlack:F.getCSSVar("--color-black")||"#001428",colorGray00:F.getCSSVar("--color-gray-00")||"#000000",colorGray33:F.getCSSVar("--color-gray-33")||"#333333",colorGray66:F.getCSSVar("--color-gray-66")||"#666666",colorGray99:F.getCSSVar("--color-gray-99")||"#999999",colorGrayCC:F.getCSSVar("--color-gray-cc")||"#cccccc",colorGrayDD:F.getCSSVar("--color-gray-dd")||"#dddddd",colorGrayE6:F.getCSSVar("--color-gray-e6")||"#e6e6e6",colorGrayEE:F.getCSSVar("--color-gray-ee")||"#eeeeee",colorGrayEF:F.getCSSVar("--color-gray-ef")||"#efefef",colorGrayF5:F.getCSSVar("--color-gray-f5")||"#f5f5f5",colorGrayFF:F.getCSSVar("--color-gray-ff")||"#ffffff",fontLineHeight:F.getCSSVar("--font-line-height")||"1.4",fontSize32:F.getCSSVar("--font-size-32")||"32px",fontSize24:F.getCSSVar("--font-size-24")||"24px",fontSize22:F.getCSSVar("--font-size-22")||"22px",fontSize20:F.getCSSVar("--font-size-20")||"20px",fontSize18:F.getCSSVar("--font-size-18")||"18px",fontSize16:F.getCSSVar("--font-size-16")||"16px",fontSize14:F.getCSSVar("--font-size-14")||"14px",fontSize12:F.getCSSVar("--font-size-12")||"12px",fontSize10:F.getCSSVar("--font-size-10")||"10px",d4:F.getCSSVar("--distance-4")||"4px",d8:F.getCSSVar("--distance-8")||"8px",d12:F.getCSSVar("--distance-12")||"12px",d16:F.getCSSVar("--distance-16")||"16px",d20:F.getCSSVar("--distance-20")||"20px",d32:F.getCSSVar("--distance-32")||"32px",d40:F.getCSSVar("--distance-40")||"40px",d44:F.getCSSVar("--distance-44")||"44px"};class lt{__color={r:0,g:0,b:0,a:1};constructor(t,e){t&&this.setColor(t),typeof e=="number"&&this.setAlpha(e)}get color(){return this.__color}set color(t){this.__color=tn(t)}setColor(t){return this.color=t,this}get r(){return this.__color.r}set r(t){this.__color.r=j(Math.round(t),0,255)}get g(){return this.__color.g}set g(t){this.__color.g=j(Math.round(t),0,255)}get b(){return this.__color.b}set b(t){this.__color.b=j(Math.round(t),0,255)}get a(){return this.__color.a}set a(t){this.__color.a=j(t,0,1)}setAlpha(t){return this.a=t,this}setRGB(t,e,s){return this.r=t,this.g=e,this.b=s,this}setRGBA(t,e,s,n){return this.r=t,this.g=e,this.b=s,this.a=n,this}get hex(){return(this.r<<16)+(this.g<<8)+this.b}toString(){if(this.a===1){const t="000000"+this.hex.toString(16);return"#"+t.slice(t.length-6)}else return`rgba(${this.r},${this.g},${this.b},${Mt(this.a,6)})`}clone(){return new lt(this.color)}copy(t){this.setColor(t.color)}opposite(t=!1,e="#000000",s="#ffffff"){if(t)return new lt(this.r*.299+this.g*.587+this.b*.114>186?e:s);{const n=this.clone();return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,n}}lighten(t){t=j(Math.abs(t),0,1);let{r:e,g:s,b:n}=this.color;return e+=(255-e)*t,s+=(255-s)*t,n+=(255-n)*t,new lt().setRGBA(e,s,n,this.color.a)}darken(t){t=j(Math.abs(t),0,1);let{r:e,g:s,b:n}=this.color;return e=e*(1-t),s=s*(1-t),n=n*(1-t),new lt().setRGBA(e,s,n,this.color.a)}static gradient(t,e,s){try{const n=tn(t),r=tn(e);return new lt().setRGB((r.r-n.r)*s+n.r,(r.g-n.g)*s+n.g,(r.b-n.b)*s+n.b)}catch{return new lt(e)}}static random(){return new lt(Math.random()*16777215)}get hsv(){const{r:t,g:e,b:s,a:n}=this.color,r=Math.max(t,e,s),a=Math.min(t,e,s),o=r-a;let h;return t===r?h=(e-s)/o:e===r?h=2+(s-t)/o:h=4+(t-e)/o,h/=6,h<0&&(h+=1),{h:o==0?0:h*360,s:r===0?0:o/r,v:r/255,a:n}}set h(t){const e=this.hsv;e.h=j(t,0,360),this.setColor(e)}get h(){return this.hsv.h}set s(t){const e=this.hsv;e.s=j(t,0,1),this.setColor(e)}get s(){return this.hsv.s}set v(t){const e=this.hsv;e.v=j(t,0,1),this.setColor(e)}get v(){return this.hsv.v}}function We(i,t){return new lt(i,t)}function tn(i){const t=Object.prototype.hasOwnProperty.call(i,"a")?j(i.a,0,1):1;if(Object.prototype.hasOwnProperty.call(i,"r")&&Object.prototype.hasOwnProperty.call(i,"g")&&Object.prototype.hasOwnProperty.call(i,"b"))return i.r=j(Math.round(i.r),0,255),i.g=j(Math.round(i.g),0,255),i.b=j(Math.round(i.b),0,255),i.a=t,i;if(Object.prototype.hasOwnProperty.call(i,"h")&&Object.prototype.hasOwnProperty.call(i,"s")&&Object.prototype.hasOwnProperty.call(i,"v")){const s=j(i.h,0,360),n=j(i.s,0,1),r=j(i.v,0,1),a=Math.floor(s/60)%6,o=s/60-Math.floor(s/60),h=r*(1-n),c=r*(1-o*n),l=r*(1-(1-o)*n),f=[[r,l,h],[c,r,h],[h,r,l],[h,c,r],[l,h,r],[r,h,c]][a];return{r:Math.round(f[0]*255),g:Math.round(f[1]*255),b:Math.round(f[2]*255),a:t}}const e={r:0,g:0,b:0,a:t};if(typeof i=="number")i<Math.pow(2,24)?(e.r=i>>16&255,e.g=i>>8&255,e.b=i&255):(e.r=i>>24&255,e.g=i>>16&255,e.b=i>>8&255,e.a=(i&255)/255);else if(typeof i=="string"){const s=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,?\s*(\d?\.?\d*)?\s*\)/gi.exec(i);if(s)e.r=parseInt(s[1]),e.g=parseInt(s[2]),e.b=parseInt(s[3]),s[4]&&(e.a=parseFloat(s[4]));else{let n=i.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);n?(e.r=parseInt(`${n[1]}${n[1]}`,16),e.g=parseInt(`${n[2]}${n[2]}`,16),e.b=parseInt(`${n[3]}${n[3]}`,16)):(n=i.match(/^#([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})$/i),n?(e.r=parseInt(n[1],16),e.g=parseInt(n[2],16),e.b=parseInt(n[3],16)):(n=i.match(/^#([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})$/i),n?(e.r=parseInt(n[1],16),e.g=parseInt(n[2],16),e.b=parseInt(n[3],16),e.a=parseInt(n[4],16)/255):i==="none"&&(e.a=0)))}}else throw new Error("parseColor 不支持的颜色解析:"+i);return e.r=j(e.r,0,255),e.g=j(e.g,0,255),e.b=j(e.b,0,255),e.a=j(e.a,0,1),e}const ya=["#0ac2d2","#7bb7fa","#60d7a9","#fdc162","#fd6a62","#f68dbb","#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff","#dc4916","#6871b1","#d1b935","#1bbc9b","#FF7F50","#4BBFC3","#ff9900"],de={backgroundColor:"#1a1a1a",numberColor:"#2FA1D6",booleanColor:"#806787",stringColor:"#1ed36f",functionColor:"#e61d5f",saveRowColor:"#dad5cb",buttonColor:"",borderColor:"",inputColor:""};de.buttonColor=new lt(de.saveRowColor).darken(.1).toString(),de.borderColor=new lt(de.backgroundColor).lighten(.07).toString(),de.inputColor=new lt(de.backgroundColor).lighten(.085).toString();function Xs(i=window.location.href){return _n(URL)?new URL(i):wa(i)}function wa(i=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",s="(?<pathname>(?:\\/[^/#?]+)*\\/?)",n="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${s}${n}${r}$`).exec(i);return{href:i,protocol:o?.groups?.protocol??"",host:o?.groups?.host??"",hostname:o?.groups?.hostname??"",port:o?.groups?.port??"",pathname:o?.groups?.pathname??"",search:o?.groups?.search??"",hash:o?.groups?.hash??""}}function Zl(i){const t=Xs(i);return t.protocol==="http:"||t.protocol==="https:"}function xa(i=window.location.href){const t=Xs(i),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function Kl(i=Xs().search){i=decodeURIComponent(i).replace(/^[#?&]/,"");const t={};if(!i)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let s=e.exec(i);for(;s;)t[s[1]]=s[2],s=e.exec(i);return t}function Vs(i){return"?"+Object.entries(i).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function ba(i){return"?"+[...i.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function va(i,t){return i.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function Ql(i,t){return va(i,Vs(t))}function en(i,t){return i+t.replace(/^[&?]/,i.indexOf("?")>=0?"&":"?")}function tu(i,t){return en(i,Vs(t))}const eu=(i=window.location.href)=>JSON.parse('{"'+decodeURI(i.split("?")[1]).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}');class su{worker;cbs={};constructor(t){if(Xr)try{this.worker=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){throw typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),e}else throw new Error("Your environment do not support Worker !")}postMessage(t,e=[]){this.worker.postMessage(t,e)}onmessage(t){this.worker.addEventListener("message",t)}offmessage(t){this.worker.removeEventListener("message",t)}onmessageerror(t){this.worker.addEventListener("messageerror",t)}offmessageerror(t){this.worker.removeEventListener("messageerror",t)}postCanvas(t){const e=t.transferControlToOffscreen();this.worker.postMessage({canvas:e},[e])}postPort(t){this.worker.postMessage({port:t},[t])}postReset(){this.worker.postMessage({reset:!0});for(const t in this.cbs)this.cbs[t](),delete this.cbs[t]}fire(t,e){return new Promise(s=>{if(e){const n=Math.random().toString(36).slice(2),r=a=>{a.data.id===n&&(this.worker.removeEventListener("message",r),delete this.cbs[n],e(),s())};this.cbs[n]=r.bind(this,{data:{id:n}}),this.worker.addEventListener("message",r),this.worker.postMessage({...t,id:n})}else this.worker.postMessage(t),s()})}}class iu{port1;port2;port1MessageCbs=[];port2MessageCbs=[];port1MessageErrorCbs=[];port2MessageErrorCbs=[];constructor(){const{port1:t,port2:e}=new MessageChannel;this.port1=t,this.port2=e,this.port1.addEventListener("message",s=>{this.port1MessageCbs.forEach(n=>n(this.port1,s))}),this.port1.addEventListener("messageerror",s=>{this.port1MessageErrorCbs.forEach(n=>n(this.port1,s))}),this.port1.start(),this.port2.addEventListener("message",s=>{this.port2MessageCbs.forEach(n=>n(this.port2,s))}),this.port2.addEventListener("messageerror",s=>{this.port2MessageErrorCbs.forEach(n=>n(this.port2,s))}),this.port2.start()}close(){this.port1.close(),this.port2.close()}onPort1Message(t){this.port1MessageCbs.push(t)}onPort1MessageError(t){this.port1MessageErrorCbs.push(t)}offPort1Message(t){xe(this.port1MessageCbs,t)}offPort1MessageError(t){xe(this.port1MessageErrorCbs,t)}onPort2Message(t){this.port2MessageCbs.push(t)}onPort2MessageError(t){this.port2MessageErrorCbs.push(t)}offPort2Message(t){xe(this.port2MessageCbs,t)}offPort2MessageError(t){xe(this.port2MessageErrorCbs,t)}}function Sa(){let i=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0,s=t.length;e<s;e++)try{i=new window.ActiveXObject(t[e]);break}catch{continue}}else i=new XMLHttpRequest;return i}function nu(i,t){return new Promise((e,s)=>{const{method:n="GET",data:r={},multipartFormDataString:a="",boundary:o="",headers:h={},withCredentials:c=!1,responseType:l="json",timeout:f=3e4}=t||{},y=Sa();y.timeout=f,y.responseType=l,y.onreadystatechange=function(x){y.readyState===4&&(y.status===200?e(y.response):s(y.statusText))},y.ontimeout=()=>{s(`${i} is timed out for ${f}ms.`)},y.addEventListener("load",x=>t?.load?.(x,y),!1),y.addEventListener("loadstart",x=>t?.loadstart?.(x,y),!1),y.addEventListener("loadend",x=>t?.loadend?.(x,y),!1),y.addEventListener("progress",x=>{if(x.lengthComputable){const w=Math.round(x.loaded*100/x.total);t?.progress?.(x,y,w)}},!1),y.addEventListener("error",x=>t?.error?.(x,y),!1),y.addEventListener("abort",x=>t?.abort?.(x,y),!1);const b=n.toUpperCase();Object.assign(h,{Accept:"*/*"});let p=!1,E=!1,_=!1;function v(){c&&(y.withCredentials=!0);for(const x in h)dt(x).toLowerCase()=="content-type"&&h[x].toLowerCase()=="multipart/form-data"?(p=!0,y.setRequestHeader("Content-Type","multipart/form-data; boundary="+o)):(dt(x).toLowerCase()=="content-type"&&(h[x].toLowerCase().indexOf("text/plain")>=0?E=!0:h[x].toLowerCase().indexOf("application/json")>=0&&(_=!0)),y.setRequestHeader(x,h[x]))}switch(b){case"GET":let x="";r instanceof FormData?x=ba(r):x=Vs(r),y.open("GET",en(i,x),!0),v(),y.send(null);break;default:y.open(b,i,!0),v(),p?y.sendAsBinary(a):_?y.send(JSON.stringify(r)):E?y.send(Object.entries(r).map(([w,g])=>`${w}=${g}`).join(`\r
|
|
30
|
+
`)):y.send(Object.entries(r).map(([w,g])=>`${encodeURIComponent(w)}=${encodeURIComponent(g)}`).join("&"));break}})}async function ru(i){const t={url:i.action||"",data:{},contentType:i.method.toLowerCase()==="post"&&i.enctype?i.enctype:"application/x-www-form-urlencoded",multipartFormDataString:"",boundary:"---------------------------"+Date.now().toString(16)},e=[],s=t.contentType=="multipart/form-data";for(let n=0;n<i.elements.length;n++){const r=i.elements[n];if(!r.hasAttribute("name"))continue;const a=r.getAttribute("type");switch(r.nodeName.toUpperCase()==="INPUT"&&a?a.toUpperCase():""){case"FILE":const h=r;if(s)for(let f=0,y=h.files?.length||0;f<y;f++){const b=h.files?.[f];if(b){const p=await Cs(b,ce.binaryString);e.push('Content-Disposition: form-data; name="'+h.name+'"; filename="'+b.name+`"\r
|
|
31
31
|
Content-Type: `+b.type+`\r
|
|
32
32
|
\r
|
|
33
33
|
`+p+`\r
|
|
@@ -37,10 +37,10 @@ Content-Type: `+b.type+`\r
|
|
|
37
37
|
`):t.data[l.name]=l.value;break}}return t.multipartFormDataString="--"+t.boundary+`\r
|
|
38
38
|
`+e.join("--"+t.boundary+`\r
|
|
39
39
|
`)+"--"+t.boundary+`--\r
|
|
40
|
-
`,t}function zl(i,t,e,s,n){const r=t/e;let a=0,o=0;switch(i){case"aspectFit":r>=1?(a=s,o=a/r,o>n&&(o=n,a=o*r)):(o=n,a=o*r,a>s&&(a=s,o=a/r));break;case"aspectFill":r>=1?(o=n,a=o*r):(a=s,o=a/r);break;case"widthFix":a=s,o=a/r;break;case"heightFix":o=n,a=o*r;break;case"scaleToFill":default:a=s,o=n;break}return{width:a,height:o}}const Us=new Map;async function Hl(i){return new Promise((t,e)=>{Xs(i,(s,n)=>s?e(s):t({width:n.width,height:n.height,aspectRatio:n.width/n.height}))})}const Xs=(i,t)=>{if(Us.has(i))return t(null,Us.get(i));const e=new Image;e.onload=function(){Us.set(i,{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height,element:e}),t(null,Us.get(i))},e.onerror=function(s){t(s,null)},e.src=i},ql=(i,t)=>{for(let e=0,s=i.length;e<s;e++){const n=i[e],{type:r}=n;if(r.split("/")[0]!=="image")continue;const a=new FileReader;a.onload=function(o){if(!o.target)return t("no reader target",null);const h=o.target.result,c=Dn(h),l=new Blob([h]);Ki(l,(f,y)=>{if(!y)return t(f,null);Xs(y,(b,p)=>{if(!p)return t(b,null);pa(y,(E,_)=>{if(!_)return t(E,null);const v={name:n.name,fileType:c,size:n.size,width:p.width,height:p.height,imgUrl:y,imageData:_,blob:l};return t(null,v)})})})},a.readAsArrayBuffer(n)}},pa=(i,t)=>{Xs(i,(e,s)=>{if(!s)return t(e,null);const n=document.createElement("canvas"),r=n.getContext("2d");n.width=s.width,n.height=s.height,r.drawImage(s.element,0,0,n.width,n.height);const a=r.getImageData(0,0,n.width,n.height);return t(null,a)})},jl=(i,t=0,e=0)=>{const s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.drawImage(i,0,0,t,e),n.getImageData(0,0,t,e)},$l=(i,t=0,e=0)=>{const s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.drawImage(i,0,0,t,e),n.getImageData(0,0,t,e)},Wl=i=>{const t=i.width,e=i.height,s=t*e*3,n=s+54,r=[66,77,n&255,n>>8&255,n>>16&255,n>>24&255,0,0,0,0,54,0,0,0],a=[40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,1,0,24,0,0,0,0,0,s&255,s>>8&255,s>>16&255,s>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=(4-t*3%4)%4,h=i.data;let c="";const l=t<<2;let f=e;const y=String.fromCharCode;do{const p=l*(f-1);let E="";for(let _=0;_<t;_++){const v=_<<2;E+=y(h[p+v+2])+y(h[p+v+1])+y(h[p+v])}for(let _=0;_<o;_++)E+=String.fromCharCode(0);c+=E}while(--f);function b(p){if(!window.btoa)throw"btoa undefined";let E="";if(typeof p=="string")E=p;else for(let _=0;_<p.length;_++)E+=String.fromCharCode(p[_]);return btoa(E)}return b(r.concat(a))+b(c)},Jl=i=>{const{width:t,height:e}=i,s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.putImageData(i,0,0,0,0,t,e),s.toDataURL("image/png")},Zl=(i,t,e)=>{const{width:s,height:n}=i,r=document.createElement("canvas"),a=r.getContext("2d");r.width=s,r.height=n,a.putImageData(i,0,0,0,0,s,n);const o=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},o,1)},Ki=(i,t)=>{const e=new FileReader;e.onload=function(s){s.target?t(null,s.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(i)},Kl=(i,t)=>{Ki(i,function(e,s){if(s){const n=new Image;n.src=s}else t(e)})};function Ql(i){const t=[],e=[],s=[];let n=0;for(let h=0,c=i.data.length;h<c;h+=4)t[n]=i.data[h],e[n]=i.data[h+1],s[n]=i.data[h+2],n+=1;const r=Qi(t),a=Qi(e),o=Qi(s);return"rgb("+r+","+a+","+o+")"}function Qi(i){const t={},e=[],s=[];for(let o=0;o<i.length;o++)t[i[o]]?e.push(i[o]):t[i[o]]=1;let n=0;for(let o=0;o<e.length;o++){n=0;for(let h=0;h<e.length;h++)e[o]===e[h]&&(n+=1),s[o]=n}const r=Math.max.apply(null,s);let a=0;for(;a<s.length;a++)if(s[a]===r)return;return e[a]}const tu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[(a*e+e-o-1)*4],n[h+1]=t[(a*e+e-o-1)*4+1],n[h+2]=t[(a*e+e-o-1)*4+2],n[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(n,e,s)},eu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[((s-a-1)*e+o)*4],n[h+1]=t[((s-a-1)*e+o)*4+1],n[h+2]=t[((s-a-1)*e+o)*4+2],n[h+3]=t[((s-a-1)*e+o)*4+3]}return new ImageData(n,e,s)},su=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;n[h]=t[(o*e+e-a-1)*4],n[h+1]=t[(o*e+e-a-1)*4+1],n[h+2]=t[(o*e+e-a-1)*4+2],n[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(n,s,e)},iu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;n[h]=t[((s-o-1)*e+a)*4],n[h+1]=t[((s-o-1)*e+a)*4+1],n[h+2]=t[((s-o-1)*e+a)*4+2],n[h+3]=t[((s-o-1)*e+a)*4+3]}return new ImageData(n,s,e)},nu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1]+t[h+2])/3;n[h]=c,n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},ru=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=.2126*t[h]+.7152*t[h+1]+.0722*t[h+2];n[h]=c,n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},au=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=(t[h]+t[h+1]+t[h+2])/3>127?255:0;n[h]=l,n[h+1]=l,n[h+2]=l,n[h+3]=t[h+3]}return new ImageData(n,e,s)},ou=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=255-t[h],n[h+1]=255-t[h+1],n[h+2]=255-t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},hu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=0,n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},cu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=t[h+1],n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},lu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=0,n[h+2]=t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},uu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=t[h+1],n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},fu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=0,n[h+2]=t[h+1],n[h+3]=t[h+3]}return new ImageData(n,e,s)},du=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=t[h+1],n[h+2]=t[h+1],n[h+3]=t[h+3]}return new ImageData(n,e,s)},mu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h+1]+t[h+2])/2;n[h]=t[h],n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},pu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+2])/2;n[h]=c,n[h+1]=t[h+1],n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},gu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1])/2;n[h]=c,n[h+1]=c,n[h+2]=t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},yu=i=>ga(i,[-1,-1,-1,-1,9,-1,-1,-1,-1]),wu=i=>ga(i,[-1,-1,-1,-1,8,-1,-1,-1,-1]),xu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=t[h+1],n[h+2]=t[h+2],n[h+3]=255}return new ImageData(n,e,s)},bu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;if(t[h+3]===0)n[h]=255,n[h+1]=255,n[h+2]=255,n[h+3]=255;else{const c=ya([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);n[h]=c[0],n[h+1]=c[1],n[h+2]=c[2],n[h+3]=c[3]}}return new ImageData(n,e,s)},vu=(i,t,e,s,n,r=!1,a)=>{const{data:o,width:h,height:c}=i;let l=n,f=s,y=t,b=e;if(l<0?l=0:l>h&&(l=h),f<0?f=0:f>c&&(f=c),y<1?y=1:y>h&&(y=h),b<1?b=1:b>c&&(b=c),l+y>h&&(y=h-l),f+b>c&&(b=c-f),r){const p=new Uint8ClampedArray(o.length);for(let _=0;_<c;_++)for(let v=0;v<h;v++){const x=(_*h+v)*4;v>=l&&v<=l+y&&_>=f&&_<=f+b?(p[x]=o[x],p[x+1]=o[x+1],p[x+2]=o[x+2],p[x+3]=o[x+3]):(p[x]=255,p[x+1]=255,p[x+2]=255,p[x+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(p,h,c)}else{const p=new Uint8ClampedArray(y*b*4);for(let _=f;_<=f+b;_++)for(let v=l;v<=l+y;v++){const x=((_-f)*y+v-l)*4,w=(_*h+v)*4;p[x]=o[w],p[x+1]=o[w+1],p[x+2]=o[w+2],p[x+3]=o[w+3]}return new ImageData(p,y,b)}},Su=(i,t,e,s)=>{const{data:n,width:r,height:a}=i;let o=t;o>Math.floor(r/2)&&(o=Math.floor(r/2)),o>Math.floor(a/2)&&(o=Math.floor(a/2)),o<0&&(o=0);const h=new Uint8ClampedArray(n.length);for(let l=0;l<a;l++)for(let f=0;f<r;f++){const y=(l*r+f)*4;let b=-1;f<o?l<o?b=Math.sqrt(Math.pow(o-f-1,2)+Math.pow(o-l-1,2)):l>a-o-1&&(b=Math.sqrt(Math.pow(o-f-1,2)+Math.pow(l-(a-o),2))):f>r-o-1&&(l<o?b=Math.sqrt(Math.pow(f-(r-o),2)+Math.pow(o-l-1,2)):l>a-o-1&&(b=Math.sqrt(Math.pow(f-(r-o),2)+Math.pow(l-(a-o),2)))),Math.round(b)>o?(h[y]=255,h[y+1]=255,h[y+2]=255,h[y+3]=s||e.toUpperCase()==="PNG"?0:255):(h[y]=n[y],h[y+1]=n[y+1],h[y+2]=n[y+2],h[y+3]=s||e.toUpperCase()==="PNG"?n[y+3]:255)}return new ImageData(h,r,a)},Cu=(i,t,e,s,n,r=1e4)=>{const a=new Image;a.src=i;const o=document.createElement("canvas"),h=o.getContext("2d");return o.width=r,o.height=r,h.drawImage(a,0,0,t,e,0,0,s,n),h.getImageData(0,0,s,n)},Tu=(i,t)=>{const{data:e,width:s,height:n}=i,r=new Uint8ClampedArray(e.length);for(let o=0;o<n;o++)for(let h=0;h<s;h++){const c=(o*s+h)*4;r[c]=Math.max(Math.min(e[c]+t,255),0),r[c+1]=Math.max(Math.min(e[c+1]+t,255),0),r[c+2]=Math.max(Math.min(e[c+2]+t,255),0),r[c+3]=e[c+3]}return new ImageData(r,s,n)},Pu=(i,t,e=!1)=>{const{data:s,width:n,height:r}=i,a=new Uint8ClampedArray(s.length);for(let h=0;h<r;h++)for(let c=0;c<n;c++){const l=(h*n+c)*4;s[l+3]===0?(a[l]=255,a[l+1]=255,a[l+2]=255):(a[l]=s[l],a[l+1]=s[l+1],a[l+2]=s[l+2]);let 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,n,r)},Eu=(i,t,e,s)=>{const{data:n,width:r,height:a}=i,{data:o,width:h,height:c}=t;let l=e,f=s;e+c>a&&(l=a-c),s+h>r&&(f=r-h);const y=new Uint8ClampedArray(n.length);for(let p=0;p<a;p++)for(let E=0;E<r;E++){const _=(p*r+E)*4;if(E<f||E>f+h||p<=l||p>=l+c)y[_]=n[_],y[_+1]=n[_+1],y[_+2]=n[_+2],y[_+3]=n[_+3];else{const v=(p*r+E-((l+1)*r+(p-(l+1))*(r-h))+h-f-1)*4,x=[o[v],o[v+1],o[v+2],o[v+3]],w=[n[_],n[_+1],n[_+2],n[_+3]],g=ya(x,w);y[_]=g[0],y[_+1]=g[1],y[_+2]=g[2],y[_+3]=g[3]}}return new ImageData(y,r,a)},_u=(i,t,e,s,n,r=10)=>{const{data:a,width:o,height:h}=i;let c=n,l=s,f=t,y=e;c<0?c=0:c>o&&(c=o),l<0?l=0:l>h&&(l=h),f<1?f=1:f>o&&(f=o),y<1?y=1:y>h&&(y=h),c+f>o&&(f=o-c),l+y>h&&(y=h-l);const b=new Uint8ClampedArray(a.length);for(let E=0;E<h;E++)for(let _=0;_<o;_++){const v=(E*o+_)*4;if(_>=c&&_<=c+f&&E>=l&&E<=l+y){const x=Math.floor((_-c)/r),w=Math.floor((E-l)/r);let g=Math.floor(r*(x+1)-r/2+c),P=Math.floor(r*(w+1)-r/2+l);g>o-1&&(g=o-1),P>h-1&&(P=h-1);const C=(P*o+g)*4;b[v]=a[C],b[v+1]=a[C+1],b[v+2]=a[C+2],b[v+3]=a[C+3]}else b[v]=a[v],b[v+1]=a[v+1],b[v+2]=a[v+2],b[v+3]=a[v+3]}return new ImageData(b,o,h)},Au=(i,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}})=>{if(t&&e){const{data:s,width:n,height:r}=i,{data:a}=t,o=new Uint8ClampedArray(s.length),{backgroundColor:h,changeIntoColor:c}=e;for(let f=0;f<r;f++)for(let y=0;y<n;y++){const b=(f*n+y)*4,p=a[b],E=a[b+1],_=a[b+2],v=a[b+3];p===h.r&&E===h.g&&_===h.b&&v===h.a&&c.a!==0?(o[b]=c.r,o[b+1]=c.g,o[b+2]=c.b,o[b+3]=c.a):(o[b]=s[b],o[b+1]=s[b+1],o[b+2]=s[b+2],o[b+3]=s[b+3])}return new ImageData(o,n,r)}return i},ga=(i,t)=>{const{data:e,width:s,height:n}=i,r=new Uint8ClampedArray(e.length);for(let o=0;o<n;o++)for(let h=0;h<s;h++){const c=(o*s+h)*4;for(let l=0;l<3;l++){const f=c+l;h===0||h===s-1||o===0||o===n-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[c+3]=e[c+3]}return new ImageData(r,s,n)},ya=(i,t)=>{if(i&&i.length===4&&t&&t.length===4){const e=i[3],s=t[3];if(e===255||s===0)return i;if(e===0)return t;{const n=e/255,r=s/255,a=Math.max(Math.min(Math.floor(i[0]*n+t[0]*r*(1-n)),255),0),o=Math.max(Math.min(Math.floor(i[1]*n+t[1]*r*(1-n)),255),0),h=Math.max(Math.min(Math.floor(i[2]*n+t[2]*r*(1-n)),255),0),c=Math.max(Math.min(Math.floor((n+r*(1-n))*255),255),0);return[a,o,h,c]}}return[255,255,255,255]},tn=function(){const i=[];return{writeByte(t){i.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,s=t.length){for(let n=0;n<s;n++)this.writeByte(t[n+e])},writeString(t){for(let e=0,s=t.length;e<s;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return i},toString(){let t="[";for(let e=0,s=i.length;e<s;e++)e>0&&(t+=","),t+=i[e];return t+="]",t}}},wa=function(){let i=0,t=0,e=0,s="";const n=function(a){if(!(a<0)){if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47}throw new Error("n:"+a)},r=function(a){s+=String.fromCharCode(n(a&63))};return{writeByte(a){for(i=i<<8|a&255,t+=8,e+=1;t>=6;)r(i>>>t-6),t-=6},flush(){if(t>0&&(r(i<<6-t),i=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)s+="="}},toString(){return s}}},xa=function(i,t,e){const s=new Array(i*i),n=function(o){const h=o;let c=0,l=0;return{write(f,y){if(f>>>y)throw new Error("length over");for(;c+y>=8;)h.writeByte(255&(f<<c|l)),y-=8-c,f>>>=8-c,l=0,c=0;l=f<<c|l,c=c+y},flush(){c>0&&h.writeByte(l)}}},r=function(o){const h=1<<o,c=(1<<o)+1;let l=o+1;const f=a();for(let _=0;_<h;_++)f.add(String.fromCharCode(_));f.add(String.fromCharCode(h)),f.add(String.fromCharCode(c));const y=tn(),b=n(y);b.write(h,l);let p=0,E=String.fromCharCode(s[p]);for(p+=1;p<s.length;){const _=String.fromCharCode(s[p]);p+=1,f.contains(E+_)?E=E+_:(b.write(f.indexOf(E),l),f.size()<4095&&(f.size()==1<<l&&(l+=1),f.add(E+_)),E=_)}return b.write(f.indexOf(E),l),b.write(c,l),b.flush(),y.toByteArray()},a=function(){const o={};let h=0;return{add(c){if(this.contains(c))throw new Error("dup key:"+c);o[c]=h,h+=1},size(){return h},indexOf(c){return o[c]},contains(c){return typeof o[c]<"u"}}};return{setPixel(o,h,c){s[h*i+o]=c},write(o){o.writeString("GIF87a"),o.writeShort(i),o.writeShort(i),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte(be("0x"+t[1]+t[2])),o.writeByte(be("0x"+t[3]+t[4])),o.writeByte(be("0x"+t[5]+t[6])),o.writeByte(be("0x"+e[1]+e[2])),o.writeByte(be("0x"+e[3]+e[4])),o.writeByte(be("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(i),o.writeShort(i),o.writeByte(0);const h=2,c=r(h);o.writeByte(h);let l=0;for(;c.length-l>255;)o.writeByte(255),o.writeBytes(c,l,255),l+=255;o.writeByte(c.length-l),o.writeBytes(c,l,c.length-l),o.writeByte(0),o.writeString(";")}}},ba=function(i,t,e,s){const n=xa(i,t,e);for(let c=0;c<i;c++)for(let l=0;l<i;l++)n.setPixel(l,c,s(l,c));const r=tn();n.write(r);const a=wa(),o=r.toByteArray();for(let c=0,l=o.length;c<l;c++)a.writeByte(o[c]);a.flush();let h="";return h+="data:image/gif;base64,",h+=a,h},bt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},He={M:0,L:1,H:2,Q:3},ie={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},tt={glog:function(i){if(i<1)throw new Error("glog("+i+")");return tt.LOG_TABLE[i]},gexp:function(i){for(;i<0;)i+=255;for(;i>=256;)i-=255;return tt.EXP_TABLE[i]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let i=0;i<8;i++)tt.EXP_TABLE[i]=1<<i;for(let i=8;i<256;i++)tt.EXP_TABLE[i]=tt.EXP_TABLE[i-4]^tt.EXP_TABLE[i-5]^tt.EXP_TABLE[i-6]^tt.EXP_TABLE[i-8];for(let i=0;i<255;i++)tt.LOG_TABLE[tt.EXP_TABLE[i]]=i;const $={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(i){let t=i<<10;for(;$.getBCHDigit(t)-$.getBCHDigit($.G15)>=0;)t^=$.G15<<$.getBCHDigit(t)-$.getBCHDigit($.G15);return(i<<10|t)^$.G15_MASK},getBCHTypeNumber:function(i){let t=i<<12;for(;$.getBCHDigit(t)-$.getBCHDigit($.G18)>=0;)t^=$.G18<<$.getBCHDigit(t)-$.getBCHDigit($.G18);return i<<12|t},getBCHDigit:function(i){let t=0;for(;i!=0;)t++,i>>>=1;return t},getPatternPosition:function(i){return $.PATTERN_POSITION_TABLE[i-1]},getMask:function(i,t,e){switch(i){case ie.PATTERN000:return(t+e)%2==0;case ie.PATTERN001:return t%2==0;case ie.PATTERN010:return e%3==0;case ie.PATTERN011:return(t+e)%3==0;case ie.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case ie.PATTERN101:return t*e%2+t*e%3==0;case ie.PATTERN110:return(t*e%2+t*e%3)%2==0;case ie.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+i)}},getErrorCorrectPolynomial:function(i){let t=new Te([1],0);for(let e=0;e<i;e++)t=t.multiply(new Te([1,tt.gexp(e)],0));return t},getLengthInBits:function(i,t){if(1<=t&&t<10)switch(i){case bt.MODE_NUMBER:return 10;case bt.MODE_ALPHA_NUM:return 9;case bt.MODE_8BIT_BYTE:return 8;case bt.MODE_KANJI:return 8;default:throw new Error("mode:"+i)}else if(t<27)switch(i){case bt.MODE_NUMBER:return 12;case bt.MODE_ALPHA_NUM:return 11;case bt.MODE_8BIT_BYTE:return 16;case bt.MODE_KANJI:return 10;default:throw new Error("mode:"+i)}else if(t<41)switch(i){case bt.MODE_NUMBER:return 14;case bt.MODE_ALPHA_NUM:return 13;case bt.MODE_8BIT_BYTE:return 16;case bt.MODE_KANJI:return 12;default:throw new Error("mode:"+i)}else throw new Error("type:"+t)},getLostPoint:function(i){const t=i.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++){let o=0;const h=i.isDark(r,a);for(let c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(let l=-1;l<=1;l++)a+l<0||t<=a+l||c==0&&l==0||h==i.isDark(r+c,a+l)&&o++;o>5&&(e+=3+o-5)}for(let r=0;r<t-1;r++)for(let a=0;a<t-1;a++){let o=0;i.isDark(r,a)&&o++,i.isDark(r+1,a)&&o++,i.isDark(r,a+1)&&o++,i.isDark(r+1,a+1)&&o++,(o==0||o==4)&&(e+=3)}for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)i.isDark(r,a)&&!i.isDark(r,a+1)&&i.isDark(r,a+2)&&i.isDark(r,a+3)&&i.isDark(r,a+4)&&!i.isDark(r,a+5)&&i.isDark(r,a+6)&&(e+=40);for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)i.isDark(a,r)&&!i.isDark(a+1,r)&&i.isDark(a+2,r)&&i.isDark(a+3,r)&&i.isDark(a+4,r)&&!i.isDark(a+5,r)&&i.isDark(a+6,r)&&(e+=40);let s=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++)i.isDark(a,r)&&s++;const n=Math.abs(100*s/t/t-50)/5;return e+=n*10,e}};class Te{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let s=0;for(;s<t.length&&t[s]==0;)s++;this.num=new Array(t.length-s+e);for(let n=0;n<t.length-s;n++)this.num[n]=t[n+s]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let s=0;s<this.getLength();s++)for(let n=0;n<t.getLength();n++)e[s+n]^=tt.gexp(tt.glog(this.get(s))+tt.glog(t.get(n)));return new Te(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=tt.glog(this.get(0))-tt.glog(t.get(0)),s=new Array(this.getLength());for(let n=0;n<this.getLength();n++)s[n]=this.get(n);for(let n=0;n<t.getLength();n++)s[n]^=tt.gexp(tt.glog(t.get(n))+e);return new Te(s,0).mod(t)}}class Gt{totalCount;dataCount;constructor(t,e){this.totalCount=t,this.dataCount=e}static RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];static getRSBlocks(t,e){const s=Gt.getRsBlockTable(t,e);if(s==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const n=s.length/3,r=[];for(let a=0;a<n;a++){const o=s[a*3+0],h=s[a*3+1],c=s[a*3+2];for(let l=0;l<o;l++)r.push(new Gt(h,c))}return r}static getRsBlockTable(t,e){switch(e){case He.L:return Gt.RS_BLOCK_TABLE[(t-1)*4+0];case He.M:return Gt.RS_BLOCK_TABLE[(t-1)*4+1];case He.Q:return Gt.RS_BLOCK_TABLE[(t-1)*4+2];case He.H:return Gt.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class va{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 Du{mode;data;constructor(t){this.mode=bt.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 ne{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=He[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new Du(t);this.dataList.push(e),this.dataCache=null}isDark(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]}getModuleCount(){return this.moduleCount}make(){if(this.typeNumber<1){let t=1;for(t=1;t<40;t++){const e=Gt.getRSBlocks(t,this.errorCorrectLevel),s=new va;let n=0;for(let r=0;r<e.length;r++)n+=e[r].dataCount;for(let r=0;r<this.dataList.length;r++){const a=this.dataList[r];s.put(a.mode,4),s.put(a.getLength(),$.getLengthInBits(a.mode,t)),a.write(s)}if(s.getLengthInBits()<=n*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let s=0;s<this.moduleCount;s++){this.modules[s]=new Array(this.moduleCount);for(let n=0;n<this.moduleCount;n++)this.modules[s][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=ne.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let s=-1;s<=7;s++)if(!(t+s<=-1||this.moduleCount<=t+s))for(let n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=s&&s<=6&&(n==0||n==6)||0<=n&&n<=6&&(s==0||s==6)||2<=s&&s<=4&&2<=n&&n<=4?this.modules[t+s][e+n]=!0:this.modules[t+s][e+n]=!1)}getBestMaskPattern(){let t=0,e=0;for(let s=0;s<8;s++){this.makeImpl(!0,s);const n=$.getLostPoint(this);(s==0||t>n)&&(t=n,e=s)}return e}createMovieClip(t,e,s){const n=t.createEmptyMovieClip(e,s),r=1;this.make();for(let a=0;a<this.modules.length;a++){const o=a*r;for(let h=0;h<this.modules[a].length;h++){const c=h*r;this.modules[a][h]&&(n.beginFill(0,100),n.moveTo(c,o),n.lineTo(c+r,o),n.lineTo(c+r,o+r),n.lineTo(c,o+r),n.endFill())}}return n}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=$.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let s=0;s<t.length;s++){const n=t[e],r=t[s];if(this.modules[n][r]==null)for(let a=-2;a<=2;a++)for(let o=-2;o<=2;o++)a==-2||a==2||o==-2||o==2||a==0&&o==0?this.modules[n+a][r+o]=!0:this.modules[n+a][r+o]=!1}}setupTypeNumber(t){const e=$.getBCHTypeNumber(this.typeNumber);for(let s=0;s<18;s++){const n=!t&&(e>>s&1)==1;this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=n}for(let s=0;s<18;s++){const n=!t&&(e>>s&1)==1;this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=n}}setupTypeInfo(t,e){const s=this.errorCorrectLevel<<3|e,n=$.getBCHTypeInfo(s);for(let r=0;r<15;r++){const a=!t&&(n>>r&1)==1;r<6?this.modules[r][8]=a:r<8?this.modules[r+1][8]=a:this.modules[this.moduleCount-15+r][8]=a}for(let r=0;r<15;r++){const a=!t&&(n>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=a:r<9?this.modules[8][15-r-1+1]=a:this.modules[8][15-r-1]=a}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let s=-1,n=this.moduleCount-1,r=7,a=0;for(let o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(let h=0;h<2;h++)if(this.modules[n][o-h]==null){let c=!1;a<t.length&&(c=(t[a]>>>r&1)==1),$.getMask(e,n,o-h)&&(c=!c),this.modules[n][o-h]=c,r--,r==-1&&(a++,r=7)}if(n+=s,n<0||this.moduleCount<=n){n-=s,s=-s;break}}}static createData(t,e,s){const n=Gt.getRSBlocks(t,e),r=new va;for(let o=0;o<s.length;o++){const h=s[o];r.put(h.mode,4),r.put(h.getLength(),$.getLengthInBits(h.mode,t)),h.write(r)}let a=0;for(let o=0;o<n.length;o++)a+=n[o].dataCount;if(r.getLengthInBits()>a*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+a*8+")");for(r.getLengthInBits()+4<=a*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=a*8||(r.put(ne.PAD0,8),r.getLengthInBits()>=a*8));)r.put(ne.PAD1,8);return ne.createBytes(r,n)}static createBytes(t,e){let s=0,n=0,r=0;const a=new Array(e.length),o=new Array(e.length);for(let f=0;f<e.length;f++){const y=e[f].dataCount,b=e[f].totalCount-y;n=Math.max(n,y),r=Math.max(r,b),a[f]=new Array(y);for(let v=0;v<a[f].length;v++)a[f][v]=255&t.buffer[v+s];s+=y;const p=$.getErrorCorrectPolynomial(b),_=new Te(a[f],p.getLength()-1).mod(p);o[f]=new Array(p.getLength()-1);for(let v=0;v<o[f].length;v++){const x=v+_.getLength()-o[f].length;o[f][v]=x>=0?_.get(x):0}}let h=0;for(let f=0;f<e.length;f++)h+=e[f].totalCount;const c=new Array(h);let l=0;for(let f=0;f<n;f++)for(let y=0;y<e.length;y++)f<a[y].length&&(c[l++]=a[y][f]);for(let f=0;f<r;f++)for(let y=0;y<e.length;y++)f<o[y].length&&(c[l++]=o[y][f]);return c}}const Sa=Math.ceil,qe=Math.floor,Ca=Math.round;function Iu(i,t){const e=Sn(i),s=t?.ecc||"H",n=t?.size||256,r=-1,a=t?.padding||0,o=t?.color||"#000000",h=t?.background||"#ffffff",c=new ne(r,s);c.addData(e),c.make();const l=c.getModuleCount(),f=(n-a*2)/l,y=a,b=n-a;return ba(n,o,h,function(p,E){if(y<=p&&p<b&&y<=E&&E<b){const _=qe((p-y)/f),v=qe((E-y)/f);return c.isDark(v,_)?0:1}else return 1})}function Mu(i,t){const e=t.x||0,s=t.y||0,n=Sn(i),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?qe(t.size):256,h=t.padding||0,c=-1,l=t.color||"#000000",f=t.background||"#ffffff",y=new ne(c,a);y.addData(n),y.make();const b=y.getModuleCount(),p=(o-h*2)/b;r.fillStyle=f,r.fillRect(e,s,o,o);for(let E=0;E<b;E++)for(let _=0;_<b;_++){const v=Sa((_+1)*p)-qe(_*p),x=Sa((E+1)*p)-qe(E*p);r.fillStyle=y.isDark(E,_)?l:f,r.fillRect(e+Ca(_*p)+h,s+Ca(E*p)+h,v,x)}}class rt extends H{shapesCountChange=!1;constructor(t){super(t)}shapeInit(){}frameStart(t){return this.shapesCountChange&&(this.shapesCountChange=!1,this.shapes.forEach(e=>{e.parent=this,e.initPathD()}),this.pathd=this.initPathD(),this.shapes.forEach(e=>{!e.forceCXY&&!e.independentTransformInGroup&&(e.cX=this.cX-e.diffXInGroup,e.cY=this.cY-e.diffYInGroup)})),super.frameStart(t)}frameUpdate(t,e){this.shapes.forEach(s=>{!s.independentTransformInGroup&&!s.isDragging&&(s.x=this.x+s.diffXInGroup,s.y=this.y+s.diffYInGroup,s.degree=this.degree+s.diffDegreeInGroup,s.scalarX=this.scalarX*s.diffScalarXInGroup,s.scalarY=this.scalarY*s.diffScalarYInGroup)}),super.frameUpdate(t,e)}addShape(t){(Array.isArray(t)?t:[t]).forEach(e=>{this.shapes.findIndex(s=>s.id==e.id)==-1&&(e.on("draging",(s,n)=>{this.enableDrag&&(this.x+=s,this.y+=n,this.emit("draging",s,n,e))}),this.shapes.push(e),this.shapesCountChange=!0)})}getBoundingClientRect(){const t=[],e=[];this.shapes.forEach(h=>{const c=h.getBoundingClientRect();c&&(t.push(c.x,c.x+c.width),e.push(c.y,c.y+c.height))});const s=this.pathd?.getBoundingClientRect();if(s&&(s.width||s.height)&&(t.push(s.x,s.x+s.width),e.push(s.y,s.y+s.height)),t.length==0||e.length==0)return null;const n=Math.min.apply(0,t),r=Math.min.apply(0,e),a=Math.max.apply(0,t),o=Math.max.apply(0,e);return{x:n,y:r,width:a-n,height:o-r}}setAttrs(t,e){typeof t!="string"?(super.setAttr(t),this.shapes.forEach(s=>{s.setAttr(t)})):e&&(super.setAttr(t,e),this.shapes.forEach(s=>{s.setAttr(t,e)}))}sortPathD(){this.shapes=this.shapes.map(t=>{const e=t.initPathD();return{shape:t,perimeter:e.perimeterPoints()}}).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.shape)}expendFill(t){const e=t.shapes.length,s=this.shapes.length;if(e<s)return t.expendFill(this);for(let n=s;n<e;n++){const a=t.shapes[n].initPathD().polymorphPoints,o=a[0],h=a[1],c=[["M",o,h]];for(let l=2;l+5<a.length;l+=6)c.push(["C",o,h,o,h,o,h]);this.addShape(new H({attrs:{...t.shapes[n].getAttrs()},d:c}))}}strokeDashTween(t,e){switch(e?.type){case"sequence":const s=this.shapes.length-1;this.shapes.forEach((o,h)=>{o.strokeDashTween(t,{...e,delay:h,onStart:()=>{h==0&&e?.onGroupStart?.()},onUpdate:()=>{e?.onGroupUpdate?.()},onComplete:()=>{h==s&&e?.onGroupComplete?.()}})});break;case"parallel":default:const n=new Es({frameDuration:t}),r={},a={};this.shapes.forEach((o,h)=>{const c=It(o.getTotalLength(),0);r[`offset_${h}`]=c,a[`offset_${h}`]=0,o.setAttr({strokeDasharray:`${c} ${c}`,strokeDashoffset:`${c}`})}),n.addTween(r,a,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(o,h)=>{for(let c in o){const l=ei(c).number;this.shapes[l].setAttr("strokeDashoffset",""+It(o[c],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),n.play();break}}}class me extends H{toX;toY;constructor(t){super(t),this.toX=t?.toX||0,this.toY=t?.toY||0;let e=this.toX-this.x,s=this.toY-this.y;return new Proxy(this,{set(n,r,a,o){switch(r){case"x":n.toX=a+e;break;case"y":n.toY=a+s;break;case"toX":e=a-n.x;break;case"toY":s=a-n.y;break}return Reflect.set(n,r,a,o)}})}toSVGPathData(){return[["m",0,0],["l",this.toX-this.x,this.toY-this.y]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.lineTo(this.toX-this.x,this.toY-this.y)}intersection(t){const e=new Jr({x:this.x,y:this.y,toX:this.toX,toY:this.toY}),s=new Jr({x:t.x,y:t.y,toX:t.toX,toY:t.toY});return e.intersection(s)}}class ku extends H{cx;cy;toX;toY;isLineThrough;constructor(t){super(t),this.cx=t?.cx||0,this.cy=t?.cy||0,this.toX=t?.toX||0,this.toY=t?.toY||0,this.isLineThrough=typeof t?.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["m",0,0],["q",t-this.x,e-this.y,this.toX-this.x,this.toY-this.y]]}else return[["m",0,0],["q",this.cx-this.x,this.cy-this.y,this.toX-this.x,this.toY-this.y]]}toCanvasContext(t){if(t.beginPath(),t.moveTo(0,0),this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e-this.x,s-this.y,this.toX-this.x,this.toY-this.y)}else t.quadraticCurveTo(this.cx-this.x,this.cy-this.y,this.toX-this.x,this.toY-this.y)}}class Ta extends ha{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=xo(e);for(let n of s.stylesheet.rules)for(let r of n.declarations)for(let a of n.selectors)this.globalStyles[a]=this.globalStyles[a]||[],this.globalStyles[a].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,s)=>{let n=this.groups.length;for(;n--;)if(this.groups[n]!=this.currentItem){let r="",a="";for(let o in this.groups[n])o=="transform"?r=this.groups[n].transform:o=="class"&&this.globalStyles["."+this.groups[n][o]]?a=this.globalStyles["."+this.groups[n][o]].join(";")+";"+a:o=="id"&&this.globalStyles["#"+this.groups[n][o]]?a=this.globalStyles["#"+this.groups[n][o]].join(";")+";"+a:typeof this.currentItem[o]>"u"&&(this.currentItem[o]=this.groups[n][o]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=a:this.currentItem.style=a+this.currentItem.style,this.currentItem.class&&this.globalStyles["."+this.currentItem.class]?this.currentItem.style=this.globalStyles["."+this.currentItem.class].join(";")+";"+this.currentItem.style:this.currentItem.id&&this.globalStyles["#"+this.currentItem.id]&&(this.currentItem.style=this.globalStyles["#"+this.currentItem.id].join(";")+";"+this.currentItem.style),sn(this.currentItem.style,this.currentItem,nn)}switch(this.processAttrs(e,s),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let s=[],n;switch(t){case"svg":let r="",a="";if(e.width&&e.height)r=e.width,a=e.height;else if(e.viewBox){const o=e.viewBox.split(/\s+/gi);o.length==4&&(r=String(parseFloat(o[2])-parseFloat(o[0])),a=String(parseFloat(o[3])-parseFloat(o[1])))}r&&a&&this.items.push({type:"viewbox",width:r,height:a});break;case"line":typeof e.x1=="number"&&typeof e.y1=="number"&&typeof e.x2=="number"&&typeof e.y2=="number"&&(this.currentItem.path="M"+[e.x1,e.y1,e.x2,e.y2]);break;case"stop":n={},e.style&&sn(e.style,n),n.offset=n.offset||e.offset,n.color=n["stop-color"]||e["stop-color"],n.opacity=n["stop-opacity"]||e["stop-opacity"],~(n.offset+"").indexOf("%")?n.offset=parseFloat(n.offset):n.offset=parseFloat(n.offset)*100,n.offset=+n.offset.toFixed(2),this.grad.stops.push(n);break;case"linearGradient":this.grad.angle=(360+en(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),s=[this.grad.angle];for(let o=0,h=this.grad.stops.length;o<h;o++)n=this.grad.stops[o],o&&o!=h-1?s.push(n.color+":"+n.offset):s.push(n.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break;case"radialGradient":s=[];for(let o=0,h=this.grad.stops.length;o<h;o++)n=this.grad.stops[o],o&&o!=h-1?s.push(n.color+":"+n.offset):s.push(n.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break}for(let r in e){const a=e[r];if(nn.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"&&sn(a,this.currentItem,nn),r==="transform"&&(this.currentItem.transform=a+(this.currentItem.transform||" ")),r==="fill"){const o=a.match(/url\(#([^)]+)\)/);if(o){const h=o[1];this.currentItem.fillid=h,this.idtops[h]&&(this.currentItem.fill=this.idtops[h])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+a+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=a),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=a)}}addToItems(){this.items.push(this.currentItem)}}function en(i,t,e,s,n,r){if(typeof n>"u"||typeof r>"u"){const a=i-e,o=t-s;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return en(i,t,n,r)-en(e,s,n,r)}function sn(i,t,e){const s=(i+"").split(";"),n=/^\s+|\s+$/g;for(let r=0,a=s.length;r<a;r++){let o=s[r].split(":"),h=o[0].replace(n,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=o[1].replace(n,""))}}const nn=["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 Lu{app;rootEl;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e,s){this.app=t,this.rootEl=wt.createSVGElement("svg"),L.empty(this.app.container),L.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.captureDrag({start:()=>{this.isMouseDown=!0,this.dragDx=0,this.dragDy=0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.dragDx=0,this.dragDy=0,this.setCursor()},move:(n,r)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=r.dx,this.dragDy+=r.dy),this.setCursor()}}),this.app.on("tap",()=>{for(const n of this.shapes)if(this.currentMouseInShape==n){n.emit("clicked");let r=n.parent;for(;r;)r.emit("clicked",n),r=r.parent;break}})}setCursor(){this.currentEnableDragMouseInShape?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShape?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}setSize(t,e){return le(this.rootEl,{viewBox:`0 0 ${t} ${e}`,width:`${t}`,height:`${e}`}),this}download(){return wt.downloadFromSVGElement(this.rootEl)}_addDrawShape(t){this.shapes.findIndex(e=>e.id==t.id)===-1&&(this.shapes.push(t),t instanceof rt&&t.shapes.forEach(e=>{this._addDrawShape(e)}))}path(t){(Array.isArray(t)?t:[t]).forEach(e=>{this._addDrawShape(e)}),this.isMouseDown&&this.currentEnableDragMouseInShape||(this.currentMouseInShape=void 0);for(const e of this.shapes){if(!e.isShow){e.el&&(L.remove(e.el),delete e.el);continue}if(e.frameStart(this.app.mousePoint),e.el||(e instanceof je?e.el=this.text(e.text,e.x,e.y,Tn(e.getAttrs(),(n,r)=>typeof r=="string")):(e.el=wt.createSvgPath(e.toSVGPathD(),e.id),L.insert(this.rootEl,e.el))),e.followMouse&&(!ns(e.x,this.app.mousePoint.x,5)||!ns(e.y,this.app.mousePoint.y,5))&&e.followTo(this.app.mousePoint),e.targetToAfterDragFree&&(this.isMouseDown||e.runEaseTo({x:e.targetToAfterDragFree.targetX,y:e.targetToAfterDragFree.targetY},{easing:e.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShape==e){e.isDragging=!0;const n=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,n||r){if(e.x+=n,e.y+=r,e.alongPath){const a=e.alongPath.closestPoint(e.x,e.y);e.x=a.point.x-e.cX,e.y=a.point.y-e.cY}e.emit("draging",n,r)}}else e.isDragging=!1;e instanceof je&&(e.setAttr("x",String(e.x)),e.setAttr("y",String(e.y))),e.frameUpdate(this.app.mousePoint);const s=e.toSVGPathD();if(this.attr(e,Tn(e.getAttrs(),(n,r)=>typeof r=="string")),this.attr(e,"d",s),!this.currentMouseInShape){const n=e.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||e.isPointInStroke(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||!1;e.isMouseIn=n,n&&(this.currentMouseInShape=e,e.enableDrag&&(this.currentEnableDragMouseInShape=e))}e.frameEnd(this.app.mousePoint)}this.currentMouseInShape||(this.currentEnableDragMouseInShape=void 0)}delete(t){(Array.isArray(t)?t:[t]).forEach(e=>{e.el&&L.remove(e.el),delete e.el,this.shapes=this.shapes.filter(s=>s.id!==e.id)})}clear(){this.shapes.forEach(t=>{t.el&&L.remove(t.el),delete t.el}),L.empty(this.rootEl),this.shapes=[]}attr(t,e,s){const n=t.el||t;return n instanceof SVGElement?e===void 0&&s===void 0?le(n):typeof e=="string"&&s===void 0?le(n,ot(e))||"":(typeof e=="object"?le(n,e):typeof e=="string"&&s!==void 0&&le(n,ot(e),s),this):this}circle(t,e,s){return this.path(new zt({x:t,y:e,radius:s}))}circleEl(t,e,s){const n=wt.createSVGElement("circle",{cx:String(t),cy:String(e),r:String(s)});return L.insert(this.rootEl,n),n}ellipse(t,e,s,n){return this.path(new Ea({x:t,y:e,rx:s,ry:n}))}ellipseEl(t,e,s,n){const r=wt.createSVGElement("ellipse",{cx:String(t),cy:String(e),rx:String(s),ry:String(n)});return L.insert(this.rootEl,r),r}rect(t,e,s,n){return this.path(new Ht({x:t,y:e,width:s,height:n}))}rectEl(t,e,s,n){const r=wt.createSVGElement("rect",{x:String(t),y:String(e),width:String(s),height:String(n)});return L.insert(this.rootEl,r),r}image(t,e,s,n,r){}text(t,e,s,n){const r=wt.createSVGElement("text",{x:String(e),y:String(s)});return L.html(r,t),this.attr(r,Object.assign({"alignment-baseline":"middle"},n)),L.insert(this.rootEl,r),r}textWithTspan(t,e,s,n){const r=n?.["line-height"]||"1.2em",a=wt.createSVGElement("text",{x:String(e),y:String(s)});return t.split(`
|
|
41
|
-
`).forEach((o,h)=>{if(o.trim()){const c=wt.createSVGElement("tspan",{x:String(e),dy:h>0?r:"0"});L.html(c,o),L.insert(a,c),this.attr(c,Object.assign({"alignment-baseline":"middle"},n))}}),L.insert(this.rootEl,a),a}}class Ru extends rt{svgWidth=0;svgHeight=0;width=0;height=0;constructor(t){super(t);const e=new Ta(t.svg).parse();for(let s=0,n=e.length;s<n;s++){const r=e[s];if(r.type=="viewbox"&&r.width&&r.height){if(this.svgWidth=parseFloat(r.width),this.svgHeight=parseFloat(r.height),t.width){const l=this.svgWidth/this.svgHeight;this.width=t.width,this.height=this.width/l}else this.width=this.svgWidth,this.height=this.svgHeight;continue}if(r.type!="path"||!fe.isSVGPath(r.path))continue;const a={};for(const l in r)l==="type"||l==="path"||l==="transform"||(a[l]=r[l]);const o=fe.absolutizeSVGPath(fe.parseSVGPath(r.path)),h=[];let c=[];for(let l=0,f=o.length;l<f;l++){const y=o[l];c.push(y),y[0].toLowerCase()=="z"&&(h.push(c),c=[])}c.length&&h.push(c),h.forEach(l=>{const f=ji(r.transform??"");f.scale(this.width&&this.svgWidth?this.width/this.svgWidth:1),this.addShape(new H({...t,attrs:{...a,...t?.attrs||{}},d:l,originMatrix:f}))})}}shapeInit(){this.trim()}}class zt extends H{radius;constructor(t){super(t),this.radius=t?.radius||0}getBoundingClientRect(){return{x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2}}toSVGPathData(){return this.radius?[["m",0,-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",0,0]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.radius===t.radius&&this.mass===t.mass}midPointBtw(t){return{x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2}}length(){return Ms(this.x,this.y)}scalar(t){return this.x*=t,this.y*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y;return{x:s*t.x-e*t.y,y:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y}}div(t){return{x:this.x/t.x,y:this.y/t.y}}add(t){return{x:this.x+t.x,y:this.y+t.y}}sub(t){return{x:this.x-t.x,y:this.y-t.y}}dot(t){return this.x*t.x+this.y*t.y}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y}}checkCollision(t){const e=t.x-this.x,s=t.y-this.y;if(Math.sqrt(e*e+s*s)<this.radius+t.radius){const r=Math.atan2(s,e),a={x:0,y:0},o=Et(-r,e,s),h=Et(-r,this.vx,this.vy),c=Et(-r,t.vx,t.vy),l=h.x-c.x;h.x=((this.mass-t.mass)*h.x+2*t.mass*c.x)/(this.mass+t.mass),c.x=l+h.x;const f=Math.abs(h.x)+Math.abs(c.x),y=this.radius+t.radius-Math.abs(a.x-o.x);a.x+=h.x/f*y,o.x+=c.x/f*y;const b=Et(r,a.x,a.y),p=Et(r,o.x,o.y);t.x=this.x+p.x,t.y=this.y+p.y,this.x=this.x+b.x,this.y=this.y+b.y;const E=Et(r,h.x,h.y),_=Et(r,c.x,c.y);this.vx=E.x,this.vy=E.y,t.vx=_.x,t.vy=_.y}}checkWall(t){const e=typeof t?.bounce=="number"?t.bounce:-1,s=t.wall.x,n=t.wall.y,r=t.wall.x+t.wall.width,a=t.wall.y+t.wall.height;this.x+this.radius>r?(this.x=r-this.radius,this.vx*=e):this.x-this.radius<s&&(this.x=s+this.radius,this.vx*=e),this.y+this.radius>a?(this.y=a-this.radius,this.vy*=e):this.y-this.radius<n&&(this.y=n+this.radius,this.vy*=e)}}class Pa extends H{points;isStraight;constructor(t){if(super(t),this.points=t.points,this.points.length<3)throw new Error("points length must >= 3");this.isStraight=typeof t?.isStraight=="boolean"?t.isStraight:!0}toSVGPathData(){const t=[],e=this.points.length;if(this.isStraight){t.push(["M",this.points[0].x,this.points[0].y]);for(let s=1;s<=e-1;s++)t.push(["L",this.points[s].x,this.points[s].y]);t.push(["Z"])}else{const s=(this.points[0].x+this.points[e-1].x)/2,n=(this.points[0].y+this.points[e-1].y)/2;t.push(["M",s,n]);for(let r=0;r<e-1;r++){const a=(this.points[r].x+this.points[r+1].x)/2,o=(this.points[r].y+this.points[r+1].y)/2;t.push(["Q",this.points[r].x,this.points[r].y,a,o])}t.push(["Q",this.points[e-1].x,this.points[e-1].y,s,n])}return t}toCanvasContext(t){t.beginPath();const e=this.points.length;if(this.isStraight){t.moveTo(this.points[0].x,this.points[0].y);for(let s=1;s<=e-1;s++)t.lineTo(this.points[s].x,this.points[s].y);t.closePath()}else{const s=(this.points[0].x+this.points[e-1].x)/2,n=(this.points[0].y+this.points[e-1].y)/2;t.moveTo(s,n);for(let r=0;r<e-1;r++){const a=(this.points[r].x+this.points[r+1].x)/2,o=(this.points[r].y+this.points[r+1].y)/2;t.quadraticCurveTo(this.points[r].x,this.points[r].y,a,o)}t.quadraticCurveTo(this.points[e-1].x,this.points[e-1].y,s,n)}}isContainPoint(t,e){const s=this.points.length;let n=!1;const r=2e-10;for(let a=0,o=s-1;a<s;o=a,a++){const h=this.points[a].x,c=this.points[a].y,l=this.points[o].x,f=this.points[o].y;if(h===t&&c===e||l===t&&f===e||e===c&&e===f)return!0;if(e>=c&&e<f||e<c&&e>=f){const y=(l-h)/(f-c),b=h+y*(e-c);if(b===t||Math.abs(b-t)<r)return!0;b>t&&(n=!n)}}return n}[Symbol.iterator](){let t=-1;return{next:()=>({value:t<=this.points.length-1?this.points[++t]:void 0,done:t>=this.points.length})}}}class Ht extends H{width;height;borderRadius;constructor(t){super(t),this.width=t.width,this.height=t.height,this.borderRadius=t.borderRadius||0}static fromCubicBezier(t,e,s,n,r,a,o,h){const c=new dt({x:t,y:e,c1x:s,c1y:n,c2x:r,c2y:a,toX:o,toY:h});return new Ht(c.getBoundingClientRect())}getBoundingClientRect(){return{x:this.x,y:this.y,width:this.width,height:this.height}}toSVGPathData(){return this.borderRadius?[["m",this.borderRadius,0],["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",0,0],["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}}class Ea extends H{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}getBoundingClientRect(){return{x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2}}toSVGPathData(){return[["m",0,-this.ry],["a",this.rx,this.ry,0,1,1,0,2*this.ry],["a",this.rx,this.ry,0,1,1,0,-2*this.ry],["z"]]}toCanvasContext(t){t.beginPath(),t.ellipse(0,0,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class Ou extends H{constructor(t){super(t)}toSVGPathData(){return[["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 Fu extends H{constructor(t){super(t)}toSVGPathData(){return[["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 Nu extends H{rx;ry;constructor(t){super(t),this.rx=t?.rx||10,this.ry=t?.ry||10}toSVGPathData(){return[["m",0,0],["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 Bu extends H{rx;ry;constructor(t){super(t),this.rx=t?.rx??50,this.ry=t?.ry??50}toSVGPathData(){return[["m",0,0+this.ry*.3],["C",0,0,0-this.rx/2,0,0-this.rx/2,0+this.ry*.3],["C",0-this.rx/2,0+(this.ry+this.ry*.3)/2,0,0+(this.ry+this.ry*.3)/1.4,0,0+this.ry],["C",0,0+(this.ry+this.ry*.3)/1.8,0+this.rx/2,0+(this.ry+this.ry*.3)/2,0+this.rx/2,0+this.ry*.3],["C",0+this.rx/2,0,0,0,0,0+this.ry*.3],["z"]]}}class Yu extends H{r;constructor(t){super(t),this.r=t?.r||20}toSVGPathData(){const t=[["m",0,-this.r]];for(let e=0;e<6;e+=1){const s=288+e*144,n=this.r*Math.cos(N(s)),r=this.r*Math.sin(N(s));t.push(["l",n,r])}return t}}class Uu extends H{constructor(t){super(t)}toSVGPathData(){return[["M",0,0],["C",15,0,15,-40,5,-30],["L",0,0],["C",-15,0,-15,-40,-5,-30],["L",0,0],["a",15,15,0,1,1,0,2*15],["a",15,15,0,1,1,0,-2*15]]}}class Xu extends H{constructor(t){super(t),this.originD="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 Vu extends rt{constructor(t){super(t);const e=new me({...t,x:this.x,y:this.y,toX:this.x,toY:this.y-140-Math.random()*20}),s=30+Math.random()*30,n=new me({...t,x:this.x,y:this.y-s,diffYInGroup:-s,toX:this.x+Math.random()*80-40,toY:this.y-100-Math.random()*40}),r=60+Math.random()*40,a=new me({...t,x:this.x,y:this.y-r,diffYInGroup:-r,toX:this.x+Math.random()*60-30,toY:this.y-110-Math.random()*20});this.addShape([e,n,a])}}class je extends H{text;width=0;height=0;constructor(t){super(t),this.text=t.text,this.setAttr({fontSize:"10px",fontFamily:'system-ui, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',emojiFontFamily:'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif',fill:"#666666",stroke:"none","alignment-baseline":"middle",textAnchor:"start",...this.getAttrs()});const e=ei(this.getAttr("fontSize"),10).number,s=ei(this.getAttr("fontWeight"),400).number,n=L.measureText(this.text,e,s);this.width=n.width,this.height=n.height}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){t.fillText(this.text,0,0)}}class _a extends rt{text;bg;padding;offset;isShow;textShape;bgShape;constructor(t){super(t),this.text=t.text,this.bg=t.bg||"rgba(0,0,0,0.5)",this.padding=t.padding||4,this.offset=t.offset||20,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!1,this.textShape=new je({...t,x:this.x+this.offset,y:this.y+this.offset,text:this.text,attrs:{...this.getAttrs(),fill:ze(this.bg).opposite(!0).toString(),textAnchor:"start"}}),this.bgShape=new Ht({...t,x:this.textShape.x-this.padding,y:this.textShape.y-this.textShape.height/2-this.padding,width:this.textShape.width+this.padding*2,height:this.textShape.height+this.padding*2,attrs:{...this.getAttrs(),fill:this.bg}}),this.addShape([this.bgShape,this.textShape])}shapeInit(){gt(()=>{this.textShape.x=this.x+this.offset,this.textShape.y=this.y+this.offset,this.textShape.text=this.text,this.textShape.isShow=this.isShow,this.bgShape.x=this.textShape.x-this.padding,this.bgShape.y=this.textShape.y-this.textShape.height/2-this.padding,this.bgShape.width=this.textShape.width+this.padding*2,this.bgShape.height=this.textShape.height+this.padding*2,this.bgShape.isShow=this.isShow})}}class Gu extends rt{radius;expandRaidus;startDegree;endDegree;text="";defaultShowText;tip="";p1=new zt;p1Offset=10;p2=new zt;p2Offset=40;p3=new zt;p3Offset=10;p4=new zt;p4Offset=10;direction=1;sectorArc;line12;line23;textShape;tipShape;constructor(t){super(t),this.radius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.text=t.text||"",this.defaultShowText=typeof t?.defaultShowText=="boolean"?t.defaultShowText:!!this.text,this.tip=t.tip||"",this.sectorArc=new Aa({x:this.x,y:this.y,radius:this.radius,expandRaidus:this.expandRaidus,startDegree:this.startDegree,endDegree:this.endDegree,attrs:Object.assign({...this.getAttrs()},{strokeWidth:"0"})}),this.addShape(this.sectorArc);const e=Object.assign({...this.getAttrs()},{fill:"none"});this.line12=new me({x:this.p1.x,y:this.p1.y,toX:this.p2.x,toY:this.p2.y,attrs:{...e},isShow:this.defaultShowText}),this.line23=new me({x:this.p2.x,y:this.p2.y,toX:this.p3.x,toY:this.p3.y,attrs:{...e},isShow:this.defaultShowText}),this.textShape=new je({x:this.p4.x,y:this.p4.y,text:this.text,attrs:{stroke:e.stroke,textAnchor:this.direction==1?"start":"end"},isShow:this.defaultShowText}),this.text&&(this.addShape(this.line12),this.addShape(this.line23),this.addShape(this.textShape)),this.tipShape=new _a({x:0,y:0,text:this.tip,isShow:!1}),this.tip&&this.addShape(this.tipShape)}frameUpdate(t){this.text&&!this.defaultShowText&&(this.line12.isShow=this.sectorArc.isMouseIn,this.line23.isShow=this.sectorArc.isMouseIn,this.textShape.isShow=this.sectorArc.isMouseIn);const e=this.startDegree+(this.endDegree-this.startDegree)/2,{dx:s,dy:n}=Rt(N(e),this.sectorArc.radius+this.p1Offset);this.p1.x=this.x+s,this.p1.y=this.y+n;const{dx:r,dy:a}=Rt(N(e),this.sectorArc.radius+this.p1Offset+this.p2Offset);this.p2.x=this.x+r,this.p2.y=this.y+a,this.line12.x=this.p1.x,this.line12.y=this.p1.y,this.line12.toX=this.p2.x,this.line12.toY=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.x=this.p2.x,this.line23.y=this.p2.y,this.line23.toX=this.p3.x,this.line23.toY=this.p3.y,this.textShape.x=this.p4.x,this.textShape.y=this.p4.y,this.textShape.setAttr("textAnchor",this.direction==1?"start":"end"),this.sectorArc.isMouseIn?(this.tipShape.isShow=!0,this.tipShape.x=t.x,this.tipShape.y=t.y):(this.tipShape.isShow=!1,this.tipShape.x=t.x,this.tipShape.y=t.y)}}class Aa extends H{radius;realRadius;expandRaidus;startDegree;endDegree;vr;ar;bounce;durationTime;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.durationTime=1e3/120,this.status=0}frameUpdate(){this.status==0&&this.radius<this.realRadius?(this.expand(this.realRadius),this.radius>=this.realRadius&&(this.status=1)):this.isMouseIn?this.expand(this.realRadius+this.expandRaidus):this.shrink(this.realRadius)}expand(t){this.vr+=this.ar,this.radius+=this.vr*this.durationTime,this.radius>t&&(this.radius=t,this.vr*=-this.bounce)}shrink(t){this.vr-=this.ar,this.radius+=this.vr*this.durationTime,this.radius<t&&(this.radius=t,this.vr*=-this.bounce)}toSVGPathData(){const{dx:t,dy:e}=Rt(N(this.startDegree),this.radius),{dx:s,dy:n}=Rt(N(this.endDegree),this.radius);return[["m",0,0],["l",t,e],["a",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,s-t,n-e],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.arc(0,0,this.radius,N(this.startDegree),N(this.endDegree),!1),t.closePath()}containPoint(t,e){const s=ks(this.x,this.y,t,e),n=nt(se(this.x,this.y,t,e));return s<=this.radius&&n>=this.startDegree&&n<=this.endDegree}}class zu extends rt{showFlame;ship;flame;constructor(t){super(t),this.showFlame=typeof t?.showFlame=="boolean"?t.showFlame:!1,this.ship=new H({...t,d:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]]}),this.addShape(this.ship),this.flame=new H({...t,isShow:this.showFlame,d:[["m",-10,-5],["l",-7.5,5],["l",7.5,5],["z"]]}),this.addShape(this.flame)}shapeInit(){gt(()=>{this.ship.x=this.x,this.ship.y=this.y,this.flame.x=this.x,this.flame.y=this.y,this.flame.isShow=this.showFlame})}}class Hu extends rt{value;backgroundRect;occupyRect;handle;constructor(t){super(t);const e=t?.min||0,s=t?.max||100,n=t?.step||1,r=no(e,s,n);this.value=r(typeof t?.defaultValue=="number"?j(t.defaultValue,e,s):e);const a=this.value/(s-e),o=t?.barWidth||100,h=t?.barHeight||4,c=t?.handleRadius||10,l=h*.5,f=t?.barColor||Wi.colorGrayF5,y=t?.handleColor||Wi.colorPrimary;this.backgroundRect=new Ht({x:this.x,y:this.y,width:o,height:h,borderRadius:l,attrs:{fill:f},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.backgroundRect),this.occupyRect=new Ht({x:this.x,y:this.y,width:o*a,height:h,borderRadius:l,attrs:{fill:y},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.occupyRect),this.handle=new zt({x:this.x+o*a,y:this.y+l,diffXInGroup:o*a,diffYInGroup:l,radius:c,alongPath:new yl({x:this.x,y:this.y+l,d:[["m",0,0],["l",o,0]]}),attrs:{fill:y},enableDrag:!0,independentTransformInGroup:!0}),this.addShape(this.handle),this.handle.on("draging",b=>{this.occupyRect.width=j(this.occupyRect.width+b,0,o),this.value=r((this.handle.x-this.x)/o*(s-e)+e),this.emit("change",this.value)})}}class qu extends rt{width;height;cornerRadius;controlPoint;mainRect;rightPoint;constructor(t){super(t),this.width=t.width,this.height=t.height,this.cornerRadius=this.height/2,this.controlPoint=new zt({...t,x:this.x,y:this.y,radius:2}),this.forceSetCXY(this.controlPoint.cX,this.controlPoint.cY),this.mainRect=new Ht({...t,x:this.x-this.cornerRadius,y:this.y-this.cornerRadius,diffXInGroup:-this.cornerRadius,diffYInGroup:-this.cornerRadius,width:this.width+this.cornerRadius*2,height:this.height,borderRadius:this.cornerRadius}),this.rightPoint=new zt({...t,x:this.x+this.width,y:this.y,diffXInGroup:this.width,radius:2}),this.addShape([this.mainRect,this.controlPoint,this.rightPoint])}getPin(){return{x:this.controlPoint.x+Math.cos(N(this.controlPoint.degree))*this.width,y:this.controlPoint.y+Math.sin(N(this.controlPoint.degree))*this.width}}}class rn extends H{extendDegree;radius;startDegree;endDegree;diffDegree;constructor(t){super(t),this.extendDegree=t?.extendDegree||0,this.x=(t.x||0)+t.width/2;const e=Math.min(t.width/2,t.height)-t.lineWidth;this.radius=e-e*Math.abs(Math.sin(N(this.extendDegree))),this.y=(t.y||0)+t.height-t.lineWidth-this.radius*Math.abs(Math.sin(N(this.extendDegree))),this.diffDegree=t.endDegree-t.startDegree,this.startDegree=180+t.startDegree-this.extendDegree,this.endDegree=180+t.endDegree+this.extendDegree,this.setAttr({"stroke-linecap":"round","stroke-width":String(t.lineWidth),stroke:t.color||"none"})}setPercent(t){this.endDegree=this.startDegree+(this.diffDegree+this.extendDegree*2)*t}toSVGPathData(){const{dx:t,dy:e}=Rt(N(this.startDegree),this.radius),{dx:s,dy:n}=Rt(N(this.endDegree),this.radius);return[["m",t,e],["a",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,s-t,n-e]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,N(this.startDegree),N(this.endDegree),!1)}}class ju extends rt{percent=0;ringBg;ring;lines=[];bgColor;startColor;endColor;indicatorLineCount;constructor(t){super(t);const e=t?.startDegree||0,s=t?.endDegree||180,n=t?.extendDegree||15,r=t?.lineWidth||12;this.bgColor=t?.bgColor||"#B3C6E7",this.startColor=t?.startColor||"#5A82F0",this.endColor=t?.endColor||"#66B3FF",this.percent=t?.percent||0,this.indicatorLineCount=22+1;const a=20,o=2,h=17;this.ringBg=new rn({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:n,lineWidth:r,color:this.bgColor}),this.addShape(this.ringBg),this.ring=new rn({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:n,lineWidth:r}),this.addShape(this.ring);const c=this.ringBg.y-this.ringBg.radius+a;for(let l=0;l<this.indicatorLineCount;l++)this.lines.push(new me({...t,centerX:this.ringBg.x,centerY:this.ringBg.y,x:this.ringBg.x,y:c,toX:this.ringBg.x,toY:c+h,degree:this.ringBg.startDegree+90+(s-e+n*2)/(this.indicatorLineCount-1)*l,attrs:{"stroke-linecap":"round","stroke-width":String(o),stroke:this.bgColor}}));this.addShape(this.lines)}setPercent(t){this.percent=t}shapeInit(){this.on("draging",(t,e,s)=>{this.shapes.forEach(n=>{n!=s&&(n.x+=t,n.y+=e)})})}frameUpdate(t,e){const s=this.ringBg.radius-this.ringBg.radius*Math.cos(Math.PI*this.percent),n=this.ringBg.radius*Math.sin(Math.PI*this.percent);if(e){const r=e.createLinearGradient(-this.ringBg.radius,0,-this.ringBg.radius+s,-n,{0:this.startColor,1:this.endColor});this.ring.setAttr({stroke:r})}else this.ring.setAttr({stroke:this.startColor});this.ring.setPercent(this.percent);for(let r=0;r<this.indicatorLineCount;r++){const a=r/(this.indicatorLineCount-1)<=this.percent;this.lines[r].setAttr({stroke:a&&e?e.createLinearGradient(0,0,this.lines[r].toX-this.lines[r].x,this.lines[r].toY-this.lines[r].y,{0:this.startColor,1:this.endColor}):a?this.startColor:this.bgColor})}}}class $u extends H{x;y;z;brightness;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.brightness=this.setBrightness(t?.brightness||1)}setBrightness(t){return this.brightness=j(t,0,1),this.brightness}toSVGPathData(){return[]}}const Wu=$u;class Ju extends H{points;light;constructor(t=[]){if(t.length<3)throw new Error("points length must >= 3");super(),this.points=t,this.light=new Wu({x:0,y:0,z:0,brightness:1})}toSVGPathData(){const t=[];t.push(["M",this.points[0].getScreenX(),this.points[0].getScreenY()]);for(let e=0,s=this.points.length;e<=s-1;e++)t.push(["L",this.points[e].getScreenX(),this.points[e].getScreenY()]);return t.push(["L",this.points[0].getScreenX(),this.points[0].getScreenY()]),t}toCanvasContext(t){t.beginPath(),t.moveTo(0,0);for(let e=0,s=this.points.length;e<=s-1;e++)t.lineTo(this.points[e].getScreenX()-this.points[0].getScreenX(),this.points[e].getScreenY()-this.points[0].getScreenY());t.lineTo(0,0)}get length(){return this.points.length}getDepth(){return Math.min(...this.points.map(t=>t.z))}isBackface(){const t=this.points[2].getScreenX()-this.points[0].getScreenX(),e=this.points[2].getScreenY()-this.points[0].getScreenY(),s=this.points[1].getScreenX()-this.points[2].getScreenX(),n=this.points[1].getScreenY()-this.points[2].getScreenY();return t*n>e*s}getLightFactor(){const t={x:this.points[0].x-this.points[1].x,y:this.points[0].y-this.points[1].y,z:this.points[0].z-this.points[1].z},e={x:this.points[1].x-this.points[2].x,y:this.points[1].y-this.points[2].y,z:this.points[1].z-this.points[2].z},s={x:t.y*e.z-t.z*e.y,y:-(t.x*e.z-t.z*e.x),z:t.x*e.y-t.y*e.x},n=s.x*this.light.x+s.y*this.light.y+s.z*this.light.z,r=Math.sqrt(s.x*s.x+s.y*s.y+s.z*s.z),a=Math.sqrt(this.light.x*this.light.x+this.light.y*this.light.y+this.light.z*this.light.z);return Math.acos(n/(r*a))/Math.PI*this.light.brightness}getAdjustedColor(t){const e=ze(t),s=this.getLightFactor();return e.r*=s,e.g*=s,e.b*=s,e.toString()}}class Zu extends rt{fettis=[];constructor(t,e,s){super();const{shape:n,x:r,y:a,particleCount:o,angle:h,spread:c,startVelocity:l,decay:f,gravity:y,drift:b,ticks:p,colors:E,scalar:_,flat:v}=Object.assign({shape:Ht,x:.5,y:.6,particleCount:100,angle:90,spread:70,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,colors:ca,scalar:1,flat:!1},s||{}),x=N(h),w=N(c);let g=o;for(;g--;){const P=E[g%E.length],C=new n({x:t*r,y:e*a,width:10,height:10,scalar:_,attrs:{fill:P},independentTransformInGroup:!0});this.addShape(C),this.fettis.push({shape:C,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:l*.5+Math.random()*l,angle2D:-x+(.5*w-Math.random()*w),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,tick:0,totalTicks:p,decay:f,drift:b,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:y*3,scalar:_,flat:v,color:ze(P)})}}frameUpdate(t){this.fettis.length&&(this.fettis=this.fettis.filter(e=>{e.shape.x+=Math.cos(e.angle2D)*e.velocity+e.drift,e.shape.y+=Math.sin(e.angle2D)*e.velocity+e.gravity,e.velocity*=e.decay,e.flat?(e.wobble=0,e.wobbleX=e.shape.x+10*e.scalar,e.wobbleY=e.shape.y+10*e.scalar,e.tiltSin=0,e.tiltCos=0,e.random=1):(e.wobble+=e.wobbleSpeed,e.wobbleX=e.shape.x+10*e.scalar*Math.cos(e.wobble),e.wobbleY=e.shape.y+10*e.scalar*Math.sin(e.wobble),e.tiltAngle+=.1,e.tiltSin=Math.sin(e.tiltAngle),e.tiltCos=Math.cos(e.tiltAngle),e.random=Math.random()+2);const s=e.tick++/e.totalTicks,n=e.shape.x+e.random*e.tiltCos,r=e.shape.y+e.random*e.tiltSin,a=e.wobbleX+e.random*e.tiltCos,o=e.wobbleY+e.random*e.tiltSin;return e.shape.setAttr("fill",e.color.setAlpha(1-s).toString()),e.shape.degree=nt(Math.PI/10*e.wobble),e.shape.scalarX=Math.abs(a-n)*.1,e.shape.scalarY=Math.abs(o-r)*.1,e.tick<e.totalTicks}))}}class an{shapes;constructor(t){this.shapes=t}run(t){this.shapes.forEach(s=>{s.run(),t?.wall&&s.checkWall({wall:t.wall,bounce:t.bounce})});const e=this.shapes.length;for(let s=0,n=e-1;s<n;s++)for(let r=s+1;r<e;r++)this.shapes[s].checkCollision(this.shapes[r])}gravitate(){const t=this.shapes.length;this.shapes.forEach((e,s)=>{e.run();for(let n=s+1;n<t;n++)e.checkCollision(this.shapes[n]),e.gravitateTo(this.shapes[n])})}springChain(t){this.shapes.forEach((e,s)=>{s>0&&e.runSpringTo(this.shapes[s-1],t)})}springConnect(t){const e=Jt(t?.springLength,100);this.shapes.forEach(s=>{s.isDragging||this.shapes.filter(n=>n.id!==s.id).forEach(n=>{const r=se(s.x,s.y,n.x,n.y);s.runSpringTo({x:n.x-Math.cos(r)*e,y:n.y-Math.sin(r)*e},t)})})}springMass(t,e){const s=this.shapes.length,n=[];return this.shapes.forEach((r,a)=>{r.run(e),r.x>t.x+t.width?r.x=t.x:r.x<t.x&&(r.x=t.x+t.width),r.y>t.y+t.height?r.y=t.y:r.y<t.y&&(r.y=t.y+t.height);for(let o=a+1;o<s;o++)n.push([r.x,r.y,this.shapes[o].x,this.shapes[o].y,r.springMassTo(this.shapes[o],e)])}),n}polymorph(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");const t=this.shapes.length-1,e=new Array(t);for(let n=0;n<t;n++){const r=this.shapes[n].initPathD();this.shapes[n].frameStart();const a=this.shapes[n+1].initPathD();this.shapes[n+1].frameStart();const o=Math.max(r.polymorphPoints.length,a.polymorphPoints.length);e[n]=xt.getPathInterpolator(r.expendFill(o),a.expendFill(o))}const s=new H({d:e[0](0)});return n=>{const r=It(t*n,6),a=Math.min(Math.floor(r),t-1),o=It(r-a,6);s.originD=e[a](o);const h=this.shapes[a].getAttr("fill","none"),c=this.shapes[a+1].getAttr("fill","none");typeof h=="string"&&typeof c=="string"&&s.setAttr("fill",lt.gradient(h,c,o).toString());const l=this.shapes[a].getAttr("stroke","none"),f=this.shapes[a+1].getAttr("stroke","none");return typeof l=="string"&&typeof f=="string"&&s.setAttr("stroke",lt.gradient(l,f,o).toString()),s}}polymorphGroup(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");let t=0,e;const s=[];this.shapes.forEach(o=>{let h;o instanceof rt?(h=o,h.sortPathD()):(h=new rt,h.addShape(o)),s.push(h),t<h.shapes.length&&(t=h.shapes.length,e=h)}),s.forEach(o=>{o!==e&&o.expendFill(e)});const n=[];s.forEach((o,h)=>{o.shapes.forEach((c,l)=>{n[l]=n[l]||[],n[l][h]=c})});const r=[];n.forEach(o=>{r.push(new an(o).polymorph())});const a=new rt;return r.forEach(o=>{a.addShape(o(0))}),o=>(r.forEach(h=>{h(o)}),a)}polymorphTween(t=6e3,e){const s=this.shapes.findIndex(o=>o instanceof rt)>=0?this.polymorphGroup():this.polymorph(),n=s(0),r=e?.onUpdate,a=new Es({frameDuration:t});a.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(o,h)=>{s(o.t),r?.(o,h),e?.draw?.(n)}})),a.play()}static generatePointsShape(t,e,s,n){const r=[];for(let a=0;a<n;a++){const o=a/n*2*Math.PI,{dx:h,dy:c}=Rt(o,s);r.push({x:t+h,y:e+c})}return new Pa({points:r})}static generateRosettaShape(t,e,s,n,r){if(r==0)throw new Error("no dividing by zero, please");const a=[],o=360/r;for(let h=0;h<r;h+=1){const c=o*h*Math.PI/180,l=t+2*s*Math.cos(c),f=e+2*s*Math.sin(c);a.push(new Hi({x:t,y:e,rx:s,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:l,toY:f})),a.push(new Hi({x:l,y:f,rx:s,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:t,toY:e}))}return new H({d:xt.fromLines(a)})}}const Da={map:new Map,transform:function(i){if(Fr)return i;if(this.map.has(i))return this.map.get(i);const t=new OffscreenCanvas(i.width,i.height);return t.getContext("2d")?.drawImage(i,0,0),this.map.set(i,t),t},clear:function(){this.map.clear()}};function Ku(i,t,e){const s=new OffscreenCanvas(i,t),n=s.getContext("2d");if(n)return e(n),s.transferToImageBitmap()}function Qu(i,t,e){const s=i.createPattern(Da.transform(t),"no-repeat");if(s){const n=$i(e);s.setTransform(n),i.fillStyle=s}}class tf{app;ctx;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e=!1){if(this.app=t,!(this.app.container instanceof HTMLCanvasElement))throw new Error("app.container 应该为 HTMLCanvasElement!");this.ctx=new Fs(this.app.container,this.app.width,this.app.height,e),this.app.captureDrag({start:()=>{this.isMouseDown=!0,this.dragDx=0,this.dragDy=0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.dragDx=0,this.dragDy=0,this.setCursor()},move:(s,n)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=n.dx,this.dragDy+=n.dy),this.setCursor()}}),this.app.on("tap",()=>{for(let s of this.shapes)if(this.currentMouseInShape==s){s.emit("clicked");let n=s.parent;for(;n;)n.emit("clicked",s),n=n.parent;break}})}setCursor(){this.currentEnableDragMouseInShape?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShape?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}transformCtxBaseOnShape(t){t.usePathDtoCanvasContext||(this.ctx.translate(t.x,t.y),this.ctx.rotate(N(t.degree),t.cX,t.cY),this.ctx.scale(t.scalarX,t.scalarY,t.cX,t.cY))}_addDrawShape(t){this.shapes.push(t),t instanceof rt&&t.shapes.forEach(e=>{this._addDrawShape(e)})}draw(t=[]){this.shapes=[],(Array.isArray(t)?t:[t]).forEach(e=>{this._addDrawShape(e)}),this.isMouseDown&&this.currentEnableDragMouseInShape||(this.currentMouseInShape=void 0);for(let e of this.shapes){if(!e.isShow)continue;if(this.ctx.save(),e.frameStart(this.app.mousePoint),L.attrsToCanvas(this.ctx,e.getAttrs()),e.followMouse&&(!ns(e.x,this.app.mousePoint.x,5)||!ns(e.y,this.app.mousePoint.y,5))&&e.followTo(this.app.mousePoint),e.targetToAfterDragFree&&(this.isMouseDown||e.runEaseTo({x:e.targetToAfterDragFree.targetX,y:e.targetToAfterDragFree.targetY},{easing:e.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShape==e){e.isDragging=!0;const n=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,n||r){if(e.x+=n,e.y+=r,e.alongPath){const a=e.alongPath.closestPoint(e.x,e.y);e.x=a.point.x-e.cX,e.y=a.point.y-e.cY}e.emit("draging",n,r)}}else e.isDragging=!1;e.frameUpdate(this.app.mousePoint,this.ctx),this.transformCtxBaseOnShape(e),e.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill();const s=this.ctx.currentPath2D;if(!this.currentMouseInShape){const n=this.ctx.isPointInPath(s,this.app.mousePoint.x,this.app.mousePoint.y)||this.ctx.isPointInStroke(s,this.app.mousePoint.x,this.app.mousePoint.y)||!1;e.isMouseIn=n,n&&(this.currentMouseInShape=e,e.enableDrag&&(this.currentEnableDragMouseInShape=e))}e.frameEnd(this.app.mousePoint),this.ctx.restore()}this.currentMouseInShape||(this.currentEnableDragMouseInShape=void 0)}drawMouseMoveLine(t="line",e){switch(t){case"brush":const s=e?.brushSize??10,n=e?.brushDensity??50,r=e?.brushColor??"#000000",a=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),o=a.data,h=ze(r);return this.app.captureDrag({move:()=>{if(this.isMouseDown){for(let c=0;c<n;c++){const l=Math.random()*Math.PI*2,f=Math.random()*s,y=this.app.mousePoint.x+Math.cos(l)*f|0,b=this.app.mousePoint.y+Math.sin(l)*f|0,p=(y+b*a.width)*4;o[p]=h.r,o[p+1]=h.g,o[p+2]=h.b,o[p+3]=255}this.ctx.putImageData(a)}}});case"line":default:return this.app.captureDrag({start:c=>{this.ctx.beginPath(),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 ef{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new Ge(t),this.remoteVideoUtil=new Ge(e)}start(){this.getLocalMediaStream().then(t=>{this.call(t)})}end(){this.localPeerConnection?.close(),this.remotePeerConnection?.close(),this.localPeerConnection=null,this.remotePeerConnection=null,this.trace("Ending call.")}getLocalMediaStream(){return new Promise((t,e)=>{navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then(s=>{this.localVideoUtil.setSrcObject(s),t(s)}).catch(s=>{this.trace(`navigator.getUserMedia error: ${s}.`),e(s)})})}gotRemoteMediaStream(t){const e=t.streams[0];this.remoteVideoUtil.setSrcObject(e),this.trace("Remote peer connection received remote stream.")}call(t){const e=t.getVideoTracks(),s=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),s.length>0&&this.trace(`Using audio device: ${s[0].label}.`);const n=void 0,r=new RTCPeerConnection(n);this.localPeerConnection=r,this.trace("Created local peer connection object localPeerConnection."),r.addEventListener("icecandidate",this.handleConnection),r.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const a=new RTCPeerConnection(n);this.remotePeerConnection=a,this.trace("Created remote peer connection object remotePeerConnection."),a.addEventListener("icecandidate",this.handleConnection),a.addEventListener("iceconnectionstatechange",this.handleConnectionChange),a.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),r.addTrack(e[0],t),r.addTrack(s[0],t),this.trace("localPeerConnection createOffer start."),r.createOffer({offerToReceiveVideo:!0}).then(o=>this.createdOffer(o)).catch(o=>this.setSessionDescriptionError(o))}handleConnection(t){const e=t.target,s=t.candidate;if(e&&s){const n=new RTCIceCandidate(s),r=this.getOtherPeer(e);r&&(r.addIceCandidate(n).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
|
|
40
|
+
`,t}function au(i,t,e,s,n){const r=t/e;let a=0,o=0;switch(i){case"aspectFit":r>=1?(a=s,o=a/r,o>n&&(o=n,a=o*r)):(o=n,a=o*r,a>s&&(a=s,o=a/r));break;case"aspectFill":r>=1?(o=n,a=o*r):(a=s,o=a/r);break;case"widthFix":a=s,o=a/r;break;case"heightFix":o=n,a=o*r;break;case"scaleToFill":default:a=s,o=n;break}return{width:a,height:o}}const zs=new Map;async function ou(i){return new Promise((t,e)=>{Gs(i,(s,n)=>s?e(s):t({width:n.width,height:n.height,aspectRatio:n.width/n.height}))})}const Gs=(i,t)=>{if(zs.has(i))return t(null,zs.get(i));const e=new Image;e.onload=function(){zs.set(i,{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height,element:e}),t(null,zs.get(i))},e.onerror=function(s){t(s,null)},e.src=i},hu=(i,t)=>{for(let e=0,s=i.length;e<s;e++){const n=i[e],{type:r}=n;if(r.split("/")[0]!=="image")continue;const a=new FileReader;a.onload=function(o){if(!o.target)return t("no reader target",null);const h=o.target.result,c=Ln(h),l=new Blob([h]);sn(l,(f,y)=>{if(!y)return t(f,null);Gs(y,(b,p)=>{if(!p)return t(b,null);Ca(y,(E,_)=>{if(!_)return t(E,null);const v={name:n.name,fileType:c,size:n.size,width:p.width,height:p.height,imgUrl:y,imageData:_,blob:l};return t(null,v)})})})},a.readAsArrayBuffer(n)}},Ca=(i,t)=>{Gs(i,(e,s)=>{if(!s)return t(e,null);const n=document.createElement("canvas"),r=n.getContext("2d");n.width=s.width,n.height=s.height,r.drawImage(s.element,0,0,n.width,n.height);const a=r.getImageData(0,0,n.width,n.height);return t(null,a)})},cu=(i,t=0,e=0)=>{const s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.drawImage(i,0,0,t,e),n.getImageData(0,0,t,e)},lu=(i,t=0,e=0)=>{const s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.drawImage(i,0,0,t,e),n.getImageData(0,0,t,e)},uu=i=>{const t=i.width,e=i.height,s=t*e*3,n=s+54,r=[66,77,n&255,n>>8&255,n>>16&255,n>>24&255,0,0,0,0,54,0,0,0],a=[40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,1,0,24,0,0,0,0,0,s&255,s>>8&255,s>>16&255,s>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=(4-t*3%4)%4,h=i.data;let c="";const l=t<<2;let f=e;const y=String.fromCharCode;do{const p=l*(f-1);let E="";for(let _=0;_<t;_++){const v=_<<2;E+=y(h[p+v+2])+y(h[p+v+1])+y(h[p+v])}for(let _=0;_<o;_++)E+=String.fromCharCode(0);c+=E}while(--f);function b(p){if(!window.btoa)throw"btoa undefined";let E="";if(typeof p=="string")E=p;else for(let _=0;_<p.length;_++)E+=String.fromCharCode(p[_]);return btoa(E)}return b(r.concat(a))+b(c)},fu=i=>{const{width:t,height:e}=i,s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.putImageData(i,0,0,0,0,t,e),s.toDataURL("image/png")},du=(i,t,e)=>{const{width:s,height:n}=i,r=document.createElement("canvas"),a=r.getContext("2d");r.width=s,r.height=n,a.putImageData(i,0,0,0,0,s,n);const o=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},o,1)},sn=(i,t)=>{const e=new FileReader;e.onload=function(s){s.target?t(null,s.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(i)},mu=(i,t)=>{sn(i,function(e,s){if(s){const n=new Image;n.src=s}else t(e)})};function pu(i){const t=[],e=[],s=[];let n=0;for(let h=0,c=i.data.length;h<c;h+=4)t[n]=i.data[h],e[n]=i.data[h+1],s[n]=i.data[h+2],n+=1;const r=nn(t),a=nn(e),o=nn(s);return"rgb("+r+","+a+","+o+")"}function nn(i){const t={},e=[],s=[];for(let o=0;o<i.length;o++)t[i[o]]?e.push(i[o]):t[i[o]]=1;let n=0;for(let o=0;o<e.length;o++){n=0;for(let h=0;h<e.length;h++)e[o]===e[h]&&(n+=1),s[o]=n}const r=Math.max.apply(null,s);let a=0;for(;a<s.length;a++)if(s[a]===r)return;return e[a]}const gu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[(a*e+e-o-1)*4],n[h+1]=t[(a*e+e-o-1)*4+1],n[h+2]=t[(a*e+e-o-1)*4+2],n[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(n,e,s)},yu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[((s-a-1)*e+o)*4],n[h+1]=t[((s-a-1)*e+o)*4+1],n[h+2]=t[((s-a-1)*e+o)*4+2],n[h+3]=t[((s-a-1)*e+o)*4+3]}return new ImageData(n,e,s)},wu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;n[h]=t[(o*e+e-a-1)*4],n[h+1]=t[(o*e+e-a-1)*4+1],n[h+2]=t[(o*e+e-a-1)*4+2],n[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(n,s,e)},xu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;n[h]=t[((s-o-1)*e+a)*4],n[h+1]=t[((s-o-1)*e+a)*4+1],n[h+2]=t[((s-o-1)*e+a)*4+2],n[h+3]=t[((s-o-1)*e+a)*4+3]}return new ImageData(n,s,e)},bu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1]+t[h+2])/3;n[h]=c,n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},vu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=.2126*t[h]+.7152*t[h+1]+.0722*t[h+2];n[h]=c,n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Su=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=(t[h]+t[h+1]+t[h+2])/3>127?255:0;n[h]=l,n[h+1]=l,n[h+2]=l,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Cu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=255-t[h],n[h+1]=255-t[h+1],n[h+2]=255-t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Tu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=0,n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Pu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=t[h+1],n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Eu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=0,n[h+2]=t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},_u=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=t[h+1],n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Au=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=0,n[h+2]=t[h+1],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Du=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=t[h+1],n[h+2]=t[h+1],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Mu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h+1]+t[h+2])/2;n[h]=t[h],n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Iu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+2])/2;n[h]=c,n[h+1]=t[h+1],n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},ku=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1])/2;n[h]=c,n[h+1]=c,n[h+2]=t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Lu=i=>Ta(i,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Ru=i=>Ta(i,[-1,-1,-1,-1,8,-1,-1,-1,-1]),Ou=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=t[h+1],n[h+2]=t[h+2],n[h+3]=255}return new ImageData(n,e,s)},Fu=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;if(t[h+3]===0)n[h]=255,n[h+1]=255,n[h+2]=255,n[h+3]=255;else{const c=Pa([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);n[h]=c[0],n[h+1]=c[1],n[h+2]=c[2],n[h+3]=c[3]}}return new ImageData(n,e,s)},Nu=(i,t,e,s,n,r=!1,a)=>{const{data:o,width:h,height:c}=i;let l=n,f=s,y=t,b=e;if(l<0?l=0:l>h&&(l=h),f<0?f=0:f>c&&(f=c),y<1?y=1:y>h&&(y=h),b<1?b=1:b>c&&(b=c),l+y>h&&(y=h-l),f+b>c&&(b=c-f),r){const p=new Uint8ClampedArray(o.length);for(let _=0;_<c;_++)for(let v=0;v<h;v++){const x=(_*h+v)*4;v>=l&&v<=l+y&&_>=f&&_<=f+b?(p[x]=o[x],p[x+1]=o[x+1],p[x+2]=o[x+2],p[x+3]=o[x+3]):(p[x]=255,p[x+1]=255,p[x+2]=255,p[x+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(p,h,c)}else{const p=new Uint8ClampedArray(y*b*4);for(let _=f;_<=f+b;_++)for(let v=l;v<=l+y;v++){const x=((_-f)*y+v-l)*4,w=(_*h+v)*4;p[x]=o[w],p[x+1]=o[w+1],p[x+2]=o[w+2],p[x+3]=o[w+3]}return new ImageData(p,y,b)}},Bu=(i,t,e,s)=>{const{data:n,width:r,height:a}=i;let o=t;o>Math.floor(r/2)&&(o=Math.floor(r/2)),o>Math.floor(a/2)&&(o=Math.floor(a/2)),o<0&&(o=0);const h=new Uint8ClampedArray(n.length);for(let l=0;l<a;l++)for(let f=0;f<r;f++){const y=(l*r+f)*4;let b=-1;f<o?l<o?b=Math.sqrt(Math.pow(o-f-1,2)+Math.pow(o-l-1,2)):l>a-o-1&&(b=Math.sqrt(Math.pow(o-f-1,2)+Math.pow(l-(a-o),2))):f>r-o-1&&(l<o?b=Math.sqrt(Math.pow(f-(r-o),2)+Math.pow(o-l-1,2)):l>a-o-1&&(b=Math.sqrt(Math.pow(f-(r-o),2)+Math.pow(l-(a-o),2)))),Math.round(b)>o?(h[y]=255,h[y+1]=255,h[y+2]=255,h[y+3]=s||e.toUpperCase()==="PNG"?0:255):(h[y]=n[y],h[y+1]=n[y+1],h[y+2]=n[y+2],h[y+3]=s||e.toUpperCase()==="PNG"?n[y+3]:255)}return new ImageData(h,r,a)},Uu=(i,t,e,s,n,r=1e4)=>{const a=new Image;a.src=i;const o=document.createElement("canvas"),h=o.getContext("2d");return o.width=r,o.height=r,h.drawImage(a,0,0,t,e,0,0,s,n),h.getImageData(0,0,s,n)},Yu=(i,t)=>{const{data:e,width:s,height:n}=i,r=new Uint8ClampedArray(e.length);for(let o=0;o<n;o++)for(let h=0;h<s;h++){const c=(o*s+h)*4;r[c]=Math.max(Math.min(e[c]+t,255),0),r[c+1]=Math.max(Math.min(e[c+1]+t,255),0),r[c+2]=Math.max(Math.min(e[c+2]+t,255),0),r[c+3]=e[c+3]}return new ImageData(r,s,n)},Xu=(i,t,e=!1)=>{const{data:s,width:n,height:r}=i,a=new Uint8ClampedArray(s.length);for(let h=0;h<r;h++)for(let c=0;c<n;c++){const l=(h*n+c)*4;s[l+3]===0?(a[l]=255,a[l+1]=255,a[l+2]=255):(a[l]=s[l],a[l+1]=s[l+1],a[l+2]=s[l+2]);let 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,n,r)},Vu=(i,t,e,s)=>{const{data:n,width:r,height:a}=i,{data:o,width:h,height:c}=t;let l=e,f=s;e+c>a&&(l=a-c),s+h>r&&(f=r-h);const y=new Uint8ClampedArray(n.length);for(let p=0;p<a;p++)for(let E=0;E<r;E++){const _=(p*r+E)*4;if(E<f||E>f+h||p<=l||p>=l+c)y[_]=n[_],y[_+1]=n[_+1],y[_+2]=n[_+2],y[_+3]=n[_+3];else{const v=(p*r+E-((l+1)*r+(p-(l+1))*(r-h))+h-f-1)*4,x=[o[v],o[v+1],o[v+2],o[v+3]],w=[n[_],n[_+1],n[_+2],n[_+3]],g=Pa(x,w);y[_]=g[0],y[_+1]=g[1],y[_+2]=g[2],y[_+3]=g[3]}}return new ImageData(y,r,a)},zu=(i,t,e,s,n,r=10)=>{const{data:a,width:o,height:h}=i;let c=n,l=s,f=t,y=e;c<0?c=0:c>o&&(c=o),l<0?l=0:l>h&&(l=h),f<1?f=1:f>o&&(f=o),y<1?y=1:y>h&&(y=h),c+f>o&&(f=o-c),l+y>h&&(y=h-l);const b=new Uint8ClampedArray(a.length);for(let E=0;E<h;E++)for(let _=0;_<o;_++){const v=(E*o+_)*4;if(_>=c&&_<=c+f&&E>=l&&E<=l+y){const x=Math.floor((_-c)/r),w=Math.floor((E-l)/r);let g=Math.floor(r*(x+1)-r/2+c),P=Math.floor(r*(w+1)-r/2+l);g>o-1&&(g=o-1),P>h-1&&(P=h-1);const C=(P*o+g)*4;b[v]=a[C],b[v+1]=a[C+1],b[v+2]=a[C+2],b[v+3]=a[C+3]}else b[v]=a[v],b[v+1]=a[v+1],b[v+2]=a[v+2],b[v+3]=a[v+3]}return new ImageData(b,o,h)},Gu=(i,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}})=>{if(t&&e){const{data:s,width:n,height:r}=i,{data:a}=t,o=new Uint8ClampedArray(s.length),{backgroundColor:h,changeIntoColor:c}=e;for(let f=0;f<r;f++)for(let y=0;y<n;y++){const b=(f*n+y)*4,p=a[b],E=a[b+1],_=a[b+2],v=a[b+3];p===h.r&&E===h.g&&_===h.b&&v===h.a&&c.a!==0?(o[b]=c.r,o[b+1]=c.g,o[b+2]=c.b,o[b+3]=c.a):(o[b]=s[b],o[b+1]=s[b+1],o[b+2]=s[b+2],o[b+3]=s[b+3])}return new ImageData(o,n,r)}return i},Ta=(i,t)=>{const{data:e,width:s,height:n}=i,r=new Uint8ClampedArray(e.length);for(let o=0;o<n;o++)for(let h=0;h<s;h++){const c=(o*s+h)*4;for(let l=0;l<3;l++){const f=c+l;h===0||h===s-1||o===0||o===n-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[c+3]=e[c+3]}return new ImageData(r,s,n)},Pa=(i,t)=>{if(i&&i.length===4&&t&&t.length===4){const e=i[3],s=t[3];if(e===255||s===0)return i;if(e===0)return t;{const n=e/255,r=s/255,a=Math.max(Math.min(Math.floor(i[0]*n+t[0]*r*(1-n)),255),0),o=Math.max(Math.min(Math.floor(i[1]*n+t[1]*r*(1-n)),255),0),h=Math.max(Math.min(Math.floor(i[2]*n+t[2]*r*(1-n)),255),0),c=Math.max(Math.min(Math.floor((n+r*(1-n))*255),255),0);return[a,o,h,c]}}return[255,255,255,255]},rn=function(){const i=[];return{writeByte(t){i.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,s=t.length){for(let n=0;n<s;n++)this.writeByte(t[n+e])},writeString(t){for(let e=0,s=t.length;e<s;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return i},toString(){let t="[";for(let e=0,s=i.length;e<s;e++)e>0&&(t+=","),t+=i[e];return t+="]",t}}},Ea=function(){let i=0,t=0,e=0,s="";const n=function(a){if(!(a<0)){if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47}throw new Error("n:"+a)},r=function(a){s+=String.fromCharCode(n(a&63))};return{writeByte(a){for(i=i<<8|a&255,t+=8,e+=1;t>=6;)r(i>>>t-6),t-=6},flush(){if(t>0&&(r(i<<6-t),i=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)s+="="}},toString(){return s}}},_a=function(i,t,e){const s=new Array(i*i),n=function(o){const h=o;let c=0,l=0;return{write(f,y){if(f>>>y)throw new Error("length over");for(;c+y>=8;)h.writeByte(255&(f<<c|l)),y-=8-c,f>>>=8-c,l=0,c=0;l=f<<c|l,c=c+y},flush(){c>0&&h.writeByte(l)}}},r=function(o){const h=1<<o,c=(1<<o)+1;let l=o+1;const f=a();for(let _=0;_<h;_++)f.add(String.fromCharCode(_));f.add(String.fromCharCode(h)),f.add(String.fromCharCode(c));const y=rn(),b=n(y);b.write(h,l);let p=0,E=String.fromCharCode(s[p]);for(p+=1;p<s.length;){const _=String.fromCharCode(s[p]);p+=1,f.contains(E+_)?E=E+_:(b.write(f.indexOf(E),l),f.size()<4095&&(f.size()==1<<l&&(l+=1),f.add(E+_)),E=_)}return b.write(f.indexOf(E),l),b.write(c,l),b.flush(),y.toByteArray()},a=function(){const o={};let h=0;return{add(c){if(this.contains(c))throw new Error("dup key:"+c);o[c]=h,h+=1},size(){return h},indexOf(c){return o[c]},contains(c){return typeof o[c]<"u"}}};return{setPixel(o,h,c){s[h*i+o]=c},write(o){o.writeString("GIF87a"),o.writeShort(i),o.writeShort(i),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte(be("0x"+t[1]+t[2])),o.writeByte(be("0x"+t[3]+t[4])),o.writeByte(be("0x"+t[5]+t[6])),o.writeByte(be("0x"+e[1]+e[2])),o.writeByte(be("0x"+e[3]+e[4])),o.writeByte(be("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(i),o.writeShort(i),o.writeByte(0);const h=2,c=r(h);o.writeByte(h);let l=0;for(;c.length-l>255;)o.writeByte(255),o.writeBytes(c,l,255),l+=255;o.writeByte(c.length-l),o.writeBytes(c,l,c.length-l),o.writeByte(0),o.writeString(";")}}},Aa=function(i,t,e,s){const n=_a(i,t,e);for(let c=0;c<i;c++)for(let l=0;l<i;l++)n.setPixel(l,c,s(l,c));const r=rn();n.write(r);const a=Ea(),o=r.toByteArray();for(let c=0,l=o.length;c<l;c++)a.writeByte(o[c]);a.flush();let h="";return h+="data:image/gif;base64,",h+=a,h},bt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Je={M:0,L:1,H:2,Q:3},ne={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},tt={glog:function(i){if(i<1)throw new Error("glog("+i+")");return tt.LOG_TABLE[i]},gexp:function(i){for(;i<0;)i+=255;for(;i>=256;)i-=255;return tt.EXP_TABLE[i]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let i=0;i<8;i++)tt.EXP_TABLE[i]=1<<i;for(let i=8;i<256;i++)tt.EXP_TABLE[i]=tt.EXP_TABLE[i-4]^tt.EXP_TABLE[i-5]^tt.EXP_TABLE[i-6]^tt.EXP_TABLE[i-8];for(let i=0;i<255;i++)tt.LOG_TABLE[tt.EXP_TABLE[i]]=i;const $={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(i){let t=i<<10;for(;$.getBCHDigit(t)-$.getBCHDigit($.G15)>=0;)t^=$.G15<<$.getBCHDigit(t)-$.getBCHDigit($.G15);return(i<<10|t)^$.G15_MASK},getBCHTypeNumber:function(i){let t=i<<12;for(;$.getBCHDigit(t)-$.getBCHDigit($.G18)>=0;)t^=$.G18<<$.getBCHDigit(t)-$.getBCHDigit($.G18);return i<<12|t},getBCHDigit:function(i){let t=0;for(;i!=0;)t++,i>>>=1;return t},getPatternPosition:function(i){return $.PATTERN_POSITION_TABLE[i-1]},getMask:function(i,t,e){switch(i){case ne.PATTERN000:return(t+e)%2==0;case ne.PATTERN001:return t%2==0;case ne.PATTERN010:return e%3==0;case ne.PATTERN011:return(t+e)%3==0;case ne.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case ne.PATTERN101:return t*e%2+t*e%3==0;case ne.PATTERN110:return(t*e%2+t*e%3)%2==0;case ne.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+i)}},getErrorCorrectPolynomial:function(i){let t=new Ee([1],0);for(let e=0;e<i;e++)t=t.multiply(new Ee([1,tt.gexp(e)],0));return t},getLengthInBits:function(i,t){if(1<=t&&t<10)switch(i){case bt.MODE_NUMBER:return 10;case bt.MODE_ALPHA_NUM:return 9;case bt.MODE_8BIT_BYTE:return 8;case bt.MODE_KANJI:return 8;default:throw new Error("mode:"+i)}else if(t<27)switch(i){case bt.MODE_NUMBER:return 12;case bt.MODE_ALPHA_NUM:return 11;case bt.MODE_8BIT_BYTE:return 16;case bt.MODE_KANJI:return 10;default:throw new Error("mode:"+i)}else if(t<41)switch(i){case bt.MODE_NUMBER:return 14;case bt.MODE_ALPHA_NUM:return 13;case bt.MODE_8BIT_BYTE:return 16;case bt.MODE_KANJI:return 12;default:throw new Error("mode:"+i)}else throw new Error("type:"+t)},getLostPoint:function(i){const t=i.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++){let o=0;const h=i.isDark(r,a);for(let c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(let l=-1;l<=1;l++)a+l<0||t<=a+l||c==0&&l==0||h==i.isDark(r+c,a+l)&&o++;o>5&&(e+=3+o-5)}for(let r=0;r<t-1;r++)for(let a=0;a<t-1;a++){let o=0;i.isDark(r,a)&&o++,i.isDark(r+1,a)&&o++,i.isDark(r,a+1)&&o++,i.isDark(r+1,a+1)&&o++,(o==0||o==4)&&(e+=3)}for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)i.isDark(r,a)&&!i.isDark(r,a+1)&&i.isDark(r,a+2)&&i.isDark(r,a+3)&&i.isDark(r,a+4)&&!i.isDark(r,a+5)&&i.isDark(r,a+6)&&(e+=40);for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)i.isDark(a,r)&&!i.isDark(a+1,r)&&i.isDark(a+2,r)&&i.isDark(a+3,r)&&i.isDark(a+4,r)&&!i.isDark(a+5,r)&&i.isDark(a+6,r)&&(e+=40);let s=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++)i.isDark(a,r)&&s++;const n=Math.abs(100*s/t/t-50)/5;return e+=n*10,e}};class Ee{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let s=0;for(;s<t.length&&t[s]==0;)s++;this.num=new Array(t.length-s+e);for(let n=0;n<t.length-s;n++)this.num[n]=t[n+s]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let s=0;s<this.getLength();s++)for(let n=0;n<t.getLength();n++)e[s+n]^=tt.gexp(tt.glog(this.get(s))+tt.glog(t.get(n)));return new Ee(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=tt.glog(this.get(0))-tt.glog(t.get(0)),s=new Array(this.getLength());for(let n=0;n<this.getLength();n++)s[n]=this.get(n);for(let n=0;n<t.getLength();n++)s[n]^=tt.gexp(tt.glog(t.get(n))+e);return new Ee(s,0).mod(t)}}class zt{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=zt.getRsBlockTable(t,e);if(s==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const n=s.length/3,r=[];for(let a=0;a<n;a++){const o=s[a*3+0],h=s[a*3+1],c=s[a*3+2];for(let l=0;l<o;l++)r.push(new zt(h,c))}return r}static getRsBlockTable(t,e){switch(e){case Je.L:return zt.RS_BLOCK_TABLE[(t-1)*4+0];case Je.M:return zt.RS_BLOCK_TABLE[(t-1)*4+1];case Je.Q:return zt.RS_BLOCK_TABLE[(t-1)*4+2];case Je.H:return zt.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Da{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 qu{mode;data;constructor(t){this.mode=bt.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 re{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Je[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new qu(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=zt.getRSBlocks(t,this.errorCorrectLevel),s=new Da;let n=0;for(let r=0;r<e.length;r++)n+=e[r].dataCount;for(let r=0;r<this.dataList.length;r++){const a=this.dataList[r];s.put(a.mode,4),s.put(a.getLength(),$.getLengthInBits(a.mode,t)),a.write(s)}if(s.getLengthInBits()<=n*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let s=0;s<this.moduleCount;s++){this.modules[s]=new Array(this.moduleCount);for(let n=0;n<this.moduleCount;n++)this.modules[s][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=re.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let s=-1;s<=7;s++)if(!(t+s<=-1||this.moduleCount<=t+s))for(let n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=s&&s<=6&&(n==0||n==6)||0<=n&&n<=6&&(s==0||s==6)||2<=s&&s<=4&&2<=n&&n<=4?this.modules[t+s][e+n]=!0:this.modules[t+s][e+n]=!1)}getBestMaskPattern(){let t=0,e=0;for(let s=0;s<8;s++){this.makeImpl(!0,s);const n=$.getLostPoint(this);(s==0||t>n)&&(t=n,e=s)}return e}createMovieClip(t,e,s){const n=t.createEmptyMovieClip(e,s),r=1;this.make();for(let a=0;a<this.modules.length;a++){const o=a*r;for(let h=0;h<this.modules[a].length;h++){const c=h*r;this.modules[a][h]&&(n.beginFill(0,100),n.moveTo(c,o),n.lineTo(c+r,o),n.lineTo(c+r,o+r),n.lineTo(c,o+r),n.endFill())}}return n}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=$.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let s=0;s<t.length;s++){const n=t[e],r=t[s];if(this.modules[n][r]==null)for(let a=-2;a<=2;a++)for(let o=-2;o<=2;o++)a==-2||a==2||o==-2||o==2||a==0&&o==0?this.modules[n+a][r+o]=!0:this.modules[n+a][r+o]=!1}}setupTypeNumber(t){const e=$.getBCHTypeNumber(this.typeNumber);for(let s=0;s<18;s++){const n=!t&&(e>>s&1)==1;this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=n}for(let s=0;s<18;s++){const n=!t&&(e>>s&1)==1;this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=n}}setupTypeInfo(t,e){const s=this.errorCorrectLevel<<3|e,n=$.getBCHTypeInfo(s);for(let r=0;r<15;r++){const a=!t&&(n>>r&1)==1;r<6?this.modules[r][8]=a:r<8?this.modules[r+1][8]=a:this.modules[this.moduleCount-15+r][8]=a}for(let r=0;r<15;r++){const a=!t&&(n>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=a:r<9?this.modules[8][15-r-1+1]=a:this.modules[8][15-r-1]=a}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let s=-1,n=this.moduleCount-1,r=7,a=0;for(let o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(let h=0;h<2;h++)if(this.modules[n][o-h]==null){let c=!1;a<t.length&&(c=(t[a]>>>r&1)==1),$.getMask(e,n,o-h)&&(c=!c),this.modules[n][o-h]=c,r--,r==-1&&(a++,r=7)}if(n+=s,n<0||this.moduleCount<=n){n-=s,s=-s;break}}}static createData(t,e,s){const n=zt.getRSBlocks(t,e),r=new Da;for(let o=0;o<s.length;o++){const h=s[o];r.put(h.mode,4),r.put(h.getLength(),$.getLengthInBits(h.mode,t)),h.write(r)}let a=0;for(let o=0;o<n.length;o++)a+=n[o].dataCount;if(r.getLengthInBits()>a*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+a*8+")");for(r.getLengthInBits()+4<=a*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=a*8||(r.put(re.PAD0,8),r.getLengthInBits()>=a*8));)r.put(re.PAD1,8);return re.createBytes(r,n)}static createBytes(t,e){let s=0,n=0,r=0;const a=new Array(e.length),o=new Array(e.length);for(let f=0;f<e.length;f++){const y=e[f].dataCount,b=e[f].totalCount-y;n=Math.max(n,y),r=Math.max(r,b),a[f]=new Array(y);for(let v=0;v<a[f].length;v++)a[f][v]=255&t.buffer[v+s];s+=y;const p=$.getErrorCorrectPolynomial(b),_=new Ee(a[f],p.getLength()-1).mod(p);o[f]=new Array(p.getLength()-1);for(let v=0;v<o[f].length;v++){const x=v+_.getLength()-o[f].length;o[f][v]=x>=0?_.get(x):0}}let h=0;for(let f=0;f<e.length;f++)h+=e[f].totalCount;const c=new Array(h);let l=0;for(let f=0;f<n;f++)for(let y=0;y<e.length;y++)f<a[y].length&&(c[l++]=a[y][f]);for(let f=0;f<r;f++)for(let y=0;y<e.length;y++)f<o[y].length&&(c[l++]=o[y][f]);return c}}const Ma=Math.ceil,Ze=Math.floor,Ia=Math.round;function Hu(i,t){const e=En(i),s=t?.ecc||"H",n=t?.size||256,r=-1,a=t?.padding||0,o=t?.color||"#000000",h=t?.background||"#ffffff",c=new re(r,s);c.addData(e),c.make();const l=c.getModuleCount(),f=(n-a*2)/l,y=a,b=n-a;return Aa(n,o,h,function(p,E){if(y<=p&&p<b&&y<=E&&E<b){const _=Ze((p-y)/f),v=Ze((E-y)/f);return c.isDark(v,_)?0:1}else return 1})}function ju(i,t){const e=t.x||0,s=t.y||0,n=En(i),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?Ze(t.size):256,h=t.padding||0,c=-1,l=t.color||"#000000",f=t.background||"#ffffff",y=new re(c,a);y.addData(n),y.make();const b=y.getModuleCount(),p=(o-h*2)/b;r.fillStyle=f,r.fillRect(e,s,o,o);for(let E=0;E<b;E++)for(let _=0;_<b;_++){const v=Ma((_+1)*p)-Ze(_*p),x=Ma((E+1)*p)-Ze(E*p);r.fillStyle=y.isDark(E,_)?l:f,r.fillRect(e+Ia(_*p)+h,s+Ia(E*p)+h,v,x)}}class rt extends q{shapesCountChange=!1;constructor(t){super(t)}shapeInit(){}frameStart(t){return this.shapesCountChange&&(this.shapesCountChange=!1,this.shapes.forEach(e=>{e.parent=this,e.initPathD()}),this.pathd=this.initPathD(),this.shapes.forEach(e=>{!e.forceCXY&&!e.independentTransformInGroup&&(e.cX=this.cX-e.diffXInGroup,e.cY=this.cY-e.diffYInGroup)})),super.frameStart(t)}frameUpdate(t,e){this.shapes.forEach(s=>{!s.independentTransformInGroup&&!s.isDragging&&(s.x=this.x+s.diffXInGroup,s.y=this.y+s.diffYInGroup,s.degree=this.degree+s.diffDegreeInGroup,s.scalarX=this.scalarX*s.diffScalarXInGroup,s.scalarY=this.scalarY*s.diffScalarYInGroup)}),super.frameUpdate(t,e)}addShape(t){(Array.isArray(t)?t:[t]).forEach(e=>{this.shapes.findIndex(s=>s.id==e.id)==-1&&(e.on("draging",(s,n)=>{this.enableDrag&&(this.x+=s,this.y+=n,this.emit("draging",s,n,e))}),this.shapes.push(e),this.shapesCountChange=!0)})}getBoundingClientRect(){const t=[],e=[];this.shapes.forEach(h=>{const c=h.getBoundingClientRect();c&&(t.push(c.x,c.x+c.width),e.push(c.y,c.y+c.height))});const s=this.pathd?.getBoundingClientRect();if(s&&(s.width||s.height)&&(t.push(s.x,s.x+s.width),e.push(s.y,s.y+s.height)),t.length==0||e.length==0)return null;const n=Math.min.apply(0,t),r=Math.min.apply(0,e),a=Math.max.apply(0,t),o=Math.max.apply(0,e);return{x:n,y:r,width:a-n,height:o-r}}setAttrs(t,e){typeof t!="string"?(super.setAttr(t),this.shapes.forEach(s=>{s.setAttr(t)})):e&&(super.setAttr(t,e),this.shapes.forEach(s=>{s.setAttr(t,e)}))}sortPathD(){this.shapes=this.shapes.map(t=>{const e=t.initPathD();return{shape:t,perimeter:e.perimeterPoints()}}).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.shape)}expendFill(t){const e=t.shapes.length,s=this.shapes.length;if(e<s)return t.expendFill(this);for(let n=s;n<e;n++){const a=t.shapes[n].initPathD().polymorphPoints,o=a[0],h=a[1],c=[["M",o,h]];for(let l=2;l+5<a.length;l+=6)c.push(["C",o,h,o,h,o,h]);this.addShape(new q({attrs:{...t.shapes[n].getAttrs()},d:c}))}}strokeDashTween(t,e){switch(e?.type){case"sequence":const s=this.shapes.length-1;this.shapes.forEach((o,h)=>{o.strokeDashTween(t,{...e,delay:h,onStart:()=>{h==0&&e?.onGroupStart?.()},onUpdate:()=>{e?.onGroupUpdate?.()},onComplete:()=>{h==s&&e?.onGroupComplete?.()}})});break;case"parallel":default:const n=new Ds({frameDuration:t}),r={},a={};this.shapes.forEach((o,h)=>{const c=Mt(o.getTotalLength(),0);r[`offset_${h}`]=c,a[`offset_${h}`]=0,o.setAttr({strokeDasharray:`${c} ${c}`,strokeDashoffset:`${c}`})}),n.addTween(r,a,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(o,h)=>{for(let c in o){const l=ni(c).number;this.shapes[l].setAttr("strokeDashoffset",""+Mt(o[c],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),n.play();break}}}class me extends q{toX;toY;constructor(t){super(t),this.toX=t?.toX||0,this.toY=t?.toY||0;let e=this.toX-this.x,s=this.toY-this.y;return new Proxy(this,{set(n,r,a,o){switch(r){case"x":n.toX=a+e;break;case"y":n.toY=a+s;break;case"toX":e=a-n.x;break;case"toY":s=a-n.y;break}return Reflect.set(n,r,a,o)}})}toSVGPathData(){return[["m",0,0],["l",this.toX-this.x,this.toY-this.y]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.lineTo(this.toX-this.x,this.toY-this.y)}intersection(t){const e=new oa({x:this.x,y:this.y,toX:this.toX,toY:this.toY}),s=new oa({x:t.x,y:t.y,toX:t.toX,toY:t.toY});return e.intersection(s)}}class $u extends q{cx;cy;toX;toY;isLineThrough;constructor(t){super(t),this.cx=t?.cx||0,this.cy=t?.cy||0,this.toX=t?.toX||0,this.toY=t?.toY||0,this.isLineThrough=typeof t?.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["m",0,0],["q",t-this.x,e-this.y,this.toX-this.x,this.toY-this.y]]}else return[["m",0,0],["q",this.cx-this.x,this.cy-this.y,this.toX-this.x,this.toY-this.y]]}toCanvasContext(t){if(t.beginPath(),t.moveTo(0,0),this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e-this.x,s-this.y,this.toX-this.x,this.toY-this.y)}else t.quadraticCurveTo(this.cx-this.x,this.cy-this.y,this.toX-this.x,this.toY-this.y)}}class ka extends ga{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=_o(e);for(let n of s.stylesheet.rules)for(let r of n.declarations)for(let a of n.selectors)this.globalStyles[a]=this.globalStyles[a]||[],this.globalStyles[a].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,s)=>{let n=this.groups.length;for(;n--;)if(this.groups[n]!=this.currentItem){let r="",a="";for(let o in this.groups[n])o=="transform"?r=this.groups[n].transform:o=="class"&&this.globalStyles["."+this.groups[n][o]]?a=this.globalStyles["."+this.groups[n][o]].join(";")+";"+a:o=="id"&&this.globalStyles["#"+this.groups[n][o]]?a=this.globalStyles["#"+this.groups[n][o]].join(";")+";"+a:typeof this.currentItem[o]>"u"&&(this.currentItem[o]=this.groups[n][o]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=a:this.currentItem.style=a+this.currentItem.style,this.currentItem.class&&this.globalStyles["."+this.currentItem.class]?this.currentItem.style=this.globalStyles["."+this.currentItem.class].join(";")+";"+this.currentItem.style:this.currentItem.id&&this.globalStyles["#"+this.currentItem.id]&&(this.currentItem.style=this.globalStyles["#"+this.currentItem.id].join(";")+";"+this.currentItem.style),on(this.currentItem.style,this.currentItem,hn)}switch(this.processAttrs(e,s),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let s=[],n;switch(t){case"svg":let r="",a="";if(e.width&&e.height)r=e.width,a=e.height;else if(e.viewBox){const o=e.viewBox.split(/\s+/gi);o.length==4&&(r=String(parseFloat(o[2])-parseFloat(o[0])),a=String(parseFloat(o[3])-parseFloat(o[1])))}r&&a&&this.items.push({type:"viewbox",width:r,height:a});break;case"line":typeof e.x1=="number"&&typeof e.y1=="number"&&typeof e.x2=="number"&&typeof e.y2=="number"&&(this.currentItem.path="M"+[e.x1,e.y1,e.x2,e.y2]);break;case"stop":n={},e.style&&on(e.style,n),n.offset=n.offset||e.offset,n.color=n["stop-color"]||e["stop-color"],n.opacity=n["stop-opacity"]||e["stop-opacity"],~(n.offset+"").indexOf("%")?n.offset=parseFloat(n.offset):n.offset=parseFloat(n.offset)*100,n.offset=+n.offset.toFixed(2),this.grad.stops.push(n);break;case"linearGradient":this.grad.angle=(360+an(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),s=[this.grad.angle];for(let o=0,h=this.grad.stops.length;o<h;o++)n=this.grad.stops[o],o&&o!=h-1?s.push(n.color+":"+n.offset):s.push(n.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break;case"radialGradient":s=[];for(let o=0,h=this.grad.stops.length;o<h;o++)n=this.grad.stops[o],o&&o!=h-1?s.push(n.color+":"+n.offset):s.push(n.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break}for(let r in e){const a=e[r];if(hn.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"&&on(a,this.currentItem,hn),r==="transform"&&(this.currentItem.transform=a+(this.currentItem.transform||" ")),r==="fill"){const o=a.match(/url\(#([^)]+)\)/);if(o){const h=o[1];this.currentItem.fillid=h,this.idtops[h]&&(this.currentItem.fill=this.idtops[h])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+a+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=a),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=a)}}addToItems(){this.items.push(this.currentItem)}}function an(i,t,e,s,n,r){if(typeof n>"u"||typeof r>"u"){const a=i-e,o=t-s;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return an(i,t,n,r)-an(e,s,n,r)}function on(i,t,e){const s=(i+"").split(";"),n=/^\s+|\s+$/g;for(let r=0,a=s.length;r<a;r++){let o=s[r].split(":"),h=o[0].replace(n,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=o[1].replace(n,""))}}const hn=["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 Wu{app;rootEl;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e,s){this.app=t,this.rootEl=wt.createSVGElement("svg"),F.empty(this.app.container),F.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.captureDrag({start:()=>{this.isMouseDown=!0,this.dragDx=0,this.dragDy=0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.dragDx=0,this.dragDy=0,this.setCursor()},move:(n,r)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=r.dx,this.dragDy+=r.dy),this.setCursor()}}),this.app.on("tap",()=>{for(const n of this.shapes)if(this.currentMouseInShape==n){n.emit("clicked");let r=n.parent;for(;r;)r.emit("clicked",n),r=r.parent;break}})}setCursor(){this.currentEnableDragMouseInShape?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShape?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}setSize(t,e){return se(this.rootEl,{viewBox:`0 0 ${t} ${e}`,width:`${t}`,height:`${e}`}),this}download(){return wt.downloadFromSVGElement(this.rootEl)}_addDrawShape(t){this.shapes.findIndex(e=>e.id==t.id)===-1&&(this.shapes.push(t),t instanceof rt&&t.shapes.forEach(e=>{this._addDrawShape(e)}))}path(t){(Array.isArray(t)?t:[t]).forEach(e=>{this._addDrawShape(e)}),this.isMouseDown&&this.currentEnableDragMouseInShape||(this.currentMouseInShape=void 0);for(const e of this.shapes){if(!e.isShow){e.el&&(e.el.remove(),delete e.el);continue}if(e.frameStart(this.app.mousePoint),e.el||(e instanceof Ke?e.el=this.text(e.text,e.x,e.y,An(e.getAttrs(),(n,r)=>typeof r=="string")):(e.el=wt.createSvgPath(e.toSVGPathD(),e.id),F.insert(this.rootEl,e.el))),e.followMouse&&(!cs(e.x,this.app.mousePoint.x,5)||!cs(e.y,this.app.mousePoint.y,5))&&e.followTo(this.app.mousePoint),e.targetToAfterDragFree&&(this.isMouseDown||e.runEaseTo({x:e.targetToAfterDragFree.targetX,y:e.targetToAfterDragFree.targetY},{easing:e.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShape==e){e.isDragging=!0;const n=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,n||r){if(e.x+=n,e.y+=r,e.alongPath){const a=e.alongPath.closestPoint(e.x,e.y);e.x=a.point.x-e.cX,e.y=a.point.y-e.cY}e.emit("draging",n,r)}}else e.isDragging=!1;e instanceof Ke&&(e.setAttr("x",String(e.x)),e.setAttr("y",String(e.y))),e.frameUpdate(this.app.mousePoint);const s=e.toSVGPathD();if(this.attr(e,An(e.getAttrs(),(n,r)=>typeof r=="string")),this.attr(e,"d",s),!this.currentMouseInShape){const n=e.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||e.isPointInStroke(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||!1;e.isMouseIn=n,n&&(this.currentMouseInShape=e,e.enableDrag&&(this.currentEnableDragMouseInShape=e))}e.frameEnd(this.app.mousePoint)}this.currentMouseInShape||(this.currentEnableDragMouseInShape=void 0)}delete(t){(Array.isArray(t)?t:[t]).forEach(e=>{e.el&&e.el.remove(),delete e.el,this.shapes=this.shapes.filter(s=>s.id!==e.id)})}clear(){this.shapes.forEach(t=>{t.el&&t.el.remove(),delete t.el}),F.empty(this.rootEl),this.shapes=[]}attr(t,e,s){const n=t.el||t;return n instanceof SVGElement?e===void 0&&s===void 0?se(n):typeof e=="string"&&s===void 0?se(n,dt(e))||"":(typeof e=="object"?se(n,e):typeof e=="string"&&s!==void 0&&se(n,dt(e),s),this):this}circle(t,e,s){return this.path(new Gt({x:t,y:e,radius:s}))}circleEl(t,e,s){const n=wt.createSVGElement("circle",{cx:String(t),cy:String(e),r:String(s)});return F.insert(this.rootEl,n),n}ellipse(t,e,s,n){return this.path(new Ra({x:t,y:e,rx:s,ry:n}))}ellipseEl(t,e,s,n){const r=wt.createSVGElement("ellipse",{cx:String(t),cy:String(e),rx:String(s),ry:String(n)});return F.insert(this.rootEl,r),r}rect(t,e,s,n){return this.path(new qt({x:t,y:e,width:s,height:n}))}rectEl(t,e,s,n){const r=wt.createSVGElement("rect",{x:String(t),y:String(e),width:String(s),height:String(n)});return F.insert(this.rootEl,r),r}image(t,e,s,n,r){}text(t,e,s,n){const r=wt.createSVGElement("text",{x:String(e),y:String(s)});return F.html(r,t),this.attr(r,Object.assign({"alignment-baseline":"middle"},n)),F.insert(this.rootEl,r),r}textWithTspan(t,e,s,n){const r=n?.["line-height"]||"1.2em",a=wt.createSVGElement("text",{x:String(e),y:String(s)});return t.split(`
|
|
41
|
+
`).forEach((o,h)=>{if(o.trim()){const c=wt.createSVGElement("tspan",{x:String(e),dy:h>0?r:"0"});F.html(c,o),F.insert(a,c),this.attr(c,Object.assign({"alignment-baseline":"middle"},n))}}),F.insert(this.rootEl,a),a}}class Ju extends rt{svgWidth=0;svgHeight=0;width=0;height=0;constructor(t){super(t);const e=new ka(t.svg).parse();for(let s=0,n=e.length;s<n;s++){const r=e[s];if(r.type=="viewbox"&&r.width&&r.height){if(this.svgWidth=parseFloat(r.width),this.svgHeight=parseFloat(r.height),t.width){const l=this.svgWidth/this.svgHeight;this.width=t.width,this.height=this.width/l}else this.width=this.svgWidth,this.height=this.svgHeight;continue}if(r.type!="path"||!fe.isSVGPath(r.path))continue;const a={};for(const l in r)l==="type"||l==="path"||l==="transform"||(a[l]=r[l]);const o=fe.absolutizeSVGPath(fe.parseSVGPath(r.path)),h=[];let c=[];for(let l=0,f=o.length;l<f;l++){const y=o[l];c.push(y),y[0].toLowerCase()=="z"&&(h.push(c),c=[])}c.length&&h.push(c),h.forEach(l=>{const f=Zi(r.transform??"");f.scale(this.width&&this.svgWidth?this.width/this.svgWidth:1),this.addShape(new q({...t,attrs:{...a,...t?.attrs||{}},d:l,originMatrix:f}))})}}shapeInit(){this.trim()}}class Gt extends q{radius;constructor(t){super(t),this.radius=t?.radius||0}getBoundingClientRect(){return{x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2}}toSVGPathData(){return this.radius?[["m",0,-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",0,0]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.radius===t.radius&&this.mass===t.mass}midPointBtw(t){return{x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2}}length(){return Rs(this.x,this.y)}scalar(t){return this.x*=t,this.y*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y;return{x:s*t.x-e*t.y,y:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y}}div(t){return{x:this.x/t.x,y:this.y/t.y}}add(t){return{x:this.x+t.x,y:this.y+t.y}}sub(t){return{x:this.x-t.x,y:this.y-t.y}}dot(t){return this.x*t.x+this.y*t.y}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y}}checkCollision(t){const e=t.x-this.x,s=t.y-this.y;if(Math.sqrt(e*e+s*s)<this.radius+t.radius){const r=Math.atan2(s,e),a={x:0,y:0},o=_t(-r,e,s),h=_t(-r,this.vx,this.vy),c=_t(-r,t.vx,t.vy),l=h.x-c.x;h.x=((this.mass-t.mass)*h.x+2*t.mass*c.x)/(this.mass+t.mass),c.x=l+h.x;const f=Math.abs(h.x)+Math.abs(c.x),y=this.radius+t.radius-Math.abs(a.x-o.x);a.x+=h.x/f*y,o.x+=c.x/f*y;const b=_t(r,a.x,a.y),p=_t(r,o.x,o.y);t.x=this.x+p.x,t.y=this.y+p.y,this.x=this.x+b.x,this.y=this.y+b.y;const E=_t(r,h.x,h.y),_=_t(r,c.x,c.y);this.vx=E.x,this.vy=E.y,t.vx=_.x,t.vy=_.y}}checkWall(t){const e=typeof t?.bounce=="number"?t.bounce:-1,s=t.wall.x,n=t.wall.y,r=t.wall.x+t.wall.width,a=t.wall.y+t.wall.height;this.x+this.radius>r?(this.x=r-this.radius,this.vx*=e):this.x-this.radius<s&&(this.x=s+this.radius,this.vx*=e),this.y+this.radius>a?(this.y=a-this.radius,this.vy*=e):this.y-this.radius<n&&(this.y=n+this.radius,this.vy*=e)}}class La extends q{points;isStraight;constructor(t){if(super(t),this.points=t.points,this.points.length<3)throw new Error("points length must >= 3");this.isStraight=typeof t?.isStraight=="boolean"?t.isStraight:!0}toSVGPathData(){const t=[],e=this.points.length;if(this.isStraight){t.push(["M",this.points[0].x,this.points[0].y]);for(let s=1;s<=e-1;s++)t.push(["L",this.points[s].x,this.points[s].y]);t.push(["Z"])}else{const s=(this.points[0].x+this.points[e-1].x)/2,n=(this.points[0].y+this.points[e-1].y)/2;t.push(["M",s,n]);for(let r=0;r<e-1;r++){const a=(this.points[r].x+this.points[r+1].x)/2,o=(this.points[r].y+this.points[r+1].y)/2;t.push(["Q",this.points[r].x,this.points[r].y,a,o])}t.push(["Q",this.points[e-1].x,this.points[e-1].y,s,n])}return t}toCanvasContext(t){t.beginPath();const e=this.points.length;if(this.isStraight){t.moveTo(this.points[0].x,this.points[0].y);for(let s=1;s<=e-1;s++)t.lineTo(this.points[s].x,this.points[s].y);t.closePath()}else{const s=(this.points[0].x+this.points[e-1].x)/2,n=(this.points[0].y+this.points[e-1].y)/2;t.moveTo(s,n);for(let r=0;r<e-1;r++){const a=(this.points[r].x+this.points[r+1].x)/2,o=(this.points[r].y+this.points[r+1].y)/2;t.quadraticCurveTo(this.points[r].x,this.points[r].y,a,o)}t.quadraticCurveTo(this.points[e-1].x,this.points[e-1].y,s,n)}}isContainPoint(t,e){const s=this.points.length;let n=!1;const r=2e-10;for(let a=0,o=s-1;a<s;o=a,a++){const h=this.points[a].x,c=this.points[a].y,l=this.points[o].x,f=this.points[o].y;if(h===t&&c===e||l===t&&f===e||e===c&&e===f)return!0;if(e>=c&&e<f||e<c&&e>=f){const y=(l-h)/(f-c),b=h+y*(e-c);if(b===t||Math.abs(b-t)<r)return!0;b>t&&(n=!n)}}return n}[Symbol.iterator](){let t=-1;return{next:()=>({value:t<=this.points.length-1?this.points[++t]:void 0,done:t>=this.points.length})}}}class qt extends q{width;height;borderRadius;constructor(t){super(t),this.width=t.width,this.height=t.height,this.borderRadius=t.borderRadius||0}static fromCubicBezier(t,e,s,n,r,a,o,h){const c=new mt({x:t,y:e,c1x:s,c1y:n,c2x:r,c2y:a,toX:o,toY:h});return new qt(c.getBoundingClientRect())}getBoundingClientRect(){return{x:this.x,y:this.y,width:this.width,height:this.height}}toSVGPathData(){return this.borderRadius?[["m",this.borderRadius,0],["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",0,0],["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}}class Ra extends q{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}getBoundingClientRect(){return{x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2}}toSVGPathData(){return[["m",0,-this.ry],["a",this.rx,this.ry,0,1,1,0,2*this.ry],["a",this.rx,this.ry,0,1,1,0,-2*this.ry],["z"]]}toCanvasContext(t){t.beginPath(),t.ellipse(0,0,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class Zu extends q{constructor(t){super(t)}toSVGPathData(){return[["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 Ku extends q{constructor(t){super(t)}toSVGPathData(){return[["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 Qu extends q{rx;ry;constructor(t){super(t),this.rx=t?.rx||10,this.ry=t?.ry||10}toSVGPathData(){return[["m",0,0],["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 tf extends q{rx;ry;constructor(t){super(t),this.rx=t?.rx??50,this.ry=t?.ry??50}toSVGPathData(){return[["m",0,0+this.ry*.3],["C",0,0,0-this.rx/2,0,0-this.rx/2,0+this.ry*.3],["C",0-this.rx/2,0+(this.ry+this.ry*.3)/2,0,0+(this.ry+this.ry*.3)/1.4,0,0+this.ry],["C",0,0+(this.ry+this.ry*.3)/1.8,0+this.rx/2,0+(this.ry+this.ry*.3)/2,0+this.rx/2,0+this.ry*.3],["C",0+this.rx/2,0,0,0,0,0+this.ry*.3],["z"]]}}class ef extends q{r;constructor(t){super(t),this.r=t?.r||20}toSVGPathData(){const t=[["m",0,-this.r]];for(let e=0;e<6;e+=1){const s=288+e*144,n=this.r*Math.cos(N(s)),r=this.r*Math.sin(N(s));t.push(["l",n,r])}return t}}class sf extends q{constructor(t){super(t)}toSVGPathData(){return[["M",0,0],["C",15,0,15,-40,5,-30],["L",0,0],["C",-15,0,-15,-40,-5,-30],["L",0,0],["a",15,15,0,1,1,0,2*15],["a",15,15,0,1,1,0,-2*15]]}}class nf extends q{constructor(t){super(t),this.originD="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 rf extends rt{constructor(t){super(t);const e=new me({...t,x:this.x,y:this.y,toX:this.x,toY:this.y-140-Math.random()*20}),s=30+Math.random()*30,n=new me({...t,x:this.x,y:this.y-s,diffYInGroup:-s,toX:this.x+Math.random()*80-40,toY:this.y-100-Math.random()*40}),r=60+Math.random()*40,a=new me({...t,x:this.x,y:this.y-r,diffYInGroup:-r,toX:this.x+Math.random()*60-30,toY:this.y-110-Math.random()*20});this.addShape([e,n,a])}}class Ke extends q{text;width=0;height=0;constructor(t){super(t),this.text=t.text,this.setAttr({fontSize:"10px",fontFamily:'system-ui, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',emojiFontFamily:'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif',fill:"#666666",stroke:"none","alignment-baseline":"middle",textAnchor:"start",...this.getAttrs()});const e=ni(this.getAttr("fontSize"),10).number,s=ni(this.getAttr("fontWeight"),400).number,n=F.measureText(this.text,e,s);this.width=n.width,this.height=n.height}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){t.fillText(this.text,0,0)}}class Oa extends rt{text;bg;padding;offset;isShow;textShape;bgShape;constructor(t){super(t),this.text=t.text,this.bg=t.bg||"rgba(0,0,0,0.5)",this.padding=t.padding||4,this.offset=t.offset||20,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!1,this.textShape=new Ke({...t,x:this.x+this.offset,y:this.y+this.offset,text:this.text,attrs:{...this.getAttrs(),fill:We(this.bg).opposite(!0).toString(),textAnchor:"start"}}),this.bgShape=new qt({...t,x:this.textShape.x-this.padding,y:this.textShape.y-this.textShape.height/2-this.padding,width:this.textShape.width+this.padding*2,height:this.textShape.height+this.padding*2,attrs:{...this.getAttrs(),fill:this.bg}}),this.addShape([this.bgShape,this.textShape])}shapeInit(){yt(()=>{this.textShape.x=this.x+this.offset,this.textShape.y=this.y+this.offset,this.textShape.text=this.text,this.textShape.isShow=this.isShow,this.bgShape.x=this.textShape.x-this.padding,this.bgShape.y=this.textShape.y-this.textShape.height/2-this.padding,this.bgShape.width=this.textShape.width+this.padding*2,this.bgShape.height=this.textShape.height+this.padding*2,this.bgShape.isShow=this.isShow})}}class af extends rt{radius;expandRaidus;startDegree;endDegree;text="";defaultShowText;tip="";p1=new Gt;p1Offset=10;p2=new Gt;p2Offset=40;p3=new Gt;p3Offset=10;p4=new Gt;p4Offset=10;direction=1;sectorArc;line12;line23;textShape;tipShape;constructor(t){super(t),this.radius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.text=t.text||"",this.defaultShowText=typeof t?.defaultShowText=="boolean"?t.defaultShowText:!!this.text,this.tip=t.tip||"",this.sectorArc=new Fa({x:this.x,y:this.y,radius:this.radius,expandRaidus:this.expandRaidus,startDegree:this.startDegree,endDegree:this.endDegree,attrs:Object.assign({...this.getAttrs()},{strokeWidth:"0"})}),this.addShape(this.sectorArc);const e=Object.assign({...this.getAttrs()},{fill:"none"});this.line12=new me({x:this.p1.x,y:this.p1.y,toX:this.p2.x,toY:this.p2.y,attrs:{...e},isShow:this.defaultShowText}),this.line23=new me({x:this.p2.x,y:this.p2.y,toX:this.p3.x,toY:this.p3.y,attrs:{...e},isShow:this.defaultShowText}),this.textShape=new Ke({x:this.p4.x,y:this.p4.y,text:this.text,attrs:{stroke:e.stroke,textAnchor:this.direction==1?"start":"end"},isShow:this.defaultShowText}),this.text&&(this.addShape(this.line12),this.addShape(this.line23),this.addShape(this.textShape)),this.tipShape=new Oa({x:0,y:0,text:this.tip,isShow:!1}),this.tip&&this.addShape(this.tipShape)}frameUpdate(t){this.text&&!this.defaultShowText&&(this.line12.isShow=this.sectorArc.isMouseIn,this.line23.isShow=this.sectorArc.isMouseIn,this.textShape.isShow=this.sectorArc.isMouseIn);const e=this.startDegree+(this.endDegree-this.startDegree)/2,{dx:s,dy:n}=Rt(N(e),this.sectorArc.radius+this.p1Offset);this.p1.x=this.x+s,this.p1.y=this.y+n;const{dx:r,dy:a}=Rt(N(e),this.sectorArc.radius+this.p1Offset+this.p2Offset);this.p2.x=this.x+r,this.p2.y=this.y+a,this.line12.x=this.p1.x,this.line12.y=this.p1.y,this.line12.toX=this.p2.x,this.line12.toY=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.x=this.p2.x,this.line23.y=this.p2.y,this.line23.toX=this.p3.x,this.line23.toY=this.p3.y,this.textShape.x=this.p4.x,this.textShape.y=this.p4.y,this.textShape.setAttr("textAnchor",this.direction==1?"start":"end"),this.sectorArc.isMouseIn?(this.tipShape.isShow=!0,this.tipShape.x=t.x,this.tipShape.y=t.y):(this.tipShape.isShow=!1,this.tipShape.x=t.x,this.tipShape.y=t.y)}}class Fa extends q{radius;realRadius;expandRaidus;startDegree;endDegree;vr;ar;bounce;durationTime;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.durationTime=1e3/120,this.status=0}frameUpdate(){this.status==0&&this.radius<this.realRadius?(this.expand(this.realRadius),this.radius>=this.realRadius&&(this.status=1)):this.isMouseIn?this.expand(this.realRadius+this.expandRaidus):this.shrink(this.realRadius)}expand(t){this.vr+=this.ar,this.radius+=this.vr*this.durationTime,this.radius>t&&(this.radius=t,this.vr*=-this.bounce)}shrink(t){this.vr-=this.ar,this.radius+=this.vr*this.durationTime,this.radius<t&&(this.radius=t,this.vr*=-this.bounce)}toSVGPathData(){const{dx:t,dy:e}=Rt(N(this.startDegree),this.radius),{dx:s,dy:n}=Rt(N(this.endDegree),this.radius);return[["m",0,0],["l",t,e],["a",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,s-t,n-e],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.arc(0,0,this.radius,N(this.startDegree),N(this.endDegree),!1),t.closePath()}containPoint(t,e){const s=Os(this.x,this.y,t,e),n=nt(ie(this.x,this.y,t,e));return s<=this.radius&&n>=this.startDegree&&n<=this.endDegree}}class of extends rt{showFlame;ship;flame;constructor(t){super(t),this.showFlame=typeof t?.showFlame=="boolean"?t.showFlame:!1,this.ship=new q({...t,d:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]]}),this.addShape(this.ship),this.flame=new q({...t,isShow:this.showFlame,d:[["m",-10,-5],["l",-7.5,5],["l",7.5,5],["z"]]}),this.addShape(this.flame)}shapeInit(){yt(()=>{this.ship.x=this.x,this.ship.y=this.y,this.flame.x=this.x,this.flame.y=this.y,this.flame.isShow=this.showFlame})}}class hf extends rt{value;backgroundRect;occupyRect;handle;constructor(t){super(t);const e=t?.min||0,s=t?.max||100,n=t?.step||1,r=fo(e,s,n);this.value=r(typeof t?.defaultValue=="number"?j(t.defaultValue,e,s):e);const a=this.value/(s-e),o=t?.barWidth||100,h=t?.barHeight||4,c=t?.handleRadius||10,l=h*.5,f=t?.barColor||Qi.colorGrayF5,y=t?.handleColor||Qi.colorPrimary;this.backgroundRect=new qt({x:this.x,y:this.y,width:o,height:h,borderRadius:l,attrs:{fill:f},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.backgroundRect),this.occupyRect=new qt({x:this.x,y:this.y,width:o*a,height:h,borderRadius:l,attrs:{fill:y},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.occupyRect),this.handle=new Gt({x:this.x+o*a,y:this.y+l,diffXInGroup:o*a,diffYInGroup:l,radius:c,alongPath:new Gl({x:this.x,y:this.y+l,d:[["m",0,0],["l",o,0]]}),attrs:{fill:y},enableDrag:!0,independentTransformInGroup:!0}),this.addShape(this.handle),this.handle.on("draging",b=>{this.occupyRect.width=j(this.occupyRect.width+b,0,o),this.value=r((this.handle.x-this.x)/o*(s-e)+e),this.emit("change",this.value)})}}class cf extends rt{width;height;cornerRadius;controlPoint;mainRect;rightPoint;constructor(t){super(t),this.width=t.width,this.height=t.height,this.cornerRadius=this.height/2,this.controlPoint=new Gt({...t,x:this.x,y:this.y,radius:2}),this.forceSetCXY(this.controlPoint.cX,this.controlPoint.cY),this.mainRect=new qt({...t,x:this.x-this.cornerRadius,y:this.y-this.cornerRadius,diffXInGroup:-this.cornerRadius,diffYInGroup:-this.cornerRadius,width:this.width+this.cornerRadius*2,height:this.height,borderRadius:this.cornerRadius}),this.rightPoint=new Gt({...t,x:this.x+this.width,y:this.y,diffXInGroup:this.width,radius:2}),this.addShape([this.mainRect,this.controlPoint,this.rightPoint])}getPin(){return{x:this.controlPoint.x+Math.cos(N(this.controlPoint.degree))*this.width,y:this.controlPoint.y+Math.sin(N(this.controlPoint.degree))*this.width}}}class cn extends q{extendDegree;radius;startDegree;endDegree;diffDegree;constructor(t){super(t),this.extendDegree=t?.extendDegree||0,this.x=(t.x||0)+t.width/2;const e=Math.min(t.width/2,t.height)-t.lineWidth;this.radius=e-e*Math.abs(Math.sin(N(this.extendDegree))),this.y=(t.y||0)+t.height-t.lineWidth-this.radius*Math.abs(Math.sin(N(this.extendDegree))),this.diffDegree=t.endDegree-t.startDegree,this.startDegree=180+t.startDegree-this.extendDegree,this.endDegree=180+t.endDegree+this.extendDegree,this.setAttr({"stroke-linecap":"round","stroke-width":String(t.lineWidth),stroke:t.color||"none"})}setPercent(t){this.endDegree=this.startDegree+(this.diffDegree+this.extendDegree*2)*t}toSVGPathData(){const{dx:t,dy:e}=Rt(N(this.startDegree),this.radius),{dx:s,dy:n}=Rt(N(this.endDegree),this.radius);return[["m",t,e],["a",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,s-t,n-e]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,N(this.startDegree),N(this.endDegree),!1)}}class lf extends rt{percent=0;ringBg;ring;lines=[];bgColor;startColor;endColor;indicatorLineCount;constructor(t){super(t);const e=t?.startDegree||0,s=t?.endDegree||180,n=t?.extendDegree||15,r=t?.lineWidth||12;this.bgColor=t?.bgColor||"#B3C6E7",this.startColor=t?.startColor||"#5A82F0",this.endColor=t?.endColor||"#66B3FF",this.percent=t?.percent||0,this.indicatorLineCount=22+1;const a=20,o=2,h=17;this.ringBg=new cn({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:n,lineWidth:r,color:this.bgColor}),this.addShape(this.ringBg),this.ring=new cn({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:n,lineWidth:r}),this.addShape(this.ring);const c=this.ringBg.y-this.ringBg.radius+a;for(let l=0;l<this.indicatorLineCount;l++)this.lines.push(new me({...t,centerX:this.ringBg.x,centerY:this.ringBg.y,x:this.ringBg.x,y:c,toX:this.ringBg.x,toY:c+h,degree:this.ringBg.startDegree+90+(s-e+n*2)/(this.indicatorLineCount-1)*l,attrs:{"stroke-linecap":"round","stroke-width":String(o),stroke:this.bgColor}}));this.addShape(this.lines)}setPercent(t){this.percent=t}shapeInit(){this.on("draging",(t,e,s)=>{this.shapes.forEach(n=>{n!=s&&(n.x+=t,n.y+=e)})})}frameUpdate(t,e){const s=this.ringBg.radius-this.ringBg.radius*Math.cos(Math.PI*this.percent),n=this.ringBg.radius*Math.sin(Math.PI*this.percent);if(e){const r=e.createLinearGradient(-this.ringBg.radius,0,-this.ringBg.radius+s,-n,{0:this.startColor,1:this.endColor});this.ring.setAttr({stroke:r})}else this.ring.setAttr({stroke:this.startColor});this.ring.setPercent(this.percent);for(let r=0;r<this.indicatorLineCount;r++){const a=r/(this.indicatorLineCount-1)<=this.percent;this.lines[r].setAttr({stroke:a&&e?e.createLinearGradient(0,0,this.lines[r].toX-this.lines[r].x,this.lines[r].toY-this.lines[r].y,{0:this.startColor,1:this.endColor}):a?this.startColor:this.bgColor})}}}class uf extends q{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=j(t,0,1),this.brightness}toSVGPathData(){return[]}}const ff=uf;class df extends q{points;light;constructor(t=[]){if(t.length<3)throw new Error("points length must >= 3");super(),this.points=t,this.light=new ff({x:0,y:0,z:0,brightness:1})}toSVGPathData(){const t=[];t.push(["M",this.points[0].getScreenX(),this.points[0].getScreenY()]);for(let e=0,s=this.points.length;e<=s-1;e++)t.push(["L",this.points[e].getScreenX(),this.points[e].getScreenY()]);return t.push(["L",this.points[0].getScreenX(),this.points[0].getScreenY()]),t}toCanvasContext(t){t.beginPath(),t.moveTo(0,0);for(let e=0,s=this.points.length;e<=s-1;e++)t.lineTo(this.points[e].getScreenX()-this.points[0].getScreenX(),this.points[e].getScreenY()-this.points[0].getScreenY());t.lineTo(0,0)}get length(){return this.points.length}getDepth(){return Math.min(...this.points.map(t=>t.z))}isBackface(){const t=this.points[2].getScreenX()-this.points[0].getScreenX(),e=this.points[2].getScreenY()-this.points[0].getScreenY(),s=this.points[1].getScreenX()-this.points[2].getScreenX(),n=this.points[1].getScreenY()-this.points[2].getScreenY();return t*n>e*s}getLightFactor(){const t={x:this.points[0].x-this.points[1].x,y:this.points[0].y-this.points[1].y,z:this.points[0].z-this.points[1].z},e={x:this.points[1].x-this.points[2].x,y:this.points[1].y-this.points[2].y,z:this.points[1].z-this.points[2].z},s={x:t.y*e.z-t.z*e.y,y:-(t.x*e.z-t.z*e.x),z:t.x*e.y-t.y*e.x},n=s.x*this.light.x+s.y*this.light.y+s.z*this.light.z,r=Math.sqrt(s.x*s.x+s.y*s.y+s.z*s.z),a=Math.sqrt(this.light.x*this.light.x+this.light.y*this.light.y+this.light.z*this.light.z);return Math.acos(n/(r*a))/Math.PI*this.light.brightness}getAdjustedColor(t){const e=We(t),s=this.getLightFactor();return e.r*=s,e.g*=s,e.b*=s,e.toString()}}class mf extends rt{fettis=[];constructor(t,e,s){super();const{shape:n,x:r,y:a,particleCount:o,angle:h,spread:c,startVelocity:l,decay:f,gravity:y,drift:b,ticks:p,colors:E,scalar:_,flat:v}=Object.assign({shape:qt,x:.5,y:.6,particleCount:100,angle:90,spread:70,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,colors:ya,scalar:1,flat:!1},s||{}),x=N(h),w=N(c);let g=o;for(;g--;){const P=E[g%E.length],C=new n({x:t*r,y:e*a,width:10,height:10,scalar:_,attrs:{fill:P},independentTransformInGroup:!0});this.addShape(C),this.fettis.push({shape:C,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:l*.5+Math.random()*l,angle2D:-x+(.5*w-Math.random()*w),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,tick:0,totalTicks:p,decay:f,drift:b,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:y*3,scalar:_,flat:v,color:We(P)})}}frameUpdate(t){this.fettis.length&&(this.fettis=this.fettis.filter(e=>{e.shape.x+=Math.cos(e.angle2D)*e.velocity+e.drift,e.shape.y+=Math.sin(e.angle2D)*e.velocity+e.gravity,e.velocity*=e.decay,e.flat?(e.wobble=0,e.wobbleX=e.shape.x+10*e.scalar,e.wobbleY=e.shape.y+10*e.scalar,e.tiltSin=0,e.tiltCos=0,e.random=1):(e.wobble+=e.wobbleSpeed,e.wobbleX=e.shape.x+10*e.scalar*Math.cos(e.wobble),e.wobbleY=e.shape.y+10*e.scalar*Math.sin(e.wobble),e.tiltAngle+=.1,e.tiltSin=Math.sin(e.tiltAngle),e.tiltCos=Math.cos(e.tiltAngle),e.random=Math.random()+2);const s=e.tick++/e.totalTicks,n=e.shape.x+e.random*e.tiltCos,r=e.shape.y+e.random*e.tiltSin,a=e.wobbleX+e.random*e.tiltCos,o=e.wobbleY+e.random*e.tiltSin;return e.shape.setAttr("fill",e.color.setAlpha(1-s).toString()),e.shape.degree=nt(Math.PI/10*e.wobble),e.shape.scalarX=Math.abs(a-n)*.1,e.shape.scalarY=Math.abs(o-r)*.1,e.tick<e.totalTicks}))}}class ln{shapes;constructor(t){this.shapes=t}run(t){this.shapes.forEach(s=>{s.run(),t?.wall&&s.checkWall({wall:t.wall,bounce:t.bounce})});const e=this.shapes.length;for(let s=0,n=e-1;s<n;s++)for(let r=s+1;r<e;r++)this.shapes[s].checkCollision(this.shapes[r])}gravitate(){const t=this.shapes.length;this.shapes.forEach((e,s)=>{e.run();for(let n=s+1;n<t;n++)e.checkCollision(this.shapes[n]),e.gravitateTo(this.shapes[n])})}springChain(t){this.shapes.forEach((e,s)=>{s>0&&e.runSpringTo(this.shapes[s-1],t)})}springConnect(t){const e=Jt(t?.springLength,100);this.shapes.forEach(s=>{s.isDragging||this.shapes.filter(n=>n.id!==s.id).forEach(n=>{const r=ie(s.x,s.y,n.x,n.y);s.runSpringTo({x:n.x-Math.cos(r)*e,y:n.y-Math.sin(r)*e},t)})})}springMass(t,e){const s=this.shapes.length,n=[];return this.shapes.forEach((r,a)=>{r.run(e),r.x>t.x+t.width?r.x=t.x:r.x<t.x&&(r.x=t.x+t.width),r.y>t.y+t.height?r.y=t.y:r.y<t.y&&(r.y=t.y+t.height);for(let o=a+1;o<s;o++)n.push([r.x,r.y,this.shapes[o].x,this.shapes[o].y,r.springMassTo(this.shapes[o],e)])}),n}polymorph(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");const t=this.shapes.length-1,e=new Array(t);for(let n=0;n<t;n++){const r=this.shapes[n].initPathD();this.shapes[n].frameStart();const a=this.shapes[n+1].initPathD();this.shapes[n+1].frameStart();const o=Math.max(r.polymorphPoints.length,a.polymorphPoints.length);e[n]=xt.getPathInterpolator(r.expendFill(o),a.expendFill(o))}const s=new q({d:e[0](0)});return n=>{const r=Mt(t*n,6),a=Math.min(Math.floor(r),t-1),o=Mt(r-a,6);s.originD=e[a](o);const h=this.shapes[a].getAttr("fill","none"),c=this.shapes[a+1].getAttr("fill","none");typeof h=="string"&&typeof c=="string"&&s.setAttr("fill",lt.gradient(h,c,o).toString());const l=this.shapes[a].getAttr("stroke","none"),f=this.shapes[a+1].getAttr("stroke","none");return typeof l=="string"&&typeof f=="string"&&s.setAttr("stroke",lt.gradient(l,f,o).toString()),s}}polymorphGroup(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");let t=0,e;const s=[];this.shapes.forEach(o=>{let h;o instanceof rt?(h=o,h.sortPathD()):(h=new rt,h.addShape(o)),s.push(h),t<h.shapes.length&&(t=h.shapes.length,e=h)}),s.forEach(o=>{o!==e&&o.expendFill(e)});const n=[];s.forEach((o,h)=>{o.shapes.forEach((c,l)=>{n[l]=n[l]||[],n[l][h]=c})});const r=[];n.forEach(o=>{r.push(new ln(o).polymorph())});const a=new rt;return r.forEach(o=>{a.addShape(o(0))}),o=>(r.forEach(h=>{h(o)}),a)}polymorphTween(t=6e3,e){const s=this.shapes.findIndex(o=>o instanceof rt)>=0?this.polymorphGroup():this.polymorph(),n=s(0),r=e?.onUpdate,a=new Ds({frameDuration:t});a.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(o,h)=>{s(o.t),r?.(o,h),e?.draw?.(n)}})),a.play()}static generatePointsShape(t,e,s,n){const r=[];for(let a=0;a<n;a++){const o=a/n*2*Math.PI,{dx:h,dy:c}=Rt(o,s);r.push({x:t+h,y:e+c})}return new La({points:r})}static generateRosettaShape(t,e,s,n,r){if(r==0)throw new Error("no dividing by zero, please");const a=[],o=360/r;for(let h=0;h<r;h+=1){const c=o*h*Math.PI/180,l=t+2*s*Math.cos(c),f=e+2*s*Math.sin(c);a.push(new Wi({x:t,y:e,rx:s,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:l,toY:f})),a.push(new Wi({x:l,y:f,rx:s,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:t,toY:e}))}return new q({d:xt.fromLines(a)})}}const Na={map:new Map,transform:function(i){if(Vr)return i;if(this.map.has(i))return this.map.get(i);const t=new OffscreenCanvas(i.width,i.height);return t.getContext("2d")?.drawImage(i,0,0),this.map.set(i,t),t},clear:function(){this.map.clear()}};function pf(i,t,e){const s=new OffscreenCanvas(i,t),n=s.getContext("2d");if(n)return e(n),s.transferToImageBitmap()}function gf(i,t,e){const s=i.createPattern(Na.transform(t),"no-repeat");if(s){const n=Ki(e);s.setTransform(n),i.fillStyle=s}}class yf{app;ctx;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e=!1){if(this.app=t,!(this.app.container instanceof HTMLCanvasElement))throw new Error("app.container 应该为 HTMLCanvasElement!");this.ctx=new Us(this.app.container,this.app.width,this.app.height,e),this.app.captureDrag({start:()=>{this.isMouseDown=!0,this.dragDx=0,this.dragDy=0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.dragDx=0,this.dragDy=0,this.setCursor()},move:(s,n)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=n.dx,this.dragDy+=n.dy),this.setCursor()}}),this.app.on("tap",()=>{for(let s of this.shapes)if(this.currentMouseInShape==s){s.emit("clicked");let n=s.parent;for(;n;)n.emit("clicked",s),n=n.parent;break}})}setCursor(){this.currentEnableDragMouseInShape?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShape?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}transformCtxBaseOnShape(t){t.usePathDtoCanvasContext||(this.ctx.translate(t.x,t.y),this.ctx.rotate(N(t.degree),t.cX,t.cY),this.ctx.scale(t.scalarX,t.scalarY,t.cX,t.cY))}_addDrawShape(t){this.shapes.push(t),t instanceof rt&&t.shapes.forEach(e=>{this._addDrawShape(e)})}draw(t=[]){this.shapes=[],(Array.isArray(t)?t:[t]).forEach(e=>{this._addDrawShape(e)}),this.isMouseDown&&this.currentEnableDragMouseInShape||(this.currentMouseInShape=void 0);for(let e of this.shapes){if(!e.isShow)continue;if(this.ctx.save(),e.frameStart(this.app.mousePoint),F.attrsToCanvas(this.ctx,e.getAttrs()),e.followMouse&&(!cs(e.x,this.app.mousePoint.x,5)||!cs(e.y,this.app.mousePoint.y,5))&&e.followTo(this.app.mousePoint),e.targetToAfterDragFree&&(this.isMouseDown||e.runEaseTo({x:e.targetToAfterDragFree.targetX,y:e.targetToAfterDragFree.targetY},{easing:e.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShape==e){e.isDragging=!0;const n=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,n||r){if(e.x+=n,e.y+=r,e.alongPath){const a=e.alongPath.closestPoint(e.x,e.y);e.x=a.point.x-e.cX,e.y=a.point.y-e.cY}e.emit("draging",n,r)}}else e.isDragging=!1;e.frameUpdate(this.app.mousePoint,this.ctx),this.transformCtxBaseOnShape(e),e.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill();const s=this.ctx.currentPath2D;if(!this.currentMouseInShape){const n=this.ctx.isPointInPath(s,this.app.mousePoint.x,this.app.mousePoint.y)||this.ctx.isPointInStroke(s,this.app.mousePoint.x,this.app.mousePoint.y)||!1;e.isMouseIn=n,n&&(this.currentMouseInShape=e,e.enableDrag&&(this.currentEnableDragMouseInShape=e))}e.frameEnd(this.app.mousePoint),this.ctx.restore()}this.currentMouseInShape||(this.currentEnableDragMouseInShape=void 0)}drawMouseMoveLine(t="line",e){switch(t){case"brush":const s=e?.brushSize??10,n=e?.brushDensity??50,r=e?.brushColor??"#000000",a=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),o=a.data,h=We(r);return this.app.captureDrag({move:()=>{if(this.isMouseDown){for(let c=0;c<n;c++){const l=Math.random()*Math.PI*2,f=Math.random()*s,y=this.app.mousePoint.x+Math.cos(l)*f|0,b=this.app.mousePoint.y+Math.sin(l)*f|0,p=(y+b*a.width)*4;o[p]=h.r,o[p+1]=h.g,o[p+2]=h.b,o[p+3]=255}this.ctx.putImageData(a)}}});case"line":default:return this.app.captureDrag({start:c=>{this.ctx.beginPath(),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 wf{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new $e(t),this.remoteVideoUtil=new $e(e)}start(){this.getLocalMediaStream().then(t=>{this.call(t)})}end(){this.localPeerConnection?.close(),this.remotePeerConnection?.close(),this.localPeerConnection=null,this.remotePeerConnection=null,this.trace("Ending call.")}getLocalMediaStream(){return new Promise((t,e)=>{navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then(s=>{this.localVideoUtil.setSrcObject(s),t(s)}).catch(s=>{this.trace(`navigator.getUserMedia error: ${s}.`),e(s)})})}gotRemoteMediaStream(t){const e=t.streams[0];this.remoteVideoUtil.setSrcObject(e),this.trace("Remote peer connection received remote stream.")}call(t){const e=t.getVideoTracks(),s=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),s.length>0&&this.trace(`Using audio device: ${s[0].label}.`);const n=void 0,r=new RTCPeerConnection(n);this.localPeerConnection=r,this.trace("Created local peer connection object localPeerConnection."),r.addEventListener("icecandidate",this.handleConnection),r.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const a=new RTCPeerConnection(n);this.remotePeerConnection=a,this.trace("Created remote peer connection object remotePeerConnection."),a.addEventListener("icecandidate",this.handleConnection),a.addEventListener("iceconnectionstatechange",this.handleConnectionChange),a.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),r.addTrack(e[0],t),r.addTrack(s[0],t),this.trace("localPeerConnection createOffer start."),r.createOffer({offerToReceiveVideo:!0}).then(o=>this.createdOffer(o)).catch(o=>this.setSessionDescriptionError(o))}handleConnection(t){const e=t.target,s=t.candidate;if(e&&s){const n=new RTCIceCandidate(s),r=this.getOtherPeer(e);r&&(r.addIceCandidate(n).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
|
|
42
42
|
${t.candidate.candidate}.`))}}handleConnectionSuccess(t){this.trace(`${this.getPeerName(t)} addIceCandidate success.`)}handleConnectionFailure(t,e){this.trace(`${this.getPeerName(t)} failed to add ICE Candidate:
|
|
43
43
|
${e.toString()}.`)}handleConnectionChange(t){const e=t.target;console.log("ICE state change event: ",t),e&&this.trace(`${this.getPeerName(e)} ICE state: ${e.iceConnectionState}.`)}createdOffer(t){this.trace(`Offer from localPeerConnection:
|
|
44
44
|
${t.sdp}`),this.localPeerConnection&&(this.trace("localPeerConnection setLocalDescription start."),this.localPeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.remotePeerConnection&&(this.trace("remotePeerConnection setRemoteDescription start."),this.remotePeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e)),this.trace("remotePeerConnection createAnswer start."),this.remotePeerConnection.createAnswer().then(e=>this.createdAnswer(e)).catch(e=>this.setSessionDescriptionError(e)))}createdAnswer(t){this.trace(`Answer from remotePeerConnection:
|
|
45
|
-
${t.sdp}.`),this.remotePeerConnection&&(this.trace("remotePeerConnection setLocalDescription start."),this.remotePeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.localPeerConnection&&(this.trace("localPeerConnection setRemoteDescription start."),this.localPeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e)))}setSessionDescriptionError(t){this.trace(`Failed to create session description: ${t.toString()}.`)}setDescriptionSuccess(t,e){const s=this.getPeerName(t);this.trace(`${s} ${e} complete.`)}setLocalDescriptionSuccess(t){this.setDescriptionSuccess(t,"setLocalDescription")}setRemoteDescriptionSuccess(t){this.setDescriptionSuccess(t,"setRemoteDescription")}trace(t){t=t.trim();const e=(window.performance.now()/1e3).toFixed(3);console.log(e,t);const s=document.createElement("div");s.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(s)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class sf{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.")}}const Ia=[],Ma={};function on(i){Ia.push(i)}function nf(i,t=!1){const e=ua();if(Ma[e])return;wx.error(r=>{console.log(r.errMsg??JSON.stringify(r))}),wx.ready(()=>{Ia.forEach(r=>r())});const s=["updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","openProductSpecificView","addCard","chooseCard","openCard"],n=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(i,{debug:t,jsApiList:s,openTagList:n})),Ma[e]=!0}function rf(i){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[i],success:function(s){s.checkResult[i]?t(!0):e(!1)},fail:function(){e(!1)}})})}function af(i){on(function(){wx.updateAppMessageShareData(i)})}function of(i){on(function(){wx.updateTimelineShareData(i)})}function hf(i){wx.chooseImage(i)}function cf(i){wx.previewImage(i)}function lf(i){wx.uploadImage(i)}function uf(i){wx.downloadImage(i)}function ff(i){wx.getLocalImgData(i)}function df(){wx.startRecord()}function mf(i){wx.stopRecord(i)}function pf(i){wx.onVoiceRecordEnd(i)}function gf(i){wx.playVoice(i)}function yf(i){wx.pauseVoice(i)}function wf(i){wx.stopVoice(i)}function xf(i){wx.onVoicePlayEnd(i)}function bf(i){wx.uploadVoice(i)}function vf(i){wx.downloadVoice(i)}function Sf(i){wx.translateVoice(i)}function Cf(i){wx.getNetworkType(i)}function Tf(i){wx.openLocation(i)}function Pf(i){wx.getLocation(i)}function Ef(i){wx.scanQRCode(i)}function _f(i,t,e){function s(){WeixinJSBridge.invoke("getBrandWCPayRequest",i,function(n){n.err_msg=="get_brand_wcpay_request:ok"?t():e(n.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",s,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",s),document.attachEvent("onWeixinJSBridgeReady",s)):s()}function Af(i){window.AlipayJSBridge?i&&i():document.addEventListener("AlipayJSBridgeReady",i,!1)}function $e(i,t){let e="未知错误";switch(i.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${i.error}(${e}): ${i.errorMessage}`}function Df(i,t,e){ap.tradePay(Object.assign(i,{}),function(s){let n="未知错误";switch(s.resultCode){case 9e3:return n="订单支付成功",t?.(n);case 8e3:n="正在处理中";break;case 4e3:n="订单支付失败";break;case 6001:n="用户中途取消";break;case 6002:n="网络连接出错";break;case 99:n="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(n)})}function If(i,t,e){ap.scan(Object.assign(i,{fail:s=>{e?.($e(s))}}),function(s){t?.(s.code)})}function Mf(i,t,e){ap.getLocation(Object.assign(i,{fail:s=>{e?.($e(s))}}),function(s){t?.(s)})}function kf(i,t,e){ap.openLocation(Object.assign(i,{fail:s=>{e?.($e(s))}}),function(){t?.()})}function Lf(i,t,e){ap.chooseImage(Object.assign(i,{fail:s=>{e?.($e(s,"chooseImage"))}}),function(s){t?.(s)})}function Rf(i,t,e){ap.previewImage(Object.assign(i,{fail:s=>{e?.($e(s))}}),function(){t?.()})}class Of{map;constructor(t,e=120.619585,s=31.299379,n=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,s),n)}}class Ff{currentPage;itemsPerPage;entriesInterval;entriesEdge;linkTo;prevText;nextText;ellipseText;prevShowAlways;nextShowAlways;callback;totalPages;parentVNode;constructor(t,e,s){this.currentPage=s?.currentPage||0,this.itemsPerPage=s?.itemsPerPage||10,this.entriesInterval=s?.entriesInterval||5,this.entriesEdge=s?.entriesEdge||1,this.linkTo=s?.linkTo||"javascript:;",this.prevText=s?.prevText||"上一页",this.nextText=s?.nextText||"下一页",this.ellipseText=s?.ellipseText||"...",this.prevShowAlways=typeof s?.prevShowAlways=="boolean"?s?.prevShowAlways:!0,this.nextShowAlways=typeof s?.nextShowAlways=="boolean"?s?.nextShowAlways:!0,this.callback=s?.callback||(n=>!1),this.totalPages=Math.ceil(e/this.itemsPerPage),this.parentVNode=this.createParentVNode(),Ce(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return ue("div",{class:"pagination"},[])}appendVNode(t,e,s){e=e<0?0:e<this.totalPages?e:this.totalPages-1;const n=s?.text||String(e+1),r=s?.classes||"";t.children.push(e==this.currentPage&&r.indexOf("prev")==-1&&r.indexOf("next")==-1?ue("span",{class:`current ${r}`},n):ue("a",{class:r,href:this.linkTo.replace(/__id__/,String(e)),onClick:a=>this.selectPage(e,a)},n))}drawLinks(){const t=this.createParentVNode(),e=Math.ceil(this.entriesInterval/2),s=this.currentPage>e?Math.max(Math.min(this.currentPage-e,this.totalPages-this.entriesInterval),0):0,n=this.currentPage>e?Math.min(this.currentPage+e,this.totalPages):Math.min(this.entriesInterval,this.totalPages);if(this.prevText&&(this.currentPage>0||this.prevShowAlways)&&this.appendVNode(t,this.currentPage-1,{text:this.prevText,classes:"prev"}),s>0&&this.entriesEdge>0){const r=Math.min(this.entriesEdge,s);for(let a=0;a<r;a++)this.appendVNode(t,a);this.entriesEdge<s&&this.ellipseText&&t.children.push(ue("span",{},this.ellipseText))}for(let r=s;r<n;r++)this.appendVNode(t,r);if(n<this.totalPages&&this.entriesEdge>0){this.totalPages-this.entriesEdge>n&&this.ellipseText&&t.children.push(ue("span",{},this.ellipseText));const r=Math.max(this.totalPages-this.entriesEdge,n);for(let a=r;a<this.totalPages;a++)this.appendVNode(t,a)}this.nextText&&(this.currentPage<this.totalPages-1||this.nextShowAlways)&&this.appendVNode(t,this.currentPage+1,{text:this.nextText,classes:"next"}),Is(this.parentVNode,t),this.parentVNode=t}selectPage(t,e){this.currentPage=t=t<0?0:t<this.totalPages?t:this.totalPages-1,this.drawLinks();const s=this.callback(t);return e&&(s||(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)),s}prevPage(){return this.selectPage(this.currentPage-1)}nextPage(){return this.selectPage(this.currentPage+1)}}const re={enabled:!1,files:{},add:function(i,t){this.enabled!==!1&&(this.files[i]=t)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class Nf{isLoading=!1;itemsLoaded=0;itemsTotal=0;urlModifier;handlers=[];_onStart;_onLoad;_onProgress;_onError;constructor(t){this._onStart=t?.onStart,this._onLoad=t?.onLoad,this._onProgress=t?.onProgress,this._onError=t?.onError}itemStart(t){this.itemsTotal++,this.isLoading===!1&&this._onStart?.(t,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(t){this.itemsLoaded++,this._onProgress?.(t,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this._onLoad?.())}itemError(t){this._onError?.(t)}resolveURL(t){return this.urlModifier?this.urlModifier(t):t}setURLModifier(t){return this.urlModifier=t,this}addHandler(t,e){return this.handlers.push(t,e),this}removeHandler(t){const e=this.handlers.indexOf(t);return e!==-1&&this.handlers.splice(e,2),this}getHandler(t){for(let e=0,s=this.handlers.length;e<s;e+=2){const n=this.handlers[e],r=this.handlers[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return r}return null}}const Bf=new Nf;class Yf{static DEFAULT_MATERIAL_NAME="__DEFAULT";manager;crossOrigin;withCredentials;path;resourcePath;requestHeader;constructor(t){this.manager=t!==void 0?t:Bf,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(t,e){}loadAsync(t,e){return new Promise((s,n)=>{this.load(t,{onLoad:s,onProgress:e,onError:n})})}parse(t){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const Vs=Yf;class Uf extends Vs{constructor(t){super(t)}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=re.get(t);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s;const n=L.createElementNS("img"),r=()=>{o(),re.add(t,n),e?.onLoad?.(n),this.manager.itemEnd(t)},a=h=>{o(),e?.onError?.(h),this.manager.itemError(t),this.manager.itemEnd(t)};function o(){n.removeEventListener("load",r,!1),n.removeEventListener("error",a,!1)}return n.addEventListener("load",r,!1),n.addEventListener("error",a,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(n.crossOrigin=this.crossOrigin),this.manager.itemStart(t),n.src=t,n}}class Xf extends Vs{isImageBitmapLoader=!0;options;constructor(t){super(t),typeof createImageBitmap>"u"&&console.warn("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=re.get(t);if(s!==void 0){if(this.manager.itemStart(t),s.then){s.then(r=>{e?.onLoad?.(r),this.manager.itemEnd(t)}).catch(r=>{e?.onError?.(r)});return}return setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s}const n=fetch(t,{credentials:this.crossOrigin==="anonymous"?"same-origin":"include",headers:this.requestHeader}).then(r=>r.blob()).then(r=>createImageBitmap(r,Object.assign(this.options,{colorSpaceConversion:"none"}))).then(r=>(re.add(t,r),e?.onLoad?.(r),this.manager.itemEnd(t),r)).catch(r=>{e?.onError?.(r),re.remove(t),this.manager.itemError(t),this.manager.itemEnd(t)});re.add(t,n),this.manager.itemStart(t)}}const qt={};class Vf extends Error{response;constructor(t,e){super(t),this.response=e}}class ka extends Vs{mimeType;responseType="";constructor(t){super(t),typeof fetch>"u"&&console.warn("FileLoader: fetch() not supported.")}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=re.get(t);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s;if(qt[t]!==void 0){qt[t].push({onLoad:e?.onLoad,onProgress:e?.onProgress,onError:e?.onError});return}qt[t]=[],qt[t].push({onLoad:e?.onLoad,onProgress:e?.onProgress,onError:e?.onError});const n=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),r=this.mimeType,a=this.responseType;fetch(n).then(o=>{if(o.status===200||o.status===0){if(o.status===0&&console.warn("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||o.body===void 0||o.body?.getReader===void 0)return o;const h=qt[t],c=o.body.getReader(),l=o.headers.get("X-File-Size")||o.headers.get("Content-Length"),f=l?parseInt(l):0,y=f!==0;let b=0;const p=new ReadableStream({start(E){_();function _(){c.read().then(({done:v,value:x})=>{if(v)E.close();else{b+=x.byteLength;const w=new ProgressEvent("progress",{lengthComputable:y,loaded:b,total:f});for(let g=0,P=h.length;g<P;g++)h[g].onProgress?.(w);E.enqueue(x),_()}},v=>{E.error(v)})}}});return new Response(p)}else throw new Vf(`fetch for "${o.url}" responded with ${o.status}: ${o.statusText}`,o)}).then(o=>{switch(a){case"arraybuffer":return o.arrayBuffer();case"blob":return o.blob();case"document":return o.text().then(h=>new DOMParser().parseFromString(h,r));case"json":return o.json();default:if(r===void 0)return o.text();{const c=/charset="?([^;"\s]*)"?/i.exec(r),l=c&&c[1]?c[1].toLowerCase():void 0,f=new TextDecoder(l);return o.arrayBuffer().then(y=>f.decode(y))}}}).then(o=>{re.add(t,o);const h=qt[t];delete qt[t];for(let c=0,l=h.length;c<l;c++)h[c].onLoad?.(o)}).catch(o=>{const h=qt[t];if(h===void 0)throw this.manager.itemError(t),o;delete qt[t];for(let c=0,l=h.length;c<l;c++)h[c].onError?.(o);this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class Gf extends Vs{constructor(t){super(t)}load(t,e){const s=new ka(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,{onLoad:n=>{try{const r=n.slice(0);new AudioContext().decodeAudioData(r,o=>{e?.onLoad?.(o)}).catch(o=>{e?.onError?.(o),this.manager.itemError(t)})}catch(r){e?.onError?.(r),this.manager.itemError(t)}},onProgress:e?.onProgress,onError:e?.onError})}}d.Arrow=Ou,d.AudioLoader=Gf,d.BezierEasing=Ri,d.CSSToJSEasing=Hc,d.Clock=Ni,d.Color=lt,d.CommonKeyCode=Sc,d.Confetti=Zu,d.ControlsColorPattern=de,d.Cross=Xu,d.CustomCanvasContext=Ne,d.CustomCanvasGradient=Os,d.CustomCanvasPattern=zi,d.DOMEventBus=oa,d.DOMParse=ha,d.DOMSVGUtil=fe,d.DOMToBlob=br,d.DOMToString=vi,d.DOMUtil=L,d.DOMVideo=Ge,d.Easing=R,d.Ellipse=Ea,d.FetchWithAxios=wr,d.FetchWithAxiosRequestCancel=xr,d.FileLoader=ka,d.FileUpload=Xh,d.Fox=Fu,d.Heart=Nu,d.HeartVariant=Bu,d.ImageBitmapLoader=Xf,d.ImageLoader=Uf,d.Interpolation=Vt,d.Line=me,d.LinePicture=Ru,d.LineQuadraticBezier=ku,d.MVVM=kl,d.Matrix=ct,d.Matrix3D=mt,d.NormalColors=ca,d.Pagination=Ff,d.Point=zt,d.Point3D=Xe,d.Point3Ds=Ju,d.Points=Pa,d.QRCode=ne,d.Rabbit=Uu,d.Rect=Ht,d.Ring=rn,d.RingIndicator=ju,d.SVGParse=Ta,d.SVGParsedPathArgsLength=Ue,d.Sector=Gu,d.SectorArc=Aa,d.Segment=qu,d.Shape=H,d.ShapeCombo=an,d.ShapeGroup=rt,d.Ship=zu,d.Slider=Hu,d.Star=Yu,d.TWEEN=Qc,d.Text=je,d.Timeline=Es,d.Tip=_a,d.Tree=Vu,d.Tween=Fi,d.WebGLRenderer=sf,d.WebRTCClient=ef,d.WebSocketClient=Ll,d.YZCanvas=tf,d.YZCanvasContext=Fs,d.YZMessageChannel=Xl,d.YZSVG=Lu,d.YZWorker=Ul,d.addWatermark=Eu,d.addWxJsReadyFnBeforeConfig=on,d.ajax=Vl,d.aliJsChooseImage=Lf,d.aliJsGetLocation=Mf,d.aliJsOpenLocation=kf,d.aliJsPreviewImage=Rf,d.aliJsReady=Af,d.aliJsScan=If,d.aliJsTradePay=Df,d.angle=se,d.appendURL=Zi,d.appendURLRecord=Bl,d.atomReadAttribute=$r,d.atomReadAttributes=Gi,d.atomReadStyle=el,d.atomReadStyles=Xi,d.atomRemoveAttribute=il,d.atomRemoveDataset=rl,d.atomRemoveStyle=Vi,d.atomWriteStyle=As,d.base64EncodeOutputStream=wa,d.bitmapMapper=Da,d.blobToRawImage=Kl,d.byteArrayOutputStream=tn,d.canDrawBitmap=Fr,d.canUsePaths=yc,d.canUseWorker=Or,d.changeBrightness=Tu,d.changeDiaphaneity=Pu,d.changeSize=Cu,d.checkWxJsApi=rf,d.clearCookies=Gh,d.color=ze,d.computeImageDisplayRect=zl,d.createXMLHttpRequest=ma,d.dispatchEvent=Er,d.distance=ks,d.distance2=Ls,d.drawBitmapInCanvas=Qu,d.drawQRCodeToCanvas=Mu,d.easeNameToCubicBezier=Oi,d.fileOrBlobToDataURL=Ki,d.flipSideToSide=tu,d.flipUpsideDown=eu,d.flushURL=da,d.flushURLRecord=Nl,d.formDataToString=fa,d.fpsTask=kc,d.getBitmapFromCanvas=Ku,d.getBodyPosition=Tl,d.getBrowserClient=Ti,d.getBrowserClientVersion=nc,d.getBrowserLanguage=ac,d.getDOMMatrix=$i,d.getDirection=cl,d.getDocumentElementPosition=Ve,d.getElementPositionInPage=na,d.getElementPositionInPage2=_l,d.getElementPositionInViewport=ra,d.getFileExtension=Sr,d.getFileMD5Hash=Tr,d.getFileTypeFromFile=Uh,d.getFilesImageInfo=ql,d.getFormSubmitData=Gl,d.getImageAspectRatio=Hl,d.getImageDataByAIData=Au,d.getImageDataFromBitmap=$l,d.getImageDataFromUrl=pa,d.getImageDataFromVideo=jl,d.getImageMainColor=Ql,d.getInternetExplorerVersion=Mr,d.getMousePositionInElement=_t,d.getMousePositionInPage=aa,d.getMousePositionInViewport=Il,d.getOperatingSystem=vs,d.getOperatingSystemVersion=ic,d.getPageSize=El,d.getParameters=Yl,d.getRawImageInfo=Xs,d.getRelativeBoundingClientRect=Al,d.getScreenPosition=Cl,d.getStyle=ee,d.getTimeZone=oc,d.getURL=Bs,d.getUserGeolocationPromise=rc,d.getVerticalScrollPercentInPage=Dl,d.getViewportSize=Pl,d.getVnode=Bi,d.gifImage=xa,d.h=ue,d.hFromEl=Ds,d.hasDocument=mc,d.hasHistory=pc,d.hasWindow=Rr,d.imageDataToBitmap=Wl,d.imageDataToBlob=Zl,d.imageDataToDataURL=Jl,d.immediateVnode=tl,d.injectStyle=sl,d.injectWxJsConfig=nf,d.isAliBrowser=Lr,d.isAliMiniProgram=dc,d.isAndroid=Ir,d.isAppleDevice=hc,d.isBrowserSupportFileAPI=gc,d.isElement=wc,d.isIE=lc,d.isIE9or10=uc,d.isIOS=Pi,d.isMacOS=Ei,d.isMobile=cc,d.isNative=Ss,d.isURL=Ol,d.isWxBrowser=kr,d.isWxMiniProgram=fc,d.jpgToPng=xu,d.leftRotate=su,d.length=Ms,d.linkExport=ws,d.mapTDTJSSDK=Of,d.marginSharpen=wu,d.microTask=Fc,d.mosaic=_u,d.mount=Ce,d.multiplyArrayOfMatrix=xl,d.multiplyArrayOfMatrix3D=bl,d.multiplyMatrix=ea,d.multiplyMatrix3D=sa,d.nextTick=Oc,d.normalizePoint=hl,d.objectSignature=yr,d.onDocumentReady=_c,d.outputGifBase64=ba,d.outputQRCodeBase64=Iu,d.parseTransformToMatrix=ji,d.parseURL=la,d.patch=Is,d.pngToJpg=bu,d.polar=Rt,d.prefixes=xc,d.radiusClip=Su,d.readFileInBrowser=xs,d.recordToString=Ys,d.rectClip=vu,d.requestAnimationFrameCycle=Ai,d.reverseCSSToJSEasing=qc,d.reverseEaseNameToCubicBezier=zr,d.reverseEasing=Yr,d.rightRotate=iu,d.rotatePoint=Et,d.scheduleIdle=Nr,d.scheduleVnode=Yi,d.scheduleYZIdle=ki,d.selectFileInBrowser=vr,d.setIntervalAccurate=Mc,d.setRem=Rl,d.setStyle=Ui,d.setTimeoutAccurate=Di,d.sharpen=yu,d.signature=gr,d.simulateMouseEventFromTouch=Zh,d.singletonDOMEventBus=Ml,d.stringToDOM=Yh,d.stringToRecord=Fl,d.theme=Wi,d.toBlackAndWhite=au,d.toBlue=lu,d.toBlueAndGreen=du,d.toBlueAndGrey=gu,d.toDegree=nt,d.toGreen=cu,d.toGreenAndGrey=pu,d.toGrey=nu,d.toGrey2=ru,d.toOpposite=ou,d.toRadian=N,d.toRed=hu,d.toRedAndBlue=fu,d.toRedAndGreen=uu,d.toRedAndGrey=mu,d.transformPath2D=wl,d.trimURLHash=ua,d.useAttribute=le,d.useClipboard=al,d.useCookie=Vh,d.useDataset=nl,d.useEmit=bs,d.useEventListener=yt,d.useFireEvent=Jh,d.useHotKey=_i,d.useHotKeyFileLoop=Tc,d.useHotKeyFileOnce=Cc,d.useLinkExport=Ec,d.useLoadLink=Dc,d.useLoadScript=Ac,d.useLocalStorage=Pr,d.useMedia=_r,d.useObjectURL=Pc,d.usePreventScroll=sc,d.useRunInSandbox=ol,d.useScroll=ec,d.useSelectFile=Ci,d.useTheme=Kh,d.useThemeToggle=Qh,d.useWindowChange=tc,d.waitForStyleSheetsLoaded=Ic,d.wxJsChooseImage=hf,d.wxJsDownloadImage=uf,d.wxJsDownloadVoice=vf,d.wxJsGetLocalImgData=ff,d.wxJsGetLocation=Pf,d.wxJsGetNetworkType=Cf,d.wxJsOnVoicePlayEnd=xf,d.wxJsOnVoiceRecordEnd=pf,d.wxJsOpenLocation=Tf,d.wxJsPauseVoice=yf,d.wxJsPay=_f,d.wxJsPlayVoice=gf,d.wxJsPreviewImage=cf,d.wxJsScanQRCode=Ef,d.wxJsStartRecord=df,d.wxJsStopRecord=mf,d.wxJsStopVoice=wf,d.wxJsTranslateVoice=Sf,d.wxJsUpdateAppMessageShareData=af,d.wxJsUpdateTimelineShareData=of,d.wxJsUploadImage=lf,d.wxJsUploadVoice=bf,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
45
|
+
${t.sdp}.`),this.remotePeerConnection&&(this.trace("remotePeerConnection setLocalDescription start."),this.remotePeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.localPeerConnection&&(this.trace("localPeerConnection setRemoteDescription start."),this.localPeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e)))}setSessionDescriptionError(t){this.trace(`Failed to create session description: ${t.toString()}.`)}setDescriptionSuccess(t,e){const s=this.getPeerName(t);this.trace(`${s} ${e} complete.`)}setLocalDescriptionSuccess(t){this.setDescriptionSuccess(t,"setLocalDescription")}setRemoteDescriptionSuccess(t){this.setDescriptionSuccess(t,"setRemoteDescription")}trace(t){t=t.trim();const e=(window.performance.now()/1e3).toFixed(3);console.log(e,t);const s=document.createElement("div");s.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(s)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class xf{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.")}}const Ba=[],Ua={};function un(i){Ba.push(i)}function bf(i,t=!1){const e=xa();if(Ua[e])return;wx.error(r=>{console.log(r.errMsg??JSON.stringify(r))}),wx.ready(()=>{Ba.forEach(r=>r())});const s=["updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","openProductSpecificView","addCard","chooseCard","openCard"],n=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(i,{debug:t,jsApiList:s,openTagList:n})),Ua[e]=!0}function vf(i){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[i],success:function(s){s.checkResult[i]?t(!0):e(!1)},fail:function(){e(!1)}})})}function Sf(i){un(function(){wx.updateAppMessageShareData(i)})}function Cf(i){un(function(){wx.updateTimelineShareData(i)})}function Tf(i){wx.chooseImage(i)}function Pf(i){wx.previewImage(i)}function Ef(i){wx.uploadImage(i)}function _f(i){wx.downloadImage(i)}function Af(i){wx.getLocalImgData(i)}function Df(){wx.startRecord()}function Mf(i){wx.stopRecord(i)}function If(i){wx.onVoiceRecordEnd(i)}function kf(i){wx.playVoice(i)}function Lf(i){wx.pauseVoice(i)}function Rf(i){wx.stopVoice(i)}function Of(i){wx.onVoicePlayEnd(i)}function Ff(i){wx.uploadVoice(i)}function Nf(i){wx.downloadVoice(i)}function Bf(i){wx.translateVoice(i)}function Uf(i){wx.getNetworkType(i)}function Yf(i){wx.openLocation(i)}function Xf(i){wx.getLocation(i)}function Vf(i){wx.scanQRCode(i)}function zf(i,t,e){function s(){WeixinJSBridge.invoke("getBrandWCPayRequest",i,function(n){n.err_msg=="get_brand_wcpay_request:ok"?t():e(n.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",s,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",s),document.attachEvent("onWeixinJSBridgeReady",s)):s()}function Gf(i){window.AlipayJSBridge?i&&i():document.addEventListener("AlipayJSBridgeReady",i,!1)}function Qe(i,t){let e="未知错误";switch(i.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${i.error}(${e}): ${i.errorMessage}`}function qf(i,t,e){ap.tradePay(Object.assign(i,{}),function(s){let n="未知错误";switch(s.resultCode){case 9e3:return n="订单支付成功",t?.(n);case 8e3:n="正在处理中";break;case 4e3:n="订单支付失败";break;case 6001:n="用户中途取消";break;case 6002:n="网络连接出错";break;case 99:n="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(n)})}function Hf(i,t,e){ap.scan(Object.assign(i,{fail:s=>{e?.(Qe(s))}}),function(s){t?.(s.code)})}function jf(i,t,e){ap.getLocation(Object.assign(i,{fail:s=>{e?.(Qe(s))}}),function(s){t?.(s)})}function $f(i,t,e){ap.openLocation(Object.assign(i,{fail:s=>{e?.(Qe(s))}}),function(){t?.()})}function Wf(i,t,e){ap.chooseImage(Object.assign(i,{fail:s=>{e?.(Qe(s,"chooseImage"))}}),function(s){t?.(s)})}function Jf(i,t,e){ap.previewImage(Object.assign(i,{fail:s=>{e?.(Qe(s))}}),function(){t?.()})}class Zf{map;constructor(t,e=120.619585,s=31.299379,n=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,s),n)}}class Kf{currentPage;itemsPerPage;entriesInterval;entriesEdge;linkTo;prevText;nextText;ellipseText;prevShowAlways;nextShowAlways;callback;totalPages;parentVNode;constructor(t,e,s){this.currentPage=s?.currentPage||0,this.itemsPerPage=s?.itemsPerPage||10,this.entriesInterval=s?.entriesInterval||5,this.entriesEdge=s?.entriesEdge||1,this.linkTo=s?.linkTo||"javascript:;",this.prevText=s?.prevText||"上一页",this.nextText=s?.nextText||"下一页",this.ellipseText=s?.ellipseText||"...",this.prevShowAlways=typeof s?.prevShowAlways=="boolean"?s?.prevShowAlways:!0,this.nextShowAlways=typeof s?.nextShowAlways=="boolean"?s?.nextShowAlways:!0,this.callback=s?.callback||(n=>!1),this.totalPages=Math.ceil(e/this.itemsPerPage),this.parentVNode=this.createParentVNode(),Pe(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return ue("div",{class:"pagination"},[])}appendVNode(t,e,s){e=e<0?0:e<this.totalPages?e:this.totalPages-1;const n=s?.text||String(e+1),r=s?.classes||"";t.children.push(e==this.currentPage&&r.indexOf("prev")==-1&&r.indexOf("next")==-1?ue("span",{class:`current ${r}`},n):ue("a",{class:r,href:this.linkTo.replace(/__id__/,String(e)),onClick:a=>this.selectPage(e,a)},n))}drawLinks(){const t=this.createParentVNode(),e=Math.ceil(this.entriesInterval/2),s=this.currentPage>e?Math.max(Math.min(this.currentPage-e,this.totalPages-this.entriesInterval),0):0,n=this.currentPage>e?Math.min(this.currentPage+e,this.totalPages):Math.min(this.entriesInterval,this.totalPages);if(this.prevText&&(this.currentPage>0||this.prevShowAlways)&&this.appendVNode(t,this.currentPage-1,{text:this.prevText,classes:"prev"}),s>0&&this.entriesEdge>0){const r=Math.min(this.entriesEdge,s);for(let a=0;a<r;a++)this.appendVNode(t,a);this.entriesEdge<s&&this.ellipseText&&t.children.push(ue("span",{},this.ellipseText))}for(let r=s;r<n;r++)this.appendVNode(t,r);if(n<this.totalPages&&this.entriesEdge>0){this.totalPages-this.entriesEdge>n&&this.ellipseText&&t.children.push(ue("span",{},this.ellipseText));const r=Math.max(this.totalPages-this.entriesEdge,n);for(let a=r;a<this.totalPages;a++)this.appendVNode(t,a)}this.nextText&&(this.currentPage<this.totalPages-1||this.nextShowAlways)&&this.appendVNode(t,this.currentPage+1,{text:this.nextText,classes:"next"}),Ls(this.parentVNode,t),this.parentVNode=t}selectPage(t,e){this.currentPage=t=t<0?0:t<this.totalPages?t:this.totalPages-1,this.drawLinks();const s=this.callback(t);return e&&(s||(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)),s}prevPage(){return this.selectPage(this.currentPage-1)}nextPage(){return this.selectPage(this.currentPage+1)}}const ae={enabled:!1,files:{},add:function(i,t){this.enabled!==!1&&(this.files[i]=t)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class Qf{isLoading=!1;itemsLoaded=0;itemsTotal=0;urlModifier;handlers=[];_onStart;_onLoad;_onProgress;_onError;constructor(t){this._onStart=t?.onStart,this._onLoad=t?.onLoad,this._onProgress=t?.onProgress,this._onError=t?.onError}itemStart(t){this.itemsTotal++,this.isLoading===!1&&this._onStart?.(t,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(t){this.itemsLoaded++,this._onProgress?.(t,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this._onLoad?.())}itemError(t){this._onError?.(t)}resolveURL(t){return this.urlModifier?this.urlModifier(t):t}setURLModifier(t){return this.urlModifier=t,this}addHandler(t,e){return this.handlers.push(t,e),this}removeHandler(t){const e=this.handlers.indexOf(t);return e!==-1&&this.handlers.splice(e,2),this}getHandler(t){for(let e=0,s=this.handlers.length;e<s;e+=2){const n=this.handlers[e],r=this.handlers[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return r}return null}}const td=new Qf;class ed{static DEFAULT_MATERIAL_NAME="__DEFAULT";manager;crossOrigin;withCredentials;path;resourcePath;requestHeader;constructor(t){this.manager=t!==void 0?t:td,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(t,e){}loadAsync(t,e){return new Promise((s,n)=>{this.load(t,{onLoad:s,onProgress:e,onError:n})})}parse(t){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const qs=ed;class sd extends qs{constructor(t){super(t)}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=ae.get(t);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s;const n=F.createElementNS("img"),r=()=>{o(),ae.add(t,n),e?.onLoad?.(n),this.manager.itemEnd(t)},a=h=>{o(),e?.onError?.(h),this.manager.itemError(t),this.manager.itemEnd(t)};function o(){n.removeEventListener("load",r,!1),n.removeEventListener("error",a,!1)}return n.addEventListener("load",r,!1),n.addEventListener("error",a,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(n.crossOrigin=this.crossOrigin),this.manager.itemStart(t),n.src=t,n}}class id extends qs{isImageBitmapLoader=!0;options;constructor(t){super(t),typeof createImageBitmap>"u"&&console.warn("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=ae.get(t);if(s!==void 0){if(this.manager.itemStart(t),s.then){s.then(r=>{e?.onLoad?.(r),this.manager.itemEnd(t)}).catch(r=>{e?.onError?.(r)});return}return setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s}const n=fetch(t,{credentials:this.crossOrigin==="anonymous"?"same-origin":"include",headers:this.requestHeader}).then(r=>r.blob()).then(r=>createImageBitmap(r,Object.assign(this.options,{colorSpaceConversion:"none"}))).then(r=>(ae.add(t,r),e?.onLoad?.(r),this.manager.itemEnd(t),r)).catch(r=>{e?.onError?.(r),ae.remove(t),this.manager.itemError(t),this.manager.itemEnd(t)});ae.add(t,n),this.manager.itemStart(t)}}const Ht={};class nd extends Error{response;constructor(t,e){super(t),this.response=e}}class Ya extends qs{mimeType;responseType="";constructor(t){super(t),typeof fetch>"u"&&console.warn("FileLoader: fetch() not supported.")}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=ae.get(t);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s;if(Ht[t]!==void 0){Ht[t].push({onLoad:e?.onLoad,onProgress:e?.onProgress,onError:e?.onError});return}Ht[t]=[],Ht[t].push({onLoad:e?.onLoad,onProgress:e?.onProgress,onError:e?.onError});const n=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),r=this.mimeType,a=this.responseType;fetch(n).then(o=>{if(o.status===200||o.status===0){if(o.status===0&&console.warn("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||o.body===void 0||o.body?.getReader===void 0)return o;const h=Ht[t],c=o.body.getReader(),l=o.headers.get("X-File-Size")||o.headers.get("Content-Length"),f=l?parseInt(l):0,y=f!==0;let b=0;const p=new ReadableStream({start(E){_();function _(){c.read().then(({done:v,value:x})=>{if(v)E.close();else{b+=x.byteLength;const w=new ProgressEvent("progress",{lengthComputable:y,loaded:b,total:f});for(let g=0,P=h.length;g<P;g++)h[g].onProgress?.(w);E.enqueue(x),_()}},v=>{E.error(v)})}}});return new Response(p)}else throw new nd(`fetch for "${o.url}" responded with ${o.status}: ${o.statusText}`,o)}).then(o=>{switch(a){case"arraybuffer":return o.arrayBuffer();case"blob":return o.blob();case"document":return o.text().then(h=>new DOMParser().parseFromString(h,r));case"json":return o.json();default:if(r===void 0)return o.text();{const c=/charset="?([^;"\s]*)"?/i.exec(r),l=c&&c[1]?c[1].toLowerCase():void 0,f=new TextDecoder(l);return o.arrayBuffer().then(y=>f.decode(y))}}}).then(o=>{ae.add(t,o);const h=Ht[t];delete Ht[t];for(let c=0,l=h.length;c<l;c++)h[c].onLoad?.(o)}).catch(o=>{const h=Ht[t];if(h===void 0)throw this.manager.itemError(t),o;delete Ht[t];for(let c=0,l=h.length;c<l;c++)h[c].onError?.(o);this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class rd extends qs{constructor(t){super(t)}load(t,e){const s=new Ya(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,{onLoad:n=>{try{const r=n.slice(0);new AudioContext().decodeAudioData(r,o=>{e?.onLoad?.(o)}).catch(o=>{e?.onError?.(o),this.manager.itemError(t)})}catch(r){e?.onError?.(r),this.manager.itemError(t)}},onProgress:e?.onProgress,onError:e?.onError})}}d.Arrow=Zu,d.AudioLoader=rd,d.BezierEasing=Ni,d.CSSToJSEasing=el,d.Clock=Yi,d.Color=lt,d.CommonKeyCode=kc,d.Confetti=mf,d.ControlsColorPattern=de,d.Cross=nf,d.CustomCanvasContext=ze,d.CustomCanvasGradient=Bs,d.CustomCanvasPattern=$i,d.DOMEventBus=pa,d.DOMParse=ga,d.DOMSVGUtil=fe,d.DOMToBlob=Tr,d.DOMToString=Ti,d.DOMUtil=F,d.DOMVideo=$e,d.Easing=L,d.Ellipse=Ra,d.FetchWithAxios=Sr,d.FetchWithAxiosRequestCancel=Cr,d.FileLoader=Ya,d.FileUpload=Wh,d.Fox=Ku,d.Heart=Qu,d.HeartVariant=tf,d.ImageBitmapLoader=id,d.ImageLoader=sd,d.Interpolation=Vt,d.Line=me,d.LinePicture=Ju,d.LineQuadraticBezier=$u,d.MVVM=Tl,d.Matrix=ct,d.Matrix3D=pt,d.NormalColors=ya,d.Pagination=Kf,d.Point=Gt,d.Point3D=je,d.Point3Ds=df,d.Points=La,d.QRCode=re,d.Rabbit=sf,d.Rect=qt,d.Ring=cn,d.RingIndicator=lf,d.SVGParse=ka,d.SVGParsedPathArgsLength=He,d.Sector=af,d.SectorArc=Fa,d.Segment=cf,d.Shape=q,d.ShapeCombo=ln,d.ShapeGroup=rt,d.Ship=of,d.Slider=hf,d.Star=ef,d.TWEEN=cl,d.Text=Ke,d.Timeline=Ds,d.Tip=Oa,d.Tree=rf,d.Tween=Ui,d.WebGLRenderer=xf,d.WebRTCClient=wf,d.WebSocketClient=Pl,d.YZCanvas=yf,d.YZCanvasContext=Us,d.YZMessageChannel=iu,d.YZSVG=Wu,d.YZWorker=su,d.addClass=gl,d.addWatermark=Vu,d.addWxJsReadyFnBeforeConfig=un,d.ajax=nu,d.aliJsChooseImage=Wf,d.aliJsGetLocation=jf,d.aliJsOpenLocation=$f,d.aliJsPreviewImage=Jf,d.aliJsReady=Gf,d.aliJsScan=Hf,d.aliJsTradePay=qf,d.angle=ie,d.appendURL=en,d.appendURLRecord=tu,d.atomReadAttribute=ta,d.atomReadAttributes=qi,d.atomReadStyle=ul,d.atomReadStyles=zi,d.atomRemoveAttribute=dl,d.atomRemoveDataset=pl,d.atomRemoveStyle=Gi,d.atomWriteAttribute=Hi,d.atomWriteStyle=Is,d.base64EncodeOutputStream=Ea,d.bitmapMapper=Na,d.blobToRawImage=mu,d.byteArrayOutputStream=rn,d.canDrawBitmap=Vr,d.canUsePaths=_c,d.canUseWorker=Xr,d.changeBrightness=Yu,d.changeDiaphaneity=Xu,d.changeSize=Uu,d.checkWxJsApi=vf,d.clearCookies=Zh,d.color=We,d.computeImageDisplayRect=au,d.createXMLHttpRequest=Sa,d.dispatchEvent=Mr,d.distance=Os,d.distance2=Fs,d.drawBitmapInCanvas=gf,d.drawQRCodeToCanvas=ju,d.easeNameToCubicBezier=Bi,d.fileOrBlobToDataURL=sn,d.flipSideToSide=gu,d.flipUpsideDown=yu,d.flushURL=va,d.flushURLRecord=Ql,d.formDataToString=ba,d.fpsTask=Vc,d.getBitmapFromCanvas=pf,d.getBodyPosition=_l,d.getBrowserClient=_i,d.getBrowserClientVersion=pc,d.getBrowserLanguage=gc,d.getDOMMatrix=Ki,d.getDirection=Fl,d.getDocumentElementPosition=Xe,d.getElementPositionInPage=ia,d.getElementPositionInPage2=Ml,d.getElementPositionInViewport=na,d.getFileExtension=Er,d.getFileMD5Hash=Ar,d.getFileTypeFromFile=$h,d.getFilesImageInfo=hu,d.getFormSubmitData=ru,d.getImageAspectRatio=ou,d.getImageDataByAIData=Gu,d.getImageDataFromBitmap=lu,d.getImageDataFromUrl=Ca,d.getImageDataFromVideo=cu,d.getImageMainColor=pu,d.getInternetExplorerVersion=Nr,d.getMousePositionInElement=Et,d.getMousePositionInPage=ra,d.getMousePositionInViewport=Ll,d.getOperatingSystem=Ts,d.getOperatingSystemVersion=mc,d.getPageSize=Dl,d.getParameters=eu,d.getRawImageInfo=Gs,d.getRelativeBoundingClientRect=Il,d.getScreenPosition=El,d.getStyle=ee,d.getTimeZone=yc,d.getURL=Xs,d.getVerticalScrollPercentInPage=kl,d.getViewportSize=Al,d.getVnode=Xi,d.gifImage=_a,d.h=ue,d.hFromEl=ks,d.hasClass=wl,d.hasDocument=Tc,d.hasHistory=Pc,d.hasWindow=Yr,d.hideEl=sa,d.imageDataToBitmap=uu,d.imageDataToBlob=du,d.imageDataToDataURL=fu,d.immediateVnode=ll,d.injectStyle=fl,d.injectWxJsConfig=bf,d.isAliBrowser=Ur,d.isAliMiniProgram=Cc,d.isAndroid=Fr,d.isAppleDevice=wc,d.isBrowserSupportFileAPI=Ec,d.isElement=Ac,d.isIE=bc,d.isIE9or10=vc,d.isIOS=Ai,d.isMacOS=Di,d.isMobile=xc,d.isNative=Ps,d.isURL=Zl,d.isWxBrowser=Br,d.isWxMiniProgram=Sc,d.jpgToPng=Ou,d.leftRotate=wu,d.length=Rs,d.linkExport=Ss,d.mapTDTJSSDK=Zf,d.marginSharpen=Ru,d.microTask=Hc,d.mosaic=zu,d.mount=Pe,d.multiplyArrayOfMatrix=Hl,d.multiplyArrayOfMatrix3D=jl,d.multiplyMatrix=fa,d.multiplyMatrix3D=da,d.nextTick=qc,d.normalizePoint=Ol,d.objectSignature=vr,d.onDocumentReady=Nc,d.outputGifBase64=Aa,d.outputQRCodeBase64=Hu,d.parseTransformToMatrix=Zi,d.parseURL=wa,d.patch=Ls,d.pngToJpg=Fu,d.polar=Rt,d.prefixes=Dc,d.radiusClip=Bu,d.readFileInBrowser=Cs,d.recordToString=Vs,d.rectClip=Nu,d.removeClass=yl,d.requestAnimationFrameCycle=Ii,d.reverseCSSToJSEasing=sl,d.reverseEaseNameToCubicBezier=Jr,d.reverseEasing=qr,d.rightRotate=xu,d.rotatePoint=_t,d.scheduleIdle=zr,d.scheduleVnode=Vi,d.scheduleYZIdle=Oi,d.scrollTo=lc,d.selectFileInBrowser=Pr,d.setIntervalAccurate=Xc,d.setManualScroll=uc,d.setRem=Rl,d.setStyle=Ue,d.setTimeoutAccurate=ki,d.sharpen=Lu,d.showEl=ea,d.signature=br,d.simulateMouseEventFromTouch=rc,d.singletonDOMEventBus=Jl,d.stringToDOM=jh,d.stringToRecord=Kl,d.theme=Qi,d.toBlackAndWhite=Su,d.toBlue=Eu,d.toBlueAndGreen=Du,d.toBlueAndGrey=ku,d.toDegree=nt,d.toGreen=Pu,d.toGreenAndGrey=Iu,d.toGrey=bu,d.toGrey2=vu,d.toOpposite=Cu,d.toRadian=N,d.toRed=Tu,d.toRedAndBlue=Au,d.toRedAndGreen=_u,d.toRedAndGrey=Mu,d.toggleClass=ji,d.toggleElDisplay=xl,d.transformPath2D=ql,d.trimURLHash=xa,d.useAttribute=se,d.useClipboard=bl,d.useCookie=Jh,d.useDataset=ml,d.useElement=Ye,d.useEmit=Fe,d.useEventListener=ot,d.useFireEvent=nc,d.useHotKey=Mi,d.useHotKeyFileLoop=Rc,d.useHotKeyFileOnce=Lc,d.useLinkExport=Fc,d.useLoadLink=Uc,d.useLoadScript=Bc,d.useLocalStorage=Dr,d.useLocation=vl,d.useMedia=Ir,d.useObjectURL=Oc,d.usePreventScroll=cc,d.useResize=fc,d.useRunInSandbox=Cl,d.useScroll=hc,d.useSelectFile=Ei,d.useTheme=ac,d.useThemeToggle=oc,d.useVibrate=Sl,d.useWindowChange=Rr,d.useWindowResize=dc,d.waitForStyleSheetsLoaded=Yc,d.wxJsChooseImage=Tf,d.wxJsDownloadImage=_f,d.wxJsDownloadVoice=Nf,d.wxJsGetLocalImgData=Af,d.wxJsGetLocation=Xf,d.wxJsGetNetworkType=Uf,d.wxJsOnVoicePlayEnd=Of,d.wxJsOnVoiceRecordEnd=If,d.wxJsOpenLocation=Yf,d.wxJsPauseVoice=Lf,d.wxJsPay=zf,d.wxJsPlayVoice=kf,d.wxJsPreviewImage=Pf,d.wxJsScanQRCode=Vf,d.wxJsStartRecord=Df,d.wxJsStopRecord=Mf,d.wxJsStopVoice=Rf,d.wxJsTranslateVoice=Bf,d.wxJsUpdateAppMessageShareData=Sf,d.wxJsUpdateTimelineShareData=Cf,d.wxJsUploadImage=Ef,d.wxJsUploadVoice=Ff,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
46
46
|
//# sourceMappingURL=zyzgroup_core_web.umd.cjs.map
|