@zyzgroup/core-web 0.0.57 → 0.0.59

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.
Files changed (174) hide show
  1. package/README.md +0 -0
  2. package/dist/animate.css +221 -285
  3. package/dist/animate.min.css +8 -0
  4. package/dist/zyzgroup_core_web.iife.js +23 -24
  5. package/dist/zyzgroup_core_web.iife.js.map +1 -1
  6. package/dist/zyzgroup_core_web.js +14620 -24051
  7. package/dist/zyzgroup_core_web.js.map +1 -1
  8. package/dist/zyzgroup_core_web.umd.cjs +23 -24
  9. package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
  10. package/package.json +1 -1
  11. package/types/{shape → animate}/AnimateOperation.d.ts +19 -6
  12. package/types/animate/AnimateOperation.d.ts.map +1 -0
  13. package/types/animate/animateInWeb.d.ts +14 -0
  14. package/types/animate/animateInWeb.d.ts.map +1 -0
  15. package/types/animate/index.d.ts +4 -0
  16. package/types/animate/index.d.ts.map +1 -0
  17. package/types/animate/tween/Easing.d.ts.map +1 -0
  18. package/types/animate/tween/Group.d.ts.map +1 -0
  19. package/types/animate/tween/Interpolation.d.ts.map +1 -0
  20. package/types/animate/tween/Now.d.ts.map +1 -0
  21. package/types/animate/tween/Sequence.d.ts.map +1 -0
  22. package/types/animate/tween/Tween.d.ts.map +1 -0
  23. package/types/animate/tween/cubicBezierToEase.d.ts.map +1 -0
  24. package/types/{tween → animate/tween}/index.d.ts +2 -0
  25. package/types/animate/tween/index.d.ts.map +1 -0
  26. package/types/animate/tween/mainGroup.d.ts.map +1 -0
  27. package/types/{shape → canvas}/CanvasOperation.d.ts +3 -2
  28. package/types/canvas/CanvasOperation.d.ts.map +1 -0
  29. package/types/canvas/CustomCanvasContext.d.ts.map +1 -0
  30. package/types/canvas/index.d.ts +3 -0
  31. package/types/canvas/index.d.ts.map +1 -0
  32. package/types/dom/DOMEventBus.d.ts +82 -0
  33. package/types/dom/DOMEventBus.d.ts.map +1 -0
  34. package/types/dom/DOMKey.d.ts +1 -1
  35. package/types/dom/DOMKey.d.ts.map +1 -1
  36. package/types/dom/index.d.ts +1 -2
  37. package/types/dom/index.d.ts.map +1 -1
  38. package/types/index.d.ts +5 -4
  39. package/types/index.d.ts.map +1 -1
  40. package/types/math/Matrix.d.ts.map +1 -0
  41. package/types/math/Vector.d.ts.map +1 -0
  42. package/types/math/index.d.ts +4 -0
  43. package/types/math/index.d.ts.map +1 -0
  44. package/types/{shape/lib → math}/math.d.ts +9 -2
  45. package/types/math/math.d.ts.map +1 -0
  46. package/types/position.d.ts +2 -5
  47. package/types/position.d.ts.map +1 -1
  48. package/types/shape/PathGroup.d.ts +2 -2
  49. package/types/shape/PathGroup.d.ts.map +1 -1
  50. package/types/shape/SportBase.d.ts +4 -1
  51. package/types/shape/SportBase.d.ts.map +1 -1
  52. package/types/shape/YZRaphael.d.ts.map +1 -1
  53. package/types/shape/index.d.ts +0 -4
  54. package/types/shape/index.d.ts.map +1 -1
  55. package/types/shape/shapes/ShapeArmyAnts.d.ts +1 -1
  56. package/types/shape/shapes/ShapeArmyAnts.d.ts.map +1 -1
  57. package/types/shape/shapes/ShapeArrow.d.ts +3 -3
  58. package/types/shape/shapes/ShapeArrow.d.ts.map +1 -1
  59. package/types/shape/shapes/ShapeBall.d.ts +3 -3
  60. package/types/shape/shapes/ShapeBall.d.ts.map +1 -1
  61. package/types/shape/shapes/ShapeBase.d.ts +7 -8
  62. package/types/shape/shapes/ShapeBase.d.ts.map +1 -1
  63. package/types/shape/shapes/ShapeLight.d.ts.map +1 -1
  64. package/types/shape/shapes/ShapeLine.d.ts +7 -7
  65. package/types/shape/shapes/ShapeLine.d.ts.map +1 -1
  66. package/types/shape/shapes/ShapePoint3d.d.ts.map +1 -1
  67. package/types/shape/shapes/ShapeRect.d.ts +3 -3
  68. package/types/shape/shapes/ShapeRect.d.ts.map +1 -1
  69. package/types/shape/shapes/ShapeSegment.d.ts +1 -1
  70. package/types/shape/shapes/ShapeSegment.d.ts.map +1 -1
  71. package/types/shape/shapes/ShapeShip.d.ts +1 -1
  72. package/types/shape/shapes/ShapeShip.d.ts.map +1 -1
  73. package/types/shape/shapes/ShapeSlider.d.ts +1 -1
  74. package/types/shape/shapes/ShapeSlider.d.ts.map +1 -1
  75. package/types/shape/shapes/ShapeSmileFace.d.ts +1 -1
  76. package/types/shape/shapes/ShapeSmileFace.d.ts.map +1 -1
  77. package/types/shape/shapes/ShapeSpirograph.d.ts +1 -1
  78. package/types/shape/shapes/ShapeSpirograph.d.ts.map +1 -1
  79. package/types/shape/shapes/ShapeStar.d.ts +1 -1
  80. package/types/shape/shapes/ShapeStar.d.ts.map +1 -1
  81. package/types/shape/shapes/ShapeTiger.d.ts +1 -1
  82. package/types/shape/shapes/ShapeTiger.d.ts.map +1 -1
  83. package/types/shape/shapes/ShapeTree.d.ts +1 -1
  84. package/types/shape/shapes/ShapeTree.d.ts.map +1 -1
  85. package/types/shape/shapes/ShapeTriangle.d.ts +1 -1
  86. package/types/shape/shapes/ShapeTriangle.d.ts.map +1 -1
  87. package/types/shape/shapes/ShapeTriangleLight.d.ts +1 -1
  88. package/types/shape/shapes/ShapeTriangleLight.d.ts.map +1 -1
  89. package/types/{shape → svg}/SVGOperation.d.ts +2 -2
  90. package/types/{shape → svg}/SVGOperation.d.ts.map +1 -1
  91. package/types/svg/index.d.ts +3 -0
  92. package/types/svg/index.d.ts.map +1 -0
  93. package/types/{shape → svg}/lib/a2c.d.ts.map +1 -1
  94. package/types/svg/lib/abs-svg-path.d.ts.map +1 -0
  95. package/types/{shape → svg}/lib/index.d.ts +1 -5
  96. package/types/svg/lib/index.d.ts.map +1 -0
  97. package/types/svg/lib/is-svg-path.d.ts.map +1 -0
  98. package/types/svg/lib/normalize-svg-path.d.ts.map +1 -0
  99. package/types/svg/lib/parse-svg-path.d.ts.map +1 -0
  100. package/types/svg/lib/point-at-length.d.ts.map +1 -0
  101. package/types/svg/lib/point-in-path.d.ts.map +1 -0
  102. package/types/svg/lib/point-svg-path.d.ts.map +1 -0
  103. package/types/svg/lib/rel-svg-path.d.ts.map +1 -0
  104. package/types/svg/rappar.d.ts.map +1 -0
  105. package/types/{shape → three}/three.d.ts.map +1 -1
  106. package/types/animate.d.ts +0 -2
  107. package/types/animate.d.ts.map +0 -1
  108. package/types/dom/DOMCanvas/DOMCanvas.d.ts +0 -40
  109. package/types/dom/DOMCanvas/DOMCanvas.d.ts.map +0 -1
  110. package/types/dom/DOMCanvas/DOMCanvasKonva.d.ts +0 -1
  111. package/types/dom/DOMCanvas/DOMCanvasKonva.d.ts.map +0 -1
  112. package/types/dom/DOMCanvas/index.d.ts +0 -2
  113. package/types/dom/DOMCanvas/index.d.ts.map +0 -1
  114. package/types/dom/DOMCanvas/services/Keyboard.d.ts +0 -11
  115. package/types/dom/DOMCanvas/services/Keyboard.d.ts.map +0 -1
  116. package/types/dom/DOMCanvas/services/Mouse.d.ts +0 -13
  117. package/types/dom/DOMCanvas/services/Mouse.d.ts.map +0 -1
  118. package/types/dom/DOMCanvas/services/Tooler.d.ts +0 -1
  119. package/types/dom/DOMCanvas/services/Tooler.d.ts.map +0 -1
  120. package/types/dom/DOMCanvas/types.d.ts +0 -36
  121. package/types/dom/DOMCanvas/types.d.ts.map +0 -1
  122. package/types/dom/DOMMouse.d.ts +0 -43
  123. package/types/dom/DOMMouse.d.ts.map +0 -1
  124. package/types/shape/AnimateOperation.d.ts.map +0 -1
  125. package/types/shape/CanvasOperation.d.ts.map +0 -1
  126. package/types/shape/lib/CustomCanvasContext.d.ts.map +0 -1
  127. package/types/shape/lib/Matrix.d.ts.map +0 -1
  128. package/types/shape/lib/Vector.d.ts.map +0 -1
  129. package/types/shape/lib/abs-svg-path.d.ts.map +0 -1
  130. package/types/shape/lib/elemental.d.ts +0 -2
  131. package/types/shape/lib/elemental.d.ts.map +0 -1
  132. package/types/shape/lib/eve.d.ts +0 -14
  133. package/types/shape/lib/eve.d.ts.map +0 -1
  134. package/types/shape/lib/index.d.ts.map +0 -1
  135. package/types/shape/lib/is-svg-path.d.ts.map +0 -1
  136. package/types/shape/lib/math.d.ts.map +0 -1
  137. package/types/shape/lib/normalize-svg-path.d.ts.map +0 -1
  138. package/types/shape/lib/parse-svg-path.d.ts.map +0 -1
  139. package/types/shape/lib/point-at-length.d.ts.map +0 -1
  140. package/types/shape/lib/point-in-path.d.ts.map +0 -1
  141. package/types/shape/lib/point-svg-path.d.ts.map +0 -1
  142. package/types/shape/lib/rappar.d.ts.map +0 -1
  143. package/types/shape/lib/rel-svg-path.d.ts.map +0 -1
  144. package/types/tween/Easing.d.ts.map +0 -1
  145. package/types/tween/Group.d.ts.map +0 -1
  146. package/types/tween/Interpolation.d.ts.map +0 -1
  147. package/types/tween/Now.d.ts.map +0 -1
  148. package/types/tween/Sequence.d.ts.map +0 -1
  149. package/types/tween/Tween.d.ts.map +0 -1
  150. package/types/tween/cubicBezierToEase.d.ts.map +0 -1
  151. package/types/tween/index.d.ts.map +0 -1
  152. package/types/tween/mainGroup.d.ts.map +0 -1
  153. /package/types/{tween → animate/tween}/Easing.d.ts +0 -0
  154. /package/types/{tween → animate/tween}/Group.d.ts +0 -0
  155. /package/types/{tween → animate/tween}/Interpolation.d.ts +0 -0
  156. /package/types/{tween → animate/tween}/Now.d.ts +0 -0
  157. /package/types/{tween → animate/tween}/Sequence.d.ts +0 -0
  158. /package/types/{tween → animate/tween}/Tween.d.ts +0 -0
  159. /package/types/{tween → animate/tween}/cubicBezierToEase.d.ts +0 -0
  160. /package/types/{tween → animate/tween}/mainGroup.d.ts +0 -0
  161. /package/types/{shape/lib → canvas}/CustomCanvasContext.d.ts +0 -0
  162. /package/types/{shape/lib → math}/Matrix.d.ts +0 -0
  163. /package/types/{shape/lib → math}/Vector.d.ts +0 -0
  164. /package/types/{shape → svg}/lib/a2c.d.ts +0 -0
  165. /package/types/{shape → svg}/lib/abs-svg-path.d.ts +0 -0
  166. /package/types/{shape → svg}/lib/is-svg-path.d.ts +0 -0
  167. /package/types/{shape → svg}/lib/normalize-svg-path.d.ts +0 -0
  168. /package/types/{shape → svg}/lib/parse-svg-path.d.ts +0 -0
  169. /package/types/{shape → svg}/lib/point-at-length.d.ts +0 -0
  170. /package/types/{shape → svg}/lib/point-in-path.d.ts +0 -0
  171. /package/types/{shape → svg}/lib/point-svg-path.d.ts +0 -0
  172. /package/types/{shape → svg}/lib/rel-svg-path.d.ts +0 -0
  173. /package/types/{shape/lib → svg}/rappar.d.ts +0 -0
  174. /package/types/{shape → three}/three.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- var ZYZGroupCoreWeb=function(V){"use strict";function xt(n,t){for(var e=0;e<t.length;e++){const i=t[e];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in n)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}const ia=typeof window=="object"&&typeof document=="object";typeof process<"u"&&process.versions!=null&&process.versions.node!=null;const A1=n=>{let t=null;switch(n){case"bin":t=/^[0-1]+$/;break;case"oct":t=/^(0b)?[0-7]+$/i;break;case"hex":t=/^(0x)?[0-9a-fA-F]+$/i;break;case"int":t=/^[-+]?[0-9]+$/;break;case"number":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;break;case"phone-number":t=/^[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}$/gi;break;case"email":t=/^[A-Za-z0-9_!#$%&'*+/=?`{|}~^.-]+@[A-Za-z0-9._-]+$/gm;break;case"ip":t=/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;break;case"base64-data":t=/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i;break;case"var-name":t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;break;case"hex-color":t=/^#([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;break;case"chinese-name":t=/^(?:[\u4e00-\u9fa5·]{2,16})$/;break;case"chinese":t=new RegExp(String.raw`
1
+ var ZYZGroupCoreWeb=function(O){"use strict";const Vi=typeof window=="object"&&typeof document=="object";typeof process<"u"&&process.versions!=null&&process.versions.node!=null;const dc=n=>{let t=null;switch(n){case"bin":t=/^[0-1]+$/;break;case"oct":t=/^(0b)?[0-7]+$/i;break;case"hex":t=/^(0x)?[0-9a-fA-F]+$/i;break;case"int":t=/^[-+]?[0-9]+$/;break;case"number":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;break;case"phone-number":t=/^[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}$/gi;break;case"email":t=/^[A-Za-z0-9_!#$%&'*+/=?`{|}~^.-]+@[A-Za-z0-9._-]+$/gm;break;case"ip":t=/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;break;case"base64-data":t=/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i;break;case"var-name":t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;break;case"hex-color":t=/^#([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;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,39 +7,38 @@ var ZYZGroupCoreWeb=function(V){"use strict";function xt(n,t){for(var e=0;e<t.le
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};function M1(n){const t={matchIndex:-1,fullMatch:null,groupMatchs:[]};if(n){t.matchIndex=typeof n.index=="number"?n.index:-1;for(let e=0,i=n.length;e<i;e++)e==0?t.fullMatch=n[e]:t.groupMatchs.push(n[e])}return t}const Dl=(n,t)=>{typeof n=="string"&&(n=A1(n)||new RegExp(n));const e=[],i=t.matchAll(n);for(const r of i)e.push(M1(r));return e},R1=(n=12)=>"x".repeat(n).replace(/[x]/g,t=>(Math.random()*16|0).toString(16));function Ll(n){return n.replace(/(^\w|[_-]\w)/g,function(t){return t.slice(-1).toUpperCase()})}function Il(n){let t="";for(let e=0,i=n.length;e<i;e++){const r=n.charCodeAt(e);r>=1&&r<=127?t+=n.charAt(e):r>2047?(t+=String.fromCharCode(224|r>>12&15),t+=String.fromCharCode(128|r>>6&63),t+=String.fromCharCode(128|r>>0&63)):(t+=String.fromCharCode(192|r>>6&31),t+=String.fromCharCode(128|r>>0&63))}return t}var mi=(n=>(n.UNKNOWN="",n.HTML="text/html",n.CSS="text/css",n.XML="text/xml",n.TEXT="text/plain",n.MD="text/plain",n.JPEG="image/jpeg",n.PNG="image/png",n.GIF="image/gif",n.WEBP="image/webp",n.SVG="image/svg+xml",n.ICO="image/x-icon",n.MPEG="audio/mpeg",n.MP3="audio/mpeg",n.OGG="audio/ogg",n.WAV="audio/wav",n.MP4="video/mp4",n.JSON="application/json",n.JAVASCRIPT="application/javascript",n.ECMASCRIPT="application/ecmascript",n.EXCEL="application/vnb.ms-excel",n.XWWW="application/x-www-form-urlencoded",n.DOC="application/msword",n.CSV="application/x-csv",n.PDF="application/pdf",n.ZIP="application/zip",n.TGZ="application/x-gtar",n.TAR_GZ="application/x-gzip",n.EOT="appliaction/vnd.ms-fontobject",n.TTF="aplication/font-sfnt",n))(mi||{});const $n=(n,t=16)=>(n=n.toLowerCase(),(n.indexOf("0b")==0||n.indexOf("0o")==0||n.indexOf("0x")==0)&&(n=n.slice(2)),parseInt(n,t));function D1(){const n=Uint32Array.of(305419896),t=new Uint8Array(n.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}const Ol=n=>{let t=mi.UNKNOWN;switch(new DataView(n).getUint32(0,D1()).toString(16).toUpperCase()){case"FFD8FFDB":t=mi.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=mi.JPEG;break;case"89504E47":t=mi.PNG;break;case"47494638":t=mi.GIF;break;case"52494646":t=mi.WEBP;break;case"25504446":t=mi.PDF;break;case"504B0304":t=mi.ZIP;break}return t},Fl=function(){const n=[];return{writeByte(t){n.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,i=t.length){for(let r=0;r<i;r++)this.writeByte(t[r+e])},writeString(t){for(let e=0,i=t.length;e<i;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return n},toString(){let t="[";for(let e=0,i=n.length;e<i;e++)e>0&&(t+=","),t+=n[e];return t+="]",t}}},L1=function(){let n=0,t=0,e=0,i="";const r=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)},s=function(a){i+=String.fromCharCode(r(a&63))};return{writeByte(a){for(n=n<<8|a&255,t+=8,e+=1;t>=6;)s(n>>>t-6),t-=6},flush(){if(t>0&&(s(n<<6-t),n=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)i+="="}},toString(){return i}}};function I1(n){const t=typeof n;return t!=="object"?t:Object.prototype.toString.call(n).replace(/^\[object (\S+)\]$/,"$1").toLowerCase()}function na(n){return I1(n)==="object"}function Nl(n,t=new WeakMap){if(n==null)return n;if(n.constructor===Date)return new Date(n);if(n.constructor===RegExp)return new RegExp(n);if(typeof n!="object")return n;if(t.has(n))return t.get(n);const e=Object.getOwnPropertyDescriptors(n),i=Object.create(Object.getPrototypeOf(n),e);t.set(n,i);for(const r of Reflect.ownKeys(n))i[r]=na(n[r])?Nl(n[r],t):n[r];return i}function Gl(n,t){for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(na(t[e])?(typeof n[e]>"u"&&(n[e]={}),Gl(n[e],t[e])):typeof n[e]>"u"&&(n[e]=t[e]));return n}function Ul(n,t=12){return+n.toPrecision(t)}function O1(n,t){let e=+new Date,i;return function(...r){const s=+new Date;s-e<t?(clearTimeout(i),i=setTimeout(()=>{e=s,n.apply(this,r)},t)):(clearTimeout(i),e=s,n.apply(this,r))}}var xo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pe(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function St(n){if(n.__esModule)return n;var t=n.default;if(typeof t=="function"){var e=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),e}var Bl={exports:{}},Vn=typeof Reflect=="object"?Reflect:null,zl=Vn&&typeof Vn.apply=="function"?Vn.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)},ra;Vn&&typeof Vn.ownKeys=="function"?ra=Vn.ownKeys:Object.getOwnPropertySymbols?ra=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:ra=function(t){return Object.getOwnPropertyNames(t)};function F1(n){console&&console.warn&&console.warn(n)}var $l=Number.isNaN||function(t){return t!==t};function qt(){qt.init.call(this)}Bl.exports=qt,Bl.exports.once=B1,qt.EventEmitter=qt,qt.prototype._events=void 0,qt.prototype._eventsCount=0,qt.prototype._maxListeners=void 0;var Vl=10;function sa(n){if(typeof n!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n)}Object.defineProperty(qt,"defaultMaxListeners",{enumerable:!0,get:function(){return Vl},set:function(n){if(typeof n!="number"||n<0||$l(n))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+n+".");Vl=n}}),qt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},qt.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||$l(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function Hl(n){return n._maxListeners===void 0?qt.defaultMaxListeners:n._maxListeners}qt.prototype.getMaxListeners=function(){return Hl(this)},qt.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var r=t==="error",s=this._events;if(s!==void 0)r=r&&s.error===void 0;else if(!r)return!1;if(r){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var h=s[t];if(h===void 0)return!1;if(typeof h=="function")zl(h,this,e);else for(var l=h.length,c=Wl(h,l),i=0;i<l;++i)zl(c[i],this,e);return!0};function jl(n,t,e,i){var r,s,a;if(sa(e),s=n._events,s===void 0?(s=n._events=Object.create(null),n._eventsCount=0):(s.newListener!==void 0&&(n.emit("newListener",t,e.listener?e.listener:e),s=n._events),a=s[t]),a===void 0)a=s[t]=e,++n._eventsCount;else if(typeof a=="function"?a=s[t]=i?[e,a]:[a,e]:i?a.unshift(e):a.push(e),r=Hl(n),r>0&&a.length>r&&!a.warned){a.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=n,o.type=t,o.count=a.length,F1(o)}return n}qt.prototype.addListener=function(t,e){return jl(this,t,e,!1)},qt.prototype.on=qt.prototype.addListener,qt.prototype.prependListener=function(t,e){return jl(this,t,e,!0)};function N1(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Xl(n,t,e){var i={fired:!1,wrapFn:void 0,target:n,type:t,listener:e},r=N1.bind(i);return r.listener=e,i.wrapFn=r,r}qt.prototype.once=function(t,e){return sa(e),this.on(t,Xl(this,t,e)),this},qt.prototype.prependOnceListener=function(t,e){return sa(e),this.prependListener(t,Xl(this,t,e)),this},qt.prototype.removeListener=function(t,e){var i,r,s,a,o;if(sa(e),r=this._events,r===void 0)return this;if(i=r[t],i===void 0)return this;if(i===e||i.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,i.listener||e));else if(typeof i!="function"){for(s=-1,a=i.length-1;a>=0;a--)if(i[a]===e||i[a].listener===e){o=i[a].listener,s=a;break}if(s<0)return this;s===0?i.shift():G1(i,s),i.length===1&&(r[t]=i[0]),r.removeListener!==void 0&&this.emit("removeListener",t,o||e)}return this},qt.prototype.off=qt.prototype.removeListener,qt.prototype.removeAllListeners=function(t){var e,i,r;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[t]),this;if(arguments.length===0){var s=Object.keys(i),a;for(r=0;r<s.length;++r)a=s[r],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(e=i[t],typeof e=="function")this.removeListener(t,e);else if(e!==void 0)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this};function Yl(n,t,e){var i=n._events;if(i===void 0)return[];var r=i[t];return r===void 0?[]:typeof r=="function"?e?[r.listener||r]:[r]:e?U1(r):Wl(r,r.length)}qt.prototype.listeners=function(t){return Yl(this,t,!0)},qt.prototype.rawListeners=function(t){return Yl(this,t,!1)},qt.listenerCount=function(n,t){return typeof n.listenerCount=="function"?n.listenerCount(t):ql.call(n,t)},qt.prototype.listenerCount=ql;function ql(n){var t=this._events;if(t!==void 0){var e=t[n];if(typeof e=="function")return 1;if(e!==void 0)return e.length}return 0}qt.prototype.eventNames=function(){return this._eventsCount>0?ra(this._events):[]};function Wl(n,t){for(var e=new Array(t),i=0;i<t;++i)e[i]=n[i];return e}function G1(n,t){for(;t+1<n.length;t++)n[t]=n[t+1];n.pop()}function U1(n){for(var t=new Array(n.length),e=0;e<t.length;++e)t[e]=n[e].listener||n[e];return t}function B1(n,t){return new Promise(function(e,i){function r(a){n.removeListener(t,s),i(a)}function s(){typeof n.removeListener=="function"&&n.removeListener("error",r),e([].slice.call(arguments))}Kl(n,t,s,{once:!0}),t!=="error"&&z1(n,r,{once:!0})})}function z1(n,t,e){typeof n.on=="function"&&Kl(n,"error",t,e)}function Kl(n,t,e,i){if(typeof n.on=="function")i.once?n.once(t,e):n.on(t,e);else if(typeof n.addEventListener=="function")n.addEventListener(t,function r(s){i.once&&n.removeEventListener(t,r),e(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof n)}class Zl{events;constructor(){this.events={}}on(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e)}addListener(t,e){this.on(t,e)}prependListener(t,e){this.events[t]||(this.events[t]=[]),this.events[t].unshift(e)}removeListener(t,e){this.events[t]&&(this.events[t]=this.events[t].filter(i=>i!==e))}off(t,e){this.removeListener(t,e)}removeAllListeners(t){t?this.events[t]=[]:this.events={}}emit(t,...e){this.events[t]&&this.events[t].forEach(i=>{Reflect.apply(i,this,e)})}once(t,e){const r=(()=>{let s=!1;return(...a)=>{s||(s=!0,Reflect.apply(e,this,a),this.off(t,r))}})();this.on(t,r)}}var Jl=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function $1(n,t={}){var e=1,i=1;function r(nt){var J=nt.match(/\n/g);J&&(e+=J.length);var I=nt.lastIndexOf(`
11
- `);i=~I?nt.length-I:i+nt.length}function s(){var nt={line:e,column:i};return function(J){return J.position=new a(nt),m(),J}}function a(nt){this.start=nt,this.end={line:e,column:i},this.source=t.source}a.prototype.content=n;var o=[];function h(nt){var J=new Error(t.source+":"+e+":"+i+": "+nt);if(J.reason=nt,J.filename=t.source,J.line=e,J.column=i,J.source=n,t.silent)o.push(J);else throw J}function l(){var nt=f();return{type:"stylesheet",stylesheet:{source:t.source,rules:nt,parsingErrors:o}}}function c(){return u(/^{\s*/)}function d(){return u(/^}/)}function f(){var nt,J=[];for(m(),v(J);n.length&&n.charAt(0)!="}"&&(nt=_t()||pt());)nt!==!1&&(J.push(nt),v(J));return J}function u(nt){var J=nt.exec(n);if(J){var I=J[0];return r(I),n=n.slice(I.length),J}}function m(){u(/^\s*/)}function v(nt){var J;for(nt=nt||[];J=b();)J!==!1&&nt.push(J);return nt}function b(){var nt=s();if(!(n.charAt(0)!="/"||n.charAt(1)!="*")){for(var J=2;n.charAt(J)!=""&&(n.charAt(J)!="*"||n.charAt(J+1)!="/");)++J;if(J+=2,n.charAt(J-1)==="")return h("End of comment missing");var I=n.slice(2,J-2);return i+=2,r(I),n=n.slice(J),i+=2,nt({type:"comment",comment:I})}}function S(){var nt=u(/^([^{]+)/);if(nt)return vi(nt[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(J){return J.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(J){return J.replace(/\u200C/g,",")})}function E(){var nt=s(),J=u(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(J){if(J=vi(J[0]),!u(/^:\s*/))return h("property missing ':'");var I=u(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),D=nt({type:"declaration",property:J.replace(Jl,""),value:I?vi(I[0]).replace(Jl,""):""});return u(/^[;\s]*/),D}}function _(){var nt=[];if(!c())return h("missing '{'");v(nt);for(var J;J=E();)J!==!1&&(nt.push(J),v(nt));return d()?nt:h("missing '}'")}function x(){for(var nt,J=[],I=s();nt=u(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)J.push(nt[1]),u(/^,\s*/);if(J.length)return I({type:"keyframe",values:J,declarations:_()})}function P(){var nt=s(),J=u(/^@([-\w]+)?keyframes\s*/);if(J){var I=J[1];if(J=u(/^([-\w]+)\s*/),!J)return h("@keyframes missing name");var D=J[1];if(!c())return h("@keyframes missing '{'");for(var A,B=v();A=x();)B.push(A),B=B.concat(v());return d()?nt({type:"keyframes",name:D,vendor:I,keyframes:B}):h("@keyframes missing '}'")}}function R(){var nt=s(),J=u(/^@supports *([^{]+)/);if(J){var I=vi(J[1]);if(!c())return h("@supports missing '{'");var D=v().concat(f());return d()?nt({type:"supports",supports:I,rules:D}):h("@supports missing '}'")}}function F(){var nt=s(),J=u(/^@host\s*/);if(J){if(!c())return h("@host missing '{'");var I=v().concat(f());return d()?nt({type:"host",rules:I}):h("@host missing '}'")}}function L(){var nt=s(),J=u(/^@media *([^{]+)/);if(J){var I=vi(J[1]);if(!c())return h("@media missing '{'");var D=v().concat(f());return d()?nt({type:"media",media:I,rules:D}):h("@media missing '}'")}}function $(){var nt=s(),J=u(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(J)return nt({type:"custom-media",name:vi(J[1]),media:vi(J[2])})}function U(){var nt=s(),J=u(/^@page */);if(J){var I=S()||[];if(!c())return h("@page missing '{'");for(var D=v(),A;A=E();)D.push(A),D=D.concat(v());return d()?nt({type:"page",selectors:I,declarations:D}):h("@page missing '}'")}}function z(){var nt=s(),J=u(/^@([-\w]+)?document *([^{]+)/);if(J){var I=vi(J[1]),D=vi(J[2]);if(!c())return h("@document missing '{'");var A=v().concat(f());return d()?nt({type:"document",document:D,vendor:I,rules:A}):h("@document missing '}'")}}function q(){var nt=s(),J=u(/^@font-face\s*/);if(J){if(!c())return h("@font-face missing '{'");for(var I=v(),D;D=E();)I.push(D),I=I.concat(v());return d()?nt({type:"font-face",declarations:I}):h("@font-face missing '}'")}}var K=vt("import"),Z=vt("charset"),at=vt("namespace");function vt(nt){var J=new RegExp("^@"+nt+"\\s*([^;]+);");return function(){var I=s(),D=u(J);if(D){var A={type:nt};return A[nt]=D[1].trim(),I(A)}}}function _t(){if(n[0]=="@")return P()||L()||$()||R()||K()||Z()||at()||z()||U()||F()||q()}function pt(){var nt=s(),J=S();return J?(v(),nt({type:"rule",selectors:J,declarations:_()})):h("selector missing")}return So(l())}function vi(n){return n?n.replace(/^\s+|\s+$/g,""):""}function So(n,t){var e=n&&typeof n.type=="string",i=e?n:t;for(var r in n){var s=n[r];Array.isArray(s)?s.forEach(function(a){So(a,i)}):s&&typeof s=="object"&&So(s,i)}return e&&Object.defineProperty(n,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),n}const Co=(n,t="image/svg+xml",e="utf-8")=>new Blob([n],{type:`${t};charset=${e}`}),Ql=n=>new XMLSerializer().serializeToString(n),V1=(n,t="text/html")=>new DOMParser().parseFromString(n,t),tc=(n,t="image/svg+xml",e="utf-8")=>Co(Ql(n),t,e),To=(n,t)=>{const e=document.createElement("a");e.style.visibility="hidden",document.body.appendChild(e),e.download=t,typeof n=="string"?e.href=n:e.href=window.URL.createObjectURL(n),e.click(),document.body.removeChild(e),window.URL.revokeObjectURL(e.href)};function ec(n=["*"],t){if(!globalThis.document||!(globalThis.document instanceof Document))throw new Error("This is not a browser environment");const e=globalThis.document.createElement("input");return e.setAttribute("type","file"),e.setAttribute("visibility","hidden"),Array.isArray(n)&&n.length>0&&e.setAttribute("accept",n.join(",")),t&&e.setAttribute("multiple","true"),e.click(),new Promise((i,r)=>{globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!e.files||e.files?.length===0)&&r(new Error("Cancel select"))},1e3)},{once:!0}),e.addEventListener("change",()=>{if(!e.files||e.files?.length===0)r(new Error("Cancel select"));else{const s=Array.from(e.files);!n.includes("*")&&s.some(a=>!n.includes(`.${nc(a)}`))&&r(new Error(`Please select files in ${n} format`)),i(s)}})})}function ko(n,t="text",e){return new Promise((i,r)=>{const s=new FileReader;switch(s.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),s.addEventListener("load",a=>{i(a.target?.result)}),s.addEventListener("error",a=>{r(a)}),t){case"dataURL":s.readAsDataURL(n);break;case"binaryString":s.readAsBinaryString(n);break;case"arrayBuffer":s.readAsArrayBuffer(n);break;default:s.readAsText(n)}})}function ic(n,t,e){return ko(n.slice(t,e),"arrayBuffer")}async function H1(n){const t=await ic(n,0,4);return Ol(t)}const nc=n=>{let t;return n instanceof File?t=n.name:t=n,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function j1(n,t){n.addEventListener("change",function(){t(n.files)},!1)}function X1(n,t){n.addEventListener("dragover",function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},!1),n.addEventListener("drop",function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer&&t(e.dataTransfer.files)},!1)}function Y1(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(t=>setTimeout(()=>{throw t}))}function q1(n,t={},e=[]){return{tag:n,props:t,children:e}}function kr(n,t){if(n.el)return;const e=n.el=document.createElement(n.tag);if(n.props)for(const i in n.props){const r=n.props[i];i.startsWith("on")?e.addEventListener(i.slice(2).toLowerCase(),r):e.setAttribute(i,r)}n.children&&(typeof n.children=="string"?e.textContent=n.children:n.children.forEach(i=>{kr(i,e)})),t.appendChild(e)}function rc(n,t){if(n.tag!==t.tag){if(!n.el)return;const e=n.el.parentElement||document.body;e.removeChild(n.el),kr(t,e)}else{const e=t.el=n.el;if(!e)return;const i=n.props,r=t.props;for(const o in i)o in r||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),i[o]):e.removeAttribute(o));for(const o in r){const h=i[o],l=r[o];l!=h&&(o.startsWith("on")?e.addEventListener(o.slice(2).toLowerCase(),l):e.setAttribute(o,l))}const s=n.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof s=="string")e.innerHTML="",a.forEach(o=>{kr(o,e)});else{const o=Math.min(s.length,a.length);for(let h=0;h<o;h++)rc(s[h],a[h]);a.length>s.length&&a.slice(s.length).forEach(h=>{kr(h,e)}),a.length<s.length&&s.slice(a.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}}function sc(n,t,e){if(!n){e&&t&&e.appendChild(t);return}if(!n.isEqualNode(t)){if(n.nodeName!==t.nodeName){e.replaceChild(t,n);return}if(n.nodeType===Node.TEXT_NODE){n.textContent!==t.textContent&&(n.textContent=t.textContent);return}for(let i=n.attributes.length-1;i>=0;i--){const r=n.attributes[i].name;!t.hasAttribute(r)&&r!=="open"&&n.removeAttribute(r)}for(let i=0;i<t.attributes.length;i++){const r=t.attributes[i].name,s=t.attributes[i].value;n.setAttribute(r,s)}for(let i=0;i<t.childNodes.length;i++)n.childNodes[i]?sc(n.childNodes[i],t.childNodes[i],n):n.appendChild(t.childNodes[i].cloneNode(!0));for(;n.childNodes.length>t.childNodes.length;)n.lastChild&&n.removeChild(n.lastChild)}}class W1{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:i,wasClean:r}=t;console.log(`ws closed : ${e} ${i} ${r}`)},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 i=this.waitingResponse[e.requestid];i?i.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,i=this.waitingResponse[e]={requestid:e};try{let r;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?r=t:r=JSON.stringify({...i,...t});const s=await new Promise((a,o)=>{i.resolve=a,this.sendWithRetry(r),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-i.requestid)/1e3),s}catch(r){return Promise.reject(r)}finally{delete this.waitingResponse[e]}}async send(t,e,i=r=>{console.log(r)}){this.sendPayload(t).then(e,i)}}function Eo(){return document.compatMode=="BackCompat"?document.body:document.documentElement}function Hn(){const n=Eo();return{scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight}}function aa(){const n=Eo();return{clientTop:n.clientTop,clientLeft:n.clientLeft,clientWidth:n.clientWidth,clientHeight:n.clientHeight}}function oa(){const{clientWidth:n,clientHeight:t}=aa();return{width:n,height:t}}function K1(){const{scrollWidth:n,scrollHeight:t}=Hn(),{width:e,height:i}=oa();return{width:Math.max(n,e),height:Math.max(t,i)}}function Z1(n){const{width:t,height:e}=oa(),{top:i,left:r,right:s,bottom:a}=n.getBoundingClientRect();return(i>=0&&i<=e||a>=0&&a<=e)&&(r>=0&&r<=t||s>=0&&s<=t)}function J1(n,t,e){const i={threshold:1};new IntersectionObserver(function(s,a){let o=s[0];if(s.length>1){const l=s.find(c=>c.isIntersecting);l&&(o=l)}o.isIntersecting&&o.intersectionRatio>=i.threshold?t(o.target):e?.(o.target)},i).observe(n)}function ac(n){const{top:t,left:e}=n.getBoundingClientRect(),i=Hn();return{x:e+i.scrollLeft,y:t+i.scrollTop}}function Q1(n){return{x:oc(n),y:hc(n)}}function oc(n){let t=0;for(;n!==null;)t+=n.offsetLeft,n=n.offsetParent;return t}function hc(n){let t=0;for(;n!==null;)t+=n.offsetTop,n=n.offsetParent;return t}function tg(n){const t=n.getBoundingClientRect();return{x:t.left,y:t.top}}function eg(n,t){const e=n.getBoundingClientRect(),i=t.getBoundingClientRect();return{x:i.x-e.x,y:i.y-e.y,width:i.width,height:i.height}}function lc(n){if(n.pageX&&n.pageY)return{x:n.pageX,y:n.pageY};const t=Hn();return{x:n.clientX+t.scrollLeft,y:n.clientY+t.scrollTop}}function ig(n){return{x:n.clientX,y:n.clientY}}function ze(n,t){const e=lc(t),i=ac(n);return{x:e.x-i.x,y:e.y-i.y}}function Po(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}const ha=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/mac/i.test(n)?t="macOS":/win/i.test(n)?t="Windows":/android/i.test(n)?t="Android":/iphone|ipad|ipod/i.test(n)?t="iOS":/linux/i.test(n)?t="Linux":/bsd/i.test(n)&&(t="BSD"),t.toLowerCase()},ng=()=>{const n=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(n)){const e=n.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(n)){const e=n.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(n)){const e=n.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(n)){const e=n.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},Ao=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/chrome/i.test(n)?t="Chrome":/firefox/i.test(n)?t="Firefox":/safari/i.test(n)?t="Safari":/edge/i.test(n)?t="Edge":/msie|trident/i.test(n)?t="IE":/MicroMessenger/i.test(n)?t="Wechat":/alipay/i.test(n)&&(t="Ali"),t.toLowerCase()},rg=()=>{const n=navigator.userAgent;let t="Unknown";if(/Chrome/.test(n)){const e=n.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(n)){const e=n.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(n)){const e=n.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(n)){const e=n.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(n)){const e=n.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t},sg=()=>"geolocation"in navigator?new Promise((n,t)=>{navigator.geolocation.getCurrentPosition(e=>{const i=e.coords.latitude,r=e.coords.longitude;n({latitude:i,longitude:r})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function ag(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function og(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Mo(){return ha()==="ios"}function Ro(){return ha()==="macos"}function hg(){return Mo()|Ro()}function cc(){return ha()==="android"}function lg(){return Mo()||cc()}function cg(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function uc(){const n=window.navigator.userAgent,t=n.indexOf("MSIE ");if(t>0)return parseInt(n.substring(t+5,n.indexOf(".",t)),10);if(n.indexOf("Trident/")>0){const r=n.indexOf("rv:");return parseInt(n.substring(r+3,n.indexOf(".",r)),10)}const i=n.indexOf("Edge/");return i>0?parseInt(n.substring(i+5,n.indexOf(".",i)),10):-1}function fc(){return Ao()==="wechat"}function dc(){return Ao()==="ali"}function ug(){return fc()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function fg(){return dc()&&navigator.userAgent.match(/miniprogram/i)}const dg=uc()!==-1,gg=typeof document<"u",gc=typeof window<"u",pg=typeof history<"u",mg=gc&&window.File&&window.FileReader&&window.FileList&&window.Blob,pc=(()=>{const n=Po();return!!(n.Worker&&n.Blob&&n.Promise&&n.OffscreenCanvas&&n.OffscreenCanvasRenderingContext2D&&n.HTMLCanvasElement&&n.HTMLCanvasElement.prototype.transferControlToOffscreen&&n.URL&&n.URL.createObjectURL)})(),vg=typeof Path2D=="function"&&typeof DOMMatrix=="function",_g=function(){if(!Po().OffscreenCanvas)return!1;var t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);var i=t.transferToImageBitmap();try{e.createPattern(i,"no-repeat")}catch{return!1}return!0}();function yg(n,t){let e=n[t];Object.defineProperty(n,"prop",{get:()=>e,set:i=>{e=i;debugger}})}function wg(n){return new Proxy(n,{get(t,e,i){return Reflect.get(t,e,i)},set(t,e,i,r){debugger;return Reflect.set(t,e,i,r)}})}function bg(n){var t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;var i=100,r=function(){var s=Math.min(t.clientWidth,n);t.dataset.width=s,t.dataset.rem=i=Math.round(100*(s/n)),t.style.fontSize=i+"px"};r(),window.rem2px=function(s){return s=parseFloat(s),s*i},window.px2rem=function(s){return s=parseFloat(s),s/i},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",r,!1)}class It{static onDocumentReady(t){function e(){document.readyState!=="loading"&&(t(),document.removeEventListener("DOMContentLoaded",e))}typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}static getCSSVar(t){return getComputedStyle(document.documentElement).getPropertyValue(t)}static setCSSVar(t,e){document.documentElement.style.setProperty(t,e)}static safeExec(t){const e=new Proxy(window,{get(i,r,s){if(typeof r=="string"&&["open","location","document"].includes(r))throw new Error(`禁止访问 key: ${r}`);return r==="window"?e:Reflect.get(i,r,s)},set(i,r,s,a){return Reflect.set(i,r,s,a)}});new Function("window",`with(window) { ${t} }`)(e,null)}static dom=new Proxy({},{get(t,e){return function(i={},...r){const s=document.createElement(e);for(const a of Object.keys(i))s.setAttribute(a,i[a]);for(const a of r)typeof a=="string"?s.appendChild(document.createTextNode(a)):s.appendChild(a);return s}}});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};function pc(n){const t={matchIndex:-1,fullMatch:null,groupMatchs:[]};if(n){t.matchIndex=typeof n.index=="number"?n.index:-1;for(let e=0,i=n.length;e<i;e++)e==0?t.fullMatch=n[e]:t.groupMatchs.push(n[e])}return t}const ra=(n,t)=>{typeof n=="string"&&(n=dc(n)||new RegExp(n));const e=[],i=t.matchAll(n);for(const r of i)e.push(pc(r));return e};function sa(n){return n.replace(/(^\w|[_-]\w)/g,function(t){return t.slice(-1).toUpperCase()})}function aa(n){let t="";for(let e=0,i=n.length;e<i;e++){const r=n.charCodeAt(e);r>=1&&r<=127?t+=n.charAt(e):r>2047?(t+=String.fromCharCode(224|r>>12&15),t+=String.fromCharCode(128|r>>6&63),t+=String.fromCharCode(128|r>>0&63)):(t+=String.fromCharCode(192|r>>6&31),t+=String.fromCharCode(128|r>>0&63))}return t}var Ne=(n=>(n.UNKNOWN="",n.HTML="text/html",n.CSS="text/css",n.XML="text/xml",n.TEXT="text/plain",n.MD="text/plain",n.JPEG="image/jpeg",n.PNG="image/png",n.GIF="image/gif",n.WEBP="image/webp",n.SVG="image/svg+xml",n.ICO="image/x-icon",n.MPEG="audio/mpeg",n.MP3="audio/mpeg",n.OGG="audio/ogg",n.WAV="audio/wav",n.MP4="video/mp4",n.JSON="application/json",n.JAVASCRIPT="application/javascript",n.ECMASCRIPT="application/ecmascript",n.EXCEL="application/vnb.ms-excel",n.XWWW="application/x-www-form-urlencoded",n.DOC="application/msword",n.CSV="application/x-csv",n.PDF="application/pdf",n.ZIP="application/zip",n.TGZ="application/x-gtar",n.TAR_GZ="application/x-gzip",n.EOT="appliaction/vnd.ms-fontobject",n.TTF="aplication/font-sfnt",n))(Ne||{});const On=(n,t=16)=>(n=n.toLowerCase(),(n.indexOf("0b")==0||n.indexOf("0o")==0||n.indexOf("0x")==0)&&(n=n.slice(2)),parseInt(n,t));function gc(){const n=Uint32Array.of(305419896),t=new Uint8Array(n.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}const oa=n=>{let t=Ne.UNKNOWN;switch(new DataView(n).getUint32(0,gc()).toString(16).toUpperCase()){case"FFD8FFDB":t=Ne.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Ne.JPEG;break;case"89504E47":t=Ne.PNG;break;case"47494638":t=Ne.GIF;break;case"52494646":t=Ne.WEBP;break;case"25504446":t=Ne.PDF;break;case"504B0304":t=Ne.ZIP;break}return t},la=function(){const n=[];return{writeByte(t){n.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,i=t.length){for(let r=0;r<i;r++)this.writeByte(t[r+e])},writeString(t){for(let e=0,i=t.length;e<i;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return n},toString(){let t="[";for(let e=0,i=n.length;e<i;e++)e>0&&(t+=","),t+=n[e];return t+="]",t}}},mc=function(){let n=0,t=0,e=0,i="";const r=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)},s=function(a){i+=String.fromCharCode(r(a&63))};return{writeByte(a){for(n=n<<8|a&255,t+=8,e+=1;t>=6;)s(n>>>t-6),t-=6},flush(){if(t>0&&(s(n<<6-t),n=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)i+="="}},toString(){return i}}};function vc(n){const t=typeof n;return t!=="object"?t:Object.prototype.toString.call(n).replace(/^\[object (\S+)\]$/,"$1").toLowerCase()}function Nr(n){return vc(n)==="object"}function ca(n,t=new WeakMap){if(n==null)return n;if(n.constructor===Date)return new Date(n);if(n.constructor===RegExp)return new RegExp(n);if(typeof n!="object")return n;if(t.has(n))return t.get(n);const e=Object.getOwnPropertyDescriptors(n),i=Object.create(Object.getPrototypeOf(n),e);t.set(n,i);for(const r of Reflect.ownKeys(n))i[r]=Nr(n[r])?ca(n[r],t):n[r];return i}function ha(n,t=12){return+n.toPrecision(t)}var _c=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ji(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var fa={exports:{}},Fn=typeof Reflect=="object"?Reflect:null,ua=Fn&&typeof Fn.apply=="function"?Fn.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)},Xi;Fn&&typeof Fn.ownKeys=="function"?Xi=Fn.ownKeys:Object.getOwnPropertySymbols?Xi=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Xi=function(t){return Object.getOwnPropertyNames(t)};function yc(n){console&&console.warn&&console.warn(n)}var da=Number.isNaN||function(t){return t!==t};function Nt(){Nt.init.call(this)}fa.exports=Nt,fa.exports.once=Cc,Nt.EventEmitter=Nt,Nt.prototype._events=void 0,Nt.prototype._eventsCount=0,Nt.prototype._maxListeners=void 0;var pa=10;function Yi(n){if(typeof n!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n)}Object.defineProperty(Nt,"defaultMaxListeners",{enumerable:!0,get:function(){return pa},set:function(n){if(typeof n!="number"||n<0||da(n))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+n+".");pa=n}}),Nt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Nt.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||da(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function ga(n){return n._maxListeners===void 0?Nt.defaultMaxListeners:n._maxListeners}Nt.prototype.getMaxListeners=function(){return ga(this)},Nt.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var r=t==="error",s=this._events;if(s!==void 0)r=r&&s.error===void 0;else if(!r)return!1;if(r){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var l=s[t];if(l===void 0)return!1;if(typeof l=="function")ua(l,this,e);else for(var c=l.length,u=wa(l,c),i=0;i<c;++i)ua(u[i],this,e);return!0};function ma(n,t,e,i){var r,s,a;if(Yi(e),s=n._events,s===void 0?(s=n._events=Object.create(null),n._eventsCount=0):(s.newListener!==void 0&&(n.emit("newListener",t,e.listener?e.listener:e),s=n._events),a=s[t]),a===void 0)a=s[t]=e,++n._eventsCount;else if(typeof a=="function"?a=s[t]=i?[e,a]:[a,e]:i?a.unshift(e):a.push(e),r=ga(n),r>0&&a.length>r&&!a.warned){a.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=n,o.type=t,o.count=a.length,yc(o)}return n}Nt.prototype.addListener=function(t,e){return ma(this,t,e,!1)},Nt.prototype.on=Nt.prototype.addListener,Nt.prototype.prependListener=function(t,e){return ma(this,t,e,!0)};function wc(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function va(n,t,e){var i={fired:!1,wrapFn:void 0,target:n,type:t,listener:e},r=wc.bind(i);return r.listener=e,i.wrapFn=r,r}Nt.prototype.once=function(t,e){return Yi(e),this.on(t,va(this,t,e)),this},Nt.prototype.prependOnceListener=function(t,e){return Yi(e),this.prependListener(t,va(this,t,e)),this},Nt.prototype.removeListener=function(t,e){var i,r,s,a,o;if(Yi(e),r=this._events,r===void 0)return this;if(i=r[t],i===void 0)return this;if(i===e||i.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,i.listener||e));else if(typeof i!="function"){for(s=-1,a=i.length-1;a>=0;a--)if(i[a]===e||i[a].listener===e){o=i[a].listener,s=a;break}if(s<0)return this;s===0?i.shift():xc(i,s),i.length===1&&(r[t]=i[0]),r.removeListener!==void 0&&this.emit("removeListener",t,o||e)}return this},Nt.prototype.off=Nt.prototype.removeListener,Nt.prototype.removeAllListeners=function(t){var e,i,r;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[t]),this;if(arguments.length===0){var s=Object.keys(i),a;for(r=0;r<s.length;++r)a=s[r],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(e=i[t],typeof e=="function")this.removeListener(t,e);else if(e!==void 0)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this};function _a(n,t,e){var i=n._events;if(i===void 0)return[];var r=i[t];return r===void 0?[]:typeof r=="function"?e?[r.listener||r]:[r]:e?bc(r):wa(r,r.length)}Nt.prototype.listeners=function(t){return _a(this,t,!0)},Nt.prototype.rawListeners=function(t){return _a(this,t,!1)},Nt.listenerCount=function(n,t){return typeof n.listenerCount=="function"?n.listenerCount(t):ya.call(n,t)},Nt.prototype.listenerCount=ya;function ya(n){var t=this._events;if(t!==void 0){var e=t[n];if(typeof e=="function")return 1;if(e!==void 0)return e.length}return 0}Nt.prototype.eventNames=function(){return this._eventsCount>0?Xi(this._events):[]};function wa(n,t){for(var e=new Array(t),i=0;i<t;++i)e[i]=n[i];return e}function xc(n,t){for(;t+1<n.length;t++)n[t]=n[t+1];n.pop()}function bc(n){for(var t=new Array(n.length),e=0;e<t.length;++e)t[e]=n[e].listener||n[e];return t}function Cc(n,t){return new Promise(function(e,i){function r(a){n.removeListener(t,s),i(a)}function s(){typeof n.removeListener=="function"&&n.removeListener("error",r),e([].slice.call(arguments))}xa(n,t,s,{once:!0}),t!=="error"&&Tc(n,r,{once:!0})})}function Tc(n,t,e){typeof n.on=="function"&&xa(n,"error",t,e)}function xa(n,t,e,i){if(typeof n.on=="function")i.once?n.once(t,e):n.on(t,e);else if(typeof n.addEventListener=="function")n.addEventListener(t,function r(s){i.once&&n.removeEventListener(t,r),e(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof n)}class Sc{events;constructor(){this.events={}}on(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e)}addListener(t,e){this.on(t,e)}prependListener(t,e){this.events[t]||(this.events[t]=[]),this.events[t].unshift(e)}removeListener(t,e){this.events[t]&&(this.events[t]=this.events[t].filter(i=>i!==e))}off(t,e){this.removeListener(t,e)}removeAllListeners(t){t?this.events[t]=[]:this.events={}}emit(t,...e){this.events[t]&&this.events[t].forEach(i=>{Reflect.apply(i,this,e)})}once(t,e){const r=(()=>{let s=!1;return(...a)=>{s||(s=!0,Reflect.apply(e,this,a),this.off(t,r))}})();this.on(t,r)}}var ba=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Ec(n,t={}){var e=1,i=1;function r(st){var ht=st.match(/\n/g);ht&&(e+=ht.length);var L=st.lastIndexOf(`
11
+ `);i=~L?st.length-L:i+st.length}function s(){var st={line:e,column:i};return function(ht){return ht.position=new a(st),w(),ht}}function a(st){this.start=st,this.end={line:e,column:i},this.source=t.source}a.prototype.content=n;var o=[];function l(st){var ht=new Error(t.source+":"+e+":"+i+": "+st);if(ht.reason=st,ht.filename=t.source,ht.line=e,ht.column=i,ht.source=n,t.silent)o.push(ht);else throw ht}function c(){var st=p();return{type:"stylesheet",stylesheet:{source:t.source,rules:st,parsingErrors:o}}}function u(){return d(/^{\s*/)}function g(){return d(/^}/)}function p(){var st,ht=[];for(w(),x(ht);n.length&&n.charAt(0)!="}"&&(st=kt()||tt());)st!==!1&&(ht.push(st),x(ht));return ht}function d(st){var ht=st.exec(n);if(ht){var L=ht[0];return r(L),n=n.slice(L.length),ht}}function w(){d(/^\s*/)}function x(st){var ht;for(st=st||[];ht=C();)ht!==!1&&st.push(ht);return st}function C(){var st=s();if(!(n.charAt(0)!="/"||n.charAt(1)!="*")){for(var ht=2;n.charAt(ht)!=""&&(n.charAt(ht)!="*"||n.charAt(ht+1)!="/");)++ht;if(ht+=2,n.charAt(ht-1)==="")return l("End of comment missing");var L=n.slice(2,ht-2);return i+=2,r(L),n=n.slice(ht),i+=2,st({type:"comment",comment:L})}}function A(){var st=d(/^([^{]+)/);if(st)return ze(st[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(ht){return ht.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(ht){return ht.replace(/\u200C/g,",")})}function P(){var st=s(),ht=d(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(ht){if(ht=ze(ht[0]),!d(/^:\s*/))return l("property missing ':'");var L=d(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),E=st({type:"declaration",property:ht.replace(ba,""),value:L?ze(L[0]).replace(ba,""):""});return d(/^[;\s]*/),E}}function M(){var st=[];if(!u())return l("missing '{'");x(st);for(var ht;ht=P();)ht!==!1&&(st.push(ht),x(st));return g()?st:l("missing '}'")}function D(){for(var st,ht=[],L=s();st=d(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)ht.push(st[1]),d(/^,\s*/);if(ht.length)return L({type:"keyframe",values:ht,declarations:M()})}function U(){var st=s(),ht=d(/^@([-\w]+)?keyframes\s*/);if(ht){var L=ht[1];if(ht=d(/^([-\w]+)\s*/),!ht)return l("@keyframes missing name");var E=ht[1];if(!u())return l("@keyframes missing '{'");for(var S,R=x();S=D();)R.push(S),R=R.concat(x());return g()?st({type:"keyframes",name:E,vendor:L,keyframes:R}):l("@keyframes missing '}'")}}function z(){var st=s(),ht=d(/^@supports *([^{]+)/);if(ht){var L=ze(ht[1]);if(!u())return l("@supports missing '{'");var E=x().concat(p());return g()?st({type:"supports",supports:L,rules:E}):l("@supports missing '}'")}}function F(){var st=s(),ht=d(/^@host\s*/);if(ht){if(!u())return l("@host missing '{'");var L=x().concat(p());return g()?st({type:"host",rules:L}):l("@host missing '}'")}}function G(){var st=s(),ht=d(/^@media *([^{]+)/);if(ht){var L=ze(ht[1]);if(!u())return l("@media missing '{'");var E=x().concat(p());return g()?st({type:"media",media:L,rules:E}):l("@media missing '}'")}}function H(){var st=s(),ht=d(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(ht)return st({type:"custom-media",name:ze(ht[1]),media:ze(ht[2])})}function $(){var st=s(),ht=d(/^@page */);if(ht){var L=A()||[];if(!u())return l("@page missing '{'");for(var E=x(),S;S=P();)E.push(S),E=E.concat(x());return g()?st({type:"page",selectors:L,declarations:E}):l("@page missing '}'")}}function X(){var st=s(),ht=d(/^@([-\w]+)?document *([^{]+)/);if(ht){var L=ze(ht[1]),E=ze(ht[2]);if(!u())return l("@document missing '{'");var S=x().concat(p());return g()?st({type:"document",document:E,vendor:L,rules:S}):l("@document missing '}'")}}function J(){var st=s(),ht=d(/^@font-face\s*/);if(ht){if(!u())return l("@font-face missing '{'");for(var L=x(),E;E=P();)L.push(E),L=L.concat(x());return g()?st({type:"font-face",declarations:L}):l("@font-face missing '}'")}}var dt=Et("import"),ft=Et("charset"),gt=Et("namespace");function Et(st){var ht=new RegExp("^@"+st+"\\s*([^;]+);");return function(){var L=s(),E=d(ht);if(E){var S={type:st};return S[st]=E[1].trim(),L(S)}}}function kt(){if(n[0]=="@")return U()||G()||H()||z()||dt()||ft()||gt()||X()||$()||F()||J()}function tt(){var st=s(),ht=A();return ht?(x(),st({type:"rule",selectors:ht,declarations:M()})):l("selector missing")}return zr(c())}function ze(n){return n?n.replace(/^\s+|\s+$/g,""):""}function zr(n,t){var e=n&&typeof n.type=="string",i=e?n:t;for(var r in n){var s=n[r];Array.isArray(s)?s.forEach(function(a){zr(a,i)}):s&&typeof s=="object"&&zr(s,i)}return e&&Object.defineProperty(n,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),n}const Br=(n,t="image/svg+xml",e="utf-8")=>new Blob([n],{type:`${t};charset=${e}`}),Ca=n=>new XMLSerializer().serializeToString(n),kc=(n,t="text/html")=>new DOMParser().parseFromString(n,t),Ta=(n,t="image/svg+xml",e="utf-8")=>Br(Ca(n),t,e),Gr=(n,t)=>{const e=document.createElement("a");e.style.visibility="hidden",document.body.appendChild(e),e.download=t,typeof n=="string"?e.href=n:e.href=window.URL.createObjectURL(n),e.click(),document.body.removeChild(e),window.URL.revokeObjectURL(e.href)};function Ac(n=["*"],t){if(!globalThis.document||!(globalThis.document instanceof Document))throw new Error("This is not a browser environment");const e=globalThis.document.createElement("input");return e.setAttribute("type","file"),e.setAttribute("visibility","hidden"),Array.isArray(n)&&n.length>0&&e.setAttribute("accept",n.join(",")),t&&e.setAttribute("multiple","true"),e.click(),new Promise((i,r)=>{globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!e.files||e.files?.length===0)&&r(new Error("Cancel select"))},1e3)},{once:!0}),e.addEventListener("change",()=>{if(!e.files||e.files?.length===0)r(new Error("Cancel select"));else{const s=Array.from(e.files);!n.includes("*")&&s.some(a=>!n.includes(`.${ka(a)}`))&&r(new Error(`Please select files in ${n} format`)),i(s)}})})}function Sa(n,t="text",e){return new Promise((i,r)=>{const s=new FileReader;switch(s.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),s.addEventListener("load",a=>{i(a.target?.result)}),s.addEventListener("error",a=>{r(a)}),t){case"dataURL":s.readAsDataURL(n);break;case"binaryString":s.readAsBinaryString(n);break;case"arrayBuffer":s.readAsArrayBuffer(n);break;default:s.readAsText(n)}})}function Ea(n,t,e){return Sa(n.slice(t,e),"arrayBuffer")}async function Pc(n){const t=await Ea(n,0,4);return oa(t)}const ka=n=>{let t;return n instanceof File?t=n.name:t=n,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function Ic(n,t){n.addEventListener("change",function(){t(n.files)},!1)}function Mc(n,t){n.addEventListener("dragover",function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},!1),n.addEventListener("drop",function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer&&t(e.dataTransfer.files)},!1)}function Lc(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(t=>setTimeout(()=>{throw t}))}function Dc(n,t={},e=[]){return{tag:n,props:t,children:e}}function ci(n,t){if(n.el)return;const e=n.el=document.createElement(n.tag);if(n.props)for(const i in n.props){const r=n.props[i];i.startsWith("on")?e.addEventListener(i.slice(2).toLowerCase(),r):e.setAttribute(i,r)}n.children&&(typeof n.children=="string"?e.textContent=n.children:n.children.forEach(i=>{ci(i,e)})),t.appendChild(e)}function Aa(n,t){if(n.tag!==t.tag){if(!n.el)return;const e=n.el.parentElement||document.body;e.removeChild(n.el),ci(t,e)}else{const e=t.el=n.el;if(!e)return;const i=n.props,r=t.props;for(const o in i)o in r||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),i[o]):e.removeAttribute(o));for(const o in r){const l=i[o],c=r[o];c!=l&&(o.startsWith("on")?e.addEventListener(o.slice(2).toLowerCase(),c):e.setAttribute(o,c))}const s=n.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof s=="string")e.innerHTML="",a.forEach(o=>{ci(o,e)});else{const o=Math.min(s.length,a.length);for(let l=0;l<o;l++)Aa(s[l],a[l]);a.length>s.length&&a.slice(s.length).forEach(l=>{ci(l,e)}),a.length<s.length&&s.slice(a.length).forEach(l=>{l.el&&e.removeChild(l.el)})}}}function Pa(n,t,e){if(!n){e&&t&&e.appendChild(t);return}if(!n.isEqualNode(t)){if(n.nodeName!==t.nodeName){e.replaceChild(t,n);return}if(n.nodeType===Node.TEXT_NODE){n.textContent!==t.textContent&&(n.textContent=t.textContent);return}for(let i=n.attributes.length-1;i>=0;i--){const r=n.attributes[i].name;!t.hasAttribute(r)&&r!=="open"&&n.removeAttribute(r)}for(let i=0;i<t.attributes.length;i++){const r=t.attributes[i].name,s=t.attributes[i].value;n.setAttribute(r,s)}for(let i=0;i<t.childNodes.length;i++)n.childNodes[i]?Pa(n.childNodes[i],t.childNodes[i],n):n.appendChild(t.childNodes[i].cloneNode(!0));for(;n.childNodes.length>t.childNodes.length;)n.lastChild&&n.removeChild(n.lastChild)}}class Rc{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:i,wasClean:r}=t;console.log(`ws closed : ${e} ${i} ${r}`)},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 i=this.waitingResponse[e.requestid];i?i.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,i=this.waitingResponse[e]={requestid:e};try{let r;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?r=t:r=JSON.stringify({...i,...t});const s=await new Promise((a,o)=>{i.resolve=a,this.sendWithRetry(r),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-i.requestid)/1e3),s}catch(r){return Promise.reject(r)}finally{delete this.waitingResponse[e]}}async send(t,e,i=r=>{console.log(r)}){this.sendPayload(t).then(e,i)}}function Hr(){return document.compatMode=="BackCompat"?document.body:document.documentElement}function Un(){const n=Hr();return{scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight}}function $i(){const n=Hr();return{clientTop:n.clientTop,clientLeft:n.clientLeft,clientWidth:n.clientWidth,clientHeight:n.clientHeight}}function qi(){const{clientWidth:n,clientHeight:t}=$i();return{width:n,height:t}}function Oc(){const{scrollWidth:n,scrollHeight:t}=Un(),{width:e,height:i}=qi();return{width:Math.max(n,e),height:Math.max(t,i)}}function Fc(n){const{width:t,height:e}=qi(),{top:i,left:r,right:s,bottom:a}=n.getBoundingClientRect();return(i>=0&&i<=e||a>=0&&a<=e)&&(r>=0&&r<=t||s>=0&&s<=t)}function Uc(n,t,e){const i={threshold:1};new IntersectionObserver(function(s,a){let o=s[0];if(s.length>1){const c=s.find(u=>u.isIntersecting);c&&(o=c)}o.isIntersecting&&o.intersectionRatio>=i.threshold?t(o.target):e?.(o.target)},i).observe(n)}function Ia(n){const{top:t,left:e}=n.getBoundingClientRect(),i=Un();return{x:e+i.scrollLeft,y:t+i.scrollTop}}function Nc(n){return{x:Ma(n),y:La(n)}}function Ma(n){let t=0;for(;n!==null;)t+=n.offsetLeft,n=n.offsetParent;return t}function La(n){let t=0;for(;n!==null;)t+=n.offsetTop,n=n.offsetParent;return t}function zc(n){const t=n.getBoundingClientRect();return{x:t.left,y:t.top}}function Bc(n,t){const e=n.getBoundingClientRect(),i=t.getBoundingClientRect();return{x:i.x-e.x,y:i.y-e.y,width:i.width,height:i.height}}function Da(n){if("center"in n)return n.center;if(n.pageX&&n.pageY)return{x:n.pageX,y:n.pageY};const t=Un();return{x:n.clientX+t.scrollLeft,y:n.clientY+t.scrollTop}}function Gc(n){return{x:n.clientX,y:n.clientY}}function Zi(n,t){const e=Da(t),i=Ia(n);return{x:e.x-i.x,y:e.y-i.y}}function Vr(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}const Wi=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/mac/i.test(n)?t="macOS":/win/i.test(n)?t="Windows":/android/i.test(n)?t="Android":/iphone|ipad|ipod/i.test(n)?t="iOS":/linux/i.test(n)?t="Linux":/bsd/i.test(n)&&(t="BSD"),t.toLowerCase()},Hc=()=>{const n=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(n)){const e=n.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(n)){const e=n.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(n)){const e=n.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(n)){const e=n.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},jr=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/chrome/i.test(n)?t="Chrome":/firefox/i.test(n)?t="Firefox":/safari/i.test(n)?t="Safari":/edge/i.test(n)?t="Edge":/msie|trident/i.test(n)?t="IE":/MicroMessenger/i.test(n)?t="Wechat":/alipay/i.test(n)&&(t="Ali"),t.toLowerCase()},Vc=()=>{const n=navigator.userAgent;let t="Unknown";if(/Chrome/.test(n)){const e=n.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(n)){const e=n.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(n)){const e=n.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(n)){const e=n.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(n)){const e=n.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t},jc=()=>"geolocation"in navigator?new Promise((n,t)=>{navigator.geolocation.getCurrentPosition(e=>{const i=e.coords.latitude,r=e.coords.longitude;n({latitude:i,longitude:r})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function Xc(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function Yc(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Xr(){return Wi()==="ios"}function Yr(){return Wi()==="macos"}function $c(){return Xr()|Yr()}function Ra(){return Wi()==="android"}function qc(){return Xr()||Ra()}function Zc(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function Oa(){const n=window.navigator.userAgent,t=n.indexOf("MSIE ");if(t>0)return parseInt(n.substring(t+5,n.indexOf(".",t)),10);if(n.indexOf("Trident/")>0){const r=n.indexOf("rv:");return parseInt(n.substring(r+3,n.indexOf(".",r)),10)}const i=n.indexOf("Edge/");return i>0?parseInt(n.substring(i+5,n.indexOf(".",i)),10):-1}function Fa(){return jr()==="wechat"}function Ua(){return jr()==="ali"}function Wc(){return Fa()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function Jc(){return Ua()&&navigator.userAgent.match(/miniprogram/i)}const Kc=Oa()!==-1,Qc=typeof document<"u",Na=typeof window<"u",th=typeof history<"u",eh=Na&&window.File&&window.FileReader&&window.FileList&&window.Blob,za=(()=>{const n=Vr();return!!(n.Worker&&n.Blob&&n.Promise&&n.OffscreenCanvas&&n.OffscreenCanvasRenderingContext2D&&n.HTMLCanvasElement&&n.HTMLCanvasElement.prototype.transferControlToOffscreen&&n.URL&&n.URL.createObjectURL)})(),nh=typeof Path2D=="function"&&typeof DOMMatrix=="function",ih=function(){if(!Vr().OffscreenCanvas)return!1;var t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);var i=t.transferToImageBitmap();try{e.createPattern(i,"no-repeat")}catch{return!1}return!0}();function rh(n,t){let e=n[t];Object.defineProperty(n,"prop",{get:()=>e,set:i=>{e=i;debugger}})}function sh(n){return new Proxy(n,{get(t,e,i){return Reflect.get(t,e,i)},set(t,e,i,r){debugger;return Reflect.set(t,e,i,r)}})}function ah(n){var t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;var i=100,r=function(){var s=Math.min(t.clientWidth,n);t.dataset.width=s,t.dataset.rem=i=Math.round(100*(s/n)),t.style.fontSize=i+"px"};r(),window.rem2px=function(s){return s=parseFloat(s),s*i},window.px2rem=function(s){return s=parseFloat(s),s/i},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",r,!1)}var Ba={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
12
+ * http://hammerjs.github.io/
13
+ *
14
+ * Copyright (c) 2016 Jorik Tangelder;
15
+ * Licensed under the MIT license */(function(n){(function(t,e,i,r){var s=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),o="function",l=Math.round,c=Math.abs,u=Date.now;function g(h,m,y){return setTimeout(M(h,y),m)}function p(h,m,y){return Array.isArray(h)?(d(h,y[m],y),!0):!1}function d(h,m,y){var b;if(h)if(h.forEach)h.forEach(m,y);else if(h.length!==r)for(b=0;b<h.length;)m.call(y,h[b],b,h),b++;else for(b in h)h.hasOwnProperty(b)&&m.call(y,h[b],b,h)}function w(h,m,y){var b="DEPRECATED METHOD: "+m+`
16
+ `+y+` AT
17
+ `;return function(){var k=new Error("get-stack-trace"),I=k&&k.stack?k.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",N=t.console&&(t.console.warn||t.console.log);return N&&N.call(t.console,b,I),h.apply(this,arguments)}}var x;typeof Object.assign!="function"?x=function(m){if(m===r||m===null)throw new TypeError("Cannot convert undefined or null to object");for(var y=Object(m),b=1;b<arguments.length;b++){var k=arguments[b];if(k!==r&&k!==null)for(var I in k)k.hasOwnProperty(I)&&(y[I]=k[I])}return y}:x=Object.assign;var C=w(function(m,y,b){for(var k=Object.keys(y),I=0;I<k.length;)(!b||b&&m[k[I]]===r)&&(m[k[I]]=y[k[I]]),I++;return m},"extend","Use `assign`."),A=w(function(m,y){return C(m,y,!0)},"merge","Use `assign`.");function P(h,m,y){var b=m.prototype,k;k=h.prototype=Object.create(b),k.constructor=h,k._super=b,y&&x(k,y)}function M(h,m){return function(){return h.apply(m,arguments)}}function D(h,m){return typeof h==o?h.apply(m&&m[0]||r,m):h}function U(h,m){return h===r?m:h}function z(h,m,y){d($(m),function(b){h.addEventListener(b,y,!1)})}function F(h,m,y){d($(m),function(b){h.removeEventListener(b,y,!1)})}function G(h,m){for(;h;){if(h==m)return!0;h=h.parentNode}return!1}function H(h,m){return h.indexOf(m)>-1}function $(h){return h.trim().split(/\s+/g)}function X(h,m,y){if(h.indexOf&&!y)return h.indexOf(m);for(var b=0;b<h.length;){if(y&&h[b][y]==m||!y&&h[b]===m)return b;b++}return-1}function J(h){return Array.prototype.slice.call(h,0)}function dt(h,m,y){for(var b=[],k=[],I=0;I<h.length;){var N=m?h[I][m]:h[I];X(k,N)<0&&b.push(h[I]),k[I]=N,I++}return y&&(m?b=b.sort(function(Q,W){return Q[m]>W[m]}):b=b.sort()),b}function ft(h,m){for(var y,b,k=m[0].toUpperCase()+m.slice(1),I=0;I<s.length;){if(y=s[I],b=y?y+k:m,b in h)return b;I++}return r}var gt=1;function Et(){return gt++}function kt(h){var m=h.ownerDocument||h;return m.defaultView||m.parentWindow||t}var tt=/mobile|tablet|ip(ad|hone|od)|android/i,st="ontouchstart"in t,ht=ft(t,"PointerEvent")!==r,L=st&&tt.test(navigator.userAgent),E="touch",S="pen",R="mouse",B="kinect",j=25,V=1,et=2,Y=4,it=8,pt=1,vt=2,wt=4,At=8,xt=16,It=vt|wt,Mt=At|xt,Dt=It|Mt,_t=["x","y"],zt=["clientX","clientY"];function Rt(h,m){var y=this;this.manager=h,this.callback=m,this.element=h.element,this.target=h.options.inputTarget,this.domHandler=function(b){D(h.options.enable,[h])&&y.handler(b)},this.init()}Rt.prototype={handler:function(){},init:function(){this.evEl&&z(this.element,this.evEl,this.domHandler),this.evTarget&&z(this.target,this.evTarget,this.domHandler),this.evWin&&z(kt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&F(this.element,this.evEl,this.domHandler),this.evTarget&&F(this.target,this.evTarget,this.domHandler),this.evWin&&F(kt(this.element),this.evWin,this.domHandler)}};function jt(h){var m,y=h.options.inputClass;return y?m=y:ht?m=ye:L?m=Ze:st?m=Qn:m=Te,new m(h,Ut)}function Ut(h,m,y){var b=y.pointers.length,k=y.changedPointers.length,I=m&V&&b-k===0,N=m&(Y|it)&&b-k===0;y.isFirst=!!I,y.isFinal=!!N,I&&(h.session={}),y.eventType=m,ie(h,y),h.emit("hammer.input",y),h.recognize(y),h.session.prevInput=y}function ie(h,m){var y=h.session,b=m.pointers,k=b.length;y.firstInput||(y.firstInput=fn(m)),k>1&&!y.firstMultiple?y.firstMultiple=fn(m):k===1&&(y.firstMultiple=!1);var I=y.firstInput,N=y.firstMultiple,q=N?N.center:I.center,Q=m.center=Ce(b);m.timeStamp=u(),m.deltaTime=m.timeStamp-I.timeStamp,m.angle=De(q,Q),m.distance=Le(q,Q),Wt(y,m),m.offsetDirection=Xe(m.deltaX,m.deltaY);var W=je(m.deltaTime,m.deltaX,m.deltaY);m.overallVelocityX=W.x,m.overallVelocityY=W.y,m.overallVelocity=c(W.x)>c(W.y)?W.x:W.y,m.scale=N?qt(N.pointers,b):1,m.rotation=N?Wn(N.pointers,b):0,m.maxPointers=y.prevInput?m.pointers.length>y.prevInput.maxPointers?m.pointers.length:y.prevInput.maxPointers:m.pointers.length,Me(y,m);var Z=h.element;G(m.srcEvent.target,Z)&&(Z=m.srcEvent.target),m.target=Z}function Wt(h,m){var y=m.center,b=h.offsetDelta||{},k=h.prevDelta||{},I=h.prevInput||{};(m.eventType===V||I.eventType===Y)&&(k=h.prevDelta={x:I.deltaX||0,y:I.deltaY||0},b=h.offsetDelta={x:y.x,y:y.y}),m.deltaX=k.x+(y.x-b.x),m.deltaY=k.y+(y.y-b.y)}function Me(h,m){var y=h.lastInterval||m,b=m.timeStamp-y.timeStamp,k,I,N,q;if(m.eventType!=it&&(b>j||y.velocity===r)){var Q=m.deltaX-y.deltaX,W=m.deltaY-y.deltaY,Z=je(b,Q,W);I=Z.x,N=Z.y,k=c(Z.x)>c(Z.y)?Z.x:Z.y,q=Xe(Q,W),h.lastInterval=m}else k=y.velocity,I=y.velocityX,N=y.velocityY,q=y.direction;m.velocity=k,m.velocityX=I,m.velocityY=N,m.direction=q}function fn(h){for(var m=[],y=0;y<h.pointers.length;)m[y]={clientX:l(h.pointers[y].clientX),clientY:l(h.pointers[y].clientY)},y++;return{timeStamp:u(),pointers:m,center:Ce(m),deltaX:h.deltaX,deltaY:h.deltaY}}function Ce(h){var m=h.length;if(m===1)return{x:l(h[0].clientX),y:l(h[0].clientY)};for(var y=0,b=0,k=0;k<m;)y+=h[k].clientX,b+=h[k].clientY,k++;return{x:l(y/m),y:l(b/m)}}function je(h,m,y){return{x:m/h||0,y:y/h||0}}function Xe(h,m){return h===m?pt:c(h)>=c(m)?h<0?vt:wt:m<0?At:xt}function Le(h,m,y){y||(y=_t);var b=m[y[0]]-h[y[0]],k=m[y[1]]-h[y[1]];return Math.sqrt(b*b+k*k)}function De(h,m,y){y||(y=_t);var b=m[y[0]]-h[y[0]],k=m[y[1]]-h[y[1]];return Math.atan2(k,b)*180/Math.PI}function Wn(h,m){return De(m[1],m[0],zt)+De(h[1],h[0],zt)}function qt(h,m){return Le(m[0],m[1],zt)/Le(h[0],h[1],zt)}var Re={mousedown:V,mousemove:et,mouseup:Y},un="mousedown",ae="mousemove mouseup";function Te(){this.evEl=un,this.evWin=ae,this.pressed=!1,Rt.apply(this,arguments)}P(Te,Rt,{handler:function(m){var y=Re[m.type];y&V&&m.button===0&&(this.pressed=!0),y&et&&m.which!==1&&(y=Y),this.pressed&&(y&Y&&(this.pressed=!1),this.callback(this.manager,y,{pointers:[m],changedPointers:[m],pointerType:R,srcEvent:m}))}});var de={pointerdown:V,pointermove:et,pointerup:Y,pointercancel:it,pointerout:it},Pn={2:E,3:S,4:R,5:B},Ye="pointerdown",dn="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Ye="MSPointerDown",dn="MSPointerMove MSPointerUp MSPointerCancel");function ye(){this.evEl=Ye,this.evWin=dn,Rt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}P(ye,Rt,{handler:function(m){var y=this.store,b=!1,k=m.type.toLowerCase().replace("ms",""),I=de[k],N=Pn[m.pointerType]||m.pointerType,q=N==E,Q=X(y,m.pointerId,"pointerId");I&V&&(m.button===0||q)?Q<0&&(y.push(m),Q=y.length-1):I&(Y|it)&&(b=!0),!(Q<0)&&(y[Q]=m,this.callback(this.manager,I,{pointers:y,changedPointers:[m],pointerType:N,srcEvent:m}),b&&y.splice(Q,1))}});var Qt={touchstart:V,touchmove:et,touchend:Y,touchcancel:it},Er="touchstart",pn="touchstart touchmove touchend touchcancel";function $e(){this.evTarget=Er,this.evWin=pn,this.started=!1,Rt.apply(this,arguments)}P($e,Rt,{handler:function(m){var y=Qt[m.type];if(y===V&&(this.started=!0),!!this.started){var b=Oe.call(this,m,y);y&(Y|it)&&b[0].length-b[1].length===0&&(this.started=!1),this.callback(this.manager,y,{pointers:b[0],changedPointers:b[1],pointerType:E,srcEvent:m})}}});function Oe(h,m){var y=J(h.touches),b=J(h.changedTouches);return m&(Y|it)&&(y=dt(y.concat(b),"identifier",!0)),[y,b]}var Jn={touchstart:V,touchmove:et,touchend:Y,touchcancel:it},qe="touchstart touchmove touchend touchcancel";function Ze(){this.evTarget=qe,this.targetIds={},Rt.apply(this,arguments)}P(Ze,Rt,{handler:function(m){var y=Jn[m.type],b=In.call(this,m,y);b&&this.callback(this.manager,y,{pointers:b[0],changedPointers:b[1],pointerType:E,srcEvent:m})}});function In(h,m){var y=J(h.touches),b=this.targetIds;if(m&(V|et)&&y.length===1)return b[y[0].identifier]=!0,[y,y];var k,I,N=J(h.changedTouches),q=[],Q=this.target;if(I=y.filter(function(W){return G(W.target,Q)}),m===V)for(k=0;k<I.length;)b[I[k].identifier]=!0,k++;for(k=0;k<N.length;)b[N[k].identifier]&&q.push(N[k]),m&(Y|it)&&delete b[N[k].identifier],k++;if(q.length)return[dt(I.concat(q),"identifier",!0),q]}var Kn=2500,kr=25;function Qn(){Rt.apply(this,arguments);var h=M(this.handler,this);this.touch=new Ze(this.manager,h),this.mouse=new Te(this.manager,h),this.primaryTouch=null,this.lastTouches=[]}P(Qn,Rt,{handler:function(m,y,b){var k=b.pointerType==E,I=b.pointerType==R;if(!(I&&b.sourceCapabilities&&b.sourceCapabilities.firesTouchEvents)){if(k)Ar.call(this,y,b);else if(I&&We.call(this,b))return;this.callback(m,y,b)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Ar(h,m){h&V?(this.primaryTouch=m.changedPointers[0].identifier,Pr.call(this,m)):h&(Y|it)&&Pr.call(this,m)}function Pr(h){var m=h.changedPointers[0];if(m.identifier===this.primaryTouch){var y={x:m.clientX,y:m.clientY};this.lastTouches.push(y);var b=this.lastTouches,k=function(){var I=b.indexOf(y);I>-1&&b.splice(I,1)};setTimeout(k,Kn)}}function We(h){for(var m=h.srcEvent.clientX,y=h.srcEvent.clientY,b=0;b<this.lastTouches.length;b++){var k=this.lastTouches[b],I=Math.abs(m-k.x),N=Math.abs(y-k.y);if(I<=kr&&N<=kr)return!0}return!1}var Ir=ft(a.style,"touchAction"),Mr=Ir!==r,Lr="compute",Dr="auto",ti="manipulation",Je="none",oe="pan-x",Ke="pan-y",gn=mn();function Ot(h,m){this.manager=h,this.set(m)}Ot.prototype={set:function(h){h==Lr&&(h=this.compute()),Mr&&this.manager.element.style&&gn[h]&&(this.manager.element.style[Ir]=h),this.actions=h.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var h=[];return d(this.manager.recognizers,function(m){D(m.options.enable,[m])&&(h=h.concat(m.getTouchAction()))}),Rr(h.join(" "))},preventDefaults:function(h){var m=h.srcEvent,y=h.offsetDirection;if(this.manager.session.prevented){m.preventDefault();return}var b=this.actions,k=H(b,Je)&&!gn[Je],I=H(b,Ke)&&!gn[Ke],N=H(b,oe)&&!gn[oe];if(k){var q=h.pointers.length===1,Q=h.distance<2,W=h.deltaTime<250;if(q&&Q&&W)return}if(!(N&&I)&&(k||I&&y&It||N&&y&Mt))return this.preventSrc(m)},preventSrc:function(h){this.manager.session.prevented=!0,h.preventDefault()}};function Rr(h){if(H(h,Je))return Je;var m=H(h,oe),y=H(h,Ke);return m&&y?Je:m||y?m?oe:Ke:H(h,ti)?ti:Dr}function mn(){if(!Mr)return!1;var h={},m=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(y){h[y]=m?t.CSS.supports("touch-action",y):!0}),h}var Mn=1,te=2,Fe=4,Se=8,we=Se,Qe=16,Ht=32;function bt(h){this.options=x({},this.defaults,h||{}),this.id=Et(),this.manager=null,this.options.enable=U(this.options.enable,!0),this.state=Mn,this.simultaneous={},this.requireFail=[]}bt.prototype={defaults:{},set:function(h){return x(this.options,h),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(h){if(p(h,"recognizeWith",this))return this;var m=this.simultaneous;return h=vn(h,this),m[h.id]||(m[h.id]=h,h.recognizeWith(this)),this},dropRecognizeWith:function(h){return p(h,"dropRecognizeWith",this)?this:(h=vn(h,this),delete this.simultaneous[h.id],this)},requireFailure:function(h){if(p(h,"requireFailure",this))return this;var m=this.requireFail;return h=vn(h,this),X(m,h)===-1&&(m.push(h),h.requireFailure(this)),this},dropRequireFailure:function(h){if(p(h,"dropRequireFailure",this))return this;h=vn(h,this);var m=X(this.requireFail,h);return m>-1&&this.requireFail.splice(m,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(h){return!!this.simultaneous[h.id]},emit:function(h){var m=this,y=this.state;function b(k){m.manager.emit(k,h)}y<Se&&b(m.options.event+Gi(y)),b(m.options.event),h.additionalEvent&&b(h.additionalEvent),y>=Se&&b(m.options.event+Gi(y))},tryEmit:function(h){if(this.canEmit())return this.emit(h);this.state=Ht},canEmit:function(){for(var h=0;h<this.requireFail.length;){if(!(this.requireFail[h].state&(Ht|Mn)))return!1;h++}return!0},recognize:function(h){var m=x({},h);if(!D(this.options.enable,[this,m])){this.reset(),this.state=Ht;return}this.state&(we|Qe|Ht)&&(this.state=Mn),this.state=this.process(m),this.state&(te|Fe|Se|Qe)&&this.tryEmit(m)},process:function(h){},getTouchAction:function(){},reset:function(){}};function Gi(h){return h&Qe?"cancel":h&Se?"end":h&Fe?"move":h&te?"start":""}function ei(h){return h==xt?"down":h==At?"up":h==vt?"left":h==wt?"right":""}function vn(h,m){var y=m.manager;return y?y.get(h):h}function pe(){bt.apply(this,arguments)}P(pe,bt,{defaults:{pointers:1},attrTest:function(h){var m=this.options.pointers;return m===0||h.pointers.length===m},process:function(h){var m=this.state,y=h.eventType,b=m&(te|Fe),k=this.attrTest(h);return b&&(y&it||!k)?m|Qe:b||k?y&Y?m|Se:m&te?m|Fe:te:Ht}});function le(){pe.apply(this,arguments),this.pX=null,this.pY=null}P(le,pe,{defaults:{event:"pan",threshold:10,pointers:1,direction:Dt},getTouchAction:function(){var h=this.options.direction,m=[];return h&It&&m.push(Ke),h&Mt&&m.push(oe),m},directionTest:function(h){var m=this.options,y=!0,b=h.distance,k=h.direction,I=h.deltaX,N=h.deltaY;return k&m.direction||(m.direction&It?(k=I===0?pt:I<0?vt:wt,y=I!=this.pX,b=Math.abs(h.deltaX)):(k=N===0?pt:N<0?At:xt,y=N!=this.pY,b=Math.abs(h.deltaY))),h.direction=k,y&&b>m.threshold&&k&m.direction},attrTest:function(h){return pe.prototype.attrTest.call(this,h)&&(this.state&te||!(this.state&te)&&this.directionTest(h))},emit:function(h){this.pX=h.deltaX,this.pY=h.deltaY;var m=ei(h.direction);m&&(h.additionalEvent=this.options.event+m),this._super.emit.call(this,h)}});function tn(){pe.apply(this,arguments)}P(tn,pe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Je]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.scale-1)>this.options.threshold||this.state&te)},emit:function(h){if(h.scale!==1){var m=h.scale<1?"in":"out";h.additionalEvent=this.options.event+m}this._super.emit.call(this,h)}});function ni(){bt.apply(this,arguments),this._timer=null,this._input=null}P(ni,bt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Dr]},process:function(h){var m=this.options,y=h.pointers.length===m.pointers,b=h.distance<m.threshold,k=h.deltaTime>m.time;if(this._input=h,!b||!y||h.eventType&(Y|it)&&!k)this.reset();else if(h.eventType&V)this.reset(),this._timer=g(function(){this.state=we,this.tryEmit()},m.time,this);else if(h.eventType&Y)return we;return Ht},reset:function(){clearTimeout(this._timer)},emit:function(h){this.state===we&&(h&&h.eventType&Y?this.manager.emit(this.options.event+"up",h):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}});function ii(){pe.apply(this,arguments)}P(ii,pe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Je]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.rotation)>this.options.threshold||this.state&te)}});function ri(){pe.apply(this,arguments)}P(ri,pe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:It|Mt,pointers:1},getTouchAction:function(){return le.prototype.getTouchAction.call(this)},attrTest:function(h){var m=this.options.direction,y;return m&(It|Mt)?y=h.overallVelocity:m&It?y=h.overallVelocityX:m&Mt&&(y=h.overallVelocityY),this._super.attrTest.call(this,h)&&m&h.offsetDirection&&h.distance>this.options.threshold&&h.maxPointers==this.options.pointers&&c(y)>this.options.velocity&&h.eventType&Y},emit:function(h){var m=ei(h.offsetDirection);m&&this.manager.emit(this.options.event+m,h),this.manager.emit(this.options.event,h)}});function xe(){bt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}P(xe,bt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ti]},process:function(h){var m=this.options,y=h.pointers.length===m.pointers,b=h.distance<m.threshold,k=h.deltaTime<m.time;if(this.reset(),h.eventType&V&&this.count===0)return this.failTimeout();if(b&&k&&y){if(h.eventType!=Y)return this.failTimeout();var I=this.pTime?h.timeStamp-this.pTime<m.interval:!0,N=!this.pCenter||Le(this.pCenter,h.center)<m.posThreshold;this.pTime=h.timeStamp,this.pCenter=h.center,!N||!I?this.count=1:this.count+=1,this._input=h;var q=this.count%m.taps;if(q===0)return this.hasRequireFailures()?(this._timer=g(function(){this.state=we,this.tryEmit()},m.interval,this),te):we}return Ht},failTimeout:function(){return this._timer=g(function(){this.state=Ht},this.options.interval,this),Ht},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==we&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function be(h,m){return m=m||{},m.recognizers=U(m.recognizers,be.defaults.preset),new Dn(h,m)}be.VERSION="2.0.7",be.defaults={domEvents:!1,touchAction:Lr,enable:!0,inputTarget:null,inputClass:null,preset:[[ii,{enable:!1}],[tn,{enable:!1},["rotate"]],[ri,{direction:It}],[le,{direction:It},["swipe"]],[xe],[xe,{event:"doubletap",taps:2},["tap"]],[ni]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Ln=1,Xt=2;function Dn(h,m){this.options=x({},be.defaults,m||{}),this.options.inputTarget=this.options.inputTarget||h,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=h,this.input=jt(this),this.touchAction=new Ot(this,this.options.touchAction),f(this,!0),d(this.options.recognizers,function(y){var b=this.add(new y[0](y[1]));y[2]&&b.recognizeWith(y[2]),y[3]&&b.requireFailure(y[3])},this)}Dn.prototype={set:function(h){return x(this.options,h),h.touchAction&&this.touchAction.update(),h.inputTarget&&(this.input.destroy(),this.input.target=h.inputTarget,this.input.init()),this},stop:function(h){this.session.stopped=h?Xt:Ln},recognize:function(h){var m=this.session;if(!m.stopped){this.touchAction.preventDefaults(h);var y,b=this.recognizers,k=m.curRecognizer;(!k||k&&k.state&we)&&(k=m.curRecognizer=null);for(var I=0;I<b.length;)y=b[I],m.stopped!==Xt&&(!k||y==k||y.canRecognizeWith(k))?y.recognize(h):y.reset(),!k&&y.state&(te|Fe|Se)&&(k=m.curRecognizer=y),I++}},get:function(h){if(h instanceof bt)return h;for(var m=this.recognizers,y=0;y<m.length;y++)if(m[y].options.event==h)return m[y];return null},add:function(h){if(p(h,"add",this))return this;var m=this.get(h.options.event);return m&&this.remove(m),this.recognizers.push(h),h.manager=this,this.touchAction.update(),h},remove:function(h){if(p(h,"remove",this))return this;if(h=this.get(h),h){var m=this.recognizers,y=X(m,h);y!==-1&&(m.splice(y,1),this.touchAction.update())}return this},on:function(h,m){if(h!==r&&m!==r){var y=this.handlers;return d($(h),function(b){y[b]=y[b]||[],y[b].push(m)}),this}},off:function(h,m){if(h!==r){var y=this.handlers;return d($(h),function(b){m?y[b]&&y[b].splice(X(y[b],m),1):delete y[b]}),this}},emit:function(h,m){this.options.domEvents&&v(h,m);var y=this.handlers[h]&&this.handlers[h].slice();if(!(!y||!y.length)){m.type=h,m.preventDefault=function(){m.srcEvent.preventDefault()};for(var b=0;b<y.length;)y[b](m),b++}},destroy:function(){this.element&&f(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function f(h,m){var y=h.element;if(y.style){var b;d(h.options.cssProps,function(k,I){b=ft(y.style,I),m?(h.oldCssProps[b]=y.style[b],y.style[b]=k):y.style[b]=h.oldCssProps[b]||""}),m||(h.oldCssProps={})}}function v(h,m){var y=e.createEvent("Event");y.initEvent(h,!0,!0),y.gesture=m,m.target.dispatchEvent(y)}x(be,{INPUT_START:V,INPUT_MOVE:et,INPUT_END:Y,INPUT_CANCEL:it,STATE_POSSIBLE:Mn,STATE_BEGAN:te,STATE_CHANGED:Fe,STATE_ENDED:Se,STATE_RECOGNIZED:we,STATE_CANCELLED:Qe,STATE_FAILED:Ht,DIRECTION_NONE:pt,DIRECTION_LEFT:vt,DIRECTION_RIGHT:wt,DIRECTION_UP:At,DIRECTION_DOWN:xt,DIRECTION_HORIZONTAL:It,DIRECTION_VERTICAL:Mt,DIRECTION_ALL:Dt,Manager:Dn,Input:Rt,TouchAction:Ot,TouchInput:Ze,MouseInput:Te,PointerEventInput:ye,TouchMouseInput:Qn,SingleTouchInput:$e,Recognizer:bt,AttrRecognizer:pe,Tap:xe,Pan:le,Swipe:ri,Pinch:tn,Rotate:ii,Press:ni,on:z,off:F,each:d,merge:A,extend:C,assign:x,inherit:P,bindFn:M,prefixed:ft});var _=typeof t<"u"?t:typeof self<"u"?self:{};_.Hammer=be,typeof r=="function"&&r.amd?r(function(){return be}):n.exports?n.exports=be:t[i]=be})(window,document,"Hammer")})(Ba);var oh=Ba.exports;const lh=ji(oh);function Ji(n){return n*Math.PI/180}function $r(n){return n*180/Math.PI}function Ga(n,t,e,i){const r=n-e,s=t-i;return Math.sqrt(r*r+s*s)}function qr(n,t,e,i){const r=e-n,s=i-t;return Math.atan2(s,r)}function Zr(n,t){return{x:Math.cos(n)*t,y:Math.sin(n)*t}}function Ki(n,t){return Math.sqrt(n*n+t*t)}function Wr(n,t){const e=Ki(n,t);return{x:n/=e,y:t/=e}}function ch(n,t,e,i,r=10){if(Math.abs(e-n)<r&&Math.abs(i-t)<r)return"no";const s=$r(qr(n,t,e,i));return s>=-135&&s<=-45?"up":s>45&&s<135?"down":s>=135&&s<=180||s>=-180&&s<-135?"left":s>=-45&&s<=45?"right":"no"}class Qi{x;y;vx;vy;ax;ay;mass;constructor(t){this.x=t.x,this.y=t.y,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||0}distanceTo(t){return Ga(this.x,this.y,t.x,t.y)}angleTo(t){return qr(this.x,this.y,t.x,t.y)}velocityTo(t){return{vx:t.x-this.x,vy:t.y-this.y}}followTo(t,e=3){const i=this.angleTo(t),{x:r,y:s}=Zr(i,e);this.vx=r,this.vy=s,this.nextFrame()}followAccelerationTo(t,e=.05){const i=this.angleTo(t),{x:r,y:s}=Zr(i,e);this.ax=r,this.ay=s,this.nextFrame()}nextFrame(t){const e=t?.gravity??0,i=t?.friction??0;if(this.vx+=this.ax,this.vy+=this.ay,this.vy+=e,i>0){const r=Math.atan2(this.vy,this.vx);let s=Math.sqrt(this.vx*this.vx+this.vy*this.vy);s>i?s-=i:s=0,this.vx=Math.cos(r)*s,this.vy=Math.sin(r)*s}this.x+=this.vx,this.y+=this.vy}nextFrameEaseTo(t,e){const i=e?.gravity??0,r=e?.friction??1,s=e?.easing??.05,a=t.x-this.x,o=t.y-this.y;this.vx=a*s,this.vy=o*s,this.vy+=i,this.vx*=r,this.vy*=r,this.x+=this.vx,this.y+=this.vy}nextFrameSpringTo(t,e){const i=e?.gravity??0,r=e?.friction??.95,s=e?.spring??.03;(Array.isArray(t)?t:[t]).forEach(o=>{const l=o.x-this.x,c=o.y-this.y,u=l*s,g=c*s;this.vx+=u,this.vy+=g}),this.vy+=i,this.vx*=r,this.vy*=r,this.x+=this.vx,this.y+=this.vy}nextFrameSpringConnect(t,e){const i=e?.gravity??0,r=e?.friction??.95,s=e?.spring??.03,a=e?.springLength??100,o=this.angleTo(t);this.nextFrameSpringTo(new Qi({x:t.x-Math.cos(o)*a,y:t.y-Math.sin(o)*a}),{spring:s,friction:r,gravity:i})}}class Nn extends Qi{width;height;constructor(t){super(t),this.width=t.width,this.height=t.height}eq(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}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){return!(t.x<this.x||t.x>this.x+this.width||t.y<this.y||t.y>this.y+this.height)}toArray(){return[this.x,this.y,this.width,this.height]}clone(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height}}class Ee extends Qi{radius;constructor(t){super(t),this.radius=t?.radius??0}toSVGPathData(){return[this.x,this.y]}toSVGPathD(){return`${this.x},${this.y}`}setX(t){this.x=t}setY(t){this.y=t}setXY(t,e){this.x=t,this.y=e}eq(t){return this.x===t.x&&this.y===t.y}midPointBtw(t){return new Ee({x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2})}toArray(){return[this.x,this.y]}clone(t){this.setXY(t.x,t.y)}getBounds(){return new Nn({x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2})}nextFrameCollisionTo(t){const e=t.x-this.x,i=t.y-this.y;if(Math.sqrt(e*e+i*i)<this.radius+t.radius){const a=Math.atan2(i,e),o=Math.sin(a),l=Math.cos(a),c={x:0,y:0},u=s(e,i,o,l,!0),g=s(this.vx,this.vy,o,l,!0),p=s(t.vx,t.vy,o,l,!0),d=g.x-p.x;g.x=((this.mass-t.mass)*g.x+2*t.mass*p.x)/(this.mass+t.mass),p.x=d+g.x;const w=Math.abs(g.x)+Math.abs(p.x),x=this.radius+t.radius-Math.abs(c.x-u.x);c.x+=g.x/w*x,u.x+=p.x/w*x;const C=s(c.x,c.y,o,l,!1),A=s(u.x,u.y,o,l,!1);t.x=this.x+A.x,t.y=this.y+A.y,this.x=this.x+C.x,this.y=this.y+C.y;const P=s(g.x,g.y,o,l,!1),M=s(p.x,p.y,o,l,!1);this.vx=P.x,this.vy=P.y,t.vx=M.x,t.vy=M.y}function s(a,o,l,c,u=!1){return{x:u?a*c+o*l:a*c-o*l,y:u?o*c-a*l:o*c+a*l}}}nextFrameBounce(t){const e=t.left,i=t.top,r=t.right,s=t.bottom,a=t?.bounce??-1;this.x+this.radius>r?(this.x=r-this.radius,this.vx*=a):this.x-this.radius<e&&(this.x=e+this.radius,this.vx*=a),this.y+this.radius>s?(this.y=s-this.radius,this.vy*=a):this.y-this.radius<i&&(this.y=i+this.radius,this.vy*=a)}}class Ha{constructor(){}static getFormatKeyNames(t){const e=Yr(),i=[];return t.ctrl&&i.push(e?"Cmd":"Ctrl"),t.shift&&i.push("Shift"),t.alt&&i.push("Alt"),typeof t.key=="string"?i.push(sa(t.key)):Array.isArray(t.key)&&(t.key.map(r=>sa(r)),i.push(...t.key)),i}static matchKeyScheme(t,e){const i=t.ctrl??!1,r=t.shift??!1,s=t.alt??!1;if(t.exact)return(i===e.metaKey||i===e.ctrlKey)&&r===e.shiftKey&&s===e.altKey;const a=[];return i&&a.push(i===e.metaKey||i===e.ctrlKey),r&&a.push(r===e.shiftKey),s&&a.push(s===e.altKey),a.every(o=>o)}static on(t,e){if(t?.key===void 0||t?.key===null)return e;const i=t?.target??window;let r=!1;const s=this.getFormatKeyNames(t),a=o=>{if(o.stopPropagation(),!r&&o.key!=="Control"&&o.key!=="Meta"&&o.key!=="Shift"&&o.key!=="Option"&&o.key!=="Alt"&&s.find(l=>l.toLowerCase()===o.key.toLowerCase())&&this.matchKeyScheme(t,o)){o.preventDefault();const l=e(o);if(typeof l!="function")return;const c=u=>{u.preventDefault(),l(u),i.removeEventListener("keyup",c)};i.addEventListener("keyup",c)}};return e.title=t?.title??"",e.formatedKeyNames=s,e.pause=()=>r=!0,e.restart=()=>r=!1,e.removeListener=()=>i.removeEventListener("keydown",a),i.addEventListener("keydown",a),e}}const Va=hh("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 hh(n,t=10){const e={},i=n.split(",");for(let r=0;r<i.length;r+=2){const s="&"+i[r+1]+";",a=parseInt(i[r],t);e[s]="&#"+a+";"}return e["\\xa0"]="&#160;",e}function ee(n,t){const e=Object.keys(t);for(let i=0;i<e.length;i++)n=n.replace(new RegExp("{"+e[i]+"}","gi"),""+t[e[i]]);return n}function tr(n){let t,e;if(!n)throw new Error("cannot create a random attribute name for an undefined object");const i="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=i[Math.floor(Math.random()*i.length)];while(n[t]);return t}function fh(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function uh(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const hi={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}};class er{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const i=this.__ctx.__createElement("stop");if(i.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const s=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);s&&(i.setAttribute("stop-color",ee("rgb({r},{g},{b})",{r:s[1],g:s[2],b:s[3]})),i.setAttribute("stop-opacity",s[4]))}else i.setAttribute("stop-color",e);this.__root.appendChild(i)}}class Jr{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class fi{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:i=500,enableMirroring:r=!1}){this.enableMirroring=r,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=i),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(hi);for(let e=0,i=t.length;e<i;e++){const r=t[e];this[r]=hi[r].canvas}}__getStyleState(){const t={},e=Object.keys(hi);for(let i=0,r=e.length;i<r;i++){const s=e[i];t[s]=this[s]}return t}__applyStyleState(t){const e=Object.keys(t);for(let i=0,r=e.length;i<r;i++){const s=e[i];this[s]=t[s]}}__createElement(t,e={},i=!1){const r=this.__document.createElementNS("http://www.w3.org/2000/svg",t),s=Object.keys(e);i&&(r.setAttribute("fill","none"),r.setAttribute("stroke","none"));for(let a=0;a<s.length;a++){const o=s[a];r.setAttribute(o,e[o])}return r}__applyStyleToCurrentElement(t){let e=this.__currentElement;const i=this.__currentElementsToStyle;i&&(e.setAttribute(t,""),e=i.element,i.children.forEach(s=>{s.setAttribute(t,"")}));const r=Object.keys(hi);for(let s=0;s<r.length;s++){const a=hi[r[s]],o=this[r[s]];if(a.apply){if(o instanceof Jr){if(o.__ctx)for(;o.__ctx.__SVGdefs.childNodes.length;){const l=o.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[l]=l,this.__SVGdefs.appendChild(o.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(a.apply,ee("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof er)e.setAttribute(a.apply,ee("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);e.setAttribute(a.svgAttr,ee("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let u=parseFloat(c[4]);const g=this.globalAlpha;g!=null&&(u*=g),e.setAttribute(a.svgAttr+"-opacity",""+u)}else{let l=a.svgAttr;if(r[s]==="globalAlpha"&&(l=t+"-"+a.svgAttr,e.getAttribute(l)))continue;l&&e.setAttribute(l,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 r=Object.keys(Va);for(let s=0,a=r.length;s<a;s++){const o=r[s],l=Va[o],c=new RegExp(o,"gi");c.test(e)&&(e=e.replace(c,l))}}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 r=this.__createElement("g");e.appendChild(r),this.__currentElement=r}let i=this.__currentElement.getAttribute("transform");i?i+=" ":i="",i+=t,this.__currentElement.setAttribute("transform",i)}scale(t,e){e===void 0&&(e=t),this.__addTransform(ee("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(ee("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(ee("translate({x},{y})",{x:t,y:e}))}transform(t,e,i,r,s,a){this.__addTransform(ee("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:i,d:r,e:s,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):console.error("Attempted to apply path command to node",t.nodeName)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(ee("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(ee("L {x} {y}",this.__currentPosition)):this.__addPathCommand(ee("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,i,r,s,a){this.__currentPosition={x:s,y:a},this.__addPathCommand(ee("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:i,cp2y:r,x:s,y:a}))}quadraticCurveTo(t,e,i,r){this.__currentPosition={x:i,y:r},this.__addPathCommand(ee("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:i,y:r}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,i,r,s){const a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(typeof a>"u"||typeof o>"u")return;if(s<0)throw new Error("IndexSizeError: The radius provided ("+s+") is negative.");if(a===t&&o===e||t===i&&e===r||s===0){this.lineTo(t,e);return}const l=this.normalize([a-t,o-e]),c=this.normalize([i-t,r-e]);if(l[0]*c[1]===l[1]*c[0]){this.lineTo(t,e);return}const u=l[0]*c[0]+l[1]*c[1],g=Math.acos(Math.abs(u)),p=this.normalize([l[0]+c[0],l[1]+c[1]]),d=s/Math.sin(g/2),w=t+d*p[0],x=e+d*p[1],C=[-l[1],l[0]],A=[c[1],-c[0]],P=function(U){const z=U[0];return U[1]>=0?Math.acos(z):-Math.acos(z)},M=P(C),D=P(A);this.lineTo(w+C[0]*s,x+C[1]*s),this.arc(w,x,s,M,D)}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,i,r){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.closePath()}fillRect(t,e,i,r){const s=this.__createElement("rect",{x:t,y:e,width:i,height:r},!0);this.__closestGroupOrSvg().appendChild(s),this.__currentElement=s,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,i,r){const s=this.__createElement("rect",{x:t,y:e,width:i,height:r},!0);this.__closestGroupOrSvg().appendChild(s),this.__currentElement=s,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),i=this.__rootSVG.childNodes[1],r=i.childNodes;for(let s=r.length-1;s>=0;s--)r[s]&&i.removeChild(r[s]);this.__currentElement=i,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,i,r){if(t===0&&e===0&&i===this.width&&r===this.height){this.__clearCanvas();return}const s=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:i,height:r,fill:"#FFFFFF"},!0);s.appendChild(a)}createLinearGradient(t,e,i,r){const s=this.__createElement("linearGradient",{id:tr(this.__ids),x1:t+"px",x2:i+"px",y1:e+"px",y2:r+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(s),new er(s,this)}createRadialGradient(t,e,i,r,s,a){const o=this.__createElement("radialGradient",{id:tr(this.__ids),cx:r+"px",cy:s+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new er(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),i={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"&&(i.decoration="underline"),this.__fontHref&&(i.href=this.__fontHref),i}__wrapTextLink(t,e){if(t.href){const i=this.__createElement("a");return i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),i.appendChild(e),i}return e}__applyText(t,e,i,r){const s=this.__parseFont(),a=this.__closestGroupOrSvg(),o=this.__createElement("text",{"font-family":s.family,"font-size":s.size,"font-style":s.style,"font-weight":s.weight,"text-decoration":s.decoration,x:e,y:i,"text-anchor":fh(this.textAlign),"dominant-baseline":uh(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(r),a.appendChild(this.__wrapTextLink(s,o))}fillText(t,e,i){this.__applyText(t,e,i,"fill")}strokeText(t,e,i){this.__applyText(t,e,i,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,i,r,s,a){if(r===s)return;r=r%(2*Math.PI),s=s%(2*Math.PI),r===s&&(s=(s+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+i*Math.cos(s),l=e+i*Math.sin(s),c=t+i*Math.cos(r),u=e+i*Math.sin(r),g=a?0:1;let p=0,d=s-r;d<0&&(d+=2*Math.PI),a?p=d>Math.PI?0:1:p=d>Math.PI?1:0,this.lineTo(c,u),this.__addPathCommand(ee("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:i,ry:i,xAxisRotation:0,largeArcFlag:p,sweepFlag:g,endX:o,endY:l})),this.__currentPosition={x:o,y:l}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),i=tr(this.__ids),r=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",i),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",ee("url(#{id})",{id:i})),t.appendChild(r),this.__currentElement=r}drawImage(...t){let e=t[0],i,r,s,a,o=0,l=0,c,u,g,p,d,w,x,C;if(t.length===3)i=t[1],r=t[2],c=e.width,u=e.height,s=c,a=u;else if(t.length===5)i=t[1],r=t[2],s=t[3],a=t[4],c=e.width,u=e.height;else if(t.length===9)o=t[1],l=t[2],c=t[3],u=t[4],i=t[5],r=t[6],s=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const A=this.__closestGroupOrSvg();this.__currentElement;const P="translate("+i+", "+r+")";if(e instanceof fi){if(g=e.getSvg().cloneNode(!0),g.childNodes&&g.childNodes.length>1){for(p=g.childNodes[0];p.childNodes.length;)C=p.childNodes[0].getAttribute("id"),this.__ids[C]=C,this.__SVGdefs.appendChild(p.childNodes[0]);if(d=g.childNodes[1],d){const M=d.getAttribute("transform");let D;M?D=M+" "+P:D=P,d.setAttribute("transform",D),A.appendChild(d)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(w=this.__createElement("image"),w.setAttribute("width",s),w.setAttribute("height",a),w.setAttribute("preserveAspectRatio","none"),(o||l||c!==e.width||u!==e.height)&&(x=this.__document.createElement("canvas"),x.width=s,x.height=a,x.getContext("2d")?.drawImage(e,o,l,c,u,0,0,s,a),e=x),w.setAttribute("transform",P),w.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),A.appendChild(w))}createPattern(t,e){const i=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),r=tr(this.__ids);let s;return i.setAttribute("id",r),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(s=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),i.appendChild(s),this.__SVGdefs.appendChild(i)):t instanceof fi&&(i.setAttribute("width",""+t.width),i.setAttribute("height",""+t.height),i.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(i)),new Jr(i,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}function dh(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ja={},Kr={exports:{}},Xa;function ph(){return Xa||(Xa=1,function(n){(function(t){var e="0.4.0",i="hasOwnProperty",r=/[\.\/]/,s="*",a=function(){},o=function(p,d){return p-d},l,c,u={n:{}},g=function(p,d){var w=c,x=Array.prototype.slice.call(arguments,2),C=g.listeners(p),A=0,P,M=[],D={},U=[];l=p,c=0;for(var z=0,F=C.length;z<F;z++)"zIndex"in C[z]&&(M.push(C[z].zIndex),C[z].zIndex<0&&(D[C[z].zIndex]=C[z]));for(M.sort(o);M[A]<0;)if(P=D[M[A++]],U.push(P.apply(d,x)),c)return c=w,U;for(z=0;z<F;z++)if(P=C[z],"zIndex"in P)if(P.zIndex==M[A]){if(U.push(P.apply(d,x)),c)return c=w,U;do if(A++,P=D[M[A]],P&&U.push(P.apply(d,x)),c)return c=w,U;while(P)}else D[P.zIndex]=P;else if(U.push(P.apply(d,x)),c)return c=w,U;return c=w,U.length?U:null};g.listeners=function(p){var d=p.split(r),w=u,x,C,A,P,M,D,U,z,F=[w],G=[];for(P=0,M=d.length;P<M;P++){for(z=[],D=0,U=F.length;D<U;D++)for(w=F[D].n,C=[w[d[P]],w[s]],A=2;A--;)x=C[A],x&&(z.push(x),G=G.concat(x.f||[]));F=z}return G},g.on=function(p,d){for(var w=p.split(r),x=u,C=0,A=w.length;C<A;C++)x=x.n,!x[w[C]]&&(x[w[C]]={n:{}}),x=x[w[C]];for(x.f=x.f||[],C=0,A=x.f.length;C<A;C++)if(x.f[C]==d)return a;return x.f.push(d),function(P){+P==+P&&(d.zIndex=+P)}},g.stop=function(){c=1},g.nt=function(p){return p?new RegExp("(?:\\.|\\/|^)"+p+"(?:\\.|\\/|$)").test(l):l},g.unbind=function(p,d){var w=p.split(r),x,C,A,P,M,D,U,z=[u];for(P=0,M=w.length;P<M;P++)for(D=0;D<z.length;D+=A.length-2){if(A=[D,1],x=z[D].n,w[P]!=s)x[w[P]]&&A.push(x[w[P]]);else for(C in x)x[i](C)&&A.push(x[C]);z.splice.apply(z,A)}for(P=0,M=z.length;P<M;P++)for(x=z[P];x.n;){if(d){if(x.f){for(D=0,U=x.f.length;D<U;D++)if(x.f[D]==d){x.f.splice(D,1);break}!x.f.length&&delete x.f}for(C in x.n)if(x.n[i](C)&&x.n[C].f){var F=x.n[C].f;for(D=0,U=F.length;D<U;D++)if(F[D]==d){F.splice(D,1);break}!F.length&&delete x.n[C].f}}else{delete x.f;for(C in x.n)x.n[i](C)&&x.n[C].f&&delete x.n[C].f}x=x.n}},g.once=function(p,d){var w=function(){d.apply(this,arguments),g.unbind(p,w)};return g.on(p,w)},g.version=e,g.toString=function(){return"You are running Eve "+e},n.exports?n.exports=g:t.eve=g})(_c)}(Kr)),Kr.exports}(function(n){if(typeof dh=="function")var t=ph();(function(){function e(p){var d=function(w){d.parse(w)};return d.mode="text",d.type=String(p||"html").toLowerCase(),d.textchunk="",d.raw="",d.parse=l,d.on=a,d.event=s,d.end=r,d}function i(p,d,w){p==`
18
+ `&&this.event("newline"),g[this.mode].call(this,p,d,w)}function r(){i.call(this,"eof"),this.event("eof")}function s(p,d,w){typeof t=="function"&&t("elemental."+p+"."+d,null,d,w||"",this.raw);for(var x=this.events&&this.events[p],C=x&&x.length;C--;)try{this.events[p][C](d,w||"",this.raw)}catch{}this.raw=""}function a(p,d){this.events=this.events||{},this.events[p]=this.events[p]||[],this.events[p].push(d)}function o(p,d){return p&&(p.charAt?p.charAt(d):p[d])}function l(p){p=p||Object(p);for(var d=1,w=p.length+1,x,C,A=o(p,0);d<w;d++)x=C,C=A,A=o(p,d),this.raw+=C,i.call(this,C,A,x);this._beforeEnd=function(){i.call(this,"","",C)}}var c=/[\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]/,u=function(){for(var p in this.attr)this.attr.hasOwnProperty(p)&&this.event("attr",p,{value:this.attr[p],tagname:this.tagname,attr:this.attr})},g={text:function(p,d,w){switch(p){case"<":case"eof":this.nodename="",this.attr={},this.mode="tag name start",this.raw=this.raw.slice(0,-1),this.textchunk&&this.event("text",this.textchunk),this.raw+=p,this.textchunk="";break;default:this.textchunk+=p}},special:function(p,d,w){if(w=="!"&&p=="-"&&d=="-")this.mode="comment start";else{if(this.textchunk=="[CDATA"&&p=="["){this.mode="cdata",this.textchunk="";return}if(p==">"||p=="eof"){this.event("special",this.textchunk),this.mode="text",this.textchunk="";return}this.textchunk+=p}},cdata:function(p,d,w){w=="]"&&p=="]"&&d==">"?(this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1)):(p=="eof"&&g["cdata end"].call(this),this.textchunk+=p)},"cdata end":function(p,d,w){this.event("cdata",this.textchunk),this.textchunk="",this.mode="text"},"comment start":function(p,d,w){d==">"||p=="eof"?(this.event("comment",""),this.mode="comment instant end"):this.mode="comment"},"comment instant end":function(p,d,w){this.mode="text"},comment:function(p,d,w){p=="-"&&w=="-"&&d==">"?(this.mode="comment end",this.textchunk=this.textchunk.slice(0,-1)):p=="eof"?this.event("comment",this.textchunk):this.textchunk+=p},"comment end":function(p,d,w){this.event("comment",this.textchunk),this.textchunk="",this.mode="text"},declaration:function(p,d,w){p=="?"&&d==">"?this.mode="declaration end":(p=="eof"&&this.event("comment",this.textchunk),this.textchunk+=p)},"declaration end":function(p,d,w){this.event("comment",this.textchunk),this.textchunk="",this.mode="text"},"tag name start":function(p,d,w){if(p=="eof")this.event("text","<");else if(!c.test(p)){if(this.mode="tag name",p=="/"){this.mode="close tag name start";return}if(p=="!"){this.mode="special",this.textchunk="";return}if(p=="?"){this.mode="declaration";return}g[this.mode].call(this,p,d,w)}},"close tag name start":function(p,d,w){c.test(p)||(this.mode="close tag name",this.tagname="",this.nodename="",g[this.mode].call(this,p,d,w))},"close tag name":function(p,d,w){if(c.test(p))this.tagname=this.nodename;else switch(p){case">":this.event("/tag",this.tagname||this.nodename),this.mode="text";break;default:!this.tagname&&(this.nodename+=p)}},"tag name":function(p,d,w){if(c.test(p))this.tagname=this.nodename,this.nodename="",this.mode="attr start";else switch(p){case">":this.event("tag",this.nodename),this.mode="text";break;default:this.nodename+=p}},"attr start":function(p,d,w){c.test(p)||(this.mode="attr",this.nodename="",g[this.mode].call(this,p,d,w))},attr:function(p,d,w){if(c.test(p)||p=="=")this.attr[this.nodename]="",this.mode="attr value start";else switch(p){case">":this.nodename=="/"?(delete this.attr["/"],this.event("tag",this.tagname,this.attr),u.call(this),this.event("/tag",this.tagname,!0)):(this.nodename&&(this.attr[this.nodename]=""),this.event("tag",this.tagname,this.attr),u.call(this)),this.mode="text";break;default:this.nodename+=p}},"attr value start":function(p,d,w){if(!c.test(p)){if(this.mode="attr value",this.quote=!1,p=="'"||p=='"'){this.quote=p;return}g[this.mode].call(this,p,d,w)}},"attr value":function(p,d,w){if(c.test(p)&&!this.quote)this.mode="attr start";else if(p==">"&&!this.quote)this.event("tag",this.tagname,this.attr),this.mode="text";else switch(p){case'"':case"'":this.quote==p&&w!="\\"&&(this.mode="attr start");break;default:this.attr[this.nodename]+=p}}};e.version="0.2.1",n.elemental=e,n.eve=t})()})(ja);const Ya=ji(ja),$a=[1,0,0,1,0,0],qa=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class Jt{value;matrix3d;isEverTo3d=!1;_prev_rotatex=0;_prev_rotatey=0;constructor(t=$a){this.value=Array.from(t),this.matrix3d=this.toMatrix3D()}unit(){return this.value=Array.from($a),this.matrix3d=this.toMatrix3D(),this}transformPoint(t,e,i=0,r=0){const s=t-i,a=e-r;return t=s*this.value[0]+a*this.value[2]+this.value[4],e=s*this.value[1]+a*this.value[3]+this.value[5],[t+i,e+r]}fromString(t){const e=ra("number",t);return e.length===6?e.forEach((i,r)=>{i.fullMatch&&(this.value[r]=parseFloat(i.fullMatch))}):this.unit(),this}toMatrix3D(t=this.matrix3d){const e=[this.value[0],this.value[1],0,0,this.value[2],this.value[3],0,0,0,0,1,0,this.value[4],this.value[5],0,1];return t?(t.value=e,t):new yn(e)}offset(t=0,e=0){return[t-this.value[4],e-this.value[5]]}clone(){return new Jt(this.value)}multiply(t){const e=this.value;let i;t instanceof Jt?i=t.value:i=t;const r=e[0]*i[0]+e[2]*i[1],s=e[1]*i[0]+e[3]*i[1],a=e[0]*i[2]+e[2]*i[3],o=e[1]*i[2]+e[3]*i[3],l=e[0]*i[4]+e[2]*i[5]+e[4],c=e[1]*i[4]+e[3]*i[5]+e[5];return e[0]=r,e[1]=s,e[2]=a,e[3]=o,e[4]=l,e[5]=c,this}inverse(){const t=new Jt(this.value),e=t.value,i=1/(e[0]*e[3]-e[1]*e[2]),r=e[3]*i,s=-e[1]*i,a=-e[2]*i,o=e[0]*i,l=i*(e[2]*e[5]-e[3]*e[4]),c=i*(e[1]*e[4]-e[0]*e[5]);return e[0]=r,e[1]=s,e[2]=a,e[3]=o,e[4]=l,e[5]=c,t}translate(t,e){return this.matrix3d.translate(t,e,0),this.multiply([1,0,0,1,t,e])}translateTo(t,e){const i=this.offset(t,e);return this.translate(i[0],i[1])}translateX(t){return this.translate(t,0)}translateY(t){return this.translate(0,t)}translateZ(t){return this.isEverTo3d=!0,this.matrix3d.translate(0,0,t)}translate3d(t,e,i){return this.isEverTo3d=!0,this.matrix3d.translate(t,e,i)}rotate(t,e=0,i=0){const r=Ji(t),s=+Math.cos(r).toFixed(9),a=+Math.sin(r).toFixed(9);return this.multiply([s,a,-a,s,e,i]),this.translate(-e,-i),this}rotateX(t){return this._prev_rotatex=t,this.isEverTo3d=!0,this.matrix3d.rotate("x",t)}rotateXTo(t){return this.rotateX(t-this._prev_rotatex)}rotateY(t){return this._prev_rotatey=t,this.isEverTo3d=!0,this.matrix3d.rotate("y",t)}rotateYTo(t){return this.rotateY(t-this._prev_rotatey)}rotateZ(t){return this.isEverTo3d=!0,this.matrix3d.rotate("z",t)}rotate3d(t,e,i){return this.isEverTo3d=!0,this.matrix3d.rotate("x",t).rotate("y",e).rotate("z",i)}scale(t,e=t,i=0,r=0){return this.matrix3d.scale(t,e,1),this.translate(i,r),this.multiply([t,0,0,e,0,0]),this.translate(-i,-r),this}scaleTo(t,e=t){return this.scale(t/this.value[0],e/this.value[3]),this}scaleX(t){return this.scale(t,1)}scaleY(t){return this.scale(1,t)}scaleZ(t){return this.isEverTo3d=!0,this.matrix3d.scale(1,1,t)}scale3d(t,e,i){return this.isEverTo3d=!0,this.matrix3d.scale(t,e,i)}skew(t,e=0){const i=t*Math.PI/180,r=e*Math.PI/180,s=Math.tan(i),a=Math.tan(r);return this.multiply([1,a,s,1,0,0])}skewX(t){return this.skew(t,0)}skewY(t){return this.skew(0,t)}skewZ(t){return this}skew3d(t,e,i){return this}split(){const t={dx:0,dy:0,scalex:1,scaley:1,shear:1,rotate:0,isSimple:!0,isSuperSimple:!0,noRotation:!1};t.dx=this.value[4],t.dy=this.value[5];const e=[[this.value[0],this.value[2]],[this.value[1],this.value[3]]];t.scalex=Ki(e[0][0],e[0][1]);let i=Wr(e[0][0],e[0][1]);e[0][0]=i.x,e[0][1]=i.y,t.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*t.shear,e[1][1]-e[0][1]*t.shear],t.scaley=Ki(e[1][0],e[1][1]),i=Wr(e[1][0],e[1][1]),e[1][0]=i.x,e[1][1]=i.y,t.shear/=t.scaley;const r=-e[0][1],s=e[1][1];return s<0?(t.rotate=$r(Math.acos(s)),r<0&&(t.rotate=360-t.rotate)):t.rotate=Ji(Math.asin(r)),t.isSimple=!+t.shear.toFixed(9)&&(t.scalex.toFixed(9)==t.scaley.toFixed(9)||!t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t}toTransformString(){const t=this.split();return t.isSimple?(t.scalex=+t.scalex.toFixed(4),t.scaley=+t.scaley.toFixed(4),t.rotate=+t.rotate.toFixed(4),(t.dx&&t.dy?"t"+[t.dx,t.dy]:"")+(t.scalex!=1||t.scaley!=1?"s"+[t.scalex,t.scaley,0,0]:"")+(t.rotate?"r"+[t.rotate,0,0]:"")):"matrix"+[this.value[0],this.value[1],this.value[2],this.value[3],this.value[4],this.value[5]]}toString(){return this.isEverTo3d?this.toMatrix3DString():`matrix(${this.value.map(t=>ha(t,6)).join(",")})`}toMatrix3DString(){return this.matrix3d.toString()}toFilter(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.value[0]+", M12="+this.value[2]+", M21="+this.value[1]+", M22="+this.value[3]+", Dx="+this.value[4]+", Dy="+this.value[5]+", sizingmethod='auto expand')"}}class yn{value;constructor(t=qa){this.value=Array.from(t)}unit(){return this.value=Array.from(qa),this}fromString(t){const e=ra("number",t);return e.length===16?e.forEach((i,r)=>{i.fullMatch&&(this.value[r]=parseFloat(i.fullMatch))}):this.unit(),this}toMatrix(t){const e=[this.value[0],this.value[1],this.value[4],this.value[5],this.value[12],this.value[13]];return t?(t.value=e,t):new Jt(e)}multiplyMatrix(t){const e=this.value[0],i=this.value[1],r=this.value[2],s=this.value[3],a=this.value[4],o=this.value[5],l=this.value[6],c=this.value[7],u=this.value[8],g=this.value[9],p=this.value[10],d=this.value[11],w=this.value[12],x=this.value[13],C=this.value[14],A=this.value[15],P=t.value[0],M=t.value[1],D=t.value[2],U=t.value[3],z=P*e+M*a+D*u+U*w,F=P*i+M*o+D*g+U*x,G=P*r+M*l+D*p+U*C,H=P*s+M*c+D*d+U*A;return new Jt([z,F,G,H,0,0])}multiply(t){const e=new Jt([t.value[0],t.value[1],t.value[2],t.value[3],0,0]),i=new Jt([t.value[4],t.value[5],t.value[6],t.value[7],0,0]),r=new Jt([t.value[8],t.value[9],t.value[10],t.value[11],0,0]),s=new Jt([t.value[12],t.value[13],t.value[14],t.value[15],0,0]),a=this.multiplyMatrix(e),o=this.multiplyMatrix(i),l=this.multiplyMatrix(r),c=this.multiplyMatrix(s);return this.value[0]=a.value[0],this.value[1]=a.value[1],this.value[2]=a.value[2],this.value[3]=a.value[3],this.value[4]=o.value[0],this.value[5]=o.value[1],this.value[6]=o.value[2],this.value[7]=o.value[3],this.value[8]=l.value[0],this.value[9]=l.value[1],this.value[10]=l.value[2],this.value[11]=l.value[3],this.value[12]=c.value[0],this.value[13]=c.value[1],this.value[14]=c.value[2],this.value[15]=c.value[3],this}translate(t=0,e=0,i=0){return this.multiply(new yn([1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1]))}scale(t=1,e=1,i=1){return this.multiply(new yn([t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1]))}rotate(t,e){const i=Ji(e),r=Math.sin,s=Math.cos;let a;switch(t){case"x":a=[1,0,0,0,0,s(i),r(i),0,0,-r(i),s(i),0,0,0,0,1];break;case"y":a=[s(i),0,-r(i),0,0,1,0,0,r(i),0,s(i),0,0,0,0,1];break;case"z":a=[s(i),r(i),0,0,-r(i),s(i),0,0,0,0,1,0,0,0,0,1];break}return this.multiply(new yn(a))}toString(){return`matrix3d(${this.value.map(t=>ha(t,6)).join(",")})`}}function ui(n){const t=new Jt;return n.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,i,r){r.indexOf(",")>=0?r=r.split(/\s*,\s*/):r=r.split(/\s+/);const s=[];for(let a=0,o=r.length;a<o;a++)r[a].trim()&&s.push(parseFloat(""+r[a]));switch(i.toLowerCase()){case"t":case"translate":t.translate(s[0],s[1]);break;case"translatex":t.translateX(s[0]);break;case"translatey":t.translateY(s[0]);break;case"translatez":t.translateZ(s[0]);break;case"translate3d":t.translate3d(s[0],s[1],s[2]);break;case"r":case"rotate":t.rotate(s[0],s[1]??0,s[2]??0);break;case"rotatex":t.rotateX(s[0]);break;case"rotatey":t.rotateY(s[0]);break;case"rotatez":t.rotateZ(s[0]);break;case"rotate3d":t.rotate3d(s[0],s[1],s[2]);break;case"s":case"scale":t.scale(s[0],s[1]??s[0]);break;case"scalex":t.scaleX(s[0]);break;case"scaley":t.scaleY(s[0]);break;case"scalez":t.scaleZ(s[0]);break;case"scale3d":t.scale3d(s[0],s[1],s[2]);break;case"skew":t.skew(s[0],s[1]??0);break;case"skewx":t.skewX(s[0]);break;case"skewy":t.skewY(s[0]);break;case"skewz":t.skewZ(s[0]);break;case"skew3d":t.skew3d(s[0],s[1],s[2]);break;case"m":case"matrix":t.multiply([s[0],s[1],s[2],s[3],s[4],s[5]]);break;case"matrix3d":t.matrix3d.multiply(new yn(s));break}return""}),t}function Qr(n,t,e,i,r,s){if(typeof r>"u"||typeof s>"u"){const a=n-e,o=t-i;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return Qr(n,t,r,s)-Qr(e,i,r,s)}const St=Ya.eve,gh=Ya.elemental,nr={cursor:1,cx:0,cy:0,fill:1,"fill-opacity":0,font:1,"font-family":1,"font-size":0,"font-style":1,"font-weight":1,height:0,"letter-spacing":0,opacity:0,r:0,rx:0,ry:0,src:1,stroke:1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":0,"stroke-opacity":0,"stroke-width":0,"text-anchor":1,width:0,x:0,y:0};function ts(n,t,e){for(var i=(n+"").split(";"),r=/^\s+|\s+$/g,s,a=0,o=i.length;a<o;a++){var l=i[a].split(":");s=l[0].replace(r,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()}),(!e||s in e)&&(t[s]=l[1].replace(r,""),e&&!e[s]&&(t[s]=parseFloat(t[s])))}}function Za(n){const t=gh(),e=[],i=[],r={};let s,a,o;const l={};function c(u,g){return function(p,d){const w={type:g||u};e.push(w);for(let x in d)Object.prototype.hasOwnProperty.call(d,x)&&St("rappar."+u+".attr."+x,w,d[x],x);St("rappar."+u+".attrend",w,d)}}return St.on("rappar.polygon.attr.points",function(u){this.path="M"+u+"z",St.stop()}),St.on("rappar.image.attr.xlink:href",function(u){this.src=u,St.stop()}),St.on("rappar.path.attr.d",function(u){this.path=u,St.stop()}),St.on("rappar.*.attr.transform",function(u){this.transform=ui(u).toTransformString(),St.stop()}),St.on("rappar.*.attr.fill",function(u){var g=u.match(/url\(#([^)]+)\)/),p=this;g&&(g=g[1],r[g]?this.fill=r[g]:St.on("rappar.found."+g,function(d){p.fill=d}),St.stop())}),St.on("rappar.line.attrend",function(u){this.path="M"+[u.x1,u.y1,u.x2,u.y2]}),St.on("rappar.*.attrend",function(){for(var u=i.length;u--;)if(i[u]!=this){let p="",d="";for(var g in i[u])g=="transform"?p=i[u].transform:g=="class"&&l["."+i[u][g]]?d=l["."+i[u][g]].join(";")+";"+d:g=="id"&&l["#"+i[u][g]]?d=l["#"+i[u][g]].join(";")+";"+d:typeof this[g]>"u"&&(this[g]=i[u][g]);this.type&&(typeof this.transform>"u"?this.transform=p:this.transform+=p,typeof this.style>"u"?this.style=d:this.style=d+this.style,ts(this.style,this,nr))}}),St.on("rappar.*.attr.style",function(u){var g=function(){ts(u,this,nr),St.unbind("rappar.*.attrend",g)};St.on("rappar.*.attrend",g),St.stop()}),St.on("rappar.*.attr.*",function(u,g){g in nr&&(this[g]=nr[g]?u:parseFloat(u))}),St.on("elemental.tag.circle",c("circle")),St.on("elemental.tag.ellipse",c("ellipse")),St.on("elemental.tag.polygon",c("polygon","path")),St.on("elemental.tag.path",c("path")),St.on("elemental.tag.line",c("line","path")),St.on("elemental.tag.rect",c("rect")),St.on("elemental.tag.image",c("image")),St.on("elemental.tag.text",c("text")),St.on("elemental.text",function(u){try{const g=Ec(u);for(let p of g.stylesheet.rules){for(let d of p.selectors)l[d]=[];for(let d of p.declarations)for(let w of p.selectors)l[w].push(`${d.property}:${d.value}`)}}catch{}}),St.on("elemental.tag.svg",function(u,g){let p=g.width||0,d=g.height||0;if(!p||!d){const w=g.viewBox.split(/\s+/gi);p=parseFloat(w[2])-parseFloat(w[0]),d=parseFloat(w[3])-parseFloat(w[1])}e.push({type:"viewbox",width:p,height:d})}),St.on("rappar.text.attrend",function(){s="",a=this,this["text-anchor"]=this["text-anchor"]||"start"}),St.on("elemental.text",function(u,g,p){a&&(s+=p)}),St.on("elemental./tag.text",function(){a.text=s,a=null}),St.on("elemental.tag.g",function(u,g){var p={};i.push(p);for(var d in g)Object.prototype.hasOwnProperty.call(g,d)&&(p[d]=g[d],St("rappar.g.attr."+d,p,g[d],d));St("rappar.g.attrend",p)}),St.on("elemental./tag.g",function(u,g){i.pop()}),St.on("elemental.tag.linearGradient",function(u,g){o={id:g.id,angle:+(360+Qr(g.x1,g.y1,g.x2,g.y2,g.x1+100,g.y1)).toFixed(2),stops:[]}}),St.on("elemental./tag.linearGradient",function(){for(var u=[o.angle],g,p=0,d=o.stops.length;p<d;p++)g=o.stops[p],p&&p!=d-1?u.push(g.color+":"+g.offset):u.push(g.color);r[o.id]=u.join("-"),St("rappar.found."+o.id,null,r[o.id])}),St.on("elemental.tag.radialGradient",function(u,g){o={id:g.id,stops:[]}}),St.on("elemental./tag.radialGradient",function(){for(var u=[],g,p=0,d=o.stops.length;p<d;p++)g=o.stops[p],p&&p!=d-1?u.push(g.color+":"+g.offset):u.push(g.color);r[o.id]="r"+u.join("-"),St("rappar.found."+o.id,null,r[o.id])}),St.on("elemental.tag.stop",function(u,g){var p={};g.style&&ts(g.style,p),p.offset=p.offset||g.offset,p.color=p["stop-color"]||g["stop-color"],p.opacity=p["stop-opacity"]||g["stop-opacity"],~(p.offset+"").indexOf("%")?p.offset=parseFloat(p.offset):p.offset=parseFloat(p.offset)*100,p.offset=+p.offset.toFixed(2),o.stops.push(p)}),t(n),t.end(),e}function Wa(n){return typeof n!="string"?!1:(n=n.trim(),/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(n)&&/[\dz]$/i.test(n)&&n.length>4)}const es={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},mh=/([astvzqmhlc])([^astvzqmhlc]*)/gi,vh=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function _h(n){const t=n.match(vh);return t?t.map(Number):[]}function ir(n){const t=[];return n.replace(mh,function(e,i,r){let s=i.toLowerCase();for(r=_h(r),s=="m"&&r.length>2&&(t.push([i].concat(r.splice(0,2))),s="l",i=i=="m"?"l":"L");;){if(r.length==es[s])return r.unshift(i),t.push(r);if(r.length<es[s])throw new Error("malformed path data");t.push([i].concat(r.splice(0,es[s])))}}),t}function rr(n){var t=0,e=0,i=0,r=0;return n.map(function(s){s=s.slice();var a=s[0],o=a.toUpperCase();if(a!=o)switch(s[0]=o,a){case"a":s[6]+=i,s[7]+=r;break;case"v":s[1]+=r;break;case"h":s[1]+=i;break;default:for(var l=1;l<s.length;)s[l++]+=i,s[l++]+=r}switch(o){case"Z":i=t,r=e;break;case"H":i=s[1];break;case"V":r=s[1];break;case"M":i=t=s[1],r=e=s[2];break;default:i=s[s.length-2],r=s[s.length-1]}return s})}function yh(n){var t=0,e=0,i=0,r=0;return n.map(function(s){s=s.slice();var a=s[0],o=a.toLowerCase();if(a!=o)switch(s[0]=o,a){case"A":s[6]-=i,s[7]-=r;break;case"V":s[1]-=r;break;case"H":s[1]-=i;break;default:for(var l=1;l<s.length;)s[l++]-=i,s[l++]-=r}switch(o){case"z":i=t,r=e;break;case"h":i+=s[1];break;case"v":r+=s[1];break;case"m":i+=s[1],r+=s[2],t+=s[1],e+=s[2];break;default:i+=s[s.length-2],r+=s[s.length-1]}return s})}const di=Math.PI*2;function Ja(n,t,e,i){const r=n*i-t*e<0?-1:1;let s=n*e+t*i;return s>1&&(s=1),s<-1&&(s=-1),r*Math.acos(s)}function wh(n,t,e,i,r,s,a,o,l,c){const u=c*(n-e)/2+l*(t-i)/2,g=-l*(n-e)/2+c*(t-i)/2,p=a*a,d=o*o,w=u*u,x=g*g;let C=p*d-p*x-d*w;C<0&&(C=0),C/=p*x+d*w,C=Math.sqrt(C)*(r===s?-1:1);const A=C*a/o*g,P=C*-o/a*u,M=c*A-l*P+(n+e)/2,D=l*A+c*P+(t+i)/2,U=(u-A)/a,z=(g-P)/o,F=(-u-A)/a,G=(-g-P)/o,H=Ja(1,0,U,z);let $=Ja(U,z,F,G);return s===0&&$>0&&($-=di),s===1&&$<0&&($+=di),[M,D,H,$]}function xh(n,t){const e=1.3333333333333333*Math.tan(t/4),i=Math.cos(n),r=Math.sin(n),s=Math.cos(n+t),a=Math.sin(n+t);return[i,r,i-r*e,r+i*e,s+a*e,a-s*e,s,a]}function bh(n,t,e,i,r,s,a,o,l){const c=Math.sin(l*di/360),u=Math.cos(l*di/360),g=u*(n-e)/2+c*(t-i)/2,p=-c*(n-e)/2+u*(t-i)/2;if(g===0&&p===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const d=g*g/(a*a)+p*p/(o*o);d>1&&(a*=Math.sqrt(d),o*=Math.sqrt(d));const w=wh(n,t,e,i,r,s,a,o,c,u),x=[];let C=w[2],A=w[3];const P=Math.max(Math.ceil(Math.abs(A)/(di/4)),1);A/=P;for(let M=0;M<P;M++)x.push(xh(C,A)),C+=A;return x.map(M=>{for(let D=0;D<M.length;D+=2){let U=M[D+0],z=M[D+1];U*=a,z*=o;const F=u*U-c*z,G=c*U+u*z;M[D+0]=F+w[0],M[D+1]=G+w[1]}return M})}function sr(n){for(var t,e=[],i=0,r=0,s=0,a=0,o=null,l=null,c=0,u=0,g=0,p=n.length;g<p;g++){var d=n[g],w=d[0];switch(w){case"M":s=d[1],a=d[2];break;case"A":var x=bh(c,u,d[6],d[7],d[4],d[5],d[1],d[2],d[3]);if(!x.length)continue;x=x.map(D=>{const[U,z,F,G,H,$,X,J]=D;return{x1:F,y1:G,x2:H,y2:$,x:X,y:J}});for(var C=0,A;C<x.length;C++)A=x[C],d=["C",A.x1,A.y1,A.x2,A.y2,A.x,A.y],C<x.length-1&&e.push(d);break;case"S":var P=c,M=u;(t=="C"||t=="S")&&(P+=P-i,M+=M-r),d=["C",P,M,d[1],d[2],d[3],d[4]];break;case"T":t=="Q"||t=="T"?(o=c*2-o,l=u*2-l):(o=c,l=u),d=Ka(c,u,o,l,d[1],d[2]);break;case"Q":o=d[1],l=d[2],d=Ka(c,u,d[1],d[2],d[3],d[4]);break;case"L":d=ar(c,u,d[1],d[2]);break;case"H":d=ar(c,u,d[1],u);break;case"V":d=ar(c,u,c,d[1]);break;case"Z":d=ar(c,u,s,a);break}t=w,c=d[d.length-2],u=d[d.length-1],d.length>4?(i=d[d.length-4],r=d[d.length-3]):(i=c,r=u),e.push(d)}return e}function ar(n,t,e,i){return["C",n,t,e,i,e,i]}function Ka(n,t,e,i,r,s){return["C",n/3+.6666666666666666*e,t/3+.6666666666666666*i,r/3+.6666666666666666*e,s/3+.6666666666666666*i,r,s]}const Ch=n=>Array.isArray(n);function zn(n){if(!(this instanceof zn))return new zn(n);this._path=Ch(n)?n:ir(n),this._path=rr(this._path),this._path=Sh(this._path),this._path=Th(this._path)}zn.prototype.at=function(n,t){return this._walk(n,t).pos},zn.prototype.length=function(){return this._walk(null).length},zn.prototype._walk=function(n,t){let e=[0,0],i=[0,0,0],r=[0,0],s=0;for(let u=0;u<this._path.length;u++){let g=this._path[u];if(g[0]==="M"){if(e[0]=g[1],e[1]=g[2],n===0)return{length:s,pos:e}}else if(g[0]==="C"){i[0]=r[0]=e[0],i[1]=r[1]=e[1],i[2]=s;let p=100;for(let d=0;d<=p;d++){let w=d/p,x=a(g,w),C=o(g,w);if(s+=ns(e[0],e[1],x,C),e[0]=x,e[1]=C,typeof n=="number"&&s>=n){let A=(s-n)/(s-i[2]),P=[e[0]*(1-A)+i[0]*A,e[1]*(1-A)+i[1]*A];return{length:s,pos:P}}i[0]=e[0],i[1]=e[1],i[2]=s}}else if(g[0]==="Q"){i[0]=r[0]=e[0],i[1]=r[1]=e[1],i[2]=s;let p=100;for(let d=0;d<=p;d++){let w=d/p,x=l(g,w),C=c(g,w);if(s+=ns(e[0],e[1],x,C),e[0]=x,e[1]=C,typeof n=="number"&&s>=n){let A=(s-n)/(s-i[2]),P=[e[0]*(1-A)+i[0]*A,e[1]*(1-A)+i[1]*A];return{length:s,pos:P}}i[0]=e[0],i[1]=e[1],i[2]=s}}else if(g[0]==="L"){if(i[0]=e[0],i[1]=e[1],i[2]=s,s+=ns(e[0],e[1],g[1],g[2]),e[0]=g[1],e[1]=g[2],typeof n=="number"&&s>=n){let p=(s-n)/(s-i[2]),d=[e[0]*(1-p)+i[0]*p,e[1]*(1-p)+i[1]*p];return{length:s,pos:d}}i[0]=e[0],i[1]=e[1],i[2]=s}}return{length:s,pos:e};function a(u,g){return Math.pow(1-g,3)*r[0]+3*Math.pow(1-g,2)*g*u[1]+3*(1-g)*Math.pow(g,2)*u[3]+Math.pow(g,3)*u[5]}function o(u,g){return Math.pow(1-g,3)*r[1]+3*Math.pow(1-g,2)*g*u[2]+3*(1-g)*Math.pow(g,2)*u[4]+Math.pow(g,3)*u[6]}function l(u,g){return Math.pow(1-g,2)*r[0]+2*(1-g)*g*u[1]+Math.pow(g,2)*u[3]}function c(u,g){return Math.pow(1-g,2)*r[1]+2*(1-g)*g*u[2]+Math.pow(g,2)*u[4]}};function ns(n,t,e,i){let r=n-e,s=t-i;return Math.sqrt(r*r+s*s)}function Th(n){let t,e=0,i=0,r={S:{to:"C",x:3},T:{to:"Q",x:1}};for(let s=0,a=n.length;s<a;s++){let o=n[s],l=r[o[0]];l&&(o[0]=l.to,t&&(t[0]===l.to?(e=2*t[l.x+2]-t[l.x],i=2*t[l.x+3]-t[l.x+1]):(e=t[t.length-2],i=t[t.length-1])),o.splice(1,0,e,i)),t=o}return n}function Sh(n){let t=[],e=["L",0,0],i;for(let r=0,s=n.length;r<s;r++){let a=n[r];switch(a[0]){case"M":e=["L",a[1],a[2]],t.push(a);break;case"Z":t.push(e);break;case"H":i=t[t.length-1]||["L",0,0],t.push(["L",a[1],i[i.length-1]]);break;case"V":i=t[t.length-1]||["L",0,0],t.push(["L",i[i.length-2],a[1]]);break;default:t.push(a)}}return t}const is=n=>{if(typeof n=="function"||Object(n)!==n)return n;const t=new n.constructor;for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=is(n[e]));return t};function rs(n){const t=rs.ps=rs.ps||{};return t[n]?t[n].sleep=100:t[n]={sleep:100},setTimeout(()=>{for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&e!==n&&(t[e].sleep--,t[e].sleep||delete t[e])}),t[n]}function pi(n,t,e,i){return n==null&&(n=t=e=i=0),t==null&&(t=n.y,e=n.width,i=n.height,n=n.x),{x:n,y:t,width:e,w:e,height:i,h:i,x2:n+e,y2:t+i,cx:n+e/2,cy:t+i/2,r1:Math.min(e,i)/2,r2:Math.max(e,i)/2,r0:Math.sqrt(e*e+i*i)/2,path:Lh(n,t,e,i),vb:[n,t,e,i].join(" ")}}function Qa(n,t,e,i,r,s,a,o,l){const c=1-l,u=c**3,g=c**2,p=l*l,d=p*l,w=u*n+g*3*l*e+c*3*l*l*r+d*a,x=u*t+g*3*l*i+c*3*l*l*s+d*o,C=n+2*l*(e-n)+p*(r-2*e+n),A=t+2*l*(i-t)+p*(s-2*i+t),P=e+2*l*(r-e)+p*(a-2*r+e),M=i+2*l*(s-i)+p*(o-2*s+i),D=c*n+l*e,U=c*t+l*i,z=c*r+l*a,F=c*s+l*o,G=90-Math.atan2(C-P,A-M)*180/Math.PI;return{x:w,y:x,m:{x:C,y:A},n:{x:P,y:M},start:{x:D,y:U},end:{x:z,y:F},alpha:G}}function to(n,t,e,i,r,s,a,o){Array.isArray(n)||(n=[n,t,e,i,r,s,a,o]);const l=io(...n);return pi(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)}function Eh(n,t,e){return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height}function kh(n,t){n=pi(n),t=pi(t);const{x:e,y:i,width:r,height:s}=n,{x:a,y:o,width:l,height:c}=t,u=e+r/2,g=i+s/2,p=a+l/2,d=o+c/2;return Math.abs(u-p)<=(r+l)/2||Math.abs(g-d)<=(s+c)/2}function eo(n,t,e,i,r){const s=-3*t+9*e-9*i+3*r,a=n*s+6*t-12*e+6*i;return n*a-3*t+3*e}function no(n,t,e,i,r,s,a,o,l){l==null&&(l=1),l=Math.max(0,Math.min(l,1));const c=l/2,u=12,g=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let d=0;for(let w=0;w<u;w++){const x=c*g[w]+c,C=eo(x,n,e,r,a),A=eo(x,t,i,s,o),P=C*C+A*A;d+=p[w]*Math.sqrt(P)}return c*d}function Ah(n,t,e,i,r,s,a,o){if(Math.max(n,e)<Math.min(r,a)||Math.min(n,e)>Math.max(r,a)||Math.max(t,i)<Math.min(s,o)||Math.min(t,i)>Math.max(s,o))return;const l=(n*i-t*e)*(r-a)-(n-e)*(r*o-s*a),c=(n*i-t*e)*(s-o)-(t-i)*(r*o-s*a),u=(n-e)*(s-o)-(t-i)*(r-a);if(!u)return;const g=l/u,p=c/u,d=Number(g.toFixed(2)),w=Number(p.toFixed(2));if(!(d<Number(Math.min(n,e).toFixed(2))||d>Number(Math.max(n,e).toFixed(2))||d<Number(Math.min(r,a).toFixed(2))||d>Number(Math.max(r,a).toFixed(2))||w<Number(Math.min(t,i).toFixed(2))||w>Number(Math.max(t,i).toFixed(2))||w<Number(Math.min(s,o).toFixed(2))||w>Number(Math.max(s,o).toFixed(2))))return{x:g,y:p}}function Ph(n,t,e){const i=to(n),r=to(t);if(!kh(i,r))return e?0:[];const s=no.apply(0,n),a=no.apply(0,t),o=Math.ceil(s/8),l=Math.ceil(a/8),c=[],u=[],g={};let p=e?0:[];for(let d=0;d<o+1;d++){const w=Qa.apply(0,n.concat(d/o));c.push({x:w.x,y:w.y,t:d/o})}for(let d=0;d<l+1;d++){const w=Qa.apply(0,t.concat(d/l));u.push({x:w.x,y:w.y,t:d/l})}for(let d=0;d<o;d++)for(let w=0;w<l;w++){const x=c[d],C=c[d+1],A=u[w],P=u[w+1],M=Math.abs(C.x-x.x)<.001?"y":"x",D=Math.abs(P.x-A.x)<.001?"y":"x",U=Ah(x.x,x.y,C.x,C.y,A.x,A.y,P.x,P.y);if(U&&g[U.x.toFixed(4)]!==U.y.toFixed(4)){g[U.x.toFixed(4)]=U.y.toFixed(4);const z=x.t+Math.abs((U[M]-x[M])/(C[M]-x[M]))*(C.t-x.t),F=A.t+Math.abs((U[D]-A[D])/(P[D]-A[D]))*(P.t-A.t);z>=0&&z<=1&&F>=0&&F<=1&&(e?p++:p.push({x:U.x,y:U.y,t1:z,t2:F}))}}return p}function Ih(n,t,e){let i,r,s,a,o,l,c,u,g,p,d=e?0:[];for(let w=0,x=n.length;w<x;w++){const C=n[w];if(C[0]==="M")i=o=C[1],r=l=C[2];else{C[0]==="C"?(g=[i,r].concat(C.slice(1)),i=g[6],r=g[7]):(g=[i,r,i,r,o,l,o,l],i=o,r=l);for(let A=0,P=t.length;A<P;A++){const M=t[A];if(M[0]==="M")s=c=M[1],a=u=M[2];else{M[0]==="C"?(p=[s,a].concat(M.slice(1)),s=p[6],a=p[7]):(p=[s,a,s,a,c,u,c,u],s=c,a=u);const D=Ph(g,p,e);if(e)d+=D;else{for(let U=0,z=D.length;U<z;U++)D[U].segment1=w,D[U].segment2=A,D[U].bez1=g,D[U].bez2=p;d=d.concat(D)}}}}}return d}function Mh(n){const t=rs(n);if(t.bbox)return is(t.bbox);if(!n)return pi();let e=0,i=0,r=[],s=[],a=[];for(let p=0,d=n.length;p<d;p++)if(a=n[p],a[0]==="M")e=a[1],i=a[2],r.push(e),s.push(i);else{const w=io(e,i,a[1],a[2],a[3],a[4],a[5],a[6]);r=r.concat(w.min.x,w.max.x),s=s.concat(w.min.y,w.max.y),e=a[5],i=a[6]}const o=Math.min.apply(0,r),l=Math.min.apply(0,s),c=Math.max.apply(0,r),u=Math.max.apply(0,s),g=pi(o,l,c-o,u-l);return t.bbox=is(g),g}function Lh(n,t,e,i,r){return r?[["M",Number(n)+Number(r),t],["l",e-r*2,0],["a",r,r,0,0,1,r,r],["l",0,i-r*2],["a",r,r,0,0,1,-r,r],["l",r*2-e,0],["a",r,r,0,0,1,-r,-r],["l",0,r*2-i],["a",r,r,0,0,1,r,-r],["z"]]:[["M",n,t],["l",e,0],["l",0,i],["l",-e,0],["z"]]}function io(n,t,e,i,r,s,a,o){const l=[],c=[[],[]];let u,g,p,d,w,x,C,A;for(let U=0;U<2;++U){if(U===0?(g=6*n-12*e+6*r,u=-3*n+9*e-9*r+3*a,p=3*e-3*n):(g=6*t-12*i+6*s,u=-3*t+9*i-9*s+3*o,p=3*i-3*t),Math.abs(u)<1e-12){if(Math.abs(g)<1e-12)continue;d=-p/g,d>0&&d<1&&l.push(d);continue}C=g*g-4*p*u,A=Math.sqrt(C),!(C<0)&&(w=(-g+A)/(2*u),w>0&&w<1&&l.push(w),x=(-g-A)/(2*u),x>0&&x<1&&l.push(x))}let P=l.length,M;const D=P;for(;P--;)d=l[P],M=1-d,c[0][P]=M*M*M*n+3*M*M*d*e+3*M*d*d*r+d*d*d*a,c[1][P]=M*M*M*t+3*M*M*d*i+3*M*d*d*s+d*d*d*o;return c[0][D]=n,c[1][D]=t,c[0][D+1]=a,c[1][D+1]=o,c[0].length=c[1].length=D+2,{min:{x:Math.min.apply(0,c[0]),y:Math.min.apply(0,c[1])},max:{x:Math.max.apply(0,c[0]),y:Math.max.apply(0,c[1])}}}function Dh(n,t,e){const i=Mh(n);return!(!Eh(i,t,e)||Ih(n,sr([["M",t,e],["H",i.x2+10]]),1)%2!==1)}const ss=new Map;function ro(n){if(ss.has(n))return ss.get(n);const t=zn(n);return ss.set(n,t),t}function so(n){const t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",n),t}function ao(n,t){return Vi?so(n).getTotalLength(t):ro(n).length()}function oo(n,t){if(Vi)return so(n).getPointAtLength(t);{const e=ro(n),[i,r]=e.at(t);return{x:i,y:r}}}let ge=null;function lo(n,t,e){if(Vi){ge||(ge=document.createElement("canvas").getContext("2d"));const i=new Path2D(n);return ge.isPointInPath(i,t,e)}else return Dh(n,t,e)}function co(n,t,e,{lineWidth:i=1,lineCap:r="butt",lineJoin:s="miter"}){if(Vi){if(ge||(ge=document.createElement("canvas").getContext("2d")),ge.isPointInStroke){ge.save(),ge.lineWidth=i,ge.lineCap=r,ge.lineJoin=s;const a=new Path2D(n),o=ge.isPointInStroke(a,t,e);return ge.restore(),o}}else return null}class as{point;constructor(t){this.point=new Ee(t)}static fromSVGPathData(t){if(t.length<3)throw new Error("Line 参数个数错误");if(t[0].toUpperCase()!=="L")throw new Error("Line command 错误");return new as({x:t[1],y:t[2]})}toSVGPathData(){return["L",this.point.x,this.point.y]}toSVGPathD(){return"L "+this.point.toSVGPathD()}}const ho=as;class os extends ho{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1}static fromSVGPathData(t){if(t.length<8)throw new Error("Arc 参数个数错误");if(t[0].toUpperCase()!=="A")throw new Error("Arc command 错误");return new os({x:t[6],y:t[7],rx:t[1],ry:t[2],xAxisRotate:t[3],largeArcFlag:t[4],sweepFlag:t[5]})}toSVGPathData(){return["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.point.x,this.point.y]}toSVGPathD(){return`A ${this.rx},${this.ry} ${this.xAxisRotate} ${this.largeArcFlag},${this.sweepFlag} ${this.point.toSVGPathD()}`}}const fo=os;class ls extends ho{ctrlPoints=[];constructor(t){super(t),this.ctrlPoints.push(new Ee({x:t.c1x,y:t.c1y})),this.ctrlPoints.push(new Ee({x:t.c2x,y:t.c2y}))}static fromSVGPathData(t){if(t.length<7)throw new Error("CubicBezier 参数个数错误");if(t[0].toUpperCase()!=="C")throw new Error("CubicBezier command 错误");return new ls({c1x:t[1],c1y:t[2],c2x:t[3],c2y:t[4],x:t[5],y:t[6]})}toSVGPathData(){return["C",this.ctrlPoints[0].x,this.ctrlPoints[0].y,this.ctrlPoints[1].x,this.ctrlPoints[1].y,this.point.x,this.point.y]}toSVGPathD(){return`C ${this.ctrlPoints.map(t=>t.toSVGPathD()).join(" ")} ${this.point.toSVGPathD()}`}}const cs=ls;class wn{startPoint;isClosed=!1;lines=[];normalizedLines=[];constructor(t){this.startPoint=t?.startPoint??null,this.isClosed=t?.isClosed??!1,t?.lines?.forEach(this.addLine),this.normalize()}setStartPoint(t,e){return this.startPoint=new Ee({x:t,y:e}),this}addLine(t){return this.lines.push(t),this}normalize(){let t=this.lines.reduce((i,r)=>(i+=r.toSVGPathD(),i),"");this.startPoint&&(t="M "+this.startPoint.toSVGPathD()+t),this.isClosed&&(t+="Z"),this.normalizedLines=[];const e=sr(rr(ir(t)));for(let i=0,r=e.length;i<r;i++){const s=e[i];if(i==0&&s[0]=="M"){this.setStartPoint(s[1],s[2]);continue}if(i==r-1&&s[0]=="Z"){this.isClosed=!0;continue}this.normalizedLines.push(cs.fromSVGPathData(s))}return this}static fromSVGPathD(t,e){if(!Wa(t))throw new Error("Not an SVG path!");const i=sr(rr(ir(t)));return wn.fromSVGPathData(i,e)}static fromSVGPathData(t,e){const i=new wn;for(let s=0,a=t.length;s<a;s++){const o=t[s],l=o[0];if(s==0&&l=="M"){i.setStartPoint(o[1],o[2]);continue}if(s==a-1&&l=="Z"){i.isClosed=!0;continue}i.addLine(new cs({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],x:o[5],y:o[6]}))}i.normalize();const r=ui(e??"");return i.transform(r)}toSVGPathD(){let t="";this.startPoint&&(t+="M "+this.startPoint.toSVGPathD());for(let e=0,i=this.normalizedLines.length;e<i;e++)t+=this.normalizedLines[e].toSVGPathD();return this.isClosed&&(t+="Z"),t}toSVGPathData(){const t=[];this.startPoint&&t.push(["M",...this.startPoint.toSVGPathData()]);for(let e=0,i=this.normalizedLines.length;e<i;e++)t.push(this.normalizedLines[e].toSVGPathData());return this.isClosed&&t.push(["Z"]),t}toCanvas(t){const e=this.normalizedLines;e.length&&(this.startPoint&&(t.beginPath(),t.moveTo(this.startPoint.x,this.startPoint.y)),e.forEach(i=>{const[r,...s]=i.toSVGPathData();r==="M"?t.moveTo(s[0],s[1]):r==="Z"?t.closePath():t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}),this.isClosed&&t.closePath())}get bounds(){let t=[0,0,0,0];if(this.normalizedLines.length){t=[1/0,1/0,-1/0,-1/0];for(let e=0,i=this.normalizedLines.length;e<i;e++){const r=this.normalizedLines[e],s=[...r.ctrlPoints,r.point];for(let a=0;a<s.length;a++){const o=s[a].x,l=s[a].y;o<t[0]&&(t[0]=o),l<t[1]&&(t[1]=l),o>t[2]&&(t[2]=o),l>t[3]&&(t[3]=l)}}}return t}get size(){const t=this.bounds;return[t[2]-t[0],t[3]-t[1]]}get center(){const[t,e,i,r]=this.bounds;return[(t+i)/2,(e+r)/2]}getTotalLength(){return ao(this.toSVGPathD())}getPointAtLength(t){return oo(this.toSVGPathD(),t)}isPointInPath(t,e){return lo(this.toSVGPathD(),t,e)}isPointInStroke(t,e,i={lineWidth:1,lineCap:"butt",lineJoin:"miter"}){return co(this.toSVGPathD(),t,e,i)}transform(t){if(this.startPoint){const[e,i]=t.transformPoint(this.startPoint.x,this.startPoint.y);this.setStartPoint(e,i)}return this.normalizedLines=this.normalizedLines.map(e=>{const[i,...r]=e.toSVGPathData(),s=[i];for(let a=0,o=r.length;a<o;a+=2){const l=r[a],c=r[a+1],[u,g]=t.transformPoint(l,c);s.push(u,g)}return cs.fromSVGPathData(s)}),this}translate(t,e){const i=new Jt().translate(t,e);return this.transform(i)}rotate(t,e=0,i=0){const r=new Jt().rotate(t,e,i);return this.transform(r)}scale(t,e=t,i=0,r=0){const s=new Jt().scale(t,e,i,r);return this.transform(s)}skew(t,e=0){const i=new Jt().skew(t,e);return this.transform(i)}trim(){const[t,e]=this.bounds;return this.translate(-t,-e),this}static generateRosetta(t,e,i,r,s){if(s==0)throw new Error("no dividing by zero, please");const a=new wn;a.setStartPoint(t,e);const o=360/s;for(let l=0;l<s;l+=1){const c=o*l*Math.PI/180,u=t+2*i*Math.cos(c),g=e+2*i*Math.sin(c);a.addLine(new fo({x:u,y:g,rx:i,ry:r,xAxisRotate:o*l,largeArcFlag:1,sweepFlag:1})),a.addLine(new fo({x:t,y:e,rx:i,ry:r,xAxisRotate:o*l,largeArcFlag:1,sweepFlag:1}))}return a.normalize(),a}}var uo={exports:{}};(function(n,t){(function(e,i){n.exports=i()})(window,function(){return function(e){var i={};function r(s){if(i[s])return i[s].exports;var a=i[s]={i:s,l:!1,exports:{}};return e[s].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=i,r.d=function(s,a,o){r.o(s,a)||Object.defineProperty(s,a,{enumerable:!0,get:o})},r.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},r.t=function(s,a){if(1&a&&(s=r(s)),8&a||4&a&&typeof s=="object"&&s&&s.__esModule)return s;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:s}),2&a&&typeof s!="string")for(var l in s)r.d(o,l,function(c){return s[c]}.bind(null,l));return o},r.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return r.d(a,"a",a),a},r.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},r.p="",r(r.s=1)}([function(e,i,r){var s,a;s=[r(2)],(a=function(o){function l(f){if(l.is(f,"function"))return c?f():o.on("raphael.DOMload",f);if(l.is(f,st))return l._engine.create[P](l,f.splice(0,3+l.is(f[0],tt))).add(f);var v=Array.prototype.slice.call(arguments,0);if(l.is(v[v.length-1],"function")){var _=v.pop();return c?_.call(l._engine.create[P](l,v)):o.on("raphael.DOMload",function(){_.call(l._engine.create[P](l,v))})}return l._engine.create[P](l,arguments)}l.version="2.3.0",l.eve=o;var c,u,g=/[, ]+/,p={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},d=/\{(\d+)\}/g,w="hasOwnProperty",x={doc:document,win:window},C={was:Object.prototype[w].call(x.win,"Raphael"),is:x.win.Raphael},A=function(){this.ca=this.customAttributes={}},P="apply",M="concat",D="ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch,U="",z=" ",F=String,G="split",H="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[G](z),$={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},X=F.prototype.toLowerCase,J=Math,dt=J.max,ft=J.min,gt=J.abs,Et=J.pow,kt=J.PI,tt="number",st="array",ht=Object.prototype.toString,L=(l._ISURL=/^url\(['"]?(.+?)['"]?\)$/i,/^\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),E={NaN:1,Infinity:1,"-Infinity":1},S=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,R=J.round,B=parseFloat,j=parseInt,V=F.prototype.toUpperCase,et=l._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0,class:""},Y=l._availableAnimAttrs={blur:tt,"clip-rect":"csv",cx:tt,cy:tt,fill:"colour","fill-opacity":tt,"font-size":tt,height:tt,opacity:tt,path:"path",r:tt,rx:tt,ry:tt,stroke:"colour","stroke-opacity":tt,"stroke-width":tt,transform:"transform",width:tt,x:tt,y:tt},it=/[\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]*/,pt={hs:1,rg:1},vt=/,?([achlmqrstvxz]),?/gi,wt=/([achlmrqstvz])[\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,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\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]*)+)/gi,At=/([rstm])[\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,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\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]*)+)/gi,xt=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\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]*/gi,It=(l._radial_gradient=/^r(?:\(([^,]+?)[\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]*([^\)]+?)\))?/,{}),Mt=function(f,v){return B(f)-B(v)},Dt=function(f){return f},_t=l._rectPath=function(f,v,_,h,m){return m?[["M",f+m,v],["l",_-2*m,0],["a",m,m,0,0,1,m,m],["l",0,h-2*m],["a",m,m,0,0,1,-m,m],["l",2*m-_,0],["a",m,m,0,0,1,-m,-m],["l",0,2*m-h],["a",m,m,0,0,1,m,-m],["z"]]:[["M",f,v],["l",_,0],["l",0,h],["l",-_,0],["z"]]},zt=function(f,v,_,h){return h==null&&(h=_),[["M",f,v],["m",0,-h],["a",_,h,0,1,1,0,2*h],["a",_,h,0,1,1,0,-2*h],["z"]]},Rt=l._getPath={path:function(f){return f.attr("path")},circle:function(f){var v=f.attrs;return zt(v.cx,v.cy,v.r)},ellipse:function(f){var v=f.attrs;return zt(v.cx,v.cy,v.rx,v.ry)},rect:function(f){var v=f.attrs;return _t(v.x,v.y,v.width,v.height,v.r)},image:function(f){var v=f.attrs;return _t(v.x,v.y,v.width,v.height)},text:function(f){var v=f._getBBox();return _t(v.x,v.y,v.width,v.height)},set:function(f){var v=f._getBBox();return _t(v.x,v.y,v.width,v.height)}},jt=l.mapPath=function(f,v){if(!v)return f;var _,h,m,y,b,k,I;for(m=0,b=(f=In(f)).length;m<b;m++)for(y=1,k=(I=f[m]).length;y<k;y+=2)_=v.x(I[y],I[y+1]),h=v.y(I[y],I[y+1]),I[y]=_,I[y+1]=h;return f};if(l._g=x,l.type=x.win.SVGAngle||x.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML",l.type=="VML"){var Ut,ie=x.doc.createElement("div");if(ie.innerHTML='<v:shape adj="1"/>',(Ut=ie.firstChild).style.behavior="url(#default#VML)",!Ut||typeof Ut.adj!="object")return l.type=U;ie=null}function Wt(f){if(typeof f=="function"||Object(f)!==f)return f;var v=new f.constructor;for(var _ in f)f[w](_)&&(v[_]=Wt(f[_]));return v}l.svg=!(l.vml=l.type=="VML"),l._Paper=A,l.fn=u=A.prototype=l.prototype,l._id=0,l.is=function(f,v){return(v=X.call(v))=="finite"?!E[w](+f):v=="array"?f instanceof Array:v=="null"&&f===null||v==typeof f&&f!==null||v=="object"&&f===Object(f)||v=="array"&&Array.isArray&&Array.isArray(f)||ht.call(f).slice(8,-1).toLowerCase()==v},l.angle=function(f,v,_,h,m,y){if(m==null){var b=f-_,k=v-h;return b||k?(180+180*J.atan2(-k,-b)/kt+360)%360:0}return l.angle(f,v,m,y)-l.angle(_,h,m,y)},l.rad=function(f){return f%360*kt/180},l.deg=function(f){return Math.round(180*f/kt%360*1e3)/1e3},l.snapTo=function(f,v,_){if(_=l.is(_,"finite")?_:10,l.is(f,st)){for(var h=f.length;h--;)if(gt(f[h]-v)<=_)return f[h]}else{var m=v%(f=+f);if(m<_)return v-m;if(m>f-_)return v-m+f}return v};var Me,fn;l.createUUID=(Me=/[xy]/g,fn=function(f){var v=16*J.random()|0;return(f=="x"?v:3&v|8).toString(16)},function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(Me,fn).toUpperCase()}),l.setWindow=function(f){o("raphael.setWindow",l,x.win,f),x.win=f,x.doc=x.win.document,l._engine.initWin&&l._engine.initWin(x.win)};var Ce=function(f){if(l.vml){var v,_=/^\s+|\s+$/g;try{var h=new ActiveXObject("htmlfile");h.write("<body>"),h.close(),v=h.body}catch{v=createPopup().document.body}var m=v.createTextRange();Ce=qt(function(b){try{v.style.color=F(b).replace(_,U);var k=m.queryCommandValue("ForeColor");return"#"+("000000"+(k=(255&k)<<16|65280&k|(16711680&k)>>>16).toString(16)).slice(-6)}catch{return"none"}})}else{var y=x.doc.createElement("i");y.title="Raphaël Colour Picker",y.style.display="none",x.doc.body.appendChild(y),Ce=qt(function(b){return y.style.color=b,x.doc.defaultView.getComputedStyle(y,U).getPropertyValue("color")})}return Ce(f)},je=function(){return"hsb("+[this.h,this.s,this.b]+")"},Xe=function(){return"hsl("+[this.h,this.s,this.l]+")"},Le=function(){return this.hex},De=function(f,v,_){if(v==null&&l.is(f,"object")&&"r"in f&&"g"in f&&"b"in f&&(_=f.b,v=f.g,f=f.r),v==null&&l.is(f,"string")){var h=l.getRGB(f);f=h.r,v=h.g,_=h.b}return(f>1||v>1||_>1)&&(f/=255,v/=255,_/=255),[f,v,_]},Wn=function(f,v,_,h){var m={r:f*=255,g:v*=255,b:_*=255,hex:l.rgb(f,v,_),toString:Le};return l.is(h,"finite")&&(m.opacity=h),m};function qt(f,v,_){return function h(){var m=Array.prototype.slice.call(arguments,0),y=m.join("␀"),b=h.cache=h.cache||{},k=h.count=h.count||[];return b[w](y)?(function(I,N){for(var q=0,Q=I.length;q<Q;q++)if(I[q]===N)return I.push(I.splice(q,1)[0])}(k,y),_?_(b[y]):b[y]):(k.length>=1e3&&delete b[k.shift()],k.push(y),b[y]=f[P](v,m),_?_(b[y]):b[y])}}l.color=function(f){var v;return l.is(f,"object")&&"h"in f&&"s"in f&&"b"in f?(v=l.hsb2rgb(f),f.r=v.r,f.g=v.g,f.b=v.b,f.hex=v.hex):l.is(f,"object")&&"h"in f&&"s"in f&&"l"in f?(v=l.hsl2rgb(f),f.r=v.r,f.g=v.g,f.b=v.b,f.hex=v.hex):(l.is(f,"string")&&(f=l.getRGB(f)),l.is(f,"object")&&"r"in f&&"g"in f&&"b"in f?(v=l.rgb2hsl(f),f.h=v.h,f.s=v.s,f.l=v.l,v=l.rgb2hsb(f),f.v=v.b):(f={hex:"none"}).r=f.g=f.b=f.h=f.s=f.v=f.l=-1),f.toString=Le,f},l.hsb2rgb=function(f,v,_,h){var m,y,b,k,I;return this.is(f,"object")&&"h"in f&&"s"in f&&"b"in f&&(_=f.b,v=f.s,h=f.o,f=f.h),k=(I=_*v)*(1-gt((f=(f*=360)%360/60)%2-1)),m=y=b=_-I,Wn(m+=[I,k,0,0,k,I][f=~~f],y+=[k,I,I,k,0,0][f],b+=[0,0,k,I,I,k][f],h)},l.hsl2rgb=function(f,v,_,h){var m,y,b,k,I;return this.is(f,"object")&&"h"in f&&"s"in f&&"l"in f&&(_=f.l,v=f.s,f=f.h),(f>1||v>1||_>1)&&(f/=360,v/=100,_/=100),k=(I=2*v*(_<.5?_:1-_))*(1-gt((f=(f*=360)%360/60)%2-1)),m=y=b=_-I/2,Wn(m+=[I,k,0,0,k,I][f=~~f],y+=[k,I,I,k,0,0][f],b+=[0,0,k,I,I,k][f],h)},l.rgb2hsb=function(f,v,_){var h,m;return f=(_=De(f,v,_))[0],v=_[1],_=_[2],{h:(((m=(h=dt(f,v,_))-ft(f,v,_))==0?null:h==f?(v-_)/m:h==v?(_-f)/m+2:(f-v)/m+4)+360)%6*60/360,s:m==0?0:m/h,b:h,toString:je}},l.rgb2hsl=function(f,v,_){var h,m,y,b;return f=(_=De(f,v,_))[0],v=_[1],_=_[2],h=((m=dt(f,v,_))+(y=ft(f,v,_)))/2,{h:(((b=m-y)==0?null:m==f?(v-_)/b:m==v?(_-f)/b+2:(f-v)/b+4)+360)%6*60/360,s:b==0?0:h<.5?b/(2*h):b/(2-2*h),l:h,toString:Xe}},l._path2string=function(){return this.join(",").replace(vt,"$1")},l._preload=function(f,v){var _=x.doc.createElement("img");_.style.cssText="position:absolute;left:-9999em;top:-9999em",_.onload=function(){v.call(this),this.onload=null,x.doc.body.removeChild(this)},_.onerror=function(){x.doc.body.removeChild(this)},x.doc.body.appendChild(_),_.src=f};function Re(){return this.hex}function un(f,v){for(var _=[],h=0,m=f.length;m-2*!v>h;h+=2){var y=[{x:+f[h-2],y:+f[h-1]},{x:+f[h],y:+f[h+1]},{x:+f[h+2],y:+f[h+3]},{x:+f[h+4],y:+f[h+5]}];v?h?m-4==h?y[3]={x:+f[0],y:+f[1]}:m-2==h&&(y[2]={x:+f[0],y:+f[1]},y[3]={x:+f[2],y:+f[3]}):y[0]={x:+f[m-2],y:+f[m-1]}:m-4==h?y[3]=y[2]:h||(y[0]={x:+f[h],y:+f[h+1]}),_.push(["C",(-y[0].x+6*y[1].x+y[2].x)/6,(-y[0].y+6*y[1].y+y[2].y)/6,(y[1].x+6*y[2].x-y[3].x)/6,(y[1].y+6*y[2].y-y[3].y)/6,y[2].x,y[2].y])}return _}l.getRGB=qt(function(f){if(!f||(f=F(f)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Re};if(f=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:Re};!pt[w](f.toLowerCase().substring(0,2))&&f.charAt()!="#"&&(f=Ce(f));var v,_,h,m,y,b,k=f.match(L);return k?(k[2]&&(h=j(k[2].substring(5),16),_=j(k[2].substring(3,5),16),v=j(k[2].substring(1,3),16)),k[3]&&(h=j((y=k[3].charAt(3))+y,16),_=j((y=k[3].charAt(2))+y,16),v=j((y=k[3].charAt(1))+y,16)),k[4]&&(b=k[4][G](it),v=B(b[0]),b[0].slice(-1)=="%"&&(v*=2.55),_=B(b[1]),b[1].slice(-1)=="%"&&(_*=2.55),h=B(b[2]),b[2].slice(-1)=="%"&&(h*=2.55),k[1].toLowerCase().slice(0,4)=="rgba"&&(m=B(b[3])),b[3]&&b[3].slice(-1)=="%"&&(m/=100)),k[5]?(b=k[5][G](it),v=B(b[0]),b[0].slice(-1)=="%"&&(v*=2.55),_=B(b[1]),b[1].slice(-1)=="%"&&(_*=2.55),h=B(b[2]),b[2].slice(-1)=="%"&&(h*=2.55),(b[0].slice(-3)=="deg"||b[0].slice(-1)=="°")&&(v/=360),k[1].toLowerCase().slice(0,4)=="hsba"&&(m=B(b[3])),b[3]&&b[3].slice(-1)=="%"&&(m/=100),l.hsb2rgb(v,_,h,m)):k[6]?(b=k[6][G](it),v=B(b[0]),b[0].slice(-1)=="%"&&(v*=2.55),_=B(b[1]),b[1].slice(-1)=="%"&&(_*=2.55),h=B(b[2]),b[2].slice(-1)=="%"&&(h*=2.55),(b[0].slice(-3)=="deg"||b[0].slice(-1)=="°")&&(v/=360),k[1].toLowerCase().slice(0,4)=="hsla"&&(m=B(b[3])),b[3]&&b[3].slice(-1)=="%"&&(m/=100),l.hsl2rgb(v,_,h,m)):((k={r:v,g:_,b:h,toString:Re}).hex="#"+(16777216|h|_<<8|v<<16).toString(16).slice(1),l.is(m,"finite")&&(k.opacity=m),k)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Re}},l),l.hsb=qt(function(f,v,_){return l.hsb2rgb(f,v,_).hex}),l.hsl=qt(function(f,v,_){return l.hsl2rgb(f,v,_).hex}),l.rgb=qt(function(f,v,_){function h(m){return m+.5|0}return"#"+(16777216|h(_)|h(v)<<8|h(f)<<16).toString(16).slice(1)}),l.getColor=function(f){var v=this.getColor.start=this.getColor.start||{h:0,s:1,b:f||.75},_=this.hsb2rgb(v.h,v.s,v.b);return v.h+=.075,v.h>1&&(v.h=0,v.s-=.2,v.s<=0&&(this.getColor.start={h:0,s:1,b:v.b})),_.hex},l.getColor.reset=function(){delete this.start},l.parsePathString=function(f){if(!f)return null;var v=ae(f);if(v.arr)return Qt(v.arr);var _={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},h=[];return l.is(f,st)&&l.is(f[0],st)&&(h=Qt(f)),h.length||F(f).replace(wt,function(m,y,b){var k=[],I=y.toLowerCase();if(b.replace(xt,function(N,q){q&&k.push(+q)}),I=="m"&&k.length>2&&(h.push([y][M](k.splice(0,2))),I="l",y=y=="m"?"l":"L"),I=="r")h.push([y][M](k));else for(;k.length>=_[I]&&(h.push([y][M](k.splice(0,_[I]))),_[I]););}),h.toString=l._path2string,v.arr=Qt(h),h},l.parseTransformString=qt(function(f){if(!f)return null;var v=[];return l.is(f,st)&&l.is(f[0],st)&&(v=Qt(f)),v.length||F(f).replace(At,function(_,h,m){var y=[];X.call(h),m.replace(xt,function(b,k){k&&y.push(+k)}),v.push([h][M](y))}),v.toString=l._path2string,v},this,function(f){if(!f)return f;for(var v=[],_=0;_<f.length;_++){for(var h=[],m=0;m<f[_].length;m++)h.push(f[_][m]);v.push(h)}return v});var ae=function(f){var v=ae.ps=ae.ps||{};return v[f]?v[f].sleep=100:v[f]={sleep:100},setTimeout(function(){for(var _ in v)v[w](_)&&_!=f&&(v[_].sleep--,!v[_].sleep&&delete v[_])}),v[f]};function Te(f,v,_,h,m){return f*(f*(-3*v+9*_-9*h+3*m)+6*v-12*_+6*h)-3*v+3*_}function de(f,v,_,h,m,y,b,k,I){I==null&&(I=1);for(var N=(I=I>1?1:I<0?0:I)/2,q=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],Q=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],W=0,Z=0;Z<12;Z++){var nt=N*q[Z]+N,at=Te(nt,f,_,m,b),rt=Te(nt,v,h,y,k),K=at*at+rt*rt;W+=Q[Z]*J.sqrt(K)}return N*W}function Pn(f,v,_,h,m,y,b,k){if(!(dt(f,_)<ft(m,b)||ft(f,_)>dt(m,b)||dt(v,h)<ft(y,k)||ft(v,h)>dt(y,k))){var I=(f-_)*(y-k)-(v-h)*(m-b);if(I){var N=((f*h-v*_)*(m-b)-(f-_)*(m*k-y*b))/I,q=((f*h-v*_)*(y-k)-(v-h)*(m*k-y*b))/I,Q=+N.toFixed(2),W=+q.toFixed(2);if(!(Q<+ft(f,_).toFixed(2)||Q>+dt(f,_).toFixed(2)||Q<+ft(m,b).toFixed(2)||Q>+dt(m,b).toFixed(2)||W<+ft(v,h).toFixed(2)||W>+dt(v,h).toFixed(2)||W<+ft(y,k).toFixed(2)||W>+dt(y,k).toFixed(2)))return{x:N,y:q}}}}function Ye(f,v,_){var h=l.bezierBBox(f),m=l.bezierBBox(v);if(!l.isBBoxIntersect(h,m))return _?0:[];for(var y=de.apply(0,f),b=de.apply(0,v),k=dt(~~(y/5),1),I=dt(~~(b/5),1),N=[],q=[],Q={},W=_?0:[],Z=0;Z<k+1;Z++){var nt=l.findDotsAtSegment.apply(l,f.concat(Z/k));N.push({x:nt.x,y:nt.y,t:Z/k})}for(Z=0;Z<I+1;Z++)nt=l.findDotsAtSegment.apply(l,v.concat(Z/I)),q.push({x:nt.x,y:nt.y,t:Z/I});for(Z=0;Z<k;Z++)for(var at=0;at<I;at++){var rt=N[Z],K=N[Z+1],mt=q[at],ot=q[at+1],ut=gt(K.x-rt.x)<.001?"y":"x",lt=gt(ot.x-mt.x)<.001?"y":"x",Ct=Pn(rt.x,rt.y,K.x,K.y,mt.x,mt.y,ot.x,ot.y);if(Ct){if(Q[Ct.x.toFixed(4)]==Ct.y.toFixed(4))continue;Q[Ct.x.toFixed(4)]=Ct.y.toFixed(4);var yt=rt.t+gt((Ct[ut]-rt[ut])/(K[ut]-rt[ut]))*(K.t-rt.t),Tt=mt.t+gt((Ct[lt]-mt[lt])/(ot[lt]-mt[lt]))*(ot.t-mt.t);yt>=0&&yt<=1.001&&Tt>=0&&Tt<=1.001&&(_?W++:W.push({x:Ct.x,y:Ct.y,t1:ft(yt,1),t2:ft(Tt,1)}))}}return W}function dn(f,v,_){f=l._path2curve(f),v=l._path2curve(v);for(var h,m,y,b,k,I,N,q,Q,W,Z=_?0:[],nt=0,at=f.length;nt<at;nt++){var rt=f[nt];if(rt[0]=="M")h=k=rt[1],m=I=rt[2];else{rt[0]=="C"?(Q=[h,m].concat(rt.slice(1)),h=Q[6],m=Q[7]):(Q=[h,m,h,m,k,I,k,I],h=k,m=I);for(var K=0,mt=v.length;K<mt;K++){var ot=v[K];if(ot[0]=="M")y=N=ot[1],b=q=ot[2];else{ot[0]=="C"?(W=[y,b].concat(ot.slice(1)),y=W[6],b=W[7]):(W=[y,b,y,b,N,q,N,q],y=N,b=q);var ut=Ye(Q,W,_);if(_)Z+=ut;else{for(var lt=0,Ct=ut.length;lt<Ct;lt++)ut[lt].segment1=nt,ut[lt].segment2=K,ut[lt].bez1=Q,ut[lt].bez2=W;Z=Z.concat(ut)}}}}}return Z}l.findDotsAtSegment=function(f,v,_,h,m,y,b,k,I){var N=1-I,q=Et(N,3),Q=Et(N,2),W=I*I,Z=W*I,nt=q*f+3*Q*I*_+3*N*I*I*m+Z*b,at=q*v+3*Q*I*h+3*N*I*I*y+Z*k,rt=f+2*I*(_-f)+W*(m-2*_+f),K=v+2*I*(h-v)+W*(y-2*h+v),mt=_+2*I*(m-_)+W*(b-2*m+_),ot=h+2*I*(y-h)+W*(k-2*y+h),ut=N*f+I*_,lt=N*v+I*h,Ct=N*m+I*b,yt=N*y+I*k,Tt=90-180*J.atan2(rt-mt,K-ot)/kt;return(rt>mt||K<ot)&&(Tt+=180),{x:nt,y:at,m:{x:rt,y:K},n:{x:mt,y:ot},start:{x:ut,y:lt},end:{x:Ct,y:yt},alpha:Tt}},l.bezierBBox=function(f,v,_,h,m,y,b,k){l.is(f,"array")||(f=[f,v,_,h,m,y,b,k]);var I=Ze.apply(null,f);return{x:I.min.x,y:I.min.y,x2:I.max.x,y2:I.max.y,width:I.max.x-I.min.x,height:I.max.y-I.min.y}},l.isPointInsideBBox=function(f,v,_){return v>=f.x&&v<=f.x2&&_>=f.y&&_<=f.y2},l.isBBoxIntersect=function(f,v){var _=l.isPointInsideBBox;return _(v,f.x,f.y)||_(v,f.x2,f.y)||_(v,f.x,f.y2)||_(v,f.x2,f.y2)||_(f,v.x,v.y)||_(f,v.x2,v.y)||_(f,v.x,v.y2)||_(f,v.x2,v.y2)||(f.x<v.x2&&f.x>v.x||v.x<f.x2&&v.x>f.x)&&(f.y<v.y2&&f.y>v.y||v.y<f.y2&&v.y>f.y)},l.pathIntersection=function(f,v){return dn(f,v)},l.pathIntersectionNumber=function(f,v){return dn(f,v,1)},l.isPointInsidePath=function(f,v,_){var h=l.pathBBox(f);return l.isPointInsideBBox(h,v,_)&&dn(f,[["M",v,_],["H",h.x2+10]],1)%2==1},l._removedFactory=function(f){return function(){o("raphael.log",null,"Raphaël: you are calling to method “"+f+"” of removed object",f)}};var ye=l.pathBBox=function(f){var v=ae(f);if(v.bbox)return Wt(v.bbox);if(!f)return{x:0,y:0,width:0,height:0,x2:0,y2:0};for(var _,h=0,m=0,y=[],b=[],k=0,I=(f=In(f)).length;k<I;k++)if((_=f[k])[0]=="M")h=_[1],m=_[2],y.push(h),b.push(m);else{var N=Ze(h,m,_[1],_[2],_[3],_[4],_[5],_[6]);y=y[M](N.min.x,N.max.x),b=b[M](N.min.y,N.max.y),h=_[5],m=_[6]}var q=ft[P](0,y),Q=ft[P](0,b),W=dt[P](0,y),Z=dt[P](0,b),nt=W-q,at=Z-Q,rt={x:q,y:Q,x2:W,y2:Z,width:nt,height:at,cx:q+nt/2,cy:Q+at/2};return v.bbox=Wt(rt),rt},Qt=function(f){var v=Wt(f);return v.toString=l._path2string,v},Er=l._pathToRelative=function(f){var v=ae(f);if(v.rel)return Qt(v.rel);l.is(f,st)&&l.is(f&&f[0],st)||(f=l.parsePathString(f));var _=[],h=0,m=0,y=0,b=0,k=0;f[0][0]=="M"&&(y=h=f[0][1],b=m=f[0][2],k++,_.push(["M",h,m]));for(var I=k,N=f.length;I<N;I++){var q=_[I]=[],Q=f[I];if(Q[0]!=X.call(Q[0]))switch(q[0]=X.call(Q[0]),q[0]){case"a":q[1]=Q[1],q[2]=Q[2],q[3]=Q[3],q[4]=Q[4],q[5]=Q[5],q[6]=+(Q[6]-h).toFixed(3),q[7]=+(Q[7]-m).toFixed(3);break;case"v":q[1]=+(Q[1]-m).toFixed(3);break;case"m":y=Q[1],b=Q[2];default:for(var W=1,Z=Q.length;W<Z;W++)q[W]=+(Q[W]-(W%2?h:m)).toFixed(3)}else{q=_[I]=[],Q[0]=="m"&&(y=Q[1]+h,b=Q[2]+m);for(var nt=0,at=Q.length;nt<at;nt++)_[I][nt]=Q[nt]}var rt=_[I].length;switch(_[I][0]){case"z":h=y,m=b;break;case"h":h+=+_[I][rt-1];break;case"v":m+=+_[I][rt-1];break;default:h+=+_[I][rt-2],m+=+_[I][rt-1]}}return _.toString=l._path2string,v.rel=Qt(_),_},pn=l._pathToAbsolute=function(f){var v=ae(f);if(v.abs)return Qt(v.abs);if(l.is(f,st)&&l.is(f&&f[0],st)||(f=l.parsePathString(f)),!f||!f.length)return[["M",0,0]];var _=[],h=0,m=0,y=0,b=0,k=0;f[0][0]=="M"&&(y=h=+f[0][1],b=m=+f[0][2],k++,_[0]=["M",h,m]);for(var I,N,q=f.length==3&&f[0][0]=="M"&&f[1][0].toUpperCase()=="R"&&f[2][0].toUpperCase()=="Z",Q=k,W=f.length;Q<W;Q++){if(_.push(I=[]),(N=f[Q])[0]!=V.call(N[0]))switch(I[0]=V.call(N[0]),I[0]){case"A":I[1]=N[1],I[2]=N[2],I[3]=N[3],I[4]=N[4],I[5]=N[5],I[6]=+(N[6]+h),I[7]=+(N[7]+m);break;case"V":I[1]=+N[1]+m;break;case"H":I[1]=+N[1]+h;break;case"R":for(var Z=[h,m][M](N.slice(1)),nt=2,at=Z.length;nt<at;nt++)Z[nt]=+Z[nt]+h,Z[++nt]=+Z[nt]+m;_.pop(),_=_[M](un(Z,q));break;case"M":y=+N[1]+h,b=+N[2]+m;default:for(nt=1,at=N.length;nt<at;nt++)I[nt]=+N[nt]+(nt%2?h:m)}else if(N[0]=="R")Z=[h,m][M](N.slice(1)),_.pop(),_=_[M](un(Z,q)),I=["R"][M](N.slice(-2));else for(var rt=0,K=N.length;rt<K;rt++)I[rt]=N[rt];switch(I[0]){case"Z":h=y,m=b;break;case"H":h=I[1];break;case"V":m=I[1];break;case"M":y=I[I.length-2],b=I[I.length-1];default:h=I[I.length-2],m=I[I.length-1]}}return _.toString=l._path2string,v.abs=Qt(_),_},$e=function(f,v,_,h){return[f,v,_,h,_,h]},Oe=function(f,v,_,h,m,y){return[1/3*f+2/3*_,1/3*v+2/3*h,1/3*m+2/3*_,1/3*y+2/3*h,m,y]},Jn=function(f,v,_,h,m,y,b,k,I,N){var q,Q=120*kt/180,W=kt/180*(+m||0),Z=[],nt=qt(function(fc,uc,Ur){return{x:fc*J.cos(Ur)-uc*J.sin(Ur),y:fc*J.sin(Ur)+uc*J.cos(Ur)}});if(N)yt=N[0],Tt=N[1],lt=N[2],Ct=N[3];else{f=(q=nt(f,v,-W)).x,v=q.y,k=(q=nt(k,I,-W)).x,I=q.y;var at=(f-k)/2,rt=(v-I)/2,K=at*at/(_*_)+rt*rt/(h*h);K>1&&(_*=K=J.sqrt(K),h*=K);var mt=_*_,ot=h*h,ut=(y==b?-1:1)*J.sqrt(gt((mt*ot-mt*rt*rt-ot*at*at)/(mt*rt*rt+ot*at*at))),lt=ut*_*rt/h+(f+k)/2,Ct=ut*-h*at/_+(v+I)/2,yt=J.asin(((v-Ct)/h).toFixed(9)),Tt=J.asin(((I-Ct)/h).toFixed(9));(yt=f<lt?kt-yt:yt)<0&&(yt=2*kt+yt),(Tt=k<lt?kt-Tt:Tt)<0&&(Tt=2*kt+Tt),b&&yt>Tt&&(yt-=2*kt),!b&&Tt>yt&&(Tt-=2*kt)}var si=Tt-yt;if(gt(si)>Q){var Hi=Tt,ce=k,Ue=I;Tt=yt+Q*(b&&Tt>yt?1:-1),k=lt+_*J.cos(Tt),I=Ct+h*J.sin(Tt),Z=Jn(k,I,_,h,m,0,b,ce,Ue,[Tt,Hi,lt,Ct])}si=Tt-yt;var ai=J.cos(yt),oi=J.sin(yt),Or=J.cos(Tt),en=J.sin(Tt),Rn=J.tan(si/4),Fr=4/3*_*Rn,ac=4/3*h*Rn,oc=[f,v],li=[f+Fr*oi,v-ac*ai],lc=[k+Fr*en,I-ac*Or],cc=[k,I];if(li[0]=2*oc[0]-li[0],li[1]=2*oc[1]-li[1],N)return[li,lc,cc][M](Z);for(var hc=[],_n=0,a1=(Z=[li,lc,cc][M](Z).join()[G](",")).length;_n<a1;_n++)hc[_n]=_n%2?nt(Z[_n-1],Z[_n],W).y:nt(Z[_n],Z[_n+1],W).x;return hc},qe=function(f,v,_,h,m,y,b,k,I){var N=1-I;return{x:Et(N,3)*f+3*Et(N,2)*I*_+3*N*I*I*m+Et(I,3)*b,y:Et(N,3)*v+3*Et(N,2)*I*h+3*N*I*I*y+Et(I,3)*k}},Ze=qt(function(f,v,_,h,m,y,b,k){var I,N=m-2*_+f-(b-2*m+_),q=2*(_-f)-2*(m-_),Q=f-_,W=(-q+J.sqrt(q*q-4*N*Q))/2/N,Z=(-q-J.sqrt(q*q-4*N*Q))/2/N,nt=[v,k],at=[f,b];return gt(W)>"1e12"&&(W=.5),gt(Z)>"1e12"&&(Z=.5),W>0&&W<1&&(I=qe(f,v,_,h,m,y,b,k,W),at.push(I.x),nt.push(I.y)),Z>0&&Z<1&&(I=qe(f,v,_,h,m,y,b,k,Z),at.push(I.x),nt.push(I.y)),N=y-2*h+v-(k-2*y+h),Q=v-h,W=(-(q=2*(h-v)-2*(y-h))+J.sqrt(q*q-4*N*Q))/2/N,Z=(-q-J.sqrt(q*q-4*N*Q))/2/N,gt(W)>"1e12"&&(W=.5),gt(Z)>"1e12"&&(Z=.5),W>0&&W<1&&(I=qe(f,v,_,h,m,y,b,k,W),at.push(I.x),nt.push(I.y)),Z>0&&Z<1&&(I=qe(f,v,_,h,m,y,b,k,Z),at.push(I.x),nt.push(I.y)),{min:{x:ft[P](0,at),y:ft[P](0,nt)},max:{x:dt[P](0,at),y:dt[P](0,nt)}}}),In=l._path2curve=qt(function(f,v){var _=!v&&ae(f);if(!v&&_.curve)return Qt(_.curve);for(var h=pn(f),m=v&&pn(v),y={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},b={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},k=function(ut,lt,Ct){var yt,Tt;if(!ut)return["C",lt.x,lt.y,lt.x,lt.y,lt.x,lt.y];switch(!(ut[0]in{T:1,Q:1})&&(lt.qx=lt.qy=null),ut[0]){case"M":lt.X=ut[1],lt.Y=ut[2];break;case"A":ut=["C"][M](Jn[P](0,[lt.x,lt.y][M](ut.slice(1))));break;case"S":Ct=="C"||Ct=="S"?(yt=2*lt.x-lt.bx,Tt=2*lt.y-lt.by):(yt=lt.x,Tt=lt.y),ut=["C",yt,Tt][M](ut.slice(1));break;case"T":Ct=="Q"||Ct=="T"?(lt.qx=2*lt.x-lt.qx,lt.qy=2*lt.y-lt.qy):(lt.qx=lt.x,lt.qy=lt.y),ut=["C"][M](Oe(lt.x,lt.y,lt.qx,lt.qy,ut[1],ut[2]));break;case"Q":lt.qx=ut[1],lt.qy=ut[2],ut=["C"][M](Oe(lt.x,lt.y,ut[1],ut[2],ut[3],ut[4]));break;case"L":ut=["C"][M]($e(lt.x,lt.y,ut[1],ut[2]));break;case"H":ut=["C"][M]($e(lt.x,lt.y,ut[1],lt.y));break;case"V":ut=["C"][M]($e(lt.x,lt.y,lt.x,ut[1]));break;case"Z":ut=["C"][M]($e(lt.x,lt.y,lt.X,lt.Y))}return ut},I=function(ut,lt){if(ut[lt].length>7){ut[lt].shift();for(var Ct=ut[lt];Ct.length;)q[lt]="A",m&&(Q[lt]="A"),ut.splice(lt++,0,["C"][M](Ct.splice(0,6)));ut.splice(lt,1),at=dt(h.length,m&&m.length||0)}},N=function(ut,lt,Ct,yt,Tt){ut&&lt&&ut[Tt][0]=="M"&&lt[Tt][0]!="M"&&(lt.splice(Tt,0,["M",yt.x,yt.y]),Ct.bx=0,Ct.by=0,Ct.x=ut[Tt][1],Ct.y=ut[Tt][2],at=dt(h.length,m&&m.length||0))},q=[],Q=[],W="",Z="",nt=0,at=dt(h.length,m&&m.length||0);nt<at;nt++){h[nt]&&(W=h[nt][0]),W!="C"&&(q[nt]=W,nt&&(Z=q[nt-1])),h[nt]=k(h[nt],y,Z),q[nt]!="A"&&W=="C"&&(q[nt]="C"),I(h,nt),m&&(m[nt]&&(W=m[nt][0]),W!="C"&&(Q[nt]=W,nt&&(Z=Q[nt-1])),m[nt]=k(m[nt],b,Z),Q[nt]!="A"&&W=="C"&&(Q[nt]="C"),I(m,nt)),N(h,m,y,b,nt),N(m,h,b,y,nt);var rt=h[nt],K=m&&m[nt],mt=rt.length,ot=m&&K.length;y.x=rt[mt-2],y.y=rt[mt-1],y.bx=B(rt[mt-4])||y.x,y.by=B(rt[mt-3])||y.y,b.bx=m&&(B(K[ot-4])||b.x),b.by=m&&(B(K[ot-3])||b.y),b.x=m&&K[ot-2],b.y=m&&K[ot-1]}return m||(_.curve=Qt(h)),m?[h,m]:h},null,Qt),Kn=(l._parseDots=qt(function(f){for(var v=[],_=0,h=f.length;_<h;_++){var m={},y=f[_].match(/^([^:]*):?([\d\.]*)/);if(m.color=l.getRGB(y[1]),m.color.error)return null;m.opacity=m.color.opacity,m.color=m.color.hex,y[2]&&(m.offset=y[2]+"%"),v.push(m)}for(_=1,h=v.length-1;_<h;_++)if(!v[_].offset){for(var b=B(v[_-1].offset||0),k=0,I=_+1;I<h;I++)if(v[I].offset){k=v[I].offset;break}k||(k=100,I=h);for(var N=((k=B(k))-b)/(I-_+1);_<I;_++)b+=N,v[_].offset=b+"%"}return v}),l._tear=function(f,v){f==v.top&&(v.top=f.prev),f==v.bottom&&(v.bottom=f.next),f.next&&(f.next.prev=f.prev),f.prev&&(f.prev.next=f.next)}),kr=(l._tofront=function(f,v){v.top!==f&&(Kn(f,v),f.next=null,f.prev=v.top,v.top.next=f,v.top=f)},l._toback=function(f,v){v.bottom!==f&&(Kn(f,v),f.next=v.bottom,f.prev=null,v.bottom.prev=f,v.bottom=f)},l._insertafter=function(f,v,_){Kn(f,_),v==_.top&&(_.top=f),v.next&&(v.next.prev=f),f.next=v.next,f.prev=v,v.next=f},l._insertbefore=function(f,v,_){Kn(f,_),v==_.bottom&&(_.bottom=f),v.prev&&(v.prev.next=f),f.prev=v.prev,v.prev=f,f.next=v},l.toMatrix=function(f,v){var _=ye(f),h={_:{transform:U},getBBox:function(){return _}};return Qn(h,v),h.matrix}),Qn=(l.transformPath=function(f,v){return jt(f,kr(f,v))},l._extractTransform=function(f,v){if(v==null)return f._.transform;v=F(v).replace(/\.{3}|\u2026/g,f._.transform||U);var _,h,m=l.parseTransformString(v),y=0,b=1,k=1,I=f._,N=new We;if(I.transform=m||[],m)for(var q=0,Q=m.length;q<Q;q++){var W,Z,nt,at,rt,K=m[q],mt=K.length,ot=F(K[0]).toLowerCase(),ut=K[0]!=ot,lt=ut?N.invert():0;ot=="t"&&mt==3?ut?(W=lt.x(0,0),Z=lt.y(0,0),nt=lt.x(K[1],K[2]),at=lt.y(K[1],K[2]),N.translate(nt-W,at-Z)):N.translate(K[1],K[2]):ot=="r"?mt==2?(rt=rt||f.getBBox(1),N.rotate(K[1],rt.x+rt.width/2,rt.y+rt.height/2),y+=K[1]):mt==4&&(ut?(nt=lt.x(K[2],K[3]),at=lt.y(K[2],K[3]),N.rotate(K[1],nt,at)):N.rotate(K[1],K[2],K[3]),y+=K[1]):ot=="s"?mt==2||mt==3?(rt=rt||f.getBBox(1),N.scale(K[1],K[mt-1],rt.x+rt.width/2,rt.y+rt.height/2),b*=K[1],k*=K[mt-1]):mt==5&&(ut?(nt=lt.x(K[3],K[4]),at=lt.y(K[3],K[4]),N.scale(K[1],K[2],nt,at)):N.scale(K[1],K[2],K[3],K[4]),b*=K[1],k*=K[2]):ot=="m"&&mt==7&&N.add(K[1],K[2],K[3],K[4],K[5],K[6]),I.dirtyT=1,f.matrix=N}f.matrix=N,I.sx=b,I.sy=k,I.deg=y,I.dx=_=N.e,I.dy=h=N.f,b==1&&k==1&&!y&&I.bbox?(I.bbox.x+=+_,I.bbox.y+=+h):I.dirtyT=1}),Ar=function(f){var v=f[0];switch(v.toLowerCase()){case"t":return[v,0,0];case"m":return[v,1,0,0,1,0,0];case"r":return f.length==4?[v,0,f[2],f[3]]:[v,0];case"s":return f.length==5?[v,1,1,f[3],f[4]]:f.length==3?[v,1,1]:[v,1]}},Pr=l._equaliseTransform=function(f,v){v=F(v).replace(/\.{3}|\u2026/g,f),f=l.parseTransformString(f)||[],v=l.parseTransformString(v)||[];for(var _,h,m,y,b=dt(f.length,v.length),k=[],I=[],N=0;N<b;N++){if(m=f[N]||Ar(v[N]),y=v[N]||Ar(m),m[0]!=y[0]||m[0].toLowerCase()=="r"&&(m[2]!=y[2]||m[3]!=y[3])||m[0].toLowerCase()=="s"&&(m[3]!=y[3]||m[4]!=y[4]))return;for(k[N]=[],I[N]=[],_=0,h=dt(m.length,y.length);_<h;_++)_ in m&&(k[N][_]=m[_]),_ in y&&(I[N][_]=y[_])}return{from:k,to:I}};function We(f,v,_,h,m,y){f!=null?(this.a=+f,this.b=+v,this.c=+_,this.d=+h,this.e=+m,this.f=+y):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}l._getContainer=function(f,v,_,h){var m;if((m=h!=null||l.is(f,"object")?f:x.doc.getElementById(f))!=null)return m.tagName?v==null?{container:m,width:m.style.pixelWidth||m.offsetWidth,height:m.style.pixelHeight||m.offsetHeight}:{container:m,width:v,height:_}:{container:1,x:f,y:v,width:_,height:h}},l.pathToRelative=Er,l._engine={},l.path2curve=In,l.matrix=function(f,v,_,h,m,y){return new We(f,v,_,h,m,y)},function(f){function v(h){return h[0]*h[0]+h[1]*h[1]}function _(h){var m=J.sqrt(v(h));h[0]&&(h[0]/=m),h[1]&&(h[1]/=m)}f.add=function(h,m,y,b,k,I){var N,q,Q,W,Z=[[],[],[]],nt=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],at=[[h,y,k],[m,b,I],[0,0,1]];for(h&&h instanceof We&&(at=[[h.a,h.c,h.e],[h.b,h.d,h.f],[0,0,1]]),N=0;N<3;N++)for(q=0;q<3;q++){for(W=0,Q=0;Q<3;Q++)W+=nt[N][Q]*at[Q][q];Z[N][q]=W}this.a=Z[0][0],this.b=Z[1][0],this.c=Z[0][1],this.d=Z[1][1],this.e=Z[0][2],this.f=Z[1][2]},f.invert=function(){var h=this,m=h.a*h.d-h.b*h.c;return new We(h.d/m,-h.b/m,-h.c/m,h.a/m,(h.c*h.f-h.d*h.e)/m,(h.b*h.e-h.a*h.f)/m)},f.clone=function(){return new We(this.a,this.b,this.c,this.d,this.e,this.f)},f.translate=function(h,m){this.add(1,0,0,1,h,m)},f.scale=function(h,m,y,b){m==null&&(m=h),(y||b)&&this.add(1,0,0,1,y,b),this.add(h,0,0,m,0,0),(y||b)&&this.add(1,0,0,1,-y,-b)},f.rotate=function(h,m,y){h=l.rad(h),m=m||0,y=y||0;var b=+J.cos(h).toFixed(9),k=+J.sin(h).toFixed(9);this.add(b,k,-k,b,m,y),this.add(1,0,0,1,-m,-y)},f.x=function(h,m){return h*this.a+m*this.c+this.e},f.y=function(h,m){return h*this.b+m*this.d+this.f},f.get=function(h){return+this[F.fromCharCode(97+h)].toFixed(4)},f.toString=function(){return l.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},f.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},f.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},f.split=function(){var h={};h.dx=this.e,h.dy=this.f;var m=[[this.a,this.c],[this.b,this.d]];h.scalex=J.sqrt(v(m[0])),_(m[0]),h.shear=m[0][0]*m[1][0]+m[0][1]*m[1][1],m[1]=[m[1][0]-m[0][0]*h.shear,m[1][1]-m[0][1]*h.shear],h.scaley=J.sqrt(v(m[1])),_(m[1]),h.shear/=h.scaley;var y=-m[0][1],b=m[1][1];return b<0?(h.rotate=l.deg(J.acos(b)),y<0&&(h.rotate=360-h.rotate)):h.rotate=l.deg(J.asin(y)),h.isSimple=!(+h.shear.toFixed(9)||h.scalex.toFixed(9)!=h.scaley.toFixed(9)&&h.rotate),h.isSuperSimple=!+h.shear.toFixed(9)&&h.scalex.toFixed(9)==h.scaley.toFixed(9)&&!h.rotate,h.noRotation=!+h.shear.toFixed(9)&&!h.rotate,h},f.toTransformString=function(h){var m=h||this[G]();return m.isSimple?(m.scalex=+m.scalex.toFixed(4),m.scaley=+m.scaley.toFixed(4),m.rotate=+m.rotate.toFixed(4),(m.dx||m.dy?"t"+[m.dx,m.dy]:U)+(m.scalex!=1||m.scaley!=1?"s"+[m.scalex,m.scaley,0,0]:U)+(m.rotate?"r"+[m.rotate,0,0]:U)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(We.prototype);for(var Ir=function(){this.returnValue=!1},Mr=function(){return this.originalEvent.preventDefault()},Lr=function(){this.cancelBubble=!0},Dr=function(){return this.originalEvent.stopPropagation()},ti=function(f){var v=x.doc.documentElement.scrollTop||x.doc.body.scrollTop,_=x.doc.documentElement.scrollLeft||x.doc.body.scrollLeft;return{x:f.clientX+_,y:f.clientY+v}},Je=x.doc.addEventListener?function(f,v,_,h){var m=function(b){var k=ti(b);return _.call(h,b,k.x,k.y)};if(f.addEventListener(v,m,!1),D&&$[v]){var y=function(b){for(var k=ti(b),I=b,N=0,q=b.targetTouches&&b.targetTouches.length;N<q;N++)if(b.targetTouches[N].target==f){(b=b.targetTouches[N]).originalEvent=I,b.preventDefault=Mr,b.stopPropagation=Dr;break}return _.call(h,b,k.x,k.y)};f.addEventListener($[v],y,!1)}return function(){return f.removeEventListener(v,m,!1),D&&$[v]&&f.removeEventListener($[v],y,!1),!0}}:x.doc.attachEvent?function(f,v,_,h){var m=function(y){y=y||x.win.event;var b=x.doc.documentElement.scrollTop||x.doc.body.scrollTop,k=x.doc.documentElement.scrollLeft||x.doc.body.scrollLeft,I=y.clientX+k,N=y.clientY+b;return y.preventDefault=y.preventDefault||Ir,y.stopPropagation=y.stopPropagation||Lr,_.call(h,y,I,N)};return f.attachEvent("on"+v,m),function(){return f.detachEvent("on"+v,m),!0}}:void 0,oe=[],Ke=function(f){for(var v,_=f.clientX,h=f.clientY,m=x.doc.documentElement.scrollTop||x.doc.body.scrollTop,y=x.doc.documentElement.scrollLeft||x.doc.body.scrollLeft,b=oe.length;b--;){if(v=oe[b],D&&f.touches){for(var k,I=f.touches.length;I--;)if((k=f.touches[I]).identifier==v.el._drag.id){_=k.clientX,h=k.clientY,(f.originalEvent?f.originalEvent:f).preventDefault();break}}else f.preventDefault();var N,q=v.el.node,Q=q.nextSibling,W=q.parentNode,Z=q.style.display;x.win.opera&&W.removeChild(q),q.style.display="none",N=v.el.paper.getElementByPoint(_,h),q.style.display=Z,x.win.opera&&(Q?W.insertBefore(q,Q):W.appendChild(q)),N&&o("raphael.drag.over."+v.el.id,v.el,N),_+=y,h+=m,o("raphael.drag.move."+v.el.id,v.move_scope||v.el,_-v.el._drag.x,h-v.el._drag.y,_,h,f)}},gn=function(f){l.unmousemove(Ke).unmouseup(gn);for(var v,_=oe.length;_--;)(v=oe[_]).el._drag={},o("raphael.drag.end."+v.el.id,v.end_scope||v.start_scope||v.move_scope||v.el,f);oe=[]},Ot=l.el={},Rr=H.length;Rr--;)(function(f){l[f]=Ot[f]=function(v,_){return l.is(v,"function")&&(this.events=this.events||[],this.events.push({name:f,f:v,unbind:Je(this.shape||this.node||x.doc,f,v,_||this)})),this},l["un"+f]=Ot["un"+f]=function(v){for(var _=this.events||[],h=_.length;h--;)_[h].name!=f||!l.is(v,"undefined")&&_[h].f!=v||(_[h].unbind(),_.splice(h,1),!_.length&&delete this.events);return this}})(H[Rr]);Ot.data=function(f,v){var _=It[this.id]=It[this.id]||{};if(arguments.length==0)return _;if(arguments.length==1){if(l.is(f,"object")){for(var h in f)f[w](h)&&this.data(h,f[h]);return this}return o("raphael.data.get."+this.id,this,_[f],f),_[f]}return _[f]=v,o("raphael.data.set."+this.id,this,v,f),this},Ot.removeData=function(f){return f==null?delete It[this.id]:It[this.id]&&delete It[this.id][f],this},Ot.getData=function(){return Wt(It[this.id]||{})},Ot.hover=function(f,v,_,h){return this.mouseover(f,_).mouseout(v,h||_)},Ot.unhover=function(f,v){return this.unmouseover(f).unmouseout(v)};var mn=[];Ot.drag=function(f,v,_,h,m,y){function b(k){(k.originalEvent||k).preventDefault();var I=k.clientX,N=k.clientY,q=x.doc.documentElement.scrollTop||x.doc.body.scrollTop,Q=x.doc.documentElement.scrollLeft||x.doc.body.scrollLeft;if(this._drag.id=k.identifier,D&&k.touches){for(var W,Z=k.touches.length;Z--;)if(W=k.touches[Z],this._drag.id=W.identifier,W.identifier==this._drag.id){I=W.clientX,N=W.clientY;break}}this._drag.x=I+Q,this._drag.y=N+q,!oe.length&&l.mousemove(Ke).mouseup(gn),oe.push({el:this,move_scope:h,start_scope:m,end_scope:y}),v&&o.on("raphael.drag.start."+this.id,v),f&&o.on("raphael.drag.move."+this.id,f),_&&o.on("raphael.drag.end."+this.id,_),o("raphael.drag.start."+this.id,m||h||this,this._drag.x,this._drag.y,k)}return this._drag={},mn.push({el:this,start:b}),this.mousedown(b),this},Ot.onDragOver=function(f){f?o.on("raphael.drag.over."+this.id,f):o.unbind("raphael.drag.over."+this.id)},Ot.undrag=function(){for(var f=mn.length;f--;)mn[f].el==this&&(this.unmousedown(mn[f].start),mn.splice(f,1),o.unbind("raphael.drag.*."+this.id));!mn.length&&l.unmousemove(Ke).unmouseup(gn),oe=[]},u.circle=function(f,v,_){var h=l._engine.circle(this,f||0,v||0,_||0);return this.__set__&&this.__set__.push(h),h},u.rect=function(f,v,_,h,m){var y=l._engine.rect(this,f||0,v||0,_||0,h||0,m||0);return this.__set__&&this.__set__.push(y),y},u.ellipse=function(f,v,_,h){var m=l._engine.ellipse(this,f||0,v||0,_||0,h||0);return this.__set__&&this.__set__.push(m),m},u.path=function(f){f&&!l.is(f,"string")&&!l.is(f[0],st)&&(f+=U);var v=l._engine.path(l.format[P](l,arguments),this);return this.__set__&&this.__set__.push(v),v},u.image=function(f,v,_,h,m){var y=l._engine.image(this,f||"about:blank",v||0,_||0,h||0,m||0);return this.__set__&&this.__set__.push(y),y},u.text=function(f,v,_){var h=l._engine.text(this,f||0,v||0,F(_));return this.__set__&&this.__set__.push(h),h},u.set=function(f){!l.is(f,"array")&&(f=Array.prototype.splice.call(arguments,0,arguments.length));var v=new Ln(f);return this.__set__&&this.__set__.push(v),v.paper=this,v.type="set",v},u.setStart=function(f){this.__set__=f||this.set()},u.setFinish=function(f){var v=this.__set__;return delete this.__set__,v},u.getSize=function(){var f=this.canvas.parentNode;return{width:f.offsetWidth,height:f.offsetHeight}},u.setSize=function(f,v){return l._engine.setSize.call(this,f,v)},u.setViewBox=function(f,v,_,h,m){return l._engine.setViewBox.call(this,f,v,_,h,m)},u.top=u.bottom=null,u.raphael=l;function Mn(){return this.x+z+this.y+z+this.width+" × "+this.height}u.getElementByPoint=function(f,v){var _,h,m,y,b,k,I,N=this.canvas,q=x.doc.elementFromPoint(f,v);if(x.win.opera&&q.tagName=="svg"){var Q=(h=(_=N).getBoundingClientRect(),m=_.ownerDocument,y=m.body,b=m.documentElement,k=b.clientTop||y.clientTop||0,I=b.clientLeft||y.clientLeft||0,{y:h.top+(x.win.pageYOffset||b.scrollTop||y.scrollTop)-k,x:h.left+(x.win.pageXOffset||b.scrollLeft||y.scrollLeft)-I}),W=N.createSVGRect();W.x=f-Q.x,W.y=v-Q.y,W.width=W.height=1;var Z=N.getIntersectionList(W,null);Z.length&&(q=Z[Z.length-1])}if(!q)return null;for(;q.parentNode&&q!=N.parentNode&&!q.raphael;)q=q.parentNode;return q==this.canvas.parentNode&&(q=N),q=q&&q.raphael?this.getById(q.raphaelid):null},u.getElementsByBBox=function(f){var v=this.set();return this.forEach(function(_){l.isBBoxIntersect(_.getBBox(),f)&&v.push(_)}),v},u.getById=function(f){for(var v=this.bottom;v;){if(v.id==f)return v;v=v.next}return null},u.forEach=function(f,v){for(var _=this.bottom;_;){if(f.call(v,_)===!1)return this;_=_.next}return this},u.getElementsByPoint=function(f,v){var _=this.set();return this.forEach(function(h){h.isPointInside(f,v)&&_.push(h)}),_},Ot.isPointInside=function(f,v){var _=this.realPath=Rt[this.type](this);return this.attr("transform")&&this.attr("transform").length&&(_=l.transformPath(_,this.attr("transform"))),l.isPointInsidePath(_,f,v)},Ot.getBBox=function(f){if(this.removed)return{};var v=this._;return f?(!v.dirty&&v.bboxwt||(this.realPath=Rt[this.type](this),v.bboxwt=ye(this.realPath),v.bboxwt.toString=Mn,v.dirty=0),v.bboxwt):((v.dirty||v.dirtyT||!v.bbox)&&(!v.dirty&&this.realPath||(v.bboxwt=0,this.realPath=Rt[this.type](this)),v.bbox=ye(jt(this.realPath,this.matrix)),v.bbox.toString=Mn,v.dirty=v.dirtyT=0),v.bbox)},Ot.clone=function(){if(this.removed)return null;var f=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(f),f},Ot.glow=function(f){if(this.type=="text")return null;var v={width:((f=f||{}).width||10)+(+this.attr("stroke-width")||1),fill:f.fill||!1,opacity:f.opacity==null?.5:f.opacity,offsetx:f.offsetx||0,offsety:f.offsety||0,color:f.color||"#000"},_=v.width/2,h=this.paper,m=h.set(),y=this.realPath||Rt[this.type](this);y=this.matrix?jt(y,this.matrix):y;for(var b=1;b<_+1;b++)m.push(h.path(y).attr({stroke:v.color,fill:v.fill?v.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(v.width/_*b).toFixed(3),opacity:+(v.opacity/_).toFixed(3)}));return m.insertBefore(this).translate(v.offsetx,v.offsety)};var te=function(f,v,_,h,m,y,b,k,I){return I==null?de(f,v,_,h,m,y,b,k):l.findDotsAtSegment(f,v,_,h,m,y,b,k,function(N,q,Q,W,Z,nt,at,rt,K){if(!(K<0||de(N,q,Q,W,Z,nt,at,rt)<K)){var mt,ot=.5,ut=1-ot;for(mt=de(N,q,Q,W,Z,nt,at,rt,ut);gt(mt-K)>.01;)mt=de(N,q,Q,W,Z,nt,at,rt,ut+=(mt<K?1:-1)*(ot/=2));return ut}}(f,v,_,h,m,y,b,k,I))},Fe=function(f,v){return function(_,h,m){for(var y,b,k,I,N,q="",Q={},W=0,Z=0,nt=(_=In(_)).length;Z<nt;Z++){if((k=_[Z])[0]=="M")y=+k[1],b=+k[2];else{if(W+(I=te(y,b,k[1],k[2],k[3],k[4],k[5],k[6]))>h){if(v&&!Q.start){if(q+=["C"+(N=te(y,b,k[1],k[2],k[3],k[4],k[5],k[6],h-W)).start.x,N.start.y,N.m.x,N.m.y,N.x,N.y],m)return q;Q.start=q,q=["M"+N.x,N.y+"C"+N.n.x,N.n.y,N.end.x,N.end.y,k[5],k[6]].join(),W+=I,y=+k[5],b=+k[6];continue}if(!f&&!v)return{x:(N=te(y,b,k[1],k[2],k[3],k[4],k[5],k[6],h-W)).x,y:N.y,alpha:N.alpha}}W+=I,y=+k[5],b=+k[6]}q+=k.shift()+k}return Q.end=q,(N=f?W:v?Q:l.findDotsAtSegment(y,b,k[0],k[1],k[2],k[3],k[4],k[5],1)).alpha&&(N={x:N.x,y:N.y,alpha:N.alpha}),N}},Se=Fe(1),we=Fe(),Qe=Fe(0,1);l.getTotalLength=Se,l.getPointAtLength=we,l.getSubpath=function(f,v,_){if(this.getTotalLength(f)-_<1e-6)return Qe(f,v).end;var h=Qe(f,_,1);return v?Qe(h,v).end:h},Ot.getTotalLength=function(){var f=this.getPath();if(f)return this.node.getTotalLength?this.node.getTotalLength():Se(f)},Ot.getPointAtLength=function(f){var v=this.getPath();if(v)return we(v,f)},Ot.getPath=function(){var f,v=l._getPath[this.type];if(this.type!="text"&&this.type!="set")return v&&(f=v(this)),f},Ot.getSubpath=function(f,v){var _=this.getPath();if(_)return l.getSubpath(_,f,v)};var Ht=l.easing_formulas={linear:function(f){return f},"<":function(f){return Et(f,1.7)},">":function(f){return Et(f,.48)},"<>":function(f){var v=.48-f/1.04,_=J.sqrt(.1734+v*v),h=_-v,m=-_-v,y=Et(gt(h),1/3)*(h<0?-1:1)+Et(gt(m),1/3)*(m<0?-1:1)+.5;return 3*(1-y)*y*y+y*y*y},backIn:function(f){var v=1.70158;return f*f*((v+1)*f-v)},backOut:function(f){var v=1.70158;return(f-=1)*f*((v+1)*f+v)+1},elastic:function(f){return f==!!f?f:Et(2,-10*f)*J.sin(2*kt*(f-.075)/.3)+1},bounce:function(f){var v=7.5625,_=2.75;return f<1/_?v*f*f:f<2/_?v*(f-=1.5/_)*f+.75:f<2.5/_?v*(f-=2.25/_)*f+.9375:v*(f-=2.625/_)*f+.984375}};Ht.easeIn=Ht["ease-in"]=Ht["<"],Ht.easeOut=Ht["ease-out"]=Ht[">"],Ht.easeInOut=Ht["ease-in-out"]=Ht["<>"],Ht["back-in"]=Ht.backIn,Ht["back-out"]=Ht.backOut;var bt=[],Gi=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(f){setTimeout(f,16)},ei=function(){for(var f=+new Date,v=0;v<bt.length;v++){var _=bt[v];if(!_.el.removed&&!_.paused){var h,m,y=f-_.start,b=_.ms,k=_.easing,I=_.from,N=_.diff,q=_.to,Q=(_.t,_.el),W={},Z={};if(_.initstatus?(y=(_.initstatus*_.anim.top-_.prev)/(_.percent-_.prev)*b,_.status=_.initstatus,delete _.initstatus,_.stop&&bt.splice(v--,1)):_.status=(_.prev+(_.percent-_.prev)*(y/b))/_.anim.top,!(y<0))if(y<b){var nt=k(y/b);for(var at in I)if(I[w](at)){switch(Y[at]){case tt:h=+I[at]+nt*b*N[at];break;case"colour":h="rgb("+[vn(R(I[at].r+nt*b*N[at].r)),vn(R(I[at].g+nt*b*N[at].g)),vn(R(I[at].b+nt*b*N[at].b))].join(",")+")";break;case"path":h=[];for(var rt=0,K=I[at].length;rt<K;rt++){h[rt]=[I[at][rt][0]];for(var mt=1,ot=I[at][rt].length;mt<ot;mt++)h[rt][mt]=+I[at][rt][mt]+nt*b*N[at][rt][mt];h[rt]=h[rt].join(z)}h=h.join(z);break;case"transform":if(N[at].real)for(h=[],rt=0,K=I[at].length;rt<K;rt++)for(h[rt]=[I[at][rt][0]],mt=1,ot=I[at][rt].length;mt<ot;mt++)h[rt][mt]=I[at][rt][mt]+nt*b*N[at][rt][mt];else{var ut=function(Ct){return+I[at][Ct]+nt*b*N[at][Ct]};h=[["m",ut(0),ut(1),ut(2),ut(3),ut(4),ut(5)]]}break;case"csv":if(at=="clip-rect")for(h=[],rt=4;rt--;)h[rt]=+I[at][rt]+nt*b*N[at][rt];break;default:var lt=[][M](I[at]);for(h=[],rt=Q.paper.customAttributes[at].length;rt--;)h[rt]=+lt[rt]+nt*b*N[at][rt]}W[at]=h}Q.attr(W),function(Ct,yt,Tt){setTimeout(function(){o("raphael.anim.frame."+Ct,yt,Tt)})}(Q.id,Q,_.anim)}else{if(function(Ct,yt,Tt){setTimeout(function(){o("raphael.anim.frame."+yt.id,yt,Tt),o("raphael.anim.finish."+yt.id,yt,Tt),l.is(Ct,"function")&&Ct.call(yt)})}(_.callback,Q,_.anim),Q.attr(q),bt.splice(v--,1),_.repeat>1&&!_.next){for(m in q)q[w](m)&&(Z[m]=_.totalOrigin[m]);_.el.attr(Z),tn(_.anim,_.el,_.anim.percents[0],null,_.totalOrigin,_.repeat-1)}_.next&&!_.stop&&tn(_.anim,_.el,_.next,null,_.totalOrigin,_.repeat)}}}bt.length&&Gi(ei)},vn=function(f){return f>255?255:f<0?0:f};function pe(f,v,_,h,m,y){var b=3*v,k=3*(h-v)-b,I=1-b-k,N=3*_,q=3*(m-_)-N,Q=1-N-q;function W(Z){return((I*Z+k)*Z+b)*Z}return function(Z,nt){var at=function(rt,K){var mt,ot,ut,lt,Ct,yt;for(ut=rt,yt=0;yt<8;yt++){if(lt=W(ut)-rt,gt(lt)<K)return ut;if(gt(Ct=(3*I*ut+2*k)*ut+b)<1e-6)break;ut-=lt/Ct}if(ot=1,(ut=rt)<(mt=0))return mt;if(ut>ot)return ot;for(;mt<ot;){if(lt=W(ut),gt(lt-rt)<K)return ut;rt>lt?mt=ut:ot=ut,ut=(ot-mt)/2+mt}return ut}(Z,nt);return((Q*at+q)*at+N)*at}(f,1/(200*y))}function le(f,v){var _=[],h={};if(this.ms=v,this.times=1,f){for(var m in f)f[w](m)&&(h[B(m)]=f[m],_.push(B(m)));_.sort(Mt)}this.anim=h,this.top=_[_.length-1],this.percents=_}function tn(f,v,_,h,m,y){_=B(_);var b,k,I,N,q,Q,W=f.ms,Z={},nt={},at={};if(h)for(K=0,mt=bt.length;K<mt;K++){var rt=bt[K];if(rt.el.id==v.id&&rt.anim==f){rt.percent!=_?(bt.splice(K,1),I=1):k=rt,v.attr(rt.totalOrigin);break}}else h=+nt;for(var K=0,mt=f.percents.length;K<mt;K++){if(f.percents[K]==_||f.percents[K]>h*f.top){_=f.percents[K],q=f.percents[K-1]||0,W=W/f.top*(_-q),N=f.percents[K+1],b=f.anim[_];break}h&&v.attr(f.anim[f.percents[K]])}if(b){if(k)k.initstatus=h,k.start=new Date-k.ms*h;else{for(var ot in b)if(b[w](ot)&&(Y[w](ot)||v.paper.customAttributes[w](ot)))switch(Z[ot]=v.attr(ot),Z[ot]==null&&(Z[ot]=et[ot]),nt[ot]=b[ot],Y[ot]){case tt:at[ot]=(nt[ot]-Z[ot])/W;break;case"colour":Z[ot]=l.getRGB(Z[ot]);var ut=l.getRGB(nt[ot]);at[ot]={r:(ut.r-Z[ot].r)/W,g:(ut.g-Z[ot].g)/W,b:(ut.b-Z[ot].b)/W};break;case"path":var lt=In(Z[ot],nt[ot]),Ct=lt[1];for(Z[ot]=lt[0],at[ot]=[],K=0,mt=Z[ot].length;K<mt;K++){at[ot][K]=[0];for(var yt=1,Tt=Z[ot][K].length;yt<Tt;yt++)at[ot][K][yt]=(Ct[K][yt]-Z[ot][K][yt])/W}break;case"transform":var si=v._,Hi=Pr(si[ot],nt[ot]);if(Hi)for(Z[ot]=Hi.from,nt[ot]=Hi.to,at[ot]=[],at[ot].real=!0,K=0,mt=Z[ot].length;K<mt;K++)for(at[ot][K]=[Z[ot][K][0]],yt=1,Tt=Z[ot][K].length;yt<Tt;yt++)at[ot][K][yt]=(nt[ot][K][yt]-Z[ot][K][yt])/W;else{var ce=v.matrix||new We,Ue={_:{transform:si.transform},getBBox:function(){return v.getBBox(1)}};Z[ot]=[ce.a,ce.b,ce.c,ce.d,ce.e,ce.f],Qn(Ue,nt[ot]),nt[ot]=Ue._.transform,at[ot]=[(Ue.matrix.a-ce.a)/W,(Ue.matrix.b-ce.b)/W,(Ue.matrix.c-ce.c)/W,(Ue.matrix.d-ce.d)/W,(Ue.matrix.e-ce.e)/W,(Ue.matrix.f-ce.f)/W]}break;case"csv":var ai=F(b[ot])[G](g),oi=F(Z[ot])[G](g);if(ot=="clip-rect")for(Z[ot]=oi,at[ot]=[],K=oi.length;K--;)at[ot][K]=(ai[K]-Z[ot][K])/W;nt[ot]=ai;break;default:for(ai=[][M](b[ot]),oi=[][M](Z[ot]),at[ot]=[],K=v.paper.customAttributes[ot].length;K--;)at[ot][K]=((ai[K]||0)-(oi[K]||0))/W}var Or=b.easing,en=l.easing_formulas[Or];if(!en)if((en=F(Or).match(S))&&en.length==5){var Rn=en;en=function(Fr){return pe(Fr,+Rn[1],+Rn[2],+Rn[3],+Rn[4],W)}}else en=Dt;if(rt={anim:f,percent:_,timestamp:Q=b.start||f.start||+new Date,start:Q+(f.del||0),status:0,initstatus:h||0,stop:!1,ms:W,easing:en,from:Z,diff:at,to:nt,el:v,callback:b.callback,prev:q,next:N,repeat:y||f.times,origin:v.attr(),totalOrigin:m},bt.push(rt),h&&!k&&!I&&(rt.stop=!0,rt.start=new Date-W*h,bt.length==1))return ei();I&&(rt.start=new Date-rt.ms*h),bt.length==1&&Gi(ei)}o("raphael.anim.start."+v.id,v,f)}}function ni(f){for(var v=0;v<bt.length;v++)bt[v].el.paper==f&&bt.splice(v--,1)}Ot.animateWith=function(f,v,_,h,m,y){if(this.removed)return y&&y.call(this),this;var b=_ instanceof le?_:l.animation(_,h,m,y);tn(b,this,b.percents[0],null,this.attr());for(var k=0,I=bt.length;k<I;k++)if(bt[k].anim==v&&bt[k].el==f){bt[I-1].start=bt[k].start;break}return this},Ot.onAnimation=function(f){return f?o.on("raphael.anim.frame."+this.id,f):o.unbind("raphael.anim.frame."+this.id),this},le.prototype.delay=function(f){var v=new le(this.anim,this.ms);return v.times=this.times,v.del=+f||0,v},le.prototype.repeat=function(f){var v=new le(this.anim,this.ms);return v.del=this.del,v.times=J.floor(dt(f,0))||1,v},l.animation=function(f,v,_,h){if(f instanceof le)return f;!l.is(_,"function")&&_||(h=h||_||null,_=null),f=Object(f),v=+v||0;var m,y,b={};for(y in f)f[w](y)&&B(y)!=y&&B(y)+"%"!=y&&(m=!0,b[y]=f[y]);if(m)return _&&(b.easing=_),h&&(b.callback=h),new le({100:b},v);if(h){var k=0;for(var I in f){var N=j(I);f[w](I)&&N>k&&(k=N)}!f[k+="%"].callback&&(f[k].callback=h)}return new le(f,v)},Ot.animate=function(f,v,_,h){if(this.removed)return h&&h.call(this),this;var m=f instanceof le?f:l.animation(f,v,_,h);return tn(m,this,m.percents[0],null,this.attr()),this},Ot.setTime=function(f,v){return f&&v!=null&&this.status(f,ft(v,f.ms)/f.ms),this},Ot.status=function(f,v){var _,h,m=[],y=0;if(v!=null)return tn(f,this,-1,ft(v,1)),this;for(_=bt.length;y<_;y++)if((h=bt[y]).el.id==this.id&&(!f||h.anim==f)){if(f)return h.status;m.push({anim:h.anim,status:h.status})}return f?0:m},Ot.pause=function(f){for(var v=0;v<bt.length;v++)bt[v].el.id!=this.id||f&&bt[v].anim!=f||o("raphael.anim.pause."+this.id,this,bt[v].anim)!==!1&&(bt[v].paused=!0);return this},Ot.resume=function(f){for(var v=0;v<bt.length;v++)if(bt[v].el.id==this.id&&(!f||bt[v].anim==f)){var _=bt[v];o("raphael.anim.resume."+this.id,this,_.anim)!==!1&&(delete _.paused,this.status(_.anim,_.status))}return this},Ot.stop=function(f){for(var v=0;v<bt.length;v++)bt[v].el.id!=this.id||f&&bt[v].anim!=f||o("raphael.anim.stop."+this.id,this,bt[v].anim)!==!1&&bt.splice(v--,1);return this},o.on("raphael.remove",ni),o.on("raphael.clear",ni),Ot.toString=function(){return"Raphaël’s object"};var ii,ri,xe,be,Ln=function(f){if(this.items=[],this.length=0,this.type="set",f)for(var v=0,_=f.length;v<_;v++)!f[v]||f[v].constructor!=Ot.constructor&&f[v].constructor!=Ln||(this[this.items.length]=this.items[this.items.length]=f[v],this.length++)},Xt=Ln.prototype;for(var Dn in Xt.push=function(){for(var f,v,_=0,h=arguments.length;_<h;_++)!(f=arguments[_])||f.constructor!=Ot.constructor&&f.constructor!=Ln||(this[v=this.items.length]=this.items[v]=f,this.length++);return this},Xt.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},Xt.forEach=function(f,v){for(var _=0,h=this.items.length;_<h;_++)if(f.call(v,this.items[_],_)===!1)return this;return this},Ot)Ot[w](Dn)&&(Xt[Dn]=function(f){return function(){var v=arguments;return this.forEach(function(_){_[f][P](_,v)})}}(Dn));return Xt.attr=function(f,v){if(f&&l.is(f,st)&&l.is(f[0],"object"))for(var _=0,h=f.length;_<h;_++)this.items[_].attr(f[_]);else for(var m=0,y=this.items.length;m<y;m++)this.items[m].attr(f,v);return this},Xt.clear=function(){for(;this.length;)this.pop()},Xt.splice=function(f,v,_){f=f<0?dt(this.length+f,0):f,v=dt(0,ft(this.length-f,v));var h,m=[],y=[],b=[];for(h=2;h<arguments.length;h++)b.push(arguments[h]);for(h=0;h<v;h++)y.push(this[f+h]);for(;h<this.length-f;h++)m.push(this[f+h]);var k=b.length;for(h=0;h<k+m.length;h++)this.items[f+h]=this[f+h]=h<k?b[h]:m[h-k];for(h=this.items.length=this.length-=v-k;this[h];)delete this[h++];return new Ln(y)},Xt.exclude=function(f){for(var v=0,_=this.length;v<_;v++)if(this[v]==f)return this.splice(v,1),!0},Xt.animate=function(f,v,_,h){(l.is(_,"function")||!_)&&(h=_||null);var m,y,b=this.items.length,k=b,I=this;if(!b)return this;h&&(y=function(){!--b&&h.call(I)}),_=l.is(_,"string")?_:y;var N=l.animation(f,v,_,y);for(m=this.items[--k].animate(N);k--;)this.items[k]&&!this.items[k].removed&&this.items[k].animateWith(m,N,N),this.items[k]&&!this.items[k].removed||b--;return this},Xt.insertAfter=function(f){for(var v=this.items.length;v--;)this.items[v].insertAfter(f);return this},Xt.getBBox=function(){for(var f=[],v=[],_=[],h=[],m=this.items.length;m--;)if(!this.items[m].removed){var y=this.items[m].getBBox();f.push(y.x),v.push(y.y),_.push(y.x+y.width),h.push(y.y+y.height)}return{x:f=ft[P](0,f),y:v=ft[P](0,v),x2:_=dt[P](0,_),y2:h=dt[P](0,h),width:_-f,height:h-v}},Xt.clone=function(f){f=this.paper.set();for(var v=0,_=this.items.length;v<_;v++)f.push(this.items[v].clone());return f},Xt.toString=function(){return"Raphaël‘s set"},Xt.glow=function(f){var v=this.paper.set();return this.forEach(function(_,h){var m=_.glow(f);m?.forEach(function(y,b){v.push(y)})}),v},Xt.isPointInside=function(f,v){var _=!1;return this.forEach(function(h){if(h.isPointInside(f,v))return _=!0,!1}),_},l.registerFont=function(f){if(!f.face)return f;this.fonts=this.fonts||{};var v={w:f.w,face:{},glyphs:{}},_=f.face["font-family"];for(var h in f.face)f.face[w](h)&&(v.face[h]=f.face[h]);if(this.fonts[_]?this.fonts[_].push(v):this.fonts[_]=[v],!f.svg){for(var m in v.face["units-per-em"]=j(f.face["units-per-em"],10),f.glyphs)if(f.glyphs[w](m)){var y=f.glyphs[m];if(v.glyphs[m]={w:y.w,k:{},d:y.d&&"M"+y.d.replace(/[mlcxtrv]/g,function(k){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[k]||"M"})+"z"},y.k)for(var b in y.k)y[w](b)&&(v.glyphs[m].k[b]=y.k[b])}}return f},u.getFont=function(f,v,_,h){if(h=h||"normal",_=_||"normal",v=+v||{normal:400,bold:700,lighter:300,bolder:800}[v]||400,l.fonts){var m,y=l.fonts[f];if(!y){var b=new RegExp("(^|\\s)"+f.replace(/[^\w\d\s+!~.:_-]/g,U)+"(\\s|$)","i");for(var k in l.fonts)if(l.fonts[w](k)&&b.test(k)){y=l.fonts[k];break}}if(y)for(var I=0,N=y.length;I<N&&((m=y[I]).face["font-weight"]!=v||m.face["font-style"]!=_&&m.face["font-style"]||m.face["font-stretch"]!=h);I++);return m}},u.print=function(f,v,_,h,m,y,b,k){y=y||"middle",b=dt(ft(b||0,1),-1),k=dt(ft(k||1,3),1);var I,N=F(_)[G](U),q=0,Q=0,W=U;if(l.is(h,"string")&&(h=this.getFont(h)),h){I=(m||16)/h.face["units-per-em"];for(var Z=h.face.bbox[G](g),nt=+Z[0],at=Z[3]-Z[1],rt=0,K=+Z[1]+(y=="baseline"?at+ +h.face.descent:at/2),mt=0,ot=N.length;mt<ot;mt++){if(N[mt]==`
19
+ `)q=0,lt=0,Q=0,rt+=at*k;else{var ut=Q&&h.glyphs[N[mt-1]]||{},lt=h.glyphs[N[mt]];q+=Q?(ut.w||h.w)+(ut.k&&ut.k[N[mt]]||0)+h.w*b:0,Q=1}lt&&lt.d&&(W+=l.transformPath(lt.d,["t",q*I,rt*I,"s",I,I,nt,K,"t",(f-nt)/I,(v-K)/I]))}}return this.path(W).attr({fill:"#000",stroke:"none"})},u.add=function(f){if(l.is(f,"array"))for(var v,_=this.set(),h=0,m=f.length;h<m;h++)v=f[h]||{},p[w](v.type)&&_.push(this[v.type]().attr(v));return _},l.format=function(f,v){var _=l.is(v,st)?[0][M](v):arguments;return f&&l.is(f,"string")&&_.length-1&&(f=f.replace(d,function(h,m){return _[++m]==null?U:_[m]})),f||U},l.fullfill=(ii=/\{([^\}]+)\}/g,ri=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,function(f,v){return String(f).replace(ii,function(_,h){return function(m,y,b){var k=b;return y.replace(ri,function(I,N,q,Q,W){N=N||Q,k&&(N in k&&(k=k[N]),typeof k=="function"&&W&&(k=k()))}),k=(k==null||k==b?m:k)+""}(_,h,v)})}),l.ninja=function(){if(C.was)x.win.Raphael=C.is;else{window.Raphael=void 0;try{delete window.Raphael}catch{}}return l},l.st=Xt,o.on("raphael.DOMload",function(){c=!0}),(xe=document).readyState==null&&xe.addEventListener&&(xe.addEventListener("DOMContentLoaded",be=function(){xe.removeEventListener("DOMContentLoaded",be,!1),xe.readyState="complete"},!1),xe.readyState="loading"),function f(){/in/.test(xe.readyState)?setTimeout(f,9):l.eve("raphael.DOMload")}(),l}.apply(i,s))===void 0||(e.exports=a)},function(e,i,r){var s,a;s=[r(0),r(3),r(4)],(a=function(o){return o}.apply(i,s))===void 0||(e.exports=a)},function(e,i,r){var s,a,o,l,c,u,g,p,d,w,x,C,A,P;l="hasOwnProperty",c=/[\.\/]/,u=/\s*,\s*/,g=function(M,D){return M-D},p={n:{}},d=function(){for(var M=0,D=this.length;M<D;M++)if(this[M]!==void 0)return this[M]},w=function(){for(var M=this.length;--M;)if(this[M]!==void 0)return this[M]},x=Object.prototype.toString,C=String,A=Array.isArray||function(M){return M instanceof Array||x.call(M)=="[object Array]"},(P=function(M,D){var U,z=o,F=Array.prototype.slice.call(arguments,2),G=P.listeners(M),H=0,$=[],X={},J=[],dt=a;J.firstDefined=d,J.lastDefined=w,a=M,o=0;for(var ft=0,gt=G.length;ft<gt;ft++)"zIndex"in G[ft]&&($.push(G[ft].zIndex),G[ft].zIndex<0&&(X[G[ft].zIndex]=G[ft]));for($.sort(g);$[H]<0;)if(U=X[$[H++]],J.push(U.apply(D,F)),o)return o=z,J;for(ft=0;ft<gt;ft++)if("zIndex"in(U=G[ft]))if(U.zIndex==$[H]){if(J.push(U.apply(D,F)),o)break;do if((U=X[$[++H]])&&J.push(U.apply(D,F)),o)break;while(U)}else X[U.zIndex]=U;else if(J.push(U.apply(D,F)),o)break;return o=z,a=dt,J})._events=p,P.listeners=function(M){var D,U,z,F,G,H,$,X,J=A(M)?M:M.split(c),dt=p,ft=[dt],gt=[];for(F=0,G=J.length;F<G;F++){for(X=[],H=0,$=ft.length;H<$;H++)for(U=[(dt=ft[H].n)[J[F]],dt["*"]],z=2;z--;)(D=U[z])&&(X.push(D),gt=gt.concat(D.f||[]));ft=X}return gt},P.separator=function(M){M?(M="["+(M=C(M).replace(/(?=[\.\^\]\[\-])/g,"\\"))+"]",c=new RegExp(M)):c=/[\.\/]/},P.on=function(M,D){if(typeof D!="function")return function(){};for(var U=A(M)?A(M[0])?M:[M]:C(M).split(u),z=0,F=U.length;z<F;z++)(function(G){for(var H,$=A(G)?G:C(G).split(c),X=p,J=0,dt=$.length;J<dt;J++)X=(X=X.n).hasOwnProperty($[J])&&X[$[J]]||(X[$[J]]={n:{}});for(X.f=X.f||[],J=0,dt=X.f.length;J<dt;J++)if(X.f[J]==D){H=!0;break}!H&&X.f.push(D)})(U[z]);return function(G){+G==+G&&(D.zIndex=+G)}},P.f=function(M){var D=[].slice.call(arguments,1);return function(){P.apply(null,[M,null].concat(D).concat([].slice.call(arguments,0)))}},P.stop=function(){o=1},P.nt=function(M){var D=A(a)?a.join("."):a;return M?new RegExp("(?:\\.|\\/|^)"+M+"(?:\\.|\\/|$)").test(D):D},P.nts=function(){return A(a)?a:a.split(c)},P.off=P.unbind=function(M,D){if(M){var U=A(M)?A(M[0])?M:[M]:C(M).split(u);if(U.length>1)for(var z=0,F=U.length;z<F;z++)P.off(U[z],D);else{U=A(M)?M:C(M).split(c);var G,H,$,X,J,dt=[p];for(z=0,F=U.length;z<F;z++)for(X=0;X<dt.length;X+=$.length-2){if($=[X,1],G=dt[X].n,U[z]!="*")G[U[z]]&&$.push(G[U[z]]);else for(H in G)G[l](H)&&$.push(G[H]);dt.splice.apply(dt,$)}for(z=0,F=dt.length;z<F;z++)for(G=dt[z];G.n;){if(D){if(G.f){for(X=0,J=G.f.length;X<J;X++)if(G.f[X]==D){G.f.splice(X,1);break}!G.f.length&&delete G.f}for(H in G.n)if(G.n[l](H)&&G.n[H].f){var ft=G.n[H].f;for(X=0,J=ft.length;X<J;X++)if(ft[X]==D){ft.splice(X,1);break}!ft.length&&delete G.n[H].f}}else for(H in delete G.f,G.n)G.n[l](H)&&G.n[H].f&&delete G.n[H].f;G=G.n}}}else P._events=p={n:{}}},P.once=function(M,D){var U=function(){return P.off(M,U),D.apply(this,arguments)};return P.on(M,U)},P.version="0.5.0",P.toString=function(){return"You are running Eve 0.5.0"},e.exports?e.exports=P:(s=function(){return P}.apply(i,[]))===void 0||(e.exports=s)},function(e,i,r){var s,a;s=[r(0)],(a=function(o){if(!o||o.svg){var l="hasOwnProperty",c=String,u=parseFloat,g=parseInt,p=Math,d=p.max,w=p.abs,x=p.pow,C=/[, ]+/,A=o.eve,P="",M=" ",D="http://www.w3.org/1999/xlink",U={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},z={};o.toString=function(){return`Your browser supports SVG.
20
+ You are running Raphaël `+this.version};var F=function(L,E){if(E)for(var S in typeof L=="string"&&(L=F(L)),E)E[l](S)&&(S.substring(0,6)=="xlink:"?L.setAttributeNS(D,S.substring(6),c(E[S])):L.setAttribute(S,c(E[S])));else(L=o._g.doc.createElementNS("http://www.w3.org/2000/svg",L)).style&&(L.style.webkitTapHighlightColor="rgba(0,0,0,0)");return L},G=function(L,E){var S="linear",R=L.id+E,B=.5,j=.5,V=L.node,et=L.paper,Y=V.style,it=o._g.doc.getElementById(R);if(!it){if(E=(E=c(E).replace(o._radial_gradient,function(Mt,Dt,_t){if(S="radial",Dt&&_t){B=u(Dt);var zt=2*((j=u(_t))>.5)-1;x(B-.5,2)+x(j-.5,2)>.25&&(j=p.sqrt(.25-x(B-.5,2))*zt+.5)&&j!=.5&&(j=j.toFixed(5)-1e-5*zt)}return P})).split(/\s*\-\s*/),S=="linear"){var pt=E.shift();if(pt=-u(pt),isNaN(pt))return null;var vt=[0,0,p.cos(o.rad(pt)),p.sin(o.rad(pt))],wt=1/(d(w(vt[2]),w(vt[3]))||1);vt[2]*=wt,vt[3]*=wt,vt[2]<0&&(vt[0]=-vt[2],vt[2]=0),vt[3]<0&&(vt[1]=-vt[3],vt[3]=0)}var At=o._parseDots(E);if(!At)return null;if(R=R.replace(/[\(\)\s,\xb0#]/g,"_"),L.gradient&&R!=L.gradient.id&&(et.defs.removeChild(L.gradient),delete L.gradient),!L.gradient){it=F(S+"Gradient",{id:R}),L.gradient=it,F(it,S=="radial"?{fx:B,fy:j}:{x1:vt[0],y1:vt[1],x2:vt[2],y2:vt[3],gradientTransform:L.matrix.invert()}),et.defs.appendChild(it);for(var xt=0,It=At.length;xt<It;xt++)it.appendChild(F("stop",{offset:At[xt].offset?At[xt].offset:xt?"100%":"0%","stop-color":At[xt].color||"#fff","stop-opacity":isFinite(At[xt].opacity)?At[xt].opacity:1}))}}return F(V,{fill:H(R),opacity:1,"fill-opacity":1}),Y.fill=P,Y.opacity=1,Y.fillOpacity=1,1},H=function(L){if((E=document.documentMode)&&(E===9||E===10))return"url('#"+L+"')";var E,S=document.location;return"url('"+(S.protocol+"//"+S.host+S.pathname+S.search)+"#"+L+"')"},$=function(L){var E=L.getBBox(1);F(L.pattern,{patternTransform:L.matrix.invert()+" translate("+E.x+","+E.y+")"})},X=function(L,E,S){if(L.type=="path"){for(var R,B,j,V,et,Y=c(E).toLowerCase().split("-"),it=L.paper,pt=S?"end":"start",vt=L.node,wt=L.attrs,At=wt["stroke-width"],xt=Y.length,It="classic",Mt=3,Dt=3,_t=5;xt--;)switch(Y[xt]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":It=Y[xt];break;case"wide":Dt=5;break;case"narrow":Dt=2;break;case"long":Mt=5;break;case"short":Mt=2}if(It=="open"?(Mt+=2,Dt+=2,_t+=2,j=1,V=S?4:1,et={fill:"none",stroke:wt.stroke}):(V=j=Mt/2,et={fill:wt.stroke,stroke:"none"}),L._.arrows?S?(L._.arrows.endPath&&z[L._.arrows.endPath]--,L._.arrows.endMarker&&z[L._.arrows.endMarker]--):(L._.arrows.startPath&&z[L._.arrows.startPath]--,L._.arrows.startMarker&&z[L._.arrows.startMarker]--):L._.arrows={},It!="none"){var zt="raphael-marker-"+It,Rt="raphael-marker-"+pt+It+Mt+Dt+"-obj"+L.id;o._g.doc.getElementById(zt)?z[zt]++:(it.defs.appendChild(F(F("path"),{"stroke-linecap":"round",d:U[It],id:zt})),z[zt]=1);var jt,Ut=o._g.doc.getElementById(Rt);Ut?(z[Rt]++,jt=Ut.getElementsByTagName("use")[0]):(Ut=F(F("marker"),{id:Rt,markerHeight:Dt,markerWidth:Mt,orient:"auto",refX:V,refY:Dt/2}),jt=F(F("use"),{"xlink:href":"#"+zt,transform:(S?"rotate(180 "+Mt/2+" "+Dt/2+") ":P)+"scale("+Mt/_t+","+Dt/_t+")","stroke-width":(1/((Mt/_t+Dt/_t)/2)).toFixed(4)}),Ut.appendChild(jt),it.defs.appendChild(Ut),z[Rt]=1),F(jt,et);var ie=j*(It!="diamond"&&It!="oval");S?(R=L._.arrows.startdx*At||0,B=o.getTotalLength(wt.path)-ie*At):(R=ie*At,B=o.getTotalLength(wt.path)-(L._.arrows.enddx*At||0)),(et={})["marker-"+pt]="url(#"+Rt+")",(B||R)&&(et.d=o.getSubpath(wt.path,R,B)),F(vt,et),L._.arrows[pt+"Path"]=zt,L._.arrows[pt+"Marker"]=Rt,L._.arrows[pt+"dx"]=ie,L._.arrows[pt+"Type"]=It,L._.arrows[pt+"String"]=E}else S?(R=L._.arrows.startdx*At||0,B=o.getTotalLength(wt.path)-R):(R=0,B=o.getTotalLength(wt.path)-(L._.arrows.enddx*At||0)),L._.arrows[pt+"Path"]&&F(vt,{d:o.getSubpath(wt.path,R,B)}),delete L._.arrows[pt+"Path"],delete L._.arrows[pt+"Marker"],delete L._.arrows[pt+"dx"],delete L._.arrows[pt+"Type"],delete L._.arrows[pt+"String"];for(et in z)if(z[l](et)&&!z[et]){var Wt=o._g.doc.getElementById(et);Wt&&Wt.parentNode.removeChild(Wt)}}},J={"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},dt=function(L,E,S){if(E=J[c(E).toLowerCase()]){for(var R=L.attrs["stroke-width"]||"1",B={round:R,square:R,butt:0}[L.attrs["stroke-linecap"]||S["stroke-linecap"]]||0,j=[],V=E.length;V--;)j[V]=E[V]*R+(V%2?1:-1)*B;F(L.node,{"stroke-dasharray":j.join(",")})}else F(L.node,{"stroke-dasharray":"none"})},ft=function(L,E){var S=L.node,R=L.attrs,B=S.style.visibility;for(var j in S.style.visibility="hidden",E)if(E[l](j)){if(!o._availableAttrs[l](j))continue;var V=E[j];switch(R[j]=V,j){case"blur":L.blur(V);break;case"title":var et=S.getElementsByTagName("title");if(et.length&&(et=et[0]))et.firstChild.nodeValue=V;else{et=F("title");var Y=o._g.doc.createTextNode(V);et.appendChild(Y),S.appendChild(et)}break;case"href":case"target":var it=S.parentNode;if(it.tagName.toLowerCase()!="a"){var pt=F("a");it.insertBefore(pt,S),pt.appendChild(S),it=pt}j=="target"?it.setAttributeNS(D,"show",V=="blank"?"new":V):it.setAttributeNS(D,j,V);break;case"cursor":S.style.cursor=V;break;case"transform":L.transform(V);break;case"arrow-start":X(L,V);break;case"arrow-end":X(L,V,1);break;case"clip-rect":var vt=c(V).split(C);if(vt.length==4){L.clip&&L.clip.parentNode.parentNode.removeChild(L.clip.parentNode);var wt=F("clipPath"),At=F("rect");wt.id=o.createUUID(),F(At,{x:vt[0],y:vt[1],width:vt[2],height:vt[3]}),wt.appendChild(At),L.paper.defs.appendChild(wt),F(S,{"clip-path":"url(#"+wt.id+")"}),L.clip=At}if(!V){var xt=S.getAttribute("clip-path");if(xt){var It=o._g.doc.getElementById(xt.replace(/(^url\(#|\)$)/g,P));It&&It.parentNode.removeChild(It),F(S,{"clip-path":P}),delete L.clip}}break;case"path":L.type=="path"&&(F(S,{d:V?R.path=o._pathToAbsolute(V):"M0,0"}),L._.dirty=1,L._.arrows&&("startString"in L._.arrows&&X(L,L._.arrows.startString),"endString"in L._.arrows&&X(L,L._.arrows.endString,1)));break;case"width":if(S.setAttribute(j,V),L._.dirty=1,!R.fx)break;j="x",V=R.x;case"x":R.fx&&(V=-R.x-(R.width||0));case"rx":if(j=="rx"&&L.type=="rect")break;case"cx":S.setAttribute(j,V),L.pattern&&$(L),L._.dirty=1;break;case"height":if(S.setAttribute(j,V),L._.dirty=1,!R.fy)break;j="y",V=R.y;case"y":R.fy&&(V=-R.y-(R.height||0));case"ry":if(j=="ry"&&L.type=="rect")break;case"cy":S.setAttribute(j,V),L.pattern&&$(L),L._.dirty=1;break;case"r":L.type=="rect"?F(S,{rx:V,ry:V}):S.setAttribute(j,V),L._.dirty=1;break;case"src":L.type=="image"&&S.setAttributeNS(D,"href",V);break;case"stroke-width":L._.sx==1&&L._.sy==1||(V/=d(w(L._.sx),w(L._.sy))||1),S.setAttribute(j,V),R["stroke-dasharray"]&&dt(L,R["stroke-dasharray"],E),L._.arrows&&("startString"in L._.arrows&&X(L,L._.arrows.startString),"endString"in L._.arrows&&X(L,L._.arrows.endString,1));break;case"stroke-dasharray":dt(L,V,E);break;case"fill":var Mt=c(V).match(o._ISURL);if(Mt){wt=F("pattern");var Dt=F("image");wt.id=o.createUUID(),F(wt,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),F(Dt,{x:0,y:0,"xlink:href":Mt[1]}),wt.appendChild(Dt),function(Ut){o._preload(Mt[1],function(){var ie=this.offsetWidth,Wt=this.offsetHeight;F(Ut,{width:ie,height:Wt}),F(Dt,{width:ie,height:Wt})})}(wt),L.paper.defs.appendChild(wt),F(S,{fill:"url(#"+wt.id+")"}),L.pattern=wt,L.pattern&&$(L);break}var _t=o.getRGB(V);if(_t.error){if((L.type=="circle"||L.type=="ellipse"||c(V).charAt()!="r")&&G(L,V)){if("opacity"in R||"fill-opacity"in R){var zt=o._g.doc.getElementById(S.getAttribute("fill").replace(/^url\(#|\)$/g,P));if(zt){var Rt=zt.getElementsByTagName("stop");F(Rt[Rt.length-1],{"stop-opacity":("opacity"in R?R.opacity:1)*("fill-opacity"in R?R["fill-opacity"]:1)})}}R.gradient=V,R.fill="none";break}}else delete E.gradient,delete R.gradient,!o.is(R.opacity,"undefined")&&o.is(E.opacity,"undefined")&&F(S,{opacity:R.opacity}),!o.is(R["fill-opacity"],"undefined")&&o.is(E["fill-opacity"],"undefined")&&F(S,{"fill-opacity":R["fill-opacity"]});_t[l]("opacity")&&F(S,{"fill-opacity":_t.opacity>1?_t.opacity/100:_t.opacity});case"stroke":_t=o.getRGB(V),S.setAttribute(j,_t.hex),j=="stroke"&&_t[l]("opacity")&&F(S,{"stroke-opacity":_t.opacity>1?_t.opacity/100:_t.opacity}),j=="stroke"&&L._.arrows&&("startString"in L._.arrows&&X(L,L._.arrows.startString),"endString"in L._.arrows&&X(L,L._.arrows.endString,1));break;case"gradient":(L.type=="circle"||L.type=="ellipse"||c(V).charAt()!="r")&&G(L,V);break;case"opacity":R.gradient&&!R[l]("stroke-opacity")&&F(S,{"stroke-opacity":V>1?V/100:V});case"fill-opacity":if(R.gradient){(zt=o._g.doc.getElementById(S.getAttribute("fill").replace(/^url\(#|\)$/g,P)))&&(Rt=zt.getElementsByTagName("stop"),F(Rt[Rt.length-1],{"stop-opacity":V}));break}default:j=="font-size"&&(V=g(V,10)+"px");var jt=j.replace(/(\-.)/g,function(Ut){return Ut.substring(1).toUpperCase()});S.style[jt]=V,L._.dirty=1,S.setAttribute(j,V)}}gt(L,E),S.style.visibility=B},gt=function(L,E){if(L.type=="text"&&(E[l]("text")||E[l]("font")||E[l]("font-size")||E[l]("x")||E[l]("y"))){var S=L.attrs,R=L.node,B=R.firstChild?g(o._g.doc.defaultView.getComputedStyle(R.firstChild,P).getPropertyValue("font-size"),10):10;if(E[l]("text")){for(S.text=E.text;R.firstChild;)R.removeChild(R.firstChild);for(var j,V=c(E.text).split(`
21
+ `),et=[],Y=0,it=V.length;Y<it;Y++)j=F("tspan"),Y&&F(j,{dy:1.2*B,x:S.x}),j.appendChild(o._g.doc.createTextNode(V[Y])),R.appendChild(j),et[Y]=j}else for(Y=0,it=(et=R.getElementsByTagName("tspan")).length;Y<it;Y++)Y?F(et[Y],{dy:1.2*B,x:S.x}):F(et[0],{dy:0});F(R,{x:S.x,y:S.y}),L._.dirty=1;var pt=L._getBBox(),vt=S.y-(pt.y+pt.height/2);vt&&o.is(vt,"finite")&&F(et[0],{dy:vt})}},Et=function(L){return L.parentNode&&L.parentNode.tagName.toLowerCase()==="a"?L.parentNode:L},kt=function(L,E){this[0]=this.node=L,L.raphael=!0,this.id=("0000"+(Math.random()*Math.pow(36,5)<<0).toString(36)).slice(-5),L.raphaelid=this.id,this.matrix=o.matrix(),this.realPath=null,this.paper=E,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!E.bottom&&(E.bottom=this),this.prev=E.top,E.top&&(E.top.next=this),E.top=this,this.next=null},tt=o.el;kt.prototype=tt,tt.constructor=kt,o._engine.path=function(L,E){var S=F("path");E.canvas&&E.canvas.appendChild(S);var R=new kt(S,E);return R.type="path",ft(R,{fill:"none",stroke:"#000",path:L}),R},tt.rotate=function(L,E,S){if(this.removed)return this;if((L=c(L).split(C)).length-1&&(E=u(L[1]),S=u(L[2])),L=u(L[0]),S==null&&(E=S),E==null||S==null){var R=this.getBBox(1);E=R.x+R.width/2,S=R.y+R.height/2}return this.transform(this._.transform.concat([["r",L,E,S]])),this},tt.scale=function(L,E,S,R){if(this.removed)return this;if((L=c(L).split(C)).length-1&&(E=u(L[1]),S=u(L[2]),R=u(L[3])),L=u(L[0]),E==null&&(E=L),R==null&&(S=R),S==null||R==null)var B=this.getBBox(1);return S=S??B.x+B.width/2,R=R??B.y+B.height/2,this.transform(this._.transform.concat([["s",L,E,S,R]])),this},tt.translate=function(L,E){return this.removed?this:((L=c(L).split(C)).length-1&&(E=u(L[1])),L=u(L[0])||0,E=+E||0,this.transform(this._.transform.concat([["t",L,E]])),this)},tt.transform=function(L){var E=this._;if(L==null)return E.transform;if(o._extractTransform(this,L),this.clip&&F(this.clip,{transform:this.matrix.invert()}),this.pattern&&$(this),this.node&&F(this.node,{transform:this.matrix}),E.sx!=1||E.sy!=1){var S=this.attrs[l]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":S})}return this},tt.hide=function(){return this.removed||(this.node.style.display="none"),this},tt.show=function(){return this.removed||(this.node.style.display=""),this},tt.remove=function(){var L=Et(this.node);if(!this.removed&&L.parentNode){var E=this.paper;for(var S in E.__set__&&E.__set__.exclude(this),A.unbind("raphael.*.*."+this.id),this.gradient&&E.defs.removeChild(this.gradient),o._tear(this,E),L.parentNode.removeChild(L),this.removeData(),this)this[S]=typeof this[S]=="function"?o._removedFactory(S):null;this.removed=!0}},tt._getBBox=function(){if(this.node.style.display=="none"){this.show();var L=!0}var E,S=!1;this.paper.canvas.parentElement?E=this.paper.canvas.parentElement.style:this.paper.canvas.parentNode&&(E=this.paper.canvas.parentNode.style),E&&E.display=="none"&&(S=!0,E.display="");var R={};try{R=this.node.getBBox()}catch{R={x:this.node.clientLeft,y:this.node.clientTop,width:this.node.clientWidth,height:this.node.clientHeight}}finally{R=R||{},S&&(E.display="none")}return L&&this.hide(),R},tt.attr=function(L,E){if(this.removed)return this;if(L==null){var S={};for(var R in this.attrs)this.attrs[l](R)&&(S[R]=this.attrs[R]);return S.gradient&&S.fill=="none"&&(S.fill=S.gradient)&&delete S.gradient,S.transform=this._.transform,S}if(E==null&&o.is(L,"string")){if(L=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;if(L=="transform")return this._.transform;for(var B=L.split(C),j={},V=0,et=B.length;V<et;V++)(L=B[V])in this.attrs?j[L]=this.attrs[L]:o.is(this.paper.customAttributes[L],"function")?j[L]=this.paper.customAttributes[L].def:j[L]=o._availableAttrs[L];return et-1?j:j[B[0]]}if(E==null&&o.is(L,"array")){for(j={},V=0,et=L.length;V<et;V++)j[L[V]]=this.attr(L[V]);return j}if(E!=null){var Y={};Y[L]=E}else L!=null&&o.is(L,"object")&&(Y=L);for(var it in Y)A("raphael.attr."+it+"."+this.id,this,Y[it]);for(it in this.paper.customAttributes)if(this.paper.customAttributes[l](it)&&Y[l](it)&&o.is(this.paper.customAttributes[it],"function")){var pt=this.paper.customAttributes[it].apply(this,[].concat(Y[it]));for(var vt in this.attrs[it]=Y[it],pt)pt[l](vt)&&(Y[vt]=pt[vt])}return ft(this,Y),this},tt.toFront=function(){if(this.removed)return this;var L=Et(this.node);L.parentNode.appendChild(L);var E=this.paper;return E.top!=this&&o._tofront(this,E),this},tt.toBack=function(){if(this.removed)return this;var L=Et(this.node),E=L.parentNode;return E.insertBefore(L,E.firstChild),o._toback(this,this.paper),this.paper,this},tt.insertAfter=function(L){if(this.removed||!L)return this;var E=Et(this.node),S=Et(L.node||L[L.length-1].node);return S.nextSibling?S.parentNode.insertBefore(E,S.nextSibling):S.parentNode.appendChild(E),o._insertafter(this,L,this.paper),this},tt.insertBefore=function(L){if(this.removed||!L)return this;var E=Et(this.node),S=Et(L.node||L[0].node);return S.parentNode.insertBefore(E,S),o._insertbefore(this,L,this.paper),this},tt.blur=function(L){var E=this;if(+L!=0){var S=F("filter"),R=F("feGaussianBlur");E.attrs.blur=L,S.id=o.createUUID(),F(R,{stdDeviation:+L||1.5}),S.appendChild(R),E.paper.defs.appendChild(S),E._blur=S,F(E.node,{filter:"url(#"+S.id+")"})}else E._blur&&(E._blur.parentNode.removeChild(E._blur),delete E._blur,delete E.attrs.blur),E.node.removeAttribute("filter");return E},o._engine.circle=function(L,E,S,R){var B=F("circle");L.canvas&&L.canvas.appendChild(B);var j=new kt(B,L);return j.attrs={cx:E,cy:S,r:R,fill:"none",stroke:"#000"},j.type="circle",F(B,j.attrs),j},o._engine.rect=function(L,E,S,R,B,j){var V=F("rect");L.canvas&&L.canvas.appendChild(V);var et=new kt(V,L);return et.attrs={x:E,y:S,width:R,height:B,rx:j||0,ry:j||0,fill:"none",stroke:"#000"},et.type="rect",F(V,et.attrs),et},o._engine.ellipse=function(L,E,S,R,B){var j=F("ellipse");L.canvas&&L.canvas.appendChild(j);var V=new kt(j,L);return V.attrs={cx:E,cy:S,rx:R,ry:B,fill:"none",stroke:"#000"},V.type="ellipse",F(j,V.attrs),V},o._engine.image=function(L,E,S,R,B,j){var V=F("image");F(V,{x:S,y:R,width:B,height:j,preserveAspectRatio:"none"}),V.setAttributeNS(D,"href",E),L.canvas&&L.canvas.appendChild(V);var et=new kt(V,L);return et.attrs={x:S,y:R,width:B,height:j,src:E},et.type="image",et},o._engine.text=function(L,E,S,R){var B=F("text");L.canvas&&L.canvas.appendChild(B);var j=new kt(B,L);return j.attrs={x:E,y:S,"text-anchor":"middle",text:R,"font-family":o._availableAttrs["font-family"],"font-size":o._availableAttrs["font-size"],stroke:"none",fill:"#000"},j.type="text",ft(j,j.attrs),j},o._engine.setSize=function(L,E){return this.width=L||this.width,this.height=E||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},o._engine.create=function(){var L=o._getContainer.apply(0,arguments),E=L&&L.container;if(!E)throw new Error("SVG container not found.");var S,R=L.x,B=L.y,j=L.width,V=L.height,et=F("svg"),Y="overflow:hidden;";return R=R||0,B=B||0,F(et,{height:V=V||342,version:1.1,width:j=j||512,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}),E==1?(et.style.cssText=Y+"position:absolute;left:"+R+"px;top:"+B+"px",o._g.doc.body.appendChild(et),S=1):(et.style.cssText=Y+"position:relative",E.firstChild?E.insertBefore(et,E.firstChild):E.appendChild(et)),(E=new o._Paper).width=j,E.height=V,E.canvas=et,E.clear(),E._left=E._top=0,S&&(E.renderfix=function(){}),E.renderfix(),E},o._engine.setViewBox=function(L,E,S,R,B){A("raphael.setViewBox",this,this._viewBox,[L,E,S,R,B]);var j,V,et=this.getSize(),Y=d(S/et.width,R/et.height),it=this.top,pt=B?"xMidYMid meet":"xMinYMin";for(L==null?(this._vbSize&&(Y=1),delete this._vbSize,j="0 0 "+this.width+M+this.height):(this._vbSize=Y,j=L+M+E+M+S+M+R),F(this.canvas,{viewBox:j,preserveAspectRatio:pt});Y&&it;)V="stroke-width"in it.attrs?it.attrs["stroke-width"]:1,it.attr({"stroke-width":V}),it._.dirty=1,it._.dirtyT=1,it=it.prev;return this._viewBox=[L,E,S,R,!!B],this},o.prototype.renderfix=function(){var L,E=this.canvas,S=E.style;try{L=E.getScreenCTM()||E.createSVGMatrix()}catch{L=E.createSVGMatrix()}var R=-L.e%1,B=-L.f%1;(R||B)&&(R&&(this._left=(this._left+R)%1,S.left=this._left+"px"),B&&(this._top=(this._top+B)%1,S.top=this._top+"px"))},o.prototype.clear=function(){o.eve("raphael.clear",this);for(var L=this.canvas;L.firstChild;)L.removeChild(L.firstChild);this.bottom=this.top=null,(this.desc=F("desc")).appendChild(o._g.doc.createTextNode("Created with Raphaël "+o.version)),L.appendChild(this.desc),L.appendChild(this.defs=F("defs"))},o.prototype.remove=function(){for(var L in A("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this)this[L]=typeof this[L]=="function"?o._removedFactory(L):null};var st=o.st;for(var ht in tt)tt[l](ht)&&!st[l](ht)&&(st[ht]=function(L){return function(){var E=arguments;return this.forEach(function(S){S[L].apply(S,E)})}}(ht))}}.apply(i,s))===void 0||(e.exports=a)},function(e,i,r){var s,a;s=[r(0)],(a=function(o){if(!o||o.vml){var l="hasOwnProperty",c=String,u=parseFloat,g=Math,p=g.round,d=g.max,w=g.min,x=g.abs,C=/[, ]+/,A=o.eve,P=" ",M="",D={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},U=/([clmz]),?([^clmz]*)/gi,z=/ progid:\S+Blur\([^\)]+\)/g,F=/-?[^,\s-]+/g,G="position:absolute;left:0;top:0;width:1px;height:1px;behavior:url(#default#VML)",H=21600,$={path:1,rect:1,image:1},X={circle:1,ellipse:1},J=function(E,S,R){var B=o.matrix();return B.rotate(-E,.5,.5),{dx:B.x(S,R),dy:B.y(S,R)}},dt=function(E,S,R,B,j,V){var et=E._,Y=E.matrix,it=et.fillpos,pt=E.node,vt=pt.style,wt=1,At="",xt=H/S,It=H/R;if(vt.visibility="hidden",S&&R){if(pt.coordsize=x(xt)+P+x(It),vt.rotation=V*(S*R<0?-1:1),V){var Mt=J(V,B,j);B=Mt.dx,j=Mt.dy}if(S<0&&(At+="x"),R<0&&(At+=" y")&&(wt=-1),vt.flip=At,pt.coordorigin=B*-xt+P+j*-It,it||et.fillsize){var Dt=pt.getElementsByTagName("fill");Dt=Dt&&Dt[0],pt.removeChild(Dt),it&&(Mt=J(V,Y.x(it[0],it[1]),Y.y(it[0],it[1])),Dt.position=Mt.dx*wt+P+Mt.dy*wt),et.fillsize&&(Dt.size=et.fillsize[0]*x(S)+P+et.fillsize[1]*x(R)),pt.appendChild(Dt)}vt.visibility="visible"}};o.toString=function(){return`Your browser doesn’t support SVG. Falling down to VML.
22
+ You are running Raphaël `+this.version};var ft,gt=function(E,S,R){for(var B=c(S).toLowerCase().split("-"),j=R?"end":"start",V=B.length,et="classic",Y="medium",it="medium";V--;)switch(B[V]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":et=B[V];break;case"wide":case"narrow":it=B[V];break;case"long":case"short":Y=B[V]}var pt=E.node.getElementsByTagName("stroke")[0];pt[j+"arrow"]=et,pt[j+"arrowlength"]=Y,pt[j+"arrowwidth"]=it},Et=function(E,S){E.attrs=E.attrs||{};var R=E.node,B=E.attrs,j=R.style,V=$[E.type]&&(S.x!=B.x||S.y!=B.y||S.width!=B.width||S.height!=B.height||S.cx!=B.cx||S.cy!=B.cy||S.rx!=B.rx||S.ry!=B.ry||S.r!=B.r),et=X[E.type]&&(B.cx!=S.cx||B.cy!=S.cy||B.r!=S.r||B.rx!=S.rx||B.ry!=S.ry),Y=E;for(var it in S)S[l](it)&&(B[it]=S[it]);if(V&&(B.path=o._getPath[E.type](E),E._.dirty=1),S.href&&(R.href=S.href),S.title&&(R.title=S.title),S.target&&(R.target=S.target),S.cursor&&(j.cursor=S.cursor),"blur"in S&&E.blur(S.blur),(S.path&&E.type=="path"||V)&&(R.path=function(qt){var Re=/[ahqstv]/gi,un=o._pathToAbsolute;if(c(qt).match(Re)&&(un=o._path2curve),Re=/[clmz]/g,un==o._pathToAbsolute&&!c(qt).match(Re)){var ae=c(qt).replace(U,function(Er,pn,$e){var Oe=[],Jn=pn.toLowerCase()=="m",qe=D[pn];return $e.replace(F,function(Ze){Jn&&Oe.length==2&&(qe+=Oe+D[pn=="m"?"l":"L"],Oe=[]),Oe.push(p(Ze*H))}),qe+Oe});return ae}var Te,de,Pn=un(qt);ae=[];for(var Ye=0,dn=Pn.length;Ye<dn;Ye++){Te=Pn[Ye],(de=Pn[Ye][0].toLowerCase())=="z"&&(de="x");for(var ye=1,Qt=Te.length;ye<Qt;ye++)de+=p(Te[ye]*H)+(ye!=Qt-1?",":M);ae.push(de)}return ae.join(P)}(~c(B.path).toLowerCase().indexOf("r")?o._pathToAbsolute(B.path):B.path),E._.dirty=1,E.type=="image"&&(E._.fillpos=[B.x,B.y],E._.fillsize=[B.width,B.height],dt(E,1,1,0,0,0))),"transform"in S&&E.transform(S.transform),et){var pt=+B.cx,vt=+B.cy,wt=+B.rx||+B.r||0,At=+B.ry||+B.r||0;R.path=o.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",p((pt-wt)*H),p((vt-At)*H),p((pt+wt)*H),p((vt+At)*H),p(pt*H)),E._.dirty=1}if("clip-rect"in S){var xt=c(S["clip-rect"]).split(C);if(xt.length==4){xt[2]=+xt[2]+ +xt[0],xt[3]=+xt[3]+ +xt[1];var It=R.clipRect||o._g.doc.createElement("div"),Mt=It.style;Mt.clip=o.format("rect({1}px {2}px {3}px {0}px)",xt),R.clipRect||(Mt.position="absolute",Mt.top=0,Mt.left=0,Mt.width=E.paper.width+"px",Mt.height=E.paper.height+"px",R.parentNode.insertBefore(It,R),It.appendChild(R),R.clipRect=It)}S["clip-rect"]||R.clipRect&&(R.clipRect.style.clip="auto")}if(E.textpath){var Dt=E.textpath.style;S.font&&(Dt.font=S.font),S["font-family"]&&(Dt.fontFamily='"'+S["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,M)+'"'),S["font-size"]&&(Dt.fontSize=S["font-size"]),S["font-weight"]&&(Dt.fontWeight=S["font-weight"]),S["font-style"]&&(Dt.fontStyle=S["font-style"])}if("arrow-start"in S&&gt(Y,S["arrow-start"]),"arrow-end"in S&&gt(Y,S["arrow-end"],1),S.opacity!=null||S.fill!=null||S.src!=null||S.stroke!=null||S["stroke-width"]!=null||S["stroke-opacity"]!=null||S["fill-opacity"]!=null||S["stroke-dasharray"]!=null||S["stroke-miterlimit"]!=null||S["stroke-linejoin"]!=null||S["stroke-linecap"]!=null){var _t=R.getElementsByTagName("fill");if(!(_t=_t&&_t[0])&&(_t=ft("fill")),E.type=="image"&&S.src&&(_t.src=S.src),S.fill&&(_t.on=!0),_t.on!=null&&S.fill!="none"&&S.fill!==null||(_t.on=!1),_t.on&&S.fill){var zt=c(S.fill).match(o._ISURL);if(zt){_t.parentNode==R&&R.removeChild(_t),_t.rotate=!0,_t.src=zt[1],_t.type="tile";var Rt=E.getBBox(1);_t.position=Rt.x+P+Rt.y,E._.fillpos=[Rt.x,Rt.y],o._preload(zt[1],function(){E._.fillsize=[this.offsetWidth,this.offsetHeight]})}else _t.color=o.getRGB(S.fill).hex,_t.src=M,_t.type="solid",o.getRGB(S.fill).error&&(Y.type in{circle:1,ellipse:1}||c(S.fill).charAt()!="r")&&kt(Y,S.fill,_t)&&(B.fill="none",B.gradient=S.fill,_t.rotate=!1)}if("fill-opacity"in S||"opacity"in S){var jt=((+B["fill-opacity"]+1||2)-1)*((+B.opacity+1||2)-1)*((+o.getRGB(S.fill).o+1||2)-1);jt=w(d(jt,0),1),_t.opacity=jt,_t.src&&(_t.color="none")}R.appendChild(_t);var Ut=R.getElementsByTagName("stroke")&&R.getElementsByTagName("stroke")[0],ie=!1;!Ut&&(ie=Ut=ft("stroke")),(S.stroke&&S.stroke!="none"||S["stroke-width"]||S["stroke-opacity"]!=null||S["stroke-dasharray"]||S["stroke-miterlimit"]||S["stroke-linejoin"]||S["stroke-linecap"])&&(Ut.on=!0),(S.stroke=="none"||S.stroke===null||Ut.on==null||S.stroke==0||S["stroke-width"]==0)&&(Ut.on=!1);var Wt=o.getRGB(S.stroke);Ut.on&&S.stroke&&(Ut.color=Wt.hex),jt=((+B["stroke-opacity"]+1||2)-1)*((+B.opacity+1||2)-1)*((+Wt.o+1||2)-1);var Me=.75*(u(S["stroke-width"])||1);if(jt=w(d(jt,0),1),S["stroke-width"]==null&&(Me=B["stroke-width"]),S["stroke-width"]&&(Ut.weight=Me),Me&&Me<1&&(jt*=Me)&&(Ut.weight=1),Ut.opacity=jt,S["stroke-linejoin"]&&(Ut.joinstyle=S["stroke-linejoin"]||"miter"),Ut.miterlimit=S["stroke-miterlimit"]||8,S["stroke-linecap"]&&(Ut.endcap=S["stroke-linecap"]=="butt"?"flat":S["stroke-linecap"]=="square"?"square":"round"),"stroke-dasharray"in S){var fn={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};Ut.dashstyle=fn[l](S["stroke-dasharray"])?fn[S["stroke-dasharray"]]:M}ie&&R.appendChild(Ut)}if(Y.type=="text"){Y.paper.canvas.style.display=M;var Ce=Y.paper.span,je=B.font&&B.font.match(/\d+(?:\.\d*)?(?=px)/);j=Ce.style,B.font&&(j.font=B.font),B["font-family"]&&(j.fontFamily=B["font-family"]),B["font-weight"]&&(j.fontWeight=B["font-weight"]),B["font-style"]&&(j.fontStyle=B["font-style"]),je=u(B["font-size"]||je&&je[0])||10,j.fontSize=100*je+"px",Y.textpath.string&&(Ce.innerHTML=c(Y.textpath.string).replace(/</g,"&#60;").replace(/&/g,"&#38;").replace(/\n/g,"<br>"));var Xe=Ce.getBoundingClientRect();Y.W=B.w=(Xe.right-Xe.left)/100,Y.H=B.h=(Xe.bottom-Xe.top)/100,Y.X=B.x,Y.Y=B.y+Y.H/2,("x"in S||"y"in S)&&(Y.path.v=o.format("m{0},{1}l{2},{1}",p(B.x*H),p(B.y*H),p(B.x*H)+1));for(var Le=["x","y","text","font","font-family","font-weight","font-style","font-size"],De=0,Wn=Le.length;De<Wn;De++)if(Le[De]in S){Y._.dirty=1;break}switch(B["text-anchor"]){case"start":Y.textpath.style["v-text-align"]="left",Y.bbx=Y.W/2;break;case"end":Y.textpath.style["v-text-align"]="right",Y.bbx=-Y.W/2;break;default:Y.textpath.style["v-text-align"]="center",Y.bbx=0}Y.textpath.style["v-text-kern"]=!0}},kt=function(E,S,R){E.attrs=E.attrs||{},E.attrs;var B=Math.pow,j="linear",V=".5 .5";if(E.attrs.gradient=S,S=(S=c(S).replace(o._radial_gradient,function(wt,At,xt){return j="radial",At&&xt&&(At=u(At),xt=u(xt),B(At-.5,2)+B(xt-.5,2)>.25&&(xt=g.sqrt(.25-B(At-.5,2))*(2*(xt>.5)-1)+.5),V=At+P+xt),M})).split(/\s*\-\s*/),j=="linear"){var et=S.shift();if(et=-u(et),isNaN(et))return null}var Y=o._parseDots(S);if(!Y)return null;if(E=E.shape||E.node,Y.length){E.removeChild(R),R.on=!0,R.method="none",R.color=Y[0].color,R.color2=Y[Y.length-1].color;for(var it=[],pt=0,vt=Y.length;pt<vt;pt++)Y[pt].offset&&it.push(Y[pt].offset+P+Y[pt].color);R.colors=it.length?it.join():"0% "+R.color,j=="radial"?(R.type="gradientTitle",R.focus="100%",R.focussize="0 0",R.focusposition=V,R.angle=0):(R.type="gradient",R.angle=(270-et)%360),E.appendChild(R)}return 1},tt=function(E,S){this[0]=this.node=E,E.raphael=!0,this.id=o._oid++,E.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=S,this.matrix=o.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!S.bottom&&(S.bottom=this),this.prev=S.top,S.top&&(S.top.next=this),S.top=this,this.next=null},st=o.el;tt.prototype=st,st.constructor=tt,st.transform=function(E){if(E==null)return this._.transform;var S,R=this.paper._viewBoxShift,B=R?"s"+[R.scale,R.scale]+"-1-1t"+[R.dx,R.dy]:M;R&&(S=E=c(E).replace(/\.{3}|\u2026/g,this._.transform||M)),o._extractTransform(this,B+E);var j,V=this.matrix.clone(),et=this.skew,Y=this.node,it=~c(this.attrs.fill).indexOf("-"),pt=!c(this.attrs.fill).indexOf("url(");if(V.translate(1,1),pt||it||this.type=="image")if(et.matrix="1 0 0 1",et.offset="0 0",j=V.split(),it&&j.noRotation||!j.isSimple){Y.style.filter=V.toFilter();var vt=this.getBBox(),wt=this.getBBox(1),At=vt.x-wt.x,xt=vt.y-wt.y;Y.coordorigin=At*-H+P+xt*-H,dt(this,1,1,At,xt,0)}else Y.style.filter=M,dt(this,j.scalex,j.scaley,j.dx,j.dy,j.rotate);else Y.style.filter=M,et.matrix=c(V),et.offset=V.offset();return S!==null&&(this._.transform=S,o._extractTransform(this,S)),this},st.rotate=function(E,S,R){if(this.removed)return this;if(E!=null){if((E=c(E).split(C)).length-1&&(S=u(E[1]),R=u(E[2])),E=u(E[0]),R==null&&(S=R),S==null||R==null){var B=this.getBBox(1);S=B.x+B.width/2,R=B.y+B.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",E,S,R]])),this}},st.translate=function(E,S){return this.removed?this:((E=c(E).split(C)).length-1&&(S=u(E[1])),E=u(E[0])||0,S=+S||0,this._.bbox&&(this._.bbox.x+=E,this._.bbox.y+=S),this.transform(this._.transform.concat([["t",E,S]])),this)},st.scale=function(E,S,R,B){if(this.removed)return this;if((E=c(E).split(C)).length-1&&(S=u(E[1]),R=u(E[2]),B=u(E[3]),isNaN(R)&&(R=null),isNaN(B)&&(B=null)),E=u(E[0]),S==null&&(S=E),B==null&&(R=B),R==null||B==null)var j=this.getBBox(1);return R=R??j.x+j.width/2,B=B??j.y+j.height/2,this.transform(this._.transform.concat([["s",E,S,R,B]])),this._.dirtyT=1,this},st.hide=function(){return!this.removed&&(this.node.style.display="none"),this},st.show=function(){return!this.removed&&(this.node.style.display=M),this},st.auxGetBBox=o.el.getBBox,st.getBBox=function(){var E=this.auxGetBBox();if(this.paper&&this.paper._viewBoxShift){var S={},R=1/this.paper._viewBoxShift.scale;return S.x=E.x-this.paper._viewBoxShift.dx,S.x*=R,S.y=E.y-this.paper._viewBoxShift.dy,S.y*=R,S.width=E.width*R,S.height=E.height*R,S.x2=S.x+S.width,S.y2=S.y+S.height,S}return E},st._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},st.remove=function(){if(!this.removed&&this.node.parentNode){for(var E in this.paper.__set__&&this.paper.__set__.exclude(this),o.eve.unbind("raphael.*.*."+this.id),o._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape),this)this[E]=typeof this[E]=="function"?o._removedFactory(E):null;this.removed=!0}},st.attr=function(E,S){if(this.removed)return this;if(E==null){var R={};for(var B in this.attrs)this.attrs[l](B)&&(R[B]=this.attrs[B]);return R.gradient&&R.fill=="none"&&(R.fill=R.gradient)&&delete R.gradient,R.transform=this._.transform,R}if(S==null&&o.is(E,"string")){if(E=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;for(var j=E.split(C),V={},et=0,Y=j.length;et<Y;et++)(E=j[et])in this.attrs?V[E]=this.attrs[E]:o.is(this.paper.customAttributes[E],"function")?V[E]=this.paper.customAttributes[E].def:V[E]=o._availableAttrs[E];return Y-1?V:V[j[0]]}if(this.attrs&&S==null&&o.is(E,"array")){for(V={},et=0,Y=E.length;et<Y;et++)V[E[et]]=this.attr(E[et]);return V}var it;for(var pt in S!=null&&((it={})[E]=S),S==null&&o.is(E,"object")&&(it=E),it)A("raphael.attr."+pt+"."+this.id,this,it[pt]);if(it){for(pt in this.paper.customAttributes)if(this.paper.customAttributes[l](pt)&&it[l](pt)&&o.is(this.paper.customAttributes[pt],"function")){var vt=this.paper.customAttributes[pt].apply(this,[].concat(it[pt]));for(var wt in this.attrs[pt]=it[pt],vt)vt[l](wt)&&(it[wt]=vt[wt])}it.text&&this.type=="text"&&(this.textpath.string=it.text),Et(this,it)}return this},st.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&o._tofront(this,this.paper),this},st.toBack=function(){return this.removed?this:(this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),o._toback(this,this.paper)),this)},st.insertAfter=function(E){return this.removed?this:(E.constructor==o.st.constructor&&(E=E[E.length-1]),E.node.nextSibling?E.node.parentNode.insertBefore(this.node,E.node.nextSibling):E.node.parentNode.appendChild(this.node),o._insertafter(this,E,this.paper),this)},st.insertBefore=function(E){return this.removed?this:(E.constructor==o.st.constructor&&(E=E[0]),E.node.parentNode.insertBefore(this.node,E.node),o._insertbefore(this,E,this.paper),this)},st.blur=function(E){var S=this.node.runtimeStyle,R=S.filter;return R=R.replace(z,M),+E!=0?(this.attrs.blur=E,S.filter=R+P+" progid:DXImageTransform.Microsoft.Blur(pixelradius="+(+E||1.5)+")",S.margin=o.format("-{0}px 0 0 -{0}px",p(+E||1.5))):(S.filter=R,S.margin=0,delete this.attrs.blur),this},o._engine.path=function(E,S){var R=ft("shape");R.style.cssText=G,R.coordsize=H+P+H,R.coordorigin=S.coordorigin;var B=new tt(R,S),j={fill:"none",stroke:"#000"};E&&(j.path=E),B.type="path",B.path=[],B.Path=M,Et(B,j),S.canvas&&S.canvas.appendChild(R);var V=ft("skew");return V.on=!0,R.appendChild(V),B.skew=V,B.transform(M),B},o._engine.rect=function(E,S,R,B,j,V){var et=o._rectPath(S,R,B,j,V),Y=E.path(et),it=Y.attrs;return Y.X=it.x=S,Y.Y=it.y=R,Y.W=it.width=B,Y.H=it.height=j,it.r=V,it.path=et,Y.type="rect",Y},o._engine.ellipse=function(E,S,R,B,j){var V=E.path();return V.attrs,V.X=S-B,V.Y=R-j,V.W=2*B,V.H=2*j,V.type="ellipse",Et(V,{cx:S,cy:R,rx:B,ry:j}),V},o._engine.circle=function(E,S,R,B){var j=E.path();return j.attrs,j.X=S-B,j.Y=R-B,j.W=j.H=2*B,j.type="circle",Et(j,{cx:S,cy:R,r:B}),j},o._engine.image=function(E,S,R,B,j,V){var et=o._rectPath(R,B,j,V),Y=E.path(et).attr({stroke:"none"}),it=Y.attrs,pt=Y.node,vt=pt.getElementsByTagName("fill")[0];return it.src=S,Y.X=it.x=R,Y.Y=it.y=B,Y.W=it.width=j,Y.H=it.height=V,it.path=et,Y.type="image",vt.parentNode==pt&&pt.removeChild(vt),vt.rotate=!0,vt.src=S,vt.type="tile",Y._.fillpos=[R,B],Y._.fillsize=[j,V],pt.appendChild(vt),dt(Y,1,1,0,0,0),Y},o._engine.text=function(E,S,R,B){var j=ft("shape"),V=ft("path"),et=ft("textpath");S=S||0,R=R||0,B=B||"",V.v=o.format("m{0},{1}l{2},{1}",p(S*H),p(R*H),p(S*H)+1),V.textpathok=!0,et.string=c(B),et.on=!0,j.style.cssText=G,j.coordsize=H+P+H,j.coordorigin="0 0";var Y=new tt(j,E),it={fill:"#000",stroke:"none",font:o._availableAttrs.font,text:B};Y.shape=j,Y.path=V,Y.textpath=et,Y.type="text",Y.attrs.text=c(B),Y.attrs.x=S,Y.attrs.y=R,Y.attrs.w=1,Y.attrs.h=1,Et(Y,it),j.appendChild(et),j.appendChild(V),E.canvas.appendChild(j);var pt=ft("skew");return pt.on=!0,j.appendChild(pt),Y.skew=pt,Y.transform(M),Y},o._engine.setSize=function(E,S){var R=this.canvas.style;return this.width=E,this.height=S,E==+E&&(E+="px"),S==+S&&(S+="px"),R.width=E,R.height=S,R.clip="rect(0 "+E+" "+S+" 0)",this._viewBox&&o._engine.setViewBox.apply(this,this._viewBox),this},o._engine.setViewBox=function(E,S,R,B,j){o.eve("raphael.setViewBox",this,this._viewBox,[E,S,R,B,j]);var V,et,Y=this.getSize(),it=Y.width,pt=Y.height;return j&&(R*(V=pt/B)<it&&(E-=(it-R*V)/2/V),B*(et=it/R)<pt&&(S-=(pt-B*et)/2/et)),this._viewBox=[E,S,R,B,!!j],this._viewBoxShift={dx:-E,dy:-S,scale:Y},this.forEach(function(vt){vt.transform("...")}),this},o._engine.initWin=function(E){var S=E.document;S.styleSheets.length<31?S.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"):S.styleSheets[0].addRule(".rvml","behavior:url(#default#VML)");try{!S.namespaces.rvml&&S.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),ft=function(R){return S.createElement("<rvml:"+R+' class="rvml">')}}catch{ft=function(B){return S.createElement("<"+B+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},o._engine.initWin(o._g.win),o._engine.create=function(){var E=o._getContainer.apply(0,arguments),S=E.container,R=E.height,B=E.width,j=E.x,V=E.y;if(!S)throw new Error("VML container not found.");var et=new o._Paper,Y=et.canvas=o._g.doc.createElement("div"),it=Y.style;return j=j||0,V=V||0,B=B||512,R=R||342,et.width=B,et.height=R,B==+B&&(B+="px"),R==+R&&(R+="px"),et.coordsize=216e5+P+216e5,et.coordorigin="0 0",et.span=o._g.doc.createElement("span"),et.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",Y.appendChild(et.span),it.cssText=o.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",B,R),S==1?(o._g.doc.body.appendChild(Y),it.left=j+"px",it.top=V+"px",it.position="absolute"):S.firstChild?S.insertBefore(Y,S.firstChild):S.appendChild(Y),et.renderfix=function(){},et},o.prototype.clear=function(){o.eve("raphael.clear",this),this.canvas.innerHTML=M,this.span=o._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},o.prototype.remove=function(){for(var E in o.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas),this)this[E]=typeof this[E]=="function"?o._removedFactory(E):null;return!0};var ht=o.st;for(var L in st)st[l](L)&&!ht[l](L)&&(ht[L]=function(E){return function(){var S=arguments;return this.forEach(function(R){R[E].apply(R,S)})}}(L))}}.apply(i,s))===void 0||(e.exports=a)}])})})(uo);var Rh=uo.exports;const Kt=ji(Rh);class gi{points;constructor(t=[]){this.points=t}toSVGPathData(){const t=[];for(let e=0,i=this.length;e<i;e++)t.push([e===0?"M":"L",this.points[e].x,this.points[e].y]);return t}toSVGPathD(){let t="";for(let e=0,i=this.length;e<i;e++)t+=(e===0?"M":"L")+this.points[e].x+","+this.points[e].y;return t}get length(){return this.points.length}addPoint(t){this.points.push(t)}getPoint(t){return this.points[t]}isContainPoint(t){const e=t.x,i=t.y,r=this.length;let s=!1;const a=2e-10;for(let o=0,l=r-1;o<r;l=o,o++){const c=this.points[o].x,u=this.points[o].y,g=this.points[l].x,p=this.points[l].y;if(c===e&&u===i||g===e&&p===i||i===u&&i===p)return!0;if(i>=u&&i<p||i<u&&i>=p){const d=(g-c)/(p-u),w=c+d*(i-u);if(w===e||Math.abs(w-e)<a)return!0;w>e&&(s=!s)}}return s}[Symbol.iterator](){let t=0;return{next:()=>({value:t>=this.length-1?this.points[++t]:void 0,done:t>=this.length})}}static generateInMultiplePoint(t,e,i,r,s=1){const a=new gi;for(let o=0;o<=s*i;o+=1){const l=Math.floor(o/s)/i*2*Math.PI,c=t+Math.cos(l)*r,u=e+Math.sin(l)*r;a.addPoint(new Ee({x:c,y:u}))}return a}}Kt.easing_formulas.swing=function(n){return n+Math.sin(n*Math.PI*2)/2},Kt.easing_formulas.may_cause_seizures=function(n){return n+.2*Math.random()-.1};function Oh(n,t,e){let i;return n&&typeof n=="object"&&n.canvas?i=n:n&&(typeof n=="string"||n instanceof HTMLElement)?i=Kt(n,t,e):i=Kt(0,0,t,e),i}Kt.fn.importSVG=function(n,t){const e=Fh.fromRawSVG(n);return e.toRaphael(this,(i,r)=>{e.save(),t&&t(i),r(),e.restore()}),this},Kt.fn.NPolygonPath=function(n,t,e,i,r=2){return{shape:this.path(gi.generateInMultiplePoint(n,t,e,i,r).toSVGPathD()),afterPath:gi.generateInMultiplePoint(n,t,e*r,i,1).toSVGPathD()}},Kt.fn.zoom=function(n=1){return this.setViewBox(0,0,this.width/n,this.height/n),this},Kt.fn.brickwall=function(n,t,e,i,r){for(var s=i/r,a=e/3,o={fill:"firebrick",stroke:"#CCC"},l=0;l<r;l+=1){var c=this.rect(0,0,a,s).attr(o),u=this.rect(0,0,2*a,s).attr(o);l%2?(c.transform("T"+n+","+(t+l*s)),u.transform("T"+(n+a)+","+(t+l*s))):(u.transform("T"+n+","+(t+l*s)),c.transform("T"+(n+2*a)+","+(t+l*s)))}},Kt.fn.rosetta=function(n,t,e,i,r){const s=wn.generateRosetta(n,t,e,i,r);return s.center,this.path(s.toSVGPathD())},Kt.fn.moon=function(n){n=n||{},n.r=typeof n.r=="number"?n.r:100,n.phase=typeof n.phase=="number"?n.phase:.25,n.x=typeof n.x=="number"?n.x:0,n.y=typeof n.y=="number"?n.y:0,this.circle(n.r+n.x,n.r+n.y,n.r).attr({"stroke-width":0,fill:"#999"});function t(i){i=typeof i=="number"?i:.25,i=Math.max(0,Math.min(1,i)),i=(i-.5)*2;let r="M"+n.r+",0";r+="a"+n.r+","+n.r+" 0 0,0 0,"+n.r*2;let s=i>0?0:1;return i=Math.abs(i),i=i||1e-4,n.inner_r=n.r/Math.pow(i,.5),r+="M"+n.r+","+n.r*2,r+="a"+n.inner_r+","+n.inner_r+" 0 0,"+s+" 0,"+n.r*-2,r}var e=this.path(t(n.phase)).attr({"stroke-width":0,stroke:"#999",fill:"#FF9"}).transform("T"+n.x+","+n.y);return{setPhase:function(i){e.attr("path",t(i))}}},Kt.fn.star=function(n,t,e){let i="M"+n+","+(t-e);for(var r=0;r<6;r+=1){const s=270+r*144,a=n+e*Math.cos(s*Math.PI/180),o=t+e*Math.sin(s*Math.PI/180);i+="L"+a+","+o}return this.path(i).attr("stroke-width",0).attr("fill","red")},Kt.fn.heart=function(n=150,t=300){let e="M"+n+","+t;return e+="l120,-175a50,50 0 0,0 -120,-75a50,50 0 0,0 -120,75l120,175",this.path(e).attr("stroke","red").attr("fill","pink")},Kt.el.redder=function(){const n=Kt.getRGB(this.attr("fill"));n.r+=51,this.attr("fill","rgb("+n.r+","+n.g+","+n.b+")")},Kt.installCustomAttributes=function(n){n.customAttributes.redness=function(t){const e=255*(1-t/100);return{fill:"rgb(255,"+e+", "+e+")"}},n.customAttributes.progress=function(t){const e=this.data("progresspath"),i=this.attr(),r={x:0,y:0},s=this.data("progresstrail");if(!e)return{transform:"t0,0"};Object.prototype.hasOwnProperty.call(i,"width")&&(r.x=-this.attr("width")/2,r.y=-this.attr("height")/2);const a=e.getTotalLength(),o=e.getPointAtLength(t*a);return s&&s.attr("path",e.getSubpath(0,t*a)),{transform:"t"+(o.x+r.x)+","+(o.y+r.y)+"r"+o.alpha}}};const hs=Kt;class nn{pgs=[];history=[];save(){this.history.push(ca(this.pgs))}restore(){const t=this.history.pop();t&&(this.pgs=t)}get size(){let t=0,e=0;return this.pgs.forEach(i=>{const r=i.pg;if(r){const[s,a,o,l]=r.bounds,[c,u]=r.size;t=Math.max(t,s,s+c,o),e=Math.max(e,a,a+u,l)}}),[Math.ceil(t),Math.ceil(e)]}static fromRawSVG(t){return nn.fromRawSVGUseRappar(t)}static fromRawSVGUseRappar(t){const e=new nn,i=Za(t);for(let r=0,s=i.length;r<s;r++){const a=i[r];if(a.type=="viewbox"&&a.width&&a.height)continue;const o={attrs:{}};for(const l in a)l==="type"||l==="path"||l==="transform"||(o.attrs[l]=a[l]);switch(a.type){case"path":o.d=a.path,o.pg=wn.fromSVGPathD(a.path,a.transform);break}e.pgs.push(o)}return e}toRaphael(t,e){let i;t instanceof HTMLElement?i=hs(HTMLElement):typeof t=="string"?i=hs(document.getElementById(t)):i=t;const[r,s]=this.size;i.setSize(r,s);const a=(o=!1)=>{for(let l=0,c=this.pgs.length;l<c;l++){const u=this.pgs[l];if(u.pg&&(u.raphaelPath?u.raphaelPath.attr("path",u.pg.toSVGPathD()):u.raphaelPath=i.path(u.pg.toSVGPathD()),u.raphaelPath.attr(u.attrs)),o&&e){const g=p=>{const{x:d,y:w}=Zi(i.canvas,p),x=this.pgs.find(C=>C.raphaelPath?.isPointInside(d,w));x&&e?.(x,a)};u.raphaelPath?.unclick(g),u.raphaelPath?.click(g)}}};return a(!0),i}toCanvasOperation(t,e){let i;typeof t=="string"?i=document.getElementById(t):i=t;const[r,s]=this.size;i.width=r,i.height=s;const a=new fs(i),o=()=>{a.clearRect(0,0,r,s);for(let c=0,u=this.pgs.length;c<u;c++){const g=this.pgs[c];g.pg&&(a.save(),this.toCanvasAttrs(a,g.attrs),g.pg.toCanvas(a),g.attrs.stroke!=="none"&&a.stroke(),g.attrs.fill!=="none"&&a.fill(),a.restore())}};o();const l=c=>{const{x:u,y:g}=Zi(a.canvas,c),p=this.pgs.find(d=>d.pg?.isPointInPath(u,g));p&&e?.(p,o)};return i.removeEventListener("click",l),i.addEventListener("click",l),a}toCanvasAttrs(t,e){for(const i in e){const r=e[i];switch(i){case"fill":t.fillStyle=String(r);break;case"stroke":t.strokeStyle=String(r);break;case"stroke-width":t.lineWidth=Number(r);break;case"stroke-linecap":t.lineCap=r;break;case"stroke-linejoin":t.lineJoin=r;break}}}static toDownloadSVGElement(t,e="shape"){Gr(Ta(t),`${e}.svg`)}toDownloadSVGElement(t,e="shape"){return nn.toDownloadSVGElement(t,e),this}static toDownloadSVGString(t,e="shape"){Gr(Br(t),`${e}.svg`)}toDownloadSVGString(t,e="shape"){return nn.toDownloadSVGString(t,e),this}static getSVGDOM(t){if(t instanceof HTMLObjectElement||t instanceof HTMLIFrameElement)return t.contentDocument;if(t instanceof HTMLEmbedElement)return t.getSVGDocument()}}const Fh=nn;class fs{canvas;context;customContext;constructor(t){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),this.customContext=new fi({canvas:this.canvas,width:this.canvas.width,height:this.canvas.height})}set lineWidth(t){this.context.lineWidth=t,this.customContext.lineWidth=t}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.context.lineCap=t,this.customContext.lineCap=t}get lineCap(){return this.context.lineCap}set lineJoin(t){this.context.lineJoin=t,this.customContext.lineCap=t}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.context.lineDashOffset=t,this.customContext.lineDashOffset=t}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.context.miterLimit=t,this.customContext.miterLimit=t}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext.globalAlpha=t}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext.fillStyle=t):(this.context.fillStyle=t.gradient,this.customContext.fillStyle=t.gradientCustom)}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext.strokeStyle=t):(this.context.strokeStyle=t.gradient,this.customContext.strokeStyle=t.gradientCustom)}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext.font=t}get font(){return this.context.font}fill(){return this.context.fill(),this.customContext.fill(),this}fillRect(t,e,i,r){return this.context.fillRect(t,e,i,r),this.customContext.fillRect(t,e,i,r),this}fillText(t,e,i,r){return this.context.fillText(t,e,i,r),this.customContext.fillText(t,e,i),this}setLineDash(t){return this.context.setLineDash(t),this.customContext.setLineDash(t),this}stroke(){return this.context.stroke(),this.customContext.stroke(),this}strokeText(t,e,i,r){return this.context.strokeText(t,e,i,r),this.customContext.strokeText(t,e,i),this}strokeRect(t,e,i,r){return this.context.strokeRect(t,e,i,r),this.customContext.strokeRect(t,e,i,r),this}clearRect(t=0,e=0,i=this.canvas.width,r=this.canvas.height){return this.context.clearRect(t,e,i,r),this.customContext.clearRect(t,e,i,r),this}save(){return this.context.save(),this.customContext.save(),this}restore(){return this.context.restore(),this.customContext.restore(),this}beginPath(){return this.context.beginPath(),this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext.closePath(),this}isPointInPath(t,e){return this.context.isPointInPath(t,e)}moveTo(t,e){return this.context.moveTo(t,e),this.customContext.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext.lineTo(t,e),this}arc(t,e,i,r,s,a){return this.context.arc(t,e,i,r,s,a),this.customContext.arc(t,e,i,r,s,a?-1:1),this}arcTo(t,e,i,r,s){return this.context.arcTo(t,e,i,r,s),this.customContext.arcTo(t,e,i,r,s),this}quadraticCurveTo(t,e,i,r){return this.context.quadraticCurveTo(t,e,i,r),this.customContext.quadraticCurveTo(t,e,i,r),this}bezierCurveTo(t,e,i,r,s,a){return this.context.bezierCurveTo(t,e,i,r,s,a),this.customContext.bezierCurveTo(t,e,i,r,s,a),this}rect(t,e,i,r){return this.context.rect(t,e,i,r),this.customContext.rect(t,e,i,r),this}translate(t,e){return this.context.translate(t,e),this.customContext.translate(t,e),this}rotate(t){return this.context.rotate(t),this.customContext.rotate(t),this}scale(t,e){return this.context.scale(t,e),this.customContext.scale(t,e),this}createLinearGradient(t,e,i,r,s){const a=this.context.createLinearGradient(t,e,i,r),o=this.customContext.createLinearGradient(t,e,i,r);return s&&Object.keys(s).forEach(l=>{const c=parseFloat(l);a.addColorStop(c,s[c]),o.addColorStop(c,s[c])}),{gradient:a,gradientCustom:o}}createRadialGradient(t,e,i,r,s,a,o){const l=this.context.createRadialGradient(t,e,i,r,s,a),c=this.customContext.createRadialGradient(t,e,i,r,s,a);return o&&Object.keys(o).forEach(u=>{const g=parseFloat(u);l.addColorStop(g,o[g]),c.addColorStop(g,o[g])}),{gradient:l,gradientCustom:c}}drawImage(t,e=0,i=0){return this.context.drawImage(t,e,i),this.customContext.drawImage(t,e,i),this}getImageData(t,e,i,r,s){return this.context.getImageData(t,e,i,r,s)}putImageData(t,e=0,i=0){return this.context.putImageData(t,e,i)}toRawSVG(){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}toSVGOperation(){const{raw:t}=this.toRawSVG();return nn.fromRawSVG(t)}}class po extends Sc{container;hammer;mousePoint;ctx;removeEventListeners=[];constructor(t=document.documentElement){super(),this.container=t,this.hammer=new lh(this.container),this.mousePoint=new Ee({x:0,y:0}),this.container instanceof HTMLCanvasElement&&(this.ctx=new fs(this.container)),this.restart()}restart(){this.destroy(),this.removeEventListeners=[this.initEventListeners()],this.on("pointerMove",this.setMousePoint),this.addRemoveWhenDestroy(()=>{this.off("pointerMove",this.setMousePoint)})}destroy(){this.removeEventListeners.forEach(t=>t())}addRemoveWhenDestroy(t){this.removeEventListeners.push(t)}setMousePoint(t){const e=Zi(this.container,t);this.mousePoint.x=e.x,this.mousePoint.y=e.y}initEventListeners(){const t=new ResizeObserver(tt=>{const{width:st,height:ht}=tt[0].contentRect;this.emit("resize",st,ht)}),e=tt=>{this.emit("mouseDown",tt),this.container.style.userSelect="none"},i=tt=>{this.emit("mouseUp",tt),this.container.style.userSelect=""},r=tt=>{this.emit("mouseMove",tt)},s=tt=>{this.emit("mouseOver",tt)},a=tt=>{this.emit("mouseOut",tt),this.container.style.userSelect=""},o=tt=>{this.emit("mouseClick",tt)},l=tt=>{this.emit("mouseDoubleClick",tt)},c=tt=>{this.emit("mouseWheel",tt)},u=tt=>{this.emit("mouseContextMenu",tt)},g=tt=>{this.emit("touchStart",tt),this.container.style.userSelect="none"},p=tt=>{this.emit("touchEnd",tt),this.container.style.userSelect=""},d=tt=>{this.emit("touchCancel",tt),this.container.style.userSelect=""},w=tt=>{this.emit("touchMove",tt)},x=tt=>{this.emit("pointerDown",tt),this.container.style.userSelect="none"},C=tt=>{this.emit("pointerUp",tt),this.container.style.userSelect=""},A=tt=>{this.emit("pointerCancel",tt),this.container.style.userSelect=""},P=tt=>{this.emit("pointerMove",tt)},M=tt=>{this.emit("pan",tt)},D=tt=>{this.emit("panStart",tt),this.container.style.userSelect="none"},U=tt=>{this.emit("panMove",tt)},z=tt=>{this.emit("panEnd",tt),this.container.style.userSelect=""},F=tt=>{this.emit("panCancel",tt),this.container.style.userSelect=""},G=tt=>{this.emit("panLeft",tt)},H=tt=>{this.emit("panRight",tt)},$=tt=>{this.emit("panUp",tt),this.container.style.userSelect=""},X=tt=>{this.emit("panDown",tt),this.container.style.userSelect="none"},J=tt=>{this.emit("pinch",tt)},dt=tt=>{this.emit("press",tt)},ft=tt=>{this.emit("rotate",tt)},gt=tt=>{this.emit("swipe",tt)},Et=tt=>{this.emit("tap",tt)},kt=tt=>{!tt.target||this.container==tt.target||this.container.contains(tt.target)||this.emit("tapOutSide",tt)};return t.observe(this.container),this.container.addEventListener("mousedown",e),this.container.addEventListener("mouseup",i),this.container.addEventListener("mousemove",r),this.container.addEventListener("mouseover",s),this.container.addEventListener("mouseout",a),this.container.addEventListener("click",o),this.container.addEventListener("dblclick",l),this.container.addEventListener("wheel",c),this.container.addEventListener("contextmenu",u),this.container.addEventListener("touchstart",g),this.container.addEventListener("touchend",p),this.container.addEventListener("touchcancel",d),this.container.addEventListener("touchmove",w),this.container.addEventListener("pointerdown",x),this.container.addEventListener("pointerup",C),this.container.addEventListener("pointercancel",A),this.container.addEventListener("pointermove",P),this.hammer.on("pan",M),this.hammer.on("panstart",D),this.hammer.on("panmove",U),this.hammer.on("panend",z),this.hammer.on("pancancel",F),this.hammer.on("panleft",G),this.hammer.on("panright",H),this.hammer.on("panup",$),this.hammer.on("pandown",X),this.hammer.on("pinch",J),this.hammer.on("press",dt),this.hammer.on("rotate",ft),this.hammer.on("swipe",gt),this.hammer.on("tap",Et),document.addEventListener("pointerdown",kt,!1),()=>{t.unobserve(this.container),this.container.removeEventListener("mousedown",e),this.container.removeEventListener("mouseup",i),this.container.removeEventListener("mousemove",r),this.container.removeEventListener("mouseover",s),this.container.removeEventListener("mouseout",a),this.container.removeEventListener("click",o),this.container.removeEventListener("dblclick",l),this.container.removeEventListener("wheel",c),this.container.removeEventListener("contextmenu",u),this.container.removeEventListener("touchstart",g),this.container.removeEventListener("touchend",p),this.container.removeEventListener("touchcancel",d),this.container.removeEventListener("touchmove",w),this.container.removeEventListener("pointerdown",x),this.container.removeEventListener("pointerup",C),this.container.removeEventListener("pointercancel",A),this.container.removeEventListener("pointermove",P),this.hammer.off("pan",M),this.hammer.off("panstart",D),this.hammer.off("panmove",U),this.hammer.off("panend",z),this.hammer.off("pancancel",F),this.hammer.off("panleft",G),this.hammer.off("panright",H),this.hammer.off("panup",$),this.hammer.off("pandown",X),this.hammer.off("pinch",J),this.hammer.off("press",dt),this.hammer.off("rotate",ft),this.hammer.off("swipe",gt),this.hammer.off("tap",Et),document.removeEventListener("pointerdown",kt,!1),document.removeEventListener("touchstart",kt,!1),document.removeEventListener("mousedown",kt,!1)}}registerKeyDown(t,e,i){const r=Ha.on(t,s=>(e(s,r.formatedKeyNames,r.pause,r.restart),i));r.removeListener&&this.addRemoveWhenDestroy(r.removeListener)}drawMouseMoveLine(t,e){if(!this.ctx)return;let i=!1;switch(t){case"brush":const r=(e&&e.brushSize)??10,s=(e&&e.brushDensity)??50,a=(e&&e.brushColor)??"#000000",o=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),l=o.data,c=or(a);this.captureMove({start:()=>{i=!0},end:()=>{i=!1},move:()=>{if(i){for(let u=0;u<s;u++){const g=Math.random()*Math.PI*2,p=Math.random()*r,d=this.mousePoint.x+Math.cos(g)*p|0,w=this.mousePoint.y+Math.sin(g)*p|0,x=(d+w*o.width)*4;l[x]=c>>16&255,l[x+1]=c>>8&255,l[x+2]=c&255,l[x+3]=255}this.ctx.putImageData(o)}}});break;case"line":default:this.captureMove({start:u=>{i=!0,this.ctx.beginPath(),this.setMousePoint(u),this.ctx.moveTo(this.mousePoint.x,this.mousePoint.y)},end:()=>{i=!1,this.ctx.closePath()},move:()=>{i&&(this.ctx.lineTo(this.mousePoint.x,this.mousePoint.y),this.ctx.stroke())}})}}static isTouchEnabled(){return"ontouchstart"in window||navigator.maxTouchPoints>0}captureMove(t){return this.captureMoveUsePointer(t)}captureMoveUseMouse(t){const e=s=>{document.addEventListener("mousemove",r,!1),document.addEventListener("mouseup",i,!1),this.container.style.userSelect="none",t?.start?.(s)},i=s=>{document.removeEventListener("mousemove",r,!1),document.removeEventListener("mouseup",i,!1),this.container.style.userSelect="",t?.end?.(s)},r=s=>{t?.move?.(s)};this.on("mouseDown",e),this.addRemoveWhenDestroy(()=>{this.off("mouseDown",e)})}captureMoveUseTouch(t){const e=s=>{s.preventDefault(),t?.start?.(s)},i=s=>{t?.end?.(s)},r=s=>{t?.move?.(s)};this.on("touchStart",e),this.on("touchEnd",i),this.on("touchCancel",i),this.on("touchMove",r),this.addRemoveWhenDestroy(()=>{this.off("touchStart",e),this.off("touchEnd",i),this.off("touchCancel",i),this.off("touchMove",r)})}captureMoveUsePointer(t){const e=s=>{this.container.setPointerCapture(s.pointerId),this.container.style.userSelect="none",t?.start?.(s)},i=s=>{this.container.style.userSelect="",t?.end?.(s)},r=s=>{t?.move?.(s)};this.on("pointerDown",e),this.on("pointerUp",i),this.on("pointerCancel",i),this.on("pointerMove",r),this.addRemoveWhenDestroy(()=>{this.off("pointerDown",e),this.off("pointerUp",i),this.off("pointerCancel",i),this.off("pointerMove",r)})}static getMouseButton(t){if(document.implementation.hasFeature("MouseEvents","2.0"))return t.button;switch(t.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}}class Pt{static onDocumentReady(t){function e(){document.readyState!=="loading"&&(t(),document.removeEventListener("DOMContentLoaded",e))}typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}static getCSSVar(t){return getComputedStyle(document.documentElement).getPropertyValue(t)}static setCSSVar(t,e){document.documentElement.style.setProperty(t,e)}static safeExec(t){const e=new Proxy(window,{get(i,r,s){if(typeof r=="string"&&["open","location","document"].includes(r))throw new Error(`禁止访问 key: ${r}`);return r==="window"?e:Reflect.get(i,r,s)},set(i,r,s,a){return Reflect.set(i,r,s,a)}});new Function("window",`with(window) { ${t} }`)(e,null)}static dom=new Proxy({},{get(t,e){return function(i={},...r){const s=document.createElement(e);for(const a of Object.keys(i))s.setAttribute(a,i[a]);for(const a of r)typeof a=="string"?s.appendChild(document.createTextNode(a)):s.appendChild(a);return s}}});static compileTemplate(t){return t=t.replace(/<%=(.+?)%>/g,"`); \n echo( $1 ); \n echo(`").replace(/<%([\s\S]+?)%>/g,"`); \n $1 \n echo(`"),t="echo(`"+t+"`);",`(function parse(data){
12
23
  let output = "";
13
24
  function echo(html){
14
25
  output += html;
15
26
  }
16
27
  ${t}
17
28
  return output;
18
- })`}static safeHtml(t,e="encode"){const i={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"};for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t=t.replace(new RegExp(e=="decode"?r:i[r],"g"),e=="decode"?i[r]:r));return t}static loadScript(t,e=()=>{},i=(r,s,a,o,h)=>{}){const r=document.createElement("script");r.type="text/javascript",r.src=t,r.async=!1,document.body.appendChild(r),r.onload=e,r.onerror=i}static loadStyle(t){const e=document.createElement("link");e.rel="stylesheet",e.href=t,document.head.insertBefore(e,document.head.childNodes[document.head.childNodes.length-1].nextSibling)}static waitForStyleSheetsLoaded=()=>new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let i=document.styleSheets.length??0;const r=()=>i>=e.length?(t(),!0):!1;r()||e.forEach(s=>{s.onload=()=>{i+=1,r()}})});static lazyloadImages(){const t=document.getElementsByTagName("img"),e=oa().height;let i=0;return()=>{for(let r=i;r<t.length;r++)t[r].getBoundingClientRect().top<e&&(t[r].src=t[r].getAttribute("data-src")??"",i=r+1)}}static iframePostMessage(t,e="http://test.com/localstorage.html"){const i=document.createElement("iframe");i.src=e,document.body.append(i),setTimeout(function(){i.contentWindow?.postMessage(t,e)},4e3),setTimeout(function(){i.remove()},6e3)}static getTextWidth=(t,e,i=400)=>{const r=document.createElement("span");r.style.visibility="hidden",r.style.padding="0",r.style.whiteSpace="nowrap",r.style.overflow="visible",r.style.fontSize=e>12?e+"px":"12px",r.style.fontWeight=i.toString(),r.innerText=t,document.body.appendChild(r);const s=r.offsetWidth;return document.body.removeChild(r),s};static getFixedWidthText=(t,e,i=12,r=400,s=!0)=>{let a="",o="",h="";if(!t||e<i||typeof t!="string")return a;const l=t.split(""),c=document.createElement("span");c.style.visibility="hidden",c.style.padding="0",c.style.whiteSpace="nowrap",c.style.overflow="visible",c.style.fontSize=i>12?i+"px":"12px",c.style.fontWeight=r.toString(),document.body.appendChild(c);for(let d=0,f=l.length;d<f;d++){const u=l[d];if(o=h,h+=u,a=h,c.innerText=h,c.offsetWidth>e){s?a=o+"...":a=o;break}}return document.body.removeChild(c),a};static getLocation(){return new Promise((t,e)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(i=>{t(i.coords)}):e("Geolocation is not supported by this browser")})}static vibrate(t=200){"vibrate"in navigator?window.navigator.vibrate(t):console.error("Your device is not support vibrate on this browser.")}static copyToClipboard=t=>navigator.clipboard.writeText(t);static getSelectedText=()=>window.getSelection()?.toString();static siblings=t=>Array.prototype.slice.call(t.parentNode?.children).filter(e=>e!==t);static isElementFocus=t=>t===document.activeElement;static isTabInView=()=>!document.hidden;static navigateBack=()=>history.back();static navigateBack2=()=>history.go(-1);static addDebuggerOnBeforeUnload=()=>{window.addEventListener("beforeunload",()=>{debugger})}}function Do(n,t=document){return new oe(n,t)}class oe{context;nodes;prefixs=["moz","o","ms","webkit"];constructor(t,e=document){if(this.context=e,typeof t=="string"?this.nodes=Array.from(this.context.querySelectorAll(t)):t instanceof HTMLElement?this.nodes=[t]:this.nodes=t,this.nodes.length===0)throw new Error(`can not find ${t}`);this.each((i,r)=>{i instanceof HTMLInputElement&&i.addEventListener("change",s=>{this.changeRadioChecked(s.currentTarget.value)}),i instanceof HTMLSelectElement&&i.addEventListener("change",s=>{this.changeSelectSelected(s.currentTarget.value)})})}get(t){return t<0&&(t=this.nodes.length+t),this.nodes[t]}concat(t){return new oe(this.nodes.concat(t.nodes),this.context)}then(t){return t(this)??this}each(t){return this.nodes.forEach((e,i)=>{t(e,i)}),this}_save(t,e,i){t._mQuery||(t._mQuery={}),Array.isArray(i)?(t._mQuery[e]=t._mQuery[e]??[],t._mQuery[e].push(...i)):i!=null?t._mQuery[e]=i:delete t._mQuery[e]}on(t,e,i){return this.nodes.forEach(r=>{this._save(r,"events",[{event:t,callback:e,options:i}]),r.addEventListener(t,e,i)}),this}off(t,e,i){return this.nodes.forEach(r=>{r.removeEventListener(t,e,i)}),this}dispatchEvent(t,e){let i;const r=["click","dblclick","mousedown","mouseup","mousemove"],s=["keydown","keyup","keypress"];return typeof t=="string"?r.includes(t)?i=new MouseEvent(t,e):s.includes(t)?i=new KeyboardEvent(t,e):i=new Event(t,e):i=t,this.nodes.forEach(a=>{a.dispatchEvent(i)}),this}change(){return this.dispatchEvent("change")}click(){return this.dispatchEvent("click")}static hasEvent(t,e){return"on"+e in t}static _fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(i=>{const r=oe._scriptConvert(i);r!=i&&e.content.replaceChild(r,i)}),e.content}static _scriptConvert(t){const e=i=>{const s=i.ownerDocument.createElement("script");s.text=i.text;const a=i.attributes;for(let o=0;o<a.length;o++)s.setAttribute(a[o].name,a[o].value);return s};return t.tagName=="SCRIPT"&&(t=e(t)),t.querySelectorAll&&t.querySelectorAll("script").forEach(i=>{i.parentNode?.replaceChild(e(i),i)}),t}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 isSVG(t){return(t||document.documentElement).nodeName.toLowerCase()==="svg"}static createElement(t){return oe.isSVG()?document.createElementNS.call(document,"http://www.w3.org/2000/svg",t):document.createElement.call(document,t)}static createTextNode(t){return document.createTextNode.call(document,t)}static createDocumentFragment(){return document.createDocumentFragment.call(document)}_insert(t,e){const i=this.nodes.length;if(i<1)return this;const r=[];if(typeof e=="string")this.nodes.forEach(s=>{const a=oe._fragment(e);r.push(...a.children),s[t](a)});else if(e instanceof HTMLElement)this.each(s=>{const a=i===1?e:oe._fragment(e.outerHTML);r.push(...i===1?[e]:a.children),s[t](a)}),i>1&&e.remove();else if(e instanceof oe){const s=i==1;e.each(a=>{this.each(o=>{const h=s?a:a.cloneNode(!0);r.push(h),o[t](h),oe._scriptConvert(h)})}),s||e.remove()}return t=="replaceWith"&&(this.nodes=r),this}append(t){return this._insert("append",t)}prepend(t){return this._insert("prepend",t)}after(t){return this._insert("after",t)}before(t){return this._insert("before",t)}replace(t){return this._insert("replaceWith",t)}remove(){return this.nodes.forEach(t=>{t.remove()}),this}static removeChild(t){t.parentElement?.removeChild(t)}find(t){const e=[];return this.nodes.forEach(i=>{e.push(...Array.from(i.querySelectorAll(t)))}),new oe(e,this.context)}filter(t){const e=[];return this.nodes.forEach(i=>{(i===t||typeof t=="string"&&i.matches&&i.matches(t))&&e.push(i)}),new oe(e,this.context)}next(){const t=[];return this.nodes.forEach(e=>{const i=e.nextElementSibling;i&&t.push(i)}),new oe(t,this.context)}prev(){const t=[];return this.nodes.forEach(e=>{const i=e.previousElementSibling;i&&t.push(i)}),new oe(t,this.context)}closest(t){const e=[];return this.nodes.forEach(i=>{const r=i.closest(t);r&&e.push(r)}),new oe(e,this.context)}shadow(t){const e=[];this.nodes.forEach(r=>{r.shadowRoot&&e.push(r.shadowRoot)});const i=new oe(e,this.context);return t!==void 0?i.find(t):i}parent(t){return this.parents(t,!0)}parents(t,e=!1){const i=[],r=a=>{if(i.indexOf(a)==-1&&i.push(a),!e&&a.parentElement)return r(a.parentElement)};this.nodes.forEach(a=>{a.parentElement&&r(a.parentElement)});const s=new oe(i,this.context);return t!==void 0?s.filter(t):s}static getComputedStyle(t,e,i){let r;const s=t.style.getPropertyPriority(e);return"getComputedStyle"in window?(r=getComputedStyle.call(window,t,i),r=r.getPropertyValue(e)):r=t.style.getPropertyValue(e),r+(s?"!"+s:"")}css(t,e){if((t===void 0||typeof t=="string")&&e===void 0){const i=this.nodes[0].style;if(typeof t=="string"){const r=i.getPropertyPriority(t),s=i.getPropertyValue(t).trim();return s?s+(r?"!"+r:""):oe.getComputedStyle(this.nodes[0],t)}else{const r=Object.fromEntries(this.nodes[0].style.cssText.split(";").filter(s=>!!s).map(s=>s.split(":").map(a=>a.trim())));return Object.assign(r,getComputedStyle.call(window,this.nodes[0])),r}}else{let i={};return typeof t=="string"&&e!==void 0?i[t]=e:typeof t=="object"&&(i=t),this.nodes.forEach(r=>{Object.keys(i).forEach(s=>{const a=String(i[s]).toLowerCase().includes("!important")?"important":"";r.style.setProperty(s,String(i[s]).replace(/!important/i,""),a)})}),this}}addClass(t){return this.toggleClass(t,!0)}removeClass(t){return this.toggleClass(t,!1)}toggleClass(t,e){const i=t.split(/[,\s]+/);return this.nodes.forEach(r=>{i.forEach(s=>{if(s.trim()!==""){let a="toggle";e!==void 0&&(a=e?"add":"remove"),r.classList[a](s.trim())}})}),this}hasClass(t){const e=t.split(/[,\s]+/);let i=!1;return this.nodes.forEach(r=>{i=i||e.every(s=>Array.from(r.classList??[]).includes(s.trim()))}),i}attr(t,e){if(e===void 0&&typeof t=="string")return this.nodes[0].getAttribute(t);let i={};return typeof t=="object"?i=t:e!==void 0&&(i[t]=e),this.nodes.forEach(r=>{Object.entries(i).forEach(([s,a])=>{r.setAttribute(s,a)})}),this}removeAttr(t){const e=t.split(/[,\s]+/);return this.nodes.forEach(i=>{e.forEach(r=>{i.removeAttribute(r)})}),this}prop(t,e){if(e===void 0&&typeof t=="string")return this.nodes[0][t];{let i={};return typeof t=="object"?i=t:typeof t=="string"&&e!==void 0&&(i[t]=e),this.nodes.forEach(r=>{Object.entries(i).forEach(([s,a])=>{const o=oe._fixProp(s);r[o]=a,o=="innerHTML"&&oe._scriptConvert(r)})}),this}}removeProp(t){const e=t.split(/[,\s]+/);return this.nodes.forEach(i=>{e.forEach(r=>{delete i[oe._fixProp(r)]})}),this}changeSelectSelected(t){this.nodes.forEach(e=>{if(e instanceof HTMLSelectElement){const i=e.options;for(let r=0,s=i.length;r<s;r++)i[r].value==t?i[r].selected=!0:i[r].selected=!1}})}changeRadioChecked(t){this.nodes.forEach(e=>{e instanceof HTMLInputElement&&(e.value==t?e.checked=!0:e.checked=!1)})}data(t,e){if(typeof t=="string"&&t.indexOf("-")!=-1)throw new Error(`Key "${t}" contains "-" (dash). Dashes are not allowed in property names. Use camelCase instead.`);if((typeof t=="string"||t===void 0)&&e===void 0){const i=Object.assign({},this.nodes[0].dataset);return Object.keys(i).forEach(r=>{if(i[r]?.startsWith("[")||i[r]?.startsWith("{"))try{i[r]=JSON.parse(i[r]??"")}catch{}}),typeof t=="string"?i[t]:i}else{let i={};return typeof t=="object"?i=t:typeof t=="string"&&(i[t]=e),this.nodes.forEach(r=>{Object.entries(i).forEach(([s,a])=>{a!=null?r.dataset[s]=a instanceof Object?JSON.stringify(a):a:delete r.dataset[s]})}),this}}removeData(t){const e=t.split(/[,\s]+/);return this.nodes.forEach(i=>{e.forEach(r=>{delete i.dataset[r]})}),this}show(){return this.toggle(!0)}hide(){return this.toggle(!1)}toggle(t){return this.nodes.forEach(e=>{const i=e.style.display,r=getComputedStyle(e).display,s=i=="none"||r=="none";if(s&&(t===void 0||t===!0)){const a=e instanceof HTMLTableRowElement?"table-row":e instanceof HTMLTableCellElement?"table-cell":"block";e.style.display=e._mQuery?.prevDisplay??(i==r&&r!="none"?"":a),this._save(e,"prevDisplay",null)}!s&&(t==null||t===!1)&&(r!="none"&&this._save(e,"prevDisplay",r),e.style.setProperty("display","none"))})}empty(){return this.html("")}html(t){return t instanceof HTMLElement?this.empty().append(t.innerHTML):this.prop("innerHTML",t)}text(t){return this.prop("textContent",t)}val(t){return this.prop("value",t)}}class Qt{constructor(){}static getFormatKeyNames(t){const e=Ro(),i=[];return t.ctrl&&i.push(e?"Cmd":"Ctrl"),t.shift&&i.push(e?"Option":"Shift"),t.alt&&i.push("Alt"),typeof t.key=="string"?i.push(Ll(t.key)):Array.isArray(t.key)&&(t.key.map(r=>Ll(r)),i.push(...t.key)),i}static matchKeyScheme(t,e){const i=t.ctrl??!1,r=t.shift??!1,s=t.alt??!1;if(t.exact)return(i===e.metaKey||i===e.ctrlKey)&&r===e.shiftKey&&s===e.altKey;const a=[];return i&&a.push(i===e.metaKey||i===e.ctrlKey),r&&a.push(r===e.shiftKey),s&&a.push(s===e.altKey),a.every(o=>o)}static on(t,e){if(t?.key===void 0||t?.key===null)return e;const i=t?.target??window;let r=!1;const s=this.getFormatKeyNames(t),a=o=>{if(o.stopPropagation(),!r&&o.key!=="Control"&&o.key!=="Meta"&&o.key!=="Shift"&&o.key!=="Option"&&o.key!=="Alt"&&s.find(h=>h.toLowerCase()===o.key.toLowerCase())&&this.matchKeyScheme(t,o)){o.preventDefault();const h=e(o);if(typeof h!="function")return;const l=c=>{c.preventDefault(),h(c),i.removeEventListener("keyup",l)};i.addEventListener("keyup",l)}};return i.addEventListener("keydown",a),e.title=t?.title??"",e.formatedKeyNames=s,e.pause=()=>r=!0,e.unpause=()=>r=!1,e.removeListener=()=>i.removeEventListener("keydown",a),e}}function la(n){return n*Math.PI/180}function Lo(n){return n*180/Math.PI}function mc(n,t,e,i){const r=n-e,s=t-i;return Math.sqrt(r*r+s*s)}function Io(n,t,e,i){const r=e-n,s=i-t;return Math.atan2(s,r)}function ca(n){return n[0]*n[0]+n[1]*n[1]}function Oo(n){const t=Math.sqrt(ca(n));n[0]&&(n[0]/=t),n[1]&&(n[1]/=t)}function vc(n,t,e,i,r=10){if(Math.abs(e-n)<r&&Math.abs(i-t)<r)return"no";const s=Lo(Io(n,t,e,i));return s>=-135&&s<=-45?"up":s>45&&s<135?"down":s>=135&&s<=180||s>=-180&&s<-135?"left":s>=-45&&s<=45?"right":"no"}class Er{x;y;vx;vy;ax;ay;mass;constructor(t){this.x=t.x,this.y=t.y,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||0}fromAngleAndLength(t,e){return new Er({x:Math.cos(t)*e,y:Math.sin(t)*e})}distanceTo(t){return mc(this.x,this.y,t.x,t.y)}angleTo(t){return Io(this.x,this.y,t.x,t.y)}followTo(t,e=3){const i=this.angleTo(t),{x:r,y:s}=this.fromAngleAndLength(i,e);this.vx=r,this.vy=s,this.nextFrame()}followAccelerationTo(t,e=.05){const i=this.angleTo(t),{x:r,y:s}=this.fromAngleAndLength(i,e);this.ax=r,this.ay=s,this.nextFrame()}nextFrame(t){const e=t?.gravity??0,i=t?.friction??0;if(this.vx+=this.ax,this.vy+=this.ay,this.vy+=e,i>0){const r=Math.atan2(this.vy,this.vx);let s=Math.sqrt(this.vx*this.vx+this.vy*this.vy);s>i?s-=i:s=0,this.vx=Math.cos(r)*s,this.vy=Math.sin(r)*s}this.x+=this.vx,this.y+=this.vy}nextFrameEaseTo(t,e){const i=e?.gravity??0,r=e?.friction??1,s=e?.easing??.05,a=t.x-this.x,o=t.y-this.y;this.vx=a*s,this.vy=o*s,this.vy+=i,this.vx*=r,this.vy*=r,this.x+=this.vx,this.y+=this.vy}nextFrameSpringTo(t,e){const i=e?.gravity??0,r=e?.friction??.95,s=e?.spring??.03;(Array.isArray(t)?t:[t]).forEach(o=>{const h=o.x-this.x,l=o.y-this.y,c=h*s,d=l*s;this.vx+=c,this.vy+=d}),this.vy+=i,this.vx*=r,this.vy*=r,this.x+=this.vx,this.y+=this.vy}nextFrameSpringConnect(t,e){const i=e?.gravity??0,r=e?.friction??.95,s=e?.spring??.03,a=e?.springLength??100,o=this.angleTo(t);this.nextFrameSpringTo(new Er({x:t.x-Math.cos(o)*a,y:t.y-Math.sin(o)*a}),{spring:s,friction:r,gravity:i})}}let jn=class extends Er{width;height;constructor(t){super(t),this.width=t.width,this.height=t.height}eq(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}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){return!(t.x<this.x||t.x>this.x+this.width||t.y<this.y||t.y>this.y+this.height)}toArray(){return[this.x,this.y,this.width,this.height]}clone(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height}};class Wt extends Er{radius;constructor(t){super(t),this.radius=t?.radius??0}toSVGPathData(){return[this.x,this.y]}toSVGPathD(){return`${this.x},${this.y}`}setX(t){this.x=t}setY(t){this.y=t}setXY(t,e){this.x=t,this.y=e}eq(t){return this.x===t.x&&this.y===t.y}midPointBtw(t){return new Wt({x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2})}toArray(){return[this.x,this.y]}clone(t){this.setXY(t.x,t.y)}getBounds(){return new jn({x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2})}nextFrameCollisionTo(t){const e=t.x-this.x,i=t.y-this.y;if(Math.sqrt(e*e+i*i)<this.radius+t.radius){const a=Math.atan2(i,e),o=Math.sin(a),h=Math.cos(a),l={x:0,y:0},c=s(e,i,o,h,!0),d=s(this.vx,this.vy,o,h,!0),f=s(t.vx,t.vy,o,h,!0),u=d.x-f.x;d.x=((this.mass-t.mass)*d.x+2*t.mass*f.x)/(this.mass+t.mass),f.x=u+d.x;const m=Math.abs(d.x)+Math.abs(f.x),v=this.radius+t.radius-Math.abs(l.x-c.x);l.x+=d.x/m*v,c.x+=f.x/m*v;const b=s(l.x,l.y,o,h,!1),S=s(c.x,c.y,o,h,!1);t.x=this.x+S.x,t.y=this.y+S.y,this.x=this.x+b.x,this.y=this.y+b.y;const E=s(d.x,d.y,o,h,!1),_=s(f.x,f.y,o,h,!1);this.vx=E.x,this.vy=E.y,t.vx=_.x,t.vy=_.y}function s(a,o,h,l,c=!1){return{x:c?a*l+o*h:a*l-o*h,y:c?o*l-a*h:o*l+a*h}}}nextFrameBounce(t){const e=t.left,i=t.top,r=t.right,s=t.bottom,a=t?.bounce??-1;this.x+this.radius>r?(this.x=r-this.radius,this.vx*=a):this.x-this.radius<e&&(this.x=e+this.radius,this.vx*=a),this.y+this.radius>s?(this.y=s-this.radius,this.vy*=a):this.y-this.radius<i&&(this.y=i+this.radius,this.vy*=a)}}class Pr extends Wt{startPoint;startTime;slideDetectDuration=300;slideDetectDistance=10;directionDebounceDuration=100;getDirectionDebounce=t=>O1((e,i,r,s)=>t(vc(e,i,r,s)),this.directionDebounceDuration);constructor(t={x:0,y:0}){super(t),this.startPoint=new Wt({x:this.x,y:this.y}),this.startTime=new Date}static isTouchEnabled(){return"ontouchstart"in window||navigator.maxTouchPoints>0}capture(t,e={}){return Pr.isTouchEnabled()?this.capturePointer(t,e):this.captureMouse(t,e)}captureMouse(t,e={}){const i=h=>{const l=ze(t,h);this.x=l.x,this.y=l.y,document.addEventListener("mousemove",o,!1),document.addEventListener("mouseup",r,!1),t.style.userSelect="none",t.style.webkitUserSelect="",this.startPoint.x=this.x,this.startPoint.y=this.y,this.startTime=new Date,e.start?.(this)},r=h=>{const l=ze(t,h);this.x=l.x,this.y=l.y,document.removeEventListener("mouseup",r,!1),document.removeEventListener("mousemove",o,!1),t.style.userSelect="",t.style.webkitUserSelect="",e.end?.(this)},s=this.getDirectionDebounce(h=>{new Date().getTime()-this.startTime.getTime()>this.slideDetectDuration||(h=="left"&&Math.abs(this.x-this.startPoint.x)>=this.slideDetectDistance?e.slideLeft?.(this.x-this.startPoint.x,this.y-this.startPoint.y):h=="right"&&Math.abs(this.x-this.startPoint.x)>=this.slideDetectDistance&&e.slideRight?.(this.x-this.startPoint.x,this.y-this.startPoint.y))}),a=h=>{!h.target||t==h.target||t.contains(h.target)||e.slideRight?.(this.x-this.startPoint.x,this.y-this.startPoint.y)},o=h=>{const l=ze(t,h);this.x=l.x,this.y=l.y,s(this.startPoint.x,this.startPoint.y,this.x,this.y),e.move?.(this)};return t.addEventListener("mousedown",i,!1),document.addEventListener("mousedown",a,!1),()=>{t.removeEventListener("mousedown",i,!1),document.removeEventListener("mousedown",a,!1)}}captureTouch(t,e={}){const i=h=>{h.preventDefault();const l=h.changedTouches[0],c=ze(t,l);this.x=c.x,this.y=c.y,this.startPoint.x=this.x,this.startPoint.y=this.y,this.startTime=new Date,e.start?.(this)},r=h=>{const l=h.changedTouches[0],c=ze(t,l);this.x=c.x,this.y=c.y,e.end?.(this)},s=this.getDirectionDebounce(h=>{new Date().getTime()-this.startTime.getTime()>this.slideDetectDuration||(h=="left"&&Math.abs(this.x-this.startPoint.x)>=this.slideDetectDistance?e.slideLeft?.(this.x-this.startPoint.x,this.y-this.startPoint.y):h=="right"&&Math.abs(this.x-this.startPoint.x)>=this.slideDetectDistance&&e.slideRight?.(this.x-this.startPoint.x,this.y-this.startPoint.y))}),a=h=>{!h.target||t==h.target||t.contains(h.target)||e.slideRight?.(this.x-this.startPoint.x,this.y-this.startPoint.y)},o=h=>{const l=h.changedTouches[0],c=ze(t,l);this.x=c.x,this.y=c.y,s(this.startPoint.x,this.startPoint.y,this.x,this.y),e.move?.(this)};return t.addEventListener("touchstart",i,!1),t.addEventListener("touchend",r,!1),t.addEventListener("touchcancel",r,!1),t.addEventListener("touchmove",o,!1),document.addEventListener("touchstart",a,!1),()=>{t.removeEventListener("touchstart",i,!1),t.removeEventListener("touchend",r,!1),t.removeEventListener("touchcancel",r,!1),t.removeEventListener("touchmove",o,!1),document.removeEventListener("touchstart",a,!1)}}capturePointer(t,e={}){const i=h=>{const l=ze(t,h);this.x=l.x,this.y=l.y,t.setPointerCapture(h.pointerId),t.style.userSelect="none",t.style.webkitUserSelect="",this.startPoint.x=this.x,this.startPoint.y=this.y,this.startTime=new Date,e.start?.(this)},r=h=>{const l=ze(t,h);this.x=l.x,this.y=l.y,t.style.userSelect="",t.style.webkitUserSelect="",e.end?.(this)},s=this.getDirectionDebounce(h=>{new Date().getTime()-this.startTime.getTime()>this.slideDetectDuration||(h=="left"&&Math.abs(this.x-this.startPoint.x)>=this.slideDetectDistance?e.slideLeft?.(this.x-this.startPoint.x,this.y-this.startPoint.y):h=="right"&&Math.abs(this.x-this.startPoint.x)>=this.slideDetectDistance&&e.slideRight?.(this.x-this.startPoint.x,this.y-this.startPoint.y))}),a=h=>{!h.target||t==h.target||t.contains(h.target)||e.slideRight?.(this.x-this.startPoint.x,this.y-this.startPoint.y)},o=h=>{const l=ze(t,h);this.x=l.x,this.y=l.y,s(this.startPoint.x,this.startPoint.y,this.x,this.y),e.move?.(this)};return t.addEventListener("pointerdown",i,!1),t.addEventListener("pointerup",r,!1),t.addEventListener("pointercancel",r,!1),t.addEventListener("pointermove",o,!1),document.addEventListener("pointerdown",a,!1),()=>{t.removeEventListener("pointerdown",i,!1),t.removeEventListener("pointerup",r,!1),t.removeEventListener("pointercancel",r,!1),t.removeEventListener("pointermove",o,!1),document.removeEventListener("pointerdown",a,!1)}}static clickEvent=typeof document<"u"&&document.ontouchstart?"touchstart":"click";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}}}function Fo(n,t){if(typeof t<"u")window.localStorage.setItem(n,t);else return window.localStorage.getItem(n)??void 0}function xg(n,t,e){const i=new Date;i.setTime(i.getTime()+e*24*60*60*1e3);const r="expires="+i.toUTCString();document.cookie=n+"="+t+"; "+r}function Sg(n){const t=n+"=",e=document.cookie.split(";");for(let i=0,r=e.length;i<r;i++){const s=e[i].trim();if(s.indexOf(t)==0)return s.substring(t.length,s.length)}return""}const Cg=()=>document.cookie.split(";").map(n=>n.split("=")).reduce((n,[t,e])=>(n[t.trim().replace('"',"")]=e,n),{}),Tg=()=>document.cookie.split(";").forEach(n=>document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));class kg{static theme(t){return t=t||Fo("theme"),typeof t>"u"&&(t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Fo("theme",t),document.documentElement.classList.toggle("dark",t==="dark"),t}static has(t){return window.matchMedia(t).matches||!1}static on(t,e){window.matchMedia(t).addEventListener("change",e)}static off(t,e){window.matchMedia(t).removeEventListener("change",e)}}class Eg{static addEventListener(t,e,i){t.addEventListener(e,i,!1)}static removeEventListener(t,e,i){t.removeEventListener(e,i,!1)}static getTarget(t){return t.target||t.srcElement}}class Pg{static setPageVerticalScrollPercent(t,e="width"){const i=Do(t);i.css("transition","all linear 30ms");const{clientHeight:r}=aa(),{scrollTop:s,scrollHeight:a}=Hn(),o=a-r,h=o<=0?0:s/o*100;i.css(e,h+"%")}static pullDownRefresh(t,e,i=50){let r=0,s=0;t.addEventListener("touchstart",function(a){r=a.touches[0].pageY,t.style.position="relative",t.style.transition="transform 0s"},!1),t.addEventListener("touchmove",function(a){s=a.touches[0].pageY-r,s>0&&s<i&&(t.style.transform="translateY("+s+"px)")},!1),t.addEventListener("touchend",function(a){t.style.transition="transform 0.5s ease 1s",t.style.transform="translateY(0px)",s>=i&&e()},!1)}static pullUpLoading(t,e=50){const{clientHeight:i}=aa(),{scrollTop:r,scrollHeight:s}=Hn();r+i>=s-e&&t()}static scrollTo=(t={x:0,y:0})=>window.scrollTo(t.x,t.y)}const Ag={width:500,height:500};class _c{app;constructor(t){this.app=t}}var yc={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
19
- * http://hammerjs.github.io/
20
- *
21
- * Copyright (c) 2016 Jorik Tangelder;
22
- * Licensed under the MIT license */(function(n){(function(t,e,i,r){var s=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),o="function",h=Math.round,l=Math.abs,c=Date.now;function d(g,y,k){return setTimeout(_(g,k),y)}function f(g,y,k){return Array.isArray(g)?(u(g,k[y],k),!0):!1}function u(g,y,k){var M;if(g)if(g.forEach)g.forEach(y,k);else if(g.length!==r)for(M=0;M<g.length;)y.call(k,g[M],M,g),M++;else for(M in g)g.hasOwnProperty(M)&&y.call(k,g[M],M,g)}function m(g,y,k){var M="DEPRECATED METHOD: "+y+`
23
- `+k+` AT
24
- `;return function(){var O=new Error("get-stack-trace"),G=O&&O.stack?O.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",H=t.console&&(t.console.warn||t.console.log);return H&&H.call(t.console,M,G),g.apply(this,arguments)}}var v;typeof Object.assign!="function"?v=function(y){if(y===r||y===null)throw new TypeError("Cannot convert undefined or null to object");for(var k=Object(y),M=1;M<arguments.length;M++){var O=arguments[M];if(O!==r&&O!==null)for(var G in O)O.hasOwnProperty(G)&&(k[G]=O[G])}return k}:v=Object.assign;var b=m(function(y,k,M){for(var O=Object.keys(k),G=0;G<O.length;)(!M||M&&y[O[G]]===r)&&(y[O[G]]=k[O[G]]),G++;return y},"extend","Use `assign`."),S=m(function(y,k){return b(y,k,!0)},"merge","Use `assign`.");function E(g,y,k){var M=y.prototype,O;O=g.prototype=Object.create(M),O.constructor=g,O._super=M,k&&v(O,k)}function _(g,y){return function(){return g.apply(y,arguments)}}function x(g,y){return typeof g==o?g.apply(y&&y[0]||r,y):g}function P(g,y){return g===r?y:g}function R(g,y,k){u(U(y),function(M){g.addEventListener(M,k,!1)})}function F(g,y,k){u(U(y),function(M){g.removeEventListener(M,k,!1)})}function L(g,y){for(;g;){if(g==y)return!0;g=g.parentNode}return!1}function $(g,y){return g.indexOf(y)>-1}function U(g){return g.trim().split(/\s+/g)}function z(g,y,k){if(g.indexOf&&!k)return g.indexOf(y);for(var M=0;M<g.length;){if(k&&g[M][k]==y||!k&&g[M]===y)return M;M++}return-1}function q(g){return Array.prototype.slice.call(g,0)}function K(g,y,k){for(var M=[],O=[],G=0;G<g.length;){var H=y?g[G][y]:g[G];z(O,H)<0&&M.push(g[G]),O[G]=H,G++}return k&&(y?M=M.sort(function(st,it){return st[y]>it[y]}):M=M.sort()),M}function Z(g,y){for(var k,M,O=y[0].toUpperCase()+y.slice(1),G=0;G<s.length;){if(k=s[G],M=k?k+O:y,M in g)return M;G++}return r}var at=1;function vt(){return at++}function _t(g){var y=g.ownerDocument||g;return y.defaultView||y.parentWindow||t}var pt=/mobile|tablet|ip(ad|hone|od)|android/i,nt="ontouchstart"in t,J=Z(t,"PointerEvent")!==r,I=nt&&pt.test(navigator.userAgent),D="touch",A="pen",B="mouse",j="kinect",W=25,N=1,Y=2,X=4,et=8,ht=1,mt=2,bt=4,Tt=8,yt=16,Et=mt|bt,Pt=Tt|yt,Ot=Et|Pt,Ct=["x","y"],Jt=["clientX","clientY"];function zt(g,y){var k=this;this.manager=g,this.callback=y,this.element=g.element,this.target=g.options.inputTarget,this.domHandler=function(M){x(g.options.enable,[g])&&k.handler(M)},this.init()}zt.prototype={handler:function(){},init:function(){this.evEl&&R(this.element,this.evEl,this.domHandler),this.evTarget&&R(this.target,this.evTarget,this.domHandler),this.evWin&&R(_t(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&F(this.element,this.evEl,this.domHandler),this.evTarget&&F(this.target,this.evTarget,this.domHandler),this.evWin&&F(_t(this.element),this.evWin,this.domHandler)}};function ce(g){var y,k=g.options.inputClass;return k?y=k:J?y=Ye:I?y=Fi:nt?y=mr:y=ti,new y(g,Xt)}function Xt(g,y,k){var M=k.pointers.length,O=k.changedPointers.length,G=y&N&&M-O===0,H=y&(X|et)&&M-O===0;k.isFirst=!!G,k.isFinal=!!H,G&&(g.session={}),k.eventType=y,Ee(g,k),g.emit("hammer.input",k),g.recognize(k),g.session.prevInput=k}function Ee(g,y){var k=g.session,M=y.pointers,O=M.length;k.firstInput||(k.firstInput=on(y)),O>1&&!k.firstMultiple?k.firstMultiple=on(y):O===1&&(k.firstMultiple=!1);var G=k.firstInput,H=k.firstMultiple,Q=H?H.center:G.center,st=y.center=Qe(M);y.timeStamp=c(),y.deltaTime=y.timeStamp-G.timeStamp,y.angle=ui(Q,st),y.distance=ci(Q,st),ye(k,y),y.offsetDirection=Di(y.deltaX,y.deltaY);var it=Ri(y.deltaTime,y.deltaX,y.deltaY);y.overallVelocityX=it.x,y.overallVelocityY=it.y,y.overallVelocity=l(it.x)>l(it.y)?it.x:it.y,y.scale=H?ve(H.pointers,M):1,y.rotation=H?dr(H.pointers,M):0,y.maxPointers=k.prevInput?y.pointers.length>k.prevInput.maxPointers?y.pointers.length:k.prevInput.maxPointers:y.pointers.length,li(k,y);var tt=g.element;L(y.srcEvent.target,tt)&&(tt=y.srcEvent.target),y.target=tt}function ye(g,y){var k=y.center,M=g.offsetDelta||{},O=g.prevDelta||{},G=g.prevInput||{};(y.eventType===N||G.eventType===X)&&(O=g.prevDelta={x:G.deltaX||0,y:G.deltaY||0},M=g.offsetDelta={x:k.x,y:k.y}),y.deltaX=O.x+(k.x-M.x),y.deltaY=O.y+(k.y-M.y)}function li(g,y){var k=g.lastInterval||y,M=y.timeStamp-k.timeStamp,O,G,H,Q;if(y.eventType!=et&&(M>W||k.velocity===r)){var st=y.deltaX-k.deltaX,it=y.deltaY-k.deltaY,tt=Ri(M,st,it);G=tt.x,H=tt.y,O=l(tt.x)>l(tt.y)?tt.x:tt.y,Q=Di(st,it),g.lastInterval=y}else O=k.velocity,G=k.velocityX,H=k.velocityY,Q=k.direction;y.velocity=O,y.velocityX=G,y.velocityY=H,y.direction=Q}function on(g){for(var y=[],k=0;k<g.pointers.length;)y[k]={clientX:h(g.pointers[k].clientX),clientY:h(g.pointers[k].clientY)},k++;return{timeStamp:c(),pointers:y,center:Qe(y),deltaX:g.deltaX,deltaY:g.deltaY}}function Qe(g){var y=g.length;if(y===1)return{x:h(g[0].clientX),y:h(g[0].clientY)};for(var k=0,M=0,O=0;O<y;)k+=g[O].clientX,M+=g[O].clientY,O++;return{x:h(k/y),y:h(M/y)}}function Ri(g,y,k){return{x:y/g||0,y:k/g||0}}function Di(g,y){return g===y?ht:l(g)>=l(y)?g<0?mt:bt:y<0?Tt:yt}function ci(g,y,k){k||(k=Ct);var M=y[k[0]]-g[k[0]],O=y[k[1]]-g[k[1]];return Math.sqrt(M*M+O*O)}function ui(g,y,k){k||(k=Ct);var M=y[k[0]]-g[k[0]],O=y[k[1]]-g[k[1]];return Math.atan2(O,M)*180/Math.PI}function dr(g,y){return ui(y[1],y[0],Jt)+ui(g[1],g[0],Jt)}function ve(g,y){return ci(y[0],y[1],Jt)/ci(g[0],g[1],Jt)}var fi={mousedown:N,mousemove:Y,mouseup:X},hn="mousedown",Re="mousemove mouseup";function ti(){this.evEl=hn,this.evWin=Re,this.pressed=!1,zt.apply(this,arguments)}E(ti,zt,{handler:function(y){var k=fi[y.type];k&N&&y.button===0&&(this.pressed=!0),k&Y&&y.which!==1&&(k=X),this.pressed&&(k&X&&(this.pressed=!1),this.callback(this.manager,k,{pointers:[y],changedPointers:[y],pointerType:B,srcEvent:y}))}});var Ue={pointerdown:N,pointermove:Y,pointerup:X,pointercancel:et,pointerout:et},Fn={2:D,3:A,4:B,5:j},Li="pointerdown",ln="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Li="MSPointerDown",ln="MSPointerMove MSPointerUp MSPointerCancel");function Ye(){this.evEl=Li,this.evWin=ln,zt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}E(Ye,zt,{handler:function(y){var k=this.store,M=!1,O=y.type.toLowerCase().replace("ms",""),G=Ue[O],H=Fn[y.pointerType]||y.pointerType,Q=H==D,st=z(k,y.pointerId,"pointerId");G&N&&(y.button===0||Q)?st<0&&(k.push(y),st=k.length-1):G&(X|et)&&(M=!0),!(st<0)&&(k[st]=y,this.callback(this.manager,G,{pointers:k,changedPointers:[y],pointerType:H,srcEvent:y}),M&&k.splice(st,1))}});var Se={touchstart:N,touchmove:Y,touchend:X,touchcancel:et},lo="touchstart",cn="touchstart touchmove touchend touchcancel";function Ii(){this.evTarget=lo,this.evWin=cn,this.started=!1,zt.apply(this,arguments)}E(Ii,zt,{handler:function(y){var k=Se[y.type];if(k===N&&(this.started=!0),!!this.started){var M=di.call(this,y,k);k&(X|et)&&M[0].length-M[1].length===0&&(this.started=!1),this.callback(this.manager,k,{pointers:M[0],changedPointers:M[1],pointerType:D,srcEvent:y})}}});function di(g,y){var k=q(g.touches),M=q(g.changedTouches);return y&(X|et)&&(k=K(k.concat(M),"identifier",!0)),[k,M]}var gr={touchstart:N,touchmove:Y,touchend:X,touchcancel:et},Oi="touchstart touchmove touchend touchcancel";function Fi(){this.evTarget=Oi,this.targetIds={},zt.apply(this,arguments)}E(Fi,zt,{handler:function(y){var k=gr[y.type],M=Nn.call(this,y,k);M&&this.callback(this.manager,k,{pointers:M[0],changedPointers:M[1],pointerType:D,srcEvent:y})}});function Nn(g,y){var k=q(g.touches),M=this.targetIds;if(y&(N|Y)&&k.length===1)return M[k[0].identifier]=!0,[k,k];var O,G,H=q(g.changedTouches),Q=[],st=this.target;if(G=k.filter(function(it){return L(it.target,st)}),y===N)for(O=0;O<G.length;)M[G[O].identifier]=!0,O++;for(O=0;O<H.length;)M[H[O].identifier]&&Q.push(H[O]),y&(X|et)&&delete M[H[O].identifier],O++;if(Q.length)return[K(G.concat(Q),"identifier",!0),Q]}var pr=2500,co=25;function mr(){zt.apply(this,arguments);var g=_(this.handler,this);this.touch=new Fi(this.manager,g),this.mouse=new ti(this.manager,g),this.primaryTouch=null,this.lastTouches=[]}E(mr,zt,{handler:function(y,k,M){var O=M.pointerType==D,G=M.pointerType==B;if(!(G&&M.sourceCapabilities&&M.sourceCapabilities.firesTouchEvents)){if(O)uo.call(this,k,M);else if(G&&Ni.call(this,M))return;this.callback(y,k,M)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function uo(g,y){g&N?(this.primaryTouch=y.changedPointers[0].identifier,fo.call(this,y)):g&(X|et)&&fo.call(this,y)}function fo(g){var y=g.changedPointers[0];if(y.identifier===this.primaryTouch){var k={x:y.clientX,y:y.clientY};this.lastTouches.push(k);var M=this.lastTouches,O=function(){var G=M.indexOf(k);G>-1&&M.splice(G,1)};setTimeout(O,pr)}}function Ni(g){for(var y=g.srcEvent.clientX,k=g.srcEvent.clientY,M=0;M<this.lastTouches.length;M++){var O=this.lastTouches[M],G=Math.abs(y-O.x),H=Math.abs(k-O.y);if(G<=co&&H<=co)return!0}return!1}var go=Z(a.style,"touchAction"),po=go!==r,mo="compute",vo="auto",vr="manipulation",Gi="none",De="pan-x",Ui="pan-y",un=fn();function $t(g,y){this.manager=g,this.set(y)}$t.prototype={set:function(g){g==mo&&(g=this.compute()),po&&this.manager.element.style&&un[g]&&(this.manager.element.style[go]=g),this.actions=g.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var g=[];return u(this.manager.recognizers,function(y){x(y.options.enable,[y])&&(g=g.concat(y.getTouchAction()))}),_o(g.join(" "))},preventDefaults:function(g){var y=g.srcEvent,k=g.offsetDirection;if(this.manager.session.prevented){y.preventDefault();return}var M=this.actions,O=$(M,Gi)&&!un[Gi],G=$(M,Ui)&&!un[Ui],H=$(M,De)&&!un[De];if(O){var Q=g.pointers.length===1,st=g.distance<2,it=g.deltaTime<250;if(Q&&st&&it)return}if(!(H&&G)&&(O||G&&k&Et||H&&k&Pt))return this.preventSrc(y)},preventSrc:function(g){this.manager.session.prevented=!0,g.preventDefault()}};function _o(g){if($(g,Gi))return Gi;var y=$(g,De),k=$(g,Ui);return y&&k?Gi:y||k?y?De:Ui:$(g,vr)?vr:vo}function fn(){if(!po)return!1;var g={},y=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(k){g[k]=y?t.CSS.supports("touch-action",k):!0}),g}var Gn=1,Ce=2,gi=4,ei=8,qe=ei,Bi=16,ne=32;function At(g){this.options=v({},this.defaults,g||{}),this.id=vt(),this.manager=null,this.options.enable=P(this.options.enable,!0),this.state=Gn,this.simultaneous={},this.requireFail=[]}At.prototype={defaults:{},set:function(g){return v(this.options,g),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(g){if(f(g,"recognizeWith",this))return this;var y=this.simultaneous;return g=dn(g,this),y[g.id]||(y[g.id]=g,g.recognizeWith(this)),this},dropRecognizeWith:function(g){return f(g,"dropRecognizeWith",this)?this:(g=dn(g,this),delete this.simultaneous[g.id],this)},requireFailure:function(g){if(f(g,"requireFailure",this))return this;var y=this.requireFail;return g=dn(g,this),z(y,g)===-1&&(y.push(g),g.requireFailure(this)),this},dropRequireFailure:function(g){if(f(g,"dropRequireFailure",this))return this;g=dn(g,this);var y=z(this.requireFail,g);return y>-1&&this.requireFail.splice(y,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(g){return!!this.simultaneous[g.id]},emit:function(g){var y=this,k=this.state;function M(O){y.manager.emit(O,g)}k<ei&&M(y.options.event+ta(k)),M(y.options.event),g.additionalEvent&&M(g.additionalEvent),k>=ei&&M(y.options.event+ta(k))},tryEmit:function(g){if(this.canEmit())return this.emit(g);this.state=ne},canEmit:function(){for(var g=0;g<this.requireFail.length;){if(!(this.requireFail[g].state&(ne|Gn)))return!1;g++}return!0},recognize:function(g){var y=v({},g);if(!x(this.options.enable,[this,y])){this.reset(),this.state=ne;return}this.state&(qe|Bi|ne)&&(this.state=Gn),this.state=this.process(y),this.state&(Ce|gi|ei|Bi)&&this.tryEmit(y)},process:function(g){},getTouchAction:function(){},reset:function(){}};function ta(g){return g&Bi?"cancel":g&ei?"end":g&gi?"move":g&Ce?"start":""}function _r(g){return g==yt?"down":g==Tt?"up":g==mt?"left":g==bt?"right":""}function dn(g,y){var k=y.manager;return k?k.get(g):g}function Be(){At.apply(this,arguments)}E(Be,At,{defaults:{pointers:1},attrTest:function(g){var y=this.options.pointers;return y===0||g.pointers.length===y},process:function(g){var y=this.state,k=g.eventType,M=y&(Ce|gi),O=this.attrTest(g);return M&&(k&et||!O)?y|Bi:M||O?k&X?y|ei:y&Ce?y|gi:Ce:ne}});function Le(){Be.apply(this,arguments),this.pX=null,this.pY=null}E(Le,Be,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ot},getTouchAction:function(){var g=this.options.direction,y=[];return g&Et&&y.push(Ui),g&Pt&&y.push(De),y},directionTest:function(g){var y=this.options,k=!0,M=g.distance,O=g.direction,G=g.deltaX,H=g.deltaY;return O&y.direction||(y.direction&Et?(O=G===0?ht:G<0?mt:bt,k=G!=this.pX,M=Math.abs(g.deltaX)):(O=H===0?ht:H<0?Tt:yt,k=H!=this.pY,M=Math.abs(g.deltaY))),g.direction=O,k&&M>y.threshold&&O&y.direction},attrTest:function(g){return Be.prototype.attrTest.call(this,g)&&(this.state&Ce||!(this.state&Ce)&&this.directionTest(g))},emit:function(g){this.pX=g.deltaX,this.pY=g.deltaY;var y=_r(g.direction);y&&(g.additionalEvent=this.options.event+y),this._super.emit.call(this,g)}});function zi(){Be.apply(this,arguments)}E(zi,Be,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Gi]},attrTest:function(g){return this._super.attrTest.call(this,g)&&(Math.abs(g.scale-1)>this.options.threshold||this.state&Ce)},emit:function(g){if(g.scale!==1){var y=g.scale<1?"in":"out";g.additionalEvent=this.options.event+y}this._super.emit.call(this,g)}});function yr(){At.apply(this,arguments),this._timer=null,this._input=null}E(yr,At,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[vo]},process:function(g){var y=this.options,k=g.pointers.length===y.pointers,M=g.distance<y.threshold,O=g.deltaTime>y.time;if(this._input=g,!M||!k||g.eventType&(X|et)&&!O)this.reset();else if(g.eventType&N)this.reset(),this._timer=d(function(){this.state=qe,this.tryEmit()},y.time,this);else if(g.eventType&X)return qe;return ne},reset:function(){clearTimeout(this._timer)},emit:function(g){this.state===qe&&(g&&g.eventType&X?this.manager.emit(this.options.event+"up",g):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}});function wr(){Be.apply(this,arguments)}E(wr,Be,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Gi]},attrTest:function(g){return this._super.attrTest.call(this,g)&&(Math.abs(g.rotation)>this.options.threshold||this.state&Ce)}});function br(){Be.apply(this,arguments)}E(br,Be,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Et|Pt,pointers:1},getTouchAction:function(){return Le.prototype.getTouchAction.call(this)},attrTest:function(g){var y=this.options.direction,k;return y&(Et|Pt)?k=g.overallVelocity:y&Et?k=g.overallVelocityX:y&Pt&&(k=g.overallVelocityY),this._super.attrTest.call(this,g)&&y&g.offsetDirection&&g.distance>this.options.threshold&&g.maxPointers==this.options.pointers&&l(k)>this.options.velocity&&g.eventType&X},emit:function(g){var y=_r(g.offsetDirection);y&&this.manager.emit(this.options.event+y,g),this.manager.emit(this.options.event,g)}});function We(){At.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}E(We,At,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[vr]},process:function(g){var y=this.options,k=g.pointers.length===y.pointers,M=g.distance<y.threshold,O=g.deltaTime<y.time;if(this.reset(),g.eventType&N&&this.count===0)return this.failTimeout();if(M&&O&&k){if(g.eventType!=X)return this.failTimeout();var G=this.pTime?g.timeStamp-this.pTime<y.interval:!0,H=!this.pCenter||ci(this.pCenter,g.center)<y.posThreshold;this.pTime=g.timeStamp,this.pCenter=g.center,!H||!G?this.count=1:this.count+=1,this._input=g;var Q=this.count%y.taps;if(Q===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=qe,this.tryEmit()},y.interval,this),Ce):qe}return ne},failTimeout:function(){return this._timer=d(function(){this.state=ne},this.options.interval,this),ne},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==qe&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Ke(g,y){return y=y||{},y.recognizers=P(y.recognizers,Ke.defaults.preset),new Bn(g,y)}Ke.VERSION="2.0.7",Ke.defaults={domEvents:!1,touchAction:mo,enable:!0,inputTarget:null,inputClass:null,preset:[[wr,{enable:!1}],[zi,{enable:!1},["rotate"]],[br,{direction:Et}],[Le,{direction:Et},["swipe"]],[We],[We,{event:"doubletap",taps:2},["tap"]],[yr]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Un=1,de=2;function Bn(g,y){this.options=v({},Ke.defaults,y||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=ce(this),this.touchAction=new $t(this,this.options.touchAction),p(this,!0),u(this.options.recognizers,function(k){var M=this.add(new k[0](k[1]));k[2]&&M.recognizeWith(k[2]),k[3]&&M.requireFailure(k[3])},this)}Bn.prototype={set:function(g){return v(this.options,g),g.touchAction&&this.touchAction.update(),g.inputTarget&&(this.input.destroy(),this.input.target=g.inputTarget,this.input.init()),this},stop:function(g){this.session.stopped=g?de:Un},recognize:function(g){var y=this.session;if(!y.stopped){this.touchAction.preventDefaults(g);var k,M=this.recognizers,O=y.curRecognizer;(!O||O&&O.state&qe)&&(O=y.curRecognizer=null);for(var G=0;G<M.length;)k=M[G],y.stopped!==de&&(!O||k==O||k.canRecognizeWith(O))?k.recognize(g):k.reset(),!O&&k.state&(Ce|gi|ei)&&(O=y.curRecognizer=k),G++}},get:function(g){if(g instanceof At)return g;for(var y=this.recognizers,k=0;k<y.length;k++)if(y[k].options.event==g)return y[k];return null},add:function(g){if(f(g,"add",this))return this;var y=this.get(g.options.event);return y&&this.remove(y),this.recognizers.push(g),g.manager=this,this.touchAction.update(),g},remove:function(g){if(f(g,"remove",this))return this;if(g=this.get(g),g){var y=this.recognizers,k=z(y,g);k!==-1&&(y.splice(k,1),this.touchAction.update())}return this},on:function(g,y){if(g!==r&&y!==r){var k=this.handlers;return u(U(g),function(M){k[M]=k[M]||[],k[M].push(y)}),this}},off:function(g,y){if(g!==r){var k=this.handlers;return u(U(g),function(M){y?k[M]&&k[M].splice(z(k[M],y),1):delete k[M]}),this}},emit:function(g,y){this.options.domEvents&&w(g,y);var k=this.handlers[g]&&this.handlers[g].slice();if(!(!k||!k.length)){y.type=g,y.preventDefault=function(){y.srcEvent.preventDefault()};for(var M=0;M<k.length;)k[M](y),M++}},destroy:function(){this.element&&p(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function p(g,y){var k=g.element;if(k.style){var M;u(g.options.cssProps,function(O,G){M=Z(k.style,G),y?(g.oldCssProps[M]=k.style[M],k.style[M]=O):k.style[M]=g.oldCssProps[M]||""}),y||(g.oldCssProps={})}}function w(g,y){var k=e.createEvent("Event");k.initEvent(g,!0,!0),k.gesture=y,y.target.dispatchEvent(k)}v(Ke,{INPUT_START:N,INPUT_MOVE:Y,INPUT_END:X,INPUT_CANCEL:et,STATE_POSSIBLE:Gn,STATE_BEGAN:Ce,STATE_CHANGED:gi,STATE_ENDED:ei,STATE_RECOGNIZED:qe,STATE_CANCELLED:Bi,STATE_FAILED:ne,DIRECTION_NONE:ht,DIRECTION_LEFT:mt,DIRECTION_RIGHT:bt,DIRECTION_UP:Tt,DIRECTION_DOWN:yt,DIRECTION_HORIZONTAL:Et,DIRECTION_VERTICAL:Pt,DIRECTION_ALL:Ot,Manager:Bn,Input:zt,TouchAction:$t,TouchInput:Fi,MouseInput:ti,PointerEventInput:Ye,TouchMouseInput:mr,SingleTouchInput:Ii,Recognizer:At,AttrRecognizer:Be,Tap:We,Pan:Le,Swipe:br,Pinch:zi,Rotate:wr,Press:yr,on:R,off:F,each:u,merge:S,extend:b,assign:v,inherit:E,bindFn:_,prefixed:Z});var C=typeof t<"u"?t:typeof self<"u"?self:{};C.Hammer=Ke,typeof r=="function"&&r.amd?r(function(){return Ke}):n.exports?n.exports=Ke:t[i]=Ke})(window,document,"Hammer")})(yc);var Mg=yc.exports;const Rg=Pe(Mg);let Dg=class extends _c{point;removeEventListeners=[];hammer;constructor(t){super(t),this.point=new Pr,this.hammer=new Rg(t.container),this.removeEventListeners.push(this.point.captureMouse(this.app.container)),this.removeEventListeners.push(this.addEventListeners())}destroy(){this.removeEventListeners.forEach(t=>t())}addEventListeners(){const t=b=>{this.app.emit("mouseDown",b)},e=b=>{this.app.emit("mouseUp",b)},i=b=>{this.app.emit("mouseMove",b)},r=b=>{this.app.emit("mouseOver",b)},s=b=>{this.app.emit("mouseOut",b)},a=b=>{this.app.emit("mouseClick",b)},o=b=>{this.app.emit("mouseDoubleClick",b)},h=b=>{this.app.emit("mouseWheel",b)},l=b=>{this.app.emit("mouseContextMenu",b)},c=b=>{this.app.emit("pan",b)},d=b=>{this.app.emit("pinch",b)},f=b=>{this.app.emit("press",b)},u=b=>{this.app.emit("rotate",b)},m=b=>{this.app.emit("swipe",b)},v=b=>{this.app.emit("tap",b)};return this.app.container?.addEventListener("mousedown",t),this.app.container?.addEventListener("mouseup",e),this.app.container?.addEventListener("mousemove",i),this.app.container?.addEventListener("mouseover",r),this.app.container?.addEventListener("mouseout",s),this.app.container?.addEventListener("click",a),this.app.container?.addEventListener("dblclick",o),this.app.container?.addEventListener("wheel",h),this.app.container?.addEventListener("contextmenu",l),this.hammer.on("pan",c),this.hammer.on("pinch",d),this.hammer.on("press",f),this.hammer.on("rotate",u),this.hammer.on("swipe",m),this.hammer.on("tap",v),()=>{this.app.container?.removeEventListener("mousedown",t),this.app.container?.removeEventListener("mouseup",e),this.app.container?.removeEventListener("mousemove",i),this.app.container?.removeEventListener("mouseover",r),this.app.container?.removeEventListener("mouseout",s),this.app.container?.removeEventListener("click",a),this.app.container?.removeEventListener("dblclick",o),this.app.container?.removeEventListener("wheel",h),this.app.container?.removeEventListener("contextmenu",l),this.hammer.off("pan",c),this.hammer.off("pinch",d),this.hammer.off("press",f),this.hammer.off("rotate",u),this.hammer.off("swipe",m),this.hammer.off("tap",v)}}};class Lg extends _c{removeEventListeners=[];constructor(t){super(t)}destroy(){this.removeEventListeners.forEach(t=>t())}on(t,e){const i=Qt.on(t,s=>(this.app.emit("keyDown",s,i),e)),r=()=>{i.removeListener?.()};return this.removeEventListeners.push(r),r}}const wc=[1,0,0,1,0,0],bc=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class we{value;matrix3d;isEverTo3d=!1;_prev_rotatex=0;_prev_rotatey=0;constructor(t=wc){this.value=Array.from(t),this.matrix3d=this.toMatrix3D()}unit(){return this.value=Array.from(wc),this.matrix3d=this.toMatrix3D(),this}transformPoint(t,e,i=0,r=0){const s=t-i,a=e-r;return t=s*this.value[0]+a*this.value[2]+this.value[4],e=s*this.value[1]+a*this.value[3]+this.value[5],[t+i,e+r]}fromString(t){const e=Dl("number",t);return e.length===6?e.forEach((i,r)=>{i.fullMatch&&(this.value[r]=parseFloat(i.fullMatch))}):this.unit(),this}toMatrix3D(t=this.matrix3d){const e=[this.value[0],this.value[1],0,0,this.value[2],this.value[3],0,0,0,0,1,0,this.value[4],this.value[5],0,1];return t?(t.value=e,t):new pn(e)}offset(t=0,e=0){return[t-this.value[4],e-this.value[5]]}clone(){return new we(this.value)}multiply(t){const e=this.value;let i;t instanceof we?i=t.value:i=t;const r=e[0]*i[0]+e[2]*i[1],s=e[1]*i[0]+e[3]*i[1],a=e[0]*i[2]+e[2]*i[3],o=e[1]*i[2]+e[3]*i[3],h=e[0]*i[4]+e[2]*i[5]+e[4],l=e[1]*i[4]+e[3]*i[5]+e[5];return e[0]=r,e[1]=s,e[2]=a,e[3]=o,e[4]=h,e[5]=l,this}inverse(){const t=new we(this.value),e=t.value,i=1/(e[0]*e[3]-e[1]*e[2]),r=e[3]*i,s=-e[1]*i,a=-e[2]*i,o=e[0]*i,h=i*(e[2]*e[5]-e[3]*e[4]),l=i*(e[1]*e[4]-e[0]*e[5]);return e[0]=r,e[1]=s,e[2]=a,e[3]=o,e[4]=h,e[5]=l,t}translate(t,e){return this.matrix3d.translate(t,e,0),this.multiply([1,0,0,1,t,e])}translateTo(t,e){const i=this.offset(t,e);return this.translate(i[0],i[1])}translateX(t){return this.translate(t,0)}translateY(t){return this.translate(0,t)}translateZ(t){return this.isEverTo3d=!0,this.matrix3d.translate(0,0,t)}translate3d(t,e,i){return this.isEverTo3d=!0,this.matrix3d.translate(t,e,i)}rotate(t,e=0,i=0){const r=la(t),s=+Math.cos(r).toFixed(9),a=+Math.sin(r).toFixed(9);return this.multiply([s,a,-a,s,e,i]),this.translate(-e,-i),this}rotateX(t){return this._prev_rotatex=t,this.isEverTo3d=!0,this.matrix3d.rotate("x",t)}rotateXTo(t){return this.rotateX(t-this._prev_rotatex)}rotateY(t){return this._prev_rotatey=t,this.isEverTo3d=!0,this.matrix3d.rotate("y",t)}rotateYTo(t){return this.rotateY(t-this._prev_rotatey)}rotateZ(t){return this.isEverTo3d=!0,this.matrix3d.rotate("z",t)}rotate3d(t,e,i){return this.isEverTo3d=!0,this.matrix3d.rotate("x",t).rotate("y",e).rotate("z",i)}scale(t,e=t,i=0,r=0){return this.matrix3d.scale(t,e,1),this.translate(i,r),this.multiply([t,0,0,e,0,0]),this.translate(-i,-r),this}scaleTo(t,e=t){return this.scale(t/this.value[0],e/this.value[3]),this}scaleX(t){return this.scale(t,1)}scaleY(t){return this.scale(1,t)}scaleZ(t){return this.isEverTo3d=!0,this.matrix3d.scale(1,1,t)}scale3d(t,e,i){return this.isEverTo3d=!0,this.matrix3d.scale(t,e,i)}skew(t,e=0){const i=t*Math.PI/180,r=e*Math.PI/180,s=Math.tan(i),a=Math.tan(r);return this.multiply([1,a,s,1,0,0])}skewX(t){return this.skew(t,0)}skewY(t){return this.skew(0,t)}skewZ(t){return this}skew3d(t,e,i){return this}split(){const t={dx:0,dy:0,scalex:1,scaley:1,shear:1,rotate:0,isSimple:!0,isSuperSimple:!0,noRotation:!1};t.dx=this.value[4],t.dy=this.value[5];const e=[[this.value[0],this.value[2]],[this.value[1],this.value[3]]];t.scalex=Math.sqrt(ca(e[0])),Oo(e[0]),t.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*t.shear,e[1][1]-e[0][1]*t.shear],t.scaley=Math.sqrt(ca(e[1])),Oo(e[1]),t.shear/=t.scaley;const i=-e[0][1],r=e[1][1];return r<0?(t.rotate=Lo(Math.acos(r)),i<0&&(t.rotate=360-t.rotate)):t.rotate=la(Math.asin(i)),t.isSimple=!+t.shear.toFixed(9)&&(t.scalex.toFixed(9)==t.scaley.toFixed(9)||!t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t}toTransformString(){const t=this.split();return t.isSimple?(t.scalex=+t.scalex.toFixed(4),t.scaley=+t.scaley.toFixed(4),t.rotate=+t.rotate.toFixed(4),(t.dx&&t.dy?"t"+[t.dx,t.dy]:"")+(t.scalex!=1||t.scaley!=1?"s"+[t.scalex,t.scaley,0,0]:"")+(t.rotate?"r"+[t.rotate,0,0]:"")):"matrix"+[this.value[0],this.value[1],this.value[2],this.value[3],this.value[4],this.value[5]]}toString(){return this.isEverTo3d?this.toMatrix3DString():`matrix(${this.value.map(t=>Ul(t,6)).join(",")})`}toMatrix3DString(){return this.matrix3d.toString()}toFilter(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.value[0]+", M12="+this.value[2]+", M21="+this.value[1]+", M22="+this.value[3]+", Dx="+this.value[4]+", Dy="+this.value[5]+", sizingmethod='auto expand')"}}class pn{value;constructor(t=bc){this.value=Array.from(t)}unit(){return this.value=Array.from(bc),this}fromString(t){const e=Dl("number",t);return e.length===16?e.forEach((i,r)=>{i.fullMatch&&(this.value[r]=parseFloat(i.fullMatch))}):this.unit(),this}toMatrix(t){const e=[this.value[0],this.value[1],this.value[4],this.value[5],this.value[12],this.value[13]];return t?(t.value=e,t):new we(e)}multiplyMatrix(t){const e=this.value[0],i=this.value[1],r=this.value[2],s=this.value[3],a=this.value[4],o=this.value[5],h=this.value[6],l=this.value[7],c=this.value[8],d=this.value[9],f=this.value[10],u=this.value[11],m=this.value[12],v=this.value[13],b=this.value[14],S=this.value[15],E=t.value[0],_=t.value[1],x=t.value[2],P=t.value[3],R=E*e+_*a+x*c+P*m,F=E*i+_*o+x*d+P*v,L=E*r+_*h+x*f+P*b,$=E*s+_*l+x*u+P*S;return new we([R,F,L,$,0,0])}multiply(t){const e=new we([t.value[0],t.value[1],t.value[2],t.value[3],0,0]),i=new we([t.value[4],t.value[5],t.value[6],t.value[7],0,0]),r=new we([t.value[8],t.value[9],t.value[10],t.value[11],0,0]),s=new we([t.value[12],t.value[13],t.value[14],t.value[15],0,0]),a=this.multiplyMatrix(e),o=this.multiplyMatrix(i),h=this.multiplyMatrix(r),l=this.multiplyMatrix(s);return this.value[0]=a.value[0],this.value[1]=a.value[1],this.value[2]=a.value[2],this.value[3]=a.value[3],this.value[4]=o.value[0],this.value[5]=o.value[1],this.value[6]=o.value[2],this.value[7]=o.value[3],this.value[8]=h.value[0],this.value[9]=h.value[1],this.value[10]=h.value[2],this.value[11]=h.value[3],this.value[12]=l.value[0],this.value[13]=l.value[1],this.value[14]=l.value[2],this.value[15]=l.value[3],this}translate(t=0,e=0,i=0){return this.multiply(new pn([1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1]))}scale(t=1,e=1,i=1){return this.multiply(new pn([t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1]))}rotate(t,e){const i=la(e),r=Math.sin,s=Math.cos;let a;switch(t){case"x":a=[1,0,0,0,0,s(i),r(i),0,0,-r(i),s(i),0,0,0,0,1];break;case"y":a=[s(i),0,-r(i),0,0,1,0,0,r(i),0,s(i),0,0,0,0,1];break;case"z":a=[s(i),r(i),0,0,-r(i),s(i),0,0,0,0,1,0,0,0,0,1];break}return this.multiply(new pn(a))}toString(){return`matrix3d(${this.value.map(t=>Ul(t,6)).join(",")})`}}function Ar(n){const t=new we;return n.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,i,r){r.indexOf(",")>=0?r=r.split(/\s*,\s*/):r=r.split(/\s+/);const s=[];for(let a=0,o=r.length;a<o;a++)r[a].trim()&&s.push(parseFloat(""+r[a]));switch(i.toLowerCase()){case"t":case"translate":t.translate(s[0],s[1]);break;case"translatex":t.translateX(s[0]);break;case"translatey":t.translateY(s[0]);break;case"translatez":t.translateZ(s[0]);break;case"translate3d":t.translate3d(s[0],s[1],s[2]);break;case"r":case"rotate":t.rotate(s[0],s[1]??0,s[2]??0);break;case"rotatex":t.rotateX(s[0]);break;case"rotatey":t.rotateY(s[0]);break;case"rotatez":t.rotateZ(s[0]);break;case"rotate3d":t.rotate3d(s[0],s[1],s[2]);break;case"s":case"scale":t.scale(s[0],s[1]??s[0]);break;case"scalex":t.scaleX(s[0]);break;case"scaley":t.scaleY(s[0]);break;case"scalez":t.scaleZ(s[0]);break;case"scale3d":t.scale3d(s[0],s[1],s[2]);break;case"skew":t.skew(s[0],s[1]??0);break;case"skewx":t.skewX(s[0]);break;case"skewy":t.skewY(s[0]);break;case"skewz":t.skewZ(s[0]);break;case"skew3d":t.skew3d(s[0],s[1],s[2]);break;case"m":case"matrix":t.multiply([s[0],s[1],s[2],s[3],s[4],s[5]]);break;case"matrix3d":t.matrix3d.multiply(new pn(s));break}return""}),t}class ua{x;y;z;constructor(t=[0,0,0],e=[0,0,0]){const[i,r,s]=t,[a,o,h]=e;this.x=i-a,this.y=r-o,this.z=s-h}get length(){const{x:t,y:e,z:i}=this;return Math.sqrt(t*t+e*e+i*i)}unit(){const t=this.length;return new ua([this.x/t,this.y/t,this.z/t])}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){const e=this.x,i=this.y,r=this.z,s=t.x,a=t.y,o=t.z;return new ua([i*o-r*a,r*s-e*o,e*a-s*i])}}function xc(n){return typeof n!="string"?!1:(n=n.trim(),/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(n)&&/[\dz]$/i.test(n)&&n.length>4)}const No={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Ig=/([astvzqmhlc])([^astvzqmhlc]*)/gi,Og=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function Fg(n){const t=n.match(Og);return t?t.map(Number):[]}function fa(n){const t=[];return n.replace(Ig,function(e,i,r){let s=i.toLowerCase();for(r=Fg(r),s=="m"&&r.length>2&&(t.push([i].concat(r.splice(0,2))),s="l",i=i=="m"?"l":"L");;){if(r.length==No[s])return r.unshift(i),t.push(r);if(r.length<No[s])throw new Error("malformed path data");t.push([i].concat(r.splice(0,No[s])))}}),t}function da(n){var t=0,e=0,i=0,r=0;return n.map(function(s){s=s.slice();var a=s[0],o=a.toUpperCase();if(a!=o)switch(s[0]=o,a){case"a":s[6]+=i,s[7]+=r;break;case"v":s[1]+=r;break;case"h":s[1]+=i;break;default:for(var h=1;h<s.length;)s[h++]+=i,s[h++]+=r}switch(o){case"Z":i=t,r=e;break;case"H":i=s[1];break;case"V":r=s[1];break;case"M":i=t=s[1],r=e=s[2];break;default:i=s[s.length-2],r=s[s.length-1]}return s})}function Ng(n){var t=0,e=0,i=0,r=0;return n.map(function(s){s=s.slice();var a=s[0],o=a.toLowerCase();if(a!=o)switch(s[0]=o,a){case"A":s[6]-=i,s[7]-=r;break;case"V":s[1]-=r;break;case"H":s[1]-=i;break;default:for(var h=1;h<s.length;)s[h++]-=i,s[h++]-=r}switch(o){case"z":i=t,r=e;break;case"h":i+=s[1];break;case"v":r+=s[1];break;case"m":i+=s[1],r+=s[2],t+=s[1],e+=s[2];break;default:i+=s[s.length-2],r+=s[s.length-1]}return s})}const Mr=Math.PI*2;function Sc(n,t,e,i){const r=n*i-t*e<0?-1:1;let s=n*e+t*i;return s>1&&(s=1),s<-1&&(s=-1),r*Math.acos(s)}function Gg(n,t,e,i,r,s,a,o,h,l){const c=l*(n-e)/2+h*(t-i)/2,d=-h*(n-e)/2+l*(t-i)/2,f=a*a,u=o*o,m=c*c,v=d*d;let b=f*u-f*v-u*m;b<0&&(b=0),b/=f*v+u*m,b=Math.sqrt(b)*(r===s?-1:1);const S=b*a/o*d,E=b*-o/a*c,_=l*S-h*E+(n+e)/2,x=h*S+l*E+(t+i)/2,P=(c-S)/a,R=(d-E)/o,F=(-c-S)/a,L=(-d-E)/o,$=Sc(1,0,P,R);let U=Sc(P,R,F,L);return s===0&&U>0&&(U-=Mr),s===1&&U<0&&(U+=Mr),[_,x,$,U]}function Ug(n,t){const e=1.3333333333333333*Math.tan(t/4),i=Math.cos(n),r=Math.sin(n),s=Math.cos(n+t),a=Math.sin(n+t);return[i,r,i-r*e,r+i*e,s+a*e,a-s*e,s,a]}function Bg(n,t,e,i,r,s,a,o,h){const l=Math.sin(h*Mr/360),c=Math.cos(h*Mr/360),d=c*(n-e)/2+l*(t-i)/2,f=-l*(n-e)/2+c*(t-i)/2;if(d===0&&f===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const u=d*d/(a*a)+f*f/(o*o);u>1&&(a*=Math.sqrt(u),o*=Math.sqrt(u));const m=Gg(n,t,e,i,r,s,a,o,l,c),v=[];let b=m[2],S=m[3];const E=Math.max(Math.ceil(Math.abs(S)/(Mr/4)),1);S/=E;for(let _=0;_<E;_++)v.push(Ug(b,S)),b+=S;return v.map(_=>{for(let x=0;x<_.length;x+=2){let P=_[x+0],R=_[x+1];P*=a,R*=o;const F=c*P-l*R,L=l*P+c*R;_[x+0]=F+m[0],_[x+1]=L+m[1]}return _})}function ga(n){for(var t,e=[],i=0,r=0,s=0,a=0,o=null,h=null,l=0,c=0,d=0,f=n.length;d<f;d++){var u=n[d],m=u[0];switch(m){case"M":s=u[1],a=u[2];break;case"A":var v=Bg(l,c,u[6],u[7],u[4],u[5],u[1],u[2],u[3]);if(!v.length)continue;v=v.map(x=>{const[P,R,F,L,$,U,z,q]=x;return{x1:F,y1:L,x2:$,y2:U,x:z,y:q}});for(var b=0,S;b<v.length;b++)S=v[b],u=["C",S.x1,S.y1,S.x2,S.y2,S.x,S.y],b<v.length-1&&e.push(u);break;case"S":var E=l,_=c;(t=="C"||t=="S")&&(E+=E-i,_+=_-r),u=["C",E,_,u[1],u[2],u[3],u[4]];break;case"T":t=="Q"||t=="T"?(o=l*2-o,h=c*2-h):(o=l,h=c),u=Cc(l,c,o,h,u[1],u[2]);break;case"Q":o=u[1],h=u[2],u=Cc(l,c,u[1],u[2],u[3],u[4]);break;case"L":u=pa(l,c,u[1],u[2]);break;case"H":u=pa(l,c,u[1],c);break;case"V":u=pa(l,c,l,u[1]);break;case"Z":u=pa(l,c,s,a);break}t=m,l=u[u.length-2],c=u[u.length-1],u.length>4?(i=u[u.length-4],r=u[u.length-3]):(i=l,r=c),e.push(u)}return e}function pa(n,t,e,i){return["C",n,t,e,i,e,i]}function Cc(n,t,e,i,r,s){return["C",n/3+.6666666666666666*e,t/3+.6666666666666666*i,r/3+.6666666666666666*e,s/3+.6666666666666666*i,r,s]}const zg=n=>Array.isArray(n);function Xn(n){if(!(this instanceof Xn))return new Xn(n);this._path=zg(n)?n:fa(n),this._path=da(this._path),this._path=Vg(this._path),this._path=$g(this._path)}Xn.prototype.at=function(n,t){return this._walk(n,t).pos},Xn.prototype.length=function(){return this._walk(null).length},Xn.prototype._walk=function(n,t){let e=[0,0],i=[0,0,0],r=[0,0],s=0;for(let c=0;c<this._path.length;c++){let d=this._path[c];if(d[0]==="M"){if(e[0]=d[1],e[1]=d[2],n===0)return{length:s,pos:e}}else if(d[0]==="C"){i[0]=r[0]=e[0],i[1]=r[1]=e[1],i[2]=s;let f=100;for(let u=0;u<=f;u++){let m=u/f,v=a(d,m),b=o(d,m);if(s+=Go(e[0],e[1],v,b),e[0]=v,e[1]=b,typeof n=="number"&&s>=n){let S=(s-n)/(s-i[2]),E=[e[0]*(1-S)+i[0]*S,e[1]*(1-S)+i[1]*S];return{length:s,pos:E}}i[0]=e[0],i[1]=e[1],i[2]=s}}else if(d[0]==="Q"){i[0]=r[0]=e[0],i[1]=r[1]=e[1],i[2]=s;let f=100;for(let u=0;u<=f;u++){let m=u/f,v=h(d,m),b=l(d,m);if(s+=Go(e[0],e[1],v,b),e[0]=v,e[1]=b,typeof n=="number"&&s>=n){let S=(s-n)/(s-i[2]),E=[e[0]*(1-S)+i[0]*S,e[1]*(1-S)+i[1]*S];return{length:s,pos:E}}i[0]=e[0],i[1]=e[1],i[2]=s}}else if(d[0]==="L"){if(i[0]=e[0],i[1]=e[1],i[2]=s,s+=Go(e[0],e[1],d[1],d[2]),e[0]=d[1],e[1]=d[2],typeof n=="number"&&s>=n){let f=(s-n)/(s-i[2]),u=[e[0]*(1-f)+i[0]*f,e[1]*(1-f)+i[1]*f];return{length:s,pos:u}}i[0]=e[0],i[1]=e[1],i[2]=s}}return{length:s,pos:e};function a(c,d){return Math.pow(1-d,3)*r[0]+3*Math.pow(1-d,2)*d*c[1]+3*(1-d)*Math.pow(d,2)*c[3]+Math.pow(d,3)*c[5]}function o(c,d){return Math.pow(1-d,3)*r[1]+3*Math.pow(1-d,2)*d*c[2]+3*(1-d)*Math.pow(d,2)*c[4]+Math.pow(d,3)*c[6]}function h(c,d){return Math.pow(1-d,2)*r[0]+2*(1-d)*d*c[1]+Math.pow(d,2)*c[3]}function l(c,d){return Math.pow(1-d,2)*r[1]+2*(1-d)*d*c[2]+Math.pow(d,2)*c[4]}};function Go(n,t,e,i){let r=n-e,s=t-i;return Math.sqrt(r*r+s*s)}function $g(n){let t,e=0,i=0,r={S:{to:"C",x:3},T:{to:"Q",x:1}};for(let s=0,a=n.length;s<a;s++){let o=n[s],h=r[o[0]];h&&(o[0]=h.to,t&&(t[0]===h.to?(e=2*t[h.x+2]-t[h.x],i=2*t[h.x+3]-t[h.x+1]):(e=t[t.length-2],i=t[t.length-1])),o.splice(1,0,e,i)),t=o}return n}function Vg(n){let t=[],e=["L",0,0],i;for(let r=0,s=n.length;r<s;r++){let a=n[r];switch(a[0]){case"M":e=["L",a[1],a[2]],t.push(a);break;case"Z":t.push(e);break;case"H":i=t[t.length-1]||["L",0,0],t.push(["L",a[1],i[i.length-1]]);break;case"V":i=t[t.length-1]||["L",0,0],t.push(["L",i[i.length-2],a[1]]);break;default:t.push(a)}}return t}const Uo=n=>{if(typeof n=="function"||Object(n)!==n)return n;const t=new n.constructor;for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=Uo(n[e]));return t};function Bo(n){const t=Bo.ps=Bo.ps||{};return t[n]?t[n].sleep=100:t[n]={sleep:100},setTimeout(()=>{for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&e!==n&&(t[e].sleep--,t[e].sleep||delete t[e])}),t[n]}function Rr(n,t,e,i){return n==null&&(n=t=e=i=0),t==null&&(t=n.y,e=n.width,i=n.height,n=n.x),{x:n,y:t,width:e,w:e,height:i,h:i,x2:n+e,y2:t+i,cx:n+e/2,cy:t+i/2,r1:Math.min(e,i)/2,r2:Math.max(e,i)/2,r0:Math.sqrt(e*e+i*i)/2,path:Kg(n,t,e,i),vb:[n,t,e,i].join(" ")}}function Tc(n,t,e,i,r,s,a,o,h){const l=1-h,c=l**3,d=l**2,f=h*h,u=f*h,m=c*n+d*3*h*e+l*3*h*h*r+u*a,v=c*t+d*3*h*i+l*3*h*h*s+u*o,b=n+2*h*(e-n)+f*(r-2*e+n),S=t+2*h*(i-t)+f*(s-2*i+t),E=e+2*h*(r-e)+f*(a-2*r+e),_=i+2*h*(s-i)+f*(o-2*s+i),x=l*n+h*e,P=l*t+h*i,R=l*r+h*a,F=l*s+h*o,L=90-Math.atan2(b-E,S-_)*180/Math.PI;return{x:m,y:v,m:{x:b,y:S},n:{x:E,y:_},start:{x,y:P},end:{x:R,y:F},alpha:L}}function kc(n,t,e,i,r,s,a,o){Array.isArray(n)||(n=[n,t,e,i,r,s,a,o]);const h=Ac(...n);return Rr(h.min.x,h.min.y,h.max.x-h.min.x,h.max.y-h.min.y)}function Hg(n,t,e){return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height}function jg(n,t){n=Rr(n),t=Rr(t);const{x:e,y:i,width:r,height:s}=n,{x:a,y:o,width:h,height:l}=t,c=e+r/2,d=i+s/2,f=a+h/2,u=o+l/2;return Math.abs(c-f)<=(r+h)/2||Math.abs(d-u)<=(s+l)/2}function Ec(n,t,e,i,r){const s=-3*t+9*e-9*i+3*r,a=n*s+6*t-12*e+6*i;return n*a-3*t+3*e}function Pc(n,t,e,i,r,s,a,o,h){h==null&&(h=1),h=Math.max(0,Math.min(h,1));const l=h/2,c=12,d=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let u=0;for(let m=0;m<c;m++){const v=l*d[m]+l,b=Ec(v,n,e,r,a),S=Ec(v,t,i,s,o),E=b*b+S*S;u+=f[m]*Math.sqrt(E)}return l*u}function Xg(n,t,e,i,r,s,a,o){if(Math.max(n,e)<Math.min(r,a)||Math.min(n,e)>Math.max(r,a)||Math.max(t,i)<Math.min(s,o)||Math.min(t,i)>Math.max(s,o))return;const h=(n*i-t*e)*(r-a)-(n-e)*(r*o-s*a),l=(n*i-t*e)*(s-o)-(t-i)*(r*o-s*a),c=(n-e)*(s-o)-(t-i)*(r-a);if(!c)return;const d=h/c,f=l/c,u=Number(d.toFixed(2)),m=Number(f.toFixed(2));if(!(u<Number(Math.min(n,e).toFixed(2))||u>Number(Math.max(n,e).toFixed(2))||u<Number(Math.min(r,a).toFixed(2))||u>Number(Math.max(r,a).toFixed(2))||m<Number(Math.min(t,i).toFixed(2))||m>Number(Math.max(t,i).toFixed(2))||m<Number(Math.min(s,o).toFixed(2))||m>Number(Math.max(s,o).toFixed(2))))return{x:d,y:f}}function Yg(n,t,e){const i=kc(n),r=kc(t);if(!jg(i,r))return e?0:[];const s=Pc.apply(0,n),a=Pc.apply(0,t),o=Math.ceil(s/8),h=Math.ceil(a/8),l=[],c=[],d={};let f=e?0:[];for(let u=0;u<o+1;u++){const m=Tc.apply(0,n.concat(u/o));l.push({x:m.x,y:m.y,t:u/o})}for(let u=0;u<h+1;u++){const m=Tc.apply(0,t.concat(u/h));c.push({x:m.x,y:m.y,t:u/h})}for(let u=0;u<o;u++)for(let m=0;m<h;m++){const v=l[u],b=l[u+1],S=c[m],E=c[m+1],_=Math.abs(b.x-v.x)<.001?"y":"x",x=Math.abs(E.x-S.x)<.001?"y":"x",P=Xg(v.x,v.y,b.x,b.y,S.x,S.y,E.x,E.y);if(P&&d[P.x.toFixed(4)]!==P.y.toFixed(4)){d[P.x.toFixed(4)]=P.y.toFixed(4);const R=v.t+Math.abs((P[_]-v[_])/(b[_]-v[_]))*(b.t-v.t),F=S.t+Math.abs((P[x]-S[x])/(E[x]-S[x]))*(E.t-S.t);R>=0&&R<=1&&F>=0&&F<=1&&(e?f++:f.push({x:P.x,y:P.y,t1:R,t2:F}))}}return f}function qg(n,t,e){let i,r,s,a,o,h,l,c,d,f,u=e?0:[];for(let m=0,v=n.length;m<v;m++){const b=n[m];if(b[0]==="M")i=o=b[1],r=h=b[2];else{b[0]==="C"?(d=[i,r].concat(b.slice(1)),i=d[6],r=d[7]):(d=[i,r,i,r,o,h,o,h],i=o,r=h);for(let S=0,E=t.length;S<E;S++){const _=t[S];if(_[0]==="M")s=l=_[1],a=c=_[2];else{_[0]==="C"?(f=[s,a].concat(_.slice(1)),s=f[6],a=f[7]):(f=[s,a,s,a,l,c,l,c],s=l,a=c);const x=Yg(d,f,e);if(e)u+=x;else{for(let P=0,R=x.length;P<R;P++)x[P].segment1=m,x[P].segment2=S,x[P].bez1=d,x[P].bez2=f;u=u.concat(x)}}}}}return u}function Wg(n){const t=Bo(n);if(t.bbox)return Uo(t.bbox);if(!n)return Rr();let e=0,i=0,r=[],s=[],a=[];for(let f=0,u=n.length;f<u;f++)if(a=n[f],a[0]==="M")e=a[1],i=a[2],r.push(e),s.push(i);else{const m=Ac(e,i,a[1],a[2],a[3],a[4],a[5],a[6]);r=r.concat(m.min.x,m.max.x),s=s.concat(m.min.y,m.max.y),e=a[5],i=a[6]}const o=Math.min.apply(0,r),h=Math.min.apply(0,s),l=Math.max.apply(0,r),c=Math.max.apply(0,s),d=Rr(o,h,l-o,c-h);return t.bbox=Uo(d),d}function Kg(n,t,e,i,r){return r?[["M",Number(n)+Number(r),t],["l",e-r*2,0],["a",r,r,0,0,1,r,r],["l",0,i-r*2],["a",r,r,0,0,1,-r,r],["l",r*2-e,0],["a",r,r,0,0,1,-r,-r],["l",0,r*2-i],["a",r,r,0,0,1,r,-r],["z"]]:[["M",n,t],["l",e,0],["l",0,i],["l",-e,0],["z"]]}function Ac(n,t,e,i,r,s,a,o){const h=[],l=[[],[]];let c,d,f,u,m,v,b,S;for(let P=0;P<2;++P){if(P===0?(d=6*n-12*e+6*r,c=-3*n+9*e-9*r+3*a,f=3*e-3*n):(d=6*t-12*i+6*s,c=-3*t+9*i-9*s+3*o,f=3*i-3*t),Math.abs(c)<1e-12){if(Math.abs(d)<1e-12)continue;u=-f/d,u>0&&u<1&&h.push(u);continue}b=d*d-4*f*c,S=Math.sqrt(b),!(b<0)&&(m=(-d+S)/(2*c),m>0&&m<1&&h.push(m),v=(-d-S)/(2*c),v>0&&v<1&&h.push(v))}let E=h.length,_;const x=E;for(;E--;)u=h[E],_=1-u,l[0][E]=_*_*_*n+3*_*_*u*e+3*_*u*u*r+u*u*u*a,l[1][E]=_*_*_*t+3*_*_*u*i+3*_*u*u*s+u*u*u*o;return l[0][x]=n,l[1][x]=t,l[0][x+1]=a,l[1][x+1]=o,l[0].length=l[1].length=x+2,{min:{x:Math.min.apply(0,l[0]),y:Math.min.apply(0,l[1])},max:{x:Math.max.apply(0,l[0]),y:Math.max.apply(0,l[1])}}}function Zg(n,t,e){const i=Wg(n);return!(!Hg(i,t,e)||qg(n,ga([["M",t,e],["H",i.x2+10]]),1)%2!==1)}const zo=new Map;function Mc(n){if(zo.has(n))return zo.get(n);const t=Xn(n);return zo.set(n,t),t}function Rc(n){const t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",n),t}function Dc(n,t){return ia?Rc(n).getTotalLength(t):Mc(n).length()}function Lc(n,t){if(ia)return Rc(n).getPointAtLength(t);{const e=Mc(n),[i,r]=e.at(t);return{x:i,y:r}}}let $e=null;function Ic(n,t,e){if(ia){$e||($e=document.createElement("canvas").getContext("2d"));const i=new Path2D(n);return $e.isPointInPath(i,t,e)}else return Zg(n,t,e)}function Oc(n,t,e,{lineWidth:i=1,lineCap:r="butt",lineJoin:s="miter"}){if(ia){if($e||($e=document.createElement("canvas").getContext("2d")),$e.isPointInStroke){$e.save(),$e.lineWidth=i,$e.lineCap=r,$e.lineJoin=s;const a=new Path2D(n),o=$e.isPointInStroke(a,t,e);return $e.restore(),o}}else return null}function Jg(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Fc={},$o={exports:{}},Nc;function Qg(){return Nc||(Nc=1,function(n){(function(t){var e="0.4.0",i="hasOwnProperty",r=/[\.\/]/,s="*",a=function(){},o=function(f,u){return f-u},h,l,c={n:{}},d=function(f,u){var m=l,v=Array.prototype.slice.call(arguments,2),b=d.listeners(f),S=0,E,_=[],x={},P=[];h=f,l=0;for(var R=0,F=b.length;R<F;R++)"zIndex"in b[R]&&(_.push(b[R].zIndex),b[R].zIndex<0&&(x[b[R].zIndex]=b[R]));for(_.sort(o);_[S]<0;)if(E=x[_[S++]],P.push(E.apply(u,v)),l)return l=m,P;for(R=0;R<F;R++)if(E=b[R],"zIndex"in E)if(E.zIndex==_[S]){if(P.push(E.apply(u,v)),l)return l=m,P;do if(S++,E=x[_[S]],E&&P.push(E.apply(u,v)),l)return l=m,P;while(E)}else x[E.zIndex]=E;else if(P.push(E.apply(u,v)),l)return l=m,P;return l=m,P.length?P:null};d.listeners=function(f){var u=f.split(r),m=c,v,b,S,E,_,x,P,R,F=[m],L=[];for(E=0,_=u.length;E<_;E++){for(R=[],x=0,P=F.length;x<P;x++)for(m=F[x].n,b=[m[u[E]],m[s]],S=2;S--;)v=b[S],v&&(R.push(v),L=L.concat(v.f||[]));F=R}return L},d.on=function(f,u){for(var m=f.split(r),v=c,b=0,S=m.length;b<S;b++)v=v.n,!v[m[b]]&&(v[m[b]]={n:{}}),v=v[m[b]];for(v.f=v.f||[],b=0,S=v.f.length;b<S;b++)if(v.f[b]==u)return a;return v.f.push(u),function(E){+E==+E&&(u.zIndex=+E)}},d.stop=function(){l=1},d.nt=function(f){return f?new RegExp("(?:\\.|\\/|^)"+f+"(?:\\.|\\/|$)").test(h):h},d.unbind=function(f,u){var m=f.split(r),v,b,S,E,_,x,P,R=[c];for(E=0,_=m.length;E<_;E++)for(x=0;x<R.length;x+=S.length-2){if(S=[x,1],v=R[x].n,m[E]!=s)v[m[E]]&&S.push(v[m[E]]);else for(b in v)v[i](b)&&S.push(v[b]);R.splice.apply(R,S)}for(E=0,_=R.length;E<_;E++)for(v=R[E];v.n;){if(u){if(v.f){for(x=0,P=v.f.length;x<P;x++)if(v.f[x]==u){v.f.splice(x,1);break}!v.f.length&&delete v.f}for(b in v.n)if(v.n[i](b)&&v.n[b].f){var F=v.n[b].f;for(x=0,P=F.length;x<P;x++)if(F[x]==u){F.splice(x,1);break}!F.length&&delete v.n[b].f}}else{delete v.f;for(b in v.n)v.n[i](b)&&v.n[b].f&&delete v.n[b].f}v=v.n}},d.once=function(f,u){var m=function(){u.apply(this,arguments),d.unbind(f,m)};return d.on(f,m)},d.version=e,d.toString=function(){return"You are running Eve "+e},n.exports?n.exports=d:t.eve=d})(xo)}($o)),$o.exports}(function(n){if(typeof Jg=="function")var t=Qg();(function(){function e(f){var u=function(m){u.parse(m)};return u.mode="text",u.type=String(f||"html").toLowerCase(),u.textchunk="",u.raw="",u.parse=h,u.on=a,u.event=s,u.end=r,u}function i(f,u,m){f==`
25
- `&&this.event("newline"),d[this.mode].call(this,f,u,m)}function r(){i.call(this,"eof"),this.event("eof")}function s(f,u,m){typeof t=="function"&&t("elemental."+f+"."+u,null,u,m||"",this.raw);for(var v=this.events&&this.events[f],b=v&&v.length;b--;)try{this.events[f][b](u,m||"",this.raw)}catch{}this.raw=""}function a(f,u){this.events=this.events||{},this.events[f]=this.events[f]||[],this.events[f].push(u)}function o(f,u){return f&&(f.charAt?f.charAt(u):f[u])}function h(f){f=f||Object(f);for(var u=1,m=f.length+1,v,b,S=o(f,0);u<m;u++)v=b,b=S,S=o(f,u),this.raw+=b,i.call(this,b,S,v);this._beforeEnd=function(){i.call(this,"","",b)}}var l=/[\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]/,c=function(){for(var f in this.attr)this.attr.hasOwnProperty(f)&&this.event("attr",f,{value:this.attr[f],tagname:this.tagname,attr:this.attr})},d={text:function(f,u,m){switch(f){case"<":case"eof":this.nodename="",this.attr={},this.mode="tag name start",this.raw=this.raw.slice(0,-1),this.textchunk&&this.event("text",this.textchunk),this.raw+=f,this.textchunk="";break;default:this.textchunk+=f}},special:function(f,u,m){if(m=="!"&&f=="-"&&u=="-")this.mode="comment start";else{if(this.textchunk=="[CDATA"&&f=="["){this.mode="cdata",this.textchunk="";return}if(f==">"||f=="eof"){this.event("special",this.textchunk),this.mode="text",this.textchunk="";return}this.textchunk+=f}},cdata:function(f,u,m){m=="]"&&f=="]"&&u==">"?(this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1)):(f=="eof"&&d["cdata end"].call(this),this.textchunk+=f)},"cdata end":function(f,u,m){this.event("cdata",this.textchunk),this.textchunk="",this.mode="text"},"comment start":function(f,u,m){u==">"||f=="eof"?(this.event("comment",""),this.mode="comment instant end"):this.mode="comment"},"comment instant end":function(f,u,m){this.mode="text"},comment:function(f,u,m){f=="-"&&m=="-"&&u==">"?(this.mode="comment end",this.textchunk=this.textchunk.slice(0,-1)):f=="eof"?this.event("comment",this.textchunk):this.textchunk+=f},"comment end":function(f,u,m){this.event("comment",this.textchunk),this.textchunk="",this.mode="text"},declaration:function(f,u,m){f=="?"&&u==">"?this.mode="declaration end":(f=="eof"&&this.event("comment",this.textchunk),this.textchunk+=f)},"declaration end":function(f,u,m){this.event("comment",this.textchunk),this.textchunk="",this.mode="text"},"tag name start":function(f,u,m){if(f=="eof")this.event("text","<");else if(!l.test(f)){if(this.mode="tag name",f=="/"){this.mode="close tag name start";return}if(f=="!"){this.mode="special",this.textchunk="";return}if(f=="?"){this.mode="declaration";return}d[this.mode].call(this,f,u,m)}},"close tag name start":function(f,u,m){l.test(f)||(this.mode="close tag name",this.tagname="",this.nodename="",d[this.mode].call(this,f,u,m))},"close tag name":function(f,u,m){if(l.test(f))this.tagname=this.nodename;else switch(f){case">":this.event("/tag",this.tagname||this.nodename),this.mode="text";break;default:!this.tagname&&(this.nodename+=f)}},"tag name":function(f,u,m){if(l.test(f))this.tagname=this.nodename,this.nodename="",this.mode="attr start";else switch(f){case">":this.event("tag",this.nodename),this.mode="text";break;default:this.nodename+=f}},"attr start":function(f,u,m){l.test(f)||(this.mode="attr",this.nodename="",d[this.mode].call(this,f,u,m))},attr:function(f,u,m){if(l.test(f)||f=="=")this.attr[this.nodename]="",this.mode="attr value start";else switch(f){case">":this.nodename=="/"?(delete this.attr["/"],this.event("tag",this.tagname,this.attr),c.call(this),this.event("/tag",this.tagname,!0)):(this.nodename&&(this.attr[this.nodename]=""),this.event("tag",this.tagname,this.attr),c.call(this)),this.mode="text";break;default:this.nodename+=f}},"attr value start":function(f,u,m){if(!l.test(f)){if(this.mode="attr value",this.quote=!1,f=="'"||f=='"'){this.quote=f;return}d[this.mode].call(this,f,u,m)}},"attr value":function(f,u,m){if(l.test(f)&&!this.quote)this.mode="attr start";else if(f==">"&&!this.quote)this.event("tag",this.tagname,this.attr),this.mode="text";else switch(f){case'"':case"'":this.quote==f&&m!="\\"&&(this.mode="attr start");break;default:this.attr[this.nodename]+=f}}};e.version="0.2.1",n.elemental=e,n.eve=t})()})(Fc);const Gc=Pe(Fc);function Vo(n,t,e,i,r,s){if(typeof r>"u"||typeof s>"u"){const a=n-e,o=t-i;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return Vo(n,t,r,s)-Vo(e,i,r,s)}const Dt=Gc.eve,tp=Gc.elemental,ma={cursor:1,cx:0,cy:0,fill:1,"fill-opacity":0,font:1,"font-family":1,"font-size":0,"font-style":1,"font-weight":1,height:0,"letter-spacing":0,opacity:0,r:0,rx:0,ry:0,src:1,stroke:1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":0,"stroke-opacity":0,"stroke-width":0,"text-anchor":1,width:0,x:0,y:0};function Ho(n,t,e){for(var i=(n+"").split(";"),r=/^\s+|\s+$/g,s,a=0,o=i.length;a<o;a++){var h=i[a].split(":");s=h[0].replace(r,"").replace(/[A-Z]/g,function(l){return"-"+l.toLowerCase()}),(!e||s in e)&&(t[s]=h[1].replace(r,""),e&&!e[s]&&(t[s]=parseFloat(t[s])))}}function Uc(n){const t=tp(),e=[],i=[],r={};let s,a,o;const h={};function l(c,d){return function(f,u){const m={type:d||c};e.push(m);for(let v in u)Object.prototype.hasOwnProperty.call(u,v)&&Dt("rappar."+c+".attr."+v,m,u[v],v);Dt("rappar."+c+".attrend",m,u)}}return Dt.on("rappar.polygon.attr.points",function(c){this.path="M"+c+"z",Dt.stop()}),Dt.on("rappar.image.attr.xlink:href",function(c){this.src=c,Dt.stop()}),Dt.on("rappar.path.attr.d",function(c){this.path=c,Dt.stop()}),Dt.on("rappar.*.attr.transform",function(c){this.transform=Ar(c).toTransformString(),Dt.stop()}),Dt.on("rappar.*.attr.fill",function(c){var d=c.match(/url\(#([^)]+)\)/),f=this;d&&(d=d[1],r[d]?this.fill=r[d]:Dt.on("rappar.found."+d,function(u){f.fill=u}),Dt.stop())}),Dt.on("rappar.line.attrend",function(c){this.path="M"+[c.x1,c.y1,c.x2,c.y2]}),Dt.on("rappar.*.attrend",function(){for(var c=i.length;c--;)if(i[c]!=this){let f="",u="";for(var d in i[c])d=="transform"?f=i[c].transform:d=="class"&&h["."+i[c][d]]?u=h["."+i[c][d]].join(";")+";"+u:d=="id"&&h["#"+i[c][d]]?u=h["#"+i[c][d]].join(";")+";"+u:typeof this[d]>"u"&&(this[d]=i[c][d]);this.type&&(typeof this.transform>"u"?this.transform=f:this.transform+=f,typeof this.style>"u"?this.style=u:this.style=u+this.style,Ho(this.style,this,ma))}}),Dt.on("rappar.*.attr.style",function(c){var d=function(){Ho(c,this,ma),Dt.unbind("rappar.*.attrend",d)};Dt.on("rappar.*.attrend",d),Dt.stop()}),Dt.on("rappar.*.attr.*",function(c,d){d in ma&&(this[d]=ma[d]?c:parseFloat(c))}),Dt.on("elemental.tag.circle",l("circle")),Dt.on("elemental.tag.ellipse",l("ellipse")),Dt.on("elemental.tag.polygon",l("polygon","path")),Dt.on("elemental.tag.path",l("path")),Dt.on("elemental.tag.line",l("line","path")),Dt.on("elemental.tag.rect",l("rect")),Dt.on("elemental.tag.image",l("image")),Dt.on("elemental.tag.text",l("text")),Dt.on("elemental.text",function(c){try{const d=$1(c);for(let f of d.stylesheet.rules){for(let u of f.selectors)h[u]=[];for(let u of f.declarations)for(let m of f.selectors)h[m].push(`${u.property}:${u.value}`)}}catch{}}),Dt.on("elemental.tag.svg",function(c,d){let f=d.width||0,u=d.height||0;if(!f||!u){const m=d.viewBox.split(/\s+/gi);f=parseFloat(m[2])-parseFloat(m[0]),u=parseFloat(m[3])-parseFloat(m[1])}e.push({type:"viewbox",width:f,height:u})}),Dt.on("rappar.text.attrend",function(){s="",a=this,this["text-anchor"]=this["text-anchor"]||"start"}),Dt.on("elemental.text",function(c,d,f){a&&(s+=f)}),Dt.on("elemental./tag.text",function(){a.text=s,a=null}),Dt.on("elemental.tag.g",function(c,d){var f={};i.push(f);for(var u in d)Object.prototype.hasOwnProperty.call(d,u)&&(f[u]=d[u],Dt("rappar.g.attr."+u,f,d[u],u));Dt("rappar.g.attrend",f)}),Dt.on("elemental./tag.g",function(c,d){i.pop()}),Dt.on("elemental.tag.linearGradient",function(c,d){o={id:d.id,angle:+(360+Vo(d.x1,d.y1,d.x2,d.y2,d.x1+100,d.y1)).toFixed(2),stops:[]}}),Dt.on("elemental./tag.linearGradient",function(){for(var c=[o.angle],d,f=0,u=o.stops.length;f<u;f++)d=o.stops[f],f&&f!=u-1?c.push(d.color+":"+d.offset):c.push(d.color);r[o.id]=c.join("-"),Dt("rappar.found."+o.id,null,r[o.id])}),Dt.on("elemental.tag.radialGradient",function(c,d){o={id:d.id,stops:[]}}),Dt.on("elemental./tag.radialGradient",function(){for(var c=[],d,f=0,u=o.stops.length;f<u;f++)d=o.stops[f],f&&f!=u-1?c.push(d.color+":"+d.offset):c.push(d.color);r[o.id]="r"+c.join("-"),Dt("rappar.found."+o.id,null,r[o.id])}),Dt.on("elemental.tag.stop",function(c,d){var f={};d.style&&Ho(d.style,f),f.offset=f.offset||d.offset,f.color=f["stop-color"]||d["stop-color"],f.opacity=f["stop-opacity"]||d["stop-opacity"],~(f.offset+"").indexOf("%")?f.offset=parseFloat(f.offset):f.offset=parseFloat(f.offset)*100,f.offset=+f.offset.toFixed(2),o.stops.push(f)}),t(n),t.end(),e}const Bc=ep("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 ep(n,t=10){const e={},i=n.split(",");for(let r=0;r<i.length;r+=2){const s="&"+i[r+1]+";",a=parseInt(i[r],t);e[s]="&#"+a+";"}return e["\\xa0"]="&#160;",e}function Te(n,t){const e=Object.keys(t);for(let i=0;i<e.length;i++)n=n.replace(new RegExp("{"+e[i]+"}","gi"),""+t[e[i]]);return n}function va(n){let t,e;if(!n)throw new Error("cannot create a random attribute name for an undefined object");const i="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=i[Math.floor(Math.random()*i.length)];while(n[t]);return t}function ip(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function np(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const Dr={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}};class _a{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const i=this.__ctx.__createElement("stop");if(i.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const s=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);s&&(i.setAttribute("stop-color",Te("rgb({r},{g},{b})",{r:s[1],g:s[2],b:s[3]})),i.setAttribute("stop-opacity",s[4]))}else i.setAttribute("stop-color",e);this.__root.appendChild(i)}}class jo{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Lr{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:i=500,enableMirroring:r=!1}){this.enableMirroring=r,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=i),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(Dr);for(let e=0,i=t.length;e<i;e++){const r=t[e];this[r]=Dr[r].canvas}}__getStyleState(){const t={},e=Object.keys(Dr);for(let i=0,r=e.length;i<r;i++){const s=e[i];t[s]=this[s]}return t}__applyStyleState(t){const e=Object.keys(t);for(let i=0,r=e.length;i<r;i++){const s=e[i];this[s]=t[s]}}__createElement(t,e={},i=!1){const r=this.__document.createElementNS("http://www.w3.org/2000/svg",t),s=Object.keys(e);i&&(r.setAttribute("fill","none"),r.setAttribute("stroke","none"));for(let a=0;a<s.length;a++){const o=s[a];r.setAttribute(o,e[o])}return r}__applyStyleToCurrentElement(t){let e=this.__currentElement;const i=this.__currentElementsToStyle;i&&(e.setAttribute(t,""),e=i.element,i.children.forEach(s=>{s.setAttribute(t,"")}));const r=Object.keys(Dr);for(let s=0;s<r.length;s++){const a=Dr[r[s]],o=this[r[s]];if(a.apply){if(o instanceof jo){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,Te("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof _a)e.setAttribute(a.apply,Te("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 l=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(o);e.setAttribute(a.svgAttr,Te("rgb({r},{g},{b})",{r:l[1],g:l[2],b:l[3]}));let c=parseFloat(l[4]);const d=this.globalAlpha;d!=null&&(c*=d),e.setAttribute(a.svgAttr+"-opacity",""+c)}else{let h=a.svgAttr;if(r[s]==="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 r=Object.keys(Bc);for(let s=0,a=r.length;s<a;s++){const o=r[s],h=Bc[o],l=new RegExp(o,"gi");l.test(e)&&(e=e.replace(l,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 r=this.__createElement("g");e.appendChild(r),this.__currentElement=r}let i=this.__currentElement.getAttribute("transform");i?i+=" ":i="",i+=t,this.__currentElement.setAttribute("transform",i)}scale(t,e){e===void 0&&(e=t),this.__addTransform(Te("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(Te("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(Te("translate({x},{y})",{x:t,y:e}))}transform(t,e,i,r,s,a){this.__addTransform(Te("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:i,d:r,e:s,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):console.error("Attempted to apply path command to node",t.nodeName)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(Te("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(Te("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Te("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,i,r,s,a){this.__currentPosition={x:s,y:a},this.__addPathCommand(Te("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:i,cp2y:r,x:s,y:a}))}quadraticCurveTo(t,e,i,r){this.__currentPosition={x:i,y:r},this.__addPathCommand(Te("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:i,y:r}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,i,r,s){const a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(typeof a>"u"||typeof o>"u")return;if(s<0)throw new Error("IndexSizeError: The radius provided ("+s+") is negative.");if(a===t&&o===e||t===i&&e===r||s===0){this.lineTo(t,e);return}const h=this.normalize([a-t,o-e]),l=this.normalize([i-t,r-e]);if(h[0]*l[1]===h[1]*l[0]){this.lineTo(t,e);return}const c=h[0]*l[0]+h[1]*l[1],d=Math.acos(Math.abs(c)),f=this.normalize([h[0]+l[0],h[1]+l[1]]),u=s/Math.sin(d/2),m=t+u*f[0],v=e+u*f[1],b=[-h[1],h[0]],S=[l[1],-l[0]],E=function(P){const R=P[0];return P[1]>=0?Math.acos(R):-Math.acos(R)},_=E(b),x=E(S);this.lineTo(m+b[0]*s,v+b[1]*s),this.arc(m,v,s,_,x)}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,i,r){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.closePath()}fillRect(t,e,i,r){const s=this.__createElement("rect",{x:t,y:e,width:i,height:r},!0);this.__closestGroupOrSvg().appendChild(s),this.__currentElement=s,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,i,r){const s=this.__createElement("rect",{x:t,y:e,width:i,height:r},!0);this.__closestGroupOrSvg().appendChild(s),this.__currentElement=s,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),i=this.__rootSVG.childNodes[1],r=i.childNodes;for(let s=r.length-1;s>=0;s--)r[s]&&i.removeChild(r[s]);this.__currentElement=i,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,i,r){if(t===0&&e===0&&i===this.width&&r===this.height){this.__clearCanvas();return}const s=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:i,height:r,fill:"#FFFFFF"},!0);s.appendChild(a)}createLinearGradient(t,e,i,r){const s=this.__createElement("linearGradient",{id:va(this.__ids),x1:t+"px",x2:i+"px",y1:e+"px",y2:r+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(s),new _a(s,this)}createRadialGradient(t,e,i,r,s,a){const o=this.__createElement("radialGradient",{id:va(this.__ids),cx:r+"px",cy:s+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new _a(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),i={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"&&(i.decoration="underline"),this.__fontHref&&(i.href=this.__fontHref),i}__wrapTextLink(t,e){if(t.href){const i=this.__createElement("a");return i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),i.appendChild(e),i}return e}__applyText(t,e,i,r){const s=this.__parseFont(),a=this.__closestGroupOrSvg(),o=this.__createElement("text",{"font-family":s.family,"font-size":s.size,"font-style":s.style,"font-weight":s.weight,"text-decoration":s.decoration,x:e,y:i,"text-anchor":ip(this.textAlign),"dominant-baseline":np(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(r),a.appendChild(this.__wrapTextLink(s,o))}fillText(t,e,i){this.__applyText(t,e,i,"fill")}strokeText(t,e,i){this.__applyText(t,e,i,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,i,r,s,a){if(r===s)return;r=r%(2*Math.PI),s=s%(2*Math.PI),r===s&&(s=(s+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+i*Math.cos(s),h=e+i*Math.sin(s),l=t+i*Math.cos(r),c=e+i*Math.sin(r),d=a?0:1;let f=0,u=s-r;u<0&&(u+=2*Math.PI),a?f=u>Math.PI?0:1:f=u>Math.PI?1:0,this.lineTo(l,c),this.__addPathCommand(Te("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:i,ry:i,xAxisRotation:0,largeArcFlag:f,sweepFlag:d,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),i=va(this.__ids),r=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",i),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",Te("url(#{id})",{id:i})),t.appendChild(r),this.__currentElement=r}drawImage(...t){let e=t[0],i,r,s,a,o=0,h=0,l,c,d,f,u,m,v,b;if(t.length===3)i=t[1],r=t[2],l=e.width,c=e.height,s=l,a=c;else if(t.length===5)i=t[1],r=t[2],s=t[3],a=t[4],l=e.width,c=e.height;else if(t.length===9)o=t[1],h=t[2],l=t[3],c=t[4],i=t[5],r=t[6],s=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const S=this.__closestGroupOrSvg();this.__currentElement;const E="translate("+i+", "+r+")";if(e instanceof Lr){if(d=e.getSvg().cloneNode(!0),d.childNodes&&d.childNodes.length>1){for(f=d.childNodes[0];f.childNodes.length;)b=f.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(f.childNodes[0]);if(u=d.childNodes[1],u){const _=u.getAttribute("transform");let x;_?x=_+" "+E:x=E,u.setAttribute("transform",x),S.appendChild(u)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(m=this.__createElement("image"),m.setAttribute("width",s),m.setAttribute("height",a),m.setAttribute("preserveAspectRatio","none"),(o||h||l!==e.width||c!==e.height)&&(v=this.__document.createElement("canvas"),v.width=s,v.height=a,v.getContext("2d")?.drawImage(e,o,h,l,c,0,0,s,a),e=v),m.setAttribute("transform",E),m.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),S.appendChild(m))}createPattern(t,e){const i=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),r=va(this.__ids);let s;return i.setAttribute("id",r),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(s=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),i.appendChild(s),this.__SVGdefs.appendChild(i)):t instanceof Lr&&(i.setAttribute("width",""+t.width),i.setAttribute("height",""+t.height),i.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(i)),new jo(i,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}const zc=class k1{point;constructor(t){this.point=new Wt(t)}static fromSVGPathData(t){if(t.length<3)throw new Error("Line 参数个数错误");if(t[0].toUpperCase()!=="L")throw new Error("Line command 错误");return new k1({x:t[1],y:t[2]})}toSVGPathData(){return["L",this.point.x,this.point.y]}toSVGPathD(){return"L "+this.point.toSVGPathD()}},$c=class E1 extends zc{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1}static fromSVGPathData(t){if(t.length<8)throw new Error("Arc 参数个数错误");if(t[0].toUpperCase()!=="A")throw new Error("Arc command 错误");return new E1({x:t[6],y:t[7],rx:t[1],ry:t[2],xAxisRotate:t[3],largeArcFlag:t[4],sweepFlag:t[5]})}toSVGPathData(){return["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.point.x,this.point.y]}toSVGPathD(){return`A ${this.rx},${this.ry} ${this.xAxisRotate} ${this.largeArcFlag},${this.sweepFlag} ${this.point.toSVGPathD()}`}};class Xo extends zc{ctrlPoints=[];constructor(t){super(t),this.ctrlPoints.push(new Wt({x:t.c1x,y:t.c1y})),this.ctrlPoints.push(new Wt({x:t.c2x,y:t.c2y}))}static fromSVGPathData(t){if(t.length<7)throw new Error("CubicBezier 参数个数错误");if(t[0].toUpperCase()!=="C")throw new Error("CubicBezier command 错误");return new Xo({c1x:t[1],c1y:t[2],c2x:t[3],c2y:t[4],x:t[5],y:t[6]})}toSVGPathData(){return["C",this.ctrlPoints[0].x,this.ctrlPoints[0].y,this.ctrlPoints[1].x,this.ctrlPoints[1].y,this.point.x,this.point.y]}toSVGPathD(){return`C ${this.ctrlPoints.map(t=>t.toSVGPathD()).join(" ")} ${this.point.toSVGPathD()}`}}const Yo=Xo;class mn{startPoint;isClosed=!1;lines=[];normalizedLines=[];constructor(t){this.startPoint=t?.startPoint??null,this.isClosed=t?.isClosed??!1,t?.lines?.forEach(this.addLine),this.normalize()}setStartPoint(t,e){return this.startPoint=new Wt({x:t,y:e}),this}addLine(t){return this.lines.push(t),this}normalize(){let t=this.lines.reduce((i,r)=>(i+=r.toSVGPathD(),i),"");this.startPoint&&(t="M "+this.startPoint.toSVGPathD()+t),this.isClosed&&(t+="Z"),this.normalizedLines=[];const e=ga(da(fa(t)));for(let i=0,r=e.length;i<r;i++){const s=e[i];if(i==0&&s[0]=="M"){this.setStartPoint(s[1],s[2]);continue}if(i==r-1&&s[0]=="Z"){this.isClosed=!0;continue}this.normalizedLines.push(Yo.fromSVGPathData(s))}return this}static fromSVGPathD(t,e){if(!xc(t))throw new Error("Not an SVG path!");const i=ga(da(fa(t)));return mn.fromSVGPathData(i,e)}static fromSVGPathData(t,e){const i=new mn;for(let s=0,a=t.length;s<a;s++){const o=t[s],h=o[0];if(s==0&&h=="M"){i.setStartPoint(o[1],o[2]);continue}if(s==a-1&&h=="Z"){i.isClosed=!0;continue}i.addLine(new Yo({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],x:o[5],y:o[6]}))}i.normalize();const r=Ar(e??"");return i.transform(r)}toSVGPathD(){let t="";this.startPoint&&(t+="M "+this.startPoint.toSVGPathD());for(let e=0,i=this.normalizedLines.length;e<i;e++)t+=this.normalizedLines[e].toSVGPathD();return this.isClosed&&(t+="Z"),t}toSVGPathData(){const t=[];this.startPoint&&t.push(["M",...this.startPoint.toSVGPathData()]);for(let e=0,i=this.normalizedLines.length;e<i;e++)t.push(this.normalizedLines[e].toSVGPathData());return this.isClosed&&t.push(["Z"]),t}toCanvas(t){const e=this.normalizedLines;e.length&&(this.startPoint&&(t.beginPath(),t.moveTo(this.startPoint.x,this.startPoint.y)),e.forEach(i=>{const[r,...s]=i.toSVGPathData();r==="M"?t.moveTo(s[0],s[1]):r==="Z"?t.closePath():t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}),this.isClosed&&t.closePath())}get bounds(){let t=[0,0,0,0];if(this.normalizedLines.length){t=[1/0,1/0,-1/0,-1/0];for(let e=0,i=this.normalizedLines.length;e<i;e++){const r=this.normalizedLines[e],s=[...r.ctrlPoints,r.point];for(let a=0;a<s.length;a++){const o=s[a].x,h=s[a].y;o<t[0]&&(t[0]=o),h<t[1]&&(t[1]=h),o>t[2]&&(t[2]=o),h>t[3]&&(t[3]=h)}}}return t}get size(){const t=this.bounds;return[t[2]-t[0],t[3]-t[1]]}get center(){const[t,e,i,r]=this.bounds;return[(t+i)/2,(e+r)/2]}getTotalLength(){return Dc(this.toSVGPathD())}getPointAtLength(t){return Lc(this.toSVGPathD(),t)}isPointInPath(t,e){return Ic(this.toSVGPathD(),t,e)}isPointInStroke(t,e,i={lineWidth:1,lineCap:"butt",lineJoin:"miter"}){return Oc(this.toSVGPathD(),t,e,i)}transform(t){if(this.startPoint){const[e,i]=t.transformPoint(this.startPoint.x,this.startPoint.y);this.setStartPoint(e,i)}return this.normalizedLines=this.normalizedLines.map(e=>{const[i,...r]=e.toSVGPathData(),s=[i];for(let a=0,o=r.length;a<o;a+=2){const h=r[a],l=r[a+1],[c,d]=t.transformPoint(h,l);s.push(c,d)}return Yo.fromSVGPathData(s)}),this}translate(t,e){const i=new we().translate(t,e);return this.transform(i)}rotate(t,e=0,i=0){const r=new we().rotate(t,e,i);return this.transform(r)}scale(t,e=t,i=0,r=0){const s=new we().scale(t,e,i,r);return this.transform(s)}skew(t,e=0){const i=new we().skew(t,e);return this.transform(i)}trim(){const[t,e]=this.bounds;return this.translate(-t,-e),this}static generateRosetta(t,e,i,r,s){if(s==0)throw new Error("no dividing by zero, please");const a=new mn;a.setStartPoint(t,e);const o=360/s;for(let h=0;h<s;h+=1){const l=o*h*Math.PI/180,c=t+2*i*Math.cos(l),d=e+2*i*Math.sin(l);a.addLine(new $c({x:c,y:d,rx:i,ry:r,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1})),a.addLine(new $c({x:t,y:e,rx:i,ry:r,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1}))}return a.normalize(),a}}var Vc={exports:{}};(function(n,t){(function(e,i){n.exports=i()})(window,function(){return function(e){var i={};function r(s){if(i[s])return i[s].exports;var a=i[s]={i:s,l:!1,exports:{}};return e[s].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=i,r.d=function(s,a,o){r.o(s,a)||Object.defineProperty(s,a,{enumerable:!0,get:o})},r.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},r.t=function(s,a){if(1&a&&(s=r(s)),8&a||4&a&&typeof s=="object"&&s&&s.__esModule)return s;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:s}),2&a&&typeof s!="string")for(var h in s)r.d(o,h,function(l){return s[l]}.bind(null,h));return o},r.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return r.d(a,"a",a),a},r.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},r.p="",r(r.s=1)}([function(e,i,r){var s,a;s=[r(2)],(a=function(o){function h(p){if(h.is(p,"function"))return l?p():o.on("raphael.DOMload",p);if(h.is(p,nt))return h._engine.create[E](h,p.splice(0,3+h.is(p[0],pt))).add(p);var w=Array.prototype.slice.call(arguments,0);if(h.is(w[w.length-1],"function")){var C=w.pop();return l?C.call(h._engine.create[E](h,w)):o.on("raphael.DOMload",function(){C.call(h._engine.create[E](h,w))})}return h._engine.create[E](h,arguments)}h.version="2.3.0",h.eve=o;var l,c,d=/[, ]+/,f={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},u=/\{(\d+)\}/g,m="hasOwnProperty",v={doc:document,win:window},b={was:Object.prototype[m].call(v.win,"Raphael"),is:v.win.Raphael},S=function(){this.ca=this.customAttributes={}},E="apply",_="concat",x="ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch,P="",R=" ",F=String,L="split",$="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[L](R),U={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},z=F.prototype.toLowerCase,q=Math,K=q.max,Z=q.min,at=q.abs,vt=q.pow,_t=q.PI,pt="number",nt="array",J=Object.prototype.toString,I=(h._ISURL=/^url\(['"]?(.+?)['"]?\)$/i,/^\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),D={NaN:1,Infinity:1,"-Infinity":1},A=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,B=q.round,j=parseFloat,W=parseInt,N=F.prototype.toUpperCase,Y=h._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0,class:""},X=h._availableAnimAttrs={blur:pt,"clip-rect":"csv",cx:pt,cy:pt,fill:"colour","fill-opacity":pt,"font-size":pt,height:pt,opacity:pt,path:"path",r:pt,rx:pt,ry:pt,stroke:"colour","stroke-opacity":pt,"stroke-width":pt,transform:"transform",width:pt,x:pt,y:pt},et=/[\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]*/,ht={hs:1,rg:1},mt=/,?([achlmqrstvxz]),?/gi,bt=/([achlmrqstvz])[\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,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\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]*)+)/gi,Tt=/([rstm])[\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,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\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]*)+)/gi,yt=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\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]*/gi,Et=(h._radial_gradient=/^r(?:\(([^,]+?)[\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]*([^\)]+?)\))?/,{}),Pt=function(p,w){return j(p)-j(w)},Ot=function(p){return p},Ct=h._rectPath=function(p,w,C,g,y){return y?[["M",p+y,w],["l",C-2*y,0],["a",y,y,0,0,1,y,y],["l",0,g-2*y],["a",y,y,0,0,1,-y,y],["l",2*y-C,0],["a",y,y,0,0,1,-y,-y],["l",0,2*y-g],["a",y,y,0,0,1,y,-y],["z"]]:[["M",p,w],["l",C,0],["l",0,g],["l",-C,0],["z"]]},Jt=function(p,w,C,g){return g==null&&(g=C),[["M",p,w],["m",0,-g],["a",C,g,0,1,1,0,2*g],["a",C,g,0,1,1,0,-2*g],["z"]]},zt=h._getPath={path:function(p){return p.attr("path")},circle:function(p){var w=p.attrs;return Jt(w.cx,w.cy,w.r)},ellipse:function(p){var w=p.attrs;return Jt(w.cx,w.cy,w.rx,w.ry)},rect:function(p){var w=p.attrs;return Ct(w.x,w.y,w.width,w.height,w.r)},image:function(p){var w=p.attrs;return Ct(w.x,w.y,w.width,w.height)},text:function(p){var w=p._getBBox();return Ct(w.x,w.y,w.width,w.height)},set:function(p){var w=p._getBBox();return Ct(w.x,w.y,w.width,w.height)}},ce=h.mapPath=function(p,w){if(!w)return p;var C,g,y,k,M,O,G;for(y=0,M=(p=Nn(p)).length;y<M;y++)for(k=1,O=(G=p[y]).length;k<O;k+=2)C=w.x(G[k],G[k+1]),g=w.y(G[k],G[k+1]),G[k]=C,G[k+1]=g;return p};if(h._g=v,h.type=v.win.SVGAngle||v.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML",h.type=="VML"){var Xt,Ee=v.doc.createElement("div");if(Ee.innerHTML='<v:shape adj="1"/>',(Xt=Ee.firstChild).style.behavior="url(#default#VML)",!Xt||typeof Xt.adj!="object")return h.type=P;Ee=null}function ye(p){if(typeof p=="function"||Object(p)!==p)return p;var w=new p.constructor;for(var C in p)p[m](C)&&(w[C]=ye(p[C]));return w}h.svg=!(h.vml=h.type=="VML"),h._Paper=S,h.fn=c=S.prototype=h.prototype,h._id=0,h.is=function(p,w){return(w=z.call(w))=="finite"?!D[m](+p):w=="array"?p instanceof Array:w=="null"&&p===null||w==typeof p&&p!==null||w=="object"&&p===Object(p)||w=="array"&&Array.isArray&&Array.isArray(p)||J.call(p).slice(8,-1).toLowerCase()==w},h.angle=function(p,w,C,g,y,k){if(y==null){var M=p-C,O=w-g;return M||O?(180+180*q.atan2(-O,-M)/_t+360)%360:0}return h.angle(p,w,y,k)-h.angle(C,g,y,k)},h.rad=function(p){return p%360*_t/180},h.deg=function(p){return Math.round(180*p/_t%360*1e3)/1e3},h.snapTo=function(p,w,C){if(C=h.is(C,"finite")?C:10,h.is(p,nt)){for(var g=p.length;g--;)if(at(p[g]-w)<=C)return p[g]}else{var y=w%(p=+p);if(y<C)return w-y;if(y>p-C)return w-y+p}return w};var li,on;h.createUUID=(li=/[xy]/g,on=function(p){var w=16*q.random()|0;return(p=="x"?w:3&w|8).toString(16)},function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(li,on).toUpperCase()}),h.setWindow=function(p){o("raphael.setWindow",h,v.win,p),v.win=p,v.doc=v.win.document,h._engine.initWin&&h._engine.initWin(v.win)};var Qe=function(p){if(h.vml){var w,C=/^\s+|\s+$/g;try{var g=new ActiveXObject("htmlfile");g.write("<body>"),g.close(),w=g.body}catch{w=createPopup().document.body}var y=w.createTextRange();Qe=ve(function(M){try{w.style.color=F(M).replace(C,P);var O=y.queryCommandValue("ForeColor");return"#"+("000000"+(O=(255&O)<<16|65280&O|(16711680&O)>>>16).toString(16)).slice(-6)}catch{return"none"}})}else{var k=v.doc.createElement("i");k.title="Raphaël Colour Picker",k.style.display="none",v.doc.body.appendChild(k),Qe=ve(function(M){return k.style.color=M,v.doc.defaultView.getComputedStyle(k,P).getPropertyValue("color")})}return Qe(p)},Ri=function(){return"hsb("+[this.h,this.s,this.b]+")"},Di=function(){return"hsl("+[this.h,this.s,this.l]+")"},ci=function(){return this.hex},ui=function(p,w,C){if(w==null&&h.is(p,"object")&&"r"in p&&"g"in p&&"b"in p&&(C=p.b,w=p.g,p=p.r),w==null&&h.is(p,"string")){var g=h.getRGB(p);p=g.r,w=g.g,C=g.b}return(p>1||w>1||C>1)&&(p/=255,w/=255,C/=255),[p,w,C]},dr=function(p,w,C,g){var y={r:p*=255,g:w*=255,b:C*=255,hex:h.rgb(p,w,C),toString:ci};return h.is(g,"finite")&&(y.opacity=g),y};function ve(p,w,C){return function g(){var y=Array.prototype.slice.call(arguments,0),k=y.join("␀"),M=g.cache=g.cache||{},O=g.count=g.count||[];return M[m](k)?(function(G,H){for(var Q=0,st=G.length;Q<st;Q++)if(G[Q]===H)return G.push(G.splice(Q,1)[0])}(O,k),C?C(M[k]):M[k]):(O.length>=1e3&&delete M[O.shift()],O.push(k),M[k]=p[E](w,y),C?C(M[k]):M[k])}}h.color=function(p){var w;return h.is(p,"object")&&"h"in p&&"s"in p&&"b"in p?(w=h.hsb2rgb(p),p.r=w.r,p.g=w.g,p.b=w.b,p.hex=w.hex):h.is(p,"object")&&"h"in p&&"s"in p&&"l"in p?(w=h.hsl2rgb(p),p.r=w.r,p.g=w.g,p.b=w.b,p.hex=w.hex):(h.is(p,"string")&&(p=h.getRGB(p)),h.is(p,"object")&&"r"in p&&"g"in p&&"b"in p?(w=h.rgb2hsl(p),p.h=w.h,p.s=w.s,p.l=w.l,w=h.rgb2hsb(p),p.v=w.b):(p={hex:"none"}).r=p.g=p.b=p.h=p.s=p.v=p.l=-1),p.toString=ci,p},h.hsb2rgb=function(p,w,C,g){var y,k,M,O,G;return this.is(p,"object")&&"h"in p&&"s"in p&&"b"in p&&(C=p.b,w=p.s,g=p.o,p=p.h),O=(G=C*w)*(1-at((p=(p*=360)%360/60)%2-1)),y=k=M=C-G,dr(y+=[G,O,0,0,O,G][p=~~p],k+=[O,G,G,O,0,0][p],M+=[0,0,O,G,G,O][p],g)},h.hsl2rgb=function(p,w,C,g){var y,k,M,O,G;return this.is(p,"object")&&"h"in p&&"s"in p&&"l"in p&&(C=p.l,w=p.s,p=p.h),(p>1||w>1||C>1)&&(p/=360,w/=100,C/=100),O=(G=2*w*(C<.5?C:1-C))*(1-at((p=(p*=360)%360/60)%2-1)),y=k=M=C-G/2,dr(y+=[G,O,0,0,O,G][p=~~p],k+=[O,G,G,O,0,0][p],M+=[0,0,O,G,G,O][p],g)},h.rgb2hsb=function(p,w,C){var g,y;return p=(C=ui(p,w,C))[0],w=C[1],C=C[2],{h:(((y=(g=K(p,w,C))-Z(p,w,C))==0?null:g==p?(w-C)/y:g==w?(C-p)/y+2:(p-w)/y+4)+360)%6*60/360,s:y==0?0:y/g,b:g,toString:Ri}},h.rgb2hsl=function(p,w,C){var g,y,k,M;return p=(C=ui(p,w,C))[0],w=C[1],C=C[2],g=((y=K(p,w,C))+(k=Z(p,w,C)))/2,{h:(((M=y-k)==0?null:y==p?(w-C)/M:y==w?(C-p)/M+2:(p-w)/M+4)+360)%6*60/360,s:M==0?0:g<.5?M/(2*g):M/(2-2*g),l:g,toString:Di}},h._path2string=function(){return this.join(",").replace(mt,"$1")},h._preload=function(p,w){var C=v.doc.createElement("img");C.style.cssText="position:absolute;left:-9999em;top:-9999em",C.onload=function(){w.call(this),this.onload=null,v.doc.body.removeChild(this)},C.onerror=function(){v.doc.body.removeChild(this)},v.doc.body.appendChild(C),C.src=p};function fi(){return this.hex}function hn(p,w){for(var C=[],g=0,y=p.length;y-2*!w>g;g+=2){var k=[{x:+p[g-2],y:+p[g-1]},{x:+p[g],y:+p[g+1]},{x:+p[g+2],y:+p[g+3]},{x:+p[g+4],y:+p[g+5]}];w?g?y-4==g?k[3]={x:+p[0],y:+p[1]}:y-2==g&&(k[2]={x:+p[0],y:+p[1]},k[3]={x:+p[2],y:+p[3]}):k[0]={x:+p[y-2],y:+p[y-1]}:y-4==g?k[3]=k[2]:g||(k[0]={x:+p[g],y:+p[g+1]}),C.push(["C",(-k[0].x+6*k[1].x+k[2].x)/6,(-k[0].y+6*k[1].y+k[2].y)/6,(k[1].x+6*k[2].x-k[3].x)/6,(k[1].y+6*k[2].y-k[3].y)/6,k[2].x,k[2].y])}return C}h.getRGB=ve(function(p){if(!p||(p=F(p)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:fi};if(p=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:fi};!ht[m](p.toLowerCase().substring(0,2))&&p.charAt()!="#"&&(p=Qe(p));var w,C,g,y,k,M,O=p.match(I);return O?(O[2]&&(g=W(O[2].substring(5),16),C=W(O[2].substring(3,5),16),w=W(O[2].substring(1,3),16)),O[3]&&(g=W((k=O[3].charAt(3))+k,16),C=W((k=O[3].charAt(2))+k,16),w=W((k=O[3].charAt(1))+k,16)),O[4]&&(M=O[4][L](et),w=j(M[0]),M[0].slice(-1)=="%"&&(w*=2.55),C=j(M[1]),M[1].slice(-1)=="%"&&(C*=2.55),g=j(M[2]),M[2].slice(-1)=="%"&&(g*=2.55),O[1].toLowerCase().slice(0,4)=="rgba"&&(y=j(M[3])),M[3]&&M[3].slice(-1)=="%"&&(y/=100)),O[5]?(M=O[5][L](et),w=j(M[0]),M[0].slice(-1)=="%"&&(w*=2.55),C=j(M[1]),M[1].slice(-1)=="%"&&(C*=2.55),g=j(M[2]),M[2].slice(-1)=="%"&&(g*=2.55),(M[0].slice(-3)=="deg"||M[0].slice(-1)=="°")&&(w/=360),O[1].toLowerCase().slice(0,4)=="hsba"&&(y=j(M[3])),M[3]&&M[3].slice(-1)=="%"&&(y/=100),h.hsb2rgb(w,C,g,y)):O[6]?(M=O[6][L](et),w=j(M[0]),M[0].slice(-1)=="%"&&(w*=2.55),C=j(M[1]),M[1].slice(-1)=="%"&&(C*=2.55),g=j(M[2]),M[2].slice(-1)=="%"&&(g*=2.55),(M[0].slice(-3)=="deg"||M[0].slice(-1)=="°")&&(w/=360),O[1].toLowerCase().slice(0,4)=="hsla"&&(y=j(M[3])),M[3]&&M[3].slice(-1)=="%"&&(y/=100),h.hsl2rgb(w,C,g,y)):((O={r:w,g:C,b:g,toString:fi}).hex="#"+(16777216|g|C<<8|w<<16).toString(16).slice(1),h.is(y,"finite")&&(O.opacity=y),O)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:fi}},h),h.hsb=ve(function(p,w,C){return h.hsb2rgb(p,w,C).hex}),h.hsl=ve(function(p,w,C){return h.hsl2rgb(p,w,C).hex}),h.rgb=ve(function(p,w,C){function g(y){return y+.5|0}return"#"+(16777216|g(C)|g(w)<<8|g(p)<<16).toString(16).slice(1)}),h.getColor=function(p){var w=this.getColor.start=this.getColor.start||{h:0,s:1,b:p||.75},C=this.hsb2rgb(w.h,w.s,w.b);return w.h+=.075,w.h>1&&(w.h=0,w.s-=.2,w.s<=0&&(this.getColor.start={h:0,s:1,b:w.b})),C.hex},h.getColor.reset=function(){delete this.start},h.parsePathString=function(p){if(!p)return null;var w=Re(p);if(w.arr)return Se(w.arr);var C={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},g=[];return h.is(p,nt)&&h.is(p[0],nt)&&(g=Se(p)),g.length||F(p).replace(bt,function(y,k,M){var O=[],G=k.toLowerCase();if(M.replace(yt,function(H,Q){Q&&O.push(+Q)}),G=="m"&&O.length>2&&(g.push([k][_](O.splice(0,2))),G="l",k=k=="m"?"l":"L"),G=="r")g.push([k][_](O));else for(;O.length>=C[G]&&(g.push([k][_](O.splice(0,C[G]))),C[G]););}),g.toString=h._path2string,w.arr=Se(g),g},h.parseTransformString=ve(function(p){if(!p)return null;var w=[];return h.is(p,nt)&&h.is(p[0],nt)&&(w=Se(p)),w.length||F(p).replace(Tt,function(C,g,y){var k=[];z.call(g),y.replace(yt,function(M,O){O&&k.push(+O)}),w.push([g][_](k))}),w.toString=h._path2string,w},this,function(p){if(!p)return p;for(var w=[],C=0;C<p.length;C++){for(var g=[],y=0;y<p[C].length;y++)g.push(p[C][y]);w.push(g)}return w});var Re=function(p){var w=Re.ps=Re.ps||{};return w[p]?w[p].sleep=100:w[p]={sleep:100},setTimeout(function(){for(var C in w)w[m](C)&&C!=p&&(w[C].sleep--,!w[C].sleep&&delete w[C])}),w[p]};function ti(p,w,C,g,y){return p*(p*(-3*w+9*C-9*g+3*y)+6*w-12*C+6*g)-3*w+3*C}function Ue(p,w,C,g,y,k,M,O,G){G==null&&(G=1);for(var H=(G=G>1?1:G<0?0:G)/2,Q=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],st=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],it=0,tt=0;tt<12;tt++){var ot=H*Q[tt]+H,ct=ti(ot,p,C,y,M),lt=ti(ot,w,g,k,O),rt=ct*ct+lt*lt;it+=st[tt]*q.sqrt(rt)}return H*it}function Fn(p,w,C,g,y,k,M,O){if(!(K(p,C)<Z(y,M)||Z(p,C)>K(y,M)||K(w,g)<Z(k,O)||Z(w,g)>K(k,O))){var G=(p-C)*(k-O)-(w-g)*(y-M);if(G){var H=((p*g-w*C)*(y-M)-(p-C)*(y*O-k*M))/G,Q=((p*g-w*C)*(k-O)-(w-g)*(y*O-k*M))/G,st=+H.toFixed(2),it=+Q.toFixed(2);if(!(st<+Z(p,C).toFixed(2)||st>+K(p,C).toFixed(2)||st<+Z(y,M).toFixed(2)||st>+K(y,M).toFixed(2)||it<+Z(w,g).toFixed(2)||it>+K(w,g).toFixed(2)||it<+Z(k,O).toFixed(2)||it>+K(k,O).toFixed(2)))return{x:H,y:Q}}}}function Li(p,w,C){var g=h.bezierBBox(p),y=h.bezierBBox(w);if(!h.isBBoxIntersect(g,y))return C?0:[];for(var k=Ue.apply(0,p),M=Ue.apply(0,w),O=K(~~(k/5),1),G=K(~~(M/5),1),H=[],Q=[],st={},it=C?0:[],tt=0;tt<O+1;tt++){var ot=h.findDotsAtSegment.apply(h,p.concat(tt/O));H.push({x:ot.x,y:ot.y,t:tt/O})}for(tt=0;tt<G+1;tt++)ot=h.findDotsAtSegment.apply(h,w.concat(tt/G)),Q.push({x:ot.x,y:ot.y,t:tt/G});for(tt=0;tt<O;tt++)for(var ct=0;ct<G;ct++){var lt=H[tt],rt=H[tt+1],wt=Q[ct],ut=Q[ct+1],gt=at(rt.x-lt.x)<.001?"y":"x",ft=at(ut.x-wt.x)<.001?"y":"x",Mt=Fn(lt.x,lt.y,rt.x,rt.y,wt.x,wt.y,ut.x,ut.y);if(Mt){if(st[Mt.x.toFixed(4)]==Mt.y.toFixed(4))continue;st[Mt.x.toFixed(4)]=Mt.y.toFixed(4);var kt=lt.t+at((Mt[gt]-lt[gt])/(rt[gt]-lt[gt]))*(rt.t-lt.t),Rt=wt.t+at((Mt[ft]-wt[ft])/(ut[ft]-wt[ft]))*(ut.t-wt.t);kt>=0&&kt<=1.001&&Rt>=0&&Rt<=1.001&&(C?it++:it.push({x:Mt.x,y:Mt.y,t1:Z(kt,1),t2:Z(Rt,1)}))}}return it}function ln(p,w,C){p=h._path2curve(p),w=h._path2curve(w);for(var g,y,k,M,O,G,H,Q,st,it,tt=C?0:[],ot=0,ct=p.length;ot<ct;ot++){var lt=p[ot];if(lt[0]=="M")g=O=lt[1],y=G=lt[2];else{lt[0]=="C"?(st=[g,y].concat(lt.slice(1)),g=st[6],y=st[7]):(st=[g,y,g,y,O,G,O,G],g=O,y=G);for(var rt=0,wt=w.length;rt<wt;rt++){var ut=w[rt];if(ut[0]=="M")k=H=ut[1],M=Q=ut[2];else{ut[0]=="C"?(it=[k,M].concat(ut.slice(1)),k=it[6],M=it[7]):(it=[k,M,k,M,H,Q,H,Q],k=H,M=Q);var gt=Li(st,it,C);if(C)tt+=gt;else{for(var ft=0,Mt=gt.length;ft<Mt;ft++)gt[ft].segment1=ot,gt[ft].segment2=rt,gt[ft].bez1=st,gt[ft].bez2=it;tt=tt.concat(gt)}}}}}return tt}h.findDotsAtSegment=function(p,w,C,g,y,k,M,O,G){var H=1-G,Q=vt(H,3),st=vt(H,2),it=G*G,tt=it*G,ot=Q*p+3*st*G*C+3*H*G*G*y+tt*M,ct=Q*w+3*st*G*g+3*H*G*G*k+tt*O,lt=p+2*G*(C-p)+it*(y-2*C+p),rt=w+2*G*(g-w)+it*(k-2*g+w),wt=C+2*G*(y-C)+it*(M-2*y+C),ut=g+2*G*(k-g)+it*(O-2*k+g),gt=H*p+G*C,ft=H*w+G*g,Mt=H*y+G*M,kt=H*k+G*O,Rt=90-180*q.atan2(lt-wt,rt-ut)/_t;return(lt>wt||rt<ut)&&(Rt+=180),{x:ot,y:ct,m:{x:lt,y:rt},n:{x:wt,y:ut},start:{x:gt,y:ft},end:{x:Mt,y:kt},alpha:Rt}},h.bezierBBox=function(p,w,C,g,y,k,M,O){h.is(p,"array")||(p=[p,w,C,g,y,k,M,O]);var G=Fi.apply(null,p);return{x:G.min.x,y:G.min.y,x2:G.max.x,y2:G.max.y,width:G.max.x-G.min.x,height:G.max.y-G.min.y}},h.isPointInsideBBox=function(p,w,C){return w>=p.x&&w<=p.x2&&C>=p.y&&C<=p.y2},h.isBBoxIntersect=function(p,w){var C=h.isPointInsideBBox;return C(w,p.x,p.y)||C(w,p.x2,p.y)||C(w,p.x,p.y2)||C(w,p.x2,p.y2)||C(p,w.x,w.y)||C(p,w.x2,w.y)||C(p,w.x,w.y2)||C(p,w.x2,w.y2)||(p.x<w.x2&&p.x>w.x||w.x<p.x2&&w.x>p.x)&&(p.y<w.y2&&p.y>w.y||w.y<p.y2&&w.y>p.y)},h.pathIntersection=function(p,w){return ln(p,w)},h.pathIntersectionNumber=function(p,w){return ln(p,w,1)},h.isPointInsidePath=function(p,w,C){var g=h.pathBBox(p);return h.isPointInsideBBox(g,w,C)&&ln(p,[["M",w,C],["H",g.x2+10]],1)%2==1},h._removedFactory=function(p){return function(){o("raphael.log",null,"Raphaël: you are calling to method “"+p+"” of removed object",p)}};var Ye=h.pathBBox=function(p){var w=Re(p);if(w.bbox)return ye(w.bbox);if(!p)return{x:0,y:0,width:0,height:0,x2:0,y2:0};for(var C,g=0,y=0,k=[],M=[],O=0,G=(p=Nn(p)).length;O<G;O++)if((C=p[O])[0]=="M")g=C[1],y=C[2],k.push(g),M.push(y);else{var H=Fi(g,y,C[1],C[2],C[3],C[4],C[5],C[6]);k=k[_](H.min.x,H.max.x),M=M[_](H.min.y,H.max.y),g=C[5],y=C[6]}var Q=Z[E](0,k),st=Z[E](0,M),it=K[E](0,k),tt=K[E](0,M),ot=it-Q,ct=tt-st,lt={x:Q,y:st,x2:it,y2:tt,width:ot,height:ct,cx:Q+ot/2,cy:st+ct/2};return w.bbox=ye(lt),lt},Se=function(p){var w=ye(p);return w.toString=h._path2string,w},lo=h._pathToRelative=function(p){var w=Re(p);if(w.rel)return Se(w.rel);h.is(p,nt)&&h.is(p&&p[0],nt)||(p=h.parsePathString(p));var C=[],g=0,y=0,k=0,M=0,O=0;p[0][0]=="M"&&(k=g=p[0][1],M=y=p[0][2],O++,C.push(["M",g,y]));for(var G=O,H=p.length;G<H;G++){var Q=C[G]=[],st=p[G];if(st[0]!=z.call(st[0]))switch(Q[0]=z.call(st[0]),Q[0]){case"a":Q[1]=st[1],Q[2]=st[2],Q[3]=st[3],Q[4]=st[4],Q[5]=st[5],Q[6]=+(st[6]-g).toFixed(3),Q[7]=+(st[7]-y).toFixed(3);break;case"v":Q[1]=+(st[1]-y).toFixed(3);break;case"m":k=st[1],M=st[2];default:for(var it=1,tt=st.length;it<tt;it++)Q[it]=+(st[it]-(it%2?g:y)).toFixed(3)}else{Q=C[G]=[],st[0]=="m"&&(k=st[1]+g,M=st[2]+y);for(var ot=0,ct=st.length;ot<ct;ot++)C[G][ot]=st[ot]}var lt=C[G].length;switch(C[G][0]){case"z":g=k,y=M;break;case"h":g+=+C[G][lt-1];break;case"v":y+=+C[G][lt-1];break;default:g+=+C[G][lt-2],y+=+C[G][lt-1]}}return C.toString=h._path2string,w.rel=Se(C),C},cn=h._pathToAbsolute=function(p){var w=Re(p);if(w.abs)return Se(w.abs);if(h.is(p,nt)&&h.is(p&&p[0],nt)||(p=h.parsePathString(p)),!p||!p.length)return[["M",0,0]];var C=[],g=0,y=0,k=0,M=0,O=0;p[0][0]=="M"&&(k=g=+p[0][1],M=y=+p[0][2],O++,C[0]=["M",g,y]);for(var G,H,Q=p.length==3&&p[0][0]=="M"&&p[1][0].toUpperCase()=="R"&&p[2][0].toUpperCase()=="Z",st=O,it=p.length;st<it;st++){if(C.push(G=[]),(H=p[st])[0]!=N.call(H[0]))switch(G[0]=N.call(H[0]),G[0]){case"A":G[1]=H[1],G[2]=H[2],G[3]=H[3],G[4]=H[4],G[5]=H[5],G[6]=+(H[6]+g),G[7]=+(H[7]+y);break;case"V":G[1]=+H[1]+y;break;case"H":G[1]=+H[1]+g;break;case"R":for(var tt=[g,y][_](H.slice(1)),ot=2,ct=tt.length;ot<ct;ot++)tt[ot]=+tt[ot]+g,tt[++ot]=+tt[ot]+y;C.pop(),C=C[_](hn(tt,Q));break;case"M":k=+H[1]+g,M=+H[2]+y;default:for(ot=1,ct=H.length;ot<ct;ot++)G[ot]=+H[ot]+(ot%2?g:y)}else if(H[0]=="R")tt=[g,y][_](H.slice(1)),C.pop(),C=C[_](hn(tt,Q)),G=["R"][_](H.slice(-2));else for(var lt=0,rt=H.length;lt<rt;lt++)G[lt]=H[lt];switch(G[0]){case"Z":g=k,y=M;break;case"H":g=G[1];break;case"V":y=G[1];break;case"M":k=G[G.length-2],M=G[G.length-1];default:g=G[G.length-2],y=G[G.length-1]}}return C.toString=h._path2string,w.abs=Se(C),C},Ii=function(p,w,C,g){return[p,w,C,g,C,g]},di=function(p,w,C,g,y,k){return[1/3*p+2/3*C,1/3*w+2/3*g,1/3*y+2/3*C,1/3*k+2/3*g,y,k]},gr=function(p,w,C,g,y,k,M,O,G,H){var Q,st=120*_t/180,it=_t/180*(+y||0),tt=[],ot=ve(function(C1,T1,bo){return{x:C1*q.cos(bo)-T1*q.sin(bo),y:C1*q.sin(bo)+T1*q.cos(bo)}});if(H)kt=H[0],Rt=H[1],ft=H[2],Mt=H[3];else{p=(Q=ot(p,w,-it)).x,w=Q.y,O=(Q=ot(O,G,-it)).x,G=Q.y;var ct=(p-O)/2,lt=(w-G)/2,rt=ct*ct/(C*C)+lt*lt/(g*g);rt>1&&(C*=rt=q.sqrt(rt),g*=rt);var wt=C*C,ut=g*g,gt=(k==M?-1:1)*q.sqrt(at((wt*ut-wt*lt*lt-ut*ct*ct)/(wt*lt*lt+ut*ct*ct))),ft=gt*C*lt/g+(p+O)/2,Mt=gt*-g*ct/C+(w+G)/2,kt=q.asin(((w-Mt)/g).toFixed(9)),Rt=q.asin(((G-Mt)/g).toFixed(9));(kt=p<ft?_t-kt:kt)<0&&(kt=2*_t+kt),(Rt=O<ft?_t-Rt:Rt)<0&&(Rt=2*_t+Rt),M&&kt>Rt&&(kt-=2*_t),!M&&Rt>kt&&(Rt-=2*_t)}var xr=Rt-kt;if(at(xr)>st){var ea=Rt,Ie=O,pi=G;Rt=kt+st*(M&&Rt>kt?1:-1),O=ft+C*q.cos(Rt),G=Mt+g*q.sin(Rt),tt=gr(O,G,C,g,y,0,M,Ie,pi,[Rt,ea,ft,Mt])}xr=Rt-kt;var Sr=q.cos(kt),Cr=q.sin(kt),yo=q.cos(Rt),$i=q.sin(Rt),zn=q.tan(xr/4),wo=4/3*C*zn,y1=4/3*g*zn,w1=[p,w],Tr=[p+wo*Cr,w-y1*Sr],b1=[O+wo*$i,G-y1*yo],x1=[O,G];if(Tr[0]=2*w1[0]-Tr[0],Tr[1]=2*w1[1]-Tr[1],H)return[Tr,b1,x1][_](tt);for(var S1=[],gn=0,D8=(tt=[Tr,b1,x1][_](tt).join()[L](",")).length;gn<D8;gn++)S1[gn]=gn%2?ot(tt[gn-1],tt[gn],it).y:ot(tt[gn],tt[gn+1],it).x;return S1},Oi=function(p,w,C,g,y,k,M,O,G){var H=1-G;return{x:vt(H,3)*p+3*vt(H,2)*G*C+3*H*G*G*y+vt(G,3)*M,y:vt(H,3)*w+3*vt(H,2)*G*g+3*H*G*G*k+vt(G,3)*O}},Fi=ve(function(p,w,C,g,y,k,M,O){var G,H=y-2*C+p-(M-2*y+C),Q=2*(C-p)-2*(y-C),st=p-C,it=(-Q+q.sqrt(Q*Q-4*H*st))/2/H,tt=(-Q-q.sqrt(Q*Q-4*H*st))/2/H,ot=[w,O],ct=[p,M];return at(it)>"1e12"&&(it=.5),at(tt)>"1e12"&&(tt=.5),it>0&&it<1&&(G=Oi(p,w,C,g,y,k,M,O,it),ct.push(G.x),ot.push(G.y)),tt>0&&tt<1&&(G=Oi(p,w,C,g,y,k,M,O,tt),ct.push(G.x),ot.push(G.y)),H=k-2*g+w-(O-2*k+g),st=w-g,it=(-(Q=2*(g-w)-2*(k-g))+q.sqrt(Q*Q-4*H*st))/2/H,tt=(-Q-q.sqrt(Q*Q-4*H*st))/2/H,at(it)>"1e12"&&(it=.5),at(tt)>"1e12"&&(tt=.5),it>0&&it<1&&(G=Oi(p,w,C,g,y,k,M,O,it),ct.push(G.x),ot.push(G.y)),tt>0&&tt<1&&(G=Oi(p,w,C,g,y,k,M,O,tt),ct.push(G.x),ot.push(G.y)),{min:{x:Z[E](0,ct),y:Z[E](0,ot)},max:{x:K[E](0,ct),y:K[E](0,ot)}}}),Nn=h._path2curve=ve(function(p,w){var C=!w&&Re(p);if(!w&&C.curve)return Se(C.curve);for(var g=cn(p),y=w&&cn(w),k={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},M={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},O=function(gt,ft,Mt){var kt,Rt;if(!gt)return["C",ft.x,ft.y,ft.x,ft.y,ft.x,ft.y];switch(!(gt[0]in{T:1,Q:1})&&(ft.qx=ft.qy=null),gt[0]){case"M":ft.X=gt[1],ft.Y=gt[2];break;case"A":gt=["C"][_](gr[E](0,[ft.x,ft.y][_](gt.slice(1))));break;case"S":Mt=="C"||Mt=="S"?(kt=2*ft.x-ft.bx,Rt=2*ft.y-ft.by):(kt=ft.x,Rt=ft.y),gt=["C",kt,Rt][_](gt.slice(1));break;case"T":Mt=="Q"||Mt=="T"?(ft.qx=2*ft.x-ft.qx,ft.qy=2*ft.y-ft.qy):(ft.qx=ft.x,ft.qy=ft.y),gt=["C"][_](di(ft.x,ft.y,ft.qx,ft.qy,gt[1],gt[2]));break;case"Q":ft.qx=gt[1],ft.qy=gt[2],gt=["C"][_](di(ft.x,ft.y,gt[1],gt[2],gt[3],gt[4]));break;case"L":gt=["C"][_](Ii(ft.x,ft.y,gt[1],gt[2]));break;case"H":gt=["C"][_](Ii(ft.x,ft.y,gt[1],ft.y));break;case"V":gt=["C"][_](Ii(ft.x,ft.y,ft.x,gt[1]));break;case"Z":gt=["C"][_](Ii(ft.x,ft.y,ft.X,ft.Y))}return gt},G=function(gt,ft){if(gt[ft].length>7){gt[ft].shift();for(var Mt=gt[ft];Mt.length;)Q[ft]="A",y&&(st[ft]="A"),gt.splice(ft++,0,["C"][_](Mt.splice(0,6)));gt.splice(ft,1),ct=K(g.length,y&&y.length||0)}},H=function(gt,ft,Mt,kt,Rt){gt&&ft&&gt[Rt][0]=="M"&&ft[Rt][0]!="M"&&(ft.splice(Rt,0,["M",kt.x,kt.y]),Mt.bx=0,Mt.by=0,Mt.x=gt[Rt][1],Mt.y=gt[Rt][2],ct=K(g.length,y&&y.length||0))},Q=[],st=[],it="",tt="",ot=0,ct=K(g.length,y&&y.length||0);ot<ct;ot++){g[ot]&&(it=g[ot][0]),it!="C"&&(Q[ot]=it,ot&&(tt=Q[ot-1])),g[ot]=O(g[ot],k,tt),Q[ot]!="A"&&it=="C"&&(Q[ot]="C"),G(g,ot),y&&(y[ot]&&(it=y[ot][0]),it!="C"&&(st[ot]=it,ot&&(tt=st[ot-1])),y[ot]=O(y[ot],M,tt),st[ot]!="A"&&it=="C"&&(st[ot]="C"),G(y,ot)),H(g,y,k,M,ot),H(y,g,M,k,ot);var lt=g[ot],rt=y&&y[ot],wt=lt.length,ut=y&&rt.length;k.x=lt[wt-2],k.y=lt[wt-1],k.bx=j(lt[wt-4])||k.x,k.by=j(lt[wt-3])||k.y,M.bx=y&&(j(rt[ut-4])||M.x),M.by=y&&(j(rt[ut-3])||M.y),M.x=y&&rt[ut-2],M.y=y&&rt[ut-1]}return y||(C.curve=Se(g)),y?[g,y]:g},null,Se),pr=(h._parseDots=ve(function(p){for(var w=[],C=0,g=p.length;C<g;C++){var y={},k=p[C].match(/^([^:]*):?([\d\.]*)/);if(y.color=h.getRGB(k[1]),y.color.error)return null;y.opacity=y.color.opacity,y.color=y.color.hex,k[2]&&(y.offset=k[2]+"%"),w.push(y)}for(C=1,g=w.length-1;C<g;C++)if(!w[C].offset){for(var M=j(w[C-1].offset||0),O=0,G=C+1;G<g;G++)if(w[G].offset){O=w[G].offset;break}O||(O=100,G=g);for(var H=((O=j(O))-M)/(G-C+1);C<G;C++)M+=H,w[C].offset=M+"%"}return w}),h._tear=function(p,w){p==w.top&&(w.top=p.prev),p==w.bottom&&(w.bottom=p.next),p.next&&(p.next.prev=p.prev),p.prev&&(p.prev.next=p.next)}),co=(h._tofront=function(p,w){w.top!==p&&(pr(p,w),p.next=null,p.prev=w.top,w.top.next=p,w.top=p)},h._toback=function(p,w){w.bottom!==p&&(pr(p,w),p.next=w.bottom,p.prev=null,w.bottom.prev=p,w.bottom=p)},h._insertafter=function(p,w,C){pr(p,C),w==C.top&&(C.top=p),w.next&&(w.next.prev=p),p.next=w.next,p.prev=w,w.next=p},h._insertbefore=function(p,w,C){pr(p,C),w==C.bottom&&(C.bottom=p),w.prev&&(w.prev.next=p),p.prev=w.prev,w.prev=p,p.next=w},h.toMatrix=function(p,w){var C=Ye(p),g={_:{transform:P},getBBox:function(){return C}};return mr(g,w),g.matrix}),mr=(h.transformPath=function(p,w){return ce(p,co(p,w))},h._extractTransform=function(p,w){if(w==null)return p._.transform;w=F(w).replace(/\.{3}|\u2026/g,p._.transform||P);var C,g,y=h.parseTransformString(w),k=0,M=1,O=1,G=p._,H=new Ni;if(G.transform=y||[],y)for(var Q=0,st=y.length;Q<st;Q++){var it,tt,ot,ct,lt,rt=y[Q],wt=rt.length,ut=F(rt[0]).toLowerCase(),gt=rt[0]!=ut,ft=gt?H.invert():0;ut=="t"&&wt==3?gt?(it=ft.x(0,0),tt=ft.y(0,0),ot=ft.x(rt[1],rt[2]),ct=ft.y(rt[1],rt[2]),H.translate(ot-it,ct-tt)):H.translate(rt[1],rt[2]):ut=="r"?wt==2?(lt=lt||p.getBBox(1),H.rotate(rt[1],lt.x+lt.width/2,lt.y+lt.height/2),k+=rt[1]):wt==4&&(gt?(ot=ft.x(rt[2],rt[3]),ct=ft.y(rt[2],rt[3]),H.rotate(rt[1],ot,ct)):H.rotate(rt[1],rt[2],rt[3]),k+=rt[1]):ut=="s"?wt==2||wt==3?(lt=lt||p.getBBox(1),H.scale(rt[1],rt[wt-1],lt.x+lt.width/2,lt.y+lt.height/2),M*=rt[1],O*=rt[wt-1]):wt==5&&(gt?(ot=ft.x(rt[3],rt[4]),ct=ft.y(rt[3],rt[4]),H.scale(rt[1],rt[2],ot,ct)):H.scale(rt[1],rt[2],rt[3],rt[4]),M*=rt[1],O*=rt[2]):ut=="m"&&wt==7&&H.add(rt[1],rt[2],rt[3],rt[4],rt[5],rt[6]),G.dirtyT=1,p.matrix=H}p.matrix=H,G.sx=M,G.sy=O,G.deg=k,G.dx=C=H.e,G.dy=g=H.f,M==1&&O==1&&!k&&G.bbox?(G.bbox.x+=+C,G.bbox.y+=+g):G.dirtyT=1}),uo=function(p){var w=p[0];switch(w.toLowerCase()){case"t":return[w,0,0];case"m":return[w,1,0,0,1,0,0];case"r":return p.length==4?[w,0,p[2],p[3]]:[w,0];case"s":return p.length==5?[w,1,1,p[3],p[4]]:p.length==3?[w,1,1]:[w,1]}},fo=h._equaliseTransform=function(p,w){w=F(w).replace(/\.{3}|\u2026/g,p),p=h.parseTransformString(p)||[],w=h.parseTransformString(w)||[];for(var C,g,y,k,M=K(p.length,w.length),O=[],G=[],H=0;H<M;H++){if(y=p[H]||uo(w[H]),k=w[H]||uo(y),y[0]!=k[0]||y[0].toLowerCase()=="r"&&(y[2]!=k[2]||y[3]!=k[3])||y[0].toLowerCase()=="s"&&(y[3]!=k[3]||y[4]!=k[4]))return;for(O[H]=[],G[H]=[],C=0,g=K(y.length,k.length);C<g;C++)C in y&&(O[H][C]=y[C]),C in k&&(G[H][C]=k[C])}return{from:O,to:G}};function Ni(p,w,C,g,y,k){p!=null?(this.a=+p,this.b=+w,this.c=+C,this.d=+g,this.e=+y,this.f=+k):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}h._getContainer=function(p,w,C,g){var y;if((y=g!=null||h.is(p,"object")?p:v.doc.getElementById(p))!=null)return y.tagName?w==null?{container:y,width:y.style.pixelWidth||y.offsetWidth,height:y.style.pixelHeight||y.offsetHeight}:{container:y,width:w,height:C}:{container:1,x:p,y:w,width:C,height:g}},h.pathToRelative=lo,h._engine={},h.path2curve=Nn,h.matrix=function(p,w,C,g,y,k){return new Ni(p,w,C,g,y,k)},function(p){function w(g){return g[0]*g[0]+g[1]*g[1]}function C(g){var y=q.sqrt(w(g));g[0]&&(g[0]/=y),g[1]&&(g[1]/=y)}p.add=function(g,y,k,M,O,G){var H,Q,st,it,tt=[[],[],[]],ot=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],ct=[[g,k,O],[y,M,G],[0,0,1]];for(g&&g instanceof Ni&&(ct=[[g.a,g.c,g.e],[g.b,g.d,g.f],[0,0,1]]),H=0;H<3;H++)for(Q=0;Q<3;Q++){for(it=0,st=0;st<3;st++)it+=ot[H][st]*ct[st][Q];tt[H][Q]=it}this.a=tt[0][0],this.b=tt[1][0],this.c=tt[0][1],this.d=tt[1][1],this.e=tt[0][2],this.f=tt[1][2]},p.invert=function(){var g=this,y=g.a*g.d-g.b*g.c;return new Ni(g.d/y,-g.b/y,-g.c/y,g.a/y,(g.c*g.f-g.d*g.e)/y,(g.b*g.e-g.a*g.f)/y)},p.clone=function(){return new Ni(this.a,this.b,this.c,this.d,this.e,this.f)},p.translate=function(g,y){this.add(1,0,0,1,g,y)},p.scale=function(g,y,k,M){y==null&&(y=g),(k||M)&&this.add(1,0,0,1,k,M),this.add(g,0,0,y,0,0),(k||M)&&this.add(1,0,0,1,-k,-M)},p.rotate=function(g,y,k){g=h.rad(g),y=y||0,k=k||0;var M=+q.cos(g).toFixed(9),O=+q.sin(g).toFixed(9);this.add(M,O,-O,M,y,k),this.add(1,0,0,1,-y,-k)},p.x=function(g,y){return g*this.a+y*this.c+this.e},p.y=function(g,y){return g*this.b+y*this.d+this.f},p.get=function(g){return+this[F.fromCharCode(97+g)].toFixed(4)},p.toString=function(){return h.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},p.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},p.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},p.split=function(){var g={};g.dx=this.e,g.dy=this.f;var y=[[this.a,this.c],[this.b,this.d]];g.scalex=q.sqrt(w(y[0])),C(y[0]),g.shear=y[0][0]*y[1][0]+y[0][1]*y[1][1],y[1]=[y[1][0]-y[0][0]*g.shear,y[1][1]-y[0][1]*g.shear],g.scaley=q.sqrt(w(y[1])),C(y[1]),g.shear/=g.scaley;var k=-y[0][1],M=y[1][1];return M<0?(g.rotate=h.deg(q.acos(M)),k<0&&(g.rotate=360-g.rotate)):g.rotate=h.deg(q.asin(k)),g.isSimple=!(+g.shear.toFixed(9)||g.scalex.toFixed(9)!=g.scaley.toFixed(9)&&g.rotate),g.isSuperSimple=!+g.shear.toFixed(9)&&g.scalex.toFixed(9)==g.scaley.toFixed(9)&&!g.rotate,g.noRotation=!+g.shear.toFixed(9)&&!g.rotate,g},p.toTransformString=function(g){var y=g||this[L]();return y.isSimple?(y.scalex=+y.scalex.toFixed(4),y.scaley=+y.scaley.toFixed(4),y.rotate=+y.rotate.toFixed(4),(y.dx||y.dy?"t"+[y.dx,y.dy]:P)+(y.scalex!=1||y.scaley!=1?"s"+[y.scalex,y.scaley,0,0]:P)+(y.rotate?"r"+[y.rotate,0,0]:P)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(Ni.prototype);for(var go=function(){this.returnValue=!1},po=function(){return this.originalEvent.preventDefault()},mo=function(){this.cancelBubble=!0},vo=function(){return this.originalEvent.stopPropagation()},vr=function(p){var w=v.doc.documentElement.scrollTop||v.doc.body.scrollTop,C=v.doc.documentElement.scrollLeft||v.doc.body.scrollLeft;return{x:p.clientX+C,y:p.clientY+w}},Gi=v.doc.addEventListener?function(p,w,C,g){var y=function(M){var O=vr(M);return C.call(g,M,O.x,O.y)};if(p.addEventListener(w,y,!1),x&&U[w]){var k=function(M){for(var O=vr(M),G=M,H=0,Q=M.targetTouches&&M.targetTouches.length;H<Q;H++)if(M.targetTouches[H].target==p){(M=M.targetTouches[H]).originalEvent=G,M.preventDefault=po,M.stopPropagation=vo;break}return C.call(g,M,O.x,O.y)};p.addEventListener(U[w],k,!1)}return function(){return p.removeEventListener(w,y,!1),x&&U[w]&&p.removeEventListener(U[w],k,!1),!0}}:v.doc.attachEvent?function(p,w,C,g){var y=function(k){k=k||v.win.event;var M=v.doc.documentElement.scrollTop||v.doc.body.scrollTop,O=v.doc.documentElement.scrollLeft||v.doc.body.scrollLeft,G=k.clientX+O,H=k.clientY+M;return k.preventDefault=k.preventDefault||go,k.stopPropagation=k.stopPropagation||mo,C.call(g,k,G,H)};return p.attachEvent("on"+w,y),function(){return p.detachEvent("on"+w,y),!0}}:void 0,De=[],Ui=function(p){for(var w,C=p.clientX,g=p.clientY,y=v.doc.documentElement.scrollTop||v.doc.body.scrollTop,k=v.doc.documentElement.scrollLeft||v.doc.body.scrollLeft,M=De.length;M--;){if(w=De[M],x&&p.touches){for(var O,G=p.touches.length;G--;)if((O=p.touches[G]).identifier==w.el._drag.id){C=O.clientX,g=O.clientY,(p.originalEvent?p.originalEvent:p).preventDefault();break}}else p.preventDefault();var H,Q=w.el.node,st=Q.nextSibling,it=Q.parentNode,tt=Q.style.display;v.win.opera&&it.removeChild(Q),Q.style.display="none",H=w.el.paper.getElementByPoint(C,g),Q.style.display=tt,v.win.opera&&(st?it.insertBefore(Q,st):it.appendChild(Q)),H&&o("raphael.drag.over."+w.el.id,w.el,H),C+=k,g+=y,o("raphael.drag.move."+w.el.id,w.move_scope||w.el,C-w.el._drag.x,g-w.el._drag.y,C,g,p)}},un=function(p){h.unmousemove(Ui).unmouseup(un);for(var w,C=De.length;C--;)(w=De[C]).el._drag={},o("raphael.drag.end."+w.el.id,w.end_scope||w.start_scope||w.move_scope||w.el,p);De=[]},$t=h.el={},_o=$.length;_o--;)(function(p){h[p]=$t[p]=function(w,C){return h.is(w,"function")&&(this.events=this.events||[],this.events.push({name:p,f:w,unbind:Gi(this.shape||this.node||v.doc,p,w,C||this)})),this},h["un"+p]=$t["un"+p]=function(w){for(var C=this.events||[],g=C.length;g--;)C[g].name!=p||!h.is(w,"undefined")&&C[g].f!=w||(C[g].unbind(),C.splice(g,1),!C.length&&delete this.events);return this}})($[_o]);$t.data=function(p,w){var C=Et[this.id]=Et[this.id]||{};if(arguments.length==0)return C;if(arguments.length==1){if(h.is(p,"object")){for(var g in p)p[m](g)&&this.data(g,p[g]);return this}return o("raphael.data.get."+this.id,this,C[p],p),C[p]}return C[p]=w,o("raphael.data.set."+this.id,this,w,p),this},$t.removeData=function(p){return p==null?delete Et[this.id]:Et[this.id]&&delete Et[this.id][p],this},$t.getData=function(){return ye(Et[this.id]||{})},$t.hover=function(p,w,C,g){return this.mouseover(p,C).mouseout(w,g||C)},$t.unhover=function(p,w){return this.unmouseover(p).unmouseout(w)};var fn=[];$t.drag=function(p,w,C,g,y,k){function M(O){(O.originalEvent||O).preventDefault();var G=O.clientX,H=O.clientY,Q=v.doc.documentElement.scrollTop||v.doc.body.scrollTop,st=v.doc.documentElement.scrollLeft||v.doc.body.scrollLeft;if(this._drag.id=O.identifier,x&&O.touches){for(var it,tt=O.touches.length;tt--;)if(it=O.touches[tt],this._drag.id=it.identifier,it.identifier==this._drag.id){G=it.clientX,H=it.clientY;break}}this._drag.x=G+st,this._drag.y=H+Q,!De.length&&h.mousemove(Ui).mouseup(un),De.push({el:this,move_scope:g,start_scope:y,end_scope:k}),w&&o.on("raphael.drag.start."+this.id,w),p&&o.on("raphael.drag.move."+this.id,p),C&&o.on("raphael.drag.end."+this.id,C),o("raphael.drag.start."+this.id,y||g||this,this._drag.x,this._drag.y,O)}return this._drag={},fn.push({el:this,start:M}),this.mousedown(M),this},$t.onDragOver=function(p){p?o.on("raphael.drag.over."+this.id,p):o.unbind("raphael.drag.over."+this.id)},$t.undrag=function(){for(var p=fn.length;p--;)fn[p].el==this&&(this.unmousedown(fn[p].start),fn.splice(p,1),o.unbind("raphael.drag.*."+this.id));!fn.length&&h.unmousemove(Ui).unmouseup(un),De=[]},c.circle=function(p,w,C){var g=h._engine.circle(this,p||0,w||0,C||0);return this.__set__&&this.__set__.push(g),g},c.rect=function(p,w,C,g,y){var k=h._engine.rect(this,p||0,w||0,C||0,g||0,y||0);return this.__set__&&this.__set__.push(k),k},c.ellipse=function(p,w,C,g){var y=h._engine.ellipse(this,p||0,w||0,C||0,g||0);return this.__set__&&this.__set__.push(y),y},c.path=function(p){p&&!h.is(p,"string")&&!h.is(p[0],nt)&&(p+=P);var w=h._engine.path(h.format[E](h,arguments),this);return this.__set__&&this.__set__.push(w),w},c.image=function(p,w,C,g,y){var k=h._engine.image(this,p||"about:blank",w||0,C||0,g||0,y||0);return this.__set__&&this.__set__.push(k),k},c.text=function(p,w,C){var g=h._engine.text(this,p||0,w||0,F(C));return this.__set__&&this.__set__.push(g),g},c.set=function(p){!h.is(p,"array")&&(p=Array.prototype.splice.call(arguments,0,arguments.length));var w=new Un(p);return this.__set__&&this.__set__.push(w),w.paper=this,w.type="set",w},c.setStart=function(p){this.__set__=p||this.set()},c.setFinish=function(p){var w=this.__set__;return delete this.__set__,w},c.getSize=function(){var p=this.canvas.parentNode;return{width:p.offsetWidth,height:p.offsetHeight}},c.setSize=function(p,w){return h._engine.setSize.call(this,p,w)},c.setViewBox=function(p,w,C,g,y){return h._engine.setViewBox.call(this,p,w,C,g,y)},c.top=c.bottom=null,c.raphael=h;function Gn(){return this.x+R+this.y+R+this.width+" × "+this.height}c.getElementByPoint=function(p,w){var C,g,y,k,M,O,G,H=this.canvas,Q=v.doc.elementFromPoint(p,w);if(v.win.opera&&Q.tagName=="svg"){var st=(g=(C=H).getBoundingClientRect(),y=C.ownerDocument,k=y.body,M=y.documentElement,O=M.clientTop||k.clientTop||0,G=M.clientLeft||k.clientLeft||0,{y:g.top+(v.win.pageYOffset||M.scrollTop||k.scrollTop)-O,x:g.left+(v.win.pageXOffset||M.scrollLeft||k.scrollLeft)-G}),it=H.createSVGRect();it.x=p-st.x,it.y=w-st.y,it.width=it.height=1;var tt=H.getIntersectionList(it,null);tt.length&&(Q=tt[tt.length-1])}if(!Q)return null;for(;Q.parentNode&&Q!=H.parentNode&&!Q.raphael;)Q=Q.parentNode;return Q==this.canvas.parentNode&&(Q=H),Q=Q&&Q.raphael?this.getById(Q.raphaelid):null},c.getElementsByBBox=function(p){var w=this.set();return this.forEach(function(C){h.isBBoxIntersect(C.getBBox(),p)&&w.push(C)}),w},c.getById=function(p){for(var w=this.bottom;w;){if(w.id==p)return w;w=w.next}return null},c.forEach=function(p,w){for(var C=this.bottom;C;){if(p.call(w,C)===!1)return this;C=C.next}return this},c.getElementsByPoint=function(p,w){var C=this.set();return this.forEach(function(g){g.isPointInside(p,w)&&C.push(g)}),C},$t.isPointInside=function(p,w){var C=this.realPath=zt[this.type](this);return this.attr("transform")&&this.attr("transform").length&&(C=h.transformPath(C,this.attr("transform"))),h.isPointInsidePath(C,p,w)},$t.getBBox=function(p){if(this.removed)return{};var w=this._;return p?(!w.dirty&&w.bboxwt||(this.realPath=zt[this.type](this),w.bboxwt=Ye(this.realPath),w.bboxwt.toString=Gn,w.dirty=0),w.bboxwt):((w.dirty||w.dirtyT||!w.bbox)&&(!w.dirty&&this.realPath||(w.bboxwt=0,this.realPath=zt[this.type](this)),w.bbox=Ye(ce(this.realPath,this.matrix)),w.bbox.toString=Gn,w.dirty=w.dirtyT=0),w.bbox)},$t.clone=function(){if(this.removed)return null;var p=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(p),p},$t.glow=function(p){if(this.type=="text")return null;var w={width:((p=p||{}).width||10)+(+this.attr("stroke-width")||1),fill:p.fill||!1,opacity:p.opacity==null?.5:p.opacity,offsetx:p.offsetx||0,offsety:p.offsety||0,color:p.color||"#000"},C=w.width/2,g=this.paper,y=g.set(),k=this.realPath||zt[this.type](this);k=this.matrix?ce(k,this.matrix):k;for(var M=1;M<C+1;M++)y.push(g.path(k).attr({stroke:w.color,fill:w.fill?w.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(w.width/C*M).toFixed(3),opacity:+(w.opacity/C).toFixed(3)}));return y.insertBefore(this).translate(w.offsetx,w.offsety)};var Ce=function(p,w,C,g,y,k,M,O,G){return G==null?Ue(p,w,C,g,y,k,M,O):h.findDotsAtSegment(p,w,C,g,y,k,M,O,function(H,Q,st,it,tt,ot,ct,lt,rt){if(!(rt<0||Ue(H,Q,st,it,tt,ot,ct,lt)<rt)){var wt,ut=.5,gt=1-ut;for(wt=Ue(H,Q,st,it,tt,ot,ct,lt,gt);at(wt-rt)>.01;)wt=Ue(H,Q,st,it,tt,ot,ct,lt,gt+=(wt<rt?1:-1)*(ut/=2));return gt}}(p,w,C,g,y,k,M,O,G))},gi=function(p,w){return function(C,g,y){for(var k,M,O,G,H,Q="",st={},it=0,tt=0,ot=(C=Nn(C)).length;tt<ot;tt++){if((O=C[tt])[0]=="M")k=+O[1],M=+O[2];else{if(it+(G=Ce(k,M,O[1],O[2],O[3],O[4],O[5],O[6]))>g){if(w&&!st.start){if(Q+=["C"+(H=Ce(k,M,O[1],O[2],O[3],O[4],O[5],O[6],g-it)).start.x,H.start.y,H.m.x,H.m.y,H.x,H.y],y)return Q;st.start=Q,Q=["M"+H.x,H.y+"C"+H.n.x,H.n.y,H.end.x,H.end.y,O[5],O[6]].join(),it+=G,k=+O[5],M=+O[6];continue}if(!p&&!w)return{x:(H=Ce(k,M,O[1],O[2],O[3],O[4],O[5],O[6],g-it)).x,y:H.y,alpha:H.alpha}}it+=G,k=+O[5],M=+O[6]}Q+=O.shift()+O}return st.end=Q,(H=p?it:w?st:h.findDotsAtSegment(k,M,O[0],O[1],O[2],O[3],O[4],O[5],1)).alpha&&(H={x:H.x,y:H.y,alpha:H.alpha}),H}},ei=gi(1),qe=gi(),Bi=gi(0,1);h.getTotalLength=ei,h.getPointAtLength=qe,h.getSubpath=function(p,w,C){if(this.getTotalLength(p)-C<1e-6)return Bi(p,w).end;var g=Bi(p,C,1);return w?Bi(g,w).end:g},$t.getTotalLength=function(){var p=this.getPath();if(p)return this.node.getTotalLength?this.node.getTotalLength():ei(p)},$t.getPointAtLength=function(p){var w=this.getPath();if(w)return qe(w,p)},$t.getPath=function(){var p,w=h._getPath[this.type];if(this.type!="text"&&this.type!="set")return w&&(p=w(this)),p},$t.getSubpath=function(p,w){var C=this.getPath();if(C)return h.getSubpath(C,p,w)};var ne=h.easing_formulas={linear:function(p){return p},"<":function(p){return vt(p,1.7)},">":function(p){return vt(p,.48)},"<>":function(p){var w=.48-p/1.04,C=q.sqrt(.1734+w*w),g=C-w,y=-C-w,k=vt(at(g),1/3)*(g<0?-1:1)+vt(at(y),1/3)*(y<0?-1:1)+.5;return 3*(1-k)*k*k+k*k*k},backIn:function(p){var w=1.70158;return p*p*((w+1)*p-w)},backOut:function(p){var w=1.70158;return(p-=1)*p*((w+1)*p+w)+1},elastic:function(p){return p==!!p?p:vt(2,-10*p)*q.sin(2*_t*(p-.075)/.3)+1},bounce:function(p){var w=7.5625,C=2.75;return p<1/C?w*p*p:p<2/C?w*(p-=1.5/C)*p+.75:p<2.5/C?w*(p-=2.25/C)*p+.9375:w*(p-=2.625/C)*p+.984375}};ne.easeIn=ne["ease-in"]=ne["<"],ne.easeOut=ne["ease-out"]=ne[">"],ne.easeInOut=ne["ease-in-out"]=ne["<>"],ne["back-in"]=ne.backIn,ne["back-out"]=ne.backOut;var At=[],ta=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(p){setTimeout(p,16)},_r=function(){for(var p=+new Date,w=0;w<At.length;w++){var C=At[w];if(!C.el.removed&&!C.paused){var g,y,k=p-C.start,M=C.ms,O=C.easing,G=C.from,H=C.diff,Q=C.to,st=(C.t,C.el),it={},tt={};if(C.initstatus?(k=(C.initstatus*C.anim.top-C.prev)/(C.percent-C.prev)*M,C.status=C.initstatus,delete C.initstatus,C.stop&&At.splice(w--,1)):C.status=(C.prev+(C.percent-C.prev)*(k/M))/C.anim.top,!(k<0))if(k<M){var ot=O(k/M);for(var ct in G)if(G[m](ct)){switch(X[ct]){case pt:g=+G[ct]+ot*M*H[ct];break;case"colour":g="rgb("+[dn(B(G[ct].r+ot*M*H[ct].r)),dn(B(G[ct].g+ot*M*H[ct].g)),dn(B(G[ct].b+ot*M*H[ct].b))].join(",")+")";break;case"path":g=[];for(var lt=0,rt=G[ct].length;lt<rt;lt++){g[lt]=[G[ct][lt][0]];for(var wt=1,ut=G[ct][lt].length;wt<ut;wt++)g[lt][wt]=+G[ct][lt][wt]+ot*M*H[ct][lt][wt];g[lt]=g[lt].join(R)}g=g.join(R);break;case"transform":if(H[ct].real)for(g=[],lt=0,rt=G[ct].length;lt<rt;lt++)for(g[lt]=[G[ct][lt][0]],wt=1,ut=G[ct][lt].length;wt<ut;wt++)g[lt][wt]=G[ct][lt][wt]+ot*M*H[ct][lt][wt];else{var gt=function(Mt){return+G[ct][Mt]+ot*M*H[ct][Mt]};g=[["m",gt(0),gt(1),gt(2),gt(3),gt(4),gt(5)]]}break;case"csv":if(ct=="clip-rect")for(g=[],lt=4;lt--;)g[lt]=+G[ct][lt]+ot*M*H[ct][lt];break;default:var ft=[][_](G[ct]);for(g=[],lt=st.paper.customAttributes[ct].length;lt--;)g[lt]=+ft[lt]+ot*M*H[ct][lt]}it[ct]=g}st.attr(it),function(Mt,kt,Rt){setTimeout(function(){o("raphael.anim.frame."+Mt,kt,Rt)})}(st.id,st,C.anim)}else{if(function(Mt,kt,Rt){setTimeout(function(){o("raphael.anim.frame."+kt.id,kt,Rt),o("raphael.anim.finish."+kt.id,kt,Rt),h.is(Mt,"function")&&Mt.call(kt)})}(C.callback,st,C.anim),st.attr(Q),At.splice(w--,1),C.repeat>1&&!C.next){for(y in Q)Q[m](y)&&(tt[y]=C.totalOrigin[y]);C.el.attr(tt),zi(C.anim,C.el,C.anim.percents[0],null,C.totalOrigin,C.repeat-1)}C.next&&!C.stop&&zi(C.anim,C.el,C.next,null,C.totalOrigin,C.repeat)}}}At.length&&ta(_r)},dn=function(p){return p>255?255:p<0?0:p};function Be(p,w,C,g,y,k){var M=3*w,O=3*(g-w)-M,G=1-M-O,H=3*C,Q=3*(y-C)-H,st=1-H-Q;function it(tt){return((G*tt+O)*tt+M)*tt}return function(tt,ot){var ct=function(lt,rt){var wt,ut,gt,ft,Mt,kt;for(gt=lt,kt=0;kt<8;kt++){if(ft=it(gt)-lt,at(ft)<rt)return gt;if(at(Mt=(3*G*gt+2*O)*gt+M)<1e-6)break;gt-=ft/Mt}if(ut=1,(gt=lt)<(wt=0))return wt;if(gt>ut)return ut;for(;wt<ut;){if(ft=it(gt),at(ft-lt)<rt)return gt;lt>ft?wt=gt:ut=gt,gt=(ut-wt)/2+wt}return gt}(tt,ot);return((st*ct+Q)*ct+H)*ct}(p,1/(200*k))}function Le(p,w){var C=[],g={};if(this.ms=w,this.times=1,p){for(var y in p)p[m](y)&&(g[j(y)]=p[y],C.push(j(y)));C.sort(Pt)}this.anim=g,this.top=C[C.length-1],this.percents=C}function zi(p,w,C,g,y,k){C=j(C);var M,O,G,H,Q,st,it=p.ms,tt={},ot={},ct={};if(g)for(rt=0,wt=At.length;rt<wt;rt++){var lt=At[rt];if(lt.el.id==w.id&&lt.anim==p){lt.percent!=C?(At.splice(rt,1),G=1):O=lt,w.attr(lt.totalOrigin);break}}else g=+ot;for(var rt=0,wt=p.percents.length;rt<wt;rt++){if(p.percents[rt]==C||p.percents[rt]>g*p.top){C=p.percents[rt],Q=p.percents[rt-1]||0,it=it/p.top*(C-Q),H=p.percents[rt+1],M=p.anim[C];break}g&&w.attr(p.anim[p.percents[rt]])}if(M){if(O)O.initstatus=g,O.start=new Date-O.ms*g;else{for(var ut in M)if(M[m](ut)&&(X[m](ut)||w.paper.customAttributes[m](ut)))switch(tt[ut]=w.attr(ut),tt[ut]==null&&(tt[ut]=Y[ut]),ot[ut]=M[ut],X[ut]){case pt:ct[ut]=(ot[ut]-tt[ut])/it;break;case"colour":tt[ut]=h.getRGB(tt[ut]);var gt=h.getRGB(ot[ut]);ct[ut]={r:(gt.r-tt[ut].r)/it,g:(gt.g-tt[ut].g)/it,b:(gt.b-tt[ut].b)/it};break;case"path":var ft=Nn(tt[ut],ot[ut]),Mt=ft[1];for(tt[ut]=ft[0],ct[ut]=[],rt=0,wt=tt[ut].length;rt<wt;rt++){ct[ut][rt]=[0];for(var kt=1,Rt=tt[ut][rt].length;kt<Rt;kt++)ct[ut][rt][kt]=(Mt[rt][kt]-tt[ut][rt][kt])/it}break;case"transform":var xr=w._,ea=fo(xr[ut],ot[ut]);if(ea)for(tt[ut]=ea.from,ot[ut]=ea.to,ct[ut]=[],ct[ut].real=!0,rt=0,wt=tt[ut].length;rt<wt;rt++)for(ct[ut][rt]=[tt[ut][rt][0]],kt=1,Rt=tt[ut][rt].length;kt<Rt;kt++)ct[ut][rt][kt]=(ot[ut][rt][kt]-tt[ut][rt][kt])/it;else{var Ie=w.matrix||new Ni,pi={_:{transform:xr.transform},getBBox:function(){return w.getBBox(1)}};tt[ut]=[Ie.a,Ie.b,Ie.c,Ie.d,Ie.e,Ie.f],mr(pi,ot[ut]),ot[ut]=pi._.transform,ct[ut]=[(pi.matrix.a-Ie.a)/it,(pi.matrix.b-Ie.b)/it,(pi.matrix.c-Ie.c)/it,(pi.matrix.d-Ie.d)/it,(pi.matrix.e-Ie.e)/it,(pi.matrix.f-Ie.f)/it]}break;case"csv":var Sr=F(M[ut])[L](d),Cr=F(tt[ut])[L](d);if(ut=="clip-rect")for(tt[ut]=Cr,ct[ut]=[],rt=Cr.length;rt--;)ct[ut][rt]=(Sr[rt]-tt[ut][rt])/it;ot[ut]=Sr;break;default:for(Sr=[][_](M[ut]),Cr=[][_](tt[ut]),ct[ut]=[],rt=w.paper.customAttributes[ut].length;rt--;)ct[ut][rt]=((Sr[rt]||0)-(Cr[rt]||0))/it}var yo=M.easing,$i=h.easing_formulas[yo];if(!$i)if(($i=F(yo).match(A))&&$i.length==5){var zn=$i;$i=function(wo){return Be(wo,+zn[1],+zn[2],+zn[3],+zn[4],it)}}else $i=Ot;if(lt={anim:p,percent:C,timestamp:st=M.start||p.start||+new Date,start:st+(p.del||0),status:0,initstatus:g||0,stop:!1,ms:it,easing:$i,from:tt,diff:ct,to:ot,el:w,callback:M.callback,prev:Q,next:H,repeat:k||p.times,origin:w.attr(),totalOrigin:y},At.push(lt),g&&!O&&!G&&(lt.stop=!0,lt.start=new Date-it*g,At.length==1))return _r();G&&(lt.start=new Date-lt.ms*g),At.length==1&&ta(_r)}o("raphael.anim.start."+w.id,w,p)}}function yr(p){for(var w=0;w<At.length;w++)At[w].el.paper==p&&At.splice(w--,1)}$t.animateWith=function(p,w,C,g,y,k){if(this.removed)return k&&k.call(this),this;var M=C instanceof Le?C:h.animation(C,g,y,k);zi(M,this,M.percents[0],null,this.attr());for(var O=0,G=At.length;O<G;O++)if(At[O].anim==w&&At[O].el==p){At[G-1].start=At[O].start;break}return this},$t.onAnimation=function(p){return p?o.on("raphael.anim.frame."+this.id,p):o.unbind("raphael.anim.frame."+this.id),this},Le.prototype.delay=function(p){var w=new Le(this.anim,this.ms);return w.times=this.times,w.del=+p||0,w},Le.prototype.repeat=function(p){var w=new Le(this.anim,this.ms);return w.del=this.del,w.times=q.floor(K(p,0))||1,w},h.animation=function(p,w,C,g){if(p instanceof Le)return p;!h.is(C,"function")&&C||(g=g||C||null,C=null),p=Object(p),w=+w||0;var y,k,M={};for(k in p)p[m](k)&&j(k)!=k&&j(k)+"%"!=k&&(y=!0,M[k]=p[k]);if(y)return C&&(M.easing=C),g&&(M.callback=g),new Le({100:M},w);if(g){var O=0;for(var G in p){var H=W(G);p[m](G)&&H>O&&(O=H)}!p[O+="%"].callback&&(p[O].callback=g)}return new Le(p,w)},$t.animate=function(p,w,C,g){if(this.removed)return g&&g.call(this),this;var y=p instanceof Le?p:h.animation(p,w,C,g);return zi(y,this,y.percents[0],null,this.attr()),this},$t.setTime=function(p,w){return p&&w!=null&&this.status(p,Z(w,p.ms)/p.ms),this},$t.status=function(p,w){var C,g,y=[],k=0;if(w!=null)return zi(p,this,-1,Z(w,1)),this;for(C=At.length;k<C;k++)if((g=At[k]).el.id==this.id&&(!p||g.anim==p)){if(p)return g.status;y.push({anim:g.anim,status:g.status})}return p?0:y},$t.pause=function(p){for(var w=0;w<At.length;w++)At[w].el.id!=this.id||p&&At[w].anim!=p||o("raphael.anim.pause."+this.id,this,At[w].anim)!==!1&&(At[w].paused=!0);return this},$t.resume=function(p){for(var w=0;w<At.length;w++)if(At[w].el.id==this.id&&(!p||At[w].anim==p)){var C=At[w];o("raphael.anim.resume."+this.id,this,C.anim)!==!1&&(delete C.paused,this.status(C.anim,C.status))}return this},$t.stop=function(p){for(var w=0;w<At.length;w++)At[w].el.id!=this.id||p&&At[w].anim!=p||o("raphael.anim.stop."+this.id,this,At[w].anim)!==!1&&At.splice(w--,1);return this},o.on("raphael.remove",yr),o.on("raphael.clear",yr),$t.toString=function(){return"Raphaël’s object"};var wr,br,We,Ke,Un=function(p){if(this.items=[],this.length=0,this.type="set",p)for(var w=0,C=p.length;w<C;w++)!p[w]||p[w].constructor!=$t.constructor&&p[w].constructor!=Un||(this[this.items.length]=this.items[this.items.length]=p[w],this.length++)},de=Un.prototype;for(var Bn in de.push=function(){for(var p,w,C=0,g=arguments.length;C<g;C++)!(p=arguments[C])||p.constructor!=$t.constructor&&p.constructor!=Un||(this[w=this.items.length]=this.items[w]=p,this.length++);return this},de.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},de.forEach=function(p,w){for(var C=0,g=this.items.length;C<g;C++)if(p.call(w,this.items[C],C)===!1)return this;return this},$t)$t[m](Bn)&&(de[Bn]=function(p){return function(){var w=arguments;return this.forEach(function(C){C[p][E](C,w)})}}(Bn));return de.attr=function(p,w){if(p&&h.is(p,nt)&&h.is(p[0],"object"))for(var C=0,g=p.length;C<g;C++)this.items[C].attr(p[C]);else for(var y=0,k=this.items.length;y<k;y++)this.items[y].attr(p,w);return this},de.clear=function(){for(;this.length;)this.pop()},de.splice=function(p,w,C){p=p<0?K(this.length+p,0):p,w=K(0,Z(this.length-p,w));var g,y=[],k=[],M=[];for(g=2;g<arguments.length;g++)M.push(arguments[g]);for(g=0;g<w;g++)k.push(this[p+g]);for(;g<this.length-p;g++)y.push(this[p+g]);var O=M.length;for(g=0;g<O+y.length;g++)this.items[p+g]=this[p+g]=g<O?M[g]:y[g-O];for(g=this.items.length=this.length-=w-O;this[g];)delete this[g++];return new Un(k)},de.exclude=function(p){for(var w=0,C=this.length;w<C;w++)if(this[w]==p)return this.splice(w,1),!0},de.animate=function(p,w,C,g){(h.is(C,"function")||!C)&&(g=C||null);var y,k,M=this.items.length,O=M,G=this;if(!M)return this;g&&(k=function(){!--M&&g.call(G)}),C=h.is(C,"string")?C:k;var H=h.animation(p,w,C,k);for(y=this.items[--O].animate(H);O--;)this.items[O]&&!this.items[O].removed&&this.items[O].animateWith(y,H,H),this.items[O]&&!this.items[O].removed||M--;return this},de.insertAfter=function(p){for(var w=this.items.length;w--;)this.items[w].insertAfter(p);return this},de.getBBox=function(){for(var p=[],w=[],C=[],g=[],y=this.items.length;y--;)if(!this.items[y].removed){var k=this.items[y].getBBox();p.push(k.x),w.push(k.y),C.push(k.x+k.width),g.push(k.y+k.height)}return{x:p=Z[E](0,p),y:w=Z[E](0,w),x2:C=K[E](0,C),y2:g=K[E](0,g),width:C-p,height:g-w}},de.clone=function(p){p=this.paper.set();for(var w=0,C=this.items.length;w<C;w++)p.push(this.items[w].clone());return p},de.toString=function(){return"Raphaël‘s set"},de.glow=function(p){var w=this.paper.set();return this.forEach(function(C,g){var y=C.glow(p);y?.forEach(function(k,M){w.push(k)})}),w},de.isPointInside=function(p,w){var C=!1;return this.forEach(function(g){if(g.isPointInside(p,w))return C=!0,!1}),C},h.registerFont=function(p){if(!p.face)return p;this.fonts=this.fonts||{};var w={w:p.w,face:{},glyphs:{}},C=p.face["font-family"];for(var g in p.face)p.face[m](g)&&(w.face[g]=p.face[g]);if(this.fonts[C]?this.fonts[C].push(w):this.fonts[C]=[w],!p.svg){for(var y in w.face["units-per-em"]=W(p.face["units-per-em"],10),p.glyphs)if(p.glyphs[m](y)){var k=p.glyphs[y];if(w.glyphs[y]={w:k.w,k:{},d:k.d&&"M"+k.d.replace(/[mlcxtrv]/g,function(O){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[O]||"M"})+"z"},k.k)for(var M in k.k)k[m](M)&&(w.glyphs[y].k[M]=k.k[M])}}return p},c.getFont=function(p,w,C,g){if(g=g||"normal",C=C||"normal",w=+w||{normal:400,bold:700,lighter:300,bolder:800}[w]||400,h.fonts){var y,k=h.fonts[p];if(!k){var M=new RegExp("(^|\\s)"+p.replace(/[^\w\d\s+!~.:_-]/g,P)+"(\\s|$)","i");for(var O in h.fonts)if(h.fonts[m](O)&&M.test(O)){k=h.fonts[O];break}}if(k)for(var G=0,H=k.length;G<H&&((y=k[G]).face["font-weight"]!=w||y.face["font-style"]!=C&&y.face["font-style"]||y.face["font-stretch"]!=g);G++);return y}},c.print=function(p,w,C,g,y,k,M,O){k=k||"middle",M=K(Z(M||0,1),-1),O=K(Z(O||1,3),1);var G,H=F(C)[L](P),Q=0,st=0,it=P;if(h.is(g,"string")&&(g=this.getFont(g)),g){G=(y||16)/g.face["units-per-em"];for(var tt=g.face.bbox[L](d),ot=+tt[0],ct=tt[3]-tt[1],lt=0,rt=+tt[1]+(k=="baseline"?ct+ +g.face.descent:ct/2),wt=0,ut=H.length;wt<ut;wt++){if(H[wt]==`
26
- `)Q=0,ft=0,st=0,lt+=ct*O;else{var gt=st&&g.glyphs[H[wt-1]]||{},ft=g.glyphs[H[wt]];Q+=st?(gt.w||g.w)+(gt.k&&gt.k[H[wt]]||0)+g.w*M:0,st=1}ft&&ft.d&&(it+=h.transformPath(ft.d,["t",Q*G,lt*G,"s",G,G,ot,rt,"t",(p-ot)/G,(w-rt)/G]))}}return this.path(it).attr({fill:"#000",stroke:"none"})},c.add=function(p){if(h.is(p,"array"))for(var w,C=this.set(),g=0,y=p.length;g<y;g++)w=p[g]||{},f[m](w.type)&&C.push(this[w.type]().attr(w));return C},h.format=function(p,w){var C=h.is(w,nt)?[0][_](w):arguments;return p&&h.is(p,"string")&&C.length-1&&(p=p.replace(u,function(g,y){return C[++y]==null?P:C[y]})),p||P},h.fullfill=(wr=/\{([^\}]+)\}/g,br=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,function(p,w){return String(p).replace(wr,function(C,g){return function(y,k,M){var O=M;return k.replace(br,function(G,H,Q,st,it){H=H||st,O&&(H in O&&(O=O[H]),typeof O=="function"&&it&&(O=O()))}),O=(O==null||O==M?y:O)+""}(C,g,w)})}),h.ninja=function(){if(b.was)v.win.Raphael=b.is;else{window.Raphael=void 0;try{delete window.Raphael}catch{}}return h},h.st=de,o.on("raphael.DOMload",function(){l=!0}),(We=document).readyState==null&&We.addEventListener&&(We.addEventListener("DOMContentLoaded",Ke=function(){We.removeEventListener("DOMContentLoaded",Ke,!1),We.readyState="complete"},!1),We.readyState="loading"),function p(){/in/.test(We.readyState)?setTimeout(p,9):h.eve("raphael.DOMload")}(),h}.apply(i,s))===void 0||(e.exports=a)},function(e,i,r){var s,a;s=[r(0),r(3),r(4)],(a=function(o){return o}.apply(i,s))===void 0||(e.exports=a)},function(e,i,r){var s,a,o,h,l,c,d,f,u,m,v,b,S,E;h="hasOwnProperty",l=/[\.\/]/,c=/\s*,\s*/,d=function(_,x){return _-x},f={n:{}},u=function(){for(var _=0,x=this.length;_<x;_++)if(this[_]!==void 0)return this[_]},m=function(){for(var _=this.length;--_;)if(this[_]!==void 0)return this[_]},v=Object.prototype.toString,b=String,S=Array.isArray||function(_){return _ instanceof Array||v.call(_)=="[object Array]"},(E=function(_,x){var P,R=o,F=Array.prototype.slice.call(arguments,2),L=E.listeners(_),$=0,U=[],z={},q=[],K=a;q.firstDefined=u,q.lastDefined=m,a=_,o=0;for(var Z=0,at=L.length;Z<at;Z++)"zIndex"in L[Z]&&(U.push(L[Z].zIndex),L[Z].zIndex<0&&(z[L[Z].zIndex]=L[Z]));for(U.sort(d);U[$]<0;)if(P=z[U[$++]],q.push(P.apply(x,F)),o)return o=R,q;for(Z=0;Z<at;Z++)if("zIndex"in(P=L[Z]))if(P.zIndex==U[$]){if(q.push(P.apply(x,F)),o)break;do if((P=z[U[++$]])&&q.push(P.apply(x,F)),o)break;while(P)}else z[P.zIndex]=P;else if(q.push(P.apply(x,F)),o)break;return o=R,a=K,q})._events=f,E.listeners=function(_){var x,P,R,F,L,$,U,z,q=S(_)?_:_.split(l),K=f,Z=[K],at=[];for(F=0,L=q.length;F<L;F++){for(z=[],$=0,U=Z.length;$<U;$++)for(P=[(K=Z[$].n)[q[F]],K["*"]],R=2;R--;)(x=P[R])&&(z.push(x),at=at.concat(x.f||[]));Z=z}return at},E.separator=function(_){_?(_="["+(_=b(_).replace(/(?=[\.\^\]\[\-])/g,"\\"))+"]",l=new RegExp(_)):l=/[\.\/]/},E.on=function(_,x){if(typeof x!="function")return function(){};for(var P=S(_)?S(_[0])?_:[_]:b(_).split(c),R=0,F=P.length;R<F;R++)(function(L){for(var $,U=S(L)?L:b(L).split(l),z=f,q=0,K=U.length;q<K;q++)z=(z=z.n).hasOwnProperty(U[q])&&z[U[q]]||(z[U[q]]={n:{}});for(z.f=z.f||[],q=0,K=z.f.length;q<K;q++)if(z.f[q]==x){$=!0;break}!$&&z.f.push(x)})(P[R]);return function(L){+L==+L&&(x.zIndex=+L)}},E.f=function(_){var x=[].slice.call(arguments,1);return function(){E.apply(null,[_,null].concat(x).concat([].slice.call(arguments,0)))}},E.stop=function(){o=1},E.nt=function(_){var x=S(a)?a.join("."):a;return _?new RegExp("(?:\\.|\\/|^)"+_+"(?:\\.|\\/|$)").test(x):x},E.nts=function(){return S(a)?a:a.split(l)},E.off=E.unbind=function(_,x){if(_){var P=S(_)?S(_[0])?_:[_]:b(_).split(c);if(P.length>1)for(var R=0,F=P.length;R<F;R++)E.off(P[R],x);else{P=S(_)?_:b(_).split(l);var L,$,U,z,q,K=[f];for(R=0,F=P.length;R<F;R++)for(z=0;z<K.length;z+=U.length-2){if(U=[z,1],L=K[z].n,P[R]!="*")L[P[R]]&&U.push(L[P[R]]);else for($ in L)L[h]($)&&U.push(L[$]);K.splice.apply(K,U)}for(R=0,F=K.length;R<F;R++)for(L=K[R];L.n;){if(x){if(L.f){for(z=0,q=L.f.length;z<q;z++)if(L.f[z]==x){L.f.splice(z,1);break}!L.f.length&&delete L.f}for($ in L.n)if(L.n[h]($)&&L.n[$].f){var Z=L.n[$].f;for(z=0,q=Z.length;z<q;z++)if(Z[z]==x){Z.splice(z,1);break}!Z.length&&delete L.n[$].f}}else for($ in delete L.f,L.n)L.n[h]($)&&L.n[$].f&&delete L.n[$].f;L=L.n}}}else E._events=f={n:{}}},E.once=function(_,x){var P=function(){return E.off(_,P),x.apply(this,arguments)};return E.on(_,P)},E.version="0.5.0",E.toString=function(){return"You are running Eve 0.5.0"},e.exports?e.exports=E:(s=function(){return E}.apply(i,[]))===void 0||(e.exports=s)},function(e,i,r){var s,a;s=[r(0)],(a=function(o){if(!o||o.svg){var h="hasOwnProperty",l=String,c=parseFloat,d=parseInt,f=Math,u=f.max,m=f.abs,v=f.pow,b=/[, ]+/,S=o.eve,E="",_=" ",x="http://www.w3.org/1999/xlink",P={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},R={};o.toString=function(){return`Your browser supports SVG.
27
- You are running Raphaël `+this.version};var F=function(I,D){if(D)for(var A in typeof I=="string"&&(I=F(I)),D)D[h](A)&&(A.substring(0,6)=="xlink:"?I.setAttributeNS(x,A.substring(6),l(D[A])):I.setAttribute(A,l(D[A])));else(I=o._g.doc.createElementNS("http://www.w3.org/2000/svg",I)).style&&(I.style.webkitTapHighlightColor="rgba(0,0,0,0)");return I},L=function(I,D){var A="linear",B=I.id+D,j=.5,W=.5,N=I.node,Y=I.paper,X=N.style,et=o._g.doc.getElementById(B);if(!et){if(D=(D=l(D).replace(o._radial_gradient,function(Pt,Ot,Ct){if(A="radial",Ot&&Ct){j=c(Ot);var Jt=2*((W=c(Ct))>.5)-1;v(j-.5,2)+v(W-.5,2)>.25&&(W=f.sqrt(.25-v(j-.5,2))*Jt+.5)&&W!=.5&&(W=W.toFixed(5)-1e-5*Jt)}return E})).split(/\s*\-\s*/),A=="linear"){var ht=D.shift();if(ht=-c(ht),isNaN(ht))return null;var mt=[0,0,f.cos(o.rad(ht)),f.sin(o.rad(ht))],bt=1/(u(m(mt[2]),m(mt[3]))||1);mt[2]*=bt,mt[3]*=bt,mt[2]<0&&(mt[0]=-mt[2],mt[2]=0),mt[3]<0&&(mt[1]=-mt[3],mt[3]=0)}var Tt=o._parseDots(D);if(!Tt)return null;if(B=B.replace(/[\(\)\s,\xb0#]/g,"_"),I.gradient&&B!=I.gradient.id&&(Y.defs.removeChild(I.gradient),delete I.gradient),!I.gradient){et=F(A+"Gradient",{id:B}),I.gradient=et,F(et,A=="radial"?{fx:j,fy:W}:{x1:mt[0],y1:mt[1],x2:mt[2],y2:mt[3],gradientTransform:I.matrix.invert()}),Y.defs.appendChild(et);for(var yt=0,Et=Tt.length;yt<Et;yt++)et.appendChild(F("stop",{offset:Tt[yt].offset?Tt[yt].offset:yt?"100%":"0%","stop-color":Tt[yt].color||"#fff","stop-opacity":isFinite(Tt[yt].opacity)?Tt[yt].opacity:1}))}}return F(N,{fill:$(B),opacity:1,"fill-opacity":1}),X.fill=E,X.opacity=1,X.fillOpacity=1,1},$=function(I){if((D=document.documentMode)&&(D===9||D===10))return"url('#"+I+"')";var D,A=document.location;return"url('"+(A.protocol+"//"+A.host+A.pathname+A.search)+"#"+I+"')"},U=function(I){var D=I.getBBox(1);F(I.pattern,{patternTransform:I.matrix.invert()+" translate("+D.x+","+D.y+")"})},z=function(I,D,A){if(I.type=="path"){for(var B,j,W,N,Y,X=l(D).toLowerCase().split("-"),et=I.paper,ht=A?"end":"start",mt=I.node,bt=I.attrs,Tt=bt["stroke-width"],yt=X.length,Et="classic",Pt=3,Ot=3,Ct=5;yt--;)switch(X[yt]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":Et=X[yt];break;case"wide":Ot=5;break;case"narrow":Ot=2;break;case"long":Pt=5;break;case"short":Pt=2}if(Et=="open"?(Pt+=2,Ot+=2,Ct+=2,W=1,N=A?4:1,Y={fill:"none",stroke:bt.stroke}):(N=W=Pt/2,Y={fill:bt.stroke,stroke:"none"}),I._.arrows?A?(I._.arrows.endPath&&R[I._.arrows.endPath]--,I._.arrows.endMarker&&R[I._.arrows.endMarker]--):(I._.arrows.startPath&&R[I._.arrows.startPath]--,I._.arrows.startMarker&&R[I._.arrows.startMarker]--):I._.arrows={},Et!="none"){var Jt="raphael-marker-"+Et,zt="raphael-marker-"+ht+Et+Pt+Ot+"-obj"+I.id;o._g.doc.getElementById(Jt)?R[Jt]++:(et.defs.appendChild(F(F("path"),{"stroke-linecap":"round",d:P[Et],id:Jt})),R[Jt]=1);var ce,Xt=o._g.doc.getElementById(zt);Xt?(R[zt]++,ce=Xt.getElementsByTagName("use")[0]):(Xt=F(F("marker"),{id:zt,markerHeight:Ot,markerWidth:Pt,orient:"auto",refX:N,refY:Ot/2}),ce=F(F("use"),{"xlink:href":"#"+Jt,transform:(A?"rotate(180 "+Pt/2+" "+Ot/2+") ":E)+"scale("+Pt/Ct+","+Ot/Ct+")","stroke-width":(1/((Pt/Ct+Ot/Ct)/2)).toFixed(4)}),Xt.appendChild(ce),et.defs.appendChild(Xt),R[zt]=1),F(ce,Y);var Ee=W*(Et!="diamond"&&Et!="oval");A?(B=I._.arrows.startdx*Tt||0,j=o.getTotalLength(bt.path)-Ee*Tt):(B=Ee*Tt,j=o.getTotalLength(bt.path)-(I._.arrows.enddx*Tt||0)),(Y={})["marker-"+ht]="url(#"+zt+")",(j||B)&&(Y.d=o.getSubpath(bt.path,B,j)),F(mt,Y),I._.arrows[ht+"Path"]=Jt,I._.arrows[ht+"Marker"]=zt,I._.arrows[ht+"dx"]=Ee,I._.arrows[ht+"Type"]=Et,I._.arrows[ht+"String"]=D}else A?(B=I._.arrows.startdx*Tt||0,j=o.getTotalLength(bt.path)-B):(B=0,j=o.getTotalLength(bt.path)-(I._.arrows.enddx*Tt||0)),I._.arrows[ht+"Path"]&&F(mt,{d:o.getSubpath(bt.path,B,j)}),delete I._.arrows[ht+"Path"],delete I._.arrows[ht+"Marker"],delete I._.arrows[ht+"dx"],delete I._.arrows[ht+"Type"],delete I._.arrows[ht+"String"];for(Y in R)if(R[h](Y)&&!R[Y]){var ye=o._g.doc.getElementById(Y);ye&&ye.parentNode.removeChild(ye)}}},q={"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},K=function(I,D,A){if(D=q[l(D).toLowerCase()]){for(var B=I.attrs["stroke-width"]||"1",j={round:B,square:B,butt:0}[I.attrs["stroke-linecap"]||A["stroke-linecap"]]||0,W=[],N=D.length;N--;)W[N]=D[N]*B+(N%2?1:-1)*j;F(I.node,{"stroke-dasharray":W.join(",")})}else F(I.node,{"stroke-dasharray":"none"})},Z=function(I,D){var A=I.node,B=I.attrs,j=A.style.visibility;for(var W in A.style.visibility="hidden",D)if(D[h](W)){if(!o._availableAttrs[h](W))continue;var N=D[W];switch(B[W]=N,W){case"blur":I.blur(N);break;case"title":var Y=A.getElementsByTagName("title");if(Y.length&&(Y=Y[0]))Y.firstChild.nodeValue=N;else{Y=F("title");var X=o._g.doc.createTextNode(N);Y.appendChild(X),A.appendChild(Y)}break;case"href":case"target":var et=A.parentNode;if(et.tagName.toLowerCase()!="a"){var ht=F("a");et.insertBefore(ht,A),ht.appendChild(A),et=ht}W=="target"?et.setAttributeNS(x,"show",N=="blank"?"new":N):et.setAttributeNS(x,W,N);break;case"cursor":A.style.cursor=N;break;case"transform":I.transform(N);break;case"arrow-start":z(I,N);break;case"arrow-end":z(I,N,1);break;case"clip-rect":var mt=l(N).split(b);if(mt.length==4){I.clip&&I.clip.parentNode.parentNode.removeChild(I.clip.parentNode);var bt=F("clipPath"),Tt=F("rect");bt.id=o.createUUID(),F(Tt,{x:mt[0],y:mt[1],width:mt[2],height:mt[3]}),bt.appendChild(Tt),I.paper.defs.appendChild(bt),F(A,{"clip-path":"url(#"+bt.id+")"}),I.clip=Tt}if(!N){var yt=A.getAttribute("clip-path");if(yt){var Et=o._g.doc.getElementById(yt.replace(/(^url\(#|\)$)/g,E));Et&&Et.parentNode.removeChild(Et),F(A,{"clip-path":E}),delete I.clip}}break;case"path":I.type=="path"&&(F(A,{d:N?B.path=o._pathToAbsolute(N):"M0,0"}),I._.dirty=1,I._.arrows&&("startString"in I._.arrows&&z(I,I._.arrows.startString),"endString"in I._.arrows&&z(I,I._.arrows.endString,1)));break;case"width":if(A.setAttribute(W,N),I._.dirty=1,!B.fx)break;W="x",N=B.x;case"x":B.fx&&(N=-B.x-(B.width||0));case"rx":if(W=="rx"&&I.type=="rect")break;case"cx":A.setAttribute(W,N),I.pattern&&U(I),I._.dirty=1;break;case"height":if(A.setAttribute(W,N),I._.dirty=1,!B.fy)break;W="y",N=B.y;case"y":B.fy&&(N=-B.y-(B.height||0));case"ry":if(W=="ry"&&I.type=="rect")break;case"cy":A.setAttribute(W,N),I.pattern&&U(I),I._.dirty=1;break;case"r":I.type=="rect"?F(A,{rx:N,ry:N}):A.setAttribute(W,N),I._.dirty=1;break;case"src":I.type=="image"&&A.setAttributeNS(x,"href",N);break;case"stroke-width":I._.sx==1&&I._.sy==1||(N/=u(m(I._.sx),m(I._.sy))||1),A.setAttribute(W,N),B["stroke-dasharray"]&&K(I,B["stroke-dasharray"],D),I._.arrows&&("startString"in I._.arrows&&z(I,I._.arrows.startString),"endString"in I._.arrows&&z(I,I._.arrows.endString,1));break;case"stroke-dasharray":K(I,N,D);break;case"fill":var Pt=l(N).match(o._ISURL);if(Pt){bt=F("pattern");var Ot=F("image");bt.id=o.createUUID(),F(bt,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),F(Ot,{x:0,y:0,"xlink:href":Pt[1]}),bt.appendChild(Ot),function(Xt){o._preload(Pt[1],function(){var Ee=this.offsetWidth,ye=this.offsetHeight;F(Xt,{width:Ee,height:ye}),F(Ot,{width:Ee,height:ye})})}(bt),I.paper.defs.appendChild(bt),F(A,{fill:"url(#"+bt.id+")"}),I.pattern=bt,I.pattern&&U(I);break}var Ct=o.getRGB(N);if(Ct.error){if((I.type=="circle"||I.type=="ellipse"||l(N).charAt()!="r")&&L(I,N)){if("opacity"in B||"fill-opacity"in B){var Jt=o._g.doc.getElementById(A.getAttribute("fill").replace(/^url\(#|\)$/g,E));if(Jt){var zt=Jt.getElementsByTagName("stop");F(zt[zt.length-1],{"stop-opacity":("opacity"in B?B.opacity:1)*("fill-opacity"in B?B["fill-opacity"]:1)})}}B.gradient=N,B.fill="none";break}}else delete D.gradient,delete B.gradient,!o.is(B.opacity,"undefined")&&o.is(D.opacity,"undefined")&&F(A,{opacity:B.opacity}),!o.is(B["fill-opacity"],"undefined")&&o.is(D["fill-opacity"],"undefined")&&F(A,{"fill-opacity":B["fill-opacity"]});Ct[h]("opacity")&&F(A,{"fill-opacity":Ct.opacity>1?Ct.opacity/100:Ct.opacity});case"stroke":Ct=o.getRGB(N),A.setAttribute(W,Ct.hex),W=="stroke"&&Ct[h]("opacity")&&F(A,{"stroke-opacity":Ct.opacity>1?Ct.opacity/100:Ct.opacity}),W=="stroke"&&I._.arrows&&("startString"in I._.arrows&&z(I,I._.arrows.startString),"endString"in I._.arrows&&z(I,I._.arrows.endString,1));break;case"gradient":(I.type=="circle"||I.type=="ellipse"||l(N).charAt()!="r")&&L(I,N);break;case"opacity":B.gradient&&!B[h]("stroke-opacity")&&F(A,{"stroke-opacity":N>1?N/100:N});case"fill-opacity":if(B.gradient){(Jt=o._g.doc.getElementById(A.getAttribute("fill").replace(/^url\(#|\)$/g,E)))&&(zt=Jt.getElementsByTagName("stop"),F(zt[zt.length-1],{"stop-opacity":N}));break}default:W=="font-size"&&(N=d(N,10)+"px");var ce=W.replace(/(\-.)/g,function(Xt){return Xt.substring(1).toUpperCase()});A.style[ce]=N,I._.dirty=1,A.setAttribute(W,N)}}at(I,D),A.style.visibility=j},at=function(I,D){if(I.type=="text"&&(D[h]("text")||D[h]("font")||D[h]("font-size")||D[h]("x")||D[h]("y"))){var A=I.attrs,B=I.node,j=B.firstChild?d(o._g.doc.defaultView.getComputedStyle(B.firstChild,E).getPropertyValue("font-size"),10):10;if(D[h]("text")){for(A.text=D.text;B.firstChild;)B.removeChild(B.firstChild);for(var W,N=l(D.text).split(`
28
- `),Y=[],X=0,et=N.length;X<et;X++)W=F("tspan"),X&&F(W,{dy:1.2*j,x:A.x}),W.appendChild(o._g.doc.createTextNode(N[X])),B.appendChild(W),Y[X]=W}else for(X=0,et=(Y=B.getElementsByTagName("tspan")).length;X<et;X++)X?F(Y[X],{dy:1.2*j,x:A.x}):F(Y[0],{dy:0});F(B,{x:A.x,y:A.y}),I._.dirty=1;var ht=I._getBBox(),mt=A.y-(ht.y+ht.height/2);mt&&o.is(mt,"finite")&&F(Y[0],{dy:mt})}},vt=function(I){return I.parentNode&&I.parentNode.tagName.toLowerCase()==="a"?I.parentNode:I},_t=function(I,D){this[0]=this.node=I,I.raphael=!0,this.id=("0000"+(Math.random()*Math.pow(36,5)<<0).toString(36)).slice(-5),I.raphaelid=this.id,this.matrix=o.matrix(),this.realPath=null,this.paper=D,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!D.bottom&&(D.bottom=this),this.prev=D.top,D.top&&(D.top.next=this),D.top=this,this.next=null},pt=o.el;_t.prototype=pt,pt.constructor=_t,o._engine.path=function(I,D){var A=F("path");D.canvas&&D.canvas.appendChild(A);var B=new _t(A,D);return B.type="path",Z(B,{fill:"none",stroke:"#000",path:I}),B},pt.rotate=function(I,D,A){if(this.removed)return this;if((I=l(I).split(b)).length-1&&(D=c(I[1]),A=c(I[2])),I=c(I[0]),A==null&&(D=A),D==null||A==null){var B=this.getBBox(1);D=B.x+B.width/2,A=B.y+B.height/2}return this.transform(this._.transform.concat([["r",I,D,A]])),this},pt.scale=function(I,D,A,B){if(this.removed)return this;if((I=l(I).split(b)).length-1&&(D=c(I[1]),A=c(I[2]),B=c(I[3])),I=c(I[0]),D==null&&(D=I),B==null&&(A=B),A==null||B==null)var j=this.getBBox(1);return A=A??j.x+j.width/2,B=B??j.y+j.height/2,this.transform(this._.transform.concat([["s",I,D,A,B]])),this},pt.translate=function(I,D){return this.removed?this:((I=l(I).split(b)).length-1&&(D=c(I[1])),I=c(I[0])||0,D=+D||0,this.transform(this._.transform.concat([["t",I,D]])),this)},pt.transform=function(I){var D=this._;if(I==null)return D.transform;if(o._extractTransform(this,I),this.clip&&F(this.clip,{transform:this.matrix.invert()}),this.pattern&&U(this),this.node&&F(this.node,{transform:this.matrix}),D.sx!=1||D.sy!=1){var A=this.attrs[h]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":A})}return this},pt.hide=function(){return this.removed||(this.node.style.display="none"),this},pt.show=function(){return this.removed||(this.node.style.display=""),this},pt.remove=function(){var I=vt(this.node);if(!this.removed&&I.parentNode){var D=this.paper;for(var A in D.__set__&&D.__set__.exclude(this),S.unbind("raphael.*.*."+this.id),this.gradient&&D.defs.removeChild(this.gradient),o._tear(this,D),I.parentNode.removeChild(I),this.removeData(),this)this[A]=typeof this[A]=="function"?o._removedFactory(A):null;this.removed=!0}},pt._getBBox=function(){if(this.node.style.display=="none"){this.show();var I=!0}var D,A=!1;this.paper.canvas.parentElement?D=this.paper.canvas.parentElement.style:this.paper.canvas.parentNode&&(D=this.paper.canvas.parentNode.style),D&&D.display=="none"&&(A=!0,D.display="");var B={};try{B=this.node.getBBox()}catch{B={x:this.node.clientLeft,y:this.node.clientTop,width:this.node.clientWidth,height:this.node.clientHeight}}finally{B=B||{},A&&(D.display="none")}return I&&this.hide(),B},pt.attr=function(I,D){if(this.removed)return this;if(I==null){var A={};for(var B in this.attrs)this.attrs[h](B)&&(A[B]=this.attrs[B]);return A.gradient&&A.fill=="none"&&(A.fill=A.gradient)&&delete A.gradient,A.transform=this._.transform,A}if(D==null&&o.is(I,"string")){if(I=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;if(I=="transform")return this._.transform;for(var j=I.split(b),W={},N=0,Y=j.length;N<Y;N++)(I=j[N])in this.attrs?W[I]=this.attrs[I]:o.is(this.paper.customAttributes[I],"function")?W[I]=this.paper.customAttributes[I].def:W[I]=o._availableAttrs[I];return Y-1?W:W[j[0]]}if(D==null&&o.is(I,"array")){for(W={},N=0,Y=I.length;N<Y;N++)W[I[N]]=this.attr(I[N]);return W}if(D!=null){var X={};X[I]=D}else I!=null&&o.is(I,"object")&&(X=I);for(var et in X)S("raphael.attr."+et+"."+this.id,this,X[et]);for(et in this.paper.customAttributes)if(this.paper.customAttributes[h](et)&&X[h](et)&&o.is(this.paper.customAttributes[et],"function")){var ht=this.paper.customAttributes[et].apply(this,[].concat(X[et]));for(var mt in this.attrs[et]=X[et],ht)ht[h](mt)&&(X[mt]=ht[mt])}return Z(this,X),this},pt.toFront=function(){if(this.removed)return this;var I=vt(this.node);I.parentNode.appendChild(I);var D=this.paper;return D.top!=this&&o._tofront(this,D),this},pt.toBack=function(){if(this.removed)return this;var I=vt(this.node),D=I.parentNode;return D.insertBefore(I,D.firstChild),o._toback(this,this.paper),this.paper,this},pt.insertAfter=function(I){if(this.removed||!I)return this;var D=vt(this.node),A=vt(I.node||I[I.length-1].node);return A.nextSibling?A.parentNode.insertBefore(D,A.nextSibling):A.parentNode.appendChild(D),o._insertafter(this,I,this.paper),this},pt.insertBefore=function(I){if(this.removed||!I)return this;var D=vt(this.node),A=vt(I.node||I[0].node);return A.parentNode.insertBefore(D,A),o._insertbefore(this,I,this.paper),this},pt.blur=function(I){var D=this;if(+I!=0){var A=F("filter"),B=F("feGaussianBlur");D.attrs.blur=I,A.id=o.createUUID(),F(B,{stdDeviation:+I||1.5}),A.appendChild(B),D.paper.defs.appendChild(A),D._blur=A,F(D.node,{filter:"url(#"+A.id+")"})}else D._blur&&(D._blur.parentNode.removeChild(D._blur),delete D._blur,delete D.attrs.blur),D.node.removeAttribute("filter");return D},o._engine.circle=function(I,D,A,B){var j=F("circle");I.canvas&&I.canvas.appendChild(j);var W=new _t(j,I);return W.attrs={cx:D,cy:A,r:B,fill:"none",stroke:"#000"},W.type="circle",F(j,W.attrs),W},o._engine.rect=function(I,D,A,B,j,W){var N=F("rect");I.canvas&&I.canvas.appendChild(N);var Y=new _t(N,I);return Y.attrs={x:D,y:A,width:B,height:j,rx:W||0,ry:W||0,fill:"none",stroke:"#000"},Y.type="rect",F(N,Y.attrs),Y},o._engine.ellipse=function(I,D,A,B,j){var W=F("ellipse");I.canvas&&I.canvas.appendChild(W);var N=new _t(W,I);return N.attrs={cx:D,cy:A,rx:B,ry:j,fill:"none",stroke:"#000"},N.type="ellipse",F(W,N.attrs),N},o._engine.image=function(I,D,A,B,j,W){var N=F("image");F(N,{x:A,y:B,width:j,height:W,preserveAspectRatio:"none"}),N.setAttributeNS(x,"href",D),I.canvas&&I.canvas.appendChild(N);var Y=new _t(N,I);return Y.attrs={x:A,y:B,width:j,height:W,src:D},Y.type="image",Y},o._engine.text=function(I,D,A,B){var j=F("text");I.canvas&&I.canvas.appendChild(j);var W=new _t(j,I);return W.attrs={x:D,y:A,"text-anchor":"middle",text:B,"font-family":o._availableAttrs["font-family"],"font-size":o._availableAttrs["font-size"],stroke:"none",fill:"#000"},W.type="text",Z(W,W.attrs),W},o._engine.setSize=function(I,D){return this.width=I||this.width,this.height=D||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},o._engine.create=function(){var I=o._getContainer.apply(0,arguments),D=I&&I.container;if(!D)throw new Error("SVG container not found.");var A,B=I.x,j=I.y,W=I.width,N=I.height,Y=F("svg"),X="overflow:hidden;";return B=B||0,j=j||0,F(Y,{height:N=N||342,version:1.1,width:W=W||512,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}),D==1?(Y.style.cssText=X+"position:absolute;left:"+B+"px;top:"+j+"px",o._g.doc.body.appendChild(Y),A=1):(Y.style.cssText=X+"position:relative",D.firstChild?D.insertBefore(Y,D.firstChild):D.appendChild(Y)),(D=new o._Paper).width=W,D.height=N,D.canvas=Y,D.clear(),D._left=D._top=0,A&&(D.renderfix=function(){}),D.renderfix(),D},o._engine.setViewBox=function(I,D,A,B,j){S("raphael.setViewBox",this,this._viewBox,[I,D,A,B,j]);var W,N,Y=this.getSize(),X=u(A/Y.width,B/Y.height),et=this.top,ht=j?"xMidYMid meet":"xMinYMin";for(I==null?(this._vbSize&&(X=1),delete this._vbSize,W="0 0 "+this.width+_+this.height):(this._vbSize=X,W=I+_+D+_+A+_+B),F(this.canvas,{viewBox:W,preserveAspectRatio:ht});X&&et;)N="stroke-width"in et.attrs?et.attrs["stroke-width"]:1,et.attr({"stroke-width":N}),et._.dirty=1,et._.dirtyT=1,et=et.prev;return this._viewBox=[I,D,A,B,!!j],this},o.prototype.renderfix=function(){var I,D=this.canvas,A=D.style;try{I=D.getScreenCTM()||D.createSVGMatrix()}catch{I=D.createSVGMatrix()}var B=-I.e%1,j=-I.f%1;(B||j)&&(B&&(this._left=(this._left+B)%1,A.left=this._left+"px"),j&&(this._top=(this._top+j)%1,A.top=this._top+"px"))},o.prototype.clear=function(){o.eve("raphael.clear",this);for(var I=this.canvas;I.firstChild;)I.removeChild(I.firstChild);this.bottom=this.top=null,(this.desc=F("desc")).appendChild(o._g.doc.createTextNode("Created with Raphaël "+o.version)),I.appendChild(this.desc),I.appendChild(this.defs=F("defs"))},o.prototype.remove=function(){for(var I in S("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this)this[I]=typeof this[I]=="function"?o._removedFactory(I):null};var nt=o.st;for(var J in pt)pt[h](J)&&!nt[h](J)&&(nt[J]=function(I){return function(){var D=arguments;return this.forEach(function(A){A[I].apply(A,D)})}}(J))}}.apply(i,s))===void 0||(e.exports=a)},function(e,i,r){var s,a;s=[r(0)],(a=function(o){if(!o||o.vml){var h="hasOwnProperty",l=String,c=parseFloat,d=Math,f=d.round,u=d.max,m=d.min,v=d.abs,b=/[, ]+/,S=o.eve,E=" ",_="",x={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},P=/([clmz]),?([^clmz]*)/gi,R=/ progid:\S+Blur\([^\)]+\)/g,F=/-?[^,\s-]+/g,L="position:absolute;left:0;top:0;width:1px;height:1px;behavior:url(#default#VML)",$=21600,U={path:1,rect:1,image:1},z={circle:1,ellipse:1},q=function(D,A,B){var j=o.matrix();return j.rotate(-D,.5,.5),{dx:j.x(A,B),dy:j.y(A,B)}},K=function(D,A,B,j,W,N){var Y=D._,X=D.matrix,et=Y.fillpos,ht=D.node,mt=ht.style,bt=1,Tt="",yt=$/A,Et=$/B;if(mt.visibility="hidden",A&&B){if(ht.coordsize=v(yt)+E+v(Et),mt.rotation=N*(A*B<0?-1:1),N){var Pt=q(N,j,W);j=Pt.dx,W=Pt.dy}if(A<0&&(Tt+="x"),B<0&&(Tt+=" y")&&(bt=-1),mt.flip=Tt,ht.coordorigin=j*-yt+E+W*-Et,et||Y.fillsize){var Ot=ht.getElementsByTagName("fill");Ot=Ot&&Ot[0],ht.removeChild(Ot),et&&(Pt=q(N,X.x(et[0],et[1]),X.y(et[0],et[1])),Ot.position=Pt.dx*bt+E+Pt.dy*bt),Y.fillsize&&(Ot.size=Y.fillsize[0]*v(A)+E+Y.fillsize[1]*v(B)),ht.appendChild(Ot)}mt.visibility="visible"}};o.toString=function(){return`Your browser doesn’t support SVG. Falling down to VML.
29
- You are running Raphaël `+this.version};var Z,at=function(D,A,B){for(var j=l(A).toLowerCase().split("-"),W=B?"end":"start",N=j.length,Y="classic",X="medium",et="medium";N--;)switch(j[N]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":Y=j[N];break;case"wide":case"narrow":et=j[N];break;case"long":case"short":X=j[N]}var ht=D.node.getElementsByTagName("stroke")[0];ht[W+"arrow"]=Y,ht[W+"arrowlength"]=X,ht[W+"arrowwidth"]=et},vt=function(D,A){D.attrs=D.attrs||{};var B=D.node,j=D.attrs,W=B.style,N=U[D.type]&&(A.x!=j.x||A.y!=j.y||A.width!=j.width||A.height!=j.height||A.cx!=j.cx||A.cy!=j.cy||A.rx!=j.rx||A.ry!=j.ry||A.r!=j.r),Y=z[D.type]&&(j.cx!=A.cx||j.cy!=A.cy||j.r!=A.r||j.rx!=A.rx||j.ry!=A.ry),X=D;for(var et in A)A[h](et)&&(j[et]=A[et]);if(N&&(j.path=o._getPath[D.type](D),D._.dirty=1),A.href&&(B.href=A.href),A.title&&(B.title=A.title),A.target&&(B.target=A.target),A.cursor&&(W.cursor=A.cursor),"blur"in A&&D.blur(A.blur),(A.path&&D.type=="path"||N)&&(B.path=function(ve){var fi=/[ahqstv]/gi,hn=o._pathToAbsolute;if(l(ve).match(fi)&&(hn=o._path2curve),fi=/[clmz]/g,hn==o._pathToAbsolute&&!l(ve).match(fi)){var Re=l(ve).replace(P,function(lo,cn,Ii){var di=[],gr=cn.toLowerCase()=="m",Oi=x[cn];return Ii.replace(F,function(Fi){gr&&di.length==2&&(Oi+=di+x[cn=="m"?"l":"L"],di=[]),di.push(f(Fi*$))}),Oi+di});return Re}var ti,Ue,Fn=hn(ve);Re=[];for(var Li=0,ln=Fn.length;Li<ln;Li++){ti=Fn[Li],(Ue=Fn[Li][0].toLowerCase())=="z"&&(Ue="x");for(var Ye=1,Se=ti.length;Ye<Se;Ye++)Ue+=f(ti[Ye]*$)+(Ye!=Se-1?",":_);Re.push(Ue)}return Re.join(E)}(~l(j.path).toLowerCase().indexOf("r")?o._pathToAbsolute(j.path):j.path),D._.dirty=1,D.type=="image"&&(D._.fillpos=[j.x,j.y],D._.fillsize=[j.width,j.height],K(D,1,1,0,0,0))),"transform"in A&&D.transform(A.transform),Y){var ht=+j.cx,mt=+j.cy,bt=+j.rx||+j.r||0,Tt=+j.ry||+j.r||0;B.path=o.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",f((ht-bt)*$),f((mt-Tt)*$),f((ht+bt)*$),f((mt+Tt)*$),f(ht*$)),D._.dirty=1}if("clip-rect"in A){var yt=l(A["clip-rect"]).split(b);if(yt.length==4){yt[2]=+yt[2]+ +yt[0],yt[3]=+yt[3]+ +yt[1];var Et=B.clipRect||o._g.doc.createElement("div"),Pt=Et.style;Pt.clip=o.format("rect({1}px {2}px {3}px {0}px)",yt),B.clipRect||(Pt.position="absolute",Pt.top=0,Pt.left=0,Pt.width=D.paper.width+"px",Pt.height=D.paper.height+"px",B.parentNode.insertBefore(Et,B),Et.appendChild(B),B.clipRect=Et)}A["clip-rect"]||B.clipRect&&(B.clipRect.style.clip="auto")}if(D.textpath){var Ot=D.textpath.style;A.font&&(Ot.font=A.font),A["font-family"]&&(Ot.fontFamily='"'+A["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,_)+'"'),A["font-size"]&&(Ot.fontSize=A["font-size"]),A["font-weight"]&&(Ot.fontWeight=A["font-weight"]),A["font-style"]&&(Ot.fontStyle=A["font-style"])}if("arrow-start"in A&&at(X,A["arrow-start"]),"arrow-end"in A&&at(X,A["arrow-end"],1),A.opacity!=null||A.fill!=null||A.src!=null||A.stroke!=null||A["stroke-width"]!=null||A["stroke-opacity"]!=null||A["fill-opacity"]!=null||A["stroke-dasharray"]!=null||A["stroke-miterlimit"]!=null||A["stroke-linejoin"]!=null||A["stroke-linecap"]!=null){var Ct=B.getElementsByTagName("fill");if(!(Ct=Ct&&Ct[0])&&(Ct=Z("fill")),D.type=="image"&&A.src&&(Ct.src=A.src),A.fill&&(Ct.on=!0),Ct.on!=null&&A.fill!="none"&&A.fill!==null||(Ct.on=!1),Ct.on&&A.fill){var Jt=l(A.fill).match(o._ISURL);if(Jt){Ct.parentNode==B&&B.removeChild(Ct),Ct.rotate=!0,Ct.src=Jt[1],Ct.type="tile";var zt=D.getBBox(1);Ct.position=zt.x+E+zt.y,D._.fillpos=[zt.x,zt.y],o._preload(Jt[1],function(){D._.fillsize=[this.offsetWidth,this.offsetHeight]})}else Ct.color=o.getRGB(A.fill).hex,Ct.src=_,Ct.type="solid",o.getRGB(A.fill).error&&(X.type in{circle:1,ellipse:1}||l(A.fill).charAt()!="r")&&_t(X,A.fill,Ct)&&(j.fill="none",j.gradient=A.fill,Ct.rotate=!1)}if("fill-opacity"in A||"opacity"in A){var ce=((+j["fill-opacity"]+1||2)-1)*((+j.opacity+1||2)-1)*((+o.getRGB(A.fill).o+1||2)-1);ce=m(u(ce,0),1),Ct.opacity=ce,Ct.src&&(Ct.color="none")}B.appendChild(Ct);var Xt=B.getElementsByTagName("stroke")&&B.getElementsByTagName("stroke")[0],Ee=!1;!Xt&&(Ee=Xt=Z("stroke")),(A.stroke&&A.stroke!="none"||A["stroke-width"]||A["stroke-opacity"]!=null||A["stroke-dasharray"]||A["stroke-miterlimit"]||A["stroke-linejoin"]||A["stroke-linecap"])&&(Xt.on=!0),(A.stroke=="none"||A.stroke===null||Xt.on==null||A.stroke==0||A["stroke-width"]==0)&&(Xt.on=!1);var ye=o.getRGB(A.stroke);Xt.on&&A.stroke&&(Xt.color=ye.hex),ce=((+j["stroke-opacity"]+1||2)-1)*((+j.opacity+1||2)-1)*((+ye.o+1||2)-1);var li=.75*(c(A["stroke-width"])||1);if(ce=m(u(ce,0),1),A["stroke-width"]==null&&(li=j["stroke-width"]),A["stroke-width"]&&(Xt.weight=li),li&&li<1&&(ce*=li)&&(Xt.weight=1),Xt.opacity=ce,A["stroke-linejoin"]&&(Xt.joinstyle=A["stroke-linejoin"]||"miter"),Xt.miterlimit=A["stroke-miterlimit"]||8,A["stroke-linecap"]&&(Xt.endcap=A["stroke-linecap"]=="butt"?"flat":A["stroke-linecap"]=="square"?"square":"round"),"stroke-dasharray"in A){var on={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};Xt.dashstyle=on[h](A["stroke-dasharray"])?on[A["stroke-dasharray"]]:_}Ee&&B.appendChild(Xt)}if(X.type=="text"){X.paper.canvas.style.display=_;var Qe=X.paper.span,Ri=j.font&&j.font.match(/\d+(?:\.\d*)?(?=px)/);W=Qe.style,j.font&&(W.font=j.font),j["font-family"]&&(W.fontFamily=j["font-family"]),j["font-weight"]&&(W.fontWeight=j["font-weight"]),j["font-style"]&&(W.fontStyle=j["font-style"]),Ri=c(j["font-size"]||Ri&&Ri[0])||10,W.fontSize=100*Ri+"px",X.textpath.string&&(Qe.innerHTML=l(X.textpath.string).replace(/</g,"&#60;").replace(/&/g,"&#38;").replace(/\n/g,"<br>"));var Di=Qe.getBoundingClientRect();X.W=j.w=(Di.right-Di.left)/100,X.H=j.h=(Di.bottom-Di.top)/100,X.X=j.x,X.Y=j.y+X.H/2,("x"in A||"y"in A)&&(X.path.v=o.format("m{0},{1}l{2},{1}",f(j.x*$),f(j.y*$),f(j.x*$)+1));for(var ci=["x","y","text","font","font-family","font-weight","font-style","font-size"],ui=0,dr=ci.length;ui<dr;ui++)if(ci[ui]in A){X._.dirty=1;break}switch(j["text-anchor"]){case"start":X.textpath.style["v-text-align"]="left",X.bbx=X.W/2;break;case"end":X.textpath.style["v-text-align"]="right",X.bbx=-X.W/2;break;default:X.textpath.style["v-text-align"]="center",X.bbx=0}X.textpath.style["v-text-kern"]=!0}},_t=function(D,A,B){D.attrs=D.attrs||{},D.attrs;var j=Math.pow,W="linear",N=".5 .5";if(D.attrs.gradient=A,A=(A=l(A).replace(o._radial_gradient,function(bt,Tt,yt){return W="radial",Tt&&yt&&(Tt=c(Tt),yt=c(yt),j(Tt-.5,2)+j(yt-.5,2)>.25&&(yt=d.sqrt(.25-j(Tt-.5,2))*(2*(yt>.5)-1)+.5),N=Tt+E+yt),_})).split(/\s*\-\s*/),W=="linear"){var Y=A.shift();if(Y=-c(Y),isNaN(Y))return null}var X=o._parseDots(A);if(!X)return null;if(D=D.shape||D.node,X.length){D.removeChild(B),B.on=!0,B.method="none",B.color=X[0].color,B.color2=X[X.length-1].color;for(var et=[],ht=0,mt=X.length;ht<mt;ht++)X[ht].offset&&et.push(X[ht].offset+E+X[ht].color);B.colors=et.length?et.join():"0% "+B.color,W=="radial"?(B.type="gradientTitle",B.focus="100%",B.focussize="0 0",B.focusposition=N,B.angle=0):(B.type="gradient",B.angle=(270-Y)%360),D.appendChild(B)}return 1},pt=function(D,A){this[0]=this.node=D,D.raphael=!0,this.id=o._oid++,D.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=A,this.matrix=o.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!A.bottom&&(A.bottom=this),this.prev=A.top,A.top&&(A.top.next=this),A.top=this,this.next=null},nt=o.el;pt.prototype=nt,nt.constructor=pt,nt.transform=function(D){if(D==null)return this._.transform;var A,B=this.paper._viewBoxShift,j=B?"s"+[B.scale,B.scale]+"-1-1t"+[B.dx,B.dy]:_;B&&(A=D=l(D).replace(/\.{3}|\u2026/g,this._.transform||_)),o._extractTransform(this,j+D);var W,N=this.matrix.clone(),Y=this.skew,X=this.node,et=~l(this.attrs.fill).indexOf("-"),ht=!l(this.attrs.fill).indexOf("url(");if(N.translate(1,1),ht||et||this.type=="image")if(Y.matrix="1 0 0 1",Y.offset="0 0",W=N.split(),et&&W.noRotation||!W.isSimple){X.style.filter=N.toFilter();var mt=this.getBBox(),bt=this.getBBox(1),Tt=mt.x-bt.x,yt=mt.y-bt.y;X.coordorigin=Tt*-$+E+yt*-$,K(this,1,1,Tt,yt,0)}else X.style.filter=_,K(this,W.scalex,W.scaley,W.dx,W.dy,W.rotate);else X.style.filter=_,Y.matrix=l(N),Y.offset=N.offset();return A!==null&&(this._.transform=A,o._extractTransform(this,A)),this},nt.rotate=function(D,A,B){if(this.removed)return this;if(D!=null){if((D=l(D).split(b)).length-1&&(A=c(D[1]),B=c(D[2])),D=c(D[0]),B==null&&(A=B),A==null||B==null){var j=this.getBBox(1);A=j.x+j.width/2,B=j.y+j.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",D,A,B]])),this}},nt.translate=function(D,A){return this.removed?this:((D=l(D).split(b)).length-1&&(A=c(D[1])),D=c(D[0])||0,A=+A||0,this._.bbox&&(this._.bbox.x+=D,this._.bbox.y+=A),this.transform(this._.transform.concat([["t",D,A]])),this)},nt.scale=function(D,A,B,j){if(this.removed)return this;if((D=l(D).split(b)).length-1&&(A=c(D[1]),B=c(D[2]),j=c(D[3]),isNaN(B)&&(B=null),isNaN(j)&&(j=null)),D=c(D[0]),A==null&&(A=D),j==null&&(B=j),B==null||j==null)var W=this.getBBox(1);return B=B??W.x+W.width/2,j=j??W.y+W.height/2,this.transform(this._.transform.concat([["s",D,A,B,j]])),this._.dirtyT=1,this},nt.hide=function(){return!this.removed&&(this.node.style.display="none"),this},nt.show=function(){return!this.removed&&(this.node.style.display=_),this},nt.auxGetBBox=o.el.getBBox,nt.getBBox=function(){var D=this.auxGetBBox();if(this.paper&&this.paper._viewBoxShift){var A={},B=1/this.paper._viewBoxShift.scale;return A.x=D.x-this.paper._viewBoxShift.dx,A.x*=B,A.y=D.y-this.paper._viewBoxShift.dy,A.y*=B,A.width=D.width*B,A.height=D.height*B,A.x2=A.x+A.width,A.y2=A.y+A.height,A}return D},nt._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},nt.remove=function(){if(!this.removed&&this.node.parentNode){for(var D in this.paper.__set__&&this.paper.__set__.exclude(this),o.eve.unbind("raphael.*.*."+this.id),o._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape),this)this[D]=typeof this[D]=="function"?o._removedFactory(D):null;this.removed=!0}},nt.attr=function(D,A){if(this.removed)return this;if(D==null){var B={};for(var j in this.attrs)this.attrs[h](j)&&(B[j]=this.attrs[j]);return B.gradient&&B.fill=="none"&&(B.fill=B.gradient)&&delete B.gradient,B.transform=this._.transform,B}if(A==null&&o.is(D,"string")){if(D=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;for(var W=D.split(b),N={},Y=0,X=W.length;Y<X;Y++)(D=W[Y])in this.attrs?N[D]=this.attrs[D]:o.is(this.paper.customAttributes[D],"function")?N[D]=this.paper.customAttributes[D].def:N[D]=o._availableAttrs[D];return X-1?N:N[W[0]]}if(this.attrs&&A==null&&o.is(D,"array")){for(N={},Y=0,X=D.length;Y<X;Y++)N[D[Y]]=this.attr(D[Y]);return N}var et;for(var ht in A!=null&&((et={})[D]=A),A==null&&o.is(D,"object")&&(et=D),et)S("raphael.attr."+ht+"."+this.id,this,et[ht]);if(et){for(ht in this.paper.customAttributes)if(this.paper.customAttributes[h](ht)&&et[h](ht)&&o.is(this.paper.customAttributes[ht],"function")){var mt=this.paper.customAttributes[ht].apply(this,[].concat(et[ht]));for(var bt in this.attrs[ht]=et[ht],mt)mt[h](bt)&&(et[bt]=mt[bt])}et.text&&this.type=="text"&&(this.textpath.string=et.text),vt(this,et)}return this},nt.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&o._tofront(this,this.paper),this},nt.toBack=function(){return this.removed?this:(this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),o._toback(this,this.paper)),this)},nt.insertAfter=function(D){return this.removed?this:(D.constructor==o.st.constructor&&(D=D[D.length-1]),D.node.nextSibling?D.node.parentNode.insertBefore(this.node,D.node.nextSibling):D.node.parentNode.appendChild(this.node),o._insertafter(this,D,this.paper),this)},nt.insertBefore=function(D){return this.removed?this:(D.constructor==o.st.constructor&&(D=D[0]),D.node.parentNode.insertBefore(this.node,D.node),o._insertbefore(this,D,this.paper),this)},nt.blur=function(D){var A=this.node.runtimeStyle,B=A.filter;return B=B.replace(R,_),+D!=0?(this.attrs.blur=D,A.filter=B+E+" progid:DXImageTransform.Microsoft.Blur(pixelradius="+(+D||1.5)+")",A.margin=o.format("-{0}px 0 0 -{0}px",f(+D||1.5))):(A.filter=B,A.margin=0,delete this.attrs.blur),this},o._engine.path=function(D,A){var B=Z("shape");B.style.cssText=L,B.coordsize=$+E+$,B.coordorigin=A.coordorigin;var j=new pt(B,A),W={fill:"none",stroke:"#000"};D&&(W.path=D),j.type="path",j.path=[],j.Path=_,vt(j,W),A.canvas&&A.canvas.appendChild(B);var N=Z("skew");return N.on=!0,B.appendChild(N),j.skew=N,j.transform(_),j},o._engine.rect=function(D,A,B,j,W,N){var Y=o._rectPath(A,B,j,W,N),X=D.path(Y),et=X.attrs;return X.X=et.x=A,X.Y=et.y=B,X.W=et.width=j,X.H=et.height=W,et.r=N,et.path=Y,X.type="rect",X},o._engine.ellipse=function(D,A,B,j,W){var N=D.path();return N.attrs,N.X=A-j,N.Y=B-W,N.W=2*j,N.H=2*W,N.type="ellipse",vt(N,{cx:A,cy:B,rx:j,ry:W}),N},o._engine.circle=function(D,A,B,j){var W=D.path();return W.attrs,W.X=A-j,W.Y=B-j,W.W=W.H=2*j,W.type="circle",vt(W,{cx:A,cy:B,r:j}),W},o._engine.image=function(D,A,B,j,W,N){var Y=o._rectPath(B,j,W,N),X=D.path(Y).attr({stroke:"none"}),et=X.attrs,ht=X.node,mt=ht.getElementsByTagName("fill")[0];return et.src=A,X.X=et.x=B,X.Y=et.y=j,X.W=et.width=W,X.H=et.height=N,et.path=Y,X.type="image",mt.parentNode==ht&&ht.removeChild(mt),mt.rotate=!0,mt.src=A,mt.type="tile",X._.fillpos=[B,j],X._.fillsize=[W,N],ht.appendChild(mt),K(X,1,1,0,0,0),X},o._engine.text=function(D,A,B,j){var W=Z("shape"),N=Z("path"),Y=Z("textpath");A=A||0,B=B||0,j=j||"",N.v=o.format("m{0},{1}l{2},{1}",f(A*$),f(B*$),f(A*$)+1),N.textpathok=!0,Y.string=l(j),Y.on=!0,W.style.cssText=L,W.coordsize=$+E+$,W.coordorigin="0 0";var X=new pt(W,D),et={fill:"#000",stroke:"none",font:o._availableAttrs.font,text:j};X.shape=W,X.path=N,X.textpath=Y,X.type="text",X.attrs.text=l(j),X.attrs.x=A,X.attrs.y=B,X.attrs.w=1,X.attrs.h=1,vt(X,et),W.appendChild(Y),W.appendChild(N),D.canvas.appendChild(W);var ht=Z("skew");return ht.on=!0,W.appendChild(ht),X.skew=ht,X.transform(_),X},o._engine.setSize=function(D,A){var B=this.canvas.style;return this.width=D,this.height=A,D==+D&&(D+="px"),A==+A&&(A+="px"),B.width=D,B.height=A,B.clip="rect(0 "+D+" "+A+" 0)",this._viewBox&&o._engine.setViewBox.apply(this,this._viewBox),this},o._engine.setViewBox=function(D,A,B,j,W){o.eve("raphael.setViewBox",this,this._viewBox,[D,A,B,j,W]);var N,Y,X=this.getSize(),et=X.width,ht=X.height;return W&&(B*(N=ht/j)<et&&(D-=(et-B*N)/2/N),j*(Y=et/B)<ht&&(A-=(ht-j*Y)/2/Y)),this._viewBox=[D,A,B,j,!!W],this._viewBoxShift={dx:-D,dy:-A,scale:X},this.forEach(function(mt){mt.transform("...")}),this},o._engine.initWin=function(D){var A=D.document;A.styleSheets.length<31?A.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"):A.styleSheets[0].addRule(".rvml","behavior:url(#default#VML)");try{!A.namespaces.rvml&&A.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),Z=function(B){return A.createElement("<rvml:"+B+' class="rvml">')}}catch{Z=function(j){return A.createElement("<"+j+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},o._engine.initWin(o._g.win),o._engine.create=function(){var D=o._getContainer.apply(0,arguments),A=D.container,B=D.height,j=D.width,W=D.x,N=D.y;if(!A)throw new Error("VML container not found.");var Y=new o._Paper,X=Y.canvas=o._g.doc.createElement("div"),et=X.style;return W=W||0,N=N||0,j=j||512,B=B||342,Y.width=j,Y.height=B,j==+j&&(j+="px"),B==+B&&(B+="px"),Y.coordsize=216e5+E+216e5,Y.coordorigin="0 0",Y.span=o._g.doc.createElement("span"),Y.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",X.appendChild(Y.span),et.cssText=o.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",j,B),A==1?(o._g.doc.body.appendChild(X),et.left=W+"px",et.top=N+"px",et.position="absolute"):A.firstChild?A.insertBefore(X,A.firstChild):A.appendChild(X),Y.renderfix=function(){},Y},o.prototype.clear=function(){o.eve("raphael.clear",this),this.canvas.innerHTML=_,this.span=o._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},o.prototype.remove=function(){for(var D in o.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas),this)this[D]=typeof this[D]=="function"?o._removedFactory(D):null;return!0};var J=o.st;for(var I in nt)nt[h](I)&&!J[h](I)&&(J[I]=function(D){return function(){var A=arguments;return this.forEach(function(B){B[D].apply(B,A)})}}(I))}}.apply(i,s))===void 0||(e.exports=a)}])})})(Vc);var rp=Vc.exports;const be=Pe(rp);class Ir{points;constructor(t=[]){this.points=t}toSVGPathData(){const t=[];for(let e=0,i=this.length;e<i;e++)t.push([e===0?"M":"L",this.points[e].x,this.points[e].y]);return t}toSVGPathD(){let t="";for(let e=0,i=this.length;e<i;e++)t+=(e===0?"M":"L")+this.points[e].x+","+this.points[e].y;return t}get length(){return this.points.length}addPoint(t){this.points.push(t)}getPoint(t){return this.points[t]}isContainPoint(t){const e=t.x,i=t.y,r=this.length;let s=!1;const a=2e-10;for(let o=0,h=r-1;o<r;h=o,o++){const l=this.points[o].x,c=this.points[o].y,d=this.points[h].x,f=this.points[h].y;if(l===e&&c===i||d===e&&f===i||i===c&&i===f)return!0;if(i>=c&&i<f||i<c&&i>=f){const u=(d-l)/(f-c),m=l+u*(i-c);if(m===e||Math.abs(m-e)<a)return!0;m>e&&(s=!s)}}return s}[Symbol.iterator](){let t=0;return{next:()=>({value:t>=this.length-1?this.points[++t]:void 0,done:t>=this.length})}}static generateInMultiplePoint(t,e,i,r,s=1){const a=new Ir;for(let o=0;o<=s*i;o+=1){const h=Math.floor(o/s)/i*2*Math.PI,l=t+Math.cos(h)*r,c=e+Math.sin(h)*r;a.addPoint(new Wt({x:l,y:c}))}return a}}be.easing_formulas.swing=function(n){return n+Math.sin(n*Math.PI*2)/2},be.easing_formulas.may_cause_seizures=function(n){return n+.2*Math.random()-.1};function sp(n,t,e){let i;return n&&typeof n=="object"&&n.canvas?i=n:n&&(typeof n=="string"||n instanceof HTMLElement)?i=be(n,t,e):i=be(0,0,t,e),i}be.fn.importSVG=function(n,t){const e=op.fromRawSVG(n);return e.toRaphael(this,(i,r)=>{e.save(),t&&t(i),r(),e.restore()}),this},be.fn.NPolygonPath=function(n,t,e,i,r=2){return{shape:this.path(Ir.generateInMultiplePoint(n,t,e,i,r).toSVGPathD()),afterPath:Ir.generateInMultiplePoint(n,t,e*r,i,1).toSVGPathD()}},be.fn.zoom=function(n=1){return this.setViewBox(0,0,this.width/n,this.height/n),this},be.fn.brickwall=function(n,t,e,i,r){for(var s=i/r,a=e/3,o={fill:"firebrick",stroke:"#CCC"},h=0;h<r;h+=1){var l=this.rect(0,0,a,s).attr(o),c=this.rect(0,0,2*a,s).attr(o);h%2?(l.transform("T"+n+","+(t+h*s)),c.transform("T"+(n+a)+","+(t+h*s))):(c.transform("T"+n+","+(t+h*s)),l.transform("T"+(n+2*a)+","+(t+h*s)))}},be.fn.rosetta=function(n,t,e,i,r){const s=mn.generateRosetta(n,t,e,i,r);return s.center,this.path(s.toSVGPathD())},be.fn.moon=function(n){n=n||{},n.r=typeof n.r=="number"?n.r:100,n.phase=typeof n.phase=="number"?n.phase:.25,n.x=typeof n.x=="number"?n.x:0,n.y=typeof n.y=="number"?n.y:0,this.circle(n.r+n.x,n.r+n.y,n.r).attr({"stroke-width":0,fill:"#999"});function t(i){i=typeof i=="number"?i:.25,i=Math.max(0,Math.min(1,i)),i=(i-.5)*2;let r="M"+n.r+",0";r+="a"+n.r+","+n.r+" 0 0,0 0,"+n.r*2;let s=i>0?0:1;return i=Math.abs(i),i=i||1e-4,n.inner_r=n.r/Math.pow(i,.5),r+="M"+n.r+","+n.r*2,r+="a"+n.inner_r+","+n.inner_r+" 0 0,"+s+" 0,"+n.r*-2,r}var e=this.path(t(n.phase)).attr({"stroke-width":0,stroke:"#999",fill:"#FF9"}).transform("T"+n.x+","+n.y);return{setPhase:function(i){e.attr("path",t(i))}}},be.fn.star=function(n,t,e){let i="M"+n+","+(t-e);for(var r=0;r<6;r+=1){const s=270+r*144,a=n+e*Math.cos(s*Math.PI/180),o=t+e*Math.sin(s*Math.PI/180);i+="L"+a+","+o}return this.path(i).attr("stroke-width",0).attr("fill","red")},be.fn.heart=function(n=150,t=300){let e="M"+n+","+t;return e+="l120,-175a50,50 0 0,0 -120,-75a50,50 0 0,0 -120,75l120,175",this.path(e).attr("stroke","red").attr("fill","pink")},be.el.redder=function(){const n=be.getRGB(this.attr("fill"));n.r+=51,this.attr("fill","rgb("+n.r+","+n.g+","+n.b+")")},be.installCustomAttributes=function(n){n.customAttributes.redness=function(t){const e=255*(1-t/100);return{fill:"rgb(255,"+e+", "+e+")"}},n.customAttributes.progress=function(t){const e=this.data("progresspath"),i=this.attr(),r={x:0,y:0},s=this.data("progresstrail");if(!e)return{transform:"t0,0"};Object.prototype.hasOwnProperty.call(i,"width")&&(r.x=-this.attr("width")/2,r.y=-this.attr("height")/2);const a=e.getTotalLength(),o=e.getPointAtLength(t*a);return s&&s.attr("path",e.getSubpath(0,t*a)),{transform:"t"+(o.x+r.x)+","+(o.y+r.y)+"r"+o.alpha}}};const qo=be;class Vi{pgs=[];history=[];save(){this.history.push(Nl(this.pgs))}restore(){const t=this.history.pop();t&&(this.pgs=t)}get size(){let t=0,e=0;return this.pgs.forEach(i=>{const r=i.pg;if(r){const[s,a,o,h]=r.bounds,[l,c]=r.size;t=Math.max(t,s,s+l,o),e=Math.max(e,a,a+c,h)}}),[Math.ceil(t),Math.ceil(e)]}static fromRawSVG(t){return Vi.fromRawSVGUseRappar(t)}static fromRawSVGUseRappar(t){const e=new Vi,i=Uc(t);for(let r=0,s=i.length;r<s;r++){const a=i[r];if(a.type=="viewbox"&&a.width&&a.height)continue;const o={attrs:{}};for(const h in a)h==="type"||h==="path"||h==="transform"||(o.attrs[h]=a[h]);switch(a.type){case"path":o.d=a.path,o.pg=mn.fromSVGPathD(a.path,a.transform);break}e.pgs.push(o)}return e}toRaphael(t,e){let i;t instanceof HTMLElement?i=qo(HTMLElement):typeof t=="string"?i=qo(document.getElementById(t)):i=t;const[r,s]=this.size;i.setSize(r,s);const a=(o=!1)=>{for(let h=0,l=this.pgs.length;h<l;h++){const c=this.pgs[h];if(c.pg&&(c.raphaelPath?c.raphaelPath.attr("path",c.pg.toSVGPathD()):c.raphaelPath=i.path(c.pg.toSVGPathD()),c.raphaelPath.attr(c.attrs)),o&&e){const d=f=>{const{x:u,y:m}=ze(i.canvas,f),v=this.pgs.find(b=>b.raphaelPath?.isPointInside(u,m));v&&e?.(v,a)};c.raphaelPath?.unclick(d),c.raphaelPath?.click(d)}}};return a(!0),i}toCanvasOperation(t,e){let i;typeof t=="string"?i=document.getElementById(t):i=t;const[r,s]=this.size;i.width=r,i.height=s;const a=new Wo(i),o=()=>{a.clearRect(0,0,r,s);for(let l=0,c=this.pgs.length;l<c;l++){const d=this.pgs[l];d.pg&&(a.save(),this.toCanvasAttrs(a,d.attrs),d.pg.toCanvas(a),d.attrs.stroke!=="none"&&a.stroke(),d.attrs.fill!=="none"&&a.fill(),a.restore())}};o();const h=l=>{const{x:c,y:d}=ze(a.canvas,l),f=this.pgs.find(u=>u.pg?.isPointInPath(c,d));f&&e?.(f,o)};return i.removeEventListener("click",h),i.addEventListener("click",h),a}toCanvasAttrs(t,e){for(const i in e){const r=e[i];switch(i){case"fill":t.fillStyle=String(r);break;case"stroke":t.strokeStyle=String(r);break;case"stroke-width":t.lineWidth=Number(r);break;case"stroke-linecap":t.lineCap=r;break;case"stroke-linejoin":t.lineJoin=r;break}}}static toDownloadSVGElement(t,e="shape"){To(tc(t),`${e}.svg`)}toDownloadSVGElement(t,e="shape"){return Vi.toDownloadSVGElement(t,e),this}static toDownloadSVGString(t,e="shape"){To(Co(t),`${e}.svg`)}toDownloadSVGString(t,e="shape"){return Vi.toDownloadSVGString(t,e),this}static getSVGDOM(t){if(t instanceof HTMLObjectElement||t instanceof HTMLIFrameElement)return t.contentDocument;if(t instanceof HTMLEmbedElement)return t.getSVGDocument()}}const op=Vi;class Wo{canvas;context;customContext;constructor(t){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),this.customContext=new Lr({canvas:this.canvas,width:this.canvas.width,height:this.canvas.height})}set lineWidth(t){this.context.lineWidth=t,this.customContext.lineWidth=t}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.context.lineCap=t,this.customContext.lineCap=t}get lineCap(){return this.context.lineCap}set lineJoin(t){this.context.lineJoin=t,this.customContext.lineCap=t}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.context.lineDashOffset=t,this.customContext.lineDashOffset=t}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.context.miterLimit=t,this.customContext.miterLimit=t}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext.globalAlpha=t}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext.fillStyle=t):(this.context.fillStyle=t.gradient,this.customContext.fillStyle=t.gradientCustom)}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext.strokeStyle=t):(this.context.strokeStyle=t.gradient,this.customContext.strokeStyle=t.gradientCustom)}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext.font=t}get font(){return this.context.font}fill(){return this.context.fill(),this.customContext.fill(),this}fillRect(t,e,i,r){return this.context.fillRect(t,e,i,r),this.customContext.fillRect(t,e,i,r),this}fillText(t,e,i,r){return this.context.fillText(t,e,i,r),this.customContext.fillText(t,e,i),this}setLineDash(t){return this.context.setLineDash(t),this.customContext.setLineDash(t),this}stroke(){return this.context.stroke(),this.customContext.stroke(),this}strokeText(t,e,i,r){return this.context.strokeText(t,e,i,r),this.customContext.strokeText(t,e,i),this}strokeRect(t,e,i,r){return this.context.strokeRect(t,e,i,r),this.customContext.strokeRect(t,e,i,r),this}clearRect(t=0,e=0,i=this.canvas.width,r=this.canvas.height){return this.context.clearRect(t,e,i,r),this.customContext.clearRect(t,e,i,r),this}save(){return this.context.save(),this.customContext.save(),this}restore(){return this.context.restore(),this.customContext.restore(),this}beginPath(){return this.context.beginPath(),this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext.closePath(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext.lineTo(t,e),this}arc(t,e,i,r,s,a){return this.context.arc(t,e,i,r,s,a),this.customContext.arc(t,e,i,r,s,a?-1:1),this}arcTo(t,e,i,r,s){return this.context.arcTo(t,e,i,r,s),this.customContext.arcTo(t,e,i,r,s),this}quadraticCurveTo(t,e,i,r){return this.context.quadraticCurveTo(t,e,i,r),this.customContext.quadraticCurveTo(t,e,i,r),this}bezierCurveTo(t,e,i,r,s,a){return this.context.bezierCurveTo(t,e,i,r,s,a),this.customContext.bezierCurveTo(t,e,i,r,s,a),this}rect(t,e,i,r){return this.context.rect(t,e,i,r),this.customContext.rect(t,e,i,r),this}translate(t,e){return this.context.translate(t,e),this.customContext.translate(t,e),this}rotate(t){return this.context.rotate(t),this.customContext.rotate(t),this}scale(t,e){return this.context.scale(t,e),this.customContext.scale(t,e),this}createLinearGradient(t,e,i,r,s){const a=this.context.createLinearGradient(t,e,i,r),o=this.customContext.createLinearGradient(t,e,i,r);return s&&Object.keys(s).forEach(h=>{const l=parseFloat(h);a.addColorStop(l,s[l]),o.addColorStop(l,s[l])}),{gradient:a,gradientCustom:o}}createRadialGradient(t,e,i,r,s,a,o){const h=this.context.createRadialGradient(t,e,i,r,s,a),l=this.customContext.createRadialGradient(t,e,i,r,s,a);return o&&Object.keys(o).forEach(c=>{const d=parseFloat(c);h.addColorStop(d,o[d]),l.addColorStop(d,o[d])}),{gradient:h,gradientCustom:l}}drawImage(t,e=0,i=0){return this.context.drawImage(t,e,i),this.customContext.drawImage(t,e,i),this}getImageData(t,e,i,r,s){return this.context.getImageData(t,e,i,r,s)}putImageData(t,e=0,i=0){return this.context.putImageData(t,e,i)}toRawSVG(){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}toSVGOperation(){const{raw:t}=this.toRawSVG();return Vi.fromRawSVG(t)}}(function(){let n=0;window.requestAnimationFrame||(window.requestAnimationFrame=function(t){const e=new Date().getTime(),i=Math.max(0,16-(e-n)),r=window.setTimeout(function(){t(e+i)},i);return n=e+i,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})})();const Ko=n=>{window.requestAnimationFrame(function t(e){const i=window.requestAnimationFrame(t);n(e,i)})};class hp extends Zl{container;ctx;config;mouse;keyboard;resizeObserver;installedPlugins=new Map;animateFrameID;constructor(t,e={}){super(),this.container=t,this.ctx=new Wo(this.container),this.config=Gl(e,Ag),t instanceof HTMLCanvasElement&&(this.config.width=t.width,this.config.height=t.height),this.resizeObserver=new ResizeObserver(i=>{const{width:r,height:s}=i[0].contentRect;this.emit("resizeRoot",r,s)}),this.resizeObserver.observe(this.container),this.mouse=new Dg(this),this.keyboard=new Lg(this)}renderFrame(t){Ko((e,i)=>{this.animateFrameID=i,t(this)})}destroyFrame(){typeof this.animateFrameID<"u"&&window.cancelAnimationFrame(this.animateFrameID)}destroy(){this.removeAllListeners(),this.destroyPlugin(Array.from(this.installedPlugins.keys())),this.resizeObserver.disconnect(),this.mouse?.destroy(),this.keyboard?.destroy(),this.destroyFrame()}drawMouseMoveLine(t={}){switch(t.type){case"brush":t.typeOptions=t.typeOptions||{brush_size:10,brush_density:50,brush_color:"#000000"};const e=this.ctx.getImageData(0,0,this.config.width,this.config.height),i=e.data,r=ya(t.typeOptions.brush_color);let s=!1;this.on("mouseDown",()=>{s=!0}),this.on("mouseUp",()=>{s=!1}),this.on("mouseMove",()=>{if(s){for(let a=0;a<t.typeOptions.brush_density;a++){const o=Math.random()*Math.PI*2,h=Math.random()*t.typeOptions.brush_size,l=this.mouse.point.x+Math.cos(o)*h|0,c=this.mouse.point.y+Math.sin(o)*h|0,d=(l+c*e.width)*4;i[d]=r>>16&255,i[d+1]=r>>8&255,i[d+2]=r&255,i[d+3]=255}this.ctx.putImageData(e)}});break;case"line":default:this.on("mouseDown",()=>{this.ctx.beginPath(),this.ctx.moveTo(this.mouse.point.x,this.mouse.point.y)}),this.on("mouseMove",()=>{this.ctx.lineTo(this.mouse.point.x,this.mouse.point.y),t.extra?.(this),this.ctx.stroke()}),this.on("mouseUp",()=>{this.ctx.closePath()})}}use(t,...e){return this.installedPlugins.has(t.name)||(this.installedPlugins.set(t.name,t),t.install(this,...e)),this}getPlugin(t){return this.installedPlugins.get(t)}getPlugins(t){return t.map(e=>this.getPlugin(e))}enablePlugin(t){return Array.isArray(t)||(t=[t]),this.getPlugins(t)?.forEach(i=>i?.enable?.()),this}disablePlugin(t){return Array.isArray(t)||(t=[t]),this.getPlugins(t)?.forEach(i=>i?.disable?.()),this}destroyPlugin(t){return Array.isArray(t)||(t=[t]),this.getPlugins(t)?.forEach(i=>i?.destroy()),this}isPluginEnable(t){return this.getPlugin(t)?.isEnabled?.()??!1}}const lp={safeAreaTop:It.getCSSVar("--safe-area-inset-top"),safeAreaRight:It.getCSSVar("--safe-area-inset-right"),safeAreaBottom:It.getCSSVar("--safe-area-inset-bottom"),safeAreaLeft:It.getCSSVar("--safe-area-inset-left"),colorPrimary:It.getCSSVar("--color-primary"),colorRed:It.getCSSVar("--color-red"),colorOrange:It.getCSSVar("--color-orange"),colorYellow:It.getCSSVar("--color-yellow"),colorGreen:It.getCSSVar("--color-green"),colorBlue:It.getCSSVar("--color-blue"),colorPurple:It.getCSSVar("--color-purple"),colorBlack:It.getCSSVar("--color-black"),colorGray0:It.getCSSVar("--color-gray-0"),colorGray3:It.getCSSVar("--color-gray-3"),colorGray6:It.getCSSVar("--color-gray-6"),colorGray9:It.getCSSVar("--color-gray-9"),colorGrayCC:It.getCSSVar("--color-gray-cc"),colorGrayDD:It.getCSSVar("--color-gray-dd"),colorGrayE6:It.getCSSVar("--color-gray-e6"),colorGrayEE:It.getCSSVar("--color-gray-ee"),colorGrayEF:It.getCSSVar("--color-gray-ef"),colorGrayF5:It.getCSSVar("--color-gray-f5"),colorGrayFF:It.getCSSVar("--color-gray-ff"),fontLineHeight:It.getCSSVar("--font-line-height"),fontSize32:It.getCSSVar("--font-size-32"),fontSize24:It.getCSSVar("--font-size-24"),fontSize20:It.getCSSVar("--font-size-20"),fontSize18:It.getCSSVar("--font-size-18"),fontSize16:It.getCSSVar("--font-size-16"),fontSize14:It.getCSSVar("--font-size-14"),fontSize12:It.getCSSVar("--font-size-12"),fontSize11:It.getCSSVar("--font-size-11"),gap4:It.getCSSVar("--gap-4"),gap8:It.getCSSVar("--gap-8"),gap12:It.getCSSVar("--gap-12"),gap16:It.getCSSVar("--gap-16"),gap20:It.getCSSVar("--gap-20"),gap40:It.getCSSVar("--gap-40"),height44:It.getCSSVar("--height-44"),height32:It.getCSSVar("--height-32"),borderRadius:It.getCSSVar("--border-radius")},cp=()=>Math.random()*16777215,up=()=>`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`,fp=()=>`#${(~~(Math.random()*(1<<24))).toString(16)}`,ya=function(n){return n[0]==="#"&&(n=n.slice(1)),parseInt(n,16)},Hc=function(n){let t="00000"+(n|0).toString(16);return t="#"+t.substring(t.length-6),t},jc=function(n,t=1){const e=n>>16&255,i=n>>8&255,r=n&255,s=t<0?0:t>1?1:t;return s===1?"rgb("+e+","+i+","+r+")":"rgba("+e+","+i+","+r+","+s+")"},Zo=function(n,t=1){const e=ya(n);return jc(e,t)},dp=n=>{const e=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(n);return e?"#"+((1<<24)+(parseInt(e[1])<<16)+(parseInt(e[2])<<8)+parseInt(e[3])).toString(16).slice(1):""};function gp(n,t){let e=parseInt(n.substring(1,3),16),i=parseInt(n.substring(3,5),16),r=parseInt(n.substring(5,7),16);e==0&&(e=32),i==0&&(i=32),r==0&&(r=32),e=e*(100+t)/100,i=i*(100+t)/100,r=r*(100+t)/100,e=e<255?e:255,i=i<255?i:255,r=r<255?r:255,e=Math.round(e),i=Math.round(i),r=Math.round(r);const s=e.toString(16).length==1?"0"+e.toString(16):e.toString(16),a=i.toString(16).length==1?"0"+i.toString(16):i.toString(16),o=r.toString(16).length==1?"0"+r.toString(16):r.toString(16);return"#"+s+a+o}function pp(n,t,e,i){let r,s,a;n=n/360,t=t/100,e=e/100;const o=Math.floor(n*6),h=n*6-o,l=e*(1-t),c=e*(1-h*t),d=e*(1-(1-h)*t);switch(o%6){case 0:r=e,s=d,a=l;break;case 1:r=c,s=e,a=l;break;case 2:r=l,s=e,a=d;break;case 3:r=l,s=c,a=e;break;case 4:r=d,s=l,a=e;break;case 5:default:r=e,s=l,a=c;break}return{r:Math.round(r*255),g:Math.round(s*255),b:Math.round(a*255),a:i??1}}function mp(n,t,e,i){const r=Math.max(n,t,e),s=Math.min(n,t,e),a=r-s,o=r===0?0:a/r,h=r/255;let l;switch(r){case s:l=0;break;case n:l=t-e+a*(t<e?6:0),l/=6*a;break;case t:l=e-n+a*2,l/=6*a;break;case e:default:l=n-t+a*4,l/=6*a;break}return{h:Math.round(l*360),s:Math.round(o*100),v:Math.round(h*100),a:i??1}}function vp(n){return btoa(encodeURIComponent(n)).replaceAll("+","*").replaceAll("/","-").replaceAll("=","")}function _p(n){let t=n.replaceAll("*","+").replaceAll("-","/");const e=t.length%4;return e&&(t=t.padEnd(t.length+(4-e),"=")),decodeURIComponent(atob(t))}function Jo(n=window.location.href){return na(URL)?new URL(n):Xc(n)}function Xc(n=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",i="(?<pathname>(?:\\/[^/#?]+)*\\/?)",r="(?<search>(?:\\?[^#]*)?)",s="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${i}${r}${s}$`).exec(n);return{href:n,protocol:o?.groups?.protocol??"",host:o?.groups?.host??"",hostname:o?.groups?.hostname??"",port:o?.groups?.port??"",pathname:o?.groups?.pathname??"",search:o?.groups?.search??"",hash:o?.groups?.hash??""}}function yp(n){const t=Jo(n);return t.protocol==="http:"||t.protocol==="https:"}function Yc(n=window.location.href){const t=Jo(n),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function wp(n=location.search){n=decodeURIComponent(n).replace(/^[#?&]/,"");const t={};if(!n)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let i=e.exec(n);for(;i;)t[i[1]]=i[2],i=e.exec(n);return t}function bp(n){return Array.from(new URLSearchParams(n)).reduce((t,[e,i])=>Object.assign({},t,{[e]:t[e]?(Array.isArray(t[e])?t[e]:[t[e]]).concat(i):i}),{})}function qc(n){let t="";for(const e in n)t&&(t+="&"),t+=`${e}=${n[e]}`;return t}function xp(n){return new URLSearchParams(n).toString()}function Qo(n){return"?"+[...n.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function wa(n,t){return n.indexOf("?")>=0?n+t.replace(/^\?/,"&"):n.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function Sp(n){let t="";new MutationObserver(function(i){window.location.href!==t&&(t=window.location.href,n&&n(location.href))}).observe(document,{attributes:!0,childList:!0,subtree:!0})}function Cp(n){window.addEventListener("hashchange",()=>{n(location.hash)})}function Tp(n){window.addEventListener("popstate",n,!1)}function kp(n){let t=null;if(pc)try{t=new Worker(URL.createObjectURL(new Blob([n])))}catch(e){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),null}return t}var Wc={exports:{}};(function(n){var t={};n.exports=t,t.parse=function(e,i){for(var r=t.bin.readUshort,s=t.bin.readUint,l=0,a={},o=new Uint8Array(e),h=o.length-4;s(o,h)!=101010256;)h--;var l=h;l+=4,l+=4;var c=r(o,l);l+=2,r(o,l),l+=2;var d=s(o,l);l+=4;var f=s(o,l);l+=4,l=f;for(var u=0;u<c;u++){s(o,l),l+=4,l+=4,l+=4,l+=4,s(o,l),l+=4;var d=s(o,l);l+=4;var m=s(o,l);l+=4;var v=r(o,l),b=r(o,l+2),S=r(o,l+4);l+=6,l+=8;var E=s(o,l);l+=4,l+=v+b+S,t._readLocal(o,E,a,d,m,i)}return a},t._readLocal=function(e,i,r,s,a,o){var h=t.bin.readUshort,l=t.bin.readUint;l(e,i),i+=4,h(e,i),i+=2,h(e,i),i+=2;var c=h(e,i);i+=2,l(e,i),i+=4,l(e,i),i+=4,i+=8;var d=h(e,i);i+=2;var f=h(e,i);i+=2;var u=t.bin.readUTF8(e,i,d);if(i+=d,i+=f,o){r[u]={size:a,csize:s};return}var m=new Uint8Array(e.buffer,i);if(c==0)r[u]=new Uint8Array(m.buffer.slice(i,i+s));else if(c==8){var v=new Uint8Array(a);t.inflateRaw(m,v),r[u]=v}else throw"unknown compression method: "+c},t.inflateRaw=function(e,i){return t.F.inflate(e,i)},t.inflate=function(e,i){return e[0],e[1],t.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),i)},t.deflate=function(e,i){i==null&&(i={level:6});var r=0,s=new Uint8Array(50+Math.floor(e.length*1.1));s[r]=120,s[r+1]=156,r+=2,r=t.F.deflateRaw(e,s,r,i.level);var a=t.adler(e,0,e.length);return s[r+0]=a>>>24&255,s[r+1]=a>>>16&255,s[r+2]=a>>>8&255,s[r+3]=a>>>0&255,new Uint8Array(s.buffer,0,r+4)},t.deflateRaw=function(e,i){i==null&&(i={level:6});var r=new Uint8Array(50+Math.floor(e.length*1.1)),s=t.F.deflateRaw(e,r,s,i.level);return new Uint8Array(r.buffer,0,s)},t.encode=function(e,i){i==null&&(i=!1);var r=0,s=t.bin.writeUint,a=t.bin.writeUshort,o={};for(var h in e){var l=!t._noNeed(h)&&!i,c=e[h],d=t.crc.crc(c,0,c.length);o[h]={cpr:l,usize:c.length,crc:d,file:l?t.deflateRaw(c):c}}for(var h in o)r+=o[h].file.length+30+46+2*t.bin.sizeUTF8(h);r+=22;var f=new Uint8Array(r),u=0,m=[];for(var h in o){var v=o[h];m.push(u),u=t._writeHeader(f,u,h,v,0)}var b=0,S=u;for(var h in o){var v=o[h];m.push(u),u=t._writeHeader(f,u,h,v,1,m[b++])}var E=u-S;return s(f,u,101010256),u+=4,u+=4,a(f,u,b),u+=2,a(f,u,b),u+=2,s(f,u,E),u+=4,s(f,u,S),u+=4,u+=2,f.buffer},t._noNeed=function(e){var i=e.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(i)!=-1},t._writeHeader=function(e,i,r,s,a,o){var h=t.bin.writeUint,l=t.bin.writeUshort,c=s.file;h(e,i,a==0?67324752:33639248),i+=4,a==1&&(i+=2),l(e,i,20),i+=2,l(e,i,0),i+=2,l(e,i,s.cpr?8:0),i+=2,h(e,i,0),i+=4,h(e,i,s.crc),i+=4,h(e,i,c.length),i+=4,h(e,i,s.usize),i+=4,l(e,i,t.bin.sizeUTF8(r)),i+=2,l(e,i,0),i+=2,a==1&&(i+=2,i+=2,i+=6,h(e,i,o),i+=4);var d=t.bin.writeUTF8(e,i,r);return i+=d,a==0&&(e.set(c,i),i+=c.length),i},t.crc={table:function(){for(var e=new Uint32Array(256),i=0;i<256;i++){for(var r=i,s=0;s<8;s++)r&1?r=3988292384^r>>>1:r=r>>>1;e[i]=r}return e}(),update:function(e,i,r,s){for(var a=0;a<s;a++)e=t.crc.table[(e^i[r+a])&255]^e>>>8;return e},crc:function(e,i,r){return t.crc.update(4294967295,e,i,r)^4294967295}},t.adler=function(e,i,r){for(var s=1,a=0,o=i,h=i+r;o<h;){for(var l=Math.min(o+5552,h);o<l;)s+=e[o++],a+=s;s=s%65521,a=a%65521}return a<<16|s},t.bin={readUshort:function(e,i){return e[i]|e[i+1]<<8},writeUshort:function(e,i,r){e[i]=r&255,e[i+1]=r>>8&255},readUint:function(e,i){return e[i+3]*16777216+(e[i+2]<<16|e[i+1]<<8|e[i])},writeUint:function(e,i,r){e[i]=r&255,e[i+1]=r>>8&255,e[i+2]=r>>16&255,e[i+3]=r>>24&255},readASCII:function(e,i,r){for(var s="",a=0;a<r;a++)s+=String.fromCharCode(e[i+a]);return s},writeASCII:function(e,i,r){for(var s=0;s<r.length;s++)e[i+s]=r.charCodeAt(s)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,i,r){for(var s="",a,o=0;o<r;o++)s+="%"+t.bin.pad(e[i+o].toString(16));try{a=decodeURIComponent(s)}catch{return t.bin.readASCII(e,i,r)}return a},writeUTF8:function(e,i,r){for(var s=r.length,a=0,o=0;o<s;o++){var h=r.charCodeAt(o);if(!(h&4294967168))e[i+a]=h,a++;else if(!(h&4294965248))e[i+a]=192|h>>6,e[i+a+1]=128|h>>0&63,a+=2;else if(!(h&4294901760))e[i+a]=224|h>>12,e[i+a+1]=128|h>>6&63,e[i+a+2]=128|h>>0&63,a+=3;else if(!(h&4292870144))e[i+a]=240|h>>18,e[i+a+1]=128|h>>12&63,e[i+a+2]=128|h>>6&63,e[i+a+3]=128|h>>0&63,a+=4;else throw"e"}return a},sizeUTF8:function(e){for(var i=e.length,r=0,s=0;s<i;s++){var a=e.charCodeAt(s);if(!(a&4294967168))r++;else if(!(a&4294965248))r+=2;else if(!(a&4294901760))r+=3;else if(!(a&4292870144))r+=4;else throw"e"}return r}},t.F={},t.F.deflateRaw=function(e,i,r,s){var a=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]],o=a[s],h=t.F.U,l=t.F._goodIndex;t.F._hash;var c=t.F._putsE,d=0,f=r<<3,u=0,m=e.length;if(s==0){for(;d<m;){var v=Math.min(65535,m-d);c(i,f,d+v==m?1:0),f=t.F._copyExact(e,d,v,i,f+8),d+=v}return f>>>3}var b=h.lits,S=h.strt,E=h.prev,_=0,x=0,P=0,R=0,F=0,L=0;for(m>2&&(L=t.F._hash(e,0),S[L]=0),d=0;d<m;d++){if(F=L,d+1<m-2){L=t.F._hash(e,d+1);var $=d+1&32767;E[$]=S[L],S[L]=$}if(u<=d){(_>14e3||x>26697)&&m-d>100&&(u<d&&(b[_]=d-u,_+=2,u=d),f=t.F._writeBlock(d==m-1||u==m?1:0,b,_,R,e,P,d-P,i,f),_=x=R=0,P=d);var U=0;d<m-2&&(U=t.F._bestMatch(e,d,E,F,Math.min(o[2],m-d),o[3]));var v=U>>>16,z=U&65535;if(U!=0){var v=U>>>16,z=U&65535,q=l(v,h.of0);h.lhst[257+q]++;var K=l(z,h.df0);h.dhst[K]++,R+=h.exb[q]+h.dxb[K],b[_]=v<<23|d-u,b[_+1]=z<<16|q<<8|K,_+=2,u=d+v}else h.lhst[e[d]]++;x++}}for((P!=d||e.length==0)&&(u<d&&(b[_]=d-u,_+=2,u=d),f=t.F._writeBlock(1,b,_,R,e,P,d-P,i,f),_=0,x=0,_=x=R=0,P=d);f&7;)f++;return f>>>3},t.F._bestMatch=function(e,i,r,s,a,o){var h=i&32767,l=r[h],c=h-l+32768&32767;if(l==h||s!=t.F._hash(e,i-c))return 0;for(var d=0,f=0,u=Math.min(32767,i);c<=u&&--o!=0&&l!=h;){if(d==0||e[i+d]==e[i+d-c]){var m=t.F._howLong(e,i,c);if(m>d){if(d=m,f=c,d>=a)break;c+2<m&&(m=c+2);for(var v=0,b=0;b<m-2;b++){var S=i-c+b+32768&32767,E=r[S],_=S-E+32768&32767;_>v&&(v=_,l=S)}}}h=l,l=r[h],c+=h-l+32768&32767}return d<<16|f},t.F._howLong=function(e,i,r){if(e[i]!=e[i-r]||e[i+1]!=e[i+1-r]||e[i+2]!=e[i+2-r])return 0;var s=i,a=Math.min(e.length,i+258);for(i+=3;i<a&&e[i]==e[i-r];)i++;return i-s},t.F._hash=function(e,i){return(e[i]<<8|e[i+1])+(e[i+2]<<4)&65535},t.saved=0,t.F._writeBlock=function(e,i,r,s,a,o,h,l,c){var d=t.F.U,f=t.F._putsF,u=t.F._putsE,m,v,b,S,E,_,x,P,R;d.lhst[256]++,m=t.F.getTrees(),v=m[0],b=m[1],S=m[2],E=m[3],_=m[4],x=m[5],P=m[6],R=m[7];var F=(c+3&7?8-(c+3&7):0)+32+(h<<3),L=s+t.F.contSize(d.fltree,d.lhst)+t.F.contSize(d.fdtree,d.dhst),$=s+t.F.contSize(d.ltree,d.lhst)+t.F.contSize(d.dtree,d.dhst);$+=14+3*x+t.F.contSize(d.itree,d.ihst)+(d.ihst[16]*2+d.ihst[17]*3+d.ihst[18]*7);for(var U=0;U<286;U++)d.lhst[U]=0;for(var U=0;U<30;U++)d.dhst[U]=0;for(var U=0;U<19;U++)d.ihst[U]=0;var z=F<L&&F<$?0:L<$?1:2;if(f(l,c,e),f(l,c+1,z),c+=3,z==0){for(;c&7;)c++;c=t.F._copyExact(a,o,h,l,c)}else{var q,K;if(z==1&&(q=d.fltree,K=d.fdtree),z==2){t.F.makeCodes(d.ltree,v),t.F.revCodes(d.ltree,v),t.F.makeCodes(d.dtree,b),t.F.revCodes(d.dtree,b),t.F.makeCodes(d.itree,S),t.F.revCodes(d.itree,S),q=d.ltree,K=d.dtree,u(l,c,E-257),c+=5,u(l,c,_-1),c+=5,u(l,c,x-4),c+=4;for(var Z=0;Z<x;Z++)u(l,c+Z*3,d.itree[(d.ordr[Z]<<1)+1]);c+=3*x,c=t.F._codeTiny(P,d.itree,l,c),c=t.F._codeTiny(R,d.itree,l,c)}for(var at=o,vt=0;vt<r;vt+=2){for(var _t=i[vt],pt=_t>>>23,nt=at+(_t&(1<<23)-1);at<nt;)c=t.F._writeLit(a[at++],q,l,c);if(pt!=0){var J=i[vt+1],I=J>>16,D=J>>8&255,A=J&255;c=t.F._writeLit(257+D,q,l,c),u(l,c,pt-d.of0[D]),c+=d.exb[D],c=t.F._writeLit(A,K,l,c),f(l,c,I-d.df0[A]),c+=d.dxb[A],at+=pt}}c=t.F._writeLit(256,q,l,c)}return c},t.F._copyExact=function(e,i,r,s,a){var o=a>>>3;return s[o]=r,s[o+1]=r>>>8,s[o+2]=255-s[o],s[o+3]=255-s[o+1],o+=4,s.set(new Uint8Array(e.buffer,i,r),o),a+(r+4<<3)},t.F.getTrees=function(){for(var e=t.F.U,i=t.F._hufTree(e.lhst,e.ltree,15),r=t.F._hufTree(e.dhst,e.dtree,15),s=[],a=t.F._lenCodes(e.ltree,s),o=[],h=t.F._lenCodes(e.dtree,o),l=0;l<s.length;l+=2)e.ihst[s[l]]++;for(var l=0;l<o.length;l+=2)e.ihst[o[l]]++;for(var c=t.F._hufTree(e.ihst,e.itree,7),d=19;d>4&&e.itree[(e.ordr[d-1]<<1)+1]==0;)d--;return[i,r,c,a,h,d,s,o]},t.F.getSecond=function(e){for(var i=[],r=0;r<e.length;r+=2)i.push(e[r+1]);return i},t.F.nonZero=function(e){for(var i="",r=0;r<e.length;r+=2)e[r+1]!=0&&(i+=(r>>1)+",");return i},t.F.contSize=function(e,i){for(var r=0,s=0;s<i.length;s++)r+=i[s]*e[(s<<1)+1];return r},t.F._codeTiny=function(e,i,r,s){for(var a=0;a<e.length;a+=2){var o=e[a],h=e[a+1];s=t.F._writeLit(o,i,r,s);var l=o==16?2:o==17?3:7;o>15&&(t.F._putsE(r,s,h,l),s+=l)}return s},t.F._lenCodes=function(e,i){for(var r=e.length;r!=2&&e[r-1]==0;)r-=2;for(var s=0;s<r;s+=2){var a=e[s+1],o=s+3<r?e[s+3]:-1,h=s+5<r?e[s+5]:-1,l=s==0?-1:e[s-1];if(a==0&&o==a&&h==a){for(var c=s+5;c+2<r&&e[c+2]==a;)c+=2;var d=Math.min(c+1-s>>>1,138);d<11?i.push(17,d-3):i.push(18,d-11),s+=d*2-2}else if(a==l&&o==a&&h==a){for(var c=s+5;c+2<r&&e[c+2]==a;)c+=2;var d=Math.min(c+1-s>>>1,6);i.push(16,d-3),s+=d*2-2}else i.push(a,0)}return r>>>1},t.F._hufTree=function(e,i,r){var s=[],a=e.length,o=i.length,h=0;for(h=0;h<o;h+=2)i[h]=0,i[h+1]=0;for(h=0;h<a;h++)e[h]!=0&&s.push({lit:h,f:e[h]});var l=s.length,c=s.slice(0);if(l==0)return 0;if(l==1){var d=s[0].lit,c=d==0?1:0;return i[(d<<1)+1]=1,i[(c<<1)+1]=1,1}s.sort(function(E,_){return E.f-_.f});var f=s[0],u=s[1],m=0,v=1,b=2;for(s[0]={lit:-1,f:f.f+u.f,l:f,r:u,d:0};v!=l-1;)m!=v&&(b==l||s[m].f<s[b].f)?f=s[m++]:f=s[b++],m!=v&&(b==l||s[m].f<s[b].f)?u=s[m++]:u=s[b++],s[v++]={lit:-1,f:f.f+u.f,l:f,r:u};var S=t.F.setDepth(s[v-1],0);for(S>r&&(t.F.restrictDepth(c,r,S),S=r),h=0;h<l;h++)i[(c[h].lit<<1)+1]=c[h].d;return S},t.F.setDepth=function(e,i){return e.lit!=-1?(e.d=i,i):Math.max(t.F.setDepth(e.l,i+1),t.F.setDepth(e.r,i+1))},t.F.restrictDepth=function(e,i,r){var s=0,a=1<<r-i,o=0;for(e.sort(function(l,c){return c.d==l.d?l.f-c.f:c.d-l.d}),s=0;s<e.length&&e[s].d>i;s++){var h=e[s].d;e[s].d=i,o+=a-(1<<r-h)}for(o=o>>>r-i;o>0;){var h=e[s].d;h<i?(e[s].d++,o-=1<<i-h-1):s++}for(;s>=0;s--)e[s].d==i&&o<0&&(e[s].d--,o++);o!=0&&console.log("debt left")},t.F._goodIndex=function(e,i){var r=0;return i[r|16]<=e&&(r|=16),i[r|8]<=e&&(r|=8),i[r|4]<=e&&(r|=4),i[r|2]<=e&&(r|=2),i[r|1]<=e&&(r|=1),r},t.F._writeLit=function(e,i,r,s){return t.F._putsF(r,s,i[e<<1]),s+i[(e<<1)+1]},t.F.inflate=function(e,i){var r=Uint8Array;if(e[0]==3&&e[1]==0)return i||new r(0);var s=t.F,a=s._bitsF,o=s._bitsE,h=s._decodeTiny,l=s.makeCodes,c=s.codes2map,d=s._get17,f=s.U,u=i==null;u&&(i=new r(e.length>>>2<<3));for(var m=0,v=0,b=0,S=0,E=0,_=0,x=0,P=0,R=0,F,L;m==0;){if(m=a(e,R,1),v=a(e,R+1,2),R+=3,v==0){R&7&&(R+=8-(R&7));var $=(R>>>3)+4,U=e[$-4]|e[$-3]<<8;u&&(i=t.F._check(i,P+U)),i.set(new r(e.buffer,e.byteOffset+$,U),P),R=$+U<<3,P+=U;continue}if(u&&(i=t.F._check(i,P+131072)),v==1&&(F=f.flmap,L=f.fdmap,_=511,x=31),v==2){b=o(e,R,5)+257,S=o(e,R+5,5)+1,E=o(e,R+10,4)+4,R+=14;for(var z=0;z<38;z+=2)f.itree[z]=0,f.itree[z+1]=0;for(var q=1,z=0;z<E;z++){var K=o(e,R+z*3,3);f.itree[(f.ordr[z]<<1)+1]=K,K>q&&(q=K)}R+=3*E,l(f.itree,q),c(f.itree,q,f.imap),F=f.lmap,L=f.dmap,R=h(f.imap,(1<<q)-1,b+S,e,R,f.ttree);var Z=s._copyOut(f.ttree,0,b,f.ltree);_=(1<<Z)-1;var at=s._copyOut(f.ttree,b,S,f.dtree);x=(1<<at)-1,l(f.ltree,Z),c(f.ltree,Z,F),l(f.dtree,at),c(f.dtree,at,L)}for(;;){var vt=F[d(e,R)&_];R+=vt&15;var _t=vt>>>4;if(!(_t>>>8))i[P++]=_t;else{if(_t==256)break;var pt=P+_t-254;if(_t>264){var nt=f.ldef[_t-257];pt=P+(nt>>>3)+o(e,R,nt&7),R+=nt&7}var J=L[d(e,R)&x];R+=J&15;var I=J>>>4,D=f.ddef[I],A=(D>>>4)+a(e,R,D&15);for(R+=D&15,u&&(i=t.F._check(i,P+131072));P<pt;)i[P]=i[P++-A],i[P]=i[P++-A],i[P]=i[P++-A],i[P]=i[P++-A];P=pt}}}return i.length==P?i:i.slice(0,P)},t.F._check=function(e,i){var r=e.length;if(i<=r)return e;var s=new Uint8Array(Math.max(r<<1,i));return s.set(e,0),s},t.F._decodeTiny=function(e,i,r,s,a,o){for(var h=t.F._bitsE,l=t.F._get17,c=0;c<r;){var d=e[l(s,a)&i];a+=d&15;var f=d>>>4;if(f<=15)o[c]=f,c++;else{var u=0,m=0;f==16?(m=3+h(s,a,2),a+=2,u=o[c-1]):f==17?(m=3+h(s,a,3),a+=3):f==18&&(m=11+h(s,a,7),a+=7);for(var v=c+m;c<v;)o[c]=u,c++}}return a},t.F._copyOut=function(e,i,r,s){for(var a=0,o=0,h=s.length>>>1;o<r;){var l=e[o+i];s[o<<1]=0,s[(o<<1)+1]=l,l>a&&(a=l),o++}for(;o<h;)s[o<<1]=0,s[(o<<1)+1]=0,o++;return a},t.F.makeCodes=function(e,i){for(var r=t.F.U,s=e.length,a,o,h,l,c,d=r.bl_count,l=0;l<=i;l++)d[l]=0;for(l=1;l<s;l+=2)d[e[l]]++;var f=r.next_code;for(a=0,d[0]=0,o=1;o<=i;o++)a=a+d[o-1]<<1,f[o]=a;for(h=0;h<s;h+=2)c=e[h+1],c!=0&&(e[h]=f[c],f[c]++)},t.F.codes2map=function(e,i,r){for(var s=e.length,a=t.F.U,o=a.rev15,h=0;h<s;h+=2)if(e[h+1]!=0)for(var l=h>>1,c=e[h+1],d=l<<4|c,f=i-c,u=e[h]<<f,m=u+(1<<f);u!=m;){var v=o[u]>>>15-i;r[v]=d,u++}},t.F.revCodes=function(e,i){for(var r=t.F.U.rev15,s=15-i,a=0;a<e.length;a+=2){var o=e[a]<<i-e[a+1];e[a]=r[o]>>>s}},t.F._putsE=function(e,i,r){r=r<<(i&7);var s=i>>>3;e[s]|=r,e[s+1]|=r>>>8},t.F._putsF=function(e,i,r){r=r<<(i&7);var s=i>>>3;e[s]|=r,e[s+1]|=r>>>8,e[s+2]|=r>>>16},t.F._bitsE=function(e,i,r){return(e[i>>>3]|e[(i>>>3)+1]<<8)>>>(i&7)&(1<<r)-1},t.F._bitsF=function(e,i,r){return(e[i>>>3]|e[(i>>>3)+1]<<8|e[(i>>>3)+2]<<16)>>>(i&7)&(1<<r)-1},t.F._get17=function(e,i){return(e[i>>>3]|e[(i>>>3)+1]<<8|e[(i>>>3)+2]<<16)>>>(i&7)},t.F._get25=function(e,i){return(e[i>>>3]|e[(i>>>3)+1]<<8|e[(i>>>3)+2]<<16|e[(i>>>3)+3]<<24)>>>(i&7)},t.F.U=function(){var e=Uint16Array,i=Uint32Array;return{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new i(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new i(286),dhst:new i(30),ihst:new i(19),lits:new i(15e3),strt:new e(65536),prev:new e(32768)}}(),function(){for(var e=t.F.U,i=32768,r=0;r<i;r++){var s=r;s=(s&2863311530)>>>1|(s&1431655765)<<1,s=(s&3435973836)>>>2|(s&858993459)<<2,s=(s&4042322160)>>>4|(s&252645135)<<4,s=(s&4278255360)>>>8|(s&16711935)<<8,e.rev15[r]=(s>>>16|s<<16)>>>17}function a(o,h,l){for(;h--!=0;)o.push(0,l)}for(var r=0;r<32;r++)e.ldef[r]=e.of0[r]<<3|e.exb[r],e.ddef[r]=e.df0[r]<<4|e.dxb[r];a(e.fltree,144,8),a(e.fltree,112,9),a(e.fltree,24,7),a(e.fltree,8,8),t.F.makeCodes(e.fltree,9),t.F.codes2map(e.fltree,9,e.flmap),t.F.revCodes(e.fltree,9),a(e.fdtree,32,5),t.F.makeCodes(e.fdtree,5),t.F.codes2map(e.fdtree,5,e.fdmap),t.F.revCodes(e.fdtree,5),a(e.itree,19,0),a(e.ltree,286,0),a(e.dtree,30,0),a(e.ttree,320,0)}()})(Wc);var Ep=Wc.exports;const Kc=Pe(Ep);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Pp=4,Zc=0,Jc=1,Ap=2;function Yn(n){let t=n.length;for(;--t>=0;)n[t]=0}const Mp=0,Qc=1,Rp=2,Dp=3,Lp=258,th=29,Or=256,Fr=Or+1+th,qn=30,eh=19,tu=2*Fr+1,vn=15,ih=16,Ip=7,nh=256,eu=16,iu=17,nu=18,rh=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),ba=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Op=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ru=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Fp=512,_i=new Array((Fr+2)*2);Yn(_i);const Nr=new Array(qn*2);Yn(Nr);const Gr=new Array(Fp);Yn(Gr);const Ur=new Array(Lp-Dp+1);Yn(Ur);const sh=new Array(th);Yn(sh);const xa=new Array(qn);Yn(xa);function ah(n,t,e,i,r){this.static_tree=n,this.extra_bits=t,this.extra_base=e,this.elems=i,this.max_length=r,this.has_stree=n&&n.length}let su,au,ou;function oh(n,t){this.dyn_tree=n,this.max_code=0,this.stat_desc=t}const hu=n=>n<256?Gr[n]:Gr[256+(n>>>7)],Br=(n,t)=>{n.pending_buf[n.pending++]=t&255,n.pending_buf[n.pending++]=t>>>8&255},Ae=(n,t,e)=>{n.bi_valid>ih-e?(n.bi_buf|=t<<n.bi_valid&65535,Br(n,n.bi_buf),n.bi_buf=t>>ih-n.bi_valid,n.bi_valid+=e-ih):(n.bi_buf|=t<<n.bi_valid&65535,n.bi_valid+=e)},ii=(n,t,e)=>{Ae(n,e[t*2],e[t*2+1])},lu=(n,t)=>{let e=0;do e|=n&1,n>>>=1,e<<=1;while(--t>0);return e>>>1},Np=n=>{n.bi_valid===16?(Br(n,n.bi_buf),n.bi_buf=0,n.bi_valid=0):n.bi_valid>=8&&(n.pending_buf[n.pending++]=n.bi_buf&255,n.bi_buf>>=8,n.bi_valid-=8)},Gp=(n,t)=>{const e=t.dyn_tree,i=t.max_code,r=t.stat_desc.static_tree,s=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,h=t.stat_desc.max_length;let l,c,d,f,u,m,v=0;for(f=0;f<=vn;f++)n.bl_count[f]=0;for(e[n.heap[n.heap_max]*2+1]=0,l=n.heap_max+1;l<tu;l++)c=n.heap[l],f=e[e[c*2+1]*2+1]+1,f>h&&(f=h,v++),e[c*2+1]=f,!(c>i)&&(n.bl_count[f]++,u=0,c>=o&&(u=a[c-o]),m=e[c*2],n.opt_len+=m*(f+u),s&&(n.static_len+=m*(r[c*2+1]+u)));if(v!==0){do{for(f=h-1;n.bl_count[f]===0;)f--;n.bl_count[f]--,n.bl_count[f+1]+=2,n.bl_count[h]--,v-=2}while(v>0);for(f=h;f!==0;f--)for(c=n.bl_count[f];c!==0;)d=n.heap[--l],!(d>i)&&(e[d*2+1]!==f&&(n.opt_len+=(f-e[d*2+1])*e[d*2],e[d*2+1]=f),c--)}},cu=(n,t,e)=>{const i=new Array(vn+1);let r=0,s,a;for(s=1;s<=vn;s++)r=r+e[s-1]<<1,i[s]=r;for(a=0;a<=t;a++){let o=n[a*2+1];o!==0&&(n[a*2]=lu(i[o]++,o))}},Up=()=>{let n,t,e,i,r;const s=new Array(vn+1);for(e=0,i=0;i<th-1;i++)for(sh[i]=e,n=0;n<1<<rh[i];n++)Ur[e++]=i;for(Ur[e-1]=i,r=0,i=0;i<16;i++)for(xa[i]=r,n=0;n<1<<ba[i];n++)Gr[r++]=i;for(r>>=7;i<qn;i++)for(xa[i]=r<<7,n=0;n<1<<ba[i]-7;n++)Gr[256+r++]=i;for(t=0;t<=vn;t++)s[t]=0;for(n=0;n<=143;)_i[n*2+1]=8,n++,s[8]++;for(;n<=255;)_i[n*2+1]=9,n++,s[9]++;for(;n<=279;)_i[n*2+1]=7,n++,s[7]++;for(;n<=287;)_i[n*2+1]=8,n++,s[8]++;for(cu(_i,Fr+1,s),n=0;n<qn;n++)Nr[n*2+1]=5,Nr[n*2]=lu(n,5);su=new ah(_i,rh,Or+1,Fr,vn),au=new ah(Nr,ba,0,qn,vn),ou=new ah(new Array(0),Op,0,eh,Ip)},uu=n=>{let t;for(t=0;t<Fr;t++)n.dyn_ltree[t*2]=0;for(t=0;t<qn;t++)n.dyn_dtree[t*2]=0;for(t=0;t<eh;t++)n.bl_tree[t*2]=0;n.dyn_ltree[nh*2]=1,n.opt_len=n.static_len=0,n.sym_next=n.matches=0},fu=n=>{n.bi_valid>8?Br(n,n.bi_buf):n.bi_valid>0&&(n.pending_buf[n.pending++]=n.bi_buf),n.bi_buf=0,n.bi_valid=0},du=(n,t,e,i)=>{const r=t*2,s=e*2;return n[r]<n[s]||n[r]===n[s]&&i[t]<=i[e]},hh=(n,t,e)=>{const i=n.heap[e];let r=e<<1;for(;r<=n.heap_len&&(r<n.heap_len&&du(t,n.heap[r+1],n.heap[r],n.depth)&&r++,!du(t,i,n.heap[r],n.depth));)n.heap[e]=n.heap[r],e=r,r<<=1;n.heap[e]=i},gu=(n,t,e)=>{let i,r,s=0,a,o;if(n.sym_next!==0)do i=n.pending_buf[n.sym_buf+s++]&255,i+=(n.pending_buf[n.sym_buf+s++]&255)<<8,r=n.pending_buf[n.sym_buf+s++],i===0?ii(n,r,t):(a=Ur[r],ii(n,a+Or+1,t),o=rh[a],o!==0&&(r-=sh[a],Ae(n,r,o)),i--,a=hu(i),ii(n,a,e),o=ba[a],o!==0&&(i-=xa[a],Ae(n,i,o)));while(s<n.sym_next);ii(n,nh,t)},lh=(n,t)=>{const e=t.dyn_tree,i=t.stat_desc.static_tree,r=t.stat_desc.has_stree,s=t.stat_desc.elems;let a,o,h=-1,l;for(n.heap_len=0,n.heap_max=tu,a=0;a<s;a++)e[a*2]!==0?(n.heap[++n.heap_len]=h=a,n.depth[a]=0):e[a*2+1]=0;for(;n.heap_len<2;)l=n.heap[++n.heap_len]=h<2?++h:0,e[l*2]=1,n.depth[l]=0,n.opt_len--,r&&(n.static_len-=i[l*2+1]);for(t.max_code=h,a=n.heap_len>>1;a>=1;a--)hh(n,e,a);l=s;do a=n.heap[1],n.heap[1]=n.heap[n.heap_len--],hh(n,e,1),o=n.heap[1],n.heap[--n.heap_max]=a,n.heap[--n.heap_max]=o,e[l*2]=e[a*2]+e[o*2],n.depth[l]=(n.depth[a]>=n.depth[o]?n.depth[a]:n.depth[o])+1,e[a*2+1]=e[o*2+1]=l,n.heap[1]=l++,hh(n,e,1);while(n.heap_len>=2);n.heap[--n.heap_max]=n.heap[1],Gp(n,t),cu(e,h,n.bl_count)},pu=(n,t,e)=>{let i,r=-1,s,a=t[0*2+1],o=0,h=7,l=4;for(a===0&&(h=138,l=3),t[(e+1)*2+1]=65535,i=0;i<=e;i++)s=a,a=t[(i+1)*2+1],!(++o<h&&s===a)&&(o<l?n.bl_tree[s*2]+=o:s!==0?(s!==r&&n.bl_tree[s*2]++,n.bl_tree[eu*2]++):o<=10?n.bl_tree[iu*2]++:n.bl_tree[nu*2]++,o=0,r=s,a===0?(h=138,l=3):s===a?(h=6,l=3):(h=7,l=4))},mu=(n,t,e)=>{let i,r=-1,s,a=t[0*2+1],o=0,h=7,l=4;for(a===0&&(h=138,l=3),i=0;i<=e;i++)if(s=a,a=t[(i+1)*2+1],!(++o<h&&s===a)){if(o<l)do ii(n,s,n.bl_tree);while(--o!==0);else s!==0?(s!==r&&(ii(n,s,n.bl_tree),o--),ii(n,eu,n.bl_tree),Ae(n,o-3,2)):o<=10?(ii(n,iu,n.bl_tree),Ae(n,o-3,3)):(ii(n,nu,n.bl_tree),Ae(n,o-11,7));o=0,r=s,a===0?(h=138,l=3):s===a?(h=6,l=3):(h=7,l=4)}},Bp=n=>{let t;for(pu(n,n.dyn_ltree,n.l_desc.max_code),pu(n,n.dyn_dtree,n.d_desc.max_code),lh(n,n.bl_desc),t=eh-1;t>=3&&n.bl_tree[ru[t]*2+1]===0;t--);return n.opt_len+=3*(t+1)+5+5+4,t},zp=(n,t,e,i)=>{let r;for(Ae(n,t-257,5),Ae(n,e-1,5),Ae(n,i-4,4),r=0;r<i;r++)Ae(n,n.bl_tree[ru[r]*2+1],3);mu(n,n.dyn_ltree,t-1),mu(n,n.dyn_dtree,e-1)},$p=n=>{let t=4093624447,e;for(e=0;e<=31;e++,t>>>=1)if(t&1&&n.dyn_ltree[e*2]!==0)return Zc;if(n.dyn_ltree[9*2]!==0||n.dyn_ltree[10*2]!==0||n.dyn_ltree[13*2]!==0)return Jc;for(e=32;e<Or;e++)if(n.dyn_ltree[e*2]!==0)return Jc;return Zc};let vu=!1;const Vp=n=>{vu||(Up(),vu=!0),n.l_desc=new oh(n.dyn_ltree,su),n.d_desc=new oh(n.dyn_dtree,au),n.bl_desc=new oh(n.bl_tree,ou),n.bi_buf=0,n.bi_valid=0,uu(n)},_u=(n,t,e,i)=>{Ae(n,(Mp<<1)+(i?1:0),3),fu(n),Br(n,e),Br(n,~e),e&&n.pending_buf.set(n.window.subarray(t,t+e),n.pending),n.pending+=e},Hp=n=>{Ae(n,Qc<<1,3),ii(n,nh,_i),Np(n)},jp=(n,t,e,i)=>{let r,s,a=0;n.level>0?(n.strm.data_type===Ap&&(n.strm.data_type=$p(n)),lh(n,n.l_desc),lh(n,n.d_desc),a=Bp(n),r=n.opt_len+3+7>>>3,s=n.static_len+3+7>>>3,s<=r&&(r=s)):r=s=e+5,e+4<=r&&t!==-1?_u(n,t,e,i):n.strategy===Pp||s===r?(Ae(n,(Qc<<1)+(i?1:0),3),gu(n,_i,Nr)):(Ae(n,(Rp<<1)+(i?1:0),3),zp(n,n.l_desc.max_code+1,n.d_desc.max_code+1,a+1),gu(n,n.dyn_ltree,n.dyn_dtree)),uu(n),i&&fu(n)},Xp=(n,t,e)=>(n.pending_buf[n.sym_buf+n.sym_next++]=t,n.pending_buf[n.sym_buf+n.sym_next++]=t>>8,n.pending_buf[n.sym_buf+n.sym_next++]=e,t===0?n.dyn_ltree[e*2]++:(n.matches++,t--,n.dyn_ltree[(Ur[e]+Or+1)*2]++,n.dyn_dtree[hu(t)*2]++),n.sym_next===n.sym_end);var Yp=Vp,qp=_u,Wp=jp,Kp=Xp,Zp=Hp,Jp={_tr_init:Yp,_tr_stored_block:qp,_tr_flush_block:Wp,_tr_tally:Kp,_tr_align:Zp},zr=(n,t,e,i)=>{let r=n&65535|0,s=n>>>16&65535|0,a=0;for(;e!==0;){a=e>2e3?2e3:e,e-=a;do r=r+t[i++]|0,s=s+r|0;while(--a);r%=65521,s%=65521}return r|s<<16|0};const Qp=()=>{let n,t=[];for(var e=0;e<256;e++){n=e;for(var i=0;i<8;i++)n=n&1?3988292384^n>>>1:n>>>1;t[e]=n}return t},t2=new Uint32Array(Qp());var ge=(n,t,e,i)=>{const r=t2,s=i+e;n^=-1;for(let a=i;a<s;a++)n=n>>>8^r[(n^t[a])&255];return n^-1},_n={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},yn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:e2,_tr_stored_block:ch,_tr_flush_block:i2,_tr_tally:Hi,_tr_align:n2}=Jp,{Z_NO_FLUSH:ji,Z_PARTIAL_FLUSH:r2,Z_FULL_FLUSH:s2,Z_FINISH:Ve,Z_BLOCK:yu,Z_OK:_e,Z_STREAM_END:wu,Z_STREAM_ERROR:ni,Z_DATA_ERROR:a2,Z_BUF_ERROR:uh,Z_DEFAULT_COMPRESSION:o2,Z_FILTERED:h2,Z_HUFFMAN_ONLY:Sa,Z_RLE:l2,Z_FIXED:c2,Z_DEFAULT_STRATEGY:u2,Z_UNKNOWN:f2,Z_DEFLATED:Ca}=yn,d2=9,g2=15,p2=8,m2=29,fh=256+1+m2,v2=30,_2=19,y2=2*fh+1,w2=15,Bt=3,Xi=258,ri=Xi+Bt+1,b2=32,Wn=42,dh=57,gh=69,ph=73,mh=91,vh=103,wn=113,$r=666,ke=1,Kn=2,bn=3,Zn=4,x2=3,xn=(n,t)=>(n.msg=_n[t],t),bu=n=>n*2-(n>4?9:0),Yi=n=>{let t=n.length;for(;--t>=0;)n[t]=0},S2=n=>{let t,e,i,r=n.w_size;t=n.hash_size,i=t;do e=n.head[--i],n.head[i]=e>=r?e-r:0;while(--t);t=r,i=t;do e=n.prev[--i],n.prev[i]=e>=r?e-r:0;while(--t)};let qi=(n,t,e)=>(t<<n.hash_shift^e)&n.hash_mask;const Oe=n=>{const t=n.state;let e=t.pending;e>n.avail_out&&(e=n.avail_out),e!==0&&(n.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+e),n.next_out),n.next_out+=e,t.pending_out+=e,n.total_out+=e,n.avail_out-=e,t.pending-=e,t.pending===0&&(t.pending_out=0))},Fe=(n,t)=>{i2(n,n.block_start>=0?n.block_start:-1,n.strstart-n.block_start,t),n.block_start=n.strstart,Oe(n.strm)},jt=(n,t)=>{n.pending_buf[n.pending++]=t},Vr=(n,t)=>{n.pending_buf[n.pending++]=t>>>8&255,n.pending_buf[n.pending++]=t&255},_h=(n,t,e,i)=>{let r=n.avail_in;return r>i&&(r=i),r===0?0:(n.avail_in-=r,t.set(n.input.subarray(n.next_in,n.next_in+r),e),n.state.wrap===1?n.adler=zr(n.adler,t,r,e):n.state.wrap===2&&(n.adler=ge(n.adler,t,r,e)),n.next_in+=r,n.total_in+=r,r)},xu=(n,t)=>{let e=n.max_chain_length,i=n.strstart,r,s,a=n.prev_length,o=n.nice_match;const h=n.strstart>n.w_size-ri?n.strstart-(n.w_size-ri):0,l=n.window,c=n.w_mask,d=n.prev,f=n.strstart+Xi;let u=l[i+a-1],m=l[i+a];n.prev_length>=n.good_match&&(e>>=2),o>n.lookahead&&(o=n.lookahead);do if(r=t,!(l[r+a]!==m||l[r+a-1]!==u||l[r]!==l[i]||l[++r]!==l[i+1])){i+=2,r++;do;while(l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&i<f);if(s=Xi-(f-i),i=f-Xi,s>a){if(n.match_start=t,a=s,s>=o)break;u=l[i+a-1],m=l[i+a]}}while((t=d[t&c])>h&&--e!==0);return a<=n.lookahead?a:n.lookahead},Jn=n=>{const t=n.w_size;let e,i,r;do{if(i=n.window_size-n.lookahead-n.strstart,n.strstart>=t+(t-ri)&&(n.window.set(n.window.subarray(t,t+t-i),0),n.match_start-=t,n.strstart-=t,n.block_start-=t,n.insert>n.strstart&&(n.insert=n.strstart),S2(n),i+=t),n.strm.avail_in===0)break;if(e=_h(n.strm,n.window,n.strstart+n.lookahead,i),n.lookahead+=e,n.lookahead+n.insert>=Bt)for(r=n.strstart-n.insert,n.ins_h=n.window[r],n.ins_h=qi(n,n.ins_h,n.window[r+1]);n.insert&&(n.ins_h=qi(n,n.ins_h,n.window[r+Bt-1]),n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,n.insert--,!(n.lookahead+n.insert<Bt)););}while(n.lookahead<ri&&n.strm.avail_in!==0)},Su=(n,t)=>{let e=n.pending_buf_size-5>n.w_size?n.w_size:n.pending_buf_size-5,i,r,s,a=0,o=n.strm.avail_in;do{if(i=65535,s=n.bi_valid+42>>3,n.strm.avail_out<s||(s=n.strm.avail_out-s,r=n.strstart-n.block_start,i>r+n.strm.avail_in&&(i=r+n.strm.avail_in),i>s&&(i=s),i<e&&(i===0&&t!==Ve||t===ji||i!==r+n.strm.avail_in)))break;a=t===Ve&&i===r+n.strm.avail_in?1:0,ch(n,0,0,a),n.pending_buf[n.pending-4]=i,n.pending_buf[n.pending-3]=i>>8,n.pending_buf[n.pending-2]=~i,n.pending_buf[n.pending-1]=~i>>8,Oe(n.strm),r&&(r>i&&(r=i),n.strm.output.set(n.window.subarray(n.block_start,n.block_start+r),n.strm.next_out),n.strm.next_out+=r,n.strm.avail_out-=r,n.strm.total_out+=r,n.block_start+=r,i-=r),i&&(_h(n.strm,n.strm.output,n.strm.next_out,i),n.strm.next_out+=i,n.strm.avail_out-=i,n.strm.total_out+=i)}while(a===0);return o-=n.strm.avail_in,o&&(o>=n.w_size?(n.matches=2,n.window.set(n.strm.input.subarray(n.strm.next_in-n.w_size,n.strm.next_in),0),n.strstart=n.w_size,n.insert=n.strstart):(n.window_size-n.strstart<=o&&(n.strstart-=n.w_size,n.window.set(n.window.subarray(n.w_size,n.w_size+n.strstart),0),n.matches<2&&n.matches++,n.insert>n.strstart&&(n.insert=n.strstart)),n.window.set(n.strm.input.subarray(n.strm.next_in-o,n.strm.next_in),n.strstart),n.strstart+=o,n.insert+=o>n.w_size-n.insert?n.w_size-n.insert:o),n.block_start=n.strstart),n.high_water<n.strstart&&(n.high_water=n.strstart),a?Zn:t!==ji&&t!==Ve&&n.strm.avail_in===0&&n.strstart===n.block_start?Kn:(s=n.window_size-n.strstart,n.strm.avail_in>s&&n.block_start>=n.w_size&&(n.block_start-=n.w_size,n.strstart-=n.w_size,n.window.set(n.window.subarray(n.w_size,n.w_size+n.strstart),0),n.matches<2&&n.matches++,s+=n.w_size,n.insert>n.strstart&&(n.insert=n.strstart)),s>n.strm.avail_in&&(s=n.strm.avail_in),s&&(_h(n.strm,n.window,n.strstart,s),n.strstart+=s,n.insert+=s>n.w_size-n.insert?n.w_size-n.insert:s),n.high_water<n.strstart&&(n.high_water=n.strstart),s=n.bi_valid+42>>3,s=n.pending_buf_size-s>65535?65535:n.pending_buf_size-s,e=s>n.w_size?n.w_size:s,r=n.strstart-n.block_start,(r>=e||(r||t===Ve)&&t!==ji&&n.strm.avail_in===0&&r<=s)&&(i=r>s?s:r,a=t===Ve&&n.strm.avail_in===0&&i===r?1:0,ch(n,n.block_start,i,a),n.block_start+=i,Oe(n.strm)),a?bn:ke)},yh=(n,t)=>{let e,i;for(;;){if(n.lookahead<ri){if(Jn(n),n.lookahead<ri&&t===ji)return ke;if(n.lookahead===0)break}if(e=0,n.lookahead>=Bt&&(n.ins_h=qi(n,n.ins_h,n.window[n.strstart+Bt-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),e!==0&&n.strstart-e<=n.w_size-ri&&(n.match_length=xu(n,e)),n.match_length>=Bt)if(i=Hi(n,n.strstart-n.match_start,n.match_length-Bt),n.lookahead-=n.match_length,n.match_length<=n.max_lazy_match&&n.lookahead>=Bt){n.match_length--;do n.strstart++,n.ins_h=qi(n,n.ins_h,n.window[n.strstart+Bt-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart;while(--n.match_length!==0);n.strstart++}else n.strstart+=n.match_length,n.match_length=0,n.ins_h=n.window[n.strstart],n.ins_h=qi(n,n.ins_h,n.window[n.strstart+1]);else i=Hi(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++;if(i&&(Fe(n,!1),n.strm.avail_out===0))return ke}return n.insert=n.strstart<Bt-1?n.strstart:Bt-1,t===Ve?(Fe(n,!0),n.strm.avail_out===0?bn:Zn):n.sym_next&&(Fe(n,!1),n.strm.avail_out===0)?ke:Kn},Qn=(n,t)=>{let e,i,r;for(;;){if(n.lookahead<ri){if(Jn(n),n.lookahead<ri&&t===ji)return ke;if(n.lookahead===0)break}if(e=0,n.lookahead>=Bt&&(n.ins_h=qi(n,n.ins_h,n.window[n.strstart+Bt-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),n.prev_length=n.match_length,n.prev_match=n.match_start,n.match_length=Bt-1,e!==0&&n.prev_length<n.max_lazy_match&&n.strstart-e<=n.w_size-ri&&(n.match_length=xu(n,e),n.match_length<=5&&(n.strategy===h2||n.match_length===Bt&&n.strstart-n.match_start>4096)&&(n.match_length=Bt-1)),n.prev_length>=Bt&&n.match_length<=n.prev_length){r=n.strstart+n.lookahead-Bt,i=Hi(n,n.strstart-1-n.prev_match,n.prev_length-Bt),n.lookahead-=n.prev_length-1,n.prev_length-=2;do++n.strstart<=r&&(n.ins_h=qi(n,n.ins_h,n.window[n.strstart+Bt-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart);while(--n.prev_length!==0);if(n.match_available=0,n.match_length=Bt-1,n.strstart++,i&&(Fe(n,!1),n.strm.avail_out===0))return ke}else if(n.match_available){if(i=Hi(n,0,n.window[n.strstart-1]),i&&Fe(n,!1),n.strstart++,n.lookahead--,n.strm.avail_out===0)return ke}else n.match_available=1,n.strstart++,n.lookahead--}return n.match_available&&(i=Hi(n,0,n.window[n.strstart-1]),n.match_available=0),n.insert=n.strstart<Bt-1?n.strstart:Bt-1,t===Ve?(Fe(n,!0),n.strm.avail_out===0?bn:Zn):n.sym_next&&(Fe(n,!1),n.strm.avail_out===0)?ke:Kn},C2=(n,t)=>{let e,i,r,s;const a=n.window;for(;;){if(n.lookahead<=Xi){if(Jn(n),n.lookahead<=Xi&&t===ji)return ke;if(n.lookahead===0)break}if(n.match_length=0,n.lookahead>=Bt&&n.strstart>0&&(r=n.strstart-1,i=a[r],i===a[++r]&&i===a[++r]&&i===a[++r])){s=n.strstart+Xi;do;while(i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&r<s);n.match_length=Xi-(s-r),n.match_length>n.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>=Bt?(e=Hi(n,1,n.match_length-Bt),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(e=Hi(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),e&&(Fe(n,!1),n.strm.avail_out===0))return ke}return n.insert=0,t===Ve?(Fe(n,!0),n.strm.avail_out===0?bn:Zn):n.sym_next&&(Fe(n,!1),n.strm.avail_out===0)?ke:Kn},T2=(n,t)=>{let e;for(;;){if(n.lookahead===0&&(Jn(n),n.lookahead===0)){if(t===ji)return ke;break}if(n.match_length=0,e=Hi(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++,e&&(Fe(n,!1),n.strm.avail_out===0))return ke}return n.insert=0,t===Ve?(Fe(n,!0),n.strm.avail_out===0?bn:Zn):n.sym_next&&(Fe(n,!1),n.strm.avail_out===0)?ke:Kn};function si(n,t,e,i,r){this.good_length=n,this.max_lazy=t,this.nice_length=e,this.max_chain=i,this.func=r}const Hr=[new si(0,0,0,0,Su),new si(4,4,8,4,yh),new si(4,5,16,8,yh),new si(4,6,32,32,yh),new si(4,4,16,16,Qn),new si(8,16,32,32,Qn),new si(8,16,128,128,Qn),new si(8,32,128,256,Qn),new si(32,128,258,1024,Qn),new si(32,258,258,4096,Qn)],k2=n=>{n.window_size=2*n.w_size,Yi(n.head),n.max_lazy_match=Hr[n.level].max_lazy,n.good_match=Hr[n.level].good_length,n.nice_match=Hr[n.level].nice_length,n.max_chain_length=Hr[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=Bt-1,n.match_available=0,n.ins_h=0};function E2(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Ca,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(y2*2),this.dyn_dtree=new Uint16Array((2*v2+1)*2),this.bl_tree=new Uint16Array((2*_2+1)*2),Yi(this.dyn_ltree),Yi(this.dyn_dtree),Yi(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(w2+1),this.heap=new Uint16Array(2*fh+1),Yi(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*fh+1),Yi(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const jr=n=>{if(!n)return 1;const t=n.state;return!t||t.strm!==n||t.status!==Wn&&t.status!==dh&&t.status!==gh&&t.status!==ph&&t.status!==mh&&t.status!==vh&&t.status!==wn&&t.status!==$r?1:0},Cu=n=>{if(jr(n))return xn(n,ni);n.total_in=n.total_out=0,n.data_type=f2;const t=n.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?dh:t.wrap?Wn:wn,n.adler=t.wrap===2?0:1,t.last_flush=-2,e2(t),_e},Tu=n=>{const t=Cu(n);return t===_e&&k2(n.state),t},P2=(n,t)=>jr(n)||n.state.wrap!==2?ni:(n.state.gzhead=t,_e),ku=(n,t,e,i,r,s)=>{if(!n)return ni;let a=1;if(t===o2&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),r<1||r>d2||e!==Ca||i<8||i>15||t<0||t>9||s<0||s>c2||i===8&&a!==1)return xn(n,ni);i===8&&(i=9);const o=new E2;return n.state=o,o.strm=n,o.status=Wn,o.wrap=a,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=r+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+Bt-1)/Bt),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<r+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=(o.lit_bufsize-1)*3,o.level=t,o.strategy=s,o.method=e,Tu(n)},A2=(n,t)=>ku(n,t,Ca,g2,p2,u2),M2=(n,t)=>{if(jr(n)||t>yu||t<0)return n?xn(n,ni):ni;const e=n.state;if(!n.output||n.avail_in!==0&&!n.input||e.status===$r&&t!==Ve)return xn(n,n.avail_out===0?uh:ni);const i=e.last_flush;if(e.last_flush=t,e.pending!==0){if(Oe(n),n.avail_out===0)return e.last_flush=-1,_e}else if(n.avail_in===0&&bu(t)<=bu(i)&&t!==Ve)return xn(n,uh);if(e.status===$r&&n.avail_in!==0)return xn(n,uh);if(e.status===Wn&&e.wrap===0&&(e.status=wn),e.status===Wn){let r=Ca+(e.w_bits-8<<4)<<8,s=-1;if(e.strategy>=Sa||e.level<2?s=0:e.level<6?s=1:e.level===6?s=2:s=3,r|=s<<6,e.strstart!==0&&(r|=b2),r+=31-r%31,Vr(e,r),e.strstart!==0&&(Vr(e,n.adler>>>16),Vr(e,n.adler&65535)),n.adler=1,e.status=wn,Oe(n),e.pending!==0)return e.last_flush=-1,_e}if(e.status===dh){if(n.adler=0,jt(e,31),jt(e,139),jt(e,8),e.gzhead)jt(e,(e.gzhead.text?1:0)+(e.gzhead.hcrc?2:0)+(e.gzhead.extra?4:0)+(e.gzhead.name?8:0)+(e.gzhead.comment?16:0)),jt(e,e.gzhead.time&255),jt(e,e.gzhead.time>>8&255),jt(e,e.gzhead.time>>16&255),jt(e,e.gzhead.time>>24&255),jt(e,e.level===9?2:e.strategy>=Sa||e.level<2?4:0),jt(e,e.gzhead.os&255),e.gzhead.extra&&e.gzhead.extra.length&&(jt(e,e.gzhead.extra.length&255),jt(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(n.adler=ge(n.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=gh;else if(jt(e,0),jt(e,0),jt(e,0),jt(e,0),jt(e,0),jt(e,e.level===9?2:e.strategy>=Sa||e.level<2?4:0),jt(e,x2),e.status=wn,Oe(n),e.pending!==0)return e.last_flush=-1,_e}if(e.status===gh){if(e.gzhead.extra){let r=e.pending,s=(e.gzhead.extra.length&65535)-e.gzindex;for(;e.pending+s>e.pending_buf_size;){let o=e.pending_buf_size-e.pending;if(e.pending_buf.set(e.gzhead.extra.subarray(e.gzindex,e.gzindex+o),e.pending),e.pending=e.pending_buf_size,e.gzhead.hcrc&&e.pending>r&&(n.adler=ge(n.adler,e.pending_buf,e.pending-r,r)),e.gzindex+=o,Oe(n),e.pending!==0)return e.last_flush=-1,_e;r=0,s-=o}let a=new Uint8Array(e.gzhead.extra);e.pending_buf.set(a.subarray(e.gzindex,e.gzindex+s),e.pending),e.pending+=s,e.gzhead.hcrc&&e.pending>r&&(n.adler=ge(n.adler,e.pending_buf,e.pending-r,r)),e.gzindex=0}e.status=ph}if(e.status===ph){if(e.gzhead.name){let r=e.pending,s;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>r&&(n.adler=ge(n.adler,e.pending_buf,e.pending-r,r)),Oe(n),e.pending!==0)return e.last_flush=-1,_e;r=0}e.gzindex<e.gzhead.name.length?s=e.gzhead.name.charCodeAt(e.gzindex++)&255:s=0,jt(e,s)}while(s!==0);e.gzhead.hcrc&&e.pending>r&&(n.adler=ge(n.adler,e.pending_buf,e.pending-r,r)),e.gzindex=0}e.status=mh}if(e.status===mh){if(e.gzhead.comment){let r=e.pending,s;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>r&&(n.adler=ge(n.adler,e.pending_buf,e.pending-r,r)),Oe(n),e.pending!==0)return e.last_flush=-1,_e;r=0}e.gzindex<e.gzhead.comment.length?s=e.gzhead.comment.charCodeAt(e.gzindex++)&255:s=0,jt(e,s)}while(s!==0);e.gzhead.hcrc&&e.pending>r&&(n.adler=ge(n.adler,e.pending_buf,e.pending-r,r))}e.status=vh}if(e.status===vh){if(e.gzhead.hcrc){if(e.pending+2>e.pending_buf_size&&(Oe(n),e.pending!==0))return e.last_flush=-1,_e;jt(e,n.adler&255),jt(e,n.adler>>8&255),n.adler=0}if(e.status=wn,Oe(n),e.pending!==0)return e.last_flush=-1,_e}if(n.avail_in!==0||e.lookahead!==0||t!==ji&&e.status!==$r){let r=e.level===0?Su(e,t):e.strategy===Sa?T2(e,t):e.strategy===l2?C2(e,t):Hr[e.level].func(e,t);if((r===bn||r===Zn)&&(e.status=$r),r===ke||r===bn)return n.avail_out===0&&(e.last_flush=-1),_e;if(r===Kn&&(t===r2?n2(e):t!==yu&&(ch(e,0,0,!1),t===s2&&(Yi(e.head),e.lookahead===0&&(e.strstart=0,e.block_start=0,e.insert=0))),Oe(n),n.avail_out===0))return e.last_flush=-1,_e}return t!==Ve?_e:e.wrap<=0?wu:(e.wrap===2?(jt(e,n.adler&255),jt(e,n.adler>>8&255),jt(e,n.adler>>16&255),jt(e,n.adler>>24&255),jt(e,n.total_in&255),jt(e,n.total_in>>8&255),jt(e,n.total_in>>16&255),jt(e,n.total_in>>24&255)):(Vr(e,n.adler>>>16),Vr(e,n.adler&65535)),Oe(n),e.wrap>0&&(e.wrap=-e.wrap),e.pending!==0?_e:wu)},R2=n=>{if(jr(n))return ni;const t=n.state.status;return n.state=null,t===wn?xn(n,a2):_e},D2=(n,t)=>{let e=t.length;if(jr(n))return ni;const i=n.state,r=i.wrap;if(r===2||r===1&&i.status!==Wn||i.lookahead)return ni;if(r===1&&(n.adler=zr(n.adler,t,e,0)),i.wrap=0,e>=i.w_size){r===0&&(Yi(i.head),i.strstart=0,i.block_start=0,i.insert=0);let h=new Uint8Array(i.w_size);h.set(t.subarray(e-i.w_size,e),0),t=h,e=i.w_size}const s=n.avail_in,a=n.next_in,o=n.input;for(n.avail_in=e,n.next_in=0,n.input=t,Jn(i);i.lookahead>=Bt;){let h=i.strstart,l=i.lookahead-(Bt-1);do i.ins_h=qi(i,i.ins_h,i.window[h+Bt-1]),i.prev[h&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=h,h++;while(--l);i.strstart=h,i.lookahead=Bt-1,Jn(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=Bt-1,i.match_available=0,n.next_in=a,n.input=o,n.avail_in=s,i.wrap=r,_e};var L2=A2,I2=ku,O2=Tu,F2=Cu,N2=P2,G2=M2,U2=R2,B2=D2,z2="pako deflate (from Nodeca project)",Xr={deflateInit:L2,deflateInit2:I2,deflateReset:O2,deflateResetKeep:F2,deflateSetHeader:N2,deflate:G2,deflateEnd:U2,deflateSetDictionary:B2,deflateInfo:z2};const $2=(n,t)=>Object.prototype.hasOwnProperty.call(n,t);var V2=function(n){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const e=t.shift();if(e){if(typeof e!="object")throw new TypeError(e+"must be non-object");for(const i in e)$2(e,i)&&(n[i]=e[i])}}return n},H2=n=>{let t=0;for(let i=0,r=n.length;i<r;i++)t+=n[i].length;const e=new Uint8Array(t);for(let i=0,r=0,s=n.length;i<s;i++){let a=n[i];e.set(a,r),r+=a.length}return e},Ta={assign:V2,flattenChunks:H2};let Eu=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Eu=!1}const Yr=new Uint8Array(256);for(let n=0;n<256;n++)Yr[n]=n>=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;Yr[254]=Yr[254]=1;var j2=n=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(n);let t,e,i,r,s,a=n.length,o=0;for(r=0;r<a;r++)e=n.charCodeAt(r),(e&64512)===55296&&r+1<a&&(i=n.charCodeAt(r+1),(i&64512)===56320&&(e=65536+(e-55296<<10)+(i-56320),r++)),o+=e<128?1:e<2048?2:e<65536?3:4;for(t=new Uint8Array(o),s=0,r=0;s<o;r++)e=n.charCodeAt(r),(e&64512)===55296&&r+1<a&&(i=n.charCodeAt(r+1),(i&64512)===56320&&(e=65536+(e-55296<<10)+(i-56320),r++)),e<128?t[s++]=e:e<2048?(t[s++]=192|e>>>6,t[s++]=128|e&63):e<65536?(t[s++]=224|e>>>12,t[s++]=128|e>>>6&63,t[s++]=128|e&63):(t[s++]=240|e>>>18,t[s++]=128|e>>>12&63,t[s++]=128|e>>>6&63,t[s++]=128|e&63);return t};const X2=(n,t)=>{if(t<65534&&n.subarray&&Eu)return String.fromCharCode.apply(null,n.length===t?n:n.subarray(0,t));let e="";for(let i=0;i<t;i++)e+=String.fromCharCode(n[i]);return e};var Y2=(n,t)=>{const e=t||n.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(n.subarray(0,t));let i,r;const s=new Array(e*2);for(r=0,i=0;i<e;){let a=n[i++];if(a<128){s[r++]=a;continue}let o=Yr[a];if(o>4){s[r++]=65533,i+=o-1;continue}for(a&=o===2?31:o===3?15:7;o>1&&i<e;)a=a<<6|n[i++]&63,o--;if(o>1){s[r++]=65533;continue}a<65536?s[r++]=a:(a-=65536,s[r++]=55296|a>>10&1023,s[r++]=56320|a&1023)}return X2(s,r)},q2=(n,t)=>{t=t||n.length,t>n.length&&(t=n.length);let e=t-1;for(;e>=0&&(n[e]&192)===128;)e--;return e<0||e===0?t:e+Yr[n[e]]>t?e:t},qr={string2buf:j2,buf2string:Y2,utf8border:q2};function W2(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Pu=W2;const Au=Object.prototype.toString,{Z_NO_FLUSH:K2,Z_SYNC_FLUSH:Z2,Z_FULL_FLUSH:J2,Z_FINISH:Q2,Z_OK:ka,Z_STREAM_END:tm,Z_DEFAULT_COMPRESSION:em,Z_DEFAULT_STRATEGY:im,Z_DEFLATED:nm}=yn;function Wr(n){this.options=Ta.assign({level:em,method:nm,chunkSize:16384,windowBits:15,memLevel:8,strategy:im},n||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Pu,this.strm.avail_out=0;let e=Xr.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==ka)throw new Error(_n[e]);if(t.header&&Xr.deflateSetHeader(this.strm,t.header),t.dictionary){let i;if(typeof t.dictionary=="string"?i=qr.string2buf(t.dictionary):Au.call(t.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(t.dictionary):i=t.dictionary,e=Xr.deflateSetDictionary(this.strm,i),e!==ka)throw new Error(_n[e]);this._dict_set=!0}}Wr.prototype.push=function(n,t){const e=this.strm,i=this.options.chunkSize;let r,s;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?Q2:K2,typeof n=="string"?e.input=qr.string2buf(n):Au.call(n)==="[object ArrayBuffer]"?e.input=new Uint8Array(n):e.input=n,e.next_in=0,e.avail_in=e.input.length;;){if(e.avail_out===0&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),(s===Z2||s===J2)&&e.avail_out<=6){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(r=Xr.deflate(e,s),r===tm)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),r=Xr.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===ka;if(e.avail_out===0){this.onData(e.output);continue}if(s>0&&e.next_out>0){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(e.avail_in===0)break}return!0},Wr.prototype.onData=function(n){this.chunks.push(n)},Wr.prototype.onEnd=function(n){n===ka&&(this.result=Ta.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function wh(n,t){const e=new Wr(t);if(e.push(n,!0),e.err)throw e.msg||_n[e.err];return e.result}function rm(n,t){return t=t||{},t.raw=!0,wh(n,t)}function sm(n,t){return t=t||{},t.gzip=!0,wh(n,t)}var am=Wr,om=wh,hm=rm,lm=sm,cm=yn,um={Deflate:am,deflate:om,deflateRaw:hm,gzip:lm,constants:cm};const Ea=16209,fm=16191;var dm=function(t,e){let i,r,s,a,o,h,l,c,d,f,u,m,v,b,S,E,_,x,P,R,F,L,$,U;const z=t.state;i=t.next_in,$=t.input,r=i+(t.avail_in-5),s=t.next_out,U=t.output,a=s-(e-t.avail_out),o=s+(t.avail_out-257),h=z.dmax,l=z.wsize,c=z.whave,d=z.wnext,f=z.window,u=z.hold,m=z.bits,v=z.lencode,b=z.distcode,S=(1<<z.lenbits)-1,E=(1<<z.distbits)-1;t:do{m<15&&(u+=$[i++]<<m,m+=8,u+=$[i++]<<m,m+=8),_=v[u&S];e:for(;;){if(x=_>>>24,u>>>=x,m-=x,x=_>>>16&255,x===0)U[s++]=_&65535;else if(x&16){P=_&65535,x&=15,x&&(m<x&&(u+=$[i++]<<m,m+=8),P+=u&(1<<x)-1,u>>>=x,m-=x),m<15&&(u+=$[i++]<<m,m+=8,u+=$[i++]<<m,m+=8),_=b[u&E];i:for(;;){if(x=_>>>24,u>>>=x,m-=x,x=_>>>16&255,x&16){if(R=_&65535,x&=15,m<x&&(u+=$[i++]<<m,m+=8,m<x&&(u+=$[i++]<<m,m+=8)),R+=u&(1<<x)-1,R>h){t.msg="invalid distance too far back",z.mode=Ea;break t}if(u>>>=x,m-=x,x=s-a,R>x){if(x=R-x,x>c&&z.sane){t.msg="invalid distance too far back",z.mode=Ea;break t}if(F=0,L=f,d===0){if(F+=l-x,x<P){P-=x;do U[s++]=f[F++];while(--x);F=s-R,L=U}}else if(d<x){if(F+=l+d-x,x-=d,x<P){P-=x;do U[s++]=f[F++];while(--x);if(F=0,d<P){x=d,P-=x;do U[s++]=f[F++];while(--x);F=s-R,L=U}}}else if(F+=d-x,x<P){P-=x;do U[s++]=f[F++];while(--x);F=s-R,L=U}for(;P>2;)U[s++]=L[F++],U[s++]=L[F++],U[s++]=L[F++],P-=3;P&&(U[s++]=L[F++],P>1&&(U[s++]=L[F++]))}else{F=s-R;do U[s++]=U[F++],U[s++]=U[F++],U[s++]=U[F++],P-=3;while(P>2);P&&(U[s++]=U[F++],P>1&&(U[s++]=U[F++]))}}else if(x&64){t.msg="invalid distance code",z.mode=Ea;break t}else{_=b[(_&65535)+(u&(1<<x)-1)];continue i}break}}else if(x&64)if(x&32){z.mode=fm;break t}else{t.msg="invalid literal/length code",z.mode=Ea;break t}else{_=v[(_&65535)+(u&(1<<x)-1)];continue e}break}}while(i<r&&s<o);P=m>>3,i-=P,m-=P<<3,u&=(1<<m)-1,t.next_in=i,t.next_out=s,t.avail_in=i<r?5+(r-i):5-(i-r),t.avail_out=s<o?257+(o-s):257-(s-o),z.hold=u,z.bits=m};const tr=15,Mu=852,Ru=592,Du=0,bh=1,Lu=2,gm=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),pm=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),mm=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),vm=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Kr=(n,t,e,i,r,s,a,o)=>{const h=o.bits;let l=0,c=0,d=0,f=0,u=0,m=0,v=0,b=0,S=0,E=0,_,x,P,R,F,L=null,$;const U=new Uint16Array(tr+1),z=new Uint16Array(tr+1);let q=null,K,Z,at;for(l=0;l<=tr;l++)U[l]=0;for(c=0;c<i;c++)U[t[e+c]]++;for(u=h,f=tr;f>=1&&U[f]===0;f--);if(u>f&&(u=f),f===0)return r[s++]=1<<24|64<<16|0,r[s++]=1<<24|64<<16|0,o.bits=1,0;for(d=1;d<f&&U[d]===0;d++);for(u<d&&(u=d),b=1,l=1;l<=tr;l++)if(b<<=1,b-=U[l],b<0)return-1;if(b>0&&(n===Du||f!==1))return-1;for(z[1]=0,l=1;l<tr;l++)z[l+1]=z[l]+U[l];for(c=0;c<i;c++)t[e+c]!==0&&(a[z[t[e+c]]++]=c);if(n===Du?(L=q=a,$=20):n===bh?(L=gm,q=pm,$=257):(L=mm,q=vm,$=0),E=0,c=0,l=d,F=s,m=u,v=0,P=-1,S=1<<u,R=S-1,n===bh&&S>Mu||n===Lu&&S>Ru)return 1;for(;;){K=l-v,a[c]+1<$?(Z=0,at=a[c]):a[c]>=$?(Z=q[a[c]-$],at=L[a[c]-$]):(Z=32+64,at=0),_=1<<l-v,x=1<<m,d=x;do x-=_,r[F+(E>>v)+x]=K<<24|Z<<16|at|0;while(x!==0);for(_=1<<l-1;E&_;)_>>=1;if(_!==0?(E&=_-1,E+=_):E=0,c++,--U[l]===0){if(l===f)break;l=t[e+a[c]]}if(l>u&&(E&R)!==P){for(v===0&&(v=u),F+=d,m=l-v,b=1<<m;m+v<f&&(b-=U[m+v],!(b<=0));)m++,b<<=1;if(S+=1<<m,n===bh&&S>Mu||n===Lu&&S>Ru)return 1;P=E&R,r[P]=u<<24|m<<16|F-s|0}}return E!==0&&(r[F+E]=l-v<<24|64<<16|0),o.bits=u,0};const _m=0,Iu=1,Ou=2,{Z_FINISH:Fu,Z_BLOCK:ym,Z_TREES:Pa,Z_OK:Sn,Z_STREAM_END:wm,Z_NEED_DICT:bm,Z_STREAM_ERROR:He,Z_DATA_ERROR:Nu,Z_MEM_ERROR:Gu,Z_BUF_ERROR:xm,Z_DEFLATED:Uu}=yn,Aa=16180,Bu=16181,zu=16182,$u=16183,Vu=16184,Hu=16185,ju=16186,Xu=16187,Yu=16188,qu=16189,Ma=16190,yi=16191,xh=16192,Wu=16193,Sh=16194,Ku=16195,Zu=16196,Ju=16197,Qu=16198,Ra=16199,Da=16200,tf=16201,ef=16202,nf=16203,rf=16204,sf=16205,Ch=16206,af=16207,of=16208,ee=16209,hf=16210,lf=16211,Sm=852,Cm=592,Tm=15,cf=n=>(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24);function km(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Cn=n=>{if(!n)return 1;const t=n.state;return!t||t.strm!==n||t.mode<Aa||t.mode>lf?1:0},uf=n=>{if(Cn(n))return He;const t=n.state;return n.total_in=n.total_out=t.total=0,n.msg="",t.wrap&&(n.adler=t.wrap&1),t.mode=Aa,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(Sm),t.distcode=t.distdyn=new Int32Array(Cm),t.sane=1,t.back=-1,Sn},ff=n=>{if(Cn(n))return He;const t=n.state;return t.wsize=0,t.whave=0,t.wnext=0,uf(n)},df=(n,t)=>{let e;if(Cn(n))return He;const i=n.state;return t<0?(e=0,t=-t):(e=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?He:(i.window!==null&&i.wbits!==t&&(i.window=null),i.wrap=e,i.wbits=t,ff(n))},gf=(n,t)=>{if(!n)return He;const e=new km;n.state=e,e.strm=n,e.window=null,e.mode=Aa;const i=df(n,t);return i!==Sn&&(n.state=null),i},Em=n=>gf(n,Tm);let pf=!0,Th,kh;const Pm=n=>{if(pf){Th=new Int32Array(512),kh=new Int32Array(32);let t=0;for(;t<144;)n.lens[t++]=8;for(;t<256;)n.lens[t++]=9;for(;t<280;)n.lens[t++]=7;for(;t<288;)n.lens[t++]=8;for(Kr(Iu,n.lens,0,288,Th,0,n.work,{bits:9}),t=0;t<32;)n.lens[t++]=5;Kr(Ou,n.lens,0,32,kh,0,n.work,{bits:5}),pf=!1}n.lencode=Th,n.lenbits=9,n.distcode=kh,n.distbits=5},mf=(n,t,e,i)=>{let r;const s=n.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),i>=s.wsize?(s.window.set(t.subarray(e-s.wsize,e),0),s.wnext=0,s.whave=s.wsize):(r=s.wsize-s.wnext,r>i&&(r=i),s.window.set(t.subarray(e-i,e-i+r),s.wnext),i-=r,i?(s.window.set(t.subarray(e-i,e),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=r,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=r))),0},Am=(n,t)=>{let e,i,r,s,a,o,h,l,c,d,f,u,m,v,b=0,S,E,_,x,P,R,F,L;const $=new Uint8Array(4);let U,z;const q=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Cn(n)||!n.output||!n.input&&n.avail_in!==0)return He;e=n.state,e.mode===yi&&(e.mode=xh),a=n.next_out,r=n.output,h=n.avail_out,s=n.next_in,i=n.input,o=n.avail_in,l=e.hold,c=e.bits,d=o,f=h,L=Sn;t:for(;;)switch(e.mode){case Aa:if(e.wrap===0){e.mode=xh;break}for(;c<16;){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}if(e.wrap&2&&l===35615){e.wbits===0&&(e.wbits=15),e.check=0,$[0]=l&255,$[1]=l>>>8&255,e.check=ge(e.check,$,2,0),l=0,c=0,e.mode=Bu;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((l&255)<<8)+(l>>8))%31){n.msg="incorrect header check",e.mode=ee;break}if((l&15)!==Uu){n.msg="unknown compression method",e.mode=ee;break}if(l>>>=4,c-=4,F=(l&15)+8,e.wbits===0&&(e.wbits=F),F>15||F>e.wbits){n.msg="invalid window size",e.mode=ee;break}e.dmax=1<<e.wbits,e.flags=0,n.adler=e.check=1,e.mode=l&512?qu:yi,l=0,c=0;break;case Bu:for(;c<16;){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}if(e.flags=l,(e.flags&255)!==Uu){n.msg="unknown compression method",e.mode=ee;break}if(e.flags&57344){n.msg="unknown header flags set",e.mode=ee;break}e.head&&(e.head.text=l>>8&1),e.flags&512&&e.wrap&4&&($[0]=l&255,$[1]=l>>>8&255,e.check=ge(e.check,$,2,0)),l=0,c=0,e.mode=zu;case zu:for(;c<32;){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}e.head&&(e.head.time=l),e.flags&512&&e.wrap&4&&($[0]=l&255,$[1]=l>>>8&255,$[2]=l>>>16&255,$[3]=l>>>24&255,e.check=ge(e.check,$,4,0)),l=0,c=0,e.mode=$u;case $u:for(;c<16;){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}e.head&&(e.head.xflags=l&255,e.head.os=l>>8),e.flags&512&&e.wrap&4&&($[0]=l&255,$[1]=l>>>8&255,e.check=ge(e.check,$,2,0)),l=0,c=0,e.mode=Vu;case Vu:if(e.flags&1024){for(;c<16;){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}e.length=l,e.head&&(e.head.extra_len=l),e.flags&512&&e.wrap&4&&($[0]=l&255,$[1]=l>>>8&255,e.check=ge(e.check,$,2,0)),l=0,c=0}else e.head&&(e.head.extra=null);e.mode=Hu;case Hu:if(e.flags&1024&&(u=e.length,u>o&&(u=o),u&&(e.head&&(F=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(i.subarray(s,s+u),F)),e.flags&512&&e.wrap&4&&(e.check=ge(e.check,i,u,s)),o-=u,s+=u,e.length-=u),e.length))break t;e.length=0,e.mode=ju;case ju:if(e.flags&2048){if(o===0)break t;u=0;do F=i[s+u++],e.head&&F&&e.length<65536&&(e.head.name+=String.fromCharCode(F));while(F&&u<o);if(e.flags&512&&e.wrap&4&&(e.check=ge(e.check,i,u,s)),o-=u,s+=u,F)break t}else e.head&&(e.head.name=null);e.length=0,e.mode=Xu;case Xu:if(e.flags&4096){if(o===0)break t;u=0;do F=i[s+u++],e.head&&F&&e.length<65536&&(e.head.comment+=String.fromCharCode(F));while(F&&u<o);if(e.flags&512&&e.wrap&4&&(e.check=ge(e.check,i,u,s)),o-=u,s+=u,F)break t}else e.head&&(e.head.comment=null);e.mode=Yu;case Yu:if(e.flags&512){for(;c<16;){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}if(e.wrap&4&&l!==(e.check&65535)){n.msg="header crc mismatch",e.mode=ee;break}l=0,c=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),n.adler=e.check=0,e.mode=yi;break;case qu:for(;c<32;){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}n.adler=e.check=cf(l),l=0,c=0,e.mode=Ma;case Ma:if(e.havedict===0)return n.next_out=a,n.avail_out=h,n.next_in=s,n.avail_in=o,e.hold=l,e.bits=c,bm;n.adler=e.check=1,e.mode=yi;case yi:if(t===ym||t===Pa)break t;case xh:if(e.last){l>>>=c&7,c-=c&7,e.mode=Ch;break}for(;c<3;){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}switch(e.last=l&1,l>>>=1,c-=1,l&3){case 0:e.mode=Wu;break;case 1:if(Pm(e),e.mode=Ra,t===Pa){l>>>=2,c-=2;break t}break;case 2:e.mode=Zu;break;case 3:n.msg="invalid block type",e.mode=ee}l>>>=2,c-=2;break;case Wu:for(l>>>=c&7,c-=c&7;c<32;){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}if((l&65535)!==(l>>>16^65535)){n.msg="invalid stored block lengths",e.mode=ee;break}if(e.length=l&65535,l=0,c=0,e.mode=Sh,t===Pa)break t;case Sh:e.mode=Ku;case Ku:if(u=e.length,u){if(u>o&&(u=o),u>h&&(u=h),u===0)break t;r.set(i.subarray(s,s+u),a),o-=u,s+=u,h-=u,a+=u,e.length-=u;break}e.mode=yi;break;case Zu:for(;c<14;){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}if(e.nlen=(l&31)+257,l>>>=5,c-=5,e.ndist=(l&31)+1,l>>>=5,c-=5,e.ncode=(l&15)+4,l>>>=4,c-=4,e.nlen>286||e.ndist>30){n.msg="too many length or distance symbols",e.mode=ee;break}e.have=0,e.mode=Ju;case Ju:for(;e.have<e.ncode;){for(;c<3;){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}e.lens[q[e.have++]]=l&7,l>>>=3,c-=3}for(;e.have<19;)e.lens[q[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,U={bits:e.lenbits},L=Kr(_m,e.lens,0,19,e.lencode,0,e.work,U),e.lenbits=U.bits,L){n.msg="invalid code lengths set",e.mode=ee;break}e.have=0,e.mode=Qu;case Qu:for(;e.have<e.nlen+e.ndist;){for(;b=e.lencode[l&(1<<e.lenbits)-1],S=b>>>24,E=b>>>16&255,_=b&65535,!(S<=c);){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}if(_<16)l>>>=S,c-=S,e.lens[e.have++]=_;else{if(_===16){for(z=S+2;c<z;){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}if(l>>>=S,c-=S,e.have===0){n.msg="invalid bit length repeat",e.mode=ee;break}F=e.lens[e.have-1],u=3+(l&3),l>>>=2,c-=2}else if(_===17){for(z=S+3;c<z;){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}l>>>=S,c-=S,F=0,u=3+(l&7),l>>>=3,c-=3}else{for(z=S+7;c<z;){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}l>>>=S,c-=S,F=0,u=11+(l&127),l>>>=7,c-=7}if(e.have+u>e.nlen+e.ndist){n.msg="invalid bit length repeat",e.mode=ee;break}for(;u--;)e.lens[e.have++]=F}}if(e.mode===ee)break;if(e.lens[256]===0){n.msg="invalid code -- missing end-of-block",e.mode=ee;break}if(e.lenbits=9,U={bits:e.lenbits},L=Kr(Iu,e.lens,0,e.nlen,e.lencode,0,e.work,U),e.lenbits=U.bits,L){n.msg="invalid literal/lengths set",e.mode=ee;break}if(e.distbits=6,e.distcode=e.distdyn,U={bits:e.distbits},L=Kr(Ou,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,U),e.distbits=U.bits,L){n.msg="invalid distances set",e.mode=ee;break}if(e.mode=Ra,t===Pa)break t;case Ra:e.mode=Da;case Da:if(o>=6&&h>=258){n.next_out=a,n.avail_out=h,n.next_in=s,n.avail_in=o,e.hold=l,e.bits=c,dm(n,f),a=n.next_out,r=n.output,h=n.avail_out,s=n.next_in,i=n.input,o=n.avail_in,l=e.hold,c=e.bits,e.mode===yi&&(e.back=-1);break}for(e.back=0;b=e.lencode[l&(1<<e.lenbits)-1],S=b>>>24,E=b>>>16&255,_=b&65535,!(S<=c);){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}if(E&&!(E&240)){for(x=S,P=E,R=_;b=e.lencode[R+((l&(1<<x+P)-1)>>x)],S=b>>>24,E=b>>>16&255,_=b&65535,!(x+S<=c);){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}l>>>=x,c-=x,e.back+=x}if(l>>>=S,c-=S,e.back+=S,e.length=_,E===0){e.mode=sf;break}if(E&32){e.back=-1,e.mode=yi;break}if(E&64){n.msg="invalid literal/length code",e.mode=ee;break}e.extra=E&15,e.mode=tf;case tf:if(e.extra){for(z=e.extra;c<z;){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}e.length+=l&(1<<e.extra)-1,l>>>=e.extra,c-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=ef;case ef:for(;b=e.distcode[l&(1<<e.distbits)-1],S=b>>>24,E=b>>>16&255,_=b&65535,!(S<=c);){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}if(!(E&240)){for(x=S,P=E,R=_;b=e.distcode[R+((l&(1<<x+P)-1)>>x)],S=b>>>24,E=b>>>16&255,_=b&65535,!(x+S<=c);){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}l>>>=x,c-=x,e.back+=x}if(l>>>=S,c-=S,e.back+=S,E&64){n.msg="invalid distance code",e.mode=ee;break}e.offset=_,e.extra=E&15,e.mode=nf;case nf:if(e.extra){for(z=e.extra;c<z;){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}e.offset+=l&(1<<e.extra)-1,l>>>=e.extra,c-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){n.msg="invalid distance too far back",e.mode=ee;break}e.mode=rf;case rf:if(h===0)break t;if(u=f-h,e.offset>u){if(u=e.offset-u,u>e.whave&&e.sane){n.msg="invalid distance too far back",e.mode=ee;break}u>e.wnext?(u-=e.wnext,m=e.wsize-u):m=e.wnext-u,u>e.length&&(u=e.length),v=e.window}else v=r,m=a-e.offset,u=e.length;u>h&&(u=h),h-=u,e.length-=u;do r[a++]=v[m++];while(--u);e.length===0&&(e.mode=Da);break;case sf:if(h===0)break t;r[a++]=e.length,h--,e.mode=Da;break;case Ch:if(e.wrap){for(;c<32;){if(o===0)break t;o--,l|=i[s++]<<c,c+=8}if(f-=h,n.total_out+=f,e.total+=f,e.wrap&4&&f&&(n.adler=e.check=e.flags?ge(e.check,r,f,a-f):zr(e.check,r,f,a-f)),f=h,e.wrap&4&&(e.flags?l:cf(l))!==e.check){n.msg="incorrect data check",e.mode=ee;break}l=0,c=0}e.mode=af;case af:if(e.wrap&&e.flags){for(;c<32;){if(o===0)break t;o--,l+=i[s++]<<c,c+=8}if(e.wrap&4&&l!==(e.total&4294967295)){n.msg="incorrect length check",e.mode=ee;break}l=0,c=0}e.mode=of;case of:L=wm;break t;case ee:L=Nu;break t;case hf:return Gu;case lf:default:return He}return n.next_out=a,n.avail_out=h,n.next_in=s,n.avail_in=o,e.hold=l,e.bits=c,(e.wsize||f!==n.avail_out&&e.mode<ee&&(e.mode<Ch||t!==Fu))&&mf(n,n.output,n.next_out,f-n.avail_out),d-=n.avail_in,f-=n.avail_out,n.total_in+=d,n.total_out+=f,e.total+=f,e.wrap&4&&f&&(n.adler=e.check=e.flags?ge(e.check,r,f,n.next_out-f):zr(e.check,r,f,n.next_out-f)),n.data_type=e.bits+(e.last?64:0)+(e.mode===yi?128:0)+(e.mode===Ra||e.mode===Sh?256:0),(d===0&&f===0||t===Fu)&&L===Sn&&(L=xm),L},Mm=n=>{if(Cn(n))return He;let t=n.state;return t.window&&(t.window=null),n.state=null,Sn},Rm=(n,t)=>{if(Cn(n))return He;const e=n.state;return e.wrap&2?(e.head=t,t.done=!1,Sn):He},Dm=(n,t)=>{const e=t.length;let i,r,s;return Cn(n)||(i=n.state,i.wrap!==0&&i.mode!==Ma)?He:i.mode===Ma&&(r=1,r=zr(r,t,e,0),r!==i.check)?Nu:(s=mf(n,t,e,e),s?(i.mode=hf,Gu):(i.havedict=1,Sn))};var Lm=ff,Im=df,Om=uf,Fm=Em,Nm=gf,Gm=Am,Um=Mm,Bm=Rm,zm=Dm,$m="pako inflate (from Nodeca project)",wi={inflateReset:Lm,inflateReset2:Im,inflateResetKeep:Om,inflateInit:Fm,inflateInit2:Nm,inflate:Gm,inflateEnd:Um,inflateGetHeader:Bm,inflateSetDictionary:zm,inflateInfo:$m};function Vm(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Hm=Vm;const vf=Object.prototype.toString,{Z_NO_FLUSH:jm,Z_FINISH:Xm,Z_OK:Zr,Z_STREAM_END:Eh,Z_NEED_DICT:Ph,Z_STREAM_ERROR:Ym,Z_DATA_ERROR:_f,Z_MEM_ERROR:qm}=yn;function Jr(n){this.options=Ta.assign({chunkSize:65536,windowBits:15,to:""},n||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(n&&n.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Pu,this.strm.avail_out=0;let e=wi.inflateInit2(this.strm,t.windowBits);if(e!==Zr)throw new Error(_n[e]);if(this.header=new Hm,wi.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=qr.string2buf(t.dictionary):vf.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=wi.inflateSetDictionary(this.strm,t.dictionary),e!==Zr)))throw new Error(_n[e])}Jr.prototype.push=function(n,t){const e=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let s,a,o;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?Xm:jm,vf.call(n)==="[object ArrayBuffer]"?e.input=new Uint8Array(n):e.input=n,e.next_in=0,e.avail_in=e.input.length;;){for(e.avail_out===0&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),s=wi.inflate(e,a),s===Ph&&r&&(s=wi.inflateSetDictionary(e,r),s===Zr?s=wi.inflate(e,a):s===_f&&(s=Ph));e.avail_in>0&&s===Eh&&e.state.wrap>0&&n[e.next_in]!==0;)wi.inflateReset(e),s=wi.inflate(e,a);switch(s){case Ym:case _f:case Ph:case qm:return this.onEnd(s),this.ended=!0,!1}if(o=e.avail_out,e.next_out&&(e.avail_out===0||s===Eh))if(this.options.to==="string"){let h=qr.utf8border(e.output,e.next_out),l=e.next_out-h,c=qr.buf2string(e.output,h);e.next_out=l,e.avail_out=i-l,l&&e.output.set(e.output.subarray(h,h+l),0),this.onData(c)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(!(s===Zr&&o===0)){if(s===Eh)return s=wi.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(e.avail_in===0)break}}return!0},Jr.prototype.onData=function(n){this.chunks.push(n)},Jr.prototype.onEnd=function(n){n===Zr&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ta.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function Ah(n,t){const e=new Jr(t);if(e.push(n),e.err)throw e.msg||_n[e.err];return e.result}function Wm(n,t){return t=t||{},t.raw=!0,Ah(n,t)}var Km=Jr,Zm=Ah,Jm=Wm,Qm=Ah,tv=yn,ev={Inflate:Km,inflate:Zm,inflateRaw:Jm,ungzip:Qm,constants:tv};const{Deflate:iv,deflate:nv,deflateRaw:rv,gzip:sv}=um,{Inflate:av,inflate:ov,inflateRaw:hv,ungzip:lv}=ev;var cv=iv,uv=nv,fv=rv,dv=sv,gv=av,pv=ov,mv=hv,vv=lv,_v=yn,yv={Deflate:cv,deflate:uv,deflateRaw:fv,gzip:dv,Inflate:gv,inflate:pv,inflateRaw:mv,ungzip:vv,constants:_v};const dt={};dt.toRGBA8=function(n){const t=n.width,e=n.height;if(n.tabs.acTL===null)return[dt.toRGBA8.decodeImage(n.data,t,e,n).buffer];const i=[];n.frames[0].data===null&&(n.frames[0].data=n.data);const r=t*e*4,s=new Uint8Array(r),a=new Uint8Array(r),o=new Uint8Array(r);for(let h=0;h<n.frames.length;h++){const l=n.frames[h],c=l.rect.x,d=l.rect.y,f=l.rect.width,u=l.rect.height,m=dt.toRGBA8.decodeImage(l.data,f,u,n);if(h!==0)for(let v=0;v<r;v++)o[v]=s[v];if(l.blend===0?dt._copyTile(m,f,u,s,t,e,c,d,0):l.blend===1&&dt._copyTile(m,f,u,s,t,e,c,d,1),i.push(s.buffer.slice(0)),l.dispose===1)dt._copyTile(a,f,u,s,t,e,c,d,0);else if(l.dispose===2)for(let v=0;v<r;v++)s[v]=o[v]}return i},dt.toRGBA8.decodeImage=function(n,t,e,i){const r=t*e,s=dt.decode._getBPP(i),a=Math.ceil(t*s/8),o=new Uint8Array(r*4),h=new Uint32Array(o.buffer),l=i.ctype,c=i.depth,d=dt._bin.readUshort;if(l===6){const f=r<<2;if(c===8)for(let u=0;u<f;u+=4)o[u]=n[u],o[u+1]=n[u+1],o[u+2]=n[u+2],o[u+3]=n[u+3];if(c===16)for(let u=0;u<f;u++)o[u]=n[u<<1]}else if(l===2){const f=i.tabs.tRNS;if(f===null){if(c===8)for(let u=0;u<r;u++){const m=u*3;h[u]=-16777216|n[m+2]<<16|n[m+1]<<8|n[m]}if(c===16)for(let u=0;u<r;u++){const m=u*6;h[u]=-16777216|n[m+4]<<16|n[m+2]<<8|n[m]}}else{const u=f[0],m=f[1],v=f[2];if(c===8)for(let b=0;b<r;b++){const S=b<<2,E=b*3;h[b]=-16777216|n[E+2]<<16|n[E+1]<<8|n[E],n[E]===u&&n[E+1]===m&&n[E+2]===v&&(o[S+3]=0)}if(c===16)for(let b=0;b<r;b++){const S=b<<2,E=b*6;h[b]=-16777216|n[E+4]<<16|n[E+2]<<8|n[E],d(n,E)===u&&d(n,E+2)===m&&d(n,E+4)===v&&(o[S+3]=0)}}}else if(l===3){const f=i.tabs.PLTE,u=i.tabs.tRNS,m=u?u.length:0;if(c===1)for(let v=0;v<e;v++){const b=v*a,S=v*t;for(let E=0;E<t;E++){const _=S+E<<2,x=n[b+(E>>3)]>>7-((E&7)<<0)&1,P=3*x;o[_]=f[P],o[_+1]=f[P+1],o[_+2]=f[P+2],o[_+3]=x<m?u[x]:255}}if(c===2)for(let v=0;v<e;v++){const b=v*a,S=v*t;for(let E=0;E<t;E++){const _=S+E<<2,x=n[b+(E>>2)]>>6-((E&3)<<1)&3,P=3*x;o[_]=f[P],o[_+1]=f[P+1],o[_+2]=f[P+2],o[_+3]=x<m?u[x]:255}}if(c===4)for(let v=0;v<e;v++){const b=v*a,S=v*t;for(let E=0;E<t;E++){const _=S+E<<2,x=n[b+(E>>1)]>>4-((E&1)<<2)&15,P=3*x;o[_]=f[P],o[_+1]=f[P+1],o[_+2]=f[P+2],o[_+3]=x<m?u[x]:255}}if(c===8)for(let v=0;v<r;v++){const b=v<<2,S=n[v],E=3*S;o[b]=f[E],o[b+1]=f[E+1],o[b+2]=f[E+2],o[b+3]=S<m?u[S]:255}}else if(l===4){if(c===8)for(let f=0;f<r;f++){const u=f<<2,m=f<<1,v=n[m];o[u]=v,o[u+1]=v,o[u+2]=v,o[u+3]=n[m+1]}if(c===16)for(let f=0;f<r;f++){const u=f<<2,m=f<<2,v=n[m];o[u]=v,o[u+1]=v,o[u+2]=v,o[u+3]=n[m+2]}}else if(l===0){const f=i.tabs.tRNS?i.tabs.tRNS:-1;for(let u=0;u<e;u++){const m=u*a,v=u*t;if(c===1)for(let b=0;b<t;b++){const S=255*(n[m+(b>>>3)]>>>7-(b&7)&1),E=S===f*255?0:255;h[v+b]=E<<24|S<<16|S<<8|S}else if(c===2)for(let b=0;b<t;b++){const S=85*(n[m+(b>>>2)]>>>6-((b&3)<<1)&3),E=S===f*85?0:255;h[v+b]=E<<24|S<<16|S<<8|S}else if(c===4)for(let b=0;b<t;b++){const S=17*(n[m+(b>>>1)]>>>4-((b&1)<<2)&15),E=S===f*17?0:255;h[v+b]=E<<24|S<<16|S<<8|S}else if(c===8)for(let b=0;b<t;b++){const S=n[m+b],E=S===f?0:255;h[v+b]=E<<24|S<<16|S<<8|S}else if(c===16)for(let b=0;b<t;b++){const S=n[m+(b<<1)],E=d(n,m+(b<<1))===f?0:255;h[v+b]=E<<24|S<<16|S<<8|S}}}return o},dt.decode=function(n){const t=new Uint8Array(n);let e=8;const i=dt._bin,r=i.readUshort,s=i.readUint,a={tabs:{},frames:[]},o=new Uint8Array(t.length);let h=0,l,c=0;const d=[137,80,78,71,13,10,26,10];for(let f=0;f<8;f++)if(t[f]!==d[f])throw"The input is not a PNG file!";for(;e<t.length;){const f=i.readUint(t,e);e+=4;const u=i.readASCII(t,e,4);if(e+=4,u==="IHDR")dt.decode._IHDR(t,e,a);else if(u==="CgBI")a.tabs[u]=t.slice(e,e+4);else if(u==="IDAT"){for(let m=0;m<f;m++)o[h+m]=t[e+m];h+=f}else if(u==="acTL")a.tabs[u]={num_frames:s(t,e),num_plays:s(t,e+4)},l=new Uint8Array(t.length);else if(u==="fcTL"){if(c!==0){const S=a.frames[a.frames.length-1];S.data=dt.decode._decompress(a,l.slice(0,c),S.rect.width,S.rect.height),c=0}const m={x:s(t,e+12),y:s(t,e+16),width:s(t,e+4),height:s(t,e+8)};let v=r(t,e+22);v=r(t,e+20)/(v===0?100:v);const b={rect:m,delay:Math.round(v*1e3),dispose:t[e+24],blend:t[e+25]};a.frames.push(b)}else if(u==="fdAT"){for(let m=0;m<f-4;m++)l[c+m]=t[e+m+4];c+=f-4}else if(u==="pHYs")a.tabs[u]=[i.readUint(t,e),i.readUint(t,e+4),t[e+8]];else if(u==="cHRM"){a.tabs[u]=[];for(let m=0;m<8;m++)a.tabs[u].push(i.readUint(t,e+m*4))}else if(u==="tEXt"||u==="zTXt"){a.tabs[u]===null&&(a.tabs[u]={});const m=i.nextZero(t,e),v=i.readASCII(t,e,m-e);let b;const S=e+f-m-1;if(u==="tEXt")b=i.readASCII(t,m+1,S);else{const E=dt.decode._inflate(t.slice(m+2,m+2+S));b=i.readUTF8(E,0,E.length)}a.tabs[u][v]=b}else if(u==="iTXt"){a.tabs[u]==null&&(a.tabs[u]={});let m=0,v=e;m=i.nextZero(t,v);const b=i.readASCII(t,v,m-v);v=m+1;const S=t[v];v+=2,m=i.nextZero(t,v),v=m+1,m=i.nextZero(t,v),v=m+1;let E;const _=f-(v-e);if(S===0)E=i.readUTF8(t,v,_);else{const x=dt.decode._inflate(t.slice(v,v+_));E=i.readUTF8(x,0,x.length)}a.tabs[u][b]=E}else if(u==="PLTE")a.tabs[u]=i.readBytes(t,e,f);else if(u==="hIST"){const m=a.tabs.PLTE.length/3;a.tabs[u]=[];for(let v=0;v<m;v++)a.tabs[u].push(r(t,e+v*2))}else if(u==="tRNS")a.ctype===3?a.tabs[u]=i.readBytes(t,e,f):a.ctype===0?a.tabs[u]=r(t,e):a.ctype===2&&(a.tabs[u]=[r(t,e),r(t,e+2),r(t,e+4)]);else if(u==="gAMA")a.tabs[u]=i.readUint(t,e)/1e5;else if(u==="sRGB")a.tabs[u]=t[e];else if(u==="bKGD")a.ctype===0||a.ctype===4?a.tabs[u]=[r(t,e)]:a.ctype===2||a.ctype===6?a.tabs[u]=[r(t,e),r(t,e+2),r(t,e+4)]:a.ctype===3&&(a.tabs[u]=t[e]);else if(u==="IEND")break;e+=f,e+=4}if(c!==0){const f=a.frames[a.frames.length-1];f.data=dt.decode._decompress(a,l.slice(0,c),f.rect.width,f.rect.height),c=0}return a.data=dt.decode._decompress(a,o,a.width,a.height),delete a.compress,delete a.interlace,delete a.filter,a},dt.decode._decompress=function(n,t,e,i){const r=dt.decode._getBPP(n),s=Math.ceil(e*r/8),a=new Uint8Array((s+1+n.interlace)*i);return n.tabs.CgBI?t=dt.inflateRaw(t,a):t=dt.decode._inflate(t,a),n.interlace===0?t=dt.decode._filterZero(t,n,0,e,i):n.interlace===1&&(t=dt.decode._readInterlace(t,n)),t},dt.decode._inflate=function(n,t){return dt.inflateRaw(new Uint8Array(n.buffer,2,n.length-6),t)},dt.inflateRaw=function(){const n={};return n.H={},n.H.N=function(t,e){const i=Uint8Array;let r=0,s=0,a=0,o=0,h=0,l=0,c=0,d=0,f=0,u,m;if(t[0]===3&&t[1]===0)return e||new i(0);const v=n.H,b=v.b,S=v.e,E=v.R,_=v.n,x=v.A,P=v.Z,R=v.m,F=e===null;for(F&&(e=new i(t.length>>>2<<3));r===0;){if(r=b(t,f,1),s=b(t,f+1,2),f+=3,s===0){f&7&&(f+=8-(f&7));const L=(f>>>3)+4,$=t[L-4]|t[L-3]<<8;F&&(e=n.H.W(e,d+$)),e.set(new i(t.buffer,t.byteOffset+L,$),d),f=L+$<<3,d+=$;continue}if(F&&(e=n.H.W(e,d+131072)),s===1&&(u=R.J,m=R.h,l=511,c=31),s===2){a=S(t,f,5)+257,o=S(t,f+5,5)+1,h=S(t,f+10,4)+4,f+=14;let L=1;for(let z=0;z<38;z+=2)R.Q[z]=0,R.Q[z+1]=0;for(let z=0;z<h;z++){const q=S(t,f+z*3,3);R.Q[(R.X[z]<<1)+1]=q,q>L&&(L=q)}f+=3*h,_(R.Q,L),x(R.Q,L,R.u),u=R.w,m=R.d,f=E(R.u,(1<<L)-1,a+o,t,f,R.v);const $=v.V(R.v,0,a,R.C);l=(1<<$)-1;const U=v.V(R.v,a,o,R.D);c=(1<<U)-1,_(R.C,$),x(R.C,$,u),_(R.D,U),x(R.D,U,m)}for(;;){const L=u[P(t,f)&l];f+=L&15;const $=L>>>4;if(!($>>>8))e[d++]=$;else{if($===256)break;{let U=d+$-254;if($>264){const at=R.q[$-257];U=d+(at>>>3)+S(t,f,at&7),f+=at&7}const z=m[P(t,f)&c];f+=z&15;const q=z>>>4,K=R.c[q],Z=(K>>>4)+b(t,f,K&15);for(f+=K&15;d<U;)e[d]=e[d++-Z],e[d]=e[d++-Z],e[d]=e[d++-Z],e[d]=e[d++-Z];d=U}}}}return e.length===d?e:e.slice(0,d)},n.H.W=function(t,e){const i=t.length;if(e<=i)return t;const r=new Uint8Array(i<<1);return r.set(t,0),r},n.H.R=function(t,e,i,r,s,a){const o=n.H.e,h=n.H.Z;let l=0;for(;l<i;){const c=t[h(r,s)&e];s+=c&15;const d=c>>>4;if(d<=15)a[l]=d,l++;else{let f=0,u=0;d===16?(u=3+o(r,s,2),s+=2,f=a[l-1]):d===17?(u=3+o(r,s,3),s+=3):d===18&&(u=11+o(r,s,7),s+=7);const m=l+u;for(;l<m;)a[l]=f,l++}}return s},n.H.V=function(t,e,i,r){let s=0,a=0;const o=r.length>>>1;for(;a<i;){const h=t[a+e];r[a<<1]=0,r[(a<<1)+1]=h,h>s&&(s=h),a++}for(;a<o;)r[a<<1]=0,r[(a<<1)+1]=0,a++;return s},n.H.n=function(t,e){const i=n.H.m,r=t.length;let s,a,o,h,l;const c=i.j;for(let f=0;f<=e;f++)c[f]=0;for(h=1;h<r;h+=2)c[t[h]]++;const d=i.K;for(s=0,c[0]=0,a=1;a<=e;a++)s=s+c[a-1]<<1,d[a]=s;for(o=0;o<r;o+=2)l=t[o+1],l!==0&&(t[o]=d[l],d[l]++)},n.H.A=function(t,e,i){const r=t.length,a=n.H.m.r;for(let o=0;o<r;o+=2)if(t[o+1]!==0){const h=o>>1,l=t[o+1],c=h<<4|l,d=e-l;let f=t[o]<<d;const u=f+(1<<d);for(;f!==u;){const m=a[f]>>>15-e;i[m]=c,f++}}},n.H.l=function(t,e){const i=n.H.m.r,r=15-e;for(let s=0;s<t.length;s+=2){const a=t[s]<<e-t[s+1];t[s]=i[a]>>>r}},n.H.M=function(t,e,i){i=i<<(e&7);const r=e>>>3;t[r]|=i,t[r+1]|=i>>>8},n.H.I=function(t,e,i){i=i<<(e&7);const r=e>>>3;t[r]|=i,t[r+1]|=i>>>8,t[r+2]|=i>>>16},n.H.e=function(t,e,i){return(t[e>>>3]|t[(e>>>3)+1]<<8)>>>(e&7)&(1<<i)-1},n.H.b=function(t,e,i){return(t[e>>>3]|t[(e>>>3)+1]<<8|t[(e>>>3)+2]<<16)>>>(e&7)&(1<<i)-1},n.H.Z=function(t,e){return(t[e>>>3]|t[(e>>>3)+1]<<8|t[(e>>>3)+2]<<16)>>>(e&7)},n.H.i=function(t,e){return(t[e>>>3]|t[(e>>>3)+1]<<8|t[(e>>>3)+2]<<16|t[(e>>>3)+3]<<24)>>>(e&7)},n.H.m=function(){const t=Uint16Array,e=Uint32Array;return{K:new t(16),j:new t(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new t(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new e(32),J:new t(512),_:[],h:new t(32),$:[],w:new t(32768),C:[],v:[],d:new t(32768),D:[],u:new t(512),Q:[],r:new t(32768),s:new e(286),Y:new e(30),a:new e(19),t:new e(15e3),k:new t(65536),g:new t(32768)}}(),function(){const t=n.H.m,e=32768;for(let r=0;r<e;r++){let s=r;s=(s&2863311530)>>>1|(s&1431655765)<<1,s=(s&3435973836)>>>2|(s&858993459)<<2,s=(s&4042322160)>>>4|(s&252645135)<<4,s=(s&4278255360)>>>8|(s&16711935)<<8,t.r[r]=(s>>>16|s<<16)>>>17}function i(r,s,a){for(;s--!==0;)r.push(0,a)}for(let r=0;r<32;r++)t.q[r]=t.S[r]<<3|t.T[r],t.c[r]=t.p[r]<<4|t.z[r];i(t._,144,8),i(t._,112,9),i(t._,24,7),i(t._,8,8),n.H.n(t._,9),n.H.A(t._,9,t.J),n.H.l(t._,9),i(t.$,32,5),n.H.n(t.$,5),n.H.A(t.$,5,t.h),n.H.l(t.$,5),i(t.Q,19,0),i(t.C,286,0),i(t.D,30,0),i(t.v,320,0)}(),n.H.N}(),dt.decode._readInterlace=function(n,t){const e=t.width,i=t.height,r=dt.decode._getBPP(t),s=r>>3,a=Math.ceil(e*r/8),o=new Uint8Array(i*a);let h=0;const l=[0,0,4,0,2,0,1],c=[0,4,0,2,0,1,0],d=[8,8,8,4,4,2,2],f=[8,8,4,4,2,2,1];let u=0;for(;u<7;){const m=d[u],v=f[u];let b=0,S=0,E=l[u];for(;E<i;)E+=m,S++;let _=c[u];for(;_<e;)_+=v,b++;const x=Math.ceil(b*r/8);dt.decode._filterZero(n,t,h,b,S);let P=0,R=l[u];for(;R<i;){let F=c[u],L=h+P*x<<3;for(;F<e;){if(r===1){let $=n[L>>3];$=$>>7-(L&7)&1,o[R*a+(F>>3)]|=$<<7-((F&7)<<0)}if(r===2){let $=n[L>>3];$=$>>6-(L&7)&3,o[R*a+(F>>2)]|=$<<6-((F&3)<<1)}if(r===4){let $=n[L>>3];$=$>>4-(L&7)&15,o[R*a+(F>>1)]|=$<<4-((F&1)<<2)}if(r>=8){const $=R*a+F*s;for(let U=0;U<s;U++)o[$+U]=n[(L>>3)+U]}L+=r,F+=v}P++,R+=m}b*S!==0&&(h+=S*(1+x)),u=u+1}return o},dt.decode._getBPP=function(n){return[1,null,3,1,2,null,4][n.ctype]*n.depth},dt.decode._filterZero=function(n,t,e,i,r){let s=dt.decode._getBPP(t);const a=Math.ceil(i*s/8),o=dt.decode._paeth;s=Math.ceil(s/8);let h=0,l=1,c=n[e],d=0;if(c>1&&(n[e]=[0,0,1][c-2]),c===3)for(d=s;d<a;d++)n[d+1]=n[d+1]+(n[d+1-s]>>>1)&255;for(let f=0;f<r;f++)if(h=e+f*a,l=h+f+1,c=n[l-1],d=0,c===0)for(;d<a;d++)n[h+d]=n[l+d];else if(c===1){for(;d<s;d++)n[h+d]=n[l+d];for(;d<a;d++)n[h+d]=n[l+d]+n[h+d-s]}else if(c===2)for(;d<a;d++)n[h+d]=n[l+d]+n[h+d-a];else if(c===3){for(;d<s;d++)n[h+d]=n[l+d]+(n[h+d-a]>>>1);for(;d<a;d++)n[h+d]=n[l+d]+(n[h+d-a]+n[h+d-s]>>>1)}else{for(;d<s;d++)n[h+d]=n[l+d]+o(0,n[h+d-a],0);for(;d<a;d++)n[h+d]=n[l+d]+o(n[h+d-s],n[h+d-a],n[h+d-s-a])}return n},dt.decode._paeth=function(n,t,e){const i=n+t-e,r=i-n,s=i-t,a=i-e;return r*r<=s*s&&r*r<=a*a?n:s*s<=a*a?t:e},dt.decode._IHDR=function(n,t,e){const i=dt._bin;e.width=i.readUint(n,t),t+=4,e.height=i.readUint(n,t),t+=4,e.depth=n[t],t++,e.ctype=n[t],t++,e.compress=n[t],t++,e.filter=n[t],t++,e.interlace=n[t],t++},dt._bin={nextZero:function(n,t){for(;n[t]!==0;)t++;return t},readUshort:function(n,t){return n[t]<<8|n[t+1]},writeUshort:function(n,t,e){n[t]=e>>8&255,n[t+1]=e&255},readUint:function(n,t){return n[t]*16777216+(n[t+1]<<16|n[t+2]<<8|n[t+3])},writeUint:function(n,t,e){n[t]=e>>24&255,n[t+1]=e>>16&255,n[t+2]=e>>8&255,n[t+3]=e&255},readASCII:function(n,t,e){let i="";for(let r=0;r<e;r++)i+=String.fromCharCode(n[t+r]);return i},writeASCII:function(n,t,e){for(let i=0;i<e.length;i++)n[t+i]=e.charCodeAt(i)},readBytes:function(n,t,e){const i=[];for(let r=0;r<e;r++)i.push(n[t+r]);return i},pad:function(n){return n.length<2?"0"+n:n},readUTF8:function(n,t,e){let i="",r;for(let s=0;s<e;s++)i+="%"+dt._bin.pad(n[t+s].toString(16));try{r=decodeURIComponent(i)}catch{return dt._bin.readASCII(n,t,e)}return r}},dt._copyTile=function(n,t,e,i,r,s,a,o,h){const l=Math.min(t,r),c=Math.min(e,s);let d=0,f=0;for(let u=0;u<c;u++)for(let m=0;m<l;m++)if(a>=0&&o>=0?(d=u*t+m<<2,f=(o+u)*r+a+m<<2):(d=(-o+u)*t-a+m<<2,f=u*r+m<<2),h===0)i[f]=n[d],i[f+1]=n[d+1],i[f+2]=n[d+2],i[f+3]=n[d+3];else if(h===1){const v=n[d+3]*.00392156862745098,b=n[d]*v,S=n[d+1]*v,E=n[d+2]*v,_=i[f+3]*(1/255),x=i[f]*_,P=i[f+1]*_,R=i[f+2]*_,F=1-v,L=v+_*F,$=L===0?0:1/L;i[f+3]=255*L,i[f+0]=(b+x*F)*$,i[f+1]=(S+P*F)*$,i[f+2]=(E+R*F)*$}else if(h===2){const v=n[d+3],b=n[d],S=n[d+1],E=n[d+2],_=i[f+3],x=i[f],P=i[f+1],R=i[f+2];v===_&&b===x&&S===P&&E===R?(i[f]=0,i[f+1]=0,i[f+2]=0,i[f+3]=0):(i[f]=b,i[f+1]=S,i[f+2]=E,i[f+3]=v)}else if(h===3){const v=n[d+3],b=n[d],S=n[d+1],E=n[d+2],_=i[f+3],x=i[f],P=i[f+1],R=i[f+2];if(v===_&&b===x&&S===P&&E===R)continue;if(v<220&&_>20)return!1}return!0},dt.encode=function(n,t,e,i,r,s,a){i===null&&(i=0),a===null&&(a=!1);const o=dt.encode.compress(n,t,e,i,[!1,!1,!1,0,a]);return dt.encode.compressPNG(o,-1),dt.encode._main(o,t,e,r,s)},dt.encodeLL=function(n,t,e,i,r,s,a,o){const h={ctype:0+(i===1?0:2)+(r===0?0:4),depth:s,frames:[]},l=(i+r)*s,c=l*t;for(let f=0;f<n.length;f++)h.frames.push({rect:{x:0,y:0,width:t,height:e},img:new Uint8Array(n[f]),blend:0,dispose:1,bpp:Math.ceil(l/8),bpl:Math.ceil(c/8)});return dt.encode.compressPNG(h,0,!0),dt.encode._main(h,t,e,a,o)},dt.encode._main=function(n,t,e,i,r){r||(r={});const s=dt.crc.crc,a=dt._bin.writeUint,o=dt._bin.writeUshort,h=dt._bin.writeASCII;let l=8;const c=n.frames.length>1;let d=!1,f=8+(16+5+4)+(c?20:0);if(r.sRGB!==null&&r.sRGB!==void 0&&(f+=13),r.pHYs!==null&&r.pHYs!==void 0&&(f+=21),n.ctype===3){const b=n.plte.length;for(let S=0;S<b;S++)n.plte[S]>>>24!==255&&(d=!0);f+=8+b*3+4+(d?8+b*1+4:0)}for(let b=0;b<n.frames.length;b++){const S=n.frames[b];c&&(f+=38),f+=S.cimg.length+12,b!==0&&(f+=4)}f+=12;const u=new Uint8Array(f),m=[137,80,78,71,13,10,26,10];for(let b=0;b<8;b++)u[b]=m[b];if(a(u,l,13),l+=4,h(u,l,"IHDR"),l+=4,a(u,l,t),l+=4,a(u,l,e),l+=4,u[l]=n.depth,l++,u[l]=n.ctype,l++,u[l]=0,l++,u[l]=0,l++,u[l]=0,l++,a(u,l,s(u,l-17,17)),l+=4,r.sRGB!==null&&r.sRGB!==void 0&&(a(u,l,1),l+=4,h(u,l,"sRGB"),l+=4,u[l]=r.sRGB,l++,a(u,l,s(u,l-5,5)),l+=4),r.pHYs!==null&&r.pHYs!==void 0&&(a(u,l,9),l+=4,h(u,l,"pHYs"),l+=4,a(u,l,r.pHYs[0]),l+=4,a(u,l,r.pHYs[1]),l+=4,u[l]=r.pHYs[2],l++,a(u,l,s(u,l-13,13)),l+=4),c&&(a(u,l,8),l+=4,h(u,l,"acTL"),l+=4,a(u,l,n.frames.length),l+=4,a(u,l,r.loop!=null?r.loop:0),l+=4,a(u,l,s(u,l-12,12)),l+=4),n.ctype===3){const b=n.plte.length;a(u,l,b*3),l+=4,h(u,l,"PLTE"),l+=4;for(let S=0;S<b;S++){const E=S*3,_=n.plte[S],x=_&255,P=_>>>8&255,R=_>>>16&255;u[l+E+0]=x,u[l+E+1]=P,u[l+E+2]=R}if(l+=b*3,a(u,l,s(u,l-b*3-4,b*3+4)),l+=4,d){a(u,l,b),l+=4,h(u,l,"tRNS"),l+=4;for(let S=0;S<b;S++)u[l+S]=n.plte[S]>>>24&255;l+=b,a(u,l,s(u,l-b-4,b+4)),l+=4}}let v=0;for(let b=0;b<n.frames.length;b++){const S=n.frames[b];c&&(a(u,l,26),l+=4,h(u,l,"fcTL"),l+=4,a(u,l,v++),l+=4,a(u,l,S.rect.width),l+=4,a(u,l,S.rect.height),l+=4,a(u,l,S.rect.x),l+=4,a(u,l,S.rect.y),l+=4,o(u,l,i[b]),l+=2,o(u,l,1e3),l+=2,u[l]=S.dispose,l++,u[l]=S.blend,l++,a(u,l,s(u,l-30,30)),l+=4);const E=S.cimg,_=E.length;a(u,l,_+(b===0?0:4)),l+=4;const x=l;h(u,l,b===0?"IDAT":"fdAT"),l+=4,b!==0&&(a(u,l,v++),l+=4),u.set(E,l),l+=_,a(u,l,s(u,x,l-x)),l+=4}return a(u,l,0),l+=4,h(u,l,"IEND"),l+=4,a(u,l,s(u,l-4,4)),l+=4,u.buffer},dt.encode.compressPNG=function(n,t,e){for(let i=0;i<n.frames.length;i++){const r=n.frames[i],s=r.rect.height,a=new Uint8Array(s*r.bpl+s);r.cimg=dt.encode._filterZero(r.img,s,r.bpp,r.bpl,a,t,e)}},dt.encode.compress=function(n,t,e,i,r){const s=r[0],a=r[1],o=r[2],h=r[3],l=r[4];let c=6,d=8,f=255;for(let _=0;_<n.length;_++){const x=new Uint8Array(n[_]),P=x.length;for(let R=0;R<P;R+=4)f&=x[R+3]}const u=f!==255,m=dt.encode.framize(n,t,e,s,a,o),v={},b=[],S=[];if(i!==0){const _=[];for(let L=0;L<m.length;L++)_.push(m[L].img.buffer);const x=dt.encode.concatRGBA(_),P=dt.quantize(x,i);let R=0;const F=new Uint8Array(P.abuf);for(let L=0;L<m.length;L++){const $=m[L].img,U=$.length;S.push(new Uint8Array(P.inds.buffer,R>>2,U>>2));for(let z=0;z<U;z+=4)$[z]=F[R+z],$[z+1]=F[R+z+1],$[z+2]=F[R+z+2],$[z+3]=F[R+z+3];R+=U}for(let L=0;L<P.plte.length;L++)b.push(P.plte[L].est.rgba)}else for(let _=0;_<m.length;_++){const x=m[_],P=new Uint32Array(x.img.buffer),R=x.rect.width,F=P.length,L=new Uint8Array(F);S.push(L);for(let $=0;$<F;$++){const U=P[$];if($!==0&&U===P[$-1])L[$]=L[$-1];else if($>R&&U===P[$-R])L[$]=L[$-R];else{let z=v[U];if(z===null&&(v[U]=z=b.length,b.push(U),b.length>=300))break;L[$]=z}}}const E=b.length;E<=256&&l===!1&&(E<=2?d=1:E<=4?d=2:E<=16?d=4:d=8,d=Math.max(d,h));for(let _=0;_<m.length;_++){const x=m[_],P=x.rect.width,R=x.rect.height;let F=x.img,L=4*P,$=4;if(E<=256&&l===!1){L=Math.ceil(d*P/8);const U=new Uint8Array(L*R),z=S[_];for(let q=0;q<R;q++){const K=q*L,Z=q*P;if(d===8)for(let at=0;at<P;at++)U[K+at]=z[Z+at];else if(d===4)for(let at=0;at<P;at++)U[K+(at>>1)]|=z[Z+at]<<4-(at&1)*4;else if(d===2)for(let at=0;at<P;at++)U[K+(at>>2)]|=z[Z+at]<<6-(at&3)*2;else if(d===1)for(let at=0;at<P;at++)U[K+(at>>3)]|=z[Z+at]<<7-(at&7)*1}F=U,c=3,$=1}else if(u===!1&&m.length===1){const U=new Uint8Array(P*R*3),z=P*R;for(let q=0;q<z;q++){const K=q*3,Z=q*4;U[K]=F[Z],U[K+1]=F[Z+1],U[K+2]=F[Z+2]}F=U,c=2,$=3,L=3*P}x.img=F,x.bpl=L,x.bpp=$}return{ctype:c,depth:d,plte:b,frames:m}},dt.encode.framize=function(n,t,e,i,r,s){const a=[];for(let o=0;o<n.length;o++){const h=new Uint8Array(n[o]),l=new Uint32Array(h.buffer);let c,d=0,f=0,u=t,m=e,v=i?1:0;if(o!==0){const b=s||i||o===1||a[o-2].dispose!==0?1:2;let S=0,E=1e9;for(let x=0;x<b;x++){const P=new Uint32Array(n[o-1-x]);let R=t,F=e,L=-1,$=-1;for(let z=0;z<e;z++)for(let q=0;q<t;q++){const K=z*t+q;l[K]!==P[K]&&(q<R&&(R=q),q>L&&(L=q),z<F&&(F=z),z>$&&($=z))}L===-1&&(R=F=L=$=0),r&&((R&1)===1&&R--,(F&1)===1&&F--);const U=(L-R+1)*($-F+1);U<E&&(E=U,S=x,d=R,f=F,u=L-R+1,m=$-F+1)}const _=new Uint8Array(n[o-1-S]);S===1&&(a[o-1].dispose=2),c=new Uint8Array(u*m*4),dt._copyTile(_,t,e,c,u,m,-d,-f,0),v=dt._copyTile(h,t,e,c,u,m,-d,-f,3)?1:0,v===1?dt.encode._prepareDiff(h,t,e,c,{x:d,y:f,width:u,height:m}):dt._copyTile(h,t,e,c,u,m,-d,-f,0)}else c=h.slice(0);a.push({rect:{x:d,y:f,width:u,height:m},img:c,blend:v,dispose:0})}if(i)for(let o=0;o<a.length;o++){const h=a[o];if(h.blend===1)continue;const l=h.rect,c=a[o-1].rect,d=Math.min(l.x,c.x),f=Math.min(l.y,c.y),u=Math.max(l.x+l.width,c.x+c.width),m=Math.max(l.y+l.height,c.y+c.height),v={x:d,y:f,width:u-d,height:m-f};a[o-1].dispose=1,o-1!==0&&dt.encode._updateFrame(n,t,e,a,o-1,v,r),dt.encode._updateFrame(n,t,e,a,o,v,r)}return a},dt.encode._updateFrame=function(n,t,e,i,r,s,a){const o=Uint8Array,h=Uint32Array,l=new o(n[r-1]),c=new h(n[r-1]),d=r+1<n.length?new o(n[r+1]):null,f=new o(n[r]),u=new h(f.buffer);let m=t,v=e,b=-1,S=-1;for(let _=0;_<s.height;_++)for(let x=0;x<s.width;x++){const P=s.x+x,R=s.y+_,F=R*t+P,L=u[F];L===0||i[r-1].dispose===0&&c[F]===L&&(d===null||d[F*4+3]!==0)||(P<m&&(m=P),P>b&&(b=P),R<v&&(v=R),R>S&&(S=R))}b===-1&&(m=v=b=S=0),a&&((m&1)===1&&m--,(v&1)===1&&v--),s={x:m,y:v,width:b-m+1,height:S-v+1};const E=i[r];E.rect=s,E.blend=1,E.img=new Uint8Array(s.width*s.height*4),i[r-1].dispose===0?(dt._copyTile(l,t,e,E.img,s.width,s.height,-s.x,-s.y,0),dt.encode._prepareDiff(f,t,e,E.img,s)):dt._copyTile(f,t,e,E.img,s.width,s.height,-s.x,-s.y,0)},dt.encode._prepareDiff=function(n,t,e,i,r){dt._copyTile(n,t,e,i,r.width,r.height,-r.x,-r.y,2)},dt.encode._filterZero=function(n,t,e,i,r,s,a){const o=[];let h=[0,1,2,3,4];s!==-1?h=[s]:(t*i>5e5||e===1)&&(h=[0]);let l;a&&(l={level:0});const c=r.length>1e7&&Kc!=null?Kc:yv;for(let u=0;u<h.length;u++){for(let m=0;m<t;m++)dt.encode._filterLine(r,n,m,i,e,h[u]);o.push(c.deflate(r,l))}let d,f=1e9;for(let u=0;u<o.length;u++)o[u].length<f&&(d=u,f=o[u].length);return o[d]},dt.encode._filterLine=function(n,t,e,i,r,s){const a=e*i;let o=a+e;const h=dt.decode._paeth;if(n[o]=s,o++,s===0)if(i<500)for(let l=0;l<i;l++)n[o+l]=t[a+l];else n.set(new Uint8Array(t.buffer,a,i),o);else if(s===1){for(let l=0;l<r;l++)n[o+l]=t[a+l];for(let l=r;l<i;l++)n[o+l]=t[a+l]-t[a+l-r]+256&255}else if(e===0){for(let l=0;l<r;l++)n[o+l]=t[a+l];if(s===2)for(let l=r;l<i;l++)n[o+l]=t[a+l];if(s===3)for(let l=r;l<i;l++)n[o+l]=t[a+l]-(t[a+l-r]>>1)+256&255;if(s===4)for(let l=r;l<i;l++)n[o+l]=t[a+l]-h(t[a+l-r],0,0)+256&255}else{if(s===2)for(let l=0;l<i;l++)n[o+l]=t[a+l]+256-t[a+l-i]&255;if(s===3){for(let l=0;l<r;l++)n[o+l]=t[a+l]+256-(t[a+l-i]>>1)&255;for(let l=r;l<i;l++)n[o+l]=t[a+l]+256-(t[a+l-i]+t[a+l-r]>>1)&255}if(s===4){for(let l=0;l<r;l++)n[o+l]=t[a+l]+256-h(0,t[a+l-i],0)&255;for(let l=r;l<i;l++)n[o+l]=t[a+l]+256-h(t[a+l-r],t[a+l-i],t[a+l-r-i])&255}}},dt.crc={table:function(){const n=new Uint32Array(256);for(let t=0;t<256;t++){let e=t;for(let i=0;i<8;i++)e&1?e=3988292384^e>>>1:e=e>>>1;n[t]=e}return n}(),update:function(n,t,e,i){for(let r=0;r<i;r++)n=dt.crc.table[(n^t[e+r])&255]^n>>>8;return n},crc:function(n,t,e){return dt.crc.update(4294967295,n,t,e)^4294967295}},dt.quantize=function(n,t){const e=new Uint8Array(n),i=e.slice(0),r=new Uint32Array(i.buffer),s=dt.quantize.getKDtree(i,t),a=s[0],o=s[1],h=dt.quantize.planeDst,l=e,c=r,d=l.length,f=new Uint8Array(e.length>>2);let u;if(e.length<2e7)for(let m=0;m<d;m+=4){const v=l[m]*.00392156862745098,b=l[m+1]*(1/255),S=l[m+2]*(1/255),E=l[m+3]*(1/255);u=dt.quantize.getNearest(a,v,b,S,E),f[m>>2]=u.ind,c[m>>2]=u.est.rgba}else for(let m=0;m<d;m+=4){const v=l[m]*.00392156862745098,b=l[m+1]*(1/255),S=l[m+2]*(1/255),E=l[m+3]*(1/255);for(u=a;u.left;)u=h(u.est,v,b,S,E)<=0?u.left:u.right;f[m>>2]=u.ind,c[m>>2]=u.est.rgba}return{abuf:i.buffer,inds:f,plte:o}},dt.quantize.getKDtree=function(n,t,e){e===null&&(e=1e-4);const i=new Uint32Array(n.buffer),r={i0:0,i1:n.length,bst:null,est:null,tdst:0,left:null,right:null};r.bst=dt.quantize.stats(n,r.i0,r.i1),r.est=dt.quantize.estats(r.bst);const s=[r];for(;s.length<t;){let a=0,o=0;for(let u=0;u<s.length;u++)s[u].est.L>a&&(a=s[u].est.L,o=u);if(a<e)break;const h=s[o],l=dt.quantize.splitPixels(n,i,h.i0,h.i1,h.est.e,h.est.eMq255);if(h.i0>=l||h.i1<=l){h.est.L=0;continue}const d={i0:h.i0,i1:l,bst:null,est:null,tdst:0,left:null,right:null};d.bst=dt.quantize.stats(n,d.i0,d.i1),d.est=dt.quantize.estats(d.bst);const f={i0:l,i1:h.i1,bst:null,est:null,tdst:0,left:null,right:null};f.bst={R:[],m:[],N:h.bst.N-d.bst.N};for(let u=0;u<16;u++)f.bst.R[u]=h.bst.R[u]-d.bst.R[u];for(let u=0;u<4;u++)f.bst.m[u]=h.bst.m[u]-d.bst.m[u];f.est=dt.quantize.estats(f.bst),h.left=d,h.right=f,s[o]=d,s.push(f)}s.sort(function(a,o){return o.bst.N-a.bst.N});for(let a=0;a<s.length;a++)s[a].ind=a;return[r,s]},dt.quantize.getNearest=function(n,t,e,i,r){if(n.left==null)return n.tdst=dt.quantize.dist(n.est.q,t,e,i,r),n;const s=dt.quantize.planeDst(n.est,t,e,i,r);let a=n.left,o=n.right;s>0&&(a=n.right,o=n.left);const h=dt.quantize.getNearest(a,t,e,i,r);if(h.tdst<=s*s)return h;const l=dt.quantize.getNearest(o,t,e,i,r);return l.tdst<h.tdst?l:h},dt.quantize.planeDst=function(n,t,e,i,r){const s=n.e;return s[0]*t+s[1]*e+s[2]*i+s[3]*r-n.eMq},dt.quantize.dist=function(n,t,e,i,r){const s=t-n[0],a=e-n[1],o=i-n[2],h=r-n[3];return s*s+a*a+o*o+h*h},dt.quantize.splitPixels=function(n,t,e,i,r,s){const a=dt.quantize.vecDot;for(i-=4;e<i;){for(;a(n,e,r)<=s;)e+=4;for(;a(n,i,r)>s;)i-=4;if(e>=i)break;const o=t[e>>2];t[e>>2]=t[i>>2],t[i>>2]=o,e+=4,i-=4}for(;a(n,e,r)>s;)e-=4;return e+4},dt.quantize.vecDot=function(n,t,e){return n[t]*e[0]+n[t+1]*e[1]+n[t+2]*e[2]+n[t+3]*e[3]},dt.quantize.stats=function(n,t,e){const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=[0,0,0,0],s=e-t>>2;for(let a=t;a<e;a+=4){const o=n[a]*.00392156862745098,h=n[a+1]*(1/255),l=n[a+2]*(1/255),c=n[a+3]*(1/255);r[0]+=o,r[1]+=h,r[2]+=l,r[3]+=c,i[0]+=o*o,i[1]+=o*h,i[2]+=o*l,i[3]+=o*c,i[5]+=h*h,i[6]+=h*l,i[7]+=h*c,i[10]+=l*l,i[11]+=l*c,i[15]+=c*c}return i[4]=i[1],i[8]=i[2],i[9]=i[6],i[12]=i[3],i[13]=i[7],i[14]=i[11],{R:i,m:r,N:s}},dt.quantize.estats=function(n){const t=n.R,e=n.m,i=n.N,r=e[0],s=e[1],a=e[2],o=e[3],h=i===0?0:1/i,l=[t[0]-r*r*h,t[1]-r*s*h,t[2]-r*a*h,t[3]-r*o*h,t[4]-s*r*h,t[5]-s*s*h,t[6]-s*a*h,t[7]-s*o*h,t[8]-a*r*h,t[9]-a*s*h,t[10]-a*a*h,t[11]-a*o*h,t[12]-o*r*h,t[13]-o*s*h,t[14]-o*a*h,t[15]-o*o*h],c=l,d=dt.M4;let f=[Math.random(),Math.random(),Math.random(),Math.random()],u=0,m=0;if(i!==0)for(let S=0;S<16&&(f=d.multVec(c,f),m=Math.sqrt(d.dot(f,f)),f=d.sml(1/m,f),!(S!==0&&Math.abs(m-u)<1e-9));S++)u=m;const v=[r*h,s*h,a*h,o*h],b=d.dot(d.sml(255,v),f);return{Cov:l,q:v,e:f,L:u,eMq255:b,eMq:d.dot(f,v),rgba:(Math.round(255*v[3])<<24|Math.round(255*v[2])<<16|Math.round(255*v[1])<<8|Math.round(255*v[0])<<0)>>>0}},dt.M4={multVec:function(n,t){return[n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3],n[4]*t[0]+n[5]*t[1]+n[6]*t[2]+n[7]*t[3],n[8]*t[0]+n[9]*t[1]+n[10]*t[2]+n[11]*t[3],n[12]*t[0]+n[13]*t[1]+n[14]*t[2]+n[15]*t[3]]},dot:function(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]},sml:function(n,t){return[n*t[0],n*t[1],n*t[2],n*t[3]]}},dt.encode.concatRGBA=function(n){let t=0;for(let r=0;r<n.length;r++)t+=n[r].byteLength;const e=new Uint8Array(t);let i=0;for(let r=0;r<n.length;r++){const s=new Uint8Array(n[r]),a=s.length;for(let o=0;o<a;o+=4){let h=s[o],l=s[o+1],c=s[o+2];const d=s[o+3];d===0&&(h=l=c=0),e[i+o]=h,e[i+o+1]=l,e[i+o+2]=c,e[i+o+3]=d}i+=a}return e.buffer};const wv=dt,La=new Map,Mh=(n,t)=>{if(La.has(n))return t(null,La.get(n));const e=new Image;e.onload=function(){La.set(n,{width:e.width,height:e.height,element:e}),t(null,La.get(n))},e.onerror=function(i){t(i,null)},e.src=n},bv=(n,t)=>{for(let e=0,i=n.length;e<i;e++){const r=n[e],{type:s}=r;if(s.split("/")[0]!=="image")return;const o=new FileReader;o.onload=function(h){if(!h.target)return t("no reader target",null);const l=h.target.result,c=Ol(l),d=new Blob([l]);Rh(d,(f,u)=>{if(!u)return t(f,null);Mh(u,(m,v)=>{if(!v)return t(m,null);yf(u,(b,S)=>{if(!S)return t(b,null);const E={name:r.name,fileType:c,size:r.size,width:v.width,height:v.height,imgUrl:u,imageData:S,blob:d};return t(null,E)})})})},o.readAsArrayBuffer(r)}},yf=(n,t)=>{Mh(n,(e,i)=>{if(!i)return t(e,null);const r=document.createElement("canvas"),s=r.getContext("2d");r.width=i.width,r.height=i.height,s.drawImage(i.element,0,0,r.width,r.height);const a=s.getImageData(0,0,r.width,r.height);return t(null,a)})},xv=(n,t=0,e=0)=>{const i=document.createElement("canvas"),r=i.getContext("2d");return i.width=t,i.height=e,r.drawImage(n,0,0,t,e),r.getImageData(0,0,t,e)},Sv=(n,t=0,e=0)=>{const i=document.createElement("canvas"),r=i.getContext("2d");return i.width=t,i.height=e,r.drawImage(n,0,0,t,e),r.getImageData(0,0,t,e)},Cv=n=>{const t=n.width,e=n.height,i=t*e*3,r=i+54,s=[66,77,r&255,r>>8&255,r>>16&255,r>>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,i&255,i>>8&255,i>>16&255,i>>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=n.data;let l="";const c=t<<2;let d=e;const f=String.fromCharCode;do{const m=c*(d-1);let v="";for(let b=0;b<t;b++){const S=b<<2;v+=f(h[m+S+2])+f(h[m+S+1])+f(h[m+S])}for(let b=0;b<o;b++)v+=String.fromCharCode(0);l+=v}while(--d);function u(m){if(!window.btoa)throw"btoa undefined";let v="";if(typeof m=="string")v=m;else for(let b=0;b<m.length;b++)v+=String.fromCharCode(m[b]);return btoa(v)}return u(s.concat(a))+u(l)},Tv=n=>{const{width:t,height:e}=n,i=document.createElement("canvas"),r=i.getContext("2d");return i.width=t,i.height=e,r.putImageData(n,0,0,0,0,t,e),i.toDataURL("image/png")},kv=(n,t,e)=>{const{width:i,height:r}=n,s=document.createElement("canvas"),a=s.getContext("2d");s.width=i,s.height=r,a.putImageData(n,0,0,0,0,i,r);const o=`image/${t?t.toLowerCase():"png"}`;s.toBlob(h=>{e?.(null,h)},o,1)},Rh=(n,t)=>{const e=new FileReader;e.onload=function(i){i.target?t(null,i.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(n)},Ev=(n,t)=>{Rh(n,function(e,i){if(i){const r=new Image;r.src=i}else t(e)})};function Pv(n){const t=[],e=[],i=[];let r=0;for(let h=0,l=n.data.length;h<l;h+=4)t[r]=n.data[h],e[r]=n.data[h+1],i[r]=n.data[h+2],r+=1;const s=Dh(t),a=Dh(e),o=Dh(i);return"rgb("+s+","+a+","+o+")"}function Dh(n){const t={},e=[],i=[];for(let o=0;o<n.length;o++)t[n[o]]?e.push(n[o]):t[n[o]]=1;let r=0;for(let o=0;o<e.length;o++){r=0;for(let h=0;h<e.length;h++)e[o]===e[h]&&(r+=1),i[o]=r}const s=Math.max.apply(null,i);let a=0;for(;a<i.length;a++)if(i[a]===s)return;return e[a]}const Av=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=t[(a*e+e-o-1)*4],r[h+1]=t[(a*e+e-o-1)*4+1],r[h+2]=t[(a*e+e-o-1)*4+2],r[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(r,e,i)},Mv=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=t[((i-a-1)*e+o)*4],r[h+1]=t[((i-a-1)*e+o)*4+1],r[h+2]=t[((i-a-1)*e+o)*4+2],r[h+3]=t[((i-a-1)*e+o)*4+3]}return new ImageData(r,e,i)},Rv=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<i;o++){const h=(a*i+o)*4;r[h]=t[(o*e+e-a-1)*4],r[h+1]=t[(o*e+e-a-1)*4+1],r[h+2]=t[(o*e+e-a-1)*4+2],r[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(r,i,e)},Dv=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<i;o++){const h=(a*i+o)*4;r[h]=t[((i-o-1)*e+a)*4],r[h+1]=t[((i-o-1)*e+a)*4+1],r[h+2]=t[((i-o-1)*e+a)*4+2],r[h+3]=t[((i-o-1)*e+a)*4+3]}return new ImageData(r,i,e)},Lv=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=(t[h]+t[h+1]+t[h+2])/3;r[h]=l,r[h+1]=l,r[h+2]=l,r[h+3]=t[h+3]}return new ImageData(r,e,i)},Iv=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=.2126*t[h]+.7152*t[h+1]+.0722*t[h+2];r[h]=l,r[h+1]=l,r[h+2]=l,r[h+3]=t[h+3]}return new ImageData(r,e,i)},Ov=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1]+t[h+2])/3>127?255:0;r[h]=c,r[h+1]=c,r[h+2]=c,r[h+3]=t[h+3]}return new ImageData(r,e,i)},Fv=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=255-t[h],r[h+1]=255-t[h+1],r[h+2]=255-t[h+2],r[h+3]=t[h+3]}return new ImageData(r,e,i)},Nv=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=t[h],r[h+1]=0,r[h+2]=0,r[h+3]=t[h+3]}return new ImageData(r,e,i)},Gv=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=0,r[h+1]=t[h+1],r[h+2]=0,r[h+3]=t[h+3]}return new ImageData(r,e,i)},Uv=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=0,r[h+1]=0,r[h+2]=t[h+2],r[h+3]=t[h+3]}return new ImageData(r,e,i)},Bv=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=t[h],r[h+1]=t[h+1],r[h+2]=0,r[h+3]=t[h+3]}return new ImageData(r,e,i)},zv=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=t[h],r[h+1]=0,r[h+2]=t[h+1],r[h+3]=t[h+3]}return new ImageData(r,e,i)},$v=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=0,r[h+1]=t[h+1],r[h+2]=t[h+1],r[h+3]=t[h+3]}return new ImageData(r,e,i)},Vv=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=(t[h+1]+t[h+2])/2;r[h]=t[h],r[h+1]=l,r[h+2]=l,r[h+3]=t[h+3]}return new ImageData(r,e,i)},Hv=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=(t[h]+t[h+2])/2;r[h]=l,r[h+1]=t[h+1],r[h+2]=l,r[h+3]=t[h+3]}return new ImageData(r,e,i)},jv=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=(t[h]+t[h+1])/2;r[h]=l,r[h+1]=l,r[h+2]=t[h+2],r[h+3]=t[h+3]}return new ImageData(r,e,i)},Xv=n=>wf(n,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Yv=n=>wf(n,[-1,-1,-1,-1,8,-1,-1,-1,-1]),qv=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;r[h]=t[h],r[h+1]=t[h+1],r[h+2]=t[h+2],r[h+3]=255}return new ImageData(r,e,i)},Wv=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;if(t[h+3]===0)r[h]=255,r[h+1]=255,r[h+2]=255,r[h+3]=255;else{const l=bf([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);r[h]=l[0],r[h+1]=l[1],r[h+2]=l[2],r[h+3]=l[3]}}return new ImageData(r,e,i)},Kv=(n,t,e,i,r,s=!1,a)=>{const{data:o,width:h,height:l}=n;let c=r,d=i,f=t,u=e;if(c<0?c=0:c>h&&(c=h),d<0?d=0:d>l&&(d=l),f<1?f=1:f>h&&(f=h),u<1?u=1:u>l&&(u=l),c+f>h&&(f=h-c),d+u>l&&(u=l-d),s){const m=new Uint8ClampedArray(o.length);for(let b=0;b<l;b++)for(let S=0;S<h;S++){const E=(b*h+S)*4;S>=c&&S<=c+f&&b>=d&&b<=d+u?(m[E]=o[E],m[E+1]=o[E+1],m[E+2]=o[E+2],m[E+3]=o[E+3]):(m[E]=255,m[E+1]=255,m[E+2]=255,m[E+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(m,h,l)}else{const m=new Uint8ClampedArray(f*u*4);for(let b=d;b<=d+u;b++)for(let S=c;S<=c+f;S++){const E=((b-d)*f+S-c)*4,_=(b*h+S)*4;m[E]=o[_],m[E+1]=o[_+1],m[E+2]=o[_+2],m[E+3]=o[_+3]}return new ImageData(m,f,u)}},Zv=(n,t,e,i)=>{const{data:r,width:s,height:a}=n;let o=t;o>Math.floor(s/2)&&(o=Math.floor(s/2)),o>Math.floor(a/2)&&(o=Math.floor(a/2)),o<0&&(o=0);const h=new Uint8ClampedArray(r.length);for(let c=0;c<a;c++)for(let d=0;d<s;d++){const f=(c*s+d)*4;let u=-1;d<o?c<o?u=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(o-c-1,2)):c>a-o-1&&(u=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(c-(a-o),2))):d>s-o-1&&(c<o?u=Math.sqrt(Math.pow(d-(s-o),2)+Math.pow(o-c-1,2)):c>a-o-1&&(u=Math.sqrt(Math.pow(d-(s-o),2)+Math.pow(c-(a-o),2)))),Math.round(u)>o?(h[f]=255,h[f+1]=255,h[f+2]=255,h[f+3]=i||e.toUpperCase()==="PNG"?0:255):(h[f]=r[f],h[f+1]=r[f+1],h[f+2]=r[f+2],h[f+3]=i||e.toUpperCase()==="PNG"?r[f+3]:255)}return new ImageData(h,s,a)},Jv=(n,t,e,i,r,s=1e4)=>{const a=new Image;a.src=n;const o=document.createElement("canvas"),h=o.getContext("2d");return o.width=s,o.height=s,h.drawImage(a,0,0,t,e,0,0,i,r),h.getImageData(0,0,i,r)},Qv=(n,t)=>{const{data:e,width:i,height:r}=n,s=new Uint8ClampedArray(e.length);for(let o=0;o<r;o++)for(let h=0;h<i;h++){const l=(o*i+h)*4;s[l]=Math.max(Math.min(e[l]+t,255),0),s[l+1]=Math.max(Math.min(e[l+1]+t,255),0),s[l+2]=Math.max(Math.min(e[l+2]+t,255),0),s[l+3]=e[l+3]}return new ImageData(s,i,r)},t_=(n,t,e=!1)=>{const{data:i,width:r,height:s}=n,a=new Uint8ClampedArray(i.length);for(let h=0;h<s;h++)for(let l=0;l<r;l++){const c=(h*r+l)*4;i[c+3]===0?(a[c]=255,a[c+1]=255,a[c+2]=255):(a[c]=i[c],a[c+1]=i[c+1],a[c+2]=i[c+2]);let d=i[c+3];e?d=Math.max(Math.min(Math.floor(255*t),255),0):d=Math.max(Math.min(Math.floor(d+255*t),255),0),a[c+3]=d}return new ImageData(a,r,s)},e_=(n,t,e,i)=>{const{data:r,width:s,height:a}=n,{data:o,width:h,height:l}=t;let c=e,d=i;e+l>a&&(c=a-l),i+h>s&&(d=s-h);const f=new Uint8ClampedArray(r.length);for(let m=0;m<a;m++)for(let v=0;v<s;v++){const b=(m*s+v)*4;if(v<d||v>d+h||m<=c||m>=c+l)f[b]=r[b],f[b+1]=r[b+1],f[b+2]=r[b+2],f[b+3]=r[b+3];else{const S=(m*s+v-((c+1)*s+(m-(c+1))*(s-h))+h-d-1)*4,E=[o[S],o[S+1],o[S+2],o[S+3]],_=[r[b],r[b+1],r[b+2],r[b+3]],x=bf(E,_);f[b]=x[0],f[b+1]=x[1],f[b+2]=x[2],f[b+3]=x[3]}}return new ImageData(f,s,a)},i_=(n,t,e,i,r,s=10)=>{const{data:a,width:o,height:h}=n;let l=r,c=i,d=t,f=e;l<0?l=0:l>o&&(l=o),c<0?c=0:c>h&&(c=h),d<1?d=1:d>o&&(d=o),f<1?f=1:f>h&&(f=h),l+d>o&&(d=o-l),c+f>h&&(f=h-c);const u=new Uint8ClampedArray(a.length);for(let v=0;v<h;v++)for(let b=0;b<o;b++){const S=(v*o+b)*4;if(b>=l&&b<=l+d&&v>=c&&v<=c+f){const E=Math.floor((b-l)/s),_=Math.floor((v-c)/s);let x=Math.floor(s*(E+1)-s/2+l),P=Math.floor(s*(_+1)-s/2+c);x>o-1&&(x=o-1),P>h-1&&(P=h-1);const R=(P*o+x)*4;u[S]=a[R],u[S+1]=a[R+1],u[S+2]=a[R+2],u[S+3]=a[R+3]}else u[S]=a[S],u[S+1]=a[S+1],u[S+2]=a[S+2],u[S+3]=a[S+3]}return new ImageData(u,o,h)},n_=async(n,t,e,i,r,s)=>{const a=r/100;if(["JPG","JPEG"].includes(i.toUpperCase())){const o=new Image;o.src=n;const h=document.createElement("canvas"),l=h.getContext("2d");h.width=t,h.height=e,l.drawImage(o,0,0,t,e),h.toBlob(c=>{s(c)},`image/${i.toLowerCase()}`,a)}else{const o=Math.floor(a*256),h=wv.encode([n.data.buffer],t,e,o),l=new Blob([h]);s&&s(l)}},r_=(n,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}})=>{if(t&&e){const{data:i,width:r,height:s}=n,{data:a}=t,o=new Uint8ClampedArray(i.length),{backgroundColor:h,changeIntoColor:l}=e;for(let d=0;d<s;d++)for(let f=0;f<r;f++){const u=(d*r+f)*4,m=a[u],v=a[u+1],b=a[u+2],S=a[u+3];m===h.r&&v===h.g&&b===h.b&&S===h.a&&l.a!==0?(o[u]=l.r,o[u+1]=l.g,o[u+2]=l.b,o[u+3]=l.a):(o[u]=i[u],o[u+1]=i[u+1],o[u+2]=i[u+2],o[u+3]=i[u+3])}return new ImageData(o,r,s)}return n},wf=(n,t)=>{const{data:e,width:i,height:r}=n,s=new Uint8ClampedArray(e.length);for(let o=0;o<r;o++)for(let h=0;h<i;h++){const l=(o*i+h)*4;for(let c=0;c<3;c++){const d=l+c;h===0||h===i-1||o===0||o===r-1?s[d]=e[d]:s[d]=t[0]*e[d-i*4-4]+t[1]*e[d-i*4]+t[2]*e[d-i*4+4]+t[3]*e[d-4]+t[4]*e[d]+t[5]*e[d+4]+t[6]*e[d+i*4-4]+t[7]*e[d+i*4]+t[8]*e[d+i*4+4]}s[l+3]=e[l+3]}return new ImageData(s,i,r)},bf=(n,t)=>{if(n&&n.length===4&&t&&t.length===4){const e=n[3],i=t[3];if(e===255||i===0)return n;if(e===0)return t;{const r=e/255,s=i/255,a=Math.max(Math.min(Math.floor(n[0]*r+t[0]*s*(1-r)),255),0),o=Math.max(Math.min(Math.floor(n[1]*r+t[1]*s*(1-r)),255),0),h=Math.max(Math.min(Math.floor(n[2]*r+t[2]*s*(1-r)),255),0),l=Math.max(Math.min(Math.floor((r+s*(1-r))*255),255),0);return[a,o,h,l]}}return[255,255,255,255]},xf=function(n,t,e){const i=new Array(n*n),r=function(o){const h=o;let l=0,c=0;return{write(d,f){if(d>>>f)throw new Error("length over");for(;l+f>=8;)h.writeByte(255&(d<<l|c)),f-=8-l,d>>>=8-l,c=0,l=0;c=d<<l|c,l=l+f},flush(){l>0&&h.writeByte(c)}}},s=function(o){const h=1<<o,l=(1<<o)+1;let c=o+1;const d=a();for(let b=0;b<h;b++)d.add(String.fromCharCode(b));d.add(String.fromCharCode(h)),d.add(String.fromCharCode(l));const f=Fl(),u=r(f);u.write(h,c);let m=0,v=String.fromCharCode(i[m]);for(m+=1;m<i.length;){const b=String.fromCharCode(i[m]);m+=1,d.contains(v+b)?v=v+b:(u.write(d.indexOf(v),c),d.size()<4095&&(d.size()==1<<c&&(c+=1),d.add(v+b)),v=b)}return u.write(d.indexOf(v),c),u.write(l,c),u.flush(),f.toByteArray()},a=function(){const o={};let h=0;return{add(l){if(this.contains(l))throw new Error("dup key:"+l);o[l]=h,h+=1},size(){return h},indexOf(l){return o[l]},contains(l){return typeof o[l]<"u"}}};return{setPixel(o,h,l){i[h*n+o]=l},write(o){o.writeString("GIF87a"),o.writeShort(n),o.writeShort(n),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte($n("0x"+t[1]+t[2])),o.writeByte($n("0x"+t[3]+t[4])),o.writeByte($n("0x"+t[5]+t[6])),o.writeByte($n("0x"+e[1]+e[2])),o.writeByte($n("0x"+e[3]+e[4])),o.writeByte($n("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(n),o.writeShort(n),o.writeByte(0);const h=2,l=s(h);o.writeByte(h);let c=0;for(;l.length-c>255;)o.writeByte(255),o.writeBytes(l,c,255),c+=255;o.writeByte(l.length-c),o.writeBytes(l,c,l.length-c),o.writeByte(0),o.writeString(";")}}},Sf=function(n,t,e,i){const r=xf(n,t,e);for(let l=0;l<n;l++)for(let c=0;c<n;c++)r.setPixel(c,l,i(c,l));const s=Fl();r.write(s);const a=L1(),o=s.toByteArray();for(let l=0,c=o.length;l<c;l++)a.writeByte(o[l]);a.flush();let h="";return h+="data:image/gif;base64,",h+=a,h},Ne={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Qr={M:0,L:1,H:2,Q:3},Wi={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},pe={glog:function(n){if(n<1)throw new Error("glog("+n+")");return pe.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return pe.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let n=0;n<8;n++)pe.EXP_TABLE[n]=1<<n;for(let n=8;n<256;n++)pe.EXP_TABLE[n]=pe.EXP_TABLE[n-4]^pe.EXP_TABLE[n-5]^pe.EXP_TABLE[n-6]^pe.EXP_TABLE[n-8];for(let n=0;n<255;n++)pe.LOG_TABLE[pe.EXP_TABLE[n]]=n;const ie={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(n){let t=n<<10;for(;ie.getBCHDigit(t)-ie.getBCHDigit(ie.G15)>=0;)t^=ie.G15<<ie.getBCHDigit(t)-ie.getBCHDigit(ie.G15);return(n<<10|t)^ie.G15_MASK},getBCHTypeNumber:function(n){let t=n<<12;for(;ie.getBCHDigit(t)-ie.getBCHDigit(ie.G18)>=0;)t^=ie.G18<<ie.getBCHDigit(t)-ie.getBCHDigit(ie.G18);return n<<12|t},getBCHDigit:function(n){let t=0;for(;n!=0;)t++,n>>>=1;return t},getPatternPosition:function(n){return ie.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,t,e){switch(n){case Wi.PATTERN000:return(t+e)%2==0;case Wi.PATTERN001:return t%2==0;case Wi.PATTERN010:return e%3==0;case Wi.PATTERN011:return(t+e)%3==0;case Wi.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case Wi.PATTERN101:return t*e%2+t*e%3==0;case Wi.PATTERN110:return(t*e%2+t*e%3)%2==0;case Wi.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){let t=new er([1],0);for(let e=0;e<n;e++)t=t.multiply(new er([1,pe.gexp(e)],0));return t},getLengthInBits:function(n,t){if(1<=t&&t<10)switch(n){case Ne.MODE_NUMBER:return 10;case Ne.MODE_ALPHA_NUM:return 9;case Ne.MODE_8BIT_BYTE:return 8;case Ne.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(t<27)switch(n){case Ne.MODE_NUMBER:return 12;case Ne.MODE_ALPHA_NUM:return 11;case Ne.MODE_8BIT_BYTE:return 16;case Ne.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(t<41)switch(n){case Ne.MODE_NUMBER:return 14;case Ne.MODE_ALPHA_NUM:return 13;case Ne.MODE_8BIT_BYTE:return 16;case Ne.MODE_KANJI:return 12;default:throw new Error("mode:"+n)}else throw new Error("type:"+t)},getLostPoint:function(n){const t=n.getModuleCount();let e=0;for(let s=0;s<t;s++)for(let a=0;a<t;a++){let o=0;const h=n.isDark(s,a);for(let l=-1;l<=1;l++)if(!(s+l<0||t<=s+l))for(let c=-1;c<=1;c++)a+c<0||t<=a+c||l==0&&c==0||h==n.isDark(s+l,a+c)&&o++;o>5&&(e+=3+o-5)}for(let s=0;s<t-1;s++)for(let a=0;a<t-1;a++){let o=0;n.isDark(s,a)&&o++,n.isDark(s+1,a)&&o++,n.isDark(s,a+1)&&o++,n.isDark(s+1,a+1)&&o++,(o==0||o==4)&&(e+=3)}for(let s=0;s<t;s++)for(let a=0;a<t-6;a++)n.isDark(s,a)&&!n.isDark(s,a+1)&&n.isDark(s,a+2)&&n.isDark(s,a+3)&&n.isDark(s,a+4)&&!n.isDark(s,a+5)&&n.isDark(s,a+6)&&(e+=40);for(let s=0;s<t;s++)for(let a=0;a<t-6;a++)n.isDark(a,s)&&!n.isDark(a+1,s)&&n.isDark(a+2,s)&&n.isDark(a+3,s)&&n.isDark(a+4,s)&&!n.isDark(a+5,s)&&n.isDark(a+6,s)&&(e+=40);let i=0;for(let s=0;s<t;s++)for(let a=0;a<t;a++)n.isDark(a,s)&&i++;const r=Math.abs(100*i/t/t-50)/5;return e+=r*10,e}};class er{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let i=0;for(;i<t.length&&t[i]==0;)i++;this.num=new Array(t.length-i+e);for(let r=0;r<t.length-i;r++)this.num[r]=t[r+i]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let i=0;i<this.getLength();i++)for(let r=0;r<t.getLength();r++)e[i+r]^=pe.gexp(pe.glog(this.get(i))+pe.glog(t.get(r)));return new er(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=pe.glog(this.get(0))-pe.glog(t.get(0)),i=new Array(this.getLength());for(let r=0;r<this.getLength();r++)i[r]=this.get(r);for(let r=0;r<t.getLength();r++)i[r]^=pe.gexp(pe.glog(t.get(r))+e);return new er(i,0).mod(t)}}class bi{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 i=bi.getRsBlockTable(t,e);if(i==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const r=i.length/3,s=[];for(let a=0;a<r;a++){const o=i[a*3+0],h=i[a*3+1],l=i[a*3+2];for(let c=0;c<o;c++)s.push(new bi(h,l))}return s}static getRsBlockTable(t,e){switch(e){case Qr.L:return bi.RS_BLOCK_TABLE[(t-1)*4+0];case Qr.M:return bi.RS_BLOCK_TABLE[(t-1)*4+1];case Qr.Q:return bi.RS_BLOCK_TABLE[(t-1)*4+2];case Qr.H:return bi.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Cf{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 i=0;i<e;i++)this.putBit((t>>>e-i-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 s_{mode;data;constructor(t){this.mode=Ne.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,i=this.data.length;e<i;e++)t.put(this.data.charCodeAt(e),8)}}class Ki{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Qr[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new s_(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=bi.getRSBlocks(t,this.errorCorrectLevel),i=new Cf;let r=0;for(let s=0;s<e.length;s++)r+=e[s].dataCount;for(let s=0;s<this.dataList.length;s++){const a=this.dataList[s];i.put(a.mode,4),i.put(a.getLength(),ie.getLengthInBits(a.mode,t)),a.write(i)}if(i.getLengthInBits()<=r*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 i=0;i<this.moduleCount;i++){this.modules[i]=new Array(this.moduleCount);for(let r=0;r<this.moduleCount;r++)this.modules[i][r]=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=Ki.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let i=-1;i<=7;i++)if(!(t+i<=-1||this.moduleCount<=t+i))for(let r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(0<=i&&i<=6&&(r==0||r==6)||0<=r&&r<=6&&(i==0||i==6)||2<=i&&i<=4&&2<=r&&r<=4?this.modules[t+i][e+r]=!0:this.modules[t+i][e+r]=!1)}getBestMaskPattern(){let t=0,e=0;for(let i=0;i<8;i++){this.makeImpl(!0,i);const r=ie.getLostPoint(this);(i==0||t>r)&&(t=r,e=i)}return e}createMovieClip(t,e,i){const r=t.createEmptyMovieClip(e,i),s=1;this.make();for(let a=0;a<this.modules.length;a++){const o=a*s;for(let h=0;h<this.modules[a].length;h++){const l=h*s;this.modules[a][h]&&(r.beginFill(0,100),r.moveTo(l,o),r.lineTo(l+s,o),r.lineTo(l+s,o+s),r.lineTo(l,o+s),r.endFill())}}return r}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=ie.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let i=0;i<t.length;i++){const r=t[e],s=t[i];if(this.modules[r][s]==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[r+a][s+o]=!0:this.modules[r+a][s+o]=!1}}setupTypeNumber(t){const e=ie.getBCHTypeNumber(this.typeNumber);for(let i=0;i<18;i++){const r=!t&&(e>>i&1)==1;this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=r}for(let i=0;i<18;i++){const r=!t&&(e>>i&1)==1;this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=r}}setupTypeInfo(t,e){const i=this.errorCorrectLevel<<3|e,r=ie.getBCHTypeInfo(i);for(let s=0;s<15;s++){const a=!t&&(r>>s&1)==1;s<6?this.modules[s][8]=a:s<8?this.modules[s+1][8]=a:this.modules[this.moduleCount-15+s][8]=a}for(let s=0;s<15;s++){const a=!t&&(r>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=a:s<9?this.modules[8][15-s-1+1]=a:this.modules[8][15-s-1]=a}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let i=-1,r=this.moduleCount-1,s=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[r][o-h]==null){let l=!1;a<t.length&&(l=(t[a]>>>s&1)==1),ie.getMask(e,r,o-h)&&(l=!l),this.modules[r][o-h]=l,s--,s==-1&&(a++,s=7)}if(r+=i,r<0||this.moduleCount<=r){r-=i,i=-i;break}}}static createData(t,e,i){const r=bi.getRSBlocks(t,e),s=new Cf;for(let o=0;o<i.length;o++){const h=i[o];s.put(h.mode,4),s.put(h.getLength(),ie.getLengthInBits(h.mode,t)),h.write(s)}let a=0;for(let o=0;o<r.length;o++)a+=r[o].dataCount;if(s.getLengthInBits()>a*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+a*8+")");for(s.getLengthInBits()+4<=a*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=a*8||(s.put(Ki.PAD0,8),s.getLengthInBits()>=a*8));)s.put(Ki.PAD1,8);return Ki.createBytes(s,r)}static createBytes(t,e){let i=0,r=0,s=0;const a=new Array(e.length),o=new Array(e.length);for(let d=0;d<e.length;d++){const f=e[d].dataCount,u=e[d].totalCount-f;r=Math.max(r,f),s=Math.max(s,u),a[d]=new Array(f);for(let S=0;S<a[d].length;S++)a[d][S]=255&t.buffer[S+i];i+=f;const m=ie.getErrorCorrectPolynomial(u),b=new er(a[d],m.getLength()-1).mod(m);o[d]=new Array(m.getLength()-1);for(let S=0;S<o[d].length;S++){const E=S+b.getLength()-o[d].length;o[d][S]=E>=0?b.get(E):0}}let h=0;for(let d=0;d<e.length;d++)h+=e[d].totalCount;const l=new Array(h);let c=0;for(let d=0;d<r;d++)for(let f=0;f<e.length;f++)d<a[f].length&&(l[c++]=a[f][d]);for(let d=0;d<s;d++)for(let f=0;f<e.length;f++)d<o[f].length&&(l[c++]=o[f][d]);return l}}const Tf=Math.ceil,ts=Math.floor,kf=Math.round;function a_(n,t){const e=Il(n),i=t?.ecc||"H",r=t?.size||256,s=-1,a=t?.padding||0,o=t?.color||"#000000",h=t?.background||"#ffffff",l=new Ki(s,i);l.addData(e),l.make();const c=l.getModuleCount(),d=(r-a*2)/c,f=a,u=r-a;return Sf(r,o,h,function(m,v){if(f<=m&&m<u&&f<=v&&v<u){const b=ts((m-f)/d),S=ts((v-f)/d);return l.isDark(S,b)?0:1}else return 1})}function o_(n,t){const e=t.x||0,i=t.y||0,r=Il(n),s=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?ts(t.size):256,h=t.padding||0,l=-1,c=t.color||"#000000",d=t.background||"#ffffff",f=new Ki(l,a);f.addData(r),f.make();const u=f.getModuleCount(),m=(o-h*2)/u;s.fillStyle=d,s.fillRect(e,i,o,o);for(let v=0;v<u;v++)for(let b=0;b<u;b++){const S=Tf((b+1)*m)-ts(b*m),E=Tf((v+1)*m)-ts(v*m);s.fillStyle=f.isDark(v,b)?c:d,s.fillRect(e+kf(b*m)+h,i+kf(v*m)+h,S,E)}}function Lh(){let n=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0;e<t.length;e++)try{n=new window.ActiveXObject(t[e]);break}catch{continue}}else n=new XMLHttpRequest;return n}function h_(n){if(!n.action)return{url:"",data:"",boundary:""};const t=n.method.toLowerCase()==="get",e=n.method.toLowerCase()==="post";let i=n.action,r="";const s="---------------------------"+Date.now().toString(16);if(window.FormData)r=new FormData(n),t&&(i=wa(i,Qo(r)));else if(t){let a="";for(let o=0;o<n.elements.length;o++){const h=n.elements[o];if(!h.hasAttribute("name"))continue;const l=h.nodeName.toUpperCase()==="INPUT"?h.getAttribute("type")?.toUpperCase():"TEXT";if(l==="FILE")for(let c=0,d=h.files?.length??0;c<d;a+="&"+encodeURIComponent(h.name)+"="+encodeURIComponent(h.files?.[c++].name??""));else(l!=="RADIO"&&l!=="CHECKBOX"||h.checked)&&(a+="&"+encodeURIComponent(h.name)+"="+encodeURIComponent(h.value))}i=wa(i,a)}else if(e){const a=[];if(n.enctype==="application/x-www-form-urlencoded"){for(let o=0;o<n.elements.length;o++){const h=n.elements[o];h.hasAttribute("name")&&a.push(encodeURIComponent(h.name)+"="+encodeURIComponent(h.value))}r=a.join("&")}else if(n.enctype==="text/plain"){for(let o=0;o<n.elements.length;o++){const h=n.elements[o];h.hasAttribute("name")&&a.push(h.name+"="+h.value)}r=a.join(`\r
30
- `)}else if(n.enctype==="multipart/form-data"){for(let o=0;o<n.elements.length;o++){const h=n.elements[o];if(!h.hasAttribute("name"))continue;if((h.nodeName.toUpperCase()==="INPUT"?h.getAttribute("type")?.toUpperCase():"TEXT")==="FILE")for(let c=0,d=h.files?.length??0;c<d;c++){const f=h.files?.[c];a.push('Content-Disposition: form-data; name="'+h.name+'"; filename="'+f?.name+`"\r
31
- Content-Type: `+f?.type+`\r
29
+ })`}static safeHtml(t,e="encode"){const i={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"};for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t=t.replace(new RegExp(e=="decode"?r:i[r],"g"),e=="decode"?i[r]:r));return t}static loadScript(t,e=()=>{},i=(r,s,a,o,l)=>{}){const r=document.createElement("script");r.type="text/javascript",r.src=t,r.async=!1,document.body.appendChild(r),r.onload=e,r.onerror=i}static loadStyle(t){const e=document.createElement("link");e.rel="stylesheet",e.href=t,document.head.insertBefore(e,document.head.childNodes[document.head.childNodes.length-1].nextSibling)}static waitForStyleSheetsLoaded=()=>new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let i=document.styleSheets.length??0;const r=()=>i>=e.length?(t(),!0):!1;r()||e.forEach(s=>{s.onload=()=>{i+=1,r()}})});static lazyloadImages(){const t=document.getElementsByTagName("img"),e=qi().height;let i=0;return()=>{for(let r=i;r<t.length;r++)t[r].getBoundingClientRect().top<e&&(t[r].src=t[r].getAttribute("data-src")??"",i=r+1)}}static iframePostMessage(t,e="http://test.com/localstorage.html"){const i=document.createElement("iframe");i.src=e,document.body.append(i),setTimeout(function(){i.contentWindow?.postMessage(t,e)},4e3),setTimeout(function(){i.remove()},6e3)}static getTextWidth=(t,e,i=400)=>{const r=document.createElement("span");r.style.visibility="hidden",r.style.padding="0",r.style.whiteSpace="nowrap",r.style.overflow="visible",r.style.fontSize=e>12?e+"px":"12px",r.style.fontWeight=i.toString(),r.innerText=t,document.body.appendChild(r);const s=r.offsetWidth;return document.body.removeChild(r),s};static getFixedWidthText=(t,e,i=12,r=400,s=!0)=>{let a="",o="",l="";if(!t||e<i||typeof t!="string")return a;const c=t.split(""),u=document.createElement("span");u.style.visibility="hidden",u.style.padding="0",u.style.whiteSpace="nowrap",u.style.overflow="visible",u.style.fontSize=i>12?i+"px":"12px",u.style.fontWeight=r.toString(),document.body.appendChild(u);for(let g=0,p=c.length;g<p;g++){const d=c[g];if(o=l,l+=d,a=l,u.innerText=l,u.offsetWidth>e){s?a=o+"...":a=o;break}}return document.body.removeChild(u),a};static getLocation(){return new Promise((t,e)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(i=>{t(i.coords)}):e("Geolocation is not supported by this browser")})}static vibrate(t=200){"vibrate"in navigator?window.navigator.vibrate(t):console.error("Your device is not support vibrate on this browser.")}static copyToClipboard=t=>navigator.clipboard.writeText(t);static getSelectedText=()=>window.getSelection()?.toString();static siblings=t=>Array.prototype.slice.call(t.parentNode?.children).filter(e=>e!==t);static isElementFocus=t=>t===document.activeElement;static isTabInView=()=>!document.hidden;static navigateBack=()=>history.back();static navigateBack2=()=>history.go(-1);static addDebuggerOnBeforeUnload=()=>{window.addEventListener("beforeunload",()=>{debugger})}}function us(n,t=document){return new Vt(n,t)}class Vt{context;nodes;prefixs=["moz","o","ms","webkit"];constructor(t,e=document){if(this.context=e,typeof t=="string"?this.nodes=Array.from(this.context.querySelectorAll(t)):t instanceof HTMLElement?this.nodes=[t]:this.nodes=t,this.nodes.length===0)throw new Error(`can not find ${t}`);this.each((i,r)=>{i instanceof HTMLInputElement&&i.addEventListener("change",s=>{this.changeRadioChecked(s.currentTarget.value)}),i instanceof HTMLSelectElement&&i.addEventListener("change",s=>{this.changeSelectSelected(s.currentTarget.value)})})}get(t){return t<0&&(t=this.nodes.length+t),this.nodes[t]}concat(t){return new Vt(this.nodes.concat(t.nodes),this.context)}then(t){return t(this)??this}each(t){return this.nodes.forEach((e,i)=>{t(e,i)}),this}_save(t,e,i){t._mQuery||(t._mQuery={}),Array.isArray(i)?(t._mQuery[e]=t._mQuery[e]??[],t._mQuery[e].push(...i)):i!=null?t._mQuery[e]=i:delete t._mQuery[e]}on(t,e,i){return this.nodes.forEach(r=>{this._save(r,"events",[{event:t,callback:e,options:i}]),r.addEventListener(t,e,i)}),this}off(t,e,i){return this.nodes.forEach(r=>{r.removeEventListener(t,e,i)}),this}dispatchEvent(t,e){let i;const r=["click","dblclick","mousedown","mouseup","mousemove"],s=["keydown","keyup","keypress"];return typeof t=="string"?r.includes(t)?i=new MouseEvent(t,e):s.includes(t)?i=new KeyboardEvent(t,e):i=new Event(t,e):i=t,this.nodes.forEach(a=>{a.dispatchEvent(i)}),this}change(){return this.dispatchEvent("change")}click(){return this.dispatchEvent("click")}static hasEvent(t,e){return"on"+e in t}static _fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(i=>{const r=Vt._scriptConvert(i);r!=i&&e.content.replaceChild(r,i)}),e.content}static _scriptConvert(t){const e=i=>{const s=i.ownerDocument.createElement("script");s.text=i.text;const a=i.attributes;for(let o=0;o<a.length;o++)s.setAttribute(a[o].name,a[o].value);return s};return t.tagName=="SCRIPT"&&(t=e(t)),t.querySelectorAll&&t.querySelectorAll("script").forEach(i=>{i.parentNode?.replaceChild(e(i),i)}),t}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 isSVG(t){return(t||document.documentElement).nodeName.toLowerCase()==="svg"}static createElement(t){return Vt.isSVG()?document.createElementNS.call(document,"http://www.w3.org/2000/svg",t):document.createElement.call(document,t)}static createTextNode(t){return document.createTextNode.call(document,t)}static createDocumentFragment(){return document.createDocumentFragment.call(document)}_insert(t,e){const i=this.nodes.length;if(i<1)return this;const r=[];if(typeof e=="string")this.nodes.forEach(s=>{const a=Vt._fragment(e);r.push(...a.children),s[t](a)});else if(e instanceof HTMLElement)this.each(s=>{const a=i===1?e:Vt._fragment(e.outerHTML);r.push(...i===1?[e]:a.children),s[t](a)}),i>1&&e.remove();else if(e instanceof Vt){const s=i==1;e.each(a=>{this.each(o=>{const l=s?a:a.cloneNode(!0);r.push(l),o[t](l),Vt._scriptConvert(l)})}),s||e.remove()}return t=="replaceWith"&&(this.nodes=r),this}append(t){return this._insert("append",t)}prepend(t){return this._insert("prepend",t)}after(t){return this._insert("after",t)}before(t){return this._insert("before",t)}replace(t){return this._insert("replaceWith",t)}remove(){return this.nodes.forEach(t=>{t.remove()}),this}static removeChild(t){t.parentElement?.removeChild(t)}find(t){const e=[];return this.nodes.forEach(i=>{e.push(...Array.from(i.querySelectorAll(t)))}),new Vt(e,this.context)}filter(t){const e=[];return this.nodes.forEach(i=>{(i===t||typeof t=="string"&&i.matches&&i.matches(t))&&e.push(i)}),new Vt(e,this.context)}next(){const t=[];return this.nodes.forEach(e=>{const i=e.nextElementSibling;i&&t.push(i)}),new Vt(t,this.context)}prev(){const t=[];return this.nodes.forEach(e=>{const i=e.previousElementSibling;i&&t.push(i)}),new Vt(t,this.context)}closest(t){const e=[];return this.nodes.forEach(i=>{const r=i.closest(t);r&&e.push(r)}),new Vt(e,this.context)}shadow(t){const e=[];this.nodes.forEach(r=>{r.shadowRoot&&e.push(r.shadowRoot)});const i=new Vt(e,this.context);return t!==void 0?i.find(t):i}parent(t){return this.parents(t,!0)}parents(t,e=!1){const i=[],r=a=>{if(i.indexOf(a)==-1&&i.push(a),!e&&a.parentElement)return r(a.parentElement)};this.nodes.forEach(a=>{a.parentElement&&r(a.parentElement)});const s=new Vt(i,this.context);return t!==void 0?s.filter(t):s}static getComputedStyle(t,e,i){let r;const s=t.style.getPropertyPriority(e);return"getComputedStyle"in window?(r=getComputedStyle.call(window,t,i),r=r.getPropertyValue(e)):r=t.style.getPropertyValue(e),r+(s?"!"+s:"")}css(t,e){if((t===void 0||typeof t=="string")&&e===void 0){const i=this.nodes[0].style;if(typeof t=="string"){const r=i.getPropertyPriority(t),s=i.getPropertyValue(t).trim();return s?s+(r?"!"+r:""):Vt.getComputedStyle(this.nodes[0],t)}else{const r=Object.fromEntries(this.nodes[0].style.cssText.split(";").filter(s=>!!s).map(s=>s.split(":").map(a=>a.trim())));return Object.assign(r,getComputedStyle.call(window,this.nodes[0])),r}}else{let i={};return typeof t=="string"&&e!==void 0?i[t]=e:typeof t=="object"&&(i=t),this.nodes.forEach(r=>{Object.keys(i).forEach(s=>{const a=String(i[s]).toLowerCase().includes("!important")?"important":"";r.style.setProperty(s,String(i[s]).replace(/!important/i,""),a)})}),this}}addClass(t){return this.toggleClass(t,!0)}removeClass(t){return this.toggleClass(t,!1)}toggleClass(t,e){const i=t.split(/[,\s]+/);return this.nodes.forEach(r=>{i.forEach(s=>{if(s.trim()!==""){let a="toggle";e!==void 0&&(a=e?"add":"remove"),r.classList[a](s.trim())}})}),this}hasClass(t){const e=t.split(/[,\s]+/);let i=!1;return this.nodes.forEach(r=>{i=i||e.every(s=>Array.from(r.classList??[]).includes(s.trim()))}),i}attr(t,e){if(e===void 0&&typeof t=="string")return this.nodes[0].getAttribute(t);let i={};return typeof t=="object"?i=t:e!==void 0&&(i[t]=e),this.nodes.forEach(r=>{Object.entries(i).forEach(([s,a])=>{r.setAttribute(s,a)})}),this}removeAttr(t){const e=t.split(/[,\s]+/);return this.nodes.forEach(i=>{e.forEach(r=>{i.removeAttribute(r)})}),this}prop(t,e){if(e===void 0&&typeof t=="string")return this.nodes[0][t];{let i={};return typeof t=="object"?i=t:typeof t=="string"&&e!==void 0&&(i[t]=e),this.nodes.forEach(r=>{Object.entries(i).forEach(([s,a])=>{const o=Vt._fixProp(s);r[o]=a,o=="innerHTML"&&Vt._scriptConvert(r)})}),this}}removeProp(t){const e=t.split(/[,\s]+/);return this.nodes.forEach(i=>{e.forEach(r=>{delete i[Vt._fixProp(r)]})}),this}changeSelectSelected(t){this.nodes.forEach(e=>{if(e instanceof HTMLSelectElement){const i=e.options;for(let r=0,s=i.length;r<s;r++)i[r].value==t?i[r].selected=!0:i[r].selected=!1}})}changeRadioChecked(t){this.nodes.forEach(e=>{e instanceof HTMLInputElement&&(e.value==t?e.checked=!0:e.checked=!1)})}data(t,e){if(typeof t=="string"&&t.indexOf("-")!=-1)throw new Error(`Key "${t}" contains "-" (dash). Dashes are not allowed in property names. Use camelCase instead.`);if((typeof t=="string"||t===void 0)&&e===void 0){const i=Object.assign({},this.nodes[0].dataset);return Object.keys(i).forEach(r=>{if(i[r]?.startsWith("[")||i[r]?.startsWith("{"))try{i[r]=JSON.parse(i[r]??"")}catch{}}),typeof t=="string"?i[t]:i}else{let i={};return typeof t=="object"?i=t:typeof t=="string"&&(i[t]=e),this.nodes.forEach(r=>{Object.entries(i).forEach(([s,a])=>{a!=null?r.dataset[s]=a instanceof Object?JSON.stringify(a):a:delete r.dataset[s]})}),this}}removeData(t){const e=t.split(/[,\s]+/);return this.nodes.forEach(i=>{e.forEach(r=>{delete i.dataset[r]})}),this}show(){return this.toggle(!0)}hide(){return this.toggle(!1)}toggle(t){return this.nodes.forEach(e=>{const i=e.style.display,r=getComputedStyle(e).display,s=i=="none"||r=="none";if(s&&(t===void 0||t===!0)){const a=e instanceof HTMLTableRowElement?"table-row":e instanceof HTMLTableCellElement?"table-cell":"block";e.style.display=e._mQuery?.prevDisplay??(i==r&&r!="none"?"":a),this._save(e,"prevDisplay",null)}!s&&(t==null||t===!1)&&(r!="none"&&this._save(e,"prevDisplay",r),e.style.setProperty("display","none"))})}empty(){return this.html("")}html(t){return t instanceof HTMLElement?this.empty().append(t.innerHTML):this.prop("innerHTML",t)}text(t){return this.prop("textContent",t)}val(t){return this.prop("value",t)}}function ds(n,t){if(typeof t<"u")window.localStorage.setItem(n,t);else return window.localStorage.getItem(n)??void 0}function Uh(n,t,e){const i=new Date;i.setTime(i.getTime()+e*24*60*60*1e3);const r="expires="+i.toUTCString();document.cookie=n+"="+t+"; "+r}function Nh(n){const t=n+"=",e=document.cookie.split(";");for(let i=0,r=e.length;i<r;i++){const s=e[i].trim();if(s.indexOf(t)==0)return s.substring(t.length,s.length)}return""}const zh=()=>document.cookie.split(";").map(n=>n.split("=")).reduce((n,[t,e])=>(n[t.trim().replace('"',"")]=e,n),{}),Bh=()=>document.cookie.split(";").forEach(n=>document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));class Gh{static theme(t){return t=t||ds("theme"),typeof t>"u"&&(t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ds("theme",t),document.documentElement.classList.toggle("dark",t==="dark"),t}static has(t){return window.matchMedia(t).matches||!1}static on(t,e){window.matchMedia(t).addEventListener("change",e)}static off(t,e){window.matchMedia(t).removeEventListener("change",e)}}class Hh{static addEventListener(t,e,i){t.addEventListener(e,i,!1)}static removeEventListener(t,e,i){t.removeEventListener(e,i,!1)}static getTarget(t){return t.target||t.srcElement}}class Vh{static setPageVerticalScrollPercent(t,e="width"){const i=us(t);i.css("transition","all linear 30ms");const{clientHeight:r}=$i(),{scrollTop:s,scrollHeight:a}=Un(),o=a-r,l=o<=0?0:s/o*100;i.css(e,l+"%")}static pullDownRefresh(t,e,i=50){let r=0,s=0;t.addEventListener("touchstart",function(a){r=a.touches[0].pageY,t.style.position="relative",t.style.transition="transform 0s"},!1),t.addEventListener("touchmove",function(a){s=a.touches[0].pageY-r,s>0&&s<i&&(t.style.transform="translateY("+s+"px)")},!1),t.addEventListener("touchend",function(a){t.style.transition="transform 0.5s ease 1s",t.style.transform="translateY(0px)",s>=i&&e()},!1)}static pullUpLoading(t,e=50){const{clientHeight:i}=$i(),{scrollTop:r,scrollHeight:s}=Un();r+i>=s-e&&t()}static scrollTo=(t={x:0,y:0})=>window.scrollTo(t.x,t.y)}const jh={safeAreaTop:Pt.getCSSVar("--safe-area-inset-top"),safeAreaRight:Pt.getCSSVar("--safe-area-inset-right"),safeAreaBottom:Pt.getCSSVar("--safe-area-inset-bottom"),safeAreaLeft:Pt.getCSSVar("--safe-area-inset-left"),colorPrimary:Pt.getCSSVar("--color-primary"),colorRed:Pt.getCSSVar("--color-red"),colorOrange:Pt.getCSSVar("--color-orange"),colorYellow:Pt.getCSSVar("--color-yellow"),colorGreen:Pt.getCSSVar("--color-green"),colorBlue:Pt.getCSSVar("--color-blue"),colorPurple:Pt.getCSSVar("--color-purple"),colorBlack:Pt.getCSSVar("--color-black"),colorGray0:Pt.getCSSVar("--color-gray-0"),colorGray3:Pt.getCSSVar("--color-gray-3"),colorGray6:Pt.getCSSVar("--color-gray-6"),colorGray9:Pt.getCSSVar("--color-gray-9"),colorGrayCC:Pt.getCSSVar("--color-gray-cc"),colorGrayDD:Pt.getCSSVar("--color-gray-dd"),colorGrayE6:Pt.getCSSVar("--color-gray-e6"),colorGrayEE:Pt.getCSSVar("--color-gray-ee"),colorGrayEF:Pt.getCSSVar("--color-gray-ef"),colorGrayF5:Pt.getCSSVar("--color-gray-f5"),colorGrayFF:Pt.getCSSVar("--color-gray-ff"),fontLineHeight:Pt.getCSSVar("--font-line-height"),fontSize32:Pt.getCSSVar("--font-size-32"),fontSize24:Pt.getCSSVar("--font-size-24"),fontSize20:Pt.getCSSVar("--font-size-20"),fontSize18:Pt.getCSSVar("--font-size-18"),fontSize16:Pt.getCSSVar("--font-size-16"),fontSize14:Pt.getCSSVar("--font-size-14"),fontSize12:Pt.getCSSVar("--font-size-12"),fontSize11:Pt.getCSSVar("--font-size-11"),gap4:Pt.getCSSVar("--gap-4"),gap8:Pt.getCSSVar("--gap-8"),gap12:Pt.getCSSVar("--gap-12"),gap16:Pt.getCSSVar("--gap-16"),gap20:Pt.getCSSVar("--gap-20"),gap40:Pt.getCSSVar("--gap-40"),height44:Pt.getCSSVar("--height-44"),height32:Pt.getCSSVar("--height-32"),borderRadius:Pt.getCSSVar("--border-radius")},Xh=()=>Math.random()*16777215,Yh=()=>`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`,$h=()=>`#${(~~(Math.random()*(1<<24))).toString(16)}`,or=function(n){return n[0]==="#"&&(n=n.slice(1)),parseInt(n,16)},go=function(n){let t="00000"+(n|0).toString(16);return t="#"+t.substring(t.length-6),t},mo=function(n,t=1){const e=n>>16&255,i=n>>8&255,r=n&255,s=t<0?0:t>1?1:t;return s===1?"rgb("+e+","+i+","+r+")":"rgba("+e+","+i+","+r+","+s+")"},ps=function(n,t=1){const e=or(n);return mo(e,t)},qh=n=>{const e=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(n);return e?"#"+((1<<24)+(parseInt(e[1])<<16)+(parseInt(e[2])<<8)+parseInt(e[3])).toString(16).slice(1):""};function Zh(n,t){let e=parseInt(n.substring(1,3),16),i=parseInt(n.substring(3,5),16),r=parseInt(n.substring(5,7),16);e==0&&(e=32),i==0&&(i=32),r==0&&(r=32),e=e*(100+t)/100,i=i*(100+t)/100,r=r*(100+t)/100,e=e<255?e:255,i=i<255?i:255,r=r<255?r:255,e=Math.round(e),i=Math.round(i),r=Math.round(r);const s=e.toString(16).length==1?"0"+e.toString(16):e.toString(16),a=i.toString(16).length==1?"0"+i.toString(16):i.toString(16),o=r.toString(16).length==1?"0"+r.toString(16):r.toString(16);return"#"+s+a+o}function Wh(n,t,e,i){let r,s,a;n=n/360,t=t/100,e=e/100;const o=Math.floor(n*6),l=n*6-o,c=e*(1-t),u=e*(1-l*t),g=e*(1-(1-l)*t);switch(o%6){case 0:r=e,s=g,a=c;break;case 1:r=u,s=e,a=c;break;case 2:r=c,s=e,a=g;break;case 3:r=c,s=u,a=e;break;case 4:r=g,s=c,a=e;break;case 5:default:r=e,s=c,a=u;break}return{r:Math.round(r*255),g:Math.round(s*255),b:Math.round(a*255),a:i??1}}function Jh(n,t,e,i){const r=Math.max(n,t,e),s=Math.min(n,t,e),a=r-s,o=r===0?0:a/r,l=r/255;let c;switch(r){case s:c=0;break;case n:c=t-e+a*(t<e?6:0),c/=6*a;break;case t:c=e-n+a*2,c/=6*a;break;case e:default:c=n-t+a*4,c/=6*a;break}return{h:Math.round(c*360),s:Math.round(o*100),v:Math.round(l*100),a:i??1}}function Kh(n){return btoa(encodeURIComponent(n)).replaceAll("+","*").replaceAll("/","-").replaceAll("=","")}function Qh(n){let t=n.replaceAll("*","+").replaceAll("-","/");const e=t.length%4;return e&&(t=t.padEnd(t.length+(4-e),"=")),decodeURIComponent(atob(t))}function gs(n=window.location.href){return Nr(URL)?new URL(n):vo(n)}function vo(n=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",i="(?<pathname>(?:\\/[^/#?]+)*\\/?)",r="(?<search>(?:\\?[^#]*)?)",s="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${i}${r}${s}$`).exec(n);return{href:n,protocol:o?.groups?.protocol??"",host:o?.groups?.host??"",hostname:o?.groups?.hostname??"",port:o?.groups?.port??"",pathname:o?.groups?.pathname??"",search:o?.groups?.search??"",hash:o?.groups?.hash??""}}function tf(n){const t=gs(n);return t.protocol==="http:"||t.protocol==="https:"}function _o(n=window.location.href){const t=gs(n),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function ef(n=location.search){n=decodeURIComponent(n).replace(/^[#?&]/,"");const t={};if(!n)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let i=e.exec(n);for(;i;)t[i[1]]=i[2],i=e.exec(n);return t}function nf(n){return Array.from(new URLSearchParams(n)).reduce((t,[e,i])=>Object.assign({},t,{[e]:t[e]?(Array.isArray(t[e])?t[e]:[t[e]]).concat(i):i}),{})}function yo(n){let t="";for(const e in n)t&&(t+="&"),t+=`${e}=${n[e]}`;return t}function rf(n){return new URLSearchParams(n).toString()}function ms(n){return"?"+[...n.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function lr(n,t){return n.indexOf("?")>=0?n+t.replace(/^\?/,"&"):n.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function sf(n){let t="";new MutationObserver(function(i){window.location.href!==t&&(t=window.location.href,n&&n(location.href))}).observe(document,{attributes:!0,childList:!0,subtree:!0})}function af(n){window.addEventListener("hashchange",()=>{n(location.hash)})}function of(n){window.addEventListener("popstate",n,!1)}function lf(n){let t=null;if(za)try{t=new Worker(URL.createObjectURL(new Blob([n])))}catch(e){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),null}return t}var wo={exports:{}};(function(n){var t={};n.exports=t,t.parse=function(e,i){for(var r=t.bin.readUshort,s=t.bin.readUint,c=0,a={},o=new Uint8Array(e),l=o.length-4;s(o,l)!=101010256;)l--;var c=l;c+=4,c+=4;var u=r(o,c);c+=2,r(o,c),c+=2;var g=s(o,c);c+=4;var p=s(o,c);c+=4,c=p;for(var d=0;d<u;d++){s(o,c),c+=4,c+=4,c+=4,c+=4,s(o,c),c+=4;var g=s(o,c);c+=4;var w=s(o,c);c+=4;var x=r(o,c),C=r(o,c+2),A=r(o,c+4);c+=6,c+=8;var P=s(o,c);c+=4,c+=x+C+A,t._readLocal(o,P,a,g,w,i)}return a},t._readLocal=function(e,i,r,s,a,o){var l=t.bin.readUshort,c=t.bin.readUint;c(e,i),i+=4,l(e,i),i+=2,l(e,i),i+=2;var u=l(e,i);i+=2,c(e,i),i+=4,c(e,i),i+=4,i+=8;var g=l(e,i);i+=2;var p=l(e,i);i+=2;var d=t.bin.readUTF8(e,i,g);if(i+=g,i+=p,o){r[d]={size:a,csize:s};return}var w=new Uint8Array(e.buffer,i);if(u==0)r[d]=new Uint8Array(w.buffer.slice(i,i+s));else if(u==8){var x=new Uint8Array(a);t.inflateRaw(w,x),r[d]=x}else throw"unknown compression method: "+u},t.inflateRaw=function(e,i){return t.F.inflate(e,i)},t.inflate=function(e,i){return e[0],e[1],t.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),i)},t.deflate=function(e,i){i==null&&(i={level:6});var r=0,s=new Uint8Array(50+Math.floor(e.length*1.1));s[r]=120,s[r+1]=156,r+=2,r=t.F.deflateRaw(e,s,r,i.level);var a=t.adler(e,0,e.length);return s[r+0]=a>>>24&255,s[r+1]=a>>>16&255,s[r+2]=a>>>8&255,s[r+3]=a>>>0&255,new Uint8Array(s.buffer,0,r+4)},t.deflateRaw=function(e,i){i==null&&(i={level:6});var r=new Uint8Array(50+Math.floor(e.length*1.1)),s=t.F.deflateRaw(e,r,s,i.level);return new Uint8Array(r.buffer,0,s)},t.encode=function(e,i){i==null&&(i=!1);var r=0,s=t.bin.writeUint,a=t.bin.writeUshort,o={};for(var l in e){var c=!t._noNeed(l)&&!i,u=e[l],g=t.crc.crc(u,0,u.length);o[l]={cpr:c,usize:u.length,crc:g,file:c?t.deflateRaw(u):u}}for(var l in o)r+=o[l].file.length+30+46+2*t.bin.sizeUTF8(l);r+=22;var p=new Uint8Array(r),d=0,w=[];for(var l in o){var x=o[l];w.push(d),d=t._writeHeader(p,d,l,x,0)}var C=0,A=d;for(var l in o){var x=o[l];w.push(d),d=t._writeHeader(p,d,l,x,1,w[C++])}var P=d-A;return s(p,d,101010256),d+=4,d+=4,a(p,d,C),d+=2,a(p,d,C),d+=2,s(p,d,P),d+=4,s(p,d,A),d+=4,d+=2,p.buffer},t._noNeed=function(e){var i=e.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(i)!=-1},t._writeHeader=function(e,i,r,s,a,o){var l=t.bin.writeUint,c=t.bin.writeUshort,u=s.file;l(e,i,a==0?67324752:33639248),i+=4,a==1&&(i+=2),c(e,i,20),i+=2,c(e,i,0),i+=2,c(e,i,s.cpr?8:0),i+=2,l(e,i,0),i+=4,l(e,i,s.crc),i+=4,l(e,i,u.length),i+=4,l(e,i,s.usize),i+=4,c(e,i,t.bin.sizeUTF8(r)),i+=2,c(e,i,0),i+=2,a==1&&(i+=2,i+=2,i+=6,l(e,i,o),i+=4);var g=t.bin.writeUTF8(e,i,r);return i+=g,a==0&&(e.set(u,i),i+=u.length),i},t.crc={table:function(){for(var e=new Uint32Array(256),i=0;i<256;i++){for(var r=i,s=0;s<8;s++)r&1?r=3988292384^r>>>1:r=r>>>1;e[i]=r}return e}(),update:function(e,i,r,s){for(var a=0;a<s;a++)e=t.crc.table[(e^i[r+a])&255]^e>>>8;return e},crc:function(e,i,r){return t.crc.update(4294967295,e,i,r)^4294967295}},t.adler=function(e,i,r){for(var s=1,a=0,o=i,l=i+r;o<l;){for(var c=Math.min(o+5552,l);o<c;)s+=e[o++],a+=s;s=s%65521,a=a%65521}return a<<16|s},t.bin={readUshort:function(e,i){return e[i]|e[i+1]<<8},writeUshort:function(e,i,r){e[i]=r&255,e[i+1]=r>>8&255},readUint:function(e,i){return e[i+3]*16777216+(e[i+2]<<16|e[i+1]<<8|e[i])},writeUint:function(e,i,r){e[i]=r&255,e[i+1]=r>>8&255,e[i+2]=r>>16&255,e[i+3]=r>>24&255},readASCII:function(e,i,r){for(var s="",a=0;a<r;a++)s+=String.fromCharCode(e[i+a]);return s},writeASCII:function(e,i,r){for(var s=0;s<r.length;s++)e[i+s]=r.charCodeAt(s)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,i,r){for(var s="",a,o=0;o<r;o++)s+="%"+t.bin.pad(e[i+o].toString(16));try{a=decodeURIComponent(s)}catch{return t.bin.readASCII(e,i,r)}return a},writeUTF8:function(e,i,r){for(var s=r.length,a=0,o=0;o<s;o++){var l=r.charCodeAt(o);if(!(l&4294967168))e[i+a]=l,a++;else if(!(l&4294965248))e[i+a]=192|l>>6,e[i+a+1]=128|l>>0&63,a+=2;else if(!(l&4294901760))e[i+a]=224|l>>12,e[i+a+1]=128|l>>6&63,e[i+a+2]=128|l>>0&63,a+=3;else if(!(l&4292870144))e[i+a]=240|l>>18,e[i+a+1]=128|l>>12&63,e[i+a+2]=128|l>>6&63,e[i+a+3]=128|l>>0&63,a+=4;else throw"e"}return a},sizeUTF8:function(e){for(var i=e.length,r=0,s=0;s<i;s++){var a=e.charCodeAt(s);if(!(a&4294967168))r++;else if(!(a&4294965248))r+=2;else if(!(a&4294901760))r+=3;else if(!(a&4292870144))r+=4;else throw"e"}return r}},t.F={},t.F.deflateRaw=function(e,i,r,s){var a=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]],o=a[s],l=t.F.U,c=t.F._goodIndex;t.F._hash;var u=t.F._putsE,g=0,p=r<<3,d=0,w=e.length;if(s==0){for(;g<w;){var x=Math.min(65535,w-g);u(i,p,g+x==w?1:0),p=t.F._copyExact(e,g,x,i,p+8),g+=x}return p>>>3}var C=l.lits,A=l.strt,P=l.prev,M=0,D=0,U=0,z=0,F=0,G=0;for(w>2&&(G=t.F._hash(e,0),A[G]=0),g=0;g<w;g++){if(F=G,g+1<w-2){G=t.F._hash(e,g+1);var H=g+1&32767;P[H]=A[G],A[G]=H}if(d<=g){(M>14e3||D>26697)&&w-g>100&&(d<g&&(C[M]=g-d,M+=2,d=g),p=t.F._writeBlock(g==w-1||d==w?1:0,C,M,z,e,U,g-U,i,p),M=D=z=0,U=g);var $=0;g<w-2&&($=t.F._bestMatch(e,g,P,F,Math.min(o[2],w-g),o[3]));var x=$>>>16,X=$&65535;if($!=0){var x=$>>>16,X=$&65535,J=c(x,l.of0);l.lhst[257+J]++;var dt=c(X,l.df0);l.dhst[dt]++,z+=l.exb[J]+l.dxb[dt],C[M]=x<<23|g-d,C[M+1]=X<<16|J<<8|dt,M+=2,d=g+x}else l.lhst[e[g]]++;D++}}for((U!=g||e.length==0)&&(d<g&&(C[M]=g-d,M+=2,d=g),p=t.F._writeBlock(1,C,M,z,e,U,g-U,i,p),M=0,D=0,M=D=z=0,U=g);p&7;)p++;return p>>>3},t.F._bestMatch=function(e,i,r,s,a,o){var l=i&32767,c=r[l],u=l-c+32768&32767;if(c==l||s!=t.F._hash(e,i-u))return 0;for(var g=0,p=0,d=Math.min(32767,i);u<=d&&--o!=0&&c!=l;){if(g==0||e[i+g]==e[i+g-u]){var w=t.F._howLong(e,i,u);if(w>g){if(g=w,p=u,g>=a)break;u+2<w&&(w=u+2);for(var x=0,C=0;C<w-2;C++){var A=i-u+C+32768&32767,P=r[A],M=A-P+32768&32767;M>x&&(x=M,c=A)}}}l=c,c=r[l],u+=l-c+32768&32767}return g<<16|p},t.F._howLong=function(e,i,r){if(e[i]!=e[i-r]||e[i+1]!=e[i+1-r]||e[i+2]!=e[i+2-r])return 0;var s=i,a=Math.min(e.length,i+258);for(i+=3;i<a&&e[i]==e[i-r];)i++;return i-s},t.F._hash=function(e,i){return(e[i]<<8|e[i+1])+(e[i+2]<<4)&65535},t.saved=0,t.F._writeBlock=function(e,i,r,s,a,o,l,c,u){var g=t.F.U,p=t.F._putsF,d=t.F._putsE,w,x,C,A,P,M,D,U,z;g.lhst[256]++,w=t.F.getTrees(),x=w[0],C=w[1],A=w[2],P=w[3],M=w[4],D=w[5],U=w[6],z=w[7];var F=(u+3&7?8-(u+3&7):0)+32+(l<<3),G=s+t.F.contSize(g.fltree,g.lhst)+t.F.contSize(g.fdtree,g.dhst),H=s+t.F.contSize(g.ltree,g.lhst)+t.F.contSize(g.dtree,g.dhst);H+=14+3*D+t.F.contSize(g.itree,g.ihst)+(g.ihst[16]*2+g.ihst[17]*3+g.ihst[18]*7);for(var $=0;$<286;$++)g.lhst[$]=0;for(var $=0;$<30;$++)g.dhst[$]=0;for(var $=0;$<19;$++)g.ihst[$]=0;var X=F<G&&F<H?0:G<H?1:2;if(p(c,u,e),p(c,u+1,X),u+=3,X==0){for(;u&7;)u++;u=t.F._copyExact(a,o,l,c,u)}else{var J,dt;if(X==1&&(J=g.fltree,dt=g.fdtree),X==2){t.F.makeCodes(g.ltree,x),t.F.revCodes(g.ltree,x),t.F.makeCodes(g.dtree,C),t.F.revCodes(g.dtree,C),t.F.makeCodes(g.itree,A),t.F.revCodes(g.itree,A),J=g.ltree,dt=g.dtree,d(c,u,P-257),u+=5,d(c,u,M-1),u+=5,d(c,u,D-4),u+=4;for(var ft=0;ft<D;ft++)d(c,u+ft*3,g.itree[(g.ordr[ft]<<1)+1]);u+=3*D,u=t.F._codeTiny(U,g.itree,c,u),u=t.F._codeTiny(z,g.itree,c,u)}for(var gt=o,Et=0;Et<r;Et+=2){for(var kt=i[Et],tt=kt>>>23,st=gt+(kt&(1<<23)-1);gt<st;)u=t.F._writeLit(a[gt++],J,c,u);if(tt!=0){var ht=i[Et+1],L=ht>>16,E=ht>>8&255,S=ht&255;u=t.F._writeLit(257+E,J,c,u),d(c,u,tt-g.of0[E]),u+=g.exb[E],u=t.F._writeLit(S,dt,c,u),p(c,u,L-g.df0[S]),u+=g.dxb[S],gt+=tt}}u=t.F._writeLit(256,J,c,u)}return u},t.F._copyExact=function(e,i,r,s,a){var o=a>>>3;return s[o]=r,s[o+1]=r>>>8,s[o+2]=255-s[o],s[o+3]=255-s[o+1],o+=4,s.set(new Uint8Array(e.buffer,i,r),o),a+(r+4<<3)},t.F.getTrees=function(){for(var e=t.F.U,i=t.F._hufTree(e.lhst,e.ltree,15),r=t.F._hufTree(e.dhst,e.dtree,15),s=[],a=t.F._lenCodes(e.ltree,s),o=[],l=t.F._lenCodes(e.dtree,o),c=0;c<s.length;c+=2)e.ihst[s[c]]++;for(var c=0;c<o.length;c+=2)e.ihst[o[c]]++;for(var u=t.F._hufTree(e.ihst,e.itree,7),g=19;g>4&&e.itree[(e.ordr[g-1]<<1)+1]==0;)g--;return[i,r,u,a,l,g,s,o]},t.F.getSecond=function(e){for(var i=[],r=0;r<e.length;r+=2)i.push(e[r+1]);return i},t.F.nonZero=function(e){for(var i="",r=0;r<e.length;r+=2)e[r+1]!=0&&(i+=(r>>1)+",");return i},t.F.contSize=function(e,i){for(var r=0,s=0;s<i.length;s++)r+=i[s]*e[(s<<1)+1];return r},t.F._codeTiny=function(e,i,r,s){for(var a=0;a<e.length;a+=2){var o=e[a],l=e[a+1];s=t.F._writeLit(o,i,r,s);var c=o==16?2:o==17?3:7;o>15&&(t.F._putsE(r,s,l,c),s+=c)}return s},t.F._lenCodes=function(e,i){for(var r=e.length;r!=2&&e[r-1]==0;)r-=2;for(var s=0;s<r;s+=2){var a=e[s+1],o=s+3<r?e[s+3]:-1,l=s+5<r?e[s+5]:-1,c=s==0?-1:e[s-1];if(a==0&&o==a&&l==a){for(var u=s+5;u+2<r&&e[u+2]==a;)u+=2;var g=Math.min(u+1-s>>>1,138);g<11?i.push(17,g-3):i.push(18,g-11),s+=g*2-2}else if(a==c&&o==a&&l==a){for(var u=s+5;u+2<r&&e[u+2]==a;)u+=2;var g=Math.min(u+1-s>>>1,6);i.push(16,g-3),s+=g*2-2}else i.push(a,0)}return r>>>1},t.F._hufTree=function(e,i,r){var s=[],a=e.length,o=i.length,l=0;for(l=0;l<o;l+=2)i[l]=0,i[l+1]=0;for(l=0;l<a;l++)e[l]!=0&&s.push({lit:l,f:e[l]});var c=s.length,u=s.slice(0);if(c==0)return 0;if(c==1){var g=s[0].lit,u=g==0?1:0;return i[(g<<1)+1]=1,i[(u<<1)+1]=1,1}s.sort(function(P,M){return P.f-M.f});var p=s[0],d=s[1],w=0,x=1,C=2;for(s[0]={lit:-1,f:p.f+d.f,l:p,r:d,d:0};x!=c-1;)w!=x&&(C==c||s[w].f<s[C].f)?p=s[w++]:p=s[C++],w!=x&&(C==c||s[w].f<s[C].f)?d=s[w++]:d=s[C++],s[x++]={lit:-1,f:p.f+d.f,l:p,r:d};var A=t.F.setDepth(s[x-1],0);for(A>r&&(t.F.restrictDepth(u,r,A),A=r),l=0;l<c;l++)i[(u[l].lit<<1)+1]=u[l].d;return A},t.F.setDepth=function(e,i){return e.lit!=-1?(e.d=i,i):Math.max(t.F.setDepth(e.l,i+1),t.F.setDepth(e.r,i+1))},t.F.restrictDepth=function(e,i,r){var s=0,a=1<<r-i,o=0;for(e.sort(function(c,u){return u.d==c.d?c.f-u.f:u.d-c.d}),s=0;s<e.length&&e[s].d>i;s++){var l=e[s].d;e[s].d=i,o+=a-(1<<r-l)}for(o=o>>>r-i;o>0;){var l=e[s].d;l<i?(e[s].d++,o-=1<<i-l-1):s++}for(;s>=0;s--)e[s].d==i&&o<0&&(e[s].d--,o++);o!=0&&console.log("debt left")},t.F._goodIndex=function(e,i){var r=0;return i[r|16]<=e&&(r|=16),i[r|8]<=e&&(r|=8),i[r|4]<=e&&(r|=4),i[r|2]<=e&&(r|=2),i[r|1]<=e&&(r|=1),r},t.F._writeLit=function(e,i,r,s){return t.F._putsF(r,s,i[e<<1]),s+i[(e<<1)+1]},t.F.inflate=function(e,i){var r=Uint8Array;if(e[0]==3&&e[1]==0)return i||new r(0);var s=t.F,a=s._bitsF,o=s._bitsE,l=s._decodeTiny,c=s.makeCodes,u=s.codes2map,g=s._get17,p=s.U,d=i==null;d&&(i=new r(e.length>>>2<<3));for(var w=0,x=0,C=0,A=0,P=0,M=0,D=0,U=0,z=0,F,G;w==0;){if(w=a(e,z,1),x=a(e,z+1,2),z+=3,x==0){z&7&&(z+=8-(z&7));var H=(z>>>3)+4,$=e[H-4]|e[H-3]<<8;d&&(i=t.F._check(i,U+$)),i.set(new r(e.buffer,e.byteOffset+H,$),U),z=H+$<<3,U+=$;continue}if(d&&(i=t.F._check(i,U+131072)),x==1&&(F=p.flmap,G=p.fdmap,M=511,D=31),x==2){C=o(e,z,5)+257,A=o(e,z+5,5)+1,P=o(e,z+10,4)+4,z+=14;for(var X=0;X<38;X+=2)p.itree[X]=0,p.itree[X+1]=0;for(var J=1,X=0;X<P;X++){var dt=o(e,z+X*3,3);p.itree[(p.ordr[X]<<1)+1]=dt,dt>J&&(J=dt)}z+=3*P,c(p.itree,J),u(p.itree,J,p.imap),F=p.lmap,G=p.dmap,z=l(p.imap,(1<<J)-1,C+A,e,z,p.ttree);var ft=s._copyOut(p.ttree,0,C,p.ltree);M=(1<<ft)-1;var gt=s._copyOut(p.ttree,C,A,p.dtree);D=(1<<gt)-1,c(p.ltree,ft),u(p.ltree,ft,F),c(p.dtree,gt),u(p.dtree,gt,G)}for(;;){var Et=F[g(e,z)&M];z+=Et&15;var kt=Et>>>4;if(!(kt>>>8))i[U++]=kt;else{if(kt==256)break;var tt=U+kt-254;if(kt>264){var st=p.ldef[kt-257];tt=U+(st>>>3)+o(e,z,st&7),z+=st&7}var ht=G[g(e,z)&D];z+=ht&15;var L=ht>>>4,E=p.ddef[L],S=(E>>>4)+a(e,z,E&15);for(z+=E&15,d&&(i=t.F._check(i,U+131072));U<tt;)i[U]=i[U++-S],i[U]=i[U++-S],i[U]=i[U++-S],i[U]=i[U++-S];U=tt}}}return i.length==U?i:i.slice(0,U)},t.F._check=function(e,i){var r=e.length;if(i<=r)return e;var s=new Uint8Array(Math.max(r<<1,i));return s.set(e,0),s},t.F._decodeTiny=function(e,i,r,s,a,o){for(var l=t.F._bitsE,c=t.F._get17,u=0;u<r;){var g=e[c(s,a)&i];a+=g&15;var p=g>>>4;if(p<=15)o[u]=p,u++;else{var d=0,w=0;p==16?(w=3+l(s,a,2),a+=2,d=o[u-1]):p==17?(w=3+l(s,a,3),a+=3):p==18&&(w=11+l(s,a,7),a+=7);for(var x=u+w;u<x;)o[u]=d,u++}}return a},t.F._copyOut=function(e,i,r,s){for(var a=0,o=0,l=s.length>>>1;o<r;){var c=e[o+i];s[o<<1]=0,s[(o<<1)+1]=c,c>a&&(a=c),o++}for(;o<l;)s[o<<1]=0,s[(o<<1)+1]=0,o++;return a},t.F.makeCodes=function(e,i){for(var r=t.F.U,s=e.length,a,o,l,c,u,g=r.bl_count,c=0;c<=i;c++)g[c]=0;for(c=1;c<s;c+=2)g[e[c]]++;var p=r.next_code;for(a=0,g[0]=0,o=1;o<=i;o++)a=a+g[o-1]<<1,p[o]=a;for(l=0;l<s;l+=2)u=e[l+1],u!=0&&(e[l]=p[u],p[u]++)},t.F.codes2map=function(e,i,r){for(var s=e.length,a=t.F.U,o=a.rev15,l=0;l<s;l+=2)if(e[l+1]!=0)for(var c=l>>1,u=e[l+1],g=c<<4|u,p=i-u,d=e[l]<<p,w=d+(1<<p);d!=w;){var x=o[d]>>>15-i;r[x]=g,d++}},t.F.revCodes=function(e,i){for(var r=t.F.U.rev15,s=15-i,a=0;a<e.length;a+=2){var o=e[a]<<i-e[a+1];e[a]=r[o]>>>s}},t.F._putsE=function(e,i,r){r=r<<(i&7);var s=i>>>3;e[s]|=r,e[s+1]|=r>>>8},t.F._putsF=function(e,i,r){r=r<<(i&7);var s=i>>>3;e[s]|=r,e[s+1]|=r>>>8,e[s+2]|=r>>>16},t.F._bitsE=function(e,i,r){return(e[i>>>3]|e[(i>>>3)+1]<<8)>>>(i&7)&(1<<r)-1},t.F._bitsF=function(e,i,r){return(e[i>>>3]|e[(i>>>3)+1]<<8|e[(i>>>3)+2]<<16)>>>(i&7)&(1<<r)-1},t.F._get17=function(e,i){return(e[i>>>3]|e[(i>>>3)+1]<<8|e[(i>>>3)+2]<<16)>>>(i&7)},t.F._get25=function(e,i){return(e[i>>>3]|e[(i>>>3)+1]<<8|e[(i>>>3)+2]<<16|e[(i>>>3)+3]<<24)>>>(i&7)},t.F.U=function(){var e=Uint16Array,i=Uint32Array;return{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new i(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new i(286),dhst:new i(30),ihst:new i(19),lits:new i(15e3),strt:new e(65536),prev:new e(32768)}}(),function(){for(var e=t.F.U,i=32768,r=0;r<i;r++){var s=r;s=(s&2863311530)>>>1|(s&1431655765)<<1,s=(s&3435973836)>>>2|(s&858993459)<<2,s=(s&4042322160)>>>4|(s&252645135)<<4,s=(s&4278255360)>>>8|(s&16711935)<<8,e.rev15[r]=(s>>>16|s<<16)>>>17}function a(o,l,c){for(;l--!=0;)o.push(0,c)}for(var r=0;r<32;r++)e.ldef[r]=e.of0[r]<<3|e.exb[r],e.ddef[r]=e.df0[r]<<4|e.dxb[r];a(e.fltree,144,8),a(e.fltree,112,9),a(e.fltree,24,7),a(e.fltree,8,8),t.F.makeCodes(e.fltree,9),t.F.codes2map(e.fltree,9,e.flmap),t.F.revCodes(e.fltree,9),a(e.fdtree,32,5),t.F.makeCodes(e.fdtree,5),t.F.codes2map(e.fdtree,5,e.fdmap),t.F.revCodes(e.fdtree,5),a(e.itree,19,0),a(e.ltree,286,0),a(e.dtree,30,0),a(e.ttree,320,0)}()})(wo);var cf=wo.exports;const xo=ji(cf);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const hf=4,bo=0,Co=1,ff=2;function Bn(n){let t=n.length;for(;--t>=0;)n[t]=0}const uf=0,To=1,df=2,pf=3,gf=258,vs=29,mi=256,vi=mi+1+vs,Gn=30,_s=19,So=2*vi+1,xn=15,ys=16,mf=7,ws=256,Eo=16,ko=17,Ao=18,xs=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),cr=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),vf=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Po=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_f=512,Be=new Array((vi+2)*2);Bn(Be);const _i=new Array(Gn*2);Bn(_i);const yi=new Array(_f);Bn(yi);const wi=new Array(gf-pf+1);Bn(wi);const bs=new Array(vs);Bn(bs);const hr=new Array(Gn);Bn(hr);function Cs(n,t,e,i,r){this.static_tree=n,this.extra_bits=t,this.extra_base=e,this.elems=i,this.max_length=r,this.has_stree=n&&n.length}let Io,Mo,Lo;function Ts(n,t){this.dyn_tree=n,this.max_code=0,this.stat_desc=t}const Do=n=>n<256?yi[n]:yi[256+(n>>>7)],xi=(n,t)=>{n.pending_buf[n.pending++]=t&255,n.pending_buf[n.pending++]=t>>>8&255},re=(n,t,e)=>{n.bi_valid>ys-e?(n.bi_buf|=t<<n.bi_valid&65535,xi(n,n.bi_buf),n.bi_buf=t>>ys-n.bi_valid,n.bi_valid+=e-ys):(n.bi_buf|=t<<n.bi_valid&65535,n.bi_valid+=e)},ke=(n,t,e)=>{re(n,e[t*2],e[t*2+1])},Ro=(n,t)=>{let e=0;do e|=n&1,n>>>=1,e<<=1;while(--t>0);return e>>>1},yf=n=>{n.bi_valid===16?(xi(n,n.bi_buf),n.bi_buf=0,n.bi_valid=0):n.bi_valid>=8&&(n.pending_buf[n.pending++]=n.bi_buf&255,n.bi_buf>>=8,n.bi_valid-=8)},wf=(n,t)=>{const e=t.dyn_tree,i=t.max_code,r=t.stat_desc.static_tree,s=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,l=t.stat_desc.max_length;let c,u,g,p,d,w,x=0;for(p=0;p<=xn;p++)n.bl_count[p]=0;for(e[n.heap[n.heap_max]*2+1]=0,c=n.heap_max+1;c<So;c++)u=n.heap[c],p=e[e[u*2+1]*2+1]+1,p>l&&(p=l,x++),e[u*2+1]=p,!(u>i)&&(n.bl_count[p]++,d=0,u>=o&&(d=a[u-o]),w=e[u*2],n.opt_len+=w*(p+d),s&&(n.static_len+=w*(r[u*2+1]+d)));if(x!==0){do{for(p=l-1;n.bl_count[p]===0;)p--;n.bl_count[p]--,n.bl_count[p+1]+=2,n.bl_count[l]--,x-=2}while(x>0);for(p=l;p!==0;p--)for(u=n.bl_count[p];u!==0;)g=n.heap[--c],!(g>i)&&(e[g*2+1]!==p&&(n.opt_len+=(p-e[g*2+1])*e[g*2],e[g*2+1]=p),u--)}},Oo=(n,t,e)=>{const i=new Array(xn+1);let r=0,s,a;for(s=1;s<=xn;s++)r=r+e[s-1]<<1,i[s]=r;for(a=0;a<=t;a++){let o=n[a*2+1];o!==0&&(n[a*2]=Ro(i[o]++,o))}},xf=()=>{let n,t,e,i,r;const s=new Array(xn+1);for(e=0,i=0;i<vs-1;i++)for(bs[i]=e,n=0;n<1<<xs[i];n++)wi[e++]=i;for(wi[e-1]=i,r=0,i=0;i<16;i++)for(hr[i]=r,n=0;n<1<<cr[i];n++)yi[r++]=i;for(r>>=7;i<Gn;i++)for(hr[i]=r<<7,n=0;n<1<<cr[i]-7;n++)yi[256+r++]=i;for(t=0;t<=xn;t++)s[t]=0;for(n=0;n<=143;)Be[n*2+1]=8,n++,s[8]++;for(;n<=255;)Be[n*2+1]=9,n++,s[9]++;for(;n<=279;)Be[n*2+1]=7,n++,s[7]++;for(;n<=287;)Be[n*2+1]=8,n++,s[8]++;for(Oo(Be,vi+1,s),n=0;n<Gn;n++)_i[n*2+1]=5,_i[n*2]=Ro(n,5);Io=new Cs(Be,xs,mi+1,vi,xn),Mo=new Cs(_i,cr,0,Gn,xn),Lo=new Cs(new Array(0),vf,0,_s,mf)},Fo=n=>{let t;for(t=0;t<vi;t++)n.dyn_ltree[t*2]=0;for(t=0;t<Gn;t++)n.dyn_dtree[t*2]=0;for(t=0;t<_s;t++)n.bl_tree[t*2]=0;n.dyn_ltree[ws*2]=1,n.opt_len=n.static_len=0,n.sym_next=n.matches=0},Uo=n=>{n.bi_valid>8?xi(n,n.bi_buf):n.bi_valid>0&&(n.pending_buf[n.pending++]=n.bi_buf),n.bi_buf=0,n.bi_valid=0},No=(n,t,e,i)=>{const r=t*2,s=e*2;return n[r]<n[s]||n[r]===n[s]&&i[t]<=i[e]},Ss=(n,t,e)=>{const i=n.heap[e];let r=e<<1;for(;r<=n.heap_len&&(r<n.heap_len&&No(t,n.heap[r+1],n.heap[r],n.depth)&&r++,!No(t,i,n.heap[r],n.depth));)n.heap[e]=n.heap[r],e=r,r<<=1;n.heap[e]=i},zo=(n,t,e)=>{let i,r,s=0,a,o;if(n.sym_next!==0)do i=n.pending_buf[n.sym_buf+s++]&255,i+=(n.pending_buf[n.sym_buf+s++]&255)<<8,r=n.pending_buf[n.sym_buf+s++],i===0?ke(n,r,t):(a=wi[r],ke(n,a+mi+1,t),o=xs[a],o!==0&&(r-=bs[a],re(n,r,o)),i--,a=Do(i),ke(n,a,e),o=cr[a],o!==0&&(i-=hr[a],re(n,i,o)));while(s<n.sym_next);ke(n,ws,t)},Es=(n,t)=>{const e=t.dyn_tree,i=t.stat_desc.static_tree,r=t.stat_desc.has_stree,s=t.stat_desc.elems;let a,o,l=-1,c;for(n.heap_len=0,n.heap_max=So,a=0;a<s;a++)e[a*2]!==0?(n.heap[++n.heap_len]=l=a,n.depth[a]=0):e[a*2+1]=0;for(;n.heap_len<2;)c=n.heap[++n.heap_len]=l<2?++l:0,e[c*2]=1,n.depth[c]=0,n.opt_len--,r&&(n.static_len-=i[c*2+1]);for(t.max_code=l,a=n.heap_len>>1;a>=1;a--)Ss(n,e,a);c=s;do a=n.heap[1],n.heap[1]=n.heap[n.heap_len--],Ss(n,e,1),o=n.heap[1],n.heap[--n.heap_max]=a,n.heap[--n.heap_max]=o,e[c*2]=e[a*2]+e[o*2],n.depth[c]=(n.depth[a]>=n.depth[o]?n.depth[a]:n.depth[o])+1,e[a*2+1]=e[o*2+1]=c,n.heap[1]=c++,Ss(n,e,1);while(n.heap_len>=2);n.heap[--n.heap_max]=n.heap[1],wf(n,t),Oo(e,l,n.bl_count)},Bo=(n,t,e)=>{let i,r=-1,s,a=t[0*2+1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),t[(e+1)*2+1]=65535,i=0;i<=e;i++)s=a,a=t[(i+1)*2+1],!(++o<l&&s===a)&&(o<c?n.bl_tree[s*2]+=o:s!==0?(s!==r&&n.bl_tree[s*2]++,n.bl_tree[Eo*2]++):o<=10?n.bl_tree[ko*2]++:n.bl_tree[Ao*2]++,o=0,r=s,a===0?(l=138,c=3):s===a?(l=6,c=3):(l=7,c=4))},Go=(n,t,e)=>{let i,r=-1,s,a=t[0*2+1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),i=0;i<=e;i++)if(s=a,a=t[(i+1)*2+1],!(++o<l&&s===a)){if(o<c)do ke(n,s,n.bl_tree);while(--o!==0);else s!==0?(s!==r&&(ke(n,s,n.bl_tree),o--),ke(n,Eo,n.bl_tree),re(n,o-3,2)):o<=10?(ke(n,ko,n.bl_tree),re(n,o-3,3)):(ke(n,Ao,n.bl_tree),re(n,o-11,7));o=0,r=s,a===0?(l=138,c=3):s===a?(l=6,c=3):(l=7,c=4)}},bf=n=>{let t;for(Bo(n,n.dyn_ltree,n.l_desc.max_code),Bo(n,n.dyn_dtree,n.d_desc.max_code),Es(n,n.bl_desc),t=_s-1;t>=3&&n.bl_tree[Po[t]*2+1]===0;t--);return n.opt_len+=3*(t+1)+5+5+4,t},Cf=(n,t,e,i)=>{let r;for(re(n,t-257,5),re(n,e-1,5),re(n,i-4,4),r=0;r<i;r++)re(n,n.bl_tree[Po[r]*2+1],3);Go(n,n.dyn_ltree,t-1),Go(n,n.dyn_dtree,e-1)},Tf=n=>{let t=4093624447,e;for(e=0;e<=31;e++,t>>>=1)if(t&1&&n.dyn_ltree[e*2]!==0)return bo;if(n.dyn_ltree[9*2]!==0||n.dyn_ltree[10*2]!==0||n.dyn_ltree[13*2]!==0)return Co;for(e=32;e<mi;e++)if(n.dyn_ltree[e*2]!==0)return Co;return bo};let Ho=!1;const Sf=n=>{Ho||(xf(),Ho=!0),n.l_desc=new Ts(n.dyn_ltree,Io),n.d_desc=new Ts(n.dyn_dtree,Mo),n.bl_desc=new Ts(n.bl_tree,Lo),n.bi_buf=0,n.bi_valid=0,Fo(n)},Vo=(n,t,e,i)=>{re(n,(uf<<1)+(i?1:0),3),Uo(n),xi(n,e),xi(n,~e),e&&n.pending_buf.set(n.window.subarray(t,t+e),n.pending),n.pending+=e},Ef=n=>{re(n,To<<1,3),ke(n,ws,Be),yf(n)},kf=(n,t,e,i)=>{let r,s,a=0;n.level>0?(n.strm.data_type===ff&&(n.strm.data_type=Tf(n)),Es(n,n.l_desc),Es(n,n.d_desc),a=bf(n),r=n.opt_len+3+7>>>3,s=n.static_len+3+7>>>3,s<=r&&(r=s)):r=s=e+5,e+4<=r&&t!==-1?Vo(n,t,e,i):n.strategy===hf||s===r?(re(n,(To<<1)+(i?1:0),3),zo(n,Be,_i)):(re(n,(df<<1)+(i?1:0),3),Cf(n,n.l_desc.max_code+1,n.d_desc.max_code+1,a+1),zo(n,n.dyn_ltree,n.dyn_dtree)),Fo(n),i&&Uo(n)},Af=(n,t,e)=>(n.pending_buf[n.sym_buf+n.sym_next++]=t,n.pending_buf[n.sym_buf+n.sym_next++]=t>>8,n.pending_buf[n.sym_buf+n.sym_next++]=e,t===0?n.dyn_ltree[e*2]++:(n.matches++,t--,n.dyn_ltree[(wi[e]+mi+1)*2]++,n.dyn_dtree[Do(t)*2]++),n.sym_next===n.sym_end);var Pf=Sf,If=Vo,Mf=kf,Lf=Af,Df=Ef,Rf={_tr_init:Pf,_tr_stored_block:If,_tr_flush_block:Mf,_tr_tally:Lf,_tr_align:Df},bi=(n,t,e,i)=>{let r=n&65535|0,s=n>>>16&65535|0,a=0;for(;e!==0;){a=e>2e3?2e3:e,e-=a;do r=r+t[i++]|0,s=s+r|0;while(--a);r%=65521,s%=65521}return r|s<<16|0};const Of=()=>{let n,t=[];for(var e=0;e<256;e++){n=e;for(var i=0;i<8;i++)n=n&1?3988292384^n>>>1:n>>>1;t[e]=n}return t},Ff=new Uint32Array(Of());var Yt=(n,t,e,i)=>{const r=Ff,s=i+e;n^=-1;for(let a=i;a<s;a++)n=n>>>8^r[(n^t[a])&255];return n^-1},bn={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Cn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Uf,_tr_stored_block:ks,_tr_flush_block:Nf,_tr_tally:rn,_tr_align:zf}=Rf,{Z_NO_FLUSH:sn,Z_PARTIAL_FLUSH:Bf,Z_FULL_FLUSH:Gf,Z_FINISH:me,Z_BLOCK:jo,Z_OK:Zt,Z_STREAM_END:Xo,Z_STREAM_ERROR:Ae,Z_DATA_ERROR:Hf,Z_BUF_ERROR:As,Z_DEFAULT_COMPRESSION:Vf,Z_FILTERED:jf,Z_HUFFMAN_ONLY:fr,Z_RLE:Xf,Z_FIXED:Yf,Z_DEFAULT_STRATEGY:$f,Z_UNKNOWN:qf,Z_DEFLATED:ur}=Cn,Zf=9,Wf=15,Jf=8,Kf=29,Ps=256+1+Kf,Qf=30,tu=19,eu=2*Ps+1,nu=15,Lt=3,an=258,Pe=an+Lt+1,iu=32,Hn=42,Is=57,Ms=69,Ls=73,Ds=91,Rs=103,Tn=113,Ci=666,ne=1,Vn=2,Sn=3,jn=4,ru=3,En=(n,t)=>(n.msg=bn[t],t),Yo=n=>n*2-(n>4?9:0),on=n=>{let t=n.length;for(;--t>=0;)n[t]=0},su=n=>{let t,e,i,r=n.w_size;t=n.hash_size,i=t;do e=n.head[--i],n.head[i]=e>=r?e-r:0;while(--t);t=r,i=t;do e=n.prev[--i],n.prev[i]=e>=r?e-r:0;while(--t)};let ln=(n,t,e)=>(t<<n.hash_shift^e)&n.hash_mask;const he=n=>{const t=n.state;let e=t.pending;e>n.avail_out&&(e=n.avail_out),e!==0&&(n.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+e),n.next_out),n.next_out+=e,t.pending_out+=e,n.total_out+=e,n.avail_out-=e,t.pending-=e,t.pending===0&&(t.pending_out=0))},fe=(n,t)=>{Nf(n,n.block_start>=0?n.block_start:-1,n.strstart-n.block_start,t),n.block_start=n.strstart,he(n.strm)},Ft=(n,t)=>{n.pending_buf[n.pending++]=t},Ti=(n,t)=>{n.pending_buf[n.pending++]=t>>>8&255,n.pending_buf[n.pending++]=t&255},Os=(n,t,e,i)=>{let r=n.avail_in;return r>i&&(r=i),r===0?0:(n.avail_in-=r,t.set(n.input.subarray(n.next_in,n.next_in+r),e),n.state.wrap===1?n.adler=bi(n.adler,t,r,e):n.state.wrap===2&&(n.adler=Yt(n.adler,t,r,e)),n.next_in+=r,n.total_in+=r,r)},$o=(n,t)=>{let e=n.max_chain_length,i=n.strstart,r,s,a=n.prev_length,o=n.nice_match;const l=n.strstart>n.w_size-Pe?n.strstart-(n.w_size-Pe):0,c=n.window,u=n.w_mask,g=n.prev,p=n.strstart+an;let d=c[i+a-1],w=c[i+a];n.prev_length>=n.good_match&&(e>>=2),o>n.lookahead&&(o=n.lookahead);do if(r=t,!(c[r+a]!==w||c[r+a-1]!==d||c[r]!==c[i]||c[++r]!==c[i+1])){i+=2,r++;do;while(c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&i<p);if(s=an-(p-i),i=p-an,s>a){if(n.match_start=t,a=s,s>=o)break;d=c[i+a-1],w=c[i+a]}}while((t=g[t&u])>l&&--e!==0);return a<=n.lookahead?a:n.lookahead},Xn=n=>{const t=n.w_size;let e,i,r;do{if(i=n.window_size-n.lookahead-n.strstart,n.strstart>=t+(t-Pe)&&(n.window.set(n.window.subarray(t,t+t-i),0),n.match_start-=t,n.strstart-=t,n.block_start-=t,n.insert>n.strstart&&(n.insert=n.strstart),su(n),i+=t),n.strm.avail_in===0)break;if(e=Os(n.strm,n.window,n.strstart+n.lookahead,i),n.lookahead+=e,n.lookahead+n.insert>=Lt)for(r=n.strstart-n.insert,n.ins_h=n.window[r],n.ins_h=ln(n,n.ins_h,n.window[r+1]);n.insert&&(n.ins_h=ln(n,n.ins_h,n.window[r+Lt-1]),n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,n.insert--,!(n.lookahead+n.insert<Lt)););}while(n.lookahead<Pe&&n.strm.avail_in!==0)},qo=(n,t)=>{let e=n.pending_buf_size-5>n.w_size?n.w_size:n.pending_buf_size-5,i,r,s,a=0,o=n.strm.avail_in;do{if(i=65535,s=n.bi_valid+42>>3,n.strm.avail_out<s||(s=n.strm.avail_out-s,r=n.strstart-n.block_start,i>r+n.strm.avail_in&&(i=r+n.strm.avail_in),i>s&&(i=s),i<e&&(i===0&&t!==me||t===sn||i!==r+n.strm.avail_in)))break;a=t===me&&i===r+n.strm.avail_in?1:0,ks(n,0,0,a),n.pending_buf[n.pending-4]=i,n.pending_buf[n.pending-3]=i>>8,n.pending_buf[n.pending-2]=~i,n.pending_buf[n.pending-1]=~i>>8,he(n.strm),r&&(r>i&&(r=i),n.strm.output.set(n.window.subarray(n.block_start,n.block_start+r),n.strm.next_out),n.strm.next_out+=r,n.strm.avail_out-=r,n.strm.total_out+=r,n.block_start+=r,i-=r),i&&(Os(n.strm,n.strm.output,n.strm.next_out,i),n.strm.next_out+=i,n.strm.avail_out-=i,n.strm.total_out+=i)}while(a===0);return o-=n.strm.avail_in,o&&(o>=n.w_size?(n.matches=2,n.window.set(n.strm.input.subarray(n.strm.next_in-n.w_size,n.strm.next_in),0),n.strstart=n.w_size,n.insert=n.strstart):(n.window_size-n.strstart<=o&&(n.strstart-=n.w_size,n.window.set(n.window.subarray(n.w_size,n.w_size+n.strstart),0),n.matches<2&&n.matches++,n.insert>n.strstart&&(n.insert=n.strstart)),n.window.set(n.strm.input.subarray(n.strm.next_in-o,n.strm.next_in),n.strstart),n.strstart+=o,n.insert+=o>n.w_size-n.insert?n.w_size-n.insert:o),n.block_start=n.strstart),n.high_water<n.strstart&&(n.high_water=n.strstart),a?jn:t!==sn&&t!==me&&n.strm.avail_in===0&&n.strstart===n.block_start?Vn:(s=n.window_size-n.strstart,n.strm.avail_in>s&&n.block_start>=n.w_size&&(n.block_start-=n.w_size,n.strstart-=n.w_size,n.window.set(n.window.subarray(n.w_size,n.w_size+n.strstart),0),n.matches<2&&n.matches++,s+=n.w_size,n.insert>n.strstart&&(n.insert=n.strstart)),s>n.strm.avail_in&&(s=n.strm.avail_in),s&&(Os(n.strm,n.window,n.strstart,s),n.strstart+=s,n.insert+=s>n.w_size-n.insert?n.w_size-n.insert:s),n.high_water<n.strstart&&(n.high_water=n.strstart),s=n.bi_valid+42>>3,s=n.pending_buf_size-s>65535?65535:n.pending_buf_size-s,e=s>n.w_size?n.w_size:s,r=n.strstart-n.block_start,(r>=e||(r||t===me)&&t!==sn&&n.strm.avail_in===0&&r<=s)&&(i=r>s?s:r,a=t===me&&n.strm.avail_in===0&&i===r?1:0,ks(n,n.block_start,i,a),n.block_start+=i,he(n.strm)),a?Sn:ne)},Fs=(n,t)=>{let e,i;for(;;){if(n.lookahead<Pe){if(Xn(n),n.lookahead<Pe&&t===sn)return ne;if(n.lookahead===0)break}if(e=0,n.lookahead>=Lt&&(n.ins_h=ln(n,n.ins_h,n.window[n.strstart+Lt-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),e!==0&&n.strstart-e<=n.w_size-Pe&&(n.match_length=$o(n,e)),n.match_length>=Lt)if(i=rn(n,n.strstart-n.match_start,n.match_length-Lt),n.lookahead-=n.match_length,n.match_length<=n.max_lazy_match&&n.lookahead>=Lt){n.match_length--;do n.strstart++,n.ins_h=ln(n,n.ins_h,n.window[n.strstart+Lt-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart;while(--n.match_length!==0);n.strstart++}else n.strstart+=n.match_length,n.match_length=0,n.ins_h=n.window[n.strstart],n.ins_h=ln(n,n.ins_h,n.window[n.strstart+1]);else i=rn(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++;if(i&&(fe(n,!1),n.strm.avail_out===0))return ne}return n.insert=n.strstart<Lt-1?n.strstart:Lt-1,t===me?(fe(n,!0),n.strm.avail_out===0?Sn:jn):n.sym_next&&(fe(n,!1),n.strm.avail_out===0)?ne:Vn},Yn=(n,t)=>{let e,i,r;for(;;){if(n.lookahead<Pe){if(Xn(n),n.lookahead<Pe&&t===sn)return ne;if(n.lookahead===0)break}if(e=0,n.lookahead>=Lt&&(n.ins_h=ln(n,n.ins_h,n.window[n.strstart+Lt-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),n.prev_length=n.match_length,n.prev_match=n.match_start,n.match_length=Lt-1,e!==0&&n.prev_length<n.max_lazy_match&&n.strstart-e<=n.w_size-Pe&&(n.match_length=$o(n,e),n.match_length<=5&&(n.strategy===jf||n.match_length===Lt&&n.strstart-n.match_start>4096)&&(n.match_length=Lt-1)),n.prev_length>=Lt&&n.match_length<=n.prev_length){r=n.strstart+n.lookahead-Lt,i=rn(n,n.strstart-1-n.prev_match,n.prev_length-Lt),n.lookahead-=n.prev_length-1,n.prev_length-=2;do++n.strstart<=r&&(n.ins_h=ln(n,n.ins_h,n.window[n.strstart+Lt-1]),e=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart);while(--n.prev_length!==0);if(n.match_available=0,n.match_length=Lt-1,n.strstart++,i&&(fe(n,!1),n.strm.avail_out===0))return ne}else if(n.match_available){if(i=rn(n,0,n.window[n.strstart-1]),i&&fe(n,!1),n.strstart++,n.lookahead--,n.strm.avail_out===0)return ne}else n.match_available=1,n.strstart++,n.lookahead--}return n.match_available&&(i=rn(n,0,n.window[n.strstart-1]),n.match_available=0),n.insert=n.strstart<Lt-1?n.strstart:Lt-1,t===me?(fe(n,!0),n.strm.avail_out===0?Sn:jn):n.sym_next&&(fe(n,!1),n.strm.avail_out===0)?ne:Vn},au=(n,t)=>{let e,i,r,s;const a=n.window;for(;;){if(n.lookahead<=an){if(Xn(n),n.lookahead<=an&&t===sn)return ne;if(n.lookahead===0)break}if(n.match_length=0,n.lookahead>=Lt&&n.strstart>0&&(r=n.strstart-1,i=a[r],i===a[++r]&&i===a[++r]&&i===a[++r])){s=n.strstart+an;do;while(i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&r<s);n.match_length=an-(s-r),n.match_length>n.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>=Lt?(e=rn(n,1,n.match_length-Lt),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(e=rn(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),e&&(fe(n,!1),n.strm.avail_out===0))return ne}return n.insert=0,t===me?(fe(n,!0),n.strm.avail_out===0?Sn:jn):n.sym_next&&(fe(n,!1),n.strm.avail_out===0)?ne:Vn},ou=(n,t)=>{let e;for(;;){if(n.lookahead===0&&(Xn(n),n.lookahead===0)){if(t===sn)return ne;break}if(n.match_length=0,e=rn(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++,e&&(fe(n,!1),n.strm.avail_out===0))return ne}return n.insert=0,t===me?(fe(n,!0),n.strm.avail_out===0?Sn:jn):n.sym_next&&(fe(n,!1),n.strm.avail_out===0)?ne:Vn};function Ie(n,t,e,i,r){this.good_length=n,this.max_lazy=t,this.nice_length=e,this.max_chain=i,this.func=r}const Si=[new Ie(0,0,0,0,qo),new Ie(4,4,8,4,Fs),new Ie(4,5,16,8,Fs),new Ie(4,6,32,32,Fs),new Ie(4,4,16,16,Yn),new Ie(8,16,32,32,Yn),new Ie(8,16,128,128,Yn),new Ie(8,32,128,256,Yn),new Ie(32,128,258,1024,Yn),new Ie(32,258,258,4096,Yn)],lu=n=>{n.window_size=2*n.w_size,on(n.head),n.max_lazy_match=Si[n.level].max_lazy,n.good_match=Si[n.level].good_length,n.nice_match=Si[n.level].nice_length,n.max_chain_length=Si[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=Lt-1,n.match_available=0,n.ins_h=0};function cu(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ur,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(eu*2),this.dyn_dtree=new Uint16Array((2*Qf+1)*2),this.bl_tree=new Uint16Array((2*tu+1)*2),on(this.dyn_ltree),on(this.dyn_dtree),on(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(nu+1),this.heap=new Uint16Array(2*Ps+1),on(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Ps+1),on(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ei=n=>{if(!n)return 1;const t=n.state;return!t||t.strm!==n||t.status!==Hn&&t.status!==Is&&t.status!==Ms&&t.status!==Ls&&t.status!==Ds&&t.status!==Rs&&t.status!==Tn&&t.status!==Ci?1:0},Zo=n=>{if(Ei(n))return En(n,Ae);n.total_in=n.total_out=0,n.data_type=qf;const t=n.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?Is:t.wrap?Hn:Tn,n.adler=t.wrap===2?0:1,t.last_flush=-2,Uf(t),Zt},Wo=n=>{const t=Zo(n);return t===Zt&&lu(n.state),t},hu=(n,t)=>Ei(n)||n.state.wrap!==2?Ae:(n.state.gzhead=t,Zt),Jo=(n,t,e,i,r,s)=>{if(!n)return Ae;let a=1;if(t===Vf&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),r<1||r>Zf||e!==ur||i<8||i>15||t<0||t>9||s<0||s>Yf||i===8&&a!==1)return En(n,Ae);i===8&&(i=9);const o=new cu;return n.state=o,o.strm=n,o.status=Hn,o.wrap=a,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=r+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+Lt-1)/Lt),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<r+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=(o.lit_bufsize-1)*3,o.level=t,o.strategy=s,o.method=e,Wo(n)},fu=(n,t)=>Jo(n,t,ur,Wf,Jf,$f),uu=(n,t)=>{if(Ei(n)||t>jo||t<0)return n?En(n,Ae):Ae;const e=n.state;if(!n.output||n.avail_in!==0&&!n.input||e.status===Ci&&t!==me)return En(n,n.avail_out===0?As:Ae);const i=e.last_flush;if(e.last_flush=t,e.pending!==0){if(he(n),n.avail_out===0)return e.last_flush=-1,Zt}else if(n.avail_in===0&&Yo(t)<=Yo(i)&&t!==me)return En(n,As);if(e.status===Ci&&n.avail_in!==0)return En(n,As);if(e.status===Hn&&e.wrap===0&&(e.status=Tn),e.status===Hn){let r=ur+(e.w_bits-8<<4)<<8,s=-1;if(e.strategy>=fr||e.level<2?s=0:e.level<6?s=1:e.level===6?s=2:s=3,r|=s<<6,e.strstart!==0&&(r|=iu),r+=31-r%31,Ti(e,r),e.strstart!==0&&(Ti(e,n.adler>>>16),Ti(e,n.adler&65535)),n.adler=1,e.status=Tn,he(n),e.pending!==0)return e.last_flush=-1,Zt}if(e.status===Is){if(n.adler=0,Ft(e,31),Ft(e,139),Ft(e,8),e.gzhead)Ft(e,(e.gzhead.text?1:0)+(e.gzhead.hcrc?2:0)+(e.gzhead.extra?4:0)+(e.gzhead.name?8:0)+(e.gzhead.comment?16:0)),Ft(e,e.gzhead.time&255),Ft(e,e.gzhead.time>>8&255),Ft(e,e.gzhead.time>>16&255),Ft(e,e.gzhead.time>>24&255),Ft(e,e.level===9?2:e.strategy>=fr||e.level<2?4:0),Ft(e,e.gzhead.os&255),e.gzhead.extra&&e.gzhead.extra.length&&(Ft(e,e.gzhead.extra.length&255),Ft(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(n.adler=Yt(n.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=Ms;else if(Ft(e,0),Ft(e,0),Ft(e,0),Ft(e,0),Ft(e,0),Ft(e,e.level===9?2:e.strategy>=fr||e.level<2?4:0),Ft(e,ru),e.status=Tn,he(n),e.pending!==0)return e.last_flush=-1,Zt}if(e.status===Ms){if(e.gzhead.extra){let r=e.pending,s=(e.gzhead.extra.length&65535)-e.gzindex;for(;e.pending+s>e.pending_buf_size;){let o=e.pending_buf_size-e.pending;if(e.pending_buf.set(e.gzhead.extra.subarray(e.gzindex,e.gzindex+o),e.pending),e.pending=e.pending_buf_size,e.gzhead.hcrc&&e.pending>r&&(n.adler=Yt(n.adler,e.pending_buf,e.pending-r,r)),e.gzindex+=o,he(n),e.pending!==0)return e.last_flush=-1,Zt;r=0,s-=o}let a=new Uint8Array(e.gzhead.extra);e.pending_buf.set(a.subarray(e.gzindex,e.gzindex+s),e.pending),e.pending+=s,e.gzhead.hcrc&&e.pending>r&&(n.adler=Yt(n.adler,e.pending_buf,e.pending-r,r)),e.gzindex=0}e.status=Ls}if(e.status===Ls){if(e.gzhead.name){let r=e.pending,s;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>r&&(n.adler=Yt(n.adler,e.pending_buf,e.pending-r,r)),he(n),e.pending!==0)return e.last_flush=-1,Zt;r=0}e.gzindex<e.gzhead.name.length?s=e.gzhead.name.charCodeAt(e.gzindex++)&255:s=0,Ft(e,s)}while(s!==0);e.gzhead.hcrc&&e.pending>r&&(n.adler=Yt(n.adler,e.pending_buf,e.pending-r,r)),e.gzindex=0}e.status=Ds}if(e.status===Ds){if(e.gzhead.comment){let r=e.pending,s;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>r&&(n.adler=Yt(n.adler,e.pending_buf,e.pending-r,r)),he(n),e.pending!==0)return e.last_flush=-1,Zt;r=0}e.gzindex<e.gzhead.comment.length?s=e.gzhead.comment.charCodeAt(e.gzindex++)&255:s=0,Ft(e,s)}while(s!==0);e.gzhead.hcrc&&e.pending>r&&(n.adler=Yt(n.adler,e.pending_buf,e.pending-r,r))}e.status=Rs}if(e.status===Rs){if(e.gzhead.hcrc){if(e.pending+2>e.pending_buf_size&&(he(n),e.pending!==0))return e.last_flush=-1,Zt;Ft(e,n.adler&255),Ft(e,n.adler>>8&255),n.adler=0}if(e.status=Tn,he(n),e.pending!==0)return e.last_flush=-1,Zt}if(n.avail_in!==0||e.lookahead!==0||t!==sn&&e.status!==Ci){let r=e.level===0?qo(e,t):e.strategy===fr?ou(e,t):e.strategy===Xf?au(e,t):Si[e.level].func(e,t);if((r===Sn||r===jn)&&(e.status=Ci),r===ne||r===Sn)return n.avail_out===0&&(e.last_flush=-1),Zt;if(r===Vn&&(t===Bf?zf(e):t!==jo&&(ks(e,0,0,!1),t===Gf&&(on(e.head),e.lookahead===0&&(e.strstart=0,e.block_start=0,e.insert=0))),he(n),n.avail_out===0))return e.last_flush=-1,Zt}return t!==me?Zt:e.wrap<=0?Xo:(e.wrap===2?(Ft(e,n.adler&255),Ft(e,n.adler>>8&255),Ft(e,n.adler>>16&255),Ft(e,n.adler>>24&255),Ft(e,n.total_in&255),Ft(e,n.total_in>>8&255),Ft(e,n.total_in>>16&255),Ft(e,n.total_in>>24&255)):(Ti(e,n.adler>>>16),Ti(e,n.adler&65535)),he(n),e.wrap>0&&(e.wrap=-e.wrap),e.pending!==0?Zt:Xo)},du=n=>{if(Ei(n))return Ae;const t=n.state.status;return n.state=null,t===Tn?En(n,Hf):Zt},pu=(n,t)=>{let e=t.length;if(Ei(n))return Ae;const i=n.state,r=i.wrap;if(r===2||r===1&&i.status!==Hn||i.lookahead)return Ae;if(r===1&&(n.adler=bi(n.adler,t,e,0)),i.wrap=0,e>=i.w_size){r===0&&(on(i.head),i.strstart=0,i.block_start=0,i.insert=0);let l=new Uint8Array(i.w_size);l.set(t.subarray(e-i.w_size,e),0),t=l,e=i.w_size}const s=n.avail_in,a=n.next_in,o=n.input;for(n.avail_in=e,n.next_in=0,n.input=t,Xn(i);i.lookahead>=Lt;){let l=i.strstart,c=i.lookahead-(Lt-1);do i.ins_h=ln(i,i.ins_h,i.window[l+Lt-1]),i.prev[l&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=l,l++;while(--c);i.strstart=l,i.lookahead=Lt-1,Xn(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=Lt-1,i.match_available=0,n.next_in=a,n.input=o,n.avail_in=s,i.wrap=r,Zt};var gu=fu,mu=Jo,vu=Wo,_u=Zo,yu=hu,wu=uu,xu=du,bu=pu,Cu="pako deflate (from Nodeca project)",ki={deflateInit:gu,deflateInit2:mu,deflateReset:vu,deflateResetKeep:_u,deflateSetHeader:yu,deflate:wu,deflateEnd:xu,deflateSetDictionary:bu,deflateInfo:Cu};const Tu=(n,t)=>Object.prototype.hasOwnProperty.call(n,t);var Su=function(n){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const e=t.shift();if(e){if(typeof e!="object")throw new TypeError(e+"must be non-object");for(const i in e)Tu(e,i)&&(n[i]=e[i])}}return n},Eu=n=>{let t=0;for(let i=0,r=n.length;i<r;i++)t+=n[i].length;const e=new Uint8Array(t);for(let i=0,r=0,s=n.length;i<s;i++){let a=n[i];e.set(a,r),r+=a.length}return e},dr={assign:Su,flattenChunks:Eu};let Ko=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Ko=!1}const Ai=new Uint8Array(256);for(let n=0;n<256;n++)Ai[n]=n>=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;Ai[254]=Ai[254]=1;var ku=n=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(n);let t,e,i,r,s,a=n.length,o=0;for(r=0;r<a;r++)e=n.charCodeAt(r),(e&64512)===55296&&r+1<a&&(i=n.charCodeAt(r+1),(i&64512)===56320&&(e=65536+(e-55296<<10)+(i-56320),r++)),o+=e<128?1:e<2048?2:e<65536?3:4;for(t=new Uint8Array(o),s=0,r=0;s<o;r++)e=n.charCodeAt(r),(e&64512)===55296&&r+1<a&&(i=n.charCodeAt(r+1),(i&64512)===56320&&(e=65536+(e-55296<<10)+(i-56320),r++)),e<128?t[s++]=e:e<2048?(t[s++]=192|e>>>6,t[s++]=128|e&63):e<65536?(t[s++]=224|e>>>12,t[s++]=128|e>>>6&63,t[s++]=128|e&63):(t[s++]=240|e>>>18,t[s++]=128|e>>>12&63,t[s++]=128|e>>>6&63,t[s++]=128|e&63);return t};const Au=(n,t)=>{if(t<65534&&n.subarray&&Ko)return String.fromCharCode.apply(null,n.length===t?n:n.subarray(0,t));let e="";for(let i=0;i<t;i++)e+=String.fromCharCode(n[i]);return e};var Pu=(n,t)=>{const e=t||n.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(n.subarray(0,t));let i,r;const s=new Array(e*2);for(r=0,i=0;i<e;){let a=n[i++];if(a<128){s[r++]=a;continue}let o=Ai[a];if(o>4){s[r++]=65533,i+=o-1;continue}for(a&=o===2?31:o===3?15:7;o>1&&i<e;)a=a<<6|n[i++]&63,o--;if(o>1){s[r++]=65533;continue}a<65536?s[r++]=a:(a-=65536,s[r++]=55296|a>>10&1023,s[r++]=56320|a&1023)}return Au(s,r)},Iu=(n,t)=>{t=t||n.length,t>n.length&&(t=n.length);let e=t-1;for(;e>=0&&(n[e]&192)===128;)e--;return e<0||e===0?t:e+Ai[n[e]]>t?e:t},Pi={string2buf:ku,buf2string:Pu,utf8border:Iu};function Mu(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Qo=Mu;const tl=Object.prototype.toString,{Z_NO_FLUSH:Lu,Z_SYNC_FLUSH:Du,Z_FULL_FLUSH:Ru,Z_FINISH:Ou,Z_OK:pr,Z_STREAM_END:Fu,Z_DEFAULT_COMPRESSION:Uu,Z_DEFAULT_STRATEGY:Nu,Z_DEFLATED:zu}=Cn;function Ii(n){this.options=dr.assign({level:Uu,method:zu,chunkSize:16384,windowBits:15,memLevel:8,strategy:Nu},n||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qo,this.strm.avail_out=0;let e=ki.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==pr)throw new Error(bn[e]);if(t.header&&ki.deflateSetHeader(this.strm,t.header),t.dictionary){let i;if(typeof t.dictionary=="string"?i=Pi.string2buf(t.dictionary):tl.call(t.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(t.dictionary):i=t.dictionary,e=ki.deflateSetDictionary(this.strm,i),e!==pr)throw new Error(bn[e]);this._dict_set=!0}}Ii.prototype.push=function(n,t){const e=this.strm,i=this.options.chunkSize;let r,s;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?Ou:Lu,typeof n=="string"?e.input=Pi.string2buf(n):tl.call(n)==="[object ArrayBuffer]"?e.input=new Uint8Array(n):e.input=n,e.next_in=0,e.avail_in=e.input.length;;){if(e.avail_out===0&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),(s===Du||s===Ru)&&e.avail_out<=6){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(r=ki.deflate(e,s),r===Fu)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),r=ki.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===pr;if(e.avail_out===0){this.onData(e.output);continue}if(s>0&&e.next_out>0){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(e.avail_in===0)break}return!0},Ii.prototype.onData=function(n){this.chunks.push(n)},Ii.prototype.onEnd=function(n){n===pr&&(this.result=dr.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function Us(n,t){const e=new Ii(t);if(e.push(n,!0),e.err)throw e.msg||bn[e.err];return e.result}function Bu(n,t){return t=t||{},t.raw=!0,Us(n,t)}function Gu(n,t){return t=t||{},t.gzip=!0,Us(n,t)}var Hu=Ii,Vu=Us,ju=Bu,Xu=Gu,Yu=Cn,$u={Deflate:Hu,deflate:Vu,deflateRaw:ju,gzip:Xu,constants:Yu};const gr=16209,qu=16191;var Zu=function(t,e){let i,r,s,a,o,l,c,u,g,p,d,w,x,C,A,P,M,D,U,z,F,G,H,$;const X=t.state;i=t.next_in,H=t.input,r=i+(t.avail_in-5),s=t.next_out,$=t.output,a=s-(e-t.avail_out),o=s+(t.avail_out-257),l=X.dmax,c=X.wsize,u=X.whave,g=X.wnext,p=X.window,d=X.hold,w=X.bits,x=X.lencode,C=X.distcode,A=(1<<X.lenbits)-1,P=(1<<X.distbits)-1;t:do{w<15&&(d+=H[i++]<<w,w+=8,d+=H[i++]<<w,w+=8),M=x[d&A];e:for(;;){if(D=M>>>24,d>>>=D,w-=D,D=M>>>16&255,D===0)$[s++]=M&65535;else if(D&16){U=M&65535,D&=15,D&&(w<D&&(d+=H[i++]<<w,w+=8),U+=d&(1<<D)-1,d>>>=D,w-=D),w<15&&(d+=H[i++]<<w,w+=8,d+=H[i++]<<w,w+=8),M=C[d&P];n:for(;;){if(D=M>>>24,d>>>=D,w-=D,D=M>>>16&255,D&16){if(z=M&65535,D&=15,w<D&&(d+=H[i++]<<w,w+=8,w<D&&(d+=H[i++]<<w,w+=8)),z+=d&(1<<D)-1,z>l){t.msg="invalid distance too far back",X.mode=gr;break t}if(d>>>=D,w-=D,D=s-a,z>D){if(D=z-D,D>u&&X.sane){t.msg="invalid distance too far back",X.mode=gr;break t}if(F=0,G=p,g===0){if(F+=c-D,D<U){U-=D;do $[s++]=p[F++];while(--D);F=s-z,G=$}}else if(g<D){if(F+=c+g-D,D-=g,D<U){U-=D;do $[s++]=p[F++];while(--D);if(F=0,g<U){D=g,U-=D;do $[s++]=p[F++];while(--D);F=s-z,G=$}}}else if(F+=g-D,D<U){U-=D;do $[s++]=p[F++];while(--D);F=s-z,G=$}for(;U>2;)$[s++]=G[F++],$[s++]=G[F++],$[s++]=G[F++],U-=3;U&&($[s++]=G[F++],U>1&&($[s++]=G[F++]))}else{F=s-z;do $[s++]=$[F++],$[s++]=$[F++],$[s++]=$[F++],U-=3;while(U>2);U&&($[s++]=$[F++],U>1&&($[s++]=$[F++]))}}else if(D&64){t.msg="invalid distance code",X.mode=gr;break t}else{M=C[(M&65535)+(d&(1<<D)-1)];continue n}break}}else if(D&64)if(D&32){X.mode=qu;break t}else{t.msg="invalid literal/length code",X.mode=gr;break t}else{M=x[(M&65535)+(d&(1<<D)-1)];continue e}break}}while(i<r&&s<o);U=w>>3,i-=U,w-=U<<3,d&=(1<<w)-1,t.next_in=i,t.next_out=s,t.avail_in=i<r?5+(r-i):5-(i-r),t.avail_out=s<o?257+(o-s):257-(s-o),X.hold=d,X.bits=w};const $n=15,el=852,nl=592,il=0,Ns=1,rl=2,Wu=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Ju=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Ku=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Qu=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Mi=(n,t,e,i,r,s,a,o)=>{const l=o.bits;let c=0,u=0,g=0,p=0,d=0,w=0,x=0,C=0,A=0,P=0,M,D,U,z,F,G=null,H;const $=new Uint16Array($n+1),X=new Uint16Array($n+1);let J=null,dt,ft,gt;for(c=0;c<=$n;c++)$[c]=0;for(u=0;u<i;u++)$[t[e+u]]++;for(d=l,p=$n;p>=1&&$[p]===0;p--);if(d>p&&(d=p),p===0)return r[s++]=1<<24|64<<16|0,r[s++]=1<<24|64<<16|0,o.bits=1,0;for(g=1;g<p&&$[g]===0;g++);for(d<g&&(d=g),C=1,c=1;c<=$n;c++)if(C<<=1,C-=$[c],C<0)return-1;if(C>0&&(n===il||p!==1))return-1;for(X[1]=0,c=1;c<$n;c++)X[c+1]=X[c]+$[c];for(u=0;u<i;u++)t[e+u]!==0&&(a[X[t[e+u]]++]=u);if(n===il?(G=J=a,H=20):n===Ns?(G=Wu,J=Ju,H=257):(G=Ku,J=Qu,H=0),P=0,u=0,c=g,F=s,w=d,x=0,U=-1,A=1<<d,z=A-1,n===Ns&&A>el||n===rl&&A>nl)return 1;for(;;){dt=c-x,a[u]+1<H?(ft=0,gt=a[u]):a[u]>=H?(ft=J[a[u]-H],gt=G[a[u]-H]):(ft=32+64,gt=0),M=1<<c-x,D=1<<w,g=D;do D-=M,r[F+(P>>x)+D]=dt<<24|ft<<16|gt|0;while(D!==0);for(M=1<<c-1;P&M;)M>>=1;if(M!==0?(P&=M-1,P+=M):P=0,u++,--$[c]===0){if(c===p)break;c=t[e+a[u]]}if(c>d&&(P&z)!==U){for(x===0&&(x=d),F+=g,w=c-x,C=1<<w;w+x<p&&(C-=$[w+x],!(C<=0));)w++,C<<=1;if(A+=1<<w,n===Ns&&A>el||n===rl&&A>nl)return 1;U=P&z,r[U]=d<<24|w<<16|F-s|0}}return P!==0&&(r[F+P]=c-x<<24|64<<16|0),o.bits=d,0};const td=0,sl=1,al=2,{Z_FINISH:ol,Z_BLOCK:ed,Z_TREES:mr,Z_OK:kn,Z_STREAM_END:nd,Z_NEED_DICT:id,Z_STREAM_ERROR:ve,Z_DATA_ERROR:ll,Z_MEM_ERROR:cl,Z_BUF_ERROR:rd,Z_DEFLATED:hl}=Cn,vr=16180,fl=16181,ul=16182,dl=16183,pl=16184,gl=16185,ml=16186,vl=16187,_l=16188,yl=16189,_r=16190,Ge=16191,zs=16192,wl=16193,Bs=16194,xl=16195,bl=16196,Cl=16197,Tl=16198,yr=16199,wr=16200,Sl=16201,El=16202,kl=16203,Al=16204,Pl=16205,Gs=16206,Il=16207,Ml=16208,Bt=16209,Ll=16210,Dl=16211,sd=852,ad=592,od=15,Rl=n=>(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24);function ld(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const An=n=>{if(!n)return 1;const t=n.state;return!t||t.strm!==n||t.mode<vr||t.mode>Dl?1:0},Ol=n=>{if(An(n))return ve;const t=n.state;return n.total_in=n.total_out=t.total=0,n.msg="",t.wrap&&(n.adler=t.wrap&1),t.mode=vr,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(sd),t.distcode=t.distdyn=new Int32Array(ad),t.sane=1,t.back=-1,kn},Fl=n=>{if(An(n))return ve;const t=n.state;return t.wsize=0,t.whave=0,t.wnext=0,Ol(n)},Ul=(n,t)=>{let e;if(An(n))return ve;const i=n.state;return t<0?(e=0,t=-t):(e=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?ve:(i.window!==null&&i.wbits!==t&&(i.window=null),i.wrap=e,i.wbits=t,Fl(n))},Nl=(n,t)=>{if(!n)return ve;const e=new ld;n.state=e,e.strm=n,e.window=null,e.mode=vr;const i=Ul(n,t);return i!==kn&&(n.state=null),i},cd=n=>Nl(n,od);let zl=!0,Hs,Vs;const hd=n=>{if(zl){Hs=new Int32Array(512),Vs=new Int32Array(32);let t=0;for(;t<144;)n.lens[t++]=8;for(;t<256;)n.lens[t++]=9;for(;t<280;)n.lens[t++]=7;for(;t<288;)n.lens[t++]=8;for(Mi(sl,n.lens,0,288,Hs,0,n.work,{bits:9}),t=0;t<32;)n.lens[t++]=5;Mi(al,n.lens,0,32,Vs,0,n.work,{bits:5}),zl=!1}n.lencode=Hs,n.lenbits=9,n.distcode=Vs,n.distbits=5},Bl=(n,t,e,i)=>{let r;const s=n.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),i>=s.wsize?(s.window.set(t.subarray(e-s.wsize,e),0),s.wnext=0,s.whave=s.wsize):(r=s.wsize-s.wnext,r>i&&(r=i),s.window.set(t.subarray(e-i,e-i+r),s.wnext),i-=r,i?(s.window.set(t.subarray(e-i,e),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=r,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=r))),0},fd=(n,t)=>{let e,i,r,s,a,o,l,c,u,g,p,d,w,x,C=0,A,P,M,D,U,z,F,G;const H=new Uint8Array(4);let $,X;const J=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(An(n)||!n.output||!n.input&&n.avail_in!==0)return ve;e=n.state,e.mode===Ge&&(e.mode=zs),a=n.next_out,r=n.output,l=n.avail_out,s=n.next_in,i=n.input,o=n.avail_in,c=e.hold,u=e.bits,g=o,p=l,G=kn;t:for(;;)switch(e.mode){case vr:if(e.wrap===0){e.mode=zs;break}for(;u<16;){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}if(e.wrap&2&&c===35615){e.wbits===0&&(e.wbits=15),e.check=0,H[0]=c&255,H[1]=c>>>8&255,e.check=Yt(e.check,H,2,0),c=0,u=0,e.mode=fl;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((c&255)<<8)+(c>>8))%31){n.msg="incorrect header check",e.mode=Bt;break}if((c&15)!==hl){n.msg="unknown compression method",e.mode=Bt;break}if(c>>>=4,u-=4,F=(c&15)+8,e.wbits===0&&(e.wbits=F),F>15||F>e.wbits){n.msg="invalid window size",e.mode=Bt;break}e.dmax=1<<e.wbits,e.flags=0,n.adler=e.check=1,e.mode=c&512?yl:Ge,c=0,u=0;break;case fl:for(;u<16;){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}if(e.flags=c,(e.flags&255)!==hl){n.msg="unknown compression method",e.mode=Bt;break}if(e.flags&57344){n.msg="unknown header flags set",e.mode=Bt;break}e.head&&(e.head.text=c>>8&1),e.flags&512&&e.wrap&4&&(H[0]=c&255,H[1]=c>>>8&255,e.check=Yt(e.check,H,2,0)),c=0,u=0,e.mode=ul;case ul:for(;u<32;){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}e.head&&(e.head.time=c),e.flags&512&&e.wrap&4&&(H[0]=c&255,H[1]=c>>>8&255,H[2]=c>>>16&255,H[3]=c>>>24&255,e.check=Yt(e.check,H,4,0)),c=0,u=0,e.mode=dl;case dl:for(;u<16;){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}e.head&&(e.head.xflags=c&255,e.head.os=c>>8),e.flags&512&&e.wrap&4&&(H[0]=c&255,H[1]=c>>>8&255,e.check=Yt(e.check,H,2,0)),c=0,u=0,e.mode=pl;case pl:if(e.flags&1024){for(;u<16;){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}e.length=c,e.head&&(e.head.extra_len=c),e.flags&512&&e.wrap&4&&(H[0]=c&255,H[1]=c>>>8&255,e.check=Yt(e.check,H,2,0)),c=0,u=0}else e.head&&(e.head.extra=null);e.mode=gl;case gl:if(e.flags&1024&&(d=e.length,d>o&&(d=o),d&&(e.head&&(F=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(i.subarray(s,s+d),F)),e.flags&512&&e.wrap&4&&(e.check=Yt(e.check,i,d,s)),o-=d,s+=d,e.length-=d),e.length))break t;e.length=0,e.mode=ml;case ml:if(e.flags&2048){if(o===0)break t;d=0;do F=i[s+d++],e.head&&F&&e.length<65536&&(e.head.name+=String.fromCharCode(F));while(F&&d<o);if(e.flags&512&&e.wrap&4&&(e.check=Yt(e.check,i,d,s)),o-=d,s+=d,F)break t}else e.head&&(e.head.name=null);e.length=0,e.mode=vl;case vl:if(e.flags&4096){if(o===0)break t;d=0;do F=i[s+d++],e.head&&F&&e.length<65536&&(e.head.comment+=String.fromCharCode(F));while(F&&d<o);if(e.flags&512&&e.wrap&4&&(e.check=Yt(e.check,i,d,s)),o-=d,s+=d,F)break t}else e.head&&(e.head.comment=null);e.mode=_l;case _l:if(e.flags&512){for(;u<16;){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}if(e.wrap&4&&c!==(e.check&65535)){n.msg="header crc mismatch",e.mode=Bt;break}c=0,u=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),n.adler=e.check=0,e.mode=Ge;break;case yl:for(;u<32;){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}n.adler=e.check=Rl(c),c=0,u=0,e.mode=_r;case _r:if(e.havedict===0)return n.next_out=a,n.avail_out=l,n.next_in=s,n.avail_in=o,e.hold=c,e.bits=u,id;n.adler=e.check=1,e.mode=Ge;case Ge:if(t===ed||t===mr)break t;case zs:if(e.last){c>>>=u&7,u-=u&7,e.mode=Gs;break}for(;u<3;){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}switch(e.last=c&1,c>>>=1,u-=1,c&3){case 0:e.mode=wl;break;case 1:if(hd(e),e.mode=yr,t===mr){c>>>=2,u-=2;break t}break;case 2:e.mode=bl;break;case 3:n.msg="invalid block type",e.mode=Bt}c>>>=2,u-=2;break;case wl:for(c>>>=u&7,u-=u&7;u<32;){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){n.msg="invalid stored block lengths",e.mode=Bt;break}if(e.length=c&65535,c=0,u=0,e.mode=Bs,t===mr)break t;case Bs:e.mode=xl;case xl:if(d=e.length,d){if(d>o&&(d=o),d>l&&(d=l),d===0)break t;r.set(i.subarray(s,s+d),a),o-=d,s+=d,l-=d,a+=d,e.length-=d;break}e.mode=Ge;break;case bl:for(;u<14;){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}if(e.nlen=(c&31)+257,c>>>=5,u-=5,e.ndist=(c&31)+1,c>>>=5,u-=5,e.ncode=(c&15)+4,c>>>=4,u-=4,e.nlen>286||e.ndist>30){n.msg="too many length or distance symbols",e.mode=Bt;break}e.have=0,e.mode=Cl;case Cl:for(;e.have<e.ncode;){for(;u<3;){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}e.lens[J[e.have++]]=c&7,c>>>=3,u-=3}for(;e.have<19;)e.lens[J[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,$={bits:e.lenbits},G=Mi(td,e.lens,0,19,e.lencode,0,e.work,$),e.lenbits=$.bits,G){n.msg="invalid code lengths set",e.mode=Bt;break}e.have=0,e.mode=Tl;case Tl:for(;e.have<e.nlen+e.ndist;){for(;C=e.lencode[c&(1<<e.lenbits)-1],A=C>>>24,P=C>>>16&255,M=C&65535,!(A<=u);){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}if(M<16)c>>>=A,u-=A,e.lens[e.have++]=M;else{if(M===16){for(X=A+2;u<X;){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}if(c>>>=A,u-=A,e.have===0){n.msg="invalid bit length repeat",e.mode=Bt;break}F=e.lens[e.have-1],d=3+(c&3),c>>>=2,u-=2}else if(M===17){for(X=A+3;u<X;){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}c>>>=A,u-=A,F=0,d=3+(c&7),c>>>=3,u-=3}else{for(X=A+7;u<X;){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}c>>>=A,u-=A,F=0,d=11+(c&127),c>>>=7,u-=7}if(e.have+d>e.nlen+e.ndist){n.msg="invalid bit length repeat",e.mode=Bt;break}for(;d--;)e.lens[e.have++]=F}}if(e.mode===Bt)break;if(e.lens[256]===0){n.msg="invalid code -- missing end-of-block",e.mode=Bt;break}if(e.lenbits=9,$={bits:e.lenbits},G=Mi(sl,e.lens,0,e.nlen,e.lencode,0,e.work,$),e.lenbits=$.bits,G){n.msg="invalid literal/lengths set",e.mode=Bt;break}if(e.distbits=6,e.distcode=e.distdyn,$={bits:e.distbits},G=Mi(al,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,$),e.distbits=$.bits,G){n.msg="invalid distances set",e.mode=Bt;break}if(e.mode=yr,t===mr)break t;case yr:e.mode=wr;case wr:if(o>=6&&l>=258){n.next_out=a,n.avail_out=l,n.next_in=s,n.avail_in=o,e.hold=c,e.bits=u,Zu(n,p),a=n.next_out,r=n.output,l=n.avail_out,s=n.next_in,i=n.input,o=n.avail_in,c=e.hold,u=e.bits,e.mode===Ge&&(e.back=-1);break}for(e.back=0;C=e.lencode[c&(1<<e.lenbits)-1],A=C>>>24,P=C>>>16&255,M=C&65535,!(A<=u);){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}if(P&&!(P&240)){for(D=A,U=P,z=M;C=e.lencode[z+((c&(1<<D+U)-1)>>D)],A=C>>>24,P=C>>>16&255,M=C&65535,!(D+A<=u);){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}c>>>=D,u-=D,e.back+=D}if(c>>>=A,u-=A,e.back+=A,e.length=M,P===0){e.mode=Pl;break}if(P&32){e.back=-1,e.mode=Ge;break}if(P&64){n.msg="invalid literal/length code",e.mode=Bt;break}e.extra=P&15,e.mode=Sl;case Sl:if(e.extra){for(X=e.extra;u<X;){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}e.length+=c&(1<<e.extra)-1,c>>>=e.extra,u-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=El;case El:for(;C=e.distcode[c&(1<<e.distbits)-1],A=C>>>24,P=C>>>16&255,M=C&65535,!(A<=u);){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}if(!(P&240)){for(D=A,U=P,z=M;C=e.distcode[z+((c&(1<<D+U)-1)>>D)],A=C>>>24,P=C>>>16&255,M=C&65535,!(D+A<=u);){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}c>>>=D,u-=D,e.back+=D}if(c>>>=A,u-=A,e.back+=A,P&64){n.msg="invalid distance code",e.mode=Bt;break}e.offset=M,e.extra=P&15,e.mode=kl;case kl:if(e.extra){for(X=e.extra;u<X;){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}e.offset+=c&(1<<e.extra)-1,c>>>=e.extra,u-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){n.msg="invalid distance too far back",e.mode=Bt;break}e.mode=Al;case Al:if(l===0)break t;if(d=p-l,e.offset>d){if(d=e.offset-d,d>e.whave&&e.sane){n.msg="invalid distance too far back",e.mode=Bt;break}d>e.wnext?(d-=e.wnext,w=e.wsize-d):w=e.wnext-d,d>e.length&&(d=e.length),x=e.window}else x=r,w=a-e.offset,d=e.length;d>l&&(d=l),l-=d,e.length-=d;do r[a++]=x[w++];while(--d);e.length===0&&(e.mode=wr);break;case Pl:if(l===0)break t;r[a++]=e.length,l--,e.mode=wr;break;case Gs:if(e.wrap){for(;u<32;){if(o===0)break t;o--,c|=i[s++]<<u,u+=8}if(p-=l,n.total_out+=p,e.total+=p,e.wrap&4&&p&&(n.adler=e.check=e.flags?Yt(e.check,r,p,a-p):bi(e.check,r,p,a-p)),p=l,e.wrap&4&&(e.flags?c:Rl(c))!==e.check){n.msg="incorrect data check",e.mode=Bt;break}c=0,u=0}e.mode=Il;case Il:if(e.wrap&&e.flags){for(;u<32;){if(o===0)break t;o--,c+=i[s++]<<u,u+=8}if(e.wrap&4&&c!==(e.total&4294967295)){n.msg="incorrect length check",e.mode=Bt;break}c=0,u=0}e.mode=Ml;case Ml:G=nd;break t;case Bt:G=ll;break t;case Ll:return cl;case Dl:default:return ve}return n.next_out=a,n.avail_out=l,n.next_in=s,n.avail_in=o,e.hold=c,e.bits=u,(e.wsize||p!==n.avail_out&&e.mode<Bt&&(e.mode<Gs||t!==ol))&&Bl(n,n.output,n.next_out,p-n.avail_out),g-=n.avail_in,p-=n.avail_out,n.total_in+=g,n.total_out+=p,e.total+=p,e.wrap&4&&p&&(n.adler=e.check=e.flags?Yt(e.check,r,p,n.next_out-p):bi(e.check,r,p,n.next_out-p)),n.data_type=e.bits+(e.last?64:0)+(e.mode===Ge?128:0)+(e.mode===yr||e.mode===Bs?256:0),(g===0&&p===0||t===ol)&&G===kn&&(G=rd),G},ud=n=>{if(An(n))return ve;let t=n.state;return t.window&&(t.window=null),n.state=null,kn},dd=(n,t)=>{if(An(n))return ve;const e=n.state;return e.wrap&2?(e.head=t,t.done=!1,kn):ve},pd=(n,t)=>{const e=t.length;let i,r,s;return An(n)||(i=n.state,i.wrap!==0&&i.mode!==_r)?ve:i.mode===_r&&(r=1,r=bi(r,t,e,0),r!==i.check)?ll:(s=Bl(n,t,e,e),s?(i.mode=Ll,cl):(i.havedict=1,kn))};var gd=Fl,md=Ul,vd=Ol,_d=cd,yd=Nl,wd=fd,xd=ud,bd=dd,Cd=pd,Td="pako inflate (from Nodeca project)",He={inflateReset:gd,inflateReset2:md,inflateResetKeep:vd,inflateInit:_d,inflateInit2:yd,inflate:wd,inflateEnd:xd,inflateGetHeader:bd,inflateSetDictionary:Cd,inflateInfo:Td};function Sd(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Ed=Sd;const Gl=Object.prototype.toString,{Z_NO_FLUSH:kd,Z_FINISH:Ad,Z_OK:Li,Z_STREAM_END:js,Z_NEED_DICT:Xs,Z_STREAM_ERROR:Pd,Z_DATA_ERROR:Hl,Z_MEM_ERROR:Id}=Cn;function Di(n){this.options=dr.assign({chunkSize:65536,windowBits:15,to:""},n||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(n&&n.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qo,this.strm.avail_out=0;let e=He.inflateInit2(this.strm,t.windowBits);if(e!==Li)throw new Error(bn[e]);if(this.header=new Ed,He.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Pi.string2buf(t.dictionary):Gl.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=He.inflateSetDictionary(this.strm,t.dictionary),e!==Li)))throw new Error(bn[e])}Di.prototype.push=function(n,t){const e=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let s,a,o;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?Ad:kd,Gl.call(n)==="[object ArrayBuffer]"?e.input=new Uint8Array(n):e.input=n,e.next_in=0,e.avail_in=e.input.length;;){for(e.avail_out===0&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),s=He.inflate(e,a),s===Xs&&r&&(s=He.inflateSetDictionary(e,r),s===Li?s=He.inflate(e,a):s===Hl&&(s=Xs));e.avail_in>0&&s===js&&e.state.wrap>0&&n[e.next_in]!==0;)He.inflateReset(e),s=He.inflate(e,a);switch(s){case Pd:case Hl:case Xs:case Id:return this.onEnd(s),this.ended=!0,!1}if(o=e.avail_out,e.next_out&&(e.avail_out===0||s===js))if(this.options.to==="string"){let l=Pi.utf8border(e.output,e.next_out),c=e.next_out-l,u=Pi.buf2string(e.output,l);e.next_out=c,e.avail_out=i-c,c&&e.output.set(e.output.subarray(l,l+c),0),this.onData(u)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(!(s===Li&&o===0)){if(s===js)return s=He.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(e.avail_in===0)break}}return!0},Di.prototype.onData=function(n){this.chunks.push(n)},Di.prototype.onEnd=function(n){n===Li&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=dr.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function Ys(n,t){const e=new Di(t);if(e.push(n),e.err)throw e.msg||bn[e.err];return e.result}function Md(n,t){return t=t||{},t.raw=!0,Ys(n,t)}var Ld=Di,Dd=Ys,Rd=Md,Od=Ys,Fd=Cn,Ud={Inflate:Ld,inflate:Dd,inflateRaw:Rd,ungzip:Od,constants:Fd};const{Deflate:Nd,deflate:zd,deflateRaw:Bd,gzip:Gd}=$u,{Inflate:Hd,inflate:Vd,inflateRaw:jd,ungzip:Xd}=Ud;var Yd=Nd,$d=zd,qd=Bd,Zd=Gd,Wd=Hd,Jd=Vd,Kd=jd,Qd=Xd,t0=Cn,e0={Deflate:Yd,deflate:$d,deflateRaw:qd,gzip:Zd,Inflate:Wd,inflate:Jd,inflateRaw:Kd,ungzip:Qd,constants:t0};const ct={};ct.toRGBA8=function(n){const t=n.width,e=n.height;if(n.tabs.acTL===null)return[ct.toRGBA8.decodeImage(n.data,t,e,n).buffer];const i=[];n.frames[0].data===null&&(n.frames[0].data=n.data);const r=t*e*4,s=new Uint8Array(r),a=new Uint8Array(r),o=new Uint8Array(r);for(let l=0;l<n.frames.length;l++){const c=n.frames[l],u=c.rect.x,g=c.rect.y,p=c.rect.width,d=c.rect.height,w=ct.toRGBA8.decodeImage(c.data,p,d,n);if(l!==0)for(let x=0;x<r;x++)o[x]=s[x];if(c.blend===0?ct._copyTile(w,p,d,s,t,e,u,g,0):c.blend===1&&ct._copyTile(w,p,d,s,t,e,u,g,1),i.push(s.buffer.slice(0)),c.dispose===1)ct._copyTile(a,p,d,s,t,e,u,g,0);else if(c.dispose===2)for(let x=0;x<r;x++)s[x]=o[x]}return i},ct.toRGBA8.decodeImage=function(n,t,e,i){const r=t*e,s=ct.decode._getBPP(i),a=Math.ceil(t*s/8),o=new Uint8Array(r*4),l=new Uint32Array(o.buffer),c=i.ctype,u=i.depth,g=ct._bin.readUshort;if(c===6){const p=r<<2;if(u===8)for(let d=0;d<p;d+=4)o[d]=n[d],o[d+1]=n[d+1],o[d+2]=n[d+2],o[d+3]=n[d+3];if(u===16)for(let d=0;d<p;d++)o[d]=n[d<<1]}else if(c===2){const p=i.tabs.tRNS;if(p===null){if(u===8)for(let d=0;d<r;d++){const w=d*3;l[d]=-16777216|n[w+2]<<16|n[w+1]<<8|n[w]}if(u===16)for(let d=0;d<r;d++){const w=d*6;l[d]=-16777216|n[w+4]<<16|n[w+2]<<8|n[w]}}else{const d=p[0],w=p[1],x=p[2];if(u===8)for(let C=0;C<r;C++){const A=C<<2,P=C*3;l[C]=-16777216|n[P+2]<<16|n[P+1]<<8|n[P],n[P]===d&&n[P+1]===w&&n[P+2]===x&&(o[A+3]=0)}if(u===16)for(let C=0;C<r;C++){const A=C<<2,P=C*6;l[C]=-16777216|n[P+4]<<16|n[P+2]<<8|n[P],g(n,P)===d&&g(n,P+2)===w&&g(n,P+4)===x&&(o[A+3]=0)}}}else if(c===3){const p=i.tabs.PLTE,d=i.tabs.tRNS,w=d?d.length:0;if(u===1)for(let x=0;x<e;x++){const C=x*a,A=x*t;for(let P=0;P<t;P++){const M=A+P<<2,D=n[C+(P>>3)]>>7-((P&7)<<0)&1,U=3*D;o[M]=p[U],o[M+1]=p[U+1],o[M+2]=p[U+2],o[M+3]=D<w?d[D]:255}}if(u===2)for(let x=0;x<e;x++){const C=x*a,A=x*t;for(let P=0;P<t;P++){const M=A+P<<2,D=n[C+(P>>2)]>>6-((P&3)<<1)&3,U=3*D;o[M]=p[U],o[M+1]=p[U+1],o[M+2]=p[U+2],o[M+3]=D<w?d[D]:255}}if(u===4)for(let x=0;x<e;x++){const C=x*a,A=x*t;for(let P=0;P<t;P++){const M=A+P<<2,D=n[C+(P>>1)]>>4-((P&1)<<2)&15,U=3*D;o[M]=p[U],o[M+1]=p[U+1],o[M+2]=p[U+2],o[M+3]=D<w?d[D]:255}}if(u===8)for(let x=0;x<r;x++){const C=x<<2,A=n[x],P=3*A;o[C]=p[P],o[C+1]=p[P+1],o[C+2]=p[P+2],o[C+3]=A<w?d[A]:255}}else if(c===4){if(u===8)for(let p=0;p<r;p++){const d=p<<2,w=p<<1,x=n[w];o[d]=x,o[d+1]=x,o[d+2]=x,o[d+3]=n[w+1]}if(u===16)for(let p=0;p<r;p++){const d=p<<2,w=p<<2,x=n[w];o[d]=x,o[d+1]=x,o[d+2]=x,o[d+3]=n[w+2]}}else if(c===0){const p=i.tabs.tRNS?i.tabs.tRNS:-1;for(let d=0;d<e;d++){const w=d*a,x=d*t;if(u===1)for(let C=0;C<t;C++){const A=255*(n[w+(C>>>3)]>>>7-(C&7)&1),P=A===p*255?0:255;l[x+C]=P<<24|A<<16|A<<8|A}else if(u===2)for(let C=0;C<t;C++){const A=85*(n[w+(C>>>2)]>>>6-((C&3)<<1)&3),P=A===p*85?0:255;l[x+C]=P<<24|A<<16|A<<8|A}else if(u===4)for(let C=0;C<t;C++){const A=17*(n[w+(C>>>1)]>>>4-((C&1)<<2)&15),P=A===p*17?0:255;l[x+C]=P<<24|A<<16|A<<8|A}else if(u===8)for(let C=0;C<t;C++){const A=n[w+C],P=A===p?0:255;l[x+C]=P<<24|A<<16|A<<8|A}else if(u===16)for(let C=0;C<t;C++){const A=n[w+(C<<1)],P=g(n,w+(C<<1))===p?0:255;l[x+C]=P<<24|A<<16|A<<8|A}}}return o},ct.decode=function(n){const t=new Uint8Array(n);let e=8;const i=ct._bin,r=i.readUshort,s=i.readUint,a={tabs:{},frames:[]},o=new Uint8Array(t.length);let l=0,c,u=0;const g=[137,80,78,71,13,10,26,10];for(let p=0;p<8;p++)if(t[p]!==g[p])throw"The input is not a PNG file!";for(;e<t.length;){const p=i.readUint(t,e);e+=4;const d=i.readASCII(t,e,4);if(e+=4,d==="IHDR")ct.decode._IHDR(t,e,a);else if(d==="CgBI")a.tabs[d]=t.slice(e,e+4);else if(d==="IDAT"){for(let w=0;w<p;w++)o[l+w]=t[e+w];l+=p}else if(d==="acTL")a.tabs[d]={num_frames:s(t,e),num_plays:s(t,e+4)},c=new Uint8Array(t.length);else if(d==="fcTL"){if(u!==0){const A=a.frames[a.frames.length-1];A.data=ct.decode._decompress(a,c.slice(0,u),A.rect.width,A.rect.height),u=0}const w={x:s(t,e+12),y:s(t,e+16),width:s(t,e+4),height:s(t,e+8)};let x=r(t,e+22);x=r(t,e+20)/(x===0?100:x);const C={rect:w,delay:Math.round(x*1e3),dispose:t[e+24],blend:t[e+25]};a.frames.push(C)}else if(d==="fdAT"){for(let w=0;w<p-4;w++)c[u+w]=t[e+w+4];u+=p-4}else if(d==="pHYs")a.tabs[d]=[i.readUint(t,e),i.readUint(t,e+4),t[e+8]];else if(d==="cHRM"){a.tabs[d]=[];for(let w=0;w<8;w++)a.tabs[d].push(i.readUint(t,e+w*4))}else if(d==="tEXt"||d==="zTXt"){a.tabs[d]===null&&(a.tabs[d]={});const w=i.nextZero(t,e),x=i.readASCII(t,e,w-e);let C;const A=e+p-w-1;if(d==="tEXt")C=i.readASCII(t,w+1,A);else{const P=ct.decode._inflate(t.slice(w+2,w+2+A));C=i.readUTF8(P,0,P.length)}a.tabs[d][x]=C}else if(d==="iTXt"){a.tabs[d]==null&&(a.tabs[d]={});let w=0,x=e;w=i.nextZero(t,x);const C=i.readASCII(t,x,w-x);x=w+1;const A=t[x];x+=2,w=i.nextZero(t,x),x=w+1,w=i.nextZero(t,x),x=w+1;let P;const M=p-(x-e);if(A===0)P=i.readUTF8(t,x,M);else{const D=ct.decode._inflate(t.slice(x,x+M));P=i.readUTF8(D,0,D.length)}a.tabs[d][C]=P}else if(d==="PLTE")a.tabs[d]=i.readBytes(t,e,p);else if(d==="hIST"){const w=a.tabs.PLTE.length/3;a.tabs[d]=[];for(let x=0;x<w;x++)a.tabs[d].push(r(t,e+x*2))}else if(d==="tRNS")a.ctype===3?a.tabs[d]=i.readBytes(t,e,p):a.ctype===0?a.tabs[d]=r(t,e):a.ctype===2&&(a.tabs[d]=[r(t,e),r(t,e+2),r(t,e+4)]);else if(d==="gAMA")a.tabs[d]=i.readUint(t,e)/1e5;else if(d==="sRGB")a.tabs[d]=t[e];else if(d==="bKGD")a.ctype===0||a.ctype===4?a.tabs[d]=[r(t,e)]:a.ctype===2||a.ctype===6?a.tabs[d]=[r(t,e),r(t,e+2),r(t,e+4)]:a.ctype===3&&(a.tabs[d]=t[e]);else if(d==="IEND")break;e+=p,e+=4}if(u!==0){const p=a.frames[a.frames.length-1];p.data=ct.decode._decompress(a,c.slice(0,u),p.rect.width,p.rect.height),u=0}return a.data=ct.decode._decompress(a,o,a.width,a.height),delete a.compress,delete a.interlace,delete a.filter,a},ct.decode._decompress=function(n,t,e,i){const r=ct.decode._getBPP(n),s=Math.ceil(e*r/8),a=new Uint8Array((s+1+n.interlace)*i);return n.tabs.CgBI?t=ct.inflateRaw(t,a):t=ct.decode._inflate(t,a),n.interlace===0?t=ct.decode._filterZero(t,n,0,e,i):n.interlace===1&&(t=ct.decode._readInterlace(t,n)),t},ct.decode._inflate=function(n,t){return ct.inflateRaw(new Uint8Array(n.buffer,2,n.length-6),t)},ct.inflateRaw=function(){const n={};return n.H={},n.H.N=function(t,e){const i=Uint8Array;let r=0,s=0,a=0,o=0,l=0,c=0,u=0,g=0,p=0,d,w;if(t[0]===3&&t[1]===0)return e||new i(0);const x=n.H,C=x.b,A=x.e,P=x.R,M=x.n,D=x.A,U=x.Z,z=x.m,F=e===null;for(F&&(e=new i(t.length>>>2<<3));r===0;){if(r=C(t,p,1),s=C(t,p+1,2),p+=3,s===0){p&7&&(p+=8-(p&7));const G=(p>>>3)+4,H=t[G-4]|t[G-3]<<8;F&&(e=n.H.W(e,g+H)),e.set(new i(t.buffer,t.byteOffset+G,H),g),p=G+H<<3,g+=H;continue}if(F&&(e=n.H.W(e,g+131072)),s===1&&(d=z.J,w=z.h,c=511,u=31),s===2){a=A(t,p,5)+257,o=A(t,p+5,5)+1,l=A(t,p+10,4)+4,p+=14;let G=1;for(let X=0;X<38;X+=2)z.Q[X]=0,z.Q[X+1]=0;for(let X=0;X<l;X++){const J=A(t,p+X*3,3);z.Q[(z.X[X]<<1)+1]=J,J>G&&(G=J)}p+=3*l,M(z.Q,G),D(z.Q,G,z.u),d=z.w,w=z.d,p=P(z.u,(1<<G)-1,a+o,t,p,z.v);const H=x.V(z.v,0,a,z.C);c=(1<<H)-1;const $=x.V(z.v,a,o,z.D);u=(1<<$)-1,M(z.C,H),D(z.C,H,d),M(z.D,$),D(z.D,$,w)}for(;;){const G=d[U(t,p)&c];p+=G&15;const H=G>>>4;if(!(H>>>8))e[g++]=H;else{if(H===256)break;{let $=g+H-254;if(H>264){const gt=z.q[H-257];$=g+(gt>>>3)+A(t,p,gt&7),p+=gt&7}const X=w[U(t,p)&u];p+=X&15;const J=X>>>4,dt=z.c[J],ft=(dt>>>4)+C(t,p,dt&15);for(p+=dt&15;g<$;)e[g]=e[g++-ft],e[g]=e[g++-ft],e[g]=e[g++-ft],e[g]=e[g++-ft];g=$}}}}return e.length===g?e:e.slice(0,g)},n.H.W=function(t,e){const i=t.length;if(e<=i)return t;const r=new Uint8Array(i<<1);return r.set(t,0),r},n.H.R=function(t,e,i,r,s,a){const o=n.H.e,l=n.H.Z;let c=0;for(;c<i;){const u=t[l(r,s)&e];s+=u&15;const g=u>>>4;if(g<=15)a[c]=g,c++;else{let p=0,d=0;g===16?(d=3+o(r,s,2),s+=2,p=a[c-1]):g===17?(d=3+o(r,s,3),s+=3):g===18&&(d=11+o(r,s,7),s+=7);const w=c+d;for(;c<w;)a[c]=p,c++}}return s},n.H.V=function(t,e,i,r){let s=0,a=0;const o=r.length>>>1;for(;a<i;){const l=t[a+e];r[a<<1]=0,r[(a<<1)+1]=l,l>s&&(s=l),a++}for(;a<o;)r[a<<1]=0,r[(a<<1)+1]=0,a++;return s},n.H.n=function(t,e){const i=n.H.m,r=t.length;let s,a,o,l,c;const u=i.j;for(let p=0;p<=e;p++)u[p]=0;for(l=1;l<r;l+=2)u[t[l]]++;const g=i.K;for(s=0,u[0]=0,a=1;a<=e;a++)s=s+u[a-1]<<1,g[a]=s;for(o=0;o<r;o+=2)c=t[o+1],c!==0&&(t[o]=g[c],g[c]++)},n.H.A=function(t,e,i){const r=t.length,a=n.H.m.r;for(let o=0;o<r;o+=2)if(t[o+1]!==0){const l=o>>1,c=t[o+1],u=l<<4|c,g=e-c;let p=t[o]<<g;const d=p+(1<<g);for(;p!==d;){const w=a[p]>>>15-e;i[w]=u,p++}}},n.H.l=function(t,e){const i=n.H.m.r,r=15-e;for(let s=0;s<t.length;s+=2){const a=t[s]<<e-t[s+1];t[s]=i[a]>>>r}},n.H.M=function(t,e,i){i=i<<(e&7);const r=e>>>3;t[r]|=i,t[r+1]|=i>>>8},n.H.I=function(t,e,i){i=i<<(e&7);const r=e>>>3;t[r]|=i,t[r+1]|=i>>>8,t[r+2]|=i>>>16},n.H.e=function(t,e,i){return(t[e>>>3]|t[(e>>>3)+1]<<8)>>>(e&7)&(1<<i)-1},n.H.b=function(t,e,i){return(t[e>>>3]|t[(e>>>3)+1]<<8|t[(e>>>3)+2]<<16)>>>(e&7)&(1<<i)-1},n.H.Z=function(t,e){return(t[e>>>3]|t[(e>>>3)+1]<<8|t[(e>>>3)+2]<<16)>>>(e&7)},n.H.i=function(t,e){return(t[e>>>3]|t[(e>>>3)+1]<<8|t[(e>>>3)+2]<<16|t[(e>>>3)+3]<<24)>>>(e&7)},n.H.m=function(){const t=Uint16Array,e=Uint32Array;return{K:new t(16),j:new t(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new t(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new e(32),J:new t(512),_:[],h:new t(32),$:[],w:new t(32768),C:[],v:[],d:new t(32768),D:[],u:new t(512),Q:[],r:new t(32768),s:new e(286),Y:new e(30),a:new e(19),t:new e(15e3),k:new t(65536),g:new t(32768)}}(),function(){const t=n.H.m,e=32768;for(let r=0;r<e;r++){let s=r;s=(s&2863311530)>>>1|(s&1431655765)<<1,s=(s&3435973836)>>>2|(s&858993459)<<2,s=(s&4042322160)>>>4|(s&252645135)<<4,s=(s&4278255360)>>>8|(s&16711935)<<8,t.r[r]=(s>>>16|s<<16)>>>17}function i(r,s,a){for(;s--!==0;)r.push(0,a)}for(let r=0;r<32;r++)t.q[r]=t.S[r]<<3|t.T[r],t.c[r]=t.p[r]<<4|t.z[r];i(t._,144,8),i(t._,112,9),i(t._,24,7),i(t._,8,8),n.H.n(t._,9),n.H.A(t._,9,t.J),n.H.l(t._,9),i(t.$,32,5),n.H.n(t.$,5),n.H.A(t.$,5,t.h),n.H.l(t.$,5),i(t.Q,19,0),i(t.C,286,0),i(t.D,30,0),i(t.v,320,0)}(),n.H.N}(),ct.decode._readInterlace=function(n,t){const e=t.width,i=t.height,r=ct.decode._getBPP(t),s=r>>3,a=Math.ceil(e*r/8),o=new Uint8Array(i*a);let l=0;const c=[0,0,4,0,2,0,1],u=[0,4,0,2,0,1,0],g=[8,8,8,4,4,2,2],p=[8,8,4,4,2,2,1];let d=0;for(;d<7;){const w=g[d],x=p[d];let C=0,A=0,P=c[d];for(;P<i;)P+=w,A++;let M=u[d];for(;M<e;)M+=x,C++;const D=Math.ceil(C*r/8);ct.decode._filterZero(n,t,l,C,A);let U=0,z=c[d];for(;z<i;){let F=u[d],G=l+U*D<<3;for(;F<e;){if(r===1){let H=n[G>>3];H=H>>7-(G&7)&1,o[z*a+(F>>3)]|=H<<7-((F&7)<<0)}if(r===2){let H=n[G>>3];H=H>>6-(G&7)&3,o[z*a+(F>>2)]|=H<<6-((F&3)<<1)}if(r===4){let H=n[G>>3];H=H>>4-(G&7)&15,o[z*a+(F>>1)]|=H<<4-((F&1)<<2)}if(r>=8){const H=z*a+F*s;for(let $=0;$<s;$++)o[H+$]=n[(G>>3)+$]}G+=r,F+=x}U++,z+=w}C*A!==0&&(l+=A*(1+D)),d=d+1}return o},ct.decode._getBPP=function(n){return[1,null,3,1,2,null,4][n.ctype]*n.depth},ct.decode._filterZero=function(n,t,e,i,r){let s=ct.decode._getBPP(t);const a=Math.ceil(i*s/8),o=ct.decode._paeth;s=Math.ceil(s/8);let l=0,c=1,u=n[e],g=0;if(u>1&&(n[e]=[0,0,1][u-2]),u===3)for(g=s;g<a;g++)n[g+1]=n[g+1]+(n[g+1-s]>>>1)&255;for(let p=0;p<r;p++)if(l=e+p*a,c=l+p+1,u=n[c-1],g=0,u===0)for(;g<a;g++)n[l+g]=n[c+g];else if(u===1){for(;g<s;g++)n[l+g]=n[c+g];for(;g<a;g++)n[l+g]=n[c+g]+n[l+g-s]}else if(u===2)for(;g<a;g++)n[l+g]=n[c+g]+n[l+g-a];else if(u===3){for(;g<s;g++)n[l+g]=n[c+g]+(n[l+g-a]>>>1);for(;g<a;g++)n[l+g]=n[c+g]+(n[l+g-a]+n[l+g-s]>>>1)}else{for(;g<s;g++)n[l+g]=n[c+g]+o(0,n[l+g-a],0);for(;g<a;g++)n[l+g]=n[c+g]+o(n[l+g-s],n[l+g-a],n[l+g-s-a])}return n},ct.decode._paeth=function(n,t,e){const i=n+t-e,r=i-n,s=i-t,a=i-e;return r*r<=s*s&&r*r<=a*a?n:s*s<=a*a?t:e},ct.decode._IHDR=function(n,t,e){const i=ct._bin;e.width=i.readUint(n,t),t+=4,e.height=i.readUint(n,t),t+=4,e.depth=n[t],t++,e.ctype=n[t],t++,e.compress=n[t],t++,e.filter=n[t],t++,e.interlace=n[t],t++},ct._bin={nextZero:function(n,t){for(;n[t]!==0;)t++;return t},readUshort:function(n,t){return n[t]<<8|n[t+1]},writeUshort:function(n,t,e){n[t]=e>>8&255,n[t+1]=e&255},readUint:function(n,t){return n[t]*16777216+(n[t+1]<<16|n[t+2]<<8|n[t+3])},writeUint:function(n,t,e){n[t]=e>>24&255,n[t+1]=e>>16&255,n[t+2]=e>>8&255,n[t+3]=e&255},readASCII:function(n,t,e){let i="";for(let r=0;r<e;r++)i+=String.fromCharCode(n[t+r]);return i},writeASCII:function(n,t,e){for(let i=0;i<e.length;i++)n[t+i]=e.charCodeAt(i)},readBytes:function(n,t,e){const i=[];for(let r=0;r<e;r++)i.push(n[t+r]);return i},pad:function(n){return n.length<2?"0"+n:n},readUTF8:function(n,t,e){let i="",r;for(let s=0;s<e;s++)i+="%"+ct._bin.pad(n[t+s].toString(16));try{r=decodeURIComponent(i)}catch{return ct._bin.readASCII(n,t,e)}return r}},ct._copyTile=function(n,t,e,i,r,s,a,o,l){const c=Math.min(t,r),u=Math.min(e,s);let g=0,p=0;for(let d=0;d<u;d++)for(let w=0;w<c;w++)if(a>=0&&o>=0?(g=d*t+w<<2,p=(o+d)*r+a+w<<2):(g=(-o+d)*t-a+w<<2,p=d*r+w<<2),l===0)i[p]=n[g],i[p+1]=n[g+1],i[p+2]=n[g+2],i[p+3]=n[g+3];else if(l===1){const x=n[g+3]*.00392156862745098,C=n[g]*x,A=n[g+1]*x,P=n[g+2]*x,M=i[p+3]*(1/255),D=i[p]*M,U=i[p+1]*M,z=i[p+2]*M,F=1-x,G=x+M*F,H=G===0?0:1/G;i[p+3]=255*G,i[p+0]=(C+D*F)*H,i[p+1]=(A+U*F)*H,i[p+2]=(P+z*F)*H}else if(l===2){const x=n[g+3],C=n[g],A=n[g+1],P=n[g+2],M=i[p+3],D=i[p],U=i[p+1],z=i[p+2];x===M&&C===D&&A===U&&P===z?(i[p]=0,i[p+1]=0,i[p+2]=0,i[p+3]=0):(i[p]=C,i[p+1]=A,i[p+2]=P,i[p+3]=x)}else if(l===3){const x=n[g+3],C=n[g],A=n[g+1],P=n[g+2],M=i[p+3],D=i[p],U=i[p+1],z=i[p+2];if(x===M&&C===D&&A===U&&P===z)continue;if(x<220&&M>20)return!1}return!0},ct.encode=function(n,t,e,i,r,s,a){i===null&&(i=0),a===null&&(a=!1);const o=ct.encode.compress(n,t,e,i,[!1,!1,!1,0,a]);return ct.encode.compressPNG(o,-1),ct.encode._main(o,t,e,r,s)},ct.encodeLL=function(n,t,e,i,r,s,a,o){const l={ctype:0+(i===1?0:2)+(r===0?0:4),depth:s,frames:[]},c=(i+r)*s,u=c*t;for(let p=0;p<n.length;p++)l.frames.push({rect:{x:0,y:0,width:t,height:e},img:new Uint8Array(n[p]),blend:0,dispose:1,bpp:Math.ceil(c/8),bpl:Math.ceil(u/8)});return ct.encode.compressPNG(l,0,!0),ct.encode._main(l,t,e,a,o)},ct.encode._main=function(n,t,e,i,r){r||(r={});const s=ct.crc.crc,a=ct._bin.writeUint,o=ct._bin.writeUshort,l=ct._bin.writeASCII;let c=8;const u=n.frames.length>1;let g=!1,p=8+(16+5+4)+(u?20:0);if(r.sRGB!==null&&r.sRGB!==void 0&&(p+=13),r.pHYs!==null&&r.pHYs!==void 0&&(p+=21),n.ctype===3){const C=n.plte.length;for(let A=0;A<C;A++)n.plte[A]>>>24!==255&&(g=!0);p+=8+C*3+4+(g?8+C*1+4:0)}for(let C=0;C<n.frames.length;C++){const A=n.frames[C];u&&(p+=38),p+=A.cimg.length+12,C!==0&&(p+=4)}p+=12;const d=new Uint8Array(p),w=[137,80,78,71,13,10,26,10];for(let C=0;C<8;C++)d[C]=w[C];if(a(d,c,13),c+=4,l(d,c,"IHDR"),c+=4,a(d,c,t),c+=4,a(d,c,e),c+=4,d[c]=n.depth,c++,d[c]=n.ctype,c++,d[c]=0,c++,d[c]=0,c++,d[c]=0,c++,a(d,c,s(d,c-17,17)),c+=4,r.sRGB!==null&&r.sRGB!==void 0&&(a(d,c,1),c+=4,l(d,c,"sRGB"),c+=4,d[c]=r.sRGB,c++,a(d,c,s(d,c-5,5)),c+=4),r.pHYs!==null&&r.pHYs!==void 0&&(a(d,c,9),c+=4,l(d,c,"pHYs"),c+=4,a(d,c,r.pHYs[0]),c+=4,a(d,c,r.pHYs[1]),c+=4,d[c]=r.pHYs[2],c++,a(d,c,s(d,c-13,13)),c+=4),u&&(a(d,c,8),c+=4,l(d,c,"acTL"),c+=4,a(d,c,n.frames.length),c+=4,a(d,c,r.loop!=null?r.loop:0),c+=4,a(d,c,s(d,c-12,12)),c+=4),n.ctype===3){const C=n.plte.length;a(d,c,C*3),c+=4,l(d,c,"PLTE"),c+=4;for(let A=0;A<C;A++){const P=A*3,M=n.plte[A],D=M&255,U=M>>>8&255,z=M>>>16&255;d[c+P+0]=D,d[c+P+1]=U,d[c+P+2]=z}if(c+=C*3,a(d,c,s(d,c-C*3-4,C*3+4)),c+=4,g){a(d,c,C),c+=4,l(d,c,"tRNS"),c+=4;for(let A=0;A<C;A++)d[c+A]=n.plte[A]>>>24&255;c+=C,a(d,c,s(d,c-C-4,C+4)),c+=4}}let x=0;for(let C=0;C<n.frames.length;C++){const A=n.frames[C];u&&(a(d,c,26),c+=4,l(d,c,"fcTL"),c+=4,a(d,c,x++),c+=4,a(d,c,A.rect.width),c+=4,a(d,c,A.rect.height),c+=4,a(d,c,A.rect.x),c+=4,a(d,c,A.rect.y),c+=4,o(d,c,i[C]),c+=2,o(d,c,1e3),c+=2,d[c]=A.dispose,c++,d[c]=A.blend,c++,a(d,c,s(d,c-30,30)),c+=4);const P=A.cimg,M=P.length;a(d,c,M+(C===0?0:4)),c+=4;const D=c;l(d,c,C===0?"IDAT":"fdAT"),c+=4,C!==0&&(a(d,c,x++),c+=4),d.set(P,c),c+=M,a(d,c,s(d,D,c-D)),c+=4}return a(d,c,0),c+=4,l(d,c,"IEND"),c+=4,a(d,c,s(d,c-4,4)),c+=4,d.buffer},ct.encode.compressPNG=function(n,t,e){for(let i=0;i<n.frames.length;i++){const r=n.frames[i],s=r.rect.height,a=new Uint8Array(s*r.bpl+s);r.cimg=ct.encode._filterZero(r.img,s,r.bpp,r.bpl,a,t,e)}},ct.encode.compress=function(n,t,e,i,r){const s=r[0],a=r[1],o=r[2],l=r[3],c=r[4];let u=6,g=8,p=255;for(let M=0;M<n.length;M++){const D=new Uint8Array(n[M]),U=D.length;for(let z=0;z<U;z+=4)p&=D[z+3]}const d=p!==255,w=ct.encode.framize(n,t,e,s,a,o),x={},C=[],A=[];if(i!==0){const M=[];for(let G=0;G<w.length;G++)M.push(w[G].img.buffer);const D=ct.encode.concatRGBA(M),U=ct.quantize(D,i);let z=0;const F=new Uint8Array(U.abuf);for(let G=0;G<w.length;G++){const H=w[G].img,$=H.length;A.push(new Uint8Array(U.inds.buffer,z>>2,$>>2));for(let X=0;X<$;X+=4)H[X]=F[z+X],H[X+1]=F[z+X+1],H[X+2]=F[z+X+2],H[X+3]=F[z+X+3];z+=$}for(let G=0;G<U.plte.length;G++)C.push(U.plte[G].est.rgba)}else for(let M=0;M<w.length;M++){const D=w[M],U=new Uint32Array(D.img.buffer),z=D.rect.width,F=U.length,G=new Uint8Array(F);A.push(G);for(let H=0;H<F;H++){const $=U[H];if(H!==0&&$===U[H-1])G[H]=G[H-1];else if(H>z&&$===U[H-z])G[H]=G[H-z];else{let X=x[$];if(X===null&&(x[$]=X=C.length,C.push($),C.length>=300))break;G[H]=X}}}const P=C.length;P<=256&&c===!1&&(P<=2?g=1:P<=4?g=2:P<=16?g=4:g=8,g=Math.max(g,l));for(let M=0;M<w.length;M++){const D=w[M],U=D.rect.width,z=D.rect.height;let F=D.img,G=4*U,H=4;if(P<=256&&c===!1){G=Math.ceil(g*U/8);const $=new Uint8Array(G*z),X=A[M];for(let J=0;J<z;J++){const dt=J*G,ft=J*U;if(g===8)for(let gt=0;gt<U;gt++)$[dt+gt]=X[ft+gt];else if(g===4)for(let gt=0;gt<U;gt++)$[dt+(gt>>1)]|=X[ft+gt]<<4-(gt&1)*4;else if(g===2)for(let gt=0;gt<U;gt++)$[dt+(gt>>2)]|=X[ft+gt]<<6-(gt&3)*2;else if(g===1)for(let gt=0;gt<U;gt++)$[dt+(gt>>3)]|=X[ft+gt]<<7-(gt&7)*1}F=$,u=3,H=1}else if(d===!1&&w.length===1){const $=new Uint8Array(U*z*3),X=U*z;for(let J=0;J<X;J++){const dt=J*3,ft=J*4;$[dt]=F[ft],$[dt+1]=F[ft+1],$[dt+2]=F[ft+2]}F=$,u=2,H=3,G=3*U}D.img=F,D.bpl=G,D.bpp=H}return{ctype:u,depth:g,plte:C,frames:w}},ct.encode.framize=function(n,t,e,i,r,s){const a=[];for(let o=0;o<n.length;o++){const l=new Uint8Array(n[o]),c=new Uint32Array(l.buffer);let u,g=0,p=0,d=t,w=e,x=i?1:0;if(o!==0){const C=s||i||o===1||a[o-2].dispose!==0?1:2;let A=0,P=1e9;for(let D=0;D<C;D++){const U=new Uint32Array(n[o-1-D]);let z=t,F=e,G=-1,H=-1;for(let X=0;X<e;X++)for(let J=0;J<t;J++){const dt=X*t+J;c[dt]!==U[dt]&&(J<z&&(z=J),J>G&&(G=J),X<F&&(F=X),X>H&&(H=X))}G===-1&&(z=F=G=H=0),r&&((z&1)===1&&z--,(F&1)===1&&F--);const $=(G-z+1)*(H-F+1);$<P&&(P=$,A=D,g=z,p=F,d=G-z+1,w=H-F+1)}const M=new Uint8Array(n[o-1-A]);A===1&&(a[o-1].dispose=2),u=new Uint8Array(d*w*4),ct._copyTile(M,t,e,u,d,w,-g,-p,0),x=ct._copyTile(l,t,e,u,d,w,-g,-p,3)?1:0,x===1?ct.encode._prepareDiff(l,t,e,u,{x:g,y:p,width:d,height:w}):ct._copyTile(l,t,e,u,d,w,-g,-p,0)}else u=l.slice(0);a.push({rect:{x:g,y:p,width:d,height:w},img:u,blend:x,dispose:0})}if(i)for(let o=0;o<a.length;o++){const l=a[o];if(l.blend===1)continue;const c=l.rect,u=a[o-1].rect,g=Math.min(c.x,u.x),p=Math.min(c.y,u.y),d=Math.max(c.x+c.width,u.x+u.width),w=Math.max(c.y+c.height,u.y+u.height),x={x:g,y:p,width:d-g,height:w-p};a[o-1].dispose=1,o-1!==0&&ct.encode._updateFrame(n,t,e,a,o-1,x,r),ct.encode._updateFrame(n,t,e,a,o,x,r)}return a},ct.encode._updateFrame=function(n,t,e,i,r,s,a){const o=Uint8Array,l=Uint32Array,c=new o(n[r-1]),u=new l(n[r-1]),g=r+1<n.length?new o(n[r+1]):null,p=new o(n[r]),d=new l(p.buffer);let w=t,x=e,C=-1,A=-1;for(let M=0;M<s.height;M++)for(let D=0;D<s.width;D++){const U=s.x+D,z=s.y+M,F=z*t+U,G=d[F];G===0||i[r-1].dispose===0&&u[F]===G&&(g===null||g[F*4+3]!==0)||(U<w&&(w=U),U>C&&(C=U),z<x&&(x=z),z>A&&(A=z))}C===-1&&(w=x=C=A=0),a&&((w&1)===1&&w--,(x&1)===1&&x--),s={x:w,y:x,width:C-w+1,height:A-x+1};const P=i[r];P.rect=s,P.blend=1,P.img=new Uint8Array(s.width*s.height*4),i[r-1].dispose===0?(ct._copyTile(c,t,e,P.img,s.width,s.height,-s.x,-s.y,0),ct.encode._prepareDiff(p,t,e,P.img,s)):ct._copyTile(p,t,e,P.img,s.width,s.height,-s.x,-s.y,0)},ct.encode._prepareDiff=function(n,t,e,i,r){ct._copyTile(n,t,e,i,r.width,r.height,-r.x,-r.y,2)},ct.encode._filterZero=function(n,t,e,i,r,s,a){const o=[];let l=[0,1,2,3,4];s!==-1?l=[s]:(t*i>5e5||e===1)&&(l=[0]);let c;a&&(c={level:0});const u=r.length>1e7&&xo!=null?xo:e0;for(let d=0;d<l.length;d++){for(let w=0;w<t;w++)ct.encode._filterLine(r,n,w,i,e,l[d]);o.push(u.deflate(r,c))}let g,p=1e9;for(let d=0;d<o.length;d++)o[d].length<p&&(g=d,p=o[d].length);return o[g]},ct.encode._filterLine=function(n,t,e,i,r,s){const a=e*i;let o=a+e;const l=ct.decode._paeth;if(n[o]=s,o++,s===0)if(i<500)for(let c=0;c<i;c++)n[o+c]=t[a+c];else n.set(new Uint8Array(t.buffer,a,i),o);else if(s===1){for(let c=0;c<r;c++)n[o+c]=t[a+c];for(let c=r;c<i;c++)n[o+c]=t[a+c]-t[a+c-r]+256&255}else if(e===0){for(let c=0;c<r;c++)n[o+c]=t[a+c];if(s===2)for(let c=r;c<i;c++)n[o+c]=t[a+c];if(s===3)for(let c=r;c<i;c++)n[o+c]=t[a+c]-(t[a+c-r]>>1)+256&255;if(s===4)for(let c=r;c<i;c++)n[o+c]=t[a+c]-l(t[a+c-r],0,0)+256&255}else{if(s===2)for(let c=0;c<i;c++)n[o+c]=t[a+c]+256-t[a+c-i]&255;if(s===3){for(let c=0;c<r;c++)n[o+c]=t[a+c]+256-(t[a+c-i]>>1)&255;for(let c=r;c<i;c++)n[o+c]=t[a+c]+256-(t[a+c-i]+t[a+c-r]>>1)&255}if(s===4){for(let c=0;c<r;c++)n[o+c]=t[a+c]+256-l(0,t[a+c-i],0)&255;for(let c=r;c<i;c++)n[o+c]=t[a+c]+256-l(t[a+c-r],t[a+c-i],t[a+c-r-i])&255}}},ct.crc={table:function(){const n=new Uint32Array(256);for(let t=0;t<256;t++){let e=t;for(let i=0;i<8;i++)e&1?e=3988292384^e>>>1:e=e>>>1;n[t]=e}return n}(),update:function(n,t,e,i){for(let r=0;r<i;r++)n=ct.crc.table[(n^t[e+r])&255]^n>>>8;return n},crc:function(n,t,e){return ct.crc.update(4294967295,n,t,e)^4294967295}},ct.quantize=function(n,t){const e=new Uint8Array(n),i=e.slice(0),r=new Uint32Array(i.buffer),s=ct.quantize.getKDtree(i,t),a=s[0],o=s[1],l=ct.quantize.planeDst,c=e,u=r,g=c.length,p=new Uint8Array(e.length>>2);let d;if(e.length<2e7)for(let w=0;w<g;w+=4){const x=c[w]*.00392156862745098,C=c[w+1]*(1/255),A=c[w+2]*(1/255),P=c[w+3]*(1/255);d=ct.quantize.getNearest(a,x,C,A,P),p[w>>2]=d.ind,u[w>>2]=d.est.rgba}else for(let w=0;w<g;w+=4){const x=c[w]*.00392156862745098,C=c[w+1]*(1/255),A=c[w+2]*(1/255),P=c[w+3]*(1/255);for(d=a;d.left;)d=l(d.est,x,C,A,P)<=0?d.left:d.right;p[w>>2]=d.ind,u[w>>2]=d.est.rgba}return{abuf:i.buffer,inds:p,plte:o}},ct.quantize.getKDtree=function(n,t,e){e===null&&(e=1e-4);const i=new Uint32Array(n.buffer),r={i0:0,i1:n.length,bst:null,est:null,tdst:0,left:null,right:null};r.bst=ct.quantize.stats(n,r.i0,r.i1),r.est=ct.quantize.estats(r.bst);const s=[r];for(;s.length<t;){let a=0,o=0;for(let d=0;d<s.length;d++)s[d].est.L>a&&(a=s[d].est.L,o=d);if(a<e)break;const l=s[o],c=ct.quantize.splitPixels(n,i,l.i0,l.i1,l.est.e,l.est.eMq255);if(l.i0>=c||l.i1<=c){l.est.L=0;continue}const g={i0:l.i0,i1:c,bst:null,est:null,tdst:0,left:null,right:null};g.bst=ct.quantize.stats(n,g.i0,g.i1),g.est=ct.quantize.estats(g.bst);const p={i0:c,i1:l.i1,bst:null,est:null,tdst:0,left:null,right:null};p.bst={R:[],m:[],N:l.bst.N-g.bst.N};for(let d=0;d<16;d++)p.bst.R[d]=l.bst.R[d]-g.bst.R[d];for(let d=0;d<4;d++)p.bst.m[d]=l.bst.m[d]-g.bst.m[d];p.est=ct.quantize.estats(p.bst),l.left=g,l.right=p,s[o]=g,s.push(p)}s.sort(function(a,o){return o.bst.N-a.bst.N});for(let a=0;a<s.length;a++)s[a].ind=a;return[r,s]},ct.quantize.getNearest=function(n,t,e,i,r){if(n.left==null)return n.tdst=ct.quantize.dist(n.est.q,t,e,i,r),n;const s=ct.quantize.planeDst(n.est,t,e,i,r);let a=n.left,o=n.right;s>0&&(a=n.right,o=n.left);const l=ct.quantize.getNearest(a,t,e,i,r);if(l.tdst<=s*s)return l;const c=ct.quantize.getNearest(o,t,e,i,r);return c.tdst<l.tdst?c:l},ct.quantize.planeDst=function(n,t,e,i,r){const s=n.e;return s[0]*t+s[1]*e+s[2]*i+s[3]*r-n.eMq},ct.quantize.dist=function(n,t,e,i,r){const s=t-n[0],a=e-n[1],o=i-n[2],l=r-n[3];return s*s+a*a+o*o+l*l},ct.quantize.splitPixels=function(n,t,e,i,r,s){const a=ct.quantize.vecDot;for(i-=4;e<i;){for(;a(n,e,r)<=s;)e+=4;for(;a(n,i,r)>s;)i-=4;if(e>=i)break;const o=t[e>>2];t[e>>2]=t[i>>2],t[i>>2]=o,e+=4,i-=4}for(;a(n,e,r)>s;)e-=4;return e+4},ct.quantize.vecDot=function(n,t,e){return n[t]*e[0]+n[t+1]*e[1]+n[t+2]*e[2]+n[t+3]*e[3]},ct.quantize.stats=function(n,t,e){const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=[0,0,0,0],s=e-t>>2;for(let a=t;a<e;a+=4){const o=n[a]*.00392156862745098,l=n[a+1]*(1/255),c=n[a+2]*(1/255),u=n[a+3]*(1/255);r[0]+=o,r[1]+=l,r[2]+=c,r[3]+=u,i[0]+=o*o,i[1]+=o*l,i[2]+=o*c,i[3]+=o*u,i[5]+=l*l,i[6]+=l*c,i[7]+=l*u,i[10]+=c*c,i[11]+=c*u,i[15]+=u*u}return i[4]=i[1],i[8]=i[2],i[9]=i[6],i[12]=i[3],i[13]=i[7],i[14]=i[11],{R:i,m:r,N:s}},ct.quantize.estats=function(n){const t=n.R,e=n.m,i=n.N,r=e[0],s=e[1],a=e[2],o=e[3],l=i===0?0:1/i,c=[t[0]-r*r*l,t[1]-r*s*l,t[2]-r*a*l,t[3]-r*o*l,t[4]-s*r*l,t[5]-s*s*l,t[6]-s*a*l,t[7]-s*o*l,t[8]-a*r*l,t[9]-a*s*l,t[10]-a*a*l,t[11]-a*o*l,t[12]-o*r*l,t[13]-o*s*l,t[14]-o*a*l,t[15]-o*o*l],u=c,g=ct.M4;let p=[Math.random(),Math.random(),Math.random(),Math.random()],d=0,w=0;if(i!==0)for(let A=0;A<16&&(p=g.multVec(u,p),w=Math.sqrt(g.dot(p,p)),p=g.sml(1/w,p),!(A!==0&&Math.abs(w-d)<1e-9));A++)d=w;const x=[r*l,s*l,a*l,o*l],C=g.dot(g.sml(255,x),p);return{Cov:c,q:x,e:p,L:d,eMq255:C,eMq:g.dot(p,x),rgba:(Math.round(255*x[3])<<24|Math.round(255*x[2])<<16|Math.round(255*x[1])<<8|Math.round(255*x[0])<<0)>>>0}},ct.M4={multVec:function(n,t){return[n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3],n[4]*t[0]+n[5]*t[1]+n[6]*t[2]+n[7]*t[3],n[8]*t[0]+n[9]*t[1]+n[10]*t[2]+n[11]*t[3],n[12]*t[0]+n[13]*t[1]+n[14]*t[2]+n[15]*t[3]]},dot:function(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]},sml:function(n,t){return[n*t[0],n*t[1],n*t[2],n*t[3]]}},ct.encode.concatRGBA=function(n){let t=0;for(let r=0;r<n.length;r++)t+=n[r].byteLength;const e=new Uint8Array(t);let i=0;for(let r=0;r<n.length;r++){const s=new Uint8Array(n[r]),a=s.length;for(let o=0;o<a;o+=4){let l=s[o],c=s[o+1],u=s[o+2];const g=s[o+3];g===0&&(l=c=u=0),e[i+o]=l,e[i+o+1]=c,e[i+o+2]=u,e[i+o+3]=g}i+=a}return e.buffer};const n0=ct,xr=new Map,$s=(n,t)=>{if(xr.has(n))return t(null,xr.get(n));const e=new Image;e.onload=function(){xr.set(n,{width:e.width,height:e.height,element:e}),t(null,xr.get(n))},e.onerror=function(i){t(i,null)},e.src=n},i0=(n,t)=>{for(let e=0,i=n.length;e<i;e++){const r=n[e],{type:s}=r;if(s.split("/")[0]!=="image")return;const o=new FileReader;o.onload=function(l){if(!l.target)return t("no reader target",null);const c=l.target.result,u=oa(c),g=new Blob([c]);qs(g,(p,d)=>{if(!d)return t(p,null);$s(d,(w,x)=>{if(!x)return t(w,null);Vl(d,(C,A)=>{if(!A)return t(C,null);const P={name:r.name,fileType:u,size:r.size,width:x.width,height:x.height,imgUrl:d,imageData:A,blob:g};return t(null,P)})})})},o.readAsArrayBuffer(r)}},Vl=(n,t)=>{$s(n,(e,i)=>{if(!i)return t(e,null);const r=document.createElement("canvas"),s=r.getContext("2d");r.width=i.width,r.height=i.height,s.drawImage(i.element,0,0,r.width,r.height);const a=s.getImageData(0,0,r.width,r.height);return t(null,a)})},r0=(n,t=0,e=0)=>{const i=document.createElement("canvas"),r=i.getContext("2d");return i.width=t,i.height=e,r.drawImage(n,0,0,t,e),r.getImageData(0,0,t,e)},s0=(n,t=0,e=0)=>{const i=document.createElement("canvas"),r=i.getContext("2d");return i.width=t,i.height=e,r.drawImage(n,0,0,t,e),r.getImageData(0,0,t,e)},a0=n=>{const t=n.width,e=n.height,i=t*e*3,r=i+54,s=[66,77,r&255,r>>8&255,r>>16&255,r>>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,i&255,i>>8&255,i>>16&255,i>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=(4-t*3%4)%4,l=n.data;let c="";const u=t<<2;let g=e;const p=String.fromCharCode;do{const w=u*(g-1);let x="";for(let C=0;C<t;C++){const A=C<<2;x+=p(l[w+A+2])+p(l[w+A+1])+p(l[w+A])}for(let C=0;C<o;C++)x+=String.fromCharCode(0);c+=x}while(--g);function d(w){if(!window.btoa)throw"btoa undefined";let x="";if(typeof w=="string")x=w;else for(let C=0;C<w.length;C++)x+=String.fromCharCode(w[C]);return btoa(x)}return d(s.concat(a))+d(c)},o0=n=>{const{width:t,height:e}=n,i=document.createElement("canvas"),r=i.getContext("2d");return i.width=t,i.height=e,r.putImageData(n,0,0,0,0,t,e),i.toDataURL("image/png")},l0=(n,t,e)=>{const{width:i,height:r}=n,s=document.createElement("canvas"),a=s.getContext("2d");s.width=i,s.height=r,a.putImageData(n,0,0,0,0,i,r);const o=`image/${t?t.toLowerCase():"png"}`;s.toBlob(l=>{e?.(null,l)},o,1)},qs=(n,t)=>{const e=new FileReader;e.onload=function(i){i.target?t(null,i.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(n)},c0=(n,t)=>{qs(n,function(e,i){if(i){const r=new Image;r.src=i}else t(e)})};function h0(n){const t=[],e=[],i=[];let r=0;for(let l=0,c=n.data.length;l<c;l+=4)t[r]=n.data[l],e[r]=n.data[l+1],i[r]=n.data[l+2],r+=1;const s=Zs(t),a=Zs(e),o=Zs(i);return"rgb("+s+","+a+","+o+")"}function Zs(n){const t={},e=[],i=[];for(let o=0;o<n.length;o++)t[n[o]]?e.push(n[o]):t[n[o]]=1;let r=0;for(let o=0;o<e.length;o++){r=0;for(let l=0;l<e.length;l++)e[o]===e[l]&&(r+=1),i[o]=r}const s=Math.max.apply(null,i);let a=0;for(;a<i.length;a++)if(i[a]===s)return;return e[a]}const f0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=t[(a*e+e-o-1)*4],r[l+1]=t[(a*e+e-o-1)*4+1],r[l+2]=t[(a*e+e-o-1)*4+2],r[l+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(r,e,i)},u0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=t[((i-a-1)*e+o)*4],r[l+1]=t[((i-a-1)*e+o)*4+1],r[l+2]=t[((i-a-1)*e+o)*4+2],r[l+3]=t[((i-a-1)*e+o)*4+3]}return new ImageData(r,e,i)},d0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<i;o++){const l=(a*i+o)*4;r[l]=t[(o*e+e-a-1)*4],r[l+1]=t[(o*e+e-a-1)*4+1],r[l+2]=t[(o*e+e-a-1)*4+2],r[l+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(r,i,e)},p0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<i;o++){const l=(a*i+o)*4;r[l]=t[((i-o-1)*e+a)*4],r[l+1]=t[((i-o-1)*e+a)*4+1],r[l+2]=t[((i-o-1)*e+a)*4+2],r[l+3]=t[((i-o-1)*e+a)*4+3]}return new ImageData(r,i,e)},g0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4,c=(t[l]+t[l+1]+t[l+2])/3;r[l]=c,r[l+1]=c,r[l+2]=c,r[l+3]=t[l+3]}return new ImageData(r,e,i)},m0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4,c=.2126*t[l]+.7152*t[l+1]+.0722*t[l+2];r[l]=c,r[l+1]=c,r[l+2]=c,r[l+3]=t[l+3]}return new ImageData(r,e,i)},v0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4,u=(t[l]+t[l+1]+t[l+2])/3>127?255:0;r[l]=u,r[l+1]=u,r[l+2]=u,r[l+3]=t[l+3]}return new ImageData(r,e,i)},_0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=255-t[l],r[l+1]=255-t[l+1],r[l+2]=255-t[l+2],r[l+3]=t[l+3]}return new ImageData(r,e,i)},y0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=t[l],r[l+1]=0,r[l+2]=0,r[l+3]=t[l+3]}return new ImageData(r,e,i)},w0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=0,r[l+1]=t[l+1],r[l+2]=0,r[l+3]=t[l+3]}return new ImageData(r,e,i)},x0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=0,r[l+1]=0,r[l+2]=t[l+2],r[l+3]=t[l+3]}return new ImageData(r,e,i)},b0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=t[l],r[l+1]=t[l+1],r[l+2]=0,r[l+3]=t[l+3]}return new ImageData(r,e,i)},C0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=t[l],r[l+1]=0,r[l+2]=t[l+1],r[l+3]=t[l+3]}return new ImageData(r,e,i)},T0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=0,r[l+1]=t[l+1],r[l+2]=t[l+1],r[l+3]=t[l+3]}return new ImageData(r,e,i)},S0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4,c=(t[l+1]+t[l+2])/2;r[l]=t[l],r[l+1]=c,r[l+2]=c,r[l+3]=t[l+3]}return new ImageData(r,e,i)},E0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4,c=(t[l]+t[l+2])/2;r[l]=c,r[l+1]=t[l+1],r[l+2]=c,r[l+3]=t[l+3]}return new ImageData(r,e,i)},k0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4,c=(t[l]+t[l+1])/2;r[l]=c,r[l+1]=c,r[l+2]=t[l+2],r[l+3]=t[l+3]}return new ImageData(r,e,i)},A0=n=>jl(n,[-1,-1,-1,-1,9,-1,-1,-1,-1]),P0=n=>jl(n,[-1,-1,-1,-1,8,-1,-1,-1,-1]),I0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;r[l]=t[l],r[l+1]=t[l+1],r[l+2]=t[l+2],r[l+3]=255}return new ImageData(r,e,i)},M0=n=>{const{data:t,width:e,height:i}=n,r=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const l=(a*e+o)*4;if(t[l+3]===0)r[l]=255,r[l+1]=255,r[l+2]=255,r[l+3]=255;else{const c=Xl([t[l],t[l+1],t[l+2],t[l+3]],[255,255,255,255]);r[l]=c[0],r[l+1]=c[1],r[l+2]=c[2],r[l+3]=c[3]}}return new ImageData(r,e,i)},L0=(n,t,e,i,r,s=!1,a)=>{const{data:o,width:l,height:c}=n;let u=r,g=i,p=t,d=e;if(u<0?u=0:u>l&&(u=l),g<0?g=0:g>c&&(g=c),p<1?p=1:p>l&&(p=l),d<1?d=1:d>c&&(d=c),u+p>l&&(p=l-u),g+d>c&&(d=c-g),s){const w=new Uint8ClampedArray(o.length);for(let C=0;C<c;C++)for(let A=0;A<l;A++){const P=(C*l+A)*4;A>=u&&A<=u+p&&C>=g&&C<=g+d?(w[P]=o[P],w[P+1]=o[P+1],w[P+2]=o[P+2],w[P+3]=o[P+3]):(w[P]=255,w[P+1]=255,w[P+2]=255,w[P+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(w,l,c)}else{const w=new Uint8ClampedArray(p*d*4);for(let C=g;C<=g+d;C++)for(let A=u;A<=u+p;A++){const P=((C-g)*p+A-u)*4,M=(C*l+A)*4;w[P]=o[M],w[P+1]=o[M+1],w[P+2]=o[M+2],w[P+3]=o[M+3]}return new ImageData(w,p,d)}},D0=(n,t,e,i)=>{const{data:r,width:s,height:a}=n;let o=t;o>Math.floor(s/2)&&(o=Math.floor(s/2)),o>Math.floor(a/2)&&(o=Math.floor(a/2)),o<0&&(o=0);const l=new Uint8ClampedArray(r.length);for(let u=0;u<a;u++)for(let g=0;g<s;g++){const p=(u*s+g)*4;let d=-1;g<o?u<o?d=Math.sqrt(Math.pow(o-g-1,2)+Math.pow(o-u-1,2)):u>a-o-1&&(d=Math.sqrt(Math.pow(o-g-1,2)+Math.pow(u-(a-o),2))):g>s-o-1&&(u<o?d=Math.sqrt(Math.pow(g-(s-o),2)+Math.pow(o-u-1,2)):u>a-o-1&&(d=Math.sqrt(Math.pow(g-(s-o),2)+Math.pow(u-(a-o),2)))),Math.round(d)>o?(l[p]=255,l[p+1]=255,l[p+2]=255,l[p+3]=i||e.toUpperCase()==="PNG"?0:255):(l[p]=r[p],l[p+1]=r[p+1],l[p+2]=r[p+2],l[p+3]=i||e.toUpperCase()==="PNG"?r[p+3]:255)}return new ImageData(l,s,a)},R0=(n,t,e,i,r,s=1e4)=>{const a=new Image;a.src=n;const o=document.createElement("canvas"),l=o.getContext("2d");return o.width=s,o.height=s,l.drawImage(a,0,0,t,e,0,0,i,r),l.getImageData(0,0,i,r)},O0=(n,t)=>{const{data:e,width:i,height:r}=n,s=new Uint8ClampedArray(e.length);for(let o=0;o<r;o++)for(let l=0;l<i;l++){const c=(o*i+l)*4;s[c]=Math.max(Math.min(e[c]+t,255),0),s[c+1]=Math.max(Math.min(e[c+1]+t,255),0),s[c+2]=Math.max(Math.min(e[c+2]+t,255),0),s[c+3]=e[c+3]}return new ImageData(s,i,r)},F0=(n,t,e=!1)=>{const{data:i,width:r,height:s}=n,a=new Uint8ClampedArray(i.length);for(let l=0;l<s;l++)for(let c=0;c<r;c++){const u=(l*r+c)*4;i[u+3]===0?(a[u]=255,a[u+1]=255,a[u+2]=255):(a[u]=i[u],a[u+1]=i[u+1],a[u+2]=i[u+2]);let g=i[u+3];e?g=Math.max(Math.min(Math.floor(255*t),255),0):g=Math.max(Math.min(Math.floor(g+255*t),255),0),a[u+3]=g}return new ImageData(a,r,s)},U0=(n,t,e,i)=>{const{data:r,width:s,height:a}=n,{data:o,width:l,height:c}=t;let u=e,g=i;e+c>a&&(u=a-c),i+l>s&&(g=s-l);const p=new Uint8ClampedArray(r.length);for(let w=0;w<a;w++)for(let x=0;x<s;x++){const C=(w*s+x)*4;if(x<g||x>g+l||w<=u||w>=u+c)p[C]=r[C],p[C+1]=r[C+1],p[C+2]=r[C+2],p[C+3]=r[C+3];else{const A=(w*s+x-((u+1)*s+(w-(u+1))*(s-l))+l-g-1)*4,P=[o[A],o[A+1],o[A+2],o[A+3]],M=[r[C],r[C+1],r[C+2],r[C+3]],D=Xl(P,M);p[C]=D[0],p[C+1]=D[1],p[C+2]=D[2],p[C+3]=D[3]}}return new ImageData(p,s,a)},N0=(n,t,e,i,r,s=10)=>{const{data:a,width:o,height:l}=n;let c=r,u=i,g=t,p=e;c<0?c=0:c>o&&(c=o),u<0?u=0:u>l&&(u=l),g<1?g=1:g>o&&(g=o),p<1?p=1:p>l&&(p=l),c+g>o&&(g=o-c),u+p>l&&(p=l-u);const d=new Uint8ClampedArray(a.length);for(let x=0;x<l;x++)for(let C=0;C<o;C++){const A=(x*o+C)*4;if(C>=c&&C<=c+g&&x>=u&&x<=u+p){const P=Math.floor((C-c)/s),M=Math.floor((x-u)/s);let D=Math.floor(s*(P+1)-s/2+c),U=Math.floor(s*(M+1)-s/2+u);D>o-1&&(D=o-1),U>l-1&&(U=l-1);const z=(U*o+D)*4;d[A]=a[z],d[A+1]=a[z+1],d[A+2]=a[z+2],d[A+3]=a[z+3]}else d[A]=a[A],d[A+1]=a[A+1],d[A+2]=a[A+2],d[A+3]=a[A+3]}return new ImageData(d,o,l)},z0=async(n,t,e,i,r,s)=>{const a=r/100;if(["JPG","JPEG"].includes(i.toUpperCase())){const o=new Image;o.src=n;const l=document.createElement("canvas"),c=l.getContext("2d");l.width=t,l.height=e,c.drawImage(o,0,0,t,e),l.toBlob(u=>{s(u)},`image/${i.toLowerCase()}`,a)}else{const o=Math.floor(a*256),l=n0.encode([n.data.buffer],t,e,o),c=new Blob([l]);s&&s(c)}},B0=(n,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}})=>{if(t&&e){const{data:i,width:r,height:s}=n,{data:a}=t,o=new Uint8ClampedArray(i.length),{backgroundColor:l,changeIntoColor:c}=e;for(let g=0;g<s;g++)for(let p=0;p<r;p++){const d=(g*r+p)*4,w=a[d],x=a[d+1],C=a[d+2],A=a[d+3];w===l.r&&x===l.g&&C===l.b&&A===l.a&&c.a!==0?(o[d]=c.r,o[d+1]=c.g,o[d+2]=c.b,o[d+3]=c.a):(o[d]=i[d],o[d+1]=i[d+1],o[d+2]=i[d+2],o[d+3]=i[d+3])}return new ImageData(o,r,s)}return n},jl=(n,t)=>{const{data:e,width:i,height:r}=n,s=new Uint8ClampedArray(e.length);for(let o=0;o<r;o++)for(let l=0;l<i;l++){const c=(o*i+l)*4;for(let u=0;u<3;u++){const g=c+u;l===0||l===i-1||o===0||o===r-1?s[g]=e[g]:s[g]=t[0]*e[g-i*4-4]+t[1]*e[g-i*4]+t[2]*e[g-i*4+4]+t[3]*e[g-4]+t[4]*e[g]+t[5]*e[g+4]+t[6]*e[g+i*4-4]+t[7]*e[g+i*4]+t[8]*e[g+i*4+4]}s[c+3]=e[c+3]}return new ImageData(s,i,r)},Xl=(n,t)=>{if(n&&n.length===4&&t&&t.length===4){const e=n[3],i=t[3];if(e===255||i===0)return n;if(e===0)return t;{const r=e/255,s=i/255,a=Math.max(Math.min(Math.floor(n[0]*r+t[0]*s*(1-r)),255),0),o=Math.max(Math.min(Math.floor(n[1]*r+t[1]*s*(1-r)),255),0),l=Math.max(Math.min(Math.floor(n[2]*r+t[2]*s*(1-r)),255),0),c=Math.max(Math.min(Math.floor((r+s*(1-r))*255),255),0);return[a,o,l,c]}}return[255,255,255,255]},Yl=function(n,t,e){const i=new Array(n*n),r=function(o){const l=o;let c=0,u=0;return{write(g,p){if(g>>>p)throw new Error("length over");for(;c+p>=8;)l.writeByte(255&(g<<c|u)),p-=8-c,g>>>=8-c,u=0,c=0;u=g<<c|u,c=c+p},flush(){c>0&&l.writeByte(u)}}},s=function(o){const l=1<<o,c=(1<<o)+1;let u=o+1;const g=a();for(let C=0;C<l;C++)g.add(String.fromCharCode(C));g.add(String.fromCharCode(l)),g.add(String.fromCharCode(c));const p=la(),d=r(p);d.write(l,u);let w=0,x=String.fromCharCode(i[w]);for(w+=1;w<i.length;){const C=String.fromCharCode(i[w]);w+=1,g.contains(x+C)?x=x+C:(d.write(g.indexOf(x),u),g.size()<4095&&(g.size()==1<<u&&(u+=1),g.add(x+C)),x=C)}return d.write(g.indexOf(x),u),d.write(c,u),d.flush(),p.toByteArray()},a=function(){const o={};let l=0;return{add(c){if(this.contains(c))throw new Error("dup key:"+c);o[c]=l,l+=1},size(){return l},indexOf(c){return o[c]},contains(c){return typeof o[c]<"u"}}};return{setPixel(o,l,c){i[l*n+o]=c},write(o){o.writeString("GIF87a"),o.writeShort(n),o.writeShort(n),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte(On("0x"+t[1]+t[2])),o.writeByte(On("0x"+t[3]+t[4])),o.writeByte(On("0x"+t[5]+t[6])),o.writeByte(On("0x"+e[1]+e[2])),o.writeByte(On("0x"+e[3]+e[4])),o.writeByte(On("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(n),o.writeShort(n),o.writeByte(0);const l=2,c=s(l);o.writeByte(l);let u=0;for(;c.length-u>255;)o.writeByte(255),o.writeBytes(c,u,255),u+=255;o.writeByte(c.length-u),o.writeBytes(c,u,c.length-u),o.writeByte(0),o.writeString(";")}}},$l=function(n,t,e,i){const r=Yl(n,t,e);for(let c=0;c<n;c++)for(let u=0;u<n;u++)r.setPixel(u,c,i(u,c));const s=la();r.write(s);const a=mc(),o=s.toByteArray();for(let c=0,u=o.length;c<u;c++)a.writeByte(o[c]);a.flush();let l="";return l+="data:image/gif;base64,",l+=a,l},ue={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ri={M:0,L:1,H:2,Q:3},cn={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},$t={glog:function(n){if(n<1)throw new Error("glog("+n+")");return $t.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return $t.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let n=0;n<8;n++)$t.EXP_TABLE[n]=1<<n;for(let n=8;n<256;n++)$t.EXP_TABLE[n]=$t.EXP_TABLE[n-4]^$t.EXP_TABLE[n-5]^$t.EXP_TABLE[n-6]^$t.EXP_TABLE[n-8];for(let n=0;n<255;n++)$t.LOG_TABLE[$t.EXP_TABLE[n]]=n;const Gt={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(n){let t=n<<10;for(;Gt.getBCHDigit(t)-Gt.getBCHDigit(Gt.G15)>=0;)t^=Gt.G15<<Gt.getBCHDigit(t)-Gt.getBCHDigit(Gt.G15);return(n<<10|t)^Gt.G15_MASK},getBCHTypeNumber:function(n){let t=n<<12;for(;Gt.getBCHDigit(t)-Gt.getBCHDigit(Gt.G18)>=0;)t^=Gt.G18<<Gt.getBCHDigit(t)-Gt.getBCHDigit(Gt.G18);return n<<12|t},getBCHDigit:function(n){let t=0;for(;n!=0;)t++,n>>>=1;return t},getPatternPosition:function(n){return Gt.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,t,e){switch(n){case cn.PATTERN000:return(t+e)%2==0;case cn.PATTERN001:return t%2==0;case cn.PATTERN010:return e%3==0;case cn.PATTERN011:return(t+e)%3==0;case cn.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case cn.PATTERN101:return t*e%2+t*e%3==0;case cn.PATTERN110:return(t*e%2+t*e%3)%2==0;case cn.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){let t=new qn([1],0);for(let e=0;e<n;e++)t=t.multiply(new qn([1,$t.gexp(e)],0));return t},getLengthInBits:function(n,t){if(1<=t&&t<10)switch(n){case ue.MODE_NUMBER:return 10;case ue.MODE_ALPHA_NUM:return 9;case ue.MODE_8BIT_BYTE:return 8;case ue.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(t<27)switch(n){case ue.MODE_NUMBER:return 12;case ue.MODE_ALPHA_NUM:return 11;case ue.MODE_8BIT_BYTE:return 16;case ue.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(t<41)switch(n){case ue.MODE_NUMBER:return 14;case ue.MODE_ALPHA_NUM:return 13;case ue.MODE_8BIT_BYTE:return 16;case ue.MODE_KANJI:return 12;default:throw new Error("mode:"+n)}else throw new Error("type:"+t)},getLostPoint:function(n){const t=n.getModuleCount();let e=0;for(let s=0;s<t;s++)for(let a=0;a<t;a++){let o=0;const l=n.isDark(s,a);for(let c=-1;c<=1;c++)if(!(s+c<0||t<=s+c))for(let u=-1;u<=1;u++)a+u<0||t<=a+u||c==0&&u==0||l==n.isDark(s+c,a+u)&&o++;o>5&&(e+=3+o-5)}for(let s=0;s<t-1;s++)for(let a=0;a<t-1;a++){let o=0;n.isDark(s,a)&&o++,n.isDark(s+1,a)&&o++,n.isDark(s,a+1)&&o++,n.isDark(s+1,a+1)&&o++,(o==0||o==4)&&(e+=3)}for(let s=0;s<t;s++)for(let a=0;a<t-6;a++)n.isDark(s,a)&&!n.isDark(s,a+1)&&n.isDark(s,a+2)&&n.isDark(s,a+3)&&n.isDark(s,a+4)&&!n.isDark(s,a+5)&&n.isDark(s,a+6)&&(e+=40);for(let s=0;s<t;s++)for(let a=0;a<t-6;a++)n.isDark(a,s)&&!n.isDark(a+1,s)&&n.isDark(a+2,s)&&n.isDark(a+3,s)&&n.isDark(a+4,s)&&!n.isDark(a+5,s)&&n.isDark(a+6,s)&&(e+=40);let i=0;for(let s=0;s<t;s++)for(let a=0;a<t;a++)n.isDark(a,s)&&i++;const r=Math.abs(100*i/t/t-50)/5;return e+=r*10,e}};class qn{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let i=0;for(;i<t.length&&t[i]==0;)i++;this.num=new Array(t.length-i+e);for(let r=0;r<t.length-i;r++)this.num[r]=t[r+i]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let i=0;i<this.getLength();i++)for(let r=0;r<t.getLength();r++)e[i+r]^=$t.gexp($t.glog(this.get(i))+$t.glog(t.get(r)));return new qn(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=$t.glog(this.get(0))-$t.glog(t.get(0)),i=new Array(this.getLength());for(let r=0;r<this.getLength();r++)i[r]=this.get(r);for(let r=0;r<t.getLength();r++)i[r]^=$t.gexp($t.glog(t.get(r))+e);return new qn(i,0).mod(t)}}class Ve{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 i=Ve.getRsBlockTable(t,e);if(i==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const r=i.length/3,s=[];for(let a=0;a<r;a++){const o=i[a*3+0],l=i[a*3+1],c=i[a*3+2];for(let u=0;u<o;u++)s.push(new Ve(l,c))}return s}static getRsBlockTable(t,e){switch(e){case Ri.L:return Ve.RS_BLOCK_TABLE[(t-1)*4+0];case Ri.M:return Ve.RS_BLOCK_TABLE[(t-1)*4+1];case Ri.Q:return Ve.RS_BLOCK_TABLE[(t-1)*4+2];case Ri.H:return Ve.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class ql{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 i=0;i<e;i++)this.putBit((t>>>e-i-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 G0{mode;data;constructor(t){this.mode=ue.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,i=this.data.length;e<i;e++)t.put(this.data.charCodeAt(e),8)}}class hn{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Ri[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new G0(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=Ve.getRSBlocks(t,this.errorCorrectLevel),i=new ql;let r=0;for(let s=0;s<e.length;s++)r+=e[s].dataCount;for(let s=0;s<this.dataList.length;s++){const a=this.dataList[s];i.put(a.mode,4),i.put(a.getLength(),Gt.getLengthInBits(a.mode,t)),a.write(i)}if(i.getLengthInBits()<=r*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 i=0;i<this.moduleCount;i++){this.modules[i]=new Array(this.moduleCount);for(let r=0;r<this.moduleCount;r++)this.modules[i][r]=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=hn.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let i=-1;i<=7;i++)if(!(t+i<=-1||this.moduleCount<=t+i))for(let r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(0<=i&&i<=6&&(r==0||r==6)||0<=r&&r<=6&&(i==0||i==6)||2<=i&&i<=4&&2<=r&&r<=4?this.modules[t+i][e+r]=!0:this.modules[t+i][e+r]=!1)}getBestMaskPattern(){let t=0,e=0;for(let i=0;i<8;i++){this.makeImpl(!0,i);const r=Gt.getLostPoint(this);(i==0||t>r)&&(t=r,e=i)}return e}createMovieClip(t,e,i){const r=t.createEmptyMovieClip(e,i),s=1;this.make();for(let a=0;a<this.modules.length;a++){const o=a*s;for(let l=0;l<this.modules[a].length;l++){const c=l*s;this.modules[a][l]&&(r.beginFill(0,100),r.moveTo(c,o),r.lineTo(c+s,o),r.lineTo(c+s,o+s),r.lineTo(c,o+s),r.endFill())}}return r}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=Gt.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let i=0;i<t.length;i++){const r=t[e],s=t[i];if(this.modules[r][s]==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[r+a][s+o]=!0:this.modules[r+a][s+o]=!1}}setupTypeNumber(t){const e=Gt.getBCHTypeNumber(this.typeNumber);for(let i=0;i<18;i++){const r=!t&&(e>>i&1)==1;this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=r}for(let i=0;i<18;i++){const r=!t&&(e>>i&1)==1;this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=r}}setupTypeInfo(t,e){const i=this.errorCorrectLevel<<3|e,r=Gt.getBCHTypeInfo(i);for(let s=0;s<15;s++){const a=!t&&(r>>s&1)==1;s<6?this.modules[s][8]=a:s<8?this.modules[s+1][8]=a:this.modules[this.moduleCount-15+s][8]=a}for(let s=0;s<15;s++){const a=!t&&(r>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=a:s<9?this.modules[8][15-s-1+1]=a:this.modules[8][15-s-1]=a}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let i=-1,r=this.moduleCount-1,s=7,a=0;for(let o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(let l=0;l<2;l++)if(this.modules[r][o-l]==null){let c=!1;a<t.length&&(c=(t[a]>>>s&1)==1),Gt.getMask(e,r,o-l)&&(c=!c),this.modules[r][o-l]=c,s--,s==-1&&(a++,s=7)}if(r+=i,r<0||this.moduleCount<=r){r-=i,i=-i;break}}}static createData(t,e,i){const r=Ve.getRSBlocks(t,e),s=new ql;for(let o=0;o<i.length;o++){const l=i[o];s.put(l.mode,4),s.put(l.getLength(),Gt.getLengthInBits(l.mode,t)),l.write(s)}let a=0;for(let o=0;o<r.length;o++)a+=r[o].dataCount;if(s.getLengthInBits()>a*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+a*8+")");for(s.getLengthInBits()+4<=a*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=a*8||(s.put(hn.PAD0,8),s.getLengthInBits()>=a*8));)s.put(hn.PAD1,8);return hn.createBytes(s,r)}static createBytes(t,e){let i=0,r=0,s=0;const a=new Array(e.length),o=new Array(e.length);for(let g=0;g<e.length;g++){const p=e[g].dataCount,d=e[g].totalCount-p;r=Math.max(r,p),s=Math.max(s,d),a[g]=new Array(p);for(let A=0;A<a[g].length;A++)a[g][A]=255&t.buffer[A+i];i+=p;const w=Gt.getErrorCorrectPolynomial(d),C=new qn(a[g],w.getLength()-1).mod(w);o[g]=new Array(w.getLength()-1);for(let A=0;A<o[g].length;A++){const P=A+C.getLength()-o[g].length;o[g][A]=P>=0?C.get(P):0}}let l=0;for(let g=0;g<e.length;g++)l+=e[g].totalCount;const c=new Array(l);let u=0;for(let g=0;g<r;g++)for(let p=0;p<e.length;p++)g<a[p].length&&(c[u++]=a[p][g]);for(let g=0;g<s;g++)for(let p=0;p<e.length;p++)g<o[p].length&&(c[u++]=o[p][g]);return c}}const Zl=Math.ceil,Oi=Math.floor,Wl=Math.round;function H0(n,t){const e=aa(n),i=t?.ecc||"H",r=t?.size||256,s=-1,a=t?.padding||0,o=t?.color||"#000000",l=t?.background||"#ffffff",c=new hn(s,i);c.addData(e),c.make();const u=c.getModuleCount(),g=(r-a*2)/u,p=a,d=r-a;return $l(r,o,l,function(w,x){if(p<=w&&w<d&&p<=x&&x<d){const C=Oi((w-p)/g),A=Oi((x-p)/g);return c.isDark(A,C)?0:1}else return 1})}function V0(n,t){const e=t.x||0,i=t.y||0,r=aa(n),s=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?Oi(t.size):256,l=t.padding||0,c=-1,u=t.color||"#000000",g=t.background||"#ffffff",p=new hn(c,a);p.addData(r),p.make();const d=p.getModuleCount(),w=(o-l*2)/d;s.fillStyle=g,s.fillRect(e,i,o,o);for(let x=0;x<d;x++)for(let C=0;C<d;C++){const A=Zl((C+1)*w)-Oi(C*w),P=Zl((x+1)*w)-Oi(x*w);s.fillStyle=p.isDark(x,C)?u:g,s.fillRect(e+Wl(C*w)+l,i+Wl(x*w)+l,A,P)}}function Ws(){let n=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0;e<t.length;e++)try{n=new window.ActiveXObject(t[e]);break}catch{continue}}else n=new XMLHttpRequest;return n}function j0(n){if(!n.action)return{url:"",data:"",boundary:""};const t=n.method.toLowerCase()==="get",e=n.method.toLowerCase()==="post";let i=n.action,r="";const s="---------------------------"+Date.now().toString(16);if(window.FormData)r=new FormData(n),t&&(i=lr(i,ms(r)));else if(t){let a="";for(let o=0;o<n.elements.length;o++){const l=n.elements[o];if(!l.hasAttribute("name"))continue;const c=l.nodeName.toUpperCase()==="INPUT"?l.getAttribute("type")?.toUpperCase():"TEXT";if(c==="FILE")for(let u=0,g=l.files?.length??0;u<g;a+="&"+encodeURIComponent(l.name)+"="+encodeURIComponent(l.files?.[u++].name??""));else(c!=="RADIO"&&c!=="CHECKBOX"||l.checked)&&(a+="&"+encodeURIComponent(l.name)+"="+encodeURIComponent(l.value))}i=lr(i,a)}else if(e){const a=[];if(n.enctype==="application/x-www-form-urlencoded"){for(let o=0;o<n.elements.length;o++){const l=n.elements[o];l.hasAttribute("name")&&a.push(encodeURIComponent(l.name)+"="+encodeURIComponent(l.value))}r=a.join("&")}else if(n.enctype==="text/plain"){for(let o=0;o<n.elements.length;o++){const l=n.elements[o];l.hasAttribute("name")&&a.push(l.name+"="+l.value)}r=a.join(`\r
30
+ `)}else if(n.enctype==="multipart/form-data"){for(let o=0;o<n.elements.length;o++){const l=n.elements[o];if(!l.hasAttribute("name"))continue;if((l.nodeName.toUpperCase()==="INPUT"?l.getAttribute("type")?.toUpperCase():"TEXT")==="FILE")for(let u=0,g=l.files?.length??0;u<g;u++){const p=l.files?.[u];a.push('Content-Disposition: form-data; name="'+l.name+'"; filename="'+p?.name+`"\r
31
+ Content-Type: `+p?.type+`\r
32
32
  \r
33
- `)}else a.push('Content-Disposition: form-data; name="'+h.name+`"\r
33
+ `)}else a.push('Content-Disposition: form-data; name="'+l.name+`"\r
34
34
  \r
35
- `+h.value+`\r
35
+ `+l.value+`\r
36
36
  `)}r=a.join(s+`\r
37
- `)}}return{url:i,data:r,boundary:s}}function l_(n){return new Promise((t,e)=>{const{method:i="GET",url:r="",data:s="",headers:a={},responseType:o="json",timeout:h=3e4,boundary:l=""}=n;Object.assign(a,{Accept:"*/*"});const c=Lh();c.onreadystatechange=function(u){c.readyState===4&&(c.status===200?t(c.response):e(c.statusText))},c.ontimeout=function(){e(`${r} is timed out for ${h}ms.`)},c.addEventListener("error",function(u){e(u)},!1),c.addEventListener("progress",function(u){if(u.lengthComputable){const m=Math.round(u.loaded*100/u.total);n.progress?.(m)}},!1),c.addEventListener("load",function(u){n.load?.(u)},!1),c.addEventListener("loadstart",function(u){n.loadstart?.(u)},!1),c.addEventListener("loadend",function(u){n.loadend?.(u)},!1),c.addEventListener("abort",function(u){n.abort?.(u)},!1),c.timeout=h,c.responseType=o;const d=i.toUpperCase();function f(){for(const u in a)c.setRequestHeader(u,a[u]);l&&c.setRequestHeader("Content-Type","multipart/form-data; boundary="+l)}if(d==="GET"){let u="";typeof s=="string"?u=s:s instanceof FormData?u=Qo(s):na(s)&&(u=qc(s)),c.open("GET",wa(r,u),!0),f(),c.send(null)}else d==="POST"?(c.open("POST",r,!0),f(),l?c.sendAsBinary(l+`\r
38
- `+s+l+`--\r
39
- `):c.send(JSON.stringify(s))):(c.open(d,r,!0),f(),c.send(JSON.stringify(s)))})}function c_(n,t){const e=Lh();e.open("HEAD",n),e.filepath=n,e.callback=t,e.onload=function(){const i=parseFloat(window.localStorage.getItem("lm_"+this.filepath)??""),r=Date.parse(this.getResponseHeader("Last-Modified"));(isNaN(i)||r>i)&&(window.localStorage.setItem("lm_"+this.filepath,String(Date.now())),isFinite(i)&&this.callback(r,i))},e.send()}let Ia;const Ef=new WeakMap;function Ih(n,t){let e=Ef.get(n);e||(e=new Map,Ef.set(n,e));let i=e.get(t);return i||(i=new Pf,e.set(t,i)),i}class Pf{subscribers;constructor(){this.subscribers=new Set}depend(){Ia&&this.subscribers.add(Ia)}notify(){this.subscribers.forEach(t=>t())}}function u_(n){Ia=n,n(),Ia=null}function f_(n){return Object.keys(n).forEach(t=>{let e=n[t];const i=Ih(n,t);Object.defineProperty(n,t,{get(){return i.depend(),e},set(r){r!=e&&(e=r,i.notify())}})}),n}function d_(n){return new Proxy(n,{get(t,e,i){return Ih(n,e).depend(),Reflect.get(t,e,i)},set(t,e,i,r){const s=Ih(n,e);return n[e]!=i&&(n[e]=i,s.notify()),Reflect.set(t,e,i,r)}})}let es;typeof self>"u"&&typeof process<"u"&&process.hrtime?es=function(){const n=process.hrtime();return n[0]*1e3+n[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?es=self.performance.now.bind(self.performance):Date.now!==void 0?es=Date.now:es=function(){return new Date().getTime()};const ir=es;class is{static _nextId=0;static nextId(){return is._nextId++}}const Oa={Linear:{None:function(n){return n}},Ease:{In:function(n){return Math.pow(n,1.7)}},Quadratic:{In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}},Cubic:{In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}},Quartic:{In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}},Quintic:{In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}},Sinusoidal:{In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}},Exponential:{In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}},Circular:{In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}},Elastic:{In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}},Back:{In:function(n){return n===1?1:n*n*((1.70158+1)*n-1.70158)},Out:function(n){return n===0?0:--n*n*((1.70158+1)*n+1.70158)+1},InOut:function(n){const t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)}},Bounce:{In:function(n){return 1-Oa.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?Oa.Bounce.In(n*2)*.5:Oa.Bounce.Out(n*2-1)*.5+.5}},generatePow:function(n=4){return n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(t){return t**n},Out:function(t){return 1-(1-t)**n},InOut:function(t){return t<.5?(t*2)**n/2:(1-(2-t*2)**n)/2+.5}}},random:function(n){return Math.random()},createStep:function(n){return function(t){return Math.floor(t*n)/n}},createNoisyEasing:function(n,t=.1){const e=1-t;return function(i){return t*Math.random()+e*n(i)}}},Oh=Oa,ns={Utils:{Linear:function(n,t,e){return(t-n)*e+n},Factorial:function(){const n=[1];return function(t){let e=1;if(n[t])return n[t];for(let i=t;i>1;i--)e*=i;return n[t]=e,e}}(),Bernstein:function(n,t){const e=ns.Utils.Factorial;return e(n)/e(t)/e(n-t)},CatmullRom:function(n,t,e,i,r){const s=(e-n)*.5,a=(i-t)*.5,o=r*r,h=r*o;return(2*t-2*e+s+a)*h+(-3*t+3*e-2*s-a)*o+s*r+t}},Linear:function(n,t){const e=n.length-1,i=e*t,r=Math.floor(i),s=ns.Utils.Linear;return t<0?s(n[0],n[1],i):t>1?s(n[e],n[e-1],e-i):s(n[r],n[r+1>e?e:r+1],i-r)},Bezier:function(n,t){let e=0;const i=n.length-1,r=Math.pow,s=ns.Utils.Bernstein;for(let a=0;a<=i;a++)e+=r(1-t,i-a)*r(t,a)*n[a]*s(i,a);return e},CatmullRom:function(n,t){const e=n.length-1;let i=e*t,r=Math.floor(i);const s=ns.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(r=Math.floor(i=e*(1+t))),s(n[(r-1+e)%e],n[r],n[(r+1)%e],n[(r+2)%e],i-r)):t<0?n[0]-(s(n[0],n[0],n[1],n[1],-i)-n[0]):t>1?n[e]-(s(n[e],n[e],n[e-1],n[e-1],i-e)-n[e]):s(n[r?r-1:0],n[r],n[e<r+1?e:r+1],n[e<r+2?e:r+2],i-r)}},Fh=ns;let Af=class{_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=ir(),e=!1){let i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(let r=0;r<i.length;r++){const s=this._tweens[i[r]],a=!e;s&&s.update(t,a)===!1&&!e&&delete this._tweens[i[r]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0}};const je=new Af,g_=class{constructor(t,e=je){this._object=t,this._group=e}_id=is.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=Oh.Linear.None;_interpolationFunction=Fh.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=ir()){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,i,r){for(const s in i){const a=t[s],o=Array.isArray(a),h=o?"array":typeof a,l=!o&&Array.isArray(i[s]);if(!(h==="undefined"||h==="function")){if(l){let c=i[s];if(c.length===0)continue;c=c.map(this._handleRelativeValue.bind(this,a)),i[s]=[a].concat(c)}if((h==="object"||o)&&a&&!l){e[s]=o?[]:{};for(const c in a)e[s][c]=a[c];r[s]=o?[]:{},this._setupProperties(a,e[s],i[s],r[s])}else typeof e[s]>"u"&&(e[s]=a),o||(e[s]*=1),l?r[s]=i[s].slice().reverse():r[s]=e[s]||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=ir()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=ir()){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=je){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=Oh.Linear.None){return this._easingFunction=t,this}interpolation(t=Fh.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=ir(),e=!0){if(this._isPaused)return!0;let i,r;const s=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>s)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),r=(t-this._startTime)/this._durationTime,r=this._durationTime===0||r>1?1:r;const a=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),r===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];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,i,r){for(const s in i){if(e[s]===void 0)continue;const a=e[s]||0;let o=i[s];const h=Array.isArray(t[s]),l=Array.isArray(o);!h&&l?t[s]=this._interpolationFunction(o,r):typeof o=="object"&&o?this._updateProperties(t[s],a,o,r):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[s]=a+(o-a)*r))}}_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],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=i,this._valuesEnd[t]=e}},p_=is.nextId,m_=je.getAll.bind(je),v_=je.removeAll.bind(je),__=je.add.bind(je),y_=je.remove.bind(je),w_=je.update.bind(je),b_={now:ir,Sequence:is,Easing:Oh,Interpolation:Fh,Group:Af,Tween:g_,nextId:p_,getAll:m_,removeAll:v_,add:__,remove:y_,update:w_};class Fa extends Wt{app;rotate;scale;isMouseDownInBounds=!1;constructor(t,e={x:0,y:0}){super(e),this.rotate=e.rotate??0,this.scale=e.scale??1,this.app=t,this.app.on("mouseDown",i=>{this.isMouseDownInBounds=this.getBounds().isContainPoint(this.app.mouse.point)}),this.app.on("mouseUp",i=>{this.isMouseDownInBounds=!1}),this.app.on("mouseMove",i=>{this.isMouseDownInBounds&&(this.x=this.app.mouse.point.x,this.y=this.app.mouse.point.y)})}draw(t){this._draw({extra:t,init:()=>{},shape:()=>{}})}_draw({init:t,extra:e,shape:i}){this.app.ctx.save(),t?.(this.app),e?.(this.app),this.app.ctx.translate(this.x,this.y),this.app.ctx.rotate(this.rotate),this.app.ctx.scale(this.scale,this.scale),i(this.app),this.app.ctx.restore()}}class x_ extends Fa{constructor(t,e={x:0,y:0}){super(t,e)}draw(t){super._draw({extra:t,init:e=>{e.ctx.lineWidth=2,e.ctx.fillStyle="#ffff00"},shape:e=>{e.ctx.beginPath(),e.ctx.moveTo(-50,-25),e.ctx.lineTo(0,-25),e.ctx.lineTo(0,-50),e.ctx.lineTo(50,0),e.ctx.lineTo(0,50),e.ctx.lineTo(0,25),e.ctx.lineTo(-50,25),e.ctx.lineTo(-50,-25),e.ctx.closePath(),e.ctx.fill(),e.ctx.lineWidth>0&&e.ctx.stroke()}})}}class S_ extends Fa{radius;constructor(t,e={x:0,y:0,radius:40}){super(t,e),this.radius=e.radius}draw(t){super._draw({extra:t,init:e=>{e.ctx.lineWidth=1,e.ctx.fillStyle="#ff0000"},shape:e=>{e.ctx.beginPath(),e.ctx.arc(0,0,this.radius,0,Math.PI*2,!0),e.ctx.closePath(),e.ctx.fill(),e.ctx.lineWidth>0&&e.ctx.stroke()}})}}class C_ extends Fa{toX;toY;c1x;c1y;c2x;c2y;constructor(t,e={x:0,y:0,toX:0,toY:0}){super(t,e),this.toX=e.toX,this.toY=e.toY,this.c1x=e.c1x??0,this.c1y=e.c1y??0,this.c2x=e.c2x??0,this.c2y=e.c2y??0}draw(t){this._draw({extra:t,init:e=>{e.ctx.lineWidth=1,e.ctx.strokeStyle="#eeeeee"},shape:e=>{e.ctx.beginPath(),e.ctx.moveTo(0,0),e.ctx.lineTo(this.toX-this.x,this.toY-this.y),e.ctx.lineWidth>0&&e.ctx.stroke()}})}drawQuadratic(t){this._draw({extra:t,init:e=>{e.ctx.lineWidth=1,e.ctx.strokeStyle="#eeeeee"},shape:e=>{e.ctx.beginPath(),e.ctx.moveTo(0,0),e.ctx.quadraticCurveTo(this.c1x-this.x,this.c1y-this.y,this.toX-this.x,this.toY-this.y),e.ctx.lineWidth>0&&e.ctx.stroke()}})}drawQuadraticThrough(t){this._draw({extra:t,init:e=>{e.ctx.lineWidth=1,e.ctx.strokeStyle="#eeeeee"},shape:e=>{e.ctx.beginPath(),e.ctx.moveTo(0,0);const i=this.c1x*2-(this.x+this.toX)/2,r=this.c1y*2-(this.y+this.toY)/2;e.ctx.quadraticCurveTo(i-this.x,r-this.y,this.toX-this.x,this.toY-this.y),e.ctx.lineWidth>0&&e.ctx.stroke()}})}drawQuadraticThroughCurve(t,e){this._draw({extra:e,init:i=>{i.ctx.lineWidth=1,i.ctx.strokeStyle="#eeeeee"},shape:i=>{const r=t.length;if(r<3)return new Error("points length must >= 3");const s=(t[0].x+t[r-1].x)/2,a=(t[0].y+t[r-1].y)/2;i.ctx.beginPath(),i.ctx.moveTo(s,a);let o=0;for(;o<r-1;o++){const h=(t[o].x+t[o+1].x)/2,l=(t[o].y+t[o+1].y)/2;i.ctx.quadraticCurveTo(t[o].x-this.x,t[o].y-this.y,h-this.x,l-this.y)}i.ctx.quadraticCurveTo(t[o].x-this.x,t[o].y-this.y,s-this.x,a-this.y),i.ctx.lineWidth>0&&i.ctx.stroke()}})}drawQuadraticThroughCurveNotGood(t,e){this._draw({extra:e,init:i=>{i.ctx.lineWidth=1,i.ctx.strokeStyle="#eeeeee"},shape:i=>{const r=t.length;if(r<3)return new Error("points length must >= 3");i.ctx.beginPath(),i.ctx.moveTo(t[0].x,t[0].y);let s=1;for(;s<r-2;s++){const a=(t[s].x+t[s+1].x)/2,o=(t[s].y+t[s+1].y)/2;i.ctx.quadraticCurveTo(t[s].x-this.x,t[s].y-this.y,a-this.x,o-this.y)}i.ctx.quadraticCurveTo(t[s].x-this.x,t[s].y-this.y,t[s+1].x-this.x,t[s+1].y-this.y),i.ctx.lineWidth>0&&i.ctx.stroke()}})}getBounds(){if(this.rotate===0){const t=Math.min(this.x,this.toX),e=Math.min(this.y,this.toY),i=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return new jn({x:t,y:e,width:i-t,height:r-e})}else{const t=Math.sin(this.rotate),e=Math.cos(this.rotate),i=e*this.x-t*this.y,r=e*this.toX-t*this.toY,s=e*this.y+t*this.x,a=e*this.toY+t*this.toX;return new jn({x:Math.min(i,r),y:Math.min(s,a),width:Math.max(i,r)-Math.min(i,r),height:Math.max(s,a)-Math.min(s,a)})}}}class T_ extends Fa{width;height;borderRadius;rect;constructor(t,e={x:0,y:0,width:50,height:50}){return super(t,e),this.width=e.width,this.height=e.height,this.borderRadius=e.borderRadius??0,this.rect=new jn({x:this.x,y:this.y,width:this.width,height:this.height}),new Proxy(this,{get:(r,s,a)=>Reflect.get(r,s,a),set:(r,s,a,o)=>{switch(s){case"x":case"y":case"width":case"height":this.rect[s]=a;break}return Reflect.set(r,s,a,o)}})}draw(t){this._draw({extra:t,init:e=>{e.ctx.lineWidth=1,e.ctx.fillStyle="#ff0000"},shape:e=>{e.ctx.beginPath(),this.borderRadius<=0?e.ctx.rect(0,0,this.width,this.height):(e.ctx.moveTo(0,0+this.borderRadius),e.ctx.lineTo(0,0+this.height-this.borderRadius),e.ctx.quadraticCurveTo(0,0+this.height,0+this.borderRadius,0+this.height),e.ctx.lineTo(0+this.width-this.borderRadius,0+this.height),e.ctx.quadraticCurveTo(0+this.width,0+this.height,0+this.width,0+this.height-this.borderRadius),e.ctx.lineTo(0+this.width,0+this.borderRadius),e.ctx.quadraticCurveTo(0+this.width,0,0+this.width-this.borderRadius,0),e.ctx.lineTo(0+this.borderRadius,0),e.ctx.quadraticCurveTo(0,0,0,0+this.borderRadius)),e.ctx.closePath(),e.ctx.fill(),e.ctx.lineWidth>0&&e.ctx.stroke()}})}getBounds(){return this.rect}}class Mf{x;y;z;brightness;constructor(t,e,i,r){this.x=t,this.y=e,this.z=i,this.brightness=r}setBrightness(t){this.brightness=Math.min(Math.max(t,0),1)}}class k_{x;y;width;height;rotation;showFlame;constructor(){this.x=0,this.y=0,this.width=25,this.height=20,this.rotation=0,this.showFlame=!1}draw(t,e){t.save(),t.translate(this.x,this.y),t.rotate(this.rotation),t.lineWidth=1,t.strokeStyle="#ffffff",e?.(t),t.beginPath(),t.moveTo(10,0),t.lineTo(-10,10),t.lineTo(-5,0),t.lineTo(-10,-10),t.lineTo(10,0),t.closePath(),t.stroke(),this.showFlame&&(t.beginPath(),t.moveTo(-7.5,-5),t.lineTo(-15,0),t.lineTo(-7.5,5),t.closePath(),t.stroke()),t.restore()}}class E_{x;y;scaleX;scaleY;color;alpha;lineWidth;branch;constructor(){this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.color="#ffffff",this.alpha=1,this.lineWidth=1,this.branch=[],this.branch[0]=-140-Math.random()*20,this.branch[1]=-30-Math.random()*30,this.branch[2]=Math.random()*80-40,this.branch[3]=-100-Math.random()*40,this.branch[4]=-60-Math.random()*40,this.branch[5]=Math.random()*60-30,this.branch[6]=-110-Math.random()*20}draw(t,e){t.save(),t.translate(this.x,this.y),t.scale(this.scaleX,this.scaleY),t.lineWidth=this.lineWidth,t.strokeStyle=Zo(this.color,this.alpha),e?.(t),t.beginPath(),t.moveTo(0,0),t.lineTo(0,this.branch[0]),t.moveTo(0,this.branch[1]),t.lineTo(this.branch[2],this.branch[3]),t.moveTo(0,this.branch[4]),t.lineTo(this.branch[5],this.branch[6]),t.stroke(),t.restore()}}class P_{x;y;z;fl;vpX;vpY;cX;cY;cZ;constructor(t,e,i){this.x=t,this.y=e,this.z=i,this.fl=250,this.vpX=0,this.vpY=0,this.cX=0,this.cY=0,this.cZ=0}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,i){this.cX=t,this.cY=e,this.cZ=i}rotateX(t){const e=Math.cos(t),i=Math.sin(t),r=this.y*e-this.z*i,s=this.z*e+this.y*i;this.y=r,this.z=s}rotateY(t){const e=Math.cos(t),i=Math.sin(t),r=this.x*e-this.z*i,s=this.z*e+this.x*i;this.x=r,this.z=s}rotateZ(t){const e=Math.cos(t),i=Math.sin(t),r=this.x*e-this.y*i,s=this.y*e+this.x*i;this.x=r,this.y=s}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}}class A_{pointA;pointB;pointC;color;lineWidth;alpha;constructor(t,e,i,r="#ff0000"){this.pointA=t,this.pointB=e,this.pointC=i,this.color=r,this.lineWidth=1,this.alpha=1}draw(t,e){this.isBackface()||(t.save(),t.lineWidth=this.lineWidth,t.fillStyle=t.strokeStyle=Zo(this.color,this.alpha),e?.(t),t.beginPath(),t.moveTo(this.pointA.getScreenX(),this.pointA.getScreenY()),t.lineTo(this.pointB.getScreenX(),this.pointB.getScreenY()),t.lineTo(this.pointC.getScreenX(),this.pointC.getScreenY()),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.restore())}getDepth(){return Math.min(this.pointA.z,this.pointB.z,this.pointC.z)}isBackface(){const t=this.pointC.getScreenX()-this.pointA.getScreenX(),e=this.pointC.getScreenY()-this.pointA.getScreenY(),i=this.pointB.getScreenX()-this.pointC.getScreenX(),r=this.pointB.getScreenY()-this.pointC.getScreenY();return t*r>e*i}}class M_{pointA;pointB;pointC;color;lineWidth;alpha;light;constructor(t,e,i,r="#ff0000"){this.pointA=t,this.pointB=e,this.pointC=i,this.color=r,this.lineWidth=1,this.alpha=1,this.light=new Mf(0,0,0,1)}draw(t,e){this.isBackface()||(t.save(),t.lineWidth=this.lineWidth,t.fillStyle=t.strokeStyle=this.getAdjustedColor(),e?.(t),t.beginPath(),t.moveTo(this.pointA.getScreenX(),this.pointA.getScreenY()),t.lineTo(this.pointB.getScreenX(),this.pointB.getScreenY()),t.lineTo(this.pointC.getScreenX(),this.pointC.getScreenY()),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.restore())}getDepth(){return Math.min(this.pointA.z,this.pointB.z,this.pointC.z)}isBackface(){const t=this.pointC.getScreenX()-this.pointA.getScreenX(),e=this.pointC.getScreenY()-this.pointA.getScreenY(),i=this.pointB.getScreenX()-this.pointC.getScreenX(),r=this.pointB.getScreenY()-this.pointC.getScreenY();return t*r>e*i}getAdjustedColor(){const t=ya(this.color);let e=t>>16,i=t>>8&255,r=t&255;const s=this.getLightFactor();return e*=s,i*=s,r*=s,Hc(e<<16|i<<8|r)}getLightFactor(){const t={x:this.pointA.x-this.pointB.x,y:this.pointA.y-this.pointB.y,z:this.pointA.z-this.pointB.z},e={x:this.pointB.x-this.pointC.x,y:this.pointB.y-this.pointC.y,z:this.pointB.z-this.pointC.z},i={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},r=i.x*this.light.x+i.y*this.light.y+i.z*this.light.z,s=Math.sqrt(i.x*i.x+i.y*i.y+i.z*i.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(r/(s*a))/Math.PI*this.light.brightness}}class R_{min;max;value;x;y;width;height;backColor;backBorderColor;backWidth;handleColor;handleBorderColor;handleHeight;handleY;onchange;prevCanvas;currentContext;animatedID=0;constructor(t=0,e=100,i=0,r){this.min=t,this.max=e,this.value=i,this.onchange=r,this.x=0,this.y=0,this.width=16,this.height=100,this.backColor="#cccccc",this.backBorderColor="#999999",this.backWidth=4,this.handleColor="#eeeeee",this.handleBorderColor="#cccccc",this.handleHeight=6,this.handleY=0,this.updatePosition()}draw(t,e){this.currentContext=t,t.save(),t.translate(this.x,this.y),e?.(t),t.clearRect(this.x,this.y,this.width,this.height),t.fillStyle=this.backColor,t.beginPath(),t.fillRect(this.width/2-this.backWidth/2,0,this.backWidth,this.height),t.closePath(),t.strokeStyle=this.handleBorderColor,t.fillStyle=this.handleColor,t.beginPath(),t.rect(0,this.handleY,this.width,this.handleHeight),t.closePath(),t.fill(),t.stroke(),t.restore(),(!this.prevCanvas||this.prevCanvas!=t.canvas)&&(this.captureMouse(t.canvas),this.prevCanvas=t.canvas)}updateValue(){const t=this.value,e=this.height-this.handleHeight,i=this.max-this.min;this.value=(e-this.handleY)/e*i+this.min,this.value!==t&&(this.onchange?.(this.value),Ko((r,s)=>{this.animatedID=s,this.currentContext&&this.draw(this.currentContext)}))}updatePosition(){const t=this.height-this.handleHeight,e=this.max-this.min;this.handleY=t-(this.value-this.min)/e*t}captureMouse(t){const e=new jn({x:0,y:0,width:0,height:0}),i=()=>{e.x=this.x,e.y=this.y+this.handleY,e.width=this.width,e.height=this.handleHeight};i();let r=!1;new Pr().captureMouse(t,{move:a=>{if(r){const o=a.y-this.y;this.handleY=Math.min(this.height-this.handleHeight,Math.max(o,0)),this.updateValue()}},start:a=>{r=e.isContainPoint(a)},end:a=>{i(),window.cancelAnimationFrame(this.animatedID)}})}}class D_{x;y;width;height;rotation;scaleX;scaleY;color;lineWidth;constructor(t,e,i="#ffffff"){this.x=0,this.y=0,this.width=t,this.height=e,this.rotation=0,this.scaleX=1,this.scaleY=1,this.color=i,this.lineWidth=1}draw(t,e){const i=this.height,r=this.width+i,s=i/2;t.save(),t.translate(this.x,this.y),t.rotate(this.rotation),t.scale(this.scaleX,this.scaleY),t.lineWidth=this.lineWidth,t.fillStyle=this.color,e?.(t),t.beginPath(),t.moveTo(0,-s),t.lineTo(r-2*s,-s),t.quadraticCurveTo(-s+r,-s,-s+r,0),t.lineTo(-s+r,i-2*s),t.quadraticCurveTo(-s+r,-s+i,r-2*s,-s+i),t.lineTo(0,-s+i),t.quadraticCurveTo(-s,-s+i,-s,i-2*s),t.lineTo(-s,0),t.quadraticCurveTo(-s,-s,0,-s),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.beginPath(),t.arc(0,0,2,0,Math.PI*2,!0),t.closePath(),t.stroke(),t.beginPath(),t.arc(this.width,0,2,0,Math.PI*2,!0),t.closePath(),t.stroke(),t.restore()}getPin(){return{x:this.x+Math.cos(this.rotation)*this.width,y:this.y+Math.sin(this.rotation)*this.width}}}class L_{R;r;O;constructor(t,e,i){this.R=t,this.r=e,this.O=i}draw(t,e){t.save(),e?.(t);let i=this.R-this.O,r=0,s=1;t.beginPath(),t.moveTo(i,r);let a,o;do{if(s>2e4)break;a=(this.R+this.r)*Math.cos(s*Math.PI/72)-(this.r+this.O)*Math.cos((this.R+this.r)/this.r*(s*Math.PI/72)),o=(this.R+this.r)*Math.sin(s*Math.PI/72)-(this.r+this.O)*Math.sin((this.R+this.r)/this.r*(s*Math.PI/72)),t.lineTo(a,o),i=a,r=o,s++}while(a!=this.R-this.O&&o!=0);t.stroke(),t.restore()}}class I_{r;constructor(t){this.r=t}draw(t,e){t.save(),e?.(t),t.beginPath(),t.moveTo(this.r,0);for(let i=0;i<9;i++)t.rotate(Math.PI/5),i%2==0?t.lineTo(this.r/.525731*.200811,0):t.lineTo(this.r,0);t.closePath(),t.fill(),t.restore()}}class O_{startX;startY;width;height;constructor(t,e,i,r){this.startX=t,this.startY=e,this.width=i,this.height=r}draw(t,e){t.save(),e?.(t);let i=0;const r=()=>{t.clearRect(this.startX,this.startY,this.width,this.height),t.setLineDash([4,2]),t.lineDashOffset=-i,t.strokeRect(this.startX,this.startY,this.width,this.height)};function s(){i++,i>16&&(i=0),r(),setTimeout(s,40)}s(),t.restore()}}class F_{constructor(){}draw(t,e){t.save(),e?.(t),t.beginPath(),t.arc(75,75,50,0,Math.PI*2,!0),t.moveTo(110,75),t.arc(75,75,35,0,Math.PI,!1),t.moveTo(65,65),t.arc(60,65,5,0,Math.PI*2,!0),t.moveTo(95,65),t.arc(90,65,5,0,Math.PI*2,!0),t.stroke(),t.restore()}}function Rf(n){switch(n){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}const N_={attributeName:["display"],values:[["block","block"]]},Me={easeName:"linear",begin:0,dur:300,repeatCount:1,direction:"normal",fill:"freeze",keyTimes:[0,1]};class G_{currentAnimateName;objects=[];actions=[];constructor(){}hasObjects(){return this.objects.length>0}fromDOM(t){return Array.isArray(t)||(t=[t]),this.objects=[],t.forEach(e=>{const i=Do(e);this.objects.push({width:parseFloat(i.css("width")),height:parseFloat(i.css("height")),dom:i,el:e,originCSSObject:i.css()})}),this}toCSS(t,...e){if(!this.hasObjects())return;switch(this.currentAnimateName=t,this[t](...e),this.objects[0].dom?.parent().css({position:"relative",perspective:"1000px",overflow:"hidden"}),t){default:this.objects.forEach((s,a)=>{s.dom?.css({position:"absolute","z-index":String(1e3+a),"transform-style":"preserve-3d","backface-visibility":"hidden"})});break}let i=0;const r=()=>{this.actions.forEach((s,a)=>{const o=this.objects[s.objectIndex];let h=[],l=[];Array.isArray(s.attributeName)?(h=s.attributeName,l=s.values):s.attributeName&&(h=[s.attributeName],l=[s.values]);const c=s.keyTimes.length,d=Ar(o.dom?.css("transform")??"");let f=s.begin;s.keyTimes.forEach((u,m)=>{const v={_matrix:d};h.forEach((b,S)=>{const E=l[S][s.direction=="reverse"?c-m-1:m];this._transformAttributeToCSSObjectUseMatrix(b,E,v)}),m==0?o.dom?.css(Object.assign(v,{transition:""})):(setTimeout(()=>{o.dom?.css(Object.assign(v,{transition:`all ${s.realKeyTimes[m]}ms cubic-bezier(${s.keySplines[m-1].join(",")})`}))},f),f+=s.realKeyTimes[m])}),setTimeout(()=>{s.fill==="remove"&&o.dom?.css(o.originCSSObject??{}),a==this.actions.length-1&&(typeof s.repeatCount=="number"&&++i<s.repeatCount||s.repeatCount=="infinite")&&requestAnimationFrame(()=>{this.currentAnimateName===t&&r()})},s.begin+s.dur)})};r()}_transformAttributeToCSSObjectUseMatrix(t,e,i={}){switch(t){case"translateTo":i._matrix.translateTo(e[0]??0,e[1]??0);break;case"translate":i._matrix.translate(e[0]??0,e[1]??0);break;case"rotate":i._matrix.rotate(e??0);break;case"rotateXTo":i._matrix.rotateXTo(e??0);break;case"rotateYTo":i._matrix.rotateYTo(e??0);break;case"scaleTo":typeof e=="number"?i._matrix.scaleTo(e??1):i._matrix.scaleTo(e[0]??1,e[1]??1);break;case"scale":typeof e=="number"?i._matrix.scale(e??1):i._matrix.scale(e[0]??1,e[1]??1);break;case"scaleX":i._matrix.scale(e??1,1);break;case"scaleY":i._matrix.scale(1,e??1);break;default:Object.assign(i,{[t]:`${e??""}`});break}return Object.assign(i,{transform:i._matrix.toString()}),i}_addAction(t,e=!1){return this.actions=e?[]:this.actions,Array.isArray(t)||(t=[t]),t.forEach(i=>{this.actions.push(Object.assign(i,{realKeyTimes:i.keyTimes.map(r=>i.dur*r)}))}),this}_addAnimate(t=N_,e=Me,i=0,r=!1){const s=e.keyTimes??[0,1],a=[];return s.forEach((o,h)=>{h>0&&a.push(Rf(e.easeName??"linear"))}),this._addAction({objectIndex:i,attributeName:t.attributeName,values:t.values,begin:e.begin??0,dur:e.dur??300,keyTimes:s,keySplines:a,repeatCount:e.repeatCount??1,direction:e.direction??"normal",fill:e.fill??"freeze"},r),this}_predefinedAnimate(t,e,i,r,s=Me,a=this.objects.length-1){let o=!0,h=!1,l=!1,c=!1;const d=this.objects.length;a=(a+d)%d;const f=(a-1+d)%d,u=(a+1+d)%d,m=this.objects[a],v=this.objects[f],b=this.objects[u];if(v&&f!==a){const S=t(v);S&&(this._addAnimate(S,s,f,o),o=!1,h=!0)}if(m){const S=e(m);S&&(this._addAnimate(S,s,a,o),o=!1,l=!0)}if(b&&u!==a){const S=i(b);S&&(this._addAnimate(S,s,u,o),o=!1,c=!0)}this.objects.forEach((S,E)=>{if(!(E==f&&h||E==a&&l||E==u&&c)){const _=r(S);_&&(this._addAnimate(_,s,E,o),o=!1)}})}flip(t=Me,e=this.objects.length-1){const i=e-1,r=this.objects[i],s=this.objects[e],a=Ar(s.dom?.css("transform")??""),o=a.clone();r.dom?.show(),r.dom?.css("opacity","1");const h=r.el?.getBoundingClientRect();r.dom?.css("opacity","0"),s.dom?.show(),s.dom?.css("opacity","1");const l=s.el?.getBoundingClientRect(),c=r.dom?.css("background-color"),d=s.dom?.css("background-color");o.translate((h?.left??0)-(l?.left??0),(h?.top??0)-(l?.top??0)),o.scale((h?.width??1)/(l?.width??1),(h?.height??1)/(l?.height??1));const f={transform:o.toString(),transition:""};c&&Object.assign(f,{"background-color":c}),s.dom?.css(f);const u={transform:a.toString(),transition:`all ${t.dur}ms cubic-bezier(${Rf(t.easeName??"linear").join(",")})`};d&&Object.assign(u,{"background-color":d}),setTimeout(()=>{s.dom?.css(u)},t.begin)}slideLeft(t=Me,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["translateTo"],values:[[[0,0],[-i.width,0]]]}),i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[i.width,0],[0,0]]]}),i=>{},i=>({attributeName:["translateTo"],values:[[[-i.width,0],[-i.width,0]]]}),t,e)}slideRight(t=Me,e=this.objects.length-1){this._predefinedAnimate(i=>{},i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[-i.width,0],[0,0]]]}),i=>({attributeName:["translateTo"],values:[[[0,0],[i.width,0]]]}),i=>({attributeName:["translateTo"],values:[[[i.width,0],[i.width,0]]]}),t,e)}slideDown(t=Me,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["translateTo"],values:[[[0,0],[0,i.height]]]}),i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,-i.height],[0,0]]]}),i=>{},i=>({attributeName:["translateTo"],values:[[[0,i.height],[0,i.height]]]}),t,e)}slideUp(t=Me,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["translateTo"],values:[[[0,0],[0,-i.height]]]}),i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,i.height],[0,0]]]}),i=>{},i=>({attributeName:["translateTo"],values:[[[0,-i.height],[0,-i.height]]]}),t,e)}flipLeft(t=Me,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,180]]}),i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[-180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}flipRight(t=Me,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,-180]]}),i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}flipDown(t=Me,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,-180]]}),i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}flipUp(t=Me,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,180]]}),i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[-180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}popIn(t=Me,e=this.objects.length-1){this._predefinedAnimate(i=>{},i=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[.8,1],[0,1]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}popOut(t=Me,e=this.objects.length-1){this._predefinedAnimate(i=>{},i=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[1,1.2],[1,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}rotate(t=Me,e=this.objects.length-1){Object.assign(t,{keyTimes:[0,1]});const i=t.degree??360;this._predefinedAnimate(r=>{},r=>({attributeName:["opacity","rotate"],values:[[1,1],[0,i]]}),r=>{},r=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}}class rs{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{const i=e.target;i instanceof HTMLVideoElement&&console.log(`${i.id} videoWidth: ${i.videoWidth}px, videoHeight: ${i.videoHeight}px.`)}),this.video.srcObject=t}static videoMediaChangeSupport=async()=>new Promise(t=>{const e=document.createElement("iframe"),i=document.createElement("video"),r=document.createElement("source"),s=new MediaSource;s.addEventListener("sourceopen",()=>t(!0)),r.src=URL.createObjectURL(s),r.media="(min-width:10px)",i.append(r),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(i),setTimeout(()=>{e.width="15"}),setTimeout(()=>{e.remove(),t(!1)},1e3)});static captureWebCameraPhoto(t,e){navigator.mediaDevices.getUserMedia({video:!0}).then(i=>{t.srcObject=i;const r=t.videoWidth,s=t.videoHeight,a=e.getContext("2d");e.width=r,e.height=s,a?.drawImage(t,0,0,r,s)})}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(()=>{rs.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 U_{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new rs(t),this.remoteVideoUtil=new rs(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(i=>{this.localVideoUtil.setSrcObject(i),t(i)}).catch(i=>{this.trace(`navigator.getUserMedia error: ${i}.`),e(i)})})}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(),i=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),i.length>0&&this.trace(`Using audio device: ${i[0].label}.`);const r=void 0,s=new RTCPeerConnection(r);this.localPeerConnection=s,this.trace("Created local peer connection object localPeerConnection."),s.addEventListener("icecandidate",this.handleConnection),s.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const a=new RTCPeerConnection(r);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."),s.addTrack(e[0],t),s.addTrack(i[0],t),this.trace("localPeerConnection createOffer start."),s.createOffer({offerToReceiveVideo:!0}).then(o=>this.createdOffer(o)).catch(o=>this.setSessionDescriptionError(o))}handleConnection(t){const e=t.target,i=t.candidate;if(e&&i){const r=new RTCIceCandidate(i),s=this.getOtherPeer(e);s&&(s.addIceCandidate(r).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
37
+ `)}}return{url:i,data:r,boundary:s}}function X0(n){return new Promise((t,e)=>{const{method:i="GET",url:r="",data:s="",headers:a={},responseType:o="json",timeout:l=3e4,boundary:c=""}=n;Object.assign(a,{Accept:"*/*"});const u=Ws();u.onreadystatechange=function(d){u.readyState===4&&(u.status===200?t(u.response):e(u.statusText))},u.ontimeout=function(){e(`${r} is timed out for ${l}ms.`)},u.addEventListener("error",function(d){e(d)},!1),u.addEventListener("progress",function(d){if(d.lengthComputable){const w=Math.round(d.loaded*100/d.total);n.progress?.(w)}},!1),u.addEventListener("load",function(d){n.load?.(d)},!1),u.addEventListener("loadstart",function(d){n.loadstart?.(d)},!1),u.addEventListener("loadend",function(d){n.loadend?.(d)},!1),u.addEventListener("abort",function(d){n.abort?.(d)},!1),u.timeout=l,u.responseType=o;const g=i.toUpperCase();function p(){for(const d in a)u.setRequestHeader(d,a[d]);c&&u.setRequestHeader("Content-Type","multipart/form-data; boundary="+c)}if(g==="GET"){let d="";typeof s=="string"?d=s:s instanceof FormData?d=ms(s):Nr(s)&&(d=yo(s)),u.open("GET",lr(r,d),!0),p(),u.send(null)}else g==="POST"?(u.open("POST",r,!0),p(),c?u.sendAsBinary(c+`\r
38
+ `+s+c+`--\r
39
+ `):u.send(JSON.stringify(s))):(u.open(g,r,!0),p(),u.send(JSON.stringify(s)))})}function Y0(n,t){const e=Ws();e.open("HEAD",n),e.filepath=n,e.callback=t,e.onload=function(){const i=parseFloat(window.localStorage.getItem("lm_"+this.filepath)??""),r=Date.parse(this.getResponseHeader("Last-Modified"));(isNaN(i)||r>i)&&(window.localStorage.setItem("lm_"+this.filepath,String(Date.now())),isFinite(i)&&this.callback(r,i))},e.send()}let br;const Jl=new WeakMap;function Js(n,t){let e=Jl.get(n);e||(e=new Map,Jl.set(n,e));let i=e.get(t);return i||(i=new Kl,e.set(t,i)),i}class Kl{subscribers;constructor(){this.subscribers=new Set}depend(){br&&this.subscribers.add(br)}notify(){this.subscribers.forEach(t=>t())}}function $0(n){br=n,n(),br=null}function q0(n){return Object.keys(n).forEach(t=>{let e=n[t];const i=Js(n,t);Object.defineProperty(n,t,{get(){return i.depend(),e},set(r){r!=e&&(e=r,i.notify())}})}),n}function Z0(n){return new Proxy(n,{get(t,e,i){return Js(n,e).depend(),Reflect.get(t,e,i)},set(t,e,i,r){const s=Js(n,e);return n[e]!=i&&(n[e]=i,s.notify()),Reflect.set(t,e,i,r)}})}class Cr{x;y;z;constructor(t=[0,0,0],e=[0,0,0]){const[i,r,s]=t,[a,o,l]=e;this.x=i-a,this.y=r-o,this.z=s-l}get length(){const{x:t,y:e,z:i}=this;return Math.sqrt(t*t+e*e+i*i)}unit(){const t=this.length;return new Cr([this.x/t,this.y/t,this.z/t])}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){const e=this.x,i=this.y,r=this.z,s=t.x,a=t.y,o=t.z;return new Cr([i*o-r*a,r*s-e*o,e*a-s*i])}}(function(){let n=0;window.requestAnimationFrame||(window.requestAnimationFrame=function(t){const e=new Date().getTime(),i=Math.max(0,16-(e-n)),r=window.setTimeout(function(){t(e+i)},i);return n=e+i,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})})();const Ql=n=>{let t=window.requestAnimationFrame(function e(i){t=window.requestAnimationFrame(e),n(i,t)});return()=>window.cancelAnimationFrame(t)};class W0{id=0;renders={};cancelFn;constructor(){}get length(){let t=0;for(let e in this.renders)t++;return t}register(t){const e=this.id++;this.renders[e]=t,this.run()}run(){this.cancelFn||(this.cancelFn=Ql((t,e)=>{const i=[];for(let r in this.renders)this.renders[r](t)===!1&&i.push(parseInt(r));for(let r of i)delete this.renders[r];this.length||this.stop()}))}stop(){this.cancelFn&&(this.cancelFn(),this.cancelFn=void 0)}}const Ks=new W0;let Fi;typeof self>"u"&&typeof process<"u"&&process.hrtime?Fi=function(){const n=process.hrtime();return n[0]*1e3+n[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?Fi=self.performance.now.bind(self.performance):Date.now!==void 0?Fi=Date.now:Fi=function(){return new Date().getTime()};const Zn=Fi;class Ui{static _nextId=0;static nextId(){return Ui._nextId++}}const Tr={Linear:{None:function(n){return n}},Ease:{In:function(n){return Math.pow(n,1.7)}},Quadratic:{In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}},Cubic:{In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}},Quartic:{In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}},Quintic:{In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}},Sinusoidal:{In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}},Exponential:{In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}},Circular:{In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}},Elastic:{In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}},Back:{In:function(n){return n===1?1:n*n*((1.70158+1)*n-1.70158)},Out:function(n){return n===0?0:--n*n*((1.70158+1)*n+1.70158)+1},InOut:function(n){const t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)}},Bounce:{In:function(n){return 1-Tr.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?Tr.Bounce.In(n*2)*.5:Tr.Bounce.Out(n*2-1)*.5+.5}},generatePow:function(n=4){return n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(t){return t**n},Out:function(t){return 1-(1-t)**n},InOut:function(t){return t<.5?(t*2)**n/2:(1-(2-t*2)**n)/2+.5}}},random:function(n){return Math.random()},createStep:function(n){return function(t){return Math.floor(t*n)/n}},createNoisyEasing:function(n,t=.1){const e=1-t;return function(i){return t*Math.random()+e*n(i)}}},Qs=Tr,Ni={Utils:{Linear:function(n,t,e){return(t-n)*e+n},Factorial:function(){const n=[1];return function(t){let e=1;if(n[t])return n[t];for(let i=t;i>1;i--)e*=i;return n[t]=e,e}}(),Bernstein:function(n,t){const e=Ni.Utils.Factorial;return e(n)/e(t)/e(n-t)},CatmullRom:function(n,t,e,i,r){const s=(e-n)*.5,a=(i-t)*.5,o=r*r,l=r*o;return(2*t-2*e+s+a)*l+(-3*t+3*e-2*s-a)*o+s*r+t}},Linear:function(n,t){const e=n.length-1,i=e*t,r=Math.floor(i),s=Ni.Utils.Linear;return t<0?s(n[0],n[1],i):t>1?s(n[e],n[e-1],e-i):s(n[r],n[r+1>e?e:r+1],i-r)},Bezier:function(n,t){let e=0;const i=n.length-1,r=Math.pow,s=Ni.Utils.Bernstein;for(let a=0;a<=i;a++)e+=r(1-t,i-a)*r(t,a)*n[a]*s(i,a);return e},CatmullRom:function(n,t){const e=n.length-1;let i=e*t,r=Math.floor(i);const s=Ni.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(r=Math.floor(i=e*(1+t))),s(n[(r-1+e)%e],n[r],n[(r+1)%e],n[(r+2)%e],i-r)):t<0?n[0]-(s(n[0],n[0],n[1],n[1],-i)-n[0]):t>1?n[e]-(s(n[e],n[e],n[e-1],n[e-1],i-e)-n[e]):s(n[r?r-1:0],n[r],n[e<r+1?e:r+1],n[e<r+2?e:r+2],i-r)}},ta=Ni;class tc{_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=Zn(),e=!1){let i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(let r=0;r<i.length;r++){const s=this._tweens[i[r]],a=!e;s&&s.update(t,a)===!1&&!e&&delete this._tweens[i[r]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0}}const _e=new tc;class J0{constructor(t,e=_e){this._object=t,this._group=e}_id=Ui.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=Qs.Linear.None;_interpolationFunction=ta.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=Zn()){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,i,r){for(const s in i){const a=t[s],o=Array.isArray(a),l=o?"array":typeof a,c=!o&&Array.isArray(i[s]);if(!(l==="undefined"||l==="function")){if(c){let u=i[s];if(u.length===0)continue;u=u.map(this._handleRelativeValue.bind(this,a)),i[s]=[a].concat(u)}if((l==="object"||o)&&a&&!c){e[s]=o?[]:{};for(const u in a)e[s][u]=a[u];r[s]=o?[]:{},this._setupProperties(a,e[s],i[s],r[s])}else typeof e[s]>"u"&&(e[s]=a),o||(e[s]*=1),c?r[s]=i[s].slice().reverse():r[s]=e[s]||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=Zn()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=Zn()){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=_e){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=Qs.Linear.None){return this._easingFunction=t,this}interpolation(t=ta.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=Zn(),e=!0){if(this._isPaused)return!0;let i,r;const s=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>s)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),r=(t-this._startTime)/this._durationTime,r=this._durationTime===0||r>1?1:r;const a=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),r===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];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,l=this._chainedTweens.length;o<l;o++)this._chainedTweens[o].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,i,r){for(const s in i){if(e[s]===void 0)continue;const a=e[s]||0;let o=i[s];const l=Array.isArray(t[s]),c=Array.isArray(o);!l&&c?t[s]=this._interpolationFunction(o,r):typeof o=="object"&&o?this._updateProperties(t[s],a,o,r):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[s]=a+(o-a)*r))}}_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],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=i,this._valuesEnd[t]=e}}const K0=J0,Q0=Ui.nextId,tp=_e.getAll.bind(_e),ep=_e.removeAll.bind(_e),np=_e.add.bind(_e),ip=_e.remove.bind(_e),rp=_e.update.bind(_e),ea={now:Zn,Sequence:Ui,Easing:Qs,Interpolation:ta,Group:tc,Tween:K0,nextId:Q0,getAll:tp,removeAll:ep,add:np,remove:ip,update:rp};function ec(n){switch(n){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}const sp={attributeName:["display"],values:[["block","block"]]},se={easeName:"linear",begin:0,dur:300,repeatCount:1,direction:"normal",fill:"freeze",keyTimes:[0,1]};class op{currentAnimateName;objects=[];actions=[];constructor(){}static toTween(t,e,i){const r=i?.onUpdate??(()=>{}),s=i?.duration??1e3,a=i?.delay??0,o=i?.easeFunction??ea.Easing.Linear.None,l=i?.repeat??0,c=i?.yoyo??!1,u=new ea.Tween(t).to(e,s).delay(a).easing(o).repeat(l).yoyo(c).onUpdate(function(g,p){r(g,p)});return i?.interpolationFunction&&u.interpolation(i.interpolationFunction),{tween:u,startAuto:()=>{u.start(),Ks.register(()=>u.update())}}}hasObjects(){return this.objects.length>0}fromDOM(t){return Array.isArray(t)||(t=[t]),this.objects=[],t.forEach(e=>{const i=us(e);this.objects.push({width:parseFloat(i.css("width")),height:parseFloat(i.css("height")),dom:i,el:e,originCSSObject:i.css()})}),this}toCSS(t,...e){if(!this.hasObjects())return;switch(this.currentAnimateName=t,this[t](...e),this.objects[0].dom?.parent().css({position:"relative",perspective:"1000px",overflow:"hidden"}),t){default:this.objects.forEach((s,a)=>{s.dom?.css({position:"absolute","z-index":String(1e3+a),"transform-style":"preserve-3d","backface-visibility":"hidden"})});break}let i=0;const r=()=>{this.actions.forEach((s,a)=>{const o=this.objects[s.objectIndex];let l=[],c=[];Array.isArray(s.attributeName)?(l=s.attributeName,c=s.values):s.attributeName&&(l=[s.attributeName],c=[s.values]);const u=s.keyTimes.length,g=ui(o.dom?.css("transform")??"");let p=s.begin;s.keyTimes.forEach((d,w)=>{const x={_matrix:g};l.forEach((C,A)=>{const P=c[A][s.direction=="reverse"?u-w-1:w];this._transformAttributeToCSSObjectUseMatrix(C,P,x)}),w==0?o.dom?.css(Object.assign(x,{transition:""})):(setTimeout(()=>{o.dom?.css(Object.assign(x,{transition:`all ${s.realKeyTimes[w]}ms cubic-bezier(${s.keySplines[w-1].join(",")})`}))},p),p+=s.realKeyTimes[w])}),setTimeout(()=>{s.fill==="remove"&&o.dom?.css(o.originCSSObject??{}),a==this.actions.length-1&&(typeof s.repeatCount=="number"&&++i<s.repeatCount||s.repeatCount=="infinite")&&requestAnimationFrame(()=>{this.currentAnimateName===t&&r()})},s.begin+s.dur)})};r()}_transformAttributeToCSSObjectUseMatrix(t,e,i={}){switch(t){case"translateTo":i._matrix.translateTo(e[0]??0,e[1]??0);break;case"translate":i._matrix.translate(e[0]??0,e[1]??0);break;case"rotate":i._matrix.rotate(e??0);break;case"rotateXTo":i._matrix.rotateXTo(e??0);break;case"rotateYTo":i._matrix.rotateYTo(e??0);break;case"scaleTo":typeof e=="number"?i._matrix.scaleTo(e??1):i._matrix.scaleTo(e[0]??1,e[1]??1);break;case"scale":typeof e=="number"?i._matrix.scale(e??1):i._matrix.scale(e[0]??1,e[1]??1);break;case"scaleX":i._matrix.scale(e??1,1);break;case"scaleY":i._matrix.scale(1,e??1);break;default:Object.assign(i,{[t]:`${e??""}`});break}return Object.assign(i,{transform:i._matrix.toString()}),i}_addAction(t,e=!1){return this.actions=e?[]:this.actions,Array.isArray(t)||(t=[t]),t.forEach(i=>{this.actions.push(Object.assign(i,{realKeyTimes:i.keyTimes.map(r=>i.dur*r)}))}),this}_addAnimate(t=sp,e=se,i=0,r=!1){const s=e.keyTimes??[0,1],a=[];return s.forEach((o,l)=>{l>0&&a.push(ec(e.easeName??"linear"))}),this._addAction({objectIndex:i,attributeName:t.attributeName,values:t.values,begin:e.begin??0,dur:e.dur??300,keyTimes:s,keySplines:a,repeatCount:e.repeatCount??1,direction:e.direction??"normal",fill:e.fill??"freeze"},r),this}_predefinedAnimate(t,e,i,r,s=se,a=this.objects.length-1){let o=!0,l=!1,c=!1,u=!1;const g=this.objects.length;a=(a+g)%g;const p=(a-1+g)%g,d=(a+1+g)%g,w=this.objects[a],x=this.objects[p],C=this.objects[d];if(x&&p!==a){const A=t(x);A&&(this._addAnimate(A,s,p,o),o=!1,l=!0)}if(w){const A=e(w);A&&(this._addAnimate(A,s,a,o),o=!1,c=!0)}if(C&&d!==a){const A=i(C);A&&(this._addAnimate(A,s,d,o),o=!1,u=!0)}this.objects.forEach((A,P)=>{if(!(P==p&&l||P==a&&c||P==d&&u)){const M=r(A);M&&(this._addAnimate(M,s,P,o),o=!1)}})}flip(t=se,e=this.objects.length-1){const i=e-1,r=this.objects[i],s=this.objects[e],a=ui(s.dom?.css("transform")??""),o=a.clone();r.dom?.show(),r.dom?.css("opacity","1");const l=r.el?.getBoundingClientRect();r.dom?.css("opacity","0"),s.dom?.show(),s.dom?.css("opacity","1");const c=s.el?.getBoundingClientRect(),u=r.dom?.css("background-color"),g=s.dom?.css("background-color");o.translate((l?.left??0)-(c?.left??0),(l?.top??0)-(c?.top??0)),o.scale((l?.width??1)/(c?.width??1),(l?.height??1)/(c?.height??1));const p={transform:o.toString(),transition:""};u&&Object.assign(p,{"background-color":u}),s.dom?.css(p);const d={transform:a.toString(),transition:`all ${t.dur}ms cubic-bezier(${ec(t.easeName??"linear").join(",")})`};g&&Object.assign(d,{"background-color":g}),setTimeout(()=>{s.dom?.css(d)},t.begin)}slideLeft(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["translateTo"],values:[[[0,0],[-i.width,0]]]}),i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[i.width,0],[0,0]]]}),i=>{},i=>({attributeName:["translateTo"],values:[[[-i.width,0],[-i.width,0]]]}),t,e)}slideRight(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>{},i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[-i.width,0],[0,0]]]}),i=>({attributeName:["translateTo"],values:[[[0,0],[i.width,0]]]}),i=>({attributeName:["translateTo"],values:[[[i.width,0],[i.width,0]]]}),t,e)}slideDown(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["translateTo"],values:[[[0,0],[0,i.height]]]}),i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,-i.height],[0,0]]]}),i=>{},i=>({attributeName:["translateTo"],values:[[[0,i.height],[0,i.height]]]}),t,e)}slideUp(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["translateTo"],values:[[[0,0],[0,-i.height]]]}),i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,i.height],[0,0]]]}),i=>{},i=>({attributeName:["translateTo"],values:[[[0,-i.height],[0,-i.height]]]}),t,e)}flipLeft(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,180]]}),i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[-180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}flipRight(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,-180]]}),i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}flipDown(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,-180]]}),i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}flipUp(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,180]]}),i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[-180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}popIn(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>{},i=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[.8,1],[0,1]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}popOut(t=se,e=this.objects.length-1){this._predefinedAnimate(i=>{},i=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[1,1.2],[1,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}rotate(t=se,e=this.objects.length-1){Object.assign(t,{keyTimes:[0,1]});const i=t.degree??360;this._predefinedAnimate(r=>{},r=>({attributeName:["opacity","rotate"],values:[[1,1],[0,i]]}),r=>{},r=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}}class Sr extends Ee{app;rotate;scale;isMouseDownInBounds=!1;constructor(t,e={x:0,y:0}){super(e),this.rotate=e.rotate??0,this.scale=e.scale??1,this.app=t,this.app.captureMove({start:i=>{this.isMouseDownInBounds=this.getBounds().isContainPoint(this.app.mousePoint)},end:i=>{this.isMouseDownInBounds=!1},move:i=>{this.isMouseDownInBounds&&(this.x=this.app.mousePoint.x,this.y=this.app.mousePoint.y)}})}drawShape(t){this.draw({extra:()=>{this.app.ctx&&t?.()},shape:()=>{this.app.ctx}})}draw({extra:t,shape:e}){this.app.ctx&&(this.app.ctx.save(),t?.(),this.app.ctx?.translate(this.x,this.y),this.app.ctx?.rotate(this.rotate),this.app.ctx?.scale(this.scale,this.scale),e(),this.app.ctx.lineWidth>0&&this.app.ctx.stroke(),this.app.ctx?.restore())}}class lp extends Sr{constructor(t,e={x:0,y:0}){super(t,e)}drawShape(t){super.draw({extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=2,this.app.ctx.fillStyle="#ffff00",t?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.moveTo(-50,-25),this.app.ctx.lineTo(0,-25),this.app.ctx.lineTo(0,-50),this.app.ctx.lineTo(50,0),this.app.ctx.lineTo(0,50),this.app.ctx.lineTo(0,25),this.app.ctx.lineTo(-50,25),this.app.ctx.lineTo(-50,-25),this.app.ctx.closePath(),this.app.ctx.fill())}})}}class cp extends Sr{radius;constructor(t,e={x:0,y:0,radius:40}){super(t,e),this.radius=e.radius}drawShape(t){super.draw({extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.fillStyle="#ff0000",t?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.arc(0,0,this.radius,0,Math.PI*2,!0),this.app.ctx.closePath(),this.app.ctx.fill())}})}}class hp extends Sr{toX;toY;c1x;c1y;c2x;c2y;constructor(t,e={x:0,y:0,toX:0,toY:0}){super(t,e),this.toX=e.toX,this.toY=e.toY,this.c1x=e.c1x??0,this.c1y=e.c1y??0,this.c2x=e.c2x??0,this.c2y=e.c2y??0}drawShape(t){super.draw({extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.strokeStyle="#eeeeee",t?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.moveTo(0,0),this.app.ctx.lineTo(this.toX-this.x,this.toY-this.y))}})}drawQuadratic(t){super.draw({extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.strokeStyle="#eeeeee",t?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.moveTo(0,0),this.app.ctx.quadraticCurveTo(this.c1x-this.x,this.c1y-this.y,this.toX-this.x,this.toY-this.y))}})}drawQuadraticThrough(t){super.draw({extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.strokeStyle="#eeeeee",t?.())},shape:()=>{if(!this.app.ctx)return;this.app.ctx.beginPath(),this.app.ctx.moveTo(0,0);const e=this.c1x*2-(this.x+this.toX)/2,i=this.c1y*2-(this.y+this.toY)/2;this.app.ctx.quadraticCurveTo(e-this.x,i-this.y,this.toX-this.x,this.toY-this.y)}})}drawQuadraticThroughCurve(t,e){super.draw({extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.strokeStyle="#eeeeee",e?.())},shape:()=>{if(!this.app.ctx)return;const i=t.length;if(i<3)return new Error("points length must >= 3");const r=(t[0].x+t[i-1].x)/2,s=(t[0].y+t[i-1].y)/2;this.app.ctx.beginPath(),this.app.ctx.moveTo(r,s);let a=0;for(;a<i-1;a++){const o=(t[a].x+t[a+1].x)/2,l=(t[a].y+t[a+1].y)/2;this.app.ctx.quadraticCurveTo(t[a].x-this.x,t[a].y-this.y,o-this.x,l-this.y)}this.app.ctx.quadraticCurveTo(t[a].x-this.x,t[a].y-this.y,r-this.x,s-this.y)}})}drawQuadraticThroughCurveNotGood(t,e){super.draw({extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.strokeStyle="#eeeeee",e?.())},shape:()=>{if(!this.app.ctx)return;const i=t.length;if(i<3)return new Error("points length must >= 3");this.app.ctx.beginPath(),this.app.ctx.moveTo(t[0].x,t[0].y);let r=1;for(;r<i-2;r++){const s=(t[r].x+t[r+1].x)/2,a=(t[r].y+t[r+1].y)/2;this.app.ctx.quadraticCurveTo(t[r].x-this.x,t[r].y-this.y,s-this.x,a-this.y)}this.app.ctx.quadraticCurveTo(t[r].x-this.x,t[r].y-this.y,t[r+1].x-this.x,t[r+1].y-this.y)}})}getBounds(){if(this.rotate===0){const t=Math.min(this.x,this.toX),e=Math.min(this.y,this.toY),i=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return new Nn({x:t,y:e,width:i-t,height:r-e})}else{const t=Math.sin(this.rotate),e=Math.cos(this.rotate),i=e*this.x-t*this.y,r=e*this.toX-t*this.toY,s=e*this.y+t*this.x,a=e*this.toY+t*this.toX;return new Nn({x:Math.min(i,r),y:Math.min(s,a),width:Math.max(i,r)-Math.min(i,r),height:Math.max(s,a)-Math.min(s,a)})}}}class fp extends Sr{width;height;borderRadius;rect;constructor(t,e={x:0,y:0,width:50,height:50}){return super(t,e),this.width=e.width,this.height=e.height,this.borderRadius=e.borderRadius??0,this.rect=new Nn({x:this.x,y:this.y,width:this.width,height:this.height}),new Proxy(this,{get:(r,s,a)=>Reflect.get(r,s,a),set:(r,s,a,o)=>{switch(s){case"x":case"y":case"width":case"height":this.rect[s]=a;break}return Reflect.set(r,s,a,o)}})}drawShape(t){super.draw({extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.fillStyle="#ff0000",t?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.borderRadius<=0?this.app.ctx.rect(0,0,this.width,this.height):(this.app.ctx.moveTo(0,0+this.borderRadius),this.app.ctx.lineTo(0,0+this.height-this.borderRadius),this.app.ctx.quadraticCurveTo(0,0+this.height,0+this.borderRadius,0+this.height),this.app.ctx.lineTo(0+this.width-this.borderRadius,0+this.height),this.app.ctx.quadraticCurveTo(0+this.width,0+this.height,0+this.width,0+this.height-this.borderRadius),this.app.ctx.lineTo(0+this.width,0+this.borderRadius),this.app.ctx.quadraticCurveTo(0+this.width,0,0+this.width-this.borderRadius,0),this.app.ctx.lineTo(0+this.borderRadius,0),this.app.ctx.quadraticCurveTo(0,0,0,0+this.borderRadius)),this.app.ctx.closePath(),this.app.ctx.fill())}})}getBounds(){return this.rect}}class nc{x;y;z;brightness;constructor(t,e,i,r){this.x=t,this.y=e,this.z=i,this.brightness=r}setBrightness(t){this.brightness=Math.min(Math.max(t,0),1)}}class up{x;y;width;height;rotation;showFlame;constructor(){this.x=0,this.y=0,this.width=25,this.height=20,this.rotation=0,this.showFlame=!1}draw(t,e){t.save(),t.translate(this.x,this.y),t.rotate(this.rotation),t.lineWidth=1,t.strokeStyle="#ffffff",e?.(t),t.beginPath(),t.moveTo(10,0),t.lineTo(-10,10),t.lineTo(-5,0),t.lineTo(-10,-10),t.lineTo(10,0),t.closePath(),t.stroke(),this.showFlame&&(t.beginPath(),t.moveTo(-7.5,-5),t.lineTo(-15,0),t.lineTo(-7.5,5),t.closePath(),t.stroke()),t.restore()}}class dp{x;y;scaleX;scaleY;color;alpha;lineWidth;branch;constructor(){this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.color="#ffffff",this.alpha=1,this.lineWidth=1,this.branch=[],this.branch[0]=-140-Math.random()*20,this.branch[1]=-30-Math.random()*30,this.branch[2]=Math.random()*80-40,this.branch[3]=-100-Math.random()*40,this.branch[4]=-60-Math.random()*40,this.branch[5]=Math.random()*60-30,this.branch[6]=-110-Math.random()*20}draw(t,e){t.save(),t.translate(this.x,this.y),t.scale(this.scaleX,this.scaleY),t.lineWidth=this.lineWidth,t.strokeStyle=ps(this.color,this.alpha),e?.(t),t.beginPath(),t.moveTo(0,0),t.lineTo(0,this.branch[0]),t.moveTo(0,this.branch[1]),t.lineTo(this.branch[2],this.branch[3]),t.moveTo(0,this.branch[4]),t.lineTo(this.branch[5],this.branch[6]),t.stroke(),t.restore()}}class pp{x;y;z;fl;vpX;vpY;cX;cY;cZ;constructor(t,e,i){this.x=t,this.y=e,this.z=i,this.fl=250,this.vpX=0,this.vpY=0,this.cX=0,this.cY=0,this.cZ=0}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,i){this.cX=t,this.cY=e,this.cZ=i}rotateX(t){const e=Math.cos(t),i=Math.sin(t),r=this.y*e-this.z*i,s=this.z*e+this.y*i;this.y=r,this.z=s}rotateY(t){const e=Math.cos(t),i=Math.sin(t),r=this.x*e-this.z*i,s=this.z*e+this.x*i;this.x=r,this.z=s}rotateZ(t){const e=Math.cos(t),i=Math.sin(t),r=this.x*e-this.y*i,s=this.y*e+this.x*i;this.x=r,this.y=s}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}}class gp{pointA;pointB;pointC;color;lineWidth;alpha;constructor(t,e,i,r="#ff0000"){this.pointA=t,this.pointB=e,this.pointC=i,this.color=r,this.lineWidth=1,this.alpha=1}draw(t,e){this.isBackface()||(t.save(),t.lineWidth=this.lineWidth,t.fillStyle=t.strokeStyle=ps(this.color,this.alpha),e?.(t),t.beginPath(),t.moveTo(this.pointA.getScreenX(),this.pointA.getScreenY()),t.lineTo(this.pointB.getScreenX(),this.pointB.getScreenY()),t.lineTo(this.pointC.getScreenX(),this.pointC.getScreenY()),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.restore())}getDepth(){return Math.min(this.pointA.z,this.pointB.z,this.pointC.z)}isBackface(){const t=this.pointC.getScreenX()-this.pointA.getScreenX(),e=this.pointC.getScreenY()-this.pointA.getScreenY(),i=this.pointB.getScreenX()-this.pointC.getScreenX(),r=this.pointB.getScreenY()-this.pointC.getScreenY();return t*r>e*i}}class mp{pointA;pointB;pointC;color;lineWidth;alpha;light;constructor(t,e,i,r="#ff0000"){this.pointA=t,this.pointB=e,this.pointC=i,this.color=r,this.lineWidth=1,this.alpha=1,this.light=new nc(0,0,0,1)}draw(t,e){this.isBackface()||(t.save(),t.lineWidth=this.lineWidth,t.fillStyle=t.strokeStyle=this.getAdjustedColor(),e?.(t),t.beginPath(),t.moveTo(this.pointA.getScreenX(),this.pointA.getScreenY()),t.lineTo(this.pointB.getScreenX(),this.pointB.getScreenY()),t.lineTo(this.pointC.getScreenX(),this.pointC.getScreenY()),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.restore())}getDepth(){return Math.min(this.pointA.z,this.pointB.z,this.pointC.z)}isBackface(){const t=this.pointC.getScreenX()-this.pointA.getScreenX(),e=this.pointC.getScreenY()-this.pointA.getScreenY(),i=this.pointB.getScreenX()-this.pointC.getScreenX(),r=this.pointB.getScreenY()-this.pointC.getScreenY();return t*r>e*i}getAdjustedColor(){const t=or(this.color);let e=t>>16,i=t>>8&255,r=t&255;const s=this.getLightFactor();return e*=s,i*=s,r*=s,go(e<<16|i<<8|r)}getLightFactor(){const t={x:this.pointA.x-this.pointB.x,y:this.pointA.y-this.pointB.y,z:this.pointA.z-this.pointB.z},e={x:this.pointB.x-this.pointC.x,y:this.pointB.y-this.pointC.y,z:this.pointB.z-this.pointC.z},i={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},r=i.x*this.light.x+i.y*this.light.y+i.z*this.light.z,s=Math.sqrt(i.x*i.x+i.y*i.y+i.z*i.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(r/(s*a))/Math.PI*this.light.brightness}}class vp{min;max;value;x;y;width;height;backColor;backBorderColor;backWidth;handleColor;handleBorderColor;handleHeight;handleY;onchange;prevCanvas;currentContext;animatedID=0;constructor(t=0,e=100,i=0,r){this.min=t,this.max=e,this.value=i,this.onchange=r,this.x=0,this.y=0,this.width=16,this.height=100,this.backColor="#cccccc",this.backBorderColor="#999999",this.backWidth=4,this.handleColor="#eeeeee",this.handleBorderColor="#cccccc",this.handleHeight=6,this.handleY=0,this.updatePosition()}draw(t,e){this.currentContext=t,t.save(),t.translate(this.x,this.y),e?.(t),t.clearRect(this.x,this.y,this.width,this.height),t.fillStyle=this.backColor,t.beginPath(),t.fillRect(this.width/2-this.backWidth/2,0,this.backWidth,this.height),t.closePath(),t.strokeStyle=this.handleBorderColor,t.fillStyle=this.handleColor,t.beginPath(),t.rect(0,this.handleY,this.width,this.handleHeight),t.closePath(),t.fill(),t.stroke(),t.restore(),(!this.prevCanvas||this.prevCanvas!=t.canvas)&&(this.captureMouse(t.canvas),this.prevCanvas=t.canvas)}updateValue(){const t=this.value,e=this.height-this.handleHeight,i=this.max-this.min;this.value=(e-this.handleY)/e*i+this.min,this.value!==t&&(this.onchange?.(this.value),Ks.register(()=>this.currentContext?(this.draw(this.currentContext),!0):!1))}updatePosition(){const t=this.height-this.handleHeight,e=this.max-this.min;this.handleY=t-(this.value-this.min)/e*t}captureMouse(t){const e=new Nn({x:0,y:0,width:0,height:0}),i=()=>{e.x=this.x,e.y=this.y+this.handleY,e.width=this.width,e.height=this.handleHeight};i();let r=!1;const s=new po(t);s.captureMove({move:()=>{if(r){const a=s.mousePoint.y-this.y;this.handleY=Math.min(this.height-this.handleHeight,Math.max(a,0)),this.updateValue()}},start:()=>{r=e.isContainPoint(s.mousePoint)},end:()=>{i()}})}}class _p{x;y;width;height;rotation;scaleX;scaleY;color;lineWidth;constructor(t,e,i="#ffffff"){this.x=0,this.y=0,this.width=t,this.height=e,this.rotation=0,this.scaleX=1,this.scaleY=1,this.color=i,this.lineWidth=1}draw(t,e){const i=this.height,r=this.width+i,s=i/2;t.save(),t.translate(this.x,this.y),t.rotate(this.rotation),t.scale(this.scaleX,this.scaleY),t.lineWidth=this.lineWidth,t.fillStyle=this.color,e?.(t),t.beginPath(),t.moveTo(0,-s),t.lineTo(r-2*s,-s),t.quadraticCurveTo(-s+r,-s,-s+r,0),t.lineTo(-s+r,i-2*s),t.quadraticCurveTo(-s+r,-s+i,r-2*s,-s+i),t.lineTo(0,-s+i),t.quadraticCurveTo(-s,-s+i,-s,i-2*s),t.lineTo(-s,0),t.quadraticCurveTo(-s,-s,0,-s),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.beginPath(),t.arc(0,0,2,0,Math.PI*2,!0),t.closePath(),t.stroke(),t.beginPath(),t.arc(this.width,0,2,0,Math.PI*2,!0),t.closePath(),t.stroke(),t.restore()}getPin(){return{x:this.x+Math.cos(this.rotation)*this.width,y:this.y+Math.sin(this.rotation)*this.width}}}class yp{R;r;O;constructor(t,e,i){this.R=t,this.r=e,this.O=i}draw(t,e){t.save(),e?.(t);let i=this.R-this.O,r=0,s=1;t.beginPath(),t.moveTo(i,r);let a,o;do{if(s>2e4)break;a=(this.R+this.r)*Math.cos(s*Math.PI/72)-(this.r+this.O)*Math.cos((this.R+this.r)/this.r*(s*Math.PI/72)),o=(this.R+this.r)*Math.sin(s*Math.PI/72)-(this.r+this.O)*Math.sin((this.R+this.r)/this.r*(s*Math.PI/72)),t.lineTo(a,o),i=a,r=o,s++}while(a!=this.R-this.O&&o!=0);t.stroke(),t.restore()}}class wp{r;constructor(t){this.r=t}draw(t,e){t.save(),e?.(t),t.beginPath(),t.moveTo(this.r,0);for(let i=0;i<9;i++)t.rotate(Math.PI/5),i%2==0?t.lineTo(this.r/.525731*.200811,0):t.lineTo(this.r,0);t.closePath(),t.fill(),t.restore()}}class xp{startX;startY;width;height;constructor(t,e,i,r){this.startX=t,this.startY=e,this.width=i,this.height=r}draw(t,e){t.save(),e?.(t);let i=0;const r=()=>{t.clearRect(this.startX,this.startY,this.width,this.height),t.setLineDash([4,2]),t.lineDashOffset=-i,t.strokeRect(this.startX,this.startY,this.width,this.height)};function s(){i++,i>16&&(i=0),r(),setTimeout(s,40)}s(),t.restore()}}class bp{constructor(){}draw(t,e){t.save(),e?.(t),t.beginPath(),t.arc(75,75,50,0,Math.PI*2,!0),t.moveTo(110,75),t.arc(75,75,35,0,Math.PI,!1),t.moveTo(65,65),t.arc(60,65,5,0,Math.PI*2,!0),t.moveTo(95,65),t.arc(90,65,5,0,Math.PI*2,!0),t.stroke(),t.restore()}}class zi{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{const i=e.target;i instanceof HTMLVideoElement&&console.log(`${i.id} videoWidth: ${i.videoWidth}px, videoHeight: ${i.videoHeight}px.`)}),this.video.srcObject=t}static videoMediaChangeSupport=async()=>new Promise(t=>{const e=document.createElement("iframe"),i=document.createElement("video"),r=document.createElement("source"),s=new MediaSource;s.addEventListener("sourceopen",()=>t(!0)),r.src=URL.createObjectURL(s),r.media="(min-width:10px)",i.append(r),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(i),setTimeout(()=>{e.width="15"}),setTimeout(()=>{e.remove(),t(!1)},1e3)});static captureWebCameraPhoto(t,e){navigator.mediaDevices.getUserMedia({video:!0}).then(i=>{t.srcObject=i;const r=t.videoWidth,s=t.videoHeight,a=e.getContext("2d");e.width=r,e.height=s,a?.drawImage(t,0,0,r,s)})}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(()=>{zi.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 Cp{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new zi(t),this.remoteVideoUtil=new zi(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(i=>{this.localVideoUtil.setSrcObject(i),t(i)}).catch(i=>{this.trace(`navigator.getUserMedia error: ${i}.`),e(i)})})}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(),i=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),i.length>0&&this.trace(`Using audio device: ${i[0].label}.`);const r=void 0,s=new RTCPeerConnection(r);this.localPeerConnection=s,this.trace("Created local peer connection object localPeerConnection."),s.addEventListener("icecandidate",this.handleConnection),s.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const a=new RTCPeerConnection(r);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."),s.addTrack(e[0],t),s.addTrack(i[0],t),this.trace("localPeerConnection createOffer start."),s.createOffer({offerToReceiveVideo:!0}).then(o=>this.createdOffer(o)).catch(o=>this.setSessionDescriptionError(o))}handleConnection(t){const e=t.target,i=t.candidate;if(e&&i){const r=new RTCIceCandidate(i),s=this.getOtherPeer(e);s&&(s.addIceCandidate(r).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
40
40
  ${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:
41
41
  ${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:
42
42
  ${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:
43
- ${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 i=this.getPeerName(t);this.trace(`${i} ${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 i=document.createElement("div");i.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(i)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class B_{canvas;gl;constructor(t){this.canvas=t;const e={alpha:!0,premultipliedAlpha:!1};if(this.gl=this.canvas.getContext("webgl",e),!this.gl)throw new Error("WebGL failed to initialize.")}}function Df(n,t){return!n||n.parentElement===null?t:Df(n.parentElement,t.concat([n]))}const Nh=function(n,t){return getComputedStyle(n,null).getPropertyValue(t)},z_=function(n){return Nh(n,"overflow")+Nh(n,"overflow-y")+Nh(n,"overflow-x")},$_=function(n){return/(auto|scroll)/.test(z_(n))};function V_(n){if(!(n instanceof HTMLElement||n instanceof SVGElement))return;const t=Df(n.parentElement,[]);for(let e=0;e<t.length;e+=1)if($_(t[e]))return t[e];return document.scrollingElement||document.documentElement}var Gh={exports:{}},ss={},Uh={},Bh={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n._registerNode=n.Konva=n.glob=void 0;const t=Math.PI/180;function e(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}n.glob=typeof xo<"u"?xo:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},n.Konva={_global:n.glob,version:"9.2.2",isBrowser:e(),isUnminified:/param/.test(function(r){}.toString()),dblClickWindow:400,getAngle(r){return n.Konva.angleDeg?r*t:r},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return n.Konva.DD.isDragging},isDragReady(){return!!n.Konva.DD.node},releaseCanvasOnDestroy:!0,document:n.glob.document,_injectGlobal(r){n.glob.Konva=r}};const i=r=>{n.Konva[r.prototype.getClassName()]=r};n._registerNode=i,n.Konva._injectGlobal(n.Konva)})(Bh);const Nt=St(xt({__proto__:null,default:Pe(Bh)},[Bh]));var zh={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Util=n.Transform=void 0;const t=Nt;class e{constructor(x=[1,0,0,1,0,0]){this.dirty=!1,this.m=x&&x.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new e(this.m)}copyInto(x){x.m[0]=this.m[0],x.m[1]=this.m[1],x.m[2]=this.m[2],x.m[3]=this.m[3],x.m[4]=this.m[4],x.m[5]=this.m[5]}point(x){var P=this.m;return{x:P[0]*x.x+P[2]*x.y+P[4],y:P[1]*x.x+P[3]*x.y+P[5]}}translate(x,P){return this.m[4]+=this.m[0]*x+this.m[2]*P,this.m[5]+=this.m[1]*x+this.m[3]*P,this}scale(x,P){return this.m[0]*=x,this.m[1]*=x,this.m[2]*=P,this.m[3]*=P,this}rotate(x){var P=Math.cos(x),R=Math.sin(x),F=this.m[0]*P+this.m[2]*R,L=this.m[1]*P+this.m[3]*R,$=this.m[0]*-R+this.m[2]*P,U=this.m[1]*-R+this.m[3]*P;return this.m[0]=F,this.m[1]=L,this.m[2]=$,this.m[3]=U,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(x,P){var R=this.m[0]+this.m[2]*P,F=this.m[1]+this.m[3]*P,L=this.m[2]+this.m[0]*x,$=this.m[3]+this.m[1]*x;return this.m[0]=R,this.m[1]=F,this.m[2]=L,this.m[3]=$,this}multiply(x){var P=this.m[0]*x.m[0]+this.m[2]*x.m[1],R=this.m[1]*x.m[0]+this.m[3]*x.m[1],F=this.m[0]*x.m[2]+this.m[2]*x.m[3],L=this.m[1]*x.m[2]+this.m[3]*x.m[3],$=this.m[0]*x.m[4]+this.m[2]*x.m[5]+this.m[4],U=this.m[1]*x.m[4]+this.m[3]*x.m[5]+this.m[5];return this.m[0]=P,this.m[1]=R,this.m[2]=F,this.m[3]=L,this.m[4]=$,this.m[5]=U,this}invert(){var x=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),P=this.m[3]*x,R=-this.m[1]*x,F=-this.m[2]*x,L=this.m[0]*x,$=x*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),U=x*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=P,this.m[1]=R,this.m[2]=F,this.m[3]=L,this.m[4]=$,this.m[5]=U,this}getMatrix(){return this.m}decompose(){var x=this.m[0],P=this.m[1],R=this.m[2],F=this.m[3],L=this.m[4],$=this.m[5],U=x*F-P*R;let z={x:L,y:$,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(x!=0||P!=0){var q=Math.sqrt(x*x+P*P);z.rotation=P>0?Math.acos(x/q):-Math.acos(x/q),z.scaleX=q,z.scaleY=U/q,z.skewX=(x*R+P*F)/U,z.skewY=0}else if(R!=0||F!=0){var K=Math.sqrt(R*R+F*F);z.rotation=Math.PI/2-(F>0?Math.acos(-R/K):-Math.acos(R/K)),z.scaleX=U/K,z.scaleY=K,z.skewX=0,z.skewY=(x*R+P*F)/U}return z.rotation=n.Util._getRotation(z.rotation),z}}n.Transform=e;var i="[object Array]",r="[object Number]",s="[object String]",a="[object Boolean]",o=Math.PI/180,h=180/Math.PI,l="#",c="",d="0",f="Konva warning: ",u="Konva error: ",m="rgb(",v={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},b=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,S=[];const E=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(_){setTimeout(_,60)};n.Util={_isElement(_){return!!(_&&_.nodeType==1)},_isFunction(_){return!!(_&&_.constructor&&_.call&&_.apply)},_isPlainObject(_){return!!_&&_.constructor===Object},_isArray(_){return Object.prototype.toString.call(_)===i},_isNumber(_){return Object.prototype.toString.call(_)===r&&!isNaN(_)&&isFinite(_)},_isString(_){return Object.prototype.toString.call(_)===s},_isBoolean(_){return Object.prototype.toString.call(_)===a},isObject(_){return _ instanceof Object},isValidSelector(_){if(typeof _!="string")return!1;var x=_[0];return x==="#"||x==="."||x===x.toUpperCase()},_sign(_){return _===0||_>0?1:-1},requestAnimFrame(_){S.push(_),S.length===1&&E(function(){const x=S;S=[],x.forEach(function(P){P()})})},createCanvasElement(){var _=document.createElement("canvas");try{_.style=_.style||{}}catch{}return _},createImageElement(){return document.createElement("img")},_isInDocument(_){for(;_=_.parentNode;)if(_==document)return!0;return!1},_urlToImage(_,x){var P=n.Util.createImageElement();P.onload=function(){x(P)},P.src=_},_rgbToHex(_,x,P){return(16777216+(_<<16)+(x<<8)+P).toString(16).slice(1)},_hexToRgb(_){_=_.replace(l,c);var x=parseInt(_,16);return{r:x>>16&255,g:x>>8&255,b:x&255}},getRandomColor(){for(var _=(Math.random()*16777215<<0).toString(16);_.length<6;)_=d+_;return l+_},getRGB(_){var x;return _ in v?(x=v[_],{r:x[0],g:x[1],b:x[2]}):_[0]===l?this._hexToRgb(_.substring(1)):_.substr(0,4)===m?(x=b.exec(_.replace(/ /g,"")),{r:parseInt(x[1],10),g:parseInt(x[2],10),b:parseInt(x[3],10)}):{r:0,g:0,b:0}},colorToRGBA(_){return _=_||"black",n.Util._namedColorToRBA(_)||n.Util._hex3ColorToRGBA(_)||n.Util._hex4ColorToRGBA(_)||n.Util._hex6ColorToRGBA(_)||n.Util._hex8ColorToRGBA(_)||n.Util._rgbColorToRGBA(_)||n.Util._rgbaColorToRGBA(_)||n.Util._hslColorToRGBA(_)},_namedColorToRBA(_){var x=v[_.toLowerCase()];return x?{r:x[0],g:x[1],b:x[2],a:1}:null},_rgbColorToRGBA(_){if(_.indexOf("rgb(")===0){_=_.match(/rgb\(([^)]+)\)/)[1];var x=_.split(/ *, */).map(Number);return{r:x[0],g:x[1],b:x[2],a:1}}},_rgbaColorToRGBA(_){if(_.indexOf("rgba(")===0){_=_.match(/rgba\(([^)]+)\)/)[1];var x=_.split(/ *, */).map((P,R)=>P.slice(-1)==="%"?R===3?parseInt(P)/100:parseInt(P)/100*255:Number(P));return{r:x[0],g:x[1],b:x[2],a:x[3]}}},_hex8ColorToRGBA(_){if(_[0]==="#"&&_.length===9)return{r:parseInt(_.slice(1,3),16),g:parseInt(_.slice(3,5),16),b:parseInt(_.slice(5,7),16),a:parseInt(_.slice(7,9),16)/255}},_hex6ColorToRGBA(_){if(_[0]==="#"&&_.length===7)return{r:parseInt(_.slice(1,3),16),g:parseInt(_.slice(3,5),16),b:parseInt(_.slice(5,7),16),a:1}},_hex4ColorToRGBA(_){if(_[0]==="#"&&_.length===5)return{r:parseInt(_[1]+_[1],16),g:parseInt(_[2]+_[2],16),b:parseInt(_[3]+_[3],16),a:parseInt(_[4]+_[4],16)/255}},_hex3ColorToRGBA(_){if(_[0]==="#"&&_.length===4)return{r:parseInt(_[1]+_[1],16),g:parseInt(_[2]+_[2],16),b:parseInt(_[3]+_[3],16),a:1}},_hslColorToRGBA(_){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(_)){const[x,...P]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(_),R=Number(P[0])/360,F=Number(P[1])/100,L=Number(P[2])/100;let $,U,z;if(F===0)return z=L*255,{r:Math.round(z),g:Math.round(z),b:Math.round(z),a:1};L<.5?$=L*(1+F):$=L+F-L*F;const q=2*L-$,K=[0,0,0];for(let Z=0;Z<3;Z++)U=R+.3333333333333333*-(Z-1),U<0&&U++,U>1&&U--,6*U<1?z=q+($-q)*6*U:2*U<1?z=$:3*U<2?z=q+($-q)*(.6666666666666666-U)*6:z=q,K[Z]=z*255;return{r:Math.round(K[0]),g:Math.round(K[1]),b:Math.round(K[2]),a:1}}},haveIntersection(_,x){return!(x.x>_.x+_.width||x.x+x.width<_.x||x.y>_.y+_.height||x.y+x.height<_.y)},cloneObject(_){var x={};for(var P in _)this._isPlainObject(_[P])?x[P]=this.cloneObject(_[P]):this._isArray(_[P])?x[P]=this.cloneArray(_[P]):x[P]=_[P];return x},cloneArray(_){return _.slice(0)},degToRad(_){return _*o},radToDeg(_){return _*h},_degToRad(_){return n.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),n.Util.degToRad(_)},_radToDeg(_){return n.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),n.Util.radToDeg(_)},_getRotation(_){return t.Konva.angleDeg?n.Util.radToDeg(_):_},_capitalize(_){return _.charAt(0).toUpperCase()+_.slice(1)},throw(_){throw new Error(u+_)},error(_){console.error(u+_)},warn(_){t.Konva.showWarnings&&console.warn(f+_)},each(_,x){for(var P in _)x(P,_[P])},_inRange(_,x,P){return x<=_&&_<P},_getProjectionToSegment(_,x,P,R,F,L){var $,U,z,q=(_-P)*(_-P)+(x-R)*(x-R);if(q==0)$=_,U=x,z=(F-P)*(F-P)+(L-R)*(L-R);else{var K=((F-_)*(P-_)+(L-x)*(R-x))/q;K<0?($=_,U=x,z=(_-F)*(_-F)+(x-L)*(x-L)):K>1?($=P,U=R,z=(P-F)*(P-F)+(R-L)*(R-L)):($=_+K*(P-_),U=x+K*(R-x),z=($-F)*($-F)+(U-L)*(U-L))}return[$,U,z]},_getProjectionToLine(_,x,P){var R=n.Util.cloneObject(_),F=Number.MAX_VALUE;return x.forEach(function(L,$){if(!(!P&&$===x.length-1)){var U=x[($+1)%x.length],z=n.Util._getProjectionToSegment(L.x,L.y,U.x,U.y,_.x,_.y),q=z[0],K=z[1],Z=z[2];Z<F&&(R.x=q,R.y=K,F=Z)}}),R},_prepareArrayForTween(_,x,P){var R,F=[],L=[];if(_.length>x.length){var $=x;x=_,_=$}for(R=0;R<_.length;R+=2)F.push({x:_[R],y:_[R+1]});for(R=0;R<x.length;R+=2)L.push({x:x[R],y:x[R+1]});var U=[];return L.forEach(function(z){var q=n.Util._getProjectionToLine(z,F,P);U.push(q.x),U.push(q.y)}),U},_prepareToStringify(_){var x;_.visitedByCircularReferenceRemoval=!0;for(var P in _)if(_.hasOwnProperty(P)&&_[P]&&typeof _[P]=="object"){if(x=Object.getOwnPropertyDescriptor(_,P),_[P].visitedByCircularReferenceRemoval||n.Util._isElement(_[P]))if(x.configurable)delete _[P];else return null;else if(n.Util._prepareToStringify(_[P])===null)if(x.configurable)delete _[P];else return null}return delete _.visitedByCircularReferenceRemoval,_},_assign(_,x){for(var P in x)_[P]=x[P];return _},_getFirstPointerId(_){return _.touches?_.changedTouches[0].identifier:_.pointerId||999},releaseCanvas(..._){t.Konva.releaseCanvasOnDestroy&&_.forEach(x=>{x.width=0,x.height=0})},drawRoundedRectPath(_,x,P,R){let F=0,L=0,$=0,U=0;typeof R=="number"?F=L=$=U=Math.min(R,x/2,P/2):(F=Math.min(R[0]||0,x/2,P/2),L=Math.min(R[1]||0,x/2,P/2),U=Math.min(R[2]||0,x/2,P/2),$=Math.min(R[3]||0,x/2,P/2)),_.moveTo(F,0),_.lineTo(x-L,0),_.arc(x-L,L,L,Math.PI*3/2,0,!1),_.lineTo(x,P-U),_.arc(x-U,P-U,U,0,Math.PI/2,!1),_.lineTo($,P),_.arc($,P-$,$,Math.PI/2,Math.PI,!1),_.lineTo(0,F),_.arc(F,F,F,Math.PI,Math.PI*3/2,!1)}}})(zh);const re=St(xt({__proto__:null,default:Pe(zh)},[zh]));var as={},$h={},te={};Object.defineProperty(te,"__esModule",{value:!0});var Lf=te.getComponentValidator=Vf=te.getBooleanValidator=$f=te.getNumberArrayValidator=zf=te.getFunctionValidator=Bf=te.getStringOrGradientValidator=Uf=te.getStringValidator=Gf=te.getNumberOrAutoValidator=Nf=te.getNumberOrArrayOfNumbersValidator=Ff=te.getNumberValidator=Of=te.alphaComponent=If=te.RGBComponent=void 0;const xi=Nt,se=re;function Si(n){return se.Util._isString(n)?'"'+n+'"':Object.prototype.toString.call(n)==="[object Number]"||se.Util._isBoolean(n)?n:Object.prototype.toString.call(n)}function H_(n){return n>255?255:n<0?0:Math.round(n)}var If=te.RGBComponent=H_;function j_(n){return n>1?1:n<1e-4?1e-4:n}var Of=te.alphaComponent=j_;function X_(){if(xi.Konva.isUnminified)return function(n,t){return se.Util._isNumber(n)||se.Util.warn(Si(n)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),n}}var Ff=te.getNumberValidator=X_;function Y_(n){if(xi.Konva.isUnminified)return function(t,e){let i=se.Util._isNumber(t),r=se.Util._isArray(t)&&t.length==n;return!i&&!r&&se.Util.warn(Si(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or Array<number>('+n+")"),t}}var Nf=te.getNumberOrArrayOfNumbersValidator=Y_;function q_(){if(xi.Konva.isUnminified)return function(n,t){var e=se.Util._isNumber(n),i=n==="auto";return e||i||se.Util.warn(Si(n)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),n}}var Gf=te.getNumberOrAutoValidator=q_;function W_(){if(xi.Konva.isUnminified)return function(n,t){return se.Util._isString(n)||se.Util.warn(Si(n)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),n}}var Uf=te.getStringValidator=W_;function K_(){if(xi.Konva.isUnminified)return function(n,t){const e=se.Util._isString(n),i=Object.prototype.toString.call(n)==="[object CanvasGradient]"||n&&n.addColorStop;return e||i||se.Util.warn(Si(n)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),n}}var Bf=te.getStringOrGradientValidator=K_;function Z_(){if(xi.Konva.isUnminified)return function(n,t){return se.Util._isFunction(n)||se.Util.warn(Si(n)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),n}}var zf=te.getFunctionValidator=Z_;function J_(){if(xi.Konva.isUnminified)return function(n,t){const e=Int8Array?Object.getPrototypeOf(Int8Array):null;return e&&n instanceof e||(se.Util._isArray(n)?n.forEach(function(i){se.Util._isNumber(i)||se.Util.warn('"'+t+'" attribute has non numeric element '+i+". Make sure that all elements are numbers.")}):se.Util.warn(Si(n)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),n}}var $f=te.getNumberArrayValidator=J_;function Q_(){if(xi.Konva.isUnminified)return function(n,t){var e=n===!0||n===!1;return e||se.Util.warn(Si(n)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),n}}var Vf=te.getBooleanValidator=Q_;function t5(n){if(xi.Konva.isUnminified)return function(t,e){return t==null||se.Util.isObject(t)||se.Util.warn(Si(t)+' is a not valid value for "'+e+'" attribute. The value should be an object with properties '+n),t}}Lf=te.getComponentValidator=t5;const Gt=St(xt({__proto__:null,get RGBComponent(){return If},get alphaComponent(){return Of},default:te,get getBooleanValidator(){return Vf},get getComponentValidator(){return Lf},get getFunctionValidator(){return zf},get getNumberArrayValidator(){return $f},get getNumberOrArrayOfNumbersValidator(){return Nf},get getNumberOrAutoValidator(){return Gf},get getNumberValidator(){return Ff},get getStringOrGradientValidator(){return Bf},get getStringValidator(){return Uf}},[te]));(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Factory=void 0;const t=re,e=Gt;var i="get",r="set";n.Factory={addGetterSetter(s,a,o,h,l){n.Factory.addGetter(s,a,o),n.Factory.addSetter(s,a,h,l),n.Factory.addOverloadedGetterSetter(s,a)},addGetter(s,a,o){var h=i+t.Util._capitalize(a);s.prototype[h]=s.prototype[h]||function(){var l=this.attrs[a];return l===void 0?o:l}},addSetter(s,a,o,h){var l=r+t.Util._capitalize(a);s.prototype[l]||n.Factory.overWriteSetter(s,a,o,h)},overWriteSetter(s,a,o,h){var l=r+t.Util._capitalize(a);s.prototype[l]=function(c){return o&&c!==void 0&&c!==null&&(c=o.call(this,c,a)),this._setAttr(a,c),h&&h.call(this),this}},addComponentsGetterSetter(s,a,o,h,l){var c=o.length,d=t.Util._capitalize,f=i+d(a),u=r+d(a),m,v;s.prototype[f]=function(){var S={};for(m=0;m<c;m++)v=o[m],S[v]=this.getAttr(a+d(v));return S};var b=(0,e.getComponentValidator)(o);s.prototype[u]=function(S){var E=this.attrs[a],_;h&&(S=h.call(this,S)),b&&b.call(this,S,a);for(_ in S)S.hasOwnProperty(_)&&this._setAttr(a+d(_),S[_]);return S||o.forEach(x=>{this._setAttr(a+d(x),void 0)}),this._fireChangeEvent(a,E,S),l&&l.call(this),this},n.Factory.addOverloadedGetterSetter(s,a)},addOverloadedGetterSetter(s,a){var o=t.Util._capitalize(a),h=r+o,l=i+o;s.prototype[a]=function(){return arguments.length?(this[h](arguments[0]),this):this[l]()}},addDeprecatedGetterSetter(s,a,o,h){t.Util.error("Adding deprecated "+a);var l=i+t.Util._capitalize(a),c=a+" property is deprecated and will be removed soon. Look at Konva change log for more information.";s.prototype[l]=function(){t.Util.error(c);var d=this.attrs[a];return d===void 0?o:d},n.Factory.addSetter(s,a,h,function(){t.Util.error(c)}),n.Factory.addOverloadedGetterSetter(s,a)},backCompat(s,a){t.Util.each(a,function(o,h){var l=s.prototype[h],c=i+t.Util._capitalize(o),d=r+t.Util._capitalize(o);function f(){l.apply(this,arguments),t.Util.error('"'+o+'" method is deprecated and will be removed soon. Use ""'+h+'" instead.')}s.prototype[o]=f,s.prototype[c]=f,s.prototype[d]=f})},afterSetFilter(){this._filterUpToDate=!1}}})($h);const Ft=St(xt({__proto__:null,default:Pe($h)},[$h]));var Ci={},Ti={};Object.defineProperty(Ti,"__esModule",{value:!0});var Hf=Ti.HitContext=Wf=Ti.SceneContext=qf=Ti.Context=void 0;const jf=re,e5=Nt;function i5(n){var t=[],e=n.length,i=jf.Util,r,s;for(r=0;r<e;r++)s=n[r],i._isNumber(s)?s=Math.round(s*1e3)/1e3:i._isString(s)||(s=s+""),t.push(s);return t}var Xf=",",n5="(",r5=")",s5="([",a5="])",o5=";",h5="()",l5="=",Yf=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],c5=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const u5=100;class Na{constructor(t){this.canvas=t,e5.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,e){var i=this.traceArr,r=i.length,s="",a,o,h,l;for(a=0;a<r;a++)o=i[a],h=o.method,h?(l=o.args,s+=h,t?s+=h5:jf.Util._isArray(l[0])?s+=s5+l.join(Xf)+a5:(e&&(l=l.map(c=>typeof c=="number"?Math.floor(c):c)),s+=n5+l.join(Xf)+r5)):(s+=o.property,t||(s+=l5+o.val)),s+=o5;return s}clearTrace(){this.traceArr=[]}_trace(t){var e=this.traceArr,i;e.push(t),i=e.length,i>=u5&&e.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var e=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,e.getWidth()/e.pixelRatio,e.getHeight()/e.pixelRatio)}_applyLineCap(t){const e=t.attrs.lineCap;e&&this.setAttr("lineCap",e)}_applyOpacity(t){var e=t.getAbsoluteOpacity();e!==1&&this.setAttr("globalAlpha",e)}_applyLineJoin(t){const e=t.attrs.lineJoin;e&&this.setAttr("lineJoin",e)}setAttr(t,e){this._context[t]=e}arc(t,e,i,r,s,a){this._context.arc(t,e,i,r,s,a)}arcTo(t,e,i,r,s){this._context.arcTo(t,e,i,r,s)}beginPath(){this._context.beginPath()}bezierCurveTo(t,e,i,r,s,a){this._context.bezierCurveTo(t,e,i,r,s,a)}clearRect(t,e,i,r){this._context.clearRect(t,e,i,r)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,e){var i=arguments;if(i.length===2)return this._context.createImageData(t,e);if(i.length===1)return this._context.createImageData(t)}createLinearGradient(t,e,i,r){return this._context.createLinearGradient(t,e,i,r)}createPattern(t,e){return this._context.createPattern(t,e)}createRadialGradient(t,e,i,r,s,a){return this._context.createRadialGradient(t,e,i,r,s,a)}drawImage(t,e,i,r,s,a,o,h,l){var c=arguments,d=this._context;c.length===3?d.drawImage(t,e,i):c.length===5?d.drawImage(t,e,i,r,s):c.length===9&&d.drawImage(t,e,i,r,s,a,o,h,l)}ellipse(t,e,i,r,s,a,o,h){this._context.ellipse(t,e,i,r,s,a,o,h)}isPointInPath(t,e,i,r){return i?this._context.isPointInPath(i,t,e,r):this._context.isPointInPath(t,e,r)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,e,i,r){this._context.fillRect(t,e,i,r)}strokeRect(t,e,i,r){this._context.strokeRect(t,e,i,r)}fillText(t,e,i,r){r?this._context.fillText(t,e,i,r):this._context.fillText(t,e,i)}measureText(t){return this._context.measureText(t)}getImageData(t,e,i,r){return this._context.getImageData(t,e,i,r)}lineTo(t,e){this._context.lineTo(t,e)}moveTo(t,e){this._context.moveTo(t,e)}rect(t,e,i,r){this._context.rect(t,e,i,r)}putImageData(t,e,i){this._context.putImageData(t,e,i)}quadraticCurveTo(t,e,i,r){this._context.quadraticCurveTo(t,e,i,r)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,e){this._context.scale(t,e)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,e,i,r,s,a){this._context.setTransform(t,e,i,r,s,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,e,i,r){this._context.strokeText(t,e,i,r)}transform(t,e,i,r,s,a){this._context.transform(t,e,i,r,s,a)}translate(t,e){this._context.translate(t,e)}_enableTrace(){var t=this,e=Yf.length,i=this.setAttr,r,s,a=function(o){var h=t[o],l;t[o]=function(){return s=i5(Array.prototype.slice.call(arguments,0)),l=h.apply(t,arguments),t._trace({method:o,args:s}),l}};for(r=0;r<e;r++)a(Yf[r]);t.setAttr=function(){i.apply(t,arguments);var o=arguments[0],h=arguments[1];(o==="shadowOffsetX"||o==="shadowOffsetY"||o==="shadowBlur")&&(h=h/this.canvas.getPixelRatio()),t._trace({property:o,val:h})}}_applyGlobalCompositeOperation(t){const e=t.attrs.globalCompositeOperation;var i=!e||e==="source-over";i||this.setAttr("globalCompositeOperation",e)}}var qf=Ti.Context=Na;c5.forEach(function(n){Object.defineProperty(Na.prototype,n,{get(){return this._context[n]},set(t){this._context[n]=t}})});class f5 extends Na{constructor(t,{willReadFrequently:e=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:e})}_fillColor(t){var e=t.fill();this.setAttr("fillStyle",e),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var e=t._getLinearGradient();e&&(this.setAttr("fillStyle",e),t._fillFunc(this))}_fillRadialGradient(t){const e=t._getRadialGradient();e&&(this.setAttr("fillStyle",e),t._fillFunc(this))}_fill(t){const e=t.fill(),i=t.getFillPriority();if(e&&i==="color"){this._fillColor(t);return}const r=t.getFillPatternImage();if(r&&i==="pattern"){this._fillPattern(t);return}const s=t.getFillLinearGradientColorStops();if(s&&i==="linear-gradient"){this._fillLinearGradient(t);return}const a=t.getFillRadialGradientColorStops();if(a&&i==="radial-gradient"){this._fillRadialGradient(t);return}e?this._fillColor(t):r?this._fillPattern(t):s?this._fillLinearGradient(t):a&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const e=t.getStrokeLinearGradientStartPoint(),i=t.getStrokeLinearGradientEndPoint(),r=t.getStrokeLinearGradientColorStops(),s=this.createLinearGradient(e.x,e.y,i.x,i.y);if(r){for(var a=0;a<r.length;a+=2)s.addColorStop(r[a],r[a+1]);this.setAttr("strokeStyle",s)}}_stroke(t){var e=t.dash(),i=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!i){this.save();var r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(t),e&&t.dashEnabled()&&(this.setLineDash(e),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var s=t.getStrokeLinearGradientColorStops();s?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),i||this.restore()}}_applyShadow(t){var e,i,r,s=(e=t.getShadowRGBA())!==null&&e!==void 0?e:"black",a=(i=t.getShadowBlur())!==null&&i!==void 0?i:5,o=(r=t.getShadowOffset())!==null&&r!==void 0?r:{x:0,y:0},h=t.getAbsoluteScale(),l=this.canvas.getPixelRatio(),c=h.x*l,d=h.y*l;this.setAttr("shadowColor",s),this.setAttr("shadowBlur",a*Math.min(Math.abs(c),Math.abs(d))),this.setAttr("shadowOffsetX",o.x*c),this.setAttr("shadowOffsetY",o.y*d)}}var Wf=Ti.SceneContext=f5;class d5 extends Na{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const s=t.getStrokeScaleEnabled();if(!s){this.save();var e=this.getCanvas().getPixelRatio();this.setTransform(e,0,0,e,0,0)}this._applyLineCap(t);var i=t.hitStrokeWidth(),r=i==="auto"?t.strokeWidth():i;this.setAttr("lineWidth",r),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),s||this.restore()}}}Hf=Ti.HitContext=d5;const Kf=St(xt({__proto__:null,get Context(){return qf},get HitContext(){return Hf},get SceneContext(){return Wf},default:Ti},[Ti]));Object.defineProperty(Ci,"__esModule",{value:!0});var Zf=Ci.HitCanvas=ed=Ci.SceneCanvas=td=Ci.Canvas=void 0;const Ga=re,Jf=Kf,Qf=Nt,g5=Ft,p5=Gt;var Ua;function m5(){if(Ua)return Ua;var n=Ga.Util.createCanvasElement(),t=n.getContext("2d");return Ua=function(){var e=Qf.Konva._global.devicePixelRatio||1,i=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return e/i}(),Ga.Util.releaseCanvas(n),Ua}class Ba{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var e=t||{},i=e.pixelRatio||Qf.Konva.pixelRatio||m5();this.pixelRatio=i,this._canvas=Ga.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){var e=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/e,this.getHeight()/e)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";var e=this.pixelRatio,i=this.getContext()._context;i.scale(e,e)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";var e=this.pixelRatio,i=this.getContext()._context;i.scale(e,e)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,e){this.setWidth(t||0),this.setHeight(e||0)}toDataURL(t,e){try{return this._canvas.toDataURL(t,e)}catch{try{return this._canvas.toDataURL()}catch(r){return Ga.Util.error("Unable to get data URL. "+r.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}var td=Ci.Canvas=Ba;g5.Factory.addGetterSetter(Ba,"pixelRatio",void 0,(0,p5.getNumberValidator)());class v5 extends Ba{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new Jf.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}var ed=Ci.SceneCanvas=v5;class _5 extends Ba{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new Jf.HitContext(this),this.setSize(t.width,t.height)}}Zf=Ci.HitCanvas=_5;const za=St(xt({__proto__:null,get Canvas(){return td},get HitCanvas(){return Zf},get SceneCanvas(){return ed},default:Ci},[Ci]));var Vh={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.DD=void 0;const t=Nt,e=re;n.DD={get isDragging(){var i=!1;return n.DD._dragElements.forEach(r=>{r.dragStatus==="dragging"&&(i=!0)}),i},justDragged:!1,get node(){var i;return n.DD._dragElements.forEach(r=>{i=r.node}),i},_dragElements:new Map,_drag(i){const r=[];n.DD._dragElements.forEach((s,a)=>{const{node:o}=s,h=o.getStage();h.setPointersPositions(i),s.pointerId===void 0&&(s.pointerId=e.Util._getFirstPointerId(i));const l=h._changedPointerPositions.find(f=>f.id===s.pointerId);if(l){if(s.dragStatus!=="dragging"){var c=o.dragDistance(),d=Math.max(Math.abs(l.x-s.startPointerPos.x),Math.abs(l.y-s.startPointerPos.y));if(d<c||(o.startDrag({evt:i}),!o.isDragging()))return}o._setDragPosition(i,s),r.push(o)}}),r.forEach(s=>{s.fire("dragmove",{type:"dragmove",target:s,evt:i},!0)})},_endDragBefore(i){const r=[];n.DD._dragElements.forEach(s=>{const{node:a}=s,o=a.getStage();if(i&&o.setPointersPositions(i),!o._changedPointerPositions.find(c=>c.id===s.pointerId))return;(s.dragStatus==="dragging"||s.dragStatus==="stopped")&&(n.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,s.dragStatus="stopped");const l=s.node.getLayer()||s.node instanceof t.Konva.Stage&&s.node;l&&r.indexOf(l)===-1&&r.push(l)}),r.forEach(s=>{s.draw()})},_endDragAfter(i){n.DD._dragElements.forEach((r,s)=>{r.dragStatus==="stopped"&&r.node.fire("dragend",{type:"dragend",target:r.node,evt:i},!0),r.dragStatus!=="dragging"&&n.DD._dragElements.delete(s)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",n.DD._endDragBefore,!0),window.addEventListener("touchend",n.DD._endDragBefore,!0),window.addEventListener("mousemove",n.DD._drag),window.addEventListener("touchmove",n.DD._drag),window.addEventListener("mouseup",n.DD._endDragAfter,!1),window.addEventListener("touchend",n.DD._endDragAfter,!1))})(Vh);const Hh=St(xt({__proto__:null,default:Pe(Vh)},[Vh]));Object.defineProperty(as,"__esModule",{value:!0});var id=as.Node=void 0;const Ut=re,os=Ft,$a=za,Tn=Nt,Xe=Hh,he=Gt;var Va="absoluteOpacity",Ha="allEventListeners",ki="absoluteTransform",nd="absoluteScale",kn="canvas",y5="Change",w5="children",b5="konva",jh="listening",rd="mouseenter",sd="mouseleave",ad="set",od="Shape",ja=" ",hd="stage",Zi="transform",x5="Stage",Xh="visible",S5=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(ja);let C5=1,Lt=class Rl{constructor(t){this._id=C5++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===Zi||t===ki)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,e){var i=this._cache.get(t),r=t===Zi||t===ki,s=i===void 0||r&&i.dirty===!0;return s&&(i=e.call(this),this._cache.set(t,i)),i}_calculate(t,e,i){if(!this._attachedDepsListeners.get(t)){const r=e.map(s=>s+"Change.konva").join(ja);this.on(r,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,i)}_getCanvasCache(){return this._cache.get(kn)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===ki&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(kn)){const{scene:t,filter:e,hit:i}=this._cache.get(kn);Ut.Util.releaseCanvas(t,e,i),this._cache.delete(kn)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var e=t||{},i={};(e.x===void 0||e.y===void 0||e.width===void 0||e.height===void 0)&&(i=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));var r=Math.ceil(e.width||i.width),s=Math.ceil(e.height||i.height),a=e.pixelRatio,o=e.x===void 0?Math.floor(i.x):e.x,h=e.y===void 0?Math.floor(i.y):e.y,l=e.offset||0,c=e.drawBorder||!1,d=e.hitCanvasPixelRatio||1;if(!r||!s){Ut.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}r+=l*2+1,s+=l*2+1,o-=l,h-=l;var f=new $a.SceneCanvas({pixelRatio:a,width:r,height:s}),u=new $a.SceneCanvas({pixelRatio:a,width:0,height:0,willReadFrequently:!0}),m=new $a.HitCanvas({pixelRatio:d,width:r,height:s}),v=f.getContext(),b=m.getContext();return m.isCache=!0,f.isCache=!0,this._cache.delete(kn),this._filterUpToDate=!1,e.imageSmoothingEnabled===!1&&(f.getContext()._context.imageSmoothingEnabled=!1,u.getContext()._context.imageSmoothingEnabled=!1),v.save(),b.save(),v.translate(-o,-h),b.translate(-o,-h),this._isUnderCache=!0,this._clearSelfAndDescendantCache(Va),this._clearSelfAndDescendantCache(nd),this.drawScene(f,this),this.drawHit(m,this),this._isUnderCache=!1,v.restore(),b.restore(),c&&(v.save(),v.beginPath(),v.rect(0,0,r,s),v.closePath(),v.setAttr("strokeStyle","red"),v.setAttr("lineWidth",5),v.stroke(),v.restore()),this._cache.set(kn,{scene:f,filter:u,hit:m,x:o,y:h}),this._requestDraw(),this}isCached(){return this._cache.has(kn)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,e){var i=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],r=1/0,s=1/0,a=-1/0,o=-1/0,h=this.getAbsoluteTransform(e);return i.forEach(function(l){var c=h.point(l);r===void 0&&(r=a=c.x,s=o=c.y),r=Math.min(r,c.x),s=Math.min(s,c.y),a=Math.max(a,c.x),o=Math.max(o,c.y)}),{x:r,y:s,width:a-r,height:o-s}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const e=this._getCanvasCache();t.translate(e.x,e.y);var i=this._getCachedSceneCanvas(),r=i.pixelRatio;t.drawImage(i._canvas,0,0,i.width/r,i.height/r),t.restore()}_drawCachedHitCanvas(t){var e=this._getCanvasCache(),i=e.hit;t.save(),t.translate(e.x,e.y),t.drawImage(i._canvas,0,0,i.width/i.pixelRatio,i.height/i.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),e=this._getCanvasCache(),i=e.scene,r=e.filter,s=r.getContext(),a,o,h,l;if(t){if(!this._filterUpToDate){var c=i.pixelRatio;r.setSize(i.width/i.pixelRatio,i.height/i.pixelRatio);try{for(a=t.length,s.clear(),s.drawImage(i._canvas,0,0,i.getWidth()/c,i.getHeight()/c),o=s.getImageData(0,0,r.getWidth(),r.getHeight()),h=0;h<a;h++){if(l=t[h],typeof l!="function"){Ut.Util.error("Filter should be type of function, but got "+typeof l+" instead. Please check correct filters");continue}l.call(this,o),s.putImageData(o,0,0)}}catch(d){Ut.Util.error("Unable to apply filter. "+d.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return r}return i}on(t,e){if(this._cache&&this._cache.delete(Ha),arguments.length===3)return this._delegate.apply(this,arguments);var i=t.split(ja),r=i.length,s,a,o,h,l;for(s=0;s<r;s++)a=i[s],o=a.split("."),h=o[0],l=o[1]||"",this.eventListeners[h]||(this.eventListeners[h]=[]),this.eventListeners[h].push({name:l,handler:e});return this}off(t,e){var i=(t||"").split(ja),r=i.length,s,a,o,h,l,c;if(this._cache&&this._cache.delete(Ha),!t)for(a in this.eventListeners)this._off(a);for(s=0;s<r;s++)if(o=i[s],h=o.split("."),l=h[0],c=h[1],l)this.eventListeners[l]&&this._off(l,c,e);else for(a in this.eventListeners)this._off(a,c,e);return this}dispatchEvent(t){var e={target:this,type:t.type,evt:t};return this.fire(t.type,e),this}addEventListener(t,e){return this.on(t,function(i){e.call(this,i.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,e,i){var r=this;this.on(t,function(s){for(var a=s.target.findAncestors(e,!0,r),o=0;o<a.length;o++)s=Ut.Util.cloneObject(s),s.currentTarget=a[o],i.call(a[o],s)})}remove(){return this.isDragging()&&this.stopDrag(),Xe.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(ki),this._clearSelfAndDescendantCache(Va),this._clearSelfAndDescendantCache(nd),this._clearSelfAndDescendantCache(hd),this._clearSelfAndDescendantCache(Xh),this._clearSelfAndDescendantCache(jh)}_remove(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){var e="get"+Ut.Util._capitalize(t);return Ut.Util._isFunction(this[e])?this[e]():this.attrs[t]}getAncestors(){for(var t=this.getParent(),e=[];t;)e.push(t),t=t.getParent();return e}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{var e,i;if(!t)return this;for(e in t)e!==w5&&(i=ad+Ut.Util._capitalize(e),Ut.Util._isFunction(this[i])?this[i](t[e]):this._setAttr(e,t[e]))}),this}isListening(){return this._getCache(jh,this._isListening)}_isListening(t){if(!this.listening())return!1;const i=this.getParent();return i&&i!==t&&this!==t?i._isListening(t):!0}isVisible(){return this._getCache(Xh,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const i=this.getParent();return i&&i!==t&&this!==t?i._isVisible(t):!0}shouldDrawHit(t,e=!1){if(t)return this._isVisible(t)&&this._isListening(t);var i=this.getLayer(),r=!1;Xe.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===i)&&(r=!0)});var s=!e&&!Tn.Konva.hitOnDragEnabled&&r;return this.isListening()&&this.isVisible()&&!s}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),e=this,i=0,r,s,a,o;function h(c){for(r=[],s=c.length,a=0;a<s;a++)o=c[a],i++,o.nodeType!==od&&(r=r.concat(o.getChildren().slice())),o._id===e._id&&(a=s);r.length>0&&r[0].getDepth()<=t&&h(r)}const l=this.getStage();return e.nodeType!==x5&&l&&h(l.getChildren()),i}getDepth(){for(var t=0,e=this.parent;e;)t++,e=e.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(Zi),this._clearSelfAndDescendantCache(ki)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const t=this.getStage();if(!t)return null;var e=t.getPointerPosition();if(!e)return null;var i=this.getAbsoluteTransform().copy();return i.invert(),i.point(e)}getAbsolutePosition(t){let e=!1,i=this.parent;for(;i;){if(i.isCached()){e=!0;break}i=i.parent}e&&!t&&(t=!0);var r=this.getAbsoluteTransform(t).getMatrix(),s=new Ut.Transform,a=this.offset();return s.m=r.slice(),s.translate(a.x,a.y),s.getTranslation()}setAbsolutePosition(t){const{x:e,y:i,...r}=this._clearTransform();this.attrs.x=e,this.attrs.y=i,this._clearCache(Zi);var s=this._getAbsoluteTransform().copy();return s.invert(),s.translate(t.x,t.y),t={x:this.attrs.x+s.getTranslation().x,y:this.attrs.y+s.getTranslation().y},this._setTransform(r),this.setPosition({x:t.x,y:t.y}),this._clearCache(Zi),this._clearSelfAndDescendantCache(ki),this}_setTransform(t){var e;for(e in t)this.attrs[e]=t[e]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var e=t.x,i=t.y,r=this.x(),s=this.y();return e!==void 0&&(r+=e),i!==void 0&&(s+=i),this.setPosition({x:r,y:s}),this}_eachAncestorReverse(t,e){var i=[],r=this.getParent(),s,a;if(!(e&&e._id===this._id)){for(i.unshift(this);r&&(!e||r._id!==e._id);)i.unshift(r),r=r.parent;for(s=i.length,a=0;a<s;a++)t(i[a])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return Ut.Util.warn("Node has no parent. moveToTop function is ignored."),!1;var t=this.index,e=this.parent.getChildren().length;return t<e-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return Ut.Util.warn("Node has no parent. moveUp function is ignored."),!1;var t=this.index,e=this.parent.getChildren().length;return t<e-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return Ut.Util.warn("Node has no parent. moveDown function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return Ut.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return Ut.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&Ut.Util.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var e=this.index;return this.parent.children.splice(e,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(Va,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),e=this.getParent();return e&&!e._isUnderCache&&(t*=e.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},e=this.getAttrs(),i,r,s,a,o;t.attrs={};for(i in e)r=e[i],o=Ut.Util.isObject(r)&&!Ut.Util._isPlainObject(r)&&!Ut.Util._isArray(r),!o&&(s=typeof this[i]=="function"&&this[i],delete e[i],a=s?s.call(this):null,e[i]=r,a!==r&&(t.attrs[i]=r));return t.className=this.getClassName(),Ut.Util._prepareToStringify(t)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,e,i){var r=[];e&&this._isMatch(t)&&r.push(this);for(var s=this.parent;s;){if(s===i)return r;s._isMatch(t)&&r.push(s),s=s.parent}return r}isAncestorOf(t){return!1}findAncestor(t,e,i){return this.findAncestors(t,e,i)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var e=t.replace(/ /g,"").split(","),i=e.length,r,s;for(r=0;r<i;r++)if(s=e[r],Ut.Util.isValidSelector(s)||(Ut.Util.warn('Selector "'+s+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),Ut.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),Ut.Util.warn("Konva is awesome, right?")),s.charAt(0)==="#"){if(this.id()===s.slice(1))return!0}else if(s.charAt(0)==="."){if(this.hasName(s.slice(1)))return!0}else if(this.className===s||this.nodeType===s)return!0;return!1}getLayer(){var t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(hd,this._getStage)}_getStage(){var t=this.getParent();return t?t.getStage():null}fire(t,e={},i){return e.target=e.target||this,i?this._fireAndBubble(t,e):this._fire(t,e),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(ki,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var e;if(t)return e=new Ut.Transform,this._eachAncestorReverse(function(r){var s=r.transformsEnabled();s==="all"?e.multiply(r.getTransform()):s==="position"&&e.translate(r.x()-r.offsetX(),r.y()-r.offsetY())},t),e;e=this._cache.get(ki)||new Ut.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(e):e.reset();var i=this.transformsEnabled();if(i==="all")e.multiply(this.getTransform());else if(i==="position"){const r=this.attrs.x||0,s=this.attrs.y||0,a=this.attrs.offsetX||0,o=this.attrs.offsetY||0;e.translate(r-a,s-o)}return e.dirty=!1,e}getAbsoluteScale(t){for(var e=this;e;)e._isUnderCache&&(t=e),e=e.getParent();const r=this.getAbsoluteTransform(t).decompose();return{x:r.scaleX,y:r.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(Zi,this._getTransform)}_getTransform(){var t,e,i=this._cache.get(Zi)||new Ut.Transform;i.reset();var r=this.x(),s=this.y(),a=Tn.Konva.getAngle(this.rotation()),o=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,h=(e=this.attrs.scaleY)!==null&&e!==void 0?e:1,l=this.attrs.skewX||0,c=this.attrs.skewY||0,d=this.attrs.offsetX||0,f=this.attrs.offsetY||0;return(r!==0||s!==0)&&i.translate(r,s),a!==0&&i.rotate(a),(l!==0||c!==0)&&i.skew(l,c),(o!==1||h!==1)&&i.scale(o,h),(d!==0||f!==0)&&i.translate(-1*d,-1*f),i.dirty=!1,i}clone(t){var e=Ut.Util.cloneObject(this.attrs),i,r,s,a,o;for(i in t)e[i]=t[i];var h=new this.constructor(e);for(i in this.eventListeners)for(r=this.eventListeners[i],s=r.length,a=0;a<s;a++)o=r[a],o.name.indexOf(b5)<0&&(h.eventListeners[i]||(h.eventListeners[i]=[]),h.eventListeners[i].push(o));return h}_toKonvaCanvas(t){t=t||{};var e=this.getClientRect(),i=this.getStage(),r=t.x!==void 0?t.x:Math.floor(e.x),s=t.y!==void 0?t.y:Math.floor(e.y),a=t.pixelRatio||1,o=new $a.SceneCanvas({width:t.width||Math.ceil(e.width)||(i?i.width():0),height:t.height||Math.ceil(e.height)||(i?i.height():0),pixelRatio:a}),h=o.getContext();return t.imageSmoothingEnabled===!1&&(h._context.imageSmoothingEnabled=!1),h.save(),(r||s)&&h.translate(-1*r,-1*s),this.drawScene(o),h.restore(),o}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};var e=t.mimeType||null,i=t.quality||null,r=this._toKonvaCanvas(t).toDataURL(e,i);return t.callback&&t.callback(r),r}toImage(t){return new Promise((e,i)=>{try{const r=t?.callback;r&&delete t.callback,Ut.Util._urlToImage(this.toDataURL(t),function(s){e(s),r?.(s)})}catch(r){i(r)}})}toBlob(t){return new Promise((e,i)=>{try{const r=t?.callback;r&&delete t.callback,this.toCanvas(t).toBlob(s=>{e(s),r?.(s)})}catch(r){i(r)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Tn.Konva.dragDistance}_off(t,e,i){var r=this.eventListeners[t],s,a,o;for(s=0;s<r.length;s++)if(a=r[s].name,o=r[s].handler,(a!=="konva"||e==="konva")&&(!e||a===e)&&(!i||i===o)){if(r.splice(s,1),r.length===0){delete this.eventListeners[t];break}s--}}_fireChangeEvent(t,e,i){this._fire(t+y5,{oldVal:e,newVal:i})}addName(t){if(!this.hasName(t)){var e=this.name(),i=e?e+" "+t:t;this.name(i)}return this}hasName(t){if(!t)return!1;const e=this.name();if(!e)return!1;var i=(e||"").split(/\s/g);return i.indexOf(t)!==-1}removeName(t){var e=(this.name()||"").split(/\s/g),i=e.indexOf(t);return i!==-1&&(e.splice(i,1),this.name(e.join(" "))),this}setAttr(t,e){var i=this[ad+Ut.Util._capitalize(t)];return Ut.Util._isFunction(i)?i.call(this,e):this._setAttr(t,e),this}_requestDraw(){if(Tn.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t?.batchDraw()}}_setAttr(t,e){var i=this.attrs[t];i===e&&!Ut.Util.isObject(e)||(e==null?delete this.attrs[t]:this.attrs[t]=e,this._shouldFireChangeEvents&&this._fireChangeEvent(t,i,e),this._requestDraw())}_setComponentAttr(t,e,i){var r;i!==void 0&&(r=this.attrs[t],r||(this.attrs[t]=this.getAttr(t)),this.attrs[t][e]=i,this._fireChangeEvent(t,r,i))}_fireAndBubble(t,e,i){e&&this.nodeType===od&&(e.target=this);var r=(t===rd||t===sd)&&(i&&(this===i||this.isAncestorOf&&this.isAncestorOf(i))||this.nodeType==="Stage"&&!i);if(!r){this._fire(t,e);var s=(t===rd||t===sd)&&i&&i.isAncestorOf&&i.isAncestorOf(this)&&!i.isAncestorOf(this.parent);(e&&!e.cancelBubble||!e)&&this.parent&&this.parent.isListening()&&!s&&(i&&i.parent?this._fireAndBubble.call(this.parent,t,e,i):this._fireAndBubble.call(this.parent,t,e))}}_getProtoListeners(t){var e,i,r;const s=(e=this._cache.get(Ha))!==null&&e!==void 0?e:{};let a=s?.[t];if(a===void 0){a=[];let o=Object.getPrototypeOf(this);for(;o;){const h=(r=(i=o.eventListeners)===null||i===void 0?void 0:i[t])!==null&&r!==void 0?r:[];a.push(...h),o=Object.getPrototypeOf(o)}s[t]=a,this._cache.set(Ha,s)}return a}_fire(t,e){e=e||{},e.currentTarget=this,e.type=t;const i=this._getProtoListeners(t);if(i)for(var r=0;r<i.length;r++)i[r].handler.call(this,e);const s=this.eventListeners[t];if(s)for(var r=0;r<s.length;r++)s[r].handler.call(this,e)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){var e=t?t.pointerId:void 0,i=this.getStage(),r=this.getAbsolutePosition();if(i){var s=i._getPointerById(e)||i._changedPointerPositions[0]||r;Xe.DD._dragElements.set(this._id,{node:this,startPointerPos:s,offset:{x:s.x-r.x,y:s.y-r.y},dragStatus:"ready",pointerId:e})}}startDrag(t,e=!0){Xe.DD._dragElements.has(this._id)||this._createDragElement(t);const i=Xe.DD._dragElements.get(this._id);i.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},e)}_setDragPosition(t,e){const i=this.getStage()._getPointerById(e.pointerId);if(i){var r={x:i.x-e.offset.x,y:i.y-e.offset.y},s=this.dragBoundFunc();if(s!==void 0){const a=s.call(this,r,t);a?r=a:Ut.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==r.x||this._lastPos.y!==r.y)&&(this.setAbsolutePosition(r),this._requestDraw()),this._lastPos=r}}stopDrag(t){const e=Xe.DD._dragElements.get(this._id);e&&(e.dragStatus="stopped"),Xe.DD._endDragBefore(t),Xe.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=Xe.DD._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){var e=t.evt.button!==void 0,i=!e||Tn.Konva.dragButtons.indexOf(t.evt.button)>=0;if(i&&!this.isDragging()){var r=!1;Xe.DD._dragElements.forEach(s=>{this.isAncestorOf(s.node)&&(r=!0)}),r||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const e=Xe.DD._dragElements.get(this._id),i=e&&e.dragStatus==="dragging",r=e&&e.dragStatus==="ready";i?this.stopDrag():r&&Xe.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const e=this.getStage();if(!e)return!1;const i={x:-t.x,y:-t.y,width:e.width()+2*t.x,height:e.height()+2*t.y};return Ut.Util.haveIntersection(i,this.getClientRect())}static create(t,e){return Ut.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,e)}static _createNode(t,e){var i=Rl.prototype.getClassName.call(t),r=t.children,s,a,o;e&&(t.attrs.container=e),Tn.Konva[i]||(Ut.Util.warn('Can not find a node with class name "'+i+'". Fallback to "Shape".'),i="Shape");const h=Tn.Konva[i];if(s=new h(t.attrs),r)for(a=r.length,o=0;o<a;o++)s.add(Rl._createNode(r[o]));return s}};id=as.Node=Lt,Lt.prototype.nodeType="Node",Lt.prototype._attrsAffectingSize=[],Lt.prototype.eventListeners={},Lt.prototype.on.call(Lt.prototype,S5,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(Zi),this._clearSelfAndDescendantCache(ki)}),Lt.prototype.on.call(Lt.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(Xh)}),Lt.prototype.on.call(Lt.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(jh)}),Lt.prototype.on.call(Lt.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(Va)});const Zt=os.Factory.addGetterSetter;Zt(Lt,"zIndex"),Zt(Lt,"absolutePosition"),Zt(Lt,"position"),Zt(Lt,"x",0,(0,he.getNumberValidator)()),Zt(Lt,"y",0,(0,he.getNumberValidator)()),Zt(Lt,"globalCompositeOperation","source-over",(0,he.getStringValidator)()),Zt(Lt,"opacity",1,(0,he.getNumberValidator)()),Zt(Lt,"name","",(0,he.getStringValidator)()),Zt(Lt,"id","",(0,he.getStringValidator)()),Zt(Lt,"rotation",0,(0,he.getNumberValidator)()),os.Factory.addComponentsGetterSetter(Lt,"scale",["x","y"]),Zt(Lt,"scaleX",1,(0,he.getNumberValidator)()),Zt(Lt,"scaleY",1,(0,he.getNumberValidator)()),os.Factory.addComponentsGetterSetter(Lt,"skew",["x","y"]),Zt(Lt,"skewX",0,(0,he.getNumberValidator)()),Zt(Lt,"skewY",0,(0,he.getNumberValidator)()),os.Factory.addComponentsGetterSetter(Lt,"offset",["x","y"]),Zt(Lt,"offsetX",0,(0,he.getNumberValidator)()),Zt(Lt,"offsetY",0,(0,he.getNumberValidator)()),Zt(Lt,"dragDistance",null,(0,he.getNumberValidator)()),Zt(Lt,"width",0,(0,he.getNumberValidator)()),Zt(Lt,"height",0,(0,he.getNumberValidator)()),Zt(Lt,"listening",!0,(0,he.getBooleanValidator)()),Zt(Lt,"preventDefault",!0,(0,he.getBooleanValidator)()),Zt(Lt,"filters",null,function(n){return this._filterUpToDate=!1,n}),Zt(Lt,"visible",!0,(0,he.getBooleanValidator)()),Zt(Lt,"transformsEnabled","all",(0,he.getStringValidator)()),Zt(Lt,"size"),Zt(Lt,"dragBoundFunc"),Zt(Lt,"draggable",!1,(0,he.getBooleanValidator)()),os.Factory.backCompat(Lt,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});const le=St(xt({__proto__:null,get Node(){return id},default:as},[as]));var hs={};Object.defineProperty(hs,"__esModule",{value:!0});var ld=hs.Container=void 0;const nr=Ft,Yh=le,Xa=Gt;class En extends Yh.Node{constructor(){super(...arguments),this.children=[]}getChildren(t){if(!t)return this.children||[];const e=this.children||[];var i=[];return e.forEach(function(r){t(r)&&i.push(r)}),i}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(var e=0;e<t.length;e++)this.add(t[e]);return this}const i=t[0];return i.getParent()?(i.moveTo(this),this):(this._validateAdd(i),i.index=this.getChildren().length,i.parent=this,i._clearCaches(),this.getChildren().push(i),this._fire("add",{child:i}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){var e=this._generalFind(t,!0);return e.length>0?e[0]:void 0}_generalFind(t,e){var i=[];return this._descendants(r=>{const s=r._isMatch(t);return s&&i.push(r),!!(s&&e)}),i}_descendants(t){let e=!1;const i=this.getChildren();for(const r of i){if(e=t(r),e)return!0;if(r.hasChildren()&&(e=r._descendants(t),e))return!0}return!1}toObject(){var t=Yh.Node.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(e=>{t.children.push(e.toObject())}),t}isAncestorOf(t){for(var e=t.getParent();e;){if(e._id===this._id)return!0;e=e.getParent()}return!1}clone(t){var e=Yh.Node.prototype.clone.call(this,t);return this.getChildren().forEach(function(i){e.add(i.clone())}),e}getAllIntersections(t){var e=[];return this.find("Shape").forEach(i=>{i.isVisible()&&i.intersects(t)&&e.push(i)}),e}_clearSelfAndDescendantCache(t){var e;super._clearSelfAndDescendantCache(t),!this.isCached()&&((e=this.children)===null||e===void 0||e.forEach(function(i){i._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(e,i){e.index=i}),this._requestDraw()}drawScene(t,e){var i=this.getLayer(),r=t||i&&i.getCanvas(),s=r&&r.getContext(),a=this._getCanvasCache(),o=a&&a.scene,h=r&&r.isCache;if(!this.isVisible()&&!h)return this;if(o){s.save();var l=this.getAbsoluteTransform(e).getMatrix();s.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedSceneCanvas(s),s.restore()}else this._drawChildren("drawScene",r,e);return this}drawHit(t,e){if(!this.shouldDrawHit(e))return this;var i=this.getLayer(),r=t||i&&i.hitCanvas,s=r&&r.getContext(),a=this._getCanvasCache(),o=a&&a.hit;if(o){s.save();var h=this.getAbsoluteTransform(e).getMatrix();s.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedHitCanvas(s),s.restore()}else this._drawChildren("drawHit",r,e);return this}_drawChildren(t,e,i){var r,s=e&&e.getContext(),a=this.clipWidth(),o=this.clipHeight(),h=this.clipFunc(),l=a&&o||h;const c=i===this;if(l){s.save();var d=this.getAbsoluteTransform(i),f=d.getMatrix();s.transform(f[0],f[1],f[2],f[3],f[4],f[5]),s.beginPath();let b;if(h)b=h.call(this,s,this);else{var u=this.clipX(),m=this.clipY();s.rect(u,m,a,o)}s.clip.apply(s,b),f=d.copy().invert().getMatrix(),s.transform(f[0],f[1],f[2],f[3],f[4],f[5])}var v=!c&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";v&&(s.save(),s._applyGlobalCompositeOperation(this)),(r=this.children)===null||r===void 0||r.forEach(function(b){b[t](e,i)}),v&&s.restore(),l&&s.restore()}getClientRect(t={}){var e,i=t.skipTransform,r=t.relativeTo,s,a,o,h,l={x:1/0,y:1/0,width:0,height:0},c=this;(e=this.children)===null||e===void 0||e.forEach(function(v){if(v.visible()){var b=v.getClientRect({relativeTo:c,skipShadow:t.skipShadow,skipStroke:t.skipStroke});b.width===0&&b.height===0||(s===void 0?(s=b.x,a=b.y,o=b.x+b.width,h=b.y+b.height):(s=Math.min(s,b.x),a=Math.min(a,b.y),o=Math.max(o,b.x+b.width),h=Math.max(h,b.y+b.height)))}});for(var d=this.find("Shape"),f=!1,u=0;u<d.length;u++){var m=d[u];if(m._isVisible(this)){f=!0;break}}return f&&s!==void 0?l={x:s,y:a,width:o-s,height:h-a}:l={x:0,y:0,width:0,height:0},i?l:this._transformedRect(l,r)}}ld=hs.Container=En,nr.Factory.addComponentsGetterSetter(En,"clip",["x","y","width","height"]),nr.Factory.addGetterSetter(En,"clipX",void 0,(0,Xa.getNumberValidator)()),nr.Factory.addGetterSetter(En,"clipY",void 0,(0,Xa.getNumberValidator)()),nr.Factory.addGetterSetter(En,"clipWidth",void 0,(0,Xa.getNumberValidator)()),nr.Factory.addGetterSetter(En,"clipHeight",void 0,(0,Xa.getNumberValidator)()),nr.Factory.addGetterSetter(En,"clipFunc");const Ya=St(xt({__proto__:null,get Container(){return ld},default:hs},[hs]));var qh={},Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});var cd=Ge.releaseCapture=pd=Ge.setPointerCapture=gd=Ge.hasPointerCapture=dd=Ge.createEvent=fd=Ge.getCapturedShape=void 0;const T5=Nt,ls=new Map,ud=T5.Konva._global.PointerEvent!==void 0;function k5(n){return ls.get(n)}var fd=Ge.getCapturedShape=k5;function Wh(n){return{evt:n,pointerId:n.pointerId}}var dd=Ge.createEvent=Wh;function E5(n,t){return ls.get(n)===t}var gd=Ge.hasPointerCapture=E5;function P5(n,t){md(n),t.getStage()&&(ls.set(n,t),ud&&t._fire("gotpointercapture",Wh(new PointerEvent("gotpointercapture"))))}var pd=Ge.setPointerCapture=P5;function md(n,t){const e=ls.get(n);if(!e)return;const i=e.getStage();i&&i.content,ls.delete(n),ud&&e._fire("lostpointercapture",Wh(new PointerEvent("lostpointercapture")))}cd=Ge.releaseCapture=md;const vd=St(xt({__proto__:null,get createEvent(){return dd},default:Ge,get getCapturedShape(){return fd},get hasPointerCapture(){return gd},get releaseCapture(){return cd},get setPointerCapture(){return pd}},[Ge]));(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Stage=n.stages=void 0;const t=re,e=Ft,i=Ya,r=Nt,s=za,a=Hh,o=Nt,h=vd;var l="Stage",c="string",d="px",f="mouseout",u="mouseleave",m="mouseover",v="mouseenter",b="mousemove",S="mousedown",E="mouseup",_="pointermove",x="pointerdown",P="pointerup",R="pointercancel",F="lostpointercapture",L="pointerout",$="pointerleave",U="pointerover",z="pointerenter",q="contextmenu",K="touchstart",Z="touchend",at="touchmove",vt="touchcancel",_t="wheel",pt=5,nt=[[v,"_pointerenter"],[S,"_pointerdown"],[b,"_pointermove"],[E,"_pointerup"],[u,"_pointerleave"],[K,"_pointerdown"],[at,"_pointermove"],[Z,"_pointerup"],[vt,"_pointercancel"],[m,"_pointerover"],[_t,"_wheel"],[q,"_contextmenu"],[x,"_pointerdown"],[_,"_pointermove"],[P,"_pointerup"],[R,"_pointercancel"],[F,"_lostpointercapture"]];const J={mouse:{[L]:f,[$]:u,[U]:m,[z]:v,[_]:b,[x]:S,[P]:E,[R]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[L]:"touchout",[$]:"touchleave",[U]:"touchover",[z]:"touchenter",[_]:at,[x]:K,[P]:Z,[R]:vt,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[L]:L,[$]:$,[U]:U,[z]:z,[_]:_,[x]:x,[P]:P,[R]:R,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},I=W=>W.indexOf("pointer")>=0?"pointer":W.indexOf("touch")>=0?"touch":"mouse",D=W=>{const N=I(W);if(N==="pointer")return r.Konva.pointerEventsEnabled&&J.pointer;if(N==="touch")return J.touch;if(N==="mouse")return J.mouse};function A(W={}){return(W.clipFunc||W.clipWidth||W.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),W}const B="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";n.stages=[];class j extends i.Container{constructor(N){super(A(N)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),n.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{A(this.attrs)}),this._checkVisibility()}_validateAdd(N){const Y=N.getType()==="Layer",X=N.getType()==="FastLayer";Y||X||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const N=this.visible()?"":"none";this.content.style.display=N}setContainer(N){if(typeof N===c){if(N.charAt(0)==="."){var Y=N.slice(1);N=document.getElementsByClassName(Y)[0]}else{var X;N.charAt(0)!=="#"?X=N:X=N.slice(1),N=document.getElementById(X)}if(!N)throw"Can not find container in document with id "+X}return this._setAttr("container",N),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),N.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var N=this.children,Y=N.length,X;for(X=0;X<Y;X++)N[X].clear();return this}clone(N){return N||(N={}),N.container=typeof document<"u"&&document.createElement("div"),i.Container.prototype.clone.call(this,N)}destroy(){super.destroy();var N=this.content;N&&t.Util._isInDocument(N)&&this.container().removeChild(N);var Y=n.stages.indexOf(this);return Y>-1&&n.stages.splice(Y,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const N=this._pointerPositions[0]||this._changedPointerPositions[0];return N?{x:N.x,y:N.y}:(t.Util.warn(B),null)}_getPointerById(N){return this._pointerPositions.find(Y=>Y.id===N)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(N){N=N||{},N.x=N.x||0,N.y=N.y||0,N.width=N.width||this.width(),N.height=N.height||this.height();var Y=new s.SceneCanvas({width:N.width,height:N.height,pixelRatio:N.pixelRatio||1}),X=Y.getContext()._context,et=this.children;return(N.x||N.y)&&X.translate(-1*N.x,-1*N.y),et.forEach(function(ht){if(ht.isVisible()){var mt=ht._toKonvaCanvas(N);X.drawImage(mt._canvas,N.x,N.y,mt.getWidth()/mt.getPixelRatio(),mt.getHeight()/mt.getPixelRatio())}}),Y}getIntersection(N){if(!N)return null;var Y=this.children,X=Y.length,et=X-1,ht;for(ht=et;ht>=0;ht--){const mt=Y[ht].getIntersection(N);if(mt)return mt}return null}_resizeDOM(){var N=this.width(),Y=this.height();this.content&&(this.content.style.width=N+d,this.content.style.height=Y+d),this.bufferCanvas.setSize(N,Y),this.bufferHitCanvas.setSize(N,Y),this.children.forEach(X=>{X.setSize({width:N,height:Y}),X.draw()})}add(N,...Y){if(arguments.length>1){for(var X=0;X<arguments.length;X++)this.add(arguments[X]);return this}super.add(N);var et=this.children.length;return et>pt&&t.Util.warn("The stage has "+et+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),N.setSize({width:this.width(),height:this.height()}),N.draw(),r.Konva.isBrowser&&this.content.appendChild(N.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(N){return h.hasPointerCapture(N,this)}setPointerCapture(N){h.setPointerCapture(N,this)}releaseCapture(N){h.releaseCapture(N,this)}getLayers(){return this.children}_bindContentEvents(){r.Konva.isBrowser&&nt.forEach(([N,Y])=>{this.content.addEventListener(N,X=>{this[Y](X)},{passive:!1})})}_pointerenter(N){this.setPointersPositions(N);const Y=D(N.type);Y&&this._fire(Y.pointerenter,{evt:N,target:this,currentTarget:this})}_pointerover(N){this.setPointersPositions(N);const Y=D(N.type);Y&&this._fire(Y.pointerover,{evt:N,target:this,currentTarget:this})}_getTargetShape(N){let Y=this[N+"targetShape"];return Y&&!Y.getStage()&&(Y=null),Y}_pointerleave(N){const Y=D(N.type),X=I(N.type);if(Y){this.setPointersPositions(N);var et=this._getTargetShape(X),ht=!a.DD.isDragging||r.Konva.hitOnDragEnabled;et&&ht?(et._fireAndBubble(Y.pointerout,{evt:N}),et._fireAndBubble(Y.pointerleave,{evt:N}),this._fire(Y.pointerleave,{evt:N,target:this,currentTarget:this}),this[X+"targetShape"]=null):ht&&(this._fire(Y.pointerleave,{evt:N,target:this,currentTarget:this}),this._fire(Y.pointerout,{evt:N,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(N){const Y=D(N.type),X=I(N.type);if(Y){this.setPointersPositions(N);var et=!1;this._changedPointerPositions.forEach(ht=>{var mt=this.getIntersection(ht);if(a.DD.justDragged=!1,r.Konva["_"+X+"ListenClick"]=!0,!mt||!mt.isListening())return;r.Konva.capturePointerEventsEnabled&&mt.setPointerCapture(ht.id),this[X+"ClickStartShape"]=mt,mt._fireAndBubble(Y.pointerdown,{evt:N,pointerId:ht.id}),et=!0;const bt=N.type.indexOf("touch")>=0;mt.preventDefault()&&N.cancelable&&bt&&N.preventDefault()}),et||this._fire(Y.pointerdown,{evt:N,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(N){const Y=D(N.type),X=I(N.type);if(!Y)return;a.DD.isDragging&&a.DD.node.preventDefault()&&N.cancelable&&N.preventDefault(),this.setPointersPositions(N);var et=!a.DD.isDragging||r.Konva.hitOnDragEnabled;if(!et)return;var ht={};let mt=!1;var bt=this._getTargetShape(X);this._changedPointerPositions.forEach(Tt=>{const yt=h.getCapturedShape(Tt.id)||this.getIntersection(Tt),Et=Tt.id,Pt={evt:N,pointerId:Et};var Ot=bt!==yt;if(Ot&&bt&&(bt._fireAndBubble(Y.pointerout,{...Pt},yt),bt._fireAndBubble(Y.pointerleave,{...Pt},yt)),yt){if(ht[yt._id])return;ht[yt._id]=!0}yt&&yt.isListening()?(mt=!0,Ot&&(yt._fireAndBubble(Y.pointerover,{...Pt},bt),yt._fireAndBubble(Y.pointerenter,{...Pt},bt),this[X+"targetShape"]=yt),yt._fireAndBubble(Y.pointermove,{...Pt})):bt&&(this._fire(Y.pointerover,{evt:N,target:this,currentTarget:this,pointerId:Et}),this[X+"targetShape"]=null)}),mt||this._fire(Y.pointermove,{evt:N,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(N){const Y=D(N.type),X=I(N.type);if(!Y)return;this.setPointersPositions(N);const et=this[X+"ClickStartShape"],ht=this[X+"ClickEndShape"];var mt={};let bt=!1;this._changedPointerPositions.forEach(Tt=>{const yt=h.getCapturedShape(Tt.id)||this.getIntersection(Tt);if(yt){if(yt.releaseCapture(Tt.id),mt[yt._id])return;mt[yt._id]=!0}const Et=Tt.id,Pt={evt:N,pointerId:Et};let Ot=!1;r.Konva["_"+X+"InDblClickWindow"]?(Ot=!0,clearTimeout(this[X+"DblTimeout"])):a.DD.justDragged||(r.Konva["_"+X+"InDblClickWindow"]=!0,clearTimeout(this[X+"DblTimeout"])),this[X+"DblTimeout"]=setTimeout(function(){r.Konva["_"+X+"InDblClickWindow"]=!1},r.Konva.dblClickWindow),yt&&yt.isListening()?(bt=!0,this[X+"ClickEndShape"]=yt,yt._fireAndBubble(Y.pointerup,{...Pt}),r.Konva["_"+X+"ListenClick"]&&et&&et===yt&&(yt._fireAndBubble(Y.pointerclick,{...Pt}),Ot&&ht&&ht===yt&&yt._fireAndBubble(Y.pointerdblclick,{...Pt}))):(this[X+"ClickEndShape"]=null,r.Konva["_"+X+"ListenClick"]&&this._fire(Y.pointerclick,{evt:N,target:this,currentTarget:this,pointerId:Et}),Ot&&this._fire(Y.pointerdblclick,{evt:N,target:this,currentTarget:this,pointerId:Et}))}),bt||this._fire(Y.pointerup,{evt:N,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),r.Konva["_"+X+"ListenClick"]=!1,N.cancelable&&X!=="touch"&&N.preventDefault()}_contextmenu(N){this.setPointersPositions(N);var Y=this.getIntersection(this.getPointerPosition());Y&&Y.isListening()?Y._fireAndBubble(q,{evt:N}):this._fire(q,{evt:N,target:this,currentTarget:this})}_wheel(N){this.setPointersPositions(N);var Y=this.getIntersection(this.getPointerPosition());Y&&Y.isListening()?Y._fireAndBubble(_t,{evt:N}):this._fire(_t,{evt:N,target:this,currentTarget:this})}_pointercancel(N){this.setPointersPositions(N);const Y=h.getCapturedShape(N.pointerId)||this.getIntersection(this.getPointerPosition());Y&&Y._fireAndBubble(P,h.createEvent(N)),h.releaseCapture(N.pointerId)}_lostpointercapture(N){h.releaseCapture(N.pointerId)}setPointersPositions(N){var Y=this._getContentPosition(),X=null,et=null;N=N||window.event,N.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(N.touches,ht=>{this._pointerPositions.push({id:ht.identifier,x:(ht.clientX-Y.left)/Y.scaleX,y:(ht.clientY-Y.top)/Y.scaleY})}),Array.prototype.forEach.call(N.changedTouches||N.touches,ht=>{this._changedPointerPositions.push({id:ht.identifier,x:(ht.clientX-Y.left)/Y.scaleX,y:(ht.clientY-Y.top)/Y.scaleY})})):(X=(N.clientX-Y.left)/Y.scaleX,et=(N.clientY-Y.top)/Y.scaleY,this.pointerPos={x:X,y:et},this._pointerPositions=[{x:X,y:et,id:t.Util._getFirstPointerId(N)}],this._changedPointerPositions=[{x:X,y:et,id:t.Util._getFirstPointerId(N)}])}_setPointerPosition(N){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(N)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var N=this.content.getBoundingClientRect();return{top:N.top,left:N.left,scaleX:N.width/this.content.clientWidth||1,scaleY:N.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new s.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new s.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!!r.Konva.isBrowser){var N=this.container();if(!N)throw"Stage has no container. A container is required.";N.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),N.appendChild(this.content),this._resizeDOM()}}cache(){return t.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(N){N.batchDraw()}),this}}n.Stage=j,j.prototype.nodeType=l,(0,o._registerNode)(j),e.Factory.addGetterSetter(j,"container")})(qh);const A5=St(xt({__proto__:null,default:Pe(qh)},[qh]));var cs={},Kh={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Shape=n.shapes=void 0;const t=Nt,e=re,i=Ft,r=le,s=Gt,a=Nt,o=vd;var h="hasShadow",l="shadowRGBA",c="patternImage",d="linearGradient",f="radialGradient";let u;function m(){return u||(u=e.Util.createCanvasElement().getContext("2d"),u)}n.shapes={};function v($){const U=this.attrs.fillRule;U?$.fill(U):$.fill()}function b($){$.stroke()}function S($){$.fill()}function E($){$.stroke()}function _(){this._clearCache(h)}function x(){this._clearCache(l)}function P(){this._clearCache(c)}function R(){this._clearCache(d)}function F(){this._clearCache(f)}class L extends r.Node{constructor(U){super(U);let z;for(;z=e.Util.getRandomColor(),!(z&&!(z in n.shapes)););this.colorKey=z,n.shapes[z]=this}getContext(){return e.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return e.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(h,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(c,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var U=m();const z=U.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(z&&z.setTransform){const q=new e.Transform;q.translate(this.fillPatternX(),this.fillPatternY()),q.rotate(t.Konva.getAngle(this.fillPatternRotation())),q.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),q.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const K=q.getMatrix(),Z=typeof DOMMatrix>"u"?{a:K[0],b:K[1],c:K[2],d:K[3],e:K[4],f:K[5]}:new DOMMatrix(K);z.setTransform(Z)}return z}}_getLinearGradient(){return this._getCache(d,this.__getLinearGradient)}__getLinearGradient(){var U=this.fillLinearGradientColorStops();if(U){for(var z=m(),q=this.fillLinearGradientStartPoint(),K=this.fillLinearGradientEndPoint(),Z=z.createLinearGradient(q.x,q.y,K.x,K.y),at=0;at<U.length;at+=2)Z.addColorStop(U[at],U[at+1]);return Z}}_getRadialGradient(){return this._getCache(f,this.__getRadialGradient)}__getRadialGradient(){var U=this.fillRadialGradientColorStops();if(U){for(var z=m(),q=this.fillRadialGradientStartPoint(),K=this.fillRadialGradientEndPoint(),Z=z.createRadialGradient(q.x,q.y,this.fillRadialGradientStartRadius(),K.x,K.y,this.fillRadialGradientEndRadius()),at=0;at<U.length;at+=2)Z.addColorStop(U[at],U[at+1]);return Z}}getShadowRGBA(){return this._getCache(l,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var U=e.Util.colorToRGBA(this.shadowColor());if(U)return"rgba("+U.r+","+U.g+","+U.b+","+U.a*(this.shadowOpacity()||1)+")"}}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const U=this.hitStrokeWidth();return U==="auto"?this.hasStroke():this.strokeEnabled()&&!!U}intersects(U){var z=this.getStage();if(!z)return!1;const q=z.bufferHitCanvas;return q.getContext().clear(),this.drawHit(q,void 0,!0),q.context.getImageData(Math.round(U.x),Math.round(U.y),1,1).data[3]>0}destroy(){return r.Node.prototype.destroy.call(this),delete n.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(U){var z;if(!this.getStage()||!((z=this.attrs.perfectDrawEnabled)!==null&&z!==void 0?z:!0))return!1;const K=U||this.hasFill(),Z=this.hasStroke(),at=this.getAbsoluteOpacity()!==1;if(K&&Z&&at)return!0;const vt=this.hasShadow(),_t=this.shadowForStrokeEnabled();return!!(K&&Z&&vt&&_t)}setStrokeHitEnabled(U){e.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),U?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var U=this.size();return{x:this._centroid?-U.width/2:0,y:this._centroid?-U.height/2:0,width:U.width,height:U.height}}getClientRect(U={}){const z=U.skipTransform,q=U.relativeTo,K=this.getSelfRect(),at=!U.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,vt=K.width+at,_t=K.height+at,pt=!U.skipShadow&&this.hasShadow(),nt=pt?this.shadowOffsetX():0,J=pt?this.shadowOffsetY():0,I=vt+Math.abs(nt),D=_t+Math.abs(J),A=pt&&this.shadowBlur()||0,B=I+A*2,j=D+A*2,W={width:B,height:j,x:-(at/2+A)+Math.min(nt,0)+K.x,y:-(at/2+A)+Math.min(J,0)+K.y};return z?W:this._transformedRect(W,q)}drawScene(U,z){var q=this.getLayer(),K=U||q.getCanvas(),Z=K.getContext(),at=this._getCanvasCache(),vt=this.getSceneFunc(),_t=this.hasShadow(),pt,nt,J,I=K.isCache,D=z===this;if(!this.isVisible()&&!D)return this;if(at){Z.save();var A=this.getAbsoluteTransform(z).getMatrix();return Z.transform(A[0],A[1],A[2],A[3],A[4],A[5]),this._drawCachedSceneCanvas(Z),Z.restore(),this}if(!vt)return this;if(Z.save(),this._useBufferCanvas()&&!I){pt=this.getStage(),nt=pt.bufferCanvas,J=nt.getContext(),J.clear(),J.save(),J._applyLineJoin(this);var B=this.getAbsoluteTransform(z).getMatrix();J.transform(B[0],B[1],B[2],B[3],B[4],B[5]),vt.call(this,J,this),J.restore();var j=nt.pixelRatio;_t&&Z._applyShadow(this),Z._applyOpacity(this),Z._applyGlobalCompositeOperation(this),Z.drawImage(nt._canvas,0,0,nt.width/j,nt.height/j)}else{if(Z._applyLineJoin(this),!D){var B=this.getAbsoluteTransform(z).getMatrix();Z.transform(B[0],B[1],B[2],B[3],B[4],B[5]),Z._applyOpacity(this),Z._applyGlobalCompositeOperation(this)}_t&&Z._applyShadow(this),vt.call(this,Z,this)}return Z.restore(),this}drawHit(U,z,q=!1){if(!this.shouldDrawHit(z,q))return this;var K=this.getLayer(),Z=U||K.hitCanvas,at=Z&&Z.getContext(),vt=this.hitFunc()||this.sceneFunc(),_t=this._getCanvasCache(),pt=_t&&_t.hit;if(this.colorKey||e.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),pt){at.save();var nt=this.getAbsoluteTransform(z).getMatrix();return at.transform(nt[0],nt[1],nt[2],nt[3],nt[4],nt[5]),this._drawCachedHitCanvas(at),at.restore(),this}if(!vt)return this;if(at.save(),at._applyLineJoin(this),!(this===z)){var I=this.getAbsoluteTransform(z).getMatrix();at.transform(I[0],I[1],I[2],I[3],I[4],I[5])}return vt.call(this,at,this),at.restore(),this}drawHitFromCache(U=0){var z=this._getCanvasCache(),q=this._getCachedSceneCanvas(),K=z.hit,Z=K.getContext(),at=K.getWidth(),vt=K.getHeight(),_t,pt,nt,J,I,D;Z.clear(),Z.drawImage(q._canvas,0,0,at,vt);try{for(_t=Z.getImageData(0,0,at,vt),pt=_t.data,nt=pt.length,J=e.Util._hexToRgb(this.colorKey),I=0;I<nt;I+=4)D=pt[I+3],D>U?(pt[I]=J.r,pt[I+1]=J.g,pt[I+2]=J.b,pt[I+3]=255):pt[I+3]=0;Z.putImageData(_t,0,0)}catch(A){e.Util.error("Unable to draw hit graph from cached scene canvas. "+A.message)}return this}hasPointerCapture(U){return o.hasPointerCapture(U,this)}setPointerCapture(U){o.setPointerCapture(U,this)}releaseCapture(U){o.releaseCapture(U,this)}}n.Shape=L,L.prototype._fillFunc=v,L.prototype._strokeFunc=b,L.prototype._fillFuncHit=S,L.prototype._strokeFuncHit=E,L.prototype._centroid=!1,L.prototype.nodeType="Shape",(0,a._registerNode)(L),L.prototype.eventListeners={},L.prototype.on.call(L.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",_),L.prototype.on.call(L.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",x),L.prototype.on.call(L.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",P),L.prototype.on.call(L.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",R),L.prototype.on.call(L.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",F),i.Factory.addGetterSetter(L,"stroke",void 0,(0,s.getStringOrGradientValidator)()),i.Factory.addGetterSetter(L,"strokeWidth",2,(0,s.getNumberValidator)()),i.Factory.addGetterSetter(L,"fillAfterStrokeEnabled",!1),i.Factory.addGetterSetter(L,"hitStrokeWidth","auto",(0,s.getNumberOrAutoValidator)()),i.Factory.addGetterSetter(L,"strokeHitEnabled",!0,(0,s.getBooleanValidator)()),i.Factory.addGetterSetter(L,"perfectDrawEnabled",!0,(0,s.getBooleanValidator)()),i.Factory.addGetterSetter(L,"shadowForStrokeEnabled",!0,(0,s.getBooleanValidator)()),i.Factory.addGetterSetter(L,"lineJoin"),i.Factory.addGetterSetter(L,"lineCap"),i.Factory.addGetterSetter(L,"sceneFunc"),i.Factory.addGetterSetter(L,"hitFunc"),i.Factory.addGetterSetter(L,"dash"),i.Factory.addGetterSetter(L,"dashOffset",0,(0,s.getNumberValidator)()),i.Factory.addGetterSetter(L,"shadowColor",void 0,(0,s.getStringValidator)()),i.Factory.addGetterSetter(L,"shadowBlur",0,(0,s.getNumberValidator)()),i.Factory.addGetterSetter(L,"shadowOpacity",1,(0,s.getNumberValidator)()),i.Factory.addComponentsGetterSetter(L,"shadowOffset",["x","y"]),i.Factory.addGetterSetter(L,"shadowOffsetX",0,(0,s.getNumberValidator)()),i.Factory.addGetterSetter(L,"shadowOffsetY",0,(0,s.getNumberValidator)()),i.Factory.addGetterSetter(L,"fillPatternImage"),i.Factory.addGetterSetter(L,"fill",void 0,(0,s.getStringOrGradientValidator)()),i.Factory.addGetterSetter(L,"fillPatternX",0,(0,s.getNumberValidator)()),i.Factory.addGetterSetter(L,"fillPatternY",0,(0,s.getNumberValidator)()),i.Factory.addGetterSetter(L,"fillLinearGradientColorStops"),i.Factory.addGetterSetter(L,"strokeLinearGradientColorStops"),i.Factory.addGetterSetter(L,"fillRadialGradientStartRadius",0),i.Factory.addGetterSetter(L,"fillRadialGradientEndRadius",0),i.Factory.addGetterSetter(L,"fillRadialGradientColorStops"),i.Factory.addGetterSetter(L,"fillPatternRepeat","repeat"),i.Factory.addGetterSetter(L,"fillEnabled",!0),i.Factory.addGetterSetter(L,"strokeEnabled",!0),i.Factory.addGetterSetter(L,"shadowEnabled",!0),i.Factory.addGetterSetter(L,"dashEnabled",!0),i.Factory.addGetterSetter(L,"strokeScaleEnabled",!0),i.Factory.addGetterSetter(L,"fillPriority","color"),i.Factory.addComponentsGetterSetter(L,"fillPatternOffset",["x","y"]),i.Factory.addGetterSetter(L,"fillPatternOffsetX",0,(0,s.getNumberValidator)()),i.Factory.addGetterSetter(L,"fillPatternOffsetY",0,(0,s.getNumberValidator)()),i.Factory.addComponentsGetterSetter(L,"fillPatternScale",["x","y"]),i.Factory.addGetterSetter(L,"fillPatternScaleX",1,(0,s.getNumberValidator)()),i.Factory.addGetterSetter(L,"fillPatternScaleY",1,(0,s.getNumberValidator)()),i.Factory.addComponentsGetterSetter(L,"fillLinearGradientStartPoint",["x","y"]),i.Factory.addComponentsGetterSetter(L,"strokeLinearGradientStartPoint",["x","y"]),i.Factory.addGetterSetter(L,"fillLinearGradientStartPointX",0),i.Factory.addGetterSetter(L,"strokeLinearGradientStartPointX",0),i.Factory.addGetterSetter(L,"fillLinearGradientStartPointY",0),i.Factory.addGetterSetter(L,"strokeLinearGradientStartPointY",0),i.Factory.addComponentsGetterSetter(L,"fillLinearGradientEndPoint",["x","y"]),i.Factory.addComponentsGetterSetter(L,"strokeLinearGradientEndPoint",["x","y"]),i.Factory.addGetterSetter(L,"fillLinearGradientEndPointX",0),i.Factory.addGetterSetter(L,"strokeLinearGradientEndPointX",0),i.Factory.addGetterSetter(L,"fillLinearGradientEndPointY",0),i.Factory.addGetterSetter(L,"strokeLinearGradientEndPointY",0),i.Factory.addComponentsGetterSetter(L,"fillRadialGradientStartPoint",["x","y"]),i.Factory.addGetterSetter(L,"fillRadialGradientStartPointX",0),i.Factory.addGetterSetter(L,"fillRadialGradientStartPointY",0),i.Factory.addComponentsGetterSetter(L,"fillRadialGradientEndPoint",["x","y"]),i.Factory.addGetterSetter(L,"fillRadialGradientEndPointX",0),i.Factory.addGetterSetter(L,"fillRadialGradientEndPointY",0),i.Factory.addGetterSetter(L,"fillPatternRotation",0),i.Factory.addGetterSetter(L,"fillRule",void 0,(0,s.getStringValidator)()),i.Factory.backCompat(L,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(Kh);const me=St(xt({__proto__:null,default:Pe(Kh)},[Kh]));Object.defineProperty(cs,"__esModule",{value:!0});var _d=cs.Layer=void 0;const Ei=re,Zh=Ya,rr=le,Jh=Ft,yd=za,M5=Gt,R5=me,D5=Nt;var L5="#",I5="beforeDraw",O5="draw",wd=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],F5=wd.length;class sr extends Zh.Container{constructor(t){super(t),this.canvas=new yd.SceneCanvas,this.hitCanvas=new yd.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),t<e.children.length-1?e.content.insertBefore(this.getNativeCanvasElement(),e.children[t+1].getCanvas()._canvas):e.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){rr.Node.prototype.moveToTop.call(this);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){var t=rr.Node.prototype.moveUp.call(this);if(!t)return!1;var e=this.getStage();return!e||!e.content?!1:(e.content.removeChild(this.getNativeCanvasElement()),this.index<e.children.length-1?e.content.insertBefore(this.getNativeCanvasElement(),e.children[this.index+1].getCanvas()._canvas):e.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(rr.Node.prototype.moveDown.call(this)){var t=this.getStage();if(t){var e=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),e[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(rr.Node.prototype.moveToBottom.call(this)){var t=this.getStage();if(t){var e=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),e[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var t=this.getNativeCanvasElement();return rr.Node.prototype.remove.call(this),t&&t.parentNode&&Ei.Util._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:e}){return this.canvas.setSize(t,e),this.hitCanvas.setSize(t,e),this._setSmoothEnabled(),this}_validateAdd(t){var e=t.getType();e!=="Group"&&e!=="Shape"&&Ei.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t=t||{},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),rr.Node.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){Ei.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){Ei.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,Ei.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var e=1,i=!1;;){for(let r=0;r<F5;r++){const s=wd[r],a=this._getIntersection({x:t.x+s.x*e,y:t.y+s.y*e}),o=a.shape;if(o)return o;if(i=!!a.antialiased,!a.antialiased)break}if(i)e+=1;else return null}}_getIntersection(t){const e=this.hitCanvas.pixelRatio,i=this.hitCanvas.context.getImageData(Math.round(t.x*e),Math.round(t.y*e),1,1).data,r=i[3];if(r===255){const s=Ei.Util._rgbToHex(i[0],i[1],i[2]),a=R5.shapes[L5+s];return a?{shape:a}:{antialiased:!0}}else if(r>0)return{antialiased:!0};return{}}drawScene(t,e){var i=this.getLayer(),r=t||i&&i.getCanvas();return this._fire(I5,{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),Zh.Container.prototype.drawScene.call(this,r,e),this._fire(O5,{node:this}),this}drawHit(t,e){var i=this.getLayer(),r=t||i&&i.hitCanvas;return i&&i.clearBeforeDraw()&&i.getHitCanvas().getContext().clear(),Zh.Container.prototype.drawHit.call(this,r,e),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){Ei.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return Ei.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,e=!!this.hitCanvas._canvas.parentNode;e?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return Ei.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}_d=cs.Layer=sr,sr.prototype.nodeType="Layer",(0,D5._registerNode)(sr),Jh.Factory.addGetterSetter(sr,"imageSmoothingEnabled",!0),Jh.Factory.addGetterSetter(sr,"clearBeforeDraw",!0),Jh.Factory.addGetterSetter(sr,"hitGraphEnabled",!0,(0,M5.getBooleanValidator)());const bd=St(xt({__proto__:null,get Layer(){return _d},default:cs},[cs]));var us={};Object.defineProperty(us,"__esModule",{value:!0});var xd=us.FastLayer=void 0;const N5=re,G5=bd,U5=Nt;class Qh extends G5.Layer{constructor(t){super(t),this.listening(!1),N5.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}xd=us.FastLayer=Qh,Qh.prototype.nodeType="FastLayer",(0,U5._registerNode)(Qh);const B5=St(xt({__proto__:null,get FastLayer(){return xd},default:us},[us]));var fs={};Object.defineProperty(fs,"__esModule",{value:!0});var Sd=fs.Group=void 0;const z5=re,$5=Ya,V5=Nt;class tl extends $5.Container{_validateAdd(t){var e=t.getType();e!=="Group"&&e!=="Shape"&&z5.Util.throw("You may only add groups and shapes to groups.")}}Sd=fs.Group=tl,tl.prototype.nodeType="Group",(0,V5._registerNode)(tl);const el=St(xt({__proto__:null,get Group(){return Sd},default:fs},[fs]));var ds={};Object.defineProperty(ds,"__esModule",{value:!0});var Cd=ds.Animation=void 0;const il=Nt,Td=re,nl=function(){return il.glob.performance&&il.glob.performance.now?function(){return il.glob.performance.now()}:function(){return new Date().getTime()}}();class ai{constructor(t,e){this.id=ai.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:nl(),frameRate:0},this.func=t,this.setLayers(e)}setLayers(t){let e=[];return t&&(e=Array.isArray(t)?t:[t]),this.layers=e,this}getLayers(){return this.layers}addLayer(t){const e=this.layers,i=e.length;for(let r=0;r<i;r++)if(e[r]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){const e=ai.animations,i=e.length;for(let r=0;r<i;r++)if(e[r].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=nl(),ai._addAnimation(this),this}stop(){return ai._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){const e=t.id,i=this.animations,r=i.length;for(let s=0;s<r;s++)if(i[s].id===e){this.animations.splice(s,1);break}}static _runFrames(){const t={},e=this.animations;for(let i=0;i<e.length;i++){const r=e[i],s=r.layers,a=r.func;r._updateFrameObject(nl());const o=s.length;let h;if(a?h=a.call(r,r.frame)!==!1:h=!0,!!h)for(let l=0;l<o;l++){const c=s[l];c._id!==void 0&&(t[c._id]=c)}}for(let i in t)t.hasOwnProperty(i)&&t[i].batchDraw()}static _animationLoop(){const t=ai;t.animations.length?(t._runFrames(),Td.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,Td.Util.requestAnimFrame(this._animationLoop))}}Cd=ds.Animation=ai,ai.animations=[],ai.animIdCounter=0,ai.animRunning=!1;const rl=St(xt({__proto__:null,get Animation(){return Cd},default:ds},[ds]));var sl={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Easings=n.Tween=void 0;const t=re,e=rl,i=le,r=Nt;var s={node:1,duration:1,easing:1,onFinish:1,yoyo:1},a=1,o=2,h=3,l=0,c=["fill","stroke","shadowColor"];class d{constructor(m,v,b,S,E,_,x){this.prop=m,this.propFunc=v,this.begin=S,this._pos=S,this.duration=_,this._change=0,this.prevPos=0,this.yoyo=x,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=b,this._change=E-this.begin,this.pause()}fire(m){var v=this[m];v&&v()}setTime(m){m>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():m<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=m,this.update())}getTime(){return this._time}setPosition(m){this.prevPos=this._pos,this.propFunc(m),this._pos=m}getPosition(m){return m===void 0&&(m=this._time),this.func(m,this.begin,this._change,this.duration)}play(){this.state=o,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=h,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(m){this.pause(),this._time=m,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var m=this.getTimer()-this._startTime;this.state===o?this.setTime(m):this.state===h&&this.setTime(this.duration-m)}pause(){this.state=a,this.fire("onPause")}getTimer(){return new Date().getTime()}}class f{constructor(m){var v=this,b=m.node,S=b._id,E,_=m.easing||n.Easings.Linear,x=!!m.yoyo,P;typeof m.duration>"u"?E=.3:m.duration===0?E=.001:E=m.duration,this.node=b,this._id=l++;var R=b.getLayer()||(b instanceof r.Konva.Stage?b.getLayers():null);R||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new e.Animation(function(){v.tween.onEnterFrame()},R),this.tween=new d(P,function(F){v._tweenFunc(F)},_,0,1,E*1e3,x),this._addListeners(),f.attrs[S]||(f.attrs[S]={}),f.attrs[S][this._id]||(f.attrs[S][this._id]={}),f.tweens[S]||(f.tweens[S]={});for(P in m)s[P]===void 0&&this._addAttr(P,m[P]);this.reset(),this.onFinish=m.onFinish,this.onReset=m.onReset,this.onUpdate=m.onUpdate}_addAttr(m,v){var b=this.node,S=b._id,E,_,x,P,R,F,L,$;if(x=f.tweens[S][m],x&&delete f.attrs[S][x][m],E=b.getAttr(m),t.Util._isArray(v))if(_=[],R=Math.max(v.length,E.length),m==="points"&&v.length!==E.length&&(v.length>E.length?(L=E,E=t.Util._prepareArrayForTween(E,v,b.closed())):(F=v,v=t.Util._prepareArrayForTween(v,E,b.closed()))),m.indexOf("fill")===0)for(P=0;P<R;P++)if(P%2===0)_.push(v[P]-E[P]);else{var U=t.Util.colorToRGBA(E[P]);$=t.Util.colorToRGBA(v[P]),E[P]=U,_.push({r:$.r-U.r,g:$.g-U.g,b:$.b-U.b,a:$.a-U.a})}else for(P=0;P<R;P++)_.push(v[P]-E[P]);else c.indexOf(m)!==-1?(E=t.Util.colorToRGBA(E),$=t.Util.colorToRGBA(v),_={r:$.r-E.r,g:$.g-E.g,b:$.b-E.b,a:$.a-E.a}):_=v-E;f.attrs[S][this._id][m]={start:E,diff:_,end:v,trueEnd:F,trueStart:L},f.tweens[S][m]=this._id}_tweenFunc(m){var v=this.node,b=f.attrs[v._id][this._id],S,E,_,x,P,R,F,L;for(S in b){if(E=b[S],_=E.start,x=E.diff,L=E.end,t.Util._isArray(_))if(P=[],F=Math.max(_.length,L.length),S.indexOf("fill")===0)for(R=0;R<F;R++)R%2===0?P.push((_[R]||0)+x[R]*m):P.push("rgba("+Math.round(_[R].r+x[R].r*m)+","+Math.round(_[R].g+x[R].g*m)+","+Math.round(_[R].b+x[R].b*m)+","+(_[R].a+x[R].a*m)+")");else for(R=0;R<F;R++)P.push((_[R]||0)+x[R]*m);else c.indexOf(S)!==-1?P="rgba("+Math.round(_.r+x.r*m)+","+Math.round(_.g+x.g*m)+","+Math.round(_.b+x.b*m)+","+(_.a+x.a*m)+")":P=_+x*m;v.setAttr(S,P)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var m=this.node,v=f.attrs[m._id][this._id];v.points&&v.points.trueEnd&&m.setAttr("points",v.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var m=this.node,v=f.attrs[m._id][this._id];v.points&&v.points.trueStart&&m.points(v.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(m){return this.tween.seek(m*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var m=this.node._id,v=this._id,b=f.tweens[m],S;this.pause();for(S in b)delete f.tweens[m][S];delete f.attrs[m][v]}}n.Tween=f,f.attrs={},f.tweens={},i.Node.prototype.to=function(u){var m=u.onFinish;u.node=this,u.onFinish=function(){this.destroy(),m&&m()};var v=new f(u);v.play()},n.Easings={BackEaseIn(u,m,v,b){var S=1.70158;return v*(u/=b)*u*((S+1)*u-S)+m},BackEaseOut(u,m,v,b){var S=1.70158;return v*((u=u/b-1)*u*((S+1)*u+S)+1)+m},BackEaseInOut(u,m,v,b){var S=1.70158;return(u/=b/2)<1?v/2*(u*u*(((S*=1.525)+1)*u-S))+m:v/2*((u-=2)*u*(((S*=1.525)+1)*u+S)+2)+m},ElasticEaseIn(u,m,v,b,S,E){var _=0;return u===0?m:(u/=b)===1?m+v:(E||(E=b*.3),!S||S<Math.abs(v)?(S=v,_=E/4):_=E/(2*Math.PI)*Math.asin(v/S),-(S*Math.pow(2,10*(u-=1))*Math.sin((u*b-_)*(2*Math.PI)/E))+m)},ElasticEaseOut(u,m,v,b,S,E){var _=0;return u===0?m:(u/=b)===1?m+v:(E||(E=b*.3),!S||S<Math.abs(v)?(S=v,_=E/4):_=E/(2*Math.PI)*Math.asin(v/S),S*Math.pow(2,-10*u)*Math.sin((u*b-_)*(2*Math.PI)/E)+v+m)},ElasticEaseInOut(u,m,v,b,S,E){var _=0;return u===0?m:(u/=b/2)===2?m+v:(E||(E=b*.44999999999999996),!S||S<Math.abs(v)?(S=v,_=E/4):_=E/(2*Math.PI)*Math.asin(v/S),u<1?-.5*(S*Math.pow(2,10*(u-=1))*Math.sin((u*b-_)*(2*Math.PI)/E))+m:S*Math.pow(2,-10*(u-=1))*Math.sin((u*b-_)*(2*Math.PI)/E)*.5+v+m)},BounceEaseOut(u,m,v,b){return(u/=b)<.36363636363636365?v*(7.5625*u*u)+m:u<.7272727272727273?v*(7.5625*(u-=.5454545454545454)*u+.75)+m:u<.9090909090909091?v*(7.5625*(u-=.8181818181818182)*u+.9375)+m:v*(7.5625*(u-=.9545454545454546)*u+.984375)+m},BounceEaseIn(u,m,v,b){return v-n.Easings.BounceEaseOut(b-u,0,v,b)+m},BounceEaseInOut(u,m,v,b){return u<b/2?n.Easings.BounceEaseIn(u*2,0,v,b)*.5+m:n.Easings.BounceEaseOut(u*2-b,0,v,b)*.5+v*.5+m},EaseIn(u,m,v,b){return v*(u/=b)*u+m},EaseOut(u,m,v,b){return-v*(u/=b)*(u-2)+m},EaseInOut(u,m,v,b){return(u/=b/2)<1?v/2*u*u+m:-v/2*(--u*(u-2)-1)+m},StrongEaseIn(u,m,v,b){return v*(u/=b)*u*u*u*u+m},StrongEaseOut(u,m,v,b){return v*((u=u/b-1)*u*u*u*u+1)+m},StrongEaseInOut(u,m,v,b){return(u/=b/2)<1?v/2*u*u*u*u*u+m:v/2*((u-=2)*u*u*u*u+2)+m},Linear(u,m,v,b){return v*u/b+m}}})(sl);const H5=St(xt({__proto__:null,default:Pe(sl)},[sl]));(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Konva=void 0;const t=Nt,e=re,i=le,r=Ya,s=A5,a=bd,o=B5,h=el,l=Hh,c=me,d=rl,f=H5,u=Kf,m=za;n.Konva=e.Util._assign(t.Konva,{Util:e.Util,Transform:e.Transform,Node:i.Node,Container:r.Container,Stage:s.Stage,stages:s.stages,Layer:a.Layer,FastLayer:o.FastLayer,Group:h.Group,DD:l.DD,Shape:c.Shape,shapes:c.shapes,Animation:d.Animation,Tween:f.Tween,Easings:f.Easings,Context:u.Context,Canvas:m.Canvas}),n.default=n.Konva})(Uh);const j5=St(xt({__proto__:null,default:Pe(Uh)},[Uh]));var gs={};Object.defineProperty(gs,"__esModule",{value:!0});var kd=gs.Arc=void 0;const qa=Ft,X5=me,Ed=Nt,Wa=Gt,Y5=Nt;class Pi extends X5.Shape{_sceneFunc(t){var e=Ed.Konva.getAngle(this.angle()),i=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,e,i),t.arc(0,0,this.innerRadius(),e,0,!i),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){const t=this.innerRadius(),e=this.outerRadius(),i=this.clockwise(),r=Ed.Konva.getAngle(i?360-this.angle():this.angle()),s=Math.cos(Math.min(r,Math.PI)),a=1,o=Math.sin(Math.min(Math.max(Math.PI,r),3*Math.PI/2)),h=Math.sin(Math.min(r,Math.PI/2)),l=s*(s>0?t:e),c=a*e,d=o*(o>0?t:e),f=h*(h>0?e:t);return{x:l,y:i?-1*f:d,width:c-l,height:f-d}}}kd=gs.Arc=Pi,Pi.prototype._centroid=!0,Pi.prototype.className="Arc",Pi.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,Y5._registerNode)(Pi),qa.Factory.addGetterSetter(Pi,"innerRadius",0,(0,Wa.getNumberValidator)()),qa.Factory.addGetterSetter(Pi,"outerRadius",0,(0,Wa.getNumberValidator)()),qa.Factory.addGetterSetter(Pi,"angle",0,(0,Wa.getNumberValidator)()),qa.Factory.addGetterSetter(Pi,"clockwise",!1,(0,Wa.getBooleanValidator)());const q5=St(xt({__proto__:null,get Arc(){return kd},default:gs},[gs]));var ps={},ms={};Object.defineProperty(ms,"__esModule",{value:!0});var Pd=ms.Line=void 0;const Ka=Ft,W5=me,Ad=Gt,K5=Nt;function al(n,t,e,i,r,s,a){var o=Math.sqrt(Math.pow(e-n,2)+Math.pow(i-t,2)),h=Math.sqrt(Math.pow(r-e,2)+Math.pow(s-i,2)),l=a*o/(o+h),c=a*h/(o+h),d=e-l*(r-n),f=i-l*(s-t),u=e+c*(r-n),m=i+c*(s-t);return[d,f,u,m]}function Md(n,t){var e=n.length,i=[],r,s;for(r=2;r<e-2;r+=2)s=al(n[r-2],n[r-1],n[r],n[r+1],n[r+2],n[r+3],t),!isNaN(s[0])&&(i.push(s[0]),i.push(s[1]),i.push(n[r]),i.push(n[r+1]),i.push(s[2]),i.push(s[3]));return i}class Ji extends W5.Shape{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){var e=this.points(),i=e.length,r=this.tension(),s=this.closed(),a=this.bezier(),o,h,l;if(i){if(t.beginPath(),t.moveTo(e[0],e[1]),r!==0&&i>4){for(o=this.getTensionPoints(),h=o.length,l=s?0:4,s||t.quadraticCurveTo(o[0],o[1],o[2],o[3]);l<h-2;)t.bezierCurveTo(o[l++],o[l++],o[l++],o[l++],o[l++],o[l++]);s||t.quadraticCurveTo(o[h-2],o[h-1],e[i-2],e[i-1])}else if(a)for(l=2;l<i;)t.bezierCurveTo(e[l++],e[l++],e[l++],e[l++],e[l++],e[l++]);else for(l=2;l<i;l+=2)t.lineTo(e[l],e[l+1]);s?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():Md(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),e=t.length,i=this.tension(),r=al(t[e-2],t[e-1],t[0],t[1],t[2],t[3],i),s=al(t[e-4],t[e-3],t[e-2],t[e-1],t[0],t[1],i),a=Md(t,i),o=[r[2],r[3]].concat(a).concat([s[0],s[1],t[e-2],t[e-1],s[2],s[3],r[0],r[1],t[0],t[1]]);return o}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();for(var e=t[0],i=t[0],r=t[1],s=t[1],a,o,h=0;h<t.length/2;h++)a=t[h*2],o=t[h*2+1],e=Math.min(e,a),i=Math.max(i,a),r=Math.min(r,o),s=Math.max(s,o);return{x:e,y:r,width:i-e,height:s-r}}}Pd=ms.Line=Ji,Ji.prototype.className="Line",Ji.prototype._attrsAffectingSize=["points","bezier","tension"],(0,K5._registerNode)(Ji),Ka.Factory.addGetterSetter(Ji,"closed",!1),Ka.Factory.addGetterSetter(Ji,"bezier",!1),Ka.Factory.addGetterSetter(Ji,"tension",0,(0,Ad.getNumberValidator)()),Ka.Factory.addGetterSetter(Ji,"points",[],(0,Ad.getNumberArrayValidator)());const Rd=St(xt({__proto__:null,get Line(){return Pd},default:ms},[ms]));var vs={},ol={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.t2length=n.getQuadraticArcLength=n.getCubicArcLength=n.binomialCoefficients=n.cValues=n.tValues=void 0,n.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],n.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],n.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const t=(a,o,h)=>{let l,c,d;l=h/2,c=0;for(let u=0;u<20;u++)d=l*n.tValues[20][u]+l,c+=n.cValues[20][u]*i(a,o,d);return l*c};n.getCubicArcLength=t;const e=(a,o,h)=>{h===void 0&&(h=1);const l=a[0]-2*a[1]+a[2],c=o[0]-2*o[1]+o[2],d=2*a[1]-2*a[0],f=2*o[1]-2*o[0],u=4*(l*l+c*c),m=4*(l*d+c*f),v=d*d+f*f;if(u===0)return h*Math.sqrt(Math.pow(a[2]-a[0],2)+Math.pow(o[2]-o[0],2));const b=m/(2*u),S=v/u,E=h+b,_=S-b*b,x=E*E+_>0?Math.sqrt(E*E+_):0,P=b*b+_>0?Math.sqrt(b*b+_):0,R=b+Math.sqrt(b*b+_)!==0?_*Math.log(Math.abs((E+x)/(b+P))):0;return Math.sqrt(u)/2*(E*x-b*P+R)};n.getQuadraticArcLength=e;function i(a,o,h){const l=r(1,h,a),c=r(1,h,o),d=l*l+c*c;return Math.sqrt(d)}const r=(a,o,h)=>{const l=h.length-1;let c,d;if(l===0)return 0;if(a===0){d=0;for(let f=0;f<=l;f++)d+=n.binomialCoefficients[l][f]*Math.pow(1-o,l-f)*Math.pow(o,f)*h[f];return d}else{c=new Array(l);for(let f=0;f<l;f++)c[f]=l*(h[f+1]-h[f]);return r(a-1,o,c)}},s=(a,o,h)=>{let l=1,c=a/o,d=(a-h(c))/o,f=0;for(;l>.001;){const u=h(c+d),m=Math.abs(a-u)/o;if(m<l)l=m,c+=d;else{const v=h(c-d),b=Math.abs(a-v)/o;b<l?(l=b,c-=d):d/=2}if(f++,f>500)break}return c};n.t2length=s})(ol);const Z5=St(xt({__proto__:null,default:Pe(ol)},[ol]));Object.defineProperty(vs,"__esModule",{value:!0});var Dd=vs.Path=void 0;const J5=Ft,Q5=me,t3=Nt,ar=Z5;class ue extends Q5.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=ue.parsePathData(this.data()),this.pathLength=ue.getPathLength(this.dataArray)}_sceneFunc(t){var e=this.dataArray;t.beginPath();for(var i=!1,r=0;r<e.length;r++){var s=e[r].command,a=e[r].points;switch(s){case"L":t.lineTo(a[0],a[1]);break;case"M":t.moveTo(a[0],a[1]);break;case"C":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"Q":t.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case"A":var o=a[0],h=a[1],l=a[2],c=a[3],d=a[4],f=a[5],u=a[6],m=a[7],v=l>c?l:c,b=l>c?1:l/c,S=l>c?c/l:1;t.translate(o,h),t.rotate(u),t.scale(b,S),t.arc(0,0,v,d,d+f,1-m),t.scale(1/b,1/S),t.rotate(-u),t.translate(-o,-h);break;case"z":i=!0,t.closePath();break}}!i&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(l){if(l.command==="A"){var c=l.points[4],d=l.points[5],f=l.points[4]+d,u=Math.PI/180;if(Math.abs(c-f)<u&&(u=Math.abs(c-f)),d<0)for(let m=c-u;m>f;m-=u){const v=ue.getPointOnEllipticalArc(l.points[0],l.points[1],l.points[2],l.points[3],m,0);t.push(v.x,v.y)}else for(let m=c+u;m<f;m+=u){const v=ue.getPointOnEllipticalArc(l.points[0],l.points[1],l.points[2],l.points[3],m,0);t.push(v.x,v.y)}}else if(l.command==="C")for(let m=0;m<=1;m+=.01){const v=ue.getPointOnCubicBezier(m,l.start.x,l.start.y,l.points[0],l.points[1],l.points[2],l.points[3],l.points[4],l.points[5]);t.push(v.x,v.y)}else t=t.concat(l.points)});for(var e=t[0],i=t[0],r=t[1],s=t[1],a,o,h=0;h<t.length/2;h++)a=t[h*2],o=t[h*2+1],isNaN(a)||(e=Math.min(e,a),i=Math.max(i,a)),isNaN(o)||(r=Math.min(r,o),s=Math.max(s,o));return{x:e,y:r,width:i-e,height:s-r}}getLength(){return this.pathLength}getPointAtLength(t){return ue.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,e,i,r){return Math.sqrt((i-t)*(i-t)+(r-e)*(r-e))}static getPathLength(t){let e=0;for(var i=0;i<t.length;++i)e+=t[i].pathLength;return e}static getPointAtLengthOfDataArray(t,e){var i,r=0,s=e.length;if(!s)return null;for(;r<s&&t>e[r].pathLength;)t-=e[r].pathLength,++r;if(r===s)return i=e[r-1].points.slice(-2),{x:i[0],y:i[1]};if(t<.01)return i=e[r].points.slice(0,2),{x:i[0],y:i[1]};var a=e[r],o=a.points;switch(a.command){case"L":return ue.getPointOnLine(t,a.start.x,a.start.y,o[0],o[1]);case"C":return ue.getPointOnCubicBezier((0,ar.t2length)(t,ue.getPathLength(e),v=>(0,ar.getCubicArcLength)([a.start.x,o[0],o[2],o[4]],[a.start.y,o[1],o[3],o[5]],v)),a.start.x,a.start.y,o[0],o[1],o[2],o[3],o[4],o[5]);case"Q":return ue.getPointOnQuadraticBezier((0,ar.t2length)(t,ue.getPathLength(e),v=>(0,ar.getQuadraticArcLength)([a.start.x,o[0],o[2]],[a.start.y,o[1],o[3]],v)),a.start.x,a.start.y,o[0],o[1],o[2],o[3]);case"A":var h=o[0],l=o[1],c=o[2],d=o[3],f=o[4],u=o[5],m=o[6];return f+=u*t/a.pathLength,ue.getPointOnEllipticalArc(h,l,c,d,f,m)}return null}static getPointOnLine(t,e,i,r,s,a,o){a===void 0&&(a=e),o===void 0&&(o=i);var h=(s-i)/(r-e+1e-8),l=Math.sqrt(t*t/(1+h*h));r<e&&(l*=-1);var c=h*l,d;if(r===e)d={x:a,y:o+c};else if((o-i)/(a-e+1e-8)===h)d={x:a+l,y:o+c};else{var f,u,m=this.getLineLength(e,i,r,s),v=(a-e)*(r-e)+(o-i)*(s-i);v=v/(m*m),f=e+v*(r-e),u=i+v*(s-i);var b=this.getLineLength(a,o,f,u),S=Math.sqrt(t*t-b*b);l=Math.sqrt(S*S/(1+h*h)),r<e&&(l*=-1),c=h*l,d={x:f+l,y:u+c}}return d}static getPointOnCubicBezier(t,e,i,r,s,a,o,h,l){function c(b){return b*b*b}function d(b){return 3*b*b*(1-b)}function f(b){return 3*b*(1-b)*(1-b)}function u(b){return(1-b)*(1-b)*(1-b)}var m=h*c(t)+a*d(t)+r*f(t)+e*u(t),v=l*c(t)+o*d(t)+s*f(t)+i*u(t);return{x:m,y:v}}static getPointOnQuadraticBezier(t,e,i,r,s,a,o){function h(u){return u*u}function l(u){return 2*u*(1-u)}function c(u){return(1-u)*(1-u)}var d=a*h(t)+r*l(t)+e*c(t),f=o*h(t)+s*l(t)+i*c(t);return{x:d,y:f}}static getPointOnEllipticalArc(t,e,i,r,s,a){var o=Math.cos(a),h=Math.sin(a),l={x:i*Math.cos(s),y:r*Math.sin(s)};return{x:t+(l.x*o-l.y*h),y:e+(l.x*h+l.y*o)}}static parsePathData(t){if(!t)return[];var e=t,i=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];e=e.replace(new RegExp(" ","g"),",");for(var r=0;r<i.length;r++)e=e.replace(new RegExp(i[r],"g"),"|"+i[r]);var s=e.split("|"),a=[],o=[],h=0,l=0,c=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,d;for(r=1;r<s.length;r++){var f=s[r],u=f.charAt(0);for(f=f.slice(1),o.length=0;d=c.exec(f);)o.push(d[0]);for(var m=[],v=0,b=o.length;v<b;v++){if(o[v]==="00"){m.push(0,0);continue}var S=parseFloat(o[v]);isNaN(S)?m.push(0):m.push(S)}for(;m.length>0&&!isNaN(m[0]);){var E="",_=[],x=h,P=l,R,F,L,$,U,z,q,K,Z,at;switch(u){case"l":h+=m.shift(),l+=m.shift(),E="L",_.push(h,l);break;case"L":h=m.shift(),l=m.shift(),_.push(h,l);break;case"m":var vt=m.shift(),_t=m.shift();if(h+=vt,l+=_t,E="M",a.length>2&&a[a.length-1].command==="z"){for(var pt=a.length-2;pt>=0;pt--)if(a[pt].command==="M"){h=a[pt].points[0]+vt,l=a[pt].points[1]+_t;break}}_.push(h,l),u="l";break;case"M":h=m.shift(),l=m.shift(),E="M",_.push(h,l),u="L";break;case"h":h+=m.shift(),E="L",_.push(h,l);break;case"H":h=m.shift(),E="L",_.push(h,l);break;case"v":l+=m.shift(),E="L",_.push(h,l);break;case"V":l=m.shift(),E="L",_.push(h,l);break;case"C":_.push(m.shift(),m.shift(),m.shift(),m.shift()),h=m.shift(),l=m.shift(),_.push(h,l);break;case"c":_.push(h+m.shift(),l+m.shift(),h+m.shift(),l+m.shift()),h+=m.shift(),l+=m.shift(),E="C",_.push(h,l);break;case"S":F=h,L=l,R=a[a.length-1],R.command==="C"&&(F=h+(h-R.points[2]),L=l+(l-R.points[3])),_.push(F,L,m.shift(),m.shift()),h=m.shift(),l=m.shift(),E="C",_.push(h,l);break;case"s":F=h,L=l,R=a[a.length-1],R.command==="C"&&(F=h+(h-R.points[2]),L=l+(l-R.points[3])),_.push(F,L,h+m.shift(),l+m.shift()),h+=m.shift(),l+=m.shift(),E="C",_.push(h,l);break;case"Q":_.push(m.shift(),m.shift()),h=m.shift(),l=m.shift(),_.push(h,l);break;case"q":_.push(h+m.shift(),l+m.shift()),h+=m.shift(),l+=m.shift(),E="Q",_.push(h,l);break;case"T":F=h,L=l,R=a[a.length-1],R.command==="Q"&&(F=h+(h-R.points[0]),L=l+(l-R.points[1])),h=m.shift(),l=m.shift(),E="Q",_.push(F,L,h,l);break;case"t":F=h,L=l,R=a[a.length-1],R.command==="Q"&&(F=h+(h-R.points[0]),L=l+(l-R.points[1])),h+=m.shift(),l+=m.shift(),E="Q",_.push(F,L,h,l);break;case"A":$=m.shift(),U=m.shift(),z=m.shift(),q=m.shift(),K=m.shift(),Z=h,at=l,h=m.shift(),l=m.shift(),E="A",_=this.convertEndpointToCenterParameterization(Z,at,h,l,q,K,$,U,z);break;case"a":$=m.shift(),U=m.shift(),z=m.shift(),q=m.shift(),K=m.shift(),Z=h,at=l,h+=m.shift(),l+=m.shift(),E="A",_=this.convertEndpointToCenterParameterization(Z,at,h,l,q,K,$,U,z);break}a.push({command:E||u,points:_,start:{x,y:P},pathLength:this.calcLength(x,P,E||u,_)})}(u==="z"||u==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,e,i,r){var s,a,o,h,l=ue;switch(i){case"L":return l.getLineLength(t,e,r[0],r[1]);case"C":return(0,ar.getCubicArcLength)([t,r[0],r[2],r[4]],[e,r[1],r[3],r[5]],1);case"Q":return(0,ar.getQuadraticArcLength)([t,r[0],r[2]],[e,r[1],r[3]],1);case"A":s=0;var c=r[4],d=r[5],f=r[4]+d,u=Math.PI/180;if(Math.abs(c-f)<u&&(u=Math.abs(c-f)),a=l.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],c,0),d<0)for(h=c-u;h>f;h-=u)o=l.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],h,0),s+=l.getLineLength(a.x,a.y,o.x,o.y),a=o;else for(h=c+u;h<f;h+=u)o=l.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],h,0),s+=l.getLineLength(a.x,a.y,o.x,o.y),a=o;return o=l.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],f,0),s+=l.getLineLength(a.x,a.y,o.x,o.y),s}return 0}static convertEndpointToCenterParameterization(t,e,i,r,s,a,o,h,l){var c=l*(Math.PI/180),d=Math.cos(c)*(t-i)/2+Math.sin(c)*(e-r)/2,f=-1*Math.sin(c)*(t-i)/2+Math.cos(c)*(e-r)/2,u=d*d/(o*o)+f*f/(h*h);u>1&&(o*=Math.sqrt(u),h*=Math.sqrt(u));var m=Math.sqrt((o*o*(h*h)-o*o*(f*f)-h*h*(d*d))/(o*o*(f*f)+h*h*(d*d)));s===a&&(m*=-1),isNaN(m)&&(m=0);var v=m*o*f/h,b=m*-h*d/o,S=(t+i)/2+Math.cos(c)*v-Math.sin(c)*b,E=(e+r)/2+Math.sin(c)*v+Math.cos(c)*b,_=function(U){return Math.sqrt(U[0]*U[0]+U[1]*U[1])},x=function(U,z){return(U[0]*z[0]+U[1]*z[1])/(_(U)*_(z))},P=function(U,z){return(U[0]*z[1]<U[1]*z[0]?-1:1)*Math.acos(x(U,z))},R=P([1,0],[(d-v)/o,(f-b)/h]),F=[(d-v)/o,(f-b)/h],L=[(-1*d-v)/o,(-1*f-b)/h],$=P(F,L);return x(F,L)<=-1&&($=Math.PI),x(F,L)>=1&&($=0),a===0&&$>0&&($=$-2*Math.PI),a===1&&$<0&&($=$+2*Math.PI),[S,E,o,h,R,$,c,a]}}Dd=vs.Path=ue,ue.prototype.className="Path",ue.prototype._attrsAffectingSize=["data"],(0,t3._registerNode)(ue),J5.Factory.addGetterSetter(ue,"data");const hl=St(xt({__proto__:null,get Path(){return Dd},default:vs},[vs]));Object.defineProperty(ps,"__esModule",{value:!0});var Ld=ps.Arrow=void 0;const Za=Ft,e3=Rd,Id=Gt,i3=Nt,Od=hl;class Pn extends e3.Line{_sceneFunc(t){super._sceneFunc(t);var e=Math.PI*2,i=this.points(),r=i,s=this.tension()!==0&&i.length>4;s&&(r=this.getTensionPoints());var a=this.pointerLength(),o=i.length,h,l;if(s){const f=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],i[o-2],i[o-1]],u=Od.Path.calcLength(r[r.length-4],r[r.length-3],"C",f),m=Od.Path.getPointOnQuadraticBezier(Math.min(1,1-a/u),f[0],f[1],f[2],f[3],f[4],f[5]);h=i[o-2]-m.x,l=i[o-1]-m.y}else h=i[o-2]-i[o-4],l=i[o-1]-i[o-3];var c=(Math.atan2(l,h)+e)%e,d=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(i[o-2],i[o-1]),t.rotate(c),t.moveTo(0,0),t.lineTo(-a,d/2),t.lineTo(-a,-d/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(i[0],i[1]),s?(h=(r[0]+r[2])/2-i[0],l=(r[1]+r[3])/2-i[1]):(h=i[2]-i[0],l=i[3]-i[1]),t.rotate((Math.atan2(-l,-h)+e)%e),t.moveTo(0,0),t.lineTo(-a,d/2),t.lineTo(-a,-d/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var e=this.dashEnabled();e&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),e&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),e=this.pointerWidth()/2;return{x:t.x-e,y:t.y-e,width:t.width+e*2,height:t.height+e*2}}}Ld=ps.Arrow=Pn,Pn.prototype.className="Arrow",(0,i3._registerNode)(Pn),Za.Factory.addGetterSetter(Pn,"pointerLength",10,(0,Id.getNumberValidator)()),Za.Factory.addGetterSetter(Pn,"pointerWidth",10,(0,Id.getNumberValidator)()),Za.Factory.addGetterSetter(Pn,"pointerAtBeginning",!1),Za.Factory.addGetterSetter(Pn,"pointerAtEnding",!0);const n3=St(xt({__proto__:null,get Arrow(){return Ld},default:ps},[ps]));var _s={};Object.defineProperty(_s,"__esModule",{value:!0});var Fd=_s.Circle=void 0;const r3=Ft,s3=me,a3=Gt,o3=Nt;class or extends s3.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}}Fd=_s.Circle=or,or.prototype._centroid=!0,or.prototype.className="Circle",or.prototype._attrsAffectingSize=["radius"],(0,o3._registerNode)(or),r3.Factory.addGetterSetter(or,"radius",0,(0,a3.getNumberValidator)());const h3=St(xt({__proto__:null,get Circle(){return Fd},default:_s},[_s]));var ys={};Object.defineProperty(ys,"__esModule",{value:!0});var Nd=ys.Ellipse=void 0;const ll=Ft,l3=me,Gd=Gt,c3=Nt;class Qi extends l3.Shape{_sceneFunc(t){var e=this.radiusX(),i=this.radiusY();t.beginPath(),t.save(),e!==i&&t.scale(1,i/e),t.arc(0,0,e,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}Nd=ys.Ellipse=Qi,Qi.prototype.className="Ellipse",Qi.prototype._centroid=!0,Qi.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,c3._registerNode)(Qi),ll.Factory.addComponentsGetterSetter(Qi,"radius",["x","y"]),ll.Factory.addGetterSetter(Qi,"radiusX",0,(0,Gd.getNumberValidator)()),ll.Factory.addGetterSetter(Qi,"radiusY",0,(0,Gd.getNumberValidator)());const u3=St(xt({__proto__:null,get Ellipse(){return Nd},default:ys},[ys]));var ws={};Object.defineProperty(ws,"__esModule",{value:!0});var Ud=ws.Image=void 0;const cl=re,An=Ft,f3=me,d3=Nt,bs=Gt;let oi=class P1 extends f3.Shape{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const e=this.getWidth(),i=this.getHeight(),r=this.cornerRadius(),s=this.attrs.image;let a;if(s){const o=this.attrs.cropWidth,h=this.attrs.cropHeight;o&&h?a=[s,this.cropX(),this.cropY(),o,h,0,0,e,i]:a=[s,0,0,e,i]}(this.hasFill()||this.hasStroke()||r)&&(t.beginPath(),r?cl.Util.drawRoundedRectPath(t,e,i,r):t.rect(0,0,e,i),t.closePath(),t.fillStrokeShape(this)),s&&(r&&t.clip(),t.drawImage.apply(t,a))}_hitFunc(t){var e=this.width(),i=this.height(),r=this.cornerRadius();t.beginPath(),r?cl.Util.drawRoundedRectPath(t,e,i,r):t.rect(0,0,e,i),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,e;return(t=this.attrs.width)!==null&&t!==void 0?t:(e=this.image())===null||e===void 0?void 0:e.width}getHeight(){var t,e;return(t=this.attrs.height)!==null&&t!==void 0?t:(e=this.image())===null||e===void 0?void 0:e.height}static fromURL(t,e,i=null){var r=cl.Util.createImageElement();r.onload=function(){var s=new P1({image:r});e(s)},r.onerror=i,r.crossOrigin="Anonymous",r.src=t}};Ud=ws.Image=oi,oi.prototype.className="Image",(0,d3._registerNode)(oi),An.Factory.addGetterSetter(oi,"cornerRadius",0,(0,bs.getNumberOrArrayOfNumbersValidator)(4)),An.Factory.addGetterSetter(oi,"image"),An.Factory.addComponentsGetterSetter(oi,"crop",["x","y","width","height"]),An.Factory.addGetterSetter(oi,"cropX",0,(0,bs.getNumberValidator)()),An.Factory.addGetterSetter(oi,"cropY",0,(0,bs.getNumberValidator)()),An.Factory.addGetterSetter(oi,"cropWidth",0,(0,bs.getNumberValidator)()),An.Factory.addGetterSetter(oi,"cropHeight",0,(0,bs.getNumberValidator)());const g3=St(xt({__proto__:null,get Image(){return Ud},default:ws},[ws]));var Mn={};Object.defineProperty(Mn,"__esModule",{value:!0});var Bd=Mn.Tag=Vd=Mn.Label=void 0;const Ja=Ft,p3=me,m3=el,ul=Gt,zd=Nt;var $d=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],v3="Change.konva",_3="none",fl="up",dl="right",gl="down",pl="left",y3=$d.length;class ml extends m3.Group{constructor(t){super(t),this.on("add.konva",function(e){this._addListeners(e.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var e=this,i,r=function(){e._sync()};for(i=0;i<y3;i++)t.on($d[i]+v3,r)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var t=this.getText(),e=this.getTag(),i,r,s,a,o,h,l;if(t&&e){switch(i=t.width(),r=t.height(),s=e.pointerDirection(),a=e.pointerWidth(),l=e.pointerHeight(),o=0,h=0,s){case fl:o=i/2,h=-1*l;break;case dl:o=i+a,h=r/2;break;case gl:o=i/2,h=r+l;break;case pl:o=-1*a,h=r/2;break}e.setAttrs({x:-1*o,y:-1*h,width:i,height:r}),t.setAttrs({x:-1*o,y:-1*h})}}}var Vd=Mn.Label=ml;ml.prototype.className="Label",(0,zd._registerNode)(ml);class Rn extends p3.Shape{_sceneFunc(t){var e=this.width(),i=this.height(),r=this.pointerDirection(),s=this.pointerWidth(),a=this.pointerHeight(),o=this.cornerRadius();let h=0,l=0,c=0,d=0;typeof o=="number"?h=l=c=d=Math.min(o,e/2,i/2):(h=Math.min(o[0]||0,e/2,i/2),l=Math.min(o[1]||0,e/2,i/2),d=Math.min(o[2]||0,e/2,i/2),c=Math.min(o[3]||0,e/2,i/2)),t.beginPath(),t.moveTo(h,0),r===fl&&(t.lineTo((e-s)/2,0),t.lineTo(e/2,-1*a),t.lineTo((e+s)/2,0)),t.lineTo(e-l,0),t.arc(e-l,l,l,Math.PI*3/2,0,!1),r===dl&&(t.lineTo(e,(i-a)/2),t.lineTo(e+s,i/2),t.lineTo(e,(i+a)/2)),t.lineTo(e,i-d),t.arc(e-d,i-d,d,0,Math.PI/2,!1),r===gl&&(t.lineTo((e+s)/2,i),t.lineTo(e/2,i+a),t.lineTo((e-s)/2,i)),t.lineTo(c,i),t.arc(c,i-c,c,Math.PI/2,Math.PI,!1),r===pl&&(t.lineTo(0,(i+a)/2),t.lineTo(-1*s,i/2),t.lineTo(0,(i-a)/2)),t.lineTo(0,h),t.arc(h,h,h,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){var t=0,e=0,i=this.pointerWidth(),r=this.pointerHeight(),s=this.pointerDirection(),a=this.width(),o=this.height();return s===fl?(e-=r,o+=r):s===gl?o+=r:s===pl?(t-=i*1.5,a+=i):s===dl&&(a+=i*1.5),{x:t,y:e,width:a,height:o}}}Bd=Mn.Tag=Rn,Rn.prototype.className="Tag",(0,zd._registerNode)(Rn),Ja.Factory.addGetterSetter(Rn,"pointerDirection",_3),Ja.Factory.addGetterSetter(Rn,"pointerWidth",0,(0,ul.getNumberValidator)()),Ja.Factory.addGetterSetter(Rn,"pointerHeight",0,(0,ul.getNumberValidator)()),Ja.Factory.addGetterSetter(Rn,"cornerRadius",0,(0,ul.getNumberOrArrayOfNumbersValidator)(4));const w3=St(xt({__proto__:null,get Label(){return Vd},get Tag(){return Bd},default:Mn},[Mn]));var xs={};Object.defineProperty(xs,"__esModule",{value:!0});var Hd=xs.Rect=void 0;const b3=Ft,x3=me,S3=Nt,C3=re,T3=Gt;class Qa extends x3.Shape{_sceneFunc(t){var e=this.cornerRadius(),i=this.width(),r=this.height();t.beginPath(),e?C3.Util.drawRoundedRectPath(t,i,r,e):t.rect(0,0,i,r),t.closePath(),t.fillStrokeShape(this)}}Hd=xs.Rect=Qa,Qa.prototype.className="Rect",(0,S3._registerNode)(Qa),b3.Factory.addGetterSetter(Qa,"cornerRadius",0,(0,T3.getNumberOrArrayOfNumbersValidator)(4));const jd=St(xt({__proto__:null,get Rect(){return Hd},default:xs},[xs]));var Ss={};Object.defineProperty(Ss,"__esModule",{value:!0});var Xd=Ss.RegularPolygon=void 0;const Yd=Ft,k3=me,qd=Gt,E3=Nt;class Dn extends k3.Shape{_sceneFunc(t){const e=this._getPoints();t.beginPath(),t.moveTo(e[0].x,e[0].y);for(var i=1;i<e.length;i++)t.lineTo(e[i].x,e[i].y);t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,e=this.attrs.radius||0,i=[];for(var r=0;r<t;r++)i.push({x:e*Math.sin(r*2*Math.PI/t),y:-1*e*Math.cos(r*2*Math.PI/t)});return i}getSelfRect(){const t=this._getPoints();var e=t[0].x,i=t[0].y,r=t[0].x,s=t[0].y;return t.forEach(a=>{e=Math.min(e,a.x),i=Math.max(i,a.x),r=Math.min(r,a.y),s=Math.max(s,a.y)}),{x:e,y:r,width:i-e,height:s-r}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}Xd=Ss.RegularPolygon=Dn,Dn.prototype.className="RegularPolygon",Dn.prototype._centroid=!0,Dn.prototype._attrsAffectingSize=["radius"],(0,E3._registerNode)(Dn),Yd.Factory.addGetterSetter(Dn,"radius",0,(0,qd.getNumberValidator)()),Yd.Factory.addGetterSetter(Dn,"sides",0,(0,qd.getNumberValidator)());const P3=St(xt({__proto__:null,get RegularPolygon(){return Xd},default:Ss},[Ss]));var Cs={};Object.defineProperty(Cs,"__esModule",{value:!0});var Wd=Cs.Ring=void 0;const Kd=Ft,A3=me,Zd=Gt,M3=Nt;var Jd=Math.PI*2;class Ln extends A3.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,Jd,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),Jd,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}Wd=Cs.Ring=Ln,Ln.prototype.className="Ring",Ln.prototype._centroid=!0,Ln.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,M3._registerNode)(Ln),Kd.Factory.addGetterSetter(Ln,"innerRadius",0,(0,Zd.getNumberValidator)()),Kd.Factory.addGetterSetter(Ln,"outerRadius",0,(0,Zd.getNumberValidator)());const R3=St(xt({__proto__:null,get Ring(){return Wd},default:Cs},[Cs]));var Ts={};Object.defineProperty(Ts,"__esModule",{value:!0});var Qd=Ts.Sprite=void 0;const In=Ft,D3=me,L3=rl,t0=Gt,I3=Nt;class hi extends D3.Shape{constructor(t){super(t),this._updated=!0,this.anim=new L3.Animation(()=>{var e=this._updated;return this._updated=!1,e}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var e=this.animation(),i=this.frameIndex(),r=i*4,s=this.animations()[e],a=this.frameOffsets(),o=s[r+0],h=s[r+1],l=s[r+2],c=s[r+3],d=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,l,c),t.closePath(),t.fillStrokeShape(this)),d)if(a){var f=a[e],u=i*2;t.drawImage(d,o,h,l,c,f[u+0],f[u+1],l,c)}else t.drawImage(d,o,h,l,c,0,0,l,c)}_hitFunc(t){var e=this.animation(),i=this.frameIndex(),r=i*4,s=this.animations()[e],a=this.frameOffsets(),o=s[r+2],h=s[r+3];if(t.beginPath(),a){var l=a[e],c=i*2;t.rect(l[c+0],l[c+1],o,h)}else t.rect(0,0,o,h);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),e=this.animation(),i=this.animations(),r=i[e],s=r.length/4;t<s-1?this.frameIndex(t+1):this.frameIndex(0)}}Qd=Ts.Sprite=hi,hi.prototype.className="Sprite",(0,I3._registerNode)(hi),In.Factory.addGetterSetter(hi,"animation"),In.Factory.addGetterSetter(hi,"animations"),In.Factory.addGetterSetter(hi,"frameOffsets"),In.Factory.addGetterSetter(hi,"image"),In.Factory.addGetterSetter(hi,"frameIndex",0,(0,t0.getNumberValidator)()),In.Factory.addGetterSetter(hi,"frameRate",17,(0,t0.getNumberValidator)()),In.Factory.backCompat(hi,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});const O3=St(xt({__proto__:null,get Sprite(){return Qd},default:Ts},[Ts]));var ks={};Object.defineProperty(ks,"__esModule",{value:!0});var e0=ks.Star=void 0;const vl=Ft,F3=me,_l=Gt,N3=Nt;class tn extends F3.Shape{_sceneFunc(t){var e=this.innerRadius(),i=this.outerRadius(),r=this.numPoints();t.beginPath(),t.moveTo(0,0-i);for(var s=1;s<r*2;s++){var a=s%2===0?i:e,o=a*Math.sin(s*Math.PI/r),h=-1*a*Math.cos(s*Math.PI/r);t.lineTo(o,h)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}e0=ks.Star=tn,tn.prototype.className="Star",tn.prototype._centroid=!0,tn.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,N3._registerNode)(tn),vl.Factory.addGetterSetter(tn,"numPoints",5,(0,_l.getNumberValidator)()),vl.Factory.addGetterSetter(tn,"innerRadius",0,(0,_l.getNumberValidator)()),vl.Factory.addGetterSetter(tn,"outerRadius",0,(0,_l.getNumberValidator)());const G3=St(xt({__proto__:null,get Star(){return e0},default:ks},[ks]));var On={};Object.defineProperty(On,"__esModule",{value:!0});var i0=On.Text=r0=On.stringToArray=void 0;const yl=re,xe=Ft,U3=me,en=Gt,B3=Nt;function n0(n){return Array.from(n)}var r0=On.stringToArray=n0,hr="auto",z3="center",s0="inherit",Es="justify",$3="Change.konva",V3="2d",a0="-",o0="left",H3="text",j3="Text",X3="top",Y3="bottom",h0="middle",l0="normal",q3="px ",to=" ",W3="right",c0="rtl",K3="word",Z3="char",u0="none",wl="…",f0=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],J3=f0.length;function Q3(n){return n.split(",").map(t=>{t=t.trim();const e=t.indexOf(" ")>=0,i=t.indexOf('"')>=0||t.indexOf("'")>=0;return e&&!i&&(t=`"${t}"`),t}).join(", ")}var eo;function bl(){return eo||(eo=yl.Util.createCanvasElement().getContext(V3),eo)}function ty(n){n.fillText(this._partialText,this._partialTextX,this._partialTextY)}function ey(n){n.setAttr("miterLimit",2),n.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function iy(n){return n=n||{},!n.fillLinearGradientColorStops&&!n.fillRadialGradientColorStops&&!n.fillPatternImage&&(n.fill=n.fill||"black"),n}class ae extends U3.Shape{constructor(t){super(iy(t)),this._partialTextX=0,this._partialTextY=0;for(var e=0;e<J3;e++)this.on(f0[e]+$3,this._setTextData);this._setTextData()}_sceneFunc(t){var e=this.textArr,i=e.length;if(this.text()){var r=this.padding(),s=this.fontSize(),a=this.lineHeight()*s,o=this.verticalAlign(),h=this.direction(),l=0,c=this.align(),d=this.getWidth(),f=this.letterSpacing(),u=this.fill(),m=this.textDecoration(),v=m.indexOf("underline")!==-1,b=m.indexOf("line-through")!==-1,S;h=h===s0?t.direction:h;var E=0,E=a/2,_=0,x=0;for(h===c0&&t.setAttr("direction",h),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",h0),t.setAttr("textAlign",o0),o===h0?l=(this.getHeight()-i*a-r*2)/2:o===Y3&&(l=this.getHeight()-i*a-r*2),t.translate(r,l+r),S=0;S<i;S++){var _=0,x=0,P=e[S],R=P.text,F=P.width,L=P.lastInParagraph,$,U,z;if(t.save(),c===W3?_+=d-F-r*2:c===z3&&(_+=(d-F-r*2)/2),v){t.save(),t.beginPath(),t.moveTo(_,E+x+Math.round(s/2)),$=R.split(" ").length-1,U=$===0,z=c===Es&&!L?d-r*2:F,t.lineTo(_+Math.round(z),E+x+Math.round(s/2)),t.lineWidth=s/15;const _t=this._getLinearGradient();t.strokeStyle=_t||u,t.stroke(),t.restore()}if(b){t.save(),t.beginPath(),t.moveTo(_,E+x),$=R.split(" ").length-1,U=$===0,z=c===Es&&L&&!U?d-r*2:F,t.lineTo(_+Math.round(z),E+x),t.lineWidth=s/15;const _t=this._getLinearGradient();t.strokeStyle=_t||u,t.stroke(),t.restore()}if(h!==c0&&(f!==0||c===Es)){$=R.split(" ").length-1;for(var q=n0(R),K=0;K<q.length;K++){var Z=q[K];Z===" "&&!L&&c===Es&&(_+=(d-r*2-F)/$),this._partialTextX=_,this._partialTextY=E+x,this._partialText=Z,t.fillStrokeShape(this),_+=this.measureSize(Z).width+f}}else f!==0&&t.setAttr("letterSpacing",`${f}px`),this._partialTextX=_,this._partialTextY=E+x,this._partialText=R,t.fillStrokeShape(this);t.restore(),i>1&&(E+=a)}}}_hitFunc(t){var e=this.getWidth(),i=this.getHeight();t.beginPath(),t.rect(0,0,e,i),t.closePath(),t.fillStrokeShape(this)}setText(t){var e=yl.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(H3,e),this}getWidth(){var t=this.attrs.width===hr||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===hr||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return yl.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var e=bl(),i=this.fontSize(),r;return e.save(),e.font=this._getContextFont(),r=e.measureText(t),e.restore(),{width:r.width,height:i}}_getContextFont(){return this.fontStyle()+to+this.fontVariant()+to+(this.fontSize()+q3)+Q3(this.fontFamily())}_addTextLine(t){this.align()===Es&&(t=t.trim());var i=this._getTextWidth(t);return this.textArr.push({text:t,width:i,lastInParagraph:!1})}_getTextWidth(t){var e=this.letterSpacing(),i=t.length;return bl().measureText(t).width+(i?e*(i-1):0)}_setTextData(){var t=this.text().split(`
44
- `),e=+this.fontSize(),i=0,r=this.lineHeight()*e,s=this.attrs.width,a=this.attrs.height,o=s!==hr&&s!==void 0,h=a!==hr&&a!==void 0,l=this.padding(),c=s-l*2,d=a-l*2,f=0,u=this.wrap(),m=u!==u0,v=u!==Z3&&m,b=this.ellipsis();this.textArr=[],bl().font=this._getContextFont();for(var S=b?this._getTextWidth(wl):0,E=0,_=t.length;E<_;++E){var x=t[E],P=this._getTextWidth(x);if(o&&P>c)for(;x.length>0;){for(var R=0,F=x.length,L="",$=0;R<F;){var U=R+F>>>1,z=x.slice(0,U+1),q=this._getTextWidth(z)+S;q<=c?(R=U+1,L=z,$=q):F=U}if(L){if(v){var K,Z=x[L.length],at=Z===to||Z===a0;at&&$<=c?K=L.length:K=Math.max(L.lastIndexOf(to),L.lastIndexOf(a0))+1,K>0&&(R=K,L=L.slice(0,R),$=this._getTextWidth(L))}L=L.trimRight(),this._addTextLine(L),i=Math.max(i,$),f+=r;var vt=this._shouldHandleEllipsis(f);if(vt){this._tryToAddEllipsisToLastLine();break}if(x=x.slice(R),x=x.trimLeft(),x.length>0&&(P=this._getTextWidth(x),P<=c)){this._addTextLine(x),f+=r,i=Math.max(i,P);break}}else break}else this._addTextLine(x),f+=r,i=Math.max(i,P),this._shouldHandleEllipsis(f)&&E<_-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),h&&f+r>d)break}this.textHeight=e,this.textWidth=i}_shouldHandleEllipsis(t){var e=+this.fontSize(),i=this.lineHeight()*e,r=this.attrs.height,s=r!==hr&&r!==void 0,a=this.padding(),o=r-a*2,h=this.wrap(),l=h!==u0;return!l||s&&t+i>o}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,e=t!==hr&&t!==void 0,i=this.padding(),r=t-i*2,s=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!s)){if(e){var o=this._getTextWidth(a.text+wl)<r;o||(a.text=a.text.slice(0,a.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(a.text+wl)}}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const t=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,e=this.hasShadow();return t&&e?!0:super._useBufferCanvas()}}i0=On.Text=ae,ae.prototype._fillFunc=ty,ae.prototype._strokeFunc=ey,ae.prototype.className=j3,ae.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],(0,B3._registerNode)(ae),xe.Factory.overWriteSetter(ae,"width",(0,en.getNumberOrAutoValidator)()),xe.Factory.overWriteSetter(ae,"height",(0,en.getNumberOrAutoValidator)()),xe.Factory.addGetterSetter(ae,"direction",s0),xe.Factory.addGetterSetter(ae,"fontFamily","Arial"),xe.Factory.addGetterSetter(ae,"fontSize",12,(0,en.getNumberValidator)()),xe.Factory.addGetterSetter(ae,"fontStyle",l0),xe.Factory.addGetterSetter(ae,"fontVariant",l0),xe.Factory.addGetterSetter(ae,"padding",0,(0,en.getNumberValidator)()),xe.Factory.addGetterSetter(ae,"align",o0),xe.Factory.addGetterSetter(ae,"verticalAlign",X3),xe.Factory.addGetterSetter(ae,"lineHeight",1,(0,en.getNumberValidator)()),xe.Factory.addGetterSetter(ae,"wrap",K3),xe.Factory.addGetterSetter(ae,"ellipsis",!1,(0,en.getBooleanValidator)()),xe.Factory.addGetterSetter(ae,"letterSpacing",0,(0,en.getNumberValidator)()),xe.Factory.addGetterSetter(ae,"text","",(0,en.getStringValidator)()),xe.Factory.addGetterSetter(ae,"textDecoration","");const d0=St(xt({__proto__:null,get Text(){return i0},default:On,get stringToArray(){return r0}},[On]));var Ps={};Object.defineProperty(Ps,"__esModule",{value:!0});var g0=Ps.TextPath=void 0;const xl=re,Ze=Ft,ny=me,As=hl,Sl=d0,p0=Gt,ry=Nt;var sy="",m0="normal";function v0(n){n.fillText(this.partialText,0,0)}function _0(n){n.strokeText(this.partialText,0,0)}class fe extends ny.Shape{constructor(t){super(t),this.dummyCanvas=xl.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return As.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const e=this.pathLength;return t-1>e?null:As.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=As.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();var e=this.textDecoration(),i=this.fill(),r=this.fontSize(),s=this.glyphInfo;e==="underline"&&t.beginPath();for(var a=0;a<s.length;a++){t.save();var o=s[a].p0;t.translate(o.x,o.y),t.rotate(s[a].rotation),this.partialText=s[a].text,t.fillStrokeShape(this),e==="underline"&&(a===0&&t.moveTo(0,r/2+1),t.lineTo(r,r/2+1)),t.restore()}e==="underline"&&(t.strokeStyle=i,t.lineWidth=r/20,t.stroke()),t.restore()}_hitFunc(t){t.beginPath();var e=this.glyphInfo;if(e.length>=1){var i=e[0].p0;t.moveTo(i.x,i.y)}for(var r=0;r<e.length;r++){var s=e[r].p1;t.lineTo(s.x,s.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return xl.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return Sl.Text.prototype.setText.call(this,t)}_getContextFont(){return Sl.Text.prototype._getContextFont.call(this)}_getTextSize(t){var e=this.dummyCanvas,i=e.getContext("2d");i.save(),i.font=this._getContextFont();var r=i.measureText(t);return i.restore(),{width:r.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:t,height:e}=this._getTextSize(this.attrs.text);if(this.textWidth=t,this.textHeight=e,this.glyphInfo=[],!this.attrs.data)return null;const i=this.letterSpacing(),r=this.align(),s=this.kerningFunc(),a=Math.max(this.textWidth+((this.attrs.text||"").length-1)*i,0);let o=0;r==="center"&&(o=Math.max(0,this.pathLength/2-a/2)),r==="right"&&(o=Math.max(0,this.pathLength-a));const h=(0,Sl.stringToArray)(this.text());let l=o;for(var c=0;c<h.length;c++){const d=this._getPointAtLength(l);if(!d)return;let f=this._getTextSize(h[c]).width+i;if(h[c]===" "&&r==="justify"){const E=this.text().split(" ").length-1;f+=(this.pathLength-a)/E}const u=this._getPointAtLength(l+f);if(!u)return;const m=As.Path.getLineLength(d.x,d.y,u.x,u.y);let v=0;if(s)try{v=s(h[c-1],h[c])*this.fontSize()}catch{v=0}d.x+=v,u.x+=v,this.textWidth+=v;const b=As.Path.getPointOnLine(v+m/2,d.x,d.y,u.x,u.y),S=Math.atan2(u.y-d.y,u.x-d.x);this.glyphInfo.push({transposeX:b.x,transposeY:b.y,text:h[c],rotation:S,p0:d,p1:u}),l+=f}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(c){t.push(c.p0.x),t.push(c.p0.y),t.push(c.p1.x),t.push(c.p1.y)});for(var e=t[0]||0,i=t[0]||0,r=t[1]||0,s=t[1]||0,a,o,h=0;h<t.length/2;h++)a=t[h*2],o=t[h*2+1],e=Math.min(e,a),i=Math.max(i,a),r=Math.min(r,o),s=Math.max(s,o);var l=this.fontSize();return{x:e-l/2,y:r-l/2,width:i-e+l,height:s-r+l}}destroy(){return xl.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}g0=Ps.TextPath=fe,fe.prototype._fillFunc=v0,fe.prototype._strokeFunc=_0,fe.prototype._fillFuncHit=v0,fe.prototype._strokeFuncHit=_0,fe.prototype.className="TextPath",fe.prototype._attrsAffectingSize=["text","fontSize","data"],(0,ry._registerNode)(fe),Ze.Factory.addGetterSetter(fe,"data"),Ze.Factory.addGetterSetter(fe,"fontFamily","Arial"),Ze.Factory.addGetterSetter(fe,"fontSize",12,(0,p0.getNumberValidator)()),Ze.Factory.addGetterSetter(fe,"fontStyle",m0),Ze.Factory.addGetterSetter(fe,"align","left"),Ze.Factory.addGetterSetter(fe,"letterSpacing",0,(0,p0.getNumberValidator)()),Ze.Factory.addGetterSetter(fe,"textBaseline","middle"),Ze.Factory.addGetterSetter(fe,"fontVariant",m0),Ze.Factory.addGetterSetter(fe,"text",sy),Ze.Factory.addGetterSetter(fe,"textDecoration",null),Ze.Factory.addGetterSetter(fe,"kerningFunc",null);const ay=St(xt({__proto__:null,get TextPath(){return g0},default:Ps},[Ps]));var Ms={};Object.defineProperty(Ms,"__esModule",{value:!0});var y0=Ms.Transformer=void 0;const Kt=re,Yt=Ft,w0=le,oy=me,hy=jd,b0=el,Je=Nt,nn=Gt,ly=Nt;var x0="tr-konva",cy=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(n=>n+`.${x0}`).join(" "),S0="nodesRect",uy=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],fy={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const dy="ontouchstart"in Je.Konva._global;function gy(n,t,e){if(n==="rotater")return e;t+=Kt.Util.degToRad(fy[n]||0);var i=(Kt.Util.radToDeg(t)%360+360)%360;return Kt.Util._inRange(i,337.5,360)||Kt.Util._inRange(i,0,22.5)?"ns-resize":Kt.Util._inRange(i,22.5,67.5)?"nesw-resize":Kt.Util._inRange(i,67.5,112.5)?"ew-resize":Kt.Util._inRange(i,112.5,157.5)?"nwse-resize":Kt.Util._inRange(i,157.5,202.5)?"ns-resize":Kt.Util._inRange(i,202.5,247.5)?"nesw-resize":Kt.Util._inRange(i,247.5,292.5)?"ew-resize":Kt.Util._inRange(i,292.5,337.5)?"nwse-resize":(Kt.Util.error("Transformer has unknown angle for cursor detection: "+i),"pointer")}var io=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],C0=1e8;function py(n){return{x:n.x+n.width/2*Math.cos(n.rotation)+n.height/2*Math.sin(-n.rotation),y:n.y+n.height/2*Math.cos(n.rotation)+n.width/2*Math.sin(n.rotation)}}function T0(n,t,e){const i=e.x+(n.x-e.x)*Math.cos(t)-(n.y-e.y)*Math.sin(t),r=e.y+(n.x-e.x)*Math.sin(t)+(n.y-e.y)*Math.cos(t);return{...n,rotation:n.rotation+t,x:i,y:r}}function my(n,t){const e=py(n);return T0(n,t,e)}function vy(n,t,e){let i=t;for(let r=0;r<n.length;r++){const s=Je.Konva.getAngle(n[r]),a=Math.abs(s-t)%(Math.PI*2);Math.min(a,Math.PI*2-a)<e&&(i=s)}return i}class Ht extends b0.Group{constructor(t){super(t),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(cy,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return Kt.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return x0+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const e=t.filter(r=>r.isAncestorOf(this)?(Kt.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=t=e,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(r=>{const s=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},a=r._attrsAffectingSize.map(o=>o+"Change."+this._getEventNamespace()).join(" ");r.on(a,s),r.on(uy.map(o=>o+`.${this._getEventNamespace()}`).join(" "),s),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,s),this._proxyDrag(r)}),this._resetTransformCache();var i=!!this.findOne(".top-left");return i&&this.update(),this}_proxyDrag(t){let e;t.on(`dragstart.${this._getEventNamespace()}`,i=>{e=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(i,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,i=>{if(!e)return;const r=t.getAbsolutePosition(),s=r.x-e.x,a=r.y-e.y;this.nodes().forEach(o=>{if(o===t||o.isDragging())return;const h=o.getAbsolutePosition();o.setAbsolutePosition({x:h.x+s,y:h.y+a}),o.startDrag(i)}),e=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(S0),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(S0,this.__getNodeRect)}__getNodeShape(t,e=this.rotation(),i){var r=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),s=t.getAbsoluteScale(i),a=t.getAbsolutePosition(i),o=r.x*s.x-t.offsetX()*s.x,h=r.y*s.y-t.offsetY()*s.y;const l=(Je.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),c={x:a.x+o*Math.cos(l)+h*Math.sin(-l),y:a.y+h*Math.cos(l)+o*Math.sin(l),width:r.width*s.x,height:r.height*s.y,rotation:l};return T0(c,-Je.Konva.getAngle(e),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-C0,y:-C0,width:0,height:0,rotation:0};const e=[];this.nodes().map(l=>{const c=l.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var d=[{x:c.x,y:c.y},{x:c.x+c.width,y:c.y},{x:c.x+c.width,y:c.y+c.height},{x:c.x,y:c.y+c.height}],f=l.getAbsoluteTransform();d.forEach(function(u){var m=f.point(u);e.push(m)})});const i=new Kt.Transform;i.rotate(-Je.Konva.getAngle(this.rotation()));var r=1/0,s=1/0,a=-1/0,o=-1/0;e.forEach(function(l){var c=i.point(l);r===void 0&&(r=a=c.x,s=o=c.y),r=Math.min(r,c.x),s=Math.min(s,c.y),a=Math.max(a,c.x),o=Math.max(o,c.y)}),i.invert();const h=i.point({x:r,y:s});return{x:h.x,y:h.y,width:a-r,height:o-s,rotation:Je.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),io.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){var e=new hy.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:dy?10:"auto"}),i=this;e.on("mousedown touchstart",function(r){i._handleMouseDown(r)}),e.on("dragstart",r=>{e.stopDrag(),r.cancelBubble=!0}),e.on("dragend",r=>{r.cancelBubble=!0}),e.on("mouseenter",()=>{var r=Je.Konva.getAngle(this.rotation()),s=this.rotateAnchorCursor(),a=gy(t,r,s);e.getStage().content&&(e.getStage().content.style.cursor=a),this._cursorChange=!0}),e.on("mouseout",()=>{e.getStage().content&&(e.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(e)}_createBack(){var t=new oy.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(e,i){var r=i.getParent(),s=r.padding();e.beginPath(),e.rect(-s,-s,i.width()+s*2,i.height()+s*2),e.moveTo(i.width()/2,-s),r.rotateEnabled()&&e.lineTo(i.width()/2,-r.rotateAnchorOffset()*Kt.Util._sign(i.height())-s),e.fillStrokeShape(i)},hitFunc:(e,i)=>{if(this.shouldOverdrawWholeArea()){var r=this.padding();e.beginPath(),e.rect(-r,-r,i.width()+r*2,i.height()+r*2),e.fillStrokeShape(i)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",e=>{e.cancelBubble=!0}),t.on("dragmove",e=>{e.cancelBubble=!0}),t.on("dragend",e=>{e.cancelBubble=!0}),this.on("dragmove",e=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var e=this._getNodeRect(),i=e.width,r=e.height,s=Math.sqrt(Math.pow(i,2)+Math.pow(r,2));this.sin=Math.abs(r/s),this.cos=Math.abs(i/s),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var a=t.target.getAbsolutePosition(),o=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:o.x-a.x,y:o.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(h=>{h._fire("transformstart",{evt:t.evt,target:h})})}_handleMouseMove(t){var e,i,r,s=this.findOne("."+this._movingAnchorName),a=s.getStage();a.setPointersPositions(t);const o=a.getPointerPosition();let h={x:o.x-this._anchorDragOffset.x,y:o.y-this._anchorDragOffset.y};const l=s.getAbsolutePosition();this.anchorDragBoundFunc()&&(h=this.anchorDragBoundFunc()(l,h,t)),s.setAbsolutePosition(h);const c=s.getAbsolutePosition();if(!(l.x===c.x&&l.y===c.y)){if(this._movingAnchorName==="rotater"){var d=this._getNodeRect();e=s.x()-d.width/2,i=-s.y()+d.height/2;let K=Math.atan2(-i,e)+Math.PI/2;d.height<0&&(K-=Math.PI);var f=Je.Konva.getAngle(this.rotation());const Z=f+K,at=Je.Konva.getAngle(this.rotationSnapTolerance()),_t=vy(this.rotationSnaps(),Z,at)-d.rotation,pt=my(d,_t);this._fitNodesInto(pt,t);return}var u=this.shiftBehavior(),m;u==="inverted"?m=this.keepRatio()&&!t.shiftKey:u==="none"?m=this.keepRatio():m=this.keepRatio()||t.shiftKey;var _=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(m){var v=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(v.x-s.x(),2)+Math.pow(v.y-s.y(),2));var b=this.findOne(".top-left").x()>v.x?-1:1,S=this.findOne(".top-left").y()>v.y?-1:1;e=r*this.cos*b,i=r*this.sin*S,this.findOne(".top-left").x(v.x-e),this.findOne(".top-left").y(v.y-i)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(s.y());else if(this._movingAnchorName==="top-right"){if(m){var v=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(s.x()-v.x,2)+Math.pow(v.y-s.y(),2));var b=this.findOne(".top-right").x()<v.x?-1:1,S=this.findOne(".top-right").y()>v.y?-1:1;e=r*this.cos*b,i=r*this.sin*S,this.findOne(".top-right").x(v.x+e),this.findOne(".top-right").y(v.y-i)}var E=s.position();this.findOne(".top-left").y(E.y),this.findOne(".bottom-right").x(E.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(s.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(s.x());else if(this._movingAnchorName==="bottom-left"){if(m){var v=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(v.x-s.x(),2)+Math.pow(s.y()-v.y,2));var b=v.x<s.x()?-1:1,S=s.y()<v.y?-1:1;e=r*this.cos*b,i=r*this.sin*S,s.x(v.x-e),s.y(v.y+i)}E=s.position(),this.findOne(".top-left").x(E.x),this.findOne(".bottom-right").y(E.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(s.y());else if(this._movingAnchorName==="bottom-right"){if(m){var v=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};r=Math.sqrt(Math.pow(s.x()-v.x,2)+Math.pow(s.y()-v.y,2));var b=this.findOne(".bottom-right").x()<v.x?-1:1,S=this.findOne(".bottom-right").y()<v.y?-1:1;e=r*this.cos*b,i=r*this.sin*S,this.findOne(".bottom-right").x(v.x+e),this.findOne(".bottom-right").y(v.y+i)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var _=this.centeredScaling()||t.altKey;if(_){var x=this.findOne(".top-left"),P=this.findOne(".bottom-right"),R=x.x(),F=x.y(),L=this.getWidth()-P.x(),$=this.getHeight()-P.y();P.move({x:-R,y:-F}),x.move({x:L,y:$})}var U=this.findOne(".top-left").getAbsolutePosition();e=U.x,i=U.y;var z=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),q=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:e,y:i,width:z,height:q,rotation:Je.Konva.getAngle(this.rotation())},t)}}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));var e=this.getNode();this._fire("transformend",{evt:t,target:e}),e&&this._nodes.forEach(i=>{i._fire("transformend",{evt:t,target:i})}),this._movingAnchorName=null}}_fitNodesInto(t,e){var i=this._getNodeRect();const r=1;if(Kt.Util._inRange(t.width,-this.padding()*2-r,r)){this.update();return}if(Kt.Util._inRange(t.height,-this.padding()*2-r,r)){this.update();return}const s=this.flipEnabled();var a=new Kt.Transform;if(a.rotate(Je.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const d=a.point({x:-this.padding()*2,y:0});if(t.x+=d.x,t.y+=d.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,!s){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const d=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.width+=this.padding()*2,!s){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const d=a.point({x:0,y:-this.padding()*2});if(t.x+=d.x,t.y+=d.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2,!s){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const d=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2,!s){this.update();return}}if(this.boundBoxFunc()){const d=this.boundBoxFunc()(i,t);d?t=d:Kt.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,h=new Kt.Transform;h.translate(i.x,i.y),h.rotate(i.rotation),h.scale(i.width/o,i.height/o);const l=new Kt.Transform;l.translate(t.x,t.y),l.rotate(t.rotation),l.scale(t.width/o,t.height/o);const c=l.multiply(h.invert());this._nodes.forEach(d=>{var f;const u=d.getParent().getAbsoluteTransform(),m=d.getTransform().copy();m.translate(d.offsetX(),d.offsetY());const v=new Kt.Transform;v.multiply(u.copy().invert()).multiply(c).multiply(u).multiply(m);const b=v.decompose();d.setAttrs(b),this._fire("transform",{evt:e,target:d}),d._fire("transform",{evt:e,target:d}),(f=d.getLayer())===null||f===void 0||f.batchDraw()}),this.rotation(Kt.Util._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,e){this.findOne(t).setAttrs(e)}update(){var t,e=this._getNodeRect();this.rotation(Kt.Util._getRotation(e.rotation));var i=e.width,r=e.height,s=this.enabledAnchors(),a=this.resizeEnabled(),o=this.padding(),h=this.anchorSize();const l=this.find("._anchor");l.forEach(d=>{d.setAttrs({width:h,height:h,offsetX:h/2,offsetY:h/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:h/2+o,offsetY:h/2+o,visible:a&&s.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:i/2,y:0,offsetY:h/2+o,visible:a&&s.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:i,y:0,offsetX:h/2-o,offsetY:h/2+o,visible:a&&s.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:h/2+o,visible:a&&s.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:i,y:r/2,offsetX:h/2-o,visible:a&&s.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:h/2+o,offsetY:h/2-o,visible:a&&s.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:i/2,y:r,offsetY:h/2-o,visible:a&&s.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:i,y:r,offsetX:h/2-o,offsetY:h/2-o,visible:a&&s.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:i/2,y:-this.rotateAnchorOffset()*Kt.Util._sign(r)-o,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:i,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const c=this.anchorStyleFunc();c&&l.forEach(d=>{c(d)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),b0.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return w0.Node.prototype.toObject.call(this)}clone(t){var e=w0.Node.prototype.clone.call(this,t);return e}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}y0=Ms.Transformer=Ht;function _y(n){return n instanceof Array||Kt.Util.warn("enabledAnchors value should be an array"),n instanceof Array&&n.forEach(function(t){io.indexOf(t)===-1&&Kt.Util.warn("Unknown anchor name: "+t+". Available names are: "+io.join(", "))}),n||[]}Ht.prototype.className="Transformer",(0,ly._registerNode)(Ht),Yt.Factory.addGetterSetter(Ht,"enabledAnchors",io,_y),Yt.Factory.addGetterSetter(Ht,"flipEnabled",!0,(0,nn.getBooleanValidator)()),Yt.Factory.addGetterSetter(Ht,"resizeEnabled",!0),Yt.Factory.addGetterSetter(Ht,"anchorSize",10,(0,nn.getNumberValidator)()),Yt.Factory.addGetterSetter(Ht,"rotateEnabled",!0),Yt.Factory.addGetterSetter(Ht,"rotationSnaps",[]),Yt.Factory.addGetterSetter(Ht,"rotateAnchorOffset",50,(0,nn.getNumberValidator)()),Yt.Factory.addGetterSetter(Ht,"rotateAnchorCursor","crosshair"),Yt.Factory.addGetterSetter(Ht,"rotationSnapTolerance",5,(0,nn.getNumberValidator)()),Yt.Factory.addGetterSetter(Ht,"borderEnabled",!0),Yt.Factory.addGetterSetter(Ht,"anchorStroke","rgb(0, 161, 255)"),Yt.Factory.addGetterSetter(Ht,"anchorStrokeWidth",1,(0,nn.getNumberValidator)()),Yt.Factory.addGetterSetter(Ht,"anchorFill","white"),Yt.Factory.addGetterSetter(Ht,"anchorCornerRadius",0,(0,nn.getNumberValidator)()),Yt.Factory.addGetterSetter(Ht,"borderStroke","rgb(0, 161, 255)"),Yt.Factory.addGetterSetter(Ht,"borderStrokeWidth",1,(0,nn.getNumberValidator)()),Yt.Factory.addGetterSetter(Ht,"borderDash"),Yt.Factory.addGetterSetter(Ht,"keepRatio",!0),Yt.Factory.addGetterSetter(Ht,"shiftBehavior","default"),Yt.Factory.addGetterSetter(Ht,"centeredScaling",!1),Yt.Factory.addGetterSetter(Ht,"ignoreStroke",!1),Yt.Factory.addGetterSetter(Ht,"padding",0,(0,nn.getNumberValidator)()),Yt.Factory.addGetterSetter(Ht,"node"),Yt.Factory.addGetterSetter(Ht,"nodes"),Yt.Factory.addGetterSetter(Ht,"boundBoxFunc"),Yt.Factory.addGetterSetter(Ht,"anchorDragBoundFunc"),Yt.Factory.addGetterSetter(Ht,"anchorStyleFunc"),Yt.Factory.addGetterSetter(Ht,"shouldOverdrawWholeArea",!1),Yt.Factory.addGetterSetter(Ht,"useSingleNodeRotation",!0),Yt.Factory.backCompat(Ht,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});const yy=St(xt({__proto__:null,get Transformer(){return y0},default:Ms},[Ms]));var Rs={};Object.defineProperty(Rs,"__esModule",{value:!0});var k0=Rs.Wedge=void 0;const no=Ft,wy=me,by=Nt,E0=Gt,xy=Nt;class Ai extends wy.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,by.Konva.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}k0=Rs.Wedge=Ai,Ai.prototype.className="Wedge",Ai.prototype._centroid=!0,Ai.prototype._attrsAffectingSize=["radius"],(0,xy._registerNode)(Ai),no.Factory.addGetterSetter(Ai,"radius",0,(0,E0.getNumberValidator)()),no.Factory.addGetterSetter(Ai,"angle",0,(0,E0.getNumberValidator)()),no.Factory.addGetterSetter(Ai,"clockwise",!1),no.Factory.backCompat(Ai,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});const Sy=St(xt({__proto__:null,get Wedge(){return k0},default:Rs},[Rs]));var Ds={};Object.defineProperty(Ds,"__esModule",{value:!0});var P0=Ds.Blur=void 0;const A0=Ft,Cy=le,Ty=Gt;function M0(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var ky=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Ey=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function Py(n,t){var e=n.data,i=n.width,r=n.height,s,a,o,h,l,c,d,f,u,m,v,b,S,E,_,x,P,R,F,L,$,U,z,q,K=t+t+1,Z=i-1,at=r-1,vt=t+1,_t=vt*(vt+1)/2,pt=new M0,nt=null,J=pt,I=null,D=null,A=ky[t],B=Ey[t];for(o=1;o<K;o++)J=J.next=new M0,o===vt&&(nt=J);for(J.next=pt,d=c=0,a=0;a<r;a++){for(x=P=R=F=f=u=m=v=0,b=vt*(L=e[c]),S=vt*($=e[c+1]),E=vt*(U=e[c+2]),_=vt*(z=e[c+3]),f+=_t*L,u+=_t*$,m+=_t*U,v+=_t*z,J=pt,o=0;o<vt;o++)J.r=L,J.g=$,J.b=U,J.a=z,J=J.next;for(o=1;o<vt;o++)h=c+((Z<o?Z:o)<<2),f+=(J.r=L=e[h])*(q=vt-o),u+=(J.g=$=e[h+1])*q,m+=(J.b=U=e[h+2])*q,v+=(J.a=z=e[h+3])*q,x+=L,P+=$,R+=U,F+=z,J=J.next;for(I=pt,D=nt,s=0;s<i;s++)e[c+3]=z=v*A>>B,z!==0?(z=255/z,e[c]=(f*A>>B)*z,e[c+1]=(u*A>>B)*z,e[c+2]=(m*A>>B)*z):e[c]=e[c+1]=e[c+2]=0,f-=b,u-=S,m-=E,v-=_,b-=I.r,S-=I.g,E-=I.b,_-=I.a,h=d+((h=s+t+1)<Z?h:Z)<<2,x+=I.r=e[h],P+=I.g=e[h+1],R+=I.b=e[h+2],F+=I.a=e[h+3],f+=x,u+=P,m+=R,v+=F,I=I.next,b+=L=D.r,S+=$=D.g,E+=U=D.b,_+=z=D.a,x-=L,P-=$,R-=U,F-=z,D=D.next,c+=4;d+=i}for(s=0;s<i;s++){for(P=R=F=x=u=m=v=f=0,c=s<<2,b=vt*(L=e[c]),S=vt*($=e[c+1]),E=vt*(U=e[c+2]),_=vt*(z=e[c+3]),f+=_t*L,u+=_t*$,m+=_t*U,v+=_t*z,J=pt,o=0;o<vt;o++)J.r=L,J.g=$,J.b=U,J.a=z,J=J.next;for(l=i,o=1;o<=t;o++)c=l+s<<2,f+=(J.r=L=e[c])*(q=vt-o),u+=(J.g=$=e[c+1])*q,m+=(J.b=U=e[c+2])*q,v+=(J.a=z=e[c+3])*q,x+=L,P+=$,R+=U,F+=z,J=J.next,o<at&&(l+=i);for(c=s,I=pt,D=nt,a=0;a<r;a++)h=c<<2,e[h+3]=z=v*A>>B,z>0?(z=255/z,e[h]=(f*A>>B)*z,e[h+1]=(u*A>>B)*z,e[h+2]=(m*A>>B)*z):e[h]=e[h+1]=e[h+2]=0,f-=b,u-=S,m-=E,v-=_,b-=I.r,S-=I.g,E-=I.b,_-=I.a,h=s+((h=a+vt)<at?h:at)*i<<2,f+=x+=I.r=e[h],u+=P+=I.g=e[h+1],m+=R+=I.b=e[h+2],v+=F+=I.a=e[h+3],I=I.next,b+=L=D.r,S+=$=D.g,E+=U=D.b,_+=z=D.a,x-=L,P-=$,R-=U,F-=z,D=D.next,c+=i}}const Ay=function(t){var e=Math.round(this.blurRadius());e>0&&Py(t,e)};P0=Ds.Blur=Ay,A0.Factory.addGetterSetter(Cy.Node,"blurRadius",0,(0,Ty.getNumberValidator)(),A0.Factory.afterSetFilter);const My=St(xt({__proto__:null,get Blur(){return P0},default:Ds},[Ds]));var Ls={};Object.defineProperty(Ls,"__esModule",{value:!0});var R0=Ls.Brighten=void 0;const D0=Ft,Ry=le,Dy=Gt,Ly=function(n){var t=this.brightness()*255,e=n.data,i=e.length,r;for(r=0;r<i;r+=4)e[r]+=t,e[r+1]+=t,e[r+2]+=t};R0=Ls.Brighten=Ly,D0.Factory.addGetterSetter(Ry.Node,"brightness",0,(0,Dy.getNumberValidator)(),D0.Factory.afterSetFilter);const Iy=St(xt({__proto__:null,get Brighten(){return R0},default:Ls},[Ls]));var Is={};Object.defineProperty(Is,"__esModule",{value:!0});var L0=Is.Contrast=void 0;const I0=Ft,Oy=le,Fy=Gt,Ny=function(n){var t=Math.pow((this.contrast()+100)/100,2),e=n.data,i=e.length,r=150,s=150,a=150,o;for(o=0;o<i;o+=4)r=e[o],s=e[o+1],a=e[o+2],r/=255,r-=.5,r*=t,r+=.5,r*=255,s/=255,s-=.5,s*=t,s+=.5,s*=255,a/=255,a-=.5,a*=t,a+=.5,a*=255,r=r<0?0:r>255?255:r,s=s<0?0:s>255?255:s,a=a<0?0:a>255?255:a,e[o]=r,e[o+1]=s,e[o+2]=a};L0=Is.Contrast=Ny,I0.Factory.addGetterSetter(Oy.Node,"contrast",0,(0,Fy.getNumberValidator)(),I0.Factory.afterSetFilter);const Gy=St(xt({__proto__:null,get Contrast(){return L0},default:Is},[Is]));var Os={};Object.defineProperty(Os,"__esModule",{value:!0});var O0=Os.Emboss=void 0;const rn=Ft,ro=le,Uy=re,F0=Gt,By=function(n){var t=this.embossStrength()*10,e=this.embossWhiteLevel()*255,i=this.embossDirection(),r=this.embossBlend(),s=0,a=0,o=n.data,h=n.width,l=n.height,c=h*4,d=l;switch(i){case"top-left":s=-1,a=-1;break;case"top":s=-1,a=0;break;case"top-right":s=-1,a=1;break;case"right":s=0,a=1;break;case"bottom-right":s=1,a=1;break;case"bottom":s=1,a=0;break;case"bottom-left":s=1,a=-1;break;case"left":s=0,a=-1;break;default:Uy.Util.error("Unknown emboss direction: "+i)}do{var f=(d-1)*c,u=s;d+u<1&&(u=0),d+u>l&&(u=0);var m=(d-1+u)*h*4,v=h;do{var b=f+(v-1)*4,S=a;v+S<1&&(S=0),v+S>h&&(S=0);var E=m+(v-1+S)*4,_=o[b]-o[E],x=o[b+1]-o[E+1],P=o[b+2]-o[E+2],R=_,F=R>0?R:-R,L=x>0?x:-x,$=P>0?P:-P;if(L>F&&(R=x),$>F&&(R=P),R*=t,r){var U=o[b]+R,z=o[b+1]+R,q=o[b+2]+R;o[b]=U>255?255:U<0?0:U,o[b+1]=z>255?255:z<0?0:z,o[b+2]=q>255?255:q<0?0:q}else{var K=e-R;K<0?K=0:K>255&&(K=255),o[b]=o[b+1]=o[b+2]=K}}while(--v)}while(--d)};O0=Os.Emboss=By,rn.Factory.addGetterSetter(ro.Node,"embossStrength",.5,(0,F0.getNumberValidator)(),rn.Factory.afterSetFilter),rn.Factory.addGetterSetter(ro.Node,"embossWhiteLevel",.5,(0,F0.getNumberValidator)(),rn.Factory.afterSetFilter),rn.Factory.addGetterSetter(ro.Node,"embossDirection","top-left",null,rn.Factory.afterSetFilter),rn.Factory.addGetterSetter(ro.Node,"embossBlend",!1,null,rn.Factory.afterSetFilter);const zy=St(xt({__proto__:null,get Emboss(){return O0},default:Os},[Os]));var Fs={};Object.defineProperty(Fs,"__esModule",{value:!0});var N0=Fs.Enhance=void 0;const G0=Ft,$y=le,Vy=Gt;function Cl(n,t,e,i,r){var s=e-t,a=r-i,o;return s===0?i+a/2:a===0?i:(o=(n-t)/s,o=a*o+i,o)}const Hy=function(n){var t=n.data,e=t.length,i=t[0],r=i,s,a=t[1],o=a,h,l=t[2],c=l,d,f,u=this.enhance();if(u!==0){for(f=0;f<e;f+=4)s=t[f+0],s<i?i=s:s>r&&(r=s),h=t[f+1],h<a?a=h:h>o&&(o=h),d=t[f+2],d<l?l=d:d>c&&(c=d);r===i&&(r=255,i=0),o===a&&(o=255,a=0),c===l&&(c=255,l=0);var m,v,b,S,E,_,x,P,R;for(u>0?(v=r+u*(255-r),b=i-u*(i-0),E=o+u*(255-o),_=a-u*(a-0),P=c+u*(255-c),R=l-u*(l-0)):(m=(r+i)*.5,v=r+u*(r-m),b=i+u*(i-m),S=(o+a)*.5,E=o+u*(o-S),_=a+u*(a-S),x=(c+l)*.5,P=c+u*(c-x),R=l+u*(l-x)),f=0;f<e;f+=4)t[f+0]=Cl(t[f+0],i,r,b,v),t[f+1]=Cl(t[f+1],a,o,_,E),t[f+2]=Cl(t[f+2],l,c,R,P)}};N0=Fs.Enhance=Hy,G0.Factory.addGetterSetter($y.Node,"enhance",0,(0,Vy.getNumberValidator)(),G0.Factory.afterSetFilter);const jy=St(xt({__proto__:null,get Enhance(){return N0},default:Fs},[Fs]));var Ns={};Object.defineProperty(Ns,"__esModule",{value:!0});var U0=Ns.Grayscale=void 0;const Xy=function(n){var t=n.data,e=t.length,i,r;for(i=0;i<e;i+=4)r=.34*t[i]+.5*t[i+1]+.16*t[i+2],t[i]=r,t[i+1]=r,t[i+2]=r};U0=Ns.Grayscale=Xy;const Yy=St(xt({__proto__:null,get Grayscale(){return U0},default:Ns},[Ns]));var Gs={};Object.defineProperty(Gs,"__esModule",{value:!0});var B0=Gs.HSL=void 0;const lr=Ft,Tl=le,kl=Gt;lr.Factory.addGetterSetter(Tl.Node,"hue",0,(0,kl.getNumberValidator)(),lr.Factory.afterSetFilter),lr.Factory.addGetterSetter(Tl.Node,"saturation",0,(0,kl.getNumberValidator)(),lr.Factory.afterSetFilter),lr.Factory.addGetterSetter(Tl.Node,"luminance",0,(0,kl.getNumberValidator)(),lr.Factory.afterSetFilter);const qy=function(n){var t=n.data,e=t.length,i=1,r=Math.pow(2,this.saturation()),s=Math.abs(this.hue()+360)%360,a=this.luminance()*127,o,h=i*r*Math.cos(s*Math.PI/180),l=i*r*Math.sin(s*Math.PI/180),c=.299*i+.701*h+.167*l,d=.587*i-.587*h+.33*l,f=.114*i-.114*h-.497*l,u=.299*i-.299*h-.328*l,m=.587*i+.413*h+.035*l,v=.114*i-.114*h+.293*l,b=.299*i-.3*h+1.25*l,S=.587*i-.586*h-1.05*l,E=.114*i+.886*h-.2*l,_,x,P,R;for(o=0;o<e;o+=4)_=t[o+0],x=t[o+1],P=t[o+2],R=t[o+3],t[o+0]=c*_+d*x+f*P+a,t[o+1]=u*_+m*x+v*P+a,t[o+2]=b*_+S*x+E*P+a,t[o+3]=R};B0=Gs.HSL=qy;const Wy=St(xt({__proto__:null,get HSL(){return B0},default:Gs},[Gs]));var Us={};Object.defineProperty(Us,"__esModule",{value:!0});var z0=Us.HSV=void 0;const cr=Ft,El=le,Pl=Gt,Ky=function(n){var t=n.data,e=t.length,i=Math.pow(2,this.value()),r=Math.pow(2,this.saturation()),s=Math.abs(this.hue()+360)%360,a,o=i*r*Math.cos(s*Math.PI/180),h=i*r*Math.sin(s*Math.PI/180),l=.299*i+.701*o+.167*h,c=.587*i-.587*o+.33*h,d=.114*i-.114*o-.497*h,f=.299*i-.299*o-.328*h,u=.587*i+.413*o+.035*h,m=.114*i-.114*o+.293*h,v=.299*i-.3*o+1.25*h,b=.587*i-.586*o-1.05*h,S=.114*i+.886*o-.2*h,E,_,x,P;for(a=0;a<e;a+=4)E=t[a+0],_=t[a+1],x=t[a+2],P=t[a+3],t[a+0]=l*E+c*_+d*x,t[a+1]=f*E+u*_+m*x,t[a+2]=v*E+b*_+S*x,t[a+3]=P};z0=Us.HSV=Ky,cr.Factory.addGetterSetter(El.Node,"hue",0,(0,Pl.getNumberValidator)(),cr.Factory.afterSetFilter),cr.Factory.addGetterSetter(El.Node,"saturation",0,(0,Pl.getNumberValidator)(),cr.Factory.afterSetFilter),cr.Factory.addGetterSetter(El.Node,"value",0,(0,Pl.getNumberValidator)(),cr.Factory.afterSetFilter);const Zy=St(xt({__proto__:null,get HSV(){return z0},default:Us},[Us]));var Bs={};Object.defineProperty(Bs,"__esModule",{value:!0});var $0=Bs.Invert=void 0;const Jy=function(n){var t=n.data,e=t.length,i;for(i=0;i<e;i+=4)t[i]=255-t[i],t[i+1]=255-t[i+1],t[i+2]=255-t[i+2]};$0=Bs.Invert=Jy;const Qy=St(xt({__proto__:null,get Invert(){return $0},default:Bs},[Bs]));var zs={};Object.defineProperty(zs,"__esModule",{value:!0});var V0=zs.Kaleidoscope=void 0;const so=Ft,H0=le,j0=re,X0=Gt;var t4=function(n,t,e){var i=n.data,r=t.data,s=n.width,a=n.height,o=e.polarCenterX||s/2,h=e.polarCenterY||a/2,l,c,d,f=0,u=0,m=0,v=0,b,S=Math.sqrt(o*o+h*h);c=s-o,d=a-h,b=Math.sqrt(c*c+d*d),S=b>S?b:S;var E=a,_=s,x,P,R=360/_*Math.PI/180,F,L;for(P=0;P<_;P+=1)for(F=Math.sin(P*R),L=Math.cos(P*R),x=0;x<E;x+=1)c=Math.floor(o+S*x/E*L),d=Math.floor(h+S*x/E*F),l=(d*s+c)*4,f=i[l+0],u=i[l+1],m=i[l+2],v=i[l+3],l=(P+x*s)*4,r[l+0]=f,r[l+1]=u,r[l+2]=m,r[l+3]=v},e4=function(n,t,e){var i=n.data,r=t.data,s=n.width,a=n.height,o=e.polarCenterX||s/2,h=e.polarCenterY||a/2,l,c,d,f,u,m=0,v=0,b=0,S=0,E,_=Math.sqrt(o*o+h*h);c=s-o,d=a-h,E=Math.sqrt(c*c+d*d),_=E>_?E:_;var x=a,P=s,R,F,L=e.polarRotation||0,$,U;for(c=0;c<s;c+=1)for(d=0;d<a;d+=1)f=c-o,u=d-h,R=Math.sqrt(f*f+u*u)*x/_,F=(Math.atan2(u,f)*180/Math.PI+360+L)%360,F=F*P/360,$=Math.floor(F),U=Math.floor(R),l=(U*s+$)*4,m=i[l+0],v=i[l+1],b=i[l+2],S=i[l+3],l=(d*s+c)*4,r[l+0]=m,r[l+1]=v,r[l+2]=b,r[l+3]=S};const i4=function(n){var t=n.width,e=n.height,i,r,s,a,o,h,l,c,d,f,u=Math.round(this.kaleidoscopePower()),m=Math.round(this.kaleidoscopeAngle()),v=Math.floor(t*(m%360)/360);if(!(u<1)){var b=j0.Util.createCanvasElement();b.width=t,b.height=e;var S=b.getContext("2d").getImageData(0,0,t,e);j0.Util.releaseCanvas(b),t4(n,S,{polarCenterX:t/2,polarCenterY:e/2});for(var E=t/Math.pow(2,u);E<=8;)E=E*2,u-=1;E=Math.ceil(E);var _=E,x=0,P=_,R=1;for(v+E>t&&(x=_,P=0,R=-1),r=0;r<e;r+=1)for(i=x;i!==P;i+=R)s=Math.round(i+v)%t,d=(t*r+s)*4,o=S.data[d+0],h=S.data[d+1],l=S.data[d+2],c=S.data[d+3],f=(t*r+i)*4,S.data[f+0]=o,S.data[f+1]=h,S.data[f+2]=l,S.data[f+3]=c;for(r=0;r<e;r+=1)for(_=Math.floor(E),a=0;a<u;a+=1){for(i=0;i<_+1;i+=1)d=(t*r+i)*4,o=S.data[d+0],h=S.data[d+1],l=S.data[d+2],c=S.data[d+3],f=(t*r+_*2-i-1)*4,S.data[f+0]=o,S.data[f+1]=h,S.data[f+2]=l,S.data[f+3]=c;_*=2}e4(S,n,{polarRotation:0})}};V0=zs.Kaleidoscope=i4,so.Factory.addGetterSetter(H0.Node,"kaleidoscopePower",2,(0,X0.getNumberValidator)(),so.Factory.afterSetFilter),so.Factory.addGetterSetter(H0.Node,"kaleidoscopeAngle",0,(0,X0.getNumberValidator)(),so.Factory.afterSetFilter);const n4=St(xt({__proto__:null,get Kaleidoscope(){return V0},default:zs},[zs]));var $s={};Object.defineProperty($s,"__esModule",{value:!0});var Y0=$s.Mask=void 0;const q0=Ft,r4=le,s4=Gt;function ao(n,t,e){var i=(e*n.width+t)*4,r=[];return r.push(n.data[i++],n.data[i++],n.data[i++],n.data[i++]),r}function Vs(n,t){return Math.sqrt(Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2)+Math.pow(n[2]-t[2],2))}function a4(n){for(var t=[0,0,0],e=0;e<n.length;e++)t[0]+=n[e][0],t[1]+=n[e][1],t[2]+=n[e][2];return t[0]/=n.length,t[1]/=n.length,t[2]/=n.length,t}function o4(n,t){var e=ao(n,0,0),i=ao(n,n.width-1,0),r=ao(n,0,n.height-1),s=ao(n,n.width-1,n.height-1),a=t||10;if(Vs(e,i)<a&&Vs(i,s)<a&&Vs(s,r)<a&&Vs(r,e)<a){for(var o=a4([i,e,s,r]),h=[],l=0;l<n.width*n.height;l++){var c=Vs(o,[n.data[l*4],n.data[l*4+1],n.data[l*4+2]]);h[l]=c<a?0:255}return h}}function h4(n,t){for(var e=0;e<n.width*n.height;e++)n.data[4*e+3]=t[e]}function l4(n,t,e){for(var i=[1,1,1,1,0,1,1,1,1],r=Math.round(Math.sqrt(i.length)),s=Math.floor(r/2),a=[],o=0;o<e;o++)for(var h=0;h<t;h++){for(var l=o*t+h,c=0,d=0;d<r;d++)for(var f=0;f<r;f++){var u=o+d-s,m=h+f-s;if(u>=0&&u<e&&m>=0&&m<t){var v=u*t+m,b=i[d*r+f];c+=n[v]*b}}a[l]=c===2040?255:0}return a}function c4(n,t,e){for(var i=[1,1,1,1,1,1,1,1,1],r=Math.round(Math.sqrt(i.length)),s=Math.floor(r/2),a=[],o=0;o<e;o++)for(var h=0;h<t;h++){for(var l=o*t+h,c=0,d=0;d<r;d++)for(var f=0;f<r;f++){var u=o+d-s,m=h+f-s;if(u>=0&&u<e&&m>=0&&m<t){var v=u*t+m,b=i[d*r+f];c+=n[v]*b}}a[l]=c>=1020?255:0}return a}function u4(n,t,e){for(var i=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],r=Math.round(Math.sqrt(i.length)),s=Math.floor(r/2),a=[],o=0;o<e;o++)for(var h=0;h<t;h++){for(var l=o*t+h,c=0,d=0;d<r;d++)for(var f=0;f<r;f++){var u=o+d-s,m=h+f-s;if(u>=0&&u<e&&m>=0&&m<t){var v=u*t+m,b=i[d*r+f];c+=n[v]*b}}a[l]=c}return a}const f4=function(n){var t=this.threshold(),e=o4(n,t);return e&&(e=l4(e,n.width,n.height),e=c4(e,n.width,n.height),e=u4(e,n.width,n.height),h4(n,e)),n};Y0=$s.Mask=f4,q0.Factory.addGetterSetter(r4.Node,"threshold",0,(0,s4.getNumberValidator)(),q0.Factory.afterSetFilter);const d4=St(xt({__proto__:null,get Mask(){return Y0},default:$s},[$s]));var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});var W0=Hs.Noise=void 0;const K0=Ft,g4=le,p4=Gt,m4=function(n){var t=this.noise()*255,e=n.data,i=e.length,r=t/2,s;for(s=0;s<i;s+=4)e[s+0]+=r-2*r*Math.random(),e[s+1]+=r-2*r*Math.random(),e[s+2]+=r-2*r*Math.random()};W0=Hs.Noise=m4,K0.Factory.addGetterSetter(g4.Node,"noise",.2,(0,p4.getNumberValidator)(),K0.Factory.afterSetFilter);const v4=St(xt({__proto__:null,get Noise(){return W0},default:Hs},[Hs]));var js={};Object.defineProperty(js,"__esModule",{value:!0});var Z0=js.Pixelate=void 0;const J0=Ft,_4=re,y4=le,w4=Gt,b4=function(n){var t=Math.ceil(this.pixelSize()),e=n.width,i=n.height,r,s,a,o,h,l,c,d=Math.ceil(e/t),f=Math.ceil(i/t),u,m,v,b,S,E,_,x=n.data;if(t<=0){_4.Util.error("pixelSize value can not be <= 0");return}for(S=0;S<d;S+=1)for(E=0;E<f;E+=1){for(o=0,h=0,l=0,c=0,u=S*t,m=u+t,v=E*t,b=v+t,_=0,r=u;r<m;r+=1)if(!(r>=e))for(s=v;s<b;s+=1)s>=i||(a=(e*s+r)*4,o+=x[a+0],h+=x[a+1],l+=x[a+2],c+=x[a+3],_+=1);for(o=o/_,h=h/_,l=l/_,c=c/_,r=u;r<m;r+=1)if(!(r>=e))for(s=v;s<b;s+=1)s>=i||(a=(e*s+r)*4,x[a+0]=o,x[a+1]=h,x[a+2]=l,x[a+3]=c)}};Z0=js.Pixelate=b4,J0.Factory.addGetterSetter(y4.Node,"pixelSize",8,(0,w4.getNumberValidator)(),J0.Factory.afterSetFilter);const x4=St(xt({__proto__:null,get Pixelate(){return Z0},default:js},[js]));var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});var Q0=Xs.Posterize=void 0;const t1=Ft,S4=le,C4=Gt,T4=function(n){var t=Math.round(this.levels()*254)+1,e=n.data,i=e.length,r=255/t,s;for(s=0;s<i;s+=1)e[s]=Math.floor(e[s]/r)*r};Q0=Xs.Posterize=T4,t1.Factory.addGetterSetter(S4.Node,"levels",.5,(0,C4.getNumberValidator)(),t1.Factory.afterSetFilter);const k4=St(xt({__proto__:null,get Posterize(){return Q0},default:Xs},[Xs]));var Ys={};Object.defineProperty(Ys,"__esModule",{value:!0});var e1=Ys.RGB=void 0;const oo=Ft,Al=le,E4=Gt,P4=function(n){var t=n.data,e=t.length,i=this.red(),r=this.green(),s=this.blue(),a,o;for(a=0;a<e;a+=4)o=(.34*t[a]+.5*t[a+1]+.16*t[a+2])/255,t[a]=o*i,t[a+1]=o*r,t[a+2]=o*s,t[a+3]=t[a+3]};e1=Ys.RGB=P4,oo.Factory.addGetterSetter(Al.Node,"red",0,function(n){return this._filterUpToDate=!1,n>255?255:n<0?0:Math.round(n)}),oo.Factory.addGetterSetter(Al.Node,"green",0,function(n){return this._filterUpToDate=!1,n>255?255:n<0?0:Math.round(n)}),oo.Factory.addGetterSetter(Al.Node,"blue",0,E4.RGBComponent,oo.Factory.afterSetFilter);const A4=St(xt({__proto__:null,get RGB(){return e1},default:Ys},[Ys]));var qs={};Object.defineProperty(qs,"__esModule",{value:!0});var i1=qs.RGBA=void 0;const Ws=Ft,ho=le,M4=Gt,R4=function(n){var t=n.data,e=t.length,i=this.red(),r=this.green(),s=this.blue(),a=this.alpha(),o,h;for(o=0;o<e;o+=4)h=1-a,t[o]=i*a+t[o]*h,t[o+1]=r*a+t[o+1]*h,t[o+2]=s*a+t[o+2]*h};i1=qs.RGBA=R4,Ws.Factory.addGetterSetter(ho.Node,"red",0,function(n){return this._filterUpToDate=!1,n>255?255:n<0?0:Math.round(n)}),Ws.Factory.addGetterSetter(ho.Node,"green",0,function(n){return this._filterUpToDate=!1,n>255?255:n<0?0:Math.round(n)}),Ws.Factory.addGetterSetter(ho.Node,"blue",0,M4.RGBComponent,Ws.Factory.afterSetFilter),Ws.Factory.addGetterSetter(ho.Node,"alpha",1,function(n){return this._filterUpToDate=!1,n>1?1:n<0?0:n});const D4=St(xt({__proto__:null,get RGBA(){return i1},default:qs},[qs]));var Ks={};Object.defineProperty(Ks,"__esModule",{value:!0});var n1=Ks.Sepia=void 0;const L4=function(n){var t=n.data,e=t.length,i,r,s,a;for(i=0;i<e;i+=4)r=t[i+0],s=t[i+1],a=t[i+2],t[i+0]=Math.min(255,r*.393+s*.769+a*.189),t[i+1]=Math.min(255,r*.349+s*.686+a*.168),t[i+2]=Math.min(255,r*.272+s*.534+a*.131)};n1=Ks.Sepia=L4;const I4=St(xt({__proto__:null,get Sepia(){return n1},default:Ks},[Ks]));var Zs={};Object.defineProperty(Zs,"__esModule",{value:!0});var r1=Zs.Solarize=void 0;const O4=function(n){var t=n.data,e=n.width,i=n.height,r=e*4,s=i;do{var a=(s-1)*r,o=e;do{var h=a+(o-1)*4,l=t[h],c=t[h+1],d=t[h+2];l>127&&(l=255-l),c>127&&(c=255-c),d>127&&(d=255-d),t[h]=l,t[h+1]=c,t[h+2]=d}while(--o)}while(--s)};r1=Zs.Solarize=O4;const F4=St(xt({__proto__:null,get Solarize(){return r1},default:Zs},[Zs]));var Js={};Object.defineProperty(Js,"__esModule",{value:!0});var s1=Js.Threshold=void 0;const a1=Ft,N4=le,G4=Gt,U4=function(n){var t=this.threshold()*255,e=n.data,i=e.length,r;for(r=0;r<i;r+=1)e[r]=e[r]<t?0:255};s1=Js.Threshold=U4,a1.Factory.addGetterSetter(N4.Node,"threshold",.5,(0,G4.getNumberValidator)(),a1.Factory.afterSetFilter);const B4=St(xt({__proto__:null,get Threshold(){return s1},default:Js},[Js]));Object.defineProperty(ss,"__esModule",{value:!0});var o1=ss.Konva=void 0;const h1=j5,z4=q5,$4=n3,V4=h3,H4=u3,j4=g3,l1=w3,X4=Rd,Y4=hl,q4=jd,W4=P3,K4=R3,Z4=O3,J4=G3,Q4=d0,t6=ay,e6=yy,i6=Sy,n6=My,r6=Iy,s6=Gy,a6=zy,o6=jy,h6=Yy,l6=Wy,c6=Zy,u6=Qy,f6=n4,d6=d4,g6=v4,p6=x4,m6=k4,v6=A4,_6=D4,y6=I4,w6=F4,b6=B4;o1=ss.Konva=h1.Konva.Util._assign(h1.Konva,{Arc:z4.Arc,Arrow:$4.Arrow,Circle:V4.Circle,Ellipse:H4.Ellipse,Image:j4.Image,Label:l1.Label,Tag:l1.Tag,Line:X4.Line,Path:Y4.Path,Rect:q4.Rect,RegularPolygon:W4.RegularPolygon,Ring:K4.Ring,Sprite:Z4.Sprite,Star:J4.Star,Text:Q4.Text,TextPath:t6.TextPath,Transformer:e6.Transformer,Wedge:i6.Wedge,Filters:{Blur:n6.Blur,Brighten:r6.Brighten,Contrast:s6.Contrast,Emboss:a6.Emboss,Enhance:o6.Enhance,Grayscale:h6.Grayscale,HSL:l6.HSL,HSV:c6.HSV,Invert:u6.Invert,Kaleidoscope:f6.Kaleidoscope,Mask:d6.Mask,Noise:g6.Noise,Pixelate:p6.Pixelate,Posterize:m6.Posterize,RGB:v6.RGB,RGBA:_6.RGBA,Sepia:y6.Sepia,Solarize:w6.Solarize,Threshold:b6.Threshold}});const x6=St(xt({__proto__:null,get Konva(){return o1},default:ss},[ss]));var S6=Gh.exports;Object.defineProperty(S6,"__esModule",{value:!0});const C6=x6;Gh.exports=C6.Konva;var T6=Gh.exports;const Vt=Pe(T6),c1=(n,t)=>{if(n.length!==t.length)return!1;for(let e=0;e<n.length;e++){const i=n[e],r=t.find(s=>s.id===i.id);if(!r||!k6(i,r))return!1}return!0},k6=(n,t)=>n.attrs.id===n.attrs.id&&n._id===t._id,ur=n=>n.reduce((t,e)=>[...t,...e.toArray()],[]),E6=n=>{n.sort(function(e,i){return e-i});const t=Math.floor(n.length/2);return n[t]},u1=n=>{const t=Math.atan2(n[1],n[0]),e=Math.pow(n[0],2)+Math.pow(n[1],2),i=Math.sqrt(e),r=(n[0]*n[3]-n[2]*n[1])/i;return{rotation:t/(Math.PI/180),scaleX:i,scaleY:r,x:n[4],y:n[5]}},P6=(n,t)=>{const e=n.getTransform().getMatrix(),i=t.getTransform().getMatrix(),r=e[0],s=e[1],a=e[2],o=e[3],h=e[4],l=e[5],c=i[0],d=i[1],f=i[2],u=i[3],m=i[4],v=i[5],b=c*u,S=d*f,E=(f*s-r*u)/(S-b),_=(c*s-r*d)/(b-S),x=(f*o-a*u)/(S-b),P=(c*o-a*d)/(b-S),R=(f*(l-v)+u*(m-h))/(S-b),F=(c*(l-v)+d*(m-h))/(b-S);return u1([E,_,x,P,R,F])};class f1{app;constructor(t){this.app=t}}class A6 extends f1{constructor(t){super(t),this.app.stage.on("mousedown",this.onMouseDown),this.app.stage.on("mouseup",this.onMouseUp),this.app.stage.on("mousemove",this.onMouseMove),this.app.stage.on("mouseover",this.onMouseOver),this.app.stage.on("mouseout",this.onMouseOut),this.app.stage.on("dblclick",this.onMouseDoubleClick),this.app.stage.on("click",this.onMouseClick),this.app.stage.on("contextmenu",this.onMouseContextmenu),this.app.stage.on("wheel",this.onWheel)}onMouseDown=t=>{t.evt.button===1&&this.app.triggerPanning(!0),!this.app.stage.draggable()&&this.app.emit("mouseDown",t)};onMouseUp=t=>{t.evt.button===1&&this.app.triggerPanning(!1),!this.app.stage.draggable()&&this.app.emit("mouseUp",t)};onMouseMove=t=>{this.app.stage.draggable()||this.app.emit("mouseMove",t)};onMouseOver=t=>{this.app.stage.draggable()||this.app.emit("mouseOver",t)};onMouseOut=t=>{this.app.stage.draggable()||this.app.emit("mouseOut",t)};onMouseDoubleClick=t=>{this.app.stage.draggable()||this.app.emit("mouseDoubleClick",t)};onMouseClick=t=>{this.app.stage.draggable()||this.app.emit("mouseClick",t)};onMouseContextmenu=t=>{this.app.triggerTool(!1),this.app.emit("mouseContextMenu",t),setTimeout(()=>this.app.triggerTool(!0),100)};onWheel=t=>{if(t.evt.preventDefault(),!this.app.config.mousewheel.enabled)return;const e=this.app.stage.scaleX();this.app.emit("canvasZoomStart",e);const i=this.app.stage.getPointerPosition()??new Wt({x:0,y:0}),r=new Wt({x:(i.x-this.app.stage.x())/e,y:(i.y-this.app.stage.y())/e}),s=(t.evt.shiftKey&&!t.evt.ctrlKey?t.evt.deltaX:t.evt.deltaY)>0?1:-1;let a=e;s>0?a+=this.app.config.mousewheel.factor:a-=this.app.config.mousewheel.factor,a=Math.min(Math.max(a,this.app.config.scale.min),this.app.config.scale.max),this.app.stage.scale({x:a,y:a}),this.app.stage.position({x:i.x-r.x*a,y:i.y-r.y*a}),this.app.emit("canvasZoomEnd",a)};destroy(){this.app.stage.off("mousedown",this.onMouseDown),this.app.stage.off("mouseup",this.onMouseUp),this.app.stage.off("mousemove",this.onMouseMove),this.app.stage.off("mouseover",this.onMouseOver),this.app.stage.off("mouseout",this.onMouseOut),this.app.stage.off("dblclick",this.onMouseDoubleClick),this.app.stage.off("click",this.onMouseClick),this.app.stage.off("contextmenu",this.onMouseContextmenu),this.app.stage.off("wheel",this.onWheel)}}const d1=n=>typeof n=="function";class M6 extends f1{currentTool=null;enable=!0;constructor(t){super(t),this.app.on("mouseDown",this.onMousedown),this.app.on("mouseMove",this.onMousemove),this.app.on("mouseUp",this.onMouseup),this.app.on("mouseClick",this.onClick),this.app.on("mouseDoubleClick",this.onDoubleClick)}get available(){return this.currentTool!==null&&this.enable&&!this.app.stage.draggable()}async setTool(t){const e=this.currentTool;e?.name!==t.name&&(e?.hooks&&d1(e?.hooks?.onInactive)&&await e.hooks.onInactive?.(this.app,e),this.currentTool=t,this.currentTool?.hooks&&d1(this.currentTool?.hooks?.onActive)&&await this.currentTool.hooks.onActive?.(this.app,this.currentTool),this.app.render(),this.app.emit("toolChanged",e,t))}trigger(t){const e=this.enable;t===void 0?this.enable=!this.enable:this.enable=t,this.currentTool?.enableChanged?.(e,this.enable)}onMousedown=t=>{!this.available||!this.currentTool?.mousedown||t.evt.button!==0||this.currentTool.mousedown({event:t,pointer:this.app.pointer,app:this.app})};onMouseup=t=>{!this.available||!this.currentTool?.mouseup||t.evt.button!==0||this.currentTool.mouseup({event:t,pointer:this.app.pointer,app:this.app})};onMousemove=t=>{!this.available||!this.currentTool?.mousemove||t.evt.button!==0||this.currentTool.mousemove({event:t,pointer:this.app.pointer,app:this.app})};onClick=t=>{!this.available||!this.currentTool?.click||t.evt.button!==0||this.currentTool.click({event:t,pointer:this.app.pointer,app:this.app})};onDoubleClick=t=>{!this.available||!this.currentTool?.doubleClick||t.evt.button!==0||this.currentTool.doubleClick({event:t,pointer:this.app.pointer,app:this.app})};destroy(){this.app.off("mouseDown",this.onMousedown),this.app.off("mouseMove",this.onMousemove),this.app.off("mouseUp",this.onMouseup),this.app.off("mouseClick",this.onClick),this.app.off("mouseDoubleClick",this.onDoubleClick),this.currentTool=null}}var R6=Object.defineProperty,D6=Object.getOwnPropertyDescriptor,sn=(n,t,e,i)=>{for(var r=i>1?void 0:i?D6(t,e):t,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&R6(t,e,r),r};class L6{name="alignmentPlugin";alignment;app;options;keyFns=[];constructor(t){this.options={enabled:!0,...t}}install(t){this.app=t,this.alignment=new Mi(t,this.options),this.app.alignLeft=function(e){const i=this.app.getPlugin("alignmentPlugin");return i&&i.alignment?.alignLeft(e),this},this.app.alignRight=function(e){const i=this.app.getPlugin("alignmentPlugin");return i&&i.alignment?.alignRight(e),this},this.app.alignTop=function(e){const i=this.app.getPlugin("alignmentPlugin");return i&&i.alignment?.alignTop(e),this},this.app.alignBottom=function(e){const i=this.app.getPlugin("alignmentPlugin");return i&&i.alignment?.alignBottom(e),this},this.app.alignCenterX=function(e){const i=this.app.getPlugin("alignmentPlugin");return i&&i.alignment?.alignCenterX(e),this},this.app.alignCenterY=function(e){const i=this.app.getPlugin("alignmentPlugin");return i&&i.alignment?.alignCenterY(e),this},this.app.dispersionX=function(e){const i=this.app.getPlugin("alignmentPlugin");return i&&i.alignment?.dispersionX(e),this},this.app.dispersionY=function(e){const i=this.app.getPlugin("alignmentPlugin");return i&&i.alignment?.dispersionY(e),this},this.keyFns.push(Qt.on({key:"a",title:"左对齐",shift:!0},()=>{})),this.keyFns.push(Qt.on({key:"h",title:"水平居中",shift:!0},()=>{})),this.keyFns.push(Qt.on({key:"d",title:"右对齐",shift:!0},()=>{})),this.keyFns.push(Qt.on({key:"w",title:"顶对齐",shift:!0},()=>{})),this.keyFns.push(Qt.on({key:"v",title:"垂直居中",shift:!0},()=>{})),this.keyFns.push(Qt.on({key:"s",title:"底对齐",shift:!0},()=>{})),this.keyFns.push(Qt.on({key:"h",title:"水平分布",ctrl:!0,shift:!0},()=>{})),this.keyFns.push(Qt.on({key:"v",title:"垂直分布",ctrl:!0,shift:!0},()=>{})),this.app.emit("alignmentInstalled",this)}destroy(){this.keyFns.forEach(t=>t.removeListener?.()),this.keyFns=[],this.app?.emit("alignmentDestroy",this)}enable(){this.alignment&&(this.options.enabled=!0,this.alignment.enabled=!0)}disable(){this.alignment&&(this.options.enabled=!1,this.alignment.enabled=!1)}isEnabled(){return this.options.enabled&&(this.alignment?.enabled??!1)}}function an(n,t,e){const i=e.value;return e.value=function(...r){if(this.enabled)return i.apply(this,r);console.log(`Method ${t} is disabled.`)},e}class Mi{app;enabled;constructor(t,e){const{enabled:i}=e;this.app=t,this.enabled=i}alignLeft(t){const e=t.map(r=>r.getClientRect()),i=Math.min(...e.map(r=>r.x));this.app.update(...t.map((r,s)=>{const a=r.toObject(),o=e[s].x-i;return a.attrs={...a.attrs,x:a.attrs.x-o},a}))}alignRight(t){const e=t.map(r=>r.getClientRect()),i=Math.max(...e.map(r=>r.x+r.width));this.app.update(...t.map((r,s)=>{const a=r.toObject(),o=i-(e[s].x+e[s].width);return a.attrs={...a.attrs,x:a.attrs.x+o},a}))}alignTop(t){const e=t.map(r=>r.getClientRect()),i=Math.min(...e.map(r=>r.y));this.app.update(...t.map((r,s)=>{const a=r.toObject(),o=e[s].y-i;return a.attrs={...a.attrs,y:a.attrs.y-o},a}))}alignBottom(t){const e=t.map(r=>r.getClientRect()),i=Math.max(...e.map(r=>r.y+r.height));this.app.update(...t.map((r,s)=>{const a=r.toObject(),o=i-(e[s].y+e[s].height);return a.attrs={...a.attrs,y:a.attrs.y+o},a}))}alignCenterX(t){const e=t.map(r=>r.getClientRect()),i=e.reduce((r,s)=>r+(s.x+s.width/2),0)/e.length;this.app.update(...t.map((r,s)=>{const a=r.toObject(),o=i-(e[s].x+e[s].width/2);return a.attrs={...a.attrs,x:a.attrs.x+o},a}))}alignCenterY(t){const e=t.map(r=>r.getClientRect()),i=e.reduce((r,s)=>r+(s.y+s.height/2),0)/e.length;this.app.update(...t.map((r,s)=>{const a=r.toObject(),o=i-(e[s].y+e[s].height/2);return a.attrs={...a.attrs,y:a.attrs.y+o},a}))}dispersionX(t){t.map(r=>r.getClientRect().x+r.getClientRect().width/2).every((r,s,a)=>r===a[0])||this.distributeNodes(t,"x")}dispersionY(t){t.map(r=>r.getClientRect().y+r.getClientRect().height/2).every((r,s,a)=>r===a[0])||this.distributeNodes(t,"y")}distributeNodes(t,e){if(t.length<=2)return;t.sort((d,f)=>d.getClientRect()[e]-f.getClientRect()[e]);const i=t[0],r=t[t.length-1],s=i.getClientRect()[e]+(e==="x"?i.getClientRect().width:i.getClientRect().height),a=r.getClientRect()[e]-s,h=t.slice(1,-1).reduce((d,f)=>d+(e==="x"?f.getClientRect().width:f.getClientRect().height),0),l=Math.max((a-h)/(t.length-1),0);let c=s;this.app.update(...t.map((d,f)=>{const u=d.toObject();if(f===0||f===t.length-1)return u;const m=c+l;return u.attrs[e]=m-d.getClientRect()[e]+u.attrs[e],c=m+(e==="x"?d.getClientRect().width:d.getClientRect().height),u}))}}sn([an],Mi.prototype,"alignLeft",1),sn([an],Mi.prototype,"alignRight",1),sn([an],Mi.prototype,"alignTop",1),sn([an],Mi.prototype,"alignBottom",1),sn([an],Mi.prototype,"alignCenterX",1),sn([an],Mi.prototype,"alignCenterY",1),sn([an],Mi.prototype,"dispersionX",1),sn([an],Mi.prototype,"dispersionY",1);class g1{app;selected;optionLayer;enabled;multipleSelect;hightLightConfig;transformerConfig;rubberConfig;transformer;rubberRect;rubberStartPoint=new Wt({x:0,y:0});rubberEnable=!1;hightLightRects;constructor(t,e){const{enabled:i,multipleSelect:r,transformer:s,hightLight:a,rubber:o}=e;this.app=t,this.selected=new Map,this.hightLightRects=new Map,this.enabled=i,this.multipleSelect=r,this.transformerConfig=s,this.hightLightConfig=a,this.rubberConfig=o,this.optionLayer=new Vt.Layer,this.optionLayer.name("pictode:option:layer"),this.app.stage.add(this.optionLayer),this.transformer=new Vt.Transformer({...this.transformerConfig,shouldOverdrawWholeArea:!1,flipEnabled:!1}),this.transformer.anchorStyleFunc(h=>{["middle-left","middle-right","top-center","bottom-center"].some(c=>h.hasName(c))&&([...this.selected.values()][0]instanceof Vt.Text||[...this.selected.values()][0]instanceof Vt.Group||this.selected.size>1)&&h.visible(!1);const l=(c="")=>{const d=h.getStage();!d||!d.content||(d.content.style.cursor=c)};h.on("mousedown",()=>{this.enabled=!1}),h.on("mouseup",()=>{this.enabled=!0}),h.on("mouseenter",()=>{this.enabled=!1,h.hasName("rotater")&&l("grabbing")}),h.on("mouseout",()=>{this.enabled=!0,h.hasName("rotater")&&l()})}),this.optionLayer.add(this.transformer),this.rubberRect=new Vt.Rect({stroke:this.rubberConfig.stroke,fill:this.rubberConfig.fill,strokeWidth:this.rubberConfig.strokeWidth,strokeScaleEnabled:!1}),this.optionLayer.add(this.rubberRect),this.transformer.on("transformstart",this.onTransformStart),this.transformer.on("transformend",this.onTransformEnd),this.transformer.on("dragstart",this.onDragStart),this.transformer.on("dragend",this.onDragEnd),this.app.on("mouseDown",this.onMouseDown),this.app.on("mouseMove",this.onMouseMove),this.app.on("mouseUp",this.onMouseUp),this.app.on("mouseClick",this.onMouseClick),this.app.on("mouseOut",this.onMouseOut)}handleNodeRemoved=({target:t})=>{this.cancelSelect(t),t.off("removed",this.handleNodeRemoved)};select(...t){this.enabled&&(c1(t,[...this.selected.values()])||(this.cancelSelect(),this.transformer.nodes(t.filter(e=>(e.draggable(!0),e.on("removed",this.handleNodeRemoved),this.selected.set(e.id(),e),e!==this.rubberRect))),this.setHightRect(...t),this.app.render(),this.app.emit("selectedChanged",Array.from(this.selected.values()))))}cancelSelect(...t){this.selected.size!==0&&(t.length===0&&(t=[...this.selected.values()]),t.forEach(e=>{e.draggable(!1),e.off("removed",this.handleNodeRemoved),this.selected.delete(e.id())}),this.removeHightRect(...t),this.transformer.nodes([...this.selected.values()]),this.app.emit("selectedChanged",Array.from(this.selected.values())))}selectAll(){this.select(...this.app.mainLayer.getChildren())}triggerSelector(t){t===void 0?this.enabled=!this.enabled:this.enabled=t,this.enabled||(this.rubberEnable=!1)}isSelected(t){return this.selected.has(t.id())}getSelectClientRect(){return this.transformer.getClientRect()}setHightRect(...t){this.hightLightRects=t.reduce((e,i)=>{const r=new Vt.Rect({stroke:this.hightLightConfig.stroke,strokeWidth:this.hightLightConfig.strokeWidth,dash:this.hightLightConfig.dash,fillEnabled:!1,strokeScaleEnabled:!1});this.calculateNodeRect(i,r,this.hightLightConfig.padding??0),this.optionLayer.add(r);const s=()=>requestAnimationFrame(()=>this.calculateNodeRect(i,r,this.hightLightConfig.padding??0));return i.on("dragmove transform xChange yChange",s),e.set(i.id(),{rect:r,transformHandler:s}),e},new Map)}removeHightRect(...t){t.forEach(e=>{const i=this.hightLightRects.get(e.id());i&&(e.off("dragmove transform xChange yChange",i.transformHandler),i.rect.remove(),this.hightLightRects.delete(e.id()))})}calculateNodeRect(t,e,i=0){const{x:r,y:s,width:a,height:o}=this.getNodeRect(t,i);e.position({x:(r-this.app.stage.x())/this.app.stage.scaleX(),y:(s-this.app.stage.y())/this.app.stage.scaleY()}),e.width(a/this.app.stage.scaleX()),e.height(o/this.app.stage.scaleY()),e.rotation(t.rotation())}getNodeRect(t,e=0){const i=f=>Vt.angleDeg?f*Math.PI/180:f,r=[];let s=[];t instanceof Vt.Group?s=t.getChildren():s=[t],s.map(f=>{const u=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.transformer.ignoreStroke()}),m=[{x:u.x,y:u.y},{x:u.x+u.width,y:u.y},{x:u.x+u.width,y:u.y+u.height},{x:u.x,y:u.y+u.height}],v=f.getAbsoluteTransform();m.forEach(function(b){const S=v.point(b);r.push(new Wt({x:S.x,y:S.y}))})});const a=new Vt.Transform;a.rotate(-i(t.rotation()));let o,h,l,c;r.forEach(function(f){const u=a.point(f);(o===void 0||h===void 0||l===void 0||c===void 0)&&(o=l=u.x,h=c=u.y),o=Math.min(o,u.x),h=Math.min(h,u.y),l=Math.max(l,u.x),c=Math.max(c,u.y)}),a.invert();const d=a.point({x:(o??0)-e,y:(h??0)-e});return{x:d.x,y:d.y,width:(l??0)-(o??0)+e*2,height:(c??0)-(h??0)+e*2}}onTransformStart=()=>{this.app.emit("nodeTransformStart",Array.from(this.selected.values())),this.app.emit("nodeUpdateBefore",Array.from(this.selected.values()))};onTransformEnd=()=>{this.app.emit("nodeTransformEnd",Array.from(this.selected.values())),this.app.emit("nodeUpdated",Array.from(this.selected.values()))};onDragStart=()=>{this.app.emit("nodeTransformStart",Array.from(this.selected.values())),this.app.emit("nodeUpdateBefore",Array.from(this.selected.values()))};onDragEnd=()=>{this.app.emit("nodeTransformEnd",Array.from(this.selected.values())),this.app.emit("nodeUpdated",Array.from(this.selected.values()))};onMouseDown=t=>{!this.enabled||t.evt.button!==0||t.target instanceof Vt.Stage&&(this.cancelSelect(),this.rubberStartPoint.clone(this.app.pointer),this.rubberRect.setPosition(this.rubberStartPoint),this.rubberRect.width(0),this.rubberRect.height(0),this.rubberRect.visible(!1),this.rubberEnable=!0)};onMouseMove=()=>{if(!this.enabled||!this.rubberEnable)return;const t=new Wt({x:Math.min(this.app.pointer.x,this.rubberStartPoint.x),y:Math.min(this.app.pointer.y,this.rubberStartPoint.y)});this.rubberRect.setPosition(t),this.rubberRect.width(Math.max(this.app.pointer.x,this.rubberStartPoint.x)-t.x),this.rubberRect.height(Math.max(this.app.pointer.y,this.rubberStartPoint.y)-t.y),this.rubberRect.visible(!0)};onMouseUp=t=>{if(!(!this.enabled||t.evt.button!==0)&&this.rubberEnable){const e=this.app.getShapesInArea(this.rubberRect);this.select(...e),this.rubberRect.visible(!1),this.rubberEnable=!1;return}};onMouseClick=t=>{if(!this.enabled||t.evt.button!==0||t.target instanceof Vt.Stage||!t.target.attrs.id)return;const i=this.app.findTopGroup(t.target)??t.target;t.evt.shiftKey&&this.multipleSelect?this.selected.has(i.attrs.id)?this.cancelSelect(i):this.select(...this.selected.values(),i):this.select(i)};onMouseOut=t=>{t.target instanceof Vt.Stage&&(this.rubberEnable=!1)};destroy(){this.transformer.off("transformstart",this.onTransformStart),this.transformer.off("transformend",this.onTransformEnd),this.transformer.off("dragstart",this.onDragStart),this.transformer.off("dragend",this.onDragEnd),this.app.off("mouseDown",this.onMouseDown),this.app.off("mouseMove",this.onMouseMove),this.app.off("mouseUp",this.onMouseUp),this.app.off("mouseClick",this.onMouseClick),this.app.off("mouseOut",this.onMouseOut),this.selected.clear(),this.enabled=!1,this.transformer.remove(),this.optionLayer.remove()}}const I6={enabled:!0,multipleSelect:!0,transformer:{padding:6,ignoreStroke:!0,borderStroke:"#4e86e3",borderStrokeWidth:1,borderDash:[3,3],anchorSize:8,anchorStroke:"#4e86e3",anchorCornerRadius:3,anchorStrokeWidth:1,rotateAnchorOffset:20},hightLight:{padding:3,stroke:"#4e86e3",strokeWidth:1},rubber:{stroke:"#4e86e3",strokeWidth:1,fill:"#4e86e350"}};class O6{name="selectorPlugin";selector;app;options;keyFns=[];constructor(t){this.options={...I6,...t}}install(t){this.app=t,this.selector=new g1(t,this.options),this.app.on("canvasCleared",this.onCanvasCleared),this.app.select=function(...e){const i=this.app.getPlugin("selectorPlugin");return i&&i.selector?.select(...e),this},this.app.cancelSelect=function(...e){const i=this.app.getPlugin("selectorPlugin");return i&&i.selector?.cancelSelect(...e),this},this.app.selectByEvent=function(e){return this.app.getPlugin("selectorPlugin")&&(e.target instanceof Vt.Stage?this.cancelSelect():this.select(e.target)),this},this.app.selectAll=function(){const e=this.app.getPlugin("selectorPlugin");return e&&e.selector?.selectAll(),this},this.app.triggerSelector=function(e){const i=this.app.getPlugin("selectorPlugin");return i&&i.selector?.triggerSelector(e),this},this.app.isSelected=function(e){const i=this.app.getPlugin("selectorPlugin");return i?i.selector?.isSelected(e)??!1:!1},this.keyFns.push(Qt.on({key:"a",title:"全部选中",exact:!0,ctrl:!0},()=>{const e=this.app?.isPluginEnable("selectorPlugin");this.app?.triggerSelector(!0),this.app?.selectAll(),this.app?.triggerSelector(e)})),this.keyFns.push(Qt.on({key:"g",title:"组合",ctrl:!0,shift:!0,exact:!0},()=>{})),this.app.emit("selectorInstalled",this)}destroy(){this.keyFns.forEach(t=>t.removeListener?.()),this.keyFns=[],this.selector?.destroy(),this.app?.off("canvasCleared",this.onCanvasCleared),this.app?.emit("selectorDestroy",this)}enable(){this.selector&&(this.selector.triggerSelector(!0),this.options.enabled=!0)}disable(){this.selector&&(this.selector.cancelSelect(),this.selector.triggerSelector(!1),this.options.enabled=!1)}isEnabled(){return this.options.enabled&&(this.selector?.enabled??!1)}onCanvasCleared=()=>{this.selector?.cancelSelect()}}class fr{app;id=0;name;options;executed=!1;executeTime=new Date().getTime();constructor(t,e){this.app=t,this.name=this.constructor.name,this.options=e}toJSON(){return{id:this.id,name:this.name,options:this.options,executed:this.executed,executeTime:this.executeTime}}fromJSON(t){this.id=t.id,this.name=t.name,this.options=t.options,this.executed=t.executed,this.executeTime=t.executeTime}}class F6 extends fr{constructor(t,e){super(t,e)}execute(){this.app._add(...this.options.nodes)}undo(){this.app._remove(...this.options.nodes)}}class N6 extends fr{constructor(t,e){super(t,e)}execute(){this.app._remove(...this.options.nodes)}undo(){this.app._add(...this.options.nodes)}}class G6 extends fr{constructor(t,e){super(t,e)}execute(){this.app._update(...this.options.newNodes)}undo(){this.app._update(...this.options.oldNodes)}}class U6 extends fr{constructor(t,e){super(t,e)}execute(){this.options.nodes.forEach(({node:t,newZIndex:e})=>{t.setZIndex(e)})}undo(){this.options.nodes.forEach(({node:t,oldZIndex:e})=>{t.setZIndex(e)})}}class B6 extends fr{constructor(t,e){super(t,e)}execute(){this.app._makeGroup(this.options.nodes)}undo(){this.app._decomposeGroup(this.options.group)}}class z6 extends fr{constructor(t,e){super(t,e)}execute(){this.app._decomposeGroup(this.options.group)}undo(){this.app._makeGroup(this.options.nodes)}}class p1{name="history";app;enabled;stackSize;undoStack=[];redoStack=[];idCounter=0;constructor(t,e){const{enabled:i,stackSize:r}=e;this.app=t,this.enabled=i,this.stackSize=r}execute(t,e){this.undoStack.length>this.stackSize&&this.undoStack.shift(),this.undoStack.push(t),t.id=++this.idCounter,e&&t.execute(),t.executed=!0,t.executeTime=new Date().getTime(),this.redoStack=[],this.app.emit("stackChanged",this.undoStack,this.redoStack)}undo(t=1){if(!this.enabled)return;let e;for(;t;)this.undoStack.length>0&&(e=this.undoStack.pop(),e&&(e.undo(),this.redoStack.push(e),this.app.emit("stackChanged",this.undoStack,this.redoStack))),--t;return this.app.emit("historyUndo",t,e?.toJSON()),e}redo(t=1){if(!this.enabled)return;let e;for(;t;)this.redoStack.length>0&&(e=this.redoStack.pop(),e&&(e.execute(),this.undoStack.push(e),this.app.emit("stackChanged",this.undoStack,this.redoStack))),--t;return this.app.emit("historyRedo",t,e?.toJSON()),e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}jump(t){if(!this.enabled)return;let e=this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0;if(e===void 0||t>e.id)for(e=this.redo();e!==void 0&&t>e.id;)e=this.redo();else for(;e=this.undoStack[this.undoStack.length-1],!(e===void 0||t===e.id);)this.undo();this.app.emit("stackChanged",this.undoStack,this.redoStack)}destroy(){this.undoStack=[],this.redoStack=[],this.app.emit("stackChanged",this.undoStack,this.redoStack)}}class $6{name="historyPlugin";history;app;options;keyFns=[];oldNodes=[];constructor(t){this.options={enabled:!0,stackSize:100,...t}}install(t){this.app=t,this.history=new p1(t,this.options),this.history.app=t,this.app.on("nodeAdded",this.onNodeAdded),this.app.on("nodeRemoved",this.onNodeRemove),this.app.on("nodeUpdateBefore",this.onNodeUpdateBefore),this.app.on("nodeZindexChanged",this.onNodeZIndexChanged),this.app.on("nodeGroupMake",this.onMakeGroup),this.app.on("nodeGroupDecompose",this.onDecomposeGroup),this.app.on("nodeUpdated",this.onNodeUpdated),this.app.undo=function(e=1){const i=this.app.getPlugin("historyPlugin");return i&&i.history?.undo(e),this},this.app.redo=function(e=1){const i=this.app.getPlugin("historyPlugin");return i&&i.history?.redo(e),this},this.app.canUndo=function(){const e=this.app.getPlugin("historyPlugin");return e?e.history?.canUndo()??!1:!1},this.app.canRedo=function(){const e=this.app.getPlugin("historyPlugin");return e?e.history?.canRedo()??!1:!1},this.app.jump=function(e){const i=this.app.getPlugin("historyPlugin");return i&&i.history?.jump(e),this},this.keyFns.push(Qt.on({key:"z",title:"撤销",exact:!0,ctrl:!0},()=>{this.app?.undo()})),this.keyFns.push(Qt.on({key:"y",title:"重做",exact:!0,ctrl:!0},()=>{this.app?.redo()})),this.app.emit("historyInstalled",this)}destroy(){this.keyFns.forEach(t=>t.removeListener?.()),this.keyFns=[],this.history?.destroy(),this.app?.off("nodeAdded",this.onNodeAdded),this.app?.off("nodeRemoved",this.onNodeRemove),this.app?.off("nodeUpdateBefore",this.onNodeUpdateBefore),this.app?.off("nodeUpdated",this.onNodeUpdated),this.app?.off("nodeGroupMake",this.onMakeGroup),this.app?.off("nodeGroupDecompose",this.onDecomposeGroup),this.app?.emit("historyDestroy",this)}enable(){this.history&&(this.options.enabled=!0,this.history.enabled=!0)}disable(){this.history&&(this.options.enabled=!1,this.history.enabled=!1)}isEnabled(){return this.options.enabled&&(this.history?.enabled??!1)}onNodeAdded=t=>{!this.app||!this.history||this.history.execute(new F6(this.app,{nodes:t}))};onNodeRemove=t=>{!this.app||!this.history||this.history.execute(new N6(this.app,{nodes:t}))};onNodeUpdateBefore=t=>{this.oldNodes=t.map(e=>e.toObject())};onNodeUpdated=t=>{!this.app||!this.history||this.history.execute(new G6(this.app,{oldNodes:this.oldNodes,newNodes:t.map(e=>e.toObject())}))};onNodeZIndexChanged=t=>{!this.app||!this.history||this.history.execute(new U6(this.app,{nodes:t}))};onMakeGroup=(t,e)=>{!this.app||!this.history||this.history.execute(new B6(this.app,{nodes:e,group:t}))};onDecomposeGroup=(t,e)=>{!this.app||!this.history||this.history.execute(new z6(this.app,{nodes:e,group:t}))}}class V6{name="diamondTool";hooks;config;diamond=null;startPointer=new Wt({x:0,y:0});constructor({config:t,hooks:e}){this.config=t,this.hooks=e}mousedown({app:t}){this.diamond||(this.startPointer.clone(t.pointer),this.diamond=new Vt.RegularPolygon({sides:4,radius:0,strokeScaleEnabled:!1,...this.config}),this.diamond.setPosition(this.startPointer),t.add(this.diamond),this.hooks?.onStartDrawing?.(t,this.diamond))}mousemove({app:t}){if(!this.diamond)return;const e=t.pointer.x-this.startPointer.x,i=t.pointer.y-this.startPointer.y,r=new Wt({x:this.startPointer.x+e/2,y:this.startPointer.y+i/2});this.diamond.setPosition(r),this.diamond.radius(r.distanceTo(t.pointer)),t.render()}mouseup({app:t,pointer:e}){if(this.diamond){if(this.startPointer.eq(e)){this.diamond?.destroy(),this.diamond=null;return}this.hooks?.onCompleteDrawing?.(t,this.diamond),this.diamond=null,this.startPointer.setXY(0,0)}}enableChanged(){this.diamond=null,this.startPointer.setXY(0,0)}}class H6{name="drawingTool";config;hooks;line=null;points=[];constructor({config:t,hooks:e}){this.config=t,this.hooks=e}mousedown({app:t}){const e=this.points.at(-1);(!e||!e.eq(t.pointer))&&this.points.push(t.pointer),!this.line&&(this.line=new Vt.Line({points:ur(this.points),globalCompositeOperation:"source-over",lineCap:"round",lineJoin:"round",strokeScaleEnabled:!1,hitStrokeWidth:20,...this.config}),t.add(this.line),this.hooks?.onStartDrawing?.(t,this.line))}mousemove({app:t,event:e}){this.line&&(e.evt.stopPropagation(),this.points.push(t.pointer),this.line.points(ur(this.points)))}mouseup({app:t,pointer:e}){if(!this.line)return;const i=this.points.at(-1);this.points.length<=6&&i&&e.distanceTo(i)<10&&this.line&&this.line.destroy(),this.hooks?.onCompleteDrawing?.(t,this.line),this.line=null,this.points=[]}enableChanged(){this.line=null,this.points=[]}}class j6{name="ellipseTool";config;hooks;ellipse=null;startPointer=new Wt({x:0,y:0});constructor({config:t,hooks:e}){this.config=t,this.hooks=e}mousedown({app:t}){this.ellipse||(this.startPointer.clone(t.pointer),this.ellipse=new Vt.Ellipse({radiusX:0,radiusY:0,strokeScaleEnabled:!1,...this.config}),this.ellipse.setPosition(this.startPointer),this.ellipse.radius(new Wt({x:0,y:0})),t.add(this.ellipse))}mousemove({app:t}){if(!this.ellipse)return;const e=t.pointer.x-this.startPointer.x,i=t.pointer.y-this.startPointer.y,r=new Wt({x:Math.abs(e)/2,y:Math.abs(i)/2});this.ellipse.setPosition(new Wt({x:this.startPointer.x+e/2,y:this.startPointer.y+i/2})),this.ellipse.radius(r),t.render()}mouseup({app:t,pointer:e}){if(this.ellipse){if(this.startPointer.eq(e)){this.ellipse?.destroy(),this.ellipse=null;return}this.hooks?.onCompleteDrawing?.(t,this.ellipse),this.ellipse=null,this.startPointer.setXY(0,0)}}enableChanged(){this.ellipse=null,this.startPointer.setXY(0,0)}}class X6{name="imageTool";config;hooks;image=null;isAdded=!1;imageElement=new Image;constructor({config:t,hooks:e}){this.config=t,this.hooks=e}mousedown({app:t}){this.image&&(this.image.opacity(1),this.hooks?.onCompleteDrawing?.(t,this.image),this.image=null)}mousemove({app:t,pointer:e}){if(this.isAdded||(this.image=new Vt.Image({strokeScaleEnabled:!1,image:this.imageElement,...this.config}),this.image.opacity(.5),this.image.image(this.imageElement),t.add(this.image),this.isAdded=!0),!this.image)return;const i=200,r=i*((this.imageElement.height??1)/(this.imageElement.width??1));this.image.width(i),this.image.height(r),this.image.position(new Wt({x:e.x-i/2,y:e.y-r/2})),t.render()}enableChanged(){this.image=null,this.imageElement=new Image}}class Y6{name="lineTool";config;hooks;points=[];line=null;constructor({config:t,hooks:e}){this.config=t,this.hooks=e}mousedown({app:t}){this.line||(this.line=new Vt.Line({points:ur(this.points),fill:"transparent",strokeScaleEnabled:!1,hitStrokeWidth:20,...this.config}),t.add(this.line),this.hooks?.onStartDrawing?.(t,this.line));const e=this.points.at(-1);(!e||!e.eq(t.pointer))&&this.points.push(t.pointer),this.line.points(ur(this.points))}mousemove({app:t,pointer:e}){this.line&&(this.line.points(ur(this.points).concat(e.x,e.y)),t.render())}doubleClick({app:t}){this.line&&(this.hooks?.onCompleteDrawing?.(t,this.line),this.line=null,this.points=[])}enableChanged(){this.line=null,this.points=[]}}class q6{name="rectTool";config;hooks;startPointer=new Wt({x:0,y:0});rectangle=null;constructor({config:t,hooks:e}){this.config=t,this.hooks=e}mousedown({app:t}){this.rectangle||(this.startPointer.clone(t.pointer),this.rectangle=new Vt.Rect({strokeScaleEnabled:!1,...this.config}),this.rectangle.setPosition(this.startPointer),this.rectangle.width(0),this.rectangle.height(0),t.add(this.rectangle),this.hooks?.onStartDrawing?.(t,this.rectangle))}mousemove({app:t}){this.rectangle&&(this.rectangle.setPosition(new Wt({x:Math.min(this.startPointer.x,t.pointer.x),y:Math.min(this.startPointer.y,t.pointer.y)})),this.rectangle.width(Math.abs(t.pointer.x-this.startPointer.x)),this.rectangle.height(Math.abs(t.pointer.y-this.startPointer.y)),t.render())}mouseup({app:t,pointer:e}){if(this.rectangle){if(this.startPointer.eq(e)){this.rectangle?.destroy(),this.rectangle=null;return}this.hooks?.onCompleteDrawing?.(t,this.rectangle),this.rectangle=null,this.startPointer.setXY(0,0)}}enableChanged(){this.rectangle=null,this.startPointer.setXY(0,0)}}class W6{name="selectTool";hooks;constructor(t){this.hooks=t.hooks}}const K6=(n,t,e)=>{t.hide();const i=t.absolutePosition(),r={x:n.stage.container().offsetLeft+i.x,y:n.stage.container().offsetTop+i.y},s=document.createElement("textarea");document.body.appendChild(s),s.value=t.text(),s.style.position="absolute",s.style.top=r.y+"px",s.style.left=r.x+"px",s.style.width=t.width()*t.scaleX()-t.padding()*2+"px",s.style.height=t.height()*t.scaleX()-t.padding()*2+5+"px",s.style.fontSize=t.fontSize()*t.scaleX()+"px",s.style.border="none",s.style.padding="0px",s.style.margin="0px",s.style.overflow="hidden",s.style.background="none",s.style.outline="none",s.style.resize="none",s.style.lineHeight=t.lineHeight().toString(),s.style.fontFamily=t.fontFamily(),s.style.transformOrigin="left top",s.style.textAlign=t.align(),s.style.color=t.stroke(),s.style.caretColor=t.stroke();const a=t.rotation();let o="";a&&(o+="rotateZ("+a+"deg)");let h=0;navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&(h+=2+Math.round(t.fontSize()/20)),o+="translateY(-"+h+"px)",s.style.transform=o,s.style.height=s.scrollHeight+3+"px",s.focus();function c(){s.parentNode?.removeChild(s),window.removeEventListener("click",f),t.show()}function d(u){u=Math.max(s.value.length*t.fontSize(),u);const m=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),v=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;(m||v)&&(u=Math.ceil(u)),(document.DOCUMENT_NODE||/Edge/.test(navigator.userAgent))&&(u+=1),s.style.width=u+"px"}s.addEventListener("keydown",function(u){u.key==="Enter"&&!u.shiftKey&&(s.value.trim().length>=1?t.text(s.value.charAt(0)===" "?s.value.substring(1):s.value):n.remove(t),c(),e()),u.key==="Escape"&&c()}),s.addEventListener("keydown",function(){const u=t.getAbsoluteScale().x;d(t.width()*u),s.style.height="auto",s.style.height=s.scrollHeight+t.fontSize()+"px"});function f(u){u.target!==s&&(t.text(s.value),c())}setTimeout(()=>{window.addEventListener("click",f)})};class Z6{name="textTool";config;hooks;textNode=null;constructor({config:t,hooks:e}){this.config=t,this.hooks=e}doubleClick({app:t,pointer:e}){this.textNode=new Vt.Text({...this.config,text:" ",x:e.x,y:e.y,fontFamily:"JiaYouYa"}),this.textNode.on("dblclick",({target:i})=>{K6(t,i,()=>{this.hooks?.onCompleteDrawing?.(t,i)})}),t.add(this.textNode),this.textNode.fire("dblclick")}enableChanged(){this.textNode=null}}class J6{name="eraserTool";hooks;targetMap=new Map;isEraser=!1;constructor(t){this.hooks=t.hooks}mousedown({event:t}){this.isEraser=!0,!(t.target instanceof Vt.Stage)&&(this.targetMap.set(t.target.id(),{node:t.target,opacity:t.target.attrs.opacity}),t.target.opacity(.3))}mouseup({app:t}){this.targetMap.size&&(t.remove(...[...this.targetMap.values()].map(({node:e,opacity:i})=>(e.opacity(i),e))),this.targetMap.clear(),this.isEraser=!1)}mousemove({event:t}){!this.isEraser||t.target instanceof Vt.Stage||this.targetMap.get(t.target.id())||(this.targetMap.set(t.target.id(),{node:t.target,opacity:t.target.attrs.opacity}),t.target.opacity(.3))}enableChanged(){this.targetMap.clear(),this.isEraser=!1}}const m1={backgroundColor:"#ffffff",scale:{min:.05,max:5},panning:{enabled:!1,cursor:"grabbing"},mousewheel:{enabled:!1,factor:.1}};class Q6 extends Zl{stage;mainLayer;config;mouse;tooler;installedPlugins=new Map;resizeObserver;constructor(t){super(),this.config={...m1,...t},this.stage=new Vt.Stage({container:document.createElement("div"),width:500,height:500}),this.stage.container().style.backgroundColor=this.config.backgroundColor,this.mainLayer=new Vt.Layer,this.mainLayer.name("main:layer"),this.stage.add(this.mainLayer),this.tooler=new M6(this),this.mouse=new A6(this),this.resizeObserver=new ResizeObserver(e=>{const{width:i,height:r}=e[0].contentRect;this.stage.width(i),this.stage.height(r),this.emit("resizeRoot",i,r),this.render()}),this.triggerPanning(this.config.panning.enabled),this.triggerMouseWheel(this.config.mousewheel.enabled),this.registerKeyFns()}registerKeyFns(){Qt.on({key:"o",title:"打开",exact:!0,ctrl:!0},()=>{ec().then(t=>ko(t[0])).then(t=>{this.fromJSON(t)})}),Qt.on({key:"e",title:"导出图片",exact:!0,ctrl:!0,shift:!0},()=>{}),Qt.on({key:"[",title:"下移一层",exact:!0,ctrl:!0},()=>{}),Qt.on({key:"]",title:"上移一层",exact:!0,ctrl:!0},()=>{}),Qt.on({key:"[",title:"置于底层",exact:!0,ctrl:!0,shift:!0},()=>{}),Qt.on({key:"]",title:"置于顶层",exact:!0,ctrl:!0,shift:!0},()=>{}),Qt.on({key:["delete","backspace"],title:"删除"},()=>{console.log("删除")}),Qt.on({key:"r",title:"重置画布",exact:!0,ctrl:!0},()=>{}),Qt.on({key:" ",title:"移动画布"},()=>(console.log("移动画布"),this.triggerPanning(!0),()=>{this.triggerPanning(!1)})),Qt.on({key:["Control","Meta"],title:"缩放画布"},()=>(this.triggerMouseWheel(!0),()=>{this.triggerMouseWheel(!1)})),Qt.on({key:"j",title:"解除组合",ctrl:!0,shift:!0,exact:!0},()=>{})}get pointer(){const{x:t,y:e}=this.stage.getRelativePointerPosition()??{x:0,y:0};return new Wt({x:t,y:e})}get curTool(){return this.tooler.currentTool}get containerElement(){return this.stage.container()}mount(t){this.stage.container(t),this.resizeObserver.observe(this.stage.container())}async setTool(t){await this.tooler.setTool(t)}triggerPanning(t){return t===void 0?this.stage.draggable(this.stage.draggable()):this.stage.draggable(t),this.stage.draggable()?this.stage.container().style.cursor=this.config.panning.cursor??"grabbing":this.stage.container().style.cursor="default",this}triggerMouseWheel(t){return t===void 0?this.config.mousewheel.enabled=!this.config.mousewheel.enabled:this.config.mousewheel.enabled=t,this}triggerTool(t){return this.tooler.trigger(t),this}add(...t){return this._add(...t),this.emit("nodeAdded",t),this}_add(...t){return this.mainLayer.add(...t.map(e=>(e.attrs.id||e.id(`#${R1()}`),e))),this.render(),this}remove(...t){return this._remove(...t),this.emit("nodeRemoved",t),this}_remove(...t){return t.forEach(e=>{e.remove()}),this.render(),this}update(...t){const e=i=>i.reduce((r,s)=>{const a=this.getNodeById(s.attrs.id);return a&&r.push(a),r},[]);return this.emit("nodeUpdateBefore",e(t)),this._update(...t),this.emit("nodeUpdated",e(t)),this}_update(...t){return t.forEach(e=>{this.getNodeById(e.attrs.id)?.setAttrs(e.attrs)}),this.render(),this}makeGroup(t){const e=this._makeGroup(t);return e instanceof Vt.Group&&this.emit("nodeGroupMake",e,t),e}_makeGroup(t){if(t.length<2)return t;const e=new Vt.Group({draggable:!0});return e.add(...t.map(i=>(i.draggable(!1),i))),this._add(e),e}decomposeGroup(t){const e=this._decomposeGroup(t);return this.emit("nodeGroupDecompose",t,e),e}_decomposeGroup(t){const e=t.getParent()??this.mainLayer,i=[...t.getChildren()].map(r=>{const{x:s,y:a,scaleX:o,scaleY:h,skewX:l,skewY:c,rotation:d}=r.getTransform().decompose();return r.moveTo(e),r.x(s),r.y(a),r.scaleX(o),r.scaleY(h),r.skewX(l),r.skewY(c),r.rotation(d),r});return this._remove(t),i}findTopGroup(t){return t.parent instanceof Vt.Group&&t.parent.parent instanceof Vt.Group?this.findTopGroup(t.parent):t.parent instanceof Vt.Group?t.parent:null}moveUp(...t){return this.moveZIndexNodes(t,e=>e.moveUp()),this}moveDown(...t){return this.moveZIndexNodes(t,e=>e.moveDown()),this}moveTop(...t){return this.moveZIndexNodes(t,e=>e.moveToTop()),this}moveBottom(...t){return t.forEach(e=>e.moveToBottom()),this.moveZIndexNodes(t,e=>e.moveToBottom()),this}moveZIndexNodes(t,e){const i=t.map(r=>{const s={node:r,oldZIndex:r.getZIndex(),newZIndex:r.getZIndex()};return e(r),s.newZIndex=r.getZIndex(),s});i.some(({oldZIndex:r,newZIndex:s})=>r!==s)&&this.emit("nodeZindexChanged",i)}getNodeById(t){return this.getNodes(e=>e.id()===t)?.[0]}getNodes(t){return this.mainLayer.find(t)??[]}isPointInArea(t,e){const{width:i,height:r,x:s,y:a}=e;return t.x>=s&&t.x<=s+i&&t.y>=a&&t.y<=a+r}getShapesInArea(t){return this.mainLayer.getChildren(e=>e.visible()&&e!==t&&this.haveIntersection(t,e))}haveIntersection(t,e){const i=t.getClientRect({relativeTo:this.stage}),r=e.getClientRect({relativeTo:this.stage}),s=i.x<=r.x&&i.y<=r.y,a=i.x+i.width>=r.x+r.width&&i.y<=r.y,o=i.x<=r.x&&i.y+i.height>=r.y+r.height,h=i.x+i.width>=r.x+r.width&&i.y+i.height>=r.y+r.height;return s&&a&&o&&h}render(){this.mainLayer.draw()}scale(){return this.stage.scaleX()}scaleTo(t,e=new Wt({x:0,y:0})){const i=this.scale();this.emit("canvasZoomStart",i);const r=Math.min(Math.max(t,this.config.scale.min),this.config.scale.max),s=new Wt({x:(e.x-this.stage.x())/i,y:(e.y-this.stage.y())/i});return this.stage.scale({x:r,y:r}),this.stage.position({x:e.x-s.x*r,y:e.y-s.y*r}),this.emit("canvasZoomEnd",this.scale()),this}clear(){this.mainLayer.removeChildren(),this.emit("canvasCleared"),this.render()}async toDataURL(t,e){const{padding:i=10,pixelRatio:r=2,mimeType:s="image/png",quality:a=1,haveBackground:o=!1}=e??{},h=new Vt.Layer;this.stage.add(h);let l=[];t&&t.length>0?l=t.map(R=>R.toObject()):l=this.mainLayer.children?.map(R=>R.toObject())??[];const c=l.map(R=>Vt.Node.create(R));h.add(...c);const d=new Vt.Transformer({rotateAnchorOffset:0});d.nodes(c);const f=d.getClientRect(),u=this.stage.scaleX(),m=this.stage.scaleY(),v=this.stage.x(),b=this.stage.y(),S=f.width+i*2,E=f.height+i*2,_=f.x-i,x=f.y-i,P=new Vt.Rect({width:S,height:E,x:(_-v)/u,y:(x-b)/m,fill:this.stage.container().style.backgroundColor});return o&&(h.add(P),P.moveToBottom()),new Promise((R,F)=>{try{h.toDataURL({width:S,height:E,x:_,y:x,pixelRatio:r,mimeType:s,quality:a,callback:L=>{R({dataURL:L,width:S,height:E}),d.remove(),h.remove()}})}catch(L){F(L)}})}toJSON(){return JSON.stringify(this.mainLayer.toObject())}fromJSON(t){this.clear(),this.mainLayer.remove();const e=Vt.Node.create(t,"layer");return this.mainLayer=e,this.stage.add(this.mainLayer),this.render(),this}use(t,...e){return this.installedPlugins.has(t.name)||(this.installedPlugins.set(t.name,t),t.install(this,...e)),this}getPlugin(t){return this.installedPlugins.get(t)}getPlugins(t){return t.map(e=>this.getPlugin(e))}enablePlugin(t){return Array.isArray(t)||(t=[t]),this.getPlugins(t)?.forEach(i=>i?.enable?.()),this}disablePlugin(t){return Array.isArray(t)||(t=[t]),this.getPlugins(t)?.forEach(i=>i?.disable?.()),this}isPluginEnable(t){return this.getPlugin(t)?.isEnabled?.()??!1}destroyPlugins(t){return Array.isArray(t)||(t=[t]),this.getPlugins(t)?.forEach(i=>i?.destroy()),this}destroy(){this.resizeObserver.disconnect(),this.destroyPlugins(Array.from(this.installedPlugins.keys())),this.mouse.destroy(),this.tooler.destroy(),this.stage.destroy(),this.removeAllListeners()}}const v1=[],_1={};function Ml(n){v1.push(n)}function t8(n,t=!1){const e=Yc();if(_1[e])return;wx.error(s=>{console.log(s.errMsg??JSON.stringify(s))}),wx.ready(()=>{v1.forEach(s=>s())});const i=["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"],r=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(n,{debug:t,jsApiList:i,openTagList:r})),_1[e]=!0}function e8(n){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[n],success:function(i){i.checkResult[n]?t(!0):e(!1)},fail:function(){e(!1)}})})}function i8(n){Ml(function(){wx.updateAppMessageShareData(n)})}function n8(n){Ml(function(){wx.updateTimelineShareData(n)})}function r8(n){wx.chooseImage(n)}function s8(n){wx.previewImage(n)}function a8(n){wx.uploadImage(n)}function o8(n){wx.downloadImage(n)}function h8(n){wx.getLocalImgData(n)}function l8(){wx.startRecord()}function c8(n){wx.stopRecord(n)}function u8(n){wx.onVoiceRecordEnd(n)}function f8(n){wx.playVoice(n)}function d8(n){wx.pauseVoice(n)}function g8(n){wx.stopVoice(n)}function p8(n){wx.onVoicePlayEnd(n)}function m8(n){wx.uploadVoice(n)}function v8(n){wx.downloadVoice(n)}function _8(n){wx.translateVoice(n)}function y8(n){wx.getNetworkType(n)}function w8(n){wx.openLocation(n)}function b8(n){wx.getLocation(n)}function x8(n){wx.scanQRCode(n)}function S8(n,t,e){function i(){WeixinJSBridge.invoke("getBrandWCPayRequest",n,function(r){r.err_msg=="get_brand_wcpay_request:ok"?t():e(r.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",i,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",i),document.attachEvent("onWeixinJSBridgeReady",i)):i()}function C8(n){window.AlipayJSBridge?n&&n():document.addEventListener("AlipayJSBridgeReady",n,!1)}function Qs(n,t){let e="未知错误";switch(n.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${n.error}(${e}): ${n.errorMessage}`}function T8(n,t,e){ap.tradePay(Object.assign(n,{}),function(i){let r="未知错误";switch(i.resultCode){case 9e3:return r="订单支付成功",t?.(r);case 8e3:r="正在处理中";break;case 4e3:r="订单支付失败";break;case 6001:r="用户中途取消";break;case 6002:r="网络连接出错";break;case 99:r="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(r)})}function k8(n,t,e){ap.scan(Object.assign(n,{fail:i=>{e?.(Qs(i))}}),function(i){t?.(i.code)})}function E8(n,t,e){ap.getLocation(Object.assign(n,{fail:i=>{e?.(Qs(i))}}),function(i){t?.(i)})}function P8(n,t,e){ap.openLocation(Object.assign(n,{fail:i=>{e?.(Qs(i))}}),function(){t?.()})}function A8(n,t,e){ap.chooseImage(Object.assign(n,{fail:i=>{e?.(Qs(i,"chooseImage"))}}),function(i){t?.(i)})}function M8(n,t,e){ap.previewImage(Object.assign(n,{fail:i=>{e?.(Qs(i))}}),function(){t?.()})}class R8{map;constructor(t,e=120.619585,i=31.299379,r=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,i),r)}}return V.AlignmentPlugin=L6,V.AnimateOperation=G_,V.CanvasOperation=Wo,V.CustomCanvasContext=Lr,V.CustomCanvasGradient=_a,V.CustomCanvasPattern=jo,V.DEFAULT_APP_CONFIG=m1,V.DOMCanvas=hp,V.DOMEvent=Eg,V.DOMKey=Qt,V.DOMMedia=kg,V.DOMMouse=Pr,V.DOMQuery=oe,V.DOMScroll=Pg,V.DOMToBlob=tc,V.DOMToString=Ql,V.DOMUtil=It,V.Dep=Pf,V.DiamondTool=V6,V.DrawingTool=H6,V.EllipseTool=j6,V.EraserTool=J6,V.HSVToRGBObject=pp,V.History=p1,V.HistoryPlugin=$6,V.ImageTool=X6,V.KonvaApp=Q6,V.LineTool=Y6,V.Matrix=we,V.Matrix3D=pn,V.PathGroup=mn,V.Point=Wt,V.Polygon=Ir,V.QRCode=Ki,V.RGBStringToHexString=dp,V.RGBToHSVObject=mp,V.Rect=jn,V.RectTool=q6,V.SVGOperation=Vi,V.SelectTool=W6,V.Selector=g1,V.SelectorPlugin=O6,V.ShapeArmyAnts=O_,V.ShapeArrow=x_,V.ShapeBall=S_,V.ShapeLight=Mf,V.ShapeLine=C_,V.ShapePoint3d=P_,V.ShapeRect=T_,V.ShapeSegment=D_,V.ShapeShip=k_,V.ShapeSlider=R_,V.ShapeSmileFace=F_,V.ShapeSpirograph=L_,V.ShapeStar=I_,V.ShapeTree=E_,V.ShapeTriangle=A_,V.ShapeTriangleLight=M_,V.TWEEN=b_,V.TextTool=Z6,V.Vector=ua,V.VideoUtil=rs,V.WebGLRenderer=B_,V.WebRTCClient=U_,V.WebSocketClient=W1,V.YZRaphael=qo,V.absolutize=da,V.addWatermark=e_,V.addWxJsReadyFnBeforeConfig=Ml,V.ajax=l_,V.aliJsChooseImage=A8,V.aliJsGetLocation=E8,V.aliJsOpenLocation=P8,V.aliJsPreviewImage=M8,V.aliJsReady=C8,V.aliJsScan=k8,V.aliJsTradePay=T8,V.angle=Io,V.animateInWeb=Ko,V.appendURLSearchString=wa,V.base64URLDecode=_p,V.base64URLEncode=vp,V.blobToRawImage=Ev,V.canDrawBitmap=_g,V.canUsePaths=vg,V.canUseWorker=pc,V.changeBrightness=Qv,V.changeDiaphaneity=t_,V.changeSize=Jv,V.checkWxJsApi=e8,V.clearCookies=Tg,V.colorNumberToHexString=Hc,V.colorNumberToRGBString=jc,V.compression=n_,V.createXMLHttpRequest=Lh,V.debugObject=wg,V.debugObjectProperty=yg,V.distance=mc,V.dquery=Do,V.drawQRCodeToCanvas=o_,V.fileOrBlobToDataURL=Rh,V.fileToArrayBufferPromise=ic,V.flatPoints=ur,V.flipSideToSide=Av,V.flipUpsideDown=Mv,V.formDataToSearchString=Qo,V.getBrowserClient=Ao,V.getBrowserClientVersion=rg,V.getBrowserLanguage=ag,V.getCookie=Sg,V.getCookieObject=Cg,V.getDirection=vc,V.getDocumentElement=Eo,V.getElementLeftInPage=oc,V.getElementPositionInPage=ac,V.getElementPositionInPage2=Q1,V.getElementPositionInViewport=tg,V.getElementTopInPage=hc,V.getFileExtensionFromFile=nc,V.getFileTypeFromFile=H1,V.getFilesImageInfo=bv,V.getFormSubmitData=h_,V.getGlobal=Po,V.getGroupCoords=P6,V.getImageDataByAIData=r_,V.getImageDataFromBitmap=Sv,V.getImageDataFromUrl=yf,V.getImageDataFromVideo=xv,V.getImageMainColor=Pv,V.getInternetExplorerVersion=uc,V.getMiddleValue=E6,V.getMousePositionInElement=ze,V.getMousePositionInPage=lc,V.getMousePositionInViewport=ig,V.getOperatingSystem=ha,V.getOperatingSystemVersion=ng,V.getPageClient=aa,V.getPageScroll=Hn,V.getPageSize=K1,V.getPointAtLength=Lc,V.getRaphael=sp,V.getRawImageInfo=Mh,V.getRelativeBoundingClientRect=eg,V.getScrollParent=V_,V.getTimeZone=og,V.getTotalLength=Dc,V.getURL=Jo,V.getUserGeolocationPromise=sg,V.getViewportSize=oa,V.getWorker=kp,V.gifImage=xf,V.h=q1,V.handleDragAndDropFiles=X1,V.handleInputFiles=j1,V.hasDocument=gg,V.hasHistory=pg,V.hasWindow=gc,V.hexStringToColorNumber=ya,V.hexStringToRGBString=Zo,V.ifWebFileHasChanged=c_,V.imageDataToBitmap=Cv,V.imageDataToBlob=kv,V.imageDataToDataURL=Tv,V.injectWxJsConfig=t8,V.isAliBrowser=dc,V.isAliMiniProgram=fg,V.isAndroid=cc,V.isAppleDevice=hg,V.isBrowserSupportFileAPI=mg,V.isDarkMode=cg,V.isElementInViewport=J1,V.isElementInViewportSimple=Z1,V.isIE=dg,V.isIOS=Mo,V.isMacOS=Ro,V.isMobile=lg,V.isPointInPath=Ic,V.isPointInStroke=Oc,V.isSvgPath=xc,V.isURL=yp,V.isWxBrowser=fc,V.isWxMiniProgram=ug,V.jpgToPng=qv,V.leftRotate=Rv,V.linkExport=To,V.localstorage=Fo,V.mapTDTJSSDK=R8,V.marginSharpen=Yv,V.microTask=Y1,V.mosaic=i_,V.mount=kr,V.norm=ca,V.normalize=ga,V.normalizePoint=Oo,V.onHashChange=Cp,V.onHistoryChange=Tp,V.onURLChange=Sp,V.outputGifBase64=Sf,V.outputQRCodeBase64=a_,V.parse=fa,V.parseTransformToMatrix=Ar,V.parseURL=Xc,V.patch=rc,V.patchDOM=sc,V.pngToJpg=Wv,V.qrDecompose=u1,V.radiusClip=Zv,V.randomColorHexString=up,V.randomColorHexString2=fp,V.randomColorNumber=cp,V.rappar=Uc,V.reactiveVue2=f_,V.reactiveVue3=d_,V.readFileInBrowser=ko,V.recordToSearchString=qc,V.recordToSearchString2=xp,V.rectClip=Kv,V.relative=Ng,V.rightRotate=Dv,V.searchStringToRecord=wp,V.searchStringToRecord2=bp,V.selectFileInBrowser=ec,V.setCookie=xg,V.setRem=bg,V.shadeColor=gp,V.shapeArrayEqual=c1,V.sharpen=Xv,V.stringToBlob=Co,V.stringToDOM=V1,V.theme=lp,V.toBlackAndWhite=Ov,V.toBlue=Uv,V.toBlueAndGreen=$v,V.toBlueAndGrey=jv,V.toDegree=Lo,V.toGreen=Gv,V.toGreenAndGrey=Hv,V.toGrey=Lv,V.toGrey2=Iv,V.toOpposite=Fv,V.toRadian=la,V.toRed=Nv,V.toRedAndBlue=zv,V.toRedAndGreen=Bv,V.toRedAndGrey=Vv,V.trimURLHash=Yc,V.watchEffect=u_,V.wxJsChooseImage=r8,V.wxJsDownloadImage=o8,V.wxJsDownloadVoice=v8,V.wxJsGetLocalImgData=h8,V.wxJsGetLocation=b8,V.wxJsGetNetworkType=y8,V.wxJsOnVoicePlayEnd=p8,V.wxJsOnVoiceRecordEnd=u8,V.wxJsOpenLocation=w8,V.wxJsPauseVoice=d8,V.wxJsPay=S8,V.wxJsPlayVoice=f8,V.wxJsPreviewImage=s8,V.wxJsScanQRCode=x8,V.wxJsStartRecord=l8,V.wxJsStopRecord=c8,V.wxJsStopVoice=g8,V.wxJsTranslateVoice=_8,V.wxJsUpdateAppMessageShareData=i8,V.wxJsUpdateTimelineShareData=n8,V.wxJsUploadImage=a8,V.wxJsUploadVoice=m8,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"}),V}({});
43
+ ${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 i=this.getPeerName(t);this.trace(`${i} ${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 i=document.createElement("div");i.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(i)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class Tp{canvas;gl;constructor(t){this.canvas=t;const e={alpha:!0,premultipliedAlpha:!1};if(this.gl=this.canvas.getContext("webgl",e),!this.gl)throw new Error("WebGL failed to initialize.")}}function ic(n,t){return!n||n.parentElement===null?t:ic(n.parentElement,t.concat([n]))}const na=function(n,t){return getComputedStyle(n,null).getPropertyValue(t)},Sp=function(n){return na(n,"overflow")+na(n,"overflow-y")+na(n,"overflow-x")},Ep=function(n){return/(auto|scroll)/.test(Sp(n))};function kp(n){if(!(n instanceof HTMLElement||n instanceof SVGElement))return;const t=ic(n.parentElement,[]);for(let e=0;e<t.length;e+=1)if(Ep(t[e]))return t[e];return document.scrollingElement||document.documentElement}const rc=[],sc={};function ia(n){rc.push(n)}function Ap(n,t=!1){const e=_o();if(sc[e])return;wx.error(s=>{console.log(s.errMsg??JSON.stringify(s))}),wx.ready(()=>{rc.forEach(s=>s())});const i=["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"],r=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(n,{debug:t,jsApiList:i,openTagList:r})),sc[e]=!0}function Pp(n){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[n],success:function(i){i.checkResult[n]?t(!0):e(!1)},fail:function(){e(!1)}})})}function Ip(n){ia(function(){wx.updateAppMessageShareData(n)})}function Mp(n){ia(function(){wx.updateTimelineShareData(n)})}function Lp(n){wx.chooseImage(n)}function Dp(n){wx.previewImage(n)}function Rp(n){wx.uploadImage(n)}function Op(n){wx.downloadImage(n)}function Fp(n){wx.getLocalImgData(n)}function Up(){wx.startRecord()}function Np(n){wx.stopRecord(n)}function zp(n){wx.onVoiceRecordEnd(n)}function Bp(n){wx.playVoice(n)}function Gp(n){wx.pauseVoice(n)}function Hp(n){wx.stopVoice(n)}function Vp(n){wx.onVoicePlayEnd(n)}function jp(n){wx.uploadVoice(n)}function Xp(n){wx.downloadVoice(n)}function Yp(n){wx.translateVoice(n)}function $p(n){wx.getNetworkType(n)}function qp(n){wx.openLocation(n)}function Zp(n){wx.getLocation(n)}function Wp(n){wx.scanQRCode(n)}function Jp(n,t,e){function i(){WeixinJSBridge.invoke("getBrandWCPayRequest",n,function(r){r.err_msg=="get_brand_wcpay_request:ok"?t():e(r.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",i,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",i),document.attachEvent("onWeixinJSBridgeReady",i)):i()}function Kp(n){window.AlipayJSBridge?n&&n():document.addEventListener("AlipayJSBridgeReady",n,!1)}function Bi(n,t){let e="未知错误";switch(n.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${n.error}(${e}): ${n.errorMessage}`}function Qp(n,t,e){ap.tradePay(Object.assign(n,{}),function(i){let r="未知错误";switch(i.resultCode){case 9e3:return r="订单支付成功",t?.(r);case 8e3:r="正在处理中";break;case 4e3:r="订单支付失败";break;case 6001:r="用户中途取消";break;case 6002:r="网络连接出错";break;case 99:r="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(r)})}function t1(n,t,e){ap.scan(Object.assign(n,{fail:i=>{e?.(Bi(i))}}),function(i){t?.(i.code)})}function e1(n,t,e){ap.getLocation(Object.assign(n,{fail:i=>{e?.(Bi(i))}}),function(i){t?.(i)})}function n1(n,t,e){ap.openLocation(Object.assign(n,{fail:i=>{e?.(Bi(i))}}),function(){t?.()})}function i1(n,t,e){ap.chooseImage(Object.assign(n,{fail:i=>{e?.(Bi(i,"chooseImage"))}}),function(i){t?.(i)})}function r1(n,t,e){ap.previewImage(Object.assign(n,{fail:i=>{e?.(Bi(i))}}),function(){t?.()})}class s1{map;constructor(t,e=120.619585,i=31.299379,r=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,i),r)}}return O.AnimateOperation=op,O.CanvasOperation=fs,O.CustomCanvasContext=fi,O.CustomCanvasGradient=er,O.CustomCanvasPattern=Jr,O.DOMEvent=Hh,O.DOMEventBus=po,O.DOMKey=Ha,O.DOMMedia=Gh,O.DOMQuery=Vt,O.DOMScroll=Vh,O.DOMToBlob=Ta,O.DOMToString=Ca,O.DOMUtil=Pt,O.Dep=Kl,O.HSVToRGBObject=Wh,O.Matrix=Jt,O.Matrix3D=yn,O.PathGroup=wn,O.Point=Ee,O.Polygon=gi,O.QRCode=hn,O.RGBStringToHexString=qh,O.RGBToHSVObject=Jh,O.Rect=Nn,O.SVGOperation=nn,O.ShapeArmyAnts=xp,O.ShapeArrow=lp,O.ShapeBall=cp,O.ShapeLight=nc,O.ShapeLine=hp,O.ShapePoint3d=pp,O.ShapeRect=fp,O.ShapeSegment=_p,O.ShapeShip=up,O.ShapeSlider=vp,O.ShapeSmileFace=bp,O.ShapeSpirograph=yp,O.ShapeStar=wp,O.ShapeTree=dp,O.ShapeTriangle=gp,O.ShapeTriangleLight=mp,O.TWEEN=ea,O.Vector=Cr,O.VideoUtil=zi,O.WebGLRenderer=Tp,O.WebRTCClient=Cp,O.WebSocketClient=Rc,O.YZRaphael=hs,O.absolutize=rr,O.addWatermark=U0,O.addWxJsReadyFnBeforeConfig=ia,O.ajax=X0,O.aliJsChooseImage=i1,O.aliJsGetLocation=e1,O.aliJsOpenLocation=n1,O.aliJsPreviewImage=r1,O.aliJsReady=Kp,O.aliJsScan=t1,O.aliJsTradePay=Qp,O.angle=qr,O.animateInWeb=Ql,O.appendURLSearchString=lr,O.base64URLDecode=Qh,O.base64URLEncode=Kh,O.blobToRawImage=c0,O.canDrawBitmap=ih,O.canUsePaths=nh,O.canUseWorker=za,O.changeBrightness=O0,O.changeDiaphaneity=F0,O.changeSize=R0,O.checkWxJsApi=Pp,O.clearCookies=Bh,O.colorNumberToHexString=go,O.colorNumberToRGBString=mo,O.compression=z0,O.createXMLHttpRequest=Ws,O.debugObject=sh,O.debugObjectProperty=rh,O.distance=Ga,O.dquery=us,O.drawQRCodeToCanvas=V0,O.fileOrBlobToDataURL=qs,O.fileToArrayBufferPromise=Ea,O.flipSideToSide=f0,O.flipUpsideDown=u0,O.formDataToSearchString=ms,O.fromAngleAndLength=Zr,O.getBrowserClient=jr,O.getBrowserClientVersion=Vc,O.getBrowserLanguage=Xc,O.getCookie=Nh,O.getCookieObject=zh,O.getDirection=ch,O.getDocumentElement=Hr,O.getElementLeftInPage=Ma,O.getElementPositionInPage=Ia,O.getElementPositionInPage2=Nc,O.getElementPositionInViewport=zc,O.getElementTopInPage=La,O.getFileExtensionFromFile=ka,O.getFileTypeFromFile=Pc,O.getFilesImageInfo=i0,O.getFormSubmitData=j0,O.getGlobal=Vr,O.getImageDataByAIData=B0,O.getImageDataFromBitmap=s0,O.getImageDataFromUrl=Vl,O.getImageDataFromVideo=r0,O.getImageMainColor=h0,O.getInternetExplorerVersion=Oa,O.getMousePositionInElement=Zi,O.getMousePositionInPage=Da,O.getMousePositionInViewport=Gc,O.getOperatingSystem=Wi,O.getOperatingSystemVersion=Hc,O.getPageClient=$i,O.getPageScroll=Un,O.getPageSize=Oc,O.getPointAtLength=oo,O.getRaphael=Oh,O.getRawImageInfo=$s,O.getRelativeBoundingClientRect=Bc,O.getScrollParent=kp,O.getTimeZone=Yc,O.getTotalLength=ao,O.getURL=gs,O.getUserGeolocationPromise=jc,O.getViewportSize=qi,O.getWorker=lf,O.gifImage=Yl,O.h=Dc,O.handleDragAndDropFiles=Mc,O.handleInputFiles=Ic,O.hasDocument=Qc,O.hasHistory=th,O.hasWindow=Na,O.hexStringToColorNumber=or,O.hexStringToRGBString=ps,O.ifWebFileHasChanged=Y0,O.imageDataToBitmap=a0,O.imageDataToBlob=l0,O.imageDataToDataURL=o0,O.injectWxJsConfig=Ap,O.isAliBrowser=Ua,O.isAliMiniProgram=Jc,O.isAndroid=Ra,O.isAppleDevice=$c,O.isBrowserSupportFileAPI=eh,O.isDarkMode=Zc,O.isElementInViewport=Uc,O.isElementInViewportSimple=Fc,O.isIE=Kc,O.isIOS=Xr,O.isMacOS=Yr,O.isMobile=qc,O.isPointInPath=lo,O.isPointInStroke=co,O.isSvgPath=Wa,O.isURL=tf,O.isWxBrowser=Fa,O.isWxMiniProgram=Wc,O.jpgToPng=I0,O.leftRotate=d0,O.linkExport=Gr,O.localstorage=ds,O.mapTDTJSSDK=s1,O.marginSharpen=P0,O.microTask=Lc,O.mosaic=N0,O.mount=ci,O.norm=Ki,O.normalize=sr,O.normalizePoint=Wr,O.onHashChange=af,O.onHistoryChange=of,O.onURLChange=sf,O.outputGifBase64=$l,O.outputQRCodeBase64=H0,O.parse=ir,O.parseTransformToMatrix=ui,O.parseURL=vo,O.patch=Aa,O.patchDOM=Pa,O.pngToJpg=M0,O.radiusClip=D0,O.randomColorHexString=Yh,O.randomColorHexString2=$h,O.randomColorNumber=Xh,O.rappar=Za,O.reactiveVue2=q0,O.reactiveVue3=Z0,O.readFileInBrowser=Sa,O.recordToSearchString=yo,O.recordToSearchString2=rf,O.rectClip=L0,O.relative=yh,O.rightRotate=p0,O.searchStringToRecord=ef,O.searchStringToRecord2=nf,O.selectFileInBrowser=Ac,O.setCookie=Uh,O.setRem=ah,O.shadeColor=Zh,O.sharpen=A0,O.singletonGlobalAnimateInWeb=Ks,O.stringToBlob=Br,O.stringToDOM=kc,O.theme=jh,O.toBlackAndWhite=v0,O.toBlue=x0,O.toBlueAndGreen=T0,O.toBlueAndGrey=k0,O.toDegree=$r,O.toGreen=w0,O.toGreenAndGrey=E0,O.toGrey=g0,O.toGrey2=m0,O.toOpposite=_0,O.toRadian=Ji,O.toRed=y0,O.toRedAndBlue=C0,O.toRedAndGreen=b0,O.toRedAndGrey=S0,O.trimURLHash=_o,O.watchEffect=$0,O.wxJsChooseImage=Lp,O.wxJsDownloadImage=Op,O.wxJsDownloadVoice=Xp,O.wxJsGetLocalImgData=Fp,O.wxJsGetLocation=Zp,O.wxJsGetNetworkType=$p,O.wxJsOnVoicePlayEnd=Vp,O.wxJsOnVoiceRecordEnd=zp,O.wxJsOpenLocation=qp,O.wxJsPauseVoice=Gp,O.wxJsPay=Jp,O.wxJsPlayVoice=Bp,O.wxJsPreviewImage=Dp,O.wxJsScanQRCode=Wp,O.wxJsStartRecord=Up,O.wxJsStopRecord=Np,O.wxJsStopVoice=Hp,O.wxJsTranslateVoice=Yp,O.wxJsUpdateAppMessageShareData=Ip,O.wxJsUpdateTimelineShareData=Mp,O.wxJsUploadImage=Rp,O.wxJsUploadVoice=jp,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"}),O}({});
45
44
  //# sourceMappingURL=zyzgroup_core_web.iife.js.map