archgine 1.0.62 → 1.0.63

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.
@@ -4010,7 +4010,7 @@ Fu.__DOMHandler = Eu;
4010
4010
  Fu.normalizeLineEndings = Le;
4011
4011
  Fu.DOMParser = Ie;
4012
4012
  var gr = Fu.DOMParser;
4013
- const Er = "1.0.62";
4013
+ const Er = "1.0.63";
4014
4014
  function vr() {
4015
4015
  return typeof window < "u" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]");
4016
4016
  }
package/lib/index.mjs CHANGED
@@ -4010,7 +4010,7 @@ uu.__DOMHandler = Ra;
4010
4010
  uu.normalizeLineEndings = _d;
4011
4011
  uu.DOMParser = Cd;
4012
4012
  var Gx = uu.DOMParser;
4013
- const Yx = "1.0.62";
4013
+ const Yx = "1.0.63";
4014
4014
  function Xx() {
4015
4015
  return typeof window < "u" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]");
4016
4016
  }
@@ -12474,16 +12474,33 @@ class bA extends Eh {
12474
12474
  super(t), this.bind(`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-200 -200 500 500">
12475
12475
  <view id="defaultView" viewBox="-200 -200 500 500" />
12476
12476
  <style>
12477
- #svg-loading-fast circle {animation: svg-loading-fast 2s ease infinite;}
12477
+ /*#svg-loading-fast circle {animation: svg-loading-fast 2s ease infinite;}*/
12478
+ /*@keyframes svg-loading-fast {*/
12479
+ /* 0% {stroke-dasharray: 250; stroke-dashoffset: 250;}*/
12480
+ /* 50% {stroke-dasharray: 0; stroke-dashoffset: 0; opacity: 0.5;}*/
12481
+ /*}*/
12482
+ #svg-loading-fast .line {animation: svg-loading-fast 3s ease infinite;}
12478
12483
  @keyframes svg-loading-fast {
12479
- 10% {stroke-dasharray: 250; stroke-dashoffset: 250;}
12480
- 100% {stroke-dasharray: 0; stroke-dashoffset: 0; opacity: 0.5;}
12484
+ 0% {stroke-dasharray: 250; stroke-dashoffset: 250; opacity: 1;}
12485
+ 50% {stroke-dasharray: 250; stroke-dashoffset: 0; opacity: 0.5;}
12481
12486
  }
12482
- #svg-loading-fast {fill: #5CC9F5}
12487
+ #svg-loading-fast path {animation: pathFrames 6s ease infinite;}
12488
+ @keyframes pathFrames {
12489
+ 0% {opacity: 1;}
12490
+ 50% {opacity: 0.5;}
12491
+ }
12492
+ #svg-loading-fast .triangle {animation: triangleFrames 1s ease infinite;}
12493
+ @keyframes triangleFrames {
12494
+ 0% {opacity: 1;}
12495
+ 50% {opacity: 0.3;}
12496
+ }
12497
+ #svg-loading-fast {fill: #525252}
12498
+ .line {stroke: #525252; stroke-width: 4px}
12499
+ .triangle {fill: #F26666}
12483
12500
  </style>
12484
12501
  <g id="svg-loading-fast">
12485
12502
  <!-- <text x="50" y="55" style="text-anchor: middle; fill: #5CC9F5; font-size: 15px;">loading</text>-->
12486
- <circle cx="103" cy="25" r="103" style="fill: none; stroke: #5CC9F5; stroke-width: 1px;" />
12503
+ <!-- <circle cx="103" cy="25" r="103" style="fill: none; stroke: #5CC9F5; stroke-width: 1px;" />-->
12487
12504
  <path d="M14 35.7L14 15L21.27 15L21.27 33L34.59 33L33.08 35.7L14 35.7Z" />
12488
12505
  <path d="M44.78 17.77L44.78 32.93L55.4 32.93L55.4 15L62.71 15L62.71 35.7L37.47 35.7L37.47 15L55.4 15L52.88 17.77L44.78 17.77Z" />
12489
12506
  <path d="M76.39 27.92L85.03 27.92L82.9 30.77L75.2 30.77L73.29 35.7L65.59 35.7L73.94 15L87.19 15L95.58 35.7L87.94 35.7L85.03 27.92L81.14 17.77L79.99 17.77L76.39 27.92Z" />
@@ -12491,6 +12508,11 @@ class bA extends Eh {
12491
12508
  <path d="M133.63 35.7L126.61 35.7L126.61 15L133.63 15L133.63 35.7Z" />
12492
12509
  <path d="M153.75 35.7L143.78 21.3L143.78 35.7L136.51 35.7L136.51 15L144.64 15L154.58 29.65L154.58 15L161.78 15L161.78 35.7L153.75 35.7Z" />
12493
12510
  <path d="M182.73 33L182.73 25.73L177.37 25.73L177.37 22.99L189.93 22.99L189.93 35.7L182.73 35.7L182.73 33.5L180.57 35.7L164.66 35.7L164.66 15L190.04 15L188.46 17.7L172.04 17.7L172.04 33L182.73 33Z" />
12511
+ <!-- <rect class="line" width="207" height="5" x="0" y="43" />-->
12512
+ <!-- <path class="line" d="M0 43L207 43" />-->
12513
+ <path class="line" d="M103.5 46L0 46" />
12514
+ <path class="line" d="M103.5 46L207 46" />
12515
+ <path class="triangle" d="M103.5 56L133.5 90L73.5 90Z" />
12494
12516
  </g>
12495
12517
  </svg>`);
12496
12518
  }
@@ -17358,24 +17380,48 @@ var Wn = /* @__PURE__ */ ((r) => (r.SELECTED = "SELECTED", r.POINTEROVER = "POIN
17358
17380
  class Tb extends Eh {
17359
17381
  name = "SvgEmptyScene";
17360
17382
  constructor(t) {
17361
- super(t), this.bind(`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-20 10 78 22">
17362
- <view id="defaultView" viewBox="0 0 78 22" />
17383
+ super(t), this.bind(`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-200 -200 500 500">
17384
+ <view id="defaultView" viewBox="-200 -200 500 500" />
17363
17385
  <style>
17364
- #svg-loading-fast path {
17365
- fill: #2E3032;
17366
- animation: svg-loading-fast 2s ease infinite;
17386
+ /*#svg-loading-fast path {*/
17387
+ /* fill: #2E3032;*/
17388
+ /* animation: svg-loading-fast 2s ease infinite;*/
17389
+ /*}*/
17390
+ /*@keyframes svg-loading-fast {*/
17391
+ /* 0%, 100% {stroke-dasharray: 250; stroke-dashoffset: 250;}*/
17392
+ /* 68% {stroke-dasharray: 0; stroke-dashoffset: 0; opacity: 0.5;}*/
17393
+ /*}*/
17394
+ /*#svg-loading-fast .line {animation: svg-loading-fast 6s ease infinite;}*/
17395
+ /*@keyframes svg-loading-fast {*/
17396
+ /* 0% {stroke-dasharray: 250; stroke-dashoffset: 250; opacity: 1;}*/
17397
+ /* 50% {stroke-dasharray: 250; stroke-dashoffset: 0; opacity: 0.5;}*/
17398
+ /*}*/
17399
+ #svg-loading-fast path {animation: pathFrames 6s ease infinite;}
17400
+ @keyframes pathFrames {
17401
+ 0% {opacity: 1;}
17402
+ 50% {opacity: 0.5;}
17367
17403
  }
17368
- @keyframes svg-loading-fast {
17369
- 0%, 100% {stroke-dasharray: 250; stroke-dashoffset: 250;}
17370
- 68% {stroke-dasharray: 0; stroke-dashoffset: 0; opacity: 0.5;}
17404
+ #svg-loading-fast .triangle {animation: triangleFrames 3s ease infinite;}
17405
+ @keyframes triangleFrames {
17406
+ 0% {opacity: 1;}
17407
+ 50% {opacity: 0.3;}
17371
17408
  }
17372
- </style>
17409
+ #svg-loading-fast {fill: #525252}
17410
+ .line {stroke: #525252; stroke-width: 4px}
17411
+ .triangle {fill: #F26666}
17412
+ </style>
17373
17413
  <g id="svg-loading-fast">
17374
- <path d="M17.7 14L16.82 15.5L5 15.5L5 4L17.66 4L16.76 5.5L9.04 5.5L9.04 8.86L17.32 8.86L16.44 10.38L9.04 10.38L9.04 14L17.7 14Z" />
17375
- <path d="M22.98 15.44L19.3 15.44L19.3 7.38L31.38 7.38L30.18 8.82L29.02 8.82L29.02 15.44L25.3 15.44L25.3 8.82L22.98 8.82L22.98 15.44ZM35.06 15.44L31.38 15.44L31.38 7.38L35.06 7.38L35.06 15.44Z" />
17376
- <path d="M40.44 14.02L44.12 14.02L44.12 7.42L47.96 7.42L47.96 15.48L40.44 15.48L40.44 18.56L36.66 18.56L36.66 7.42L44.12 7.42L42.9 8.86L40.44 8.86L40.44 14.02Z" />
17377
- <path d="M51.62 7.42L51.62 4.78L55.48 4.78L55.48 7.42L59 7.42L58.02 8.86L55.48 8.86L55.48 14.08L58.82 14.08L57.98 15.48L51.62 15.48L51.62 8.86L49.56 8.86L49.56 7.42L51.62 7.42Z" />
17378
- <path d="M67.08 11.8L69.66 7.42L73.66 7.42L67.08 18.58L63.06 18.58L65.06 15.42L60.6 7.42L64.66 7.42L67.08 11.8Z" />
17414
+ <g transform="scale(2, 2) translate(12, 0)">
17415
+ <path d="M17.7 14L16.82 15.5L5 15.5L5 4L17.66 4L16.76 5.5L9.04 5.5L9.04 8.86L17.32 8.86L16.44 10.38L9.04 10.38L9.04 14L17.7 14Z" />
17416
+ <path d="M22.98 15.44L19.3 15.44L19.3 7.38L31.38 7.38L30.18 8.82L29.02 8.82L29.02 15.44L25.3 15.44L25.3 8.82L22.98 8.82L22.98 15.44ZM35.06 15.44L31.38 15.44L31.38 7.38L35.06 7.38L35.06 15.44Z" />
17417
+ <path d="M40.44 14.02L44.12 14.02L44.12 7.42L47.96 7.42L47.96 15.48L40.44 15.48L40.44 18.56L36.66 18.56L36.66 7.42L44.12 7.42L42.9 8.86L40.44 8.86L40.44 14.02Z" />
17418
+ <path d="M51.62 7.42L51.62 4.78L55.48 4.78L55.48 7.42L59 7.42L58.02 8.86L55.48 8.86L55.48 14.08L58.82 14.08L57.98 15.48L51.62 15.48L51.62 8.86L49.56 8.86L49.56 7.42L51.62 7.42Z" />
17419
+ <path d="M67.08 11.8L69.66 7.42L73.66 7.42L67.08 18.58L63.06 18.58L65.06 15.42L60.6 7.42L64.66 7.42L67.08 11.8Z" />
17420
+ </g>
17421
+
17422
+ <path class="line" d="M103.5 46L20 46" />
17423
+ <path class="line" d="M103.5 46L187 46" />
17424
+ <path class="triangle" d="M103.5 56L133.5 90L73.5 90Z" />
17379
17425
  </g>
17380
17426
  </svg>`);
17381
17427
  }
package/lib/index.umd.js CHANGED
@@ -2,7 +2,7 @@
2
2
  `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),r.entityMap=r.HTML_ENTITIES})(fc);var Ou={},Vs=di.NAMESPACE,Nu=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,pc=new RegExp("[\\-\\.0-9"+Nu.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),dc=new RegExp("^"+Nu.source+pc.source+"*(?::"+Nu.source+pc.source+"*)?$"),zs=0,zi=1,Jn=2,$s=3,ts=4,es=5,Gs=6,Za=7;function rs(r,t){this.message=r,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,rs)}rs.prototype=new Error,rs.prototype.name=rs.name;function gc(){}gc.prototype={parse:function(r,t,e){var i=this.domBuilder;i.startDocument(),vc(t,t={}),Ug(r,t,e,i,this.errorHandler),i.endDocument()}};function Ug(r,t,e,i,a){function o(O){if(O>65535){O-=65536;var vt=55296+(O>>10),Bt=56320+(O&1023);return String.fromCharCode(vt,Bt)}else return String.fromCharCode(O)}function l(O){var vt=O.slice(1,-1);return Object.hasOwnProperty.call(e,vt)?e[vt]:vt.charAt(0)==="#"?o(parseInt(vt.substr(1).replace("x","0x"))):(a.error("entity not found:"+O),O)}function c(O){if(O>N){var vt=r.substring(N,O).replace(/&#?\w+;/g,l);_&&f(N),i.characters(vt,0,O-N),N=O}}function f(O,vt){for(;O>=g&&(vt=E.exec(r));)d=vt.index,g=d+vt[0].length,_.lineNumber++;_.columnNumber=O-d+1}for(var d=0,g=0,E=/.*(?:\r\n?|\n)|.*$/g,_=i.locator,C=[{currentNSMap:t}],R={},N=0;;){try{var M=r.indexOf("<",N);if(M<0){if(!r.substr(N).match(/^\s*$/)){var I=i.doc,W=I.createTextNode(r.substr(N));I.appendChild(W),i.currentElement=W}return}switch(M>N&&c(M),r.charAt(M+1)){case"/":var J=r.indexOf(">",M+3),G=r.substring(M+2,J).replace(/[ \t\n\r]+$/g,""),b=C.pop();J<0?(G=r.substring(M+2).replace(/[\s<].*/,""),a.error("end tag name: "+G+" is not complete:"+b.tagName),J=M+1+G.length):G.match(/\s</)&&(G=G.replace(/[\s<].*/,""),a.error("end tag name: "+G+" maybe not complete"),J=M+1+G.length);var P=b.localNSMap,q=b.tagName==G,K=q||b.tagName&&b.tagName.toLowerCase()==G.toLowerCase();if(K){if(i.endElement(b.uri,b.localName,G),P)for(var tt in P)Object.prototype.hasOwnProperty.call(P,tt)&&i.endPrefixMapping(tt);q||a.fatalError("end tag name: "+G+" is not match the current start tagName:"+b.tagName)}else C.push(b);J++;break;case"?":_&&f(M),J=$g(r,M,i);break;case"!":_&&f(M),J=zg(r,M,i,a);break;default:_&&f(M);var Z=new xc,rt=C[C.length-1].currentNSMap,J=qg(r,M,Z,rt,l,a),st=Z.length;if(!Z.closed&&Vg(r,J,Z.tagName,R)&&(Z.closed=!0,e.nbsp||a.warning("unclosed xml attribute")),_&&st){for(var ct=yc(_,{}),ft=0;ft<st;ft++){var pt=Z[ft];f(pt.offset),pt.locator=yc(_,{})}i.locator=ct,mc(Z,i,rt)&&C.push(Z),i.locator=_}else mc(Z,i,rt)&&C.push(Z);Vs.isHTML(Z.uri)&&!Z.closed?J=Wg(r,J,Z.tagName,l,i):J++}}catch(O){if(O instanceof rs)throw O;a.error("element parse error: "+O),J=-1}J>N?N=J:c(Math.max(M,N)+1)}}function yc(r,t){return t.lineNumber=r.lineNumber,t.columnNumber=r.columnNumber,t}function qg(r,t,e,i,a,o){function l(_,C,R){e.attributeNames.hasOwnProperty(_)&&o.fatalError("Attribute "+_+" redefined"),e.addValue(_,C.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,a),R)}for(var c,f,d=++t,g=zs;;){var E=r.charAt(d);switch(E){case"=":if(g===zi)c=r.slice(t,d),g=$s;else if(g===Jn)g=$s;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(g===$s||g===zi)if(g===zi&&(o.warning('attribute value must after "="'),c=r.slice(t,d)),t=d+1,d=r.indexOf(E,t),d>0)f=r.slice(t,d),l(c,f,t-1),g=es;else throw new Error("attribute value no end '"+E+"' match");else if(g==ts)f=r.slice(t,d),l(c,f,t),o.warning('attribute "'+c+'" missed start quot('+E+")!!"),t=d+1,g=es;else throw new Error('attribute value must after "="');break;case"/":switch(g){case zs:e.setTagName(r.slice(t,d));case es:case Gs:case Za:g=Za,e.closed=!0;case ts:case zi:break;case Jn:e.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),g==zs&&e.setTagName(r.slice(t,d)),d;case">":switch(g){case zs:e.setTagName(r.slice(t,d));case es:case Gs:case Za:break;case ts:case zi:f=r.slice(t,d),f.slice(-1)==="/"&&(e.closed=!0,f=f.slice(0,-1));case Jn:g===Jn&&(f=c),g==ts?(o.warning('attribute "'+f+'" missed quot(")!'),l(c,f,t)):((!Vs.isHTML(i[""])||!f.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+f+'" missed value!! "'+f+'" instead!!'),l(f,f,t));break;case $s:throw new Error("attribute value missed!!")}return d;case"€":E=" ";default:if(E<=" ")switch(g){case zs:e.setTagName(r.slice(t,d)),g=Gs;break;case zi:c=r.slice(t,d),g=Jn;break;case ts:var f=r.slice(t,d);o.warning('attribute "'+f+'" missed quot(")!!'),l(c,f,t);case es:g=Gs;break}else switch(g){case Jn:e.tagName,(!Vs.isHTML(i[""])||!c.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+c+'" missed value!! "'+c+'" instead2!!'),l(c,c,t),t=d,g=zi;break;case es:o.warning('attribute space is required"'+c+'"!!');case Gs:g=zi,t=d;break;case $s:g=ts,t=d;break;case Za:throw new Error("elements closed character '/' and '>' must be connected to")}}d++}}function mc(r,t,e){for(var i=r.tagName,a=null,E=r.length;E--;){var o=r[E],l=o.qName,c=o.value,_=l.indexOf(":");if(_>0)var f=o.prefix=l.slice(0,_),d=l.slice(_+1),g=f==="xmlns"&&d;else d=l,f=null,g=l==="xmlns"&&"";o.localName=d,g!==!1&&(a==null&&(a={},vc(e,e={})),e[g]=a[g]=c,o.uri=Vs.XMLNS,t.startPrefixMapping(g,c))}for(var E=r.length;E--;){o=r[E];var f=o.prefix;f&&(f==="xml"&&(o.uri=Vs.XML),f!=="xmlns"&&(o.uri=e[f||""]))}var _=i.indexOf(":");_>0?(f=r.prefix=i.slice(0,_),d=r.localName=i.slice(_+1)):(f=null,d=r.localName=i);var C=r.uri=e[f||""];if(t.startElement(C,d,i,r),r.closed){if(t.endElement(C,d,i),a)for(f in a)Object.prototype.hasOwnProperty.call(a,f)&&t.endPrefixMapping(f)}else return r.currentNSMap=e,r.localNSMap=a,!0}function Wg(r,t,e,i,a){if(/^(?:script|textarea)$/i.test(e)){var o=r.indexOf("</"+e+">",t),l=r.substring(t+1,o);if(/[&<]/.test(l))return/^script$/i.test(e)?(a.characters(l,0,l.length),o):(l=l.replace(/&#?\w+;/g,i),a.characters(l,0,l.length),o)}return t+1}function Vg(r,t,e,i){var a=i[e];return a==null&&(a=r.lastIndexOf("</"+e+">"),a<t&&(a=r.lastIndexOf("</"+e)),i[e]=a),a<t}function vc(r,t){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}function zg(r,t,e,i){var a=r.charAt(t+2);switch(a){case"-":if(r.charAt(t+3)==="-"){var o=r.indexOf("-->",t+4);return o>t?(e.comment(r,t+4,o-t-4),o+3):(i.error("Unclosed comment"),-1)}else return-1;default:if(r.substr(t+3,6)=="CDATA["){var o=r.indexOf("]]>",t+9);return e.startCDATA(),e.characters(r,t+9,o-t-9),e.endCDATA(),o+3}var l=Gg(r,t),c=l.length;if(c>1&&/!doctype/i.test(l[0][0])){var f=l[1][0],d=!1,g=!1;c>3&&(/^public$/i.test(l[2][0])?(d=l[3][0],g=c>4&&l[4][0]):/^system$/i.test(l[2][0])&&(g=l[3][0]));var E=l[c-1];return e.startDTD(f,d,g),e.endDTD(),E.index+E[0].length}}return-1}function $g(r,t,e){var i=r.indexOf("?>",t);if(i){var a=r.substring(t,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return a?(a[0].length,e.processingInstruction(a[1],a[2]),i+2):-1}return-1}function xc(){this.attributeNames={}}xc.prototype={setTagName:function(r){if(!dc.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},addValue:function(r,t,e){if(!dc.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:t,offset:e}},length:0,getLocalName:function(r){return this[r].localName},getLocator:function(r){return this[r].locator},getQName:function(r){return this[r].qName},getURI:function(r){return this[r].uri},getValue:function(r){return this[r].value}};function Gg(r,t){var e,i=[],a=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(a.lastIndex=t,a.exec(r);e=a.exec(r);)if(i.push(e),e[1])return i}Ou.XMLReader=gc,Ou.ParseError=rs;var Yg=di,Xg=Vi,Ec=fc,Ac=Ou,Zg=Xg.DOMImplementation,wc=Yg.NAMESPACE,Qg=Ac.ParseError,Kg=Ac.XMLReader;function bc(r){return r.replace(/\r[\n\u0085]/g,`
3
3
  `).replace(/[\r\u0085\u2028]/g,`
4
4
  `)}function Tc(r){this.options=r||{locator:{}}}Tc.prototype.parseFromString=function(r,t){var e=this.options,i=new Kg,a=e.domBuilder||new Ys,o=e.errorHandler,l=e.locator,c=e.xmlns||{},f=/\/x?html?$/.test(t),d=f?Ec.HTML_ENTITIES:Ec.XML_ENTITIES;l&&a.setDocumentLocator(l),i.errorHandler=jg(o,a,l),i.domBuilder=e.domBuilder||a,f&&(c[""]=wc.HTML),c.xml=c.xml||wc.XML;var g=e.normalizeLineEndings||bc;return r&&typeof r=="string"?i.parse(g(r),c,d):i.errorHandler.error("invalid doc source"),a.doc};function jg(r,t,e){if(!r){if(t instanceof Ys)return t;r=t}var i={},a=r instanceof Function;e=e||{};function o(l){var c=r[l];!c&&a&&(c=r.length==2?function(f){r(l,f)}:r),i[l]=c&&function(f){c("[xmldom "+l+"] "+f+Mu(e))}||function(){}}return o("warning"),o("error"),o("fatalError"),i}function Ys(){this.cdata=!1}function is(r,t){t.lineNumber=r.lineNumber,t.columnNumber=r.columnNumber}Ys.prototype={startDocument:function(){this.doc=new Zg().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(r,t,e,i){var a=this.doc,o=a.createElementNS(r,e||t),l=i.length;Qa(this,o),this.currentElement=o,this.locator&&is(this.locator,o);for(var c=0;c<l;c++){var r=i.getURI(c),f=i.getValue(c),e=i.getQName(c),d=a.createAttributeNS(r,e);this.locator&&is(i.getLocator(c),d),d.value=d.nodeValue=f,o.setAttributeNode(d)}},endElement:function(r,t,e){var i=this.currentElement;i.tagName,this.currentElement=i.parentNode},startPrefixMapping:function(r,t){},endPrefixMapping:function(r){},processingInstruction:function(r,t){var e=this.doc.createProcessingInstruction(r,t);this.locator&&is(this.locator,e),Qa(this,e)},ignorableWhitespace:function(r,t,e){},characters:function(r,t,e){if(r=_c.apply(this,arguments),r){if(this.cdata)var i=this.doc.createCDATASection(r);else var i=this.doc.createTextNode(r);this.currentElement?this.currentElement.appendChild(i):/^\s*$/.test(r)&&this.doc.appendChild(i),this.locator&&is(this.locator,i)}},skippedEntity:function(r){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(r){(this.locator=r)&&(r.lineNumber=0)},comment:function(r,t,e){r=_c.apply(this,arguments);var i=this.doc.createComment(r);this.locator&&is(this.locator,i),Qa(this,i)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(r,t,e){var i=this.doc.implementation;if(i&&i.createDocumentType){var a=i.createDocumentType(r,t,e);this.locator&&is(this.locator,a),Qa(this,a),this.doc.doctype=a}},warning:function(r){console.warn("[xmldom warning] "+r,Mu(this.locator))},error:function(r){console.error("[xmldom error] "+r,Mu(this.locator))},fatalError:function(r){throw new Qg(r,this.locator)}};function Mu(r){if(r)return`
5
- @`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}function _c(r,t,e){return typeof r=="string"?r.substr(t,e):r.length>=t+e||t?new java.lang.String(r,t,e)+"":r}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){Ys.prototype[r]=function(){return null}});function Qa(r,t){r.currentElement?r.currentElement.appendChild(t):r.doc.appendChild(t)}Xa.__DOMHandler=Ys,Xa.normalizeLineEndings=bc,Xa.DOMParser=Tc;var Jg=Xa.DOMParser;const t0="1.0.62";function e0(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const ns=typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{document:void 0,tinyEngine:void 0};ns.Path2D||Ag(ns),ns.DOMParser||(ns.DOMParser=Jg);const kt={window:ns,version:t0,isBrowser:e0(),dpr:typeof window<"u"&&window.devicePixelRatio||1,document:ns.document,time:0,deltaTime:0,config:Zn},Xs=(r,t,e)=>Math.max(t,Math.min(e,r)),Cc=(r,t=1e-6)=>Math.abs(r)<t?0:r<0?-1:1,r0=r=>r*(Math.PI/180),i0=(r,t)=>(r%t+t)%t,Lu=(r,t,e)=>(1-e)*r+e*t,n0=r=>{let t=r*(180/Math.PI);return t<0&&(t+=360),t>360&&(t-=360),t},$t={transparent:"rgba(1, 1, 1, 0)",green:"#45b787",darkGreen:"#314a43",blue:"#6e9bc5",darkBlue:"#2775b6",red:"#F26666",darkRed:"#D95970",brown:"#ECD2B9",darkBrown:"#BF9D8A",yellow:"#ECDEC0",darkYellow:"#D0AC57",lightGray:"#e0e0e0",gray:"#beb6b6",darkGray:"#918883",white:"#F2F2F2",darkWhite:"#ececec",lightBlack:"#2E3032",black:"#182327",blackAlpha5:"rgba(0, 0, 0, 0.5)"},s0={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ir={h:0,s:0,l:0},Ka={h:0,s:0,l:0};function Bu(r,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(t-r)*6*e:e<1/2?t:e<2/3?r+(t-r)*6*(2/3-e):r}const a0=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$|rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)|rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*[\d.]+\s*\)/;class Wt{isColor=!0;r=1;g=1;b=1;a=1;constructor(t,e,i,a){return e===void 0&&i===void 0?this.set(t):this.setRGBA(t,e,i,a)}static isColor(t){return typeof t=="string"?a0.test(t):typeof t=="number"?t>=0&&t<=16777215:!1}static getRandomStyle(){return vi.random().getStyle()}static getDarken(t,e=.8){return vi.set(t).getHSL(ja),vi.setHSL(ja.h,ja.s,ja.l*e).getStyle()}static getLighten(t,e=1.2){return this.getDarken(t,e)}static getContrast(t){return vi.set(t),vi.getContrastString()}static getArray(t){return vi.set(t).toArray()}static getComplementary(t){return vi.set(t),vi.getComplementaryString()}static getMoreTransparent(t,e){return vi.set(t).setA(e).getStyle()}set(t){return t&&t.isColor?this.copy(t):typeof t=="number"?this.setHex(t):typeof t=="string"&&this.setStyle(t),this}random(){return this.setHex(Math.floor(Math.random()*(1<<24)))}setScalar(t){return this.r=t,this.g=t,this.b=t,this.a=1,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,this.a=1,this}setR(t){return this.r=t,this}setG(t){return this.g=t,this}setB(t){return this.b=t,this}setA(t){return this.a=t,this}setRGB(t,e,i){return this.setRGBA(t,e,i,this.a)}setRGBA(t,e,i,a=1){return this.r=t,this.g=e,this.b=i,this.a=a,this}setHSL(t,e,i,a=1){if(t=i0(t,1),e=Xs(e,0,1),i=Xs(i,0,1),e===0)this.r=this.g=this.b=i;else{const o=i<=.5?i*(1+e):i+e-i*e,l=2*i-o;this.r=Bu(l,o,t+1/3),this.g=Bu(l,o,t),this.b=Bu(l,o,t-1/3)}return this.a=a,this}setStyle(t){let e;if(e=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let i;const a=e[1],o=e[2];switch(a){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,this.a=Math.max(Math.min(1,i[4]!==void 0?parseFloat(i[4]):1),0),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,this.a=Math.max(Math.min(1,i[4]!==void 0?parseFloat(i[4]):1),0),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){const l=parseFloat(i[1])/360,c=parseInt(i[2],10)/100,f=parseInt(i[3],10)/100,d=Math.max(Math.min(1,i[4]!==void 0?parseFloat(i[4]):1),0);return this.setHSL(l,c,f,d)}break}}else if(e=/^\#([A-Fa-f\d]+)$/.exec(t)){const i=e[1],a=i.length;if(a===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this.a=1,this;if(a===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this.a=1,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=s0[t.toLowerCase()];return e!==void 0?this.setHex(e):console.warn("Color: Unknown color "+t),this}clone(){return new Wt(this.r,this.g,this.b,this.a)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}getRGB(t=new Wt){return t.setRGB(this.r,this.g,this.b)}getRGBByBg(t=new Wt){const e=this.a,i=e*this.r+(1-e)*t.r,a=e*this.g+(1-e)*t.g,o=e*this.b+(1-e)*t.b;return new Wt(i,a,o)}getHex(){return Xs(this.r*255,0,255)<<16^Xs(this.g*255,0,255)<<8^Xs(this.b*255,0,255)<<0}getHSL(t){const e=this.r,i=this.g,a=this.b,o=Math.max(e,i,a),l=Math.min(e,i,a);let c=0,f;const d=(l+o)/2;if(l===o)c=0,f=0;else{const g=o-l;switch(f=d<=.5?g/(o+l):g/(2-o-l),o){case e:c=(i-a)/g+(i<a?6:0);break;case i:c=(a-e)/g+2;break;case a:c=(e-i)/g+4;break}c/=6}return t.h=c,t.s=f,t.l=d,t}getStyle(){return this.a===1?`rgb(${this.r*255|0},${this.g*255|0},${this.b*255|0})`:`rgba(${this.r*255|0},${this.g*255|0},${this.b*255|0},${this.a||1})`}getHexString(){return"#"+("000000"+this.getHex().toString(16)).slice(-6)}getBrightness(){let t=(this.r*255*299+this.g*255*587+this.b*255*144)/1e3;return t+=(255-t)*(255-this.a*255)/255,t}getContrastString(){return this.getBrightness()>125?"#2f2f2f":"#f2f2f2"}getComplementary(t=new Wt){const e=this.toArray(),i=[0,0,0,1];for(let a=0;a<e.length;a++)if(a<3)i[a]=1-e[a];else if(a===3)e[a]>1||e[a]<=0?i[a]=1:i[a]=Math.max(Math.min(parseFloat(e[a].toFixed(2)),1),0);else continue;return t.setRGBA(i[0],i[1],i[2],parseFloat(i[3].toFixed(2)))}getComplementaryString(){return this.getComplementary().getStyle()}getLightenOrDarken(t){if(typeof t>"u"||t>=1)return this.getHexString();const e=this.getRGBByBg(),i=e.r*t+(1-t),a=e.g*t+(1-t),o=e.b*t+(1-t);return new Wt(i,a,o).getHexString()}getNormalized(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.a,1),0).toFixed(2))]}getNormalized3(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2))]}offsetHSL(t,e,i){return this.getHSL(Ir),Ir.h+=t,Ir.s+=e,Ir.l+=i,this.setHSL(Ir.h,Ir.s,Ir.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(Ir),t.getHSL(Ka);const i=Lu(Ir.h,Ka.h,e),a=Lu(Ir.s,Ka.s,e),o=Lu(Ir.l,Ka.l,e);return this.setHSL(i,a,o),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this.a=t[e+3],this}toArray(t=[0,0,0,0],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),t.normalized===!0&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const vi=new Wt,ja={h:0,s:0,l:0};class F{isVector2=!0;x=0;y=0;z;constructor(t=0,e=0,i){this.x=t,this.y=e,this.z=i||0}static isZero(t){return t.x===0&&t.y===0}static isEmpty(t){return!Number.isFinite(t.x)&&!Number.isFinite(t.y)}static equals(t,e,i=!0){return i?t.x===e.x&&t.y===e.y:Math.abs(t.x-e.x)<Number.EPSILON&&Math.abs(t.y-e.y)<Number.EPSILON}static getInt32Array(t,e=2){const i=new ArrayBuffer(t.length*e*4),a=new Int32Array(i);for(let o=0,l=t.length;o<l;o++)a[o*2]=t[o].x,a[o*2+1]=t[o].y;return a}static getFloat64Array(t,e=2){const i=new ArrayBuffer(t.length*e*8),a=new Float64Array(i);for(let o=0,l=t.length;o<l;o++)a[o*2]=t[o].x,a[o*2+1]=t[o].y;return a}static getVectors(t){const e=[];for(let i=0,a=t.length;i<a;i++)e.push(new F(t[i].x,t[i].y));return e}static getStrings(t){const e=[];if(!t||!t.length)return"";for(let i=0,a=t.length;i<a;i++)e.push(F.getString(t[i]));return e.join(",")}static getString(t){return`${t.x},${t.y}`}static getLength(t){return Math.sqrt(t.x*t.x+t.y*t.y)}static getDistance(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}static dot(t,e){return t.x*e.x+t.y*e.y}static cross(t,e){return t.x*e.y-t.y*e.x}static sub(t,e){return new F().subVectors(t,e)}static isPointOnSegment(t,e,i){return Cc(this.sub(t,i).cross(this.sub(e,i)))===0&&Cc(this.sub(t,i).dot(this.sub(e,i)))<=0}static angle(t,e,i){return i?Math.atan2(t.y-e.y,t.x-e.x):n0(Math.atan2(t.y-e.y,t.x-e.x))}static getSamplingPoints(t,e=100){let i=this.getClothoidPoints(t,e),a=0;for(let o=0,l=i.length;o<l;o++){let c=Math.max(0,o-1);o>0?a+=this.getDistance(i[c],i[c+1]):a=0,i[o].l=Math.round(a);let f=this.angle(i[c+1],i[c]);i[o].a=Math.round(f*100)/100}return i}static getClothoidPoints(t,e=100){let i=[],a=t.concat([]);if(!a||a.length<2)return i;a.length===2?(a.push(a[1]),a.unshift(a[0])):a.length===3&&a.splice(2,0,a[1]);for(let o=0;o<a.length-3;o+=3){let l=new F(a[o].x,a[o].y),c=new F(a[o+1].x,a[o+1].y),f=new F(a[o+2].x,a[o+2].y),d=new F(a[o+3].x,a[o+3].y),g=0;g+=l.distanceTo(c),g+=c.distanceTo(f),g+=f.distanceTo(d);let E=Math.min(.5,1/(g/e));for(let _=E;_<1;_+=E){let C=3*(c.x-l.x),R=3*(f.x-c.x)-C,N=d.x-l.x-C-R,M=3*(c.y-l.y),I=3*(f.y-c.y)-M,W=d.y-l.y-M-I,G=N*Math.pow(_,3)+R*Math.pow(_,2)+C*_+l.x,b=W*Math.pow(_,3)+I*Math.pow(_,2)+M*_+l.y;i.push({x:Math.round(G),y:Math.round(b),a:0,l:0})}}return i.unshift({x:a[0].x,y:a[0].y,a:0,l:0}),i.push({x:a[a.length-1].x,y:a[a.length-1].y,a:0,l:0}),i}static getClothoidLength(t){let e=0;if(t.length>2)for(let i=0;i<t.length;i++){let a=Math.max(0,i-1);i>0&&(e+=this.getDistance(t[a],t[a+1]))}return e}static getCircleCenterByChord(t,e,i,a=!0,o=new F){const l=this.getDistance(t,e);if(l===0)return o.x=1/0,o.y=1/0,o;Iu.set((t.x+e.x)/2,(t.y+e.y)/2);const c=Math.sqrt(i*i-l*l/4),f=a?-1:1;return o.x=Iu.x+f*c*(e.y-t.y)/l,o.y=Iu.y-f*c*(e.x-t.x)/l,o}static isPointInCircle(t,e,i){return this.getDistance(i,t)<e}static isPointInConvexHull(t,e){let i=!1;const a=e.length;for(let o=0,l=a-1;o<a;l=o++){const c=e[o],f=e[l];if(Math.min(c.x,f.x)<=t.x&&t.x<=Math.max(c.x,f.x)&&Math.min(c.y,f.y)<=t.y&&t.y<=Math.max(c.y,f.y)){const d=(f.x-c.x)*(t.y-c.y)-(f.y-c.y)*(t.x-c.x);if(Math.abs(d)<1e-12)return!0}c.y>t.y!=f.y>t.y&&t.x<(f.x-c.x)*(t.y-c.y)/(f.y-c.y)+c.x&&(i=!i)}return i}static isPointInPolygonByRay(t,e){let i=0;const a=new F().copy(t),o=new F,l=new F;for(let c=0;c<e.length;c++){c===e.length-1?(o.copy(e[c]),l.copy(e[0])):(o.copy(e[c]),l.copy(e[c+1]));let f=[o.y,l.y].sort((d,g)=>d-g);f[0]<a.y&&f[1]>a.y&&(o.x<a.x||l.x<a.x)&&i++}return i%2===1}static getIntersectionOfSegments(t,e,i,a,o=!1,l=new F){const c=(a.y-i.y)*(e.x-t.x)-(a.x-i.x)*(e.y-t.y);if(c===0)return l.makeEmpty();const f=(a.x-i.x)*(t.y-i.y)-(a.y-i.y)*(t.x-i.x),d=(e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x),g=f/c,E=d/c;return o&&(g<0||g>1||E<0||E>1)?l.makeEmpty():(l.x=t.x+g*(e.x-t.x),l.y=t.y+g*(e.y-t.y),l)}static getConvexHullByGrahamScan(t,e=!1,i=[]){if(!t||!t.length)return i;const a=t.length;let o=0;for(let f=0;f<a;f++)t[f].x<t[o].x&&(o=f);let l=o,c;do{i.push(t[l]),c=(l+1)%a;for(let f=0;f<a;f++)this.whichSideOfSegment(t[l],t[f],t[c])>0&&(c=f);l=c}while(l!==o);return e&&i.push(t[o]),i}static whichSideOfSegment(t,e,i){return(e.x-t.x)*(i.y-t.y)-(i.x-t.x)*(e.y-t.y)}static getPointsWithMatrix3(t,e){const i=[];if(!t)return i;for(let a=0,o=t.length;a<o;a++)i.push({x:e.elements[0]*t[a].x+e.elements[3]*t[a].y+e.elements[6],y:e.elements[1]*t[a].x+e.elements[4]*t[a].y+e.elements[7]});return i}static getPointsApplyMatrix3(t,e=[]){for(let i=0,a=e.length;i<a;i++){const o=t.elements[0]*e[i].x+t.elements[3]*e[i].y+t.elements[6],l=t.elements[1]*e[i].x+t.elements[4]*e[i].y+t.elements[7];e[i].x=o,e[i].y=l}return e}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}applyMatrix3(t){const e=this.x,i=this.y,a=t.elements;return this.x=a[0]*e+a[3]*i+a[6],this.y=a[1]*e+a[4]*i+a[7],this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}ceilToZero(){return this.x=this.x<0?Math.floor(this.x):Math.ceil(this.x),this.y=this.y<0?Math.floor(this.y):Math.ceil(this.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clone(){return new F(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}cross(t){return this.x*t.y-this.y*t.x}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}dot(t){return this.x*t.x+this.y*t.y}equals(t,e=!0){return e?t.x===this.x&&t.y===this.y:Math.abs(t.x-this.x)<Number.EPSILON&&Math.abs(t.y-this.y)<Number.EPSILON}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}floorToZero(){return this.roundToZero()}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("out of range: "+t)}}identity(){return this.set(0,0)}isEmpty(){return!Number.isFinite(this.x)&&!Number.isFinite(this.y)}isZero(){return this.x===0&&this.y===0}length(){return Math.sqrt(this.dot(this))}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}makeEmpty(){return this.x=1/0,this.y=1/0,this}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}maxXY(t,e){return this.x=Math.max(this.x,t),this.y=Math.max(this.y,e),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}minXY(t,e){return this.x=Math.min(this.x,t),this.y=Math.min(this.y,e),this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t,e){return this.x*=t,this.y*=e||t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this}negate(){return this.x=-this.x,this.y=-this.y,this}normalize(){return this.divideScalar(this.length()||1)}project(t){return this.applyMatrix3(t.matrixWorldInverse).applyMatrix3(t.projectionMatrix)}random(){return this.x=Math.random(),this.y=Math.random(),this}rotate(t){const e=Math.cos(t),i=Math.sin(t),a=this.x,o=this.y;return this.x=a*e-o*i,this.y=a*i+o*e,this}rotateAround(t,e){const i=Math.cos(e),a=Math.sin(e),o=this.x-t.x,l=this.y-t.y;return this.x=o*i-l*a+t.x,this.y=o*a+l*i+t.y,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}set(t,e){return this.x=t,this.y=e,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("out of range: "+t)}return this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*3)}setLength(t){return this.normalize().multiplyScalar(t)}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}toString(){return`{"x":${this.x},"y":${this.y}}`}unproject(t,e=!1){return this.applyMatrix3(t.projectionMatrixInverse).applyMatrix3(t.matrixWorld)}validate(){return!(isNaN(this.x)||isNaN(this.y))}*[Symbol.iterator](){yield this.x,yield this.y}}const Iu=new F,o0=Object.freeze(Object.defineProperty({__proto__:null,default:F},Symbol.toStringTag,{value:"Module"}));var Ja={exports:{}};/**
5
+ @`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}function _c(r,t,e){return typeof r=="string"?r.substr(t,e):r.length>=t+e||t?new java.lang.String(r,t,e)+"":r}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){Ys.prototype[r]=function(){return null}});function Qa(r,t){r.currentElement?r.currentElement.appendChild(t):r.doc.appendChild(t)}Xa.__DOMHandler=Ys,Xa.normalizeLineEndings=bc,Xa.DOMParser=Tc;var Jg=Xa.DOMParser;const t0="1.0.63";function e0(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const ns=typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{document:void 0,tinyEngine:void 0};ns.Path2D||Ag(ns),ns.DOMParser||(ns.DOMParser=Jg);const kt={window:ns,version:t0,isBrowser:e0(),dpr:typeof window<"u"&&window.devicePixelRatio||1,document:ns.document,time:0,deltaTime:0,config:Zn},Xs=(r,t,e)=>Math.max(t,Math.min(e,r)),Cc=(r,t=1e-6)=>Math.abs(r)<t?0:r<0?-1:1,r0=r=>r*(Math.PI/180),i0=(r,t)=>(r%t+t)%t,Lu=(r,t,e)=>(1-e)*r+e*t,n0=r=>{let t=r*(180/Math.PI);return t<0&&(t+=360),t>360&&(t-=360),t},$t={transparent:"rgba(1, 1, 1, 0)",green:"#45b787",darkGreen:"#314a43",blue:"#6e9bc5",darkBlue:"#2775b6",red:"#F26666",darkRed:"#D95970",brown:"#ECD2B9",darkBrown:"#BF9D8A",yellow:"#ECDEC0",darkYellow:"#D0AC57",lightGray:"#e0e0e0",gray:"#beb6b6",darkGray:"#918883",white:"#F2F2F2",darkWhite:"#ececec",lightBlack:"#2E3032",black:"#182327",blackAlpha5:"rgba(0, 0, 0, 0.5)"},s0={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ir={h:0,s:0,l:0},Ka={h:0,s:0,l:0};function Bu(r,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(t-r)*6*e:e<1/2?t:e<2/3?r+(t-r)*6*(2/3-e):r}const a0=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$|rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)|rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*[\d.]+\s*\)/;class Wt{isColor=!0;r=1;g=1;b=1;a=1;constructor(t,e,i,a){return e===void 0&&i===void 0?this.set(t):this.setRGBA(t,e,i,a)}static isColor(t){return typeof t=="string"?a0.test(t):typeof t=="number"?t>=0&&t<=16777215:!1}static getRandomStyle(){return vi.random().getStyle()}static getDarken(t,e=.8){return vi.set(t).getHSL(ja),vi.setHSL(ja.h,ja.s,ja.l*e).getStyle()}static getLighten(t,e=1.2){return this.getDarken(t,e)}static getContrast(t){return vi.set(t),vi.getContrastString()}static getArray(t){return vi.set(t).toArray()}static getComplementary(t){return vi.set(t),vi.getComplementaryString()}static getMoreTransparent(t,e){return vi.set(t).setA(e).getStyle()}set(t){return t&&t.isColor?this.copy(t):typeof t=="number"?this.setHex(t):typeof t=="string"&&this.setStyle(t),this}random(){return this.setHex(Math.floor(Math.random()*(1<<24)))}setScalar(t){return this.r=t,this.g=t,this.b=t,this.a=1,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,this.a=1,this}setR(t){return this.r=t,this}setG(t){return this.g=t,this}setB(t){return this.b=t,this}setA(t){return this.a=t,this}setRGB(t,e,i){return this.setRGBA(t,e,i,this.a)}setRGBA(t,e,i,a=1){return this.r=t,this.g=e,this.b=i,this.a=a,this}setHSL(t,e,i,a=1){if(t=i0(t,1),e=Xs(e,0,1),i=Xs(i,0,1),e===0)this.r=this.g=this.b=i;else{const o=i<=.5?i*(1+e):i+e-i*e,l=2*i-o;this.r=Bu(l,o,t+1/3),this.g=Bu(l,o,t),this.b=Bu(l,o,t-1/3)}return this.a=a,this}setStyle(t){let e;if(e=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let i;const a=e[1],o=e[2];switch(a){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,this.a=Math.max(Math.min(1,i[4]!==void 0?parseFloat(i[4]):1),0),this;if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,this.a=Math.max(Math.min(1,i[4]!==void 0?parseFloat(i[4]):1),0),this;break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){const l=parseFloat(i[1])/360,c=parseInt(i[2],10)/100,f=parseInt(i[3],10)/100,d=Math.max(Math.min(1,i[4]!==void 0?parseFloat(i[4]):1),0);return this.setHSL(l,c,f,d)}break}}else if(e=/^\#([A-Fa-f\d]+)$/.exec(t)){const i=e[1],a=i.length;if(a===3)return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this.a=1,this;if(a===6)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this.a=1,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=s0[t.toLowerCase()];return e!==void 0?this.setHex(e):console.warn("Color: Unknown color "+t),this}clone(){return new Wt(this.r,this.g,this.b,this.a)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}getRGB(t=new Wt){return t.setRGB(this.r,this.g,this.b)}getRGBByBg(t=new Wt){const e=this.a,i=e*this.r+(1-e)*t.r,a=e*this.g+(1-e)*t.g,o=e*this.b+(1-e)*t.b;return new Wt(i,a,o)}getHex(){return Xs(this.r*255,0,255)<<16^Xs(this.g*255,0,255)<<8^Xs(this.b*255,0,255)<<0}getHSL(t){const e=this.r,i=this.g,a=this.b,o=Math.max(e,i,a),l=Math.min(e,i,a);let c=0,f;const d=(l+o)/2;if(l===o)c=0,f=0;else{const g=o-l;switch(f=d<=.5?g/(o+l):g/(2-o-l),o){case e:c=(i-a)/g+(i<a?6:0);break;case i:c=(a-e)/g+2;break;case a:c=(e-i)/g+4;break}c/=6}return t.h=c,t.s=f,t.l=d,t}getStyle(){return this.a===1?`rgb(${this.r*255|0},${this.g*255|0},${this.b*255|0})`:`rgba(${this.r*255|0},${this.g*255|0},${this.b*255|0},${this.a||1})`}getHexString(){return"#"+("000000"+this.getHex().toString(16)).slice(-6)}getBrightness(){let t=(this.r*255*299+this.g*255*587+this.b*255*144)/1e3;return t+=(255-t)*(255-this.a*255)/255,t}getContrastString(){return this.getBrightness()>125?"#2f2f2f":"#f2f2f2"}getComplementary(t=new Wt){const e=this.toArray(),i=[0,0,0,1];for(let a=0;a<e.length;a++)if(a<3)i[a]=1-e[a];else if(a===3)e[a]>1||e[a]<=0?i[a]=1:i[a]=Math.max(Math.min(parseFloat(e[a].toFixed(2)),1),0);else continue;return t.setRGBA(i[0],i[1],i[2],parseFloat(i[3].toFixed(2)))}getComplementaryString(){return this.getComplementary().getStyle()}getLightenOrDarken(t){if(typeof t>"u"||t>=1)return this.getHexString();const e=this.getRGBByBg(),i=e.r*t+(1-t),a=e.g*t+(1-t),o=e.b*t+(1-t);return new Wt(i,a,o).getHexString()}getNormalized(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.a,1),0).toFixed(2))]}getNormalized3(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2))]}offsetHSL(t,e,i){return this.getHSL(Ir),Ir.h+=t,Ir.s+=e,Ir.l+=i,this.setHSL(Ir.h,Ir.s,Ir.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(Ir),t.getHSL(Ka);const i=Lu(Ir.h,Ka.h,e),a=Lu(Ir.s,Ka.s,e),o=Lu(Ir.l,Ka.l,e);return this.setHSL(i,a,o),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this.a=t[e+3],this}toArray(t=[0,0,0,0],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),t.normalized===!0&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const vi=new Wt,ja={h:0,s:0,l:0};class F{isVector2=!0;x=0;y=0;z;constructor(t=0,e=0,i){this.x=t,this.y=e,this.z=i||0}static isZero(t){return t.x===0&&t.y===0}static isEmpty(t){return!Number.isFinite(t.x)&&!Number.isFinite(t.y)}static equals(t,e,i=!0){return i?t.x===e.x&&t.y===e.y:Math.abs(t.x-e.x)<Number.EPSILON&&Math.abs(t.y-e.y)<Number.EPSILON}static getInt32Array(t,e=2){const i=new ArrayBuffer(t.length*e*4),a=new Int32Array(i);for(let o=0,l=t.length;o<l;o++)a[o*2]=t[o].x,a[o*2+1]=t[o].y;return a}static getFloat64Array(t,e=2){const i=new ArrayBuffer(t.length*e*8),a=new Float64Array(i);for(let o=0,l=t.length;o<l;o++)a[o*2]=t[o].x,a[o*2+1]=t[o].y;return a}static getVectors(t){const e=[];for(let i=0,a=t.length;i<a;i++)e.push(new F(t[i].x,t[i].y));return e}static getStrings(t){const e=[];if(!t||!t.length)return"";for(let i=0,a=t.length;i<a;i++)e.push(F.getString(t[i]));return e.join(",")}static getString(t){return`${t.x},${t.y}`}static getLength(t){return Math.sqrt(t.x*t.x+t.y*t.y)}static getDistance(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}static dot(t,e){return t.x*e.x+t.y*e.y}static cross(t,e){return t.x*e.y-t.y*e.x}static sub(t,e){return new F().subVectors(t,e)}static isPointOnSegment(t,e,i){return Cc(this.sub(t,i).cross(this.sub(e,i)))===0&&Cc(this.sub(t,i).dot(this.sub(e,i)))<=0}static angle(t,e,i){return i?Math.atan2(t.y-e.y,t.x-e.x):n0(Math.atan2(t.y-e.y,t.x-e.x))}static getSamplingPoints(t,e=100){let i=this.getClothoidPoints(t,e),a=0;for(let o=0,l=i.length;o<l;o++){let c=Math.max(0,o-1);o>0?a+=this.getDistance(i[c],i[c+1]):a=0,i[o].l=Math.round(a);let f=this.angle(i[c+1],i[c]);i[o].a=Math.round(f*100)/100}return i}static getClothoidPoints(t,e=100){let i=[],a=t.concat([]);if(!a||a.length<2)return i;a.length===2?(a.push(a[1]),a.unshift(a[0])):a.length===3&&a.splice(2,0,a[1]);for(let o=0;o<a.length-3;o+=3){let l=new F(a[o].x,a[o].y),c=new F(a[o+1].x,a[o+1].y),f=new F(a[o+2].x,a[o+2].y),d=new F(a[o+3].x,a[o+3].y),g=0;g+=l.distanceTo(c),g+=c.distanceTo(f),g+=f.distanceTo(d);let E=Math.min(.5,1/(g/e));for(let _=E;_<1;_+=E){let C=3*(c.x-l.x),R=3*(f.x-c.x)-C,N=d.x-l.x-C-R,M=3*(c.y-l.y),I=3*(f.y-c.y)-M,W=d.y-l.y-M-I,G=N*Math.pow(_,3)+R*Math.pow(_,2)+C*_+l.x,b=W*Math.pow(_,3)+I*Math.pow(_,2)+M*_+l.y;i.push({x:Math.round(G),y:Math.round(b),a:0,l:0})}}return i.unshift({x:a[0].x,y:a[0].y,a:0,l:0}),i.push({x:a[a.length-1].x,y:a[a.length-1].y,a:0,l:0}),i}static getClothoidLength(t){let e=0;if(t.length>2)for(let i=0;i<t.length;i++){let a=Math.max(0,i-1);i>0&&(e+=this.getDistance(t[a],t[a+1]))}return e}static getCircleCenterByChord(t,e,i,a=!0,o=new F){const l=this.getDistance(t,e);if(l===0)return o.x=1/0,o.y=1/0,o;Iu.set((t.x+e.x)/2,(t.y+e.y)/2);const c=Math.sqrt(i*i-l*l/4),f=a?-1:1;return o.x=Iu.x+f*c*(e.y-t.y)/l,o.y=Iu.y-f*c*(e.x-t.x)/l,o}static isPointInCircle(t,e,i){return this.getDistance(i,t)<e}static isPointInConvexHull(t,e){let i=!1;const a=e.length;for(let o=0,l=a-1;o<a;l=o++){const c=e[o],f=e[l];if(Math.min(c.x,f.x)<=t.x&&t.x<=Math.max(c.x,f.x)&&Math.min(c.y,f.y)<=t.y&&t.y<=Math.max(c.y,f.y)){const d=(f.x-c.x)*(t.y-c.y)-(f.y-c.y)*(t.x-c.x);if(Math.abs(d)<1e-12)return!0}c.y>t.y!=f.y>t.y&&t.x<(f.x-c.x)*(t.y-c.y)/(f.y-c.y)+c.x&&(i=!i)}return i}static isPointInPolygonByRay(t,e){let i=0;const a=new F().copy(t),o=new F,l=new F;for(let c=0;c<e.length;c++){c===e.length-1?(o.copy(e[c]),l.copy(e[0])):(o.copy(e[c]),l.copy(e[c+1]));let f=[o.y,l.y].sort((d,g)=>d-g);f[0]<a.y&&f[1]>a.y&&(o.x<a.x||l.x<a.x)&&i++}return i%2===1}static getIntersectionOfSegments(t,e,i,a,o=!1,l=new F){const c=(a.y-i.y)*(e.x-t.x)-(a.x-i.x)*(e.y-t.y);if(c===0)return l.makeEmpty();const f=(a.x-i.x)*(t.y-i.y)-(a.y-i.y)*(t.x-i.x),d=(e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x),g=f/c,E=d/c;return o&&(g<0||g>1||E<0||E>1)?l.makeEmpty():(l.x=t.x+g*(e.x-t.x),l.y=t.y+g*(e.y-t.y),l)}static getConvexHullByGrahamScan(t,e=!1,i=[]){if(!t||!t.length)return i;const a=t.length;let o=0;for(let f=0;f<a;f++)t[f].x<t[o].x&&(o=f);let l=o,c;do{i.push(t[l]),c=(l+1)%a;for(let f=0;f<a;f++)this.whichSideOfSegment(t[l],t[f],t[c])>0&&(c=f);l=c}while(l!==o);return e&&i.push(t[o]),i}static whichSideOfSegment(t,e,i){return(e.x-t.x)*(i.y-t.y)-(i.x-t.x)*(e.y-t.y)}static getPointsWithMatrix3(t,e){const i=[];if(!t)return i;for(let a=0,o=t.length;a<o;a++)i.push({x:e.elements[0]*t[a].x+e.elements[3]*t[a].y+e.elements[6],y:e.elements[1]*t[a].x+e.elements[4]*t[a].y+e.elements[7]});return i}static getPointsApplyMatrix3(t,e=[]){for(let i=0,a=e.length;i<a;i++){const o=t.elements[0]*e[i].x+t.elements[3]*e[i].y+t.elements[6],l=t.elements[1]*e[i].x+t.elements[4]*e[i].y+t.elements[7];e[i].x=o,e[i].y=l}return e}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}applyMatrix3(t){const e=this.x,i=this.y,a=t.elements;return this.x=a[0]*e+a[3]*i+a[6],this.y=a[1]*e+a[4]*i+a[7],this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}ceilToZero(){return this.x=this.x<0?Math.floor(this.x):Math.ceil(this.x),this.y=this.y<0?Math.floor(this.y):Math.ceil(this.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clone(){return new F(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}cross(t){return this.x*t.y-this.y*t.x}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}dot(t){return this.x*t.x+this.y*t.y}equals(t,e=!0){return e?t.x===this.x&&t.y===this.y:Math.abs(t.x-this.x)<Number.EPSILON&&Math.abs(t.y-this.y)<Number.EPSILON}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}floorToZero(){return this.roundToZero()}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("out of range: "+t)}}identity(){return this.set(0,0)}isEmpty(){return!Number.isFinite(this.x)&&!Number.isFinite(this.y)}isZero(){return this.x===0&&this.y===0}length(){return Math.sqrt(this.dot(this))}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}makeEmpty(){return this.x=1/0,this.y=1/0,this}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}maxXY(t,e){return this.x=Math.max(this.x,t),this.y=Math.max(this.y,e),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}minXY(t,e){return this.x=Math.min(this.x,t),this.y=Math.min(this.y,e),this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t,e){return this.x*=t,this.y*=e||t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this}negate(){return this.x=-this.x,this.y=-this.y,this}normalize(){return this.divideScalar(this.length()||1)}project(t){return this.applyMatrix3(t.matrixWorldInverse).applyMatrix3(t.projectionMatrix)}random(){return this.x=Math.random(),this.y=Math.random(),this}rotate(t){const e=Math.cos(t),i=Math.sin(t),a=this.x,o=this.y;return this.x=a*e-o*i,this.y=a*i+o*e,this}rotateAround(t,e){const i=Math.cos(e),a=Math.sin(e),o=this.x-t.x,l=this.y-t.y;return this.x=o*i-l*a+t.x,this.y=o*a+l*i+t.y,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}set(t,e){return this.x=t,this.y=e,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("out of range: "+t)}return this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*3)}setLength(t){return this.normalize().multiplyScalar(t)}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}toString(){return`{"x":${this.x},"y":${this.y}}`}unproject(t,e=!1){return this.applyMatrix3(t.projectionMatrixInverse).applyMatrix3(t.matrixWorld)}validate(){return!(isNaN(this.x)||isNaN(this.y))}*[Symbol.iterator](){yield this.x,yield this.y}}const Iu=new F,o0=Object.freeze(Object.defineProperty({__proto__:null,default:F},Symbol.toStringTag,{value:"Module"}));var Ja={exports:{}};/**
6
6
  * @license
7
7
  * Lodash <https://lodash.com/>
8
8
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
@@ -34,16 +34,33 @@ function print() { __p += __j.call(arguments, '') }
34
34
  `,rf=r=>48<=r.charCodeAt(0)&&r.charCodeAt(0)<=57;class o2 extends ef{constructor(){super(),this.curNumber="",this.curCommandType=-1,this.curCommandRelative=!1,this.canParseCommandOrComma=!0,this.curNumberHasExp=!1,this.curNumberHasExpDigits=!1,this.curNumberHasDecimal=!1,this.curArgs=[]}finish(t=[]){if(this.parse(" ",t),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t}parse(t,e=[]){const i=a=>{e.push(a),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let a=0;a<t.length;a++){const o=t[a],l=this.curCommandType===X.ARC&&(this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber.length===1&&(this.curNumber==="0"||this.curNumber==="1"),c=rf(o)&&(this.curNumber==="0"&&o==="0"||l);if(rf(o)&&!c){this.curNumber+=o,this.curNumberHasExpDigits=this.curNumberHasExp;continue}if(o==="e"||o==="E"){this.curNumber+=o,this.curNumberHasExp=!0;continue}if((o==="-"||o==="+")&&this.curNumberHasExp&&!this.curNumberHasExpDigits){this.curNumber+=o;continue}if(o==="."&&!this.curNumberHasExp&&!this.curNumberHasDecimal&&!l){this.curNumber+=o,this.curNumberHasDecimal=!0;continue}if(this.curNumber&&this.curCommandType!==-1){const f=Number(this.curNumber);if(isNaN(f))throw new SyntaxError(`Invalid number ending at ${a}`);if(this.curCommandType===X.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>f)throw new SyntaxError(`Expected positive number, got "${f}" at index "${a}"`)}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${a}"`)}this.curArgs.push(f),this.curArgs.length===u2[this.curCommandType]&&(X.HORIZ_LINE_TO===this.curCommandType?i({type:X.HORIZ_LINE_TO,relative:this.curCommandRelative,x:f}):X.VERT_LINE_TO===this.curCommandType?i({type:X.VERT_LINE_TO,relative:this.curCommandRelative,y:f}):this.curCommandType===X.MOVE_TO||this.curCommandType===X.LINE_TO||this.curCommandType===X.SMOOTH_QUAD_TO?(i({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),X.MOVE_TO===this.curCommandType&&(this.curCommandType=X.LINE_TO)):this.curCommandType===X.CURVE_TO?i({type:X.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===X.SMOOTH_CURVE_TO?i({type:X.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===X.QUAD_TO?i({type:X.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===X.ARC&&i({type:X.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!a2(o)){if(o===","&&this.canParseCommandOrComma){this.canParseCommandOrComma=!1;continue}if(o==="+"||o==="-"||o==="."){this.curNumber=o,this.curNumberHasDecimal=o===".";continue}if(c){this.curNumber=o,this.curNumberHasDecimal=!1;continue}if(this.curArgs.length!==0)throw new SyntaxError(`Unterminated command at index ${a}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${o}" at index ${a}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,o==="z"||o==="Z"){e.push({type:X.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1;continue}else if(o==="h"||o==="H")this.curCommandType=X.HORIZ_LINE_TO,this.curCommandRelative=o==="h";else if(o==="v"||o==="V")this.curCommandType=X.VERT_LINE_TO,this.curCommandRelative=o==="v";else if(o==="m"||o==="M")this.curCommandType=X.MOVE_TO,this.curCommandRelative=o==="m";else if(o==="l"||o==="L")this.curCommandType=X.LINE_TO,this.curCommandRelative=o==="l";else if(o==="c"||o==="C")this.curCommandType=X.CURVE_TO,this.curCommandRelative=o==="c";else if(o==="s"||o==="S")this.curCommandType=X.SMOOTH_CURVE_TO,this.curCommandRelative=o==="s";else if(o==="q"||o==="Q")this.curCommandType=X.QUAD_TO,this.curCommandRelative=o==="q";else if(o==="t"||o==="T")this.curCommandType=X.SMOOTH_QUAD_TO,this.curCommandRelative=o==="t";else if(o==="a"||o==="A")this.curCommandType=X.ARC,this.curCommandRelative=o==="a";else throw new SyntaxError(`Unexpected character "${o}" at index ${a}.`)}}return e}transform(t){return Object.create(this,{parse:{value(i,a=[]){const o=Object.getPrototypeOf(this).parse.call(this,i);for(const l of o){const c=t(l);Array.isArray(c)?a.push(...c):a.push(c)}return a}}})}}const Ht=class Ht extends ef{constructor(t){super(),typeof t=="string"?this.commands=Ht.parse(t):this.commands=t}encode(){return Ht.encode(this.commands)}getBounds(){const t=fe.CALCULATE_BOUNDS();return this.transform(t),t}transform(t){const e=[];for(const i of this.commands){const a=t(i);Array.isArray(a)?e.push(...a):e.push(a)}return this.commands=e,this}static encode(t){return s2(t)}static parse(t){const e=new o2,i=[];return e.parse(t,i),e.finish(i),i}};Ht.CLOSE_PATH=1,Ht.MOVE_TO=2,Ht.HORIZ_LINE_TO=4,Ht.VERT_LINE_TO=8,Ht.LINE_TO=16,Ht.CURVE_TO=32,Ht.SMOOTH_CURVE_TO=64,Ht.QUAD_TO=128,Ht.SMOOTH_QUAD_TO=256,Ht.ARC=512,Ht.LINE_COMMANDS=Ht.LINE_TO|Ht.HORIZ_LINE_TO|Ht.VERT_LINE_TO,Ht.DRAWING_COMMANDS=Ht.HORIZ_LINE_TO|Ht.VERT_LINE_TO|Ht.LINE_TO|Ht.CURVE_TO|Ht.SMOOTH_CURVE_TO|Ht.QUAD_TO|Ht.SMOOTH_QUAD_TO|Ht.ARC;let X=Ht;const u2={[X.MOVE_TO]:2,[X.LINE_TO]:2,[X.HORIZ_LINE_TO]:1,[X.VERT_LINE_TO]:1,[X.CLOSE_PATH]:0,[X.QUAD_TO]:4,[X.SMOOTH_QUAD_TO]:2,[X.CURVE_TO]:6,[X.SMOOTH_CURVE_TO]:4,[X.ARC]:7};function Wu([r,t],e){return[r*Math.cos(e)-t*Math.sin(e),r*Math.sin(e)+t*Math.cos(e)]}function kr(...r){for(let t=0;t<r.length;t++)if(typeof r[t]!="number")throw new Error(`assertNumbers arguments[${t}] is not a number. ${typeof r[t]} == typeof ${r[t]}`);return!0}const Yi=Math.PI;function Vu(r,t,e){r.lArcFlag=r.lArcFlag===0?0:1,r.sweepFlag=r.sweepFlag===0?0:1;let{rX:i,rY:a}=r;const{x:o,y:l}=r;i=Math.abs(r.rX),a=Math.abs(r.rY);const[c,f]=Wu([(t-o)/2,(e-l)/2],-r.xRot/180*Yi),d=Math.pow(c,2)/Math.pow(i,2)+Math.pow(f,2)/Math.pow(a,2);1<d&&(i*=Math.sqrt(d),a*=Math.sqrt(d)),r.rX=i,r.rY=a;const g=Math.pow(i,2)*Math.pow(f,2)+Math.pow(a,2)*Math.pow(c,2),E=(r.lArcFlag!==r.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(i,2)*Math.pow(a,2)-g)/g)),_=i*f/a*E,C=-a*c/i*E,R=Wu([_,C],r.xRot/180*Yi);r.cX=R[0]+(t+o)/2,r.cY=R[1]+(e+l)/2,r.phi1=Math.atan2((f-C)/a,(c-_)/i),r.phi2=Math.atan2((-f-C)/a,(-c-_)/i),r.sweepFlag===0&&r.phi2>r.phi1&&(r.phi2-=2*Yi),r.sweepFlag===1&&r.phi2<r.phi1&&(r.phi2+=2*Yi),r.phi1*=180/Yi,r.phi2*=180/Yi}function nf(r,t,e){kr(r,t,e);const i=r*r+t*t-e*e;if(0>i)return[];if(i===0)return[[r*e/(r*r+t*t),t*e/(r*r+t*t)]];const a=Math.sqrt(i);return[[(r*e+t*a)/(r*r+t*t),(t*e-r*a)/(r*r+t*t)],[(r*e-t*a)/(r*r+t*t),(t*e+r*a)/(r*r+t*t)]]}const Ai=Math.PI/180;function sf(r,t,e){return(1-e)*r+e*t}function af(r,t,e,i){return r+Math.cos(i/180*Yi)*t+Math.sin(i/180*Yi)*e}function of(r,t,e,i){const o=t-r,l=e-t,c=i-e,f=3*o+3*c-6*l,d=(l-o)*6,g=3*o;return Math.abs(f)<1e-6?[-g/d]:l2(d/f,g/f,1e-6)}function uf(r,t,e,i,a){const o=1-a,l=o*o*o,c=3*o*o*a,f=3*o*a*a,d=a*a*a;return r*l+t*c+e*f+i*d}function l2(r,t,e=1e-6){const i=r*r/4-t;if(i<-e)return[];if(i<=e)return[-r/2];const a=Math.sqrt(i);return[-(r/2)-a,-(r/2)+a]}function h2(r,t,e){r.cX||Vu(r,t,e);const i=Math.min(r.phi1,r.phi2),a=Math.max(r.phi1,r.phi2),o=a-i,l=Math.ceil(o/90),c=new Array(l);let f=t,d=e;for(let g=0;g<l;g++){const E=sf(r.phi1,r.phi2,g/l),_=sf(r.phi1,r.phi2,(g+1)/l),C=_-E,R=4/3*Math.tan(C*Ai/4),[N,M]=[Math.cos(E*Ai)-R*Math.sin(E*Ai),Math.sin(E*Ai)+R*Math.cos(E*Ai)],[I,W]=[Math.cos(_*Ai),Math.sin(_*Ai)],[G,b]=[I+R*Math.sin(_*Ai),W-R*Math.cos(_*Ai)],P={relative:r.relative,type:X.CURVE_TO},q=(K,tt)=>{const[Z,rt]=Wu([K*r.rX,tt*r.rY],r.xRot);return[r.cX+Z,r.cY+rt]};[P.x1,P.y1]=q(N,M),[P.x2,P.y2]=q(G,b),[P.x,P.y]=q(I,W),r.relative&&(P.x1-=f,P.y1-=d,P.x2-=f,P.y2-=d,P.x-=f,P.y-=d),[f,d]=[P.x,P.y],c[g]=P}return c}function c2(r=1e13){kr(r);function t(e){return Math.round(e*r)/r}return function(i){return"x1"in i&&typeof i.x1<"u"&&(i.x1=t(i.x1)),"y1"in i&&typeof i.y1<"u"&&(i.y1=t(i.y1)),"x2"in i&&typeof i.x2<"u"&&(i.x2=t(i.x2)),"y2"in i&&typeof i.y2<"u"&&(i.y2=t(i.y2)),"x"in i&&typeof i.x<"u"&&(i.x=t(i.x)),"y"in i&&typeof i.y<"u"&&(i.y=t(i.y)),"rX"in i&&typeof i.rX<"u"&&(i.rX=t(i.rX)),"rY"in i&&typeof i.rY<"u"&&(i.rY=t(i.rY)),i}}function lf(){return Hr((r,t,e)=>(r.relative&&(typeof r.x1<"u"&&(r.x1+=t),typeof r.y1<"u"&&(r.y1+=e),typeof r.x2<"u"&&(r.x2+=t),typeof r.y2<"u"&&(r.y2+=e),typeof r.x<"u"&&(r.x+=t),typeof r.y<"u"&&(r.y+=e),r.relative=!1),r))}function f2(){return Hr((r,t,e)=>(r.relative||(typeof r.x1<"u"&&(r.x1-=t),typeof r.y1<"u"&&(r.y1-=e),typeof r.x2<"u"&&(r.x2-=t),typeof r.y2<"u"&&(r.y2-=e),typeof r.x<"u"&&(r.x-=t),typeof r.y<"u"&&(r.y-=e),r.relative=!0),r))}function p2(r=!0,t=!0,e=!0){return Hr((i,a,o,l,c)=>{if(isNaN(l)&&!(i.type&X.MOVE_TO))throw new Error("path must start with moveto");return t&&i.type&X.HORIZ_LINE_TO&&(i.type=X.LINE_TO,i.y=i.relative?0:o),e&&i.type&X.VERT_LINE_TO&&(i.type=X.LINE_TO,i.x=i.relative?0:a),r&&i.type&X.CLOSE_PATH&&(i.type=X.LINE_TO,i.x=i.relative?l-a:l,i.y=i.relative?c-o:c),i.type&X.ARC&&(i.rX===0||i.rY===0)&&(i.type=X.LINE_TO,delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag),i})}function hf(){let r=NaN,t=NaN,e=NaN,i=NaN;return Hr((a,o,l)=>(a.type&X.SMOOTH_CURVE_TO&&(a.type=X.CURVE_TO,r=isNaN(r)?o:r,t=isNaN(t)?l:t,a.x1=a.relative?o-r:2*o-r,a.y1=a.relative?l-t:2*l-t),a.type&X.CURVE_TO?(r=a.relative?o+a.x2:a.x2,t=a.relative?l+a.y2:a.y2):(r=NaN,t=NaN),a.type&X.SMOOTH_QUAD_TO&&(a.type=X.QUAD_TO,e=isNaN(e)?o:e,i=isNaN(i)?l:i,a.x1=a.relative?o-e:2*o-e,a.y1=a.relative?l-i:2*l-i),a.type&X.QUAD_TO?(e=a.relative?o+a.x1:a.x1,i=a.relative?l+a.y1:a.y1):(e=NaN,i=NaN),a))}function cf(){let r=NaN,t=NaN;return Hr((e,i,a)=>{if(e.type&X.SMOOTH_QUAD_TO&&(e.type=X.QUAD_TO,r=isNaN(r)?i:r,t=isNaN(t)?a:t,e.x1=e.relative?i-r:2*i-r,e.y1=e.relative?a-t:2*a-t),e.type&X.QUAD_TO){r=e.relative?i+e.x1:e.x1,t=e.relative?a+e.y1:e.y1;const o=e.x1,l=e.y1;e.type=X.CURVE_TO,e.x1=((e.relative?0:i)+o*2)/3,e.y1=((e.relative?0:a)+l*2)/3,e.x2=(e.x+o*2)/3,e.y2=(e.y+l*2)/3}else r=NaN,t=NaN;return e})}function Hr(r){let t=0,e=0,i=NaN,a=NaN;return function(l){if(isNaN(i)&&!(l.type&X.MOVE_TO))throw new Error("path must start with moveto");const c=r(l,t,e,i,a);return l.type&X.CLOSE_PATH&&(t=i,e=a),"x"in l&&typeof l.x<"u"&&(t=l.relative?t+l.x:l.x),"y"in l&&typeof l.y<"u"&&(e=l.relative?e+l.y:l.y),l.type&X.MOVE_TO&&(i=t,a=e),c}}function d2(r=0){kr(r);let t=NaN,e=NaN,i=NaN,a=NaN;return Hr((o,l,c,f,d)=>{const g=Math.abs;let E=!1,_=0,C=0;if(o.type&X.SMOOTH_CURVE_TO&&(_=isNaN(t)?0:l-t,C=isNaN(e)?0:c-e),o.type&(X.CURVE_TO|X.SMOOTH_CURVE_TO)?(t=o.relative?l+o.x2:o.x2,e=o.relative?c+o.y2:o.y2):(t=NaN,e=NaN),o.type&X.SMOOTH_QUAD_TO?(i=isNaN(i)?l:2*l-i,a=isNaN(a)?c:2*c-a):o.type&X.QUAD_TO?(i=o.relative?l+o.x1:o.x1,a=o.relative?c+o.y1:o.y2):(i=NaN,a=NaN),o.type&X.LINE_COMMANDS||o.type&X.ARC&&(o.rX===0||o.rY===0||!o.lArcFlag)||o.type&X.CURVE_TO||o.type&X.SMOOTH_CURVE_TO||o.type&X.QUAD_TO||o.type&X.SMOOTH_QUAD_TO){const R=typeof o.x>"u"?0:o.relative?o.x:o.x-l,N=typeof o.y>"u"?0:o.relative?o.y:o.y-c;_=isNaN(i)?typeof o.x1>"u"?_:o.relative?o.x:o.x1-l:i-l,C=isNaN(a)?typeof o.y1>"u"?C:o.relative?o.y:o.y1-c:a-c;const M=typeof o.x2>"u"?0:o.relative?o.x:o.x2-l,I=typeof o.y2>"u"?0:o.relative?o.y:o.y2-c;g(R)<=r&&g(N)<=r&&g(_)<=r&&g(C)<=r&&g(M)<=r&&g(I)<=r&&(E=!0)}return o.type&X.CLOSE_PATH&&g(l-f)<=r&&g(c-d)<=r&&(E=!0),E?[]:o})}function Xi(r,t,e,i,a,o){return kr(r,t,e,i,a,o),Hr((l,c,f,d)=>{const g=l.x1,E=l.x2,_=l.relative&&!isNaN(d),C=typeof l.x<"u"?l.x:_?0:c,R=typeof l.y<"u"?l.y:_?0:f;l.type&X.HORIZ_LINE_TO&&t!==0&&(l.type=X.LINE_TO,l.y=l.relative?0:f),l.type&X.VERT_LINE_TO&&e!==0&&(l.type=X.LINE_TO,l.x=l.relative?0:c),typeof l.x<"u"&&(l.x=l.x*r+R*e+(_?0:a)),typeof l.y<"u"&&(l.y=C*t+l.y*i+(_?0:o)),typeof l.x1<"u"&&(l.x1=l.x1*r+l.y1*e+(_?0:a)),typeof l.y1<"u"&&(l.y1=g*t+l.y1*i+(_?0:o)),typeof l.x2<"u"&&(l.x2=l.x2*r+l.y2*e+(_?0:a)),typeof l.y2<"u"&&(l.y2=E*t+l.y2*i+(_?0:o));function N(I){return I*I}const M=r*i-t*e;if(typeof l.xRot<"u"&&(r!==1||t!==0||e!==0||i!==1))if(M===0)delete l.rX,delete l.rY,delete l.xRot,delete l.lArcFlag,delete l.sweepFlag,l.type=X.LINE_TO;else{const I=l.xRot*Math.PI/180,W=Math.sin(I),G=Math.cos(I),b=1/N(l.rX),P=1/N(l.rY),q=N(G)*b+N(W)*P,K=2*W*G*(b-P),tt=N(W)*b+N(G)*P,Z=q*i*i-K*t*i+tt*t*t,rt=K*(r*i+t*e)-2*(q*e*i+tt*r*t),J=q*e*e-K*r*e+tt*r*r,st=(Math.atan2(rt,Z-J)+Math.PI)%Math.PI/2,ct=Math.sin(st),ft=Math.cos(st);l.rX=Math.abs(M)/Math.sqrt(Z*N(ft)+rt*ct*ft+J*N(ct)),l.rY=Math.abs(M)/Math.sqrt(Z*N(ct)-rt*ct*ft+J*N(ft)),l.xRot=st*180/Math.PI}return typeof l.sweepFlag<"u"&&0>M&&(l.sweepFlag=+!l.sweepFlag),l})}function g2(r,t=0,e=0){kr(r,t,e);const i=Math.sin(r),a=Math.cos(r);return Xi(a,i,-i,a,t-t*a+e*i,e-t*i-e*a)}function y2(r,t=0){return kr(r,t),Xi(1,0,0,1,r,t)}function m2(r,t=r){return kr(r,t),Xi(r,0,0,t,0,0)}function v2(r){return kr(r),Xi(1,0,Math.atan(r),1,0,0)}function x2(r){return kr(r),Xi(1,Math.atan(r),0,1,0,0)}function E2(r=0){return kr(r),Xi(-1,0,0,1,r,0)}function A2(r=0){return kr(r),Xi(1,0,0,-1,0,r)}function w2(){return Hr((r,t,e)=>X.ARC===r.type?h2(r,r.relative?0:t,r.relative?0:e):r)}function b2(){return Hr((r,t,e)=>(r.relative&&(t=0,e=0),X.ARC===r.type&&Vu(r,t,e),r))}function ff(){return r=>({...r})}function T2(){const r=ff(),t=lf(),e=cf(),i=hf(),a=Hr((o,l,c)=>{const f=i(e(t(r(o))));function d(E){E>a.maxX&&(a.maxX=E),E<a.minX&&(a.minX=E)}function g(E){E>a.maxY&&(a.maxY=E),E<a.minY&&(a.minY=E)}if(f.type&X.DRAWING_COMMANDS&&(d(l),g(c)),f.type&X.HORIZ_LINE_TO&&d(f.x),f.type&X.VERT_LINE_TO&&g(f.y),f.type&X.LINE_TO&&(d(f.x),g(f.y)),f.type&X.CURVE_TO){d(f.x),g(f.y);const E=of(l,f.x1,f.x2,f.x);for(const C of E)0<C&&1>C&&d(uf(l,f.x1,f.x2,f.x,C));const _=of(c,f.y1,f.y2,f.y);for(const C of _)0<C&&1>C&&g(uf(c,f.y1,f.y2,f.y,C))}if(f.type&X.ARC){d(f.x),g(f.y),Vu(f,l,c);const E=f.xRot/180*Math.PI,_=Math.cos(E)*f.rX,C=Math.sin(E)*f.rX,R=-Math.sin(E)*f.rY,N=Math.cos(E)*f.rY,[M,I]=f.phi1<f.phi2?[f.phi1,f.phi2]:-180>f.phi2?[f.phi2+360,f.phi1+360]:[f.phi2,f.phi1],W=([P,q])=>{const tt=Math.atan2(q,P)*180/Math.PI;return tt<M?tt+360:tt},G=nf(R,-_,0).map(W);for(const P of G)P>M&&P<I&&d(af(f.cX,_,R,P));const b=nf(N,-C,0).map(W);for(const P of b)P>M&&P<I&&g(af(f.cY,C,N,P))}return o});return a.minX=1/0,a.maxX=-1/0,a.minY=1/0,a.maxY=-1/0,a}const fe={ROUND:c2,TO_ABS:lf,TO_REL:f2,NORMALIZE_HVZ:p2,NORMALIZE_ST:hf,QT_TO_C:cf,INFO:Hr,SANITIZE:d2,MATRIX:Xi,ROTATE:g2,TRANSLATE:y2,SCALE:m2,SKEW_X:v2,SKEW_Y:x2,X_AXIS_SYMMETRY:E2,Y_AXIS_SYMMETRY:A2,A_TO_C:w2,ANNOTATE_ARCS:b2,CLONE:ff,CALCULATE_BOUNDS:T2};class wi{static cached=new Map;static cachedCanvas=new Map;static destroy(){this.cached.clear(),this.cachedCanvas.clear()}static createCanvas(t){var a;if(!((a=kt.window)!=null&&a.document))throw new Error("environment not support");let e;t.containerId&&(e=kt.window.document.getElementById(t.containerId)),e||(e=kt.window.document.getElementsByTagName("body")[0]);let i;if(t.canvasId&&(i=kt.window.document.getElementById(t.canvasId)||void 0),t.width||(t.width=(e==null?void 0:e.offsetWidth)||100),t.height||(t.height=(e==null?void 0:e.offsetHeight)||100),t.dpr||(t.dpr=kt.dpr),i)this.resizeCanvas(i,t.width,t.height,t.dpr);else{if(i=this.createHtmlCanvas(t.width,t.height,t.dpr),!i)throw new Error("error environment");t.canvasId&&i.setAttribute("id",t.canvasId),e==null||e.appendChild(i)}return i.style.background=t.background||"transparent",i}static getContext2D(t,e={}){const i={alpha:!0,willReadFrequently:!!e.willReadFrequently},a=t.getContext("2d",i);if(!a)throw new Error("getContext2D error");return a.scale(e.dpr||1,e.dpr||1),a}static resizeCanvas(t,e,i,a=1){t instanceof OffscreenCanvas?(t.width=e,t.height=i):t instanceof HTMLCanvasElement&&(t.setAttribute("width",(e*a).toString()),t.setAttribute("height",(i*a).toString()),t.style.width=e+"px",t.style.height=i+"px",t.style.padding="0",t.style.margin="0",t.style.border="0",t.style.imageRendering="pixelated",t.style.transform="translateZ(0)")}static async getImageBitmapByCanvasAsync(t){if(t)return t instanceof OffscreenCanvas?t.transferToImageBitmap():t instanceof HTMLCanvasElement?await createImageBitmap(t):void 0}static get(t,e,i,a=1){let o=this.cached.get(t);return o||(o=this.create(e,i,a),this.set(t,o)),this.resizeCanvas(o,e,i,a),o}static set(t,e){if(!t||!e)throw new Error("error input");return this.cached.set(t,e)}static remove(t){this.cached.has(t)&&this.cached.delete(t)}static create(t,e,i=1){var a;if((a=kt.window)!=null&&a.OffscreenCanvas)return new OffscreenCanvas(t,e);throw new Error("environment does not support")}static createHtmlCanvas(t,e,i=1){if(!kt.window.document)throw new Error("environment does not support");const a=kt.window.document.createElement("canvas");return this.resizeCanvas(a,t,e,i),a}static measureText(t,e,i=new F){if(!t)throw new Error("input error");const o=this.get("measureText",1,1).getContext("2d");if(!o)throw new Error("bufferCtx not found");e.render(o);const l=o.measureText(t);if(!l)throw new Error("measureText error");const c=l.actualBoundingBoxRight+l.actualBoundingBoxLeft,f=l.actualBoundingBoxAscent+l.actualBoundingBoxDescent;return i.set(c,f),i}}let _2=0;class ao extends H{name="Geo2";id=++_2;params;viewMatrix=new ne;boundingBox=new Dt;flipY=!1;renderPath;constructor(t={}){var e;super(t.commands),typeof t.flipY<"u"&&(this.flipY=!!t.flipY),this.params=t,(e=this.commands)!=null&&e.length&&this.toAbs(),t.flipY&&this.matrix(1,0,0,-1,0,0)}_version=0;get version(){return this._version}set version(t){this._version=t}set needsUpdate(t){t&&this._version++}setFromPoints(t){return t!=null&&t.length?(this.params.points=t,this.recomputePath(),this):this}recomputePath(){throw new Error("must be implemented in derived")}computeBoundingBox(){var t;this.boundingBox.makeEmpty(),dt.identity();for(let e=0,i=((t=this.commands)==null?void 0:t.length)||0;e<i;e++){const a=this.commands[e];switch(a.type){case H.MOVE_TO:this.boundingBox.expandByXY(a.x,a.y),dt.set(a.x,a.y);break;case H.LINE_TO:this.boundingBox.expandByXY(a.x,a.y),dt.set(a.x,a.y);break;case H.ARC:typeof a.xRot>"u"?(this.boundingBox.expandByXY(a.x,a.y),Ur.set(a.x,a.y).addScalar(-a.rX),this.boundingBox.expandByPoint(Ur),Ur.set(a.x,a.y).addScalar(a.rX),this.boundingBox.expandByPoint(Ur)):this.boundingBox.expandByXY(a.x,a.y),dt.set(a.x,a.y);break;case H.HORIZ_LINE_TO:this.boundingBox.expandByXY(a.x,dt.y),dt.set(a.x,dt.y);break;case H.VERT_LINE_TO:this.boundingBox.expandByXY(dt.x,a.y),dt.set(dt.x,a.y);break;case H.QUAD_TO:this.boundingBox.expandByXY(a.x,a.y),dt.set(a.x,a.y);break}}return this.boundingBox}render(t,e){if(this.renderPath=new Path2D,!(!t||!(e!=null&&e.length))){dt.identity();for(let i=0,a=(e==null?void 0:e.length)||0;i<a;i++){const o=e[i];switch(o.type){case H.MOVE_TO:this.renderPath.moveTo(o.x,o.y),dt.set(o.x,o.y);break;case H.LINE_TO:this.renderPath.lineTo(o.x,o.y),dt.set(o.x,o.y);break;case H.ARC:this.renderPath.arc(o.x,o.y,o.rX,o.phi1||0,o.phi2||Math.PI*2,o.sweepFlag!==1),dt.set(o.x,o.y);break;case H.HORIZ_LINE_TO:this.renderPath.lineTo(o.x,dt.y),dt.set(o.x,dt.y);break;case H.VERT_LINE_TO:this.renderPath.lineTo(dt.x,o.y),dt.set(dt.x,o.y);break;case H.CURVE_TO:dt.set(o.x,o.y);break;case H.SMOOTH_CURVE_TO:dt.set(o.x,o.y);break;case H.QUAD_TO:dt.set(o.x,o.y);break;case H.SMOOTH_QUAD_TO:dt.set(o.x,o.y);break}}}}applyMatrix(t){return this.needsUpdate=!0,this.matrix(t.elements[0],t.elements[1],t.elements[3],t.elements[4],t.elements[6],t.elements[7]),this}getRenderCommands(t){var o;const e=[];for(let l=0,c=((o=this.commands)==null?void 0:o.length)||0;l<c;l++)e.push(Object.assign({},this.commands[l]));if(!t)return e;dt.identity();const i=fe.MATRIX(t.elements[0],t.elements[1],t.elements[3],t.elements[4],t.elements[6],t.elements[7]),a=[];for(let l=0,c=e.length;l<c;l++){const f=e[l],d=i(f);if(d.type===H.ARC&&typeof d.xRot<"u"){const g=k0(dt.x,dt.y,d.x,d.y,d.lArcFlag,d.sweepFlag,d.rX,d.rY,0);dt.set(d.x,d.y),d.x=g[0],d.y=g[1],d.rX=g[2]>g[3]?g[2]:g[3],d.phi1=g[4],d.phi2=g[4]+g[5],d.sweepFlag=g[7],d.phi2===0&&(d.phi2=d.phi1>0?1e-6:-1e-6)}else if(d.type===H.ARC){if(dt.set(d.x,d.y),t.getScale(Ur),d.rX=d.rY*Math.abs(Ur.x),d.phi1!==0||d.phi2!==Math.PI*2){t.getRotation(Ur),d.phi1+=Ur.x,d.phi2+=Ur.x;const g=a[a.length-1];g.x=(g.x||0)+Math.cos(Ur.x)*d.rX*2,g.y=(g.y||0)+Math.sin(Ur.x)*d.rX*2}}else dt.set(d.x||dt.x,d.y||dt.y);Array.isArray(d)?a.push(...d):a.push(d)}return a}copy(t){return this.commands=Mt.cloneDeep(t.commands),this.version=0,this}clone(){const t=this.constructor;return new t(this.params).copy(this)}getConvexHull(){var e,i;const t=[];if(!((e=this.commands)!=null&&e.length))return t;for(let a=0,o=((i=this.commands)==null?void 0:i.length)||0;a<o;a++){const l=this.commands[a];switch(l.type){case H.MOVE_TO:t.push({x:l.x,y:l.y}),dt.set(l.x,l.y);break;case H.LINE_TO:t.push({x:l.x,y:l.y}),dt.set(l.x,l.y);break;case H.ARC:t.push({x:l.x,y:l.y}),dt.set(l.x,l.y);break;case H.HORIZ_LINE_TO:t.push({x:l.x,y:dt.y}),dt.set(l.x,dt.y);break;case H.VERT_LINE_TO:t.push({x:dt.x,y:l.y}),dt.set(dt.x,l.y);break;case H.CURVE_TO:case H.SMOOTH_CURVE_TO:t.push({x:l.x,y:l.y}),dt.set(l.x,l.y);break;case H.QUAD_TO:case H.SMOOTH_QUAD_TO:t.push({x:l.x,y:l.y}),dt.set(l.x,l.y);break}}return t}isPointInBoundingBox(t){return this.boundingBox?this.boundingBox.containsPoint(t):!1}isPointInPath(t){if(this.renderPath){Zi.save(),Zi.beginPath(),Zi.lineWidth=5,Zi.stroke(this.renderPath),Zi.fill(this.renderPath),Zi.closePath();const e=Zi.isPointInPath(this.renderPath,t.x,t.y);return Zi.restore(),e}return!1}}const dt=new F,Ur=new F,Zi=wi.get("RAY_CASTER",10,10).getContext("2d");class C2 extends ao{isCircle=!0;radius=1;start=0;end=Math.PI*2;constructor(t={}){t.commands||(t.commands=[]),super(t),typeof t.radius<"u"&&(this.radius=t.radius),typeof t.start<"u"&&(this.start=t.start),typeof t.end<"u"&&(this.end=t.end),this.recomputePath()}recomputePath(){var i,a,o;if(!((a=(i=this.params)==null?void 0:i.points)!=null&&a.length))return this;const t=this.params.points,e=[];for(let l=0,c=t.length;l<c;l++)e.push({type:H.MOVE_TO,x:t[l].x>0?t[l].x+this.radius:t[l].x-this.radius,y:t[l].y*(this.params.flipY?-1:1),relative:!1}),e.push({type:H.ARC,rX:this.radius,rY:this.radius,xRot:void 0,lArcFlag:0,sweepFlag:((o=this.params)==null?void 0:o.sweepFlag)||1,phi1:this.start,phi2:this.end,x:t[l].x,y:t[l].y*(this.params.flipY?-1:1),relative:!1});return this.commands=e,this}}class D2{params;static splitLimit=100;constructor(t={}){this.params=t}destroy(){}static getInstanceByElement(t,e=!1){if(!t)return;let i;switch(t.nodeName){case"path":i=this.getInstanceByPath(t,e);break;case"circle":i=this.getInstanceByCircle(t,e);break}return i||console.error(`unsupported: ${t}`),i}static getInstanceByPath(t,e=!1){if(!t)return;const i=so(t,"d");if(!i)return;const a=i.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,""),o=a.match(/([Mm][^Mm]*)/g);if(!o||o.length<=this.splitLimit)try{return new ao({commands:a,flipY:e})}catch(c){console.error(`getInstanceByPath error: ${c}: ${a}`);return}const l=[];for(let c=0,f=o.length;c<f;c+=this.splitLimit){const g=o.slice(c,c+this.splitLimit).join(" ");try{l.push(new ao({commands:g,flipY:e}))}catch(E){console.error(`getInstanceByPath error: ${E}`)}}return l}static getInstanceByCircle(t,e=!1){if(!t||t.nodeName!=="circle")return;pf.set(so(t,"cx",0),so(t,"cy",0));const i=so(t,"r",0);return new C2({points:[pf.clone()],radius:i,flipY:e})}static getInstance(t,e=!1){if(t)return new ao({commands:t,flipY:e})}}const pf=new F;class S2{svg;offset=new F;svgRoot;layers=[];elementsMap={};boundingBoxMap={};boundingBox=new Dt;svgSkeletons=[];data;_exceptTypes=["view"];_exceptIds=["viewer","mirror"];_lvi=0;bindSvg(t){return this.svg=t,this.svgRoot=Mc(this.svg),this.layers=this.getLayers(2),this.getElementsMap(this.svg,this.elementsMap),this}getLayers(t){var e;if(!this.svg)throw new Error("please bind svg first");return t===2&&((e=this.layers)!=null&&e.length)?this.layers:(this.layers=this._getSvgLayer(this.svg,t),this.layers)}_getSvgLayer(t,e=0,i=0,a=[]){var c;let o,l=t.id;if(this._exceptTypes.includes(t.tagName)||t.tagName==="defs")return this._lvi--,a;if(e&&this._lvi>e)return a;l&&!this._exceptIds.includes(l)&&(o={value:l,label:l,children:[]},a.push(o)),this._lvi++;for(let f=0,d=t.children.length;f<d;f++)o?this._getSvgLayer(t.children[f],e,this._lvi,o.children):this._getSvgLayer(t.children[f],e,this._lvi,a);return((c=o==null?void 0:o.children)==null?void 0:c.length)===0&&delete o.children,this._lvi=i,a}getElementsMap(t,e={}){return this.traverseSvg(t,i=>{i!==t&&i.id&&(e[i.id]=i)}),e}computeBoundingBoxMap(){var e;if(Object.keys(this.boundingBoxMap).length)return this.boundingBoxMap;let t=(e=this.svg)==null?void 0:e.getBoundingClientRect();return t&&this.offset.set(t.left,t.top),this.traverseSvg(this.svg,i=>{if(!i.id)return;if(i.tagName==="use"){const l=this.getUseSymbolId(i);if(!l)return;const c=this.boundingBoxMap[l];if(c&&!c.isEmpty()){bi.set(Number(i.getAttribute("x")||"0"),Number(i.getAttribute("y")||"0")),oo.composeSvgTransform(bi.x,bi.y,i.getAttribute("transform"));const g=new Dt().copy(c).applyMatrix3(oo);this.boundingBoxMap[i.id]=g;return}const f=this.getUseElementBoundingBoxWithSymbol(i);if(!f)return;this.boundingBoxMap[l]=f,bi.set(Number(i.getAttribute("x")||"0"),Number(i.getAttribute("y")||"0")),oo.composeSvgTransform(bi.x,bi.y,i.getAttribute("transform"));const d=new Dt().copy(f).applyMatrix3(oo);this.boundingBoxMap[i.id]=d,this.boundingBox.expandByBox(d);return}if(typeof i.getBBox!="function")return;const a=i.getBBox();if((!a.width||!a.height)&&i.tagName==="path"){const l=D2.getInstanceByPath(i);if(!Array.isArray(l)){const c=l==null?void 0:l.computeBoundingBox();if(!c||c.isEmpty())return;c.getSize(bi),a.x=c.min.x,a.y=c.max.y,a.width=bi.x,a.height=bi.y}}if(!a.width||!a.height)return;const o=new Dt(new F(a.x,a.y),new F(a.x+a.width,a.y+a.height));this.boundingBoxMap[i.id]=o.round(),this.boundingBox.expandByBox(o)}),this.boundingBoxMap}updateLayersVisibility(t,e=!1){if(!this.elementsMap)throw new Error("please bind svg first");this._updateAllLayersVisibility(!e),t!=null&&t.length||(t=["background"]);for(let i=0,a=t.length;i<a;i++){const o=this.getElementById(t[i]);o&&this._updateLayersVisibility(o,e,!0,!0)}}_updateAllLayersVisibility(t=!1){Object.values(this.elementsMap).forEach(e=>{e.tagName==="svg"||e.tagName==="symbol"||!e.getAttribute("id")||(e.style.display=t?"block":"none")})}_updateLayersVisibility(t,e=!1,i=!1,a=!1){var o,l;if(!(!t||t.tagName==="svg"||!t.getAttribute("id"))){if(t.style.display=e?"block":"none",i&&e){let c=t.parentElement;for(;c&&c.tagName!=="svg";)c.style.display=e?"block":"none",c=c.parentElement}if(a&&((o=t.children)==null?void 0:o.length)>0)for(let c=0,f=(l=t.children)==null?void 0:l.length;c<f;c++)this._updateLayersVisibility(t.children[c],e,!1,!0)}}updateVisibilityByAssetType(t,e=!1,i){i||(i=F0[t]),this.updateLayersVisibility(i,!e)}updateVisibilityByAssetTypes(t,e=!1,i){if(Array.isArray(t)||(t=[t]),!!(t!=null&&t.length))for(let a=0,o=t.length;a<o;a++)this.updateVisibilityByAssetType(t[a],e,i)}getElementById(t){if(!this.elementsMap)throw new Error("please bind svg first");return this.elementsMap[t]}getElementBoundingBox(t){return this.boundingBoxMap[t]}findSkeletonByPath(t=[]){let e=0,i;const a=Object.keys(this.elementsMap);for(let o=0,l=a.length;o<l;o++){const c=this.elementsMap[a[o]];if(!c)continue;const f=c.getAttribute("d");f&&(f.length<e||(e=f.length,i=c.id?c:c.parent))}return i&&t.push(i),t}setTextInChildren2(t,e){var a;let i;((a=t==null?void 0:t.children)==null?void 0:a.length)<2?(i=Ru("text"),i.setAttribute("dy","1em"),t.appendChild(i)):i=t.children[t.children.length-1],i.innerHTML=e}traverseSvg(t,e){var i;if(!this._exceptTypes.includes(t.tagName)&&!(t.tagName!=="svg"&&t.tagName!=="defs"&&!t.id)&&!(t.tagName==="g"&&((i=t.children)==null?void 0:i.length)===0)){this._exceptIds.includes(t.id)||e(t);for(let a=0,o=t.children.length;a<o;a++)this.traverseSvg(t.children[a],e)}}traverseSvgTLayers(t,e){var i;if(Array.isArray(t)){for(let a=0,o=t.length;a<o;a++)this.traverseSvgTLayers(t[a],e);return}if(e(t),!!((i=t.children)!=null&&i.length))for(let a=0,o=t.children.length;a<o;a++)this.traverseSvgTLayers(t.children[a],e)}getLabelElementsByType(t,e={}){const i=this.getElementById(no(t));return i&&this.getElementsMap(i,e),e}getLabelElementById(t,e="rm"){if(!t)return;const i=this.getElementById(t);if(!i)return;let a=i.getAttribute("aid");return a||(a="l-"+e+"-"+t),this.getElementById(a)}setLabelsById(t,e,i="rm"){var l,c;const a=this.getLabelElementById(t,i);if(!a)return;const o=((l=a.children)==null?void 0:l.length)||0;for(let f=0,d=((e==null?void 0:e.length)||0)-(o-1);f<d;f++){const g=Ru("text");g.setAttribute("x","0"),g.setAttribute("y",o+f+"em"),a.appendChild(g)}for(let f=1,d=(c=a.children)==null?void 0:c.length;f<d;f++)a.children[f].textContent=e&&f<=e.length?e[f-1]:""}clearAssetLabelsByType(t="rm"){var a;const e=this.getLabelElementsByType(t),i=Mt.keys(e);for(let o=0,l=i.length;o<l;o++){const c=e[i[o]];for(let f=1,d=((a=c.children)==null?void 0:a.length)||0;f<d;f++)c.children[f].textContent=""}}getUseSymbolId(t){var e;if(!(!t||t.tagName!=="use"))return(e=t.getAttribute("xlink:href"))==null?void 0:e.substring(1)}getUseSymbol(t){if(!t||t.tagName!=="use")return;const e=this.getUseSymbolId(t);if(e)return this.getElementById(e)}setElementState2selected(t,e=!1){var a;if(!t)return;if(t.tagName==="use"){const o=this._getSymbolBox(t);if(!o)return;e?(a=t.parentNode)==null||a.insertBefore(o,t):t.parentNode&&t.parentNode.contains(o)&&t.parentNode.removeChild(o);return}let i=t.getAttribute("class");i||(i=""),e?i="danger":i=Mt.replace(i,"danger","").trim(),t.setAttribute("class",i)}_getSymbolBox(t){if(!t)return;const e=t.id+"-boundingBox";let i=this.getElementById(e);if(i)return i;const a=this.getUseSymbol(t);if(!a)return;let o=this.getElementBoundingBox(t.id);if(!o||o.isEmpty())return;i=document.createElementNS("http://www.w3.org/2000/svg","rect"),i.setAttribute("id",e),i.setAttribute("class","danger"),i.setAttribute("x",o.min.x.toString()),i.setAttribute("y",o.min.y.toString());const l=new F;return o.getSize(l),i.setAttribute("width",l.x.toString()),i.setAttribute("height",l.y.toString()),a.getAttribute("transform")&&i.setAttribute("transform",a.getAttribute("transform")||""),a.getAttribute("style")&&i.setAttribute("style",a.getAttribute("style")||""),this.elementsMap[e]=i,i}getUseElementBoundingBoxWithSymbol(t){var f;if(!t)return;const e=(f=t.getAttribute("xlink:href"))==null?void 0:f.substring(1);if(!e)return;let i=this.getElementById(e);if(!i)return;const a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.style.position="absolute",a.style.top="-9999px",a.style.left="-9999px";let o;if(Mt.lowerCase(i.tagName)==="symbol"){o=document.createElementNS("http://www.w3.org/2000/svg","g");for(let d=0,g=i.childNodes.length;d<g;d++){const E=i.childNodes[d].cloneNode(!0);o.appendChild(E)}}else o=i.cloneNode(!0);a.appendChild(o),o.setAttribute("style","stroke: #333333;"),document.body.appendChild(a);const l=a.getBBox();if(document.body.removeChild(a),!l)return;const c=new Dt;return c.set(new F(l.x,l.y),new F(l.x+l.width,l.y+l.height)),c}fontZoom(t,e=1){const i=this.getElementById(t);if(!i)return;let a=i.getAttribute("font-size");a||(a="12");const o=/(\d+)([a-zA-Z%]+)/.exec(a),l=o&&(o==null?void 0:o.length)>2?o[2]:"";let c=Math.round(parseFloat(a)*e*100)/100;i.setAttribute("font-size",c+l)}getCentroid(t,e=new F){const i=t.getAttribute("insX"),a=t.getAttribute("insY");return i||a?e.set(Number(i||"0"),Number(a||"0")):this.getCentroidByDom(t,e)}getCentroidByDom(t,e=new F){const i=Number(t.getAttribute("x")||"0"),a=Number(t.getAttribute("y")||"0"),o=t.getBBox();let l=1,c=1,f=t.getAttribute("transform");if(!f)return e.set(i,a);const d=/scale\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(f);if(typeof d>"u"||d==null){const g=t.transform.baseVal;if(f&&g.numberOfItems>0){let E=g.getItem(0);E&&E.type===SVGTransform.SVG_TRANSFORM_SCALE&&(l=E.matrix.a!==0?E.matrix.a:1,c=E.matrix.d!==0?E.matrix.d:l)}else return e.set((o.x+o.width/2)*l,(o.y+o.height/2)*c)}else l=d[1]&&Number(d[1])>0?Number(d[1]):1,c=d[2]&&Number(d[2])>0?Number(d[2]):l;return i&&a?e.set(i*l,a*c):e.set((o.x+o.width/2)*l,(o.y+o.height/2)*c),e}_lastLinked=[];linkAssetsByTree(t,e){if(t||(t=$e.RM),this.clearLinkedLines(t),!e||!e.value)return;const i=this.getLinesByTree(e);this.drawLinkedLines(t,i)}clearLinkedLines(t){var a;const e=ea(t);if(this.getElementById(e)){for(let o=((a=this._lastLinked)==null?void 0:a.length)-1;o>=0;o--){const l=this._lastLinked[o];l.parentNode&&l.parentNode.removeChild(l),this._lastLinked.splice(o,1)}this._lastLinked.length=0}}drawLinkedLines(t,e){var o;if(!(e!=null&&e.length))return;const i=ea(t),a=this.getElementById(i);if(a)for(let l=0,c=e.length;l<c;l++){const f=e[l][0],d=e[l][((o=e[l])==null?void 0:o.length)-1],g=Ru("line");g.setAttribute("x1",f.x.toString()),g.setAttribute("y1",f.y.toString()),g.setAttribute("x2",d.x.toString()),g.setAttribute("y2",d.y.toString()),g.setAttribute("class","danger"),g.setAttribute("style","stroke-width: 2;"),a.appendChild(g),this._lastLinked.push(g)}}getLinesByTree(t,e=[]){var o;if(!(t!=null&&t.value))return e;const i=this.getElementBoundingBox(t.value);if(!i)return e;const a=i.getCenter();return(o=t.children)==null||o.forEach(l=>{var d;const c=this.getElementBoundingBox(l==null?void 0:l.value);if(!c)return;const f=c.getCenter();e.push([a,f]),(d=l.children)!=null&&d.length&&this.getLinesByTree(l,e)}),e}}const bi=new F,oo=new ne;class O2{name="SvgPainter";params;chef;constructor(t={},e){this.params=t,this.chef=e}drawSocialDistanceCircles(t,e="http://www.w3.org/2000/svg"){var C,R,N;if(!t)return;const i=A0(t),a=Nc(t),o=2*i,l=(R=(C=this.params.socialDistance)==null?void 0:C.colors)!=null&&R.length?(N=this.params.socialDistance)==null?void 0:N.colors:[$t.green,$t.red],c=this.getRadius(a),f=t.querySelector(`#${io}`),d=f==null?void 0:f.querySelectorAll("path");if(!f||!(d!=null&&d.length))return;let g,E;const _=new Array;for(let M=0,I=(d==null?void 0:d.length)||0;M<I;M++){if(g=d[M],E=g.getAttribute("id"),!E)continue;const W=this.chef.getElementBoundingBox(E);if(!W)continue;const G=new F;W.getCenter(G),_.push({id:E,cp:G})}for(let M=0,I=_.length;M<I;M++){_[M].color=l[0];for(let W=0,G=I;W<G;W++)_[M]!==_[W]&&F.getDistance(_[M].cp,_[W].cp)<c*2&&(_[M].color=l[1])}for(let M=0,I=_.length;M<I;M++){let W=this.createCircle(_[M],c,o,e);f.appendChild(W)}}clearSocialDistanceCircles(t){if(!t)return;const e=t.querySelector(`#${io}`),i=e==null?void 0:e.querySelectorAll("circle");if(!(!e||!(i!=null&&i.length)))for(let a=0,o=(i==null?void 0:i.length)||0;a<o;a++){const l=i[a].getAttribute("id");l&&(l==null?void 0:l.indexOf("_circle"))>-1&&e.removeChild(i[a])}}getRadius(t){var i,a,o;let e=((a=(i=this.params)==null?void 0:i.socialDistance)==null?void 0:a.radius)||3;return((o=this.params)==null?void 0:o.displayUnits)==="imperial"?t==="Metres"||t==="m"?e/=3.28084:t==="cm"?e=e/3.28084*100:t==="mm"?e=e/3.28084*1e3:(t==="INCH"||t==="inches")&&(e*=12):t==="INCH"||t==="inches"?e=e*3.28084*12:t==="cm"?e*=100:t==="mm"&&(e*=1e3),e}createCircle(t,e,i,a){const o=document.createElementNS(a,"circle");return o.setAttributeNS(null,"id",t.id+"_circle"),o.setAttributeNS(null,"cx",t.cp.x),o.setAttributeNS(null,"cy",t.cp.y),o.setAttributeNS(null,"r",String(e)),o.setAttributeNS(null,"style",`pointer-events:none;fill-opacity:0.1;stroke:${t.color};stroke-width:${i}px;`),o}}const N2=function(r){return(r||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")};function uo(r,t){if(!r||!t)return!1;if(t.indexOf(" ")!==-1)throw new Error("className should not contain space.");return r.classList?r.classList.contains(t):(" "+r.className+" ").indexOf(" "+t+" ")>-1}function ra(r,t){if(!r)return;let e=r.className;const i=(t||"").split(" ");for(let a=0,o=i.length;a<o;a++){const l=i[a];l&&(r.classList?r.classList.add(l):uo(r,l)||(e+=" "+l))}r.classList||(r.className=e)}function ia(r,t){if(!r||!t)return;const e=t.split(" ");let i=" "+r.className+" ";for(let a=0,o=e.length;a<o;a++){const l=e[a];l&&(r.classList?r.classList.remove(l):uo(r,l)&&(i=i.replace(" "+l+" "," ")))}r.classList||(r.className=N2(i))}class zu extends L0{isSvgScene=!0;name="SvgScene";dynamically=!0;params;socialDistanceEnable=!1;container;svg;svgStr="";svgRoot;viewBox=new Dt;chef;defaultLayers=[];skeletonLayers=[];currentLayers=[];assetType;assetsMap={};legend=[];selectedList=[];painter;_lastHighlightType="";_lastHighlightIds=[];clickSvgElementHandler=this.handleClickSvgElement.bind(this);constructor(t={}){super(),this.params=t,this.assetType=t.assetType||$e.RM,this.params.socialDistanceEnable&&(this.socialDistanceEnable=!0),this.container=this.params.containerId?document.getElementById(this.params.containerId):kt.window.document.getElementsByTagName("body")[0],this.chef=new S2,this.painter=new O2(t,this.chef)}get isMounted(){var t;return((t=this.container.querySelectorAll("svg"))==null?void 0:t.length)>0}destroy(){var t;super.destroy(),this.unmount(),(t=this.camera)==null||t.destroy()}mount(){this.svg&&(this.container.contains(this.svg)||this.container.appendChild(this.svg),this.chef.computeBoundingBoxMap())}unmount(){this.svg&&this.svg.parentNode&&this.container.contains(this.svg)&&this.container.removeChild(this.svg)}computeBoundingBox(){return this.boundingBox.makeEmpty(),!this.chef||!this.svg?this.boundingBox:(this.chef.computeBoundingBoxMap(),this.boundingBox.copy(this.chef.boundingBox),console.warn("svgScene.computeBoundingBox: ",this.chef.boundingBox.toString()),this.boundingBox)}async load(t){return new qc().loadAsync(t)}bind(t){if(this.svgStr=t,this.svg=new DOMParser().parseFromString(t,"image/svg+xml").documentElement,!this.svg)throw new Error("svg load failed");let e=this.svg.getAttribute("viewBox");return e?(w0(e,this.viewBox),this.chef.bindSvg(this.svg),this.svgRoot=Mc(this.svg),this.svg.setAttribute("viewBox",`0 0 ${this.params.width} ${this.params.height}`),this.svg.setAttribute("style","transform: translateZ(0);"),this.appendStyles(),console.log(this.name,"viewBox -> ",e,this.viewBox.toString()),this.setAssetsMap(this.assetType,this.assetsMap),!0):!1}appendStyles(){var e;let t=(e=this.svg)==null?void 0:e.querySelector("style");t&&(t.appendChild(document.createTextNode(`.default { stroke: ${this.params.defaultStroke}; fill: ${this.params.defaultFill}; }`)),t.appendChild(document.createTextNode(`.info { stroke: ${this.params.infoStroke}; fill: ${this.params.infoFill}; }`)),t.appendChild(document.createTextNode(`.primary { stroke: ${this.params.primaryStroke}; fill: ${this.params.primaryFill}; }`)),t.appendChild(document.createTextNode(`.success { stroke: ${this.params.successStroke}; fill: ${this.params.successFill}; }`)),t.appendChild(document.createTextNode(`.warning { stroke: ${this.params.warningStroke}; fill: ${this.params.warningFill}; }`)),t.appendChild(document.createTextNode(`.danger { stroke: ${this.params.dangerStroke}; fill: ${this.params.dangerFill}; }`)),t.appendChild(document.createTextNode(`.active { stroke: ${this.params.activeStroke}; fill: ${this.params.activeFill}; }`)))}getLayers(t=2){return this.svg?this.chef.getLayers(t):[]}setDefaultLayers(t){t!=null&&t.length&&(this.defaultLayers=t)}setSkeletonLayers(t){t!=null&&t.length&&(this.skeletonLayers=t)}setCurrentLayers(t){t!=null&&t.length&&(this.currentLayers=t)}showDefaultLayers(t,e=!1){this.setDefaultLayers(t),this.chef.updateLayersVisibility(t,e)}updateLayersVisibility(t,e=!1){this.chef.updateLayersVisibility(t,e)}setAssetType(t,e){this.assetsMap={},this.assetType=t,this.setAssetsMap(this.assetType,this.assetsMap),e||(e=[ea(t)],t!==$e.RM&&e.unshift(ea($e.RM))),this.setDefaultLayers(e),this.updateLayersVisibility(this.defaultLayers,!0)}isBelongsToAssetType(t,e){e||(e=this.assetType);const i=this.getAssetsByType(e);return i?i==null?void 0:i.hasOwnProperty(t):!1}setAssetsMap(t,e={}){const i=this.chef.getElementById(ea(t));if(!i)return e;e[t]=this.chef.getElementsMap(i);const a=no(t),o=this.chef.getElementById(a);if(!o)return e;const l=this.chef.getElementsMap(o),c=Mt.keys(l);if(!(c!=null&&c.length))return e;if(Mt.startsWith(c[0],`l-${t}-`)){const f=`l-${t}-`.length;for(let d=0,g=c.length;d<g;d++){const E=c[d].slice(f);l[E]=l[c[d]],delete l[c[d]]}}return e[a]=l,e}getAssetsByType(t){return this.assetsMap.hasOwnProperty(t)||this.setAssetsMap(t,this.assetsMap),this.assetsMap[t]}getElementById(t){if(!t)return;const e=this.getAssetsByType(this.assetType);if(!(!e||!Object.hasOwnProperty.call(e,t)))return e[t]}getAssetIdsByType(t){const e=this.getAssetsByType(t),i=[];return e?Mt.keys(e):i}clearFillOrStroke(t="fill"){const e=this.getAssetsByType(this.assetType);if(!e)return;const i=Mt.keys(e);let a;for(let o=0,l=i.length;o<l;o++)a=e[i[o]],!(!a||!a.hasAttribute(t))&&(a.removeAttribute(t),t==="stroke"&&a.removeAttribute("stroke-width"));this.clearLegendBy(t)}clearFillOrStrokeByIds(t,e="fill"){const i=this.getAssetsByType(this.assetType);if(!i)return;const a=Mt.keys(i);let o;for(let l=0,c=a.length;l<c;l++)t!=null&&t.length&&!t.includes(a[l])||(o=i[a[l]],!(!o||!o.hasAttribute(e))&&(o.removeAttribute(e),e==="stroke"&&o.removeAttribute("stroke-width")));this.clearLegendBy(e)}setFillOrStrokeByIds(t,e,i="fill"){const a=this.getAssetsByType(this.assetType);if(!a)return;const o=Mt.keys(a);let l;for(let c=0,f=o.length;c<f;c++)t.includes(o[c])&&(l=a[o[c]],l&&(l.setAttribute(i,e),i==="stroke"&&l.setAttribute("stroke-width","7"),this.addLegend(i,e,o[c])))}addLegend(t,e,i){let a=this.legend.find(o=>o.color===e);a||(a={type:t,color:e,ids:[]},this.legend.push(a)),a.ids.push(i)}clearLegendBy(t){var e;t||(this.legend.length=0);for(let i=((e=this.legend)==null?void 0:e.length)-1;i>=0;i--)this.legend[i].type===t&&this.legend.splice(i,i)}getLegend(){return this.legend}showSkeleton(){var t;(t=this.skeletonLayers)!=null&&t.length&&(this.chef.updateLayersVisibility(this.defaultLayers,!1),this.chef.updateLayersVisibility(this.skeletonLayers,!0))}hideSkeleton(){var t;(t=this.skeletonLayers)!=null&&t.length&&(this.chef.updateLayersVisibility(this.skeletonLayers,!1),this.chef.updateLayersVisibility(this.defaultLayers,!0))}setAssetLabels(t,e){this.chef.setLabelsById(t,e,this.assetType)}getAssetLabelsMap(t){var a,o;if(!t)return;const e=no(t);let i=this.getAssetsByType(e);if(!i||!((a=Object.keys(i))!=null&&a.length)){let l=this.chef.getElementById(e);if(l||(l=this.chef.getElementById(t+"-txt-label")),!l)return;i=this.chef.getElementsMap(l),this.assetsMap[e]=i}if(!(!i||!((o=Object.keys(i))!=null&&o.length)))return i}getAssetLabelById(t,e){var l,c;const i=this.getAssetLabelsMap(t);if(!i)return;let a=i[e];if(a&&((l=a==null?void 0:a.childNodes)!=null&&l.length))return a.childNodes[0].textContent||"";const o="l-"+t+"-"+e;if(a=i[o],a&&((c=a==null?void 0:a.children)!=null&&c.length))return a.children[0].textContent||""}clearAssetLabels(){this.chef.clearAssetLabelsByType(this.assetType)}bindAssetsEvents(t){var a;const e=(a=this.svg)==null?void 0:a.querySelector("#"+t);if(!e)return;e.querySelectorAll("[id]").forEach(o=>{o instanceof SVGElement&&o.addEventListener("click",this.clickSvgElementHandler)})}handleClickSvgElement(t){var e;typeof t.preventDefault=="function"&&t.preventDefault(),console.warn("svgScene.handleClickSvgElement: ",(e=t==null?void 0:t.target)==null?void 0:e.id,t==null?void 0:t.target),this.dispatchEvent({type:"click",data:t})}socialDistanceEnableChanged(t){this.socialDistanceEnable=!!t,t?this.painter.drawSocialDistanceCircles(this.svg):this.painter.clearSocialDistanceCircles(this.svg)}highlightAssets(t,e){var a;this.resetHighlightAssets(t);const i=this.getAssetsByType(t);!i||!((a=Object.keys(i))!=null&&a.length)||(this._lastHighlightType=t,this._lastHighlightIds=Array.isArray(e)?e:[e],this._lastHighlightIds.forEach(o=>{o&&i[o]&&ra(i[o],"active")}))}resetHighlightAssets(t){var i;const e=this.getAssetsByType(t||this._lastHighlightType);!e||!((i=Object.keys(e))!=null&&i.length)||(this._lastHighlightIds.forEach(a=>{a&&e[a]&&ia(e[a],"active")}),this._lastHighlightIds.length=0)}getIntersectObjects(t,e=$e.RM,i=[]){i.length=0;const a=[],o=this.getAssetsByType(e);if(!o)return i;const l=Mt.keys(o);for(let f=0,d=l.length;f<d;f++){const g=this.chef.getElementBoundingBox(o[l[f]].id);g&&g.containsPoint(t.worldCoords)&&a.push(o[l[f]])}const c=Mt.sortBy(a,f=>{var d;return(d=this.chef.getElementBoundingBox(f.id))==null?void 0:d.getArea()});return i.push(...c),i}clearSelected(){var t,e;if((t=this.selectedList)!=null&&t.length)for(let i=((e=this.selectedList)==null?void 0:e.length)-1;i>=0;i--){let a=this.selectedList[i];this.selectedList.splice(i,1),this.chef.setElementState2selected(a,!1)}}clearSelectedById(t){var i,a;let e=(i=this.selectedList)==null?void 0:i.findIndex(o=>o.getAttribute("id")===t);e>-1&&(this.chef.setElementState2selected(this.selectedList[e],!1),(a=this.selectedList)==null||a.splice(e,1))}selectByIds(t,e=!1){Array.isArray(t)||(t=[t]),e||this.clearSelected();const i=Mt.uniq(Mt.map(this.selectedList,o=>o.getAttribute("id")||"")),a=this.getAssetsByType(this.assetType);if(a){for(let o=t.length-1;o>=0;o--)i.includes(t[o])?(this.clearSelectedById(t[o]),t.splice(o,1)):Object.hasOwnProperty.call(a,t[o])&&this.selectedList.push(a[t[o]]);this.selectedList.forEach(o=>{this.chef.setElementState2selected(o,!0)})}}getSelectedIds(){var e;if(!((e=this.selectedList)!=null&&e.length))return;const t=[];for(let i=0,a=this.selectedList.length;i<a;i++)this.selectedList[i].id&&t.push(this.selectedList[i].id);return t}getSelectedBoundingBox(){var e;const t=new Dt;return(e=this.selectedList)!=null&&e.length?(this.selectedList.forEach(i=>{const a=this.chef.boundingBoxMap[i.id];a&&t.expandByBox(a)}),t):t.copy(this.boundingBox)}getElementsByBox(t){const e=[],i=Object.keys(this.chef.boundingBoxMap),a=this.getAssetsByType(this.assetType);if(!a)return e;for(let o=0,l=i.length;o<l;o++)if(a.hasOwnProperty(i[o])&&!(i[o].indexOf("-assets")>-1)&&t.intersectsBox(this.chef.boundingBoxMap[i[o]])){const c=a[i[o]];c&&e.push(c)}return e}getBoundingBoxById(t){if(this.chef.boundingBoxMap.hasOwnProperty(t))return new Dt().copy(this.chef.boundingBoxMap[t])}_lastLinkedIds=[];linkAssetsByTree(t){this.chef.linkAssetsByTree(this.assetType,t);const e=this.chef.getElementById(Ks.ASSET_LABELS);e&&(e.style.display="block");const i=no(this.assetType),a=this.chef.getElementById(i);a&&(a.style.display="block");const o=this.assetsMap[i];o&&(this._lastLinkedIds.forEach(l=>{o[l]&&(o[l].style.display="none")}),this._lastLinkedIds=Oc(t),this._lastLinkedIds.forEach(l=>{o[l]&&(o[l].style.display="block")}))}onBeforeRender(){}fullscreen(t=1e3,e=!1){}update(){}}class M2 extends zu{name="SvgLoadingScene";constructor(t){super(t),this.bind(`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-200 -200 500 500">
35
35
  <view id="defaultView" viewBox="-200 -200 500 500" />
36
36
  <style>
37
- #svg-loading-fast circle {animation: svg-loading-fast 2s ease infinite;}
37
+ /*#svg-loading-fast circle {animation: svg-loading-fast 2s ease infinite;}*/
38
+ /*@keyframes svg-loading-fast {*/
39
+ /* 0% {stroke-dasharray: 250; stroke-dashoffset: 250;}*/
40
+ /* 50% {stroke-dasharray: 0; stroke-dashoffset: 0; opacity: 0.5;}*/
41
+ /*}*/
42
+ #svg-loading-fast .line {animation: svg-loading-fast 3s ease infinite;}
38
43
  @keyframes svg-loading-fast {
39
- 10% {stroke-dasharray: 250; stroke-dashoffset: 250;}
40
- 100% {stroke-dasharray: 0; stroke-dashoffset: 0; opacity: 0.5;}
44
+ 0% {stroke-dasharray: 250; stroke-dashoffset: 250; opacity: 1;}
45
+ 50% {stroke-dasharray: 250; stroke-dashoffset: 0; opacity: 0.5;}
41
46
  }
42
- #svg-loading-fast {fill: #5CC9F5}
47
+ #svg-loading-fast path {animation: pathFrames 6s ease infinite;}
48
+ @keyframes pathFrames {
49
+ 0% {opacity: 1;}
50
+ 50% {opacity: 0.5;}
51
+ }
52
+ #svg-loading-fast .triangle {animation: triangleFrames 1s ease infinite;}
53
+ @keyframes triangleFrames {
54
+ 0% {opacity: 1;}
55
+ 50% {opacity: 0.3;}
56
+ }
57
+ #svg-loading-fast {fill: #525252}
58
+ .line {stroke: #525252; stroke-width: 4px}
59
+ .triangle {fill: #F26666}
43
60
  </style>
44
61
  <g id="svg-loading-fast">
45
62
  <!-- <text x="50" y="55" style="text-anchor: middle; fill: #5CC9F5; font-size: 15px;">loading</text>-->
46
- <circle cx="103" cy="25" r="103" style="fill: none; stroke: #5CC9F5; stroke-width: 1px;" />
63
+ <!-- <circle cx="103" cy="25" r="103" style="fill: none; stroke: #5CC9F5; stroke-width: 1px;" />-->
47
64
  <path d="M14 35.7L14 15L21.27 15L21.27 33L34.59 33L33.08 35.7L14 35.7Z" />
48
65
  <path d="M44.78 17.77L44.78 32.93L55.4 32.93L55.4 15L62.71 15L62.71 35.7L37.47 35.7L37.47 15L55.4 15L52.88 17.77L44.78 17.77Z" />
49
66
  <path d="M76.39 27.92L85.03 27.92L82.9 30.77L75.2 30.77L73.29 35.7L65.59 35.7L73.94 15L87.19 15L95.58 35.7L87.94 35.7L85.03 27.92L81.14 17.77L79.99 17.77L76.39 27.92Z" />
@@ -51,6 +68,11 @@ function print() { __p += __j.call(arguments, '') }
51
68
  <path d="M133.63 35.7L126.61 35.7L126.61 15L133.63 15L133.63 35.7Z" />
52
69
  <path d="M153.75 35.7L143.78 21.3L143.78 35.7L136.51 35.7L136.51 15L144.64 15L154.58 29.65L154.58 15L161.78 15L161.78 35.7L153.75 35.7Z" />
53
70
  <path d="M182.73 33L182.73 25.73L177.37 25.73L177.37 22.99L189.93 22.99L189.93 35.7L182.73 35.7L182.73 33.5L180.57 35.7L164.66 35.7L164.66 15L190.04 15L188.46 17.7L172.04 17.7L172.04 33L182.73 33Z" />
71
+ <!-- <rect class="line" width="207" height="5" x="0" y="43" />-->
72
+ <!-- <path class="line" d="M0 43L207 43" />-->
73
+ <path class="line" d="M103.5 46L0 46" />
74
+ <path class="line" d="M103.5 46L207 46" />
75
+ <path class="triangle" d="M103.5 56L133.5 90L73.5 90Z" />
54
76
  </g>
55
77
  </svg>`)}}var df={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
56
78
  * http://hammerjs.github.io/
@@ -78,23 +100,47 @@ function print() { __p += __j.call(arguments, '') }
78
100
  `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
79
101
 
80
102
  `,`1) content: element.innerHTML
81
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var c=a.reduce(function(f,d){var g=d&&fm(d,i);return g&&f.push(g),f},[]);return pa(r)?c[0]:c}ga.defaultProps=ar,ga.setDefaultProps=um,ga.currentInput=ii,Object.assign({},bf,{effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow)}}),ga.setDefaultProps({render:sp});let pm=0;const ji=ga(document.body,{theme:"translucent",animation:"scale",inertia:!0,delay:[200,100],content:"",allowHTML:!0,placement:"left-start",trigger:"manual",arrow:!0});class fl{constructor(t,e){this.container=t,this.text=e,t?this.container=t:this.container=document.getElementsByTagName("body")[0],this.text=e}name="Label";id="Label"+pm++;el;position=new F;get isMounted(){return ji.state.isMounted}get isShown(){return ji.state.isShown}destroy(){this.text="",this.position.identity()}setHtml(t=""){return this.text=t,this}update(t){t&&(this.position.copy(t),ji.show())}async show(t){if(t)return await this.hide(),this.position.copy(t),ji.setContent(this.text),ji.setProps({getReferenceClientRect:()=>({width:0,height:0,right:this.position.x,left:this.position.x,bottom:this.position.y,top:this.position.y,x:this.position.x,y:this.position.y,toJSON(){}})}),ji.clearDelayTimeouts(),ji.show(),new Promise(e=>{Mt.delay(function(){e()},300)})}async hide(){return ji.hide(),new Promise(t=>{Mt.delay(function(){t()},100)})}}let dm=0;class gm extends Ge{name="DummyPoint";id="dummyPoint"+dm++;container;offset=new F;el;label;radius=10;position=new F;worldPosition=new F;userData;constructor(t,e){var a,o;super(),t?this.container=t:this.container=document.getElementsByTagName("body")[0];let i=this.container.getBoundingClientRect();this.offset.set(i.left,i.top),this.userData=e,(a=this.userData)!=null&&a.type||Mt.set(this,"userData.type",_n.DEFAULT),this.initDom(),this.setType((o=this.userData)==null?void 0:o.type),this.mount(),this.initLabel()}destroy(){var t;super.destroy(),this.unmount(),(t=this.label)==null||t.destroy()}get isMounted(){var t;return!!((t=this.el)!=null&&t.parentNode)}mount(){var t;this.el&&((t=this.el)!=null&&t.parentNode||this.container.appendChild(this.el))}unmount(){var t,e,i,a;(e=(t=this.el)==null?void 0:t.parentNode)==null||e.removeChild(this.el),(i=this.el)==null||i.remove(),(a=this.label)==null||a.hide()}setText(t=""){return this.el?(this.el.innerText=t,this):this}initDom(){var t;this.el=document.createElement("div"),this.el.setAttribute("id",this.id),this.el.setAttribute("class","dummy-point"),this.el.setAttribute(as+"-id",(t=this.userData)==null?void 0:t.value)}initLabel(){var t;(t=this.userData)!=null&&t.label&&(this.label=new fl(this.container,this.userData.label))}setActive(t){return t?(ra(this.el,"active"),this.showLabel()):(ia(this.el,"active"),this.hideLabel()),this}showLabel(){var t;(t=this.label)==null||t.show(ym.copy(this.position).add(this.offset).subScalar(this.radius))}hideLabel(){var t;(t=this.label)==null||t.hide()}setType(t){var i;if(!this.userData)return this;const e=(i=this.userData)==null?void 0:i.type;return t||(t=_n.DEFAULT),e&&uo(this.el,e)&&ia(this.el,e),this.userData.type=t,ra(this.el,this.userData.type),this}update(t,e=!1){!t||!this.isMounted||(e||t.subScalar(this.radius).round(),this.position.copy(t),this.el.style.transform=`translate3D(${this.position.x}px, ${this.position.y}px, 0)`)}}const ym=new F;let mm=0;class vm extends Ge{name="DummyRect";id="dummyRect"+mm++;container;offset=new F;el;radius=10;position=new F;worldPosition=new F;label;userData;constructor(t,e){super(),t?this.container=t:this.container=document.getElementsByTagName("body")[0];let i=this.container.getBoundingClientRect();this.offset.set(i.left,i.top),this.userData=e,this.initDom(),this.mount(),this.initLabel()}destroy(){var t;super.destroy(),this.unmount(),(t=this.label)==null||t.destroy()}get isMounted(){var t;return!!((t=this.el)!=null&&t.parentNode)}mount(){this.container.appendChild(this.el)}unmount(){var t,e,i,a;this.setText(""),(e=(t=this.el)==null?void 0:t.parentNode)==null||e.removeChild(this.el),(i=this.el)==null||i.remove(),(a=this.label)==null||a.hide()}initDom(){var t;this.el=document.createElement("div"),this.el.setAttribute("id",this.id),this.el.setAttribute("class","dummy-rect"),this.el.setAttribute(as+"-id",((t=this.userData)==null?void 0:t.rmId)||"undefined")}initLabel(){this.label=new fl(this.container,"")}setText(t=""){return this.el.innerText=t,this}setActive(t){return t?ra(this.el,"active"):ia(this.el,"active"),this}showLabel(){var t;(t=this.label)==null||t.show(xm.copy(this.position).add(this.offset).subScalar(this.radius))}hideLabel(){var t;(t=this.label)==null||t.hide()}setType(t){var i;if(!this.userData)return this;const e=(i=this.userData)==null?void 0:i.type;return t=_n.DEFAULT,e&&uo(this.el,e)&&ia(this.el,e),this.userData.type=t,ra(this.el,this.userData.type),this}update(t,e=!1){!t||!this.isMounted||(e||t.subScalar(this.radius).round(),this.position.copy(t),this.el.style.transform=`translate3D(${this.position.x}px, ${this.position.y}px, 0)`)}}const xm=new F;class Em extends Ge{name="Dummies";container;controller;scene;viewMatrix=new ne;dummies=[];rmMap=new Map;mergedMap=new Map;cameraUpdateHandler=this.handleCameraUpdate.bind(this);controllerTapHandler=this.handleControllerTap.bind(this);constructor(t,e){super(),this.container=t,this.controller=e,this.bindEvents()}destroy(){this.unbindEvents(),super.destroy(),this.clearDummies()}bindEvents(){this.controller.camera.addEventListener(lo.UPDATE,this.cameraUpdateHandler),this.controller.addEventListener(ot.TAP,this.controllerTapHandler)}unbindEvents(){this.controller.camera.removeEventListener(lo.UPDATE,this.cameraUpdateHandler),this.controller.removeEventListener(ot.TAP,this.controllerTapHandler)}bindScene(t){this.scene=t}update(t){var e,i,a;if(t){this.viewMatrix.copy(t);for(let o=0,l=(this.dummies||[]).length;o<l;o++){const c=this.dummies[o],f=(i=this.scene)==null?void 0:i.getElementById((e=c.userData)==null?void 0:e.rmId);if(f){const d=(a=this.scene)==null?void 0:a.chef.getElementBoundingBox(f.id);d==null||d.getCenter(Ji),Ji.applyMatrix3(this.viewMatrix).round(),c.position.copy(Ji)}else Ji.copy(c.worldPosition).applyMatrix3(this.viewMatrix).round(),c.update(Ji)}this.mergeDummies()}}setDummies(t){this.clearDummies();for(let e=0,i=(t||[]).length;e<i;e++)this.addDummy(t[e])}addDummy(t){var a,o;const e=new gm(this.container,t);this.dummies.push(e);const i=(a=e.userData)==null?void 0:a.rmId;return i&&(this.rmMap.has(i)||this.rmMap.set(i,[]),(o=this.rmMap.get(i))==null||o.push(e)),e}removeDummy(t){var a;const e=this.dummies.indexOf(t);e>-1&&this.dummies.splice(e,1);const i=(a=t.userData)==null?void 0:a.rmId;if(i){const o=this.mergedMap.get(i);o==null||o.destroy(),this.mergedMap.delete(i);const l=this.rmMap.get(i);if(!l)return;if(l.length===1)this.rmMap.delete(i);else{const c=l.indexOf(t);c>-1&&(l.splice(c,1),this.rmMap.set(i,l))}}t.destroy()}clearDummies(t){var e,i,a;for(let o=(((e=this.dummies)==null?void 0:e.length)||0)-1;o>=0;o--){const l=this.dummies[o];(!t||(i=l==null?void 0:l.userData)!=null&&i.type&&(t!=null&&t.includes((a=l.userData)==null?void 0:a.type)))&&this.removeDummy(l)}t||(this.dummies.length=0,this.mergedMap.clear(),this.rmMap.clear())}mergeDummies(){this.rmMap.forEach((t,e)=>{var a,o,l,c;if((a=this.scene)==null?void 0:a.getElementById(e)){const f=(o=this.scene)==null?void 0:o.chef.getElementBoundingBox(e);if(!f)return;pl.copy(f).applyMatrix3(this.viewMatrix).round(),pl.getSize(Ji);const d=t[0].radius,g=pl.centralArrange(t.length,d*2,d*2);if(Ji.x<d*3||Ji.y<d*3){t.forEach(_=>_.unmount());const E=this.mergedMap.get(e);E==null||E.unmount()}else if(Array.isArray(g))this.mergedMap.has(e)&&((l=this.mergedMap.get(e))==null||l.unmount()),t.forEach((E,_)=>{E.isMounted||E.mount(),E.update(g[_])});else{t.forEach(C=>C.unmount());let E=this.mergedMap.get(e);if(E)E.isMounted||E.mount();else{const C=Mt.cloneDeep(t[0].userData)||{},R=Mt.reduce(t,(M,I)=>{var W,G;return(W=I.userData)!=null&&W.label&&M.push((G=I.userData)==null?void 0:G.label),M},[]);C.label=R.join(", ");const N=Mt.reduce(t,(M,I)=>{var W,G;return(W=I.userData)!=null&&W.value&&M.push((G=I.userData)==null?void 0:G.value),M},[]);C.value=N.join(","),C.rmId=e,E=new vm(this.container,C),this.mergedMap.set(e,E)}E.setText(t.length.toString());const _=Mt.reduce(t,(C,R)=>{var N,M;return(N=R.userData)!=null&&N.label&&C.push((M=R.userData)==null?void 0:M.label),C},[]);(c=E.label)==null||c.setHtml(_.join(", <br />")),E.update(t[0].position)}}})}getDummyById(t){return this.dummies.find(e=>{var i;return((i=e.userData)==null?void 0:i.value)===t})}setActiveByIds(t){var e,i;if(this.resetActives(),!!t&&(Array.isArray(t)||(t=[t]),!!(t!=null&&t.length)))for(let a=0,o=t.length;a<o;a++){const l=this.getDummyById(t[a]);if(l&&l.setActive(!0),l&&((e=l.userData)!=null&&e.rmId)){const c=this.mergedMap.get((i=l.userData)==null?void 0:i.rmId);c&&c.setActive(!0)}}}resetActives(){this.dummies.forEach(t=>t.setActive(!1)),this.mergedMap.forEach(t=>t.setActive(!1))}showDummyLabel(t){if(!t)return;const e=this.getDummyById(t);e&&e.showLabel();const i=this.mergedMap.get(t);i&&i.showLabel()}async hideDummyLabel(){this.dummies.forEach(t=>t.hideLabel()),this.mergedMap.forEach(t=>t.hideLabel())}handleCameraUpdate(){this.update(this.controller.camera.viewMatrix)}handleControllerTap(t){var a,o,l,c,f;if((t==null?void 0:t.type)!==ot.TAP)return;const e=((a=t==null?void 0:t.e)==null?void 0:a.target)||((l=(o=t==null?void 0:t.e)==null?void 0:o.srcEvent)==null?void 0:l.target)||((f=(c=t==null?void 0:t.e)==null?void 0:c.srcEvent)==null?void 0:f.srcElement),i=e==null?void 0:e.getAttribute(as+"-id");i&&console.warn("【TODO】handleControllerTap: ",i)}}const Ji=new F,pl=new Dt;(function(){return window[Qi.prefixed(window,"requestAnimationFrame")]||function(r){window.setTimeout(r,1e3/60)}})();class Am extends Ge{name="DragController";dragFake=!1;container;offset=new F;controller;scene;raycaster;dummies;_els=[];_hms=new Map;_vos=new Map;_elMap=new Map;_panType=_n.SUCCESS;onPanHandler=this.handleOnPan.bind(this);panEndHandler=Mt.debounce(this.handlePanEnd.bind(this),500);constructor(t,e,i=!0){super(),this.container=t;let a=this.container.getBoundingClientRect();this.offset.set(a.left,a.top),this.controller=e,this.dummies=new Em(t,e),this.raycaster=new xf,this.dragFake=i}destroy(){var t;super.destroy();for(let e=(((t=this._els)==null?void 0:t.length)||0)-1;e>=0;e--)this.drop(this._els[e]);this.dummies.destroy()}bindScene(t){var e;this.scene=t,(e=this.dummies)==null||e.bindScene(t)}drag(t,e){t&&(this._els.includes(t)||(this.bindEvent(t),this._els.push(t),this._vos.set(t,e)))}drop(t){if(!t)return;this.unbindEvent(t),this._vos.delete(t),this._elMap.delete(t);const e=this._els.findIndex(i=>i===t);e>-1&&this._els.splice(e,1)}bindEvent(t){if(!t)return;const e=new Qi.Manager(t,{domEvents:!0});e.add(new Qi.Pan({threshold:0,pointers:0})),e.on(["panstart","panmove","panend"].join(" "),this.onPanHandler),this._hms.set(t,e)}unbindEvent(t){if(!t)return;const e=this._hms.get(t);e&&(e.off(["panstart","panmove","panend"].join(" "),this.onPanHandler),e.destroy(),this._hms.delete(t))}handleOnPan(t){if(typeof t.preventDefault=="function"&&t.preventDefault(),typeof t.srcEvent.stopPropagation=="function"&&t.srcEvent.stopPropagation(),typeof t.srcEvent.stopImmediatePropagation=="function"&&t.srcEvent.stopImmediatePropagation(),!this.controller)return;t.type==="panstart"||t.isFirst?this.controller.enablePan=!1:t.type==="panmove"||t.type==="panend"&&(this.controller.enablePan=!0);const e=this._vos.get(t.target);if(!e)return;const i=Mt.cloneDeep(e);i.type=this._panType;const a=this._getDummy(t.target,i);ya.set(t.center.x,t.center.y).sub(this.offset),a.worldPosition.copy(ya).unproject(this.controller.camera),a.update(ya),this.panEndHandler({type:"panend",e:t})}handlePanEnd(t){if((t==null?void 0:t.type)!=="panend")return;const e=this.getDummies(!0);this.dispatchEvent({type:"panend",data:e})}getDummies(t=!0){const e=[];return this._els.forEach(i=>{var o;let a=this._vos.get(i);if(!(!a||a.type!==_n.SUCCESS)){if(t){const l=this._elMap.get(i);if(!l||!this.controller.camera)return;ya.copy(l.position),this.raycaster.setFromCamera(ya,this.controller.camera);const c=[];if((o=this.scene)==null||o.getIntersectObjects(this.raycaster,$e.RM,c),!(c!=null&&c.length))return;a=Mt.cloneDeep(a),a.rmId=c[0].id}e.push(a)}}),e}setDummiesByVos(t){var e,i;for(let a=0,o=(t||[]).length;a<o;a++){const l=(e=this.dummies)==null?void 0:e.addDummy(t[a]);if(!l)continue;const c=Mt.cloneDeep(t[a]);delete c.rmId,delete c.wsId,this.drag(l.el,c)}(i=this.dummies)==null||i.update(this.controller.camera.viewMatrix)}clearDummies(t){var e,i;for(let a=(((e=this._els)==null?void 0:e.length)||0)-1;a>=0;a--){const o=this._vos.get(this._els[a]);(!t||t&&(o!=null&&o.type)&&t.includes(o.type))&&this.drop(this._els[a])}(i=this.dummies)==null||i.clearDummies(t)}getDummyById(t){return this.dummies.getDummyById(t)}highlightDummies(t){var e;(e=this.dummies)==null||e.setActiveByIds(t)}resetHighlightDummies(){var t;(t=this.dummies)==null||t.resetActives()}showDummyLabel(t){var e;(e=this.dummies)==null||e.showDummyLabel(t)}start(){}_getDummy(t,e){let i=this._elMap.get(t);if(i||(i=this.dummies.addDummy(e).setType(_n.SUCCESS),this._elMap.set(t,i)),i.isMounted||i.mount(),this.dummies.dummies.includes(i)||this.dummies.dummies.push(i),!this._elMap.get(i.el)){this._elMap.set(i.el,i);const o=Mt.cloneDeep(e);delete o.rmId,delete o.wsId,this.drag(i.el,o)}return i}}const ya=new F;var ps=Object.freeze({Linear:Object.freeze({None:function(r){return r},In:function(r){return r},Out:function(r){return r},InOut:function(r){return r}}),Quadratic:Object.freeze({In:function(r){return r*r},Out:function(r){return r*(2-r)},InOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)}}),Cubic:Object.freeze({In:function(r){return r*r*r},Out:function(r){return--r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)}}),Quartic:Object.freeze({In:function(r){return r*r*r*r},Out:function(r){return 1- --r*r*r*r},InOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)}}),Quintic:Object.freeze({In:function(r){return r*r*r*r*r},Out:function(r){return--r*r*r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)}}),Sinusoidal:Object.freeze({In:function(r){return 1-Math.sin((1-r)*Math.PI/2)},Out:function(r){return Math.sin(r*Math.PI/2)},InOut:function(r){return .5*(1-Math.sin(Math.PI*(.5-r)))}}),Exponential:Object.freeze({In:function(r){return r===0?0:Math.pow(1024,r-1)},Out:function(r){return r===1?1:1-Math.pow(2,-10*r)},InOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)}}),Circular:Object.freeze({In:function(r){return 1-Math.sqrt(1-r*r)},Out:function(r){return Math.sqrt(1- --r*r)},InOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)}}),Elastic:Object.freeze({In:function(r){return r===0?0:r===1?1:-Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI)},Out:function(r){return r===0?0:r===1?1:Math.pow(2,-10*r)*Math.sin((r-.1)*5*Math.PI)+1},InOut:function(r){return r===0?0:r===1?1:(r*=2,r<1?-.5*Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI):.5*Math.pow(2,-10*(r-1))*Math.sin((r-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(r){var t=1.70158;return r===1?1:r*r*((t+1)*r-t)},Out:function(r){var t=1.70158;return r===0?0:--r*r*((t+1)*r+t)+1},InOut:function(r){var t=2.5949095;return(r*=2)<1?.5*(r*r*((t+1)*r-t)):.5*((r-=2)*r*((t+1)*r+t)+2)}}),Bounce:Object.freeze({In:function(r){return 1-ps.Bounce.Out(1-r)},Out:function(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},InOut:function(r){return r<.5?ps.Bounce.In(r*2)*.5:ps.Bounce.Out(r*2-1)*.5+.5}}),generatePow:function(r){return r===void 0&&(r=4),r=r<Number.EPSILON?Number.EPSILON:r,r=r>1e4?1e4:r,{In:function(t){return Math.pow(t,r)},Out:function(t){return 1-Math.pow(1-t,r)},InOut:function(t){return t<.5?Math.pow(t*2,r)/2:(1-Math.pow(2-t*2,r))/2+.5}}}}),ds=function(){return performance.now()},ap=function(){function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return r.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},r.prototype.removeAll=function(){this._tweens={}},r.prototype.add=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var a=0,o=e;a<o.length;a++){var l=o[a];(t=l._group)===null||t===void 0||t.remove(l),l._group=this,this._tweens[l.getId()]=l,this._tweensAddedDuringUpdate[l.getId()]=l}},r.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,a=t;i<a.length;i++){var o=a[i];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},r.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},r.prototype.update=function(t,e){t===void 0&&(t=ds()),e===void 0&&(e=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var a=0;a<i.length;a++){var o=this._tweens[i[a]],l=!e;o&&o.update(t,l)===!1&&!e&&this.remove(o)}i=Object.keys(this._tweensAddedDuringUpdate)}},r}(),On={Linear:function(r,t){var e=r.length-1,i=e*t,a=Math.floor(i),o=On.Utils.Linear;return t<0?o(r[0],r[1],i):t>1?o(r[e],r[e-1],e-i):o(r[a],r[a+1>e?e:a+1],i-a)},Bezier:function(r,t){for(var e=0,i=r.length-1,a=Math.pow,o=On.Utils.Bernstein,l=0;l<=i;l++)e+=a(1-t,i-l)*a(t,l)*r[l]*o(i,l);return e},CatmullRom:function(r,t){var e=r.length-1,i=e*t,a=Math.floor(i),o=On.Utils.CatmullRom;return r[0]===r[e]?(t<0&&(a=Math.floor(i=e*(1+t))),o(r[(a-1+e)%e],r[a],r[(a+1)%e],r[(a+2)%e],i-a)):t<0?r[0]-(o(r[0],r[0],r[1],r[1],-i)-r[0]):t>1?r[e]-(o(r[e],r[e],r[e-1],r[e-1],i-e)-r[e]):o(r[a?a-1:0],r[a],r[e<a+1?e:a+1],r[e<a+2?e:a+2],i-a)},Utils:{Linear:function(r,t,e){return(t-r)*e+r},Bernstein:function(r,t){var e=On.Utils.Factorial;return e(r)/e(t)/e(r-t)},Factorial:function(){var r=[1];return function(t){var e=1;if(r[t])return r[t];for(var i=t;i>1;i--)e*=i;return r[t]=e,e}}(),CatmullRom:function(r,t,e,i,a){var o=(e-r)*.5,l=(i-t)*.5,c=a*a,f=a*c;return(2*t-2*e+o+l)*f+(-3*t+3*e-2*o-l)*c+o*a+t}}},dl=function(){function r(){}return r.nextId=function(){return r._nextId++},r._nextId=0,r}(),gl=new ap,wm=function(){function r(t,e){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=ps.Linear.None,this._interpolationFunction=On.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=dl.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof e=="object"?(this._group=e,e.add(this)):e===!0&&(this._group=gl,gl.add(this))}return r.prototype.getId=function(){return this._id},r.prototype.isPlaying=function(){return this._isPlaying},r.prototype.isPaused=function(){return this._isPaused},r.prototype.getDuration=function(){return this._duration},r.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},r.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},r.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},r.prototype.start=function(t,e){if(t===void 0&&(t=ds()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var a={};for(var o in this._valuesEnd)a[o]=this._valuesEnd[o];this._valuesEnd=a}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},r.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},r.prototype._setupProperties=function(t,e,i,a,o){for(var l in i){var c=t[l],f=Array.isArray(c),d=f?"array":typeof c,g=!f&&Array.isArray(i[l]);if(!(d==="undefined"||d==="function")){if(g){var E=i[l];if(E.length===0)continue;for(var _=[c],C=0,R=E.length;C<R;C+=1){var N=this._handleRelativeValue(c,E[C]);if(isNaN(N)){g=!1,console.warn("Found invalid interpolation list. Skipping.");break}_.push(N)}g&&(i[l]=_)}if((d==="object"||f)&&c&&!g){e[l]=f?[]:{};var M=c;for(var I in M)e[l][I]=M[I];a[l]=f?[]:{};var E=i[l];if(!this._isDynamic){var W={};for(var I in E)W[I]=E[I];i[l]=E=W}this._setupProperties(M,e[l],E,a[l],o)}else(typeof e[l]>"u"||o)&&(e[l]=c),f||(e[l]*=1),g?a[l]=i[l].slice().reverse():a[l]=e[l]||0}}},r.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},r.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},r.prototype.pause=function(t){return t===void 0&&(t=ds()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},r.prototype.resume=function(t){return t===void 0&&(t=ds()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},r.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},r.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},r.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},r.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},r.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},r.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},r.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},r.prototype.easing=function(t){return t===void 0&&(t=ps.Linear.None),this._easingFunction=t,this},r.prototype.interpolation=function(t){return t===void 0&&(t=On.Linear),this._interpolationFunction=t,this},r.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},r.prototype.onStart=function(t){return this._onStartCallback=t,this},r.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},r.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},r.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},r.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},r.prototype.onStop=function(t){return this._onStopCallback=t,this},r.prototype.update=function(t,e){var i=this,a;if(t===void 0&&(t=ds()),e===void 0&&(e=r.autoStartOnUpdate),this._isPaused)return!0;var o;if(!this._goToEnd&&!this._isPlaying)if(e)this.start(t,!0);else return!1;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);var l=t-this._startTime,c=this._duration+((a=this._repeatDelayTime)!==null&&a!==void 0?a:this._delayTime),f=this._duration+this._repeat*c,d=function(){if(i._duration===0||l>f)return 1;var N=Math.trunc(l/c),M=l-N*c,I=Math.min(M/i._duration,1);return I===0&&l===i._duration?1:I},g=d(),E=this._easingFunction(g);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,E),this._onUpdateCallback&&this._onUpdateCallback(this._object,g),this._duration===0||l>=this._duration)if(this._repeat>0){var _=Math.min(Math.trunc((l-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=_);for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=c*_,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var C=0,R=this._chainedTweens.length;C<R;C++)this._chainedTweens[C].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},r.prototype._updateProperties=function(t,e,i,a){for(var o in i)if(e[o]!==void 0){var l=e[o]||0,c=i[o],f=Array.isArray(t[o]),d=Array.isArray(c),g=!f&&d;g?t[o]=this._interpolationFunction(c,a):typeof c=="object"&&c?this._updateProperties(t[o],l,c,a):(c=this._handleRelativeValue(l,c),typeof c=="number"&&(t[o]=l+(c-l)*a))}},r.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},r.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},r.autoStartOnUpdate=!1,r}(),bm="25.0.0",Tm=dl.nextId,ni=gl,_m=ni.getAll.bind(ni),Cm=ni.removeAll.bind(ni),Dm=ni.add.bind(ni),Sm=ni.remove.bind(ni),Om=ni.update.bind(ni),mo={Easing:ps,Group:ap,Interpolation:On,now:ds,Sequence:dl,nextId:Tm,Tween:wm,VERSION:bm,getAll:_m,removeAll:Cm,add:Dm,remove:Sm,update:Om};class Nm extends Ge{name="View";params;visible=!0;cvs;scene;scenes=[];camera;controller;tween;animateDuration;constructor(t={}){super(),this.params=t,this.animateDuration=this.params.animateDuration||300,this.cvs=t.cvs,this.camera=new mf(t.camera||{})}destroy(){this.controller&&this.controller.destroy(),this.camera&&this.camera.destroy(),this.scene&&this.scene.destroy(),this.scenes.forEach(t=>t.destroy()),this.scenes.length=0,super.destroy()}bindScene(t){this.scenes.push(t),this.reset(),this.scene=t,t.isStatic}saveCameraPosition(t){gs.copy(this.camera.boundingBoxWorld);const e=t?Er+t:Er;sessionStorage.setItem(e,JSON.stringify(gs))}clearCameraPosition(t){const e=t?Er+t:Er;sessionStorage.setItem(e,"")}restoreCameraPosition(t){const e=t?Er+t:Er,i=sessionStorage.getItem(e);i&&(gs.copy(JSON.parse(i)),this.resetCameraByBoundingBox(gs,!0))}fullscreen(t=10,e=!1){this.scene&&(this.scene.boundingBox.isEmpty()&&this.scene.computeBoundingBox(),gs.copy(this.scene.boundingBox).expandByVector(vo.set(t,t)),this.resetCameraByBoundingBox(gs,e))}handleCameraChanged(t){console.warn("handleCameraChanged: ",t.target.camera.position.z,t.target.camera.scaled.x)}reset(){}async resetCameraByBoundingBox(t,e=!1){if(!this.camera)return;if(!t||t.isEmpty())throw new Error("BoundingBox empty");if(!e)return this.camera.setByBox(t),Promise.resolve();const i=this.camera.getCameraPosition();t.getCenter(vo),t.getSize(yl);const a=Math.max(yl.x/this.camera.width,yl.y/this.camera.height),o={x:vo.x,y:vo.y,z:0,s:a,r:0};await this.animateCamera(i,o)}async animateCamera(t,e){return this.controller&&(this.controller.enabled=!1),this.tween&&this.tween.stop(),new Promise(i=>{this.tween=new mo.Tween(t).to(e,this.animateDuration).easing(mo.Easing.Exponential.Out).onUpdate(a=>{this.camera.position.set(a.x,a.y),this.camera.scaled.set(a.s,a.s),this.camera.rotation.set(a.r,a.r),this.camera.update()}).onComplete(()=>{this.controller&&(this.controller.enabled=!0),i()}).start()})}computeBoundingBox(t,e=new Dt){return!t||!t.length||(e.makeEmpty(),t.forEach(i=>e.union(i.computeBoundingBox()))),e}expandScenesBoundingBox(t,e=new Dt){t.forEach(i=>i.boundingBox.union(e))}update(t){this.tween&&this.tween.update(t)}}const Er="camera_position_",vo=new F,yl=new F,gs=new Dt;class Mm extends Ge{name="SvgView";params;container;offset=new F;camera;controller;scene;p1=new F;p2=new F;graph;multiSelector;dummiesController;zoomToSelectEnable=!1;zoomBox=new Dt;selectEnable=!1;multiSelectEnable=!1;tween;animateDuration;label;controllerPanStartHandler=this.handlePanStart.bind(this);controllerPanEndHandler=this.handlePanEnd.bind(this);controllerWheelStartHandler=this.handlePanStart.bind(this);controllerWheelEndHandler=this.handlePanEnd.bind(this);controllerPanMoveHandler=this.handleControllerPanMove.bind(this);controllerPointerOverHandler=this.handleControllerPointerOver.bind(this);multiSelectorSelectedHandler=this.handleMultiSelectorSelected.bind(this);_currentAssetId;constructor(t={}){super(),this.params=t,this.params.zoomToSelectEnable&&(this.zoomToSelectEnable=!0),this.params.selectEnable&&(this.selectEnable=!0),this.params.multiSelectEnable&&(this.multiSelectEnable=!0),this.params.camera||(this.params.camera={}),this.params.camera.flipY=!0,this.animateDuration=this.params.animateDuration||300,this.camera=new mf(this.params.camera),this.container=this.params.containerId?document.getElementById(this.params.containerId):kt.window.document.getElementsByTagName("body")[0];let e=this.container.getBoundingClientRect();this.offset.set(e.left,e.top),this.controller=new yf(this.container,this.camera,!0),this.graph=new $u(this.container),this.multiSelector=new B2(this.container,this.controller),this.dummiesController=new Am(this.container,this.controller),this.bindControllerEvents(),this.initLabel()}destroy(){var t;this.unbindControllerEvents(),super.destroy(),(t=this.label)==null||t.destroy()}initLabel(){this.label=new fl(this.container,"")}showAssetsLabel(t,e,i){var o,l,c,f,d;if(!e)return;t||(t=(o=this.scene)==null?void 0:o.assetType);const a=(l=this.scene)==null?void 0:l.chef.getElementBoundingBox(e);a&&!a.isEmpty()&&(i||(i=(c=this.scene)==null?void 0:c.getAssetLabelById(t,e),i||(i=e)),(f=this.label)==null||f.setHtml(i),Nn.copy(a.min).applyMatrix3(this.camera.viewMatrix).add(this.offset).round(),(d=this.label)==null||d.show(Nn))}async hideAssetsLabel(){var t;return(t=this.label)==null?void 0:t.hide()}bindScene(t){var e;this.scene=t,this.multiSelector.bindScene(this.scene),(e=this.dummiesController)==null||e.bindScene(this.scene)}resize(){var t,e;(t=this.camera)==null||t.resize(),(e=this.controller)==null||e.resize(),console.log("【svgView】resize: ",this.params.width,this.params.height)}async setByBox(t,e=!0){await this.resetCameraByBoundingBox(t,e)}zoomIn(){this.controller.scaled=this.camera.scaled.x*.9,this.controller.update()}zoomOut(){this.controller.scaled=this.camera.scaled.x*1.1,this.controller.update()}zoomToSelectEnableChanged(t){console.log("TODO: zoomToSelectEnableChanged: ",t),this.zoomToSelectEnable=t,this.controller.enablePan=!this.zoomToSelectEnable}selectEnableChanged(t){this.selectEnable=!!t,this.multiSelector.selectEnableChanged(t)}multiSelectEnableChanged(t){this.multiSelectEnable=!!t,this.multiSelector.multiSelectEnableChanged(t)}getIntersectObjects(t,e,i=[]){return this.scene?this.scene.getIntersectObjects(t,e,i):i}async focusAt(t,e=500){return this.camera?(Xt.setFromCenterAndSize(t,Nn.set(e*2,e*2)),this.resetCameraByBoundingBox(Xt,!0)):Promise.resolve()}async focusAtById(t,e=500){var a;const i=(a=this.scene)==null?void 0:a.getBoundingBoxById(t);if(console.log("focusAtById: ",t,i==null?void 0:i.toString()),i){i.expandByScalar(e),Xt.copy(this.camera.boundingBoxWorld),Xt.containsBox(i)||await this.resetCameraByBoundingBox(i,!0);return}}async focusAtDummy(t,e=500){var o,l;const i=this.dummiesController.getDummyById(t),a=(o=i==null?void 0:i.userData)==null?void 0:o.rmId;if(a){const c=(l=this.scene)==null?void 0:l.getBoundingBoxById(a);if(c){c.expandByScalar(e),Xt.copy(this.camera.boundingBoxWorld),Xt.containsBox(c)||await this.resetCameraByBoundingBox(c,!0);return}}if(i!=null&&i.position&&!(i!=null&&i.position.isEmpty())){Xt.setFromCenterAndSize(i.worldPosition,Nn.set(e*2,e*2)),this.camera.boundingBoxWorld.containsBox(Xt)||await this.resetCameraByBoundingBox(Xt,!0);return}}async resetCameraByBoundingBox(t,e=!1){if(!this.camera)return Promise.resolve();if(!t||t.isEmpty())throw new Error("BoundingBox empty");if(!e)return this.camera.setByBox(t),Promise.resolve();const i=this.camera.getCameraPosition();t.getCenter(Nn),t.getSize(ml);const a=Math.max(ml.x/this.camera.width,ml.y/this.camera.height),o={x:Nn.x,y:Nn.y,z:0,s:a,r:0};await this.animateCamera(i,o)}async animateCamera(t,e){return this.controller&&(this.controller.enabled=!1),this.tween&&this.tween.stop(),new Promise(i=>{this.tween=new mo.Tween(t).to(e,this.animateDuration).easing(mo.Easing.Exponential.Out).onUpdate(a=>{this.camera.position.set(a.x,a.y),this.camera.scaled.set(a.s,a.s),this.camera.rotation.set(a.r,a.r),this.camera.update()}).onComplete(()=>{this.controller&&(this.controller.enabled=!0),i()}).start()})}fullscreen(){this.scene&&(this.scene&&!this.scene.viewBox.isEmpty()?Xt.copy(this.scene.viewBox):(this.scene.updateMatrixWorld(!0),this.scene.computeBoundingBox(),Xt.copy(this.scene.boundingBox)),this.resetCameraByBoundingBox(Xt,!0))}saveCameraPosition(t){Xt.copy(this.camera.boundingBoxWorld);const e=t?Er+t:Er;sessionStorage.setItem(e,JSON.stringify(Xt))}restoreCameraPosition(t){const e=t?Er+t:Er,i=sessionStorage.getItem(e);if(!i)return this.fullscreen();Xt.copy(JSON.parse(i)),this.resetCameraByBoundingBox(Xt,!0)}clearCameraPosition(t){const e=t?Er+t:Er;sessionStorage.setItem(e,"")}bindControllerEvents(){this.controller.addEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.addEventListener(ot.PAN_END,this.controllerPanEndHandler),this.controller.addEventListener(ot.WHEEL_START,this.controllerWheelStartHandler),this.controller.addEventListener(ot.WHEEL_END,this.controllerWheelEndHandler),this.controller.addEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.addEventListener(ot.POINTEROVER,this.controllerPointerOverHandler),this.multiSelector.addEventListener(Xu.SELECTED,this.multiSelectorSelectedHandler)}unbindControllerEvents(){this.controller.removeEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.removeEventListener(ot.PAN_END,this.controllerPanEndHandler),this.controller.removeEventListener(ot.WHEEL_START,this.controllerWheelStartHandler),this.controller.removeEventListener(ot.WHEEL_END,this.controllerWheelEndHandler),this.controller.removeEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.removeEventListener(ot.POINTEROVER,this.controllerPointerOverHandler),this.multiSelector.removeEventListener(Xu.SELECTED,this.multiSelectorSelectedHandler)}handlePanStart(t){if(!((t==null?void 0:t.type)!==ot.PAN_START&&(t==null?void 0:t.type)!==ot.WHEEL_START)&&this.zoomToSelectEnable){this.p1.copy(t.data.screenCoords),Xt.makeEmpty().expandByPoint(this.p1),this.graph.draw(Xt);return}}handlePanEnd(t){if(!((t==null?void 0:t.type)!==ot.PAN_END&&(t==null?void 0:t.type)!==ot.WHEEL_END)&&this.zoomToSelectEnable){this.p2.copy(t.data.screenCoords),Xt.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2).unproject(this.controller.camera),this.setByBox(Xt),this.graph.hide(),Xt.makeEmpty();return}}handleControllerPanMove(t){(t==null?void 0:t.type)===ot.PAN_MOVE&&this.zoomToSelectEnable&&(this.p2.copy(t.data.screenCoords),Xt.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2),this.graph.draw(Xt))}handleControllerPointerOver(t){var a,o,l,c,f;const e=((a=t==null?void 0:t.e)==null?void 0:a.target)||((l=(o=t==null?void 0:t.e)==null?void 0:o.srcEvent)==null?void 0:l.target);let i=e==null?void 0:e.id;(i==null?void 0:i.indexOf("dummy"))>-1?(i=e.getAttribute(as+"-id"),i&&this._currentAssetId!==i&&this.dispatchEvent({type:"POINTEROVER",data:{id:i,assetType:"dummy"},e:t.e})):i&&((c=this.scene)!=null&&c.isBelongsToAssetType(i,$e.WS))?this._currentAssetId!==i&&this.dispatchEvent({type:"POINTEROVER",data:{id:i,assetType:$e.WS},e:t.e}):i&&((f=this.scene)!=null&&f.isBelongsToAssetType(i,$e.RM))?this._currentAssetId!==i&&this.dispatchEvent({type:"POINTEROVER",data:{id:i,assetType:$e.RM},e:t.e}):(this._currentAssetId=void 0,this.dispatchEvent({type:"POINTERLEAVE",e:t.e})),this._currentAssetId=i}handleMultiSelectorSelected(t){console.warn("handleMultiSelectorSelected:",t.data),this.dispatchEvent({type:"SELECTED",data:t.data})}setDummies(t){this.dummiesController.setDummiesByVos(t)}clearDummies(t){this.dummiesController.clearDummies(t)}update(t){this.tween&&this.tween.update(t)}}const Xt=new Dt,Nn=new F,ml=new F;var Mn=(r=>(r.SELECTED="SELECTED",r.POINTEROVER="POINTEROVER",r.POINTERLEAVE="POINTERLEAVE",r))(Mn||{});class Lm extends zu{name="SvgEmptyScene";constructor(t){super(t),this.bind(`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-20 10 78 22">
82
- <view id="defaultView" viewBox="0 0 78 22" />
103
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var c=a.reduce(function(f,d){var g=d&&fm(d,i);return g&&f.push(g),f},[]);return pa(r)?c[0]:c}ga.defaultProps=ar,ga.setDefaultProps=um,ga.currentInput=ii,Object.assign({},bf,{effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow)}}),ga.setDefaultProps({render:sp});let pm=0;const ji=ga(document.body,{theme:"translucent",animation:"scale",inertia:!0,delay:[200,100],content:"",allowHTML:!0,placement:"left-start",trigger:"manual",arrow:!0});class fl{constructor(t,e){this.container=t,this.text=e,t?this.container=t:this.container=document.getElementsByTagName("body")[0],this.text=e}name="Label";id="Label"+pm++;el;position=new F;get isMounted(){return ji.state.isMounted}get isShown(){return ji.state.isShown}destroy(){this.text="",this.position.identity()}setHtml(t=""){return this.text=t,this}update(t){t&&(this.position.copy(t),ji.show())}async show(t){if(t)return await this.hide(),this.position.copy(t),ji.setContent(this.text),ji.setProps({getReferenceClientRect:()=>({width:0,height:0,right:this.position.x,left:this.position.x,bottom:this.position.y,top:this.position.y,x:this.position.x,y:this.position.y,toJSON(){}})}),ji.clearDelayTimeouts(),ji.show(),new Promise(e=>{Mt.delay(function(){e()},300)})}async hide(){return ji.hide(),new Promise(t=>{Mt.delay(function(){t()},100)})}}let dm=0;class gm extends Ge{name="DummyPoint";id="dummyPoint"+dm++;container;offset=new F;el;label;radius=10;position=new F;worldPosition=new F;userData;constructor(t,e){var a,o;super(),t?this.container=t:this.container=document.getElementsByTagName("body")[0];let i=this.container.getBoundingClientRect();this.offset.set(i.left,i.top),this.userData=e,(a=this.userData)!=null&&a.type||Mt.set(this,"userData.type",_n.DEFAULT),this.initDom(),this.setType((o=this.userData)==null?void 0:o.type),this.mount(),this.initLabel()}destroy(){var t;super.destroy(),this.unmount(),(t=this.label)==null||t.destroy()}get isMounted(){var t;return!!((t=this.el)!=null&&t.parentNode)}mount(){var t;this.el&&((t=this.el)!=null&&t.parentNode||this.container.appendChild(this.el))}unmount(){var t,e,i,a;(e=(t=this.el)==null?void 0:t.parentNode)==null||e.removeChild(this.el),(i=this.el)==null||i.remove(),(a=this.label)==null||a.hide()}setText(t=""){return this.el?(this.el.innerText=t,this):this}initDom(){var t;this.el=document.createElement("div"),this.el.setAttribute("id",this.id),this.el.setAttribute("class","dummy-point"),this.el.setAttribute(as+"-id",(t=this.userData)==null?void 0:t.value)}initLabel(){var t;(t=this.userData)!=null&&t.label&&(this.label=new fl(this.container,this.userData.label))}setActive(t){return t?(ra(this.el,"active"),this.showLabel()):(ia(this.el,"active"),this.hideLabel()),this}showLabel(){var t;(t=this.label)==null||t.show(ym.copy(this.position).add(this.offset).subScalar(this.radius))}hideLabel(){var t;(t=this.label)==null||t.hide()}setType(t){var i;if(!this.userData)return this;const e=(i=this.userData)==null?void 0:i.type;return t||(t=_n.DEFAULT),e&&uo(this.el,e)&&ia(this.el,e),this.userData.type=t,ra(this.el,this.userData.type),this}update(t,e=!1){!t||!this.isMounted||(e||t.subScalar(this.radius).round(),this.position.copy(t),this.el.style.transform=`translate3D(${this.position.x}px, ${this.position.y}px, 0)`)}}const ym=new F;let mm=0;class vm extends Ge{name="DummyRect";id="dummyRect"+mm++;container;offset=new F;el;radius=10;position=new F;worldPosition=new F;label;userData;constructor(t,e){super(),t?this.container=t:this.container=document.getElementsByTagName("body")[0];let i=this.container.getBoundingClientRect();this.offset.set(i.left,i.top),this.userData=e,this.initDom(),this.mount(),this.initLabel()}destroy(){var t;super.destroy(),this.unmount(),(t=this.label)==null||t.destroy()}get isMounted(){var t;return!!((t=this.el)!=null&&t.parentNode)}mount(){this.container.appendChild(this.el)}unmount(){var t,e,i,a;this.setText(""),(e=(t=this.el)==null?void 0:t.parentNode)==null||e.removeChild(this.el),(i=this.el)==null||i.remove(),(a=this.label)==null||a.hide()}initDom(){var t;this.el=document.createElement("div"),this.el.setAttribute("id",this.id),this.el.setAttribute("class","dummy-rect"),this.el.setAttribute(as+"-id",((t=this.userData)==null?void 0:t.rmId)||"undefined")}initLabel(){this.label=new fl(this.container,"")}setText(t=""){return this.el.innerText=t,this}setActive(t){return t?ra(this.el,"active"):ia(this.el,"active"),this}showLabel(){var t;(t=this.label)==null||t.show(xm.copy(this.position).add(this.offset).subScalar(this.radius))}hideLabel(){var t;(t=this.label)==null||t.hide()}setType(t){var i;if(!this.userData)return this;const e=(i=this.userData)==null?void 0:i.type;return t=_n.DEFAULT,e&&uo(this.el,e)&&ia(this.el,e),this.userData.type=t,ra(this.el,this.userData.type),this}update(t,e=!1){!t||!this.isMounted||(e||t.subScalar(this.radius).round(),this.position.copy(t),this.el.style.transform=`translate3D(${this.position.x}px, ${this.position.y}px, 0)`)}}const xm=new F;class Em extends Ge{name="Dummies";container;controller;scene;viewMatrix=new ne;dummies=[];rmMap=new Map;mergedMap=new Map;cameraUpdateHandler=this.handleCameraUpdate.bind(this);controllerTapHandler=this.handleControllerTap.bind(this);constructor(t,e){super(),this.container=t,this.controller=e,this.bindEvents()}destroy(){this.unbindEvents(),super.destroy(),this.clearDummies()}bindEvents(){this.controller.camera.addEventListener(lo.UPDATE,this.cameraUpdateHandler),this.controller.addEventListener(ot.TAP,this.controllerTapHandler)}unbindEvents(){this.controller.camera.removeEventListener(lo.UPDATE,this.cameraUpdateHandler),this.controller.removeEventListener(ot.TAP,this.controllerTapHandler)}bindScene(t){this.scene=t}update(t){var e,i,a;if(t){this.viewMatrix.copy(t);for(let o=0,l=(this.dummies||[]).length;o<l;o++){const c=this.dummies[o],f=(i=this.scene)==null?void 0:i.getElementById((e=c.userData)==null?void 0:e.rmId);if(f){const d=(a=this.scene)==null?void 0:a.chef.getElementBoundingBox(f.id);d==null||d.getCenter(Ji),Ji.applyMatrix3(this.viewMatrix).round(),c.position.copy(Ji)}else Ji.copy(c.worldPosition).applyMatrix3(this.viewMatrix).round(),c.update(Ji)}this.mergeDummies()}}setDummies(t){this.clearDummies();for(let e=0,i=(t||[]).length;e<i;e++)this.addDummy(t[e])}addDummy(t){var a,o;const e=new gm(this.container,t);this.dummies.push(e);const i=(a=e.userData)==null?void 0:a.rmId;return i&&(this.rmMap.has(i)||this.rmMap.set(i,[]),(o=this.rmMap.get(i))==null||o.push(e)),e}removeDummy(t){var a;const e=this.dummies.indexOf(t);e>-1&&this.dummies.splice(e,1);const i=(a=t.userData)==null?void 0:a.rmId;if(i){const o=this.mergedMap.get(i);o==null||o.destroy(),this.mergedMap.delete(i);const l=this.rmMap.get(i);if(!l)return;if(l.length===1)this.rmMap.delete(i);else{const c=l.indexOf(t);c>-1&&(l.splice(c,1),this.rmMap.set(i,l))}}t.destroy()}clearDummies(t){var e,i,a;for(let o=(((e=this.dummies)==null?void 0:e.length)||0)-1;o>=0;o--){const l=this.dummies[o];(!t||(i=l==null?void 0:l.userData)!=null&&i.type&&(t!=null&&t.includes((a=l.userData)==null?void 0:a.type)))&&this.removeDummy(l)}t||(this.dummies.length=0,this.mergedMap.clear(),this.rmMap.clear())}mergeDummies(){this.rmMap.forEach((t,e)=>{var a,o,l,c;if((a=this.scene)==null?void 0:a.getElementById(e)){const f=(o=this.scene)==null?void 0:o.chef.getElementBoundingBox(e);if(!f)return;pl.copy(f).applyMatrix3(this.viewMatrix).round(),pl.getSize(Ji);const d=t[0].radius,g=pl.centralArrange(t.length,d*2,d*2);if(Ji.x<d*3||Ji.y<d*3){t.forEach(_=>_.unmount());const E=this.mergedMap.get(e);E==null||E.unmount()}else if(Array.isArray(g))this.mergedMap.has(e)&&((l=this.mergedMap.get(e))==null||l.unmount()),t.forEach((E,_)=>{E.isMounted||E.mount(),E.update(g[_])});else{t.forEach(C=>C.unmount());let E=this.mergedMap.get(e);if(E)E.isMounted||E.mount();else{const C=Mt.cloneDeep(t[0].userData)||{},R=Mt.reduce(t,(M,I)=>{var W,G;return(W=I.userData)!=null&&W.label&&M.push((G=I.userData)==null?void 0:G.label),M},[]);C.label=R.join(", ");const N=Mt.reduce(t,(M,I)=>{var W,G;return(W=I.userData)!=null&&W.value&&M.push((G=I.userData)==null?void 0:G.value),M},[]);C.value=N.join(","),C.rmId=e,E=new vm(this.container,C),this.mergedMap.set(e,E)}E.setText(t.length.toString());const _=Mt.reduce(t,(C,R)=>{var N,M;return(N=R.userData)!=null&&N.label&&C.push((M=R.userData)==null?void 0:M.label),C},[]);(c=E.label)==null||c.setHtml(_.join(", <br />")),E.update(t[0].position)}}})}getDummyById(t){return this.dummies.find(e=>{var i;return((i=e.userData)==null?void 0:i.value)===t})}setActiveByIds(t){var e,i;if(this.resetActives(),!!t&&(Array.isArray(t)||(t=[t]),!!(t!=null&&t.length)))for(let a=0,o=t.length;a<o;a++){const l=this.getDummyById(t[a]);if(l&&l.setActive(!0),l&&((e=l.userData)!=null&&e.rmId)){const c=this.mergedMap.get((i=l.userData)==null?void 0:i.rmId);c&&c.setActive(!0)}}}resetActives(){this.dummies.forEach(t=>t.setActive(!1)),this.mergedMap.forEach(t=>t.setActive(!1))}showDummyLabel(t){if(!t)return;const e=this.getDummyById(t);e&&e.showLabel();const i=this.mergedMap.get(t);i&&i.showLabel()}async hideDummyLabel(){this.dummies.forEach(t=>t.hideLabel()),this.mergedMap.forEach(t=>t.hideLabel())}handleCameraUpdate(){this.update(this.controller.camera.viewMatrix)}handleControllerTap(t){var a,o,l,c,f;if((t==null?void 0:t.type)!==ot.TAP)return;const e=((a=t==null?void 0:t.e)==null?void 0:a.target)||((l=(o=t==null?void 0:t.e)==null?void 0:o.srcEvent)==null?void 0:l.target)||((f=(c=t==null?void 0:t.e)==null?void 0:c.srcEvent)==null?void 0:f.srcElement),i=e==null?void 0:e.getAttribute(as+"-id");i&&console.warn("【TODO】handleControllerTap: ",i)}}const Ji=new F,pl=new Dt;(function(){return window[Qi.prefixed(window,"requestAnimationFrame")]||function(r){window.setTimeout(r,1e3/60)}})();class Am extends Ge{name="DragController";dragFake=!1;container;offset=new F;controller;scene;raycaster;dummies;_els=[];_hms=new Map;_vos=new Map;_elMap=new Map;_panType=_n.SUCCESS;onPanHandler=this.handleOnPan.bind(this);panEndHandler=Mt.debounce(this.handlePanEnd.bind(this),500);constructor(t,e,i=!0){super(),this.container=t;let a=this.container.getBoundingClientRect();this.offset.set(a.left,a.top),this.controller=e,this.dummies=new Em(t,e),this.raycaster=new xf,this.dragFake=i}destroy(){var t;super.destroy();for(let e=(((t=this._els)==null?void 0:t.length)||0)-1;e>=0;e--)this.drop(this._els[e]);this.dummies.destroy()}bindScene(t){var e;this.scene=t,(e=this.dummies)==null||e.bindScene(t)}drag(t,e){t&&(this._els.includes(t)||(this.bindEvent(t),this._els.push(t),this._vos.set(t,e)))}drop(t){if(!t)return;this.unbindEvent(t),this._vos.delete(t),this._elMap.delete(t);const e=this._els.findIndex(i=>i===t);e>-1&&this._els.splice(e,1)}bindEvent(t){if(!t)return;const e=new Qi.Manager(t,{domEvents:!0});e.add(new Qi.Pan({threshold:0,pointers:0})),e.on(["panstart","panmove","panend"].join(" "),this.onPanHandler),this._hms.set(t,e)}unbindEvent(t){if(!t)return;const e=this._hms.get(t);e&&(e.off(["panstart","panmove","panend"].join(" "),this.onPanHandler),e.destroy(),this._hms.delete(t))}handleOnPan(t){if(typeof t.preventDefault=="function"&&t.preventDefault(),typeof t.srcEvent.stopPropagation=="function"&&t.srcEvent.stopPropagation(),typeof t.srcEvent.stopImmediatePropagation=="function"&&t.srcEvent.stopImmediatePropagation(),!this.controller)return;t.type==="panstart"||t.isFirst?this.controller.enablePan=!1:t.type==="panmove"||t.type==="panend"&&(this.controller.enablePan=!0);const e=this._vos.get(t.target);if(!e)return;const i=Mt.cloneDeep(e);i.type=this._panType;const a=this._getDummy(t.target,i);ya.set(t.center.x,t.center.y).sub(this.offset),a.worldPosition.copy(ya).unproject(this.controller.camera),a.update(ya),this.panEndHandler({type:"panend",e:t})}handlePanEnd(t){if((t==null?void 0:t.type)!=="panend")return;const e=this.getDummies(!0);this.dispatchEvent({type:"panend",data:e})}getDummies(t=!0){const e=[];return this._els.forEach(i=>{var o;let a=this._vos.get(i);if(!(!a||a.type!==_n.SUCCESS)){if(t){const l=this._elMap.get(i);if(!l||!this.controller.camera)return;ya.copy(l.position),this.raycaster.setFromCamera(ya,this.controller.camera);const c=[];if((o=this.scene)==null||o.getIntersectObjects(this.raycaster,$e.RM,c),!(c!=null&&c.length))return;a=Mt.cloneDeep(a),a.rmId=c[0].id}e.push(a)}}),e}setDummiesByVos(t){var e,i;for(let a=0,o=(t||[]).length;a<o;a++){const l=(e=this.dummies)==null?void 0:e.addDummy(t[a]);if(!l)continue;const c=Mt.cloneDeep(t[a]);delete c.rmId,delete c.wsId,this.drag(l.el,c)}(i=this.dummies)==null||i.update(this.controller.camera.viewMatrix)}clearDummies(t){var e,i;for(let a=(((e=this._els)==null?void 0:e.length)||0)-1;a>=0;a--){const o=this._vos.get(this._els[a]);(!t||t&&(o!=null&&o.type)&&t.includes(o.type))&&this.drop(this._els[a])}(i=this.dummies)==null||i.clearDummies(t)}getDummyById(t){return this.dummies.getDummyById(t)}highlightDummies(t){var e;(e=this.dummies)==null||e.setActiveByIds(t)}resetHighlightDummies(){var t;(t=this.dummies)==null||t.resetActives()}showDummyLabel(t){var e;(e=this.dummies)==null||e.showDummyLabel(t)}start(){}_getDummy(t,e){let i=this._elMap.get(t);if(i||(i=this.dummies.addDummy(e).setType(_n.SUCCESS),this._elMap.set(t,i)),i.isMounted||i.mount(),this.dummies.dummies.includes(i)||this.dummies.dummies.push(i),!this._elMap.get(i.el)){this._elMap.set(i.el,i);const o=Mt.cloneDeep(e);delete o.rmId,delete o.wsId,this.drag(i.el,o)}return i}}const ya=new F;var ps=Object.freeze({Linear:Object.freeze({None:function(r){return r},In:function(r){return r},Out:function(r){return r},InOut:function(r){return r}}),Quadratic:Object.freeze({In:function(r){return r*r},Out:function(r){return r*(2-r)},InOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)}}),Cubic:Object.freeze({In:function(r){return r*r*r},Out:function(r){return--r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)}}),Quartic:Object.freeze({In:function(r){return r*r*r*r},Out:function(r){return 1- --r*r*r*r},InOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)}}),Quintic:Object.freeze({In:function(r){return r*r*r*r*r},Out:function(r){return--r*r*r*r*r+1},InOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)}}),Sinusoidal:Object.freeze({In:function(r){return 1-Math.sin((1-r)*Math.PI/2)},Out:function(r){return Math.sin(r*Math.PI/2)},InOut:function(r){return .5*(1-Math.sin(Math.PI*(.5-r)))}}),Exponential:Object.freeze({In:function(r){return r===0?0:Math.pow(1024,r-1)},Out:function(r){return r===1?1:1-Math.pow(2,-10*r)},InOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)}}),Circular:Object.freeze({In:function(r){return 1-Math.sqrt(1-r*r)},Out:function(r){return Math.sqrt(1- --r*r)},InOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)}}),Elastic:Object.freeze({In:function(r){return r===0?0:r===1?1:-Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI)},Out:function(r){return r===0?0:r===1?1:Math.pow(2,-10*r)*Math.sin((r-.1)*5*Math.PI)+1},InOut:function(r){return r===0?0:r===1?1:(r*=2,r<1?-.5*Math.pow(2,10*(r-1))*Math.sin((r-1.1)*5*Math.PI):.5*Math.pow(2,-10*(r-1))*Math.sin((r-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(r){var t=1.70158;return r===1?1:r*r*((t+1)*r-t)},Out:function(r){var t=1.70158;return r===0?0:--r*r*((t+1)*r+t)+1},InOut:function(r){var t=2.5949095;return(r*=2)<1?.5*(r*r*((t+1)*r-t)):.5*((r-=2)*r*((t+1)*r+t)+2)}}),Bounce:Object.freeze({In:function(r){return 1-ps.Bounce.Out(1-r)},Out:function(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},InOut:function(r){return r<.5?ps.Bounce.In(r*2)*.5:ps.Bounce.Out(r*2-1)*.5+.5}}),generatePow:function(r){return r===void 0&&(r=4),r=r<Number.EPSILON?Number.EPSILON:r,r=r>1e4?1e4:r,{In:function(t){return Math.pow(t,r)},Out:function(t){return 1-Math.pow(1-t,r)},InOut:function(t){return t<.5?Math.pow(t*2,r)/2:(1-Math.pow(2-t*2,r))/2+.5}}}}),ds=function(){return performance.now()},ap=function(){function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return r.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},r.prototype.removeAll=function(){this._tweens={}},r.prototype.add=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];for(var a=0,o=e;a<o.length;a++){var l=o[a];(t=l._group)===null||t===void 0||t.remove(l),l._group=this,this._tweens[l.getId()]=l,this._tweensAddedDuringUpdate[l.getId()]=l}},r.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0,a=t;i<a.length;i++){var o=a[i];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},r.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},r.prototype.update=function(t,e){t===void 0&&(t=ds()),e===void 0&&(e=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var a=0;a<i.length;a++){var o=this._tweens[i[a]],l=!e;o&&o.update(t,l)===!1&&!e&&this.remove(o)}i=Object.keys(this._tweensAddedDuringUpdate)}},r}(),On={Linear:function(r,t){var e=r.length-1,i=e*t,a=Math.floor(i),o=On.Utils.Linear;return t<0?o(r[0],r[1],i):t>1?o(r[e],r[e-1],e-i):o(r[a],r[a+1>e?e:a+1],i-a)},Bezier:function(r,t){for(var e=0,i=r.length-1,a=Math.pow,o=On.Utils.Bernstein,l=0;l<=i;l++)e+=a(1-t,i-l)*a(t,l)*r[l]*o(i,l);return e},CatmullRom:function(r,t){var e=r.length-1,i=e*t,a=Math.floor(i),o=On.Utils.CatmullRom;return r[0]===r[e]?(t<0&&(a=Math.floor(i=e*(1+t))),o(r[(a-1+e)%e],r[a],r[(a+1)%e],r[(a+2)%e],i-a)):t<0?r[0]-(o(r[0],r[0],r[1],r[1],-i)-r[0]):t>1?r[e]-(o(r[e],r[e],r[e-1],r[e-1],i-e)-r[e]):o(r[a?a-1:0],r[a],r[e<a+1?e:a+1],r[e<a+2?e:a+2],i-a)},Utils:{Linear:function(r,t,e){return(t-r)*e+r},Bernstein:function(r,t){var e=On.Utils.Factorial;return e(r)/e(t)/e(r-t)},Factorial:function(){var r=[1];return function(t){var e=1;if(r[t])return r[t];for(var i=t;i>1;i--)e*=i;return r[t]=e,e}}(),CatmullRom:function(r,t,e,i,a){var o=(e-r)*.5,l=(i-t)*.5,c=a*a,f=a*c;return(2*t-2*e+o+l)*f+(-3*t+3*e-2*o-l)*c+o*a+t}}},dl=function(){function r(){}return r.nextId=function(){return r._nextId++},r._nextId=0,r}(),gl=new ap,wm=function(){function r(t,e){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=ps.Linear.None,this._interpolationFunction=On.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=dl.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof e=="object"?(this._group=e,e.add(this)):e===!0&&(this._group=gl,gl.add(this))}return r.prototype.getId=function(){return this._id},r.prototype.isPlaying=function(){return this._isPlaying},r.prototype.isPaused=function(){return this._isPaused},r.prototype.getDuration=function(){return this._duration},r.prototype.to=function(t,e){if(e===void 0&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},r.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},r.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},r.prototype.start=function(t,e){if(t===void 0&&(t=ds()),e===void 0&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var a={};for(var o in this._valuesEnd)a[o]=this._valuesEnd[o];this._valuesEnd=a}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},r.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},r.prototype._setupProperties=function(t,e,i,a,o){for(var l in i){var c=t[l],f=Array.isArray(c),d=f?"array":typeof c,g=!f&&Array.isArray(i[l]);if(!(d==="undefined"||d==="function")){if(g){var E=i[l];if(E.length===0)continue;for(var _=[c],C=0,R=E.length;C<R;C+=1){var N=this._handleRelativeValue(c,E[C]);if(isNaN(N)){g=!1,console.warn("Found invalid interpolation list. Skipping.");break}_.push(N)}g&&(i[l]=_)}if((d==="object"||f)&&c&&!g){e[l]=f?[]:{};var M=c;for(var I in M)e[l][I]=M[I];a[l]=f?[]:{};var E=i[l];if(!this._isDynamic){var W={};for(var I in E)W[I]=E[I];i[l]=E=W}this._setupProperties(M,e[l],E,a[l],o)}else(typeof e[l]>"u"||o)&&(e[l]=c),f||(e[l]*=1),g?a[l]=i[l].slice().reverse():a[l]=e[l]||0}}},r.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},r.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},r.prototype.pause=function(t){return t===void 0&&(t=ds()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},r.prototype.resume=function(t){return t===void 0&&(t=ds()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},r.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},r.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},r.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},r.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},r.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},r.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},r.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},r.prototype.easing=function(t){return t===void 0&&(t=ps.Linear.None),this._easingFunction=t,this},r.prototype.interpolation=function(t){return t===void 0&&(t=On.Linear),this._interpolationFunction=t,this},r.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},r.prototype.onStart=function(t){return this._onStartCallback=t,this},r.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},r.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},r.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},r.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},r.prototype.onStop=function(t){return this._onStopCallback=t,this},r.prototype.update=function(t,e){var i=this,a;if(t===void 0&&(t=ds()),e===void 0&&(e=r.autoStartOnUpdate),this._isPaused)return!0;var o;if(!this._goToEnd&&!this._isPlaying)if(e)this.start(t,!0);else return!1;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);var l=t-this._startTime,c=this._duration+((a=this._repeatDelayTime)!==null&&a!==void 0?a:this._delayTime),f=this._duration+this._repeat*c,d=function(){if(i._duration===0||l>f)return 1;var N=Math.trunc(l/c),M=l-N*c,I=Math.min(M/i._duration,1);return I===0&&l===i._duration?1:I},g=d(),E=this._easingFunction(g);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,E),this._onUpdateCallback&&this._onUpdateCallback(this._object,g),this._duration===0||l>=this._duration)if(this._repeat>0){var _=Math.min(Math.trunc((l-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=_);for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=c*_,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var C=0,R=this._chainedTweens.length;C<R;C++)this._chainedTweens[C].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},r.prototype._updateProperties=function(t,e,i,a){for(var o in i)if(e[o]!==void 0){var l=e[o]||0,c=i[o],f=Array.isArray(t[o]),d=Array.isArray(c),g=!f&&d;g?t[o]=this._interpolationFunction(c,a):typeof c=="object"&&c?this._updateProperties(t[o],l,c,a):(c=this._handleRelativeValue(l,c),typeof c=="number"&&(t[o]=l+(c-l)*a))}},r.prototype._handleRelativeValue=function(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)},r.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},r.autoStartOnUpdate=!1,r}(),bm="25.0.0",Tm=dl.nextId,ni=gl,_m=ni.getAll.bind(ni),Cm=ni.removeAll.bind(ni),Dm=ni.add.bind(ni),Sm=ni.remove.bind(ni),Om=ni.update.bind(ni),mo={Easing:ps,Group:ap,Interpolation:On,now:ds,Sequence:dl,nextId:Tm,Tween:wm,VERSION:bm,getAll:_m,removeAll:Cm,add:Dm,remove:Sm,update:Om};class Nm extends Ge{name="View";params;visible=!0;cvs;scene;scenes=[];camera;controller;tween;animateDuration;constructor(t={}){super(),this.params=t,this.animateDuration=this.params.animateDuration||300,this.cvs=t.cvs,this.camera=new mf(t.camera||{})}destroy(){this.controller&&this.controller.destroy(),this.camera&&this.camera.destroy(),this.scene&&this.scene.destroy(),this.scenes.forEach(t=>t.destroy()),this.scenes.length=0,super.destroy()}bindScene(t){this.scenes.push(t),this.reset(),this.scene=t,t.isStatic}saveCameraPosition(t){gs.copy(this.camera.boundingBoxWorld);const e=t?Er+t:Er;sessionStorage.setItem(e,JSON.stringify(gs))}clearCameraPosition(t){const e=t?Er+t:Er;sessionStorage.setItem(e,"")}restoreCameraPosition(t){const e=t?Er+t:Er,i=sessionStorage.getItem(e);i&&(gs.copy(JSON.parse(i)),this.resetCameraByBoundingBox(gs,!0))}fullscreen(t=10,e=!1){this.scene&&(this.scene.boundingBox.isEmpty()&&this.scene.computeBoundingBox(),gs.copy(this.scene.boundingBox).expandByVector(vo.set(t,t)),this.resetCameraByBoundingBox(gs,e))}handleCameraChanged(t){console.warn("handleCameraChanged: ",t.target.camera.position.z,t.target.camera.scaled.x)}reset(){}async resetCameraByBoundingBox(t,e=!1){if(!this.camera)return;if(!t||t.isEmpty())throw new Error("BoundingBox empty");if(!e)return this.camera.setByBox(t),Promise.resolve();const i=this.camera.getCameraPosition();t.getCenter(vo),t.getSize(yl);const a=Math.max(yl.x/this.camera.width,yl.y/this.camera.height),o={x:vo.x,y:vo.y,z:0,s:a,r:0};await this.animateCamera(i,o)}async animateCamera(t,e){return this.controller&&(this.controller.enabled=!1),this.tween&&this.tween.stop(),new Promise(i=>{this.tween=new mo.Tween(t).to(e,this.animateDuration).easing(mo.Easing.Exponential.Out).onUpdate(a=>{this.camera.position.set(a.x,a.y),this.camera.scaled.set(a.s,a.s),this.camera.rotation.set(a.r,a.r),this.camera.update()}).onComplete(()=>{this.controller&&(this.controller.enabled=!0),i()}).start()})}computeBoundingBox(t,e=new Dt){return!t||!t.length||(e.makeEmpty(),t.forEach(i=>e.union(i.computeBoundingBox()))),e}expandScenesBoundingBox(t,e=new Dt){t.forEach(i=>i.boundingBox.union(e))}update(t){this.tween&&this.tween.update(t)}}const Er="camera_position_",vo=new F,yl=new F,gs=new Dt;class Mm extends Ge{name="SvgView";params;container;offset=new F;camera;controller;scene;p1=new F;p2=new F;graph;multiSelector;dummiesController;zoomToSelectEnable=!1;zoomBox=new Dt;selectEnable=!1;multiSelectEnable=!1;tween;animateDuration;label;controllerPanStartHandler=this.handlePanStart.bind(this);controllerPanEndHandler=this.handlePanEnd.bind(this);controllerWheelStartHandler=this.handlePanStart.bind(this);controllerWheelEndHandler=this.handlePanEnd.bind(this);controllerPanMoveHandler=this.handleControllerPanMove.bind(this);controllerPointerOverHandler=this.handleControllerPointerOver.bind(this);multiSelectorSelectedHandler=this.handleMultiSelectorSelected.bind(this);_currentAssetId;constructor(t={}){super(),this.params=t,this.params.zoomToSelectEnable&&(this.zoomToSelectEnable=!0),this.params.selectEnable&&(this.selectEnable=!0),this.params.multiSelectEnable&&(this.multiSelectEnable=!0),this.params.camera||(this.params.camera={}),this.params.camera.flipY=!0,this.animateDuration=this.params.animateDuration||300,this.camera=new mf(this.params.camera),this.container=this.params.containerId?document.getElementById(this.params.containerId):kt.window.document.getElementsByTagName("body")[0];let e=this.container.getBoundingClientRect();this.offset.set(e.left,e.top),this.controller=new yf(this.container,this.camera,!0),this.graph=new $u(this.container),this.multiSelector=new B2(this.container,this.controller),this.dummiesController=new Am(this.container,this.controller),this.bindControllerEvents(),this.initLabel()}destroy(){var t;this.unbindControllerEvents(),super.destroy(),(t=this.label)==null||t.destroy()}initLabel(){this.label=new fl(this.container,"")}showAssetsLabel(t,e,i){var o,l,c,f,d;if(!e)return;t||(t=(o=this.scene)==null?void 0:o.assetType);const a=(l=this.scene)==null?void 0:l.chef.getElementBoundingBox(e);a&&!a.isEmpty()&&(i||(i=(c=this.scene)==null?void 0:c.getAssetLabelById(t,e),i||(i=e)),(f=this.label)==null||f.setHtml(i),Nn.copy(a.min).applyMatrix3(this.camera.viewMatrix).add(this.offset).round(),(d=this.label)==null||d.show(Nn))}async hideAssetsLabel(){var t;return(t=this.label)==null?void 0:t.hide()}bindScene(t){var e;this.scene=t,this.multiSelector.bindScene(this.scene),(e=this.dummiesController)==null||e.bindScene(this.scene)}resize(){var t,e;(t=this.camera)==null||t.resize(),(e=this.controller)==null||e.resize(),console.log("【svgView】resize: ",this.params.width,this.params.height)}async setByBox(t,e=!0){await this.resetCameraByBoundingBox(t,e)}zoomIn(){this.controller.scaled=this.camera.scaled.x*.9,this.controller.update()}zoomOut(){this.controller.scaled=this.camera.scaled.x*1.1,this.controller.update()}zoomToSelectEnableChanged(t){console.log("TODO: zoomToSelectEnableChanged: ",t),this.zoomToSelectEnable=t,this.controller.enablePan=!this.zoomToSelectEnable}selectEnableChanged(t){this.selectEnable=!!t,this.multiSelector.selectEnableChanged(t)}multiSelectEnableChanged(t){this.multiSelectEnable=!!t,this.multiSelector.multiSelectEnableChanged(t)}getIntersectObjects(t,e,i=[]){return this.scene?this.scene.getIntersectObjects(t,e,i):i}async focusAt(t,e=500){return this.camera?(Xt.setFromCenterAndSize(t,Nn.set(e*2,e*2)),this.resetCameraByBoundingBox(Xt,!0)):Promise.resolve()}async focusAtById(t,e=500){var a;const i=(a=this.scene)==null?void 0:a.getBoundingBoxById(t);if(console.log("focusAtById: ",t,i==null?void 0:i.toString()),i){i.expandByScalar(e),Xt.copy(this.camera.boundingBoxWorld),Xt.containsBox(i)||await this.resetCameraByBoundingBox(i,!0);return}}async focusAtDummy(t,e=500){var o,l;const i=this.dummiesController.getDummyById(t),a=(o=i==null?void 0:i.userData)==null?void 0:o.rmId;if(a){const c=(l=this.scene)==null?void 0:l.getBoundingBoxById(a);if(c){c.expandByScalar(e),Xt.copy(this.camera.boundingBoxWorld),Xt.containsBox(c)||await this.resetCameraByBoundingBox(c,!0);return}}if(i!=null&&i.position&&!(i!=null&&i.position.isEmpty())){Xt.setFromCenterAndSize(i.worldPosition,Nn.set(e*2,e*2)),this.camera.boundingBoxWorld.containsBox(Xt)||await this.resetCameraByBoundingBox(Xt,!0);return}}async resetCameraByBoundingBox(t,e=!1){if(!this.camera)return Promise.resolve();if(!t||t.isEmpty())throw new Error("BoundingBox empty");if(!e)return this.camera.setByBox(t),Promise.resolve();const i=this.camera.getCameraPosition();t.getCenter(Nn),t.getSize(ml);const a=Math.max(ml.x/this.camera.width,ml.y/this.camera.height),o={x:Nn.x,y:Nn.y,z:0,s:a,r:0};await this.animateCamera(i,o)}async animateCamera(t,e){return this.controller&&(this.controller.enabled=!1),this.tween&&this.tween.stop(),new Promise(i=>{this.tween=new mo.Tween(t).to(e,this.animateDuration).easing(mo.Easing.Exponential.Out).onUpdate(a=>{this.camera.position.set(a.x,a.y),this.camera.scaled.set(a.s,a.s),this.camera.rotation.set(a.r,a.r),this.camera.update()}).onComplete(()=>{this.controller&&(this.controller.enabled=!0),i()}).start()})}fullscreen(){this.scene&&(this.scene&&!this.scene.viewBox.isEmpty()?Xt.copy(this.scene.viewBox):(this.scene.updateMatrixWorld(!0),this.scene.computeBoundingBox(),Xt.copy(this.scene.boundingBox)),this.resetCameraByBoundingBox(Xt,!0))}saveCameraPosition(t){Xt.copy(this.camera.boundingBoxWorld);const e=t?Er+t:Er;sessionStorage.setItem(e,JSON.stringify(Xt))}restoreCameraPosition(t){const e=t?Er+t:Er,i=sessionStorage.getItem(e);if(!i)return this.fullscreen();Xt.copy(JSON.parse(i)),this.resetCameraByBoundingBox(Xt,!0)}clearCameraPosition(t){const e=t?Er+t:Er;sessionStorage.setItem(e,"")}bindControllerEvents(){this.controller.addEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.addEventListener(ot.PAN_END,this.controllerPanEndHandler),this.controller.addEventListener(ot.WHEEL_START,this.controllerWheelStartHandler),this.controller.addEventListener(ot.WHEEL_END,this.controllerWheelEndHandler),this.controller.addEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.addEventListener(ot.POINTEROVER,this.controllerPointerOverHandler),this.multiSelector.addEventListener(Xu.SELECTED,this.multiSelectorSelectedHandler)}unbindControllerEvents(){this.controller.removeEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.removeEventListener(ot.PAN_END,this.controllerPanEndHandler),this.controller.removeEventListener(ot.WHEEL_START,this.controllerWheelStartHandler),this.controller.removeEventListener(ot.WHEEL_END,this.controllerWheelEndHandler),this.controller.removeEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.removeEventListener(ot.POINTEROVER,this.controllerPointerOverHandler),this.multiSelector.removeEventListener(Xu.SELECTED,this.multiSelectorSelectedHandler)}handlePanStart(t){if(!((t==null?void 0:t.type)!==ot.PAN_START&&(t==null?void 0:t.type)!==ot.WHEEL_START)&&this.zoomToSelectEnable){this.p1.copy(t.data.screenCoords),Xt.makeEmpty().expandByPoint(this.p1),this.graph.draw(Xt);return}}handlePanEnd(t){if(!((t==null?void 0:t.type)!==ot.PAN_END&&(t==null?void 0:t.type)!==ot.WHEEL_END)&&this.zoomToSelectEnable){this.p2.copy(t.data.screenCoords),Xt.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2).unproject(this.controller.camera),this.setByBox(Xt),this.graph.hide(),Xt.makeEmpty();return}}handleControllerPanMove(t){(t==null?void 0:t.type)===ot.PAN_MOVE&&this.zoomToSelectEnable&&(this.p2.copy(t.data.screenCoords),Xt.makeEmpty().expandByPoint(this.p1).expandByPoint(this.p2),this.graph.draw(Xt))}handleControllerPointerOver(t){var a,o,l,c,f;const e=((a=t==null?void 0:t.e)==null?void 0:a.target)||((l=(o=t==null?void 0:t.e)==null?void 0:o.srcEvent)==null?void 0:l.target);let i=e==null?void 0:e.id;(i==null?void 0:i.indexOf("dummy"))>-1?(i=e.getAttribute(as+"-id"),i&&this._currentAssetId!==i&&this.dispatchEvent({type:"POINTEROVER",data:{id:i,assetType:"dummy"},e:t.e})):i&&((c=this.scene)!=null&&c.isBelongsToAssetType(i,$e.WS))?this._currentAssetId!==i&&this.dispatchEvent({type:"POINTEROVER",data:{id:i,assetType:$e.WS},e:t.e}):i&&((f=this.scene)!=null&&f.isBelongsToAssetType(i,$e.RM))?this._currentAssetId!==i&&this.dispatchEvent({type:"POINTEROVER",data:{id:i,assetType:$e.RM},e:t.e}):(this._currentAssetId=void 0,this.dispatchEvent({type:"POINTERLEAVE",e:t.e})),this._currentAssetId=i}handleMultiSelectorSelected(t){console.warn("handleMultiSelectorSelected:",t.data),this.dispatchEvent({type:"SELECTED",data:t.data})}setDummies(t){this.dummiesController.setDummiesByVos(t)}clearDummies(t){this.dummiesController.clearDummies(t)}update(t){this.tween&&this.tween.update(t)}}const Xt=new Dt,Nn=new F,ml=new F;var Mn=(r=>(r.SELECTED="SELECTED",r.POINTEROVER="POINTEROVER",r.POINTERLEAVE="POINTERLEAVE",r))(Mn||{});class Lm extends zu{name="SvgEmptyScene";constructor(t){super(t),this.bind(`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-200 -200 500 500">
104
+ <view id="defaultView" viewBox="-200 -200 500 500" />
83
105
  <style>
84
- #svg-loading-fast path {
85
- fill: #2E3032;
86
- animation: svg-loading-fast 2s ease infinite;
106
+ /*#svg-loading-fast path {*/
107
+ /* fill: #2E3032;*/
108
+ /* animation: svg-loading-fast 2s ease infinite;*/
109
+ /*}*/
110
+ /*@keyframes svg-loading-fast {*/
111
+ /* 0%, 100% {stroke-dasharray: 250; stroke-dashoffset: 250;}*/
112
+ /* 68% {stroke-dasharray: 0; stroke-dashoffset: 0; opacity: 0.5;}*/
113
+ /*}*/
114
+ /*#svg-loading-fast .line {animation: svg-loading-fast 6s ease infinite;}*/
115
+ /*@keyframes svg-loading-fast {*/
116
+ /* 0% {stroke-dasharray: 250; stroke-dashoffset: 250; opacity: 1;}*/
117
+ /* 50% {stroke-dasharray: 250; stroke-dashoffset: 0; opacity: 0.5;}*/
118
+ /*}*/
119
+ #svg-loading-fast path {animation: pathFrames 6s ease infinite;}
120
+ @keyframes pathFrames {
121
+ 0% {opacity: 1;}
122
+ 50% {opacity: 0.5;}
87
123
  }
88
- @keyframes svg-loading-fast {
89
- 0%, 100% {stroke-dasharray: 250; stroke-dashoffset: 250;}
90
- 68% {stroke-dasharray: 0; stroke-dashoffset: 0; opacity: 0.5;}
124
+ #svg-loading-fast .triangle {animation: triangleFrames 3s ease infinite;}
125
+ @keyframes triangleFrames {
126
+ 0% {opacity: 1;}
127
+ 50% {opacity: 0.3;}
91
128
  }
92
- </style>
129
+ #svg-loading-fast {fill: #525252}
130
+ .line {stroke: #525252; stroke-width: 4px}
131
+ .triangle {fill: #F26666}
132
+ </style>
93
133
  <g id="svg-loading-fast">
94
- <path d="M17.7 14L16.82 15.5L5 15.5L5 4L17.66 4L16.76 5.5L9.04 5.5L9.04 8.86L17.32 8.86L16.44 10.38L9.04 10.38L9.04 14L17.7 14Z" />
95
- <path d="M22.98 15.44L19.3 15.44L19.3 7.38L31.38 7.38L30.18 8.82L29.02 8.82L29.02 15.44L25.3 15.44L25.3 8.82L22.98 8.82L22.98 15.44ZM35.06 15.44L31.38 15.44L31.38 7.38L35.06 7.38L35.06 15.44Z" />
96
- <path d="M40.44 14.02L44.12 14.02L44.12 7.42L47.96 7.42L47.96 15.48L40.44 15.48L40.44 18.56L36.66 18.56L36.66 7.42L44.12 7.42L42.9 8.86L40.44 8.86L40.44 14.02Z" />
97
- <path d="M51.62 7.42L51.62 4.78L55.48 4.78L55.48 7.42L59 7.42L58.02 8.86L55.48 8.86L55.48 14.08L58.82 14.08L57.98 15.48L51.62 15.48L51.62 8.86L49.56 8.86L49.56 7.42L51.62 7.42Z" />
98
- <path d="M67.08 11.8L69.66 7.42L73.66 7.42L67.08 18.58L63.06 18.58L65.06 15.42L60.6 7.42L64.66 7.42L67.08 11.8Z" />
134
+ <g transform="scale(2, 2) translate(12, 0)">
135
+ <path d="M17.7 14L16.82 15.5L5 15.5L5 4L17.66 4L16.76 5.5L9.04 5.5L9.04 8.86L17.32 8.86L16.44 10.38L9.04 10.38L9.04 14L17.7 14Z" />
136
+ <path d="M22.98 15.44L19.3 15.44L19.3 7.38L31.38 7.38L30.18 8.82L29.02 8.82L29.02 15.44L25.3 15.44L25.3 8.82L22.98 8.82L22.98 15.44ZM35.06 15.44L31.38 15.44L31.38 7.38L35.06 7.38L35.06 15.44Z" />
137
+ <path d="M40.44 14.02L44.12 14.02L44.12 7.42L47.96 7.42L47.96 15.48L40.44 15.48L40.44 18.56L36.66 18.56L36.66 7.42L44.12 7.42L42.9 8.86L40.44 8.86L40.44 14.02Z" />
138
+ <path d="M51.62 7.42L51.62 4.78L55.48 4.78L55.48 7.42L59 7.42L58.02 8.86L55.48 8.86L55.48 14.08L58.82 14.08L57.98 15.48L51.62 15.48L51.62 8.86L49.56 8.86L49.56 7.42L51.62 7.42Z" />
139
+ <path d="M67.08 11.8L69.66 7.42L73.66 7.42L67.08 18.58L63.06 18.58L65.06 15.42L60.6 7.42L64.66 7.42L67.08 11.8Z" />
140
+ </g>
141
+
142
+ <path class="line" d="M103.5 46L20 46" />
143
+ <path class="line" d="M103.5 46L187 46" />
144
+ <path class="triangle" d="M103.5 56L133.5 90L73.5 90Z" />
99
145
  </g>
100
146
  </svg>`)}}class Bm extends Ge{name="SvgApp";params;renderer;view;scene;loadingScene;emptyScene;mainScene;zoomToSelectEnable=!1;zoomBox=new Dt;selectEnable=!1;multiSelectEnable=!1;requestHeader={};runningHandler=this.running.bind(this);pointerOverHandler=this.handlePointerOver.bind(this);pointerLeaveHandler=this.handlePointerLeave.bind(this);multiSelectorSelectedHandler=this.handleMultiSelectorSelected.bind(this);dragEndHandler=this.handleDragEnd.bind(this);constructor(t={}){super(),this.params=t,this.params.zoomToSelectEnable&&(this.zoomToSelectEnable=!0),this.params.selectEnable&&(this.selectEnable=!0),this.params.multiSelectEnable&&(this.multiSelectEnable=!0),this.params.defaultFill||(this.params.defaultFill=Wt.getMoreTransparent($t.white,.3)),this.params.defaultStroke||(this.params.defaultStroke=Wt.getMoreTransparent($t.darkWhite,.8)),this.params.infoFill||(this.params.infoFill=Wt.getMoreTransparent($t.gray,.3)),this.params.infoStroke||(this.params.infoStroke=Wt.getMoreTransparent($t.darkGray,.8)),this.params.primaryFill||(this.params.primaryFill=Wt.getMoreTransparent($t.blue,.3)),this.params.primaryStroke||(this.params.primaryStroke=Wt.getMoreTransparent($t.darkBlue,.8)),this.params.successFill||(this.params.successFill=Wt.getMoreTransparent($t.green,.3)),this.params.successStroke||(this.params.successStroke=Wt.getMoreTransparent($t.darkGreen,.8)),this.params.warningFill||(this.params.warningFill=Wt.getMoreTransparent($t.yellow,.3)),this.params.warningStroke||(this.params.warningStroke=Wt.getMoreTransparent($t.darkYellow,.8)),this.params.dangerFill||(this.params.dangerFill=Wt.getMoreTransparent($t.red,.3)),this.params.dangerStroke||(this.params.dangerStroke=Wt.getMoreTransparent($t.darkRed,.8)),this.params.activeFill||(this.params.activeFill=Wt.getMoreTransparent($t.brown,.3)),this.params.activeStroke||(this.params.activeStroke=Wt.getMoreTransparent($t.darkBrown,.8)),this.renderer=new _0(t),this.view=new Mm(t),this.trans2LoadingScene()}get isLoadingScene(){var t;return((t=this.scene)==null?void 0:t.name)==="SvgLoadingScene"}destroy(){var t,e;this.unbindAssetsEvents(),super.destroy(),(t=this.view)==null||t.destroy(),(e=this.renderer)==null||e.destroy()}resize(){var t,e;(t=this.renderer)==null||t.resize(),(e=this.view)==null||e.resize()}isScene(t){var e;return((e=this.scene)==null?void 0:e.uuid)===t.uuid}removeScene(t){this.scene=void 0,t==null||t.destroy()}trans2MainScene(){var t,e;(t=this.scene)==null||t.unmount(),this.scene=this.mainScene,this.scene.isMounted||this.scene.mount(),this.view.bindScene(this.scene),(e=this.loadingScene)==null||e.destroy()}trans2LoadingScene(){var e,i;console.log("trans2LoadingScene: ",this.params),this.loadingScene=new M2(this.params),(e=this.scene)==null||e.unmount(),this.scene=this.loadingScene,this.scene.isMounted||this.scene.mount();const t=new Dt().copy(this.loadingScene.viewBox).expandByVector(new F(1,1).multiplyScalar(150));console.log("trans2LoadingScene: ",t.toString()),this.view.setByBox(t,!1),(i=this.mainScene)==null||i.destroy()}trans2EmptyScene(){var e,i;console.log("trans2EmptyScene: ",this.params),this.emptyScene=new Lm(this.params),(e=this.scene)==null||e.unmount(),this.scene=this.emptyScene,this.scene.isMounted||this.scene.mount();const t=new Dt().copy(this.emptyScene.viewBox).expandByVector(new F(1,1).multiplyScalar(150));console.log("trans2EmptyScene: ",t.toString()),this.view.setByBox(t,!1),(i=this.mainScene)==null||i.destroy()}start(){requestAnimationFrame(this.runningHandler)}running(t){this.scene&&(this.scene.update(),this.renderer.render(this.scene,this.view.camera),this.view.update(t),requestAnimationFrame(this.runningHandler))}setRequestHeader(t){return this.requestHeader=t,this}async load(t,e,i=2,a){this.isLoadingScene||this.trans2LoadingScene(),await Sc(this.params.syncDelay);const o=await new qc().setRequestHeader(this.requestHeader).loadAsync(t).catch(()=>{this.trans2EmptyScene()});return this.loadByString(o,e,i)}loadByString(t,e,i=2){if(this.mainScene=new zu(this.params),!this.mainScene.bind(t))return this.trans2EmptyScene(),[];this.view.setByBox(this.mainScene.viewBox);const o=this.mainScene.getLayers(i);return e!=null&&e.length||(e=Mt.map(o,"label")),this.mainScene.showDefaultLayers(e,!0),this.trans2MainScene(),this.bindAssetsEvents(),console.log("svgApp.loadByString: ",o),o}setSkeletons(t){var e;(e=this.scene)==null||e.setSkeletonLayers(t)}getLayers(t=2){var e;return(e=this.scene)==null?void 0:e.getLayers(t)}updateLayersVisibility(t,e=!1){var i;(i=this.scene)==null||i.updateLayersVisibility(t,e)}selectByIds(t){var e;(e=this.scene)==null||e.selectByIds(t,this.multiSelectEnable)}clearSelectedByIds(t){var e;Array.isArray(t)?t.forEach(i=>{var a;return(a=this.scene)==null?void 0:a.clearSelectedById(i)}):(e=this.scene)==null||e.clearSelectedById(t)}clearSelected(){var t;(t=this.scene)==null||t.clearSelected()}getSelectedIds(){var t;return(t=this.scene)==null?void 0:t.getSelectedIds()}async targetByIds(t,e=100){var i;this.scene&&((i=this.scene)==null||i.selectByIds(t,!1),vl.copy(this.scene.getSelectedBoundingBox()).expandByVector(new F(1,1).multiplyScalar(e)),await Sc(100),vl.isEmpty()||await this.view.setByBox(vl))}linkAssetsByTree(t){var e;(e=this.scene)==null||e.linkAssetsByTree(t)}setViewAreaLimit(t){this.renderer.viewAreaLimit=t}setAssetType(t,e){var i;(i=this.scene)==null||i.setAssetType(t,e)}getAssetIdsByType(t){var e;return(e=this.scene)==null?void 0:e.getAssetIdsByType(t)}clearFill(){var t;(t=this.scene)==null||t.clearFillOrStroke("fill")}clearFillByIds(t){var e;(e=this.scene)==null||e.clearFillOrStrokeByIds(t,"fill")}setFillByIds(t,e){var i;(i=this.scene)==null||i.setFillOrStrokeByIds(t,e,"fill")}clearStroke(){var t;(t=this.scene)==null||t.clearFillOrStroke("stroke")}clearStrokeByIds(t){var e;(e=this.scene)==null||e.clearFillOrStrokeByIds(t,"stroke")}setStrokeByIds(t,e){var i;(i=this.scene)==null||i.setFillOrStrokeByIds(t,e,"stroke")}getLegend(){var t;return(t=this.scene)==null?void 0:t.getLegend()}setAssetLabels(t,e){var i;(i=this.scene)==null||i.setAssetLabels(t,e)}clearAssetLabels(){var t;(t=this.scene)==null||t.clearAssetLabels()}fullscreen(){this.view.fullscreen()}saveCameraPosition(t){this.view.saveCameraPosition(t)}restoreCameraPosition(t){this.view.restoreCameraPosition(t)}clearCameraPosition(t){this.view.clearCameraPosition(t)}zoomIn(){this.view.zoomIn()}zoomOut(){this.view.zoomOut()}focusAt(t,e=1e3){var i;(i=this.view)==null||i.focusAt(t,e)}async focusAtById(t,e=1e3){var i;return(i=this.view)==null?void 0:i.focusAtById(t,e)}async focusAtDummy(t,e=1e3){var i;return(i=this.view)==null?void 0:i.focusAtDummy(t,e)}showAssetsLabel(t,e,i){var a,o,l,c;e?t==="dummy"?(l=(o=(a=this.view)==null?void 0:a.dummiesController)==null?void 0:o.dummies)==null||l.showDummyLabel(e):(c=this.view)==null||c.showAssetsLabel(t,e,i):this.hideAssetsLabel()}hideAssetsLabel(){var t,e,i,a;(i=(e=(t=this.view)==null?void 0:t.dummiesController)==null?void 0:e.dummies)==null||i.hideDummyLabel(),(a=this.view)==null||a.hideAssetsLabel()}highlightAssets(t,e){var i;(i=this.scene)==null||i.highlightAssets(t,e)}resetHighlightAssets(t){var e;(e=this.scene)==null||e.resetHighlightAssets(t)}fontZoomIn(){var t;(t=this.scene)==null||t.chef.fontZoom("asset-labels",1.1)}fontZoomOut(){var t;(t=this.scene)==null||t.chef.fontZoom("asset-labels",.9)}zoomToSelectEnableChanged(t){this.view.zoomToSelectEnableChanged(t)}selectEnableChanged(t){this.selectEnable=!!t,this.view.selectEnableChanged(t)}multiSelectEnableChanged(t){this.multiSelectEnable=!!t,this.view.multiSelectEnableChanged(t)}socialDistanceEnableChanged(t){var e;(e=this.scene)==null||e.socialDistanceEnableChanged(t)}getBoundingBoxById(t,e=!0){var a;if(!t)return;const i=(a=this.scene)==null?void 0:a.getBoundingBoxById(t);return i&&e&&i.applyMatrix3(this.view.camera.viewMatrix).round(),i}setDummies(t){var e;(e=this.view)==null||e.setDummies(t)}clearDummies(t){var e;(e=this.view)==null||e.clearDummies(t)}highlightDummies(t){var e,i;(i=(e=this.view)==null?void 0:e.dummiesController)==null||i.highlightDummies(t)}resetHighlightDummies(){var t,e;(e=(t=this.view)==null?void 0:t.dummiesController)==null||e.resetHighlightDummies()}bindAssetsEvents(){var t,e;this.view.addEventListener(Mn.POINTEROVER,this.pointerOverHandler),this.view.addEventListener(Mn.POINTERLEAVE,this.pointerLeaveHandler),this.view.addEventListener(Mn.SELECTED,this.multiSelectorSelectedHandler),(e=(t=this.view)==null?void 0:t.dummiesController)==null||e.addEventListener("panend",this.dragEndHandler)}unbindAssetsEvents(){var t,e;this.view.removeEventListener(Mn.POINTEROVER,this.pointerOverHandler),this.view.removeEventListener(Mn.POINTERLEAVE,this.pointerLeaveHandler),this.view.removeEventListener(Mn.SELECTED,this.multiSelectorSelectedHandler),(e=(t=this.view)==null?void 0:t.dummiesController)==null||e.removeEventListener("panend",this.dragEndHandler)}handleMultiSelectorSelected(t){this.dispatchEvent({type:"SELECTED",data:t.data})}handlePointerOver(t){this.dispatchEvent({type:"pointerover",data:t.data,e:t.e})}handlePointerLeave(t){this.dispatchEvent({type:"pointerleave",data:t.data,e:t.e})}handleInitializeStart(){console.log("App.initializeStart ...")}async handleInitializeComplete(t){console.log("App.initializeComplete ...",t),t!=null&&t.data&&this.launch()}handleDragEnd(t){this.dispatchEvent(t)}launch(){console.log("App.launch ...")}}const vl=new Dt;var op=(r=>(r.SELECTED="SELECTED",r.POINTEROVER="pointerover",r.POINTERLEAVE="pointerleave",r.DRAG_END="panend",r))(op||{}),St=(r=>(r.INIT="init",r.LOAD="load",r.LOADED="loaded",r.GET_LAYERS="getLayers",r.GET_ASSET_IDS_BY_TYPE="getAssetIdsByType",r.SET_FILL_BY_IDS="setFillByIds",r.CLEAR_FILL="clearFill",r.SET_STROKE_BY_IDS="setStrokeByIds",r.CLEAR_STROKE="clearStroke",r.TERMINATE="terminate",r.CAMERA_SYNC="cameraSync",r.ASSET_TYPE_CHANGED="assetTypeChanged",r.SVG_LOADING_TYPE_CHANGED="svgLoadingTypeChanged",r.USED_CACHE_CHANGED="usedCacheChanged",r.DEBOUNCE_CACHE_CHANGED="debounceCacheChanged",r.WIREFRAME_CHANGED="wireframeChanged",r.BG_PASS_CHANGED="bgPass",r.SELECT_ENABLE_CHANGED="selectEnableChanged",r.MULTI_SELECT_ENABLE_CHANGED="multiSelectEnableChanged",r.MULTI_SELECT_BY_RANGE="multiSelectByRange",r.ZOOM_TO_SELECT_ENABLE_CHANGED="zoomToSelectEnableChanged",r.FONT_ZOOM_IN="fontZoomIn",r.FONT_ZOOM_OUT="fontZoomOut",r.CAMERA_CHANGED="cameraChanged",r.SCENES_CHANGED="scenesChanged",r.UPDATE_LAYERS_VISIBILITY="updateLayersVisibility",r.DYNAMIC_LOADED="dynamicLoaded",r.SYNC_TEXTURE_HELPER_CACHED="syncTextureHelperCached",r.INITIALIZATION_START="INITIALIZATION_START",r.INITIALIZATION_COMPLETE="INITIALIZATION_COMPLETE",r.SELECTED="selected",r.SELECT_BY_IDS="selectByIds",r.CLEAR_SELECTED="clearSelected",r.TARGET_BY_IDS="targetByIds",r.TAP="tap",r.SINGLE_TAP="singletap",r.DOUBLE_TAP="doubletap",r.PRESS="press",r.PAN="pan",r.PAN_START="panstart",r.PAN_MOVE="panmove",r.PAN_END="panend",r.ROTATE="rotate",r.ROTATE_START="rotatestart",r.ROTATE_MOVE="rotatemove",r.ROTATE_END="rotateend",r.PINCH="pinch",r.PINCH_START="pinchstart",r.PINCH_MOVE="pinchmove",r.PINCH_END="pinchend",r.PINCH_IN="pinchin",r.PINCH_OUT="pinchout",r.SWIPE="swipe",r))(St||{});class Im extends Nm{name="OpeView";container;graph;zoomToSelectEnable;multiSelectEnable;rayCaster=new xf;intersects=[];controllerPanStartHandler=this.handlePanStart.bind(this);controllerPanEndHandler=this.handlePanEnd.bind(this);controllerPanMoveHandler=this.handleControllerPanMove.bind(this);controllerPointerOverHandler=this.handleControllerPointerOver.bind(this);constructor(t={}){super(t),this.container=this.params.cvs?this.params.cvs:this.params.canvasId?document.getElementById(this.params.canvasId):kt.window.document.getElementsByTagName("body")[0],console.warn("opeView.constructor: ",this.container,this.container.tagName),this.controller=new yf(this.container,this.camera),this.bindControllerEvents();let e=this.container.tagName.toLowerCase()!=="body"?this.container.parentNode:this.container;this.graph=new $u(e)}destroy(){this.unbindControllerEvents(),this.controller&&this.controller.destroy(),super.destroy()}zoomToSelectEnableChanged(t=!1){this.zoomToSelectEnable=t,this.controller.enablePan=!this.zoomToSelectEnable}multiSelectEnableChanged(t=!1){this.multiSelectEnable=t,this.controller.enablePan=!this.multiSelectEnable}bindControllerEvents(){this.controller.addEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.addEventListener(ot.PAN_END,this.controllerPanEndHandler),this.controller.addEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.addEventListener(ot.POINTEROVER,this.controllerPointerOverHandler)}unbindControllerEvents(){this.controller.removeEventListener(ot.PAN_START,this.controllerPanStartHandler),this.controller.removeEventListener(ot.PAN_END,this.controllerPanEndHandler),this.controller.removeEventListener(ot.PAN_MOVE,this.controllerPanMoveHandler),this.controller.removeEventListener(ot.POINTEROVER,this.controllerPointerOverHandler)}handlePanStart(t){(t==null?void 0:t.type)!==ot.PAN_START&&(t==null?void 0:t.type)!==ot.WHEEL_START||(this.zoomToSelectEnable||this.multiSelectEnable)&&(xo.copy(t.data.screenCoords),tn.makeEmpty().expandByPoint(xo),this.graph.draw(tn))}async handlePanEnd(t){(t==null?void 0:t.type)!==ot.PAN_END&&(t==null?void 0:t.type)!==ot.WHEEL_END||((this.zoomToSelectEnable||this.multiSelectEnable)&&(Eo.copy(t.data.screenCoords),tn.makeEmpty().expandByPoint(xo).expandByPoint(Eo).unproject(this.controller.camera),this.graph.hide()),this.zoomToSelectEnable&&await this.resetCameraByBoundingBox(tn,!0),this.multiSelectEnable&&this.dispatchEvent({type:St.MULTI_SELECT_BY_RANGE,data:tn.clone()}),tn.makeEmpty())}handleControllerPanMove(t){(t==null?void 0:t.type)===ot.PAN_MOVE&&(this.zoomToSelectEnable||this.multiSelectEnable)&&(Eo.copy(t.data.screenCoords),tn.makeEmpty().expandByPoint(xo).expandByPoint(Eo),this.graph.draw(tn))}handleControllerPointerOver(t){t==null||t.type,ot.POINTEROVER}handleMultiSelectorSelected(t){}handleCameraChanged(t){console.warn("handleCameraChanged: ",t.target.camera.position.z,t.target.camera.scaled.x)}}const xo=new F,Eo=new F,tn=new Dt;function up(r){return!!(r&&r.constructor&&r.call&&r.apply)}const Rm="children",Pm="get",Fm="set",xl="Changed";class km extends Ge{name="Node2";userData={};_cache=new Map;_attachedDepsListeners=new Map;constructor(t){super(),this.setAttrs(t)}destroy(){super.destroy(),this._clearCache()}setAttrs(t){if(!t)return this;let e;for(const i in t)i!==Rm&&(e=Fm+i,up(this[e])?this[e](t[i]):this.setAttr(i,t[i]));return this}setAttr(t,e){Object.hasOwnProperty.call(this,t)&&(this.userData[t]=e,this[t]=e)}getAttrs(){return this.userData||{}}getAttr(t){const e=Pm+Mt.capitalize(t);return up(this[e])?this[e]():this.userData[t]}getAttrKey(){return Object.values(this.userData).filter(t=>!(t instanceof Array||t instanceof Object)).join("_")}_getCache(t,e){let i=this._cache.get(t);return(i===void 0||i.dirty===!0)&&(i=e.call(this),this._cache.set(t,i)),i}_clearCache(t){t===void 0?this._cache.clear():this._cache.has(t)&&this._cache.get(t).isMatrix3?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_setProperty(t){Object.hasOwnProperty.call(this,t)&&delete this[t],Object.defineProperty(this,t,{get(){return this.userData[t]},set(e){const i=this.userData[t];this.userData[t]=e,i!==e&&this.dispatchEvent({type:t+xl,data:{oldVal:i,newVal:e}})},enumerable:!0,configurable:!0})}computed(t,e,i){if(!this._attachedDepsListeners.get(t)){const a=e.map(o=>o+xl).join(",");this.addEventListeners(a,()=>this._clearCache(t)),e.forEach(o=>this._setProperty(o)),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,i)}watch(t,e){(t||[]).forEach(i=>{this._setProperty(i),this.addEventListener(i+xl,e)})}}const Wr=new F;class Hm extends km{isTexture=!0;isRenderTargetTexture=!1;type="Texture";name="Texture";uuid=Pc();originSize=new F;originCenter=new F;size=new F;matrix=new ne;matrixAutoUpdate=!0;userData={};version=0;_needsUpdate=!1;image;offset=new F;repeat=new F(1,1);center=new F;rotate=0;scale=1;flipY=!0;constructor(t={}){super(t),this.setAttrs(t)}destroy(){super.destroy()}set needsUpdate(t){t&&(this.version++,this._needsUpdate=!0)}get needsUpdate(){return this._needsUpdate}updateSize(t,e,i,a){return this.originSize.copy(t),this.originCenter.copy(e),this.flipY&&this.originCenter.multiplyScalar(1,-1),this.updateFinalSize(i,a)}updateFinalSize(t,e){t&&!F.isZero(t)&&!F.isEmpty(t)?Wr.copy(t):Wr.copy(this.originSize),Wr.maxXY(1,1);const i=Math.sqrt(Wr.x*Wr.x+Wr.y*Wr.y)/Math.sqrt(e.x*e.x+e.y*e.y);return i>1&&Wr.multiplyScalar(1/i),this.scale=Wr.length()/this.originSize.length(),this.repeat.multiplyScalar(this.originSize.length()/Wr.length()),this.size.copy(Wr),this.offset.copy(this.originSize).multiplyScalar(-.5).add(this.originCenter),this.updateMatrix(),this}reset(t,e){t&&this.originSize.copy(t),e&&this.size.copy(e),this.scale=this.size.x/this.originSize.x,this.repeat.set(1,1),this.center.set(0,0),this.rotate=0,this.offset.copy(this.originSize).multiplyScalar(.5).sub(this.originCenter).multiplyScalar(this.scale),this.updateMatrix()}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotate,this.center.x,this.center.y)}clone(){const t=this.constructor;return new t(this.attrs).copy(this)}copy(t){return this.name=t.name,this.originSize.copy(t.originSize),this.originCenter.copy(t.originCenter),this.size.copy(t.size),this.matrix.copy(t.matrix),this.matrixAutoUpdate=t.matrixAutoUpdate,this.userData=JSON.parse(JSON.stringify(t.userData)),this.image=t.image,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotate=t.rotate,this.scale=t.scale,this.flipY=t.flipY,this}}class en{static cached=new Map;static precisionOptimized=!0;static precisionOptimizeLevels=[.5,.25,1e-4];static initialized=!1;static textureMaxSize=new F;static DEBUG_DisplayCachedTexture=Mt.throttle((t=80,e=.8)=>{let i=qm();if(i||(i=Wm(t,e)),!i)throw new Error("dom not found");Vm(i,this.cached)},5e3);static destroy(){Object.values(this.cached).forEach(t=>{t.destroy()}),this.cached=new Map}static has(t){return this.cached.has(t)}static get(t,e){if(t)return!this.precisionOptimized||!e?this.cached.get(t):e&&e<this.precisionOptimizeLevels[2]?this.get(t+"_3"):e&&e<this.precisionOptimizeLevels[1]?this.get(t+"_2"):e&&e<this.precisionOptimizeLevels[0]?this.get(t+"_1"):this.get(t)}static set(t,e){if(!t||!e)throw new Error("error input");return this.cached.set(t,e),e}static remove(t){if(!t||!this.cached.has(t))return;const e=this.cached.get(t);if(e&&e.destroy(),this.cached.delete(t),this.precisionOptimized)for(let i=1,a=this.precisionOptimizeLevels.length;i<=a;i++){const o=t+"_"+i;let l;this.cached.has(o)&&(l=this.cached.get(o),l&&l.destroy(),this.cached.delete(o))}}static clear(){this.destroy()}static setTextureMaxSize(){this.initialized||(this.textureMaxSize.set(kt.config.width,kt.config.height).multiplyScalar(.5).round(),this.initialized=!0)}static getTextureMaxSize(){return this.initialized||this.setTextureMaxSize(),this.textureMaxSize}static getTextureByShape(t,e,i,a){var l;const o=new Hm;if(this.setTextureMaxSize(),o.scale=1,o.repeat.set(1,1),o.rotate=0,o.image=void 0,o.version=0,console.warn("getTextureByShape: ============================",t.name),e&&!F.isZero(e)&&!F.isEmpty(e))ma.copy(e),t.alignCenter?t.boundingBox.getCenter(va):va.set(0,0);else{if(t.isShape&&((l=t.geometry)!=null&&l.boundingBox))wo.copy(t.geometry.boundingBox);else if(t.boundingBox)wo.copy(t.boundingBox);else throw new Error("get boundingBox error");wo.getSize(ma),t.alignCenter?t.boundingBox.getCenter(va):wo.getCenter(va)}return i&&!F.isZero(i)&&!F.isEmpty(i)?Ci.copy(i):Ci.copy(ma),(Ci.x<lp.x||Ci.y<lp.y)&&Ci.normalize().multiplyScalar(10).round(),ai.copy(this.getTextureMaxSize()),a&&(xa.set((a==null?void 0:a.shadowBlur)||0,(a==null?void 0:a.shadowBlur)||0),Ci.add(xa.clone().multiplyScalar(2)),ma.multiplyScalar(3),ai.multiplyScalar(.3)),o.updateSize(ma,va,Ci,ai),o}static setPrecisionOptimizeTextures(t,e,i,a,o){if(!this.precisionOptimized)return;let l;for(let c=0,f=this.precisionOptimizeLevels.length;c<f;c++){ai.copy(i.size).multiplyScalar(this.precisionOptimizeLevels[c]);const d=this.getTextureByShape(e,a,ai,o);this.renderShapeTexture(e,d,o),l=t+"_"+(c+1),d.userData.textureKey=l,en.set(l,d)}}static renderShapeTexture(t,e,i){i?(xa.set(i.shadowBlur||0,i.shadowBlur||0),si.copy(e.originSize).multiplyScalar(-.5).sub(e.originCenter).multiplyScalar(e.scale),t.alignCenter?Ao.copy(e.originSize).multiplyScalar(e.scale):Ao.copy(e.originSize).add(xa.clone().multiplyScalar(1)).multiplyScalar(e.scale)):si.copy(e.offset).negate().multiplyScalar(e.scale);const a=wi.create(e.size.x,e.size.y),o=wi.getContext2D(a,{alpha:!0});if(t.isText||!t.matrix.hasChange())o.clearRect(0,0,a.width,a.height),o.translate(si.x,si.y),o.scale(e.scale,-e.scale);else{t.matrix.decompose(hp,Um,cp);const l=1/cp.x;si.sub(hp.multiplyScalar(l,-l)),o.clearRect(0,0,a.width,a.height),o.translate(si.x,si.y),o.scale(l,-l)}i&&(o.shadowColor=$t.black,o.shadowOffsetX=Ao.x,o.shadowOffsetY=Ao.y,o.shadowBlur=xa.x),t.render(o),e.image=a}static setByShape(t,e,i,a){const o=this.getTextureByShape(e,i,a);return o.userData.textureKey=t,this.renderShapeTexture(e,o),en.set(t,o),e.featureKey=t,o}static setShadowByShape(t,e,i){const a=this.getTextureByShape(e,void 0,void 0,i);return a.userData.textureKey=t,this.renderShapeTexture(e,a,i),en.set(t,a),a}static setPointsByShape(t,e){var d,g,E,_,C;const i=[];e.isGroup?e.traverse(R=>R.isShape?i.push(...R.geometry.points):void 0):e.isShape&&e.geometry.points?i.push(...e.geometry.points):e.boundingBox&&i.push(e.boundingBox.min,e.boundingBox.max);const a=this.getTextureByShape(e),o=((d=e.material)==null?void 0:d.lineWidth)*2||3;Di.set(1,1).multiplyScalar(o),a.size.copy(Di).multiplyScalar(a.scale).multiplyScalar(2).add(Ci),a.offset.sub(Di),a.updateMatrix();const l=wi.create(a.size.x,a.size.y),c=wi.getContext2D(l,{alpha:!0});si.subVectors(a.originSize.clone().multiplyScalar(.5),a.originCenter).add(Di),c.clearRect(0,0,l.width,l.height),c.scale(a.scale,a.scale),c.translate(si.x,si.y);let f=$t.black;e.material?f=((g=e.material)==null?void 0:g.stroke)||((E=e.material)==null?void 0:E.fill):e.isGroup&&e.children.length&&e.children[0].isShape&&(f=((_=e.children[0].material)==null?void 0:_.stroke)||((C=e.children[0].material)==null?void 0:C.fill)),c.fillStyle=Wt.getDarken(f);for(let R=0,N=i.length||0;R<N;R++)ai.copy(i[R]),c.moveTo(ai.x,ai.y),c.arc(ai.x,ai.y,Di.x,0,Math.PI*2);return c.fill(),a.image=l,en.set(t,a),a}static setWireframeByShape(t,e){var c;const i=this.getTextureByShape(e);Di.set(1,1).multiplyScalar(((c=e.mat)==null?void 0:c.lineWidth)||1),i.size.copy(Di).multiplyScalar(i.scale).multiplyScalar(2).add(Ci),i.offset.sub(Di),i.updateMatrix();const a=wi.create(i.size.x,i.size.y),o=wi.getContext2D(a,{alpha:!0}),l=Di.x*i.scale*5;return o.clearRect(0,0,a.width,a.height),o.strokeStyle=$t.darkGray,o.lineWidth=l,o.setLineDash([l*3,l]),o.strokeRect(0,0,i.size.x,i.size.y),i.image=a,en.set(t,i),i}}const lp=new F(10,10),ma=new F,va=new F,Ci=new F,si=new F,Ao=new F,xa=new F,ai=new F,Di=new F,wo=new Dt,hp=new F,Um=new F,cp=new F;function qm(){return window.document.getElementById("DEBUG_Displaycached")}function Wm(r=80,t=.8){const e=document.createElement("div");function i(){e.style.opacity="1"}function a(){e.style.opacity=t.toString()}return e.setAttribute("id","DEBUG_Displaycached"),e.style.position="absolute",e.style.width=r+"px",e.style.height="92vh",e.style.background=`rgba(255, 255, 255, ${t})`,e.style.left="20px",e.style.top="20px",e.style.overflow="auto",e.style.padding="6px",e.style.opacity=t.toString(),e.addEventListener("mouseenter",i),e.addEventListener("mouseleave",a),document.body.appendChild(e),e}function Vm(r,t){t.forEach((e,i)=>{!e||!e.image||zm(r,i,e)})}function zm(r,t,e){let i;for(let a=0,o=r.childNodes.length;a<o;a++)if(r.childNodes[a].getAttribute("id")===t){i=r.childNodes[a];break}i?Gm(i,e):$m(r,t,e)}function $m(r,t,e){if(!e.image)return;const i=kt.document.createElement("div");i.setAttribute("id",t),i.style.display="flex",i.style.flexDirection="column";const a=wi.createCanvas({containerId:r.id,width:e.image.width,height:e.image.height,dpr:window.devicePixelRatio});a.style.border=`${$t.yellow} 1px solid`,a.style.maxWidth=parseInt(r.style.width)-2+"px",a.style.maxHeight=parseInt(a.style.maxWidth)/(e.image.width/e.image.height)+"px";const o=a.getContext("2d",{alpha:!0});if(!o)throw new Error("getContext error");o.save(),o.scale(window.devicePixelRatio,window.devicePixelRatio),o.drawImage(e.image,0,0),o.restore(),i.appendChild(a);const l=kt.document.createElement("p");l.innerHTML=e.image.width+" * "+e.image.height,l.innerHTML+="<br/>"+t,l.style.margin="0",l.style.padding="0",l.style.lineHeight="1.2",l.style.fontSize="10px",l.style.padding="3px 0 6px 0",l.style.color=$t.black,i.appendChild(l),r.appendChild(i);function c(){const f=a.toDataURL("image/png",.6),d=document.createElement("a"),g=new MouseEvent("click");d.download=`thumb.${Date.now()}.png`,d.href=f,d.dispatchEvent(g)}i.addEventListener("click",c)}function Gm(r,t){if(!t.image)return;const e=r.querySelector("canvas");if(!e)return;const i=e.getContext("2d",{alpha:!0});if(!i)throw new Error("getContext error");i.clearRect(0,0,e.width,e.height),i.save(),i.scale(window.devicePixelRatio,window.devicePixelRatio),i.drawImage(t.image,0,0),i.restore()}class Ym extends Ge{cvs;worker;view;boundingBox=new Dt;viewTapHandler=this.handleViewTap.bind(this);multiSelectByRangeHandler=this.handleMultiSelectByRange.bind(this);workerMessageHandler=this.handleWorkerMessage.bind(this);cameraHandler=this.handleCameraChanged.bind(this);runningHandler=this.running.bind(this);constructor(t={},e){super(),t.workerRender=!0,this.params=t,kt.config=t;const i=wi.createCanvas(t);if(!i.transferControlToOffscreen)throw new Error("not support transferControlToOffscreen");this.cvs=i.transferControlToOffscreen(),this.view=new Im(t),this.view.camera.name="mainCamera",this.view.camera.resize(),this.worker=e,this.bindEvents()}destroy(){super.destroy(),this.unbindEvents(),this.worker.postMessage({task:St.TERMINATE}),this.worker.terminate()}bindEvents(){var t,e,i,a,o;(e=(t=this.view)==null?void 0:t.controller)==null||e.addEventListener(ot.TAP,this.viewTapHandler),(i=this.view)==null||i.addEventListener(St.MULTI_SELECT_BY_RANGE,this.multiSelectByRangeHandler),(o=(a=this.view)==null?void 0:a.camera)==null||o.addEventListener(lo.UPDATE,this.cameraHandler),this.worker.addEventListener("message",this.workerMessageHandler)}unbindEvents(){var t,e,i,a;(e=(t=this.view)==null?void 0:t.controller)==null||e.removeEventListener(ot.TAP,this.viewTapHandler),(a=(i=this.view)==null?void 0:i.controller)==null||a.removeEventListener(ot.CAMERA_CHANGED,this.cameraHandler),this.worker.removeEventListener("message",this.workerMessageHandler)}async handleViewTap(t){if((t==null?void 0:t.type)!==ot.TAP)return;const e=await this.promiseWorkerResponse(St.TAP,t.data);this.dispatchEvent({type:St.SELECTED,data:e})}handleWorkerMessage(t){var e,i,a,o,l,c;switch(t.data.task){case St.CAMERA_SYNC:if(!((e=t==null?void 0:t.data)!=null&&e.data))break;const f=JSON.parse(t.data.data);(a=(i=this.view)==null?void 0:i.camera)==null||a.fromJSON(f),this.view.camera.computeBoundingBox();break;case St.CAMERA_CHANGED:const{t:d,r:g,s:E}=t.data.data;(l=(o=this.view)==null?void 0:o.camera)==null||l.setTRS(d,g,E);break;case St.SCENES_CHANGED:const{box:_}=t.data.data;if(!_)return;this.boundingBox.fromString(_);break;case"syncTextureHelperCached":(((c=t.data)==null?void 0:c.data)||[]).forEach((C,R)=>en.set(R,C));break;case"pong":console.log("response: pong");break}}handleCameraChanged(t){this.worker.postMessage({task:St.CAMERA_CHANGED,data:t.data})}promiseWorkerResponse(t,e){return new Promise((i,a)=>{const o=c=>{var f;((f=c==null?void 0:c.data)==null?void 0:f.task)===t&&(this.worker.removeEventListener("message",o),this.worker.removeEventListener("error",l),i(c.data.data))},l=c=>{this.worker.removeEventListener("message",o),this.worker.removeEventListener("error",l),a(c.error)};this.worker.addEventListener("message",o),this.worker.addEventListener("error",l),this.worker.postMessage({task:t,data:e})})}async handleMultiSelectByRange(t){return this.promiseWorkerResponse(St.MULTI_SELECT_BY_RANGE,t.data)}resize(){var t;(t=this.view.camera)==null||t.resize()}async load(t,e){return this.promiseWorkerResponse(St.LOAD,{url:t,layers:e})}async getLayers(t=2){return this.promiseWorkerResponse(St.GET_LAYERS,{lv:t})}assetTypeChanged(t=$e.RM){this.params.assetType=t,this.worker.postMessage({task:St.ASSET_TYPE_CHANGED,data:t})}usedCacheChanged(t=!1){this.params.usedCache=t,this.worker.postMessage({task:St.USED_CACHE_CHANGED,data:t})}debounceCacheChanged(t=!1){this.params.debounceCache=t,this.worker.postMessage({task:St.DEBOUNCE_CACHE_CHANGED,data:t})}wireframeChanged(t=!1){this.params.wireframe=t,this.worker.postMessage({task:St.WIREFRAME_CHANGED,data:t})}bgPassChanged(t=!1){this.params.bgPass=t,this.worker.postMessage({task:St.BG_PASS_CHANGED,data:t})}async selectEnableChanged(t=!1){await this.clearSelected(),this.params.selectEnable=t,this.worker.postMessage({task:St.SELECT_ENABLE_CHANGED,data:t})}async multiSelectEnableChanged(t=!1){await this.clearSelected(),this.params.multiSelectEnable=t,this.view.multiSelectEnableChanged(t),this.worker.postMessage({task:St.MULTI_SELECT_ENABLE_CHANGED,data:t})}async zoomToSelectEnableChanged(t=!1){return this.params.zoomToSelectEnable=t,this.view.zoomToSelectEnableChanged(t),this.promiseWorkerResponse(St.ZOOM_TO_SELECT_ENABLE_CHANGED,{data:t})}async svgLoadingTypeChanged(t){return this.params.svgLoadingType=t,this.promiseWorkerResponse(St.SVG_LOADING_TYPE_CHANGED,t)}async fullscreen(){await this.view.resetCameraByBoundingBox(this.boundingBox,!0)}saveCameraPosition(t){this.view.saveCameraPosition(t)}restoreCameraPosition(t){this.view.restoreCameraPosition(t)}clearCameraPosition(t){this.view.clearCameraPosition(t)}updateLayersVisibility(t,e=!1){this.worker.postMessage({task:St.UPDATE_LAYERS_VISIBILITY,data:{ids:t,visible:e}})}clearSelected(t){return this.promiseWorkerResponse(St.CLEAR_SELECTED,{data:t})}selectByIds(t){this.worker.postMessage({task:St.SELECT_BY_IDS,data:t})}targetByIds(t){this.worker.postMessage({task:St.TARGET_BY_IDS,data:t})}async getAssetIdsByType(t){return this.promiseWorkerResponse(St.GET_ASSET_IDS_BY_TYPE,{assetType:t})}setFillByIds(t,e){this.worker.postMessage({task:St.SET_FILL_BY_IDS,data:{ids:t,c:e}})}clearFill(){this.worker.postMessage({task:St.CLEAR_FILL})}setStrokeByIds(t,e){this.worker.postMessage({task:St.SET_STROKE_BY_IDS,data:{ids:t,c:e}})}clearStroke(){this.worker.postMessage({task:St.CLEAR_STROKE})}async fontZoomIn(t=1.1){return this.promiseWorkerResponse(St.FONT_ZOOM_IN,t)}async fontZoomOut(t=.9){return this.promiseWorkerResponse(St.FONT_ZOOM_OUT,t)}start(){const t=this.cvs,e=JSON.stringify(this.params);this.worker.postMessage({task:St.INIT,data:{cvs:t,config:e}},[t]),requestAnimationFrame(this.runningHandler)}running(t){var e;(e=this.view)==null||e.update(t),requestAnimationFrame(this.runningHandler),en.DEBUG_DisplayCachedTexture()}stop(){}}function Xm(r){return new Worker("/environment.worker.js",{type:"module",name:r==null?void 0:r.name})}function Zm(r){return new Worker("/renderer.worker.js",{type:"module",name:r==null?void 0:r.name})}ce.AppEnum=op,ce.AppOffscreen=Ym,ce.AssetTypeEnum=$e,ce.Box2=l0,ce.Color=Wt,ce.ColorsEnum=$t,ce.EnvironmentWorker=Xm,ce.GLOB=kt,ce.LayerTypeEnum=Ks,ce.Monitor=Ft,ce.RendererWorker=Zm,ce.SvgApp=Bm,ce.Vector2=o0,ce.defaultConfig=Zn,Object.defineProperty(ce,Symbol.toStringTag,{value:"Module"})});
@@ -4035,7 +4035,7 @@ var Gw = Vx((La) => {
4035
4035
  Pa.normalizeLineEndings = Od;
4036
4036
  Pa.DOMParser = Md;
4037
4037
  var T_ = Pa.DOMParser;
4038
- const C_ = "1.0.62";
4038
+ const C_ = "1.0.63";
4039
4039
  function S_() {
4040
4040
  return typeof window < "u" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]");
4041
4041
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archgine",
3
- "version": "1.0.62",
3
+ "version": "1.0.63",
4
4
  "description": "A simple rendering engine developed by archbds.",
5
5
  "author": "diozhu@163.com",
6
6
  "license": "ISC",