1(function() { 2 const e = document.createElement("link").relList; 3 if (e && e.supports && e.supports("modulepreload")) 4 return; 5 for (const s of document.querySelectorAll('link[rel="modulepreload"]')) 6 n(s); 7 new MutationObserver(s=>{ 8 for (const o of s) 9 if (o.type === "childList") 10 for (const i of o.addedNodes) 11 i.tagName === "LINK" && i.rel === "modulepreload" && n(i) 12 } 13 ).observe(document, { 14 childList: !0, 15 subtree: !0 16 }); 17 function t(s) { 18 const o = {}; 19 return s.integrity && (o.integrity = s.integrity), 20 s.referrerPolicy && (o.referrerPolicy = s.referrerPolicy), 21 s.crossOrigin === "use-credentials" ? o.credentials = "include" : s.crossOrigin === "anonymous" ? o.credentials = "omit" : o.credentials = "same-origin", 22 o 23 } 24 function n(s) { 25 if (s.ep) 26 return; 27 s.ep = !0; 28 const o = t(s); 29 fetch(s.href, o) 30 } 31} 32)(); 33window.requestIdleCallback || (window.requestIdleCallback = function(l, e) { 34 let t = performance.now() 35 , n = e && e.timeout 36 , s = isNaN(n) ? Number.POSITIVE_INFINITY : t + Math.max(0, n); 37 return setTimeout(function() { 38 l({ 39 didTimeout: performance.now() > s, 40 timeRemaining: ()=>s === Number.POSITIVE_INFINITY ? 50 : Math.max(0, s - performance.now()) 41 }) 42 }, 1) 43} 44, 45window.cancelIdleCallback = function(l) { 46 clearTimeout(l) 47} 48); 49if (typeof Array.prototype.at != "function") { 50 const l = function(t) { 51 if (t = Math.trunc(t) || 0, 52 t < 0 && (t += this.length), 53 !(t < 0 || t >= this.length)) 54 return this[t] 55 } 56 , e = Reflect.getPrototypeOf(Int8Array); 57 for (const t of [Array, String, e]) 58 Object.defineProperty(t.prototype, "at", { 59 value: l, 60 writable: !0, 61 enumerable: !1, 62 configurable: !0 63 }) 64} 65/** 66* @vue/shared v3.5.32 67* (c) 2018-present Yuxi (Evan) You and Vue contributors 68* @license MIT
vendor: 4,904 bytes, lines 69-244
69**/ 70function Ic(l) { 71 const e = Object.create(null); 72 for (const t of l.split(",")) 73 e[t] = 1; 74 return t=>t in e 75} 76const ct = {} 77 , oi = [] 78 , On = ()=>{} 79 , qg = ()=>!1 80 , kd = l=>l.charCodeAt(0) === 111 && l.charCodeAt(1) === 110 && (l.charCodeAt(2) > 122 || l.charCodeAt(2) < 97) 81 , Ed = l=>l.startsWith("onUpdate:") 82 , Ft = Object.assign 83 , Lc = (l,e)=>{ 84 const t = l.indexOf(e); 85 t > -1 && l.splice(t, 1) 86} 87 , Kv = Object.prototype.hasOwnProperty 88 , rt = (l,e)=>Kv.call(l, e) 89 , ke = Array.isArray 90 , ii = l=>_i(l) === "[object Map]" 91 , jg = l=>_i(l) === "[object Set]" 92 , o0 = l=>_i(l) === "[object Date]" 93 , Wv = l=>_i(l) === "[object RegExp]" 94 , Le = l=>typeof l == "function" 95 , St = l=>typeof l == "string" 96 , kl = l=>typeof l == "symbol" 97 , ot = l=>l !== null && typeof l == "object" 98 , Jg = l=>(ot(l) || Le(l)) && Le(l.then) && Le(l.catch) 99 , Zg = Object.prototype.toString 100 , _i = l=>Zg.call(l) 101 , qv = l=>_i(l).slice(8, -1) 102 , Qg = l=>_i(l) === "[object Object]" 103 , Dd = l=>St(l) && l !== "NaN" && l[0] !== "-" && "" + parseInt(l, 10) === l 104 , nr = Ic(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted") 105 , Od = l=>{ 106 const e = Object.create(null); 107 return (t=>e[t] || (e[t] = l(t))) 108} 109 , jv = /-\w/g 110 , pl = Od(l=>l.replace(jv, e=>e.slice(1).toUpperCase())) 111 , Jv = /\B([A-Z])/g 112 , Us = Od(l=>l.replace(Jv, "-$1").toLowerCase()) 113 , Ad = Od(l=>l.charAt(0).toUpperCase() + l.slice(1)) 114 , bu = Od(l=>l ? `on${Ad(l)}` : "") 115 , Tn = (l,e)=>!Object.is(l, e) 116 , ri = (l,...e)=>{ 117 for (let t = 0; t < l.length; t++) 118 l[t](...e) 119} 120 , e1 = (l,e,t,n=!1)=>{ 121 Object.defineProperty(l, e, { 122 configurable: !0, 123 enumerable: !1, 124 writable: n, 125 value: t 126 }) 127} 128 , Vc = l=>{ 129 const e = parseFloat(l); 130 return isNaN(e) ? l : e 131} 132 , Zv = l=>{ 133 const e = St(l) ? Number(l) : NaN; 134 return isNaN(e) ? l : e 135} 136; 137let i0; 138const Id = ()=>i0 || (i0 = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {}); 139function xe(l) { 140 if (ke(l)) { 141 const e = {}; 142 for (let t = 0; t < l.length; t++) { 143 const n = l[t] 144 , s = St(n) ? lb(n) : xe(n); 145 if (s) 146 for (const o in s) 147 e[o] = s[o] 148 } 149 return e 150 } else if (St(l) || ot(l)) 151 return l 152} 153const Qv = /;(?![^(]*\))/g 154 , eb = /:([^]+)/ 155 , tb = /\/\*[^]*?\*\//g; 156function lb(l) { 157 const e = {}; 158 return l.replace(tb, "").split(Qv).forEach(t=>{ 159 if (t) { 160 const n = t.split(eb); 161 n.length > 1 && (e[n[0].trim()] = n[1].trim()) 162 } 163 } 164 ), 165 e 166} 167function Ne(l) { 168 let e = ""; 169 if (St(l)) 170 e = l; 171 else if (ke(l)) 172 for (let t = 0; t < l.length; t++) { 173 const n = Ne(l[t]); 174 n && (e += n + " ") 175 } 176 else if (ot(l)) 177 for (const t in l) 178 l[t] && (e += t + " "); 179 return e.trim() 180} 181function nb(l) { 182 if (!l) 183 return null; 184 let {class: e, style: t} = l; 185 return e && !St(e) && (l.class = Ne(e)), 186 t && (l.style = xe(t)), 187 l 188} 189const sb = "itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly" 190 , ob = Ic(sb); 191function t1(l) { 192 return !!l || l === "" 193} 194function ib(l, e) { 195 if (l.length !== e.length) 196 return !1; 197 let t = !0; 198 for (let n = 0; t && n < l.length; n++) 199 t = Mr(l[n], e[n]); 200 return t 201} 202function Mr(l, e) { 203 if (l === e) 204 return !0; 205 let t = o0(l) 206 , n = o0(e); 207 if (t || n) 208 return t && n ? l.getTime() === e.getTime() : !1; 209 if (t = kl(l), 210 n = kl(e), 211 t || n) 212 return l === e; 213 if (t = ke(l), 214 n = ke(e), 215 t || n) 216 return t && n ? ib(l, e) : !1; 217 if (t = ot(l), 218 n = ot(e), 219 t || n) { 220 if (!t || !n) 221 return !1; 222 const s = Object.keys(l).length 223 , o = Object.keys(e).length; 224 if (s !== o) 225 return !1; 226 for (const i in l) { 227 const r = l.hasOwnProperty(i) 228 , a = e.hasOwnProperty(i); 229 if (r && !a || !r && a || !Mr(l[i], e[i])) 230 return !1 231 } 232 } 233 return String(l) === String(e) 234} 235const l1 = l=>!!(l && l.__v_isRef === !0) 236 , se = l=>St(l) ? l : l == null ? "" : ke(l) || ot(l) && (l.toString === Zg || !Le(l.toString)) ? l1(l) ? se(l.value) : JSON.stringify(l, n1, 2) : String(l) 237 , n1 = (l,e)=>l1(e) ? n1(l, e.value) : ii(e) ? { 238 [`Map(${e.size})`]: [...e.entries()].reduce((t,[n,s],o)=>(t[Mu(n, o) + " =>"] = s, 239 t), {}) 240} : jg(e) ? { 241 [`Set(${e.size})`]: [...e.values()].map(t=>Mu(t)) 242} : kl(e) ? Mu(e) : ot(e) && !ke(e) && !Qg(e) ? String(e) : e 243 , Mu = (l,e="")=>{ 244 var t;
vendor: 5,143 bytes, lines 245-459
245 return kl(l) ? `Symbol(${(t = l.description) != null ? t : e})` : l 246} 247; 248/** 249* @vue/reactivity v3.5.32 250* (c) 2018-present Yuxi (Evan) You and Vue contributors 251* @license MIT 252**/ 253let ll; 254class s1 { 255 constructor(e=!1) { 256 this.detached = e, 257 this._active = !0, 258 this._on = 0, 259 this.effects = [], 260 this.cleanups = [], 261 this._isPaused = !1, 262 this.__v_skip = !0, 263 this.parent = ll, 264 !e && ll && (this.index = (ll.scopes || (ll.scopes = [])).push(this) - 1) 265 } 266 get active() { 267 return this._active 268 } 269 pause() { 270 if (this._active) { 271 this._isPaused = !0; 272 let e, t; 273 if (this.scopes) 274 for (e = 0, 275 t = this.scopes.length; e < t; e++) 276 this.scopes[e].pause(); 277 for (e = 0, 278 t = this.effects.length; e < t; e++) 279 this.effects[e].pause() 280 } 281 } 282 resume() { 283 if (this._active && this._isPaused) { 284 this._isPaused = !1; 285 let e, t; 286 if (this.scopes) 287 for (e = 0, 288 t = this.scopes.length; e < t; e++) 289 this.scopes[e].resume(); 290 for (e = 0, 291 t = this.effects.length; e < t; e++) 292 this.effects[e].resume() 293 } 294 } 295 run(e) { 296 if (this._active) { 297 const t = ll; 298 try { 299 return ll = this, 300 e() 301 } finally { 302 ll = t 303 } 304 } 305 } 306 on() { 307 ++this._on === 1 && (this.prevScope = ll, 308 ll = this) 309 } 310 off() { 311 this._on > 0 && --this._on === 0 && (ll = this.prevScope, 312 this.prevScope = void 0) 313 } 314 stop(e) { 315 if (this._active) { 316 this._active = !1; 317 let t, n; 318 for (t = 0, 319 n = this.effects.length; t < n; t++) 320 this.effects[t].stop(); 321 for (this.effects.length = 0, 322 t = 0, 323 n = this.cleanups.length; t < n; t++) 324 this.cleanups[t](); 325 if (this.cleanups.length = 0, 326 this.scopes) { 327 for (t = 0, 328 n = this.scopes.length; t < n; t++) 329 this.scopes[t].stop(!0); 330 this.scopes.length = 0 331 } 332 if (!this.detached && this.parent && !e) { 333 const s = this.parent.scopes.pop(); 334 s && s !== this && (this.parent.scopes[this.index] = s, 335 s.index = this.index) 336 } 337 this.parent = void 0 338 } 339 } 340} 341function Nc(l) { 342 return new s1(l) 343} 344function o1() { 345 return ll 346} 347function rb(l, e=!1) { 348 ll && ll.cleanups.push(l) 349} 350let mt; 351const Su = new WeakSet; 352class i1 { 353 constructor(e) { 354 this.fn = e, 355 this.deps = void 0, 356 this.depsTail = void 0, 357 this.flags = 5, 358 this.next = void 0, 359 this.cleanup = void 0, 360 this.scheduler = void 0, 361 ll && ll.active && ll.effects.push(this) 362 } 363 pause() { 364 this.flags |= 64 365 } 366 resume() { 367 this.flags & 64 && (this.flags &= -65, 368 Su.has(this) && (Su.delete(this), 369 this.trigger())) 370 } 371 notify() { 372 this.flags & 2 && !(this.flags & 32) || this.flags & 8 || a1(this) 373 } 374 run() { 375 if (!(this.flags & 1)) 376 return this.fn(); 377 this.flags |= 2, 378 r0(this), 379 d1(this); 380 const e = mt 381 , t = sn; 382 mt = this, 383 sn = !0; 384 try { 385 return this.fn() 386 } finally { 387 u1(this), 388 mt = e, 389 sn = t, 390 this.flags &= -3 391 } 392 } 393 stop() { 394 if (this.flags & 1) { 395 for (let e = this.deps; e; e = e.nextDep) 396 Bc(e); 397 this.deps = this.depsTail = void 0, 398 r0(this), 399 this.onStop && this.onStop(), 400 this.flags &= -2 401 } 402 } 403 trigger() { 404 this.flags & 64 ? Su.add(this) : this.scheduler ? this.scheduler() : this.runIfDirty() 405 } 406 runIfDirty() { 407 vh(this) && this.run() 408 } 409 get dirty() { 410 return vh(this) 411 } 412} 413let r1 = 0, sr, or; 414function a1(l, e=!1) { 415 if (l.flags |= 8, 416 e) { 417 l.next = or, 418 or = l; 419 return 420 } 421 l.next = sr, 422 sr = l 423} 424function Rc() { 425 r1++ 426} 427function Fc() { 428 if (--r1 > 0) 429 return; 430 if (or) { 431 let e = or; 432 for (or = void 0; e; ) { 433 const t = e.next; 434 e.next = void 0, 435 e.flags &= -9, 436 e = t 437 } 438 } 439 let l; 440 for (; sr; ) { 441 let e = sr; 442 for (sr = void 0; e; ) { 443 const t = e.next; 444 if (e.next = void 0, 445 e.flags &= -9, 446 e.flags & 1) 447 try { 448 e.trigger() 449 } catch (n) { 450 l || (l = n) 451 } 452 e = t 453 } 454 } 455 if (l) 456 throw l 457} 458function d1(l) { 459 for (let e = l.deps; e; e = e.nextDep)
vendor: 23,786 bytes, lines 460-1419
460 e.version = -1, 461 e.prevActiveLink = e.dep.activeLink, 462 e.dep.activeLink = e 463} 464function u1(l) { 465 let e, t = l.depsTail, n = t; 466 for (; n; ) { 467 const s = n.prevDep; 468 n.version === -1 ? (n === t && (t = s), 469 Bc(n), 470 ab(n)) : e = n, 471 n.dep.activeLink = n.prevActiveLink, 472 n.prevActiveLink = void 0, 473 n = s 474 } 475 l.deps = e, 476 l.depsTail = t 477} 478function vh(l) { 479 for (let e = l.deps; e; e = e.nextDep) 480 if (e.dep.version !== e.version || e.dep.computed && (h1(e.dep.computed) || e.dep.version !== e.version)) 481 return !0; 482 return !!l._dirty 483} 484function h1(l) { 485 if (l.flags & 4 && !(l.flags & 16) || (l.flags &= -17, 486 l.globalVersion === Sr) || (l.globalVersion = Sr, 487 !l.isSSR && l.flags & 128 && (!l.deps && !l._dirty || !vh(l)))) 488 return; 489 l.flags |= 2; 490 const e = l.dep 491 , t = mt 492 , n = sn; 493 mt = l, 494 sn = !0; 495 try { 496 d1(l); 497 const s = l.fn(l._value); 498 (e.version === 0 || Tn(s, l._value)) && (l.flags |= 128, 499 l._value = s, 500 e.version++) 501 } catch (s) { 502 throw e.version++, 503 s 504 } finally { 505 mt = t, 506 sn = n, 507 u1(l), 508 l.flags &= -3 509 } 510} 511function Bc(l, e=!1) { 512 const {dep: t, prevSub: n, nextSub: s} = l; 513 if (n && (n.nextSub = s, 514 l.prevSub = void 0), 515 s && (s.prevSub = n, 516 l.nextSub = void 0), 517 t.subs === l && (t.subs = n, 518 !n && t.computed)) { 519 t.computed.flags &= -5; 520 for (let o = t.computed.deps; o; o = o.nextDep) 521 Bc(o, !0) 522 } 523 !e && !--t.sc && t.map && t.map.delete(t.key) 524} 525function ab(l) { 526 const {prevDep: e, nextDep: t} = l; 527 e && (e.nextDep = t, 528 l.prevDep = void 0), 529 t && (t.prevDep = e, 530 l.nextDep = void 0) 531} 532let sn = !0; 533const c1 = []; 534function os() { 535 c1.push(sn), 536 sn = !1 537} 538function is() { 539 const l = c1.pop(); 540 sn = l === void 0 ? !0 : l 541} 542function r0(l) { 543 const {cleanup: e} = l; 544 if (l.cleanup = void 0, 545 e) { 546 const t = mt; 547 mt = void 0; 548 try { 549 e() 550 } finally { 551 mt = t 552 } 553 } 554} 555let Sr = 0; 556class db { 557 constructor(e, t) { 558 this.sub = e, 559 this.dep = t, 560 this.version = t.version, 561 this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0 562 } 563} 564class zc { 565 constructor(e) { 566 this.computed = e, 567 this.version = 0, 568 this.activeLink = void 0, 569 this.subs = void 0, 570 this.map = void 0, 571 this.key = void 0, 572 this.sc = 0, 573 this.__v_skip = !0 574 } 575 track(e) { 576 if (!mt || !sn || mt === this.computed) 577 return; 578 let t = this.activeLink; 579 if (t === void 0 || t.sub !== mt) 580 t = this.activeLink = new db(mt,this), 581 mt.deps ? (t.prevDep = mt.depsTail, 582 mt.depsTail.nextDep = t, 583 mt.depsTail = t) : mt.deps = mt.depsTail = t, 584 f1(t); 585 else if (t.version === -1 && (t.version = this.version, 586 t.nextDep)) { 587 const n = t.nextDep; 588 n.prevDep = t.prevDep, 589 t.prevDep && (t.prevDep.nextDep = n), 590 t.prevDep = mt.depsTail, 591 t.nextDep = void 0, 592 mt.depsTail.nextDep = t, 593 mt.depsTail = t, 594 mt.deps === t && (mt.deps = n) 595 } 596 return t 597 } 598 trigger(e) { 599 this.version++, 600 Sr++, 601 this.notify(e) 602 } 603 notify(e) { 604 Rc(); 605 try { 606 for (let t = this.subs; t; t = t.prevSub) 607 t.sub.notify() && t.sub.dep.notify() 608 } finally { 609 Fc() 610 } 611 } 612} 613function f1(l) { 614 if (l.dep.sc++, 615 l.sub.flags & 4) { 616 const e = l.dep.computed; 617 if (e && !l.dep.subs) { 618 e.flags |= 20; 619 for (let n = e.deps; n; n = n.nextDep) 620 f1(n) 621 } 622 const t = l.dep.subs; 623 t !== l && (l.prevSub = t, 624 t && (t.nextSub = l)), 625 l.dep.subs = l 626 } 627} 628const Ha = new WeakMap 629 , ko = Symbol("") 630 , bh = Symbol("") 631 , wr = Symbol(""); 632function ol(l, e, t) { 633 if (sn && mt) { 634 let n = Ha.get(l); 635 n || Ha.set(l, n = new Map); 636 let s = n.get(t); 637 s || (n.set(t, s = new zc), 638 s.map = n, 639 s.key = t), 640 s.track() 641 } 642} 643function Yn(l, e, t, n, s, o) { 644 const i = Ha.get(l); 645 if (!i) { 646 Sr++; 647 return 648 } 649 const r = a=>{ 650 a && a.trigger() 651 } 652 ; 653 if (Rc(), 654 e === "clear") 655 i.forEach(r); 656 else { 657 const a = ke(l) 658 , d = a && Dd(t); 659 if (a && t === "length") { 660 const u = Number(n); 661 i.forEach((h,c)=>{ 662 (c === "length" || c === wr || !kl(c) && c >= u) && r(h) 663 } 664 ) 665 } else 666 switch ((t !== void 0 || i.has(void 0)) && r(i.get(t)), 667 d && r(i.get(wr)), 668 e) { 669 case "add": 670 a ? d && r(i.get("length")) : (r(i.get(ko)), 671 ii(l) && r(i.get(bh))); 672 break; 673 case "delete": 674 a || (r(i.get(ko)), 675 ii(l) && r(i.get(bh))); 676 break; 677 case "set": 678 ii(l) && r(i.get(ko)); 679 break 680 } 681 } 682 Fc() 683} 684function ub(l, e) { 685 const t = Ha.get(l); 686 return t && t.get(e) 687} 688function Yo(l) { 689 const e = Oe(l); 690 return e === l ? e : (ol(e, "iterate", wr), 691 _l(l) ? e : e.map(rn)) 692} 693function Ld(l) { 694 return ol(l = Oe(l), "iterate", wr), 695 l 696} 697function Cn(l, e) { 698 return rs(l) ? gi(ls(l) ? rn(e) : e) : rn(e) 699} 700const hb = { 701 __proto__: null, 702 [Symbol.iterator]() { 703 return wu(this, Symbol.iterator, l=>Cn(this, l)) 704 }, 705 concat(...l) { 706 return Yo(this).concat(...l.map(e=>ke(e) ? Yo(e) : e)) 707 }, 708 entries() { 709 return wu(this, "entries", l=>(l[1] = Cn(this, l[1]), 710 l)) 711 }, 712 every(l, e) { 713 return zn(this, "every", l, e, void 0, arguments) 714 }, 715 filter(l, e) { 716 return zn(this, "filter", l, e, t=>t.map(n=>Cn(this, n)), arguments) 717 }, 718 find(l, e) { 719 return zn(this, "find", l, e, t=>Cn(this, t), arguments) 720 }, 721 findIndex(l, e) { 722 return zn(this, "findIndex", l, e, void 0, arguments) 723 }, 724 findLast(l, e) { 725 return zn(this, "findLast", l, e, t=>Cn(this, t), arguments) 726 }, 727 findLastIndex(l, e) { 728 return zn(this, "findLastIndex", l, e, void 0, arguments) 729 }, 730 forEach(l, e) { 731 return zn(this, "forEach", l, e, void 0, arguments) 732 }, 733 includes(...l) { 734 return Pu(this, "includes", l) 735 }, 736 indexOf(...l) { 737 return Pu(this, "indexOf", l) 738 }, 739 join(l) { 740 return Yo(this).join(l) 741 }, 742 lastIndexOf(...l) { 743 return Pu(this, "lastIndexOf", l) 744 }, 745 map(l, e) { 746 return zn(this, "map", l, e, void 0, arguments) 747 }, 748 pop() { 749 return Ni(this, "pop") 750 }, 751 push(...l) { 752 return Ni(this, "push", l) 753 }, 754 reduce(l, ...e) { 755 return a0(this, "reduce", l, e) 756 }, 757 reduceRight(l, ...e) { 758 return a0(this, "reduceRight", l, e) 759 }, 760 shift() { 761 return Ni(this, "shift") 762 }, 763 some(l, e) { 764 return zn(this, "some", l, e, void 0, arguments) 765 }, 766 splice(...l) { 767 return Ni(this, "splice", l) 768 }, 769 toReversed() { 770 return Yo(this).toReversed() 771 }, 772 toSorted(l) { 773 return Yo(this).toSorted(l) 774 }, 775 toSpliced(...l) { 776 return Yo(this).toSpliced(...l) 777 }, 778 unshift(...l) { 779 return Ni(this, "unshift", l) 780 }, 781 values() { 782 return wu(this, "values", l=>Cn(this, l)) 783 } 784}; 785function wu(l, e, t) { 786 const n = Ld(l) 787 , s = n[e](); 788 return n !== l && !_l(l) && (s._next = s.next, 789 s.next = ()=>{ 790 const o = s._next(); 791 return o.done || (o.value = t(o.value)), 792 o 793 } 794 ), 795 s 796} 797const cb = Array.prototype; 798function zn(l, e, t, n, s, o) { 799 const i = Ld(l) 800 , r = i !== l && !_l(l) 801 , a = i[e]; 802 if (a !== cb[e]) { 803 const h = a.apply(l, o); 804 return r ? rn(h) : h 805 } 806 let d = t; 807 i !== l && (r ? d = function(h, c) { 808 return t.call(this, Cn(l, h), c, l) 809 } 810 : t.length > 2 && (d = function(h, c) { 811 return t.call(this, h, c, l) 812 } 813 )); 814 const u = a.call(i, d, n); 815 return r && s ? s(u) : u 816} 817function a0(l, e, t, n) { 818 const s = Ld(l) 819 , o = s !== l && !_l(l); 820 let i = t 821 , r = !1; 822 s !== l && (o ? (r = n.length === 0, 823 i = function(d, u, h) { 824 return r && (r = !1, 825 d = Cn(l, d)), 826 t.call(this, d, Cn(l, u), h, l) 827 } 828 ) : t.length > 3 && (i = function(d, u, h) { 829 return t.call(this, d, u, h, l) 830 } 831 )); 832 const a = s[e](i, ...n); 833 return r ? Cn(l, a) : a 834} 835function Pu(l, e, t) { 836 const n = Oe(l); 837 ol(n, "iterate", wr); 838 const s = n[e](...t); 839 return (s === -1 || s === !1) && Vd(t[0]) ? (t[0] = Oe(t[0]), 840 n[e](...t)) : s 841} 842function Ni(l, e, t=[]) { 843 os(), 844 Rc(); 845 const n = Oe(l)[e].apply(l, t); 846 return Fc(), 847 is(), 848 n 849} 850const fb = Ic("__proto__,__v_isRef,__isVue") 851 , p1 = new Set(Object.getOwnPropertyNames(Symbol).filter(l=>l !== "arguments" && l !== "caller").map(l=>Symbol[l]).filter(kl)); 852function pb(l) { 853 kl(l) || (l = String(l)); 854 const e = Oe(this); 855 return ol(e, "has", l), 856 e.hasOwnProperty(l) 857} 858class g1 { 859 constructor(e=!1, t=!1) { 860 this._isReadonly = e, 861 this._isShallow = t 862 } 863 get(e, t, n) { 864 if (t === "__v_skip") 865 return e.__v_skip; 866 const s = this._isReadonly 867 , o = this._isShallow; 868 if (t === "__v_isReactive") 869 return !s; 870 if (t === "__v_isReadonly") 871 return s; 872 if (t === "__v_isShallow") 873 return o; 874 if (t === "__v_raw") 875 return n === (s ? o ? xb : b1 : o ? v1 : y1).get(e) || Object.getPrototypeOf(e) === Object.getPrototypeOf(n) ? e : void 0; 876 const i = ke(e); 877 if (!s) { 878 let a; 879 if (i && (a = hb[t])) 880 return a; 881 if (t === "hasOwnProperty") 882 return pb 883 } 884 const r = Reflect.get(e, t, wt(e) ? e : n); 885 if ((kl(t) ? p1.has(t) : fb(t)) || (s || ol(e, "get", t), 886 o)) 887 return r; 888 if (wt(r)) { 889 const a = i && Dd(t) ? r : r.value; 890 return s && ot(a) ? Sh(a) : a 891 } 892 return ot(r) ? s ? Sh(r) : Et(r) : r 893 } 894} 895class m1 extends g1 { 896 constructor(e=!1) { 897 super(!1, e) 898 } 899 set(e, t, n, s) { 900 let o = e[t]; 901 const i = ke(e) && Dd(t); 902 if (!this._isShallow) { 903 const d = rs(o); 904 if (!_l(n) && !rs(n) && (o = Oe(o), 905 n = Oe(n)), 906 !i && wt(o) && !wt(n)) 907 return d || (o.value = n), 908 !0 909 } 910 const r = i ? Number(t) < e.length : rt(e, t) 911 , a = Reflect.set(e, t, n, wt(e) ? e : s); 912 return e === Oe(s) && (r ? Tn(n, o) && Yn(e, "set", t, n) : Yn(e, "add", t, n)), 913 a 914 } 915 deleteProperty(e, t) { 916 const n = rt(e, t); 917 e[t]; 918 const s = Reflect.deleteProperty(e, t); 919 return s && n && Yn(e, "delete", t, void 0), 920 s 921 } 922 has(e, t) { 923 const n = Reflect.has(e, t); 924 return (!kl(t) || !p1.has(t)) && ol(e, "has", t), 925 n 926 } 927 ownKeys(e) { 928 return ol(e, "iterate", ke(e) ? "length" : ko), 929 Reflect.ownKeys(e) 930 } 931} 932class gb extends g1 { 933 constructor(e=!1) { 934 super(!0, e) 935 } 936 set(e, t) { 937 return !0 938 } 939 deleteProperty(e, t) { 940 return !0 941 } 942} 943const mb = new m1 944 , yb = new gb 945 , vb = new m1(!0); 946const Mh = l=>l 947 , sa = l=>Reflect.getPrototypeOf(l); 948function bb(l, e, t) { 949 return function(...n) { 950 const s = this.__v_raw 951 , o = Oe(s) 952 , i = ii(o) 953 , r = l === "entries" || l === Symbol.iterator && i 954 , a = l === "keys" && i 955 , d = s[l](...n) 956 , u = t ? Mh : e ? gi : rn; 957 return !e && ol(o, "iterate", a ? bh : ko), 958 Ft(Object.create(d), { 959 next() { 960 const {value: h, done: c} = d.next(); 961 return c ? { 962 value: h, 963 done: c 964 } : { 965 value: r ? [u(h[0]), u(h[1])] : u(h), 966 done: c 967 } 968 } 969 }) 970 } 971} 972function oa(l) { 973 return function(...e) { 974 return l === "delete" ? !1 : l === "clear" ? void 0 : this 975 } 976} 977function Mb(l, e) { 978 const t = { 979 get(s) { 980 const o = this.__v_raw 981 , i = Oe(o) 982 , r = Oe(s); 983 l || (Tn(s, r) && ol(i, "get", s), 984 ol(i, "get", r)); 985 const {has: a} = sa(i) 986 , d = e ? Mh : l ? gi : rn; 987 if (a.call(i, s)) 988 return d(o.get(s)); 989 if (a.call(i, r)) 990 return d(o.get(r)); 991 o !== i && o.get(s) 992 }, 993 get size() { 994 const s = this.__v_raw; 995 return !l && ol(Oe(s), "iterate", ko), 996 s.size 997 }, 998 has(s) { 999 const o = this.__v_raw 1000 , i = Oe(o) 1001 , r = Oe(s); 1002 return l || (Tn(s, r) && ol(i, "has", s), 1003 ol(i, "has", r)), 1004 s === r ? o.has(s) : o.has(s) || o.has(r) 1005 }, 1006 forEach(s, o) { 1007 const i = this 1008 , r = i.__v_raw 1009 , a = Oe(r) 1010 , d = e ? Mh : l ? gi : rn; 1011 return !l && ol(a, "iterate", ko), 1012 r.forEach((u,h)=>s.call(o, d(u), d(h), i)) 1013 } 1014 }; 1015 return Ft(t, l ? { 1016 add: oa("add"), 1017 set: oa("set"), 1018 delete: oa("delete"), 1019 clear: oa("clear") 1020 } : { 1021 add(s) { 1022 const o = Oe(this) 1023 , i = sa(o) 1024 , r = Oe(s) 1025 , a = !e && !_l(s) && !rs(s) ? r : s; 1026 return i.has.call(o, a) || Tn(s, a) && i.has.call(o, s) || Tn(r, a) && i.has.call(o, r) || (o.add(a), 1027 Yn(o, "add", a, a)), 1028 this 1029 }, 1030 set(s, o) { 1031 !e && !_l(o) && !rs(o) && (o = Oe(o)); 1032 const i = Oe(this) 1033 , {has: r, get: a} = sa(i); 1034 let d = r.call(i, s); 1035 d || (s = Oe(s), 1036 d = r.call(i, s)); 1037 const u = a.call(i, s); 1038 return i.set(s, o), 1039 d ? Tn(o, u) && Yn(i, "set", s, o) : Yn(i, "add", s, o), 1040 this 1041 }, 1042 delete(s) { 1043 const o = Oe(this) 1044 , {has: i, get: r} = sa(o); 1045 let a = i.call(o, s); 1046 a || (s = Oe(s), 1047 a = i.call(o, s)), 1048 r && r.call(o, s); 1049 const d = o.delete(s); 1050 return a && Yn(o, "delete", s, void 0), 1051 d 1052 }, 1053 clear() { 1054 const s = Oe(this) 1055 , o = s.size !== 0 1056 , i = s.clear(); 1057 return o && Yn(s, "clear", void 0, void 0), 1058 i 1059 } 1060 }), 1061 ["keys", "values", "entries", Symbol.iterator].forEach(s=>{ 1062 t[s] = bb(s, l, e) 1063 } 1064 ), 1065 t 1066} 1067function Uc(l, e) { 1068 const t = Mb(l, e); 1069 return (n,s,o)=>s === "__v_isReactive" ? !l : s === "__v_isReadonly" ? l : s === "__v_raw" ? n : Reflect.get(rt(t, s) && s in n ? t : n, s, o) 1070} 1071const Sb = { 1072 get: Uc(!1, !1) 1073} 1074 , wb = { 1075 get: Uc(!1, !0) 1076} 1077 , Pb = { 1078 get: Uc(!0, !1) 1079}; 1080const y1 = new WeakMap 1081 , v1 = new WeakMap 1082 , b1 = new WeakMap 1083 , xb = new WeakMap; 1084function Cb(l) { 1085 switch (l) { 1086 case "Object": 1087 case "Array": 1088 return 1; 1089 case "Map": 1090 case "Set": 1091 case "WeakMap": 1092 case "WeakSet": 1093 return 2; 1094 default: 1095 return 0 1096 } 1097} 1098function _b(l) { 1099 return l.__v_skip || !Object.isExtensible(l) ? 0 : Cb(qv(l)) 1100} 1101function Et(l) { 1102 return rs(l) ? l : Gc(l, !1, mb, Sb, y1) 1103} 1104function qn(l) { 1105 return Gc(l, !1, vb, wb, v1) 1106} 1107function Sh(l) { 1108 return Gc(l, !0, yb, Pb, b1) 1109} 1110function Gc(l, e, t, n, s) { 1111 if (!ot(l) || l.__v_raw && !(e && l.__v_isReactive)) 1112 return l; 1113 const o = _b(l); 1114 if (o === 0) 1115 return l; 1116 const i = s.get(l); 1117 if (i) 1118 return i; 1119 const r = new Proxy(l,o === 2 ? n : t); 1120 return s.set(l, r), 1121 r 1122} 1123function ls(l) { 1124 return rs(l) ? ls(l.__v_raw) : !!(l && l.__v_isReactive) 1125} 1126function rs(l) { 1127 return !!(l && l.__v_isReadonly) 1128} 1129function _l(l) { 1130 return !!(l && l.__v_isShallow) 1131} 1132function Vd(l) { 1133 return l ? !!l.__v_raw : !1 1134} 1135function Oe(l) { 1136 const e = l && l.__v_raw; 1137 return e ? Oe(e) : l 1138} 1139function me(l) { 1140 return !rt(l, "__v_skip") && Object.isExtensible(l) && e1(l, "__v_skip", !0), 1141 l 1142} 1143const rn = l=>ot(l) ? Et(l) : l 1144 , gi = l=>ot(l) ? Sh(l) : l; 1145function wt(l) { 1146 return l ? l.__v_isRef === !0 : !1 1147} 1148function Nd(l) { 1149 return M1(l, !1) 1150} 1151function ns(l) { 1152 return M1(l, !0) 1153} 1154function M1(l, e) { 1155 return wt(l) ? l : new Tb(l,e) 1156} 1157class Tb { 1158 constructor(e, t) { 1159 this.dep = new zc, 1160 this.__v_isRef = !0, 1161 this.__v_isShallow = !1, 1162 this._rawValue = t ? e : Oe(e), 1163 this._value = t ? e : rn(e), 1164 this.__v_isShallow = t 1165 } 1166 get value() { 1167 return this.dep.track(), 1168 this._value 1169 } 1170 set value(e) { 1171 const t = this._rawValue 1172 , n = this.__v_isShallow || _l(e) || rs(e); 1173 e = n ? e : Oe(e), 1174 Tn(e, t) && (this._rawValue = e, 1175 this._value = n ? e : rn(e), 1176 this.dep.trigger()) 1177 } 1178} 1179function S1(l) { 1180 return wt(l) ? l.value : l 1181} 1182const kb = { 1183 get: (l,e,t)=>e === "__v_raw" ? l : S1(Reflect.get(l, e, t)), 1184 set: (l,e,t,n)=>{ 1185 const s = l[e]; 1186 return wt(s) && !wt(t) ? (s.value = t, 1187 !0) : Reflect.set(l, e, t, n) 1188 } 1189}; 1190function w1(l) { 1191 return ls(l) ? l : new Proxy(l,kb) 1192} 1193function Eb(l) { 1194 const e = ke(l) ? new Array(l.length) : {}; 1195 for (const t in l) 1196 e[t] = P1(l, t); 1197 return e 1198} 1199class Db { 1200 constructor(e, t, n) { 1201 this._object = e, 1202 this._defaultValue = n, 1203 this.__v_isRef = !0, 1204 this._value = void 0, 1205 this._key = kl(t) ? t : String(t), 1206 this._raw = Oe(e); 1207 let s = !0 1208 , o = e; 1209 if (!ke(e) || kl(this._key) || !Dd(this._key)) 1210 do 1211 s = !Vd(o) || _l(o); 1212 while (s && (o = o.__v_raw)); 1213 this._shallow = s 1214 } 1215 get value() { 1216 let e = this._object[this._key]; 1217 return this._shallow && (e = S1(e)), 1218 this._value = e === void 0 ? this._defaultValue : e 1219 } 1220 set value(e) { 1221 if (this._shallow && wt(this._raw[this._key])) { 1222 const t = this._object[this._key]; 1223 if (wt(t)) { 1224 t.value = e; 1225 return 1226 } 1227 } 1228 this._object[this._key] = e 1229 } 1230 get dep() { 1231 return ub(this._raw, this._key) 1232 } 1233} 1234class Ob { 1235 constructor(e) { 1236 this._getter = e, 1237 this.__v_isRef = !0, 1238 this.__v_isReadonly = !0, 1239 this._value = void 0 1240 } 1241 get value() { 1242 return this._value = this._getter() 1243 } 1244} 1245function Ab(l, e, t) { 1246 return wt(l) ? l : Le(l) ? new Ob(l) : ot(l) && arguments.length > 1 ? P1(l, e, t) : Nd(l) 1247} 1248function P1(l, e, t) { 1249 return new Db(l,e,t) 1250} 1251class Ib { 1252 constructor(e, t, n) { 1253 this.fn = e, 1254 this.setter = t, 1255 this._value = void 0, 1256 this.dep = new zc(this), 1257 this.__v_isRef = !0, 1258 this.deps = void 0, 1259 this.depsTail = void 0, 1260 this.flags = 16, 1261 this.globalVersion = Sr - 1, 1262 this.next = void 0, 1263 this.effect = this, 1264 this.__v_isReadonly = !t, 1265 this.isSSR = n 1266 } 1267 notify() { 1268 if (this.flags |= 16, 1269 !(this.flags & 8) && mt !== this) 1270 return a1(this, !0), 1271 !0 1272 } 1273 get value() { 1274 const e = this.dep.track(); 1275 return h1(this), 1276 e && (e.version = this.dep.version), 1277 this._value 1278 } 1279 set value(e) { 1280 this.setter && this.setter(e) 1281 } 1282} 1283function Lb(l, e, t=!1) { 1284 let n, s; 1285 return Le(l) ? n = l : (n = l.get, 1286 s = l.set), 1287 new Ib(n,s,t) 1288} 1289const ia = {} 1290 , $a = new WeakMap; 1291let bo; 1292function Vb(l, e=!1, t=bo) { 1293 if (t) { 1294 let n = $a.get(t); 1295 n || $a.set(t, n = []), 1296 n.push(l) 1297 } 1298} 1299function Nb(l, e, t=ct) { 1300 const {immediate: n, deep: s, once: o, scheduler: i, augmentJob: r, call: a} = t 1301 , d = S=>s ? S : _l(S) || s === !1 || s === 0 ? Kn(S, 1) : Kn(S); 1302 let u, h, c, f, p = !1, g = !1; 1303 if (wt(l) ? (h = ()=>l.value, 1304 p = _l(l)) : ls(l) ? (h = ()=>d(l), 1305 p = !0) : ke(l) ? (g = !0, 1306 p = l.some(S=>ls(S) || _l(S)), 1307 h = ()=>l.map(S=>{ 1308 if (wt(S)) 1309 return S.value; 1310 if (ls(S)) 1311 return d(S); 1312 if (Le(S)) 1313 return a ? a(S, 2) : S() 1314 } 1315 )) : Le(l) ? e ? h = a ? ()=>a(l, 2) : l : h = ()=>{ 1316 if (c) { 1317 os(); 1318 try { 1319 c() 1320 } finally { 1321 is() 1322 } 1323 } 1324 const S = bo; 1325 bo = u; 1326 try { 1327 return a ? a(l, 3, [f]) : l(f) 1328 } finally { 1329 bo = S 1330 } 1331 } 1332 : h = On, 1333 e && s) { 1334 const S = h 1335 , x = s === !0 ? 1 / 0 : s; 1336 h = ()=>Kn(S(), x) 1337 } 1338 const y = o1() 1339 , m = ()=>{ 1340 u.stop(), 1341 y && y.active && Lc(y.effects, u) 1342 } 1343 ; 1344 if (o && e) { 1345 const S = e; 1346 e = (...x)=>{ 1347 S(...x), 1348 m() 1349 } 1350 } 1351 let b = g ? new Array(l.length).fill(ia) : ia; 1352 const M = S=>{ 1353 if (!(!(u.flags & 1) || !u.dirty && !S)) 1354 if (e) { 1355 const x = u.run(); 1356 if (s || p || (g ? x.some((P,C)=>Tn(P, b[C])) : Tn(x, b))) { 1357 c && c(); 1358 const P = bo; 1359 bo = u; 1360 try { 1361 const C = [x, b === ia ? void 0 : g && b[0] === ia ? [] : b, f]; 1362 b = x, 1363 a ? a(e, 3, C) : e(...C) 1364 } finally { 1365 bo = P 1366 } 1367 } 1368 } else 1369 u.run() 1370 } 1371 ; 1372 return r && r(M), 1373 u = new i1(h), 1374 u.scheduler = i ? ()=>i(M, !1) : M, 1375 f = S=>Vb(S, !1, u), 1376 c = u.onStop = ()=>{ 1377 const S = $a.get(u); 1378 if (S) { 1379 if (a) 1380 a(S, 4); 1381 else 1382 for (const x of S) 1383 x(); 1384 $a.delete(u) 1385 } 1386 } 1387 , 1388 e ? n ? M(!0) : b = u.run() : i ? i(M.bind(null, !0), !0) : u.run(), 1389 m.pause = u.pause.bind(u), 1390 m.resume = u.resume.bind(u), 1391 m.stop = m, 1392 m 1393} 1394function Kn(l, e=1 / 0, t) { 1395 if (e <= 0 || !ot(l) || l.__v_skip || (t = t || new Map, 1396 (t.get(l) || 0) >= e)) 1397 return l; 1398 if (t.set(l, e), 1399 e--, 1400 wt(l)) 1401 Kn(l.value, e, t); 1402 else if (ke(l)) 1403 for (let n = 0; n < l.length; n++) 1404 Kn(l[n], e, t); 1405 else if (jg(l) || ii(l)) 1406 l.forEach(n=>{ 1407 Kn(n, e, t) 1408 } 1409 ); 1410 else if (Qg(l)) { 1411 for (const n in l) 1412 Kn(l[n], e, t); 1413 for (const n of Object.getOwnPropertySymbols(l)) 1414 Object.prototype.propertyIsEnumerable.call(l, n) && Kn(l[n], e, t) 1415 } 1416 return l 1417} 1418/** 1419* @vue/runtime-core v3.5.32
vendor: 5,034 bytes, lines 1420-1642
1420* (c) 2018-present Yuxi (Evan) You and Vue contributors 1421* @license MIT 1422**/ 1423function Yr(l, e, t, n) { 1424 try { 1425 return n ? l(...n) : l() 1426 } catch (s) { 1427 Rd(s, e, t) 1428 } 1429} 1430function an(l, e, t, n) { 1431 if (Le(l)) { 1432 const s = Yr(l, e, t, n); 1433 return s && Jg(s) && s.catch(o=>{ 1434 Rd(o, e, t) 1435 } 1436 ), 1437 s 1438 } 1439 if (ke(l)) { 1440 const s = []; 1441 for (let o = 0; o < l.length; o++) 1442 s.push(an(l[o], e, t, n)); 1443 return s 1444 } 1445} 1446function Rd(l, e, t, n=!0) { 1447 const s = e ? e.vnode : null 1448 , {errorHandler: o, throwUnhandledErrorInProduction: i} = e && e.appContext.config || ct; 1449 if (e) { 1450 let r = e.parent; 1451 const a = e.proxy 1452 , d = `https://vuejs.org/error-reference/#runtime-${t}`; 1453 for (; r; ) { 1454 const u = r.ec; 1455 if (u) { 1456 for (let h = 0; h < u.length; h++) 1457 if (u[h](l, a, d) === !1) 1458 return 1459 } 1460 r = r.parent 1461 } 1462 if (o) { 1463 os(), 1464 Yr(o, null, 10, [l, a, d]), 1465 is(); 1466 return 1467 } 1468 } 1469 Rb(l, t, s, n, i) 1470} 1471function Rb(l, e, t, n=!0, s=!1) { 1472 if (s) 1473 throw l; 1474 console.error(l) 1475} 1476const hl = []; 1477let wn = -1; 1478const ai = []; 1479let Cs = null 1480 , ei = 0; 1481const x1 = Promise.resolve(); 1482let Xa = null; 1483function el(l) { 1484 const e = Xa || x1; 1485 return l ? e.then(this ? l.bind(this) : l) : e 1486} 1487function Fb(l) { 1488 let e = wn + 1 1489 , t = hl.length; 1490 for (; e < t; ) { 1491 const n = e + t >>> 1 1492 , s = hl[n] 1493 , o = Pr(s); 1494 o < l || o === l && s.flags & 2 ? e = n + 1 : t = n 1495 } 1496 return e 1497} 1498function Hc(l) { 1499 if (!(l.flags & 1)) { 1500 const e = Pr(l) 1501 , t = hl[hl.length - 1]; 1502 !t || !(l.flags & 2) && e >= Pr(t) ? hl.push(l) : hl.splice(Fb(e), 0, l), 1503 l.flags |= 1, 1504 C1() 1505 } 1506} 1507function C1() { 1508 Xa || (Xa = x1.then(T1)) 1509} 1510function Bb(l) { 1511 ke(l) ? ai.push(...l) : Cs && l.id === -1 ? Cs.splice(ei + 1, 0, l) : l.flags & 1 || (ai.push(l), 1512 l.flags |= 1), 1513 C1() 1514} 1515function d0(l, e, t=wn + 1) { 1516 for (; t < hl.length; t++) { 1517 const n = hl[t]; 1518 if (n && n.flags & 2) { 1519 if (l && n.id !== l.uid) 1520 continue; 1521 hl.splice(t, 1), 1522 t--, 1523 n.flags & 4 && (n.flags &= -2), 1524 n(), 1525 n.flags & 4 || (n.flags &= -2) 1526 } 1527 } 1528} 1529function _1(l) { 1530 if (ai.length) { 1531 const e = [...new Set(ai)].sort((t,n)=>Pr(t) - Pr(n)); 1532 if (ai.length = 0, 1533 Cs) { 1534 Cs.push(...e); 1535 return 1536 } 1537 for (Cs = e, 1538 ei = 0; ei < Cs.length; ei++) { 1539 const t = Cs[ei]; 1540 t.flags & 4 && (t.flags &= -2), 1541 t.flags & 8 || t(), 1542 t.flags &= -2 1543 } 1544 Cs = null, 1545 ei = 0 1546 } 1547} 1548const Pr = l=>l.id == null ? l.flags & 2 ? -1 : 1 / 0 : l.id; 1549function T1(l) { 1550 try { 1551 for (wn = 0; wn < hl.length; wn++) { 1552 const e = hl[wn]; 1553 e && !(e.flags & 8) && (e.flags & 4 && (e.flags &= -2), 1554 Yr(e, e.i, e.i ? 15 : 14), 1555 e.flags & 4 || (e.flags &= -2)) 1556 } 1557 } finally { 1558 for (; wn < hl.length; wn++) { 1559 const e = hl[wn]; 1560 e && (e.flags &= -2) 1561 } 1562 wn = -1, 1563 hl.length = 0, 1564 _1(), 1565 Xa = null, 1566 (hl.length || ai.length) && T1() 1567 } 1568} 1569let Zt = null 1570 , k1 = null; 1571function Ya(l) { 1572 const e = Zt; 1573 return Zt = l, 1574 k1 = l && l.type.__scopeId || null, 1575 e 1576} 1577function O(l, e=Zt, t) { 1578 if (!e || l._n) 1579 return l; 1580 const n = (...s)=>{ 1581 n._d && mi(-1); 1582 const o = Ya(e); 1583 let i; 1584 try { 1585 i = l(...s) 1586 } finally { 1587 Ya(o), 1588 n._d && mi(1) 1589 } 1590 return i 1591 } 1592 ; 1593 return n._n = !0, 1594 n._c = !0, 1595 n._d = !0, 1596 n 1597} 1598function wl(l, e) { 1599 if (Zt === null) 1600 return l; 1601 const t = $d(Zt) 1602 , n = l.dirs || (l.dirs = []); 1603 for (let s = 0; s < e.length; s++) { 1604 let[o,i,r,a=ct] = e[s]; 1605 o && (Le(o) && (o = { 1606 mounted: o, 1607 updated: o 1608 }), 1609 o.deep && Kn(i), 1610 n.push({ 1611 dir: o, 1612 instance: t, 1613 value: i, 1614 oldValue: void 0, 1615 arg: r, 1616 modifiers: a 1617 })) 1618 } 1619 return l 1620} 1621function Qs(l, e, t, n) { 1622 const s = l.dirs 1623 , o = e && e.dirs; 1624 for (let i = 0; i < s.length; i++) { 1625 const r = s[i]; 1626 o && (r.oldValue = o[i].value); 1627 let a = r.dir[n]; 1628 a && (os(), 1629 an(a, t, 8, [l.el, r, l, e]), 1630 is()) 1631 } 1632} 1633function zb(l, e) { 1634 if (rl) { 1635 let t = rl.provides; 1636 const n = rl.parent && rl.parent.provides; 1637 n === t && (t = rl.provides = Object.create(n)), 1638 t[l] = e 1639 } 1640} 1641function di(l, e, t=!1) { 1642 const n = Ti();
1643 if (n || Eo) { 1644 let s = Eo ? Eo._context.provides : n ? n.parent == null || n.ce ? n.vnode.appContext && n.vnode.appContext.provides : n.parent.provides : void 0; 1645 if (s && l in s) 1646 return s[l]; 1647 if (arguments.length > 1) 1648 return t && Le(e) ? e.call(n && n.proxy) : e 1649 } 1650} 1651function Ub() { 1652 return !!(Ti() || Eo) 1653} 1654const Gb = Symbol.for("v-scx") 1655 , Hb = ()=>di(Gb); 1656function Ie(l, e, t) { 1657 return E1(l, e, t) 1658} 1659function E1(l, e, t=ct) { 1660 const {immediate: n, deep: s, flush: o, once: i} = t 1661 , r = Ft({}, t) 1662 , a = e && n || !e && o !== "post"; 1663 let d; 1664 if (_r) { 1665 if (o === "sync") { 1666 const f = Hb(); 1667 d = f.__watcherHandles || (f.__watcherHandles = []) 1668 } else if (!a) { 1669 const f = ()=>{} 1670 ; 1671 return f.stop = On, 1672 f.resume = On, 1673 f.pause = On, 1674 f 1675 } 1676 } 1677 const u = rl; 1678 r.call = (f,p,g)=>an(f, u, p, g); 1679 let h = !1; 1680 o === "post" ? r.scheduler = f=>{ 1681 zt(f, u && u.suspense) 1682 } 1683 : o !== "sync" && (h = !0, 1684 r.scheduler = (f,p)=>{ 1685 p ? f() : Hc(f) 1686 } 1687 ), 1688 r.augmentJob = f=>{ 1689 e && (f.flags |= 4), 1690 h && (f.flags |= 2, 1691 u && (f.id = u.uid, 1692 f.i = u)) 1693 } 1694 ; 1695 const c = Nb(l, e, r); 1696 return _r && (d ? d.push(c) : a && c()), 1697 c 1698} 1699function $b(l, e, t) { 1700 const n = this.proxy 1701 , s = St(l) ? l.includes(".") ? D1(n, l) : ()=>n[l] : l.bind(n, n); 1702 let o; 1703 Le(e) ? o = e : (o = e.handler, 1704 t = e); 1705 const i = Wr(this) 1706 , r = E1(s, o.bind(n), t); 1707 return i(), 1708 r 1709} 1710function D1(l, e) { 1711 const t = e.split("."); 1712 return ()=>{ 1713 let n = l; 1714 for (let s = 0; s < t.length && n; s++) 1715 n = n[t[s]]; 1716 return n 1717 } 1718} 1719const eo = new WeakMap 1720 , O1 = Symbol("_vte") 1721 , A1 = l=>l.__isTeleport 1722 , Mo = l=>l && (l.disabled || l.disabled === "") 1723 , Xb = l=>l && (l.defer || l.defer === "") 1724 , u0 = l=>typeof SVGElement < "u" && l instanceof SVGElement 1725 , h0 = l=>typeof MathMLElement == "function" && l instanceof MathMLElement 1726 , wh = (l,e)=>{ 1727 const t = l && l.to; 1728 return St(t) ? e ? e(t) : null : t 1729} 1730 , Yb = { 1731 name: "Teleport", 1732 __isTeleport: !0, 1733 process(l, e, t, n, s, o, i, r, a, d) { 1734 const {mc: u, pc: h, pbc: c, o: {insert: f, querySelector: p, createText: g, createComment: y}} = d 1735 , m = Mo(e.props); 1736 let {dynamicChildren: b} = e; 1737 const M = (P,C,T)=>{ 1738 P.shapeFlag & 16 && u(P.children, C, T, s, o, i, r, a) 1739 } 1740 , S = (P=e)=>{ 1741 const C = Mo(P.props) 1742 , T = P.target = wh(P.props, p) 1743 , k = Ph(T, P, g, f); 1744 T && (i !== "svg" && u0(T) ? i = "svg" : i !== "mathml" && h0(T) && (i = "mathml"), 1745 s && s.isCE && (s.ce._teleportTargets || (s.ce._teleportTargets = new Set)).add(T), 1746 C || (M(P, T, k), 1747 Ki(P, !1))) 1748 } 1749 , x = P=>{ 1750 const C = ()=>{ 1751 eo.get(P) === C && (eo.delete(P), 1752 Mo(P.props) && (M(P, t, P.anchor), 1753 Ki(P, !0)), 1754 S(P)) 1755 } 1756 ; 1757 eo.set(P, C), 1758 zt(C, o) 1759 } 1760 ; 1761 if (l == null) { 1762 const P = e.el = g("") 1763 , C = e.anchor = g(""); 1764 if (f(P, t, n), 1765 f(C, t, n), 1766 Xb(e.props) || o && o.pendingBranch) { 1767 x(e); 1768 return 1769 } 1770 m && (M(e, t, C), 1771 Ki(e, !0)), 1772 S() 1773 } else { 1774 e.el = l.el; 1775 const P = e.anchor = l.anchor 1776 , C = eo.get(l); 1777 if (C) { 1778 C.flags |= 8, 1779 eo.delete(l), 1780 x(e); 1781 return 1782 } 1783 e.targetStart = l.targetStart; 1784 const T = e.target = l.target 1785 , k = e.targetAnchor = l.targetAnchor 1786 , D = Mo(l.props) 1787 , I = D ? t : T 1788 , F = D ? P : k; 1789 if (i === "svg" || u0(T) ? i = "svg" : (i === "mathml" || h0(T)) && (i = "mathml"), 1790 b ? (c(l.dynamicChildren, b, I, s, o, i, r), 1791 Zc(l, e, !0)) : a || h(l, e, I, F, s, o, i, r, !1), 1792 m) 1793 D ? e.props && l.props && e.props.to !== l.props.to && (e.props.to = l.props.to) : ra(e, t, P, d, 1); 1794 else if ((e.props && e.props.to) !== (l.props && l.props.to)) { 1795 const Y = e.target = wh(e.props, p); 1796 Y && ra(e, Y, null, d, 0) 1797 } else 1798 D && ra(e, T, k, d, 1); 1799 Ki(e, m) 1800 } 1801 }, 1802 remove(l, e, t, {um: n, o: {remove: s}}, o) { 1803 const {shapeFlag: i, children: r, anchor: a, targetStart: d, targetAnchor: u, target: h, props: c} = l; 1804 let f = o || !Mo(c); 1805 const p = eo.get(l); 1806 if (p && (p.flags |= 8, 1807 eo.delete(l), 1808 f = !1), 1809 h && (s(d), 1810 s(u)), 1811 o && s(a), 1812 i & 16) 1813 for (let g = 0; g < r.length; g++) { 1814 const y = r[g]; 1815 n(y, e, t, f, !!y.dynamicChildren) 1816 } 1817 }, 1818 move: ra, 1819 hydrate: Kb 1820}; 1821function ra(l, e, t, {o: {insert: n}, m: s}, o=2) { 1822 o === 0 && n(l.targetAnchor, e, t); 1823 const {el: i, anchor: r, shapeFlag: a, children: d, props: u} = l 1824 , h = o === 2; 1825 if (h && n(i, e, t), 1826 (!h || Mo(u)) && a & 16) 1827 for (let c = 0; c < d.length; c++) 1828 s(d[c], e, t, 2); 1829 h && n(r, e, t) 1830} 1831function Kb(l, e, t, n, s, o, {o: {nextSibling: i, parentNode: r, querySelector: a, insert: d, createText: u}}, h) { 1832 function c(y, m) { 1833 let b = m; 1834 for (; b; ) { 1835 if (b && b.nodeType === 8) { 1836 if (b.data === "teleport start anchor") 1837 e.targetStart = b; 1838 else if (b.data === "teleport anchor") { 1839 e.targetAnchor = b, 1840 y._lpa = e.targetAnchor && i(e.targetAnchor); 1841 break 1842 } 1843 } 1844 b = i(b) 1845 } 1846 } 1847 function f(y, m) { 1848 m.anchor = h(i(y), m, r(y), t, n, s, o) 1849 } 1850 const p = e.target = wh(e.props, a) 1851 , g = Mo(e.props); 1852 if (p) { 1853 const y = p._lpa || p.firstChild; 1854 e.shapeFlag & 16 && (g ? (f(l, e), 1855 c(p, y), 1856 e.targetAnchor || Ph(p, e, u, d, r(l) === p ? l : null)) : (e.anchor = i(l), 1857 c(p, y), 1858 e.targetAnchor || Ph(p, e, u, d), 1859 h(y && i(y), e, p, t, n, s, o))), 1860 Ki(e, g) 1861 } else 1862 g && e.shapeFlag & 16 && (f(l, e), 1863 e.targetStart = l, 1864 e.targetAnchor = i(l)); 1865 return e.anchor && i(e.anchor) 1866} 1867const I1 = Yb; 1868function Ki(l, e) { 1869 const t = l.ctx; 1870 if (t && t.ut) { 1871 let n, s; 1872 for (e ? (n = l.el, 1873 s = l.anchor) : (n = l.targetStart, 1874 s = l.targetAnchor); n && n !== s; ) 1875 n.nodeType === 1 && n.setAttribute("data-v-owner", t.uid), 1876 n = n.nextSibling; 1877 t.ut() 1878 } 1879} 1880function Ph(l, e, t, n, s=null) { 1881 const o = e.targetStart = t("") 1882 , i = e.targetAnchor = t(""); 1883 return o[O1] = i, 1884 l && (n(o, l, s), 1885 n(i, l, s)), 1886 i 1887} 1888const xn = Symbol("_leaveCb") 1889 , Ri = Symbol("_enterCb"); 1890function L1() { 1891 const l = { 1892 isMounted: !1, 1893 isLeaving: !1, 1894 isUnmounting: !1, 1895 leavingVNodes: new Map 1896 }; 1897 return Ud(()=>{ 1898 l.isMounted = !0 1899 } 1900 ), 1901 Yc(()=>{ 1902 l.isUnmounting = !0 1903 } 1904 ), 1905 l 1906} 1907const Al = [Function, Array] 1908 , V1 = { 1909 mode: String, 1910 appear: Boolean, 1911 persisted: Boolean, 1912 onBeforeEnter: Al, 1913 onEnter: Al, 1914 onAfterEnter: Al, 1915 onEnterCancelled: Al, 1916 onBeforeLeave: Al, 1917 onLeave: Al, 1918 onAfterLeave: Al, 1919 onLeaveCancelled: Al, 1920 onBeforeAppear: Al, 1921 onAppear: Al, 1922 onAfterAppear: Al, 1923 onAppearCancelled: Al 1924} 1925 , N1 = l=>{ 1926 const e = l.subTree; 1927 return e.component ? N1(e.component) : e 1928} 1929 , Wb = { 1930 name: "BaseTransition", 1931 props: V1, 1932 setup(l, {slots: e}) { 1933 const t = Ti() 1934 , n = L1(); 1935 return ()=>{ 1936 const s = e.default && $c(e.default(), !0); 1937 if (!s || !s.length) 1938 return; 1939 const o = R1(s) 1940 , i = Oe(l) 1941 , {mode: r} = i; 1942 if (n.isLeaving) 1943 return xu(o); 1944 const a = c0(o); 1945 if (!a) 1946 return xu(o); 1947 let d = xr(a, i, n, t, h=>d = h); 1948 a.type !== qt && Ls(a, d); 1949 let u = t.subTree && c0(t.subTree); 1950 if (u && u.type !== qt && !Ts(u, a) && N1(t).type !== qt) { 1951 let h = xr(u, i, n, t); 1952 if (Ls(u, h), 1953 r === "out-in" && a.type !== qt) 1954 return n.isLeaving = !0, 1955 h.afterLeave = ()=>{ 1956 n.isLeaving = !1,
vendor: 18,566 bytes, lines 1957-2621
1957 t.job.flags & 8 || t.update(), 1958 delete h.afterLeave, 1959 u = void 0 1960 } 1961 , 1962 xu(o); 1963 r === "in-out" && a.type !== qt ? h.delayLeave = (c,f,p)=>{ 1964 const g = F1(n, u); 1965 g[String(u.key)] = u, 1966 c[xn] = ()=>{ 1967 f(), 1968 c[xn] = void 0, 1969 delete d.delayedLeave, 1970 u = void 0 1971 } 1972 , 1973 d.delayedLeave = ()=>{ 1974 p(), 1975 delete d.delayedLeave, 1976 u = void 0 1977 } 1978 } 1979 : u = void 0 1980 } else 1981 u && (u = void 0); 1982 return o 1983 } 1984 } 1985}; 1986function R1(l) { 1987 let e = l[0]; 1988 if (l.length > 1) { 1989 for (const t of l) 1990 if (t.type !== qt) { 1991 e = t; 1992 break 1993 } 1994 } 1995 return e 1996} 1997const qb = Wb; 1998function F1(l, e) { 1999 const {leavingVNodes: t} = l; 2000 let n = t.get(e.type); 2001 return n || (n = Object.create(null), 2002 t.set(e.type, n)), 2003 n 2004} 2005function xr(l, e, t, n, s) { 2006 const {appear: o, mode: i, persisted: r=!1, onBeforeEnter: a, onEnter: d, onAfterEnter: u, onEnterCancelled: h, onBeforeLeave: c, onLeave: f, onAfterLeave: p, onLeaveCancelled: g, onBeforeAppear: y, onAppear: m, onAfterAppear: b, onAppearCancelled: M} = e 2007 , S = String(l.key) 2008 , x = F1(t, l) 2009 , P = (k,D)=>{ 2010 k && an(k, n, 9, D) 2011 } 2012 , C = (k,D)=>{ 2013 const I = D[1]; 2014 P(k, D), 2015 ke(k) ? k.every(F=>F.length <= 1) && I() : k.length <= 1 && I() 2016 } 2017 , T = { 2018 mode: i, 2019 persisted: r, 2020 beforeEnter(k) { 2021 let D = a; 2022 if (!t.isMounted) 2023 if (o) 2024 D = y || a; 2025 else 2026 return; 2027 k[xn] && k[xn](!0); 2028 const I = x[S]; 2029 I && Ts(l, I) && I.el[xn] && I.el[xn](), 2030 P(D, [k]) 2031 }, 2032 enter(k) { 2033 if (x[S] === l) 2034 return; 2035 let D = d 2036 , I = u 2037 , F = h; 2038 if (!t.isMounted) 2039 if (o) 2040 D = m || d, 2041 I = b || u, 2042 F = M || h; 2043 else 2044 return; 2045 let Y = !1; 2046 k[Ri] = re=>{ 2047 Y || (Y = !0, 2048 re ? P(F, [k]) : P(I, [k]), 2049 T.delayedLeave && T.delayedLeave(), 2050 k[Ri] = void 0) 2051 } 2052 ; 2053 const q = k[Ri].bind(null, !1); 2054 D ? C(D, [k, q]) : q() 2055 }, 2056 leave(k, D) { 2057 const I = String(l.key); 2058 if (k[Ri] && k[Ri](!0), 2059 t.isUnmounting) 2060 return D(); 2061 P(c, [k]); 2062 let F = !1; 2063 k[xn] = q=>{ 2064 F || (F = !0, 2065 D(), 2066 q ? P(g, [k]) : P(p, [k]), 2067 k[xn] = void 0, 2068 x[I] === l && delete x[I]) 2069 } 2070 ; 2071 const Y = k[xn].bind(null, !1); 2072 x[I] = l, 2073 f ? C(f, [k, Y]) : Y() 2074 }, 2075 clone(k) { 2076 const D = xr(k, e, t, n, s); 2077 return s && s(D), 2078 D 2079 } 2080 }; 2081 return T 2082} 2083function xu(l) { 2084 if (Bd(l)) 2085 return l = as(l), 2086 l.children = null, 2087 l 2088} 2089function c0(l) { 2090 if (!Bd(l)) 2091 return A1(l.type) && l.children ? R1(l.children) : l; 2092 if (l.component) 2093 return l.component.subTree; 2094 const {shapeFlag: e, children: t} = l; 2095 if (t) { 2096 if (e & 16) 2097 return t[0]; 2098 if (e & 32 && Le(t.default)) 2099 return t.default() 2100 } 2101} 2102function Ls(l, e) { 2103 l.shapeFlag & 6 && l.component ? (l.transition = e, 2104 Ls(l.component.subTree, e)) : l.shapeFlag & 128 ? (l.ssContent.transition = e.clone(l.ssContent), 2105 l.ssFallback.transition = e.clone(l.ssFallback)) : l.transition = e 2106} 2107function $c(l, e=!1, t) { 2108 let n = [] 2109 , s = 0; 2110 for (let o = 0; o < l.length; o++) { 2111 let i = l[o]; 2112 const r = t == null ? i.key : String(t) + String(i.key != null ? i.key : o); 2113 i.type === Pe ? (i.patchFlag & 128 && s++, 2114 n = n.concat($c(i.children, e, r))) : (e || i.type !== qt) && n.push(r != null ? as(i, { 2115 key: r 2116 }) : i) 2117 } 2118 if (s > 1) 2119 for (let o = 0; o < n.length; o++) 2120 n[o].patchFlag = -2; 2121 return n 2122} 2123function Fd(l, e) { 2124 return Le(l) ? Ft({ 2125 name: l.name 2126 }, e, { 2127 setup: l 2128 }) : l 2129} 2130function B1(l) { 2131 l.ids = [l.ids[0] + l.ids[2]++ + "-", 0, 0] 2132} 2133function f0(l, e) { 2134 let t; 2135 return !!((t = Object.getOwnPropertyDescriptor(l, e)) && !t.configurable) 2136} 2137const Ka = new WeakMap; 2138function ir(l, e, t, n, s=!1) { 2139 if (ke(l)) { 2140 l.forEach((g,y)=>ir(g, e && (ke(e) ? e[y] : e), t, n, s)); 2141 return 2142 } 2143 if (Ds(n) && !s) { 2144 n.shapeFlag & 512 && n.type.__asyncResolved && n.component.subTree.component && ir(l, e, t, n.component.subTree); 2145 return 2146 } 2147 const o = n.shapeFlag & 4 ? $d(n.component) : n.el 2148 , i = s ? null : o 2149 , {i: r, r: a} = l 2150 , d = e && e.r 2151 , u = r.refs === ct ? r.refs = {} : r.refs 2152 , h = r.setupState 2153 , c = Oe(h) 2154 , f = h === ct ? qg : g=>f0(u, g) ? !1 : rt(c, g) 2155 , p = (g,y)=>!(y && f0(u, y)); 2156 if (d != null && d !== a) { 2157 if (p0(e), 2158 St(d)) 2159 u[d] = null, 2160 f(d) && (h[d] = null); 2161 else if (wt(d)) { 2162 const g = e; 2163 p(d, g.k) && (d.value = null), 2164 g.k && (u[g.k] = null) 2165 } 2166 } 2167 if (Le(a)) 2168 Yr(a, r, 12, [i, u]); 2169 else { 2170 const g = St(a) 2171 , y = wt(a); 2172 if (g || y) { 2173 const m = ()=>{ 2174 if (l.f) { 2175 const b = g ? f(a) ? h[a] : u[a] : p() || !l.k ? a.value : u[l.k]; 2176 if (s) 2177 ke(b) && Lc(b, o); 2178 else if (ke(b)) 2179 b.includes(o) || b.push(o); 2180 else if (g) 2181 u[a] = [o], 2182 f(a) && (h[a] = u[a]); 2183 else { 2184 const M = [o]; 2185 p(a, l.k) && (a.value = M), 2186 l.k && (u[l.k] = M) 2187 } 2188 } else 2189 g ? (u[a] = i, 2190 f(a) && (h[a] = i)) : y && (p(a, l.k) && (a.value = i), 2191 l.k && (u[l.k] = i)) 2192 } 2193 ; 2194 if (i) { 2195 const b = ()=>{ 2196 m(), 2197 Ka.delete(l) 2198 } 2199 ; 2200 b.id = -1, 2201 Ka.set(l, b), 2202 zt(b, t) 2203 } else 2204 p0(l), 2205 m() 2206 } 2207 } 2208} 2209function p0(l) { 2210 const e = Ka.get(l); 2211 e && (e.flags |= 8, 2212 Ka.delete(l)) 2213} 2214Id().requestIdleCallback; 2215Id().cancelIdleCallback; 2216const Ds = l=>!!l.type.__asyncLoader 2217 , Bd = l=>l.type.__isKeepAlive 2218 , jb = { 2219 name: "KeepAlive", 2220 __isKeepAlive: !0, 2221 props: { 2222 include: [String, RegExp, Array], 2223 exclude: [String, RegExp, Array], 2224 max: [String, Number] 2225 }, 2226 setup(l, {slots: e}) { 2227 const t = Ti() 2228 , n = t.ctx; 2229 if (!n.renderer) 2230 return ()=>{ 2231 const b = e.default && e.default(); 2232 return b && b.length === 1 ? b[0] : b 2233 } 2234 ; 2235 const s = new Map 2236 , o = new Set; 2237 let i = null; 2238 const r = t.suspense 2239 , {renderer: {p: a, m: d, um: u, o: {createElement: h}}} = n 2240 , c = h("div"); 2241 n.activate = (b,M,S,x,P)=>{ 2242 const C = b.component; 2243 d(b, M, S, 0, r), 2244 a(C.vnode, b, M, S, C, r, x, b.slotScopeIds, P), 2245 zt(()=>{ 2246 C.isDeactivated = !1, 2247 C.a && ri(C.a); 2248 const T = b.props && b.props.onVnodeMounted; 2249 T && Ll(T, C.parent, b) 2250 } 2251 , r) 2252 } 2253 , 2254 n.deactivate = b=>{ 2255 const M = b.component; 2256 qa(M.m), 2257 qa(M.a), 2258 d(b, c, null, 1, r), 2259 zt(()=>{ 2260 M.da && ri(M.da); 2261 const S = b.props && b.props.onVnodeUnmounted; 2262 S && Ll(S, M.parent, b), 2263 M.isDeactivated = !0 2264 } 2265 , r) 2266 } 2267 ; 2268 function f(b) { 2269 Cu(b), 2270 u(b, t, r, !0) 2271 } 2272 function p(b) { 2273 s.forEach((M,S)=>{ 2274 const x = Eh(Ds(M) ? M.type.__asyncResolved || {} : M.type); 2275 x && !b(x) && g(S) 2276 } 2277 ) 2278 } 2279 function g(b) { 2280 const M = s.get(b); 2281 M && (!i || !Ts(M, i)) ? f(M) : i && Cu(i), 2282 s.delete(b), 2283 o.delete(b) 2284 } 2285 Ie(()=>[l.include, l.exclude], ([b,M])=>{ 2286 b && p(S=>Wi(b, S)), 2287 M && p(S=>!Wi(M, S)) 2288 } 2289 , { 2290 flush: "post", 2291 deep: !0 2292 }); 2293 let y = null; 2294 const m = ()=>{ 2295 y != null && (ja(t.subTree.type) ? zt(()=>{ 2296 s.set(y, aa(t.subTree)) 2297 } 2298 , t.subTree.suspense) : s.set(y, aa(t.subTree))) 2299 } 2300 ; 2301 return Ud(m), 2302 Xc(m), 2303 Yc(()=>{ 2304 s.forEach(b=>{ 2305 const {subTree: M, suspense: S} = t 2306 , x = aa(M); 2307 if (b.type === x.type && b.key === x.key) { 2308 Cu(x); 2309 const P = x.component.da; 2310 P && zt(P, S); 2311 return 2312 } 2313 f(b) 2314 } 2315 ) 2316 } 2317 ), 2318 ()=>{ 2319 if (y = null, 2320 !e.default) 2321 return i = null; 2322 const b = e.default() 2323 , M = b[0]; 2324 if (b.length > 1) 2325 return i = null, 2326 b; 2327 if (!yi(M) || !(M.shapeFlag & 4) && !(M.shapeFlag & 128)) 2328 return i = null, 2329 M; 2330 let S = aa(M); 2331 if (S.type === qt) 2332 return i = null, 2333 S; 2334 const x = S.type 2335 , P = Eh(Ds(S) ? S.type.__asyncResolved || {} : x) 2336 , {include: C, exclude: T, max: k} = l; 2337 if (C && (!P || !Wi(C, P)) || T && P && Wi(T, P)) 2338 return S.shapeFlag &= -257, 2339 i = S, 2340 M; 2341 const D = S.key == null ? x : S.key 2342 , I = s.get(D); 2343 return S.el && (S = as(S), 2344 M.shapeFlag & 128 && (M.ssContent = S)), 2345 y = D, 2346 I ? (S.el = I.el, 2347 S.component = I.component, 2348 S.transition && Ls(S, S.transition), 2349 S.shapeFlag |= 512, 2350 o.delete(D), 2351 o.add(D)) : (o.add(D), 2352 k && o.size > parseInt(k, 10) && g(o.values().next().value)), 2353 S.shapeFlag |= 256, 2354 i = S, 2355 ja(M.type) ? M : S 2356 } 2357 } 2358} 2359 , Jb = jb; 2360function Wi(l, e) { 2361 return ke(l) ? l.some(t=>Wi(t, e)) : St(l) ? l.split(",").includes(e) : Wv(l) ? (l.lastIndex = 0, 2362 l.test(e)) : !1 2363} 2364function Zb(l, e) { 2365 z1(l, "a", e) 2366} 2367function Qb(l, e) { 2368 z1(l, "da", e) 2369} 2370function z1(l, e, t=rl) { 2371 const n = l.__wdc || (l.__wdc = ()=>{ 2372 let s = t; 2373 for (; s; ) { 2374 if (s.isDeactivated) 2375 return; 2376 s = s.parent 2377 } 2378 return l() 2379 } 2380 ); 2381 if (zd(e, n, t), 2382 t) { 2383 let s = t.parent; 2384 for (; s && s.parent; ) 2385 Bd(s.parent.vnode) && eM(n, e, t, s), 2386 s = s.parent 2387 } 2388} 2389function eM(l, e, t, n) { 2390 const s = zd(e, l, n, !0); 2391 Kc(()=>{ 2392 Lc(n[e], s) 2393 } 2394 , t) 2395} 2396function Cu(l) { 2397 l.shapeFlag &= -257, 2398 l.shapeFlag &= -513 2399} 2400function aa(l) { 2401 return l.shapeFlag & 128 ? l.ssContent : l 2402} 2403function zd(l, e, t=rl, n=!1) { 2404 if (t) { 2405 const s = t[l] || (t[l] = []) 2406 , o = e.__weh || (e.__weh = (...i)=>{ 2407 os(); 2408 const r = Wr(t) 2409 , a = an(e, t, l, i); 2410 return r(), 2411 is(), 2412 a 2413 } 2414 ); 2415 return n ? s.unshift(o) : s.push(o), 2416 o 2417 } 2418} 2419const ps = l=>(e,t=rl)=>{ 2420 (!_r || l === "sp") && zd(l, (...n)=>e(...n), t) 2421} 2422 , tM = ps("bm") 2423 , Ud = ps("m") 2424 , lM = ps("bu") 2425 , Xc = ps("u") 2426 , Yc = ps("bum") 2427 , Kc = ps("um") 2428 , nM = ps("sp") 2429 , sM = ps("rtg") 2430 , oM = ps("rtc"); 2431function iM(l, e=rl) { 2432 zd("ec", l, e) 2433} 2434const Wc = "components" 2435 , rM = "directives"; 2436function E(l, e) { 2437 return qc(Wc, l, !0, e) || l 2438} 2439const U1 = Symbol.for("v-ndc"); 2440function G1(l) { 2441 return St(l) ? qc(Wc, l, !1) || l : l || U1 2442} 2443function Gd(l) { 2444 return qc(rM, l) 2445} 2446function qc(l, e, t=!0, n=!1) { 2447 const s = Zt || rl; 2448 if (s) { 2449 const o = s.type; 2450 if (l === Wc) { 2451 const r = Eh(o, !1); 2452 if (r && (r === e || r === pl(e) || r === Ad(pl(e)))) 2453 return o 2454 } 2455 const i = g0(s[l] || o[l], e) || g0(s.appContext[l], e); 2456 return !i && n ? o : i 2457 } 2458} 2459function g0(l, e) { 2460 return l && (l[e] || l[pl(e)] || l[Ad(pl(e))]) 2461} 2462function Gt(l, e, t, n) { 2463 let s; 2464 const o = t && t[n] 2465 , i = ke(l); 2466 if (i || St(l)) { 2467 const r = i && ls(l); 2468 let a = !1 2469 , d = !1; 2470 r && (a = !_l(l), 2471 d = rs(l), 2472 l = Ld(l)), 2473 s = new Array(l.length); 2474 for (let u = 0, h = l.length; u < h; u++) 2475 s[u] = e(a ? d ? gi(rn(l[u])) : rn(l[u]) : l[u], u, void 0, o && o[u]) 2476 } else if (typeof l == "number") { 2477 s = new Array(l); 2478 for (let r = 0; r < l; r++) 2479 s[r] = e(r + 1, r, void 0, o && o[r]) 2480 } else if (ot(l)) 2481 if (l[Symbol.iterator]) 2482 s = Array.from(l, (r,a)=>e(r, a, void 0, o && o[a])); 2483 else { 2484 const r = Object.keys(l); 2485 s = new Array(r.length); 2486 for (let a = 0, d = r.length; a < d; a++) { 2487 const u = r[a]; 2488 s[a] = e(l[u], u, a, o && o[a]) 2489 } 2490 } 2491 else 2492 s = []; 2493 return t && (t[n] = s), 2494 s 2495} 2496function aM(l, e) { 2497 for (let t = 0; t < e.length; t++) { 2498 const n = e[t]; 2499 if (ke(n)) 2500 for (let s = 0; s < n.length; s++) 2501 l[n[s].name] = n[s].fn; 2502 else 2503 n && (l[n.name] = n.key ? (...s)=>{ 2504 const o = n.fn(...s); 2505 return o && (o.key = n.key), 2506 o 2507 } 2508 : n.fn) 2509 } 2510 return l 2511} 2512function vt(l, e, t={}, n, s) { 2513 if (Zt.ce || Zt.parent && Ds(Zt.parent) && Zt.parent.ce) { 2514 const d = Object.keys(t).length > 0; 2515 return e !== "default" && (t.name = e), 2516 N(), 2517 pe(Pe, null, [w("slot", t, n && n())], d ? -2 : 64) 2518 } 2519 let o = l[e]; 2520 o && o._c && (o._d = !1), 2521 N(); 2522 const i = o && H1(o(t)) 2523 , r = t.key || i && i.key 2524 , a = pe(Pe, { 2525 key: (r && !kl(r) ? r : `_${e}`) + (!i && n ? "_fb" : "") 2526 }, i || (n ? n() : []), i && l._ === 1 ? 64 : -2); 2527 return !s && a.scopeId && (a.slotScopeIds = [a.scopeId + "-s"]), 2528 o && o._c && (o._d = !0), 2529 a 2530} 2531function H1(l) { 2532 return l.some(e=>yi(e) ? !(e.type === qt || e.type === Pe && !H1(e.children)) : !0) ? l : null 2533} 2534const xh = l=>l ? am(l) ? $d(l) : xh(l.parent) : null 2535 , rr = Ft(Object.create(null), { 2536 $: l=>l, 2537 $el: l=>l.vnode.el, 2538 $data: l=>l.data, 2539 $props: l=>l.props, 2540 $attrs: l=>l.attrs, 2541 $slots: l=>l.slots, 2542 $refs: l=>l.refs, 2543 $parent: l=>xh(l.parent), 2544 $root: l=>xh(l.root), 2545 $host: l=>l.ce, 2546 $emit: l=>l.emit, 2547 $options: l=>X1(l), 2548 $forceUpdate: l=>l.f || (l.f = ()=>{ 2549 Hc(l.update) 2550 } 2551 ), 2552 $nextTick: l=>l.n || (l.n = el.bind(l.proxy)), 2553 $watch: l=>$b.bind(l) 2554}) 2555 , _u = (l,e)=>l !== ct && !l.__isScriptSetup && rt(l, e) 2556 , dM = { 2557 get({_: l}, e) { 2558 if (e === "__v_skip") 2559 return !0; 2560 const {ctx: t, setupState: n, data: s, props: o, accessCache: i, type: r, appContext: a} = l; 2561 if (e[0] !== "$") { 2562 const c = i[e]; 2563 if (c !== void 0) 2564 switch (c) { 2565 case 1: 2566 return n[e]; 2567 case 2: 2568 return s[e]; 2569 case 4: 2570 return t[e]; 2571 case 3: 2572 return o[e] 2573 } 2574 else { 2575 if (_u(n, e)) 2576 return i[e] = 1, 2577 n[e]; 2578 if (s !== ct && rt(s, e)) 2579 return i[e] = 2, 2580 s[e]; 2581 if (rt(o, e)) 2582 return i[e] = 3, 2583 o[e]; 2584 if (t !== ct && rt(t, e)) 2585 return i[e] = 4, 2586 t[e]; 2587 Ch && (i[e] = 0) 2588 } 2589 } 2590 const d = rr[e]; 2591 let u, h; 2592 if (d) 2593 return e === "$attrs" && ol(l.attrs, "get", ""), 2594 d(l); 2595 if ((u = r.__cssModules) && (u = u[e])) 2596 return u; 2597 if (t !== ct && rt(t, e)) 2598 return i[e] = 4, 2599 t[e]; 2600 if (h = a.config.globalProperties, 2601 rt(h, e)) 2602 return h[e] 2603 }, 2604 set({_: l}, e, t) { 2605 const {data: n, setupState: s, ctx: o} = l; 2606 return _u(s, e) ? (s[e] = t, 2607 !0) : n !== ct && rt(n, e) ? (n[e] = t, 2608 !0) : rt(l.props, e) || e[0] === "$" && e.slice(1)in l ? !1 : (o[e] = t, 2609 !0) 2610 }, 2611 has({_: {data: l, setupState: e, accessCache: t, ctx: n, appContext: s, props: o, type: i}}, r) { 2612 let a; 2613 return !!(t[r] || l !== ct && r[0] !== "$" && rt(l, r) || _u(e, r) || rt(o, r) || rt(n, r) || rt(rr, r) || rt(s.config.globalProperties, r) || (a = i.__cssModules) && a[r]) 2614 }, 2615 defineProperty(l, e, t) { 2616 return t.get != null ? l._.accessCache[e] = 0 : rt(t, "value") && this.set(l, e, t.value, null), 2617 Reflect.defineProperty(l, e, t) 2618 } 2619}; 2620function m0(l) { 2621 return ke(l) ? l.reduce((e,t)=>
vendor: 9,252 bytes, lines 2621-2962
2621(e[t] = null, 2622 e), {}) : l 2623} 2624let Ch = !0; 2625function uM(l) { 2626 const e = X1(l) 2627 , t = l.proxy 2628 , n = l.ctx; 2629 Ch = !1, 2630 e.beforeCreate && y0(e.beforeCreate, l, "bc"); 2631 const {data: s, computed: o, methods: i, watch: r, provide: a, inject: d, created: u, beforeMount: h, mounted: c, beforeUpdate: f, updated: p, activated: g, deactivated: y, beforeDestroy: m, beforeUnmount: b, destroyed: M, unmounted: S, render: x, renderTracked: P, renderTriggered: C, errorCaptured: T, serverPrefetch: k, expose: D, inheritAttrs: I, components: F, directives: Y, filters: q} = e; 2632 if (d && hM(d, n, null), 2633 i) 2634 for (const te in i) { 2635 const he = i[te]; 2636 Le(he) && (n[te] = he.bind(t)) 2637 } 2638 if (s) { 2639 const te = s.call(t, t); 2640 ot(te) && (l.data = Et(te)) 2641 } 2642 if (Ch = !0, 2643 o) 2644 for (const te in o) { 2645 const he = o[te] 2646 , Me = Le(he) ? he.bind(t, t) : Le(he.get) ? he.get.bind(t, t) : On 2647 , De = !Le(he) && Le(he.set) ? he.set.bind(t) : On 2648 , ye = So({ 2649 get: Me, 2650 set: De 2651 }); 2652 Object.defineProperty(n, te, { 2653 enumerable: !0, 2654 configurable: !0, 2655 get: ()=>ye.value, 2656 set: _e=>ye.value = _e 2657 }) 2658 } 2659 if (r) 2660 for (const te in r) 2661 $1(r[te], n, t, te); 2662 if (a) { 2663 const te = Le(a) ? a.call(t) : a; 2664 Reflect.ownKeys(te).forEach(he=>{ 2665 zb(he, te[he]) 2666 } 2667 ) 2668 } 2669 u && y0(u, l, "c"); 2670 function ne(te, he) { 2671 ke(he) ? he.forEach(Me=>te(Me.bind(t))) : he && te(he.bind(t)) 2672 } 2673 if (ne(tM, h), 2674 ne(Ud, c), 2675 ne(lM, f), 2676 ne(Xc, p), 2677 ne(Zb, g), 2678 ne(Qb, y), 2679 ne(iM, T), 2680 ne(oM, P), 2681 ne(sM, C), 2682 ne(Yc, b), 2683 ne(Kc, S), 2684 ne(nM, k), 2685 ke(D)) 2686 if (D.length) { 2687 const te = l.exposed || (l.exposed = {}); 2688 D.forEach(he=>{ 2689 Object.defineProperty(te, he, { 2690 get: ()=>t[he], 2691 set: Me=>t[he] = Me, 2692 enumerable: !0 2693 }) 2694 } 2695 ) 2696 } else 2697 l.exposed || (l.exposed = {}); 2698 x && l.render === On && (l.render = x), 2699 I != null && (l.inheritAttrs = I), 2700 F && (l.components = F), 2701 Y && (l.directives = Y), 2702 k && B1(l) 2703} 2704function hM(l, e, t=On) { 2705 ke(l) && (l = _h(l)); 2706 for (const n in l) { 2707 const s = l[n]; 2708 let o; 2709 ot(s) ? "default"in s ? o = di(s.from || n, s.default, !0) : o = di(s.from || n) : o = di(s), 2710 wt(o) ? Object.defineProperty(e, n, { 2711 enumerable: !0, 2712 configurable: !0, 2713 get: ()=>o.value, 2714 set: i=>o.value = i 2715 }) : e[n] = o 2716 } 2717} 2718function y0(l, e, t) { 2719 an(ke(l) ? l.map(n=>n.bind(e.proxy)) : l.bind(e.proxy), e, t) 2720} 2721function $1(l, e, t, n) { 2722 let s = n.includes(".") ? D1(t, n) : ()=>t[n]; 2723 if (St(l)) { 2724 const o = e[l]; 2725 Le(o) && Ie(s, o) 2726 } else if (Le(l)) 2727 Ie(s, l.bind(t)); 2728 else if (ot(l)) 2729 if (ke(l)) 2730 l.forEach(o=>$1(o, e, t, n)); 2731 else { 2732 const o = Le(l.handler) ? l.handler.bind(t) : e[l.handler]; 2733 Le(o) && Ie(s, o, l) 2734 } 2735} 2736function X1(l) { 2737 const e = l.type 2738 , {mixins: t, extends: n} = e 2739 , {mixins: s, optionsCache: o, config: {optionMergeStrategies: i}} = l.appContext 2740 , r = o.get(e); 2741 let a; 2742 return r ? a = r : !s.length && !t && !n ? a = e : (a = {}, 2743 s.length && s.forEach(d=>Wa(a, d, i, !0)), 2744 Wa(a, e, i)), 2745 ot(e) && o.set(e, a), 2746 a 2747} 2748function Wa(l, e, t, n=!1) { 2749 const {mixins: s, extends: o} = e; 2750 o && Wa(l, o, t, !0), 2751 s && s.forEach(i=>Wa(l, i, t, !0)); 2752 for (const i in e) 2753 if (!(n && i === "expose")) { 2754 const r = cM[i] || t && t[i]; 2755 l[i] = r ? r(l[i], e[i]) : e[i] 2756 } 2757 return l 2758} 2759const cM = { 2760 data: v0, 2761 props: b0, 2762 emits: b0, 2763 methods: qi, 2764 computed: qi, 2765 beforeCreate: ul, 2766 created: ul, 2767 beforeMount: ul, 2768 mounted: ul, 2769 beforeUpdate: ul, 2770 updated: ul, 2771 beforeDestroy: ul, 2772 beforeUnmount: ul, 2773 destroyed: ul, 2774 unmounted: ul, 2775 activated: ul, 2776 deactivated: ul, 2777 errorCaptured: ul, 2778 serverPrefetch: ul, 2779 components: qi, 2780 directives: qi, 2781 watch: pM, 2782 provide: v0, 2783 inject: fM 2784}; 2785function v0(l, e) { 2786 return e ? l ? function() { 2787 return Ft(Le(l) ? l.call(this, this) : l, Le(e) ? e.call(this, this) : e) 2788 } 2789 : e : l 2790} 2791function fM(l, e) { 2792 return qi(_h(l), _h(e)) 2793} 2794function _h(l) { 2795 if (ke(l)) { 2796 const e = {}; 2797 for (let t = 0; t < l.length; t++) 2798 e[l[t]] = l[t]; 2799 return e 2800 } 2801 return l 2802} 2803function ul(l, e) { 2804 return l ? [...new Set([].concat(l, e))] : e 2805} 2806function qi(l, e) { 2807 return l ? Ft(Object.create(null), l, e) : e 2808} 2809function b0(l, e) { 2810 return l ? ke(l) && ke(e) ? [...new Set([...l, ...e])] : Ft(Object.create(null), m0(l), m0(e ?? {})) : e 2811} 2812function pM(l, e) { 2813 if (!l) 2814 return e; 2815 if (!e) 2816 return l; 2817 const t = Ft(Object.create(null), l); 2818 for (const n in e) 2819 t[n] = ul(l[n], e[n]); 2820 return t 2821} 2822function Y1() { 2823 return { 2824 app: null, 2825 config: { 2826 isNativeTag: qg, 2827 performance: !1, 2828 globalProperties: {}, 2829 optionMergeStrategies: {}, 2830 errorHandler: void 0, 2831 warnHandler: void 0, 2832 compilerOptions: {} 2833 }, 2834 mixins: [], 2835 components: {}, 2836 directives: {}, 2837 provides: Object.create(null), 2838 optionsCache: new WeakMap, 2839 propsCache: new WeakMap, 2840 emitsCache: new WeakMap 2841 } 2842} 2843let gM = 0; 2844function mM(l, e) { 2845 return function(n, s=null) { 2846 Le(n) || (n = Ft({}, n)), 2847 s != null && !ot(s) && (s = null); 2848 const o = Y1() 2849 , i = new WeakSet 2850 , r = []; 2851 let a = !1; 2852 const d = o.app = { 2853 _uid: gM++, 2854 _component: n, 2855 _props: s, 2856 _container: null, 2857 _context: o, 2858 _instance: null, 2859 version: XM, 2860 get config() { 2861 return o.config 2862 }, 2863 set config(u) {}, 2864 use(u, ...h) { 2865 return i.has(u) || (u && Le(u.install) ? (i.add(u), 2866 u.install(d, ...h)) : Le(u) && (i.add(u), 2867 u(d, ...h))), 2868 d 2869 }, 2870 mixin(u) { 2871 return o.mixins.includes(u) || o.mixins.push(u), 2872 d 2873 }, 2874 component(u, h) { 2875 return h ? (o.components[u] = h, 2876 d) : o.components[u] 2877 }, 2878 directive(u, h) { 2879 return h ? (o.directives[u] = h, 2880 d) : o.directives[u] 2881 }, 2882 mount(u, h, c) { 2883 if (!a) { 2884 const f = d._ceVNode || w(n, s); 2885 return f.appContext = o, 2886 c === !0 ? c = "svg" : c === !1 && (c = void 0), 2887 l(f, u, c), 2888 a = !0, 2889 d._container = u, 2890 u.__vue_app__ = d, 2891 $d(f.component) 2892 } 2893 }, 2894 onUnmount(u) { 2895 r.push(u) 2896 }, 2897 unmount() { 2898 a && (an(r, d._instance, 16), 2899 l(null, d._container), 2900 delete d._container.__vue_app__) 2901 }, 2902 provide(u, h) { 2903 return o.provides[u] = h, 2904 d 2905 }, 2906 runWithContext(u) { 2907 const h = Eo; 2908 Eo = d; 2909 try { 2910 return u() 2911 } finally { 2912 Eo = h 2913 } 2914 } 2915 }; 2916 return d 2917 } 2918} 2919let Eo = null; 2920const yM = (l,e)=>e === "modelValue" || e === "model-value" ? l.modelModifiers : l[`${e}Modifiers`] || l[`${pl(e)}Modifiers`] || l[`${Us(e)}Modifiers`]; 2921function vM(l, e, ...t) { 2922 if (l.isUnmounted) 2923 return; 2924 const n = l.vnode.props || ct; 2925 let s = t; 2926 const o = e.startsWith("update:") 2927 , i = o && yM(n, e.slice(7)); 2928 i && (i.trim && (s = t.map(u=>St(u) ? u.trim() : u)), 2929 i.number && (s = t.map(Vc))); 2930 let r, a = n[r = bu(e)] || n[r = bu(pl(e))]; 2931 !a && o && (a = n[r = bu(Us(e))]), 2932 a && an(a, l, 6, s); 2933 const d = n[r + "Once"]; 2934 if (d) { 2935 if (!l.emitted) 2936 l.emitted = {}; 2937 else if (l.emitted[r]) 2938 return; 2939 l.emitted[r] = !0, 2940 an(d, l, 6, s) 2941 } 2942} 2943const bM = new WeakMap; 2944function K1(l, e, t=!1) { 2945 const n = t ? bM : e.emitsCache 2946 , s = n.get(l); 2947 if (s !== void 0) 2948 return s; 2949 const o = l.emits; 2950 let i = {} 2951 , r = !1; 2952 if (!Le(l)) { 2953 const a = d=>{ 2954 const u = K1(d, e, !0); 2955 u && (r = !0, 2956 Ft(i, u)) 2957 } 2958 ; 2959 !t && e.mixins.length && e.mixins.forEach(a), 2960 l.extends && a(l.extends), 2961 l.mixins && l.mixins.forEach(a) 2962 }
vendor: 7,816 bytes, lines 2963-3232
2963 return !o && !r ? (ot(l) && n.set(l, null), 2964 null) : (ke(o) ? o.forEach(a=>i[a] = null) : Ft(i, o), 2965 ot(l) && n.set(l, i), 2966 i) 2967} 2968function Hd(l, e) { 2969 return !l || !kd(e) ? !1 : (e = e.slice(2).replace(/Once$/, ""), 2970 rt(l, e[0].toLowerCase() + e.slice(1)) || rt(l, Us(e)) || rt(l, e)) 2971} 2972function M0(l) { 2973 const {type: e, vnode: t, proxy: n, withProxy: s, propsOptions: [o], slots: i, attrs: r, emit: a, render: d, renderCache: u, props: h, data: c, setupState: f, ctx: p, inheritAttrs: g} = l 2974 , y = Ya(l); 2975 let m, b; 2976 try { 2977 if (t.shapeFlag & 4) { 2978 const S = s || n 2979 , x = S; 2980 m = _n(d.call(x, S, u, h, f, c, p)), 2981 b = r 2982 } else { 2983 const S = e; 2984 m = _n(S.length > 1 ? S(h, { 2985 attrs: r, 2986 slots: i, 2987 emit: a 2988 }) : S(h, null)), 2989 b = e.props ? r : MM(r) 2990 } 2991 } catch (S) { 2992 ar.length = 0, 2993 Rd(S, l, 1), 2994 m = w(qt) 2995 } 2996 let M = m; 2997 if (b && g !== !1) { 2998 const S = Object.keys(b) 2999 , {shapeFlag: x} = M; 3000 S.length && x & 7 && (o && S.some(Ed) && (b = SM(b, o)), 3001 M = as(M, b, !1, !0)) 3002 } 3003 return t.dirs && (M = as(M, null, !1, !0), 3004 M.dirs = M.dirs ? M.dirs.concat(t.dirs) : t.dirs), 3005 t.transition && Ls(M, t.transition), 3006 m = M, 3007 Ya(y), 3008 m 3009} 3010const MM = l=>{ 3011 let e; 3012 for (const t in l) 3013 (t === "class" || t === "style" || kd(t)) && ((e || (e = {}))[t] = l[t]); 3014 return e 3015} 3016 , SM = (l,e)=>{ 3017 const t = {}; 3018 for (const n in l) 3019 (!Ed(n) || !(n.slice(9)in e)) && (t[n] = l[n]); 3020 return t 3021} 3022; 3023function wM(l, e, t) { 3024 const {props: n, children: s, component: o} = l 3025 , {props: i, children: r, patchFlag: a} = e 3026 , d = o.emitsOptions; 3027 if (e.dirs || e.transition) 3028 return !0; 3029 if (t && a >= 0) { 3030 if (a & 1024) 3031 return !0; 3032 if (a & 16) 3033 return n ? S0(n, i, d) : !!i; 3034 if (a & 8) { 3035 const u = e.dynamicProps; 3036 for (let h = 0; h < u.length; h++) { 3037 const c = u[h]; 3038 if (W1(i, n, c) && !Hd(d, c)) 3039 return !0 3040 } 3041 } 3042 } else 3043 return (s || r) && (!r || !r.$stable) ? !0 : n === i ? !1 : n ? i ? S0(n, i, d) : !0 : !!i; 3044 return !1 3045} 3046function S0(l, e, t) { 3047 const n = Object.keys(e); 3048 if (n.length !== Object.keys(l).length) 3049 return !0; 3050 for (let s = 0; s < n.length; s++) { 3051 const o = n[s]; 3052 if (W1(e, l, o) && !Hd(t, o)) 3053 return !0 3054 } 3055 return !1 3056} 3057function W1(l, e, t) { 3058 const n = l[t] 3059 , s = e[t]; 3060 return t === "style" && ot(n) && ot(s) ? !Mr(n, s) : n !== s 3061} 3062function PM({vnode: l, parent: e, suspense: t}, n) { 3063 for (; e; ) { 3064 const s = e.subTree; 3065 if (s.suspense && s.suspense.activeBranch === l && (s.suspense.vnode.el = s.el = n, 3066 l = s), 3067 s === l) 3068 (l = e.vnode).el = n, 3069 e = e.parent; 3070 else 3071 break 3072 } 3073 t && t.activeBranch === l && (t.vnode.el = n) 3074} 3075const q1 = {} 3076 , j1 = ()=>Object.create(q1) 3077 , J1 = l=>Object.getPrototypeOf(l) === q1; 3078function xM(l, e, t, n=!1) { 3079 const s = {} 3080 , o = j1(); 3081 l.propsDefaults = Object.create(null), 3082 Z1(l, e, s, o); 3083 for (const i in l.propsOptions[0]) 3084 i in s || (s[i] = void 0); 3085 t ? l.props = n ? s : qn(s) : l.type.props ? l.props = s : l.props = o, 3086 l.attrs = o 3087} 3088function CM(l, e, t, n) { 3089 const {props: s, attrs: o, vnode: {patchFlag: i}} = l 3090 , r = Oe(s) 3091 , [a] = l.propsOptions; 3092 let d = !1; 3093 if ((n || i > 0) && !(i & 16)) { 3094 if (i & 8) { 3095 const u = l.vnode.dynamicProps; 3096 for (let h = 0; h < u.length; h++) { 3097 let c = u[h]; 3098 if (Hd(l.emitsOptions, c)) 3099 continue; 3100 const f = e[c]; 3101 if (a) 3102 if (rt(o, c)) 3103 f !== o[c] && (o[c] = f, 3104 d = !0); 3105 else { 3106 const p = pl(c); 3107 s[p] = Th(a, r, p, f, l, !1) 3108 } 3109 else 3110 f !== o[c] && (o[c] = f, 3111 d = !0) 3112 } 3113 } 3114 } else { 3115 Z1(l, e, s, o) && (d = !0); 3116 let u; 3117 for (const h in r) 3118 (!e || !rt(e, h) && ((u = Us(h)) === h || !rt(e, u))) && (a ? t && (t[h] !== void 0 || t[u] !== void 0) && (s[h] = Th(a, r, h, void 0, l, !0)) : delete s[h]); 3119 if (o !== r) 3120 for (const h in o) 3121 (!e || !rt(e, h)) && (delete o[h], 3122 d = !0) 3123 } 3124 d && Yn(l.attrs, "set", "") 3125} 3126function Z1(l, e, t, n) { 3127 const [s,o] = l.propsOptions; 3128 let i = !1, r; 3129 if (e) 3130 for (let a in e) { 3131 if (nr(a)) 3132 continue; 3133 const d = e[a]; 3134 let u; 3135 s && rt(s, u = pl(a)) ? !o || !o.includes(u) ? t[u] = d : (r || (r = {}))[u] = d : Hd(l.emitsOptions, a) || (!(a in n) || d !== n[a]) && (n[a] = d, 3136 i = !0) 3137 } 3138 if (o) { 3139 const a = Oe(t) 3140 , d = r || ct; 3141 for (let u = 0; u < o.length; u++) { 3142 const h = o[u]; 3143 t[h] = Th(s, a, h, d[h], l, !rt(d, h)) 3144 } 3145 } 3146 return i 3147} 3148function Th(l, e, t, n, s, o) { 3149 const i = l[t]; 3150 if (i != null) { 3151 const r = rt(i, "default"); 3152 if (r && n === void 0) { 3153 const a = i.default; 3154 if (i.type !== Function && !i.skipFactory && Le(a)) { 3155 const {propsDefaults: d} = s; 3156 if (t in d) 3157 n = d[t]; 3158 else { 3159 const u = Wr(s); 3160 n = d[t] = a.call(null, e), 3161 u() 3162 } 3163 } else 3164 n = a; 3165 s.ce && s.ce._setProp(t, n) 3166 } 3167 i[0] && (o && !r ? n = !1 : i[1] && (n === "" || n === Us(t)) && (n = !0)) 3168 } 3169 return n 3170} 3171const _M = new WeakMap; 3172function Q1(l, e, t=!1) { 3173 const n = t ? _M : e.propsCache 3174 , s = n.get(l); 3175 if (s) 3176 return s; 3177 const o = l.props 3178 , i = {} 3179 , r = []; 3180 let a = !1; 3181 if (!Le(l)) { 3182 const u = h=>{ 3183 a = !0; 3184 const [c,f] = Q1(h, e, !0); 3185 Ft(i, c), 3186 f && r.push(...f) 3187 } 3188 ; 3189 !t && e.mixins.length && e.mixins.forEach(u), 3190 l.extends && u(l.extends), 3191 l.mixins && l.mixins.forEach(u) 3192 } 3193 if (!o && !a) 3194 return ot(l) && n.set(l, oi), 3195 oi; 3196 if (ke(o)) 3197 for (let u = 0; u < o.length; u++) { 3198 const h = pl(o[u]); 3199 w0(h) && (i[h] = ct) 3200 } 3201 else if (o) 3202 for (const u in o) { 3203 const h = pl(u); 3204 if (w0(h)) { 3205 const c = o[u] 3206 , f = i[h] = ke(c) || Le(c) ? { 3207 type: c 3208 } : Ft({}, c) 3209 , p = f.type; 3210 let g = !1 3211 , y = !0; 3212 if (ke(p)) 3213 for (let m = 0; m < p.length; ++m) { 3214 const b = p[m] 3215 , M = Le(b) && b.name; 3216 if (M === "Boolean") { 3217 g = !0; 3218 break 3219 } else 3220 M === "String" && (y = !1) 3221 } 3222 else 3223 g = Le(p) && p.name === "Boolean"; 3224 f[0] = g, 3225 f[1] = y, 3226 (g || rt(f, "default")) && r.push(h) 3227 } 3228 } 3229 const d = [i, r]; 3230 return ot(l) && n.set(l, d), 3231 d 3232}
vendor: 5,480 bytes, lines 3232-3420
3232 3233function w0(l) { 3234 return l[0] !== "$" && !nr(l) 3235} 3236const jc = l=>l === "_" || l === "_ctx" || l === "$stable" 3237 , Jc = l=>ke(l) ? l.map(_n) : [_n(l)] 3238 , TM = (l,e,t)=>{ 3239 if (e._n) 3240 return e; 3241 const n = O((...s)=>Jc(e(...s)), t); 3242 return n._c = !1, 3243 n 3244} 3245 , em = (l,e,t)=>{ 3246 const n = l._ctx; 3247 for (const s in l) { 3248 if (jc(s)) 3249 continue; 3250 const o = l[s]; 3251 if (Le(o)) 3252 e[s] = TM(s, o, n); 3253 else if (o != null) { 3254 const i = Jc(o); 3255 e[s] = ()=>i 3256 } 3257 } 3258} 3259 , tm = (l,e)=>{ 3260 const t = Jc(e); 3261 l.slots.default = ()=>t 3262} 3263 , lm = (l,e,t)=>{ 3264 for (const n in e) 3265 (t || !jc(n)) && (l[n] = e[n]) 3266} 3267 , kM = (l,e,t)=>{ 3268 const n = l.slots = j1(); 3269 if (l.vnode.shapeFlag & 32) { 3270 const s = e._; 3271 s ? (lm(n, e, t), 3272 t && e1(n, "_", s, !0)) : em(e, n) 3273 } else 3274 e && tm(l, e) 3275} 3276 , EM = (l,e,t)=>{ 3277 const {vnode: n, slots: s} = l; 3278 let o = !0 3279 , i = ct; 3280 if (n.shapeFlag & 32) { 3281 const r = e._; 3282 r ? t && r === 1 ? o = !1 : lm(s, e, t) : (o = !e.$stable, 3283 em(e, s)), 3284 i = e 3285 } else 3286 e && (tm(l, e), 3287 i = { 3288 default: 1 3289 }); 3290 if (o) 3291 for (const r in s) 3292 !jc(r) && i[r] == null && delete s[r] 3293} 3294 , zt = LM; 3295function DM(l) { 3296 return OM(l) 3297} 3298function OM(l, e) { 3299 const t = Id(); 3300 t.__VUE__ = !0; 3301 const {insert: n, remove: s, patchProp: o, createElement: i, createText: r, createComment: a, setText: d, setElementText: u, parentNode: h, nextSibling: c, setScopeId: f=On, insertStaticContent: p} = l 3302 , g = (R,U,K,Q=null,J=null,le=null,A=void 0,L=null,G=!!U.dynamicChildren)=>{ 3303 if (R === U) 3304 return; 3305 R && !Ts(R, U) && (Q = Ze(R), 3306 _e(R, J, le, !0), 3307 R = null), 3308 U.patchFlag === -2 && (G = !1, 3309 U.dynamicChildren = null); 3310 const {type: X, ref: ue, shapeFlag: Z} = U; 3311 switch (X) { 3312 case Kr: 3313 y(R, U, K, Q); 3314 break; 3315 case qt: 3316 m(R, U, K, Q); 3317 break; 3318 case ku: 3319 R == null && b(U, K, Q, A); 3320 break; 3321 case Pe: 3322 F(R, U, K, Q, J, le, A, L, G); 3323 break; 3324 default: 3325 Z & 1 ? x(R, U, K, Q, J, le, A, L, G) : Z & 6 ? Y(R, U, K, Q, J, le, A, L, G) : (Z & 64 || Z & 128) && X.process(R, U, K, Q, J, le, A, L, G, Qe) 3326 } 3327 ue != null && J ? ir(ue, R && R.ref, le, U || R, !U) : ue == null && R && R.ref != null && ir(R.ref, null, le, R, !0) 3328 } 3329 , y = (R,U,K,Q)=>{ 3330 if (R == null) 3331 n(U.el = r(U.children), K, Q); 3332 else { 3333 const J = U.el = R.el; 3334 U.children !== R.children && d(J, U.children) 3335 } 3336 } 3337 , m = (R,U,K,Q)=>{ 3338 R == null ? n(U.el = a(U.children || ""), K, Q) : U.el = R.el 3339 } 3340 , b = (R,U,K,Q)=>{ 3341 [R.el,R.anchor] = p(R.children, U, K, Q, R.el, R.anchor) 3342 } 3343 , M = ({el: R, anchor: U},K,Q)=>{ 3344 let J; 3345 for (; R && R !== U; ) 3346 J = c(R), 3347 n(R, K, Q), 3348 R = J; 3349 n(U, K, Q) 3350 } 3351 , S = ({el: R, anchor: U})=>{ 3352 let K; 3353 for (; R && R !== U; ) 3354 K = c(R), 3355 s(R), 3356 R = K; 3357 s(U) 3358 } 3359 , x = (R,U,K,Q,J,le,A,L,G)=>{ 3360 if (U.type === "svg" ? A = "svg" : U.type === "math" && (A = "mathml"), 3361 R == null) 3362 P(U, K, Q, J, le, A, L, G); 3363 else { 3364 const X = R.el && R.el._isVueCE ? R.el : null; 3365 try { 3366 X && X._beginPatch(), 3367 k(R, U, J, le, A, L, G) 3368 } finally { 3369 X && X._endPatch() 3370 } 3371 } 3372 } 3373 , P = (R,U,K,Q,J,le,A,L)=>{ 3374 let G, X; 3375 const {props: ue, shapeFlag: Z, transition: H, dirs: W} = R; 3376 if (G = R.el = i(R.type, le, ue && ue.is, ue), 3377 Z & 8 ? u(G, R.children) : Z & 16 && T(R.children, G, null, Q, J, Tu(R, le), A, L), 3378 W && Qs(R, null, Q, "created"), 3379 C(G, R, R.scopeId, A, Q), 3380 ue) { 3381 for (const we in ue) 3382 we !== "value" && !nr(we) && o(G, we, null, ue[we], le, Q); 3383 "value"in ue && o(G, "value", null, ue.value, le), 3384 (X = ue.onVnodeBeforeMount) && Ll(X, Q, R) 3385 } 3386 W && Qs(R, null, Q, "beforeMount"); 3387 const fe = AM(J, H); 3388 fe && H.beforeEnter(G), 3389 n(G, U, K), 3390 ((X = ue && ue.onVnodeMounted) || fe || W) && zt(()=>{ 3391 try { 3392 X && Ll(X, Q, R), 3393 fe && H.enter(G), 3394 W && Qs(R, null, Q, "mounted") 3395 } finally {} 3396 } 3397 , J) 3398 } 3399 , C = (R,U,K,Q,J)=>{ 3400 if (K && f(R, K), 3401 Q) 3402 for (let le = 0; le < Q.length; le++) 3403 f(R, Q[le]); 3404 if (J) { 3405 let le = J.subTree; 3406 if (U === le || ja(le.type) && (le.ssContent === U || le.ssFallback === U)) { 3407 const A = J.vnode; 3408 C(R, A, A.scopeId, A.slotScopeIds, J.parent) 3409 } 3410 } 3411 } 3412 , T = (R,U,K,Q,J,le,A,L,G=0)=>{ 3413 for (let X = G; X < R.length; X++) { 3414 const ue = R[X] = L ? Xn(R[X]) : _n(R[X]); 3415 g(null, ue, U, K, Q, J, le, A, L) 3416 } 3417 } 3418 , k = (R,U,K,Q,J,le,A)=>{ 3419 const L = U.el = R.el; 3420 let {patchFlag: G, dynamicChildren: X, dirs: ue}
vendor: 7,698 bytes, lines 3420-3637
3420 = U; 3421 G |= R.patchFlag & 16; 3422 const Z = R.props || ct 3423 , H = U.props || ct; 3424 let W; 3425 if (K && to(K, !1), 3426 (W = H.onVnodeBeforeUpdate) && Ll(W, K, U, R), 3427 ue && Qs(U, R, K, "beforeUpdate"), 3428 K && to(K, !0), 3429 (Z.innerHTML && H.innerHTML == null || Z.textContent && H.textContent == null) && u(L, ""), 3430 X ? D(R.dynamicChildren, X, L, K, Q, Tu(U, J), le) : A || he(R, U, L, null, K, Q, Tu(U, J), le, !1), 3431 G > 0) { 3432 if (G & 16) 3433 I(L, Z, H, K, J); 3434 else if (G & 2 && Z.class !== H.class && o(L, "class", null, H.class, J), 3435 G & 4 && o(L, "style", Z.style, H.style, J), 3436 G & 8) { 3437 const fe = U.dynamicProps; 3438 for (let we = 0; we < fe.length; we++) { 3439 const Fe = fe[we] 3440 , We = Z[Fe] 3441 , Ye = H[Fe]; 3442 (Ye !== We || Fe === "value") && o(L, Fe, We, Ye, J, K) 3443 } 3444 } 3445 G & 1 && R.children !== U.children && u(L, U.children) 3446 } else 3447 !A && X == null && I(L, Z, H, K, J); 3448 ((W = H.onVnodeUpdated) || ue) && zt(()=>{ 3449 W && Ll(W, K, U, R), 3450 ue && Qs(U, R, K, "updated") 3451 } 3452 , Q) 3453 } 3454 , D = (R,U,K,Q,J,le,A)=>{ 3455 for (let L = 0; L < U.length; L++) { 3456 const G = R[L] 3457 , X = U[L] 3458 , ue = G.el && (G.type === Pe || !Ts(G, X) || G.shapeFlag & 198) ? h(G.el) : K; 3459 g(G, X, ue, null, Q, J, le, A, !0) 3460 } 3461 } 3462 , I = (R,U,K,Q,J)=>{ 3463 if (U !== K) { 3464 if (U !== ct) 3465 for (const le in U) 3466 !nr(le) && !(le in K) && o(R, le, U[le], null, J, Q); 3467 for (const le in K) { 3468 if (nr(le)) 3469 continue; 3470 const A = K[le] 3471 , L = U[le]; 3472 A !== L && le !== "value" && o(R, le, L, A, J, Q) 3473 } 3474 "value"in K && o(R, "value", U.value, K.value, J) 3475 } 3476 } 3477 , F = (R,U,K,Q,J,le,A,L,G)=>{ 3478 const X = U.el = R ? R.el : r("") 3479 , ue = U.anchor = R ? R.anchor : r(""); 3480 let {patchFlag: Z, dynamicChildren: H, slotScopeIds: W} = U; 3481 W && (L = L ? L.concat(W) : W), 3482 R == null ? (n(X, K, Q), 3483 n(ue, K, Q), 3484 T(U.children || [], K, ue, J, le, A, L, G)) : Z > 0 && Z & 64 && H && R.dynamicChildren && R.dynamicChildren.length === H.length ? (D(R.dynamicChildren, H, K, J, le, A, L), 3485 (U.key != null || J && U === J.subTree) && Zc(R, U, !0)) : he(R, U, K, ue, J, le, A, L, G) 3486 } 3487 , Y = (R,U,K,Q,J,le,A,L,G)=>{ 3488 U.slotScopeIds = L, 3489 R == null ? U.shapeFlag & 512 ? J.ctx.activate(U, K, Q, A, G) : q(U, K, Q, J, le, A, G) : re(R, U, G) 3490 } 3491 , q = (R,U,K,Q,J,le,A)=>{ 3492 const L = R.component = BM(R, Q, J); 3493 if (Bd(R) && (L.ctx.renderer = Qe), 3494 zM(L, !1, A), 3495 L.asyncDep) { 3496 if (J && J.registerDep(L, ne, A), 3497 !R.el) { 3498 const G = L.subTree = w(qt); 3499 m(null, G, U, K), 3500 R.placeholder = G.el 3501 } 3502 } else 3503 ne(L, R, U, K, J, le, A) 3504 } 3505 , re = (R,U,K)=>{ 3506 const Q = U.component = R.component; 3507 if (wM(R, U, K)) 3508 if (Q.asyncDep && !Q.asyncResolved) { 3509 te(Q, U, K); 3510 return 3511 } else 3512 Q.next = U, 3513 Q.update(); 3514 else 3515 U.el = R.el, 3516 Q.vnode = U 3517 } 3518 , ne = (R,U,K,Q,J,le,A)=>{ 3519 const L = ()=>{ 3520 if (R.isMounted) { 3521 let {next: Z, bu: H, u: W, parent: fe, vnode: we} = R; 3522 { 3523 const al = nm(R); 3524 if (al) { 3525 Z && (Z.el = we.el, 3526 te(R, Z, A)), 3527 al.asyncDep.then(()=>{ 3528 zt(()=>{ 3529 R.isUnmounted || X() 3530 } 3531 , J) 3532 } 3533 ); 3534 return 3535 } 3536 } 3537 let Fe = Z, We; 3538 to(R, !1), 3539 Z ? (Z.el = we.el, 3540 te(R, Z, A)) : Z = we, 3541 H && ri(H), 3542 (We = Z.props && Z.props.onVnodeBeforeUpdate) && Ll(We, fe, Z, we), 3543 to(R, !0); 3544 const Ye = M0(R) 3545 , Vt = R.subTree; 3546 R.subTree = Ye, 3547 g(Vt, Ye, h(Vt.el), Ze(Vt), R, J, le), 3548 Z.el = Ye.el, 3549 Fe === null && PM(R, Ye.el), 3550 W && zt(W, J), 3551 (We = Z.props && Z.props.onVnodeUpdated) && zt(()=>Ll(We, fe, Z, we), J) 3552 } else { 3553 let Z; 3554 const {el: H, props: W} = U 3555 , {bm: fe, m: we, parent: Fe, root: We, type: Ye} = R 3556 , Vt = Ds(U); 3557 to(R, !1), 3558 fe && ri(fe), 3559 !Vt && (Z = W && W.onVnodeBeforeMount) && Ll(Z, Fe, U), 3560 to(R, !0); 3561 { 3562 We.ce && We.ce._hasShadowRoot() && We.ce._injectChildStyle(Ye, R.parent ? R.parent.type : void 0); 3563 const al = R.subTree = M0(R); 3564 g(null, al, K, Q, R, J, le), 3565 U.el = al.el 3566 } 3567 if (we && zt(we, J), 3568 !Vt && (Z = W && W.onVnodeMounted)) { 3569 const al = U; 3570 zt(()=>Ll(Z, Fe, al), J) 3571 } 3572 (U.shapeFlag & 256 || Fe && Ds(Fe.vnode) && Fe.vnode.shapeFlag & 256) && R.a && zt(R.a, J), 3573 R.isMounted = !0, 3574 U = K = Q = null 3575 } 3576 } 3577 ; 3578 R.scope.on(); 3579 const G = R.effect = new i1(L); 3580 R.scope.off(); 3581 const X = R.update = G.run.bind(G) 3582 , ue = R.job = G.runIfDirty.bind(G); 3583 ue.i = R, 3584 ue.id = R.uid, 3585 G.scheduler = ()=>Hc(ue), 3586 to(R, !0), 3587 X() 3588 } 3589 , te = (R,U,K)=>{ 3590 U.component = R; 3591 const Q = R.vnode.props; 3592 R.vnode = U, 3593 R.next = null, 3594 CM(R, U.props, Q, K), 3595 EM(R, U.children, K), 3596 os(), 3597 d0(R), 3598 is() 3599 } 3600 , he = (R,U,K,Q,J,le,A,L,G=!1)=>{ 3601 const X = R && R.children 3602 , ue = R ? R.shapeFlag : 0 3603 , Z = U.children 3604 , {patchFlag: H, shapeFlag: W} = U; 3605 if (H > 0) { 3606 if (H & 128) { 3607 De(X, Z, K, Q, J, le, A, L, G); 3608 return 3609 } else if (H & 256) { 3610 Me(X, Z, K, Q, J, le, A, L, G); 3611 return 3612 } 3613 } 3614 W & 8 ? (ue & 16 && Be(X, J, le), 3615 Z !== X && u(K, Z)) : ue & 16 ? W & 16 ? De(X, Z, K, Q, J, le, A, L, G) : Be(X, J, le, !0) : (ue & 8 && u(K, ""), 3616 W & 16 && T(Z, K, Q, J, le, A, L, G)) 3617 } 3618 , Me = (R,U,K,Q,J,le,A,L,G)=>{ 3619 R = R || oi, 3620 U = U || oi; 3621 const X = R.length 3622 , ue = U.length 3623 , Z = Math.min(X, ue); 3624 let H; 3625 for (H = 0; H < Z; H++) { 3626 const W = U[H] = G ? Xn(U[H]) : _n(U[H]); 3627 g(R[H], W, K, null, J, le, A, L, G) 3628 } 3629 X > ue ? Be(R, J, le, !0, !1, Z) : T(U, K, Q, J, le, A, L, G, Z) 3630 } 3631 , De = (R,U,K,Q,J,le,A,L,G)=>{ 3632 let X = 0; 3633 const ue = U.length; 3634 let Z = R.length - 1 3635 , H = ue - 1; 3636 for (; X <= Z && X <= H; ) { 3637 const W = R[X]
vendor: 9,430 bytes, lines 3638-3965
3638 , fe = U[X] = G ? Xn(U[X]) : _n(U[X]); 3639 if (Ts(W, fe)) 3640 g(W, fe, K, null, J, le, A, L, G); 3641 else 3642 break; 3643 X++ 3644 } 3645 for (; X <= Z && X <= H; ) { 3646 const W = R[Z] 3647 , fe = U[H] = G ? Xn(U[H]) : _n(U[H]); 3648 if (Ts(W, fe)) 3649 g(W, fe, K, null, J, le, A, L, G); 3650 else 3651 break; 3652 Z--, 3653 H-- 3654 } 3655 if (X > Z) { 3656 if (X <= H) { 3657 const W = H + 1 3658 , fe = W < ue ? U[W].el : Q; 3659 for (; X <= H; ) 3660 g(null, U[X] = G ? Xn(U[X]) : _n(U[X]), K, fe, J, le, A, L, G), 3661 X++ 3662 } 3663 } else if (X > H) 3664 for (; X <= Z; ) 3665 _e(R[X], J, le, !0), 3666 X++; 3667 else { 3668 const W = X 3669 , fe = X 3670 , we = new Map; 3671 for (X = fe; X <= H; X++) { 3672 const dl = U[X] = G ? Xn(U[X]) : _n(U[X]); 3673 dl.key != null && we.set(dl.key, X) 3674 } 3675 let Fe, We = 0; 3676 const Ye = H - fe + 1; 3677 let Vt = !1 3678 , al = 0; 3679 const Zs = new Array(Ye); 3680 for (X = 0; X < Ye; X++) 3681 Zs[X] = 0; 3682 for (X = W; X <= Z; X++) { 3683 const dl = R[X]; 3684 if (We >= Ye) { 3685 _e(dl, J, le, !0); 3686 continue 3687 } 3688 let gn; 3689 if (dl.key != null) 3690 gn = we.get(dl.key); 3691 else 3692 for (Fe = fe; Fe <= H; Fe++) 3693 if (Zs[Fe - fe] === 0 && Ts(dl, U[Fe])) { 3694 gn = Fe; 3695 break 3696 } 3697 gn === void 0 ? _e(dl, J, le, !0) : (Zs[gn - fe] = X + 1, 3698 gn >= al ? al = gn : Vt = !0, 3699 g(dl, U[gn], K, null, J, le, A, L, G), 3700 We++) 3701 } 3702 const na = Vt ? IM(Zs) : oi; 3703 for (Fe = na.length - 1, 3704 X = Ye - 1; X >= 0; X--) { 3705 const dl = fe + X 3706 , gn = U[dl] 3707 , n0 = U[dl + 1] 3708 , s0 = dl + 1 < ue ? n0.el || sm(n0) : Q; 3709 Zs[X] === 0 ? g(null, gn, K, s0, J, le, A, L, G) : Vt && (Fe < 0 || X !== na[Fe] ? ye(gn, K, s0, 2) : Fe--) 3710 } 3711 } 3712 } 3713 , ye = (R,U,K,Q,J=null)=>{ 3714 const {el: le, type: A, transition: L, children: G, shapeFlag: X} = R; 3715 if (X & 6) { 3716 ye(R.component.subTree, U, K, Q); 3717 return 3718 } 3719 if (X & 128) { 3720 R.suspense.move(U, K, Q); 3721 return 3722 } 3723 if (X & 64) { 3724 A.move(R, U, K, Qe); 3725 return 3726 } 3727 if (A === Pe) { 3728 n(le, U, K); 3729 for (let Z = 0; Z < G.length; Z++) 3730 ye(G[Z], U, K, Q); 3731 n(R.anchor, U, K); 3732 return 3733 } 3734 if (A === ku) { 3735 M(R, U, K); 3736 return 3737 } 3738 if (Q !== 2 && X & 1 && L) 3739 if (Q === 0) 3740 L.beforeEnter(le), 3741 n(le, U, K), 3742 zt(()=>L.enter(le), J); 3743 else { 3744 const {leave: Z, delayLeave: H, afterLeave: W} = L 3745 , fe = ()=>{ 3746 R.ctx.isUnmounted ? s(le) : n(le, U, K) 3747 } 3748 , we = ()=>{ 3749 le._isLeaving && le[xn](!0), 3750 Z(le, ()=>{ 3751 fe(), 3752 W && W() 3753 } 3754 ) 3755 } 3756 ; 3757 H ? H(le, fe, we) : we() 3758 } 3759 else 3760 n(le, U, K) 3761 } 3762 , _e = (R,U,K,Q=!1,J=!1)=>{ 3763 const {type: le, props: A, ref: L, children: G, dynamicChildren: X, shapeFlag: ue, patchFlag: Z, dirs: H, cacheIndex: W, memo: fe} = R; 3764 if (Z === -2 && (J = !1), 3765 L != null && (os(), 3766 ir(L, null, K, R, !0), 3767 is()), 3768 W != null && (U.renderCache[W] = void 0), 3769 ue & 256) { 3770 U.ctx.deactivate(R); 3771 return 3772 } 3773 const we = ue & 1 && H 3774 , Fe = !Ds(R); 3775 let We; 3776 if (Fe && (We = A && A.onVnodeBeforeUnmount) && Ll(We, U, R), 3777 ue & 6) 3778 Re(R.component, K, Q); 3779 else { 3780 if (ue & 128) { 3781 R.suspense.unmount(K, Q); 3782 return 3783 } 3784 we && Qs(R, null, U, "beforeUnmount"), 3785 ue & 64 ? R.type.remove(R, U, K, Qe, Q) : X && !X.hasOnce && (le !== Pe || Z > 0 && Z & 64) ? Be(X, U, K, !1, !0) : (le === Pe && Z & 384 || !J && ue & 16) && Be(G, U, K), 3786 Q && Ge(R) 3787 } 3788 const Ye = fe != null && W == null; 3789 (Fe && (We = A && A.onVnodeUnmounted) || we || Ye) && zt(()=>{ 3790 We && Ll(We, U, R), 3791 we && Qs(R, null, U, "unmounted"), 3792 Ye && (R.el = null) 3793 } 3794 , K) 3795 } 3796 , Ge = R=>{ 3797 const {type: U, el: K, anchor: Q, transition: J} = R; 3798 if (U === Pe) { 3799 $e(K, Q); 3800 return 3801 } 3802 if (U === ku) { 3803 S(R); 3804 return 3805 } 3806 const le = ()=>{ 3807 s(K), 3808 J && !J.persisted && J.afterLeave && J.afterLeave() 3809 } 3810 ; 3811 if (R.shapeFlag & 1 && J && !J.persisted) { 3812 const {leave: A, delayLeave: L} = J 3813 , G = ()=>A(K, le); 3814 L ? L(R.el, le, G) : G() 3815 } else 3816 le() 3817 } 3818 , $e = (R,U)=>{ 3819 let K; 3820 for (; R !== U; ) 3821 K = c(R), 3822 s(R), 3823 R = K; 3824 s(U) 3825 } 3826 , Re = (R,U,K)=>{ 3827 const {bum: Q, scope: J, job: le, subTree: A, um: L, m: G, a: X} = R; 3828 qa(G), 3829 qa(X), 3830 Q && ri(Q), 3831 J.stop(), 3832 le && (le.flags |= 8, 3833 _e(A, R, U, K)), 3834 L && zt(L, U), 3835 zt(()=>{ 3836 R.isUnmounted = !0 3837 } 3838 , U) 3839 } 3840 , Be = (R,U,K,Q=!1,J=!1,le=0)=>{ 3841 for (let A = le; A < R.length; A++) 3842 _e(R[A], U, K, Q, J) 3843 } 3844 , Ze = R=>{ 3845 if (R.shapeFlag & 6) 3846 return Ze(R.component.subTree); 3847 if (R.shapeFlag & 128) 3848 return R.suspense.next(); 3849 const U = c(R.anchor || R.el) 3850 , K = U && U[O1]; 3851 return K ? c(K) : U 3852 } 3853 ; 3854 let Xe = !1; 3855 const dt = (R,U,K)=>{ 3856 let Q; 3857 R == null ? U._vnode && (_e(U._vnode, null, null, !0), 3858 Q = U._vnode.component) : g(U._vnode || null, R, U, null, null, null, K), 3859 U._vnode = R, 3860 Xe || (Xe = !0, 3861 d0(Q), 3862 _1(), 3863 Xe = !1) 3864 } 3865 , Qe = { 3866 p: g, 3867 um: _e, 3868 m: ye, 3869 r: Ge, 3870 mt: q, 3871 mc: T, 3872 pc: he, 3873 pbc: D, 3874 n: Ze, 3875 o: l 3876 }; 3877 return { 3878 render: dt, 3879 hydrate: void 0, 3880 createApp: mM(dt) 3881 } 3882} 3883function Tu({type: l, props: e}, t) { 3884 return t === "svg" && l === "foreignObject" || t === "mathml" && l === "annotation-xml" && e && e.encoding && e.encoding.includes("html") ? void 0 : t 3885} 3886function to({effect: l, job: e}, t) { 3887 t ? (l.flags |= 32, 3888 e.flags |= 4) : (l.flags &= -33, 3889 e.flags &= -5) 3890} 3891function AM(l, e) { 3892 return (!l || l && !l.pendingBranch) && e && !e.persisted 3893} 3894function Zc(l, e, t=!1) { 3895 const n = l.children 3896 , s = e.children; 3897 if (ke(n) && ke(s)) 3898 for (let o = 0; o < n.length; o++) { 3899 const i = n[o]; 3900 let r = s[o]; 3901 r.shapeFlag & 1 && !r.dynamicChildren && ((r.patchFlag <= 0 || r.patchFlag === 32) && (r = s[o] = Xn(s[o]), 3902 r.el = i.el), 3903 !t && r.patchFlag !== -2 && Zc(i, r)), 3904 r.type === Kr && (r.patchFlag === -1 && (r = s[o] = Xn(r)), 3905 r.el = i.el), 3906 r.type === qt && !r.el && (r.el = i.el) 3907 } 3908} 3909function IM(l) { 3910 const e = l.slice() 3911 , t = [0]; 3912 let n, s, o, i, r; 3913 const a = l.length; 3914 for (n = 0; n < a; n++) { 3915 const d = l[n]; 3916 if (d !== 0) { 3917 if (s = t[t.length - 1], 3918 l[s] < d) { 3919 e[n] = s, 3920 t.push(n); 3921 continue 3922 } 3923 for (o = 0, 3924 i = t.length - 1; o < i; ) 3925 r = o + i >> 1, 3926 l[t[r]] < d ? o = r + 1 : i = r; 3927 d < l[t[o]] && (o > 0 && (e[n] = t[o - 1]), 3928 t[o] = n) 3929 } 3930 } 3931 for (o = t.length, 3932 i = t[o - 1]; o-- > 0; ) 3933 t[o] = i, 3934 i = e[i]; 3935 return t 3936} 3937function nm(l) { 3938 const e = l.subTree.component; 3939 if (e) 3940 return e.asyncDep && !e.asyncResolved ? e : nm(e) 3941} 3942function qa(l) { 3943 if (l) 3944 for (let e = 0; e < l.length; e++) 3945 l[e].flags |= 8 3946} 3947function sm(l) { 3948 if (l.placeholder) 3949 return l.placeholder; 3950 const e = l.component; 3951 return e ? sm(e.subTree) : null 3952} 3953const ja = l=>l.__isSuspense; 3954function LM(l, e) { 3955 e && e.pendingBranch ? ke(l) ? e.effects.push(...l) : e.effects.push(l) : Bb(l) 3956} 3957const Pe = Symbol.for("v-fgt") 3958 , Kr = Symbol.for("v-txt") 3959 , qt = Symbol.for("v-cmt") 3960 , ku = Symbol.for("v-stc") 3961 , ar = []; 3962let Cl = null; 3963function N(l=!1) { 3964 ar.push(Cl = l ? null : []) 3965}
vendor: 7,266 bytes, lines 3966-4245
3966function VM() { 3967 ar.pop(), 3968 Cl = ar[ar.length - 1] || null 3969} 3970let Cr = 1; 3971function mi(l, e=!1) { 3972 Cr += l, 3973 l < 0 && Cl && e && (Cl.hasOnce = !0) 3974} 3975function om(l) { 3976 return l.dynamicChildren = Cr > 0 ? Cl || oi : null, 3977 VM(), 3978 Cr > 0 && Cl && Cl.push(l), 3979 l 3980} 3981function $(l, e, t, n, s, o) { 3982 return om(_(l, e, t, n, s, o, !0)) 3983} 3984function pe(l, e, t, n, s) { 3985 return om(w(l, e, t, n, s, !0)) 3986} 3987function yi(l) { 3988 return l ? l.__v_isVNode === !0 : !1 3989} 3990function Ts(l, e) { 3991 return l.type === e.type && l.key === e.key 3992} 3993const im = ({key: l})=>l ?? null 3994 , Oa = ({ref: l, ref_key: e, ref_for: t})=>(typeof l == "number" && (l = "" + l), 3995l != null ? St(l) || wt(l) || Le(l) ? { 3996 i: Zt, 3997 r: l, 3998 k: e, 3999 f: !!t 4000} : l : null); 4001function _(l, e=null, t=null, n=0, s=null, o=l === Pe ? 0 : 1, i=!1, r=!1) { 4002 const a = { 4003 __v_isVNode: !0, 4004 __v_skip: !0, 4005 type: l, 4006 props: e, 4007 key: e && im(e), 4008 ref: e && Oa(e), 4009 scopeId: k1, 4010 slotScopeIds: null, 4011 children: t, 4012 component: null, 4013 suspense: null, 4014 ssContent: null, 4015 ssFallback: null, 4016 dirs: null, 4017 transition: null, 4018 el: null, 4019 anchor: null, 4020 target: null, 4021 targetStart: null, 4022 targetAnchor: null, 4023 staticCount: 0, 4024 shapeFlag: o, 4025 patchFlag: n, 4026 dynamicProps: s, 4027 dynamicChildren: null, 4028 appContext: null, 4029 ctx: Zt 4030 }; 4031 return r ? (Qc(a, t), 4032 o & 128 && l.normalize(a)) : t && (a.shapeFlag |= St(t) ? 8 : 16), 4033 Cr > 0 && !i && Cl && (a.patchFlag > 0 || o & 6) && a.patchFlag !== 32 && Cl.push(a), 4034 a 4035} 4036const w = NM; 4037function NM(l, e=null, t=null, n=0, s=null, o=!1) { 4038 if ((!l || l === U1) && (l = qt), 4039 yi(l)) { 4040 const r = as(l, e, !0); 4041 return t && Qc(r, t), 4042 Cr > 0 && !o && Cl && (r.shapeFlag & 6 ? Cl[Cl.indexOf(l)] = r : Cl.push(r)), 4043 r.patchFlag = -2, 4044 r 4045 } 4046 if ($M(l) && (l = l.__vccOpts), 4047 e) { 4048 e = rm(e); 4049 let {class: r, style: a} = e; 4050 r && !St(r) && (e.class = Ne(r)), 4051 ot(a) && (Vd(a) && !ke(a) && (a = Ft({}, a)), 4052 e.style = xe(a)) 4053 } 4054 const i = St(l) ? 1 : ja(l) ? 128 : A1(l) ? 64 : ot(l) ? 4 : Le(l) ? 2 : 0; 4055 return _(l, e, t, n, s, i, o, !0) 4056} 4057function rm(l) { 4058 return l ? Vd(l) || J1(l) ? Ft({}, l) : l : null 4059} 4060function as(l, e, t=!1, n=!1) { 4061 const {props: s, ref: o, patchFlag: i, children: r, transition: a} = l 4062 , d = e ? Wl(s || {}, e) : s 4063 , u = { 4064 __v_isVNode: !0, 4065 __v_skip: !0, 4066 type: l.type, 4067 props: d, 4068 key: d && im(d), 4069 ref: e && e.ref ? t && o ? ke(o) ? o.concat(Oa(e)) : [o, Oa(e)] : Oa(e) : o, 4070 scopeId: l.scopeId, 4071 slotScopeIds: l.slotScopeIds, 4072 children: r, 4073 target: l.target, 4074 targetStart: l.targetStart, 4075 targetAnchor: l.targetAnchor, 4076 staticCount: l.staticCount, 4077 shapeFlag: l.shapeFlag, 4078 patchFlag: e && l.type !== Pe ? i === -1 ? 16 : i | 16 : i, 4079 dynamicProps: l.dynamicProps, 4080 dynamicChildren: l.dynamicChildren, 4081 appContext: l.appContext, 4082 dirs: l.dirs, 4083 transition: a, 4084 component: l.component, 4085 suspense: l.suspense, 4086 ssContent: l.ssContent && as(l.ssContent), 4087 ssFallback: l.ssFallback && as(l.ssFallback), 4088 placeholder: l.placeholder, 4089 el: l.el, 4090 anchor: l.anchor, 4091 ctx: l.ctx, 4092 ce: l.ce 4093 }; 4094 return a && n && Ls(u, a.clone(u)), 4095 u 4096} 4097function ve(l=" ", e=0) { 4098 return w(Kr, null, l, e) 4099} 4100function be(l="", e=!1) { 4101 return e ? (N(), 4102 pe(qt, null, l)) : w(qt, null, l) 4103} 4104function _n(l) { 4105 return l == null || typeof l == "boolean" ? w(qt) : ke(l) ? w(Pe, null, l.slice()) : yi(l) ? Xn(l) : w(Kr, null, String(l)) 4106} 4107function Xn(l) { 4108 return l.el === null && l.patchFlag !== -1 || l.memo ? l : as(l) 4109} 4110function Qc(l, e) { 4111 let t = 0; 4112 const {shapeFlag: n} = l; 4113 if (e == null) 4114 e = null; 4115 else if (ke(e)) 4116 t = 16; 4117 else if (typeof e == "object") 4118 if (n & 65) { 4119 const s = e.default; 4120 s && (s._c && (s._d = !1), 4121 Qc(l, s()), 4122 s._c && (s._d = !0)); 4123 return 4124 } else { 4125 t = 32; 4126 const s = e._; 4127 !s && !J1(e) ? e._ctx = Zt : s === 3 && Zt && (Zt.slots._ === 1 ? e._ = 1 : (e._ = 2, 4128 l.patchFlag |= 1024)) 4129 } 4130 else 4131 Le(e) ? (e = { 4132 default: e, 4133 _ctx: Zt 4134 }, 4135 t = 32) : (e = String(e), 4136 n & 64 ? (t = 16, 4137 e = [ve(e)]) : t = 8); 4138 l.children = e, 4139 l.shapeFlag |= t 4140} 4141function Wl(...l) { 4142 const e = {}; 4143 for (let t = 0; t < l.length; t++) { 4144 const n = l[t]; 4145 for (const s in n) 4146 if (s === "class") 4147 e.class !== n.class && (e.class = Ne([e.class, n.class])); 4148 else if (s === "style") 4149 e.style = xe([e.style, n.style]); 4150 else if (kd(s)) { 4151 const o = e[s] 4152 , i = n[s]; 4153 i && o !== i && !(ke(o) && o.includes(i)) ? e[s] = o ? [].concat(o, i) : i : i == null && o == null && !Ed(s) && (e[s] = i) 4154 } else 4155 s !== "" && (e[s] = n[s]) 4156 } 4157 return e 4158} 4159function Ll(l, e, t, n=null) { 4160 an(l, e, 7, [t, n]) 4161} 4162const RM = Y1(); 4163let FM = 0; 4164function BM(l, e, t) { 4165 const n = l.type 4166 , s = (e ? e.appContext : l.appContext) || RM 4167 , o = { 4168 uid: FM++, 4169 vnode: l, 4170 type: n, 4171 parent: e, 4172 appContext: s, 4173 root: null, 4174 next: null, 4175 subTree: null, 4176 effect: null, 4177 update: null, 4178 job: null, 4179 scope: new s1(!0), 4180 render: null, 4181 proxy: null, 4182 exposed: null, 4183 exposeProxy: null, 4184 withProxy: null, 4185 provides: e ? e.provides : Object.create(s.provides), 4186 ids: e ? e.ids : ["", 0, 0], 4187 accessCache: null, 4188 renderCache: [], 4189 components: null, 4190 directives: null, 4191 propsOptions: Q1(n, s), 4192 emitsOptions: K1(n, s), 4193 emit: null, 4194 emitted: null, 4195 propsDefaults: ct, 4196 inheritAttrs: n.inheritAttrs, 4197 ctx: ct, 4198 data: ct, 4199 props: ct, 4200 attrs: ct, 4201 slots: ct, 4202 refs: ct, 4203 setupState: ct, 4204 setupContext: null, 4205 suspense: t, 4206 suspenseId: t ? t.pendingId : 0, 4207 asyncDep: null, 4208 asyncResolved: !1, 4209 isMounted: !1, 4210 isUnmounted: !1, 4211 isDeactivated: !1, 4212 bc: null, 4213 c: null, 4214 bm: null, 4215 m: null, 4216 bu: null, 4217 u: null, 4218 um: null, 4219 bum: null, 4220 da: null, 4221 a: null, 4222 rtg: null, 4223 rtc: null, 4224 ec: null, 4225 sp: null 4226 }; 4227 return o.ctx = { 4228 _: o 4229 }, 4230 o.root = e ? e.root : o, 4231 o.emit = vM.bind(null, o), 4232 l.ce && l.ce(o), 4233 o 4234} 4235let rl = null; 4236const Ti = ()=>rl || Zt; 4237let Ja, kh; 4238{ 4239 const l = Id() 4240 , e = (t,n)=>{ 4241 let s; 4242 return (s = l[t]) || (s = l[t] = []), 4243 s.push(n), 4244 o=>{ 4245 s.length >
vendor: 2,966 bytes, lines 4245-4380
4245 1 ? s.forEach(i=>i(o)) : s[0](o) 4246 } 4247 } 4248 ; 4249 Ja = e("__VUE_INSTANCE_SETTERS__", t=>rl = t), 4250 kh = e("__VUE_SSR_SETTERS__", t=>_r = t) 4251} 4252const Wr = l=>{ 4253 const e = rl; 4254 return Ja(l), 4255 l.scope.on(), 4256 ()=>{ 4257 l.scope.off(), 4258 Ja(e) 4259 } 4260} 4261 , P0 = ()=>{ 4262 rl && rl.scope.off(), 4263 Ja(null) 4264} 4265; 4266function am(l) { 4267 return l.vnode.shapeFlag & 4 4268} 4269let _r = !1; 4270function zM(l, e=!1, t=!1) { 4271 e && kh(e); 4272 const {props: n, children: s} = l.vnode 4273 , o = am(l); 4274 xM(l, n, o, e), 4275 kM(l, s, t || e); 4276 const i = o ? UM(l, e) : void 0; 4277 return e && kh(!1), 4278 i 4279} 4280function UM(l, e) { 4281 const t = l.type; 4282 l.accessCache = Object.create(null), 4283 l.proxy = new Proxy(l.ctx,dM); 4284 const {setup: n} = t; 4285 if (n) { 4286 os(); 4287 const s = l.setupContext = n.length > 1 ? HM(l) : null 4288 , o = Wr(l) 4289 , i = Yr(n, l, 0, [l.props, s]) 4290 , r = Jg(i); 4291 if (is(), 4292 o(), 4293 (r || l.sp) && !Ds(l) && B1(l), 4294 r) { 4295 if (i.then(P0, P0), 4296 e) 4297 return i.then(a=>{ 4298 x0(l, a) 4299 } 4300 ).catch(a=>{ 4301 Rd(a, l, 0) 4302 } 4303 ); 4304 l.asyncDep = i 4305 } else 4306 x0(l, i) 4307 } else 4308 dm(l) 4309} 4310function x0(l, e, t) { 4311 Le(e) ? l.type.__ssrInlineRender ? l.ssrRender = e : l.render = e : ot(e) && (l.setupState = w1(e)), 4312 dm(l) 4313} 4314function dm(l, e, t) { 4315 const n = l.type; 4316 l.render || (l.render = n.render || On); 4317 { 4318 const s = Wr(l); 4319 os(); 4320 try { 4321 uM(l) 4322 } finally { 4323 is(), 4324 s() 4325 } 4326 } 4327} 4328const GM = { 4329 get(l, e) { 4330 return ol(l, "get", ""), 4331 l[e] 4332 } 4333}; 4334function HM(l) { 4335 const e = t=>{ 4336 l.exposed = t || {} 4337 } 4338 ; 4339 return { 4340 attrs: new Proxy(l.attrs,GM), 4341 slots: l.slots, 4342 emit: l.emit, 4343 expose: e 4344 } 4345} 4346function $d(l) { 4347 return l.exposed ? l.exposeProxy || (l.exposeProxy = new Proxy(w1(me(l.exposed)),{ 4348 get(e, t) { 4349 if (t in e) 4350 return e[t]; 4351 if (t in rr) 4352 return rr[t](l) 4353 }, 4354 has(e, t) { 4355 return t in e || t in rr 4356 } 4357 })) : l.proxy 4358} 4359function Eh(l, e=!0) { 4360 return Le(l) ? l.displayName || l.name : l.name || e && l.__name 4361} 4362function $M(l) { 4363 return Le(l) && "__vccOpts"in l 4364} 4365const So = (l,e)=>Lb(l, e, _r); 4366function Xd(l, e, t) { 4367 try { 4368 mi(-1); 4369 const n = arguments.length; 4370 return n === 2 ? ot(e) && !ke(e) ? yi(e) ? w(l, null, [e]) : w(l, e) : w(l, null, e) : (n > 3 ? t = Array.prototype.slice.call(arguments, 2) : n === 3 && yi(t) && (t = [t]), 4371 w(l, e, t)) 4372 } finally { 4373 mi(1) 4374 } 4375} 4376const XM = "3.5.32"; 4377/** 4378* @vue/runtime-dom v3.5.32 4379* (c) 2018-present Yuxi (Evan) You and Vue contributors 4380* @license MIT
vendor: 11,093 bytes, lines 4381-4788
4381**/ 4382let Dh; 4383const C0 = typeof window < "u" && window.trustedTypes; 4384if (C0) 4385 try { 4386 Dh = C0.createPolicy("vue", { 4387 createHTML: l=>l 4388 }) 4389 } catch {} 4390const um = Dh ? l=>Dh.createHTML(l) : l=>l 4391 , YM = "http://www.w3.org/2000/svg" 4392 , KM = "http://www.w3.org/1998/Math/MathML" 4393 , Hn = typeof document < "u" ? document : null 4394 , _0 = Hn && Hn.createElement("template") 4395 , WM = { 4396 insert: (l,e,t)=>{ 4397 e.insertBefore(l, t || null) 4398 } 4399 , 4400 remove: l=>{ 4401 const e = l.parentNode; 4402 e && e.removeChild(l) 4403 } 4404 , 4405 createElement: (l,e,t,n)=>{ 4406 const s = e === "svg" ? Hn.createElementNS(YM, l) : e === "mathml" ? Hn.createElementNS(KM, l) : t ? Hn.createElement(l, { 4407 is: t 4408 }) : Hn.createElement(l); 4409 return l === "select" && n && n.multiple != null && s.setAttribute("multiple", n.multiple), 4410 s 4411 } 4412 , 4413 createText: l=>Hn.createTextNode(l), 4414 createComment: l=>Hn.createComment(l), 4415 setText: (l,e)=>{ 4416 l.nodeValue = e 4417 } 4418 , 4419 setElementText: (l,e)=>{ 4420 l.textContent = e 4421 } 4422 , 4423 parentNode: l=>l.parentNode, 4424 nextSibling: l=>l.nextSibling, 4425 querySelector: l=>Hn.querySelector(l), 4426 setScopeId(l, e) { 4427 l.setAttribute(e, "") 4428 }, 4429 insertStaticContent(l, e, t, n, s, o) { 4430 const i = t ? t.previousSibling : e.lastChild; 4431 if (s && (s === o || s.nextSibling)) 4432 for (; e.insertBefore(s.cloneNode(!0), t), 4433 !(s === o || !(s = s.nextSibling)); ) 4434 ; 4435 else { 4436 _0.innerHTML = um(n === "svg" ? `<svg>${l}</svg>` : n === "mathml" ? `<math>${l}</math>` : l); 4437 const r = _0.content; 4438 if (n === "svg" || n === "mathml") { 4439 const a = r.firstChild; 4440 for (; a.firstChild; ) 4441 r.appendChild(a.firstChild); 4442 r.removeChild(a) 4443 } 4444 e.insertBefore(r, t) 4445 } 4446 return [i ? i.nextSibling : e.firstChild, t ? t.previousSibling : e.lastChild] 4447 } 4448} 4449 , ys = "transition" 4450 , Fi = "animation" 4451 , vi = Symbol("_vtc") 4452 , hm = { 4453 name: String, 4454 type: String, 4455 css: { 4456 type: Boolean, 4457 default: !0 4458 }, 4459 duration: [String, Number, Object], 4460 enterFromClass: String, 4461 enterActiveClass: String, 4462 enterToClass: String, 4463 appearFromClass: String, 4464 appearActiveClass: String, 4465 appearToClass: String, 4466 leaveFromClass: String, 4467 leaveActiveClass: String, 4468 leaveToClass: String 4469} 4470 , cm = Ft({}, V1, hm) 4471 , qM = l=>(l.displayName = "Transition", 4472l.props = cm, 4473l) 4474 , Za = qM((l,{slots: e})=>Xd(qb, fm(l), e)) 4475 , lo = (l,e=[])=>{ 4476 ke(l) ? l.forEach(t=>t(...e)) : l && l(...e) 4477} 4478 , T0 = l=>l ? ke(l) ? l.some(e=>e.length > 1) : l.length > 1 : !1; 4479function fm(l) { 4480 const e = {}; 4481 for (const F in l) 4482 F in hm || (e[F] = l[F]); 4483 if (l.css === !1) 4484 return e; 4485 const {name: t="v", type: n, duration: s, enterFromClass: o=`${t}-enter-from`, enterActiveClass: i=`${t}-enter-active`, enterToClass: r=`${t}-enter-to`, appearFromClass: a=o, appearActiveClass: d=i, appearToClass: u=r, leaveFromClass: h=`${t}-leave-from`, leaveActiveClass: c=`${t}-leave-active`, leaveToClass: f=`${t}-leave-to`} = l 4486 , p = jM(s) 4487 , g = p && p[0] 4488 , y = p && p[1] 4489 , {onBeforeEnter: m, onEnter: b, onEnterCancelled: M, onLeave: S, onLeaveCancelled: x, onBeforeAppear: P=m, onAppear: C=b, onAppearCancelled: T=M} = e 4490 , k = (F,Y,q,re)=>{ 4491 F._enterCancelled = re, 4492 Ps(F, Y ? u : r), 4493 Ps(F, Y ? d : i), 4494 q && q() 4495 } 4496 , D = (F,Y)=>{ 4497 F._isLeaving = !1, 4498 Ps(F, h), 4499 Ps(F, f), 4500 Ps(F, c), 4501 Y && Y() 4502 } 4503 , I = F=>(Y,q)=>{ 4504 const re = F ? C : b 4505 , ne = ()=>k(Y, F, q); 4506 lo(re, [Y, ne]), 4507 k0(()=>{ 4508 Ps(Y, F ? a : o), 4509 Sn(Y, F ? u : r), 4510 T0(re) || E0(Y, n, g, ne) 4511 } 4512 ) 4513 } 4514 ; 4515 return Ft(e, { 4516 onBeforeEnter(F) { 4517 lo(m, [F]), 4518 Sn(F, o), 4519 Sn(F, i) 4520 }, 4521 onBeforeAppear(F) { 4522 lo(P, [F]), 4523 Sn(F, a), 4524 Sn(F, d) 4525 }, 4526 onEnter: I(!1), 4527 onAppear: I(!0), 4528 onLeave(F, Y) { 4529 F._isLeaving = !0; 4530 const q = ()=>D(F, Y); 4531 Sn(F, h), 4532 F._enterCancelled ? (Sn(F, c), 4533 Oh(F)) : (Oh(F), 4534 Sn(F, c)), 4535 k0(()=>{ 4536 F._isLeaving && (Ps(F, h), 4537 Sn(F, f), 4538 T0(S) || E0(F, n, y, q)) 4539 } 4540 ), 4541 lo(S, [F, q]) 4542 }, 4543 onEnterCancelled(F) { 4544 k(F, !1, void 0, !0), 4545 lo(M, [F]) 4546 }, 4547 onAppearCancelled(F) { 4548 k(F, !0, void 0, !0), 4549 lo(T, [F]) 4550 }, 4551 onLeaveCancelled(F) { 4552 D(F), 4553 lo(x, [F]) 4554 } 4555 }) 4556} 4557function jM(l) { 4558 if (l == null) 4559 return null; 4560 if (ot(l)) 4561 return [Eu(l.enter), Eu(l.leave)]; 4562 { 4563 const e = Eu(l); 4564 return [e, e] 4565 } 4566} 4567function Eu(l) { 4568 return Zv(l) 4569} 4570function Sn(l, e) { 4571 e.split(/\s+/).forEach(t=>t && l.classList.add(t)), 4572 (l[vi] || (l[vi] = new Set)).add(e) 4573} 4574function Ps(l, e) { 4575 e.split(/\s+/).forEach(n=>n && l.classList.remove(n)); 4576 const t = l[vi]; 4577 t && (t.delete(e), 4578 t.size || (l[vi] = void 0)) 4579} 4580function k0(l) { 4581 requestAnimationFrame(()=>{ 4582 requestAnimationFrame(l) 4583 } 4584 ) 4585} 4586let JM = 0; 4587function E0(l, e, t, n) { 4588 const s = l._endId = ++JM 4589 , o = ()=>{ 4590 s === l._endId && n() 4591 } 4592 ; 4593 if (t != null) 4594 return setTimeout(o, t); 4595 const {type: i, timeout: r, propCount: a} = pm(l, e); 4596 if (!i) 4597 return n(); 4598 const d = i + "end"; 4599 let u = 0; 4600 const h = ()=>{ 4601 l.removeEventListener(d, c), 4602 o() 4603 } 4604 , c = f=>{ 4605 f.target === l && ++u >= a && h() 4606 } 4607 ; 4608 setTimeout(()=>{ 4609 u < a && h() 4610 } 4611 , r + 1), 4612 l.addEventListener(d, c) 4613} 4614function pm(l, e) { 4615 const t = window.getComputedStyle(l) 4616 , n = p=>(t[p] || "").split(", ") 4617 , s = n(`${ys}Delay`) 4618 , o = n(`${ys}Duration`) 4619 , i = D0(s, o) 4620 , r = n(`${Fi}Delay`) 4621 , a = n(`${Fi}Duration`) 4622 , d = D0(r, a); 4623 let u = null 4624 , h = 0 4625 , c = 0; 4626 e === ys ? i > 0 && (u = ys, 4627 h = i, 4628 c = o.length) : e === Fi ? d > 0 && (u = Fi, 4629 h = d, 4630 c = a.length) : (h = Math.max(i, d), 4631 u = h > 0 ? i > d ? ys : Fi : null, 4632 c = u ? u === ys ? o.length : a.length : 0); 4633 const f = u === ys && /\b(?:transform|all)(?:,|$)/.test(n(`${ys}Property`).toString()); 4634 return { 4635 type: u, 4636 timeout: h, 4637 propCount: c, 4638 hasTransform: f 4639 } 4640} 4641function D0(l, e) { 4642 for (; l.length < e.length; ) 4643 l = l.concat(l); 4644 return Math.max(...e.map((t,n)=>O0(t) + O0(l[n]))) 4645} 4646function O0(l) { 4647 return l === "auto" ? 0 : Number(l.slice(0, -1).replace(",", ".")) * 1e3 4648} 4649function Oh(l) { 4650 return (l ? l.ownerDocument : document).body.offsetHeight 4651} 4652function ZM(l, e, t) { 4653 const n = l[vi]; 4654 n && (e = (e ? [e, ...n] : [...n]).join(" ")), 4655 e == null ? l.removeAttribute("class") : t ? l.setAttribute("class", e) : l.className = e 4656} 4657const Qa = Symbol("_vod") 4658 , gm = Symbol("_vsh") 4659 , ef = { 4660 name: "show", 4661 beforeMount(l, {value: e}, {transition: t}) { 4662 l[Qa] = l.style.display === "none" ? "" : l.style.display, 4663 t && e ? t.beforeEnter(l) : Bi(l, e) 4664 }, 4665 mounted(l, {value: e}, {transition: t}) { 4666 t && e && t.enter(l) 4667 }, 4668 updated(l, {value: e, oldValue: t}, {transition: n}) { 4669 !e != !t && (n ? e ? (n.beforeEnter(l), 4670 Bi(l, !0), 4671 n.enter(l)) : n.leave(l, ()=>{ 4672 Bi(l, !1) 4673 } 4674 ) : Bi(l, e)) 4675 }, 4676 beforeUnmount(l, {value: e}) { 4677 Bi(l, e) 4678 } 4679}; 4680function Bi(l, e) { 4681 l.style.display = e ? l[Qa] : "none", 4682 l[gm] = !e 4683} 4684const QM = Symbol("") 4685 , eS = /(?:^|;)\s*display\s*:/; 4686function tS(l, e, t) { 4687 const n = l.style 4688 , s = St(t); 4689 let o = !1; 4690 if (t && !s) { 4691 if (e) 4692 if (St(e)) 4693 for (const i of e.split(";")) { 4694 const r = i.slice(0, i.indexOf(":")).trim(); 4695 t[r] == null && Aa(n, r, "") 4696 } 4697 else 4698 for (const i in e) 4699 t[i] == null && Aa(n, i, ""); 4700 for (const i in t) 4701 i === "display" && (o = !0), 4702 Aa(n, i, t[i]) 4703 } else if (s) { 4704 if (e !== t) { 4705 const i = n[QM]; 4706 i && (t += ";" + i), 4707 n.cssText = t, 4708 o = eS.test(t) 4709 } 4710 } else 4711 e && l.removeAttribute("style"); 4712 Qa in l && (l[Qa] = o ? n.display : "", 4713 l[gm] && (n.display = "none")) 4714} 4715const A0 = /\s*!important$/; 4716function Aa(l, e, t) { 4717 if (ke(t)) 4718 t.forEach(n=>Aa(l, e, n)); 4719 else if (t == null && (t = ""), 4720 e.startsWith("--")) 4721 l.setProperty(e, t); 4722 else { 4723 const n = lS(l, e); 4724 A0.test(t) ? l.setProperty(Us(n), t.replace(A0, ""), "important") : l[n] = t 4725 } 4726} 4727const I0 = ["Webkit", "Moz", "ms"] 4728 , Du = {}; 4729function lS(l, e) { 4730 const t = Du[e]; 4731 if (t) 4732 return t; 4733 let n = pl(e); 4734 if (n !== "filter" && n in l) 4735 return Du[e] = n; 4736 n = Ad(n); 4737 for (let s = 0; s < I0.length; s++) { 4738 const o = I0[s] + n; 4739 if (o in l) 4740 return Du[e] = o 4741 } 4742 return e 4743} 4744const L0 = "http://www.w3.org/1999/xlink"; 4745function V0(l, e, t, n, s, o=ob(e)) { 4746 n && e.startsWith("xlink:") ? t == null ? l.removeAttributeNS(L0, e.slice(6, e.length)) : l.setAttributeNS(L0, e, t) : t == null || o && !t1(t) ? l.removeAttribute(e) : l.setAttribute(e, o ? "" : kl(t) ? String(t) : t) 4747} 4748function N0(l, e, t, n, s) { 4749 if (e === "innerHTML" || e === "textContent") { 4750 t != null && (l[e] = e === "innerHTML" ? um(t) : t); 4751 return 4752 } 4753 const o = l.tagName; 4754 if (e === "value" && o !== "PROGRESS" && !o.includes("-")) { 4755 const r = o === "OPTION" ? l.getAttribute("value") || "" : l.value 4756 , a = t == null ? l.type === "checkbox" ? "on" : "" : String(t); 4757 (r !== a || !("_value"in l)) && (l.value = a), 4758 t == null && l.removeAttribute(e), 4759 l._value = t; 4760 return 4761 } 4762 let i = !1; 4763 if (t === "" || t == null) { 4764 const r = typeof l[e]; 4765 r === "boolean" ? t = t1(t) : t == null && r === "string" ? (t = "", 4766 i = !0) : r === "number" && (t = 0, 4767 i = !0) 4768 } 4769 try { 4770 l[e] = t 4771 } catch {} 4772 i && l.removeAttribute(s || e) 4773} 4774function wo(l, e, t, n) { 4775 l.addEventListener(e, t, n) 4776} 4777function nS(l, e, t, n) { 4778 l.removeEventListener(e, t, n) 4779} 4780const R0 = Symbol("_vei"); 4781function sS(l, e, t, n, s=null) { 4782 const o = l[R0] || (l[R0] = {}) 4783 , i = o[e]; 4784 if (n && i) 4785 i.value = n; 4786 else { 4787 const [r,a] = oS(e); 4788 if (n) {
4789 const d = o[e] = aS(n, s); 4790 wo(l, r, d, a) 4791 } else 4792 i && (nS(l, r, i, a), 4793 o[e] = void 0) 4794 } 4795} 4796const F0 = /(?:Once|Passive|Capture)$/; 4797function oS(l) { 4798 let e; 4799 if (F0.test(l)) { 4800 e = {}; 4801 let n; 4802 for (; n = l.match(F0); ) 4803 l = l.slice(0, l.length - n[0].length), 4804 e[n[0].toLowerCase()] = !0 4805 } 4806 return [l[2] === ":" ? l.slice(3) : Us(l.slice(2)), e] 4807} 4808let Ou = 0; 4809const iS = Promise.resolve() 4810 , rS = ()=>Ou || (iS.then(()=>Ou = 0), 4811Ou = Date.now()); 4812function aS(l, e) { 4813 const t = n=>{ 4814 if (!n._vts) 4815 n._vts = Date.now(); 4816 else if (n._vts <= t.attached) 4817 return; 4818 an(dS(n, t.value), e, 5, [n]) 4819 } 4820 ; 4821 return t.value = l, 4822 t.attached = rS(), 4823 t 4824} 4825function dS(l, e) { 4826 if (ke(e)) { 4827 const t = l.stopImmediatePropagation; 4828 return l.stopImmediatePropagation = ()=>{ 4829 t.call(l), 4830 l._stopped = !0 4831 } 4832 , 4833 e.map(n=>s=>!s._stopped && n && n(s)) 4834 } else 4835 return e 4836} 4837const B0 = l=>l.charCodeAt(0) === 111 && l.charCodeAt(1) === 110 && l.charCodeAt(2) > 96 && l.charCodeAt(2) < 123 4838 , uS = (l,e,t,n,s,o)=>{ 4839 const i = s === "svg"; 4840 e === "class" ? ZM(l, n, i) : e === "style" ? tS(l, t, n) : kd(e) ? Ed(e) || sS(l, e, t, n, o) : (e[0] === "." ? (e = e.slice(1), 4841 !0) : e[0] === "^" ? (e = e.slice(1), 4842 !1) : hS(l, e, n, i)) ? (N0(l, e, n), 4843 !l.tagName.includes("-") && (e === "value" || e === "checked" || e === "selected") && V0(l, e, n, i, o, e !== "value")) : l._isVueCE && (cS(l, e) || l._def.__asyncLoader && (/[A-Z]/.test(e) || !St(n))) ? N0(l, pl(e), n, o, e) : (e === "true-value" ? l._trueValue = n : e === "false-value" && (l._falseValue = n), 4844 V0(l, e, n, i)) 4845} 4846; 4847function hS(l, e, t, n) { 4848 if (n) 4849 return !!(e === "innerHTML" || e === "textContent" || e in l && B0(e) && Le(t)); 4850 if (e === "spellcheck" || e === "draggable" || e === "translate" || e === "autocorrect" || e === "sandbox" && l.tagName === "IFRAME" || e === "form" || e === "list" && l.tagName === "INPUT" || e === "type" && l.tagName === "TEXTAREA") 4851 return !1; 4852 if (e === "width" || e === "height") { 4853 const s = l.tagName; 4854 if (s === "IMG" || s === "VIDEO" || s === "CANVAS" || s === "SOURCE") 4855 return !1 4856 } 4857 return B0(e) && St(t) ? !1 : e in l 4858} 4859function cS(l, e) { 4860 const t = l._def.props; 4861 if (!t) 4862 return !1; 4863 const n = pl(e); 4864 return Array.isArray(t) ? t.some(s=>pl(s) === n) : Object.keys(t).some(s=>pl(s) === n) 4865} 4866const mm = new WeakMap 4867 , ym = new WeakMap 4868 , ed = Symbol("_moveCb") 4869 , z0 = Symbol("_enterCb") 4870 , fS = l=>(delete l.props.mode, 4871l) 4872 , pS = fS({ 4873 name: "TransitionGroup", 4874 props: Ft({}, cm, { 4875 tag: String, 4876 moveClass: String 4877 }), 4878 setup(l, {slots: e}) { 4879 const t = Ti() 4880 , n = L1(); 4881 let s, o; 4882 return Xc(()=>{ 4883 if (!s.length) 4884 return; 4885 const i = l.moveClass || `${l.name || "v"}-move`; 4886 if (!bS(s[0].el, t.vnode.el, i)) { 4887 s = []; 4888 return 4889 } 4890 s.forEach(mS), 4891 s.forEach(yS); 4892 const r = s.filter(vS); 4893 Oh(t.vnode.el), 4894 r.forEach(a=>{ 4895 const d = a.el 4896 , u = d.style; 4897 Sn(d, i), 4898 u.transform = u.webkitTransform = u.transitionDuration = ""; 4899 const h = d[ed] = c=>{ 4900 c && c.target !== d || (!c || c.propertyName.endsWith("transform")) && (d.removeEventListener("transitionend", h), 4901 d[ed] = null, 4902 Ps(d, i)) 4903 } 4904 ; 4905 d.addEventListener("transitionend", h) 4906 } 4907 ), 4908 s = [] 4909 } 4910 ), 4911 ()=>{ 4912 const i = Oe(l) 4913 , r = fm(i); 4914 let a = i.tag || Pe; 4915 if (s = [], 4916 o) 4917 for (let d = 0; d < o.length; d++) { 4918 const u = o[d]; 4919 u.el && u.el instanceof Element && (s.push(u), 4920 Ls(u, xr(u, r, n, t)), 4921 mm.set(u, vm(u.el))) 4922 } 4923 o = e.default ? $c(e.default()) : []; 4924 for (let d = 0; d < o.length; d++) { 4925 const u = o[d]; 4926 u.key != null && Ls(u, xr(u, r, n, t)) 4927 } 4928 return w(a, null, o) 4929 } 4930 } 4931}) 4932 , gS = pS; 4933function mS(l) { 4934 const e = l.el; 4935 e[ed] && e[ed](), 4936 e[z0] && e[z0]() 4937} 4938function yS(l) { 4939 ym.set(l, vm(l.el)) 4940} 4941function vS(l) { 4942 const e = mm.get(l) 4943 , t = ym.get(l) 4944 , n = e.left - t.left 4945 , s = e.top - t.top; 4946 if (n || s) { 4947 const o = l.el 4948 , i = o.style 4949 , r = o.getBoundingClientRect(); 4950 let a = 1 4951 , d = 1; 4952 return o.offsetWidth && (a = r.width / o.offsetWidth), 4953 o.offsetHeight && (d = r.height / o.offsetHeight), 4954 (!Number.isFinite(a) || a === 0) && (a = 1), 4955 (!Number.isFinite(d) || d === 0) && (d = 1), 4956 Math.abs(a - 1) < .01 && (a = 1), 4957 Math.abs(d - 1) < .01 && (d = 1), 4958 i.transform = i.webkitTransform = `translate(${n / a}px,${s / d}px)`, 4959 i.transitionDuration = "0s", 4960 l 4961 } 4962} 4963function vm(l) { 4964 const e = l.getBoundingClientRect(); 4965 return { 4966 left: e.left, 4967 top: e.top 4968 } 4969} 4970function bS(l, e, t) { 4971 const n = l.cloneNode() 4972 , s = l[vi];
vendor: 9,205 bytes, lines 4973-5343
4973 s && s.forEach(r=>{ 4974 r.split(/\s+/).forEach(a=>a && n.classList.remove(a)) 4975 } 4976 ), 4977 t.split(/\s+/).forEach(r=>r && n.classList.add(r)), 4978 n.style.display = "none"; 4979 const o = e.nodeType === 1 ? e : e.parentNode; 4980 o.appendChild(n); 4981 const {hasTransform: i} = pm(n); 4982 return o.removeChild(n), 4983 i 4984} 4985const td = l=>{ 4986 const e = l.props["onUpdate:modelValue"] || !1; 4987 return ke(e) ? t=>ri(e, t) : e 4988} 4989; 4990function MS(l) { 4991 l.target.composing = !0 4992} 4993function U0(l) { 4994 const e = l.target; 4995 e.composing && (e.composing = !1, 4996 e.dispatchEvent(new Event("input"))) 4997} 4998const ui = Symbol("_assign"); 4999function G0(l, e, t) { 5000 return e && (l = l.trim()), 5001 t && (l = Vc(l)), 5002 l 5003} 5004const SS = { 5005 created(l, {modifiers: {lazy: e, trim: t, number: n}}, s) { 5006 l[ui] = td(s); 5007 const o = n || s.props && s.props.type === "number"; 5008 wo(l, e ? "change" : "input", i=>{ 5009 i.target.composing || l[ui](G0(l.value, t, o)) 5010 } 5011 ), 5012 (t || o) && wo(l, "change", ()=>{ 5013 l.value = G0(l.value, t, o) 5014 } 5015 ), 5016 e || (wo(l, "compositionstart", MS), 5017 wo(l, "compositionend", U0), 5018 wo(l, "change", U0)) 5019 }, 5020 mounted(l, {value: e}) { 5021 l.value = e ?? "" 5022 }, 5023 beforeUpdate(l, {value: e, oldValue: t, modifiers: {lazy: n, trim: s, number: o}}, i) { 5024 if (l[ui] = td(i), 5025 l.composing) 5026 return; 5027 const r = (o || l.type === "number") && !/^0\d/.test(l.value) ? Vc(l.value) : l.value 5028 , a = e ?? ""; 5029 if (r === a) 5030 return; 5031 const d = l.getRootNode(); 5032 (d instanceof Document || d instanceof ShadowRoot) && d.activeElement === l && l.type !== "range" && (n && e === t || s && l.value.trim() === a) || (l.value = a) 5033 } 5034} 5035 , H0 = { 5036 created(l, {value: e}, t) { 5037 l.checked = Mr(e, t.props.value), 5038 l[ui] = td(t), 5039 wo(l, "change", ()=>{ 5040 l[ui](wS(l)) 5041 } 5042 ) 5043 }, 5044 beforeUpdate(l, {value: e, oldValue: t}, n) { 5045 l[ui] = td(n), 5046 e !== t && (l.checked = Mr(e, n.props.value)) 5047 } 5048}; 5049function wS(l) { 5050 return "_value"in l ? l._value : l.value 5051} 5052const PS = ["ctrl", "shift", "alt", "meta"] 5053 , xS = { 5054 stop: l=>l.stopPropagation(), 5055 prevent: l=>l.preventDefault(), 5056 self: l=>l.target !== l.currentTarget, 5057 ctrl: l=>!l.ctrlKey, 5058 shift: l=>!l.shiftKey, 5059 alt: l=>!l.altKey, 5060 meta: l=>!l.metaKey, 5061 left: l=>"button"in l && l.button !== 0, 5062 middle: l=>"button"in l && l.button !== 1, 5063 right: l=>"button"in l && l.button !== 2, 5064 exact: (l,e)=>PS.some(t=>l[`${t}Key`] && !e.includes(t)) 5065} 5066 , Ah = (l,e)=>{ 5067 if (!l) 5068 return l; 5069 const t = l._withMods || (l._withMods = {}) 5070 , n = e.join("."); 5071 return t[n] || (t[n] = ((s,...o)=>{ 5072 for (let i = 0; i < e.length; i++) { 5073 const r = xS[e[i]]; 5074 if (r && r(s, e)) 5075 return 5076 } 5077 return l(s, ...o) 5078 } 5079 )) 5080} 5081 , CS = { 5082 esc: "escape", 5083 space: " ", 5084 up: "arrow-up", 5085 left: "arrow-left", 5086 right: "arrow-right", 5087 down: "arrow-down", 5088 delete: "backspace" 5089} 5090 , Ia = (l,e)=>{ 5091 const t = l._withKeys || (l._withKeys = {}) 5092 , n = e.join("."); 5093 return t[n] || (t[n] = (s=>{ 5094 if (!("key"in s)) 5095 return; 5096 const o = Us(s.key); 5097 if (e.some(i=>i === o || CS[i] === o)) 5098 return l(s) 5099 } 5100 )) 5101} 5102 , _S = Ft({ 5103 patchProp: uS 5104}, WM); 5105let $0; 5106function TS() { 5107 return $0 || ($0 = DM(_S)) 5108} 5109const bm = ((...l)=>{ 5110 const e = TS().createApp(...l) 5111 , {mount: t} = e; 5112 return e.mount = n=>{ 5113 const s = ES(n); 5114 if (!s) 5115 return; 5116 const o = e._component; 5117 !Le(o) && !o.render && !o.template && (o.template = s.innerHTML), 5118 s.nodeType === 1 && (s.textContent = ""); 5119 const i = t(s, !1, kS(s)); 5120 return s instanceof Element && (s.removeAttribute("v-cloak"), 5121 s.setAttribute("data-v-app", "")), 5122 i 5123 } 5124 , 5125 e 5126} 5127); 5128function kS(l) { 5129 if (l instanceof SVGElement) 5130 return "svg"; 5131 if (typeof MathMLElement == "function" && l instanceof MathMLElement) 5132 return "mathml" 5133} 5134function ES(l) { 5135 return St(l) ? document.querySelector(l) : l 5136} 5137/*! 5138 * pinia v3.0.4 5139 * (c) 2025 Eduardo San Martin Morote 5140 * @license MIT 5141 */ 5142let Mm; 5143const Yd = l=>Mm = l 5144 , Sm = Symbol(); 5145function Ih(l) { 5146 return l && typeof l == "object" && Object.prototype.toString.call(l) === "[object Object]" && typeof l.toJSON != "function" 5147} 5148var dr; 5149(function(l) { 5150 l.direct = "direct", 5151 l.patchObject = "patch object", 5152 l.patchFunction = "patch function" 5153} 5154)(dr || (dr = {})); 5155function DS() { 5156 const l = Nc(!0) 5157 , e = l.run(()=>Nd({})); 5158 let t = [] 5159 , n = []; 5160 const s = me({ 5161 install(o) { 5162 Yd(s), 5163 s._a = o, 5164 o.provide(Sm, s), 5165 o.config.globalProperties.$pinia = s, 5166 n.forEach(i=>t.push(i)), 5167 n = [] 5168 }, 5169 use(o) { 5170 return this._a ? t.push(o) : n.push(o), 5171 this 5172 }, 5173 _p: t, 5174 _a: null, 5175 _e: l, 5176 _s: new Map, 5177 state: e 5178 }); 5179 return s 5180} 5181const wm = ()=>{} 5182; 5183function X0(l, e, t, n=wm) { 5184 l.add(e); 5185 const s = ()=>{ 5186 l.delete(e) && n() 5187 } 5188 ; 5189 return !t && o1() && rb(s), 5190 s 5191} 5192function Ko(l, ...e) { 5193 l.forEach(t=>{ 5194 t(...e) 5195 } 5196 ) 5197} 5198const OS = l=>l() 5199 , Y0 = Symbol() 5200 , Au = Symbol(); 5201function Lh(l, e) { 5202 l instanceof Map && e instanceof Map ? e.forEach((t,n)=>l.set(n, t)) : l instanceof Set && e instanceof Set && e.forEach(l.add, l); 5203 for (const t in e) { 5204 if (!e.hasOwnProperty(t)) 5205 continue; 5206 const n = e[t] 5207 , s = l[t]; 5208 Ih(s) && Ih(n) && l.hasOwnProperty(t) && !wt(n) && !ls(n) ? l[t] = Lh(s, n) : l[t] = n 5209 } 5210 return l 5211} 5212const AS = Symbol(); 5213function IS(l) { 5214 return !Ih(l) || !Object.prototype.hasOwnProperty.call(l, AS) 5215} 5216const {assign: xs} = Object; 5217function LS(l) { 5218 return !!(wt(l) && l.effect) 5219} 5220function VS(l, e, t, n) { 5221 const {state: s, actions: o, getters: i} = e 5222 , r = t.state.value[l]; 5223 let a; 5224 function d() { 5225 r || (t.state.value[l] = s ? s() : {}); 5226 const u = Eb(t.state.value[l]); 5227 return xs(u, o, Object.keys(i || {}).reduce((h,c)=>(h[c] = me(So(()=>{ 5228 Yd(t); 5229 const f = t._s.get(l); 5230 return i[c].call(f, f) 5231 } 5232 )), 5233 h), {})) 5234 } 5235 return a = Pm(l, d, e, t, n, !0), 5236 a 5237} 5238function Pm(l, e, t={}, n, s, o) { 5239 let i; 5240 const r = xs({ 5241 actions: {} 5242 }, t) 5243 , a = { 5244 deep: !0 5245 }; 5246 let d, u, h = new Set, c = new Set, f; 5247 const p = n.state.value[l]; 5248 !o && !p && (n.state.value[l] = {}); 5249 let g; 5250 function y(T) { 5251 let k; 5252 d = u = !1, 5253 typeof T == "function" ? (T(n.state.value[l]), 5254 k = { 5255 type: dr.patchFunction, 5256 storeId: l, 5257 events: f 5258 }) : (Lh(n.state.value[l], T), 5259 k = { 5260 type: dr.patchObject, 5261 payload: T, 5262 storeId: l, 5263 events: f 5264 }); 5265 const D = g = Symbol(); 5266 el().then(()=>{ 5267 g === D && (d = !0) 5268 } 5269 ), 5270 u = !0, 5271 Ko(h, k, n.state.value[l]) 5272 } 5273 const m = o ? function() { 5274 const {state: k} = t 5275 , D = k ? k() : {}; 5276 this.$patch(I=>{ 5277 xs(I, D) 5278 } 5279 ) 5280 } 5281 : wm; 5282 function b() { 5283 i.stop(), 5284 h.clear(), 5285 c.clear(), 5286 n._s.delete(l) 5287 } 5288 const M = (T,k="")=>{ 5289 if (Y0 in T) 5290 return T[Au] = k, 5291 T; 5292 const D = function() { 5293 Yd(n); 5294 const I = Array.from(arguments) 5295 , F = new Set 5296 , Y = new Set; 5297 function q(te) { 5298 F.add(te) 5299 } 5300 function re(te) { 5301 Y.add(te) 5302 } 5303 Ko(c, { 5304 args: I, 5305 name: D[Au], 5306 store: x, 5307 after: q, 5308 onError: re 5309 }); 5310 let ne; 5311 try { 5312 ne = T.apply(this && this.$id === l ? this : x, I) 5313 } catch (te) { 5314 throw Ko(Y, te), 5315 te 5316 } 5317 return ne instanceof Promise ? ne.then(te=>(Ko(F, te), 5318 te)).catch(te=>(Ko(Y, te), 5319 Promise.reject(te))) : (Ko(F, ne), 5320 ne) 5321 }; 5322 return D[Y0] = !0, 5323 D[Au] = k, 5324 D 5325 } 5326 , S = { 5327 _p: n, 5328 $id: l, 5329 $onAction: X0.bind(null, c), 5330 $patch: y, 5331 $reset: m, 5332 $subscribe(T, k={}) { 5333 const D = X0(h, T, k.detached, ()=>I()) 5334 , I = i.run(()=>Ie(()=>n.state.value[l], F=>{ 5335 (k.flush === "sync" ? u : d) && T({ 5336 storeId: l, 5337 type: dr.direct, 5338 events: f 5339 }, F) 5340 } 5341 , xs({}, a, k))); 5342 return D 5343 },
5344 $dispose: b 5345 } 5346 , x = Et(S); 5347 n._s.set(l, x); 5348 const C = (n._a && n._a.runWithContext || OS)(()=>n._e.run(()=>(i = Nc()).run(()=>e({ 5349 action: M 5350 })))); 5351 for (const T in C) { 5352 const k = C[T]; 5353 if (wt(k) && !LS(k) || ls(k)) 5354 o || (p && IS(k) && (wt(k) ? k.value = p[T] : Lh(k, p[T])), 5355 n.state.value[l][T] = k); 5356 else if (typeof k == "function") { 5357 const D = M(k, T); 5358 C[T] = D, 5359 r.actions[T] = k 5360 } 5361 } 5362 return xs(x, C), 5363 xs(Oe(x), C), 5364 Object.defineProperty(x, "$state", { 5365 get: ()=>n.state.value[l], 5366 set: T=>{ 5367 y(k=>{ 5368 xs(k, T) 5369 } 5370 ) 5371 } 5372 }), 5373 n._p.forEach(T=>{ 5374 xs(x, i.run(()=>T({ 5375 store: x, 5376 app: n._a, 5377 pinia: n, 5378 options: r 5379 }))) 5380 } 5381 ), 5382 p && o && t.hydrate && t.hydrate(x.$state, p), 5383 d = !0, 5384 u = !0, 5385 x 5386} 5387/*! #__NO_SIDE_EFFECTS__ */ 5388function NS(l, e, t) { 5389 let n; 5390 const s = typeof e == "function"; 5391 n = s ? t : e; 5392 function o(i, r) { 5393 const a = Ub(); 5394 return i = i || (a ? di(Sm, null) : null), 5395 i && Yd(i), 5396 i = Mm, 5397 i._s.has(l) || (s ? Pm(l, e, n, i) : VS(l, n, i)), 5398 i._s.get(l) 5399 } 5400 return o.$id = l, 5401 o 5402} 5403const RS = window || self; 5404let Tr = Math.ceil(4 * (Math.PI ** 2 - 1)) 5405 , tf = Tr < 0 ? "-" : "" 5406 , La = tf + Tr / !Tr 5407 , xm = La[6] + "o" + tf.constructor.name; 540842492974[xm](Tr) + La[0] + La[1] + La[6]; 5409function FS(l, e, t) { 5410 let n = tf; 5411 for (let s = e; s < e + t; s++) 5412 n += (l[s] + 20)[xm](Tr); 5413 return n 5414} 5415function Cm(l, e) { 5416 let t = [] 5417 , n = 0; 5418 return e.forEach(s=>{ 5419 t.push(FS(l, n, s)), 5420 n += s 5421 } 5422 ), 5423 t 5424} 5425const tt = Math.PI 5426 , He = Math.min 5427 , Ee = Math.max 5428 , K0 = Math.pow 5429 , ee = Math.abs 5430 , cl = Math.sin 5431 , jt = Math.cos 5432 , Os = Math.tan 5433 , _m = Math.acos 5434 , nn = Math.atan2 5435 , lt = Math.sqrt 5436 , Tm = Math.cbrt 5437 , Do = Math.sign 5438 , Iu = Math.round 5439 , km = Math.ceil 5440 , Em = Math.floor; 5441let picNetHostname = RS.location.hostname.toLowerCase() 5442 , J0 = picNetHostname === "pic.net" || picNetHostname.endsWith(".pic.net") ? 1 : 2; 5443function Se(l, e) { 5444 if (l < 0 && (l = -l), 5445 e < 0 && (e = -e), 5446 l < e) { 5447 let t = l / e; 5448 return e * lt(1 + t * t) * J0 5449 } else if (l !== 0) { 5450 let t = e / l; 5451 return l * lt(1 + t * t) * J0 5452 } else 5453 return 0 5454} 5455const Ul = Number.EPSILON 5456 , fl = Number.MAX_VALUE; 5457function BS(l, e, t=!1, n=!1) { 5458 let s = l - e; 5459 if (t) 5460 n ? s = (s % 360 + 540) % 360 - 180 : (s = ee(s) % 360, 5461 s > 180 && (s = 360 - s)); 5462 else { 5463 const o = tt 5464 , i = o * 2; 5465 n ? s = (s % i + o * 3) % i - o : (s = ee(s) % i, 5466 s > o && (s = i - s)) 5467 } 5468 return s 5469} 5470const Z0 = Object.freeze([1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15]); 5471function Je(l, e=-1) { 5472 if (e > 15 && (e = 15), 5473 e >= 0) { 5474 let t = Z0[e] 5475 , n = Ul * t * l; 5476 return Iu(l * t + (l > 0 ? n : -n)) / t 5477 } else if (e === -1) { 5478 let t = l < 0 ? -l : l; 5479 if (t >= 1e12) 5480 return Iu(l); 5481 { 5482 let n = t < 1 ? -1 : Em(Math.log10(t)) 5483 , s = Z0[12 - n]; 5484 return Iu(l * s) / s 5485 } 5486 } else 5487 return l 5488} 5489const zS = "butt" 5490 , US = "bevel"; 5491function Q0(l) { 5492 let e = (l || "").match(/(\d?\.?\d+)+/g); 5493 if (e == null) 5494 return null; 5495 { 5496 let t = e.map(n=>+n); 5497 return t.length % 2 && t.push(...t), 5498 t 5499 } 5500} 5501class Qt { 5502 width; 5503 linecap; 5504 linejoin; 5505 miterlimit; 5506 calcDasharray; 5507 dasharray; 5508 dashoffset; 5509 scaleDasharray = !0; 5510 constructor(e=1, t, n, s=4, o="", i=0) { 5511 this.width = e, 5512 this.linecap = t || "round", 5513 this.linejoin = n || "round", 5514 this.miterlimit = s, 5515 this.dasharray = o, 5516 this.dashoffset = i, 5517 this.updateDashArray() 5518 } 5519 set(e) { 5520 this.width = e ? e.width : 1, 5521 this.linecap = e ? e.linecap : zS, 5522 this.linejoin = e ? e.linejoin : US, 5523 this.miterlimit = e ? e.miterlimit : 4, 5524 this.dasharray = e ? e.dasharray : "", 5525 this.calcDasharray = e ? e.calcDasharray : "", 5526 this.dashoffset = e ? e.dashoffset : 0, 5527 this.scaleDasharray = e ? e.scaleDasharray : !0 5528 } 5529 clone() { 5530 return new Qt(this.width,this.linecap,this.linejoin,this.miterlimit,this.dasharray,this.dashoffset) 5531 } 5532 updateDashArray() {
5533 this.scaleDasharray ? this.calcDasharray = this.getScaledDashArray(this.width) : this.calcDasharray = this.dasharray 5534 } 5535 getScaledDashArray(e) { 5536 let t = Q0(this.dasharray); 5537 if (t == null) 5538 return ""; 5539 { 5540 let n = this.linecap 5541 , s = n === "round" || n === "square" ? 1 : 0; 5542 if (s !== 0) 5543 for (let o = 1, i = t.length; o < i; o += 2) { 5544 let r = o - 1 5545 , a = o < i - 1 ? o + 1 : 0 5546 , d = Math.min(t[r], t[a], s); 5547 t[r] -= d / 2, 5548 t[a] -= d / 2, 5549 t[o] += d 5550 } 5551 for (let o = 0; o < t.length; o++) 5552 t[o] = Je(t[o] * e, 2); 5553 return t.join(" ") 5554 } 5555 } 5556 static unscaleDashArray(e, t, n) { 5557 let s = Q0(t); 5558 if (s == null) 5559 return ""; 5560 { 5561 s.length % 2 && s.push(...s); 5562 for (let i = 0; i < s.length; i++) 5563 s[i] = Je(s[i] * e, 2); 5564 let o = n === "round" || n === "square" ? 1 : 0; 5565 if (o !== 0) 5566 for (let i = 1, r = s.length; i < r; i += 2) { 5567 let a = i - 1 5568 , d = i < r - 1 ? i + 1 : 0 5569 , u = Math.min(s[a], s[d], o); 5570 s[a] += u / 2, 5571 s[d] += u / 2, 5572 s[i] -= u 5573 } 5574 return s.join(" ") 5575 } 5576 } 5577 getCalcDashoffset() { 5578 return this.scaleDasharray ? this.dashoffset * this.width : this.dashoffset 5579 } 5580 equals(e) { 5581 return e instanceof Qt ? this === e ? !0 : this.width === e.width && this.linecap === e.linecap && this.linejoin === e.linejoin && this.miterlimit === e.miterlimit && this.calcDasharray === e.calcDasharray && this.dasharray === e.dasharray && this.dashoffset === e.dashoffset && this.scaleDasharray === e.scaleDasharray : !1 5582 } 5583 toJSON() { 5584 return { 5585 width: this.width, 5586 lineCap: this.linecap, 5587 lineJoin: this.linejoin, 5588 miterLimit: this.miterlimit, 5589 dashArray: this.dasharray, 5590 dashOffset: this.dashoffset, 5591 scaleDashArray: this.scaleDasharray 5592 } 5593 } 5594 setJSON(e) { 5595 this.width = e.width, 5596 this.linecap = e.lineCap, 5597 this.linejoin = e.lineJoin, 5598 this.miterlimit = e.miterLimit, 5599 this.dasharray = e.dashArray, 5600 this.dashoffset = e.dashOffset, 5601 this.scaleDasharray = e.scaleDashArray, 5602 this.updateDashArray() 5603 } 5604 static fromJSON(e) { 5605 let t = new Qt; 5606 return t.setJSON(e), 5607 t 5608 } 5609} 5610function Vl(l, e, t) { 5611 let n = document.createElement(l); 5612 if (e != null) 5613 for (let[s,o] of Object.entries(e)) 5614 n.setAttribute(s, o); 5615 if (t != null) { 5616 let s = n.style; 5617 for (let[o,i] of Object.entries(t)) 5618 s[o] = i 5619 } 5620 return n 5621} 5622function ki(l, e) { 5623 let t = document.createElement("canvas"); 5624 return t.width = l, 5625 t.height = e, 5626 t 5627} 5628function kr(l) { 5629 let e = !1; 5630 if (self.ClipboardItem) 5631 try { 5632 let t = new Blob([l],{ 5633 type: "text/plain" 5634 }); 5635 navigator.clipboard.write([new self.ClipboardItem({ 5636 "text/plain": t 5637 })]), 5638 e = !0 5639 } catch (t) { 5640 console.warn("Copy to clipboard failed.", t) 5641 } 5642 if (!e && document.queryCommandSupported && document.queryCommandSupported("copy")) { 5643 let t = document.activeElement 5644 , n = Vl("textarea", null, { 5645 position: "fixed" 5646 }); 5647 if (n.textContent = l, 5648 document.body.appendChild(n), 5649 n.createTextRange) { 5650 let s = document.body.createTextRange(); 5651 s.moveToElementText(n), 5652 s.select(), 5653 s.execCommand("Copy") 5654 } else { 5655 let s = document.createRange(); 5656 s.selectNodeContents(n); 5657 let o = window.getSelection(); 5658 o.removeAllRanges(), 5659 o.addRange(s), 5660 n.setSelectionRange(0, 999999), 5661 document.execCommand("copy") 5662 } 5663 try { 5664 e = document.execCommand("copy") 5665 } catch (s) { 5666 console.warn("Copy to clipboard failed.", s) 5667 } finally { 5668 n.remove(), 5669 t?.focus() 5670 } 5671 } 5672 return e 5673} 5674async function Nh() { 5675 try { 5676 return await navigator.clipboard.readText() 5677 } catch { 5678 return "" 5679 } 5680} 5681function ld(l) { 5682 return (l == null ? [] : Array.from(l.querySelectorAll("*"))).filter(t=>Er(t)) 5683} 5684function Er(l) { 5685 if (l == null) 5686 return !1; 5687 let e = l.nodeName.toLowerCase(); 5688 return e === "body" ? !0 : GS(l) ? l.tabIndex < 0 ? !1 : e === "input" || /button|object|select|textarea/.test(e) ? !l.disabled : e === "a" ? !!l.getAttribute("href") : l.tabIndex >= 0 : !1 5689} 5690function GS(l) { 5691 return typeof l.checkVisibility == "function" ? l.checkVisibility() : !!(l.offsetWidth || l.offsetHeight || l.getClientRects().length) 5692} 5693function gs(l, e) { 5694 let t = bm({ 5695 render: ()=>Xd(l, e) 5696 }) 5697 , n = self.hyApp.config.globalProperties; 5698 t.use(n.$i18n), 5699 t.use(n.$pinia), 5700 t.config.globalProperties.$store = n.$store; 5701 let s = document.createElement("div"); 5702 return document.body.appendChild(s), 5703 { 5704 instance: t.mount(s), 5705 unmount: ()=>{ 5706 t.unmount(), 5707 s.remove() 5708 } 5709 } 5710} 5711let Lu; 5712function Dm(l, e) { 5713 Lu || (Lu = ki(1, 1)); 5714 let t = Lu.getContext("2d") 5715 , n = getComputedStyle(l); 5716 return t.font = n.fontSize + " " + n.fontFamily, 5717 t.measureText(e).width 5718} 5719function Kd(l, e) { 5720 let t = 32, n = Math.min(l, e), s; 5721 if (n <= t) 5722 s = 1; 5723 else { 5724 let o = (function i(r, a) { 5725 return a ? i(a, r % a) : r 5726 } 5727 )(l, e); 5728 if (s = o, 5729 n / o <= t / 2) { 5730 for (; s % 2 === 0 && n / s < 32; ) 5731 s /= 2; 5732 for (; s % 3 === 0 && n / s < 32; ) 5733 s /= 3 5734 } 5735 if (n / s > 64) 5736 for (s = 1; n / s > 64; ) 5737 s *= 2 5738 } 5739 return s 5740} 5741const HS = "http://www.w3.org/2000/svg" 5742 , $S = "http://www.w3.org/2000/xmlns" 5743 , ep = {}; 5744function XS(l) { 5745 return l != null && (l instanceof SVGElement || l instanceof l.ownerDocument.defaultView.SVGElement) 5746} 5747function de(l, e, t, n) { 5748 let s = ep[l]; 5749 s == null && (s = document.createElementNS(HS, l), 5750 ep[l] = s); 5751 let o = s.cloneNode(!1); 5752 if (e != null) 5753 for (let i of Object.keys(e)) { 5754 let r = e[i]; 5755 if (i === "style" && !(typeof r == "string" || r instanceof String)) 5756 for (let a of Object.keys(r)) 5757 o.style.setProperty(a, r[a]); 5758 else 5759 i.startsWith("xlink:") ? o.setAttributeNS($S, i, r) : o.setAttribute(i, r) 5760 } 5761 return t != null && (o.className.baseVal = t), 5762 n != null && o.append(...n), 5763 o 5764} 5765const YS = { 5766 amp: 38, 5767 apos: 39, 5768 lt: 60, 5769 gt: 62, 5770 quot: 34, 5771 nbsp: 160, 5772 cent: 162, 5773 pound: 163, 5774 yen: 165, 5775 euro: 8364, 5776 copy: 169, 5777 reg: 174 5778}; 5779function tp(l) { 5780 let e; 5781 return l.replace(/&(?![#])[A-za-z0-9_]+;/g, function(t) { 5782 let n = YS[t.substring(1, t.length - 1)]; 5783 return n == null && (e == null && (e = document.createElement("span")), 5784 e.innerHTML = t, 5785 n = e.textContent.charCodeAt(0)), 5786 isNaN(n) ? "" : "&#" + n + ";" 5787 }) 5788} 5789function KS(l, e) { 5790 let t = { 5791 clipPath: ["clip-path"], 5792 "color-profile": ["color-profile"], 5793 cursor: ["cursor"], 5794 filter: ["filter"], 5795 linearGradient: ["fill", "stroke"], 5796 marker: ["marker", "marker-end", "marker-mid", "marker-start"], 5797 mask: ["mask"], 5798 pattern: ["fill", "stroke"], 5799 radialGradient: ["fill", "stroke"] 5800 }, n = l.querySelectorAll("[id]"), s, o = {}, i = [], r = !1; 5801 if (n.length) { 5802 for (let f of n) 5803 s = f.localName, 5804 s in t && (o[s] = 1); 5805 for (s in o)
5806 t[s].forEach(function(f) { 5807 i.includes(f) || i.push(f) 5808 }); 5809 i.length && i.push("style"); 5810 let a = l.getElementsByTagName("*"), d = l, u, h, c; 5811 for (let f = -1; d != null; ) { 5812 if (d.localName === "style") { 5813 h = d.textContent, 5814 c = h; 5815 let p = /(?<=url\(\s*["']?#)(\S+?)(?=["']?\s*(?=\)))/g 5816 , g = /(?<=#)([^\s#.,:>+~|})]+)(?=[^{}]*\{)/gm; 5817 for (let y of [p, g]) 5818 c = c && c.replaceAll(y, function(m, b) { 5819 return b + e 5820 }); 5821 c !== h && (d.textContent = c) 5822 } else if (d.hasAttributes()) { 5823 for (let p = 0; p < i.length; p++) 5824 u = i[p], 5825 h = d.getAttribute(u), 5826 c = h && h.replace(/url\(\s*["']?#(\S+?)["']?\s*(?=\))/g, function(g, y) { 5827 return "url(#" + y + e 5828 }), 5829 c !== h && d.setAttribute(u, c); 5830 ["xlink:href", "href"].forEach(function(p) { 5831 let g = d.getAttribute(p); 5832 /^\s*#/.test(g) && (g = g.trim(), 5833 d.setAttribute(p, g + e)) 5834 }) 5835 } 5836 d = a[++f] 5837 } 5838 for (let f of n) 5839 f.id += e, 5840 r = !0 5841 } 5842 return r 5843} 5844async function Wd(l, e, t, n) { 5845 let s = await WS(l); 5846 return t == null && (t = e != null ? e.width : s.clientWidth), 5847 n == null && (n = e != null ? e.height : s.clientHeight), 5848 e == null ? e = ki(t, n) : (e.width = t, 5849 e.height = n), 5850 e.getContext("2d").drawImage(s, 0, 0, t, n), 5851 e 5852} 5853async function WS(l, e) { 5854 let t = e || new Image; 5855 return t.src = "data:image/svg+xml;utf8," + encodeURIComponent(l), 5856 await t.decode(), 5857 t 5858} 5859function Om(l) { 5860 let e = (l || "").match(/^\s*url\(\s*(?:'#(\S*)'|"#(\S*)"|#(\S*))\s*\)/); 5861 return e != null ? e[1] || e[2] || e[3] : null 5862} 5863function Es(l=8) { 5864 let e = ""; 5865 for (let t = 0, n; t < l; t++) 5866 n = 0 | (t === 0 ? Math.random() * 52 + 10 : Math.random() * 62), 5867 e += String.fromCharCode(n + (n < 10 ? 48 : n < 36 ? 55 : 61)); 5868 return e 5869} 5870const qS = /^\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?)\s*([a-zA-Z]*|%)\s*$/; 5871let qd = class Am { 5872 value; 5873 unit; 5874 constructor(e=0, t=null) { 5875 this.value = e, 5876 this.unit = t 5877 } 5878 static parse(e) { 5879 if (e == null || e === "") 5880 return null; 5881 { 5882 let t = e.match(qS); 5883 if (t == null) 5884 return null; 5885 { 5886 let n = parseFloat(t[1]); 5887 return new Am(n,t[2]) 5888 } 5889 } 5890 } 5891} 5892; 5893const ti = tt / 180 5894 , no = 1 / ti 5895 , Wo = "translate" 5896 , so = "skew" 5897 , oo = "rotate" 5898 , Un = "scale"; 5899function io(l, e=!1) { 5900 if (l == null || l === "") 5901 return 0; 5902 let t = qd.parse(l) 5903 , n = t.value; 5904 switch (t.unit) { 5905 case "rad": 5906 n = e ? n * 180 / tt : n; 5907 break; 5908 case "deg": 5909 n = e ? n : n * tt / 180; 5910 break; 5911 case "grad": 5912 n = e ? n * 180 / 200 : n * tt / 200; 5913 break; 5914 case "turn": 5915 n = e ? n * 360 : n * 2 * tt; 5916 break 5917 } 5918 return n 5919} 5920function vs(l, e=1) { 5921 if (l == null || l === "") 5922 return 0; 5923 let t = qd.parse(l); 5924 return t == null ? 0 : t.unit === "%" ? t.value * e / 100 : t.value 5925} 5926class oe { 5927 _a; 5928 _b; 5929 _c; 5930 _d; 5931 _tx; 5932 _ty; 5933 _isIdentity = !1; 5934 constructor(e=1, t=0, n=0, s=1, o=0, i=0) { 5935 this.set(e, t, n, s, o, i) 5936 } 5937 set(e=1, t=0, n=0, s=1, o=0, i=0) { 5938 return this._a = e, 5939 this._b = t, 5940 this._c = n, 5941 this._d = s, 5942 this._tx = o, 5943 this._ty = i, 5944 this._updateIdentity(), 5945 this 5946 } 5947 get isIdentity() { 5948 return this._isIdentity 5949 } 5950 _updateIdentity() { 5951 this._isIdentity = this._a === 1 && this._b === 0 && this._c === 0 && this._d === 1 && this._tx === 0 && this._ty === 0 5952 } 5953 get a() { 5954 return this._a 5955 } 5956 get b() { 5957 return this._b 5958 } 5959 get c() { 5960 return this._c 5961 } 5962 get d() { 5963 return this._d 5964 }
5965 get e() { 5966 return this._tx 5967 } 5968 get f() { 5969 return this._ty 5970 } 5971 get tx() { 5972 return this._tx 5973 } 5974 get ty() { 5975 return this._ty 5976 } 5977 getDeterminant() { 5978 return this._a * this._d - this._b * this._c 5979 } 5980 translate(e, t) { 5981 return this._tx += e * this._a + t * this._c, 5982 this._ty += e * this._b + t * this._d, 5983 this._updateIdentity(), 5984 this 5985 } 5986 preTranslate(e, t) { 5987 return this._tx += e, 5988 this._ty += t, 5989 this._updateIdentity(), 5990 this 5991 } 5992 scale(e, t, n=0, s=0) { 5993 return (e !== 1 || t !== 1) && ((n !== 0 || s !== 0) && (this._tx += this._a * n * (1 - e) + this._c * s * (1 - t), 5994 this._ty += this._b * n * (1 - e) + this._d * s * (1 - t)), 5995 this._a *= e, 5996 this._b *= e, 5997 this._c *= t, 5998 this._d *= t, 5999 this._updateIdentity()), 6000 this 6001 } 6002 preScale(e, t, n=0, s=0) { 6003 return (e !== 1 || t !== 1) && (this._a *= e, 6004 this._b *= t, 6005 this._c *= e, 6006 this._d *= t, 6007 this._tx = this._tx * e + n * (1 - e), 6008 this._ty = this._ty * t + s * (1 - t), 6009 this._updateIdentity()), 6010 this 6011 } 6012 rotate(e, t=0, n=0) { 6013 if (e !== 0) { 6014 let s = cl(e) 6015 , o = jt(e); 6016 return this.rotate2(s, o, t, n) 6017 } else 6018 return this 6019 } 6020 rotate2(e, t, n=0, s=0) { 6021 let o = this._a 6022 , i = this._b 6023 , r = this._c 6024 , a = this._d; 6025 return this._a = o * t + r * e, 6026 this._b = i * t + a * e, 6027 this._c = -o * e + r * t, 6028 this._d = -i * e + a * t, 6029 (n !== 0 || s !== 0) && (this._tx += n * (o - this._a) + s * (r - this._c), 6030 this._ty += n * (i - this._b) + s * (a - this._d)), 6031 this._updateIdentity(), 6032 this 6033 } 6034 preRotate(e, t=0, n=0) { 6035 if (e !== 0) { 6036 let s = cl(e) 6037 , o = jt(e); 6038 return this.preRotate2(s, o, t, n) 6039 } else 6040 return this 6041 } 6042 preRotate2(e, t, n=0, s=0) { 6043 let o = this._a 6044 , i = this._b 6045 , r = this._c 6046 , a = this._d 6047 , d = this._tx 6048 , u = this._ty; 6049 return this._a = o * t - i * e, 6050 this._b = o * e + i * t, 6051 this._c = r * t - a * e, 6052 this._d = r * e + a * t, 6053 this._tx = t * (d - n) - e * (u - s) + n, 6054 this._ty = e * (d - n) + t * (u - s) + s, 6055 this._updateIdentity(), 6056 this 6057 } 6058 skewX(e, t=0) { 6059 if (e !== 0) { 6060 let n = Os(e) 6061 , s = this._a * n 6062 , o = this._b * n; 6063 this._c += s, 6064 this._d += o, 6065 t !== 0 && (this._tx -= s * t, 6066 this._ty -= o * t), 6067 this._updateIdentity() 6068 } 6069 return this 6070 } 6071 preSkewX(e, t=0) { 6072 if (e !== 0) { 6073 let n = Os(e); 6074 this._a += n * this._b, 6075 this._c += n * this._d, 6076 this._tx += n * (this._ty - t), 6077 this._updateIdentity() 6078 } 6079 return this 6080 } 6081 skewY(e, t=0) { 6082 if (e !== 0) { 6083 let n = Os(e) 6084 , s = this._c * n 6085 , o = this._d * n; 6086 this._a += s, 6087 this._b += o, 6088 t !== 0 && (this._tx -= s * t, 6089 this._ty -= o * t), 6090 this._updateIdentity() 6091 } 6092 return this 6093 } 6094 multiply(e, t, n, s, o, i) { 6095 let r = this._a 6096 , a = this._b 6097 , d = this._c 6098 , u = this._d; 6099 return this._a = r * e + d * t, 6100 this._b = a * e + u * t, 6101 this._c = r * n + d * s, 6102 this._d = a * n + u * s, 6103 this._tx += r * o + d * i, 6104 this._ty += a * o + u * i, 6105 this._updateIdentity(), 6106 this 6107 } 6108 preMultiply(e, t, n, s, o, i) { 6109 let r = this._a 6110 , a = this._b 6111 , d = this._c 6112 , u = this._d 6113 , h = this._tx 6114 , c = this._ty; 6115 return this._a = r * e + a * n, 6116 this._b = r * t + a * s, 6117 this._c = d * e + u * n, 6118 this._d = d * t + u * s, 6119 this._tx = h * e + c * n + o,
6120 this._ty = h * t + c * s + i, 6121 this._updateIdentity(), 6122 this 6123 } 6124 multiplyWith(e, t=!1) { 6125 let n = t ? this.clone() : this; 6126 return e != null && !e.isIdentity && (e instanceof oe ? n.multiply(e._a, e._b, e._c, e._d, e._tx, e._ty) : e instanceof SVGMatrix && n.multiply(e.a, e.b, e.c, e.d, e.e, e.f)), 6127 n 6128 } 6129 preMultiplyWith(e, t=!1) { 6130 let n = t ? this.clone() : this; 6131 return e != null && !e.isIdentity && (e instanceof oe ? n.preMultiply(e._a, e._b, e._c, e._d, e._tx, e._ty) : e instanceof SVGMatrix && n.preMultiply(e.a, e.b, e.c, e.d, e.e, e.f)), 6132 n 6133 } 6134 invert(e=!1, t=!1) { 6135 let n = e ? this.clone() : this; 6136 if (n.isIdentity) 6137 return n; 6138 { 6139 let s = n._a 6140 , o = n._b 6141 , i = n._c 6142 , r = n._d 6143 , a = n._tx 6144 , d = n._ty 6145 , u = this.getDeterminant(); 6146 return u !== 0 && isFinite(u) ? (n._a = r / u, 6147 n._b = -o / u, 6148 n._c = -i / u, 6149 n._d = s / u, 6150 n._tx = (i * d - r * a) / u, 6151 n._ty = (o * a - s * d) / u, 6152 n) : t ? null : n 6153 } 6154 } 6155 clone() { 6156 return new oe(this._a,this._b,this._c,this._d,this._tx,this._ty) 6157 } 6158 toString() { 6159 return this._a + ", " + this._b + ", " + this._c + ", " + this._d + ", " + this._tx + ", " + this._ty 6160 } 6161 decompose(e=!1, t=!1) { 6162 let n, s, o, i; 6163 if (this.isIdentity) 6164 n = [0, 0], 6165 o = 0, 6166 s = [1, 1], 6167 i = [0, 0]; 6168 else { 6169 let r = this._a 6170 , a = this._b 6171 , d = this._c 6172 , u = this._d 6173 , h = this.getDeterminant(); 6174 if (n = [this._tx, this._ty], 6175 (r !== 0 || a !== 0) && (!t || d === 0 && u === 0)) { 6176 let c = r * r + a * a 6177 , f = lt(c); 6178 o = Math.atan2(a, r), 6179 s = [f, f < Ul ? 0 : h / f], 6180 i = [Math.atan2(r * d + a * u, c), 0] 6181 } else if (d !== 0 || u !== 0) { 6182 let c = d * d + u * u 6183 , f = lt(c); 6184 o = Math.atan2(-d, u), 6185 s = [f < Ul ? 0 : h / f, f], 6186 i = [0, Math.atan2(r * d + a * u, c)] 6187 } else 6188 o = 0, 6189 s = [1, 1], 6190 i = [0, 0]; 6191 e && (o *= no, 6192 i[0] *= no, 6193 i[1] *= no) 6194 } 6195 return { 6196 translate: n, 6197 rotate: o, 6198 scale: s, 6199 skew: i 6200 } 6201 } 6202 decomposeAlt(e, t) { 6203 let n, s, o, i; 6204 if (this.isIdentity) 6205 n = [0, 0], 6206 o = 0, 6207 s = [1, 1], 6208 i = [0, 0]; 6209 else { 6210 let r = this._a 6211 , a = this._b 6212 , d = this._c 6213 , u = this._d; 6214 if ((r !== 0 || a !== 0) && (!t || d === 0 && u === 0)) { 6215 let h = Se(r, a) 6216 , c = nn(a, r) 6217 , f = cl(c) 6218 , p = jt(c) 6219 , g = d * p + u * f 6220 , y = u * p - d * f 6221 , m = ee(y) < Ul ? 0 : g / y; 6222 n = [this._tx, this._ty], 6223 o = c, 6224 s = [h, y], 6225 i = [Math.atan(m), 0] 6226 } else { 6227 let h = Se(d, u) 6228 , c = nn(-d, u) 6229 , f = cl(c) 6230 , p = jt(c) 6231 , g = a * p - r * f 6232 , y = r * p + a * f 6233 , m = ee(y) < Ul ? 0 : g / y; 6234 n = [this._tx, this._ty], 6235 o = c, 6236 s = [y, h], 6237 i = [0, Math.atan(m)] 6238 } 6239 e && (o *= no, 6240 i[0] *= no, 6241 i[1] *= no) 6242 } 6243 return { 6244 translate: n, 6245 rotate: o, 6246 scale: s, 6247 skew: i 6248 } 6249 } 6250 decomposeSingularValue() { 6251 let e = this._a 6252 , t = this._b 6253 , n = this._c 6254 , s = this._d 6255 , o = Se(e - s, n + t) 6256 , i = Se(e + s, n - t) 6257 , r = (o + i) / 2 6258 , a = ee((i - o) / 2) 6259 , d = r > a ? cl(nn(2 * (e * n + t * s), e * e - n * n + t * t - s * s) / 2) : 0 6260 , u = lt(1 - d * d) 6261 , h = r === 0 ? 1 : (e * u + n * d) / r 6262 , c = r === 0 ? 0 : (t * u + s * d) / r 6263 , f = a === 0 ? -h : (n * u - e * d) / a 6264 , p = a === 0 ? h : (s * u - t * d) / a; 6265 return { 6266 u: [h, c, f, p], 6267 s: [r, a], 6268 v: [u, -d, d, u], 6269 translate: [this._tx, this._ty] 6270 } 6271 } 6272 getRotation(e=!1) { 6273 if (this._isIdentity) 6274 return 0; 6275 { 6276 let t = this._a, n = this._b, s; 6277 if (t !== 0 || n !== 0) 6278 s = nn(n, t); 6279 else { 6280 let o = this._c 6281 , i = this._d; 6282 o !== 0 || i !== 0 ? s = nn(-o, i) : s = 0 6283 } 6284 return e && (s *= no), 6285 s 6286 } 6287 } 6288 setFromSVGMatrix(e) { 6289 return this.set(e.a, e.b, e.c, e.d, e.e, e.f), 6290 this 6291 } 6292 setFromTransform(e) { 6293 return e == null ? this.set() : this.set(e._a, e._b, e._c, e._d, e._tx, e._ty), 6294 this 6295 } 6296 transformXY(e) { 6297 if (!this.isIdentity) { 6298 let t = e.x 6299 , n = e.y; 6300 e.x = this._a * t + this._c * n + this._tx, 6301 e.y = this._b * t + this._d * n + this._ty 6302 } 6303 return e 6304 } 6305 invTransformXY(e) { 6306 if (!this.isIdentity) { 6307 let t = this.getDeterminant(); 6308 if (t !== 0) { 6309 let n = e.x - this._tx 6310 , s = e.y - this._ty; 6311 e.x = (n * this._d - s * this._c) / t, 6312 e.y = (s * this._a - n * this._b) / t 6313 } 6314 } 6315 return e 6316 } 6317 transformArray(e, t=null, n=0, s) { 6318 if (t === null && (t = e), 6319 s == null && (s = e.length), 6320 this._isIdentity) { 6321 if (t !== e) 6322 for (let o = n; o < s; o++) 6323 t[o] = e[o] 6324 } else { 6325 let o = this._a, i = this._b, r = this._c, a = this._d, d = this._tx, u = this._ty, h, c; 6326 for (let f = n; f < s; f += 2) 6327 h = e[f], 6328 c = e[f + 1], 6329 t[f] = o * h + r * c + d, 6330 t[f + 1] = i * h + a * c + u 6331 } 6332 return t 6333 } 6334 invTransformArray(e, t, n=0, s) { 6335 if (!this.isIdentity) { 6336 t == null && (t = e), 6337 s == null && (s = e.length); 6338 let o = this._a 6339 , i = this._b 6340 , r = this._c 6341 , a = this._d 6342 , d = this._tx 6343 , u = this._ty 6344 , h = this.getDeterminant(); 6345 if (h !== 0) { 6346 let c = o / h, f = i / h, p = r / h, g = a / h, y, m; 6347 for (let b = n; b < s; b += 2) 6348 y = e[b] - d, 6349 m = e[b + 1] - u, 6350 t[b] = y * g - m * p, 6351 t[b + 1] = m * c - y * f 6352 } 6353 } 6354 return t 6355 } 6356 toCssValue(e=8) { 6357 if (this.isIdentity) 6358 return "none"; 6359 { 6360 let t = this.decomposeAlt(!0, !1) 6361 , n = "" 6362 , s = Je(t.translate[0], e) 6363 , o = Je(t.translate[1], e); 6364 (s !== 0 || o !== 0) && (n += (n === "" ? "" : " ") + Wo + "(" + s + "px, " + o + "px)"); 6365 let i = Je(t.rotate, e); 6366 i !== 0 && (n += (n === "" ? "" : " ") + oo + "(" + i + "deg)"); 6367 let r = Je(t.skew[0], e); 6368 r !== 0 && (n += (n === "" ? "" : " ") + so + "X(" + r + "deg)"); 6369 let a = Je(t.scale[0], e) 6370 , d = Je(t.scale[1], e); 6371 return (a !== 1 || d !== 1) && (n += (n === "" ? "" : " ") + Un + "(" + a + ", " + d + ")"), 6372 n === "" ? "none" : n 6373 } 6374 } 6375 toSvgValue(e=8) { 6376 if (this.isIdentity) 6377 return Un + "(1)"; 6378 { 6379 let t = this.decomposeAlt(!0, !1) 6380 , n = "" 6381 , s = Je(t.translate[0], e) 6382 , o = Je(t.translate[1], e); 6383 (s !== 0 || o !== 0) && (n += (n === "" ? "" : " ") + Wo + "(" + s + ", " + o + ")"); 6384 let i = Je(t.rotate, e); 6385 i !== 0 && (n += (n === "" ? "" : " ") + oo + "(" + i + ")"); 6386 let r = Je(t.skew[0], e); 6387 r !== 0 && (n += (n === "" ? "" : " ") + so + "X(" + r + ")"); 6388 let a = Je(t.scale[0], e) 6389 , d = Je(t.scale[1], e); 6390 return (a !== 1 || d !== 1) && (n += (n === "" ? "" : " ") + Un + "(" + a + ", " + d + ")"), 6391 n === "" ? "scale(1)" : n 6392 } 6393 } 6394 toDOMMatrix() { 6395 return new DOMMatrixReadOnly([this._a, this._b, this._c, this._d, this._tx, this._ty]) 6396 } 6397 equals(e, t=!1) { 6398 return this.isIdentity ? e == null ? t : e.isIdentity : e != null && !e.isIdentity ? this._a === e._a && this._b === e._b && this._c === e._c && this._d === e._d && this._tx === e._tx && this._ty === e._ty : !1 6399 } 6400 static fromSvgValue(e) { 6401 let t = new oe; 6402 if (e != null && e !== "") { 6403 let n = e.split(")"); 6404 for (let s = 0; s < n.length; s++) { 6405 let o = n[s].trim() 6406 , i = o.indexOf("("); 6407 if (i >= 0) { 6408 let r = o.substring(0, i) 6409 , d = o.substring(i + 1).split(/\s*,\s*|\s+/);
6410 if (d.forEach((u,h)=>{ 6411 u != null && (u = parseFloat(u), 6412 d[h] = isNaN(u) ? null : u) 6413 } 6414 ), 6415 r === Wo) { 6416 let u = d[0] == null ? 0 : d[0] 6417 , h = d[1] == null ? 0 : d[1]; 6418 t.translate(u, h) 6419 } else if (r === Un) { 6420 let u = d[0] == null ? 1 : d[0] 6421 , h = d[1] == null ? u : d[1]; 6422 t.scale(u, h) 6423 } else if (r === oo) { 6424 let u = d[0] == null ? 0 : d[0] * ti 6425 , h = d[1] == null ? 0 : d[1] 6426 , c = d[2] == null ? 0 : d[2]; 6427 t.rotate(u, h, c) 6428 } else if (r === so + "X") { 6429 let u = d[0] == null ? 0 : d[0] * ti; 6430 t.skewX(u) 6431 } else if (r === so + "Y") { 6432 let u = d[0] == null ? 0 : d[0] * ti; 6433 t.skewY(u) 6434 } else if (r === "matrix") { 6435 let u = []; 6436 for (let h of d) { 6437 let c = parseFloat(h); 6438 if (isNaN(c)) 6439 break; 6440 u.push(c) 6441 } 6442 u.length === 6 && t.multiply(u[0], u[1], u[2], u[3], u[4], u[5]) 6443 } 6444 } 6445 } 6446 } 6447 return t 6448 } 6449 static fromCssValue(e, t=0, n=0) { 6450 let s = new oe; 6451 if (e != null && e !== "" && e !== "none") { 6452 let o = e.split(")"); 6453 for (let i of o) { 6454 let r = i.indexOf("("); 6455 if (r >= 0) { 6456 let a = i.substr(0, r).trim() 6457 , u = i.substr(r + 1, i.length - r - 1).trim().split(/\s*,\s*/); 6458 if (a === Wo || a === Un + "3d") { 6459 let h = u[0] == null ? 0 : vs(u[0], t) 6460 , c = u[1] == null ? 0 : vs(u[1], n); 6461 s.translate(h, c) 6462 } else if (a === Wo + "X") { 6463 let h = u[0] == null ? 0 : vs(u[0], t); 6464 s.translate(h, 0) 6465 } else if (a === Wo + "Y") { 6466 let h = u[0] == null ? 0 : vs(u[0], n); 6467 s.translate(0, h) 6468 } else if (a === Un || a === Un + "3d") { 6469 let h = u[0] == null ? 1 : vs(u[0]) 6470 , c = u[1] == null ? 1 : vs(u[1]); 6471 s.scale(h, c) 6472 } else if (a === Un + "X") { 6473 let h = u[0] == null ? 1 : vs(u[0]); 6474 s.scale(h, 0) 6475 } else if (a === Un + "Y") { 6476 let h = u[0] == null ? 1 : vs(u[0]); 6477 s.scale(0, h) 6478 } else if (a === oo || a === oo + "Z") { 6479 let h = u[0] == null ? 0 : io(u[0]); 6480 s.rotate(h) 6481 } else if (a === oo + "X") { 6482 let h = u[0] == null ? 0 : io(u[0]); 6483 s.scale(1, jt(h)) 6484 } else if (a === oo + "Y") { 6485 let h = u[0] == null ? 0 : io(u[0]); 6486 s.scale(Math.cos(h), 1) 6487 } else if (a === so) { 6488 let h = u[0] == null ? 0 : io(u[0]) 6489 , c = u[1] == null ? 0 : io(u[1]); 6490 s.skewX(h), 6491 s.skewY(c) 6492 } else if (a === so + "X") { 6493 let h = u[0] == null ? 0 : io(u[0]); 6494 s.skewX(h) 6495 } else if (a === so + "Y") { 6496 let h = u[0] == null ? 0 : io(u[0]); 6497 s.skewY(h) 6498 } else if (a === "matrix" || a === "matrix3d") { 6499 let h = []; 6500 for (let c of u) { 6501 let f = parseFloat(c); 6502 if (isNaN(f)) 6503 break; 6504 h.push(f) 6505 } 6506 h.length === 6 && a === "matrix" ? s.multiply(h[0], h[1], h[2], h[3], h[4], h[5]) : h.length === 16 && a === "matrix3d" && s.multiply(h[0], h[1], h[4], h[5], h[12], h[13]) 6507 } 6508 } 6509 } 6510 } 6511 return s 6512 } 6513 static fromSVGMatrix(e) { 6514 let t = new oe; 6515 return e != null && t.setFromSVGMatrix(e), 6516 t 6517 } 6518 static fromTransformedPoints(e, t, n, s) { 6519 let o = s.dist(n) / t.dist(e) 6520 , i = s.subtract(n).getAngleTo(t.subtract(e)) 6521 , r = new oe; 6522 return r.translate(n.x, n.y), 6523 r.rotate(i), 6524 r.scale(o, o), 6525 r.translate(-e.x, -e.y), 6526 r 6527 } 6528 static compose(e, t) { 6529 let n = t ? ti : 1 6530 , s = new oe; 6531 return e.translate && s.translate(e.translate[0], e.translate[1]), 6532 e.rotate && s.rotate(e.rotate * n), 6533 e.scale && s.scale(e.scale[0], e.scale[1]), 6534 e.skew && s.skewY(e.skew[1] * n).skewX(e.skew[0] * n), 6535 s 6536 } 6537 static composeAlt(e, t) { 6538 let n = t ? ti : 1 6539 , s = new oe; 6540 return e.translate && s.translate(e.translate[0], e.translate[1]), 6541 e.rotate && s.rotate(e.rotate * n), 6542 e.skew && s.skewY(e.skew[1] * n).skewX(e.skew[0] * n), 6543 e.scale && s.scale(e.scale[0], e.scale[1]), 6544 s 6545 } 6546 toJSON() { 6547 return [this._a, this._b, this._c, this._d, this._tx, this._ty] 6548 } 6549 static fromJSON(e) { 6550 return Array.isArray(e) ? new oe(e[0],e[1],e[2],e[3],e[4],e[5]) : new oe 6551 } 6552} 6553const jS = Object.freeze({ 6554 aliceblue: "#f0f8ff", 6555 antiquewhite: "#faebd7", 6556 aqua: "#00ffff", 6557 aquamarine: "#7fffd4", 6558 azure: "#f0ffff", 6559 beige: "#f5f5dc", 6560 bisque: "#ffe4c4", 6561 black: "#000000", 6562 blanchedalmond: "#ffebcd", 6563 blue: "#0000ff", 6564 blueviolet: "#8a2be2", 6565 brown: "#a52a2a", 6566 burlywood: "#deb887", 6567 cadetblue: "#5f9ea0", 6568 chartreuse: "#7fff00", 6569 chocolate: "#d2691e", 6570 coral: "#ff7f50", 6571 cornflowerblue: "#6495ed", 6572 cornsilk: "#fff8dc", 6573 crimson: "#dc143c", 6574 cyan: "#00ffff", 6575 darkblue: "#00008b", 6576 darkcyan: "#008b8b", 6577 darkgoldenrod: "#b8860b", 6578 darkgray: "#a9a9a9", 6579 darkgreen: "#006400", 6580 darkgrey: "#a9a9a9", 6581 darkkhaki: "#bdb76b", 6582 darkmagenta: "#8b008b", 6583 darkolivegreen: "#556b2f", 6584 darkorange: "#ff8c00", 6585 darkorchid: "#9932cc", 6586 darkred: "#8b0000", 6587 darksalmon: "#e9967a", 6588 darkseagreen: "#8fbc8f", 6589 darkslateblue: "#483d8b", 6590 darkslategray: "#2f4f4f", 6591 darkslategrey: "#2f4f4f", 6592 darkturquoise: "#00ced1", 6593 darkviolet: "#9400d3", 6594 deeppink: "#ff1493", 6595 deepskyblue: "#00bfff", 6596 dimgray: "#696969", 6597 dimgrey: "#696969", 6598 dodgerblue: "#1e90ff", 6599 firebrick: "#b22222", 6600 floralwhite: "#fffaf0", 6601 forestgreen: "#228b22", 6602 fuchsia: "#ff00ff", 6603 gainsboro: "#dcdcdc", 6604 ghostwhite: "#f8f8ff", 6605 gold: "#ffd700", 6606 goldenrod: "#daa520", 6607 gray: "#808080", 6608 green: "#008000", 6609 greenyellow: "#adff2f", 6610 grey: "#808080", 6611 honeydew: "#f0fff0", 6612 hotpink: "#ff69b4", 6613 indianred: "#cd5c5c", 6614 indigo: "#4b0082", 6615 ivory: "#fffff0", 6616 khaki: "#f0e68c", 6617 lavender: "#e6e6fa", 6618 lavenderblush: "#fff0f5", 6619 lawngreen: "#7cfc00", 6620 lemonchiffon: "#fffacd", 6621 lightblue: "#add8e6", 6622 lightcoral: "#f08080", 6623 lightcyan: "#e0ffff", 6624 lightgoldenrodyellow: "#fafad2", 6625 lightgray: "#d3d3d3", 6626 lightgreen: "#90ee90", 6627 lightgrey: "#d3d3d3", 6628 lightpink: "#ffb6c1", 6629 lightsalmon: "#ffa07a", 6630 lightseagreen: "#20b2aa", 6631 lightskyblue: "#87cefa", 6632 lightslategray: "#778899", 6633 lightslategrey: "#778899", 6634 lightsteelblue: "#b0c4de", 6635 lightyellow: "#ffffe0", 6636 lime: "#00ff00", 6637 limegreen: "#32cd32", 6638 linen: "#faf0e6", 6639 magenta: "#ff00ff", 6640 maroon: "#800000", 6641 mediumaquamarine: "#66cdaa", 6642 mediumblue: "#0000cd", 6643 mediumorchid: "#ba55d3", 6644 mediumpurple: "#9370db", 6645 mediumseagreen: "#3cb371", 6646 mediumslateblue: "#7b68ee", 6647 mediumspringgreen: "#00fa9a", 6648 mediumturquoise: "#48d1cc", 6649 mediumvioletred: "#c71585", 6650 midnightblue: "#191970", 6651 mintcream: "#f5fffa", 6652 mistyrose: "#ffe4e1", 6653 moccasin: "#ffe4b5", 6654 navajowhite: "#ffdead", 6655 navy: "#000080", 6656 oldlace: "#fdf5e6", 6657 olive: "#808000", 6658 olivedrab: "#6b8e23", 6659 orange: "#ffa500", 6660 orangered: "#ff4500", 6661 orchid: "#da70d6", 6662 palegoldenrod: "#eee8aa", 6663 palegreen: "#98fb98", 6664 paleturquoise: "#afeeee", 6665 palevioletred: "#db7093", 6666 papayawhip: "#ffefd5", 6667 peachpuff: "#ffdab9", 6668 peru: "#cd853f", 6669 pink: "#ffc0cb", 6670 plum: "#dda0dd", 6671 powderblue: "#b0e0e6", 6672 purple: "#800080", 6673 rebeccapurple: "#663399", 6674 red: "#ff0000", 6675 rosybrown: "#bc8f8f", 6676 royalblue: "#4169e1", 6677 saddlebrown: "#8b4513", 6678 salmon: "#fa8072", 6679 sandybrown: "#f4a460", 6680 seagreen: "#2e8b57", 6681 seashell: "#fff5ee", 6682 sienna: "#a0522d", 6683 silver: "#c0c0c0", 6684 skyblue: "#87ceeb", 6685 slateblue: "#6a5acd", 6686 slategray: "#708090", 6687 slategrey: "#708090", 6688 snow: "#fffafa", 6689 springgreen: "#00ff7f", 6690 steelblue: "#4682b4", 6691 tan: "#d2b48c", 6692 teal: "#008080", 6693 thistle: "#d8bfd8", 6694 tomato: "#ff6347", 6695 turquoise: "#40e0d0", 6696 violet: "#ee82ee", 6697 wheat: "#f5deb3", 6698 white: "#ffffff", 6699 whitesmoke: "#f5f5f5", 6700 yellow: "#ffff00", 6701 yellowgreen: "#9acd32" 6702}); 6703function At(...l) { 6704 let e = l.length; 6705 if (e === 1) { 6706 let t = l[0]; 6707 if (t) 6708 if (typeof t == "string") { 6709 let n = parseInt; 6710 if (t = t.trim(), 6711 t.startsWith("rgb")) { 6712 let i = t.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.\d+%?|\d+%?)\s*)?\)(?:$|\s)/i) ?? t.match(/^rgba?\s*\(\s*(\d+)\s+(\d+)\s+(\d+)\s*(?:\/\s*(\d*\.\d+%?|\d+%?)\s*)?\)/i); 6713 if (i) 6714 return [+i[1], +i[2], +i[3], lp(i[4])] 6715 } else if (t.startsWith("hsl")) { 6716 let i = t.match(/^hsla?\s*\(\s*(\d+)\s*,\s*(\d*\.\d+|\d+)%\s*,\s*(\d*\.\d+|\d+)%\s*(?:,\s*(\d*\.\d+%?|\d+%?)\s*)?\)(?:$|\s)/i) ?? t.match(/^hsla?\s*\(\s*(\d+)\s+(\d*\.\d+|\d+)%\s+(\dd*\.\d+|\d+)%\s*(?:\/\s*(\d*\.\d+%?|\d+)\s*%?)?\)/i); 6717 if (i) { 6718 let r = Lm(+i[1], +i[2], +i[3]); 6719 return [r[0], r[1], r[2], lp(i[4])] 6720 } 6721 } 6722 let s = t.match(/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3})($|\s)/i), o; 6723 if (s) 6724 return o = s[1], 6725 o.length === 3 ? [n(o[0], 16) * 17, n(o[1], 16) * 17, n(o[2], 16) * 17, 1] : [n(o.substring(0, 2), 16), n(o.substring(2, 4), 16), n(o.substring(4, 6), 16), o.length === 6 ? 1 : Math.round(n(o.substring(6, 8), 16) / .255) / 1e3]; 6726 if (t === "transparent") 6727 return [0, 0, 0, 0]; 6728 if (o = jS[t.toLowerCase()], 6729 o != null) 6730 return o = o.substr(1), 6731 [n(o.substring(0, 2), 16), n(o.substring(2, 4), 16), n(o.substring(4, 6), 16), 1] 6732 } else { 6733 if (t.r != null && t.g != null && t.b != null) 6734 return [t.r, t.g, t.b, t.a == null ? 1 : t.a]; 6735 if (t instanceof Array || t instanceof Uint8ClampedArray) { 6736 if (t.length === 3) 6737 return [t[0], t[1], t[2], 1]; 6738 if (t.length === 4) 6739 return t.slice() 6740 } 6741 } 6742 else 6743 return [0, 0, 0, 1] 6744 } else if (e === 2) { 6745 let t = At(l[0]); 6746 return t[3] = l[1], 6747 t 6748 } else { 6749 if (e === 3) 6750 return [l[0], l[1], l[2], 1]; 6751 if (e === 4) 6752 return [l[0], l[1], l[2], l[3]]; 6753 if (e === 0) 6754 return [0, 0, 0, 1] 6755 } 6756} 6757function lp(l) { 6758 if (l == null) 6759 return 1; 6760 { 6761 let e; 6762 return l.at(-1) === "%" ? e = parseFloat(l.slice(0, -1)) / 100 : e = parseFloat(l), 6763 isNaN(e) ? 1 : Math.min(1, Math.max(0, Math.round(e * 1e3) / 1e3)) 6764 } 6765} 6766const Gl = Math.round 6767 , Im = Math.pow 6768 , Oo = Math.min 6769 , Po = Math.max
6770 , Vu = Math.cbrt; 6771function ur(l) { 6772 return l < 0 ? 0 : l > 255 ? 255 : l 6773} 6774function qo(l) { 6775 return ur(Gl(l)) 6776} 6777function Nu(l) { 6778 return l > .04045 ? Im((l + .055) / 1.055, 2.4) : l / 12.92 6779} 6780function JS(l) { 6781 return l > .0031308 ? 1.055 * Im(l, 1 / 2.4) - .055 : l * 12.92 6782} 6783function Ru(l, e, t) { 6784 return t += t < 0 ? 1 : t > 1 ? -1 : 0, 6785 Oo(255, Math.floor(256 * (t < 1 / 6 ? l + (e - l) * 6 * t : t < 1 / 2 ? e : t < 2 / 3 ? l + (e - l) * (2 / 3 - t) * 6 : l))) 6786} 6787function hr(...l) { 6788 let e, t, n; 6789 if (l.length >= 3) 6790 e = l[0], 6791 t = l[1], 6792 n = l[2]; 6793 else { 6794 let s = l[0]; 6795 s instanceof Array ? (e = s[0], 6796 t = s[1], 6797 n = s[2]) : (e = s.h || 0, 6798 t = s.s || 0, 6799 n = s.v || 0) 6800 } 6801 if (t === 0) 6802 return n = Gl(255 * n), 6803 [n, n, n]; 6804 { 6805 let s = n 6806 , o = (1 - t) * s; 6807 return [Ru(o, s, e + 1 / 3), Ru(o, s, e), Ru(o, s, e - 1 / 3)] 6808 } 6809} 6810function Lm(...l) { 6811 let e, t, n; 6812 if (l.length >= 3) 6813 e = l[0], 6814 t = l[1], 6815 n = l[2]; 6816 else { 6817 let s = l[0]; 6818 s instanceof Array ? (e = s[0], 6819 t = s[1], 6820 n = s[2]) : (e = s.h || 0, 6821 t = s.s || 0, 6822 n = s.l || 0) 6823 } 6824 if (t === 0) 6825 return n = Gl(255 * n), 6826 [n, n, n]; 6827 { 6828 e %= 360, 6829 e < 0 && (e += 360), 6830 t /= 100, 6831 n /= 100; 6832 let s = o=>{ 6833 let i = (o + e / 30) % 12 6834 , r = t * Oo(n, 1 - n); 6835 return n - r * Po(-1, Oo(i - 3, 9 - i, 1)) 6836 } 6837 ; 6838 return [Gl(255 * s(0)), Gl(255 * s(8)), Gl(255 * s(4))] 6839 } 6840} 6841function ZS() { 6842 let l = At(...arguments), e = l[0], t = l[1], n = l[2], s = Oo(e, t, n), o = Po(e, t, n), i = o - s, r = o / 255, a = o === 0 ? 0 : i / o, d; 6843 return a === 0 ? d = 0 : (d = e === o ? (t - n) / i : t === o ? 2 + (n - e) / i : 4 + (e - t) / i, 6844 d < 0 && (d += 6), 6845 d /= 6), 6846 [d, a, r] 6847} 6848function Rh() { 6849 let l = At(...arguments) 6850 , e = Nu(l[0] / 255) 6851 , t = Nu(l[1] / 255) 6852 , n = Nu(l[2] / 255) 6853 , s = .4122214708 * e + .5363325363 * t + .0514459929 * n 6854 , o = .2119034982 * e + .6806995451 * t + .1073969566 * n 6855 , i = .0883024619 * e + .2817188376 * t + .6299787005 * n 6856 , r = Vu(s) 6857 , a = Vu(o) 6858 , d = Vu(i); 6859 return [.21045426830931 * r + .79361777470231 * a - .00407204301162 * d, 1.97799853243117 * r - 2.42859224204858 * a + .45059370961741 * d, .02590404246555 * r + .78277171245753 * a - .80867575492308 * d] 6860} 6861function Vm(l, e, t, n=!1) { 6862 let s = l + .39633777737617 * e + .21580375730991 * t 6863 , o = l - .10556134581566 * e - .06385417282581 * t 6864 , i = l - .08948417752981 * e - 1.29148554801941 * t 6865 , r = s ** 3 6866 , a = o ** 3 6867 , d = i ** 3 6868 , u = [4.0767416621 * r - 3.3077115913 * a + .2309699292 * d, -1.2684380046 * r + 2.6097574011 * a - .3413193965 * d, -.0041960863 * r - .7034186147 * a + 1.707614701 * d]; 6869 for (let h = 0; h < 3; h++) 6870 u[h] = Gl(255 * JS(u[h])), 6871 n || (u[h] = ur(u[h])); 6872 return u 6873} 6874function QS(l, e, t) { 6875 let n = Rh(l, e, t); 6876 return tw(n[0], n[1], n[2]) 6877} 6878function ew(l, e, t) { 6879 let n = lw(l, e, t); 6880 return Vm(n[0], n[1], n[2]) 6881} 6882function tw(l, e, t) { 6883 let n = Math.hypot(e, t) 6884 , s = (Math.atan2(t, e) * 180 / Math.PI + 360) % 360; 6885 return [l, n, s] 6886} 6887function lw(l, e, t) { 6888 t *= Math.PI / 180; 6889 let n = Math.cos(t) * e 6890 , s = Math.sin(t) * e; 6891 return [l, n, s] 6892} 6893function nw(l, ...e) { 6894 let t = At(...e) 6895 , n = t[0] / 255 6896 , s = t[1] / 255 6897 , o = t[2] / 255 6898 , i = [.26 * n + .55 * s + .19 * o, .58 * n + .3 * s + .12 * o, .26 * n + .23 * s + .51 * o]; 6899 return i[0] = Po(0, Oo(1, i[0] + l)), 6900 i[1] = Po(0, Oo(1, i[1] + l)), 6901 i[2] = Po(0, Oo(1, i[2] + l)), 6902 l > 0 && (i[0] = Po(i[0], 2.17688 * i[1] - 1.17688), 6903 i[2] = Po(i[2], 2.58491 * i[1] - 1.58491)), 6904 [ur(Gl(255 * (-1.22461 * i[0] + 2.3125 * i[1] - .08789 * i[2]))), ur(Gl(255 * (2.58398 * i[0] - .8125 * i[1] - .77148 * i[2]))), ur(Gl(255 * (-.54102 * i[0] - .8125 * i[1] + 2.35352 * i[2])))] 6905} 6906function lf() { 6907 let l = arguments 6908 , e = !0 6909 , t = !1 6910 , n = l.length - 1; 6911 typeof l[n] == "boolean" && (e = l[n], 6912 l = Array.prototype.slice.apply(l, [0, n]), 6913 n--, 6914 typeof l[n] == "boolean" && (t = l[n], 6915 l = Array.prototype.slice.apply(l, [0, n]))); 6916 let s = At.apply(void 0, l) 6917 , o = ((1 << 24) + s[2] | s[1] << 8 | s[0] << 16).toString(16).slice(1); 6918 return t && (o += Gl(255 * s[3]).toString(16).substr(1)), 6919 e && (o = "#" + o), 6920 o 6921} 6922function sw() { 6923 let l = At(...arguments); 6924 return "rgb(" + l[0] + " " + l[1] + " " + l[2] + ")" 6925} 6926function Nm() { 6927 let l = At(...arguments) 6928 , e = Gl(l[3] * 1e3) / 1e3; 6929 return "rgba(" + l[0] + ", " + l[1] + ", " + l[2] + (e === 1 ? "" : ", " + e) + ")" 6930} 6931function Rm() { 6932 let l = At(...arguments); 6933 return l[3] === 1 ? lf(l) : Nm(l) 6934} 6935function ow() { 6936 let l = At(...arguments); 6937 return .2126 * l[0] + .7152 * l[1] + .0722 * l[2] 6938} 6939const da = Math.min 6940 , ua = Math.max; 6941class ce { 6942 r = 0; 6943 g = 0; 6944 b = 0; 6945 a = 1; 6946 constructor() { 6947 this.set.apply(this, arguments) 6948 } 6949 toColor() { 6950 return this.clone() 6951 } 6952 set() { 6953 let e = At.apply(void 0, arguments); 6954 return this.r = e[0], 6955 this.g = e[1], 6956 this.b = e[2], 6957 this.a = e[3], 6958 this 6959 }
6960 alphaBlend() { 6961 let e = At.apply(void 0, arguments) 6962 , t = this.a 6963 , n = e[3] 6964 , s = da(1, ua(0, n * (1 - t))) 6965 , o = da(1, ua(0, t + s)); 6966 return o === 0 ? new ce(0,0,0,0) : new ce(qo(this.r * t + e[0] * s) / o,qo(this.g * t + e[1] * s) / o,qo(this.b * t + e[2] * s) / o,o) 6967 } 6968 blend(e) { 6969 let t = At.apply(void 0, Array.prototype.slice.apply(arguments, [1])); 6970 e = da(1, ua(0, e)); 6971 let n = 1 - e; 6972 return new ce(qo(this.r * e + t[0] * n),qo(this.g * e + t[1] * n),qo(this.b * e + t[2] * n),this.a * e + t[3] * n) 6973 } 6974 blendOklab(e) { 6975 let t = At.apply(void 0, Array.prototype.slice.apply(arguments, [1])) 6976 , n = Rh(this) 6977 , s = Rh(t); 6978 e = da(1, ua(0, e)); 6979 let o = 1 - e; 6980 return new ce(Vm(n[0] * e + s[0] * o, n[1] * e + s[1] * o, n[2] * e + s[2] * o),this.a * e + t[3] * o) 6981 } 6982 setHsv() { 6983 return this.set(hr.apply(void 0, arguments), this.a) 6984 } 6985 toString() { 6986 return "r: " + this.r + ", g: " + this.g + ", b: " + this.b + ", a: " + this.a 6987 } 6988 toJSON() { 6989 return { 6990 r: this.r, 6991 g: this.g, 6992 b: this.b, 6993 a: this.a 6994 } 6995 } 6996 equals(e) { 6997 return e && this.r === e.r && this.g === e.g && this.b === e.b && this.a === e.a 6998 } 6999 clone() { 7000 return new ce(this) 7001 } 7002 toHex(e=!1, t=!0) { 7003 return lf(this, e, t) 7004 } 7005 toRgbaFunction() { 7006 return Nm(this) 7007 } 7008 toRgbFunction() { 7009 return sw() 7010 } 7011 toCss() { 7012 return Rm(this) 7013 } 7014} 7015const nd = "linear hatch" 7016 , Fm = "cross hatch" 7017 , Fh = "dots" 7018 , Bm = "squares" 7019 , zm = "check" 7020 , Um = "triangles"; 7021function Gm(l, e, t, n, s, o, i) { 7022 let r = de("pattern"); 7023 return l != null && r.setAttribute("id", l), 7024 i != null && !i.isIdentity && r.setAttribute("patternTransform", i.toSvgValue()), 7025 r.setAttribute("patternUnits", "userSpaceOnUse"), 7026 r.setAttribute("patternContentUnits", "userSpaceOnUse"), 7027 Hm(r, e, t, n, s, o), 7028 r 7029} 7030function ro(l, e) { 7031 let t = e.patternType 7032 , n = e.color 7033 , s = e.background 7034 , o = e.density 7035 , i = e.inverse; 7036 Hm(l, t, n, s, o, i) 7037} 7038function Hm(l, e, t, n, s, o) { 7039 l.replaceChildren(); 7040 let i = 10.1 7041 , r = 10.1 7042 , a = t.toCss ? t.toCss() : t; 7043 n && l.appendChild(de("rect", { 7044 x: "-10", 7045 y: "-10", 7046 width: "30", 7047 height: "30", 7048 style: "fill:" + n.toCss() 7049 })); 7050 let d = "M-20-20V30H30V-20z" 7051 , u = ""; 7052 if (e === nd) { 7053 let h = r * s 7054 , c = (r - h) / 2 7055 , f = c + h; 7056 u = (o ? d : "") + `M-10,${c}H20V${f}H-10z` 7057 } else if (e === Fm) { 7058 let h = r * s 7059 , c = (r - h) / 2 7060 , f = c + h; 7061 u = (o ? d : "") + `M-10,${c}H${c}V-10H${f}V${c}H20V${f}H${f}V20H${c}V${f}H-10z` 7062 } else if (e === Fh) { 7063 let h = s * i / 2 * Math.SQRT2 7064 , c = r / 2 7065 , f = c - h 7066 , p = c + h; 7067 u = (o ? d : "") + `M${f},${c}A${h},${h} 0 1 1 ${p},${c}A${h},${h} 0 1 1 ${f},${c}z` 7068 } else if (e === Bm) { 7069 let h = (1 - s) * i / 2 7070 , c = i - h; 7071 u = (o ? d : "") + `M${h} ${h}H${c}V${c}H${h}z` 7072 } else if (e === zm) { 7073 let h = (s <= .5 ? s : 1 - s) * i 7074 , c = (i / 2 - h) / 2 7075 , f = i / 2 + c; 7076 o === s <= .5 && (u = d), 7077 s <= .5 ? u += `M${c} ${c}h${h}v${h}h${-h}zM${f} ${f}h${h}v${h}h${-h}z` : u += `M${c} ${f}h${h}v${h}h${-h}zM${f} ${c}h${h}v${h}h${-h}z` 7078 } else if (e === Um) { 7079 let h = s * 2.5; 7080 r = i * Math.sqrt(3 / 4); 7081 let c = i / 2 7082 , f = i * (1 - h) * .57735 7083 , p = i * (1 + h) / 2 7084 , g = f + h * r 7085 , y = i * (1 - h) / 2; 7086 u = (o ? d : "") + `M${c} ${f}L${p} ${g}H${y}z` 7087 } 7088 l.appendChild(de("path", { 7089 d: u 7090 })), 7091 l.setAttribute("width", i), 7092 l.setAttribute("height", r), 7093 l.setAttribute("viewBox", `0 0 ${i} ${r}`), 7094 l.setAttribute("fill", a || "none") 7095} 7096function np(l, e, t, n=0, s=.5, o=1, i=!1) { 7097 let r = Es() 7098 , a = 320 7099 , d = 80 7100 , u = n !== 0 || o !== 1 ? new oe().scale(o, o).rotate(n) : null; 7101 return `<svg width=${a} height=${d}
7101><defs>${new XMLSerializer().serializeToString(Gm(r, l, e, t, s, i, u))}</defs><rect width=${a} height=${d} fill="url(#${r})"/></svg>` 7102} 7103class cr { 7104 _modelId; 7105 _documentModel; 7106 _parentModel; 7107 _childModels; 7108 baseElement; 7109 constructor(e) { 7110 this._modelId = $m(), 7111 this._parentModel = null, 7112 this.baseElement = me(e), 7113 this._childModels = qn([]) 7114 } 7115 getRootElement() { 7116 return this.baseElement 7117 } 7118 getChildContainerElement() { 7119 return this.baseElement 7120 } 7121 get type() { 7122 return this.getType() 7123 } 7124 getType() { 7125 return this.constructor.type 7126 } 7127 getModelId() { 7128 return this._modelId 7129 } 7130 getDocumentModel() { 7131 return this._documentModel 7132 } 7133 getSvg() { 7134 return this._documentModel && this._documentModel.baseElement 7135 } 7136 getParentModel() { 7137 return this._parentModel 7138 } 7139 setParentModel(e=null) { 7140 let t = this._parentModel; 7141 e !== t && (this._parentModel = e && me(e), 7142 this.ancestorChanged()) 7143 } 7144 getAncestorCount() { 7145 let e = 0 7146 , t = this._parentModel; 7147 for (; t != null; ) 7148 e++, 7149 t = t.getParentModel(); 7150 return e 7151 } 7152 ancestorChanged() { 7153 let e = this._parentModel === null ? null : this._parentModel.getDocumentModel(); 7154 e !== this._documentModel && (this._documentModel != null && this._documentModel.unregisterModel(this), 7155 e?.registerModel(this), 7156 this._documentModel = e); 7157 for (let t of this._childModels) 7158 t.ancestorChanged() 7159 } 7160 getModels(e=!0, t=[]) { 7161 e && t.push(this); 7162 for (let n of this._childModels) 7163 n.getModels(!0, t); 7164 return t 7165 } 7166 getPathToRoot() { 7167 let e = this 7168 , t = []; 7169 do 7170 t.push(e), 7171 e = e.getParentModel(); 7172 while (e != null); 7173 return t 7174 } 7175 isPath() { 7176 return !1 7177 } 7178 hasChildModels() { 7179 return this._childModels.length > 0 7180 } 7181 getChildModelCount() { 7182 return this._childModels.length 7183 } 7184 getChildModels() { 7185 return this._childModels.slice() 7186 } 7187 getChildModel(e) { 7188 return this._childModels.at(e) 7189 } 7190 getChildModelIndex(e) { 7191 return this._childModels.indexOf(e) 7192 } 7193 insertChildAt(e, t) { 7194 let n = this._childModels; 7195 t == null && (t = n.length); 7196 let s = this.getChildContainerElement() 7197 , o = e.baseElement; 7198 t < n.length ? s.insertBefore(o, n[t].baseElement) : s.appendChild(o), 7199 n.splice(t, 0, e), 7200 e.setParentModel(this); 7201 let i = this._documentModel; 7202 i && i.modelChanged(this) 7203 } 7204 insertChildrenAt(e, t) { 7205 let n = this._childModels; 7206 t == null && (t = n.length); 7207 let s = this.getChildContainerElement() 7208 , o = document.createDocumentFragment(); 7209 e.forEach(r=>{ 7210 o.appendChild(r.baseElement) 7211 } 7212 ), 7213 t < n.length ? s.insertBefore(o, n[t].baseElement) : s.appendChild(o), 7214 n.splice(t, 0, ...e), 7215 e.forEach(r=>r.setParentModel(this)); 7216 let i = this._documentModel; 7217 i && i.modelChanged(this) 7218 } 7219 remove() { 7220 this._parentModel && this._parentModel.removeChild(this) 7221 } 7222 removeChild(e) { 7223 let n = this._childModels.indexOf(e); 7224 this.removeChildFrom(n) 7225 } 7226 removeChildFrom(e) { 7227 if (e >= 0) { 7228 let t = this._childModels 7229 , n = t[e]; 7230 t.splice(e, 1), 7231 n.setParentModel(null), 7232 n.baseElement.remove(); 7233 let o = this._documentModel; 7234 o && (o.unregisterModel(n), 7235 o.modelChanged(this)) 7236 } 7237 } 7238 removeChildrenFrom(e, t) { 7239 let n; 7240 if (e >= 0) { 7241 n = this._childModels.splice(e, t), 7242 n.forEach(i=>i.setParentModel(null)), 7243 n.forEach(i=>i.baseElement.remove()); 7244 let o = this._documentModel; 7245 o && (n.forEach(i=>o.unregisterModel(i)), 7246 o.modelChanged(this)) 7247 } 7248 return n || [] 7249 } 7250 getId() { 7251 return this.baseElement.getAttribute("id") 7252 } 7253 setId(e) { 7254 this.baseElement.setAttribute("id", e) 7255 } 7256 isAncestorOf(e) { 7257 if (this.getChildModelCount() === 0) 7258 return !1; 7259 let t = e.getParentModel(); 7260 for (; t != null; ) { 7261 if (t === this) 7262 return !0; 7263 t = t.getParentModel() 7264 } 7265 return !1 7266 } 7267 getModelTreeLevel() { 7268 let e = this.getDocumentModel() 7269 , t = this 7270 , n = 0; 7271 for (; t !== e; ) 7272 n++, 7273 t = t.getParentModel(); 7274 return n 7275 } 7276 modelChanged() { 7277 let e = this.getDocumentModel(); 7278 e?.modelChanged(this) 7279 } 7280 addChangeCallback(e) { 7281 let t = this.getDocumentModel(); 7282 t?.addModelChangeCallback(this, e) 7283 } 7284 removeChangeCallback(e) { 7285 this.getDocumentModel() != null && this.getDocumentModel().removeModelChangeCallback(this, e) 7286 } 7287 toJSON() { 7288 return { 7289 modelId: this._modelId, 7290 modelType: this.getType() 7291 } 7292 } 7293 setJSON(e) { 7294 this._modelId = e.modelId 7295 } 7296 static fromJSON(e) { 7297 let t = new this; 7298 return t.setJSON(e), 7299 t 7300 } 7301} 7302let iw = -1; 7303function $m() { 7304 return ++iw 7305} 7306class nf extends cr { 7307 clone() { 7308 let e = new this.constructor; 7309 return e.set(this), 7310 e 7311 } 7312 setModelTransform(e, t) { 7313 (!this.modelTransform.equals(e, !0) || !this.elementTransform.equals(t, !0)) && (this.modelTransform.setFromTransform(e), 7314 this.elementTransform.setFromTransform(t), 7315 this.updatePaintElementTransform()) 7316 } 7317 setElementModel() {} 7318 updateViewFromModel() {}
7319 updateModelFromView() {} 7320 convertGlobalColors() {} 7321} 7322class jd { 7323 colorSpaceName; 7324 params = [1, 0, 1, 0, 1, 0, 1, 0]; 7325 alpha = 1; 7326 constructor(e="oklch", t=1, n=0, s=1, o=0, i=1, r=0, a=1) { 7327 this.colorSpaceName = e, 7328 this.params.splice(0, 8, t, n, s, o, i, r), 7329 this.alpha = a 7330 } 7331 clone() { 7332 let e = this.params; 7333 return new jd(this.colorSpaceName,e[0],e[1],e[2],e[3],e[4],e[5],this.alpha) 7334 } 7335 set(e) { 7336 this.colorSpaceName = e.colorSpaceName, 7337 this.params.splice(0, 8, ...e.params), 7338 this.alpha = e.alpha 7339 } 7340 isIdentity() { 7341 let e = this.params; 7342 return e[0] === 1 && e[1] === 0 && e[2] === 1 && e[3] === 0 && e[4] === 1 && e[5] === 0 && this.alpha === 1 7343 } 7344 toCss(e) { 7345 if (this.isIdentity()) 7346 return e; 7347 { 7348 let t = this.colorSpaceName 7349 , n = t + "(from " + e 7350 , s = t.substring(t.length - 3) 7351 , o = this.params; 7352 for (let i = 0; i < 3; i++) { 7353 let r = "" 7354 , a = o[2 * i] 7355 , d = o[2 * i + 1]; 7356 a === 1 && d === 0 ? i < 3 && (r += s[i]) : a === 0 ? (i < 3 || d < 1) && (r += d) : r += "calc(" + s[i] + " * " + a + (d === 0 ? "" : d < 0 ? " - " + -d : " + " + d) + ")", 7357 r && (n += " ", 7358 n += r) 7359 } 7360 return n += " / " + this.alpha, 7361 n += ")", 7362 n 7363 } 7364 } 7365 toJSON() { 7366 return { 7367 colorSpace: this.colorSpaceName, 7368 params: this.params, 7369 alpha: this.alpha 7370 } 7371 } 7372 setJSON(e) { 7373 this.colorSpaceName = e?.colorSpaceName ?? "oklch", 7374 this.params = e?.params ?? [1, 0, 1, 0, 1, 0], 7375 this.alpha = e?.alpha ?? 1 7376 } 7377} 7378class Xt { 7379 static type = "colorRef"; 7380 id; 7381 globalColorId; 7382 documentModel; 7383 colorModification = new jd; 7384 constructor(e, t=-1, n) { 7385 this.documentModel = e, 7386 n && this.colorModification.set(n), 7387 this.globalColorId = t, 7388 this.id = Es(8) 7389 } 7390 getGlobalColor() { 7391 return this.documentModel?.getGlobalColor(this.globalColorId) 7392 } 7393 clone() { 7394 return new Xt(this.documentModel,this.globalColorId,this.colorModification) 7395 } 7396 set(e) { 7397 return this.globalColorId = e.globalColorId, 7398 this.documentModel = e.documentModel, 7399 this.colorModification.set(e.colorModification), 7400 this 7401 } 7402 toColor() { 7403 let e = this.getGlobalColor(); 7404 if (e == null) 7405 return null; 7406 let t = At(e.color) 7407 , n = QS(t[0], t[1], t[2]) 7408 , s = [Math.max(0, Math.min(1, n[0] + this.colorModification.params[1])), Math.max(0, Math.min(1, n[1] * this.colorModification.params[2])), n[2]] 7409 , o = ew(s[0], s[1], s[2]) 7410 , i = Math.min(1, Math.max(0, this.colorModification.alpha)); 7411 return new ce(o,i) 7412 } 7413 toCss() { 7414 let e = this.getGlobalColor(); 7415 if (e == null) 7416 return "none"; 7417 let t = "var(--" + e.name 7418 , n = e.color; 7419 return n && (t += ", " + n.toCss()), 7420 t += ")", 7421 this.colorModification && (t = this.colorModification.toCss(t)), 7422 t 7423 } 7424 toFallbackCss() { 7425 let e = this.getGlobalColor() 7426 , t = "var(--" + this.getFallbackCssVarName() 7427 , n = e.color; 7428 return n && (t += ", " + n.toCss()), 7429 t += ")", 7430 t 7431 } 7432 getFallbackCssVarName() { 7433 return this.getGlobalColor().name + "__MOD" + this.id 7434 } 7435 toGlobalColorCss() { 7436 let e = this.documentModel?.getGlobalColor(this.globalColorId); 7437 return e == null ? "none" : e.color.toCss() 7438 } 7439 toJSON() { 7440 return { 7441 globalColorId: this.globalColorId, 7442 globalColorModification: this.colorModification.toJSON() 7443 } 7444 } 7445 setJSON(e) { 7446 if (e == null) 7447 return null; 7448 this.globalColorId = e.globalColorId, 7449 this.colorModification.fromJSON(e.globalColorModification) 7450 } 7451 equals(e) { 7452 return e instanceof Xt ? this === e ? !0 : this.globalColorId === e.globalColorId : !1 7453 } 7454} 7455class bi extends nf { 7456 static type = "pattern"; 7457 x = 0; 7458 y = 0; 7459 color; 7460 background; 7461 scale; 7462 rotation; 7463 density; 7464 patternType; 7465 inverse; 7466 elementTransform = new oe; 7467 modelTransform = new oe; 7468 patternTransform; 7469 constructor(e=nd, t=new ce(0,0,0), n=null, s=1, o=Math.PI / 4, i=.1, r=!1) { 7470 let a = Gm(Es(), e, t, n, i, r); 7471 super(a), 7472 this.patternType = e, 7473 this.color = t && t.clone(), 7474 this.background = n && n.clone(), 7475 this.scale = s, 7476 this.rotation = o, 7477 this.density = i, 7478 this.inverse = r, 7479 this.updatePaintElementTransform(), 7480 ro(a, this) 7481 } 7482 set(e) { 7483 if (this === e) 7484 return; 7485 this.patternType = e.patternType, 7486 this.x = e.x, 7487 this.y = e.y, 7488 this.width = e.width, 7489 this.height = e.height, 7490 this.scale = e.scale, 7491 this.rotation = e.rotation, 7492 this.color = e.color && e.color.clone(), 7493 this.background = e.background && e.background.clone(), 7494 this.density = e.density, 7495 this.inverse = e.inverse, 7496 this.modelTransform.setFromTransform(e.modelTransform), 7497 this.elementTransform.setFromTransform(e.elementTransform), 7498 this.patternTransform = e.patternTransform && e.patternTransform.clone(); 7499 let t = this.getId() 7500 , n = e.baseElement.cloneNode(!0); 7501 n.setAttribute("id", t), 7502 this.baseElement = n 7503 } 7504 setPatternType(e) { 7505 this.patternType !== e && (this.patternType = e, 7506 ro(this.baseElement, this)) 7507 } 7508 getColor() { 7509 return this.color 7510 } 7511 setColor(e) { 7512 this.color = e, 7513 ro(this.baseElement, this) 7514 }
7515 getBackground() { 7516 return this.background 7517 } 7518 setBackground(e) { 7519 e == null ? this.background = null : this.background = e, 7520 ro(this.baseElement, this) 7521 } 7522 getDensity() { 7523 return this.density 7524 } 7525 setDensity(e) { 7526 this.density = e, 7527 ro(this.baseElement, this) 7528 } 7529 getRotation() { 7530 return this.rotation 7531 } 7532 setRotation(e) { 7533 this.rotation = e, 7534 this.updatePaintElementTransform() 7535 } 7536 getScale() { 7537 return this.scale 7538 } 7539 setScale(e) { 7540 this.scale = e, 7541 this.updatePaintElementTransform() 7542 } 7543 setInverse(e) { 7544 this.inverse = e, 7545 ro(this.baseElement, this) 7546 } 7547 isInverse() { 7548 return this.inverse 7549 } 7550 getPaintTransform() { 7551 return this.patternTransform && this.patternTransform.clone() 7552 } 7553 setPaintTransform(e) { 7554 this.patternTransform = e && e.clone(), 7555 this.updatePaintElementTransform() 7556 } 7557 updatePaintElementTransform() { 7558 let e = this.elementTransform.invert(!0); 7559 e.translate(this.x, this.y).scale(this.scale, this.scale).rotate(this.rotation), 7560 e.multiplyWith(this.patternTransform), 7561 e.isIdentity ? this.baseElement.removeAttribute("patternTransform") : this.baseElement.setAttribute("patternTransform", e.toSvgValue()) 7562 } 7563 updateViewFromModel() {} 7564 updateModelFromView() {} 7565 setElementModel() {} 7566 convertGlobalColors() { 7567 let e, t = this.color, n = this.background, s = t instanceof Xt, o = n instanceof Xt; 7568 return (s || o) && (e = this.clone(), 7569 s && (e.color = t.toColor()), 7570 o && (e.background = n.toColor())), 7571 e || this 7572 } 7573 equals(e) { 7574 return e instanceof bi ? this === e ? !0 : this.patternType === e.patternType && this.x === e.x && this.y === e.y && this.width === e.width && this.height === e.height && this.scale === e.scale && this.rotation === e.rotation && (this.color == null ? e.color == null : this.color.equals(e.color)) && (this.background == null ? e.background == null : this.background.equals(e.background)) && this.density === e.density && this.inverse === e.inverse : !1 7575 } 7576 toJSON() { 7577 return Object.assign(super.toJSON(), { 7578 x: this.x, 7579 y: this.y, 7580 color: this.color && this.color.toCss(), 7581 background: this.background && this.background.toCss(), 7582 scale: this.scale, 7583 rotation: this.rotation, 7584 density: this.density, 7585 patternType: this.patternType, 7586 inverse: this.inverse, 7587 elementTransform: this.elementTransform, 7588 modelTransform: this.modelTransform, 7589 paintTransform: this.paintTransform 7590 }) 7591 } 7592 setJSON(e) { 7593 this.color = new ce(e.color), 7594 this.background = e.background && new ce(e.background), 7595 this.scale = e.scale, 7596 this.rotation = e.rotation, 7597 this.density = e.density, 7598 this.patternType = e.patternType, 7599 this.inverse = e.inverse, 7600 this.elementTransform = oe.fromJSON(e.elementTransform), 7601 this.modelTransform = oe.fromJSON(e.modelTransform), 7602 this.paintTransform = oe.fromJSON(e.paintTransform), 7603 ro(this.baseElement, this) 7604 } 7605} 7606class B { 7607 _x; 7608 _y; 7609 constructor(e=0, t=0) { 7610 this._x = e, 7611 this._y = t 7612 } 7613 static create() { 7614 let e, t, n = arguments, s = n.length; 7615 if (s > 0) { 7616 let o = arguments[0]; 7617 if (o instanceof Array) { 7618 let i = s > 1 && arguments[1] || 0; 7619 e = o[i], 7620 t = o[i + 1] 7621 } else 7622 s === 1 ? (e = o.x, 7623 t = o.y) : (e = o, 7624 t = n[1]) 7625 } 7626 return new B(e || 0,t || 0) 7627 } 7628 get x() { 7629 return this._x 7630 } 7631 set x(e) { 7632 this._x = e 7633 } 7634 get y() { 7635 return this._y 7636 } 7637 set y(e) { 7638 this._y = e 7639 } 7640 clone() { 7641 return new B(this._x,this._y) 7642 } 7643 equals(e) { 7644 return e !== null && this._x === e.x && this._y === e.y 7645 } 7646 set(e, t) { 7647 if (t === void 0) 7648 if (e instanceof B) { 7649 let n = e; 7650 e = n.x, 7651 t = n.y 7652 } else 7653 t = e; 7654 return this._x = e, 7655 this._y = t, 7656 this 7657 } 7658 add(e, t=!1) { 7659 let n = t ? this : this.clone(); 7660 return n.x += e.x, 7661 n.y += e.y, 7662 n 7663 } 7664 addScalar(e, t, n=!1) {
7665 let s = n ? this : this.clone(); 7666 return s.x += e, 7667 s.y += t, 7668 s 7669 } 7670 subtract(e, t=!1) { 7671 let n = t ? this : this.clone(); 7672 return n.x -= e.x, 7673 n.y -= e.y, 7674 n 7675 } 7676 subtractScalar(e, t, n=!1) { 7677 let s = n ? this : this.clone(); 7678 return s.x -= e, 7679 s.y -= t, 7680 s 7681 } 7682 multiply(e, t=!1) { 7683 let n = t ? this : this.clone(); 7684 return n.x *= e.x, 7685 n.y *= e.y, 7686 n 7687 } 7688 multiplyScalar(e, t=!1) { 7689 let n = t ? this : this.clone(); 7690 return n.x *= e, 7691 n.y *= e, 7692 n 7693 } 7694 divide(e, t=!1) { 7695 let n = t ? this : this.clone(); 7696 return n.x /= e.x, 7697 n.y /= e.y, 7698 n 7699 } 7700 divideScalar(e, t=!1) { 7701 let n = t ? this : this.clone(); 7702 return n.x /= e, 7703 n.y /= e, 7704 n 7705 } 7706 rotate(e, t=0, n=0, s=!1) { 7707 let o = s ? this : this.clone() 7708 , i = o.x - t 7709 , r = o.y - n 7710 , a = cl(e) 7711 , d = jt(e); 7712 return o.x = i * d - r * a, 7713 o.y = i * a + r * d, 7714 o.x += t, 7715 o.y += n, 7716 o 7717 } 7718 get length() { 7719 throw new Error('length property not supported. Use "getLength()" instead') 7720 } 7721 getLength() { 7722 return Se(this._x, this._y) 7723 } 7724 setLength(e) { 7725 let t = this._x 7726 , n = this._y; 7727 isFinite(t) ? isFinite(n) || (n = Do(n), 7728 t = 0) : (t = Do(t), 7729 n = isFinite(n) ? 0 : Do(n)); 7730 let s = Se(t, n); 7731 return s !== 0 && (this._x = e * t / s, 7732 this._y = e * n / s), 7733 this 7734 } 7735 isZero(e=Ul) { 7736 return this._x <= e && this._x >= -e && this._y <= e && this._y >= -e 7737 } 7738 dist(e, t) { 7739 return lt(this.distSquared(e, t)) 7740 } 7741 distSquared(e, t) { 7742 if (t === void 0) 7743 if (e instanceof B) { 7744 let o = e; 7745 e = o.x, 7746 t = o.y 7747 } else 7748 t = e; 7749 let n = this._x - e 7750 , s = this._y - t; 7751 return n * n + s * s 7752 } 7753 dot(e) { 7754 return this._x * e.x + this._y * e.y 7755 } 7756 cross(e) { 7757 return this._x * e.y - this._y * e.x 7758 } 7759 projectOn(e, t=!1) { 7760 let n = t ? this : this.clone() 7761 , s = e.x ** 2 + e.y ** 2; 7762 if (s === 0) 7763 n.set(0, 0); 7764 else { 7765 let o = n.dot(e) / s; 7766 n.set(e.x * o, e.y * o) 7767 } 7768 return n 7769 } 7770 negate(e) { 7771 let t = e ? this : this.clone(); 7772 return t.x = -t.x, 7773 t.y = -t.y, 7774 t 7775 } 7776 perp(e, t=!1) { 7777 let n = t ? this : this.clone(); 7778 return e ? n.set(-this._y, this._x) : n.set(this._y, -this._x), 7779 n 7780 } 7781 getAngle(e=!1) { 7782 if (this._x === 0 && this._y === 0) 7783 return 0; 7784 { 7785 let t = nn(this._y, this._x); 7786 return e && (t *= 180 / tt), 7787 t 7788 } 7789 } 7790 getAngleTo(e, t=!0, n=!1) { 7791 let s = nn(this._x * e.y - this._y * e.x, this._x * e.x + this._y * e.y); 7792 return !t && s < 0 && (s = -s), 7793 n && (s *= 180 / tt), 7794 s 7795 } 7796 toString() { 7797 return "[" + this._x + "," + this._y + "]" 7798 } 7799 static interpolate(e, t, n=.5, s=null) { 7800 let o = 1 - n 7801 , i = o * e.x + n * t.x 7802 , r = o * e.y + n * t.y; 7803 return s === null ? s = new B(i,r) : s.set(i, r), 7804 s 7805 } 7806 static getLengthRatio(e, t) { 7807 return lt((e.x ** 2 + e.y ** 2) / (t.x ** 2 + t.y ** 2)) 7808 } 7809 toJSON() { 7810 return [this._x, this._y] 7811 } 7812 static fromJSON(e) { 7813 return new B(e && e[0] || 0,e && e[1] || 0) 7814 } 7815} 7816function Tl(l, e, t, n) { 7817 let s = e.x * n.y - e.y * n.x; 7818 if (s !== 0) { 7819 let o = l.x - t.x 7820 , i = l.y - t.y 7821 , r = (n.x * i - n.y * o) / s; 7822 return new B(l.x + r * e.x,l.y + r * e.y) 7823 } else 7824 return null 7825} 7826function rw(l, e, t, n, s, o) { 7827 if (e.x === 0) { 7828 if (e.y === 0) 7829 return null; 7830 if (l.x >= t && l.x <= s) 7831 return [new B(l.x,n), new B(l.x,o)] 7832 } else { 7833 let i = e.y / e.x 7834 , r = l.y - i * l.x 7835 , a = [] 7836 , d = (n - r) / i; 7837 d > t && d < s && a.push(new B(d,n)); 7838 let u = (o - r) / i; 7839 u > t && u < s && a.push(new B(u,o)); 7840 let h = i * t + r; 7841 h > n && h < o && a.push(new B(t,h)); 7842 let c = i * s + r; 7843 return c > n && c < o && a.push(new B(s,c)), 7844 a.length === 0 ? null : a 7845 } 7846} 7847function sf(l, e, t, n, s, o, i=!1) { 7848 i || (t -= l, 7849 n -= e); 7850 let r = (s - l) * n - (o - e) * t; 7851 return r < 0 ? -1 : r > 0 ? 1 : 0 7852} 7853function Bh(l, e, t, n, s, o, i=!0, r=!1, a=!1) { 7854 let d = s - l, u = o - e, h = t - l, c = n - e, f, p = h ** 2 + c ** 2; 7855 if (p === 0) 7856 f = d ** 2 + u ** 2; 7857 else { 7858 let g = (d * h + u * c) / p; 7859 i || (g = Ee(0, He(1, g))), 7860 f = (g * h - d) ** 2 + (g * c - u) ** 2 7861 } 7862 if (r) 7863 return f; 7864 { 7865 let g = lt(f); 7866 return a && (s - l) * (n - e) - (o - e) * (t - l) < 0 && (g = -g), 7867 g 7868 } 7869} 7870function ds(l, e, t, n, s, o, i=!0, r=!1) { 7871 let a = r ? t : t - l, d = r ? n : n - e, u, h = a ** 2 + d ** 2; 7872 return h === 0 ? u = 0 : (u = ((s - l) * a + (o - e) * d) / h, 7873 i || (u = u < 0 ? 0 : u > 1 ? 1 : u)), 7874 u 7875} 7876function Jt(l, e, t, n, s, o, i=!0, r=!1) { 7877 let a = ds(l, e, t, n, s, o, i, r) 7878 , d = r ? 1 : 1 - a; 7879 return new B(d * l + a * t,d * e + a * n) 7880} 7881function Xm(l, e, t, n, s, o, i=!0, r=!1) { 7882 let a = ds(l, e, t, n, s, o, i, r) 7883 , d = r ? 1 : 1 - a; 7884 return new B(d * l + a * t - s,d * e + a * n - o) 7885} 7886function Gs(l, e) { 7887 if (l.constructor === e) 7888 throw new Error('Abstract class "' + e.name + '" cannot be instantiated.') 7889} 7890function As() { 7891 let l = new Error().stack.match(/at (\S+)/g)[1].slice(3); 7892 throw new Error('Abstract function "' + l + '" is not implemented.') 7893} 7894class ks { 7895 offset; 7896 color; 7897 opacity; 7898 constructor(e, t, n=1) { 7899 this.set(e, t, n) 7900 } 7901 set(e, t, n=1) { 7902 this.offset = e, 7903 this.color = t, 7904 this.opacity = n 7905 } 7906 get offsetPercent() { 7907 return Je(this.offset * 100, 1) 7908 } 7909 set offsetPercent(e) { 7910 this.offset = e / 100 7911 } 7912 toJSON() { 7913 return { 7914 offset: this.offset, 7915 color: this.color.toCss(), 7916 opacity: this.opacity 7917 } 7918 } 7919 static fromJSON(e) { 7920 return new ks(e.offset,new ce(e.color),e.opacity) 7921 } 7922} 7923class Dr extends nf { 7924 stops = []; 7925 elementTransform = new oe; 7926 modelTransform = new oe; 7927 paintTransform = new oe; 7928 _spreadMethod = "pad"; 7929 constructor(e, t) { 7930 super(e), 7931 Gs(this, Dr), 7932 e.setAttribute("gradientUnits", "userSpaceOnUse"), 7933 e.setAttribute("id", Es()), 7934 t?.forEach((n,s)=>{ 7935 this.insertStop(s === 0 ? 0 : s / (t.length - 1), n, 1) 7936 } 7937 ) 7938 } 7939 setElementModel(e) { 7940 let t = null 7941 , n = null; 7942 e && (t = e.getAggregateTransform(), 7943 n = oe.fromSvgValue(e.baseElement.getAttribute("transform"))), 7944 this.setModelTransform(t, n),
7945 this.updateModelFromView() 7946 } 7947 updatePaintElementTransform() { 7948 let e = this.elementTransform.invert(!0); 7949 e.multiplyWith(this.modelTransform), 7950 e.multiplyWith(this.paintTransform), 7951 e.isIdentity ? this.baseElement.removeAttribute("gradientTransform") : this.baseElement.setAttribute("gradientTransform", e.toSvgValue()) 7952 } 7953 getSpreadMethod() { 7954 return this._spreadMethod 7955 } 7956 setSpreadMethod(e) { 7957 e === "reflect" || e === "repeat" ? (this.baseElement.setAttribute("spreadMethod", e), 7958 this._spreadMethod = e) : (this.baseElement.removeAttribute("spreadMethod"), 7959 this._spreadMethod = "pad") 7960 } 7961 mapPaintBounds(e, t) { 7962 As() 7963 } 7964 updateModelFromView() { 7965 As() 7966 } 7967 updateViewFromModel() { 7968 As() 7969 } 7970 setStops(e) { 7971 for (; this.stops.length > e.length; ) 7972 this.stops.pop(), 7973 this.baseElement.lastChild.remove(); 7974 for (let t = 0; t < e.length; t++) { 7975 let n = e[t], s = n.offset, o = n.color, i = n.opacity, r; 7976 if (t === this.stops.length) { 7977 let a = new ks(s,o.clone(),i); 7978 this.stops.push(a), 7979 r = de("stop"), 7980 this.baseElement.appendChild(r) 7981 } else { 7982 let a = this.stops[t]; 7983 a.offset = s, 7984 a.color.constructor === o.constructor ? a.color.set(o) : a.color = o.clone(), 7985 a.opacity = i, 7986 r = this.baseElement.children[t] 7987 } 7988 r.setAttribute("offset", s), 7989 r.style.setProperty("stop-color", o.toCss()), 7990 i >= 1 ? r.style.removeProperty("stop-opacity") : r.style.setProperty("stop-opacity", i) 7991 } 7992 } 7993 setColor(e) { 7994 let t = ow(e) 7995 , n = new ce(nw(t < 128 ? .3 : -.3, e)); 7996 this.setStops([new ks(0,e.clone()), new ks(1,n)]) 7997 } 7998 getStopCount() { 7999 return this.stops.length 8000 } 8001 getStopOffset(e) { 8002 return this.stops[e].offset 8003 } 8004 setStopOffset(e, t, n, s) { 8005 let o = this.stops 8006 , i = this.baseElement.children; 8007 n && (e > 0 && (t = Math.max(t, o[e - 1].offset)), 8008 e < o.length - 1 && (t = Math.min(t, o[e + 1].offset))); 8009 let r = o[e] 8010 , a = r.offset; 8011 if (a === t) 8012 return e; 8013 if (s) { 8014 for (let d = 1; d < o.length - 1; d++) 8015 if (d !== e) { 8016 let u = o[d].offset, h; 8017 u > a ? h = 1 - (1 - t) * (1 - u) / (1 - a) : u < a ? h = t * u / a : h = t, 8018 o[d].offset = Math.max(0, Math.min(1, h)) 8019 } 8020 } 8021 if (!n && !s) { 8022 let d = e; 8023 if (t < r.offset) { 8024 for (let u = e - 1; u >= 0; u--) 8025 if (o[u].offset <= t) { 8026 d = u + 1; 8027 break 8028 } 8029 } else if (t > r.offset) { 8030 for (let u = e + 1; u < o.length; u++) 8031 if (o[u].offset >= t) { 8032 d = u - 1; 8033 break 8034 } 8035 } 8036 if (d !== e) { 8037 let u = i[e]; 8038 o.splice(e, 1), 8039 u.remove(), 8040 o.splice(d, 0, r), 8041 this.baseElement.insertBefore(u, i[d]), 8042 e = d 8043 } 8044 } 8045 return r.offset = t, 8046 i[e].setAttribute("offset", t), 8047 e 8048 } 8049 getStopColor(e) { 8050 let t = this.stops[e]; 8051 return t ? t.color : new ce 8052 } 8053 setStopColor(e, t) { 8054 let n = this.stops[e]; 8055 n.color.constructor === t.constructor ? n.color.set(t) : n.color = t.clone(), 8056 this.baseElement.children[e].setAttribute("stop-color", t.toCss()) 8057 } 8058 insertStop(e, t, n=1, s) { 8059 let o = this.stops 8060 , i = 0; 8061 for (; i < o.length && !(o[i].offset > e); i++) 8062 ; 8063 if (t == null) 8064 if (i === 0) 8065 t = o[0].color.clone(); 8066 else if (i === o.length) 8067 t = o[o.length - 1].color.clone(); 8068 else { 8069 let d = o[i - 1] 8070 , u = o[i] 8071 , h = d.color.toColor() 8072 , c = u.color.toColor() 8073 , f = d.offset === u.offset ? d.offset : (e - d.offset) / (u.offset - d.offset); 8074 t = s ? h.blendOklab(1 - f, c) : h.blend(1 - f,
8074c) 8075 } 8076 else 8077 t = typeof t == "string" ? new ce(t) : t.clone(); 8078 let r = new ks(e,t,n); 8079 this.stops.splice(i, 0, r); 8080 let a = de("stop", { 8081 offset: e, 8082 "stop-color": t.toCss() 8083 }); 8084 return n < 1 && a.style.setProperty("stop-opacity", n), 8085 this.baseElement.insertBefore(a, this.baseElement.children[i]), 8086 i 8087 } 8088 removeStop(e) { 8089 this.stops.splice(e, 1), 8090 this.baseElement.children[e].remove() 8091 } 8092 convertGlobalColors() { 8093 let e, t = this.stops; 8094 for (let n = 0, s = t.length; n < s; n++) { 8095 let o = t[n].color; 8096 o instanceof Xt && (e == null && (e = this.clone(), 8097 t = e.stops), 8098 t[n].color = o.toColor()) 8099 } 8100 return e || this 8101 } 8102 equals(e) { 8103 if (!(e instanceof Dr)) 8104 return !1; 8105 if (this === e) 8106 return !0; 8107 if (this.stops.length !== e.stops.length) 8108 return !1; 8109 for (let t = 0; t < this.stops.length; t++) { 8110 let n = this.stops[t] 8111 , s = e.stops[t]; 8112 if (n.offset !== s.offset || !n.color.equals(s.color) || n.opacity !== s.opacity) 8113 return !1 8114 } 8115 return !0 8116 } 8117 toJSON() { 8118 return Object.assign(super.toJSON(), { 8119 stops: this.stops, 8120 elementTransform: this.elementTransform, 8121 modelTransform: this.modelTransform, 8122 paintTransform: this.paintTransform, 8123 spreadMethod: this._spreadMethod 8124 }) 8125 } 8126 setJSON(e) { 8127 this.setStops((e.stops || []).map(t=>ks.fromJSON(t))), 8128 this.elementTransform = oe.fromJSON(e.elementTransform), 8129 this.modelTransform = oe.fromJSON(e.modelTransform), 8130 this.paintTransform = oe.fromJSON(e.paintTransform), 8131 this.setSpreadMethod(e.spreadMethod) 8132 } 8133} 8134class Ve { 8135 x; 8136 y; 8137 width; 8138 height; 8139 constructor(e=0, t=0, n=0, s=0) { 8140 this.x = e, 8141 this.y = t, 8142 this.width = n, 8143 this.height = s 8144 } 8145 static fromRectangle(e) { 8146 return e ? new Ve(e.x,e.y,e.width,e.height) : new Ve 8147 } 8148 static fromBoundsCoords(e, t, n, s) { 8149 return new Ve(n > e ? e : n,s > t ? t : s,n > e ? n - e : e - n,s > t ? s - t : t - s) 8150 } 8151 set(e) { 8152 return this.x = e.x, 8153 this.y = e.y, 8154 this.width = e.width, 8155 this.height = e.height, 8156 this 8157 } 8158 expand(e) { 8159 return e < 0 && (e = -He(-e, this.width / 2, this.height / 2)), 8160 this.x -= e, 8161 this.y -= e, 8162 this.width += 2 * e, 8163 this.height += 2 * e, 8164 this 8165 } 8166 addRect(e) { 8167 if (e != null) { 8168 let t = He(this.x, e.x) 8169 , n = He(this.y, e.y); 8170 this.width = Ee(this.x + this.width, e.x + e.width) - t, 8171 this.height = Ee(this.y + this.height, e.y + e.height) - n, 8172 this.x = t, 8173 this.y = n 8174 } 8175 return this 8176 } 8177 addPoint(e, t) { 8178 let n = He(e, this.x) 8179 , s = Ee(this.x + this.width, e); 8180 this.x = n, 8181 this.width = s - n; 8182 let o = He(t, this.y) 8183 , i = Ee(this.y + this.height, t); 8184 this.y = o, 8185 this.height = i - o 8186 } 8187 getCenter() { 8188 return new B(this.getXCenter(),this.getYCenter()) 8189 } 8190 getXCenter() { 8191 return this.x + this.width / 2 8192 } 8193 getYCenter() { 8194 return this.y + this.height / 2 8195 } 8196 getArea() { 8197 return this.width * this.height 8198 } 8199 includes(e, t) { 8200 return e >= this.x && e <= this.x + this.width && t >= this.y && t <= this.y + this.height 8201 } 8202 includesRect(e) { 8203 return e.x >= this.x && e.y >= this.y && e.x + e.width <= this.x + this.width && e.y + e.height <= this.y + this.height 8204 } 8205 transform(e) { 8206 let t = new B 8207 , n = fl 8208 , s = -fl 8209 , o = fl 8210 , i = -fl; 8211 for (let r = 0; r <= 1; r++) { 8212 let a = r === 0 ? this.x : this.x + this.width; 8213 for (let d = 0; d <= 1; d++) { 8214 let u = d === 0 ? this.y : this.y + this.height; 8215 t.set(a, u), 8216 e.transformXY(t), 8217 t.x < n && (n = t.x), 8218 t.x > s && (s = t.x), 8219 t.y < o && (o = t.y), 8220 t.y > i && (i = t.y) 8221 } 8222 } 8223 return this.x = n, 8224 this.y = o, 8225 this.width = s - n, 8226 this.height = i - o, 8227 this 8228 } 8229 clone() { 8230 return new Ve(this.x,this.y,this.width,this.height) 8231 } 8232 toString() { 8233 return this.x + "," + this.y + "," + this.width + "," + this.height 8234 } 8235 equals(e) { 8236 return this.x === e.x && this.y === e.y && this.width === e.width && this.height === e.height 8237 } 8238} 8239class Mi extends Dr { 8240 static type = "linearGradient"; 8241 p1 = new B; 8242 p2 = new B; 8243 p1View = new B(0,50); 8244 p2View = new B(100,50); 8245 constructor(e) { 8246 let t = de("linearGradient"); 8247 super(t, e) 8248 } 8249 set(e) { 8250 this !== e && (this.p1.set(e.p1), 8251 this.p2.set(e.p2), 8252 this.p1View.set(e.p1View), 8253 this.p2View.set(e.p2View), 8254 this.setStops(e.stops), 8255 this.modelTransform.setFromTransform(e.modelTransform), 8256 this.elementTransform.setFromTransform(e.elementTransform), 8257 this.setSpreadMethod(e.getSpreadMethod()), 8258 this._applyGeometryAttributes(), 8259 this.updatePaintElementTransform()) 8260 } 8261 _applyGeometryAttributes() { 8262 let e = this.baseElement; 8263 e.setAttribute("x1", this.p1.x), 8264 e.setAttribute("y1", this.p1.y), 8265 e.setAttribute("x2", this.p2.x), 8266 e.setAttribute("y2", this.p2.y) 8267 } 8268 updateViewFromModel() { 8269 let e = this.p1View.set(this.p1) 8270 , t = this.p2View.set(this.p2) 8271 , n = this.modelTransform; 8272 if (!n.isIdentity) { 8273 let s = B.interpolate(e, t, .5)
8274 , o = new B(-(t.y - s.y),t.x - s.x).add(s, !0); 8275 n.transformXY(e), 8276 n.transformXY(t), 8277 n.transformXY(o), 8278 n.transformXY(s); 8279 let i = new B(-(o.y - s.y),o.x - s.x); 8280 e.subtract(s, !0).projectOn(i, !0).add(s, !0), 8281 t.subtract(s, !0).projectOn(i, !0).add(s, !0) 8282 } 8283 } 8284 updateModelFromView() { 8285 let e = this.p1.set(this.p1View) 8286 , t = this.p2.set(this.p2View) 8287 , n = this.modelTransform; 8288 if (!n.isIdentity) { 8289 let s = B.interpolate(e, t, .5) 8290 , o = new B(-(t.y - s.y),t.x - s.x).add(s, !0); 8291 n.invTransformXY(o), 8292 n.invTransformXY(s), 8293 o.subtract(s, !0); 8294 let i = new B(o.y,-o.x); 8295 n.invTransformXY(e), 8296 n.invTransformXY(t); 8297 let r = Jt(s.x, s.y, s.x + i.x, s.y + i.y, e.x, e.y) 8298 , a = Jt(s.x, s.y, s.x + i.x, s.y + i.y, t.x, t.y); 8299 this.p1.set(r), 8300 this.p2.set(a) 8301 } 8302 this._applyGeometryAttributes() 8303 } 8304 hitTest(e, t, n) { 8305 let s = Number.MAX_VALUE, o, i = this.getStopCount(), r = Array.from(Array(i).keys()); 8306 r.pop(), 8307 r.splice(1, 0, i - 1); 8308 for (let a of r) { 8309 let d = this.getStopOffset(a) 8310 , h = B.interpolate(this.p1View, this.p2View, d).dist(e, t); 8311 h <= n && h < s && (o = a, 8312 s = h) 8313 } 8314 if (o != null) 8315 return { 8316 type: "stop", 8317 index: o 8318 }; 8319 { 8320 let a, d = this.p2View, u = this.p1View, h = Jt(u.x, u.y, d.x, d.y, e, t, !1), c = h.dist(e, t); 8321 if (c <= n && c < s && (a = d.dist(u) === 0 ? .5 : Math.min(1, Math.max(0, h.dist(u) / d.dist(u)))), 8322 a != null) 8323 return { 8324 type: "line", 8325 offset: a 8326 } 8327 } 8328 return null 8329 } 8330 mapPaintBounds(e, t) { 8331 e == null && (e = new Ve(0,0,100,100)), 8332 t == null && (t = new Ve(0,0,100,100)); 8333 let n = t.width / e.width 8334 , s = t.x - n * e.x 8335 , o = t.height / e.height 8336 , i = t.y - o * e.y 8337 , r = this.p1View 8338 , a = this.p2View; 8339 isFinite(n) && (r.x = r.x * n + s, 8340 a.x = a.x * n + s), 8341 isFinite(o) && (r.y = r.y * o + i, 8342 a.y = a.y * o + i), 8343 this.updateModelFromView() 8344 } 8345 equals(e) { 8346 return e instanceof Mi ? this === e ? !0 : super.equals(e) && this.p1View.equals(e.p1View) && this.p2View.equals(e.p2View) : !1 8347 } 8348 toJSON() { 8349 return Object.assign(super.toJSON(), { 8350 p1: this.p1, 8351 p2: this.p2, 8352 p1View: this.p1View, 8353 p2View: this.p2View 8354 }) 8355 } 8356 setJSON(e) { 8357 super.setJSON(e), 8358 this.p1 = B.fromJSON(e.p1), 8359 this.p2 = B.fromJSON(e.p2), 8360 this.p1View = B.fromJSON(e.p1View), 8361 this.p2View = B.fromJSON(e.p2View), 8362 this._applyGeometryAttributes(), 8363 this.updatePaintElementTransform() 8364 } 8365} 8366class Si extends Dr { 8367 static type = "radialGradient"; 8368 pC = new B(50,50); 8369 pFRel = new B(0,0); 8370 r = 50; 8371 rFRel = 0; 8372 pCenter = new B(50,50); 8373 pR1View = new B(100,50); 8374 pR2View = new B(50,100); 8375 constructor(e) { 8376 let t = de("radialGradient"); 8377 super(t, e) 8378 } 8379 getPFocus() { 8380 let e = this.getPF(); 8381 return this.paintTransform.transformXY(e), 8382 this.modelTransform.transformXY(e), 8383 e 8384 } 8385 setPFocus(e) { 8386 let t = e.clone(); 8387 this.modelTransform.invTransformXY(t), 8388 this.paintTransform.invTransformXY(t), 8389 this.setPF(t) 8390 } 8391 getPF() { 8392 let e = this.pC 8393 , t = this.pFRel 8394 , n = this.r 8395 , s = e.x + t.x * n 8396 , o = e.y + t.y * n; 8397 return new B(s,o) 8398 } 8399 setPF(e) { 8400 let t = this.pC 8401 , n = this.r 8402 , s = (e.x - t.x) / n 8403 , o = (e.y - t.y) / n 8404 , i = 1 - this.rFRel - .001 8405 , r = Se(s, o); 8406 r > i && (s *= i / r, 8407 o *= i / r), 8408 this.pFRel.set(s, o), 8409 this._applyGeometryAttributes() 8410 } 8411 setRF(e=0) { 8412 this.rFRel = e / this.r 8413 } 8414 setRFRel(e) { 8415 this.rFRel = e, 8416 this._applyGeometryAttributes() 8417 } 8418 setPRView(e, t, n) { 8419 let s = this.pCenter 8420 , o = t === 0 ? this.pR2View : this.pR1View; 8421 if (n) { 8422 let r = t === 0 ? this.pR1View : this.pR2View 8423 , a = e.dist(s) / r.dist(s); 8424 isFinite(a) ? o.subtract(s, !0).multiplyScalar(a, !0).add(s, !0) : o.subtract(s, !0).setLength(e.dist(s).add(this.pC, !0)) 8425 } 8426 if (t === 0 ? this.pR1View.set(e) : this.pR2View.set(e), 8427 e.dist(s) > 0) { 8428 let r = o.dist(s); 8429 t === 0 ? o.set(-(e.y - s.y), e.x - s.x) : o.set(e.y - s.y, -(e.x - s.x)), 8430 o.setLength(r).add(s, !0) 8431 }
8432 this._updatePaintTransformFromView(); 8433 let i = this.paintTransform.invTransformXY(this.modelTransform.invTransformXY(this.pR1View.clone())); 8434 this.r = i.dist(this.pC), 8435 this._applyGeometryAttributes() 8436 } 8437 move(e, t) { 8438 this.pCenter.addScalar(e, t, !0); 8439 let n = this.pC.set(this.pCenter); 8440 this.modelTransform.invTransformXY(n), 8441 this.pR1View.addScalar(e, t, !0), 8442 this.pR2View.addScalar(e, t, !0), 8443 this._updatePaintTransformFromView(), 8444 this._applyGeometryAttributes() 8445 } 8446 set(e) { 8447 this !== e && (this.pC.set(e.pC), 8448 this.r = e.r, 8449 this.pFRel.set(e.pFRel), 8450 this.rFRel = e.rFRel, 8451 this.pCenter.set(e.pCenter), 8452 this.pR1View.set(e.pR1View), 8453 this.pR2View.set(e.pR2View), 8454 this.setStops(e.stops), 8455 this.modelTransform.setFromTransform(e.modelTransform), 8456 this.elementTransform.setFromTransform(e.elementTransform), 8457 this.paintTransform.setFromTransform(e.paintTransform), 8458 this.setSpreadMethod(e.getSpreadMethod()), 8459 this._applyGeometryAttributes(), 8460 this.updatePaintElementTransform()) 8461 } 8462 _applyGeometryAttributes() { 8463 let e = this.baseElement 8464 , t = this.pC 8465 , n = this.getPF() 8466 , s = this.r; 8467 e.setAttribute("cx", t.x), 8468 e.setAttribute("cy", t.y), 8469 e.setAttribute("r", s), 8470 e.setAttribute("fx", n.x), 8471 e.setAttribute("fy", n.y), 8472 e.setAttribute("fr", this.rFRel * s) 8473 } 8474 updateViewFromModel() { 8475 let e = this.modelTransform.clone(); 8476 e.multiplyWith(this.paintTransform); 8477 let t = this.pCenter 8478 , n = this.pR1View 8479 , s = this.pR2View 8480 , o = this.pC 8481 , i = this.r; 8482 t.set(o), 8483 e.transformXY(t); 8484 let r = e.transformXY(new B(o.x + i,o.y)); 8485 r = r.subtract(t, !0), 8486 e.scale(i, i), 8487 e.translate(t.x, t.y); 8488 let a = e.a 8489 , d = e.b 8490 , u = e.c 8491 , h = e.d; 8492 Math.abs(a - h) < 1e-12 && (h = a), 8493 Math.abs(d + u) < 1e-12 && (u = -d); 8494 let c = new oe(a,d,u,h).decomposeSingularValue() 8495 , f = c.u 8496 , p = c.s 8497 , g = f[0] * p[0] 8498 , y = f[1] * p[0] 8499 , m = f[2] * p[1] 8500 , b = f[3] * p[1] 8501 , M = [new B(g,y), new B(-g,-y), new B(m,b), new B(-m,-b)] 8502 , S = e.decomposeAlt().skew[0] 8503 , x = Number.MAX_VALUE 8504 , P = null; 8505 for (let T of M) { 8506 let k = T.getAngleTo(r, !0); 8507 Math.abs(k) < 1e-8 && (k = 0), 8508 S > 0 && (k = -k), 8509 k < 0 && (k = 2 * Math.PI + k), 8510 k < x && (x = k, 8511 P = T) 8512 } 8513 n.set(P), 8514 s.set(-P.y, P.x), 8515 Math.abs(P.getLength() - p[0]) < Math.abs(P.getLength() - p[1]) ? s.setLength(p[1]) : s.setLength(p[0]), 8516 n.add(t, !0), 8517 s.add(t, !0); 8518 let C = n.clone(); 8519 this.modelTransform.invTransformXY(C), 8520 this.paintTransform.invTransformXY(C), 8521 this.r = C.dist(this.pC) 8522 } 8523 updateModelFromView() { 8524 let e = this.modelTransform 8525 , t = this.pCenter 8526 , n = this.pR1View; 8527 e.invTransformXY(this.pC.set(t)), 8528 this._updatePaintTransformFromView(); 8529 let s = n.clone(); 8530 this.modelTransform.invTransformXY(s), 8531 this.paintTransform.invTransformXY(s), 8532 this.r = s.dist(this.pC), 8533 this._applyGeometryAttributes() 8534 } 8535 _updatePaintTransformFromView() { 8536 let e = this.modelTransform 8537 , t = this.pCenter 8538 , n = this.pR1View 8539 , s = this.pR2View 8540 , o = this.pC 8541 , i = o.x 8542 , r = o.y 8543 , a = n.dist(t) 8544 , d = s.dist(t) 8545 , u = this.paintTransform.set(); 8546 u.preTranslate(-i, -r).preScale(1, d / a); 8547 let h = Math.atan2(n.y - t.y, n.x - t.x); 8548 u.preRotate(h); 8549 let c = new oe(e.a,e.b,e.c,e.d,0,0); 8550 u.preMultiplyWith(c.invert()), 8551 u.preTranslate(i, r), 8552 this.updatePaintElementTransform() 8553 } 8554 hitTest(e, t, n) {
8555 let s = Number.MAX_VALUE, o, i, r = !1, a = this.getStopCount(), d = Array.from(Array(a).keys()).reverse(); 8556 d.splice(a - 1, 1), 8557 d.splice(1, 0, 0); 8558 for (let u = 0; u < 2; u++) 8559 for (let h of d) 8560 for (let c = 0; c < 2; c++) { 8561 let f = c === 0 8562 , g = this.getStopPoint(h, u, f).dist(e, t); 8563 g <= n && g < s && (o = h, 8564 s = g, 8565 i = u, 8566 r = f) 8567 } 8568 if (o != null) 8569 return { 8570 type: "stop", 8571 index: o, 8572 axis: i, 8573 negative: r 8574 }; 8575 { 8576 s = Number.MAX_VALUE; 8577 let u, h, c = !1; 8578 for (let f = 0; f < 2; f++) { 8579 let p = f === 0 ? this.pR1View : this.pR2View; 8580 for (let g = 0; g < 2; g++) { 8581 let y = g === 1; 8582 y && (p = this.pCenter.multiplyScalar(2).subtract(p, !0)); 8583 let m = this.getStopPoint(0, f, y) 8584 , b = Jt(m.x, m.y, p.x, p.y, e, t, !1) 8585 , M = b.dist(e, t); 8586 M <= n && M < s && (u = p.dist(m) === 0 ? .5 : Math.min(1, Math.max(0, b.dist(m) / p.dist(m))), 8587 s = M, 8588 h = f, 8589 c = y) 8590 } 8591 } 8592 if (u != null) 8593 return { 8594 type: "line", 8595 offset: u, 8596 axis: h, 8597 negative: c 8598 } 8599 } 8600 return null 8601 } 8602 getStopPoint(e, t, n) { 8603 let s = t === 0 ? this.pR1View : this.pR2View; 8604 n && (s = this.pCenter.multiplyScalar(2).subtract(s, !0)); 8605 let o = this.rFRel, i = this.getPFocus(), r; 8606 o === 0 ? r = i : r = s.subtract(this.pCenter).multiplyScalar(o, !0).add(i, !0); 8607 let a = this.getStopOffset(e); 8608 return B.interpolate(r, s, a) 8609 } 8610 mapPaintBounds(e, t) { 8611 e == null && (e = new Ve(0,0,100,100)), 8612 t == null && (t = new Ve(0,0,100,100)); 8613 let n = t.width / e.width 8614 , s = t.x - n * e.x 8615 , o = t.height / e.height 8616 , i = t.y - o * e.y 8617 , r = this.pCenter 8618 , a = this.pR1View 8619 , d = this.pR2View; 8620 r.x = r.x * n + s, 8621 r.y = r.y * o + i, 8622 a.x = a.x * n + s, 8623 a.y = a.y * o + i, 8624 d.x = d.x * n + s, 8625 d.y = d.y * o + i, 8626 this.updateModelFromView() 8627 } 8628 equals(e) { 8629 return e instanceof Si ? this === e ? !0 : super.equals(e) && this.pCenter.equals(e.pCenter) && this.pR1View.equals(e.pR1View) && this.pR2View.equals(e.pR2View) && this.pFRel.equals(e.pFRel) && this.rFRel === e.rFRel : !1 8630 } 8631 toJSON() { 8632 return Object.assign(super.toJSON(), { 8633 pC: this.pC, 8634 pFRel: this.pFRel, 8635 r: this.r, 8636 rFRel: this.rFRel, 8637 pCenter: this.pCenter, 8638 pR1View: this.pR1View, 8639 pR2View: this.pR2View 8640 }) 8641 } 8642 setJSON(e) { 8643 super.setJSON(e), 8644 this.pC = B.fromJSON(e.pC), 8645 this.pFRel = B.fromJSON(e.pFRel), 8646 this.r = e.r, 8647 this.rFRel = e.rFRel, 8648 this.pCenter = B.fromJSON(e.pCenter), 8649 this.pR1View = B.fromJSON(e.pR1View), 8650 this.pR2View = B.fromJSON(e.pR2View), 8651 this._applyGeometryAttributes(), 8652 this.updatePaintElementTransform() 8653 } 8654} 8655const Sl = "color" 8656 , il = "globalColor" 8657 , Wt = "linearGradient" 8658 , sl = "radialGradient" 8659 , Ml = "pattern" 8660 , sp = "fill"; 8661class et { 8662 type; 8663 paintModelOrColor; 8664 constructor(e) { 8665 if (e == null) 8666 throw new Error("modelOrColor is null"); 8667 e instanceof Mi ? this.type = Wt : e instanceof Si ? this.type = sl : e instanceof bi ? this.type = Ml : e instanceof Xt ? this.type = il : this.type = Sl, 8668 this.paintModelOrColor = e 8669 } 8670 getType() { 8671 return this.type 8672 } 8673 isTransformable() { 8674 return this.paintModelOrColor instanceof nf 8675 } 8676 clone() { 8677 return new et(this.paintModelOrColor && this.paintModelOrColor.clone()) 8678 } 8679 equals(e) { 8680 return e == null || this.type !== e.type ? !1 : this.paintModelOrColor.equals(e.paintModelOrColor) 8681 } 8682 setElementModel(e) { 8683 let t = this.paintModelOrColor; 8684 t != null && t.setElementModel != null && t.setElementModel(e) 8685 } 8686 updateViewFromModel() { 8687 this.isTransformable() && this.paintModelOrColor.updateViewFromModel() 8688 }
8689 updateModelFromView() { 8690 this.isTransformable() && this.paintModelOrColor.updateModelFromView() 8691 } 8692 toCssValue() { 8693 switch (this.type) { 8694 case Wt: 8695 case sl: 8696 case Ml: 8697 return "url(#" + this.paintModelOrColor.getId() + ")"; 8698 case Sl: 8699 case il: 8700 return this.paintModelOrColor.toCss(); 8701 default: 8702 return "none" 8703 } 8704 } 8705 applyToPreviewSvg(e) { 8706 let t = e.children[0] 8707 , n = e.children[1] 8708 , s = e.children[2]; 8709 t.replaceChildren(); 8710 let o = null 8711 , i = null; 8712 switch (this.type) { 8713 case Wt: 8714 case sl: 8715 case Ml: 8716 { 8717 let r = this.paintModelOrColor.clone(); 8718 r.setModelTransform(r.modelTransform, null), 8719 this.updateModelFromView(), 8720 t.appendChild(r.baseElement), 8721 o = "url(#" + r.getId() + ")"; 8722 break 8723 } 8724 case Sl: 8725 o = this.paintModelOrColor.toCss(); 8726 break; 8727 case il: 8728 o = this.paintModelOrColor.toCss(), 8729 i = this.paintModelOrColor.toGlobalColorCss(); 8730 break 8731 } 8732 o && n.setAttribute(sp, o), 8733 i ? (s.setAttribute(sp, i), 8734 s.removeAttribute("visibility")) : s.setAttribute("visibility", "hidden") 8735 } 8736 mapPaintBounds(e, t) { 8737 (this.type === Wt || this.type === sl) && this.paintModelOrColor.mapPaintBounds(e, t) 8738 } 8739 setModelTransform(e, t) { 8740 this.isTransformable() && this.paintModelOrColor.setModelTransform(e, t) 8741 } 8742 getGlobalColorRefs() { 8743 let e = this.type, t = this.paintModelOrColor, n; 8744 return e === il ? n = [t] : e === Wt || e === sl ? n = t.stops.filter(o=>o.color instanceof Xt).map(o=>o.color) : e === Ml && (n = [], 8745 t.color instanceof Xt && n.push(t.color), 8746 t.background instanceof Xt && n.push(t.background)), 8747 n || [] 8748 } 8749 isUsingGlobalColor(e) { 8750 return this.getGlobalColorRefs().find(t=>t.globalColorId === e.id) != null 8751 } 8752 convertGlobalColors() { 8753 let e = this.type 8754 , t = this.paintModelOrColor; 8755 return e === il ? new et(t.toColor()) : e === Wt || e === sl || e === Ml ? t.convertGlobalColors() : this 8756 } 8757 toJSON() { 8758 return { 8759 paintType: this.type, 8760 value: this.type === Sl ? this.paintModelOrColor.toCss() : this.paintModelOrColor.toJSON() 8761 } 8762 } 8763 static fromJSON(e) { 8764 if (e == null) 8765 return null; 8766 let t = e.paintType, n = e.value, s; 8767 return t === Sl ? s = new ce(n) : t === il ? s = Xt.fromJSON(n) : t === Wt ? s = Mi.fromJSON(n) : t === sl ? s = Si.fromJSON(n) : t === Ml && (s = bi.fromJSON(n)), 8768 s ? new et(s) : null 8769 } 8770} 8771class ql { 8772 paintTarget; 8773 isNoPaint = !1; 8774 paintType = Sl; 8775 color = new ce(0,0,0); 8776 globalColorRef = new Xt; 8777 linearGradientModel = new Mi(["#ff0000", "#800000"]); 8778 radialGradientModel = new Si(["#ff0000", "#800000"]); 8779 patternModel = new bi; 8780 linearGradientBounds = new Ve(0,0,100,100); 8781 radialGradientBounds = new Ve(0,0,100,100); 8782 constructor(e, t) { 8783 this.paintTarget = e, 8784 t == null ? this.isNoPaint = !0 : this.setPaint(t) 8785 } 8786 getPaint(e) { 8787 if (e == null) { 8788 if (this.isNoPaint) 8789 return null; 8790 e = this.paintType 8791 } 8792 let t; 8793 switch (e) { 8794 case Sl: 8795 t = this.color; 8796 break; 8797 case il: 8798 t = this.globalColorRef; 8799 break; 8800 case Wt: 8801 t = this.linearGradientModel; 8802 break; 8803 case sl: 8804 t = this.radialGradientModel; 8805 break; 8806 case Ml: 8807 t = this.patternModel; 8808 break; 8809 default: 8810 t = null 8811 } 8812 return new et(t) 8813 } 8814 setPaint(e) { 8815 if (e == null) { 8816 this.isNoPaint = !0; 8817 return 8818 } 8819 this.isNoPaint = !1; 8820 let t = e.type; 8821 this.paintType = t; 8822 let n = e.paintModelOrColor; 8823 if (n != null) 8824 switch (t) { 8825 case Sl: 8826 this.color.set(n); 8827 break; 8828 case il: 8829 this.globalColorRef.set(n); 8830 break; 8831 case Wt: 8832 this.linearGradientModel.set(n); 8833 break; 8834 case sl: 8835 this.radialGradientModel.set(n); 8836 break; 8837 case Ml: 8838 this.patternModel.set(n); 8839 break 8840 } 8841 } 8842 setNoPaint(e) { 8843 this.isNoPaint = e 8844 } 8845 setPaintBounds(e, t, n) { 8846 e == null && (e = this.paintType), 8847 e === Wt ? t != null && (n && this.linearGradientModel.mapPaintBounds(this.linearGradientBounds, t), 8848 this.linearGradientBounds = t) : e === sl && t != null && (n && this.radialGradientModel.mapPaintBounds(this.radialGradientBounds, t), 8849 this.radialGradientBounds = t) 8850 } 8851 getPaintBounds() { 8852 let e = this.paintType; 8853 return e === Wt ? this.linearGradientBounds.clone() : e === sl ? this.radialGradientBounds.clone() : null 8854 } 8855 clone() { 8856 let e = new ql(this.paintTarget); 8857 return e.set(this), 8858 e 8859 } 8860 set(e) { 8861 this.isNoPaint = e.isNoPaint, 8862 this.paintType = e.paintType, 8863 this.color.set(e.color), 8864 this.globalColorRef.set(e.globalColorRef), 8865 this.linearGradientModel.set(e.linearGradientModel), 8866 this.radialGradientModel.set(e.radialGradientModel), 8867 this.linearGradientBounds.set(e.linearGradientBounds), 8868 this.radialGradientBounds.set(e.radialGradientBounds), 8869 this.patternModel.set(e.patternModel) 8870 } 8871} 8872let of = typeof localStorage < "u" 8873 , Ym = of ? null : new Map; 8874function aw(l) { 8875 if (of) { 8876 let e = localStorage.getItem(l); 8877 return JSON.parse(e) 8878 } else 8879 return Ym.get(l) 8880} 8881function dw(l, e) { 8882 if (of) { 8883 let t = JSON.stringify(e); 8884 localStorage.setItem(l, t) 8885 } else 8886 return Ym.set(l, e) 8887} 8888function op() { 8889 const l = { 8890 general: { 8891 language: "en" 8892 }, 8893 editor: { 8894 grid: { 8895 show: !1, 8896 gridX: 64, 8897 gridY: 64 8898 }, 8899 alignment: { 8900 enabled: !1, 8901 showGuides: !0,
8902 toGrid: !0, 8903 toElements: !1, 8904 toNodes: !1 8905 }, 8906 pointTolerance: 6, 8907 canvasBackground: "white" 8908 }, 8909 ui: { 8910 showTooltips: !0, 8911 showRulers: !0, 8912 accentColor: "#2092FC", 8913 darkMode: { 8914 automatic: !0, 8915 isDark: !1 8916 } 8917 }, 8918 privacy: { 8919 allowGoogleFonts: null, 8920 allowSaveState: null 8921 }, 8922 colors: {}, 8923 keyboardShortcuts: {} 8924 } 8925 , e = Math.max(document.documentElement.clientWidth ?? 0, document.documentElement.clientHeight ?? 0); 8926 return l.ui.showRulers = e >= 1024, 8927 l.ui.darkMode.isDark = window.matchMedia?.("(prefers-color-scheme: dark)")?.matches, 8928 l 8929} 8930const Km = "appSettings"; 8931function uw() { 8932 try { 8933 const l = op() 8934 , e = aw(Km); 8935 if (e) { 8936 const t = JSON.parse(e) || {}; 8937 return Wm(l, t) 8938 } else 8939 return l 8940 } catch (l) { 8941 return console.error(l), 8942 op() 8943 } 8944} 8945function Wm(l, e) { 8946 const t = { 8947 ...l 8948 }; 8949 return Object.keys(l).forEach(n=>{ 8950 if (e && Object.hasOwn(e, n)) { 8951 const s = l[n] 8952 , o = e[n]; 8953 ip(s) ? ip(o) && (t[n] = Wm(s, o)) : typeof s == typeof o && (t[n] = o) 8954 } 8955 } 8956 ), 8957 t 8958} 8959function ip(l) { 8960 return l !== null && typeof l == "object" && !Array.isArray(l) 8961} 8962function hw() { 8963 try { 8964 const e = V().appSettings; 8965 dw(Km, JSON.stringify(e)) 8966 } catch (l) { 8967 console.error(l) 8968 } 8969} 8970const qm = new Map; 8971function cw(l, e) { 8972 qm.set(l, e) 8973} 8974function fw(l) { 8975 return qm.get(l) 8976} 8977class pw { 8978 constructor(e) { 8979 this.maxSize_ = e, 8980 this.clear() 8981 } 8982 setEntryFirst_(e) { 8983 e !== this.first_ && (this.size_ === 1 ? (this.first_ = e, 8984 this.last_ = e, 8985 e.previous = null, 8986 e.next = null) : (e.previous && (e.previous.next = e.next), 8987 e.next && (e.next.previous = e.previous), 8988 e === this.last_ && (this.last_ = e.previous), 8989 e.previous = null, 8990 e.next = this.first_, 8991 this.first_.previous = e, 8992 this.first_ = e)) 8993 } 8994 clear() { 8995 this.map_ = {}, 8996 this.size_ = 0, 8997 this.first_ = null, 8998 this.last_ = null 8999 } 9000 get(e) { 9001 let t = this.map_[e]; 9002 if (t) 9003 return this.setEntryFirst_(t), 9004 t.value 9005 } 9006 put(e, t) { 9007 if (t == null) 9008 this.remove(e); 9009 else { 9010 let n = this.map_[e]; 9011 n ? n.value = t : (n = { 9012 value: t 9013 }, 9014 this.size_ === this.maxSize_ ? (this.last_ = this.last_.previous, 9015 this.last_.next = null) : this.size_++, 9016 this.map_[e] = n), 9017 this.setEntryFirst_(n) 9018 } 9019 } 9020 remove(e) { 9021 let t = this.map_[e]; 9022 t && (t === this.first && (this.first_ = t.next), 9023 t === this.last && (this.last_ = t.previous), 9024 t.previous && (t.prev.next = t.next), 9025 t.next && (t.next.previous = t.previous), 9026 this.size_--) 9027 } 9028} 9029const jm = navigator.platform.includes("Mac"); 9030navigator.platform.includes("Win"); 9031const gw = /Android/i.test(navigator.userAgent) 9032 , mw = /iPhone|iPad|iPod/i.test(navigator.platform) 9033 , An = gw || mw || navigator.maxTouchPoints > 1 9034 , rf = navigator.userAgent.includes("Firefox") 9035 , yw = /Version\/([0-9._]+).*Safari/.test(navigator.userAgent); 9036window.chrome && (window.chrome.webstore || window.chrome.runtime); 9037const sd = !!window.chrome 9038 , rp = 7.5; 9039let zh = new Map 9040 , Uh = new Map 9041 , vw = ki(25, 25) 9042 , bw = ki(50, 50); 9043const Mw = { 9044 rotate: "rotate", 9045 scale: "scale", 9046 skew: "skew", 9047 nodes: "nodes", 9048 nodesPoint: "nodes", 9049 controlPoint: "nodes", 9050 selectorLasso: "default", 9051 selectorRect: "default", 9052 brush: "default", 9053 pen: "pen", 9054 pencil: "default", 9055 pointer: "pointer", 9056 grab: "move", 9057 grabbing: "move", 9058 move: "move", 9059 default: "default" 9060}; 9061class bs { 9062 constructor(e, t, n, s, o, i) { 9063 this.fallbackType = e, 9064 this.rotatable = t, 9065 this.invertable = n, 9066 this.hotspotX = s, 9067 this.hotspotY = o, 9068 this.pathData = i 9069 } 9070} 9071const Gh = { 9072 default: new bs("default",!1,!0,2,1,"M20 41l-7-12 -8 6.93v-31.93l23 19 -9.46 3 6.33 12.2 -4.87 2.8z"), 9073 pointer: new bs("pointer",!1,!1,6,2,"M2.47 22c-1.38-4.04 3.7-6.29 5.34-2.79l3.19 4.79v2 -21c0-4 6-4 6 0l.01 15v-5.09c-.25-1.11 5.3-1.95 6.03
90731.29l-.03 4.8v-4.86c-.08-1.35 5.75-1.71 5.98 2.12l.01 4.24 -.01-4.24c2.01-1.26 6.01-1.26 6.01 5.74v6c0 6-4.78 9-6 11 -.52 .85-1 2-4 2h-9c-3 0-3.59-1.09-4-2 -1-2.24-5-5-6-8l-3.53-11z"), 9074 move: new bs("move",!1,!0,11,11,"M1 22l7-7h2v5h10v-10h-5v-2l7-7 7 7v2h-5v10h10v-5h2l7 7-7 7h-2v-5h-10v10h5v2l-7 7-7-7v-2h5v-10h-10v5h-2l-7-7z"), 9075 nodes: new bs("default",!1,!0,1,1,"M14 28l-11 11v-35.38l25.49 21.05 -14.48 3.94z"), 9076 scale: new bs("default",!0,!0,12,12,"M13 21h22v-6h2l8 8 -8 8h-2v-6h-22v6h-2l-8-8 8-8h2v6z"), 9077 rotate: new bs("default",!0,!0,12,12,"M7 13l8-8h2v6h5c8 0 15 7 15 15v5h6v2l-8 8-8-8v-2h6v-5c0-6-5-11-11-11h-5v6h-2l-8-8z"), 9078 skew: new bs("default",!0,!0,12,12,"M13 17h16v4h-16v6h-2l-8-8 8-8h2v6zM35 27h-16v4h16v6h2l8-8-8-8h-2v6z"), 9079 pen: new bs("default",!1,!1,2,2,"M4.58 3.51l11.32 18.76 -11.25-18.8 .03-.02c1.6-.92 3.66-.37 4.58 1.23 .59 1.03 .58 2.24 .08 3.22l.74 1.28c5.29 3.8 12.32 7.19 17.07 9.05l5.06 18.36 -12.6 7.26 -13.36-13.54c.77-5.14 1.36-13.08 .65-19.63l-.55-.97c-1.16 0-2.28-.6-2.9-1.67 -.9-1.57-.4-3.57 1.13-4.53zM15.9 22.27c-.96 .55-1.28 1.77-.73 2.73 .55 .95 1.77 1.28 2.73 .73 .96-.55 1.28-1.78 .73-2.73 -.55-.96-1.77-1.29-2.73-.73z") 9080}; 9081Sw(jm); 9082function Sw(l) { 9083 zh.clear(), 9084 Uh.clear(); 9085 for (let e of Object.keys(Gh)) { 9086 let t = Gh[e] 9087 , n = l && t.invertable 9088 , s = ki(48, 48) 9089 , o = s.getContext("2d"); 9090 o.fillStyle = n ? "black" : "white", 9091 o.strokeStyle = n ? "white" : "black", 9092 o.lineWidth = n ? 5.5 : 2; 9093 let i = new Path2D(t.pathData); 9094 o.stroke(i), 9095 o.fill(i), 9096 o.lineWidth = n ? .5 : 1, 9097 o.stroke(i), 9098 Uh.set(e, s); 9099 let r = Zm(e, 0); 9100 (e === "default" || e === "pointer") && document.documentElement.style.setProperty("--cursor-" + e, r) 9101 } 9102} 9103function ap(l, e, t) { 9104 let n = t ? bw : vw 9105 , s = n.getContext("2d"); 9106 return s.clearRect(0, 0, n.width, n.height), 9107 s.save(), 9108 s.translate(n.width / 2, n.height / 2), 9109 e !== 0 && s.rotate(Math.PI / 180 * e), 9110 s.shadowBlur = t ? 4 : 2, 9111 s.shadowColor = "rgb(0 0 0 / 0.3)", 9112 s.shadowOffsetX = t ? 2 : 1, 9113 s.shadowOffsetY = t ? 4 : 2, 9114 s.drawImage(l, -n.width / 2, -n.height / 2, n.width, n.height), 9115 s.restore(), 9116 n.toDataURL("image/png") 9117} 9118function Jm(l) { 9119 return l !== 0 && (l = (l % 360 + 360) % 360, 9120 l = rp * Math.floor(l / rp)), 9121 l 9122} 9123function Zm(l, e=0) { 9124 e = Jm(e); 9125 let t; 9126 if (l === "none" || l === "text" || l === "crosshair") 9127 t = l; 9128 else { 9129 l = Mw[l]; 9130 let n = Gh[l]; 9131 if (n != null) { 9132 e !== 0 && !n.rotatable && (e = 0); 9133 let s = zh.get(l); 9134 if (s == null && (s = new pw(361), 9135 zh.set(l, s)), 9136 t = s.get(e), 9137 !t) { 9138 let o = Uh.get(l) 9139 , i = ap(o, e, !1) 9140 , r = ap(o, e, !0); 9141 t = '-webkit-image-set(url("' + i + '") 1x, url("' + r + '") 2x) ' + n.hotspotX + " " + n.hotspotY + ", " + n.fallbackType, 9142 s.put(e, t) 9143 } 9144 } else 9145 t = "default" 9146 } 9147 return t 9148} 9149const Hh = "stroke-width" 9150 , $h = "stroke-linecap" 9151 , Xh = "stroke-linejoin" 9152 , ji = "stroke-miterlimit" 9153 , Va = "stroke-dasharray" 9154 , Ji = "stroke-dashoffset"; 9155class Nt extends cr { 9156 _selfTransform = new oe; 9157 _aggregateTransform = new oe; 9158 _label = null; 9159 _opacity = 1; 9160 _blur = 0; 9161 _blendMode = "normal"; 9162 _hidden = !1; 9163 _locked = !1; 9164 fillPaint; 9165 strokePaint; 9166 strokeStyle = new Qt; 9167 constructor(e) { 9168 if (super(e), 9169 new.target === Nt) 9170 throw new TypeError("Cannot construct " + this.constructor.name + " instances directly"); 9171 return me(this) 9172 } 9173 clone() { 9174 let e = new this.constructor; 9175 return e.baseElement = this.baseElement.cloneNode(!0), 9176 this.copyAttributes(e), 9177 e 9178 } 9179 copyAttributes(e) { 9180 e.setSelfTransform(this._selfTransform), 9181 this.copyGraphicsAttributes(e) 9182 } 9183 copyGraphicsAttributes(e) { 9184 let t = this.getFillPaint(); 9185 t && (t = t.clone(), 9186 t.updateViewFromModel()), 9187 e.setPaint(t, "fill", !0);
9188 let n = this.getStrokePaint(); 9189 n && (n = n.clone(), 9190 n.updateViewFromModel()), 9191 e.setPaint(n, "stroke", !0), 9192 e.setStrokeStyle(this.strokeStyle), 9193 e.setOpacity(this._opacity) 9194 } 9195 ancestorChanged() { 9196 super.ancestorChanged(), 9197 (this._parentModel === null ? null : this._parentModel.getDocumentModel()) != null && (this.transformUpdated(), 9198 this.registerPaint(this.fillPaint), 9199 this.registerPaint(this.strokePaint)) 9200 } 9201 getBounds() { 9202 throw new Error("Abstract function") 9203 } 9204 getSelfTransform() { 9205 return this._selfTransform.clone() 9206 } 9207 setSelfTransform(e) { 9208 this._selfTransform.equals(e, !0) || (this._selfTransform.setFromTransform(e), 9209 this.transformUpdated(), 9210 this.modelChanged()) 9211 } 9212 getAggregateTransform() { 9213 return this._aggregateTransform.clone() 9214 } 9215 transformUpdated() { 9216 let e = this._aggregateTransform.clone(); 9217 if (this._aggregateTransform.setFromTransform(this._selfTransform), 9218 this._parentModel != null && this._aggregateTransform.preMultiplyWith(this._parentModel.getAggregateTransform()), 9219 !this._aggregateTransform.equals(e)) { 9220 for (let t of this._childModels) 9221 t.transformUpdated(); 9222 this.applyTransformToElement() 9223 } 9224 } 9225 applyTransformToElement() {} 9226 getTransformedBounds(e) { 9227 let t = this.getBounds(); 9228 return t?.transform(e ?? this.getAggregateTransform()), 9229 t 9230 } 9231 getTransformedStrokeBounds(e) { 9232 let t = this.getTransformedBounds(e); 9233 if (this.strokePaint != null) { 9234 let n = this.strokeStyle.width; 9235 t.expand(n / 2) 9236 } 9237 return t 9238 } 9239 getPaths(e, t, n) { 9240 throw new Error("not implemented (" + this.getType() + ")") 9241 } 9242 getPathData(e, t, n) { 9243 throw new Error("not implemented (" + this.getType() + ")") 9244 } 9245 getOverlayPathInfo() { 9246 throw new Error("not implemented (" + this.getType() + ")") 9247 } 9248 getLabel() { 9249 return this._label 9250 } 9251 setLabel(e) { 9252 e !== this._label && (this._label = e, 9253 this.modelChanged()) 9254 } 9255 setOpacity(e) { 9256 e = Je(e, 3), 9257 this._opacity !== e && (this._opacity = e, 9258 e === 1 ? this.baseElement.removeAttribute("opacity") : this.baseElement.setAttribute("opacity", e), 9259 this.modelChanged()) 9260 } 9261 getOpacity() { 9262 return this._opacity 9263 } 9264 setBlur(e) { 9265 e = Je(e, 3), 9266 this._blur !== e && (this._blur = e, 9267 e === 0 ? this.baseElement.style.removeProperty("filter") : this.baseElement.style.setProperty("filter", "blur(" + e + "px)"), 9268 this.modelChanged()) 9269 } 9270 getBlur() { 9271 return this._blur 9272 } 9273 setHidden(e) { 9274 this._hidden = e, 9275 e ? this.baseElement.setAttribute("visibility", "hidden") : this.baseElement.removeAttribute("visibility") 9276 } 9277 isHidden() { 9278 return this._hidden 9279 } 9280 isInHidden() { 9281 let e = !1 9282 , t = this.getParentModel(); 9283 for (; t != null && t instanceof Nt; ) { 9284 if (t.isHidden()) { 9285 e = !0; 9286 break 9287 } 9288 t = t.getParentModel() 9289 } 9290 return e 9291 } 9292 setLocked(e) { 9293 this._locked = e 9294 } 9295 isLocked() { 9296 return this._locked 9297 } 9298 isInLocked() { 9299 let e = !1 9300 , t = this.getParentModel(); 9301 for (; t != null && t instanceof Nt; ) { 9302 if (t.isLocked()) { 9303 e = !0; 9304 break 9305 } 9306 t = t.getParentModel() 9307 } 9308 return e 9309 } 9310 setBlendMode(e) { 9311 ["multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"].includes(e) ? (this.baseElement.style.setProperty("mix-blend-mode", e), 9312 this._blendMode = e) : (this.baseElement.style.removeProperty("mix-blend-mode"), 9313 this._blendMode = "normal") 9314 }
9315 getBlendMode() { 9316 return this._blendMode 9317 } 9318 setFillPaint(e) { 9319 this.setPaint(e, "fill") 9320 } 9321 getFillPaint() { 9322 return this.fillPaint 9323 } 9324 _getFillElement() { 9325 return this.baseElement 9326 } 9327 getStrokePaint() { 9328 return this.strokePaint 9329 } 9330 setStrokePaint(e) { 9331 this.setPaint(e, "stroke") 9332 } 9333 getPaint(e) { 9334 return e === "fill" ? this.getFillPaint() : this.getStrokePaint() 9335 } 9336 setPaint(e, t, n=!1) { 9337 let s = this.getPaint(t); 9338 if (e === s) 9339 return; 9340 s != null && s.isTransformable() && this.unregisterPaint(s), 9341 t === "fill" ? this.fillPaint = e : (this.strokePaint = e, 9342 (e == null || s == null) && this.setStrokeStyle(this.strokeStyle)); 9343 let o = e && e.type, i; 9344 o == null ? i = t === "fill" ? "none" : null : (o === Sl || o === il || (this.registerPaint(e), 9345 n || (e.setElementModel(this), 9346 this.applyTransformToElement())), 9347 i = e.toCssValue()); 9348 let r = t === "stroke" ? this._getStrokeElement() : this._getFillElement(); 9349 r != null && (i ? r.style.setProperty(t, i) : r.style.removeProperty(t)), 9350 this.modelChanged() 9351 } 9352 updatePaintStyle(e, t) { 9353 let n = [e ? "fill" : null, t ? "stroke" : null]; 9354 for (let s of n) 9355 if (s) { 9356 let o = this.getPaint(s), i = o && o.type, r; 9357 i == null ? r = s === "fill" ? "none" : null : r = o.toCssValue(); 9358 let a = s === "stroke" ? this._getStrokeElement() : this._getFillElement(); 9359 a != null && (r ? a.style.setProperty(s, r) : a.style.removeProperty(s)) 9360 } 9361 this.modelChanged() 9362 } 9363 setStrokeStyle(e) { 9364 this.strokeStyle.set(e); 9365 let t = this._getStrokeElement(); 9366 if (t) 9367 if (this.strokePaint == null) 9368 t.removeAttribute(Hh), 9369 t.removeAttribute($h), 9370 t.removeAttribute(Xh), 9371 t.removeAttribute(ji), 9372 t.removeAttribute(Va), 9373 t.removeAttribute(Ji); 9374 else { 9375 let n = (o,i,r)=>{ 9376 i === r ? t.removeAttribute(o) : t.setAttribute(o, i) 9377 } 9378 ; 9379 t.setAttribute(Hh, e.width), 9380 n($h, e.linecap, "butt"); 9381 let s = e.linejoin; 9382 n(Xh, s, "miter"), 9383 (s === "miter" || s === "miter-clip") && ji != null ? n(ji, e.miterlimit) : t.removeAttribute(ji), 9384 e.dasharray != null && e.dasharray !== "" ? (t.setAttribute(Va, e.calcDasharray), 9385 e.dashoffset != null && e.dashoffset !== "" ? t.setAttribute(Ji, e.getCalcDashoffset()) : t.removeAttribute(Ji)) : (t.removeAttribute(Va), 9386 t.removeAttribute(Ji)) 9387 } 9388 this.modelChanged() 9389 } 9390 getStrokeStyle() { 9391 return this.strokeStyle 9392 } 9393 _getStrokeElement() { 9394 return this.baseElement 9395 } 9396 registerPaint(e) { 9397 let t = this._documentModel; 9398 t != null && e != null && e.isTransformable() && t.addDefsEntry(e.paintModelOrColor) 9399 } 9400 unregisterPaint(e) { 9401 this._documentModel != null && e != null && e.isTransformable() && this._documentModel.deleteDefsEntry(e.paintModelOrColor) 9402 } 9403 getDefsModels(e=!0, t=null) { 9404 t == null && (t = new Set); 9405 let n = this.fillPaint 9406 , s = n && n.paintModelOrColor instanceof cr ? n.paintModelOrColor : null 9407 , o = this.strokePaint 9408 , i = o && o.paintModelOrColor instanceof cr ? o.paintModelOrColor : null; 9409 return s && t.add(s), 9410 i && t.add(i), 9411 e && this._childModels.forEach(r=>r.getDefsModels(e, t)), 9412 t 9413 } 9414 toJSON() { 9415 return Object.assign(super.toJSON(), { 9416 fill: this.fillPaint, 9417 stroke: this.strokePaint, 9418 strokeStyle: this.strokeStyle, 9419 transform: this.getSelfTransform(), 9420 opacity: this._opacity, 9421 blur: this._blur, 9422 blendMode: this._blendMode, 9423 hidden: this._hidden 9424 }) 9425 } 9426 setJSON(e) { 9427 super.setJSON(e), 9428 this.setSelfTransform(oe.fromJSON(e.transform)), 9429 this.setPaint(et.fromJSON(e.fill), "fill", !0), 9430 this.setPaint(et.fromJSON(e.stroke), "stroke", !0), 9431 this.setStrokeStyle(Qt.fromJSON(e.strokeStyle)), 9432 this.setOpacity(e.opacity || 1), 9433 this.setBlur(e.blur || 0), 9434 this.setBlendMode(e.blendMode || "normal"), 9435 this.setHidden(e.hidden || !1) 9436 } 9437} 9438function Qm(l, e, t, n, s, o=Ul, i=64) { 9439 n ??= l(e), 9440 s ??= l(t); 9441 let r = 0; 9442 for (let a = 0; a < i; a++) { 9443 r = (e * s - t * n) / (s - n), 9444 (r <= Math.min(e, t) || r >= Math.max(e, t)) && (r = e + (t - e) / 2); 9445 let d = l(r);
9446 if (ee(d) <= Ul || ee(t - e) <= o) 9447 break; 9448 s * d < 0 ? (e = t, 9449 n = s) : n *= s / (s + d), 9450 t = r, 9451 s = d 9452 } 9453 return r 9454} 9455function af(l, e, t, n=Ul, s=32) { 9456 let o = l(t) 9457 , i = ee(o) 9458 , r = t 9459 , a = i; 9460 for (let d = 0; d < s; d++) { 9461 let u = e(t); 9462 if (u === 0 || (t -= o / u, 9463 o = l(t), 9464 i = ee(o), 9465 i < a && (r = t, 9466 a = i, 9467 a < n))) 9468 break 9469 } 9470 return r 9471} 9472function Hs(l, e, t, n, s, o=-fl, i=fl, r=!0) { 9473 let a = o > -fl || i < fl 9474 , d = 0 9475 , u = 0 9476 , h = 0; 9477 if (l === 0) { 9478 if (e === 0) 9479 return 0; 9480 { 9481 let c = -t / e; 9482 return !a || c >= o && c <= i ? (n[0] = c, 9483 s && (s[0] = 0), 9484 1) : 0 9485 } 9486 } else { 9487 const c = e / 2 9488 , f = c * c - l * t; 9489 if (f >= 0) { 9490 d = 2; 9491 const p = lt(f); 9492 if (c === 0) 9493 u = p / l, 9494 h = u === 0 ? 0 : -u; 9495 else if (c > 0) { 9496 let y = c + p; 9497 u = -t / y, 9498 h = -y / l 9499 } else { 9500 let y = -c + p; 9501 u = y / l, 9502 h = t / y 9503 } 9504 if (l > 0) { 9505 let y = u; 9506 u = h, 9507 h = y 9508 } 9509 let g = 0; 9510 for (let y = 0, m = u; y < d; y++, 9511 m = h) { 9512 if (r) { 9513 let b = (l * m + e) * m + t; 9514 if (b !== 0) { 9515 let M = 2 * l * m + e 9516 , S = m - b / M 9517 , x = (l * h + e) * h + t; 9518 ee(x) < ee(b) && (m = S) 9519 } 9520 } 9521 (!a || m >= o && m <= i) && (n[g] = m, 9522 g++) 9523 } 9524 return g 9525 } else { 9526 if (s != null) { 9527 const p = -e / (2 * l); 9528 if (!a || p >= o && p <= i) { 9529 const g = lt(-f) / l; 9530 return n[0] = p, 9531 n[1] = p, 9532 s[0] = g, 9533 s[1] = -g, 9534 2 9535 } 9536 } 9537 return 0 9538 } 9539 } 9540} 9541function us(l, e, t, n, s, o, i=-fl, r=fl, a=!0) { 9542 if (l === 0) 9543 return Hs(e, t, n, s, o, i, r, a); 9544 { 9545 const d = 1.7320508075688772 9546 , u = i > -fl || r < fl; 9547 let h = 0; 9548 const c = l 9549 , f = e / 3 9550 , p = t / 3 9551 , g = n; 9552 let y = c * p - f * f 9553 , m = c * g - f * p 9554 , b = f * g - p * p 9555 , M = 4 * y * b - m * m; 9556 if (M < 0) { 9557 let S = f * f * f * g < c * p * p * p, x, P, C, T, k; 9558 const D = ()=>{ 9559 S ? (x = g, 9560 P = b, 9561 C = -g * m + 2 * p * b) : (x = c, 9562 P = y, 9563 C = -2 * f * y + c * m); 9564 let Y = (C < 0 ? 1 : -1) * ee(x) * lt(-M) 9565 , q = -C + Y; 9566 T = Tm(q / 2), 9567 k = q === Y ? -T : -P / T 9568 } 9569 ; 9570 D(); 9571 let I = P > 0 ? -C / (T * T + k * k + P) : T + k 9572 , F = S ? -g / (I + p) : (I - f) / c; 9573 if ((!u || (o == null ? F >= i - 1e-8 && F <= r + 1e-8 : F >= i && F <= r)) && (s[0] = F, 9574 o != null && (o[0] = 0), 9575 h = 1), 9576 o != null) { 9577 o[0] = 0, 9578 S = !S, 9579 D(); 9580 let Y = -(T + k) / 2 9581 , q = d / 2 * (T - k) 9582 , re = S ? -g * (Y + p) / ((Y + p) ** 2 + q ** 2) : (Y - f) / c 9583 , ne = S ? -(q * g) / ((Y + p) ** 2 + q ** 2) : q / c; 9584 (!u || re >= i && re <= r) && (s[h] = re, 9585 o[h++] = ne, 9586 s[h] = re, 9587 o[h++] = -ne) 9588 } 9589 } else if (M >= 0) { 9590 let S = lt(M); 9591 y > 0 && (y = 0), 9592 b > 0 && (b = 0); 9593 let x = ee(nn(c * S, 2 * f * y - c * m)) / 3 9594 , P = lt(-y) 9595 , C = jt(x) 9596 , T = 2 * P * C 9597 , k = P * (-C - d * cl(x)) 9598 , D = (T + k > 2 * f ? T : k) - f 9599 , I = D / c 9600 , F = ee(nn(g * S, g * m - 2 * p * b)) / 3 9601 , Y = lt(-b) 9602 , q = jt(F) 9603 , re = 2 * Y * q 9604 , ne = Y * (-q - d * cl(F)) 9605 , te = -g 9606 , he = (re + ne < 2 * p ? re : ne) + p; 9607 if (he !== 0 || te === 0) { 9608 let Me = te === 0 ? 0 : te / he
9609 , De = D === 0 ? 0 : he / D; 9610 if (De < Me) { 9611 let ye = De; 9612 De = Me, 9613 Me = ye 9614 } 9615 if (I < De) 9616 if (I < Me) { 9617 let ye = I; 9618 I = De, 9619 De = Me, 9620 Me = ye 9621 } else { 9622 let ye = I; 9623 I = De, 9624 De = ye 9625 } 9626 if (u) { 9627 let ye = i - 1e-8 9628 , _e = r + 1e-8; 9629 Me >= ye && Me <= _e && (s[h++] = Me), 9630 De >= ye && De <= _e && (s[h++] = De), 9631 I >= ye && I <= _e && (s[h++] = I) 9632 } else 9633 s[h++] = Me, 9634 s[h++] = De, 9635 s[h++] = I 9636 } 9637 } else 9638 return 0; 9639 for (let S = h - 1; S >= 0; S--) { 9640 if (a && o == null) { 9641 let x = s[S] 9642 , P = ((l * x + e) * x + t) * x + n; 9643 if (P !== 0) { 9644 let C = (3 * l * x + 2 * e) * x + t 9645 , T = x - P / C 9646 , k = ((l * T + e) * T + t) * T + n; 9647 ee(k) < ee(P) && (s[S] = T, 9648 x = T) 9649 } 9650 } 9651 u && (s[S] < i || s[S] > r) && (S === 0 ? s.shift() : (S === 1 && h === 3 && (s[1] = s[2]), 9652 s.pop()), 9653 h--) 9654 } 9655 return h 9656 } 9657} 9658const $n = [[1]] 9659 , Yh = []; 9660function df(l, e) { 9661 if (e) { 9662 if (Yh[l] == null) { 9663 df(l, !1); 9664 let t = [] 9665 , n = $n[l]; 9666 for (let s = 0; s <= l; s++) { 9667 let o = Float64Array.from($n[s]); 9668 for (let i = 1; i <= s; i++) 9669 o[i] /= n[i]; 9670 t.push(o) 9671 } 9672 Yh[l] = t 9673 } 9674 } else if ($n.length < l + 1) { 9675 let t = Array.from($n[$n.length - 1]); 9676 for (let n = $n.length; n <= l; n++) { 9677 let s, o = 1; 9678 for (let i = 1; i < n; i++) 9679 s = o, 9680 o = t[i], 9681 t[i] = s + o; 9682 t.push(1), 9683 $n[n] = Uint32Array.from(t) 9684 } 9685 } 9686} 9687function Jd(l) { 9688 let e = l.length - 1; 9689 df(e, !0); 9690 let t = Yh[e]; 9691 for (let n = e; n >= 0; n--) { 9692 let s = t[n] 9693 , o = l[0]; 9694 for (let i = 1; i <= n; i++) 9695 o += l[i] * s[i]; 9696 l[n] = o 9697 } 9698 return l 9699} 9700function En(l, e) { 9701 if (e === 0) 9702 return l[0]; 9703 { 9704 let t = l.length - 1; 9705 if (e === 1) 9706 return l[t]; 9707 { 9708 let n = $n[t] 9709 , s = 1 - e 9710 , o = 1 9711 , i = l[0]; 9712 for (let r = 1; r <= t; r++) 9713 o *= e, 9714 i = i * s + l[r] * n[r] * o; 9715 return i 9716 } 9717 } 9718} 9719function fr(l) { 9720 let e = l.length - 1 9721 , t = l.slice(0, e); 9722 for (let n = 0; n < e; n++) 9723 t[n] = e * (l[n + 1] - l[n]); 9724 return t 9725} 9726function ww(l, e) { 9727 let t = l.length - 1 9728 , n = $n[t - 1] 9729 , s = 1 - e 9730 , o = 1 9731 , i = l[1] - l[0]; 9732 for (let r = 1; r < t; r++) 9733 o *= e, 9734 i = i * s + (l[r + 1] - l[r]) * n[r] * o; 9735 return i *= t, 9736 i 9737} 9738function ao(l, e, t) { 9739 const n = Ul 9740 , s = 128; 9741 let o = En(l, e) 9742 , i = En(l, t) 9743 , r = 0; 9744 for (let a = 0; a < s && (r = (e * i - t * o) / (i - o), 9745 (r >= e && r >= t || r <= e && r <= t) && (r = e + (t - e) / 2), 9746 !(Math.abs(t - e) <= n)); a++) { 9747 let d = En(l, r); 9748 if (d === 0) 9749 return r; 9750 i * d > 0 ? o *= i / (i + d) : (e = t, 9751 o = i), 9752 t = r, 9753 i = d 9754 } 9755 return r 9756} 9757function e2(l, e, t) { 9758 let n = l.length - 1 9759 , s = 1 - e; 9760 for (let o = 0; o < n; o++) 9761 for (let i = n; i > o; i--) 9762 l[i] = l[i - 1] * s + l[i] * e; 9763 return l 9764} 9765function t2(l, e, t) { 9766 let n = l.length - 1 9767 , s = 1 - e; 9768 for (let o = n; o > 0; o--) 9769 for (let i = 0; i < o; i++) 9770 l[i] = l[i] * s + l[i + 1] * e; 9771 return l 9772} 9773function Pw(l, e) { 9774 let t = l.length - 1; 9775 l = fr(l); 9776 let n, s = r=>En(l, r), o = r=>En(n, r), i = 1; 9777 for (; ee(s(e)) < .001 && i < t; ) 9778 i++, 9779 n = fr(l), 9780 e = af(s, o, e), 9781 l = n; 9782 return i 9783} 9784function dp(l) { 9785 let e = l.length - 1 9786 , t = l[e] < 0 9787 , n = !1; 9788 for (; --e >= 0; ) 9789 if (t !== l[e] < 0) { 9790 if (n) 9791 return !1; 9792 n = !0, 9793 t = !t 9794 } 9795 return n 9796} 9797function xw(l, e) { 9798 let t = l.length - 1; 9799 if (e < .5) { 9800 let n = e / (1 - e); 9801 for (let s = t - 1; s >= 1; s--) 9802 l[s] = (t * l[s] + (t - s) * l[s + 1] * n) / s; 9803 l.shift() 9804 } else { 9805 let n = (1 - e) / e; 9806 for (let s = 1; s < t; s++) 9807 l[s] = (t * l[s] + s * l[s - 1] * n) / (t - s); 9808 l.pop() 9809 } 9810} 9811function Kh(l, e) { 9812 let s = af(o=>En(l, o), o=>ww(l, o), e, 1e-64, 128); 9813 return ee(s - e) > 1e-8 && (s = e), 9814 xw(l, s), 9815 s 9816} 9817function qr(l, e=1e-14) { 9818 l = l.slice(); 9819 let t = l.length - 1; 9820 df(t, !1); 9821 let n = 0; 9822 for (let i = 0; i <= t; i++) 9823 n = Ee(ee(l[i]), n); 9824 if (n === 0) 9825 return []; 9826 for (let i = 0; i <= t; i++) 9827 l[i] /= n; 9828 let s = []; 9829 for (; ee(l[0]) <= e && t > 0; ) { 9830 let i = Ee(0, Kh(l, 0)); 9831 t--, 9832 s.find(r=>r[0] === i) || s.push([i, 0]) 9833 } 9834 let o = !1; 9835 for (; ee(l[t]) <= e && t > 0; ) { 9836 let i = He(1, Kh(l, 1)); 9837 t--, 9838 s.find(r=>r[0] === i) || s.push([i, 0]), 9839 o = !0 9840 } 9841 Cw(l, s), 9842 o && s.sort((i,r)=>i[0] - r[0]); 9843 for (let i of s) 9844 i[1] === 0 && (i[1] = Pw(l, i[0])); 9845 return s 9846} 9847function Cw(l, e) { 9848 let t = 0 9849 , n = 1 9850 , s = l.slice() 9851 , o = s.length - 1 9852 , i = 0; 9853 const r = 1e-13; 9854 do { 9855 let a = 0 9856 , d = 0 9857 , u = 0; 9858 for (let c = 1, f = s[0] < 0; c <= o; c++) 9859 if (f !== s[c] < 0) { 9860 if (a++, 9861 a === 1) 9862 d = c; 9863 else if (a === 2) 9864 u = c; 9865 else if (a > 3) 9866 break; 9867 f = !f 9868 } 9869 let h = !1; 9870 if (a === 0) 9871 h = !0; 9872 else if (a === 1) { 9873 let c = ao(l, t, n); 9874 e.push([c, 1]), 9875 h = !0 9876 } else { 9877 if (a === 2) { 9878 let c = fr(s); 9879 if (dp(c)) { 9880 let f = ao(c, 0, 1) 9881 , p = En(s, f);
9882 if (p * s[0] < 0 && p * s[o] < 0) { 9883 let g = t + (n - t) * ao(s, 0, f); 9884 e.push([g, 1]); 9885 let y = t + (n - t) * ao(s, f, 1); 9886 e.push([y, 1]), 9887 h = !0 9888 } else 9889 ee(p) < 1e-12 && (e.push([t + f * (n - t), 2]), 9890 h = !0) 9891 } 9892 } else if (a === 3) { 9893 let c = fr(s) 9894 , f = fr(c); 9895 if (dp(f)) { 9896 let p = ao(s, 0, 1) 9897 , g = En(c, p); 9898 if (ee(g) < 1e-7) { 9899 let y = En(s, p); 9900 ee(y) < r && (e.push([t + p * (n - t), 3]), 9901 h = !0) 9902 } 9903 } 9904 } 9905 if (!h) 9906 if (i >= 32) 9907 h = !0; 9908 else { 9909 let c = (d - s[d] / (s[d] - s[d - 1]) + u - s[u] / (s[u] - s[u - 1])) / (2 * o); 9910 if (isNaN(c) && (c = .5), 9911 a === 2 && s[0] * En(s, c) < 0) { 9912 let f = ao(s, 0, c); 9913 e.push([t + f * (n - t), 1]); 9914 let p = ao(s, c, 1); 9915 e.push([t + p * (n - t), 1]), 9916 h = !0 9917 } else if (ee(s.at(-1)) <= r) { 9918 let f = Kh(s, c); 9919 e.push([t + f * (n - t), 0]), 9920 o--, 9921 i = 0 9922 } else 9923 s = e2(s, c), 9924 n = t + c * (n - t), 9925 i++ 9926 } 9927 } 9928 h && (t = n, 9929 t < 1 && (n = 1, 9930 s.splice(0, s.length, ...l), 9931 s = t2(s, t), 9932 s.length - 1, 9933 i = 0)) 9934 } while (t < 1) 9935} 9936const up = []; 9937function Zd(l) { 9938 let e = up[l]; 9939 if (e == null) { 9940 const n = new Float64Array(l) 9941 , s = new Float64Array(l); 9942 for (let o = 0, i = l - 1, r = km(l / 2); o < r; o++, 9943 i--) { 9944 let a = jt(tt * (o + .75) / (l + .5)), d, u; 9945 do { 9946 let h = 1 9947 , c = 0; 9948 for (let f = 0; f < l; f++) { 9949 let p = c; 9950 c = h, 9951 h = ((2 * f + 1) * a * c - f * p) / (f + 1) 9952 } 9953 u = l * (c - a * h) / (1 - a * a), 9954 d = a, 9955 a = d - h / u 9956 } while (ee(a - d) > 1e-14); 9957 n[o] = a, 9958 n[i] = -a, 9959 s[o] = s[i] = 2 / ((1 - a * a) * u * u) 9960 } 9961 e = [n, s], 9962 up[l] = e 9963 } 9964 return e 9965} 9966function _w(l, e=16, ...t) { 9967 const n = [] 9968 , [s,o] = Zd(e); 9969 let i = t.length; 9970 i <= 1 && (i === 0 ? t.push(0, 1) : t.push(1), 9971 i = 2); 9972 let r = 0 9973 , a = t[0]; 9974 for (let d = 1; d < i; d++) { 9975 r = a, 9976 a = t[d]; 9977 let u = 0 9978 , h = (a - r) / 2; 9979 for (let c = 0; c < e; c++) { 9980 let f = h * (s[c] + 1) + r; 9981 u += o[c] * l(f) 9982 } 9983 u *= h, 9984 n.push(u) 9985 } 9986 return n 9987} 9988function Ae(l) { 9989 return l[2] === l[0] && l[3] === l[1] && l[4] === l[6] && l[5] === l[7] 9990} 9991function wi(l, e, t, n, s, o, i, r, a) { 9992 return l[0] = e, 9993 l[1] = t, 9994 l[2] = n, 9995 l[3] = s, 9996 l[4] = o, 9997 l[5] = i, 9998 l[6] = r, 9999 l[7] = a, 10000 l 10001} 10002function Na(l, e, t, n) { 10003 l[2] = l[2] === l[0] ? e : l[2] + (e - l[0]), 10004 l[3] = l[3] === l[1] ? t : l[3] + (t - l[1]), 10005 l[0] = e, 10006 l[1] = t 10007} 10008function l2(l, e, t, n) { 10009 l[4] = l[4] === l[6] ? e : l[4] + (e - l[6]), 10010 l[5] = l[5] === l[7] ? t : l[5] + (t - l[7]), 10011 l[6] = e, 10012 l[7] = t 10013} 10014function No(l, e=!1) { 10015 return e ? wi(l, l[6], l[7], l[4], l[5], l[2], l[3], l[0], l[1]) : [l[6], l[7], l[4], l[5], l[2], l[3], l[0], l[1]] 10016} 10017function Tw(l, e, t=0, n=0) { 10018 let s = cl(e) 10019 , o = jt(e); 10020 for (let i = 0; i < 8; i += 2) { 10021 let r = l[i] - t 10022 , a = l[i + 1] - n; 10023 l[i] = r * o - a * s + t, 10024 l[i + 1] = r * s + a * o + n 10025 } 10026 return l 10027} 10028function n2(l, e, t) { 10029 for (let n = 0; n < 8; n += 2) 10030 l[n] += e, 10031 l[n + 1] += t; 10032 return l 10033} 10034function It(l, e=0) { 10035 let[t,n,s,o,i,r,a,d] = l; 10036 return e === 0 ? [a - 3 * (i - s) - t, d - 3 * (r - o) - n, 3 * (i - 2 * s + t), 3 * (r - 2 * o + n), 3 * (s - t), 3 * (o - n), t, n] : e === 1 ? [3 * (a - t - 3 * (i - s)), 3 * (d - n - 3 * (r - o)), 6 * (i - 2 * s + t), 6 * (r - 2 * o + n), 3 * (s - t), 3 * (o - n)] : e === 2 ? [6 * (a - 3 * (i - s) - t), 6 * (d - 3 * (r - o) - n), 6 * (i - 2 * s + t), 6 * (r - 2 * o + n)] : e === 3 ? [6 * (a - 3 * (i - s) - t), 6 * (d - 3 * (r - o) - n)] : [] 10037} 10038function ze(l, e, t) { 10039 let n, s; 10040 if (e === 0) 10041 n = l[0], 10042 s = l[1]; 10043 else if (e === 1) 10044 n = l[6], 10045 s = l[7]; 10046 else if (Ae(l)) { 10047 let o = 1 - e; 10048 n = o * l[0] + e * l[6], 10049 s = o * l[1] + e * l[7] 10050 } else { 10051 let o = e * e 10052 , i = e * o 10053 , r = 1 - e; 10054 n = r * (r * (r * l[0] + 3 * e * l[2]) + 3 * o * l[4]) + i * l[6], 10055 s = r * (r * (r * l[1] + 3 * e * l[3]) + 3 * o * l[5]) + i * l[7] 10056 } 10057 return t == null ? new B(n,s) : (t.set(n, s), 10058 t) 10059} 10060function Hl(l, e, t) { 10061 if (e === 0) 10062 return l[t]; 10063 if (e === 1) 10064 return l[t + 6]; 10065 if (Ae(l)) 10066 return (1 - e) * l[t] + e * l[t + 6]; 10067 { 10068 let n = e * e 10069 , s = 1 - e; 10070 return s * (s * (s * l[t] + 3 * e * l[t + 2]) + 3 * n * l[t + 4]) + e * n * l[t + 6] 10071 } 10072} 10073function Te(l, e, t=null, n=null) { 10074 let s, o; 10075 if (Ae(l)) 10076 s = l[6] - l[0], 10077 o = l[7] - l[1]; 10078 else { 10079 let[i,r,a,d,u,h,c,f] = l; 10080 if (t != null && i === a && r === d) 10081 if (i === u && r === h) 10082 s = c - i, 10083 o = f - r; 10084 else { 10085 let p = 1 - e; 10086 s = 2 * p * (u - a) + e * (c - u), 10087 o = 2 * p * (h - d) + e * (f - h) 10088 } 10089 else if (t != null && u === c && h === f) 10090 if (a === c && d === f) 10091 s = c - i, 10092 o = f - r; 10093 else { 10094 let p = 1 - e; 10095 s = (a - i) * p + 2 * e * (u - a), 10096 o = (d - r) * p + 2 * e * (h - d) 10097 } 10098 else if (e === 0) 10099 s = 3 * (a - i), 10100 o = 3 * (d - r); 10101 else if (e === 1) 10102 s = 3 * (c - u), 10103 o = 3 * (f - h); 10104 else { 10105 let p = 1 - e 10106 , g = e ** 2; 10107 s = 3 * (((a - i) * p + 2 * e * (u - a)) * p + g * (c - u)), 10108 o = 3 * (((d - r) * p + 2 * e * (h - d)) * p + g * (f - h)) 10109 } 10110 } 10111 if (t != null && (s !== 0 || o !== 0)) { 10112 let i = t / Se(s, o); 10113 s *= i, 10114 o *= i 10115 } 10116 return n != null ? (n.set(s, o), 10117 n) : new B(s,o) 10118} 10119function Ro(l, e, t=-1, n) { 10120 let s = Te(l, e, t, n); 10121 return s.set(s.y, -s.x), 10122 s 10123} 10124function je(l, e, t, n) { 10125 let s = ze(l, e, n) 10126 , o = s.x 10127 , i = s.y; 10128 return s = Ro(l, e, t, s), 10129 s.x += o, 10130 s.y += i, 10131 s 10132} 10133function Wh(l, e) { 10134 if (Ae(l)) 10135 return 0; 10136 { 10137 let t, n, s; 10138 if (e === 0) 10139 t = 3 * (l[2] - l[0]), 10140 n = 3 * (l[3] - l[1]), 10141 s = 18 * (l[0] * (l[3] - l[5]) + l[2] * (l[5] - l[1]) + l[4] * (l[1] - l[3])); 10142 else if (e === 1) 10143 t = 3 * (l[6] - l[4]), 10144 n = 3 * (l[7] - l[5]), 10145 s = 18 * (l[2] * (l[5] - l[7]) + l[4] * (l[7] - l[3]) + l[6] * (l[3] - l[5])); 10146 else { 10147 let a = It(l, 1) 10148 , d = a[0] * e 10149 , u = a[1] * e; 10150 t = (d + a[2]) * e + a[4], 10151 n = (u + a[3]) * e + a[5]; 10152 let h = 2 * d + a[2] 10153 , c = 2 * u + a[3]; 10154 s = t * c - n * h 10155 } 10156 let o = t * t + n * n, i = o * lt(o), r; 10157 return i === 0 ? r = s > 0 ? Number.POSITIVE_INFINITY : s < 0 ? Number.NEGATIVE_INFINITY : 0 : r = s / i, 10158 r 10159 } 10160} 10161function Nl(l, e) { 10162 return -1 / Wh(l, e) 10163} 10164function kw(l, e) { 10165 if (Ae(l)) 10166 return 0; 10167 { 10168 let[t,n,s,o,i,r] = It(l, 1) 10169 , a = ((n * s - t * o) * e + 2 * (n * i - t * r)) * e + o * i - s * r; 10170 return Do(a) 10171 } 10172} 10173function Ew(l, e, t=0, n=1, s=!1) { 10174 if (e.y === 0 && e.x === 0) 10175 return []; 10176 let o = ee(e.y) > ee(e.x), i = o ? e.x / e.y : e.y / e.x, r, a, d; 10177 const [u,h,c,f,p,g] = It(l, 1); 10178 o ? (r = u - i * h, 10179 a = c - i * f, 10180 d = p - i * g) : (r = h - i * u, 10181 a = f - i * c, 10182 d = g - i * p); 10183 const y = 1e-10; 10184 let m = [];
10185 Hs(r, a, d, m, null, t - y, n + y); 10186 for (let b = m.length - 1; b >= 0; b--) { 10187 let M = m[b]; 10188 M < t ? (m[b] = t, 10189 M = t) : M > n && (m[b] = n, 10190 M = n), 10191 s || (o ? ((h * M + f) * M + g) * e.y < 0 : ((u * M + c) * M + p) * e.x < 0) && (b === 0 ? m.shift() : m.pop()) 10192 } 10193 return m.length === 2 && m[0] === m[1] && m.pop(), 10194 m 10195} 10196function uf(l, e=0, t=1, n=!1) { 10197 let s = []; 10198 if (!Ae(l)) { 10199 let[o,i,r,a,d,u] = It(l, 1); 10200 Hs(r * i - a * o, 2 * (d * i - u * o), d * a - u * r, s, null, e, t), 10201 !n && s.length > 0 && (s[0] === e && s.shift(), 10202 s[s.length - 1] === t && s.pop()) 10203 } 10204 return s 10205} 10206function Dw(l, e=0) { 10207 if (Ae(l)) 10208 return e === 0 ? (l[6] - l[0]) * (l[1] + l[7]) / 2 : (l[7] - l[1]) * (l[0] + l[6]) / 2; 10209 { 10210 let[t,n,s,o,i,r,a,d] = l; 10211 return e === 0 ? -(t * (10 * n + 6 * o + 3 * r + d) + s * (-6 * n + 3 * (r + d)) + i * (-3 * (n + o) + 6 * d) + a * (-3 * o - 6 * r - 10 * d - n)) / 20 : -(n * (10 * t + 6 * s + 3 * i + a) + o * (-6 * t + 3 * (i + a)) + r * (-3 * (t + s) + 6 * a) + d * (-3 * s - 6 * i - 10 * a - t)) / 20 10212 } 10213} 10214function Ow(l) { 10215 if (Ae(l)) 10216 return (l[6] * l[1] - l[0] * l[7]) / 2; 10217 { 10218 let[e,t,n,s,o,i,r,a] = l; 10219 return (e * (-6 * s - 3 * i - a) + n * (6 * t - 3 * (i + a)) + o * (3 * (t + s) - 6 * a) + r * (t + 3 * s + 6 * i)) / 20 10220 } 10221} 10222function s2(l, e=0) { 10223 let t = 1 - e, n = l[e], s = l[e + 6], o = l[t], i = l[t + 6], r; 10224 if (Ae(l)) 10225 r = (n * (s * (o - i) - n * (2 * o + i)) + s * s * (o + 2 * i)) / 6; 10226 else { 10227 let a = l[e + 2] 10228 , d = l[e + 4] 10229 , u = l[t + 2] 10230 , h = l[t + 4]; 10231 r = (n * (n * (-280 * o - 105 * u - 30 * h - 5 * i) + a * (105 * o - 45 * (u + h) - 15 * i) + d * (30 * o - 18 * h - 12 * i) + s * (5 * (o - i) + 3 * (u - h))) + a * (a * (45 * o - 27 * h - 18 * i) + d * (45 * (o - i) + 27 * (u - h)) + s * (12 * o + 18 * u - 30 * i)) + d * (d * (18 * o + 27 * u - 45 * i) + s * (15 * o + 45 * (u + h) - 105 * i)) + s * (s * (5 * o + 30 * u + 105 * h + 280 * i))) / 840 10232 } 10233 return r 10234} 10235function gl(l, e) { 10236 e ??= [Number.MAX_VALUE, Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE]; 10237 for (let t = 0; t <= 1; t++) { 10238 let n = !1 10239 , s = e[t] 10240 , o = e[t + 2] 10241 , i = l[t] 10242 , r = l[t + 6]; 10243 i < r ? (i < s && (s = i, 10244 n = !0), 10245 r > o && (o = r, 10246 n = !0)) : (r < s && (s = r, 10247 n = !0), 10248 i > o && (o = i, 10249 n = !0)); 10250 let a = l[t + 2] 10251 , d = l[t + 4]; 10252 if (a < s || d < s || a > o || d > o) { 10253 let u = r - 3 * (d - a) - i 10254 , h = 3 * (d - 2 * a + i) 10255 , c = 3 * (a - i) 10256 , f = i 10257 , p = [] 10258 , g = Hs(3 * u, 2 * h, c, p, null, 0, 1, !0); 10259 for (let y = 0; y < g; y++) { 10260 let m = p[y] 10261 , b = ((u * m + h) * m + c) * m + f; 10262 b < s ? (s = b, 10263 n = !0) : b > o && (o = b, 10264 n = !0) 10265 } 10266 } 10267 n && (e[t] = s, 10268 e[t + 2] = o) 10269 } 10270 return e 10271} 10272function qh(l, e) { 10273 { 10274 let t = [] 10275 , n = []; 10276 if (Ae(l)) { 10277 let s = l[e] 10278 , o = l[e + 6]; 10279 s <= o ? (t = [0], 10280 n = [1]) : s >= o && (t = [1], 10281 n = [0]) 10282 } else { 10283 let s = l[e] 10284 , o = l[e + 2] 10285 , i = l[e + 4] 10286 , r = l[e + 6] 10287 , a = s 10288 , d = s; 10289 if (t = [0], 10290 n = [0], 10291 r < a ? (a = r, 10292 t[0] = 1) : r === a && t.push(1), 10293 r > d ? (d = r, 10294 n[0] = 1) : r === d && n.push(1), 10295 o < a || i < a || o > d || i > d) { 10296 let u = r - 3 * (i - o) - s 10297 , h = 3 * (i - 2 * o + s) 10298 , c = 3 * (o - s) 10299 , f = s 10300 , p = [] 10301 , g = Hs(3 * u, 2 * h, c, p, null, 0, 1); 10302 for (let y = 0; y < g; y++) { 10303 let m = p[y] 10304 , b = ((u * m + h) * m + c) * m + f; 10305 b <= a ? b < a ? (a = b, 10306 t.splice(0, t.length, m)) : t.push(m) : b >= d && (b > d ? (d = b, 10307 n.splice(0, n.length, m)) : n.push(m)) 10308 } 10309 } 10310 } 10311 return [t, n] 10312 } 10313} 10314function dn(l, e=.5, t=!1) { 10315 let n = t ? l : l.slice() 10316 , s = l.slice(); 10317 if (e === 0) 10318 n[2] = l[0], 10319 n[4] = l[0], 10320 n[6] = l[0], 10321 n[3] = l[1], 10322 n[5] = l[1], 10323 n[7] = l[1]; 10324 else if (e === 1) 10325 s[0] = l[6], 10326 s[2] = l[6], 10327 s[4] = l[6], 10328 s[1] = l[7], 10329 s[3] = l[7], 10330 s[5] = l[7]; 10331 else if (Ae(l)) { 10332 let o = 1 - e; 10333 for (let i = 0; i < 2; i++) { 10334 let r = l[i] 10335 , a = l[i + 6] 10336 , d = r === a ? r : o * r + e * a; 10337 n[i + 4] = d, 10338 n[i + 6] = d, 10339 s[i] = d, 10340 s[i + 2] = d 10341 } 10342 } else { 10343 let o = e * e 10344 , i = 1 - e; 10345 for (let r = 0; r < 2; r++) { 10346 let a = l[r] 10347 , d = l[r + 2] 10348 , u = l[r + 4] 10349 , h = l[r + 6] 10350 , c = a === d ? a : i * a + e * d 10351 , f = i * d + e * u
10352 , p = u === h ? h : i * u + e * h 10353 , g = i * c + e * f 10354 , y = i * f + e * p 10355 , m = i * (i * (i * a + 3 * e * d) + 3 * o * u) + e * o * h; 10356 n[r + 2] = c, 10357 n[r + 4] = g, 10358 n[r + 6] = m, 10359 s[r] = m, 10360 s[r + 2] = y, 10361 s[r + 4] = p 10362 } 10363 } 10364 return [n, s] 10365} 10366function Ln(l, e, t, n=!1) { 10367 if (e === 0 && t === 1) 10368 return n ? l : l.slice(); 10369 if (Ae(l)) { 10370 let s = 1 - e, o = 1 - t, i = s * l[0] + e * l[6], r = s * l[1] + e * l[7], a = o * l[0] + t * l[6], d = o * l[1] + t * l[7], u; 10371 return n ? u = wi(l, i, r, i, r, a, d, a, d) : u = [i, r, i, r, a, d, a, d], 10372 u 10373 } else { 10374 let s = n ? l : l.slice() 10375 , o = 1 - t 10376 , i = t * t; 10377 if (e === 0) 10378 for (let r = 0; r <= 1; r++) { 10379 let a = l[r] 10380 , d = l[r + 2] 10381 , u = l[r + 4] 10382 , h = l[r + 6] 10383 , c = o * (o * a + 2 * d * t) + u * i 10384 , f = o * (o * d + 2 * u * t) + h * i; 10385 s[r + 2] = a * o + d * t, 10386 s[r + 4] = c, 10387 s[r + 6] = c * o + f * t, 10388 s[r + 6] = o * (o * (o * a + 3 * t * d) + 3 * i * u) + t * i * h 10389 } 10390 else { 10391 let r = 1 - e 10392 , a = e * e; 10393 for (let d = 0; d <= 1; d++) { 10394 let u = l[d] 10395 , h = l[d + 2] 10396 , c = l[d + 4] 10397 , f = l[d + 6] 10398 , p = r * (r * u + 2 * h * e) + c * a 10399 , g = r * (r * h + 2 * c * e) + f * a 10400 , y = o * (o * u + 2 * h * t) + c * i 10401 , m = o * (o * h + 2 * c * t) + f * i; 10402 s[d] = r * (r * (r * u + 3 * e * h) + 3 * a * c) + e * a * f, 10403 s[d + 2] = p * o + g * t, 10404 s[d + 4] = y * r + m * e, 10405 s[d + 6] = o * (o * (o * u + 3 * t * h) + 3 * i * c) + t * i * f 10406 } 10407 } 10408 return s 10409 } 10410} 10411function Or(l, e=!1, t=!1) { 10412 if (Ae(l)) 10413 return []; 10414 const [n,s,o,i,r,a] = It(l, 1) 10415 , d = o * s - i * n 10416 , u = r * s - a * n 10417 , h = r * i - a * o 10418 , c = n * n + s * s 10419 , f = n * o + s * i 10420 , p = n * r + s * a 10421 , g = o * o + i * i 10422 , y = o * r + i * a 10423 , m = r * r + a * a 10424 , b = g + 2 * p 10425 , M = 3 * y * h - 2 * m * u 10426 , S = 3 * b * h + 2 * (y * u - m * d) 10427 , x = 9 * f * h + 4 * b * u - y * d 10428 , P = 6 * c * h + 14 * f * u + b * d 10429 , C = 10 * c * u + 5 * f * d 10430 , T = 4 * c * d; 10431 let k = Jd([M, S, x, P, C, T]) 10432 , D = qr(k); 10433 if (D.forEach((I,F)=>D[F] = I[0]), 10434 e || t) 10435 for (let I = D.length - 1; I >= 0; I--) { 10436 let F = D[I] 10437 , Y = -((d * F + 2 * u) * F + h) 10438 , q = (((5 * T * F + 4 * C) * F + 3 * P) * F + 2 * x) * F + S 10439 , re = Y * q; 10440 (re > 0 && e || re <= 0 && t) && D.splice(I, 1) 10441 } 10442 return D 10443} 10444function o2(l, e=0, t=1) { 10445 if (Ae(l)) 10446 return Se(l[6] - l[0], l[7] - l[1]); 10447 { 10448 let[n,s,o,i,r,a] = It(l, 1) 10449 , d = n * n + s * s 10450 , u = 2 * (n * o + s * i) 10451 , h = 2 * (n * r + s * a) + o * o + i * i 10452 , c = 2 * (o * r + i * a) 10453 , f = r * r + a * a 10454 , p = []; 10455 us(4 * d, 3 * u, 2 * h, c, p, null, e, t), 10456 p.unshift(e), 10457 p.push(t); 10458 let g = p.length <= 3 ? 24 : 16, y = Zd(g), m = y[0], b = y[1], M = 0, S, x = p[0]; 10459 for (let P = 0; P < p.length - 1; P++) { 10460 S = x, 10461 x = p[P + 1]; 10462 let C = (x - S) / 2 10463 , T = C + S 10464 , k = 0; 10465 for (let D = 0; D < g; D++) { 10466 let I = C * m[D] + T; 10467 k += b[D] * lt(Ee(0, (((d * I + u) * I + h) * I + c) * I + f)) 10468 } 10469 k *= C, 10470 M += k 10471 } 10472 return M 10473 } 10474} 10475function Aw(l, e, t) { 10476 if (Ae(l)) 10477 return e / Se(l[6] - l[0], l[7] - l[1]); 10478 let[n,s,o,i,r,a] = It(l, 1) 10479 , d = n * n + s * s 10480 , u = 2 * (n * o + s * i) 10481 , h = 2 * (n * r + s * a) + o * o + i * i 10482 , c = 2 * (o * r + i * a) 10483 , f = r * r + a * a 10484 , p = []; 10485 us(4 * d, 3 * u, 2 * h, c, p, null, 0, 1), 10486 p.unshift(0), 10487 p.push(1); 10488 let g = t && t.nPoints || 24 10489 , y = Zd(g) 10490 , m = y[0] 10491 , b = y[1]; 10492 function M(F, Y) { 10493 let q = (Y - F) / 2 10494 , re = (F + Y) / 2 10495 , ne = 0; 10496 for (let te = 0; te < g; te++) { 10497 let he = q * m[te] + re; 10498 ne += b[te] * lt(Ee((((d * he + u) * he + h) * he + c) * he + f)) 10499 } 10500 return ne *= q, 10501 ne 10502 } 10503 let S = e, x, P = p[0], C; 10504 for (let F = 0; F < p.length - 1 && (x = P, 10505 P = p[F + 1], 10506 C = M(x, P), 10507 C <= S); F++) 10508 S -= C; 10509 let T = t && t.tolerance || 1e-12, k = 0, D, I = (P + x) / 2; 10510 do 10511 if (k++, 10512 k < 16) { 10513 C = M(x, I); 10514 let F = C - S 10515 , Y = lt(Ee(0, (((d * I + u) * I + h) * I + c) * I + f)) 10516 , q = (((4 * d * I + 3 * u) * I + 2 * h) * I + c) / (2 * Y); 10517 D = I, 10518 I -= 2 * F * Y / (2 * Y * Y - F * q) 10519 } else { 10520 I = Qm(F=>S - M(x, F), x, P); 10521 break 10522 } 10523 while (ee(I - D) > T); 10524 return I 10525} 10526function hp(l) { 10527 return Se(l[6] - l[0], l[7] - l[1]) 10528} 10529function Vs(l) { 10530 return Se(l[2] - l[0], l[3] - l[1]) + Se(l[4] - l[2], l[5] - l[3]) + Se(l[6] - l[4], l[7] - l[5]) 10531} 10532function pr(l) { 10533 let e = Se(l[6] - l[0], l[7] - l[1]); 10534 if (Ae(l)) 10535 return e; 10536 { 10537 let t = Vs(l); 10538 return (e + t) / 2 10539 } 10540} 10541function Pl(l) { 10542 return l[0] === l[6] && l[0] === l[4] && l[0] === l[2] && l[1] === l[7] && l[1] === l[5] && l[1] === l[3] 10543} 10544function jn(l, e, t) { 10545 let n = l[e] 10546 , s = l[e + 6]; 10547 if (Ae(l)) { 10548 if (n === s) 10549 return n === t ? [0, 1] : []; 10550 let o; 10551 return n === t ? o = 0 : s === t ? o = 1 : t > n && t > s || t < n && t < s ? o = null : o = (t - n) / (s - n), 10552 o == null ? [] : [o] 10553 } else { 10554 let o = -1 10555 , i = -1; 10556 for (let f = e; f < 8; f += 2) { 10557 let p = l[f] - t; 10558 p <= 0 && (o = Ee(-p, o)), 10559 p >= 0 && (i = Ee(p, i)) 10560 } 10561 if (o < 0 || i < 0) 10562 return []; 10563 if (o === 0 && i === 0) 10564 return [0, 1]; 10565 let r = It(l, 0) 10566 , a = r[e] 10567 , d = r[e + 2] 10568 , u = r[e + 4] 10569 , h = r[e + 6] 10570 , c = []; 10571 if (us(a, d, u, h - t, c, null, 0, 1), 10572 n === t) { 10573 c[0] !== 0 && c.unshift(0); 10574 for (let f = 1; f < c.length && c[f] < 1e-7; f++) 10575 c[f] = 0, 10576 c.shift() 10577 } 10578 if (s === t) { 10579 c[c.length - 1] !== 1 && c.push(1); 10580 for (let f = c.length - 1; f >= 0 && c[f] > 1 - 1e-7; f--) 10581 c[f] = 1, 10582 c.pop() 10583 } 10584 return c 10585 } 10586} 10587function i2(l) { 10588 let[e,t,n,s,o,i,r,a] = l, d = o - n, u = i - s, h = n - e, c = s - t, f, p; 10589 if (d === 0) { 10590 if (!(h === 0 || u === 0)) { 10591 let g = r - e 10592 , y = a - t; 10593 p = g / h, 10594 f = (y - p * c) / u 10595 } 10596 } else { 10597 let g = d * c - u * h; 10598 if (g !== 0) { 10599 let y = r - e 10600 , m = a - t; 10601 p = (d * m - u * y) / g, 10602 f = (y - h * p) / d 10603 } 10604 } 10605 return f == null || p == null ? null : [f, p] 10606} 10607function cp(l, e, t) { 10608 let n = l.x 10609 , s = l.y 10610 , o = e.x 10611 , i = e.y 10612 , r = t.x 10613 , a = t.y 10614 , d = n - o 10615 , u = s - i 10616 , h = r - o 10617 , c = a - i 10618 , f = Se(d, u) 10619 , p = Se(h, c); 10620 if (f === 0 || p === 0) 10621 return [n, s, n, s, r, a, r, a]; 10622 { 10623 let g = lt(f * p) 10624 , y = e.x - g * (d / f + h / p) / 2 10625 , m = e.y - g * (u / f + c / p) / 2; 10626 return [n, s, (n + 2 * y) / 3, (s + 2 * m) / 3, (r + 2 * y) / 3, (a + 2 * m) / 3, r, a] 10627 } 10628} 10629function Iw(l, e, t, n) { 10630 if (l = l.slice(), 10631 Ae(l)) { 10632 let h = .6666666666666666 * (n < .5 ? n : 1 - n) 10633 , c = h * (l[6] - l[0]) 10634 , f = h * (l[7] - l[1]); 10635 l[2] = l[0] + c, 10636 l[3] = l[1] + f, 10637 l[4] = l[6] - c, 10638 l[5] = l[7] - f, 10639 n = jr(l, e) 10640 } 10641 let s = -.75 10642 , o = (n - .5) * (s - 1) / (s * (ee(4 * n - 2) - 1) - 1) + .5 10643 , i = 1 - n 10644 , r = (1 - o) / (3 * n * i * i)
10645 , a = o / (3 * n * n * i) 10646 , d = t.x - e.x 10647 , u = t.y - e.y; 10648 return l[2] += d * r, 10649 l[3] += u * r, 10650 l[4] += d * a, 10651 l[5] += u * a, 10652 l 10653} 10654function ha(l, e, t, n=1e-24) { 10655 if (Ae(l)) 10656 return t; 10657 let[s,o,i,r,a,d,u,h] = It(l, 0) 10658 , c = u - e.x 10659 , f = h - e.y; 10660 return af(y=>{ 10661 let m = ((s * y + i) * y + a) * y + c 10662 , b = ((o * y + r) * y + d) * y + f; 10663 return m * m + b * b 10664 } 10665 , y=>{ 10666 let m = 2 * ((3 * s * y + 2 * i) * y + a) * (((s * y + i) * y + a) * y + c) 10667 , b = 2 * ((3 * o * y + 2 * r) * y + d) * (((o * y + r) * y + d) * y + f); 10668 return m + b 10669 } 10670 , t, n, 64) 10671} 10672function jr(l, e) { 10673 if (Ae(l)) 10674 return ds(l[0], l[1], l[6], l[7], e.x, e.y, !1); 10675 { 10676 let t = Qd(l, e.x, e.y); 10677 t.push(0), 10678 t.push(1); 10679 let n = 0 10680 , s = fl 10681 , o = null; 10682 for (let i = 0; i < t.length; i++) { 10683 let r = t[i]; 10684 o = ze(l, r, o); 10685 let a = o.distSquared(e); 10686 a < s && (n = r, 10687 s = a) 10688 } 10689 return n 10690 } 10691} 10692function Lw(l, e) { 10693 if (Ae(l)) { 10694 let t = ds(l[0], l[1], l[6], l[7], e.x, e.y, !1); 10695 return ze(l, t) 10696 } else { 10697 let t = Qd(l, e.x, e.y); 10698 t.push(0), 10699 t.push(1); 10700 let n = null 10701 , s = fl; 10702 for (let o = 0; o < t.length; o++) { 10703 let i = t[o] 10704 , r = ze(l, i) 10705 , a = r.distSquared(e); 10706 a < s && (n = r, 10707 s = a) 10708 } 10709 return n 10710 } 10711} 10712function Qd(l, e, t) { 10713 if (Ae(l)) { 10714 let y = ds(l[0], l[1], l[6], l[7], e, t, !0); 10715 return y >= 0 && y <= 1 ? [y] : [] 10716 } 10717 let n, [s,o,i,r,a,d,u,h] = It(l, 0), c = u - e, f = h - t; 10718 l[0] === l[2] && l[1] === l[3] ? l[0] === l[4] && l[0] === l[5] ? n = [c + f, s * a + o * d, s * i + o * r, s * s + o * o] : n = [2 * (i * c + r * f), 3 * (s * c + o * f) + 2 * (i * a + r * d), 3 * (s * a + o * d) + 2 * (i * i + r * r), 5 * (s * i + o * r), 3 * (s * s + o * o)] : l[4] === l[6] && l[5] === l[7] ? l[2] === l[6] && l[3] === l[7] ? n = [c + f, s * a + o * d, s * i + o * r, s * s + o * o] : n = [-a * c - d * f, 3 * (s * c + o * f) - a * a - d * d, a * (3 * s - i) + d * (3 * o - r), s * (3 * i - a) + o * (3 * r - d), 3 * (s * s + o * o)] : n = [a * c + d * f, 2 * (i * c + r * f) + a * a + d * d, 3 * (i * a + r * d + c * s + f * o), 4 * (s * a + o * d) + 2 * (i * i + r * r), 5 * (s * i + o * r), 3 * (s * s + o * o)]; 10719 let p = Jd(n); 10720 return qr(p).map(y=>y[0]) 10721} 10722function Vw(l, e, t=1) { 10723 let n = e.x, s = e.y, [o,i,r,a,d,u,h,c] = l, f; 10724 if (t === 1) { 10725 const p = d * a - u * r 10726 , g = d * c - u * h 10727 , y = h * a - c * r; 10728 let m, b, M = 3 * (y - p + g); 10729 if (M === 0) 10730 m = 0, 10731 b = 0; 10732 else { 10733 const x = o * a - i * r 10734 , P = o * u - i * d 10735 , C = o * c - i * h 10736 , T = n * i - s * o 10737 , k = n * a - s * r 10738 , D = n * u - s * d 10739 , I = n * c - s * h 10740 , F = 3 * (I - k + y) 10741 , Y = I - T - C 10742 , q = 9 * (D - k + p) 10743 , re = 3 * (D - T - P) 10744 , ne = 3 * (k - T - x) 10745 , te = (x - C - y) / M 10746 , he = (C - P - g) / M; 10747 m = te * F + he * (Y + q) + re, 10748 b = te * Y + he * re + ne 10749 } 10750 Ee(ee(m), ee(b)) > .001 && (f = [b / (b - m)]) 10751 } 10752 if (f == null) { 10753 f = []; 10754 let p = [] 10755 , g = us(h - 3 * (d - r) - o, 3 * (d - 2 * r + o), 3 * (r - o), o - n, p) 10756 , y = [] 10757 , m = us(c - 3 * (u - a) - i, 3 * (u - 2 * a + i), 3 * (a - i), i - s, y) 10758 , b = fl; 10759 if (t === 3 && g === 1 && m === 1 && (t = 1), 10760 g >= t) { 10761 let M = [] 10762 , S = null; 10763 for (let P = 0; P < g; P++) 10764 S = ze(l, p[P], S), 10765 M.push([S.distSquared(e), P]); 10766 g > 1 && M.sort((P,C)=>{ 10767 let T = P[0] - C[0]; 10768 if (ee(T) < Ul) { 10769 let k = p[P[1]] 10770 , D = p[C[1]]; 10771 if (k >= 0 && k <= 1 && (D < 0 || D > 1)) 10772 return -1; 10773 if (D >= 0 && D <= 1 && (k < 0 || k > 1)) 10774 return 1 10775 } 10776 return T 10777 } 10778 ); 10779 let x = M[t - 1][0]; 10780 if (x < b) { 10781 f = []; 10782 for (let P = 0; P < t; P++) 10783 f.push(p[M[P][1]]); 10784 b = x 10785 } 10786 } 10787 if (m >= t) { 10788 let M = [] 10789 , S = null; 10790 for (let P = 0; P < m; P++) 10791 S = ze(l, y[P], S), 10792 M.push([S.distSquared(e), P]); 10793 if (m > 1 && M.sort((P,C)=>{ 10794 let T = P[0] - C[0]; 10795 if (ee(T) < Ul) { 10796 let k = y[P[1]] 10797 , D = y[C[1]]; 10798 if (k >= 0 && k <= 1 && (D < 0 || D > 1)) 10799 return -1; 10800 if (D >= 0 && D <= 1 && (k < 0 || k > 1)) 10801 return 1 10802 } 10803 return T 10804 } 10805 ), 10806 M[t - 1][0] < b) { 10807 f = []; 10808 for (let P = 0; P < t; P++) 10809 f.push(y[M[P][1]]) 10810 } 10811 } 10812 } 10813 return f 10814} 10815function Nw(l, e=0) { 10816 if ((l ? l.length : 0) === 0) 10817 return []; 10818 let n = []; 10819 for (let s of l) { 10820 let o = s[e] 10821 , i = s[2 + e] 10822 , r = s[4 + e] 10823 , a = s[6 + e]; 10824 if (o >= i && i >= r && r >= a || o <= i && i <= r && r <= a) 10825 n.push(s.slice()); 10826 else { 10827 let d = a - o - 3 * (r - i) 10828 , u = 2 * (o + r) - 4 * i 10829 , h = i - o 10830 , c = [] 10831 , f = Hs(d, u, h, c, null, 0, 1); 10832 if (f === 0) 10833 n.push(s.slice()); 10834 else { 10835 let p = c[0] 10836 , g = dn(s, p); 10837 if (g[0][e + 4] = g[0][e + 6], 10838 g[1][e + 2] = g[1][e], 10839 f === 1) 10840 n.push(...g); 10841 else { 10842 p = p < 1 ? (c[1] - p) / (1 - p) : 1; 10843 let y = dn(g[1], p, !0);
10844 y[0][e + 4] = y[0][e + 6], 10845 y[1][e + 2] = y[1][e], 10846 n.push(g[0], ...y) 10847 } 10848 } 10849 } 10850 } 10851 return n 10852} 10853function r2(l, e) { 10854 if (l === e) 10855 return !0; 10856 if (l == null || e == null || l.length !== e.length) 10857 return !1; 10858 for (let t = 0; t < l.length; ++t) 10859 if (l[t] !== e[t]) 10860 return !1; 10861 return !0 10862} 10863function Rw(l, e) { 10864 if (l === e) 10865 return !0; 10866 if (l == null || e == null || l.length !== e.length) 10867 return !1; 10868 for (let t = 0; t < l.length; ++t) 10869 if (Oe(l[t]) !== Oe(e[t])) 10870 return !1; 10871 return !0 10872} 10873function Fw(l, e, t) { 10874 let n = l[e]; 10875 l[e] = l[t], 10876 l[t] = n 10877} 10878class Mt { 10879 v; 10880 previous; 10881 next; 10882 path; 10883 _bounds; 10884 constructor(e, t, n, s) { 10885 this.v = e ? e.slice() : [0, 0, 0, 0, 0, 0, 0, 0], 10886 this.previous = t, 10887 this.next = n, 10888 this.path = s, 10889 this._bounds = null 10890 } 10891 setValues(e) { 10892 wi(this.v, ...e), 10893 this.notifyVChanged() 10894 } 10895 getStartPoint() { 10896 return new B(this.v[0],this.v[1]) 10897 } 10898 notifyVChanged() { 10899 this._bounds = null 10900 } 10901 getBounds() { 10902 let e = this._bounds; 10903 return e == null && (e = gl(this.v), 10904 this._bounds = e), 10905 e 10906 } 10907 getAxisBounds(e, t, n, s) { 10908 n ??= jt(t), 10909 s ??= cl(t); 10910 let o = e[0] * n - e[1] * s 10911 , i = e[2] * n - e[3] * s 10912 , r = e[4] * n - e[5] * s 10913 , a = e[6] * n - e[7] * s 10914 , d = He(o, a) 10915 , u = Ee(o, a); 10916 if (i < d || r < d || i > u || r > u) { 10917 let h = a - 3 * (r - i) - o 10918 , c = 3 * (r - 2 * i + o) 10919 , f = 3 * (i - o) 10920 , p = o 10921 , g = [] 10922 , y = Hs(3 * h, 2 * c, f, g, null, 0, 1); 10923 for (let m = 0; m < y; m++) { 10924 let b = g[m] 10925 , M = ((h * b + c) * b + f) * b + p; 10926 M < d ? d = M : M > u && (u = M) 10927 } 10928 } 10929 return [d, u] 10930 } 10931} 10932class ft { 10933 _curves; 10934 _isClosed = !1; 10935 constructor(e, t=!1) { 10936 this._curves = e == null ? [] : e.slice(); 10937 for (let n = 1; n < this._curves.length; n++) 10938 this._curves[n].path = this, 10939 this._curves[n].previous = this._curves[n - 1], 10940 this._curves[n - 1].next = this._curves[n]; 10941 t && this.close() 10942 } 10943 clone() { 10944 let e = this._curves.map(t=>new Mt(t.v)); 10945 return new ft(e,this._isClosed) 10946 } 10947 isEmpty() { 10948 return this._curves.length === 0 10949 } 10950 close(e=1e-6) { 10951 let t = this._curves; 10952 if (t.length === 0) 10953 return; 10954 let n = t.at(0) 10955 , s = t.at(-1) 10956 , o = n.v 10957 , i = s.v; 10958 if (Se(o[0] - i[6], o[1] - i[7]) > e) { 10959 let r = [i[6], i[7], i[6], i[7], o[0], o[1], o[0], o[1]]; 10960 s = this.appendCurveValues(r) 10961 } else 10962 i[4] = i[4] === i[6] ? o[0] : i[4] + (o[0] - i[6]), 10963 i[5] = i[5] === i[7] ? o[1] : i[5] + (o[1] - i[7]), 10964 i[6] = o[0], 10965 i[7] = o[1], 10966 s.notifyVChanged(); 10967 s.next = n, 10968 n.previous = s, 10969 this._isClosed = !0 10970 } 10971 open() { 10972 let e = this._curves 10973 , t = e.at(0) 10974 , n = e.at(-1); 10975 n.next = null, 10976 t.previous = null, 10977 this._isClosed = !1 10978 } 10979 isClosed() { 10980 return this._isClosed 10981 } 10982 appendCurveValues(e) { 10983 let t = new Mt(e); 10984 return this.appendCurve(t) 10985 } 10986 appendCurve(e) { 10987 return this.insertCurve(e, this._curves.length) 10988 } 10989 insertCurve(e, t) { 10990 let n = this._curves 10991 , s = this.isClosed() 10992 , o = n[t === 0 ? s ? n.length - 1 : null : t - 1] 10993 , i = n[t === n.length ? s ? 0 : null : t]; 10994 return o && (e.previous = o, 10995 o.next = e), 10996 i && (e.next = i, 10997 i.previous = e), 10998 n.splice(t, 0, e), 10999 e.path = this, 11000 e 11001 }
11002 insertCurveValues(e, t) { 11003 let n = t.map(r=>new Mt(r)) 11004 , s = this._curves 11005 , o = s[e === 0 ? this._isClosed ? s.length - 1 : null : e - 1]; 11006 if (o) { 11007 let r = n.at(0); 11008 r.previous = o, 11009 o.next = r 11010 } 11011 let i = s[e === s.length ? this._isClosed ? 0 : null : e]; 11012 if (i) { 11013 let r = n.at(-1); 11014 r.next = i, 11015 i.previous = r 11016 } 11017 s.splice(e, 0, ...n), 11018 n.forEach((r,a)=>{ 11019 if (r.path = this, 11020 a > 0) { 11021 let d = n[a - 1]; 11022 r.previous = d, 11023 d.next = r 11024 } 11025 } 11026 ) 11027 } 11028 removeCurves(e, t, n) { 11029 if (t > 0) { 11030 let s = this._curves 11031 , o = this.isClosed() 11032 , i = e === 0 11033 , r = e + t >= s.length 11034 , a = i && !o ? null : s[i ? s.length - 1 : e - 1] 11035 , d = r && !o ? null : s[r ? 0 : e + t]; 11036 if (a != null && (a.next = d), 11037 d != null && (d.previous = a), 11038 (o || !r || n) && a != null) { 11039 let u = a.v 11040 , c = s[e + t - 1].v; 11041 (u[6] !== c[6] || u[7] !== c[7]) && u.splice(4, 4, c[4], c[5], c[6], c[7]) 11042 } 11043 s.splice(e, t) 11044 } 11045 } 11046 shiftCurves(e) { 11047 let t = this._curves; 11048 e > 0 ? t.push(...t.splice(0, e)) : t.unshift(...t.splice(t.length + e, -e)) 11049 } 11050 splitCurve(e, t) { 11051 let o = this._curves[e].v 11052 , i = dn(o, t, !0) 11053 , r = new Mt(i[1]); 11054 return this.insertCurve(r, e + 1), 11055 r 11056 } 11057 getCurve(e) { 11058 return this._curves.at(e) 11059 } 11060 getCurveCount() { 11061 return this._curves.length 11062 } 11063 getCurves() { 11064 return this._curves.slice() 11065 } 11066 getFirstCurve() { 11067 return this._curves[0] 11068 } 11069 getLastCurve() { 11070 return this._curves.at(-1) 11071 } 11072 getCurveIterator() { 11073 return this._curves.values() 11074 } 11075 removeShortCurves(e=0) { 11076 let t = this._curves; 11077 for (let n = t.length - 1; n >= 0; n--) { 11078 let s = t[n].v; 11079 (e === 0 ? Pl(s) : pr(s) < e) && this.removeCurves(n, 1) 11080 } 11081 } 11082 reverse() { 11083 let e = this._curves; 11084 e.reverse(); 11085 for (let t of e) { 11086 let n = t.next; 11087 t.next = t.previous, 11088 t.previous = n, 11089 No(t.v, !0), 11090 t.notifyVChanged() 11091 } 11092 } 11093 applyTransform(e) { 11094 if (e != null && !e.isIdentity) 11095 for (let t of this._curves) 11096 e.transformArray(t.v); 11097 return this 11098 } 11099 getBoundsCoords(e) { 11100 let t = this._curves.map(n=>n.v); 11101 return ft.calculateBoundsCoords(t, e) 11102 } 11103 static calculateBoundsCoords(e, t) { 11104 if (e.length > 0) { 11105 let n = e[0]; 11106 if (t == null) 11107 t = [n[0], n[1], n[0], n[1]]; 11108 else { 11109 let[s,o] = n; 11110 s < t[0] ? t[0] = s : s > t[2] && (t[2] = s), 11111 o < t[1] ? t[1] = o : o > t[3] && (t[3] = o) 11112 } 11113 for (n of e) { 11114 let[,,,,,,s,o] = n; 11115 s < t[0] ? t[0] = s : s > t[2] && (t[2] = s), 11116 o < t[1] ? t[1] = o : o > t[3] && (t[3] = o) 11117 } 11118 for (n of e) 11119 (n[2] < t[0] || n[2] > t[2] || n[4] < t[0] || n[4] > t[2] || n[3] < t[1] || n[3] > t[3] || n[5] < t[1] || n[5] > t[3]) && (t = gl(n, t)); 11120 return t 11121 } else 11122 return [0, 0, 0, 0] 11123 } 11124 getArea() { 11125 let e = this._curves 11126 , t = 0; 11127 for (let o of e) 11128 t += Ow(o.v); 11129 let n = e.at(0).v 11130 , s = e.at(-1).v; 11131 return t += (n[0] - s[6]) * (n[1] + s[7]) / 2, 11132 t 11133 } 11134 getMoment(e) { 11135 let t = 0; 11136 for (let n of this._curves) { 11137 let s = n.v; 11138 t += s2(s, e) 11139 } 11140 return t 11141 } 11142 getCentroid() { 11143 let e = new B(this.getMoment(0),this.getMoment(1)) 11144 , t = this.getArea(); 11145 return e.divideScalar(t) 11146 } 11147} 11148function Xl(l, e=0, t=0) { 11149 let n = []; 11150 if (l == null || l === "") 11151 return n; 11152 try { 11153 let s = null, o, i, r = new Float64Array(7), a = [0, 0, 0, 0, e, e, t, t], d = 0; 11154 for (d = Ar(l, d); d < l.length; ) { 11155 let u = l.charCodeAt(d); 11156 if (u >= 65) 11157 o = u, 11158 d++, 11159 o >= 97 ? (i = !0, 11160 o -= 32) : i = !1; 11161 else if (o === 90) 11162 throw new Error("Expected MoveTo command"); 11163 if (o === 77) 11164 (s === null || s.getCurveCount() > 0) && (s = new ft, 11165 n.push(s)), 11166 d = tn(l, d, r, 2), 11167 a = d2(r, i, a), 11168 o = 76; 11169 else { 11170 if (s === null) 11171 throw new Error("Expected MoveTo command"); 11172 switch (o) { 11173 case 76: 11174 d = tn(l, d, r, 2), 11175 a = u2(r, s, i, a); 11176 break; 11177 case 72: 11178 d = tn(l, d, r, 1), 11179 a = zw(r, s, i, a); 11180 break; 11181 case 86: 11182 d = tn(l, d, r, 1), 11183 a = Uw(r, s, i, a); 11184 break; 11185 case 67: 11186 d = tn(l, d, r, 6), 11187 a = $w(r, s, i, a); 11188 break; 11189 case 83: 11190 d = tn(l, d, r, 4), 11191 a = Xw(r, s, i, a); 11192 break; 11193 case 81: 11194 d = tn(l, d, r, 4), 11195 a = Gw(r, s, i, a); 11196 break; 11197 case 84: 11198 d = tn(l, d, r, 2), 11199 a = Hw(r, s, i, a); 11200 break; 11201 case 65: 11202 d = tn(l, d, r, 7), 11203 a = Yw(r, s, i, a); 11204 break; 11205 case 90: 11206 s.removeShortCurves(), 11207 s.getCurveCount() === 0 && (s.appendCurveValues(a.slice(4).concat(a.slice(4))), 11208 s.appendCurveValues(a.slice(4).concat(a.slice(4)))), 11209 s.close(1e-8), 11210 a = s.getLastCurve().v; 11211 break; 11212 default: 11213 throw new Error('Unknown command "' + String.fromCharCode(o) + (o ? '" (0x' + o.toString(16) + ")" : "")) 11214 } 11215 } 11216 d = Ar(l, d) 11217 } 11218 } catch (s) { 11219 throw s.paths = n, 11220 s 11221 } 11222 return n 11223} 11224function a2(l, e=!1, t=0, n=0) { 11225 let s = []; 11226 if (l == null || l === "") 11227 return s; 11228 try { 11229 let o = new ft 11230 , i = new Float64Array(2) 11231 , r = [0, 0, 0, 0, t, t, n, n] 11232 , a = tn(l, 0, i, 2); 11233 for (r = d2(i, !1, r), 11234 a = Ar(l, a); a < l.length; ) 11235 a = tn(l, a, i, 2), 11236 r = u2(i, o, !1, r), 11237 a = Ar(l, a); 11238 o.removeShortCurves(), 11239 e && o.getCurveCount() > 0 && o.close(1e-8), 11240 s.push(o) 11241 } catch (o) { 11242 throw o.paths = s, 11243 o 11244 } 11245 return s 11246} 11247function Fu(l, e) { 11248 let t = ""; 11249 for (let n = 0; n < e; n++) { 11250 let s = l[n] 11251 , o = Bw(s); 11252 t += n === 0 || o[0] === "-" ? o : " " + o 11253 } 11254 return t 11255} 11256function Bw(l) { 11257 isFinite(l) || (l === Number.POSITIVE_INFINITY ? l = Number.MAX_VALUE : l === Number.NEGATIVE_INFINITY && (l = Number.MIN_VALUE)); 11258 let e = l < 0 ? -l : l; 11259 if (e >= 1e21) { 11260 let t = "0"; 11261 for (e /= 10; e >= 1e21; ) 11262 t += "0", 11263 e /= 10; 11264 return l < 0 ? -e + t : e + t 11265 } else if (e < 1e-6) { 11266 let t = 1 + e + ""; 11267 return (l < 0 ? "-0" : "0") + t.substring(1) 11268 } else 11269 return "" + l 11270} 11271function on(l, e, t=-1, n=!1, s=!0) { 11272 let o = e == null || e.isIdentity 11273 , i = [0, 0, 0, 0, 0, 0, 0, 0] 11274 , r = ""; 11275 for (let a of l) { 11276 let d = a.isClosed() 11277 , u = a.getCurveCount(); 11278 if (u > 0) { 11279 let h = a.getCurve(0) 11280 , c = o ? h.v : e.transformArray(h.v, i) 11281 , f = null 11282 , p = new Float64Array(6) 11283 , g = 0 11284 , y = Je(c[0], t) 11285 , m = Je(c[1], t); 11286 r += s || r === "" ? "M" : " M", 11287 p[0] = y, 11288 p[1] = m, 11289 r += Fu(p, 2); 11290 let b = "M" 11291 , M = ""; 11292 for (let S = 0; S < u; S++) { 11293 if (h = a.getCurve(S), 11294 c = h.v, 11295 !o) 11296 if (f === null) 11297 c = e.transformArray(c, i, 0); 11298 else { 11299 let P = f[6] 11300 , C = f[7]; 11301 c = e.transformArray(c, i, 2), 11302 c[0] = P, 11303 c[1] = C 11304 } 11305 let x = qw(c); 11306 if (x && d && S === u - 1) 11307 g = 0; 11308 else if (n) { 11309 let P = Je(c[6], t) 11310 , C = Je(c[7], t); 11311 x ? P === y ? C === m ? g = 0 : (M = "V", 11312 p[0] = C, 11313 g = 1) : C === m ? (M = "H", 11314 p[0] = P, 11315 g = 1) : (M = "L", 11316 p[0] = P, 11317 p[1] = C, 11318 g = 2) : (M = "C", 11319 p[0] = c[2], 11320 p[1] = c[3], 11321 p[2] = c[4], 11322 p[3] = c[5], 11323 p[4] = P, 11324 p[5] = C, 11325 g = 6), 11326 y = P, 11327 m = C 11328 } else { 11329 let P = Je(c[6] - y, t) 11330 , C = Je(c[7] - m, t); 11331 x ? P === 0 ? C === 0 ? g = 0 : (M = "v", 11332 p[0] = C, 11333 g = 1) : C === 0 ? (M = "h", 11334 p[0] = P, 11335 g = 1) : (M = "l", 11336 p[0] = P, 11337 p[1] = C, 11338 g = 2) : (M = "c", 11339 p[0] = Je(c[2] - y, t), 11340 p[1] = Je(c[3] - m, t), 11341 p[2] = Je(c[4] - y, t), 11342 p[3] = Je(c[5] - m, t), 11343 p[4] = P, 11344 p[5] = C, 11345 g = 6), 11346 y += P, 11347 m += C 11348 } 11349 if (g > 0) 11350 if (M !== b) 11351 r += M, 11352 b = M, 11353 r += Fu(p, g); 11354 else { 11355 let P = Fu(p, g); 11356 r += P[0] === "-" ? P : " " + P 11357 } 11358 f = c 11359 } 11360 d && (r += "z") 11361 } 11362 } 11363 return r 11364} 11365function d2(l, e, t) { 11366 let n = l[0] 11367 , s = l[1]; 11368 return e && t && (n += t[6], 11369 s += t[7]), 11370 [0, 0, 0, 0, n, s, n, s] 11371} 11372function u2(l, e, t, n) { 11373 let s = n[6] 11374 , o = n[7] 11375 , i = l[0] 11376 , r = l[1]; 11377 t && (i += s, 11378 r += o); 11379 let a = [s, o, s, o, i, r, i, r]; 11380 return e.appendCurveValues(a), 11381 a 11382} 11383function zw(l, e, t, n) { 11384 let s = n[6] 11385 , o = n[7] 11386 , i = t ? l[0] + s : l[0] 11387 , r = o 11388 , a = [s, o, s, o, i, r, i, r]; 11389 return e.appendCurveValues(a), 11390 a 11391} 11392function Uw(l, e, t, n) { 11393 let s = n[6] 11394 , o = n[7] 11395 , i = s 11396 , r = t ? l[0] + o : l[0] 11397 , a = [s, o, s, o, i, r, i, r]; 11398 return e.appendCurveValues(a), 11399 a 11400} 11401function Gw(l, e, t, n) { 11402 let s = n[6] 11403 , o = n[7] 11404 , i = l[0] 11405 , r = l[1] 11406 , a = l[2] 11407 , d = l[3]; 11408 t && (i += s, 11409 r += o, 11410 a += s, 11411 d += o); 11412 let u = (2 * i + s) / 3 11413 , h = (2 * r + o) / 3 11414 , c = (2 * i + a) / 3 11415 , f = (2 * r + d) / 3 11416 , p = [s, o, u, h, c, f, a, d]; 11417 return e.appendCurveValues(p), 11418 p 11419} 11420function Hw(l, e, t, n) { 11421 let s = n[6] 11422 , o = n[7] 11423 , i = 2 * s - n[4] 11424 , r = 2 * o - n[5] 11425 , a = l[0] 11426 , d = l[1]; 11427 t && (a += s, 11428 d += o); 11429 let u = (5 * s - 3 * n[4]) / 2 11430 , h = (5 * o - 3 * n[5]) / 2 11431 , c = (2 * u + a) / 3 11432 , f = (2 * h + d) / 3 11433 , p = [s, o, i, r, c, f, a, d]; 11434 return e.appendCurveValues(p), 11435 p 11436} 11437function $w(l, e, t, n) { 11438 let s = n[6] 11439 , o = n[7] 11440 , i = l[0] 11441 , r = l[1] 11442 , a = l[2] 11443 , d = l[3] 11444 , u = l[4] 11445 , h = l[5]; 11446 t && (i += s, 11447 r += o, 11448 a += s, 11449 d += o, 11450 u += s, 11451 h += o);
11452 let c = [s, o, i, r, a, d, u, h]; 11453 return e.appendCurveValues(c), 11454 c 11455} 11456function Xw(l, e, t, n) { 11457 let s = n[6] 11458 , o = n[7] 11459 , i = 2 * s - n[4] 11460 , r = 2 * o - n[5] 11461 , a = l[0] 11462 , d = l[1] 11463 , u = l[2] 11464 , h = l[3]; 11465 t && (a += s, 11466 d += o, 11467 u += s, 11468 h += o); 11469 let c = [s, o, i, r, a, d, u, h]; 11470 return e.appendCurveValues(c), 11471 c 11472} 11473function Yw(l, e, t, n) { 11474 let s = n[6] 11475 , o = n[7] 11476 , i = ee(l[0]) 11477 , r = ee(l[1]) 11478 , a = l[5] 11479 , d = l[6]; 11480 if (t && (a += s, 11481 d += o), 11482 s === a && o === d) 11483 return n; 11484 if (i === 0 || r === 0) { 11485 let u = [s, o, s, o, a, d, a, d]; 11486 return e.appendCurveValues(u), 11487 u 11488 } else { 11489 let u = i * i 11490 , h = r * r 11491 , c = l[2] % 360 * tt / 180 11492 , f = jt(c) 11493 , p = cl(c) 11494 , g = l[3] === 0 ? 0 : 1 11495 , y = l[4] === 0 ? 0 : 1 11496 , m = f * (s - a) / 2 + p * (o - d) / 2 11497 , b = -p * (s - a) / 2 + f * (o - d) / 2 11498 , M = m * m 11499 , S = b * b 11500 , x = M / u + S / h; 11501 if (x > 1) { 11502 let Re = lt(x); 11503 i *= Re, 11504 r *= Re, 11505 u = i * i, 11506 h = r * r 11507 } 11508 let P = (g === y ? -1 : 1) * lt(Ee(0, (u * h - u * S - h * M) / (u * S + h * M))) 11509 , C = P * (i * b / r) 11510 , T = P * (-r * m / i) 11511 , k = f * C - p * T + (s + a) / 2 11512 , D = p * C + f * T + (o + d) / 2 11513 , I = ((Re,Be,Ze,Xe)=>{ 11514 let dt = Re * Xe - Be * Ze > 0 ? 1 : -1 11515 , Qe = Re * Ze + Be * Xe; 11516 return Qe = He(1, Ee(-1, Qe)), 11517 dt * _m(Qe) 11518 } 11519 ) 11520 , F = (m - C) / i 11521 , Y = (b - T) / r 11522 , q = (-m - C) / i 11523 , re = (-b - T) / r 11524 , ne = I(1, 0, F, Y) 11525 , te = I(F, Y, q, re); 11526 y === 0 ? te > 0 && (te -= 2 * tt) : te < 0 && (te += 2 * tt); 11527 let he = Ee(Math.ceil(ee(te) / (tt / 2)), 1) 11528 , Me = te / he 11529 , De = 4 / 3 * Os(Me / 4) 11530 , ye = jt(ne) 11531 , _e = cl(ne) 11532 , Ge = []; 11533 for (; he--; ) { 11534 ne += Me; 11535 let Re = jt(ne) 11536 , Be = cl(ne) 11537 , Ze = [ye, _e, ye - _e * De, _e + ye * De, Re + Be * De, Be - Re * De, Re, Be]; 11538 Ge.push(Ze), 11539 ye = Re, 11540 _e = Be 11541 } 11542 let $e; 11543 for (let Re = 0; Re < Ge.length; Re++) { 11544 $e = Ge[Re]; 11545 for (let Be = 0; Be < 8; Be += 2) { 11546 let Ze = $e[Be] 11547 , Xe = $e[Be + 1]; 11548 Ze *= i, 11549 Xe *= r, 11550 $e[Be] = f * Ze - p * Xe + k, 11551 $e[Be + 1] = p * Ze + f * Xe + D 11552 } 11553 e.appendCurveValues($e) 11554 } 11555 return $e 11556 } 11557} 11558function tn(l, e, t, n) { 11559 e = Ar(l, e); 11560 for (let s = 0; s < n; s++) { 11561 let o = Ww(l, e); 11562 if (o === e) 11563 throw new Error("Expected " + n + " coordinates, found " + s); 11564 t[s] = l.substring(e, o) * 1, 11565 e = Kw(l, o) 11566 } 11567 return e 11568} 11569function Ar(l, e) { 11570 for (; jh(l.charCodeAt(e)); ) 11571 e++; 11572 return e 11573} 11574function Kw(l, e) { 11575 let t = l.charCodeAt(e); 11576 for (; jh(t); ) 11577 t = l.charCodeAt(++e); 11578 if (t === 44) 11579 for (t = l.charCodeAt(++e); jh(t); ) 11580 t = l.charCodeAt(++e); 11581 return e 11582} 11583function Ww(l, e) { 11584 let t = e 11585 , n = l.charCodeAt(t); 11586 (n === 45 || n === 43) && (n = l.charCodeAt(++t)); 11587 let s = t; 11588 for (; n >= 48 && n <= 57; ) 11589 n = l.charCodeAt(++t); 11590 if (n === 46) 11591 if (n = l.charCodeAt(++t), 11592 n >= 48 && n <= 57) 11593 do 11594 n = l.charCodeAt(++t); 11595 while (n >= 48 && n <= 57); 11596 else 11597 return e; 11598 if (t > s) { 11599 if (n === 69 || n === 101) { 11600 let o = t; 11601 if (n = l.charCodeAt(++o), 11602 (n === 45 || n === 43) && (n = l.charCodeAt(++o)), 11603 n >= 48 && n <= 57) { 11604 do 11605 n = l.charCodeAt(++o); 11606 while (n >= 48 && n <= 57); 11607 t = o 11608 } 11609 } 11610 return t 11611 } else 11612 return e 11613} 11614function jh(l) { 11615 return l <= 32 && (l === 32 || l === 9 || l === 10 || l === 12 || l === 13) 11616} 11617function ca(l) { 11618 return ee(l) < 1e-12 11619} 11620function qw(l) { 11621 return ca(l[0] - l[2]) && ca(l[1] - l[3]) && ca(l[4] - l[6]) && ca(l[5] - l[7]) 11622} 11623class Ao { 11624 distance = 0; 11625 linecap = "butt"; 11626 linejoin = "round"; 11627 miterlimit = 4; 11628 constructor(e, t, n, s=4) { 11629 this.set(e, t, n, s) 11630 } 11631 set(e, t, n, s=4) { 11632 this.distance = e ?? this.distance, 11633 this.linecap = t ?? this.linecap, 11634 this.linejoin = n ?? this.linejoin, 11635 this.miterlimit = s ?? this.miterlimit 11636 } 11637 setFrom(e) { 11638 this.set(e.distance, e.linecap, e.linejoin, e.miterlimit) 11639 } 11640 clone() { 11641 return new Ao(this.distance,this.linecap,this.linejoin,this.miterlimit) 11642 } 11643 equals(e) { 11644 return e instanceof Ao ? this === e ? !0 : this.distance === e.distance && this.linecap === e.linecap && this.linejoin === e.linejoin && this.miterlimit === e.miterlimit : !1 11645 } 11646 toJSON() { 11647 return { 11648 distance: this.distance, 11649 lineCap: this.linecap, 11650 lineJoin: this.linejoin, 11651 miterLimit: this.miterlimit 11652 } 11653 } 11654 setJSON(e) { 11655 this.distance = e.distance, 11656 this.linecap = e.lineCap, 11657 this.linejoin = e.lineJoin, 11658 this.miterlimit = e.miterLimit 11659 } 11660 static fromJSON(e) { 11661 let t = new Ao; 11662 return t.setJSON(e), 11663 t 11664 } 11665} 11666class Fn extends Nt { 11667 _ooffsetStyle; 11668 _pathData; 11669 _pathDataEffects; 11670 constructor(e) { 11671 super(e), 11672 Gs(this, Fn) 11673 } 11674 getFillRule() { 11675 return "nonzero" 11676 } 11677 toPathModel() { 11678 return null 11679 } 11680 getPathData(e, t, n) { 11681 let s = this.getPaths(e, t, !1); 11682 return on(s, null, n) 11683 } 11684 getOffsetStyle() { 11685 return this._offsetStyle 11686 } 11687 setOffsetStyle(e) { 11688 e && e.distance !== 0 ? this._offsetStyle ? this._offsetStyle.setFrom(e) : this._offsetStyle = e.clone() : this._offsetStyle = null 11689 } 11690 getOverlayPathInfo() { 11691 return { 11692 pathData: this.getPathData(this.getAggregateTransform(), -1), 11693 transform: null 11694 } 11695 } 11696} 11697class Fo extends Fn { 11698 static type = "image"; 11699 x; 11700 y; 11701 width; 11702 height; 11703 constructor(e, t=0, n=0, s, o) { 11704 let i = de("image"); 11705 super(i), 11706 e ? this.setImageDataUrl(e, t, n, s, o) : (this.baseElement.setAttribute("href", this.getBrokenImageDataUrl()), 11707 this.setX(t), 11708 this.setY(n), 11709 this.setWidth(64), 11710 this.setHeight(64)) 11711 } 11712 async setImageDataUrl(e, t=0, n=0, s, o) { 11713 try { 11714 let i = new Image; 11715 i.src = e, 11716 await i.decode(), 11717 s = s ?? i.width, 11718 o = o ?? i.height 11719 } catch { 11720 e = this.getBrokenImageDataUrl(s, o), 11721 s = 64, 11722 o = 64 11723 } 11724 this.baseElement.setAttribute("href", e),
11725 this.setX(t), 11726 this.setY(n), 11727 this.setWidth(s), 11728 this.setHeight(o) 11729 } 11730 getBrokenImageDataUrl(e=64, t=64) { 11731 let n = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="${e}" height="${t}"> 11732 <rect width="32" height="32" fill="#fff" /> 11733 <path d="M0.38 27.22L30.38 3.22 31.62 4.78 1.62 28.78 0.38 27.22zM2 6C2 5.45 2.45 5 3 5H24.95L22.45 7H4V16.97L9.39 12.83C9.75 12.56 10.25 12.56 10.61 12.83L12.93 14.61 11.32 15.9 10 14.89 4 19.49V21.76L2 23.36V6zM7.05 27L9.55 25H28V22L20.49 16.25 22.03 15.02 28 19.5V10.24L30 8.64V26C30 26.55 29.55 27 29 27H7.05zM14 11C14 9.7 14.98 7.99 17 7.99 17.87 7.99 18.93 8.44 19.52 9.34L17.92 10.63C17.79 10.33 17.52 10 17 10 16.73 10 16 10.22 16 11 16 11.19 16.1 11.59 16.42 11.82L14.83 13.09C14.34 12.6 14 11.9 14 11z" fill="#808080" /> 11734 </svg>`; 11735 return "data:image/svg+xml;utf8," + encodeURIComponent(n) 11736 } 11737 getX() { 11738 return this.x 11739 } 11740 setX(e) { 11741 e !== this.x && (this.x = e, 11742 this.baseElement.setAttribute("x", e)) 11743 } 11744 getY() { 11745 return this.y 11746 } 11747 setY(e) { 11748 e !== this.y && (this.y = e, 11749 this.baseElement.setAttribute("y", e)) 11750 } 11751 getWidth() { 11752 return this.width 11753 } 11754 setWidth(e) { 11755 e !== this.width && (this.width = e, 11756 this.baseElement.setAttribute("width", e)) 11757 } 11758 getHeight() { 11759 return this.height 11760 } 11761 setHeight(e) { 11762 e !== this.height && (this.height = e, 11763 this.baseElement.setAttribute("height", e)) 11764 } 11765 getBounds() { 11766 return new Ve().set(this.baseElement.getBBox()) 11767 } 11768 getPaths(e, t, n) { 11769 let s = this.baseElement.getBBox() 11770 , o = s.x 11771 , i = s.y 11772 , r = o + s.width 11773 , a = i + s.height 11774 , d = new ft; 11775 if (e == null || e.isIdentity) 11776 d.appendCurveValues([o, i, o, i, r, i, r, i]), 11777 d.appendCurveValues([r, i, r, i, r, a, r, a]), 11778 d.appendCurveValues([r, a, r, a, o, a, o, a]), 11779 d.appendCurveValues([o, a, o, a, o, i, o, i]); 11780 else { 11781 let u = e.transformXY(new B(o,i)) 11782 , h = e.transformXY(new B(r,i)) 11783 , c = e.transformXY(new B(r,a)) 11784 , f = e.transformXY(new B(o,a)); 11785 d.appendCurveValues([u.x, u.y, u.x, u.y, h.x, h.y, h.x, h.y]), 11786 d.appendCurveValues([h.x, h.y, h.x, h.y, c.x, c.y, c.x, c.y]), 11787 d.appendCurveValues([c.x, c.y, c.x, c.y, f.x, f.y, f.x, f.y]), 11788 d.appendCurveValues([f.x, f.y, f.x, f.y, u.x, u.y, u.x, u.y]) 11789 } 11790 return d.close(), 11791 [d] 11792 } 11793 applyTransformToElement() { 11794 let e = this.getAggregateTransform(); 11795 e.isIdentity ? this.baseElement.removeAttribute("transform") : this.baseElement.setAttribute("transform", e.toSvgValue()) 11796 } 11797} 11798class Is { 11799 _nodePoint; 11800 _isIn; 11801 constructor(e, t) { 11802 this._nodePoint = e, 11803 this._isIn = t 11804 } 11805 get type() { 11806 return this._isIn ? "controlIn" : "controlOut" 11807 } 11808 get nodePoint() { 11809 return this._nodePoint 11810 } 11811 getPathModel() { 11812 return this._nodePoint.getPathModel() 11813 } 11814 getPathModelId() { 11815 return this._nodePoint.getPathModelId() 11816 } 11817 getSinglePathModel() { 11818 return this._nodePoint.getSinglePathModel() 11819 } 11820 getSinglePathModelId() { 11821 return this._nodePoint.getSinglePathModelId() 11822 } 11823 getIndex() { 11824 return this._nodePoint.getIndex() 11825 } 11826 isInControlPoint() { 11827 return this._isIn 11828 } 11829 isOutControlPoint() { 11830 return !this._isIn 11831 } 11832 set(e, t) { 11833 this.x = e, 11834 this.y = t 11835 } 11836 get x() { 11837 return this._isIn ? this._nodePoint.inX : this._nodePoint.outX 11838 } 11839 set x(e) { 11840 this._isIn ? this._nodePoint.inX = e : this._nodePoint.outX = e 11841 } 11842 get y() { 11843 return this._isIn ? this._nodePoint.inY : this._nodePoint.outY 11844 } 11845 set y(e) { 11846 this._isIn ? this._nodePoint.inY = e : this._nodePoint.outY = e 11847 } 11848 get xTransformed() { 11849 return this._isIn ? this._nodePoint.inXTransformed : this._nodePoint.outXTransformed 11850 } 11851 get yTransformed() { 11852 return this._isIn ? this._nodePoint.inYTransformed : this._nodePoint.outYTransformed 11853 } 11854 compare(e) { 11855 throw new Error 11856 } 11857} 11858function jw(l) { 11859 if (l.length < 2) 11860 return []; 11861 if (l.length === 2) { 11862 let e = l[0] 11863 , t = l[1]; 11864 return [[e.x, e.y, (2 * e.x + t.x) / 3, (2 * e.y + t.y) / 3, (e.x + 2 * t.x) / 3, (e.y + 2 * t.y) / 3, t.x, t.y]] 11865 } else { 11866 let e = [], t, n; 11867 for (let i = 1; i < l.length - 1; i++) { 11868 let r = l[i - 1] 11869 , a = l[i] 11870 , d = l[i + 1]; 11871 n == null ? (t = [r.x, r.y, 0, 0, 0, 0, a.x, a.y], 11872 e.push(t)) : t = n, 11873 n = [a.x, a.y, 0, 0, 0, 0, d.x, d.y], 11874 e.push(n), 11875 gr(t, n) 11876 } 11877 let s = e[0]; 11878 s[2] = s[4] + (s[0] - s[6]) / 3, 11879 s[3] = s[5] + (s[1] - s[7]) / 3; 11880 let o = e[e.length - 1]; 11881 return o[4] = o[2] + (o[6] - o[0]) / 3, 11882 o[5] = o[3] + (o[7] - o[1]) / 3, 11883 e 11884 } 11885} 11886function Jw(l, e, t) { 11887 let n = l.x, s = l.y, o = e.x, i = e.y, r = t.x, a = t.y, d = n * n + s * s, u = o * o + i * i, h = r * r + a * a, c = n - o, f = s - i, p = n - r, g = s - a, y, m, b = f * p - g * c; 11888 return ee(b) < Number.EPSILON ? null : (ee(c) < ee(f) ? (y = (f * (d - h) + g * (u - d)) / (2 * b), 11889 m = (d - 2 * c * y - u) / (2 * f)) : (m = (c * (d - h) + p * (u - d)) / (2 * -b), 11890 y = (d - 2 * f * m - u) / (2 * c)), 11891 new B(y,m)) 11892} 11893function Zw(l, e, t) { 11894 let n = l.subtract(e) 11895 , s = t.subtract(e) 11896 , o = n.getLength() 11897 , i = s.getLength(); 11898 if (o === 0) 11899 return t.clone(); 11900 if (i === 0) 11901 return l.clone(); 11902 let r = (n.x * s.x + n.y * s.y) / (o * i), a = Math.acos(r), d = a * .5, u = a * .25, h, c; 11903 o < i ? (h = i, 11904 c = o) : (h = o, 11905 c = i); 11906 let f, p, g, y, m; 11907 for (let M = 0; M < 16; M++) { 11908 m = d, 11909 f = h * cl(m), 11910 p = h * jt(m); 11911 let S = a - m; 11912 g = c * cl(S), 11913 y = c * jt(S); 11914 let x = (1 - y / p) * (1 - y / p) + g * g / (f * f); 11915 d += x > 1 ? u : -u, 11916 u *= .5 11917 } 11918 let b = n.cross(s); 11919 return (o < i && b > 0 || o >= i && b < 0) && (m = -m),
11920 e.add((o < i ? s : n).setLength(p).rotate(m)) 11921} 11922function gr(l, e) { 11923 let t = new B(l[0],l[1]), n = new B(l[6],l[7]), s = new B(e[6],e[7]), o, i, r = Jw(t, n, s); 11924 if (r == null) 11925 o = new B(0,0), 11926 i = new B(0,0); 11927 else { 11928 let a = t.dist(r) 11929 , d = n.subtract(r).getAngleTo(t.subtract(r), !0) 11930 , u = s.subtract(r).getAngleTo(n.subtract(r), !0); 11931 if (d * u < 0 || ee(d) > tt / 2 || ee(u) > tt / 2) { 11932 let c = .5522847498307935, f = Zw(t, n, s), p, g; 11933 t.dist(n) > s.dist(n) ? (p = s, 11934 g = t) : (p = t, 11935 g = s); 11936 let y = n.dist(f) 11937 , m = g.dist(f) / y 11938 , M = p.subtract(f).projectOn(n.subtract(f)).getLength() / y 11939 , S = Math.acos(He(1, M)) 11940 , x = 4 / 3 * y * Os(S / 4); 11941 t.dist(n) > s.dist(n) ? (o = t.subtract(f).multiplyScalar(c), 11942 i = o.negate().setLength(x * m)) : (i = s.subtract(f).multiplyScalar(c), 11943 o = i.negate().setLength(x * m)) 11944 } else { 11945 let c = 1.3333333333333333 * a * Os(d / 4) 11946 , f = 4 / 3 * a * Os(u / 4) 11947 , p = n.subtract(r); 11948 o = new B(-p.y,p.x).setLength(c), 11949 i = new B(p.y,-p.x).setLength(f) 11950 } 11951 } 11952 l[4] = l[6] + o.x, 11953 l[5] = l[7] + o.y, 11954 e[2] = e[0] + i.x, 11955 e[3] = e[1] + i.y, 11956 e[4] = e[6], 11957 e[5] = e[7] 11958} 11959const eu = "corner" 11960 , yt = "smooth"; 11961class ut { 11962 _index; 11963 _singlePathModel; 11964 _controlPointIn = null; 11965 _controlPointOut = null; 11966 _nodeType = eu; 11967 radius = 0; 11968 constructor(e, t) { 11969 e != null && (this._index = t, 11970 this._singlePathModel = e) 11971 } 11972 get type() { 11973 return "node" 11974 } 11975 getPath() { 11976 return this._singlePathModel && this._singlePathModel.getPath() 11977 } 11978 getPathModel() { 11979 return this._singlePathModel && this._singlePathModel.getPathModel() 11980 } 11981 getPathModelId() { 11982 let e = this.getPathModel(); 11983 return e ? e.getModelId() : -1 11984 } 11985 getSinglePathModel() { 11986 return this._singlePathModel 11987 } 11988 getSinglePathModelId() { 11989 return this._singlePathModel ? this._singlePathModel.getModelId() : -1 11990 } 11991 getIndex() { 11992 return this._index 11993 } 11994 setIndex(e) { 11995 this._index = e 11996 } 11997 getPrevious() { 11998 let e = this._index 11999 , t = this._singlePathModel 12000 , n = e === 0; 12001 if (n && !t.isClosed()) 12002 return null; 12003 { 12004 let s = t.getNodePoints(); 12005 return s[n ? s.length - 1 : e - 1] 12006 } 12007 } 12008 getNext() { 12009 let e = this._index 12010 , t = this._singlePathModel 12011 , n = t.getNodePoints() 12012 , s = e === n.length - 1; 12013 return s && !t.isClosed() ? null : n[s ? 0 : e + 1] 12014 } 12015 isStartNode() { 12016 return this._singlePathModel != null && this._index === 0 12017 } 12018 isEndNode() { 12019 let e = this._singlePathModel; 12020 return e != null && this._index === (e.isClosed() ? 0 : e.getCurveCount()) 12021 } 12022 getV0() { 12023 let e = this._singlePathModel.getPath() 12024 , t = this._index; 12025 return t === 0 && !e.isClosed() ? null : e.getCurve(t === 0 ? -1 : t - 1).v 12026 } 12027 getV1() { 12028 let e = this._singlePathModel.getPath(); 12029 return this._index === e.getCurveCount() ? null : e.getCurve(this._index).v 12030 } 12031 getV0Transformed() { 12032 let e = this._singlePathModel 12033 , t = this._index; 12034 if (t === 0 && !e.isClosed()) 12035 return null; 12036 { 12037 let n = e.getTransformedCurveValues(); 12038 return n[(t === 0 ? n.length : t) - 1] 12039 } 12040 } 12041 getV1Transformed() { 12042 let e = this._singlePathModel 12043 , t = this._index; 12044 return t === e.getCurveCount() ? null : e.getTransformedCurveValues()[t] 12045 } 12046 set(e, t, n, s, o, i) { 12047 this.x = e, 12048 this.y = t, 12049 this.inX = n, 12050 this.inY = s, 12051 this.outX = o, 12052 this.outY = i 12053 } 12054 get x() { 12055 return this._index === 0 ? this.getV1()[0] : this.getV0()[6] 12056 } 12057 set x(e) { 12058 let t = this.getV0() 12059 , n = this.getV1(); 12060 t != null && (t[6] = e), 12061 n != null && (n[0] = e) 12062 } 12063 get y() { 12064 return this._index === 0 ? this.getV1()[1] : this.getV0()[7] 12065 } 12066 set y(e) { 12067 let t = this.getV0() 12068 , n = this.getV1(); 12069 t != null && (t[7] = e), 12070 n != null && (n[1] = e) 12071 } 12072 get inX() { 12073 let e = this.getV0(); 12074 return e != null ? e[4] : null 12075 } 12076 set inX(e) { 12077 let t = this.getV0(); 12078 t != null && (t[4] = e) 12079 } 12080 get inY() { 12081 let e = this.getV0(); 12082 return e != null ? e[5] : null 12083 } 12084 set inY(e) { 12085 let t = this.getV0(); 12086 t != null && (t[5] = e) 12087 } 12088 setIn(e, t) { 12089 let n = this.getV0(); 12090 n != null && (n[4] = e, 12091 n[5] = t) 12092 } 12093 get outX() { 12094 let e = this.getV1(); 12095 return e != null ? e[2] : null 12096 } 12097 set outX(e) { 12098 let t = this.getV1(); 12099 t != null && (t[2] = e) 12100 } 12101 get outY() { 12102 let e = this.getV1(); 12103 return e != null ? e[3] : null 12104 } 12105 set outY(e) { 12106 let t = this.getV1(); 12107 t != null && (t[3] = e) 12108 } 12109 setOut(e, t) { 12110 let n = this.getV1(); 12111 n != null && (n[2] = e, 12112 n[3] = t) 12113 } 12114 get xTransformed() { 12115 return this._index === 0 ? this.getV1Transformed()[0] : this.getV0Transformed()[6] 12116 } 12117 set xTransformed(e) { 12118 let t = this.getV0Transformed() 12119 , n = this.getV1Transformed(); 12120 t != null && (t[6] = e), 12121 n != null && (n[0] = e) 12122 } 12123 move(e, t, n=0, s=0, o=0, i=0) { 12124 let r = this.getV0(); 12125 r != null && (r[4] += n, 12126 r[5] += s, 12127 r[6] += e, 12128 r[7] += t); 12129 let a = this.getV1(); 12130 a != null && (a[0] += e, 12131 a[1] += t, 12132 a[2] += o,
12133 a[3] += i) 12134 } 12135 moveTransformed(e, t, n=0, s=0, o=0, i=0) { 12136 let r = this.getV0Transformed(); 12137 r != null && (r[4] += n, 12138 r[5] += s, 12139 r[6] += e, 12140 r[7] += t); 12141 let a = this.getV1Transformed(); 12142 a != null && (a[0] += e, 12143 a[1] += t, 12144 a[2] += o, 12145 a[3] += i) 12146 } 12147 get yTransformed() { 12148 return this._index === 0 ? this.getV1Transformed()[1] : this.getV0Transformed()[7] 12149 } 12150 set yTransformed(e) { 12151 let t = this.getV0Transformed() 12152 , n = this.getV1Transformed(); 12153 t != null && (t[7] = e), 12154 n != null && (n[1] = e) 12155 } 12156 get inXTransformed() { 12157 let e = this.getV0Transformed(); 12158 return e != null ? e[4] : null 12159 } 12160 set inXTransformed(e) { 12161 let t = this.getV0Transformed(); 12162 t != null && (t[4] = e) 12163 } 12164 get inYTransformed() { 12165 let e = this.getV0Transformed(); 12166 return e != null ? e[5] : null 12167 } 12168 set inYTransformed(e) { 12169 let t = this.getV0Transformed(); 12170 t != null && (t[5] = e) 12171 } 12172 get outXTransformed() { 12173 let e = this.getV1Transformed(); 12174 return e != null ? e[2] : null 12175 } 12176 set outXTransformed(e) { 12177 let t = this.getV1Transformed(); 12178 t != null && (t[2] = e) 12179 } 12180 get outYTransformed() { 12181 let e = this.getV1Transformed(); 12182 return e != null ? e[3] : null 12183 } 12184 set outYTransformed(e) { 12185 let t = this.getV1Transformed(); 12186 t != null && (t[3] = e) 12187 } 12188 updateTransformedCoords(e=null) { 12189 let t = this.getV0() 12190 , n = this.getV1() 12191 , s = this.getV0Transformed() 12192 , o = this.getV1Transformed(); 12193 t != null && s != null && (e != null ? e.transformArray(t, s, 4, 8) : s.splice(4, 4, t[4], t[5], t[6], t[7])), 12194 n != null && o != null && (e != null ? e.transformArray(n, o, 0, 4) : o.splice(0, 4, n[0], n[1], n[2], n[3])) 12195 } 12196 get controlPointIn() { 12197 return this._controlPointIn || (this._controlPointIn = new Is(this,!0)), 12198 this._controlPointIn 12199 } 12200 get controlPointOut() { 12201 return this._controlPointOut || (this._controlPointOut = new Is(this,!1)), 12202 this._controlPointOut 12203 } 12204 equalsControlPointIn() { 12205 return (this.inX === null || this.inX === this.x) && (this.inY === null || this.inY === this.y) 12206 } 12207 equalsControlPointOut() { 12208 return (this.outX === null || this.outX === this.x) && (this.outY === null || this.outY === this.y) 12209 } 12210 getNodeType() { 12211 return this._nodeType 12212 } 12213 setSmooth(e=!0, t=!0) { 12214 let n = this.getV0() 12215 , s = this.getV1(); 12216 if (n == null || s == null) 12217 return; 12218 let o = n[4] === n[6] && n[5] === n[7] 12219 , i = s[0] === s[2] && s[1] === s[3]; 12220 if (e && t && (o && !i ? e = !1 : !o && i && (t = !1)), 12221 !e && !t) 12222 return; 12223 let r = Number.EPSILON, a; 12224 e ? t ? (a = Te(n, 1, 1).add(Te(s, 0, 1)), 12225 a.getLength() < r ? a = Te(s, 0, 1) : a.setLength(1)) : a = Te(s, 0, 1) : a = Te(n, 1, 1); 12226 let d = this.x 12227 , u = this.y 12228 , h = this.controlPointIn 12229 , c = this.controlPointOut; 12230 if (e) { 12231 let f = Se(h.x - d, h.y - u); 12232 f < r && (f = hp(n) / 3), 12233 this.controlPointIn.x = d - f * a.x, 12234 this.controlPointIn.y = u - f * a.y 12235 } 12236 if (t) { 12237 let f = Se(c.x - d, c.y - u); 12238 f < r && (f = hp(s) / 3), 12239 this.controlPointOut.x = d + f * a.x, 12240 this.controlPointOut.y = u + f * a.y 12241 } 12242 this._singlePathModel && this._singlePathModel.nodesUpdated() 12243 } 12244 setNodeType(e, t=!0) { 12245 this._nodeType !== e && (this._nodeType = e, 12246 e === yt && t && this.setSmooth(!0, !0)) 12247 } 12248 makeG1Continuous(e=!0, t=!0) { 12249 let n = this.inX 12250 , s = this.inY 12251 , o = this.outX 12252 , i = this.outY 12253 , r = this.x 12254 , a = this.y 12255 , d = Se(this.x - this.inX, this.y - this.inY) 12256 , u = Se(this.x - this.outX, this.y - this.outY); 12257 if (d > 0 && u > 0) 12258 if (e && t) { 12259 let h = Xm(n, s, o, i, r, a, !0); 12260 this.inX -= h.x, 12261 this.inY -= h.y, 12262 this.outX -= h.x, 12263 this.outY -= h.y 12264 } else if (e) 12265 this.outX = this.x - (this.outX - this.x) * d / u, 12266 this.outY = this.y - (this.outY - this.y) * d / u; 12267 else if (t) 12268 this.outX = this.x - (this.inX - this.x) * u / d, 12269 this.outY = this.y - (this.inY - this.y) * u / d; 12270 else { 12271 let h = Jt(this.inX, this.inY, this.outX, this.outY, this._x, this._y); 12272 this.x = h.x, 12273 this.y = h.y 12274 } 12275 } 12276 transform(e) { 12277 if (!e.isIdentity) { 12278 let t = this.getV0() 12279 , n = this.getV1(); 12280 e.transformArray(t, t, 4, 8), 12281 n[0] = t[6], 12282 n[1] = t[7], 12283 e.transformArray(n, n, 2, 4) 12284 } 12285 } 12286 invTransform(e) { 12287 if (!e.isIdentity) { 12288 let t = this.getV0() 12289 , n = this.getV1(); 12290 e.invTransformArray(t, t, 4, 8), 12291 n[0] = t[6], 12292 n[1] = t[7], 12293 e.invTransformArray(n, n, 2, 4) 12294 } 12295 } 12296 compare(e) {
12297 return e == null ? -1 : this.getSinglePathModelId() - e.getSinglePathModelId() || this.getIndex() - e.getIndex() 12298 } 12299 toCoords() { 12300 return [this.x, this.y, this.inX ?? this.x, this.inY ?? this.y, this.outX ?? this.x, this.outY ?? this.y] 12301 } 12302 toString() { 12303 return this._index + ": " + this.toCoords().toString() 12304 } 12305} 12306class Pi { 12307 _modelId; 12308 _pathModel; 12309 _path; 12310 _nodes; 12311 _transformedCurveValues = []; 12312 _isTransformedCurveValuesValid = !1; 12313 constructor(e, t) { 12314 this._modelId = $m(), 12315 this._pathModel = e, 12316 this._path = t, 12317 this._nodes = null, 12318 this.initPointsFromCurves() 12319 } 12320 getModelId() { 12321 return this._modelId 12322 } 12323 initPointsFromCurves() { 12324 let e = this._path.getCurveCount() 12325 , t = []; 12326 for (let n = 0; n < e; n++) 12327 t.push(new ut(this,n)); 12328 this.isClosed() || t.push(new ut(this,e)), 12329 this._nodes = t 12330 } 12331 isEmpty() { 12332 return this._path.isEmpty() 12333 } 12334 isClosed() { 12335 return this._path.isClosed() 12336 } 12337 setClosed(e, t=!0) { 12338 let n = this._path; 12339 if (e) { 12340 if (!n.isClosed()) { 12341 let s = n.getCurveCount(); 12342 n.close(t ? 1e-6 : -1), 12343 s === n.getCurveCount() && this._nodes.pop(), 12344 this._isTransformedCurveValuesValid = !1 12345 } 12346 } else if (n.isClosed()) { 12347 n.open(); 12348 let s = this._nodes; 12349 s.push(new ut(this,s.length)), 12350 this._isTransformedCurveValuesValid = !1 12351 } 12352 } 12353 getPath() { 12354 return this._path 12355 } 12356 getPathModel() { 12357 return this._pathModel 12358 } 12359 get path() { 12360 throw new Error("Use getPath() instead") 12361 } 12362 get pathModel() { 12363 throw new Error("Use getPathModel() instead") 12364 } 12365 getCurve(e) { 12366 return this._path.getCurve(e) 12367 } 12368 getCurveCount() { 12369 return this._path.getCurveCount() 12370 } 12371 getNodePoints() { 12372 return this._nodes 12373 } 12374 getNodePointAt(e) { 12375 let t = this._nodes; 12376 return this.isClosed() && (e %= t.length), 12377 e < 0 && (e += t.length), 12378 t[e] 12379 } 12380 getNodeCount() { 12381 return this._nodes.length 12382 } 12383 getAggregateTransform() { 12384 return this._pathModel.getAggregateTransform() 12385 } 12386 getSelfTransform() { 12387 return this._pathModel.getSelfTransform() 12388 } 12389 removeNodePoints(e, t) { 12390 if (t > 0) { 12391 let n = this._nodes; 12392 e < 0 && (e = n.length + e); 12393 let o = n[e + t - 1].getNext() 12394 , i = e + t === n.length - 1; 12395 n.splice(e, t); 12396 for (let r = e; r < n.length; r++) 12397 n[r].setIndex(r); 12398 this._path.removeCurves(o == null ? e - 1 : e, t, i), 12399 this._isTransformedCurveValuesValid = !1 12400 } 12401 } 12402 insertNodePoints(e, t, n) { 12403 if (t && t.length > 0) { 12404 let s = this._path 12405 , o = this._nodes 12406 , i = this.isClosed() 12407 , r = []; 12408 if (!i && e === o.length) { 12409 let a = o.at(-1) 12410 , d = t[0].coords; 12411 r.push([a.x, a.y, a.outX ?? a.x, a.outY ?? a.y, d[2] ?? d[0], d[3] ?? d[1], d[0], d[1]]) 12412 } 12413 if (t.length > 1) { 12414 let a = t[0].coords; 12415 for (let d = 1; d < t.length; d++) { 12416 let u = t[d].coords; 12417 r.push([a[0], a[1], a[4] ?? a[0], a[5] ?? a[1], u[2] ?? u[0], u[3] ?? u[1], u[0], u[1]]), 12418 a = u 12419 } 12420 } 12421 if (i || e < o.length) { 12422 let a = o.at(e === o.length ? 0 : e) 12423 , d = t.at(-1).coords; 12424 r.push([d[0], d[1], d[4] ?? d[0], d[5] ?? d[1], a.inX ?? a.x, a.inY ?? a.y, a.x, a.y]) 12425 } 12426 if (s.insertCurveValues(i || e < o.length ? e : e - 1, r), 12427 i || e > 0 && e < o.length) { 12428 let a = s.getCurve(e - 1).v 12429 , d = t[0].coords; 12430 a.splice(4, 4, d[2] ?? d[0], d[3] ?? d[1], d[0], d[1]) 12431 } 12432 t.forEach((a,d)=>{ 12433 let u = e + d 12434 , h = new ut(this,u); 12435 a.applyDataToNode(h, !1), 12436 o.splice(u, 0, h) 12437 } 12438 ); 12439 for (let a = e + t.length; a < o.length; a++) 12440 o[a].setIndex(a); 12441 if (n) { 12442 if (n[0]) { 12443 let a = o.at(i && e === 0 ? -1 : e - 1); 12444 a && a.setOut(...n[0]) 12445 } 12446 if (n[1]) { 12447 let a = o.at(i && e + t.length === o.length ? 0 : e + t.length); 12448 a && a.setIn(...n[1]) 12449 } 12450 } 12451 return this._isTransformedCurveValuesValid = !1, 12452 o.slice(e, e + t.length) 12453 } else 12454 return [] 12455 } 12456 shiftNodePoints(e) { 12457 if (this.isClosed() && e !== 0) { 12458 let t = this._nodes; 12459 e > 0 ? t.push(...t.splice(0, e)) : t.unshift(...t.splice(t.length + e, -e)), 12460 t.forEach((n,s)=>n.setIndex(s)), 12461 this._path.shiftCurves(e), 12462 this._isTransformedCurveValuesValid = !1 12463 } 12464 }
12465 insertCurveValues(e, t) { 12466 if (t && t.length > 0) { 12467 let n = this._path; 12468 e === null && (e = this._path.getCurveCount()); 12469 let s = this._nodes; 12470 n.insertCurveValues(e, t); 12471 for (let o = e; o < e + t.length; o++) 12472 s.splice(o, 0, new ut(this,o)); 12473 for (let o = e + t.length; o < s.length; o++) 12474 s[o].setIndex(o); 12475 this._isTransformedCurveValuesValid = !1 12476 } 12477 } 12478 appendCurveValues(e) { 12479 this.appendCurve(new Mt(e)) 12480 } 12481 appendCurve(e) { 12482 let t = this._path 12483 , n = this._nodes; 12484 t.appendCurve(e); 12485 let s = this.getNodeCount(); 12486 n.push(new ut(this,s)), 12487 this._isTransformedCurveValuesValid = !1 12488 } 12489 splitCurve(e, t) { 12490 this._path.splitCurve(e, t); 12491 let n = this._nodes 12492 , s = e + 1 12493 , o = new ut(this,s); 12494 n.splice(s, 0, o); 12495 for (let i = s + 1; i < n.length; i++) 12496 n[i].setIndex(i); 12497 if (this._isTransformedCurveValuesValid) { 12498 let i = this.getAggregateTransform() 12499 , r = this._path.getCurve(e) 12500 , a = this._path.getCurve(e + 1) 12501 , d = i.transformArray(r.v.slice()) 12502 , u = i.transformArray(a.v.slice()); 12503 this._transformedCurveValues.splice(e, 1, d, u) 12504 } 12505 return o 12506 } 12507 remove() { 12508 this._pathModel.removeSinglePathModel(this) 12509 } 12510 getBounds() { 12511 return this._path.getBoundsCoords() 12512 } 12513 applyTransformToPath(e) { 12514 this._path.applyTransform(e), 12515 this._isTransformedCurveValuesValid = !1 12516 } 12517 getTransformedBounds(e) { 12518 if (e = e ?? this.getAggregateTransform(), 12519 e.isIdentity) 12520 return this.getBounds(); 12521 let t = this.getTransformedCurveValues(e); 12522 return ft.calculateBoundsCoords(t) 12523 } 12524 getTransformedCurveValues(e) { 12525 if (e = e || this.getAggregateTransform(), 12526 !this._isTransformedCurveValuesValid || !this._transform.equals(e)) { 12527 let t = []; 12528 for (let n of this._path.getCurveIterator()) { 12529 let s = n.v; 12530 e != null && (s = e.transformArray(s.slice())), 12531 t.push(s) 12532 } 12533 return this._isTransformedCurveValuesValid = !0, 12534 this._transformedCurveValues = t, 12535 this._transform = e.clone(), 12536 t 12537 } else 12538 return this._transformedCurveValues 12539 } 12540 transformUpdated() { 12541 this._isTransformedCurveValuesValid = !1 12542 } 12543 nodesUpdated() { 12544 this._isTransformedCurveValuesValid = !1 12545 } 12546 setNodeTypes(e=[]) { 12547 let t = this._nodes; 12548 for (let n = 0; n < t.length; n++) { 12549 let s = t[n] 12550 , o = e[n]; 12551 if (o == null) { 12552 let i = s.inX 12553 , r = s.inY 12554 , a = s.x 12555 , d = s.y 12556 , u = s.outX 12557 , h = s.outY 12558 , c = a - i 12559 , f = d - r 12560 , p = u - a 12561 , g = h - d 12562 , y = Se(c, f) 12563 , m = Se(p, g); 12564 if (y < 1e-8 || m < 1e-8) 12565 o = "c"; 12566 else { 12567 let b = Math.atan2(c * g - f * p, c * p + f * g); 12568 ee(b) < tt / 180 * .1 && (o = "s") 12569 } 12570 e[n] = o 12571 } 12572 } 12573 t.forEach((n,s)=>{ 12574 let o = e[s] === "s" ? yt : eu; 12575 n.setNodeType(o) 12576 } 12577 ) 12578 } 12579 reverse() { 12580 let e = this._path.getCurves(); 12581 for (let t = 0, n = km(e.length / 2); t < n; t++) { 12582 let s = e.at(t) 12583 , o = e.at(-1 - t) 12584 , i = s.v 12585 , r = o.v; 12586 if (No(i, !0), 12587 i !== r) { 12588 No(r, !0); 12589 let a = i.slice(); 12590 wi(i, ...r), 12591 wi(r, ...a) 12592 } 12593 } 12594 this.nodesUpdated() 12595 } 12596} 12597class Jh { 12598 v; 12599 partOffsets = []; 12600 constructor(e) { 12601 this.v = e 12602 } 12603 isEmpty() { 12604 return this.partOffsets.length === 0 12605 } 12606 getTStart() { 12607 return this.partOffsets.at(0)?.t0 12608 } 12609 getTEnd() { 12610 return this.partOffsets.at(-1)?.t1 12611 } 12612 getPartOffsetData(e) { 12613 return this.partOffsets.at(e) 12614 } 12615 getFirstPartOffset() { 12616 return this.partOffsets.length === 0 ? null : this.partOffsets[0] 12617 } 12618 getLastPartOffset() { 12619 let e = this.partOffsets; 12620 return e.length === 0 ? null : e[e.length - 1] 12621 } 12622 getFirstPartOffsetValues() { 12623 return this.partOffsets.length === 0 ? null : this.partOffsets[0].vOffsetParts[0] 12624 } 12625 getLastPartOffsetValues() { 12626 if (this.partOffsets.length > 0) { 12627 let t = this.partOffsets[this.partOffsets.length - 1]; 12628 return t.vOffsetParts[t.vOffsetParts.length - 1] 12629 } 12630 } 12631 getStartOffsPoint() { 12632 let e = this.getFirstPartOffset(); 12633 if (e != null) { 12634 let t = e.vOffsetParts[0]; 12635 return new B(t[0],t[1]) 12636 } 12637 } 12638 getEndOffsPoint() { 12639 let e = this.getLastPartOffset(); 12640 if (e != null) { 12641 let t = e.vOffsetParts[e.vOffsetParts.length - 1]; 12642 return new B(t[6],t[7]) 12643 } 12644 } 12645 addPartOffset(e) { 12646 e.vOffsetParts.length > 0 && this.partOffsets.push(e) 12647 } 12648} 12649class mr { 12650 t0; 12651 t1; 12652 vPart; 12653 vOffsetParts; 12654 constructor(e, t, n, s) { 12655 this.t0 = n, 12656 this.t1 = s, 12657 this.vPart = e, 12658 this.vOffsetParts = t 12659 } 12660} 12661class h2 { 12662 _length; 12663 constructor(e) { 12664 this._length = e 12665 } 12666 getLength(e=1) { 12667 return this._length * this.toLengthParameter(e) 12668 } 12669 setLength(e) { 12670 this._length = e 12671 } 12672 fromLength(e) { 12673 return this.fromLengthParameter(e / this._length) 12674 } 12675 fromLengthParameter(e) {} 12676 toLengthParameter(e) {} 12677 getEqualArcLengthTs(e) { 12678 let t = []; 12679 for (let n = 1; n < e; n++) 12680 t[n - 1] = this.fromLengthParameter(n / e); 12681 return t 12682 } 12683} 12684class hs extends h2 { 12685 _partsData = []; 12686 constructor(e, t) { 12687 if (Ae(e)) 12688 return new Qw(e); 12689 let[n,s,o,i,r,a] = It(e, 1) 12690 , d = n * n + s * s 12691 , u = 2 * (n * o + s * i) 12692 , h = 2 * (n * r + s * a) + o * o + i * i 12693 , c = 2 * (o * r + i * a) 12694 , f = r * r + a * a 12695 , p = []; 12696 us(4 * d, 3 * u, 2 * h, c, p, null, 0, 1, !1), 12697 p.at(-1) !== 1 && p.push(1); 12698 let g = 0; 12699 for (let x = 0; x < p.length; x++) { 12700 let P = p[x]; 12701 if (P - g > .5) {
12702 p.splice(x, 0, (g + P) / 2); 12703 break 12704 } 12705 g = P 12706 } 12707 let y = x=>lt(Ee(0, (((d * x + u) * x + h) * x + c) * x + f)) 12708 , b = _w(y, 4, 0, ...p) 12709 , M = b.reduce((x,P)=>x + P, 0); 12710 if (t) { 12711 let x = eP(e) 12712 , P = x / M; 12713 for (let C = 0; C < b.length; C++) 12714 b[C] *= P; 12715 M = x 12716 } 12717 super(M); 12718 let S = this._partsData; 12719 if (M > 0) { 12720 let x = 0 12721 , P = 0 12722 , C = 0 12723 , T = 0 12724 , k = 0 12725 , D = lt(f) / M 12726 , I = 0; 12727 for (let F = 0; F < p.length; F++) 12728 if (x = P, 12729 C = T, 12730 k = D, 12731 P = p[F], 12732 I += b[F], 12733 P !== x) { 12734 T = I / M, 12735 D = y(P) / M; 12736 const Y = P - x 12737 , q = T - C 12738 , re = q / Y 12739 , ne = Math.abs(re - k) 12740 , te = Math.abs(D - re); 12741 let he = ne + te < 1e-12 ? .5 : ne / (ne + te); 12742 he = Math.max(.45, Math.min(.55, he)); 12743 const Me = x + he * Y 12744 , De = Me - x 12745 , ye = P - Me 12746 , _e = (2 * q - k * (De + Y) - D * ye) / (2 * De * Y) 12747 , Ge = k - 2 * _e * x 12748 , $e = C - x * (k - _e * x) 12749 , Re = (2 * q - k * De - D * (ye + Y)) / (-2 * ye * Y) 12750 , Be = D - 2 * Re * P 12751 , Ze = T - P * (D - Re * P) 12752 , Xe = (_e * Me + Ge) * Me + $e; 12753 S.push(_e, Ge, $e, Me, Xe, Re, Be, Ze, P, T) 12754 } 12755 } else 12756 S.push(0, 1, 0, 1, 1) 12757 } 12758 fromLengthParameter(e) { 12759 if (e === 0 || e === 1) 12760 return e; 12761 let t = this._partsData 12762 , n = 0 12763 , s = 0 12764 , o = 0; 12765 for (let i = 0; i < t.length; i += 5) 12766 if (n = t[i + 4], 12767 s = o, 12768 o = t[i + 3], 12769 n >= e) { 12770 let r = t[i] 12771 , a = t[i + 1] 12772 , d = t[i + 2]; 12773 return d -= e, 12774 He(o, Ee(s, Qm(h=>(r * h + a) * h + d, s - 1e-12, o + 1e-12))) 12775 } 12776 return 1 12777 } 12778 toLengthParameter(e) { 12779 let t = this._partsData; 12780 for (let n = 0; n < t.length; n += 5) 12781 if (t[n + 3] >= e) { 12782 let o = t[n] 12783 , i = t[n + 1] 12784 , r = t[n + 2] 12785 , a = (o * e + i) * e + r 12786 , d = t[n + 4]; 12787 return He(d, a) 12788 } 12789 return 1 12790 } 12791 sD(e) { 12792 let t = this._partsData 12793 , n = 0; 12794 for (let s = 0; s < t.length; s += 5) 12795 if (n = t[s + 3], 12796 n >= e) { 12797 let o = t[s] 12798 , i = t[s + 1]; 12799 return 2 * o * e + i 12800 } 12801 return 0 12802 } 12803 getPartCount() { 12804 return this._partsData.length / 5 12805 } 12806 getPartCoeffs(e) { 12807 return this._partsData.slice(e * 5, e * 5 + 3) 12808 } 12809 getPartT1(e) { 12810 return this._partsData[e * 5 + 3] 12811 } 12812 getPartS1(e) { 12813 return this._partsData[e * 5 + 4] 12814 } 12815 toDesmosString() { 12816 let e = "" 12817 , [t,n,s,o,i,r] = It(v, 1) 12818 , a = t * t + n * n 12819 , d = 2 * (t * s + n * o) 12820 , u = 2 * (t * i + n * r) + s * s + o * o 12821 , h = 2 * (s * i + o * r) 12822 , c = i * i + r * r; 12823 e += `f(x)=\\sqrt{(${a})x^4 + (${d})x^3 + (${u})x^2 + (${h})x + (${c})} 12824`; 12825 let f = this._partsData 12826 , p = 0 12827 , g = 0; 12828 for (let y = 0; y < f.length; y += 5) { 12829 p = g, 12830 g = f[y + 3], 12831 f[y + 4]; 12832 let m = f[y] 12833 , b = f[y + 1] 12834 , M = f[y + 2]; 12835 e += `(${m})x^2 + (${b})x + (${M})\\ \\ \\left\\{${p}<=x<=${g}\\right\\} 12836` 12837 } 12838 return e 12839 } 12840} 12841class Qw extends h2 { 12842 constructor(e) { 12843 let t = Math.hypot(e[0] - e.at(-2), e[1] - e.at(-1)); 12844 super(t) 12845 } 12846 fromLengthParameter(e) { 12847 return e 12848 } 12849 toLengthParameter(e) { 12850 return e 12851 } 12852 sD(e) { 12853 return 0 12854 } 12855 getPartCount() { 12856 return 1 12857 } 12858 getPartCoeffs(e) { 12859 return [0, 0, 1, 0] 12860 } 12861 getPartT1(e) { 12862 return 1 12863 } 12864} 12865let fa; 12866function eP(l) { 12867 return fa || (fa = document.createElementNS("http://www.w3.org/2000/svg", "path")), 12868 fa.setAttribute("d", `M${l[0]} ${l[1]}C${l[2]} ${l[3]} ${l[4]} ${l[5]} ${l[6]} ${l[7]}`), 12869 fa.getTotalLength() 12870} 12871function tP(l, e, t, n, s, o, i, r=!1) { 12872 return l === 0 ? us(e, t, n, s, o, i) : lP(e / l, t / l, n / l, s / l, o, i, r) 12873} 12874function lP(l, e, t, n, s, o, i=!1) { 12875 let r = 0; 12876 const a = nP(l, e, t, n) 12877 , d = l / 2 12878 , u = e / 6 + a / 2; 12879 let h; 12880 const c = t - l * u; 12881 if (n > 0) { 12882 const y = e - d ** 2 - 2 * u; 12883 h = y === 0 ? 0 : c / (2 * y) 12884 } else 12885 h = c === 0 ? 0 : 2 * (n - u ** 2) / c; 12886 let f; 12887 l === 0 && t === 0 ? f = e - 2 * u : h === 0 ? f = 2 * e / 3 - a - d ** 2 : f = c / (2 * h); 12888 const p = lt(ee(f)) 12889 , g = p * h; 12890 if (f <= 0) { 12891 let y = d + p 12892 , m = u + g 12893 , b = d - p 12894 , M = u - g; 12895 if (ee(M) < ee(m) ? M = n / m : m = n / M, 12896 ee(y) >
12896 ee(b) ? b = (l - y + y * (e - m - M) + m * (t - y * M)) / (1 + y ** 2 + m ** 2) : y = (l - b + M * (t - m * b) + b * (e - m - M)) / (1 + M ** 2 + b ** 2), 12897 r += fp(y, m, s, o, r), 12898 r += fp(b, M, s, o, r), 12899 i) 12900 for (let S = 0; S < r; S++) { 12901 const x = s[S] 12902 , P = (((x + l) * x + e) * x + t) * x + n; 12903 if (P !== 0) { 12904 const C = ((4 * x + 3 * l) * x + 2 * e) * x + t 12905 , T = x - P / C 12906 , k = (((T + l) * T + e) * T + t) * T + n; 12907 ee(k) < ee(P) && (s[S] = T) 12908 } 12909 } 12910 } 12911 return r 12912} 12913function fp(l, e, t, n, s) { 12914 let o = 0; 12915 const i = l ** 2 - 4 * e; 12916 if (i >= 0) { 12917 const a = (l < 0 ? -l + lt(i) : -l - lt(i)) / 2 12918 , d = a === 0 ? 0 : e / a; 12919 t[s] = a, 12920 t[s + 1] = d, 12921 o = 2 12922 } 12923 return o 12924} 12925function nP(l, e, t, n) { 12926 const s = e / 3 12927 , o = l * t - 4 * n - e * s 12928 , i = s * (8 * n + l * t - 2 * s * s) - t * t - n * l * l; 12929 return sP(o, i) 12930} 12931function sP(l, e) { 12932 if (e === 0) 12933 return l < 0 ? lt(-l) : 0; 12934 { 12935 const t = l / 3 12936 , n = e 12937 , s = t * t 12938 , o = n * n 12939 , i = -4 * t * s - o; 12940 if (i < 0) { 12941 const r = t > 0; 12942 let a, d, u; 12943 r ? (a = n, 12944 d = -s, 12945 u = -o - 2 * t * s) : (a = 1, 12946 d = t, 12947 u = n); 12948 const h = (u < 0 ? 1 : -1) * ee(a) * lt(-i) 12949 , c = -u + h 12950 , f = Tm(c / 2) 12951 , p = c === h ? -f : -d / f 12952 , g = d > 0 ? -u / (f * f + p * p + d) : f + p; 12953 return r ? -n / (g + t) : g 12954 } else { 12955 const r = lt(-l / 3) 12956 , a = 2 * l * r; 12957 return a === 0 ? 0 : 2 * r * jt(_m(Ee(-1, He(1, 3 * e / a))) / 3) 12958 } 12959 } 12960} 12961function hf(l) { 12962 if (l.length < 2) 12963 return l.length === 0 ? [] : [l[0].slice()]; 12964 let e = l[0] 12965 , t = l.at(-1) 12966 , n = c2(e[0], e[1], t[6], t[7]) 12967 , s = l.map(i=>n.transformArray(i.slice())) 12968 , o = s.find(i=>!Pl(i)); 12969 if (o == null) 12970 return [l[0]].slice(); 12971 { 12972 let i = s.findLast(p=>!Pl(p)) 12973 , r = i[6] 12974 , a = Te(o, 0, 1) 12975 , d = Te(i, 1, 1) 12976 , u = 0 12977 , h = 0; 12978 s.forEach(p=>{ 12979 u += s2(p, 0), 12980 h += Dw(p) 12981 } 12982 ); 12983 let c = f2(a, d, h, u, r) 12984 , f = n.invert(); 12985 return c.forEach(p=>{ 12986 f.transformArray(p), 12987 p[0] = e[0], 12988 p[1] = e[1], 12989 p[6] = t[6], 12990 p[7] = t[7] 12991 } 12992 ), 12993 c 12994 } 12995} 12996function c2(l, e, t, n) { 12997 let s = new oe; 12998 s.translate(-l, -e); 12999 let o = Se(t - l, n - e); 13000 if (o > 0) { 13001 let i = (n - e) / o 13002 , r = (t - l) / o; 13003 s.preRotate2(-i, r) 13004 } 13005 if (o > 1) { 13006 let i = 1 / o; 13007 s.preScale(i, i) 13008 } 13009 return s 13010} 13011function f2(l, e, t, n, s) { 13012 const o = l.y 13013 , i = l.x 13014 , r = e.y 13015 , a = e.x 13016 , d = o * a 13017 , u = i * r 13018 , h = o * i 13019 , c = d - u 13020 , f = s * s * o 13021 , p = s * r 13022 , g = s * t 13023 , y = t * i 13024 , m = t * a 13025 , b = -3 * s * h * c ** 2 13026 , M = c * (4 * f * (2 * u + d) + 60 * y * c) 13027 , S = f * p * (60 * u - 36 * d) + 20 * c * ((3 * u - d) * g - 14 * c * n) 13028 , x = c * (1120 * p * (g / 3 - n) + 400 * t * m) - p * p * (80 * y + 64 * f) 13029 , P = p * (2e3 / 3 * t * (m + s * p) - 1120 * p * n); 13030 let C = []; 13031 ee(b) > 1e-16 ? tP(b, M, S, x, P, C, null) : (C = [], 13032 us(M, S, x, P, C)); 13033 const T = []; 13034 us(4 * b, 3 * M, 2 * S, x, T), 13035 T.forEach(D=>{ 13036 ((12 * b * D + 6 * M) * D + 2 * S) * ((((b * D + M) * D + S) * D + x) * D + P) >= 0 && C.push(D) 13037 } 13038 ); 13039 const k = []; 13040 for (let D of C) 13041 if (D >= 0 && isFinite(D)) { 13042 let I = (D * o * s - 3.3333333333333335 * t) / (D * c / 2 + p); 13043 I >= 0 && isFinite(I) && k.push([0, 0, D * i, D * o, 1 - I * a, -I * r, 1, 0]) 13044 } 13045 return k 13046} 13047function Ir(l) { 13048 if (Ae(l)) 13049 return null; 13050 { 13051 let e = i2(l); 13052 if (e != null) { 13053 let t = e[0] 13054 , n = e[1]; 13055 if (p2(t, n)) { 13056 let s = 1 - n / (t + n - 3) 13057 , o = s * (s + 3 / (t - 3)) 13058 , i = (s - lt(Ee(0, s * s - 4 * o))) / 2; 13059 if (i > 0 && i < 1) { 13060 let r = o / i; 13061 if (r > i) { 13062 let a = i; 13063 i = r, 13064 r = a 13065 } 13066 return i < r ? [i, r] : [r, i] 13067 } else 13068 return null 13069 } else 13070 return null 13071 } 13072 } 13073} 13074function oP(l) { 13075 if (Ae(l)) 13076 return !1; 13077 { 13078 let e = i2(l); 13079 return e == null ? !1 : p2(e[0], e[1]) 13080 } 13081} 13082function p2(l, e) { 13083 return l <= 1 && e <= 1 && e <= (l + 1) * (3 - l) / 4 && e >= l * (3 - l) / 3 && (l <= 0 || l >= 4 || (2 * e + l) ** 2 >= 3 * l * (4 - l)) 13084} 13085class g2 { 13086 isConstant() {} 13087 d(e) {} 13088 dD(e) {} 13089} 13090class Ns extends g2 { 13091 _d; 13092 constructor(e) { 13093 super(), 13094 this._d = e 13095 } 13096 clone() { 13097 return new Ns(this._d) 13098 } 13099 d(e) { 13100 return this._d 13101 } 13102 dD(e) { 13103 return 0 13104 } 13105 isConstant() { 13106 return !0 13107 } 13108 scale(e) { 13109 return this._d *= e, 13110 this 13111 } 13112 part(e, t) { 13113 return new Ns(this._d) 13114 } 13115 getMaxAbsDist() { 13116 return Math.abs(this._d) 13117 } 13118 getCoeffs(e) { 13119 return [0, 0, this._d] 13120 } 13121} 13122class un extends g2 { 13123 _constant; 13124 _coeffs0; 13125 _coeffs1; 13126 _sSplit; 13127 _d0istMaxAbs; 13128 constructor(e=1, t=0, n=0, s=0, o=0, i=0, r=0) { 13129 super(), 13130 this.set(e, t, n, s, o, i, r) 13131 } 13132 setStartEndProperties(e, t, n=0, s=0) { 13133 if (e === t && n === 0 && s === 0) 13134 this.set(1, 0, 0, e); 13135 else { 13136 let o = .5; 13137 const i = (2 * (t - e) - n * (o + 1) + s * (o - 1)) / (2 * o) 13138 , r = n 13139 , a = e 13140 , d = (2 * (t - e) - n * o + s * (o - 2)) / (2 * (o - 1)) 13141 , u = s - 2 * d 13142 , h = t - (s - d); 13143 this.set(o, i, r, a, d, u, h) 13144 } 13145 } 13146 clone() { 13147 let e = this._coeffs0 13148 , t = this._coeffs1; 13149 return new un(this._sSplit,e[0],e[1],e[2],t?.[0],t?.[1],t?.[2]) 13150 } 13151 set(e, t, n, s, o, i, r) { 13152 this._coeffs0 = [t, n, s], 13153 this._sSplit = e, 13154 t === 0 && n === 0 && e === 1 ? this._constant = !0 : (this._constant = !1, 13155 this._coeffs1 = [o, i, r]), 13156 this._d0istMaxAbs = Ee(ee(this.d(0)), ee(this.d(1))) 13157 } 13158 isConstant() { 13159 return this._constant 13160 } 13161 d(e) { 13162 if (this._constant) 13163 return this._coeffs0[2]; 13164 { 13165 let t = this._sSplit 13166 , [n,s,o] = e <= t ? this._coeffs0 : this._coeffs1; 13167 return (n * e + s) * e + o 13168 } 13169 } 13170 dD(e) { 13171 if (this._constant) 13172 return 0; 13173 { 13174 let t = this._sSplit 13175 , [n,s] = e <= t ? this._coeffs0 : this._coeffs1; 13176 return 2 * n * e + s 13177 } 13178 } 13179 part(e, t) { 13180 if (this._constant) 13181 return new Ns(this._coeffs0[2]); 13182 { 13183 let n = this._sSplit, s, o; 13184 e <= n && (s = pp(this._coeffs0, e, t)), 13185 t > n && (o = pp(this._coeffs1, e, t)); 13186 let i; 13187 return e >= n ? (i = 1, 13188 s = o, 13189 o = null) : t < n ? i = 1 : i = (n - e) / (t - e), 13190 new un(i,s[0],s[1],s[2],o?.[0],o?.[1],o?.[2]) 13191 } 13192 } 13193 scale(e) { 13194 let t = this._coeffs0; 13195 for (let s = 0; s < t.length; s++) 13196 t[s] *= e; 13197 let n = this._coeffs1; 13198 if (n) 13199 for (let s = 0; s < n.length; s++) 13200 n[s] *= e; 13201 return this._d0istMaxAbs *= e, 13202 this 13203 } 13204 getMaxAbsDist() { 13205 return this._d0istMaxAbs 13206 } 13207 getCoeffs(e) { 13208 return e <= this._sSplit ? this._coeffs0 : this._coeffs1 13209 } 13210} 13211function pp(l, e, t) { 13212 let[n,s,o] = l; 13213 const i = t - e; 13214 return [n * (i * i), i * (2 * n * e + s), (n * e + s) * e + o] 13215} 13216function Rs(l, e, t) { 13217 let n = new Jh(l); 13218 if (Pl(l)) 13219 return n; 13220 let s = e.d(0) 13221 , o = e.d(1); 13222 if (t = t ?? (ee(s) + ee(o)) / 2 * .05, 13223 s === 0 && o === 0) { 13224 let i = new mr(l,[l.slice(0)],0,1); 13225 n.addPartOffset(i) 13226 } else if (e.isConstant() && Ae(l)) { 13227 let i = Ro(l, 0, s) 13228 , r = Ro(l, 1, o) 13229 , a = l[0] + i.x 13230 , d = l[1] + i.y 13231 , u = l[6] + r.x 13232 , h = l[7] + r.y 13233 , c = [a, d, a, d, u, h, u, h] 13234 , f = new mr(l,[c],0,1); 13235 n.addPartOffset(f) 13236 } else { 13237 let i = new hs(l) 13238 , r = rP(l, e, i) 13239 , a = 0; 13240 for (let d = 0; d < r.length; ) { 13241 let u = r[d++] 13242 , h = r[d++] 13243 , c = Ln(l, u, h); 13244 if (!Pl(c)) { 13245 let f = e.part(i.toLengthParameter(u), i.toLengthParameter(h)
13245) 13246 , p = Go(c, f, t); 13247 if (p.length > 0) { 13248 let g = new mr(c,p,u,h); 13249 n.addPartOffset(g), 13250 a += g.vOffsetParts.length 13251 } 13252 } 13253 } 13254 } 13255 return n 13256} 13257function Go(l, e, t) { 13258 if (Vs(l) < Number.EPSILON) 13259 return null; 13260 let n = je(l, 0, e.d(0)) 13261 , s = [] 13262 , o = Bu(l, n, e, t); 13263 if (o != null) 13264 Vs(o) > Number.EPSILON && s.push(o); 13265 else { 13266 let i = [[l.slice(), 0, 1]] 13267 , r = new hs(l); 13268 const a = 10; 13269 let d = n 13270 , u = 0; 13271 for (let h = 0; h < i.length; h++) { 13272 let c = i[h] 13273 , f = c[0]; 13274 if (!Pl(f)) { 13275 let p = c[1]; 13276 for (; u < a; ) { 13277 let g = c[2] 13278 , y = e.part(r.toLengthParameter(p), r.toLengthParameter(g)) 13279 , m = u >= a 13280 , b = Bu(f, d, y, t, m); 13281 if (b == null) { 13282 let M = aP(f, u) 13283 , S = dP(f, M); 13284 if (u++, 13285 S != null) { 13286 let x = p + (g - p) * M; 13287 i.splice(h + 1, 0, [S, x, g]), 13288 c[2] = x 13289 } else 13290 b = Bu(f, d, y, t, !0) 13291 } 13292 if (b != null) { 13293 Pl(b) || (d.set(b[6], b[7]), 13294 s.push(b)); 13295 break 13296 } 13297 } 13298 } 13299 } 13300 } 13301 return s 13302} 13303function Bu(l, e, t, n, s=!1) { 13304 let o = e.x 13305 , i = e.y; 13306 if (Ae(l)) { 13307 let r = Ro(l, 1, t.d(1)) 13308 , a = l[6] + r.x 13309 , d = l[7] + r.y; 13310 return [o, i, o, i, a, d, a, d] 13311 } else { 13312 let r = new hs(l) 13313 , a = iP(l, t, r) 13314 , d = gp(l, a, t, r, n); 13315 if (d || (d = m2(l, t, r, e), 13316 s || (d = gp(l, [d], t, r, n))), 13317 d) 13318 return d.splice(0, 2, o, i), 13319 d 13320 } 13321} 13322function iP(l, e, t) { 13323 let n = e.d(0), s = e.d(1), o = je(l, 0, n), i = je(l, 1, s), r = c2(o.x, o.y, i.x, i.y), a = r.transformXY(i.clone()).x, d = a / o.dist(i), u = r.transformArray(l.slice()), h = e.clone().scale(d), {area: c, mx: f} = hP(u, h, t), p, g; 13324 if (h.isConstant() ? (p = Te(u, 0, 1), 13325 g = Te(u, 1, 1)) : (p = Zh(u, 0, h, t).setLength(1), 13326 g = Zh(u, 1, h, t).setLength(1)), 13327 ee(f) < 1e-12) 13328 return []; 13329 let y = f2(p, g, c, f, a) 13330 , m = r.invert(); 13331 return y.forEach(b=>{ 13332 m.transformArray(b, b, 2, 5), 13333 b[0] = o.x, 13334 b[1] = o.y, 13335 b[6] = i.x, 13336 b[7] = i.y 13337 } 13338 ), 13339 y 13340} 13341function m2(l, e, t, n) { 13342 if (pr(l) === 0) 13343 return [n.x, n.y, n.x, n.y, n.x, n.y, n.x, n.y]; 13344 { 13345 let o = je(l, 1, e.d(1)) 13346 , i = o.dist(n) / 3 13347 , r = Te(l, 0, i) 13348 , a = Te(l, 1, i) 13349 , d = 1e-6 13350 , u = t.toLengthParameter(d) 13351 , h = r.getAngleTo(je(l, d, e.d(u)).subtract(n)); 13352 r.rotate(h, 0, 0, !0); 13353 let c = t.toLengthParameter(1 - d) 13354 , f = a.getAngleTo(o.subtract(je(l, 1 - d, e.d(c)))); 13355 return a.rotate(f, 0, 0, !0), 13356 [n.x, n.y, n.x + r.x, n.y + r.y, o.x - a.x, o.y - a.y, o.x, o.y] 13357 } 13358} 13359function rP(l, e, t) { 13360 let n = .5; 13361 if (kw(l, n) * e.d(t.toLengthParameter(n)) >= 0 && uf(l, 0, 1).length === 0) 13362 return [0, 1]; 13363 let s = uP(l, e, t); 13364 s.length === 0 ? s.push(0, 1) : (s[0] !== 0 && s.unshift(0), 13365 s[s.length - 1] !== 1 && s.push(1)); 13366 let o = []; 13367 for (let i = 1; i < s.length; i++) { 13368 let r = (s[i - 1] + s[i]) / 2 13369 , a = Zh(l, r, e, t); 13370 Te(l, r).dot(a) > 0 && o.push(s[i - 1], s[i]) 13371 } 13372 return o 13373} 13374function aP(l, e=-1) { 13375 if (e === 0) { 13376 let n = Or(l, !0, !1)[0] ?? -1 13377 , s = 1e-9; 13378 if (n > s && n < 1 - s) 13379 return n 13380 } 13381 let t; 13382 if (e === 1) { 13383 let n = Math.abs(Wh(l, 0)) 13384 , s = Math.abs(Wh(l, 1)); 13385 t = n / (n + s) 13386 } else if (e % 3) { 13387 let n = Te(l, 0, 1) 13388 , s = Te(l, 1, 1); 13389 if (ee(n.cross(s)) < 1e-6) 13390 t = .5; 13391 else { 13392 let o = n.add(s, !0) 13393 , i = Ew(l, o); 13394 t = i.length === 1 ? i[0] : .5 13395 } 13396 } else 13397 t = .5; 13398 return t = Math.max(.1, Math.min(.9, t)), 13399 t 13400} 13401function dP(l, e) { 13402 let t = Number.EPSILON; 13403 if (e > t && e < 1 - t) { 13404 let n = dn(l, e) 13405 , s = n[0] 13406 , o = n[1]; 13407 if (Vs(s) > t && Vs(o) > t) 13408 return wi(l, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7]), 13409 o 13410 } 13411 return null 13412} 13413function uP(l, e, t) { 13414 const n = [] 13415 , s = e._sSplit == null ? 1 : t.fromLengthParameter(e._sSplit) 13416 , [o,i,r,a,d,u] = It(l, 1) 13417 , h = o * o + i * i 13418 , c = 2 * (o * r + i * a) 13419 , f = 2 * (o * d + i * u) + r * r + a * a 13420 , p = 2 * (r * d + a * u) 13421 , g = d * d + u * u 13422 , y = g ** 2 13423 , m = p ** 2 13424 , b = f ** 2 13425 , M = c ** 2 13426 , S = h ** 2 13427 , x = S * h 13428 , P = 3 * S * c 13429 , C = 3 * S * f + 3 * h * M 13430 , T = 3 * S * p + 6 * h * c * f + M * c 13431 , k = 3 * S * g + 6 * h * c * p + 3 * h * b + 3 * M * f 13432 , D = 6 * h * c * g + 6 * h * f * p + 3 * M * p + 3 * c * b 13433 , I = 6 * h * f * g + 3 * h * m + 3 * M * g + 6 * c * f * p + b * f 13434 , F = 6 * h * p * g + 6 * c * f * g + 3 * c * m + 3 * b * p 13435 , Y = 3 * h * y + 6 * c * p * g + 3 * b * g + 3 * f * m 13436 , q = 3 * c * y + 6 * f * p * g + m * p 13437 , re = 3 * f * y + 3 * m * g 13438 , ne = 3 * p * y 13439 , te = y * g
13440 , he = r * i - o * a 13441 , Me = 2 * (d * i - o * u) 13442 , De = d * a - r * u 13443 , ye = he * he 13444 , _e = 2 * he * Me 13445 , Ge = 2 * he * De + Me * Me 13446 , $e = 2 * Me * De 13447 , Re = De * De 13448 , Be = (Xe,dt,Qe)=>{ 13449 let Ct = Jd(Xe); 13450 Qe !== 1 && e2(Ct, Qe), 13451 dt !== 0 && t2(Ct, dt / Qe); 13452 let R = qr(Ct).map(K=>K[0]); 13453 if (R.length > 0) 13454 for (let K = 0; K < R.length; K++) { 13455 let Q = R[K] 13456 , J = dt + Q * (Qe - dt); 13457 isFinite(J) && e.d(t.toLengthParameter(J)) * Nl(l, J) > 0 && n.push(J) 13458 } 13459 } 13460 ; 13461 let Ze; 13462 if (e.isConstant()) { 13463 const Xe = e.d(0) ** 2; 13464 Ze = [Re * Xe - te, $e * Xe - ne, Ge * Xe - re, _e * Xe - q, ye * Xe - Y, -F, -I, -D, -k, -T, -C, -P, -x], 13465 Be(Ze, 0, 1) 13466 } else { 13467 let Xe = 0 13468 , dt = 0; 13469 for (let Qe = 0; Qe < t.getPartCount(); Qe++) { 13470 Xe = dt, 13471 dt = t.getPartT1(Qe); 13472 const [Ct,R,U] = t.getPartCoeffs(Qe); 13473 dt > s && Xe < s && (dt = s, 13474 Qe--); 13475 const K = t.getPartS1(Qe) 13476 , [Q,J,le] = e.getCoeffs(K) 13477 , A = Q * Ct * Ct 13478 , L = 2 * Q * Ct * R 13479 , G = Q * (2 * Ct * U + R * R) + J * Ct 13480 , X = 2 * Q * R * U + J * R 13481 , ue = Q * U * U + J * U + le 13482 , Z = A * A 13483 , H = 2 * A * L 13484 , W = 2 * A * G + L * L 13485 , fe = 2 * A * X + 2 * L * G 13486 , we = 2 * A * ue + 2 * L * X + G * G 13487 , Fe = 2 * L * ue + 2 * G * X 13488 , We = 2 * G * ue + X * X 13489 , Ye = 2 * X * ue 13490 , Vt = ue * ue; 13491 let al = [Vt * Re - te, Ye * Re + Vt * $e - ne, We * Re + Ye * $e + Vt * Ge - re, Fe * Re + We * $e + Ye * Ge + Vt * _e - q, we * Re + Fe * $e + We * Ge + Ye * _e + Vt * ye - Y, fe * Re + we * $e + Fe * Ge + We * _e + Ye * ye - F, W * Re + fe * $e + we * Ge + Fe * _e + We * ye - I, H * Re + W * $e + fe * Ge + we * _e + Fe * ye - D, Z * Re + H * $e + W * Ge + fe * _e + we * ye - k, Z * $e + H * Ge + W * _e + fe * ye - T, Z * Ge + H * _e + W * ye - C, Z * _e + H * ye - P, Z * ye - x]; 13492 Be(al, Xe, dt) 13493 } 13494 } 13495 return n 13496} 13497function gp(l, e, t, n, s=Number.MAX_VALUE) { 13498 let o, i = Number.MAX_VALUE, r = t.getMaxAbsDist() + s, a = gl(l), d = Ir(l) != null; 13499 for (let u of e) { 13500 let h = gl(u); 13501 if (h[0] < a[0] - r || h[1] < a[1] - r || h[2] > a[2] + r || h[3] > a[3] + r || h[0] > a[0] + r || h[1] > a[1] + r || h[2] < a[2] - r || h[3] < a[3] - r || d !== (Ir(u) != null)) 13502 continue; 13503 let f = new hs(u).getEqualArcLengthTs(4) 13504 , p = -1 13505 , g = uf(l); 13506 g.length === 1 && (p = g[0], 13507 f.push(p)), 13508 Fw(f, 0, Math.floor(f.length / 2)); 13509 let y = 0 13510 , m = null; 13511 for (let b of f) { 13512 m = ze(u, b, m); 13513 let M = Qd(l, m.x, m.y); 13514 M.push(1), 13515 M.unshift(0); 13516 let S = Number.MAX_VALUE; 13517 for (let x of M) { 13518 x = x < 0 ? 0 : x > 1 ? 1 : x; 13519 let P = n.toLengthParameter(x) 13520 , C = t.d(P) 13521 , T = je(l, x, C); 13522 if (b === p) { 13523 let D = t.dD(P) / n.getLength() 13524 , I = Math.atan(D) + Te(u, b).getAngle(!0) 13525 , F = Te(u, b).getAngle(!0); 13526 if (BS(I, F, !0, !1) > 2 && s !== Number.MAX_VALUE) 13527 continue 13528 } 13529 let k = T.dist(m); 13530 k < S && (S = k) 13531 } 13532 if (S > y && (y = S, 13533 S > s)) 13534 break 13535 } 13536 y < s && y < i && (o = u, 13537 i = y) 13538 } 13539 return o 13540} 13541function hP(l, e, t) { 13542 let n = 32 13543 , [s,o] = Zd(n) 13544 , [i,r,a,d,u,h,c,f] = It(l, 0) 13545 , p = 0 13546 , g = 0; 13547 for (let y = 0; y < n; y++) { 13548 let m = (1 + s[y]) / 2 13549 , b = (3 * i * m + 2 * a) * m + u 13550 , M = (3 * r * m + 2 * d) * m + h; 13551 if (b !== 0 || M !== 0) { 13552 let S = b ** 2 13553 , x = M ** 2 13554 , P = ((i * m + a) * m + u) * m + c 13555 , C = ((r * m + d) * m + h) * m + f 13556 , T = 6 * i * m + 2 * a 13557 , k = 6 * r * m + 2 * d 13558 , D = lt(S + x) 13559 , I = t.toLengthParameter(m) 13560 , F = e.d(I) 13561 , Y = t.sD(m) * e.dD(I) 13562 , q = P + M / D * F 13563 , re = C - b / D * F 13564 , ne = b + (S * (k * F + M * Y) - M * (b * F * T - x * Y)) / (D * (S + x)) 13565 , te = o[y] * re * ne; 13566 p += te, 13567 g += q * te 13568 } 13569 } 13570 return { 13571 area: .5 * p, 13572 mx: .5 * g 13573 } 13574} 13575function Zh(l, e, t, n, s) { 13576 let o = 1 - e, [i,r,a,d,u,h,c,f] = l, p = 3 * (((a - i) * o + 2 * e * (u - a)) * o + e ** 2 * (c - u)), g = 3 * (((d - r) * o + 2 * e * (h - d)) * o + e ** 2 * (f - h)), y = 6 * (o * (u - 2 * a + i
13576) + e * (c - 2 * u + a)), m = 6 * (o * (h - 2 * d + r) + e * (f - 2 * h + d)), b = n.toLengthParameter(e), M = t.d(b), S = n.sD(e) * t.dD(b), x, P, C = p * p, T = g * g, k = C + T, D = k * Math.sqrt(k); 13577 return D === 0 ? (x = 0, 13578 P = 0) : (x = p + (C * (m * M + g * S) - g * (p * M * y - T * S)) / D, 13579 P = g - (T * (y * M + p * S) - p * (g * M * m - C * S)) / D), 13580 s == null ? s = new B(x,P) : s.set(x, P), 13581 s 13582} 13583let cP = [311.06999999999994, 457.3899999999999, 337.28999999999996, 477.3699999999999, 311.43999999999994, 461.33999999999986, 311.61999999999995, 463.39999999999986] 13584 , fP = new un(1,0,0,.017246471268693626); 13585Rs(cP, fP, .002626516420561168); 13586let pP = [303.76, 523.8, 319.58, 548.41, 299.84999999999997, 528.15, 300.7, 530.3499999999999] 13587 , gP = new un(1,0,0,.002598810573805293); 13588Rs(pP, gP, .0010195706103660095); 13589let mP = [607.7873782899908, 717.6521639253509, 617.6559321811067, 723.3438465718451, 647.016408768641, 724.5326336390149, 636, 759] 13590 , yP = new un(.4645617002738846,0,3.1459047236261872,14.27345011508349,0,3.1459047236261872,14.27345011508349) 13591 , vP = .3146983392478183; 13592Go(mP, yP, vP); 13593let bP = [913, 427, 1099.929925460813, 355.0029173751741, 978.7158212183077, 374.32510242097356, 810, 545] 13594 , MP = new un(.5,8881784197001252e-31,5.993063410862268,2.794473022569542,0,5.993063410862268,2.7944730225695427) 13595 , SP = .11582009456001353; 13596Go(bP, MP, SP); 13597let wP = [819, 519, 836.6736274185445, 564.9061101171102, 825.9561985163507, 656.5517380420033, 817, 524] 13598 , PP = new un(.5000000000000002,0,-.8118004017115151,9.850761440528041,0,-.8118004017115151,9.850761440528041) 13599 , xP = .18889722479344567; 13600Go(wP, PP, xP); 13601let CP = [289, 430, 472.820281238745, 427.8374084560155, 308.0087273338735, 401.8597967233601, 274, 521] 13602 , _P = new un(.5,0,2.123420237115252,5.776683585292838,0,2.123420237115252,5.776683585292838) 13603 , TP = .13676787407700927; 13604Go(CP, _P, TP); 13605let kP = [656.4283397888372, 461.7813536797983, 654.1004954663939, 462.0375069992498, 639.4317471404269, 455.375271773788, 652.34, 464.4400000000002] 13606 , EP = new Ns(-1) 13607 , DP = .02; 13608Go(kP, EP, DP); 13609let OP = [914.0900000000003, 538.8700000000002, 954.5900000000003, 321.97000000000025, 895.5400000000003, 488.09000000000026, 865.2800000000002, 462.6500000000002] 13610 , AP = new Ns(3) 13611 , IP = .06; 13612Go(OP, AP, IP); 13613function LP(l, e) { 13614 let t = !1; 13615 Ee(ee(l[6] - l[0]), ee(l[7] - l[1])) < Ee(ee(e[6] - e[0]), ee(e[7] - e[1])) && ([l,e] = [e, l], 13616 t = !0); 13617 let n = ee(l[7] - l[1]) > ee(l[6] - l[0]) ? 1 : 0, s = n === 0 ? 1 : 0, o = l[n], i = l[n + 6], r = l[s], a = l[s + 6], d = (a - r) / (i - o), u; 13618 if (d === 0 || isNaN(d)) 13619 u = e; 13620 else { 13621 u = e.slice(); 13622 for (let f = 0; f < 8; f += 2) 13623 e[f + s] === a && e[f + n] === i ? u[f + s] = r : u[f + s] -= d * (e[f + n] - o) 13624 } 13625 let h = 1e-12, c; 13626 if (ee(r - u[s]) < h && ee(r - u[s + 6]) < h) { 13627 c = []; 13628 let f = u[n] 13629 , p = u[n + 6]; 13630 (f >= o && f <= i || f <= o && f >= i) && c.push([(f - o) / (i - o), 0]), 13631 (p >= o && p <= i || p <= o && p >= i) && c.push([(p - o) / (i - o), 1]), 13632 (o > f && o < p || o < f && o > p) && c.push([0, (o - f) / (p - f)]), 13633 (i > f && i < p || i < f && i > p) && c.push([1, (i - f) / (p - f)]), 13634 c.length === 0 && (c = null) 13635 } else { 13636 let f = jn(u, s, r); 13637 if (f.length > 0) 13638 for (let p = 0; p < f.length; p++) { 13639 let g = f[p] 13640 , y = Hl(u, g, n) 13641 , m = jn(l, n, y); 13642 m.length > 0 && (c || (c = []), 13643 c.push(...m.map(b=>[b, g]))) 13644 } 13645 } 13646 return t && c != null && c.forEach(f=>f.splice(0, 2, f[1], f[0])), 13647 c 13648} 13649function zu(l, e, t=!1) { 13650 let n = ee(e[7] - e[1]) > ee(e[6] - e[0]) ? 1 : 0, s = n === 0 ? 1 : 0, o = e[n], i = e[n + 6], r = e[s], a = e[s + 6], d = (a - r) / (i - o), u; 13651 if (d === 0 || isNaN(d)) 13652 u = l; 13653 else { 13654 u = l.slice(); 13655 for (let f = 0; f < 8; f += 2) 13656 l[f + s] === a && l[f + n] === i ? u[f + s] = r : u[f + s] -= d * (l[f + n] - o) 13657 } 13658 let h, c = 1e-12; 13659 if (ee(u[s] - r) < c && ee(u[s + 2] - r) < c && ee(u[s + 4] - r) < c && ee(u[s + 6] - r) < c) { 13660 h = []; 13661 let f = u[n] 13662 , p = u[n + 6]; 13663 (f >= o && f <= i || f <= o && f >= i) && h.push([0, (f - o) / (i - o)]), 13664 (p >= o && p <= i || p <= o && p >= i) && h.push([1, (p - o) / (i - o)]), 13665 (o > f && o < p || o < f && o > p) && h.push(...jn(l, n, o).map(g=>[g, 0])), 13666 (i > f && i < p || i < f && i > p) && h.push(...jn(l, n, i).map(g=>[g, 1])), 13667 h.length === 0 && (h = null) 13668 } else { 13669 let f = jn(u, s, e[s]); 13670 if (f.length > 0) 13671 for (let p = 0; p < f.length; p++) { 13672 let g = f[p] 13673 , y = Hl(u, g, n) 13674 , m = jn(e, n, y); 13675 if (m.length > 0) { 13676 h || (h = []); 13677 for (let b = 0; b < m.length; b++) 13678 h.push([g, m[b]]) 13679 } 13680 } 13681 } 13682 return h 13683} 13684function ni(l, e) { 13685 let t, n, s, o, i, r, a, d; 13686 if ((o = Ee(l[1], l[3], l[5], l[7])) < (a = He(e[1], e[3], e[5], e[7])) || (s = He(l[1], l[3], l[5], l[7])) > (d = Ee(e[1], e[3], e[5], e[7])) || (n = Ee(l[0], l[2], l[4], l[6])) < (i = He(e[0], e[2], e[4], e[6])) || (t = He(l[0], l[2], l[4], l[6])) > (r = Ee(e[0], e[2], e[4], e[6]))) 13687 return null; 13688 { 13689 const u = Ae(l) 13690 , h = Ae(e); 13691 if (u && h) 13692 return LP(l, e); 13693 { 13694 if (t === r && l[2] > t && l[4] > t && e[2] < r && e[4] < r || n === i && l[2] < n && l[4] < n && e[2] > i && e[4] > i || s === d && l[3] > s && l[5] > s && e[3] < d && e[5] < d || o === a && l[3] < o && l[5] < o && e[3] > a && e[5] > a) { 13695 const S = []; 13696 return l[0] === e[0] && l[1] === e[1] && S.push([0, 0]), 13697 l[0] === e[6] && l[1] === e[7] && S.push([0, 1]), 13698 l[6] === e[0] && l[7] === e[1] && S.push([1, 0]), 13699 l[6] === e[6] && l[7] === e[7] && S.push([1, 1]), 13700 S.length === 0 ? null : S 13701 } 13702 let c = l[6] === e[0] && l[7] === e[1] ? [1, 0] : l[0] === e[6] && l[1] === e[7] ? [0, 1] : null; 13703 if (c !== null && VP(l, e, c[0], c[1])) 13704 return [c]; 13705 const f = 1e-12 13706 , p = f * f; 13707 let g, y = l.slice(), m = e.slice(), b = Ee(1, r - i), M = Ee(1, d - a); 13708 for (let S = 0; S < 8; S += 2) 13709 y[S] = (y[S] - i) / b, 13710 m[S] = (m[S] - i) / b, 13711 y[S + 1] = (y[S + 1] - a) / M, 13712 m[S + 1] = (m[S + 1] - a) / M; 13713 if (h) 13714 g = zu(y, m); 13715 else if (u) 13716 g = zu(m, y), 13717 g?.forEach(S=>S.reverse()); 13718 else { 13719 if (g = NP(l, e), 13720 g != null) 13721 return g; 13722 let S = RP(m); 13723 if (ee((m[2] - m[0]) * (m[7] - m[1]) - (m[3] - m[1]) * (m[6] - m[0])) < 1e-12 && ee((m[6] - m[4]) * (m[7] - m[1]) - (m[7] - m[5]) * (m[6] - m[0])) < 1e-12) 13724 g = zu(y, m); 13725 else { 13726 let x = FP(y, S) 13727 , P = qr(x) 13728 , C = null 13729 , T = null 13730 , k = null; 13731 for (let D = 0; D < P.length; D++) { 13732 let I = P[D][0]; 13733 C = ze(y, I, C); 13734 let F = Vw(m, C, P[D][1]); 13735 T = ze(l, I, T); 13736 for (let Y = 0; Y < F.length; Y++) { 13737 let q = F[Y]; 13738 k = ze(e, q, k); 13739 let re = [I, q] 13740 , ne = T.distSquared(k); 13741 (ne > p && I > -.001 && I <= 1 + .001 && q > -.001 && q < 1 + .001 || I > -.001 && I < 0 || I > 1 && I < 1 + .001 || q > -.001 && q < 0 || q > 1 && q < 1 + .001) && (ne = y2(re, l, T, e, k, ne, p)), 13742 ne < 1e-12 && re[0] >= 0 && re[0] <= 1 && re[1] >= 0 && re[1] <= 1 && (g ??= [], 13743 g.push(re)) 13744 } 13745 } 13746 } 13747 } 13748 if (g != null && g.length > 1 && g.sort((S,x)=>S[0] - x[0]), 13749 y[0] === m[0] && y[1] === m[1] || y[0] === m[6] && y[1] === m[7]) { 13750 let S = null; 13751 if (g != null) 13752 for (let P = 0; P < g.length; P++) 13753 (S == null || g[P][0] < S[0]) && (S = g[P]); 13754 else 13755 g = [];
13756 let x = y[0] === m[0] && y[1] === m[1] ? 0 : 1; 13757 S != null && (S[0] < f || ze(y, S[0]).distSquared(y[0], y[1]) < p) ? g[0] = [0, x] : g.unshift([0, x]), 13758 g.length > 1 && g.at(0).every((P,C)=>g.at(1)[C] === P) && g.shift() 13759 } 13760 if (y[6] === m[0] && y[7] === m[1] || y[6] === m[6] && y[7] === m[7]) { 13761 let S = null; 13762 if (g) 13763 for (let P = 0; P < g.length; P++) 13764 (S == null || g[P][0] > S[0]) && (S = g[P]); 13765 else 13766 g = []; 13767 let x = y[6] === m[0] && y[7] === m[1] ? 0 : 1; 13768 S != null && (S[0] > 1 - f || ze(y, S[0]).distSquared(y[6], y[7]) < p) ? g[g.length - 1] = [1, x] : g.push([1, x]), 13769 g.length > 1 && g.at(-1).every((P,C)=>g.at(-2)[C] === P) && g.pop() 13770 } 13771 return g 13772 } 13773 } 13774} 13775function y2(l, e, t, n, s, o, i) { 13776 let r = l[0] 13777 , a = l[1] 13778 , d = null 13779 , u = null; 13780 for (let h = 0; h < 8; h++) { 13781 d = Te(e, r, null, d), 13782 u = Te(n, a, null, u); 13783 let c = Tl(t, d, s, u); 13784 c ??= B.interpolate(t, s); 13785 let f = c.subtract(t) 13786 , p = c.subtract(s, !0) 13787 , g = B.getLengthRatio(f, d) * (f.dot(d) > 0 ? 1 : -1) 13788 , y = B.getLengthRatio(p, u) * (p.dot(u) > 0 ? 1 : -1); 13789 isFinite(g) || (g = 0), 13790 isFinite(y) || (y = 0), 13791 r += g, 13792 a += y, 13793 t = ze(e, r, t), 13794 s = ze(n, a, s); 13795 let m = t.distSquared(s); 13796 if (m / o < .5) { 13797 if (l[0] = r, 13798 l[1] = a, 13799 o = m, 13800 o < i) 13801 break 13802 } else 13803 r += g / 2, 13804 a += y / 2 13805 } 13806 return o 13807} 13808function VP(l, e, t, n) { 13809 const s = t === 0 ? 0 : 6 13810 , o = n === 0 ? 0 : 6 13811 , i = l[s] 13812 , r = l[s + 1]; 13813 for (let a = 0; a < 2; a++) { 13814 const d = a === 0 ? l : e 13815 , u = a === 0 ? s : o; 13816 for (let h = 0; h < 8; h += 2) { 13817 if (h === u) 13818 continue; 13819 const c = d[h] - i 13820 , f = d[h + 1] - r; 13821 if (c === 0 && f === 0) 13822 continue; 13823 let p = 0 13824 , g = 0 13825 , y = 0 13826 , m = 0 13827 , b = !0; 13828 for (let M = 0; M < 8; M += 2) { 13829 const S = c * (l[M + 1] - r) - f * (l[M] - i); 13830 S < p ? (p = S, 13831 b = !1) : S > g && (g = S, 13832 b = !1) 13833 } 13834 for (let M = 0; M < 8; M += 2) { 13835 const S = c * (e[M + 1] - r) - f * (e[M] - i); 13836 S < y ? (y = S, 13837 b = !1) : S > m && (m = S, 13838 b = !1) 13839 } 13840 if (b) { 13841 let M = 0 13842 , S = 0 13843 , x = 0 13844 , P = 0; 13845 for (let C = 0; C < 8; C += 2) { 13846 const T = c * (l[C] - i) + f * (l[C + 1] - r); 13847 T < M ? M = T : T > S && (S = T) 13848 } 13849 for (let C = 0; C < 8; C += 2) { 13850 const T = c * (e[C] - i) + f * (e[C + 1] - r); 13851 T < x ? x = T : T > P && (P = T) 13852 } 13853 return S <= 0 && x >= 0 || M >= 0 && P <= 0 13854 } 13855 if (g <= 0 && y >= 0 || p >= 0 && m <= 0) 13856 return !0 13857 } 13858 } 13859 return !1 13860} 13861function NP(l, e) { 13862 const t = l[6] - 3 * (l[4] - l[2]) - l[0] 13863 , n = l[7] - 3 * (l[5] - l[3]) - l[1] 13864 , s = e[6] - 3 * (e[4] - e[2]) - e[0] 13865 , o = e[7] - 3 * (e[5] - e[3]) - e[1]; 13866 let i = ee(t) > ee(n); 13867 const r = i ? s / t : o / n; 13868 if ((isNaN(r) || r === 1) && r2(e, l)) 13869 return [[0, 0], [1, 1]]; 13870 if (ee(i ? o - n * r : s - t * r) < .001) { 13871 const a = Math.cbrt(r) 13872 , d = a * a; 13873 let[u,h,c,f,p,g,y,m] = It(l, 0) 13874 , [b,M,S,x,P,C,T,k] = It(e, 0); 13875 const D = (S / d - c) / (3 * u) || 0 13876 , I = D * D 13877 , F = I * D; 13878 if (ee(x - (3 * h * D + f) * d) < .01 && ee(P - (3 * u * I + 2 * c * D + p) * a) < .01 && ee(C - (3 * h * I + 2 * f * D + g) * a) < .001 && ee(T - (u * F + c * I + p * D + y)) < .01 && ee(k - (h * F + f * I + g * D + m)) < .01 && (ee(x - (3 * h * D + f) * d) < 1e-9 || ee(k - (h * F + f * I + g * D + m)) < 1e-9)) { 13879 let Y = l[0] === e[0] && l[1] === e[1] ? 0 : l[0] === e[6] && l[1] === e[7] ? 1 : -D / a 13880 , q = l[6] === e[0] && l[7] === e[1] ? 0 : l[6] === e[6] && l[7] === e[7] ? 1 : (1 - D) / a 13881 , re = e[0] === l[0] && e[1] === l[1] ? 0 : e[0] === l[6] && e[1] === l[7] ? 1 : D 13882 , ne = e[6] === l[0] && e[7] === l[1] ? 0 : e[6] === l[6] && e[7] === l[7] ? 1 : a + D 13883 , te = ze(l, 0) 13884 , he = ze(l, 1) 13885 , Me = ze(e, 0) 13886 , De = ze(e, 1) 13887 , ye = []; 13888 re = ha(l, Me, re), 13889 re >
13889= 0 && re <= 1 && ye.push([re, 0]), 13890 ne = ha(l, De, ne), 13891 ne >= 0 && ne <= 1 && ye.push([ne, 1]), 13892 ye.length < 2 && (Y = ha(e, te, Y), 13893 Y > 0 && Y < 1 && ye.push([0, Y])), 13894 ye.length < 2 && (q = ha(e, he, q), 13895 q > 0 && q < 1 && ye.push([1, q])); 13896 let _e = He(0, Y, q) 13897 , Ge = Ee(1, q, Y) 13898 , $e = Ln(e, _e, Ge) 13899 , Re = Ir($e); 13900 if (Re != null) { 13901 let Be = Re[0] * (Ge - _e) + _e, Ze = Re[1] * (Ge - _e) + _e, Xe = Be * a + D, dt = Ze * a + D, Qe = Be >= 0 && Be <= 1, Ct = Ze >= 0 && Ze <= 1, R = Xe >= 0 && Xe <= 1, U = dt >= 0 && dt <= 1, K; 13902 if (R && Ct && !(Qe || U) ? K = [Xe, Ze] : U && Qe && !(R || Ct) && (K = [dt, Be]), 13903 K) { 13904 let Q = ze(l, K[0]) 13905 , J = ze(e, K[1]) 13906 , le = Q.distSquared(J) 13907 , A = 1e-24; 13908 le > A && y2(K, l, Q, e, J, le, A), 13909 ye.pu
13909sh(K) 13910 } 13911 } 13912 if (ye.length > 0) 13913 return ye.sort((Be,Ze)=>Be[0] - Ze[0]), 13914 ye 13915 } 13916 } 13917} 13918function RP(l) { 13919 const [e,t,n,s,o,i,r,a] = It(l) 13920 , d = e * e 13921 , u = e * s 13922 , h = e * i 13923 , c = n * t 13924 , f = o * t 13925 , p = t * t 13926 , g = u - c 13927 , y = n * i - o * s 13928 , m = h - f 13929 , b = o * a - i * r 13930 , M = n * a - s * r 13931 , S = e * a - t * r 13932 , x = g * M 13933 , P = y + 3 * S 13934 , C = g * (y + S) - m * m 13935 , T = 2 * (m * S - x) 13936 , k = g * b + 2 * m * M - S * (y + P); 13937 return [b * C + M * (T + x) - (y + S) * S * S, C * i + T * s + k * t, -(C * o + T * n + k * e), g * (t * i - s * s) + 2 * m * t * s - P * p, g * (2 * n * s - h - f) + 2 * (P * e * t - m * (u + c)), g * (e * o - n * n) + 2 * m * e * n - P * d, -p * t, 3 * e * p, -3 * d * t, d * e] 13938} 13939function FP(l, e) { 13940 const [t,n,s,o,i,r,a,d,u,h] = e 13941 , [c,f,p,g,y,m,b,M] = l 13942 , S = c * c 13943 , x = c * p 13944 , P = (2 * c * y + 3 * p * p) * .2 13945 , C = (c * b + 9 * p * y) * .1 13946 , T = (2 * p * b + 3 * y * y) * .2 13947 , k = y * b 13948 , D = b * b 13949 , I = f * f 13950 , F = f * g 13951 , Y = (2 * f * m + 3 * g * g) * .2 13952 , q = (f * M + 9 * g * m) * .1 13953 , re = (2 * g * M + 3 * m * m) * .2 13954 , ne = m * M 13955 , te = M * M 13956 , he = c * f 13957 , Me = (c * g + p * f) * .5 13958 , De = (c * m + 3 * p * g + y * f) * .2 13959 , ye = (c * M + 9 * (p * m + y * g) + b * f) * .05 13960 , _e = (p * M + 3 * y * m + b * g) * .2 13961 , Ge = (y * M + b * m) * .5 13962 , $e = b * M 13963 , Re = a * S + n 13964 , Be = d * S + u * he + h * I + s 13965 , Ze = o * S + i * he + r * I 13966 , Xe = a * x + n 13967 , dt = d * x + u * Me + h * F + s 13968 , Qe = o * x + i * Me + r * F 13969 , Ct = a * P + n 13970 , R = d * P + u * De + h * Y + s 13971 , U = o * P + i * De + r * Y 13972 , K = a * C + n 13973 , Q = d * C + u * ye + h * q + s 13974 , J = o * C + i * ye + r * q 13975 , le = a * T + n 13976 , A = d * T + u * _e + h * re + s 13977 , L = o * T + i * _e + r * re 13978 , G = a * k + n 13979 , X = d * k + u * Ge + h * ne + s 13980 , ue = o * k + i * Ge + r * ne 13981 , Z = a * D + n 13982 , H = d * D + u * $e + h * te + s 13983 , W = o * D + i * $e + r * te 13984 , fe = t + c * Re + f * Be + Ze 13985 , we = t + (p * Re + g * Be + Ze + (c * Xe + f * dt + Qe) * 2) / 3 13986 , Fe = t + (y * Re + m * Be + Ze + (p * Xe + g * dt + Qe) * 6 + (c * Ct + f * R + U) * 5) / 12 13987 , We = t + (b * Re + M * Be + Ze + (y * Xe + m * dt + Qe) * 18 + (p * Ct + g * R + U) * 45 + (c * K + f * Q + J) * 20) / 84 13988 , Ye = t + ((b * Xe + M * dt + Qe) * 6 + (y * Ct + m * R + U) * 45 + (p * K + g * Q + J) * 60 + (c * le + f * A + L) * 15) / 126 13989 , Vt = t + ((b * Ct + M * R + U) * 15 + (y * K + m * Q + J) * 60 + (p * le + g * A + L) * 45 + (c * G + f * X + ue) * 6) / 126 13990 , al = t + ((b * K + M * Q + J) * 20 + (y * le + m * A + L) * 45 + (p * G + g * X + ue) * 18 + (c * Z + f * H + W)) / 84 13991 , Zs = t + ((b * le + M * A + L) * 5 + (y * G + m * X + ue) * 6 + (p * Z + g * H + W)) / 12 13992 , na = t + ((b * G + M * X + ue) * 2 + (y * Z + m * H + W)) / 3 13993 , dl = t + b * Z + M * H + W; 13994 return [fe, we, Fe, We, Ye, Vt, al, Zs, na, dl] 13995} 13996function BP(l, e) { 13997 let t = l.getCurves().map(u=>u.v) 13998 , n = t.length; 13999 if (n === 0) 14000 return new ft; 14001 const s = l.isClosed() 14002 , o = u=>(u % n + n) % n; 14003 let i = []; 14004 for (let u = 0; u < n; u++) { 14005 let h = e[u]; 14006 if (h && (s || u > 0)) { 14007 let c = t[o(u - 1)] 14008 , f = t[u]; 14009 i.push(ss(c, f, h, !0)) 14010 } else 14011 i.push(null) 14012 } 14013 const r = u=>{ 14014 if (!s && (u === 0 || u === n - 1)) 14015 return 1; 14016 let h = u 14017 , c = o(u + 1) 14018 , f = i[h] 14019 , p = i[c]; 14020 if (!f || !p || f[1] <= p[0]) 14021 return 1; 14022 let g = t[o(u - 1)] 14023 , y = t[u] 14024 , m = t[o(u + 1)]; 14025 return UP(g, y, m, f, p) 14026 } 14027 ; 14028 let a = []; 14029 for (let u = 0; u < n; u++) 14030 a.push(r(u)); 14031 let d = new Array(n).fill(!1); 14032 do { 14033 let u = 1 14034 , h = -1; 14035 for (let b = 0; b < a.length; b++) 14036 a[b] < u && (u = a[b], 14037 h = b); 14038 if (u >= 1) 14039 break; 14040 let c = h 14041 , f = o(h + 1); 14042 if (i[c]) { 14043 let b = t[o(c - 1)] 14044 , M = t[c] 14045 , S = i[c][2] * u; 14046 i[c] = ss(b, M, S, !1) 14047 } 14048 if (i[f]) { 14049 let b = t[o(f - 1)] 14050 , M = t[f] 14051 , S = i[f][2] * u; 14052 i[f] = ss(b, M, S, !1) 14053 } 14054 d[c] = !0, 14055 d[f] = !0, 14056 a[h] = 1; 14057 let p = o(h - 1) 14058 , g = p; 14059 if ((s || h > 0) && i[g] && i[c]) { 14060 if (!d[g]) { 14061 let b = t[o(g - 1)] 14062 , M = t[g] 14063 , S = i[c][0] 14064 , x = i[g][2]; 14065 x !== 0 && (i[g] = mp(b, M, x, S, !0)); 14066 let P = o(p - 1); 14067 (s || P >= 0) && (a[P] = r(P)) 14068 } 14069 a[p] = 1 14070 } 14071 let y = o(h + 1) 14072 , m = o(y + 1); 14073 if ((s || h < n - 1) && i[m] && i[f]) { 14074 if (!d[m]) { 14075 let b = t[y] 14076 , M = t[m] 14077 , S = i[f][1] 14078 , x = i[m][2]; 14079 x !== 0 && (i[m] = mp(b, M, x, S, !1)); 14080 let P = o(y + 1); 14081 (s || P < n) && (a[P] = r(P)) 14082 } 14083 a[y] = 1 14084 } 14085 } while (!0); 14086 return zP(t, i, s) 14087} 14088function zP(l, e, t) { 14089 let n = []; 14090 for (let o = 0; o < l.length; o++) { 14091 let i = l[o] 14092 , r = e[o] 14093 , a = e[o === e.length - 1 ? 0 : o + 1] 14094 , d = r?.[1] ?? 0 14095 , u = a?.[0] ?? 1; 14096 if (d === 0 && u === 1 ? n.push(i) : d < u && n.push(Ln(i, d, u)), 14097 a && (a[0] < 1 || a[1] > 0)) { 14098 let h = l[o === l.length - 1 ? 0 : o + 1]; 14099 n.push(...HP(i, h, a[0], a[1], a[2])) 14100 } 14101 } 14102 const s = n.map(o=>new Mt(o)); 14103 return new ft(s,t) 14104} 14105function UP(l, e, t, n, s) { 14106 const o = n[2] 14107 , i = s[2]; 14108 let r = 0 14109 , a = 1 14110 , d = Math.max(o, i) / 1e3; 14111 for (let u = 0; u < 16 && a - r > d; u++) { 14112 let h = (r + a) / 2 14113 , c = ss(l, e, o * h, !1) 14114 , f = ss(e, t, i * h, !1); 14115 c?.[1] <= f?.[0] ? r = h : a = h 14116 } 14117 return r 14118} 14119function mp(l, e, t, n, s) { 14120 let o = 0 14121 , i = t 14122 , r = .001; 14123 for (let a = 0; a < 16 && i - o > r; a++) { 14124 let d = (o + i) / 2 14125 , u = ss(l, e, d, !1); 14126 u != null && (s ? u[1] <= n : u[0] >= n) ? o = d : i = d 14127 } 14128 return ss(l, e, o, !1) 14129} 14130function ss(l, e, t, n=!0) { 14131 if (t === 0) 14132 return null; 14133 let s = Te(l, 1, 1).cross(Te(e, 0, 1)) 14134 , i = -Math.sign(s) * t 14135 , r = GP(l, e, i); 14136 if (r.length === 1) { 14137 let a = r[0]; 14138 return a.push(t), 14139 a 14140 } else if (r.length > 1) { 14141 let a = Number.MAX_VALUE 14142 , d = null; 14143 for (let u of r) { 14144 const h = 1 - u[0] + u[1]; 14145 h < a && (a = h, 14146 d = u) 14147 } 14148 return d.push(t), 14149 d 14150 } else if (n) { 14151 let a = t / 1e3 14152 , d = t 14153 , u = 0 14154 , h = [1, 0, 0]; 14155 for (let c = 0; c < 16 && ee(d - u) > a; c++) { 14156 let f = (u + d) / 2 14157 , p = ss(l, e, f, !1); 14158 p ? (h = p, 14159 u = f) : d = f 14160 } 14161 return h 14162 } 14163} 14164function GP(l, e, t) { 14165 let n = []; 14166 if (l != null && e != null && !Pl(l) && !Pl(e) && t !== 0) { 14167 let s = new Ns(t), o = Math.abs(t) / 100, i, r, a = Rs(l, s, o); 14168 if (a.partOffsets.length) { 14169 let d = Rs(e, s, o); 14170 d.partOffsets.length && (i = [],
14171 a.partOffsets.forEach(u=>i.push(...u.vOffsetParts)), 14172 r = [], 14173 d.partOffsets.forEach(u=>r.push(...u.vOffsetParts))) 14174 } 14175 if (i && r) { 14176 let d = []; 14177 for (let u of i) 14178 for (let h of r) { 14179 let c = ni(u, h); 14180 c && c.forEach(f=>{ 14181 d.push(ze(u, f[0])) 14182 } 14183 ) 14184 } 14185 d.forEach(u=>{ 14186 let h = yp(l, u, t) 14187 , c = yp(e, u, t); 14188 if (h != null && c != null) { 14189 let f = ze(e, c).subtract(ze(l, h), !0); 14190 f.dot(Te(l, h, 1)) > 0 && f.dot(Te(e, c, 1)) > 0 && n.push([h, c]) 14191 } 14192 } 14193 ) 14194 } 14195 if (n.length) 14196 return n 14197 } 14198 return n 14199} 14200function yp(l, e, t) { 14201 let n = Qd(l, e.x, e.y); 14202 if (n.length === 0) 14203 return null; 14204 if (n.length === 1) 14205 return n[0]; 14206 { 14207 let s = null 14208 , o = Number.MAX_VALUE; 14209 for (let i of n) { 14210 let r = je(l, i, t).dist(e); 14211 r < o && (s = i, 14212 o = r) 14213 } 14214 return s 14215 } 14216} 14217function HP(l, e, t, n, s) { 14218 let o = ze(l, t) 14219 , i = ze(e, n) 14220 , r = Te(l, t, 1) 14221 , a = Te(e, n, 1) 14222 , d = Math.acos(r.dot(a)); 14223 if (isNaN(d) || Math.abs(d) < 1e-6) 14224 return []; 14225 let u = 4 / 3 * s * Os(d / 4) 14226 , h = [o.x, o.y, o.x + r.x * u, o.y + r.y * u, i.x - a.x * u, i.y - a.y * u, i.x, i.y]; 14227 return dn(h, .5, !0) 14228} 14229class $P { 14230 curve0; 14231 curve1; 14232 t0; 14233 t1; 14234 constructor(e, t, n, s) { 14235 this.curve0 = e, 14236 this.curve1 = t, 14237 this.t0 = n, 14238 this.t1 = s 14239 } 14240} 14241function XP(l, e) { 14242 let t = l.length 14243 , n = e?.length ?? 0 14244 , s = t + n 14245 , o = new Int32Array(s) 14246 , i = new Float64Array(s); 14247 for (let u = 0; u < t; u++) 14248 o[u] = u, 14249 i[u] = l[u].getBounds()[0]; 14250 for (let u = 0; u < n; u++) 14251 o[t + u] = -(u + 1), 14252 i[t + u] = e[u].getBounds()[0]; 14253 o.sort((u,h)=>i[h < 0 ? t - h - 1 : h] - i[u < 0 ? t - u - 1 : u]); 14254 const r = [] 14255 , a = [] 14256 , d = []; 14257 for (let u = o.length - 1; u >= 0; u--) { 14258 let h = o[u] 14259 , c = h < 0 14260 , f = c ? e[-(h + 1)] : l[h] 14261 , p = c || e == null ? a : d 14262 , g = c ? d : a 14263 , y = f.getBounds(); 14264 if (g.length > 0) { 14265 let m = y[0] 14266 , b = y[1] 14267 , M = y[3]; 14268 for (let S = 0; S < g.length; S++) { 14269 let x = g[S] 14270 , P = x.getBounds(); 14271 if (P[2] < m) { 14272 g.length = S; 14273 break 14274 } else if (b <= P[3] && M >= P[1]) { 14275 let C = ni(f.v, x.v); 14276 if (C != null) 14277 for (let T of C) { 14278 let k = T[0] 14279 , D = T[1]; 14280 !(k === 1 && D === 0 && f.next === x) && !(D === 1 && k === 0 && x.next === f) && r.push(new $P(f,x,k,D)) 14281 } 14282 } 14283 } 14284 } 14285 if (p.length === 0) 14286 p.push(f); 14287 else { 14288 let m = y[2]; 14289 if (p.at(-1).getBounds()[2] > m) 14290 p.push(f); 14291 else { 14292 let b = 0 14293 , M = p.length; 14294 for (; b < M; ) { 14295 let S = M + b >>> 1; 14296 p[S].getBounds()[2] <= m ? M = S : b = S + 1 14297 } 14298 p.splice(b, 0, f) 14299 } 14300 } 14301 } 14302 return r 14303} 14304const YP = "evenodd" 14305 , Yl = "nonzero"; 14306function KP(l, e, t, n) { 14307 let s, o; 14308 if (e !== 0 && e !== 1 && (s = dn(l.v, e), 14309 e < .5 && Vs(s[0]) < 1e-12 ? e = 0 : e > .5 && Vs(s[1]) < 1e-12 && (e = 1)), 14310 e === 0) { 14311 let i = l.previous; 14312 i !== t && (i instanceof Bl ? t == null ? t = i : i.mergeInto(t, n) : (t == null && (t = new Bl, 14313 n.add(t)), 14314 t.addInCurve(i), 14315 t.addOutCurve(l), 14316 i.next = t, 14317 l.previous = t)) 14318 } else if (e === 1) { 14319 let i = l.next; 14320 i !== t && (i instanceof Bl ? t == null ? t = i : i.mergeInto(t, n) : (t == null && (t = new Bl, 14321 n.add(t)), 14322 t.addInCurve(l), 14323 t.addOutCurve(i), 14324 i.previous = t, 14325 l.next = t)) 14326 } else { 14327 if (t == null && (t = new Bl, 14328 n.add(t)), 14329 l.v = s[0], 14330 l.notifyVChanged(), 14331 o = new Mt(s[1],t,l.next), 14332 l.next instanceof Bl) { 14333 let i = l.next; 14334 i.curveEntries[i.getCurveEntryIndex(l, 1)].curve = o 14335 } else 14336 l.next.previous = o; 14337 l.next = t, 14338 t.addInCurve(l), 14339 t.addOutCurve(o) 14340 } 14341 return [o, t] 14342} 14343class vp { 14344 curve; 14345 tStart; 14346 angle; 14347 constructor(e, t) { 14348 this.curve = e, 14349 this.tStart = t, 14350 this.angle = 0 14351 } 14352} 14353class Bl { 14354 curveEntries = []; 14355 sorted = !1; 14356 constructor() {} 14357 addInCurve(e) { 14358 this.getCurveEntryIndex(e, 1) === -1 && this.curveEntries.push(new vp(e,1)) 14359 } 14360 addOutCurve(e) { 14361 this.getCurveEntryIndex(e, 0) === -1 && this.curveEntries.push(new vp(e,0)) 14362 } 14363 removeInCurve(e) { 14364 this.curveEntries.splice(this.getCurveEntryIndex(e, 1), 1) 14365 } 14366 removeOutCurve(e) { 14367 this.curveEntries.splice(this.getCurveEntryIndex(e, 0), 1) 14368 } 14369 sortCurves() { 14370 let e = new B; 14371 for (let t of this.curveEntries) 14372 t.angle = Qh(t.curve.v, t.tStart, !1, e); 14373 this.curveEntries.sort((t,n)=>{ 14374 let s = t.curve 14375 , o = n.curve 14376 , i = Zi(s, t.angle, t.tStart, o, n.angle, n.tStart); 14377 if (ee(i) < 1e-12) { 14378 let r = t.tStart 14379 , a = n.tStart; 14380 if (r === 0 && (a === 0 && s.next === o.next || a === 1 && s.next === o.previous)) { 14381 let d = s.next; 14382 d.sorted === !0 && (i = d.getCurveEntryIndex(o, 1 - a) - d.getCurveEntryIndex(s, 1)) 14383 } else if (r === 1 && (a === 1 && s.previous === o.previous || a === 0 && s.previous === o.next)) { 14384 let d = s.previous; 14385 d.sorted === !0 && (i = d.getCurveEntryIndex(o, 1 - a) - d.getCurveEntryIndex(s, 0)) 14386 } 14387 } 14388 return i 14389 } 14390 ), 14391 this.sorted = !0 14392 } 14393 getCurveEntryIndex(e, t) { 14394 let n = this.curveEntries; 14395 for (let s = 0; s < n.length; s++) 14396 if (n[s].curve === e && n[s].tStart === t) 14397 return s; 14398 return -1 14399 } 14400 mergeInto(e, t) { 14401 if (this !== e) { 14402 for (let n of this.curveEntries) { 14403 let s = n.curve; 14404 n.tStart === 0 ? (e.addOutCurve(s), 14405 s.previous = e) : (e.addInCurve(s), 14406 s.next = e) 14407 } 14408 this.curveEntries.length = 0, 14409 t.delete(this) 14410 } 14411 } 14412 adjustPoints() { 14413 const e = this.curveEntries; 14414 if (e.length === 0) 14415 return; 14416 let t = e[0] 14417 , n = t.curve.v 14418 , s = t.tStart === 0 ? n[0] : n[6] 14419 , o = t.tStart === 0 ? n[1] : n[7] 14420 , i = n[0] === n[6] && n[0] === n[2] && n[0] === n[4] ? null : 0 14421 , r = n[1] === n[7] && n[1] === n[3] && n[1] === n[5] ? null : 0; 14422 for (let a = 1; a < e.length; a++) 14423 t = e[a], 14424 n = t.curve.v, 14425 i != null && (n[0] === n[6] && n[0] === n[2] && n[0] === n[4] ? (s = n[0], 14426 i = null) : i += (t.tStart === 0 ? n[0] : n[6]) - s), 14427 r != null && (n[1] === n[7] && n[1] === n[3] && n[1] === n[5] ? (o = n[1], 14428 r = null) : r += (t.tStart === 0 ? n[1] : n[7]) - o); 14429 s += i == null ? 0 : i / e.length, 14430 o += r == null ? 0 : r / e.length; 14431 for (t of e) { 14432 n = t.curve.v; 14433 let a = !1; 14434 t.tStart === 0 ? (n[0] !== s && (n[2] = n[2] - n[0] + s, 14435 n[0] = s, 14436 a = !0),
14437 n[1] !== o && (n[3] = n[3] - n[1] + o, 14438 n[1] = o, 14439 a = !0)) : (n[6] !== s && (n[4] = n[4] - n[6] + s, 14440 n[6] = s, 14441 a = !0), 14442 n[7] !== o && (n[5] = n[5] - n[7] + o, 14443 n[7] = o, 14444 a = !0)), 14445 a && t.curve.notifyVChanged() 14446 } 14447 } 14448} 14449function Qh(l, e, t, n) { 14450 let s = Te(l, e, 1, n); 14451 e === 1 && s.negate(!0); 14452 let o = nn(s.y || 0, s.x); 14453 return t && (o < -tt / 2 ? o = -tt / 2 : o > tt / 2 && (o = tt / 2)), 14454 o 14455} 14456function Zi(l, e=null, t, n, s=null, o, i=!1) { 14457 let r = l.v 14458 , a = n.v; 14459 (e == null || s == null) && (e = Qh(r, t, i), 14460 s = Qh(a, o, i)); 14461 let d = ee(e - s) 14462 , u = .01; 14463 if (d < u || d > 2 * tt - u) { 14464 let f = l.getBounds() 14465 , p = n.getBounds() 14466 , g = Hl(r, t, 0) 14467 , y = Hl(r, t, 1) 14468 , m = He(g - f[0], g - p[0]) 14469 , b = He(f[2] - g, p[2] - g) 14470 , M = He(y - f[1], y - p[1]) 14471 , S = He(f[3] - y, p[3] - y) 14472 , x = Ee(m, b) - Ee(M, S) 14473 , P = null 14474 , C = 0; 14475 if (x > 0 ? (P = 0, 14476 C = m > b ? -1 : 1) : x < 0 && (P = 1, 14477 C = M > S ? -1 : 1), 14478 P != null) { 14479 let k = ((C === 1 ? He(f[P + 2], p[P + 2]) : Ee(f[P], p[P])) + (P === 0 ? g : y)) / 2; 14480 for (let D = 0; D < 2; D++) { 14481 let I = D === 0 ? r : a; 14482 if (Ae(I)) 14483 continue; 14484 let F = D === 0 ? t : o, Y = jn(I, P, k), q; 14485 if (Y.length === 0) 14486 P === 0 ? q = (F === 0 ? I[7] - I[1] : I[1] - I[7]) > 0 ? tt : 0 : q = (F === 0 ? I[6] - I[0] : I[0] - I[6]) > 0 ? tt / 2 : 3 * tt / 2; 14487 else { 14488 let ne = F === 0 ? He(...Y) : Ee(...Y); 14489 if (ne !== F) { 14490 let te = ze(I, ne); 14491 q = nn(te.y - y, te.x - g) 14492 } 14493 } 14494 let re = D === 0 ? e : s; 14495 (q < 0 && re > Math.PI / 2 || q < Math.PI && re > Math.PI * 3 / 2) && (q += 2 * tt), 14496 D === 0 ? e = q : s = q 14497 } 14498 } 14499 } 14500 let c = e - s; 14501 return c === 0 ? Do(o - t) * Number.EPSILON : c 14502} 14503function WP(l) { 14504 for (let e = l.length - 1; e >= 0; e--) { 14505 let t = l[e]; 14506 if (!Ae(t.v)) { 14507 let n = t.v 14508 , s = Ir(n); 14509 if (s) { 14510 let o = s[0] 14511 , i = s[1]; 14512 if (o > 0 && i < 1) { 14513 let r = dn(n, i, !0)[1] 14514 , a = dn(n, o / i, !0)[1]; 14515 l2(a, n[6], n[7]), 14516 Na(r, n[6], n[7]); 14517 let d = new Mt(r,null,t.next,t.path) 14518 , u = new Mt(a,t,d,t.path); 14519 d.previous = u, 14520 t.next = u, 14521 t.notifyVChanged(), 14522 l.splice(e + 1, 0, u, d) 14523 } 14524 } 14525 } 14526 } 14527} 14528function qP(l, e) { 14529 for (let t of l) 14530 if (Vs(t.v) === 0) { 14531 let n = t.previous 14532 , s = t.next; 14533 s instanceof Mt ? (s.previous = n, 14534 n instanceof Mt ? n.next = s : n.curveEntries[n.getCurveEntryIndex(t, 0)].curve = s) : n instanceof Mt ? (n.next = s, 14535 s.curveEntries[s.getCurveEntryIndex(t, 1)].curve = n) : (s.removeInCurve(t), 14536 n.removeOutCurve(t), 14537 s.mergeInto(n, e)), 14538 l.delete(t) 14539 } 14540} 14541function jP(l, e) { 14542 let t = l.v 14543 , n = e.v 14544 , s = He(t[0], t[6]) 14545 , o = He(n[0], n[6]); 14546 if (s < o && s < n[2] && s < n[4]) 14547 return -1; 14548 if (o < s && o < t[2] && o < t[4]) 14549 return 1; 14550 const i = l.getBounds() 14551 , r = e.getBounds(); 14552 let a = i[0] - r[0]; 14553 if (a !== 0) 14554 return a; 14555 { 14556 if (i[3] < r[1]) 14557 return -1; 14558 if (i[1] > r[3]) 14559 return 1; 14560 if (Ae(t) && Ae(n)) { 14561 let c = t[0] < t[6] ? 0 : t[0] > t[6] ? 6 : t[1] < t[7] ? 0 : 6 14562 , f = n[0] < n[6] ? 0 : n[0] > n[6] ? 6 : n[1] < n[7] ? 0 : 6; 14563 if (t[c + 1] < n[f + 1]) 14564 return -1; 14565 if (t[c + 1] > n[f + 1]) 14566 return 1; 14567 { 14568 let p = (t[6 - c + 1] - t[c + 1]) / (t[6 - c] - t[c])
14569 , g = (n[6 - f + 1] - n[f + 1]) / (n[6 - f] - n[f]); 14570 if (p !== g) 14571 return p - g 14572 } 14573 } 14574 let d = i[0]; 14575 if (t[0] === d && (t[6] > d || t[7] > t[1])) { 14576 if (n[0] === d && n[1] === t[1]) 14577 return l.previous === e.previous && l.previous instanceof Bl ? l.previous.getCurveEntryIndex(l, 0) - l.previous.getCurveEntryIndex(e, 0) : Zi(l, null, 0, e, null, 0, !0); 14578 if (n[6] === d && n[7] === t[1]) 14579 return l.previous === e.next && l.previous instanceof Bl ? l.previous.getCurveEntryIndex(l, 0) - l.previous.getCurveEntryIndex(e, 1) : Zi(l, null, 0, e, null, 1, !0) 14580 } else if (t[6] === d && (t[0] > d || t[1] > t[7])) { 14581 if (n[0] === d && n[1] === t[7]) 14582 return l.next === e.previous && l.next instanceof Bl ? l.next.getCurveEntryIndex(l, 1) - l.next.getCurveEntryIndex(e, 0) : Zi(l, null, 1, e, null, 0, !0); 14583 if (n[6] === d && n[7] === t[7]) 14584 return l.next === e.next && l.next instanceof Bl ? l.next.getCurveEntryIndex(l, 1) - l.next.getCurveEntryIndex(e, 1) : Zi(l, null, 1, e, null, 1, !0) 14585 } 14586 let u; 14587 if (t[0] === d && t[0] < t[6]) 14588 u = t[1]; 14589 else if (t[6] === d && t[6] < t[0]) 14590 u = t[7]; 14591 else if (i[2] === d) 14592 u = i[1]; 14593 else { 14594 let c = qh(t, 0)[0]; 14595 u = Hl(t, c[0], 1); 14596 for (let f = 1; f < c.length; f++) { 14597 let p = Hl(t, c[f], 1); 14598 p < u && (u = p) 14599 } 14600 } 14601 let h; 14602 if (n[0] === d && n[0] < n[6]) 14603 h = n[1]; 14604 else if (n[6] === d && n[6] < n[0]) 14605 h = n[7]; 14606 else if (r[2] === d) 14607 h = r[1]; 14608 else { 14609 let c = qh(n, 0)[0]; 14610 h = Hl(n, c[0], 1); 14611 for (let f = 1; f < c.length; f++) { 14612 let p = Hl(n, c[f], 1); 14613 p < h && (h = p) 14614 } 14615 } 14616 return u !== h ? u - h : l.previous === e.previous && l.previous instanceof Bl ? l.previous.getCurveEntryIndex(l, 0) - l.previous.getCurveEntryIndex(e, 0) : l.next === e.next && l.next instanceof Bl ? l.next.getCurveEntryIndex(l, 1) - l.next.getCurveEntryIndex(e, 1) : ((u === t[1] || u === t[7]) && (h === n[1] || h === n[7]) && (u !== t[1] || u !== t[7] || t[0] < t[6], 14617 h !== n[1] || h !== n[7] || n[0] < n[6]), 14618 0) 14619 } 14620} 14621function JP(l, e) { 14622 if (l.length > 0) { 14623 let t = new Map; 14624 for (let s = 0; s < 2; s++) 14625 for (let o of l) { 14626 let i = s === 0 ? o.curve0 : o.curve1 14627 , r = t.get(i); 14628 r == null ? t.set(i, [o]) : r.push(o) 14629 } 14630 t.forEach((s,o)=>{ 14631 s.length > 1 && s.sort((i,r)=>(i.curve0 === o ? i.t0 : i.t1) - (r.curve0 === o ? r.t0 : r.t1)) 14632 } 14633 ); 14634 let n = new Set; 14635 for (let s of l) { 14636 let o = null; 14637 for (let i = 0; i < 2; i++) { 14638 let r = i === 0 ? s.curve0 : s.curve1 14639 , a = i === 0 ? s.t0 : s.t1 14640 , d = KP(r, a, o, n); 14641 if (d[0] != null) { 14642 let u = d[0]; 14643 e.add(u); 14644 let h = t.get(r); 14645 if (h != null) 14646 if (h.length === 1) 14647 h.splice(0); 14648 else { 14649 let c = 0; 14650 for (; c < h.length; c++) { 14651 let f = h[c]; 14652 if (f === s) 14653 break; 14654 r === f.curve0 ? f.t0 /= a : f.t1 /= a 14655 } 14656 if (h.splice(c, 1), 14657 c < h.length) { 14658 let f = h.splice(c); 14659 t.set(u, f), 14660 f.forEach(p=>{ 14661 r === p.curve0 ? (p.curve0 = u, 14662 p.t0 = (p.t0 - a) / (1 - a)) : (p.curve1 = u, 14663 p.t1 = (p.t1 - a) / (1 - a)) 14664 } 14665 ) 14666 } 14667 } 14668 } 14669 o = d[1] 14670 } 14671 } 14672 for (let s of n) 14673 s.adjustPoints(); 14674 qP(e, n); 14675 for (let s of n) 14676 s.sortCurves() 14677 } 14678 return e 14679} 14680function ZP(l) { 14681 let e = Array.from(l).sort(jP); 14682 const t = [] 14683 , n = new Set 14684 , s = []; 14685 for (let o of e) { 14686 if (o.path == null) { 14687 let i = o.v, r = o.getBounds(), a = r[0], d; 14688 if (r[0] === r[2]) 14689 d = r[1]; 14690 else if (Ae(i)) 14691 i[0] < i[6] ? d = i[1] : d = i[7]; 14692 else { 14693 let f = qh(i, 0)[0] 14694 , p = f[0]; 14695 d = Hl(i, p, 1); 14696 for (let g = 1; g < f.length; g++) { 14697 p = f[g]; 14698 let y = Hl(i, p, 1); 14699 y < d && (d = y) 14700 } 14701 } 14702 let u = 0; 14703 for (let f = s.length - 1; f >= 0;
14703 f--) { 14704 let p = s[f] 14705 , g = p.getBounds(); 14706 if (g[2] <= a) 14707 s.splice(f, 1); 14708 else { 14709 let y = p.v; 14710 if (g[3] <= d) { 14711 let m = y[0] 14712 , b = y[6]; 14713 m > a != b > a && (u += m < b ? 1 : -1) 14714 } else if (g[1] <= r[3]) { 14715 let m = jn(y, 0, a); 14716 for (let b = 0; b < m.length; b++) 14717 if (Hl(y, m[b], 1) <= d) { 14718 let S = m[b] 14719 , x = Te(y, S); 14720 if (x.x > 0 && S < 1) 14721 u += 1; 14722 else if (x.x < 0 && S > 0) 14723 u += -1; 14724 else { 14725 let P = 6 * ((y[6] - 3 * (y[4] - y[2]) - y[0]) * m[b] + (y[4] - 2 * y[2] + y[0])); 14726 if (P > 0) 14727 S === 0 && (u += 1); 14728 else if (P < 0) 14729 S === 1 && (u += -1); 14730 else { 14731 let C = y[0] 14732 , T = y[6]; 14733 C > a != T > a && (u += C < T ? 1 : -1) 14734 } 14735 } 14736 } 14737 } 14738 } 14739 } 14740 let h = bp(o, n) 14741 , c = h.getArea(); 14742 if (ee(c) >= 1e-12) { 14743 let f = -Do(c); 14744 for (h.orientation = f, 14745 h.winding = u + f, 14746 t.push(h); n.size > 0; ) { 14747 let p = n.values().next().value; 14748 if (p.pendingCurveCount > 0) { 14749 let g = p.curveEntries, y; 14750 for (y = 0; y < g.length && !(g[y].curve.path != null && g[y].tStart === 1); y++) 14751 ; 14752 let m = g[y].curve.path 14753 , b = m.winding; 14754 f = m.orientation, 14755 f === 1 && b--; 14756 let M = y; 14757 for (; (M = M === g.length - 1 ? 0 : M + 1) !== y; ) { 14758 let S = g[M]; 14759 if (S.tStart === 1) 14760 b--; 14761 else { 14762 let x = S.curve; 14763 if (x.path == null) { 14764 h = bp(x, n), 14765 h.orientation = -Do(h.getArea()), 14766 h.winding = h.orientation === 1 ? b + 1 : b, 14767 t.push(h); 14768 break 14769 } 14770 b++ 14771 } 14772 } 14773 M === y && n.delete(p) 14774 } else 14775 n.delete(p) 14776 } 14777 } 14778 } 14779 s.push(o) 14780 } 14781 return t 14782} 14783function bp(l, e) { 14784 let t = new ft; 14785 t.appendCurve(l); 14786 let n = l.next; 14787 do { 14788 for (; n instanceof Mt && n.path == null; ) 14789 l = n, 14790 n = l.next, 14791 t.appendCurve(l); 14792 if (n == null) 14793 break; 14794 if (n.path != null) { 14795 t.close(); 14796 break 14797 } else { 14798 let s = n 14799 , o = s.curveEntries; 14800 s.pendingCurveCount == null ? (e.add(s), 14801 s.pendingCurveCount = o.length - 1) : s.pendingCurveCount--; 14802 let i = 0 14803 , r = s.getCurveEntryIndex(l, 1); 14804 if (l = null, 14805 r >= 0) { 14806 let a = r; 14807 for (; (a = a === o.length - 1 ? 0 : a + 1) !== r; ) { 14808 let d = o[a]; 14809 if (d.tStart === 0) { 14810 if (i === 0) { 14811 if (l == null && d.curve.path == null) 14812 l = d.curve; 14813 else if (d.curve === t.getFirstCurve()) { 14814 l = d.curve; 14815 break 14816 } 14817 } 14818 i++ 14819 } else 14820 i-- 14821 } 14822 } 14823 if (l == null) { 14824 console.log("Null"), 14825 console.log(on([t])), 14826 console.log(window.d1), 14827 console.log(window.d2), 14828 t.close(); 14829 break 14830 } else if (s.pendingCurveCount--, 14831 s.pendingCurveCount === 0 && e.delete(s), 14832 l.path === t) { 14833 t.close(); 14834 break 14835 } else 14836 t.appendCurve(l) 14837 } 14838 n = l.next 14839 } while (n != null); 14840 return t 14841} 14842function xo(l, e, t=YP, n) { 14843 let s = []; 14844 l.forEach(d=>{ 14845 for (let u of d.getCurveIterator()) 14846 s.push(u) 14847 } 14848 ); 14849 for (let d = 0; d < s.length; d++) 14850 s[d].path = null; 14851 let o; 14852 if (e != null) { 14853 o = [], 14854 e.forEach(d=>{ 14855 for (let u of d.getCurveIterator()) 14856 o.push(u) 14857 } 14858 ); 14859 for (let d = 0; d < o.length; d++) 14860 o[d].path = null 14861 } 14862 e == null && WP(s); 14863 let i = XP(s, o) 14864 , r = new Set(o ? s.concat(o) : s); 14865 JP(i, r); 14866 let a = ZP(r); 14867 for (let d = a.length - 1; d >= 0; d--) { 14868 let u = a[d]; 14869 if (n) 14870 u = n(u, u.winding), 14871 u == null ? a.splice(d, 1) : a[d] = u; 14872 else { 14873 let h = u.getArea(); 14874 if (h === 0) 14875 a.splice(d, 1); 14876 else { 14877 let c = u.winding 14878 , f = ee(c); 14879 t === Yl && (f > 1 || c === 1 && h > 0 || c === -1 && h < 0) ? a.splice(d, 1) : (f % 2 === 1 && h > 0 || f % 2 === 0 && h < 0) && a[d].reverse() 14880 } 14881 } 14882 } 14883 return a 14884} 14885function tu(l, e, t, n, s, o=.01) { 14886 l.forEach(d=>{ 14887 !d.isClosed() && d.close() 14888 } 14889 ); 14890 let i = xo(l, null, n); 14891 if (e == null) 14892 return i; 14893 let r; 14894 if (e.forEach(d=>{ 14895 !d.isClosed() && d.close() 14896 } 14897 ), 14898 r = xo(e, null, s), 14899 t === "subtract") 14900 for (let d of r) 14901 d.reverse(); 14902 let a; 14903 t === "unite" || t === "subtract" ? a = xo(i, r, Yl, (d,u)=>{ 14904 let h = ee(u) 14905 , c = d.getArea(); 14906 return ee(c) < o || c > 0 && h !== 0 || c < 0 && h !== 1 ? null : d 14907 } 14908 ) : t === "intersect" ? a = xo(i, r, Yl, (d,u)=>{ 14909 let h = ee(u) 14910 , c = d.getArea(); 14911 return ee(c) < o || c > 0 && h !== 1 || c < 0 && h !== 2 ? null : d 14912 } 14913 ) : t === "exclude" ? a = xo(i, r, Yl, (d,u)=>{ 14914 let h = d.getArea(); 14915 return ee(h) < o ? null : d 14916 } 14917 ) : a = i; 14918 for (let d of a) { 14919 let u = ee(d.winding) 14920 , h = d.getArea(); 14921 (u % 2 === 1 && h > 0 || u % 2 === 0 && h < 0) && d.reverse() 14922 } 14923 return a.forEach(d=>delete d.winding), 14924 a 14925} 14926function jl(l, e, t=Yl, n=Yl, s) { 14927 return tu(l, e, "unite", t, n, s) 14928} 14929function lu(l, e, t=Yl, n=Yl, s) { 14930 return tu(l, e, "subtract", t, n, s) 14931} 14932function QP(l, e, t=Yl, n=Yl, s) { 14933 return tu(l, e, "intersect", t, n, s) 14934} 14935function ex(l, e, t=Yl, n=Yl, s) { 14936 return tu(l, e, "exclude", t, n, s) 14937} 14938function Bo(l, e, t, n=!1, s="round", o="round", i=4, r=.1) { 14939 let a = [] 14940 , d = t == null; 14941 for (let u of l) { 14942 let h = !0; 14943 if (u.getCurveCount() === 0) 14944 h = !1; 14945 else if (d && u.isClosed()) { 14946 let p = u.getArea(); 14947 if (p * e > 0) 14948 if (ee(p) <= e * e * tt) 14949 h = !1; 14950 else { 14951 let g = u.getBoundsCoords(); 14952 ee(e) >= He(g[2] - g[0], g[3] - g[1]) / 2 && (h = !1) 14953 } 14954 } 14955 let c = []; 14956 for (let p of u.getCurveIterator()) 14957 c.push(p.v.slice()); 14958 let f; 14959 if (t != null ? f = t : f = Array(c.length + 1).fill(e), 14960 c.length === 0 && (h = !1), 14961 h) { 14962 c = c.filter(y=>!Pl(y)); 14963 let p = f ? f.at(0) : e
14964 , g = f ? f.at(-1) : e; 14965 if (c.length === 0) { 14966 let y = u.getCurve(0).v 14967 , m = []; 14968 m.push(...pa(y, null, null, g, g, s)), 14969 m.push(...pa(y, null, null, -p, -p, s)); 14970 let b = new ft(m.map(M=>new Mt(M)),!0); 14971 a.push(b) 14972 } else { 14973 let y = Mp(c, u.isClosed(), e, f, o, i); 14974 if (!u.isClosed()) { 14975 let m = c.map(S=>No(S.slice())).reverse() 14976 , b = f.slice().reverse() 14977 , M = Mp(m, !1, e, b, o, i); 14978 y.push(...pa(c.at(-1), y.at(-1), M.at(0), g, g, s)), 14979 M.push(...pa(m.at(-1), M.at(-1), y.at(0), p, p, s)), 14980 y.push(...M) 14981 } 14982 if (y.length > 0) { 14983 let m = new ft(y.map(b=>new Mt(b)),!0); 14984 a.push(m) 14985 } 14986 } 14987 } 14988 } 14989 return a = xo(a, null, "evenodd", (u,h)=>{ 14990 let c = u.getArea(); 14991 return ee(c) < r || n && h === 0 || c < 0 && h !== 1 || c > 0 && h !== 0 ? null : u 14992 } 14993 ), 14994 a 14995} 14996function Mp(l, e, t, n, s, o) { 14997 if (l.length === 0) 14998 return []; 14999 let i = new un(1,0,0,0) 15000 , r = []; 15001 for (let d = 0; d < l.length; d++) { 15002 let u = l[d].slice() 15003 , h = n[d] 15004 , c = n[d + 1]; 15005 o2(u), 15006 i.setStartEndProperties(h, c, c - h, c - h); 15007 let f = Math.min(h, c) 15008 , p = pr(u); 15009 Se(u[2] - u[0], u[3] - u[1]) / Math.max(1, p) < 1e-13 && (u[2] = u[0], 15010 u[3] = u[1]), 15011 Se(u[4] - u[6], u[5] - u[7]) / Math.max(1, p) < 1e-13 && (u[4] = u[6], 15012 u[5] = u[7]); 15013 let g = Rs(u, i, ee((h + c) / 2 * 2 / 100)); 15014 if (r.length > 0) { 15015 let y = r.at(-1) 15016 , m = new B(u[0],u[1]); 15017 if (y.getTEnd() === 1 && g.getTStart() === 0 && Te(y.v, 1, 1).getAngleTo(Te(u, 0, 1), !1) < .01) { 15018 let b = y.getLastPartOffsetValues() 15019 , M = g.getFirstPartOffsetValues(); 15020 Na(M, b[6], b[7]); 15021 let S = Xm(b[4], b[5], M[2], M[3], b[6], b[7]); 15022 b[6] += S.x, 15023 b[7] += S.y, 15024 M[0] += S.x, 15025 M[1] += S.y 15026 } else { 15027 let b = y.getTEnd() === 1 ? y.getEndOffsPoint() : je(y.v, 1, h) 15028 , M = g.getTStart() === 0 ? g.getStartOffsPoint() : je(u, 0, h) 15029 , S = Sp(b, M, m, h, s, o); 15030 if (S != null && S.length > 0) 15031 if (S.length === 1 && g.getTStart() === 0 && y.getTEnd() === 1 && pr(S[0]) < ee(f / 1e3)) 15032 Na(g.getFirstPartOffsetValues(), b.x, b.y); 15033 else { 15034 let x = [m.x, m.y, m.x, m.y, m.x, m.y, m.x, m.y] 15035 , P = new Jh(x); 15036 P.addPartOffset(new mr(x,S,0,0)), 15037 y.getTEnd() !== 1 && !y.isEmpty() && (P.noJoin = !0), 15038 r.push(P) 15039 } 15040 (S == null || g.getTStart() !== 0 || !y.isEmpty() && y.getTEnd() !== 1 && S.length === 0) && (g.noJoin = !0) 15041 } 15042 } 15043 r.push(g) 15044 } 15045 if (e) { 15046 let d = r[0] 15047 , u = d.v 15048 , h = n[n.length - 1] 15049 , c = n[0] 15050 , f = c == null ? h : Math.min(h, c) 15051 , p = r[r.length - 1] 15052 , g = new B(u[0],u[1]) 15053 , y = p.getTEnd() === 1 ? p.getEndOffsPoint() : je(p.v, 1, h) 15054 , m = d.getTStart() === 0 ? d.getStartOffsPoint() : je(u, 0, h) 15055 , b = Sp(y, m, g, h, s, o); 15056 if (b != null && b.length > 0) 15057 if (b.length === 1 && d.getTStart() === 0 && p.getTEnd() === 1 && pr(b[0]) < ee(f / 1e3)) 15058 Na(d.getFirstPartOffsetValues(), y.x, y.y); 15059 else { 15060 let M = [g.x, g.y, g.x, g.y, g.x, g.y, g.x, g.y] 15061 , S = new Jh(M); 15062 S.addPartOffset(new mr(M,b,0,0)), 15063 p.getTEnd() !== 1 && !p.isEmpty() && (S.noJoin = !0), 15064 r.push(S) 15065 } 15066 (b == null || d.getTStart() !== 0 || !p.isEmpty() && p.getTEnd() !== 1 && b.length === 0) && (d.noJoin = !0) 15067 } 15068 let a = tx(r, t / 1e3, e); 15069 for (let d = 1; d < a.length; d++) 15070 a[d - 1], 15071 a[d]; 15072 return e && a.length > 0 && (a[a.length - 1], 15073 a[0]), 15074 a 15075} 15076function tx(l, e, t) { 15077 let n = []; 15078 for (let s of l) 15079 if (!s.isEmpty()) { 15080 let o = null; 15081 for (let i of s.partOffsets) { 15082 if (i.vOffsetParts.length !== 0) { 15083 if (n.length > 0) { 15084 let r = n[n.length - 1] 15085 , a = i.vOffsetParts[0]; 15086 if (r[6] !== a[0] || r[7] !== a[1]) 15087 if (Se(a[0] - r[6], a[1] - r[7]) < ee(e)) 15088 l2(r, a[0], a[1]); 15089 else { 15090 let d = [r[6], r[7], r[6], r[7], a[0], a[1], a[0], a[1]]; 15091 if (n.push(d), 15092 o != null || s.noJoin) { 15093 let u = new B(d[0] - d[1],d[1] - d[7]) 15094 , h = Te(r, 1, 1).getAngleTo(u, !0) 15095 , c = Te(a, 0, 1).getAngleTo(u, !0); 15096 if (h * c < 0 && ee(h) > .01 && ee(c) > .01) { 15097 let f = ni(r, d) 15098 , p = ni(a, d); 15099 (f == null || f.length === 1) && p?.length 15100 } 15101 } 15102 } 15103 } 15104 for (let r of i.vOffsetParts) 15105 n.push(r) 15106 } 15107 o = i 15108 } 15109 } 15110 if (t && n.length > 0) { 15111 let s = n[n.length - 1] 15112 , o = n[0]; 15113 if (s[6] !== o[0] || s[7] !== o[1]) { 15114 let i = [s[6], s[7], s[6], s[7], o[0], o[1], o[0], o[1]]; 15115 if (n.push(i), 15116 l[0].noJoin === !0) { 15117 let r = ni(s, i) 15118 , a = ni(o, i); 15119 (r == null || r.length === 1) && a?.length 15120 } 15121 } 15122 } 15123 return n 15124} 15125function Sp(l, e, t, n, s="round", o=4) { 15126 let i = l.dist(e); 15127 if (i === 0) 15128 return []; 15129 { 15130 let r = l.subtract(t) 15131 , a = e.subtract(t) 15132 , d = r.getAngle() 15133 , h = a.getAngle() - d; 15134 if (h < -Math.PI ? h += 2 * Math.PI : h > Math.PI && (h -= 2 * Math.PI),
15135 Math.abs(ee(h) - Math.PI) < .001 && (h = Math.PI * Math.sign(n)), 15136 h * n <= 0) 15137 return null; 15138 { 15139 let c; 15140 if (i < .02) 15141 c = [[l.x, l.y, l.x, l.y, e.x, e.y, e.x, e.y]]; 15142 else if (s === "bevel") 15143 c = [[l.x, l.y, l.x, l.y, e.x, e.y, e.x, e.y]]; 15144 else if (s === "miter") { 15145 let f = new B(-r.y,r.x) 15146 , p = new B(a.y,-a.x) 15147 , g = Tl(l, f, e, p); 15148 g == null || t.dist(g) > o * ee(n) ? c = [[l.x, l.y, l.x, l.y, e.x, e.y, e.x, e.y]] : c = [[l.x, l.y, l.x, l.y, g.x, g.y, g.x, g.y], [g.x, g.y, g.x, g.y, e.x, e.y, e.x, e.y]] 15149 } else { 15150 c = []; 15151 let f = v2(l, e, t, n >= 0); 15152 c.push(...f) 15153 } 15154 return c 15155 } 15156 } 15157} 15158function pa(l, e, t, n, s, o) { 15159 let i = Pl(l) 15160 , r = i ? new B(l[0],l[1] - n) : je(l, 1, n) 15161 , a = i ? new B(l[0],l[1] + s) : je(l, 1, -s) 15162 , d = e ? new B(e[6],e[7]) : r 15163 , u = t ? new B(t[0],t[1]) : a 15164 , h = []; 15165 if (o === "butt" && (r.equals(d) || (r = Tl(r, a.subtract(r), d, Ro(e, 1, 1))), 15166 a.equals(u) || (a = Tl(r, a.subtract(r), u, Ro(t, 0, 1)))), 15167 r.equals(d) || h.push([d.x, d.y, d.x, d.y, r.x, r.y, r.x, r.y]), 15168 o === "round") 15169 h.push(...v2(r, a, B.interpolate(r, a, .5), !0)); 15170 else if (o === "square") { 15171 let c = i ? new B(1,0) : Te(l, 1, 1) 15172 , f = r.x + c.x * n 15173 , p = r.y + c.y * n 15174 , g = a.x + c.x * s 15175 , y = a.y + c.y * s; 15176 h.push([r.x, r.y, r.x, r.y, f, p, f, p]), 15177 h.push([f, p, f, p, g, y, g, y]), 15178 h.push([g, y, g, y, a.x, a.y, a.x, a.y]) 15179 } else 15180 h.push([r.x, r.y, r.x, r.y, a.x, a.y, a.x, a.y]); 15181 return a.equals(u) || h.push([a.x, a.y, a.x, a.y, u.x, u.y, u.x, u.y]), 15182 h 15183} 15184function v2(l, e, t, n) { 15185 if (l.x === e.x && l.y === e.y) 15186 return []; 15187 { 15188 let s = l.subtract(t) 15189 , o = e.subtract(t) 15190 , i = s.getAngleTo(o, !1); 15191 lx(s.x, s.y, -o.y, o.x) > 0 && (i = 2 * Math.PI - i), 15192 n || (i = 2 * Math.PI - i); 15193 let r = i > Math.PI / 2 + .01 15194 , a = l.dist(t) 15195 , d = 4 / 3 * a * Math.tan(i / (r ? 8 : 4)) 15196 , u = new B(-s.y,s.x).setLength(n ? d : -d) 15197 , h = new B(-o.y,o.x).setLength(n ? -d : d); 15198 if (r) { 15199 let c = e.subtract(l).setLength(n ? a : -a); 15200 c.set(c.y, -c.x); 15201 let f = t.add(c) 15202 , p = new B(-c.y,c.x).setLength(-d); 15203 return n || p.negate(!0), 15204 [[l.x, l.y, l.x + u.x, l.y + u.y, f.x + p.x, f.y + p.y, f.x, f.y], [f.x, f.y, f.x - p.x, f.y - p.y, e.x + h.x, e.y + h.y, e.x, e.y]] 15205 } else 15206 return [[l.x, l.y, l.x + u.x, l.y + u.y, e.x + h.x, e.y + h.y, e.x, e.y]] 15207 } 15208} 15209function lx(l, e, t, n) { 15210 return l * t + e * n 15211} 15212class Jl extends Fn { 15213 static type = "abstractPath"; 15214 _singlePathModels = []; 15215 _cachedBounds; 15216 _cachedTransformedBounds; 15217 _cachedPathDataInfo; 15218 _fillRule = "nonzero"; 15219 _elementTransform; 15220 _pathDataTransform; 15221 constructor(e, t) { 15222 super(e), 15223 Gs(this, Jl), 15224 t != null && this.setPaths(t) 15225 } 15226 clone() { 15227 let e = super.clone() 15228 , t = this._singlePathModels.map(n=>n.getPath().clone()); 15229 return e.setPaths(t), 15230 e._fillRule = this._fillRule, 15231 e._elementTransform = this._elementTransform && this._elementTransform.clone(), 15232 e._pathDataTransform = this._pathDataTransform && this._pathDataTransform.clone(), 15233 e 15234 } 15235 isPath() { 15236 return !0 15237 } 15238 _getPathDataElement() { 15239 throw new Error 15240 } 15241 setPathData(e, t) { 15242 let n; 15243 try { 15244 n = Xl(e) 15245 } catch (s) { 15246 console.error(s.message, e), 15247 n = s.paths 15248 } 15249 t && !t.isIdentity && n.forEach(s=>s.applyTransform(t)), 15250 this.setPaths(n) 15251 } 15252 isEmpty() { 15253 return this._singlePathModels.find(e=>!e.isEmpty()) == null 15254 } 15255 getPaths(e, t=0, n) { 15256 let s = e == null || e.isIdentity 15257 , o = t === -1 15258 , i = t === -1 15259 , r = this._singlePathModels.map(a=>{ 15260 let d = a.getPath(); 15261 if ((n || t || !s) && (d = d.clone()), 15262 s || (d = d.applyTransform(e)), 15263 o) { 15264 let u = a.getNodePoints().map(h=>h.radius); 15265 d = BP(d, u) 15266 } 15267 return d 15268 } 15269 ); 15270 if (i && this._offsetStyle != null) { 15271 let a = this._offsetStyle 15272 , d = a.distance 15273 , u = !1 15274 , h = a.linejoin 15275 , c = a.miterlimit 15276 , f = a.linecap; 15277 r = jl(r), 15278 r = Bo(r, d, null, u, f, h, c) 15279 } 15280 return r 15281 } 15282 setPaths(e) { 15283 this._singlePathModels.splice(0); 15284 for (let t of e) 15285 this._singlePathModels.push(new Pi(this,t)); 15286 this._cachedBounds = null, 15287 this._cachedPathDataInfo = null, 15288 this._cachedTransformedBounds = null, 15289 this.applyTransformToElement(), 15290 this.modelChanged() 15291 } 15292 getSinglePathModels() { 15293 return this._singlePathModels 15294 } 15295 setSinglePathModels(e) { 15296 this._singlePathModels = e ? e.slice() : [], 15297 this.pathDataUpdated() 15298 } 15299 addSinglePathModels(e) { 15300 this.insertSinglePathModels(this._singlePathModels.length, e) 15301 } 15302 insertSinglePathModels(e, t) { 15303 e == null && (e = this._singlePathModels.length), 15304 this._singlePathModels.splice(e, 0, ...t), 15305 this.pathDataUpdated() 15306 } 15307 removeSinglePathModel(e) { 15308 let t = this._singlePathModels.indexOf(e); 15309 this.removeSinglePathModelAt(t) 15310 } 15311 removeSinglePathModelAt(e) { 15312 this._singlePathModels.splice(e, 1), 15313 this.pathDataUpdated() 15314 } 15315 getFillRule() { 15316 return this._fillRule 15317 } 15318 setFillRule(e) { 15319 this._fillRule = e, 15320 e === "evenodd" ? this.baseElement.setAttribute("fill-rule", e) : this.baseElement.removeAttribute("fill-rule") 15321 } 15322 getBounds() { 15323 let e = null; 15324 if (this._singlePathModels.length === 0) 15325 e = new Ve; 15326 else { 15327 for (let t of this._singlePathModels) { 15328 let n = t.getBounds(); 15329 e === null ? e = n : (e[0] = He(e[0], n[0]), 15330 e[1] = He(e[1], n[1]), 15331 e[2] = Ee(e[2], n[2]), 15332 e[3] = Ee(e[3], n[3])) 15333 } 15334 e = new Ve(e[0],e[1],e[2] - e[0],e[3] - e[1]) 15335 } 15336 return this._cachedBounds = e.clone(), 15337 e 15338 } 15339 getTransformedBounds(e) { 15340 e = e ?? this.getAggregateTransform(); 15341 let t = null; 15342 for (let s of this._singlePathModels) { 15343 let o = s.getTransformedBounds(e); 15344 t === null ? t = o : (t[0] = He(t[0], o[0]), 15345 t[1] = He(t[1], o[1]), 15346 t[2] = Ee(t[2], o[2]), 15347 t[3] = Ee(t[3], o[3])) 15348 } 15349 let n; 15350 return t == null ? n = new Ve(0,0,0,0) : n = new Ve(t[0],t[1],t[2] - t[0],t[3] - t[1]), 15351 n 15352 } 15353 transformUpdated() { 15354 this._cachedTransformedBounds = null, 15355 super.transformUpdated(); 15356 for (let e of this._singlePathModels) 15357 e.transformUpdated() 15358 } 15359 pathDataUpdated() { 15360 this._cachedBounds = null, 15361 this._cachedPathDataInfo = null, 15362 this._cachedTransformedBounds = null, 15363 this.applyTransformToElement(), 15364 this.modelChanged() 15365 } 15366 getOverlayPathInfo() { 15367 return { 15368 pathData: this.getPathData(this.getAggregateTransform(), -1, 6) 15369 } 15370 } 15371 getPathData(e, t=0, n) { 15372 let s; 15373 if (t !== 0) { 15374 let o = this.getPaths(e, t, !0); 15375 s = on(o, null, n) 15376 } else 15377 s = on(this.getPaths(null, 0, !1), e, n); 15378 return this._cachedPathDataInfo = { 15379 pathData: s, 15380 transform: e && e.clone() 15381 }, 15382 s 15383 } 15384 getElementTransform() { 15385 return this._elementTransform 15386 } 15387 getPathDataTransform() { 15388 return this._pathDataTransform 15389 } 15390 applySelfTransform() { 15391 let e = this._selfTransform; 15392 if (e != null && !e.isIdentity) { 15393 this._cachedBounds = null, 15394 this._cachedPathDataInfo = null, 15395 this._cachedTransformedBounds = null; 15396 for (let t of [this.fillPaint, this.strokePaint]) 15397 t && t.updateViewFromModel(); 15398 for (let t of this._singlePathModels) 15399 t.applyTransformToPath(e); 15400 e.set(), 15401 this.transformUpdated(); 15402 for (let t of [this.fillPaint, this.strokePaint]) 15403 t && (t.setModelTransform(new oe, this._elementTransform),
15404 t.updateModelFromView()) 15405 } 15406 } 15407 applyTransformToElement() { 15408 let e = this.getAggregateTransform(), t, n; 15409 { 15410 let i = e.decomposeAlt(!1); 15411 t = oe.composeAlt({ 15412 scale: i.scale, 15413 skew: i.skew 15414 }), 15415 n = oe.composeAlt({ 15416 translate: i.translate, 15417 rotate: i.rotate 15418 }) 15419 } 15420 this._elementTransform = n, 15421 this._pathDataTransform = t; 15422 for (let i of [this.fillPaint, this.strokePaint]) 15423 i && i.setModelTransform(e, n); 15424 let s = this._getPathDataElement() 15425 , o = this.getPathData(t, -1); 15426 s.setAttribute("d", o), 15427 n.isIdentity ? s.removeAttribute("transform") : s.setAttribute("transform", n.toSvgValue()) 15428 } 15429 toJSON() { 15430 return Object.assign(super.toJSON(), { 15431 d: this.getPathData(), 15432 fillRule: this._fillRule, 15433 elementTransform: this._elementTransform && this._elementTransform.toJSON(), 15434 pathDataTransform: this._pathDataTransform && this._pathDataTransform.toJSON() 15435 }) 15436 } 15437 setJSON(e) { 15438 super.setJSON(e), 15439 this.setFillRule(e.fillRule), 15440 this.setPathData(e.d), 15441 this._elementTransform = oe.fromJSON(e.elementTransform), 15442 this._pathDataTransform = oe.fromJSON(e.pathDataTransform) 15443 } 15444} 15445class bt extends Jl { 15446 static type = "path"; 15447 constructor(e) { 15448 let t = de("path", { 15449 style: "fill: none;" 15450 }); 15451 super(t, e) 15452 } 15453 _getPathDataElement() { 15454 return this.baseElement 15455 } 15456 setNodeTypes(e) { 15457 let t = this._singlePathModels 15458 , n = 0; 15459 for (let s of t) { 15460 let o = e?.slice(n, n + s.getNodeCount()); 15461 s.setNodeTypes(o), 15462 n += s.getNodeCount() 15463 } 15464 } 15465} 15466function Ke(l) { 15467 let e = []; 15468 for (let t of l) 15469 t.getType() === "group" ? e.splice(e.length, 0, ...Ke(t.getChildModels())) : t instanceof Fn && e.push(t); 15470 return e 15471} 15472function Lr(l) { 15473 for (let e = l.length - 1; e >= 0; e--) { 15474 let t = l[e]; 15475 if (t.getType() === "group") { 15476 let n = t._childModels 15477 , s = Lr(n); 15478 if (s != null) 15479 return s 15480 } else if (t instanceof Fn && !(t instanceof Fo)) 15481 return t 15482 } 15483} 15484function nu(l) { 15485 const e = new Map 15486 , t = n=>{ 15487 let s = e.get(n); 15488 if (s == null) { 15489 const o = n.getParentModel(); 15490 o ? s = [...t(o), o.getChildModelIndex(n)] : s = [], 15491 e.set(n, s) 15492 } 15493 return s 15494 } 15495 ; 15496 return l.sort((n,s)=>{ 15497 if (n === s) 15498 return 0; 15499 { 15500 const o = t(n) 15501 , i = t(s) 15502 , r = Math.min(o.length, i.length); 15503 for (let a = 0; a < r; a++) 15504 if (o[a] !== i[a]) 15505 return o[a] - i[a]; 15506 return o.length - i.length 15507 } 15508 } 15509 ) 15510} 15511const cf = DS() 15512 , nx = NS("app", { 15513 state() { 15514 return { 15515 zoom: 100, 15516 svgClientBounds: new Ve, 15517 tool: null, 15518 subTool: null, 15519 activeDocument: null, 15520 elementManager: null, 15521 overlayManager: null, 15522 undoManager: null, 15523 documentSettings: null, 15524 appSettings: uw(), 15525 selectedModels: qn([]), 15526 textSelection: qn({ 15527 textModel: null, 15528 dot: 0, 15529 mark: 0 15530 }), 15531 fillPaintGroup: new ql("fill",new et(new ce(51,51,51))), 15532 strokePaintGroup: new ql("stroke"), 15533 strokeStyle: new Qt, 15534 selectionFillRule: null, 15535 selectionOpacity: 1, 15536 selectionBlur: 0, 15537 selectionBlendMode: "normal", 15538 selectionTransform: new oe, 15539 selectionBounds: new Ve, 15540 transformedSelectionBounds: new Ve, 15541 resizeMode: "transform", 15542 pointerX: 0, 15543 pointerY: 0, 15544 editorCursor: { 15545 type: "default", 15546 rotation: 0, 15547 isGlobal: !1 15548 }, 15549 recentColors: qn(new Array(10)), 15550 bookmarkedColors: qn([]), 15551 recentFonts: ["Roboto", "Open Sans", "Inter"] 15552 } 15553 }, 15554 actions: {
15555 setActiveDocument(l) { 15556 this.activeDocument = ns(l), 15557 this.documentSettings = l.documentSettings 15558 }, 15559 setSelectedModels(l) { 15560 let e = this.selectedModels; 15561 e.splice(0, e.length, ...l) 15562 }, 15563 setTextSelection(l, e, t) { 15564 let n = this.textSelection; 15565 n.textModel = l, 15566 n.dot = e, 15567 n.mark = t 15568 }, 15569 setTool(l) { 15570 let e = fw(l) 15571 , t = null; 15572 this.tool != null && (this.tool.setSuspended(!1), 15573 this.tool.setActive(!1), 15574 t = this.tool.name), 15575 this.tool = ns(e), 15576 e.setActive(!0, t) 15577 }, 15578 setSubTool(l) { 15579 this.subTool !== l && (this.subTool != null && this.subTool.setActive(!1), 15580 l != null ? (this.subTool = ns(l), 15581 l.setActive(!0), 15582 this.tool.setSuspended(!0)) : (this.subTool = null, 15583 this.tool.setSuspended(!1))) 15584 }, 15585 setEditorCursor(l, e=0, t=!1) { 15586 let n = this.editorCursor; 15587 n.type = l, 15588 n.rotation = Jm(e), 15589 n.isGlobal = t 15590 }, 15591 updateSelectionBounds() { 15592 let l = this.selectedModels 15593 , e = null; 15594 l.length > 0 && (l.length === 1 ? e = l[0].getBounds() : e = l.reduce((t,n)=>{ 15595 let s = n.getTransformedBounds(); 15596 return t ? t.addRect(s) : s 15597 } 15598 , null)), 15599 (e == null || this.selectionBounds == null || !e.equals(this.selectionBounds)) && (this.selectionBounds = e) 15600 }, 15601 updateTransformedSelectionBounds() { 15602 let e = this.selectedModels.reduce((t,n)=>{ 15603 let s = n.getTransformedBounds(); 15604 return t ? t.addRect(s) : s 15605 } 15606 , null); 15607 (e == null || this.tranformedSelectionBounds == null || !e.equals(this.transformedSelectionBounds)) && (this.transformedSelectionBounds = e) 15608 }, 15609 updateSelectionStyle(l=!0, e=!0, t=!0) { 15610 let n = this.selectedModels, s = this.textSelection, o, i, r, a; 15611 if (s.textModel != null) { 15612 o = s.textModel; 15613 let d = s.mark > s.dot ? 1 : -1 15614 , u = o.getTextSpanModelAt(s.mark, d); 15615 i = u?.getPaint("fill") ?? o.getPaint("fill"), 15616 r = u?.getPaint("stroke") ?? o.getPaint("stroke"), 15617 a = u?.getStrokeStyle() ?? o.getStrokeStyle() 15618 } else 15619 o = Lr(n), 15620 o && (i = o.getPaint("fill"), 15621 r = o.getPaint("stroke"), 15622 o.getPaint("stroke") && (a = o.getStrokeStyle())); 15623 if (l && o != null) { 15624 let d = this.fillPaintGroup; 15625 i && i.updateViewFromModel(), 15626 d.setPaint(i), 15627 d.setPaintBounds(d.paintType, o.getTransformedBounds()) 15628 } 15629 if (e && o != null) { 15630 let d = this.strokePaintGroup; 15631 r && r.updateViewFromModel(), 15632 d.setPaint(r), 15633 d.setPaintBounds(d.paintType, o.getTransformedBounds()) 15634 } 15635 t && a != null && this.strokeStyle.set(a) 15636 }, 15637 updateSelectionFillRule() { 15638 let l = this.selectedModels; 15639 this.selectionFillRule = l.find(e=>e.getFillRule != null)?.getFillRule() ?? null 15640 }, 15641 updateSelectionOpacity() { 15642 let l = this.selectedModels; 15643 this.selectionOpacity = l.length > 0 ? l[0].getOpacity() : 1 15644 }, 15645 updateSelectionBlur() { 15646 let l = this.selectedModels; 15647 this.selectionBlur = l.length > 0 ? l[0].getBlur() : 0 15648 }, 15649 updateSelectionBlendMode() { 15650 let l = this.selectedModels; 15651 this.selectionBlendMode = l.length > 0 ? l[0].getBlendMode() : "normal" 15652 }, 15653 addRecentPaint(l) { 15654 if (l != null && l.type === "color") { 15655 let e = l.paintModelOrColor.toCss() 15656 , t = this.recentColors.findIndex(n=>n === e); 15657 t < 0 ? this.recentColors.pop() : this.recentColors.splice(t, 1), 15658 this.recentColors.unshift(e) 15659 } 15660 }, 15661 isShowAlignGuides() {
15662 let l = this.appSettings.editor; 15663 return l?.alignment?.enabled && l?.alignment?.showGuides 15664 } 15665 } 15666}); 15667let Jr = nx(cf); 15668Ie(Ab(Jr, "appSettings"), l=>{ 15669 hw() 15670} 15671, { 15672 deep: !0 15673}); 15674function V() { 15675 return Jr 15676} 15677function z() { 15678 return Jr.elementManager 15679} 15680function j() { 15681 return Jr.overlayManager 15682} 15683function ae() { 15684 return Jr.undoManager 15685} 15686const ie = (l,e)=>{ 15687 const t = l.__vccOpts || l; 15688 for (const [n,s] of e) 15689 t[n] = s; 15690 return t 15691} 15692 , sx = { 15693 name: "HyButton", 15694 props: { 15695 label: String, 15696 disabled: Boolean, 15697 primary: Boolean 15698 } 15699} 15700 , ox = ["disabled"]; 15701function ix(l, e, t, n, s, o) { 15702 return N(), 15703 $("button", { 15704 class: Ne(["hy-button hy-element", { 15705 "hy-disabled": t.disabled, 15706 "hy-primary-btn": t.primary 15707 }]), 15708 disabled: t.disabled, 15709 role: "button" 15710 }, [vt(l.$slots, "default"), !l.$slots.default && t.label ? (N(), 15711 $(Pe, { 15712 key: 0 15713 }, [ve(se(t.label), 1)], 64)) : be("", !0)], 10, ox) 15714} 15715const nt = ie(sx, [["render", ix]]) 15716 , wp = "center" 15717 , ga = "left" 15718 , Uu = "right" 15719 , jo = "top" 15720 , Gu = "bottom" 15721 , Pp = "start" 15722 , xp = "end" 15723 , uo = 0 15724 , Hu = 1 15725 , rx = { 15726 name: "HyPopover", 15727 inheritAttrs: !1, 15728 props: { 15729 show: { 15730 type: Boolean, 15731 default: !1 15732 }, 15733 onPointerdownOutside: { 15734 type: [Function, String], 15735 default: "close" 15736 }, 15737 onEscapeKey: { 15738 type: [Function, String], 15739 default: "cancel" 15740 }, 15741 onEnterKey: { 15742 type: [Function, String], 15743 default: null 15744 }, 15745 getSource: Function, 15746 primaryPos: { 15747 type: String, 15748 default: jo 15749 }, 15750 secondaryPos: { 15751 type: String, 15752 default: wp 15753 }, 15754 elevation: { 15755 type: Number, 15756 default: 10 15757 }, 15758 arrowSize: { 15759 type: Number, 15760 default: 0 15761 }, 15762 minArrowIndent: { 15763 type: Number, 15764 default: null 15765 }, 15766 getSrcBounds: { 15767 type: Function 15768 }, 15769 centerX: { 15770 type: Number, 15771 default: 0 15772 }, 15773 centerY: { 15774 type: Number, 15775 default: 0 15776 }, 15777 useBackdrop: { 15778 type: Boolean, 15779 default: !1 15780 }, 15781 backdropStyle: { 15782 type: String 15783 }, 15784 isIndependent: { 15785 type: Boolean, 15786 default: !1 15787 } 15788 }, 15789 data() { 15790 return { 15791 popoverLeft: 0, 15792 popoverTop: 0, 15793 arrowLeft: 0, 15794 arrowTop: 0 15795 } 15796 }, 15797 computed: { 15798 isCentered() { 15799 return this.getSrcBounds == null && this.getSource == null 15800 }, 15801 arrowStyle() { 15802 let l = .707 * (this.arrowSize || 0); 15803 return l === 0 ? { 15804 display: "none" 15805 } : { 15806 top: this.arrowTop - l / 2 + "px", 15807 left: this.arrowLeft - l / 2 + "px", 15808 width: l + "px", 15809 height: l + "px" 15810 } 15811 } 15812 }, 15813 emits: ["close", "cancel"], 15814 beforeUnmount() { 15815 this.removeGlobalEventListeners() 15816 }, 15817 mounted() { 15818 this.backdrop = this.useBackdrop ? Nd(this.$refs.backdrop) : null 15819 }, 15820 methods: { 15821 onKeydown(l) { 15822 if (!l.defaultPrevented) { 15823 if (l.key === "Escape") { 15824 let e = this.onEscapeKey; 15825 e != null && (typeof e == "string" ? this.$emit(e, l) : e(l), 15826 l.preventDefault()) 15827 } else if (l.key === "Enter") { 15828 let e = this.onEnterKey; 15829 e != null && (typeof e == "string" ? this.$emit(e, l) : e(l), 15830 l.preventDefault()) 15831 } else if (l.key === "Tab" && this.$refs.popover) { 15832 let e = ld(this.$refs.popover); 15833 if (e.length > 0) { 15834 let t = e[0] 15835 , n = e[e.length - 1]; 15836 l.shiftKey ? document.activeElement === t && (n.focus(), 15837 l.preventDefault()) : document.activeElement === n && (t.focus(), 15838 l.preventDefault()) 15839 } 15840 } 15841 } 15842 }, 15843 focus() { 15844 if (this.$refs.popover) { 15845 let l = ld(this.$refs.popover); 15846 l.length > 0 && (l.find(e=>e.autofocus) || l[0]).focus() 15847 } 15848 }, 15849 layout() { 15850 let l = this.$refs.popover; 15851 if (!l) 15852 return; 15853 let e; 15854 if (this.getSrcBounds != null)
15855 e = this.getSrcBounds(); 15856 else if (this.getSource != null) { 15857 let h = this.getSource(); 15858 h && (h = h.$el || h, 15859 e = h.getBoundingClientRect()) 15860 } 15861 let t = window, n = t.innerWidth, s = t.innerHeight, o = l.offsetWidth, i = l.offsetHeight, r, a, d, u; 15862 if (e == null) 15863 r = (n - o) / 2, 15864 a = (s - i) / 2, 15865 u = o / 2, 15866 d = i / 2; 15867 else { 15868 let h = e.width 15869 , c = e.height 15870 , f = e.x 15871 , p = e.y 15872 , g = this.primaryPos || jo 15873 , y = this.secondaryPos || wp 15874 , m = this.arrowSize / 2 15875 , b = 4 15876 , M = this.minArrowIndent; 15877 if (M == null && (this.arrowSize ? M = b : M = 0), 15878 g === ga || g === Uu) { 15879 let S = Math.max(0, -(f - m - o)) 15880 , x = Math.max(0, f + h + m + o - n); 15881 g === ga && S > x ? g = Uu : g === Uu && S < x && (g = ga), 15882 g === ga ? (r = Math.max(0, f - m - o), 15883 u = o) : (r = Math.min(n - o, f + h + m), 15884 u = 0); 15885 let P = p + M - i 15886 , C = p + c - M; 15887 y === Pp ? a = Math.max(Math.min(p, s - i, C), P, 0) : y === xp ? a = Math.max(0, p + c - i, P) : a = (P + C) / 2, 15888 d = Math.max(Math.min(i - this.arrowSize / 2 - b, p + c / 2 - a), b + this.arrowSize / 2) 15889 } else if (g === jo || g === Gu) { 15890 let S = Math.max(0, -(p - m - i)) 15891 , x = Math.max(0, p + c + m + i - s); 15892 g === jo && S > x ? g = Gu : g === Gu && S < x && (g = jo), 15893 g === jo ? (a = Math.max(0, p - m - i), 15894 d = i) : (a = Math.min(s - i, p + c + m), 15895 d = 0); 15896 let P = f + M - o 15897 , C = f + h - M; 15898 y === Pp ? r = Math.min(f, n - o, C) : y === xp ? r = Math.max(0, f + h - o, P) : (r = (P + C) / 2, 15899 r = Math.max(0, Math.min(r, n - o - 1))), 15900 u = Math.max(Math.min(o - this.arrowSize / 2 - b, f + h / 2 - r), b + this.arrowSize / 2) 15901 } 15902 } 15903 this.arrowLeft = u, 15904 this.arrowTop = d, 15905 this.popoverLeft = r, 15906 this.popoverTop = a, 15907 l.style.transformOrigin = u + "px " + d + "px" 15908 }, 15909 addGlobalEventListeners() { 15910 document.addEventListener("pointerdown", this.onPointerdown, !0), 15911 document.addEventListener("wheel", this.onWheel, { 15912 capture: !0, 15913 passive: !1 15914 }), 15915 window.addEventListener("resize", this.layout, !0) 15916 }, 15917 removeGlobalEventListeners() { 15918 document.removeEventListener("pointerdown", this.onPointerdown, !0), 15919 document.removeEventListener("wheel", this.onWheel, { 15920 capture: !0, 15921 passive: !1 15922 }), 15923 window.removeEventListener("resize", this.layout, !0) 15924 }, 15925 onWheel(l) { 15926 this.isTargetOutsidePopover(l) && l.preventDefault() 15927 }, 15928 onPointerdown(l) { 15929 if (this.isTargetOutsidePopover(l)) { 15930 let t = this.$refs.popover 15931 , n = t.parentElement; 15932 for (; n.tagName !== "BODY"; ) 15933 t = n, 15934 n = n.parentElement; 15935 let s = !1 15936 , o = Array.from(n.children).indexOf(t); 15937 for (let i = o + 1; i < n.children.length; i++) { 15938 let r = n.children[i]; 15939 if (r.classList.contains("hy-popover") && r.getAttribute("data-independent")) { 15940 s = !0; 15941 break 15942 } 15943 } 15944 if (s) 15945 return; 15946 if (l.type === "pointerdown") { 15947 let i = this.onPointerdownOutside; 15948 i != null && (typeof i == "string" ? this.$emit(i, l) : i(l)) 15949 } 15950 } else { 15951 let t = l.target; 15952 for (; t && !Er(t); ) 15953 t = t.parentElement; 15954 t === document.body && l.preventDefault() 15955 } 15956 }, 15957 isTargetOutsidePopover(l) { 15958 let e = this.$refs.backdrop 15959 , t = this.$refs.popover 15960 , n = e || t; 15961 if (n == null) 15962 return !0; 15963 let s = n.nextSibling; 15964 for (; s != null; ) { 15965 if (s.classList && s.classList.contains("hy-backdrop")) 15966 return !1; 15967 s = s.nextSibling 15968 } 15969 let o = l.target; 15970 if (o === e) 15971 return !0; 15972 let i = n.parentElement 15973 , r = o 15974 , a = !0; 15975 for (; r != null; ) { 15976 if (r === t) { 15977 a = !1; 15978 break 15979 } else if (r.parentElement === i) { 15980 Array.prototype.indexOf.call(i.children, n) < Array.prototype.indexOf.call(i.children, r) && (a = !1); 15981 break 15982 } 15983 r = r.parentElement 15984 } 15985 return a 15986 } 15987 }, 15988 watch: { 15989 show: { 15990 immediate: !0, 15991 handler(l) { 15992 if (l ? this.addGlobalEventListeners() : this.removeGlobalEventListeners(), 15993 l) 15994 this.$nextTick(()=>{ 15995 this.layout(), 15996 this.focus() 15997 } 15998 ); 15999 else { 16000 let e = document.activeElement; 16001 e != null && this.$refs.popover && this.$refs.popover.contains(e) && e.blur() 16002 } 16003 } 16004 } 16005 } 16006} 16007 , ax = { 16008 key: 0, 16009 class: "hy-popover-arrow-positioner" 16010} 16011 , dx = { 16012 class: "hy-popover-content-container" 16013} 16014 , ux = ["data-independent"] 16015 , hx = { 16016 key: 0, 16017 class: "hy-popover-arrow-positioner" 16018} 16019 , cx = { 16020 class: "hy-popover-content-container" 16021}; 16022function fx(l, e, t, n, s, o) { 16023 return N(), 16024 pe(I1, { 16025 to: "body" 16026 }, [t.useBackdrop ? (N(), 16027 $(Pe, { 16028 key: 0 16029 }, [t.show ? (N(), 16030 $("div", { 16031 key: 0, 16032 ref: "backdrop", 16033 class: "hy-backdrop", 16034 style: xe(t.backdropStyle) 16035 }, [w(Za, { 16036 name: "hy-popover-fade" 16037 }, {
16038 default: O(()=>[_("div", Wl({ 16039 ref: "popover" 16040 }, l.$attrs, { 16041 class: "hy-popover", 16042 style: { 16043 top: s.popoverTop + "px", 16044 left: s.popoverLeft + "px" 16045 }, 16046 onKeydown: e[0] || (e[0] = (...i)=>o.onKeydown && o.onKeydown(...i)) 16047 }), [t.arrowSize > 0 ? (N(), 16048 $("div", ax, [_("div", { 16049 class: "hy-popover-arrow", 16050 style: xe(o.arrowStyle) 16051 }, null, 4)])) : be("", !0), _("div", dx, [vt(l.$slots, "default")])], 16)]), 16052 _: 3 16053 })], 4)) : be("", !0)], 64)) : (N(), 16054 pe(Za, { 16055 key: 1, 16056 name: "hy-popover-fade" 16057 }, { 16058 default: O(()=>[t.show ? (N(), 16059 $("div", Wl({ 16060 key: 0, 16061 ref: "popover" 16062 }, l.$attrs, { 16063 class: "hy-popover", 16064 style: { 16065 top: s.popoverTop + "px", 16066 left: s.popoverLeft + "px" 16067 }, 16068 onKeydown: e[1] || (e[1] = (...i)=>o.onKeydown && o.onKeydown(...i)), 16069 "data-independent": t.isIndependent || null 16070 }), [t.arrowSize > 0 ? (N(), 16071 $("div", hx, [_("div", { 16072 class: "hy-popover-arrow", 16073 style: xe(o.arrowStyle) 16074 }, null, 4)])) : be("", !0), _("div", cx, [vt(l.$slots, "default")])], 16, ux)) : be("", !0)]), 16075 _: 3 16076 }))]) 16077} 16078const Ql = ie(rx, [["render", fx]]) 16079 , px = { 16080 name: "HyDropdown", 16081 components: { 16082 HyButton: nt, 16083 HyPopover: Ql 16084 }, 16085 props: { 16086 modelValue: null, 16087 label: String, 16088 disabled: Boolean, 16089 popupPrimaryPos: { 16090 type: String, 16091 default: "bottom" 16092 }, 16093 popupSecondaryPos: { 16094 type: String, 16095 default: "end" 16096 }, 16097 popoverStyle: String 16098 }, 16099 data: ()=>({ 16100 popoverOpen: !1 16101 }), 16102 emits: ["cancel", "close", "open"], 16103 methods: { 16104 isOpen() { 16105 return this.popoverOpen 16106 }, 16107 close() { 16108 this.popoverOpen && (this.popoverOpen = !1, 16109 this.$emit("close"), 16110 this.$refs.button.$el.focus()) 16111 }, 16112 cancel() { 16113 this.popoverOpen && (this.popoverOpen = !1, 16114 this.$emit("cancel"), 16115 this.$refs.button.$el.focus()) 16116 }, 16117 onButtonClick(l) { 16118 !l.defaultPrevented && !this.disabled && (l.preventDefault(), 16119 this.preventOpenOnButtonClick || el(()=>this.togglePopoverOpen())) 16120 }, 16121 onButtonPointerdown(l) { 16122 this.preventOpenOnButtonClick = l.defaultPrevented 16123 }, 16124 onButtonKeydown(l) { 16125 if (!l.defaultPrevented) { 16126 let e = !1; 16127 switch (l.key) { 16128 case " ": 16129 this.togglePopoverOpen(), 16130 e = !0; 16131 break; 16132 case "Escape": 16133 this.popoverOpen && (this.togglePopoverOpen(), 16134 e = !0); 16135 break 16136 } 16137 e && l.preventDefault() 16138 } 16139 }, 16140 onPointerdownOutside(l) { 16141 this.popoverOpen && (this.popoverOpen = !1, 16142 this.$emit("close"), 16143 this.$refs.button.$el.contains(l.target) && l.preventDefault()) 16144 }, 16145 togglePopoverOpen() { 16146 this.popoverOpen = !this.popoverOpen, 16147 this.popoverOpen ? this.$emit("open") : (this.$emit("close"), 16148 this.$refs.button.$el.focus()) 16149 } 16150 }, 16151 watch: { 16152 disabled(l) { 16153 l || (this.popoverOpen = !1) 16154 } 16155 } 16156} 16157 , gx = { 16158 class: "hy-dropdown-button-content" 16159} 16160 , mx = { 16161 key: 1, 16162 class: "hy-dropdown-button-label" 16163} 16164 , yx = { 16165 key: 3 16166}; 16167function vx(l, e, t, n, s, o) { 16168 const i = E("hy-button") 16169 , r = E("hy-popover"); 16170 return N(), 16171 $(Pe, null, [w(i, Wl({ 16172 ref: "button", 16173 class: ["hy-dropdown", { 16174 "hy-selected": l.popoverOpen 16175 }], 16176 disabled: t.disabled, 16177 onClick: o.onButtonClick, 16178 onPointerdown: o.onButtonPointerdown, 16179 onKeydown: o.onButtonKeydown 16180 }, l.$attrs), { 16181 default: O(()=>[_("div", gx, [l.$slots.button ? vt(l.$slots, "button", { 16182 key: 0 16183 }) : t.label ? (N(), 16184 $("span", mx, se(t.label), 1)) : be("", !0), l.$slots.arrow ? vt(l.$slots, "arrow", { 16185 key: 2 16186 }) : (N(), 16187 $("div", yx, [...e[0] || (e[0] = [_("svg", {
16188 viewBox: "0 0 32 32", 16189 "data-icon": "down", 16190 width: "0.6em", 16191 height: "0.6em", 16192 "aria-hidden": "true", 16193 focusable: "false" 16194 }, [_("path", { 16195 d: "M2 7l14 16 14-16", 16196 fill: "none", 16197 stroke: "currentColor", 16198 "stroke-width": "8", 16199 opacity: "0.9" 16200 })], -1)])]))])]), 16201 _: 3 16202 }, 16, ["class", "disabled", "onClick", "onPointerdown", "onKeydown"]), w(r, { 16203 ref: "popover", 16204 show: l.popoverOpen, 16205 primaryPos: t.popupPrimaryPos, 16206 secondaryPos: t.popupSecondaryPos, 16207 getSource: ()=>l.$refs.button, 16208 arrowSize: 0, 16209 class: "hy-dropdown-popover hy-elevation-4", 16210 onClose: o.close, 16211 onCancel: o.cancel, 16212 role: "listBox", 16213 onPointerdownOutside: o.onPointerdownOutside, 16214 style: xe(t.popoverStyle) 16215 }, { 16216 default: O(()=>[_("div", null, [vt(l.$slots, "default")])]), 16217 _: 3 16218 }, 8, ["show", "primaryPos", "secondaryPos", "getSource", "onClose", "onCancel", "onPointerdownOutside", "style"])], 64) 16219} 16220const xl = ie(px, [["render", vx]]) 16221 , bx = { 16222 name: "HyTooltip", 16223 components: { 16224 HyPopover: Ql 16225 }, 16226 props: { 16227 label: String, 16228 getTarget: Function, 16229 primaryPos: { 16230 type: String, 16231 default: "bottom" 16232 }, 16233 secondaryPos: { 16234 type: String, 16235 default: "center" 16236 } 16237 }, 16238 data() { 16239 return { 16240 visible: !1, 16241 delay: 100 16242 } 16243 }, 16244 mounted() { 16245 let l = this.getTargetElement(); 16246 l != null && (this.target = l, 16247 l.addEventListener("pointerenter", this.onPointerenter), 16248 l.addEventListener("pointerleave", this.hide), 16249 l.addEventListener("pointerdown", this.hide)) 16250 }, 16251 unmounted() { 16252 let l = this.target; 16253 l != null && (l.removeEventListener("pointerenter", this.onPointerenter), 16254 l.removeEventListener("pointerleave", this.hide), 16255 l.removeEventListener("pointerdown", this.hide)) 16256 }, 16257 methods: { 16258 getTargetElement() { 16259 let l = this.getTarget(); 16260 return l != null && !(l instanceof HTMLElement) && l.$el && (l = l.$el, 16261 l.nodeType === Node.TEXT_NODE && l.nextElementSibling && (l = l.nextElementSibling)), 16262 l 16263 }, 16264 onPointerenter(l) { 16265 let e = this.label != null && this.label !== "" 16266 , t = this.target 16267 , n = t.parentElement; 16268 for (; !n || n !== document.body; ) 16269 t = n, 16270 n = t.parentElement; 16271 let s = t.nextElementSibling; 16272 for (; s; ) { 16273 let o = s.classList; 16274 if (!o.contains("hy-tooltip") && (o.contains("hy-modal") || o.contains("hy-popover"))) { 16275 e = !1; 16276 break 16277 } 16278 s = s.nextElementSibling 16279 } 16280 l.buttons === 0 && this.showTimeoutID == null && (this.showTimeoutID = setTimeout(o=>{ 16281 o.visible = e, 16282 o.showTimeoutID = null 16283 } 16284 , this.delay, this)) 16285 }, 16286 hide() { 16287 this.showTimeoutID != null && (clearTimeout(this.showTimeoutID), 16288 this.showTimeoutID = null), 16289 this.visible = !1 16290 } 16291 } 16292} 16293 , Mx = { 16294 class: "hy-tooltip-content" 16295}; 16296function Sx(l, e, t, n, s, o) { 16297 const i = E("hy-popover"); 16298 return N(), 16299 pe(i, { 16300 show: s.visible && l.$store.appSettings.ui.showTooltips, 16301 "get-source": o.getTargetElement, 16302 primaryPos: t.primaryPos, 16303 secondaryPos: t.secondaryPos, 16304 class: "hy-tooltip", 16305 arrowSize: 8, 16306 elevation: 5 16307 }, { 16308 default: O(()=>[_("div", Mx, se(t.label), 1)]), 16309 _: 1 16310 }, 8, ["show", "get-source", "primaryPos", "secondaryPos"]) 16311} 16312const pt = ie(bx, [["render", Sx]]) 16313 , wx = { 16314 name: "HyRadio", 16315 props: { 16316 label: String, 16317 uncheckedValue: null, 16318 disabled: Boolean, 16319 name: { 16320 type: String, 16321 required: !0 16322 }, 16323 modelValue: [String, Number], 16324 value: [String, Number], 16325 type: String 16326 }, 16327 data() { 16328 return { 16329 focus: !1, 16330 focusVisible: !1 16331 } 16332 }, 16333 computed: { 16334 isChecked() { 16335 return this.modelValue === this.value 16336 } 16337 },
16338 emits: ["update:modelValue", "change", "blur", "focus"], 16339 methods: { 16340 onFocus(l) { 16341 this.focus = !0, 16342 this.$emit("focus", l) 16343 }, 16344 onBlur(l) { 16345 this.focus = !1, 16346 this.$emit("blur", l) 16347 }, 16348 onChange(l) { 16349 this.$emit("update:modelValue", this.value, l), 16350 this.$emit("change", l) 16351 }, 16352 onClick(l) { 16353 this.isChecked && this.uncheckedValue !== void 0 && (this.$emit("update:modelValue", this.uncheckedValue, l), 16354 this.$emit("change", l)) 16355 }, 16356 onKeydown(l) { 16357 l.key === " " && !l.repeat && this.isChecked && this.uncheckedValue !== void 0 && (l.preventDefault(), 16358 this.$emit("update:modelValue", this.uncheckedValue, l), 16359 this.$emit("change", l)) 16360 } 16361 }, 16362 watch: { 16363 focus(l) { 16364 this.focusVisible = l && this.$refs.input.matches(":focus-visible") 16365 } 16366 } 16367} 16368 , Px = ["disabled", "checked", "name"] 16369 , xx = { 16370 key: 0, 16371 class: "hy-radio-label" 16372} 16373 , Cx = { 16374 key: 1, 16375 class: "hy-radio-label" 16376}; 16377function _x(l, e, t, n, s, o) { 16378 return N(), 16379 $("label", { 16380 class: Ne(["hy-element", { 16381 "hy-radio": t.type !== "button", 16382 "hy-radio-button": t.type === "button", 16383 "hy-disabled": t.disabled, 16384 "hy-selected": o.isChecked, 16385 "hy-focus-visible": s.focusVisible 16386 }]), 16387 role: "radio", 16388 onClick: e[3] || (e[3] = (...i)=>o.onClick && o.onClick(...i)), 16389 onKeydown: e[4] || (e[4] = (...i)=>o.onKeydown && o.onKeydown(...i)) 16390 }, [_("input", { 16391 ref: "input", 16392 type: "radio", 16393 disabled: t.disabled, 16394 checked: o.isChecked, 16395 name: t.name, 16396 onChange: e[0] || (e[0] = (...i)=>o.onChange && o.onChange(...i)), 16397 onFocus: e[1] || (e[1] = (...i)=>o.onFocus && o.onFocus(...i)), 16398 onBlur: e[2] || (e[2] = (...i)=>o.onBlur && o.onBlur(...i)) 16399 }, null, 40, Px), t.label ? (N(), 16400 $("span", xx, se(t.label), 1)) : l.$slots.default ? (N(), 16401 $("span", Cx, [vt(l.$slots, "default")])) : be("", !0)], 34) 16402} 16403const en = ie(wx, [["render", _x]]) 16404 , Tx = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16405<path d="M0 11c0-1.4 1.1-2.5 2.5-2.5 1.4 0 2.5 1.1 2.5 2.5 0 1.4-1.1 2.5-2.5 2.5 -1.4 0-2.5-1.1-2.5-2.5zM8.5 11c0-1.4 1.1-2.5 2.5-2.5 1.4 0 2.5 1.1 2.5 2.5 0 1.4-1.1 2.5-2.5 2.5 -1.4 0-2.5-1.1-2.5-2.5zM17 11c0-1.4 1.1-2.5 2.5-2.5 1.4 0 2.5 1.1 2.5 2.5 0 1.4-1.1 2.5-2.5 2.5 -1.4 0-2.5-1.1-2.5-2.5z"/> 16406</svg>` 16407 , kx = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16408<path d="M8.5 2.5c0-1.4 1.1-2.5 2.5-2.5 1.4 0 2.5 1.1 2.5 2.5 0 1.4-1.1 2.5-2.5 2.5 -1.4 0-2.5-1.1-2.5-2.5zm0 8.5c0-1.4 1.1-2.5 2.5-2.5 1.4 0 2.5 1.1 2.5 2.5 0 1.4-1.1 2.5-2.5 2.5 -1.4 0-2.5-1.1-2.5-2.5zm0 8.5c0-1.4 1.1-2.5 2.5-2.5 1.4 0 2.5 1.1 2.5 2.5 0 1.4-1.1 2.5-2.5 2.5 -1.4 0-2.5-1.1-2.5-2.5z"/> 16409</svg>` 16410 , Ex = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16411<path d="M3 2c0-.55 .45-1 1-1h9c.27 0 .52 .11 .71 .29l5 5c.18 .19 .29 .44 .29 .71v13c0 .55-.45 1-1 1h-14c-.55 0-1-.45-1-1v-18zM12 3h-7v16h12v-11h-4c-.55 0-1-.45-1-1v-4z"/> 16412</svg>` 16413 , Dx = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16414<path d="M1.04 2.96c0-.55 .45-1 1-1l6.48 .04c.31 0 .61 .15 .8 .4l2.7 3.6 7.94-.04c.55 0 1 .45 1 1v11c0 .55-.45 1-1 1h-17.92c-.55 0-1-.45-1-1v-15zM3 7h7.32l-2.28-3.04 -5.04-.04v3.08zM3 8v9h16v-9.08l-16 .08z"/> 16415</svg>` 16416 , Ox = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16417<path d="M2 3c0-.55 .45-1 1-1h12c.27 0 .52 .11 .71 .29l4 4c.18 .19 .29 .44 .29 .71v12c0 .55-.45 1-1 1h-16c-.55 0-1-.45-1-1v-16zM14.57 4h-10.57v14h14v-10.57l-3.43-3.43zM8 6h6v2h-6zM8.5 12c0-1.38 1.12-2.5 2.5-2.5 1.38 0 2.5 1.12 2.5 2.5 0 1.38-1.12 2.5-2.5 2.5 -1.38 0-2.5-1.12-2.5-2.5z"/> 16418</svg>` 16419 , Ax = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16420 <path d="M3 2c0-0.5 0.5-1 1-1h9c0.3 0 0.5 0.1 0.7 0.3l5 5c0.2 0.2 0.3 0.4 0.3 0.7v13c0 0.6-0.4 1-1 1h-14c-0.5 0-1-0.4-1-1v-18zM5 3v16h12v-11h-4c-0.6 0-1-0.5-1-1v-4h-7zM6.5 11.5c0-0.3 0.2-0.5 0.5-0.5h1.6c0.2-0.6 0.7-1 1.4-1 0.7 0 1.2 0.4 1.4 1h3.6c0.3 0 0.5 0.2 0.5 0.5 0 0.3-0.2 0.5-0.5 0.5h-3.6c-0.2 0.6-0.7 1-1.4 1-0.7 0-1.2-0.4-1.4-1h-1.6c-0.3 0-0.5-0.2-0.5-0.5zM6.5 15.5c0-0.3 0.2-0.5 0.5-0.5h4.6c0.2-0.6 0.7-1 1.4-1 0.7 0 1.2 0.4 1.4 1h0.6c0.3 0 0.5 0.2 0.5 0.5 0 0.3-0.2 0.5-0.5 0.5h-0.6c-0.2 0.6-0.7 1-1.4 1-0.7 0-1.2-0.4-1.4-1h-4.6c-0.3 0-0.5-0.2-0.5-0.5z"/> 16421</svg>` 16422 , b2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16423<path d="M1 7c0-0.5 0.5-1 1-1h4v2h-3v11h11v-3h2v4c0 0.5-0.5 1-1 1h-13c-0.5 0-1-0.5-1-1v-13z"/> 16424<path d="M5 3c0-0.6 0.4-1 1-1h13c0.6 0 1 1 1 1v13c0 0.5-0.5 1-1 1h-13c-0.5 0-1-0.5-1-1v-13zM7 4v11h11v-11h-11z"/> 16425</svg>` 16426 , Ix = `<svg width="22" height="22" viewBox="0 0 22 22" fill="currentColor"> 16427<path d="M1 5.5c0-1.93 1.57-3.5 3.5-3.5 1.93 0 3.5 1.57 3.5 3.5 0 .62-.16 1.2-.44 1.71l2.72 1.77 5.65-4.98h4.81l-7.94 7 7.94 7h-4.8l-5.71-5.04-2.74 1.73c.33 .53 .51 1.15 .51 1.81 0 1.93-1.57 3.5-3.5 3.5-1.93 0-3.5-1.57-3.5-3.5 0-1.93 1.57-3.5 3.5-3.5 .36 0 .71 .05 1.04 .16l2.45-2.16-2.44-2.16c-.33 .1-.68 .16-1.05 .16-1.93 0-3.5-1.57-3.5-3.5zM4.5 15c-.83 0-1.5 .67-1.5 1.5 0 .83 .67 1.5 1.5 1.5 .83 0 1.5-.67 1.5-1.5 0-.83-.67-1.5-1.5-1.5zM4.5 4c-.83 0-1.5 .67-1.5 1.5 0 .83 .67 1.5 1.5 1.5 .83 0 1.5-.67 1.5-1.5 0-.83-.67-1.5-1.5-1.5z"/> 16428</svg>` 16429 , M2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16430<path d="M3 4c0-0.55 0.45-1 1-1h14c0.55 0 1 0.45 1 1v17c0 0.55-0.45 1-1 1h-14c-0.55 0-1-0.45-1-1v-17zM17 5h-12v15h12v-15z"/> 16431<path d="M7 6.5v-1.5-2.5c0-0.28 0.22-0.5 0.5-0.5h1.06c0.23-1.02 1.13-2 2.44-2 1.03 0 2.2 0.77 2.45 2h1.05c0.28 0 0.5 0.22 0.5 0.5v2.37 1.63c0 0.28-0.22 0.5-0.5 0.5h-3.5-3.5c-0.28 0-0.5-0.22-0.5-0.5zM11 1c-0.55 0-1 0.45-1 1 0 0.55 0.45 1 1 1 0.55 0 1-0.45 1-1 0-0.55-0.45-1-1-1z"/> 16432</svg>`
16433 , S2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16434 <path d="M1 4h2v2h-2v-2zM1 7h2v2h-2v-2zM1 12v-2h2v2h-2zM1 13h2v2h-2v-2zM1 16h2v2h-2v-2zM1 1h2v2h-2v-2zM1 19h2v2h-2v-2zM4 1h2v2h-2v-2zM4 19h2v2h-2v-2zM7 1h2v2h-2v-2zM7 19h2v2h-2v-2zM10 1h2v2h-2v-2zM10 19h2v2h-2v-2zM13 1h2v2h-2v-2zM13 19h2v2h-2v-2zM16 1h2v2h-2v-2zM16 19h2v2h-2v-2zM19 1h2v2h-2v-2zM19 4h2v2h-2v-2zM19 7h2v2h-2v-2zM19 10h2v2h-2v-2zM19 13h2v2h-2v-2zM19 16h2v2h-2v-2zM19 19h2v2h-2v-2z"/> 16435 <path d="M5 6c0-0.6 0.4-1 1-1h6c0.6 0 1 0.4 1 1v3h3c0.6 0 1 0.4 1 1v6c0 0.6-0.4 1-1 1h-6c-0.6 0-1-0.4-1-1v-3h-3c-0.6 0-1-0.4-1-1v-6zM13 11v1c0 0.6-0.4 1-1 1h-1v2h4v-4h-2zM7 7v4h4v-4h-4z"/> 16436</svg>` 16437 , w2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16438 <path d="M1 4h2v2h-2v-2zM1 7h2v2h-2v-2zM1 13h2v2h-2v-2zM1 1h2v2h-2v-2zM1 19h2v2h-2v-2zM4 19h2v2h-2v-2zM7 19h2v2h-2v-2zM10 1h2v2h-2v-2zM13 1h2v2h-2v-2zM16 1h2v2h-2v-2zM19 1h2v2h-2v-2zM19 10h2v2h-2v-2zM19 7h2v2h-2v-2zM19 4h2v2h-2v-2zM7 1h2v2h-2v-2zM4 1h2v2h-2v-2zM10 19h2v2h-2v-2zM1 16h2v2h-2v-2zM1 12v-2h2v2h-2z"/> 16439 <path d="M14.5 15.9c-0.2-0.2-0.2-0.5 0-0.7l0.7-0.7c0.2-0.2 0.5-0.2 0.7 0l1.8 1.8 1.8-1.8c0.2-0.2 0.5-0.2 0.7 0l0.7 0.7c0.2 0.2 0.2 0.5 0 0.7l-1.8 1.8 1.8 1.8c0.2 0.2 0.2 0.5 0 0.7l-0.7 0.7c-0.2 0.2-0.5 0.2-0.7 0l-1.8-1.8-1.8 1.8c-0.2 0.2-0.5 0.2-0.7 0l-0.7-0.7c-0.2-0.2-0.2-0.5 0-0.7l1.8-1.8-1.8-1.8z"/> 16440</svg>` 16441 , Lx = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16442<path d="M1 11c0-0.55 0.45-1 1-1h2v2h-1v6h16v-6h-1v-2h2c0.55 0 1 0.45 1 1v8c0 0.55-0.45 1-1 1h-18c-0.55 0-1-0.45-1-1v-8z" /> 16443<path d="M5 3c0-0.55 0.45-1 1-1h10c0.55 0 1 0.45 1 1v10c0 0.55-0.45 1-1 1h-10c-0.55 0-1-0.45-1-1v-10zM15 4h-8v8h8v-8z" /> 16444</svg>` 16445 , P2 = `<svg width="22" height="22" viewBox="0 0 22 22" fill="currentColor"> 16446 <path d="M1.5 11.1c-0.4-0.2-0.6-0.6-0.5-1.1l0.3-1.5c0.1-0.4 0.4-0.7 0.8-0.8 0.6-0.2 1.2-0.2 1.7-0.2 0.2-0.4 0.4-0.7 0.5-0.9-0.2-0.6-0.5-1.1-0.6-1.7-0.2-0.4-0.1-0.8 0.3-1l1.2-1.1c0.3-0.2 0.7-0.3 1.1-0.1 0.5 0.3 1 0.6 1.5 1 0.3-0.2 0.6-0.3 1-0.4 0.1-0.5 0.2-1.1 0.5-1.7 0.1-0.4 0.5-0.6 0.9-0.6h1.6c0 0 0 0 0 0 0.4 0 0.8 0.2 0.9 0.6 0.3 0.6 0.4 1.2 0.5 1.7 0.4 0.1 0.7 0.2 1 0.4 0.5-0.4 1-0.7 1.5-1 0.4-0.2 0.8-0.1 1.1 0.1l1.2 1.1c0.4 0.2 0.5 0.6 0.3 1-0.1 0.6-0.4 1.2-0.6 1.7 0.1 0.2 0.3 0.5 0.5 0.9 0.5 0 1.1 0 1.7 0.2 0.4 0.1 0.7 0.4 0.8 0.8l0.3 1.5c0.1 0.5-0.1 0.9-0.5 1.1-0.5 0.3-1 0.6-1.5 0.8-0.1 0.3-0.1 0.7-0.2 1 0.4 0.4 0.8 0.8 1.2 1.3 0.2 0.3 0.3 0.8 0.1 1.1l-0.8 1.4c-0.2 0.3-0.6 0.5-1 0.5-0.7-0.1-1.2-0.2-1.8-0.4-0.2 0.2-0.5 0.4-0.8 0.7 0.1 0.5 0.1 1.1 0.1 1.7 0 0.4-0.2 0.8-0.6 0.9l-1.5 0.6c-0.4 0.1-0.8 0-1.1-0.3-0.4-0.5-0.8-0.9-1.1-1.4-0.2 0-0.3 0-0.5 0-0.2 0-0.3 0-0.5 0-0.3 0.5-0.7 0.9-1.1 1.4-0.3 0.3-0.7 0.4-1.1 0.3l-1.5-0.6c-0.4-0.1-0.6-0.5-0.6-0.9 0-0.6 0-1.2 0.1-1.7-0.3-0.3-0.6-0.5-0.8-0.7-0.6 0.2-1.1 0.3-1.8 0.4-0.4 0-0.8-0.2-1-0.5l-0.8-1.4c-0.2-0.3-0.1-0.8 0.1-1.1 0.4-0.5 0.8-0.9 1.2-1.3-0.1-0.3-0.1-0.7-0.2-1-0.5-0.2-1-0.5-1.5-0.8zM3.1 9.5v0.2c0.4 0.2 0.8 0.4 1.2 0.5 0.4 0.2 0.7 0.5 0.7 0.9 0 0.7 0.1 1.3 0.3 1.8 0.1 0.4 0 0.8-0.3 1.1-0.3 0.3-0.7 0.6-1 0.9l0.1 0.2c0.5-0.1 0.9-0.3 1.3-0.4 0.4-0.2 0.8 0 1.1 0.3 0.4 0.4 0.9 0.8 1.4 1.1 0.3 0.2 0.5 0.7 0.4 1.1 0 0.4-0.1 0.8-0.1 1.3h0.1c0.3-0.3 0.6-0.7 0.8-1.1 0.2-0.3 0.6-0.5 1-0.5 0.3 0.1 0.6 0.1 0.9 0.1 0.3 0 0.6 0 0.9-0.1 0.4 0 0.8 0.2 1 0.5 0.2 0.4 0.5 0.8 0.8 1.1h0.1c0-0.5-0.1-0.9-0.1-1.3-0.1-0.4 0.1-0.9 0.4-1.1 0.5-0.3 1-0.7 1.4-1.1 0.3-0.3 0.7-0.5 1.1-0.3 0.4 0.1 0.8 0.3 1.3 0.4l0.1-0.2c-0.3-0.3-0.7-0.6-1-0.9-0.3-0.3-0.4-0.7-0.3-1.1 0.2-0.5 0.3-1.1 0.3-1.8 0-0.4 0.3-0.7 0.7-0.9 0.4-0.1 0.8-0.3 1.2-0.5v-0.2c-0.5 0-0.9-0.1-1.4-0.1-0.4 0.1-0.8-0.2-0.9-0.6-0.2-0.6-0.5-1.1-0.9-1.5-0.3-0.4-0.3-0.8-0.1-1.2 0.2-0.4 0.4-0.8 0.6-1.2l-0.1-0.1c-0.4 0.3-0.8 0.5-1.1 0.8-0.3 0.3-0.8 0.3-1.1 0.1-0.5-0.3-1.1-0.5-1.7-0.6-0.1 0-0.2 0-0.3-0.1 0 0 0 0 0 0-0.3-0.1-0.5-0.4-0.5-0.7-0.1-0.4-0.2-0.9-0.3-1.3h-0.2c-0.1 0.4-0.2 0.9-0.3 1.3-0.1 0.4-0.4 0.7-0.8 0.8-0.6 0.1-1.2
164460.3-1.7 0.6-0.3 0.2-0.8 0.2-1.1-0.1-0.3-0.3-0.7-0.5-1.1-0.8l-0.1 0.1c0.2 0.4 0.4 0.8 0.6 1.2 0.2 0.4 0.2 0.8-0.1 1.2-0.4 0.4-0.7 0.9-0.9 1.5-0.1 0.4-0.5 0.7-0.9 0.6-0.5 0-0.9 0.1-1.4 0.1zM7 11c0-2.2 1.8-4 4-4 2.2 0 4 1.8 4 4 0 2.2-1.8 4-4 4-2.2 0-4-1.8-4-4zM11 9c-1.1 0-2 0.9-2 2 0 1.1 0.9 2 2 2 1.1 0 2-0.9 2-2 0-1.1-0.9-2-2-2z"/> 16447</svg>` 16448 , x2 = `<svg width="22" height="22" viewBox="0 0 22 22" fill="currentColor"> 16449 <path d="M2 4c0-0.6 0.4-1 1-1h16c0.6 0 1 0.4 1 1v14c0 0.6-0.4 1-1 1h-16c-0.6 0-1-0.4-1-1v-14zM4 5v2h14v-2h-14zM4 8v9h4v-9h-4zM9 17h9v-9h-9v9z"/> 16450</svg>` 16451 , Vx = `<svg width="22" height="22" viewBox="0 0 22 22" fill="currentColor"> 16452 <path d="M2 3.9c0-0.6 0.4-1 1-1 2.9 0 4.7 0 7.5-1.7 0.3-0.3 0.7-0.3 1.1 0 2.6 1.7 4.5 1.7 7.4 1.7 0.6 0 1 0.4 1 1 0 10.5-3 14.9-8.6 17-0.3 0.1-0.5 0.1-0.8 0-5.6-2.1-8.6-6.5-8.6-17zM11 3.2c-2.6 1.5-4.6 1.7-7 1.7 0.2 9.2 3 12.4 7 14 0.3-0.1 0.5-0.2 0.8-0.3l-0.8-0.8v-1.4l1.7 1.7c0.5-0.3 1-0.7 1.5-1.1l-3.2-3.1v-1.5l3.9 3.9c0.3-0.4 0.7-0.9 1-1.5l-4.9-4.9v-1.5l5.4 5.4c0.3-0.5 0.5-1.2 0.7-1.9l-6.1-6.1v-1.4l6.4 6.4c0.1-0.7 0.2-1.4 0.3-2.1l-4.4-4.4c-0.7-0.3-1.5-0.6-2.3-1.1zM17.9 7.4c0-0.8 0.1-1.6 0.1-2.5-1 0-1.9-0.1-2.8-0.2l2.7 2.7z"/> 16453</svg>` 16454 , Nx = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16455<path d="M0 0h16v6h6v16h-16v-6h-6v-16zM16 8v8h-8v4h12v-12h-4zM14 6v-4h-12v12h4v-8h8zM14 8h-6v6h6v-6z"/> 16456</svg>` 16457 , C2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16458<path d="M1 1h14v6h6v14h-14v-6h-6v-14z"" fill-opacity="0.3"/> 16459<path d="M0 0h16v6h6v16h-16v-6h-6v-16zM14 8v-6h-12v12h6v6h12v-12h-6z"/> 16460<path d="M10 13h3v-3h2v3h3v2h-3v3h-2v-3h-3v-2z"/> 16461</svg>` 16462 , _2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16463<path d="M6 6h16v16h-16v-16zM20 8h-12v12h12v-12z" fill-opacity="0.5"/> 16464<path d="M1 1h14v6h-8v8h-6z" fill-opacity="0.3"/> 16465<path d="M0 0h16v8h-8v8h-8v-16zM14 2h-12v12h4v-8h8v-4z"/> 16466<path d="M10 13h8v2h-8v-2z"/> 16467</svg>` 16468 , T2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16469 <path d="M0 0h16v6h6v16h-16v-6h-6v-16zM16 6h-2v-4h-12v12h4v2h2v4h12v-12h-4v-2z" fill-opacity="0.5"/> 16470 <path d="M7 7h8v8h-8z" fill-opacity="0.3"/> 16471 <path d="M6 6h10v10h-10v-10zM14 8h-6v6h6v-6z"/> 16472</svg>` 16473 , Rx = '<svg viewBox="0 0 20 20" width="20" height="20" fill="currentColor"><path d="M2 1H18V3H2zM2 6H10V8H2zM2 11H14V13H2zM2 16H10V18H2z"/></svg>' 16474 , Fx = '<svg viewBox="0 0 32 32" width="24" height="24" fill="currentColor"><path d="M 4 4.0085 L 27.9901 3.9986 V 6.9975 L 4 7.0075 V 4.0085z M 14.0064 11.011 L 28 11.0011 V 14 L 14.0064 14.0099 V 11.011z M 9.0082 18.011 L 28 18.0011 V 21 L 9.0082 21.0099 V 18.011z M 17.0053 25.011 L 28 25.0011 V 28 L 17.0053 28.0099 V 25.011z"/></svg>' 16475 , Bx = '<svg viewBox="0 0 32 32" width="24" height="24" fill="currentColor"><path d="M 4 4.0085 L 27.9901 3.9986 V 6.9975 L 4 7.0075 V 4.0085z M 9 11.0011 L 22.9936 10.9911 V 13.9901 L 9 14 V 11.0011z M 6 18.0011 H 26 V 21 H 6 V 18.0011z M 11 25.0011 H 21 V 28 H 11 V 25.0011z"/></svg>' 16476 , k2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16477<path d="M1 5.53l7-4.53v3h5.5c4.14 0 7.5 3.36 7.5 7.5 0 4.14-3.36 7.5-7.5 7.5h-2.5v-3h2.5c2.49 0 4.5-2.01 4.5-4.5 0-2.49-2.01-4.5-4.5-4.5h-5.5v3.07l-7-4.54z"/> 16478</svg>` 16479 , E2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16480<path d="M21 5.53l-7-4.53v3h-5.5c-4.14 0-7.5 3.36-7.5 7.5 0 4.14 3.36 7.5 7.5 7.5h2.5v-3h-2.5c-2.49 0-4.5-2.01-4.5-4.5 0-2.49 2.01-4.5 4.5-4.5h5.5v3.07l7-4.54z"/> 16481</svg>` 16482 , zx = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16483<path d="M2 11c0-4.97 4.03-9 9-9 4.97 0 9 4.03 9 9 0 4.97-4.03 9-9 9 -4.97 0-9-4.03-9-9zM11 6.31c-2.59 0-4.69 2.1-4.69 4.69 0 2.59 2.1 4.69 4.69 4.69v-9.38zM11 15.69v3.31c4.42 0 8-3.58 8-8 0-4.42-3.58-8-8-8v3.31c2.59 0 4.69 2.1 4.69 4.69 0 2.59-2.1 4.69-4.69 4.69z"/> 16484</svg>` 16485 , ec = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16486<path d="M 1.000000000000001 13.000000000000002c 0-2.68639111235821 1.324600558820385-5.063822632455224 3.356203366540933-6.514696250370878 -0.231886921007373 0.798102096789915-0.356203366540935 1.641916170266791-0.356203366540935 2.514696250370877 0 0.21773059971107 0.007736737655901 0.433658522445235 0.022950224406848 0.647523779641644 -0.645892956443281 0.9571195065668-1.022950224406845 2.110685439847544-1.022950224406845 3.352476220358356 0 3.314213661360822 2.68578633863912 6.000000000000001 5.999999999999999 6.000000000000001 1.241790780510844 0 2.395356713791581-0.377057267963568 3.352476220358366-1.022950224406845 0.213865257196405 0.015213486750945 0.429793179930567 0.022950224406845 0.647523779641633 0.022950224406845 0.872780080104079 0 1.716594153580957-0.124316445533566 2.514696250370881-0.356203366540939 -1.450873617915665 2.031602807720561-3.828305138012701 3.356203366540947-6.514696250370878 3.356203366540943 -4.417772558775493-0.000000000000004-7.999999999999994-3.582227441224641-7.999999999999997-8.000000000000002z"/> 16487<path d="M 5 9.000000000000002c-0.000000000000002-4.417772558775436 3.582227441224599-8 8-8 4.417772558775441-0.000000000000002 8.000000000000002 3.582227441224604 8.000000000000002 8 -0.000000000000004 4.417772558775537-3.582227441224708 8.000000000000004-8 8.000000000000004 -4.417772558775278-0.
16487000000000000004-7.999999999999997-3.582227441224437-7.999999999999998-8.000000000000005zM 13.000000000000002 3.000000000000002c-3.314213661360818-0.000000000000001-6.000000000000002 2.685786338639116-6.000000000000002 5.999999999999999 -0.000000000000002 3.31421366136082 2.68578633863912 5.999999999999997 5.999999999999999 5.999999999999999 3.314213661360818 0.000000000000002 5.999999999999997-2.685786338639111 5.999999999999997-5.999999999999999 -0.000000000000004-3.314213661360865-2.68578633863915-5.999999999999997-5.999999999999995-5.999999999999997z"/> 16488<path d="M 10.000000000000002 8.000000000000002l 1.999999999999999-0.000000000000002v-1.999999999999999l 2.000000000000001-0.000000000000001v 2.000000000000001h 2.000000000000001v 2.000000000000001h-1.999999999999999l-0.000000000000002 2.000000000000001h-1.999999999999999l-0.000000000000002-1.999999999999999 -1.999999999999999-0.000000000000002 -0.000000000000002-1.999999999999999z"/> 16489</svg>` 16490 , Zr = `<svg width="22" height="22" viewBox="0 0 22 22" fill="currentColor"> 16491<path d="M 2 3h 4.5l 1.7-2.6c 0.2-0.2 0.5-0.4 0.8-0.4h 4c 0.3 0 0.6 0.2 0.8 0.4l 1.7 2.6h 4.5v 2h-18v-2zM 13.2 3l-0.7-1h-3l-0.7 1h 4.4z" /> 16492<path d="M 3.1 6h 2l 0.9 12c 0 0.1 0 0.3 0.1 0.4 0.2 0.3 0.6 0.6 0.9 0.6h 8c 0.4 0 1-0.6 1-1l 0.9-12h 1.9l-0.8 12c 0 1.5-1.5 3-3 3h-8c-1.6 0-3-1.5-3-3l-0.9-12z" /> 16493<path d="M8 9c 0-0.6 0.4-1 1-1 0.6 0 1 0.4 1 1v 7c 0 0.6-0.4 1-1 1 -0.6 0-1-0.4-1-1v-7z" /> 16494<path d="M12 9c 0-0.6 0.4-1 1-1 0.6 0 1 0.4 1 1v 7c 0 0.6-0.4 1-1 1 -0.6 0-1-0.4-1-1v-7z" /> 16495</svg>` 16496 , Ux = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16497<path d="M1 16h3v-4h-3v-2h3v-4h-3v-2h3v-3h2v3h4v-3h2v3h4v-3h2v3h3v2h-3v4h3v2h-3v4h3v2h-3v3h-2v-3h-4v3h-2v-3h-4v3h-2v-3h-3v-2zM16 6h-4v4h4v-4zM16 12h-4v4h4v-4zM10 6h-4v4h4v-4zM10 12h-4v4h4v-4z" fill-opacity="0.3"/> 16498<path d="M4 4h2v2h-2v-2zM4 10h2v2h-2v-2zM4 16h2v2h-2v-2zM10 10h2v2h-2v-2zM10 4h2v2h-2v-2zM10 16h2v2h-2v-2zM16 4h2v2h-2v-2zM16 10h2v2h-2v-2zM16 16h2v2h-2v-2z"/> 16499</svg>` 16500 , Gx = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16501<path d="M7.34 3.34c3.13-3.12 8.19-3.12 11.32 0 3.12 3.13 3.12 8.19 0 11.32l-7.07 7.07-3.54-3.54 7.07-7.07c0 0 0 0 0 0 1.17-1.17 1.17-3.07 0-4.24-1.17-1.17-3.07-1.17-4.24 0l-7.07 7.07-3.54-3.54 7.07-7.07c0 0 0 0 0 0zM17.95 13.95c0 0 0 0 0 0 2.73-2.73 2.73-7.17 0-9.9-2.73-2.73-7.17-2.73-9.9 0 0 0 0 0 0 0l-3.54 3.54 2.13 2.12 3.53-3.54c0 0 0 0 0 0 1.56-1.56 4.1-1.56 5.66 0 1.56 1.56 1.56 4.1 0 5.66l-3.54 3.53 2.12 2.13 3.54-3.54zM11.59 16.07l-2.13 2.12 2.13 2.12 2.12-2.12-2.12-2.12zM3.81 8.29l-2.12 2.12 2.12 2.13 2.12-2.13-2.12-2.12z"/> 16502<path d="M4.2 7.56l3.66-3.65c0 0 0 0 0 0 2.82-2.83 7.41-2.83 10.23 0 2.83 2.82 2.83 7.41 0 10.23 0 0 0 0 0 0l-3.65 3.66-2.44-2.44c1.2-1.28 2.46-2.5 3.7-3.74 1.48-1.47 1.48-3.85 0-5.32-1.47-1.48-3.85-1.48-5.32 0 0 0 0 0 0 0-1.24 1.24-2.43 2.54-3.75 3.69l-2.43-2.43z" fill-opacity="0.4"/> 16503</svg>` 16504 , Hx = '<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"><path d="M0 1h22v2h-22zM2 4h8v18h-8zm2 2v14h4v-14zM12 4h8v10h-8zm2 2v6h4v-6z"/></svg>' 16505 , D2 = '<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"><path d="M1 0h2v22h-2zM4 2h18v8h-18zM6 4v4h14v-4zM4 12h10v8h-10zM6 14v4h6v-4z"/><path fill-opacity="0.3" d="M5 3h16v6h-16zM5 13h8v6h-8z"/></svg>' 16506 , O2 = '<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"><path d="M19 0h2v22h-2zM0 2h18v8h-18zM2 4v4h14v-4zM8 12h10v8h-10zM10 14v4h6v-4z"/><path fill-opacity="0.3" d="M1 3h16v6h-16zM9 13h8v6h-8z"/></svg>' 16507 , A2 = `<svg viewBox="0 0 22 22" width="20" height="20" fill="currentColor"> 16508<path d="M3 3h16v6h-16v-6zM7 13h8v6h-8v-6z" fill-opacity="0.3"/> 16509<path d="M2 2h8v-2h2v2h8v8h-8v2h4v8h-4v2h-2v-2h-4v-8h4v-2h-8v-8zM18 4h-14v4h14v-4zM14 14h-6v4h6v-4z"/> 16510</svg>` 16511 , I2 = '<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"><path fill-opacity="0.3" d="M3 5h6v16h-6zM13 5h6v8h-6z"/><path d="M0 1h22v2h-22zM2 4h8v18h-8zm2 2v14h4v-14zM12 4h8v10h-8zm2 2v6h4v-6z"/></svg>' 16512 , L2 = '<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"><path fill-opacity="0.3" d="M3 1h6v16h-6zM13 9h6v8h-6z"/><path d="M0 20h22v2h-22zM2 0h8v18h-8zm2 2v14h4v-14zM12 8h8v10h-8zm2 2v6h4v-6z"/></svg>' 16513 , V2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16514<path d="M3 19v-16h6v16h-6zM13 15v-8h6v8h-6z" fill-opacity="0.3"/> 16515<path d="M2 20v-8h-2v-2h2v-8h8v8h2v-4h8v4h2v2h-2v4h-8v-4h-2v8h-8zM4 4v14h4v-14h-4zM14 8v6h4v-6h-4z"/> 16516</svg>`
16517 , N2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16518<path d="M 2 2h 3v 18h-3v-18zM 6 2h 2v 2h-2v-2zM 6 18h 2v 2h-2v-2zM 10 2h 2v 2h-2v-2zM 10 18h 2v 2h-2v-2zM 14 2h 2v 2h-2v-2zM 14 18h 2v 2h-2v-2zM 18 18h 2v 2h-2v-2zM 18 16v-2h 2v 2h-2zM 18 2h 2v 2h-2v-2zM 18 6h 2v 2h-2v-2zM 18 10h 2v 2h-2v-2z"/> 16519</svg>` 16520 , R2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16521<path d="M 2 2h 2v 2h-2v-2zM 2 6h 2v 2h-2v-2zM 2 10h 2v 2h-2v-2zM 2 14h 2v 2h-2v-2zM 2 18h 2v 2h-2v-2zM 6 2h 2v 2h-2v-2zM 6 18h 2v 2h-2v-2zM 9 20v-18h 4v 18h-4zM 14 2h 2v 2h-2v-2zM 14 18h 2v 2h-2v-2zM 18 2h 2v 2h-2v-2zM 18 6h 2v 2h-2v-2zM 18 10h 2v 2h-2v-2zM 18 14h 2v 2h-2v-2zM 18 18h 2v 2h-2v-2z"/> 16522</svg>` 16523 , F2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16524<path d="M 20 20h-3v-18h 3v 18zM 16 20h-2v-2h 2v 2zM 16 4h-2v-2h 2v 2zM 12 20h-2v-2h 2v 2zM 12 4h-2v-2h 2v 2zM 8 20h-2v-2h 2v 2zM 8 4h-2v-2h 2v 2zM 4 4h-2v-2h 2v 2zM 4 6v 2h-2v-2h 2zM 4 20h-2v-2h 2v 2zM 4 16h-2v-2h 2v 2zM 4 12h-2v-2h 2v 2z"/> 16525</svg>` 16526 , B2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16527<path d="M 20 2v 3h-18v-3h 18zM 20 6v 2h-2v-2h 2zM 4 6v 2h-2v-2h 2zM 20 10v 2h-2v-2h 2zM 4 10v 2h-2v-2h 2zM 20 14v 2h-2v-2h 2zM 4 14v 2h-2v-2h 2zM 4 18v 2h-2v-2h 2zM 6 18h 2v 2h-2v-2zM 20 18v 2h-2v-2h 2zM 16 18v 2h-2v-2h 2zM 12 18v 2h-2v-2h 2z"/> 16528</svg>` 16529 , z2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16530<path d="M 2 2h 2v 2h-2v-2zM 2 6h 2v 2h-2v-2zM 2 14h 2v 2h-2v-2zM 2 18h 2v 2h-2v-2zM 6 2h 2v 2h-2v-2zM 6 18h 2v 2h-2v-2zM 10 2h 2v 2h-2v-2zM 10 18h 2v 2h-2v-2zM 14 2h 2v 2h-2v-2zM 14 18h 2v 2h-2v-2zM 18 2h 2v 2h-2v-2zM 18 6h 2v 2h-2v-2zM 18 14h 2v 2h-2v-2zM 18 18h 2v 2h-2v-2zM 2 9h 18v 4h-18v-4z"/> 16531</svg>` 16532 , U2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16533<path d="M 2 20v-3h 18v 3h-18zM 2 16v-2h 2v 2h-2zM 18 16v-2h 2v 2h-2zM 2 12v-2h 2v 2h-2zM 18 12v-2h 2v 2h-2zM 2 8v-2h 2v 2h-2zM 18 8v-2h 2v 2h-2zM 18 4v-2h 2v 2h-2zM 16 4h-2v-2h 2v 2zM 2 4v-2h 2v 2h-2zM 6 4v-2h 2v 2h-2zM 10 4v-2h 2v 2h-2z"/> 16534</svg>` 16535 , $x = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16536<path d="M0 10c0-.6 .4-1 1-1h4c.6 0 1 .4 1 1v10c0 .6-.4 1-1 1h-4c-.6 0-1-.4-1-1v-10zM4 11h-2v8h2v-8zM8 10c0-.6 .4-1 1-1h4c.6 0 1 .4 1 1v10c0 .6-.4 1-1 1h-4c-.6 0-1-.4-1-1v-10zM12 11h-2v8h2v-8zM16 10c0-.6 .4-1 1-1h4c.6 0 1 .4 1 1v10c0 .6-.4 1-1 1h-4c-.6 0-1-.4-1-1v-10zM20 11h-2v8h2v-8z"/> 16537<path d="M1.6 4.2l5.4-3.5v2.3h8v-2.3l5.4 3.5 -5.4 3.5v-2.4h-8v2.4l-5.4-3.5z"/> 16538</svg>` 16539 , Xx = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16540 <path d="M0 7h6v10h-6v-10zM4 9h-2v6h2v-6zM8 7h6v10h-6v-10zM12 9h-2v6h2v-6zM16 7h6v10h-6v-10zM20 9h-2v6h2v-6z" opacity="0.4"/> 16541 <path d="M0 2h18v5h-2v-3h-6v3h-2v-3h-6v3h-2v-5zM0 17h2v3h-2v-3zM8 17h2v3h-2v-3zM16 17h2v3h-2v-3z"/> 16542</svg>` 16543 , Yx = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16544 <path d="M0 7h6v10h-6v-10zM4 9h-2v6h2v-6zM8 7h6v10h-6v-10zM12 9h-2v6h2v-6zM16 7h6v10h-6v-10zM20 9h-2v6h2v-6z" opacity="0.4"/> 16545 <path d="M2 2h18v5h-2v-3h-6v3h-2v-3h-6v3h-2v-5zM2 17h2v3h-2v-3zM10 17h2v3h-2v-3zM18 17h2v3h-2v-3z"/> 16546</svg>` 16547 , Kx = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16548 <path d="M0 7h6v10h-6v-10zM4 9h-2v6h2v-6zM8 7h6v10h-6v-10zM12 9h-2v6h2v-6zM16 7h6v10h-6v-10zM20 9h-2v6h2v-6z" opacity="0.4"/> 16549 <path d="M4 17h2v3h-2v-3zM4 2h18v5h-2v-3h-6v3h-2v-3h-6v3h-2v-5zM12 17h2v3h-2v-3zM20 17h2v3h-2v-3z"/> 16550</svg>` 16551 , Wx = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16552 <path d="M0 7h6v10h-6v-10zM4 9h-2v6h2v-6zM8 7h6v10h-6v-10zM12 9h-2v6h2v-6zM16 7h6v10h-6v-10zM20 9h-2v6h2v-6z" opacity="0.4"/> 16553 <path d="M6 3h2v16h-2v-16zM14 3h2v16h-2v-16z" opacity="0.6"/> 16554</svg>` 16555 , qx = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16556 <path d="M7 22v-6h10v6h-10zM9 18v2h6v-2h-6zM7 14v-6h10v6h-10zM9 10v2h6v-2h-6zM7 6v-6h10v6h-10zM9 2v2h6v-2h-6z" opacity="0.4"/> 16557 <path d="M17 2v-2h3v2h-3zM17 10v-2h3v2h-3zM17 18v-2h3v2h-3zM2 18v-18h5v2h-3v6h3v2h-3v6h3v2h-5z"/> 16558</svg>` 16559 , jx = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16560 <path d="M7 22v-6h10v6h-10zM9 18v2h6v-2h-6zM7 14v-6h10v6h-10zM9 10v2h6v-2h-6zM7 6v-6h10v6h-10zM9 2v2h6v-2h-6z" opacity="0.4"/> 16561 <path d="M17 4v-2h3v2h-3zM17 12v-2h3v2h-3zM17 20v-2h3v2h-3zM2 20v-18h5v2h-3v6h3v2h-3v6h3v2h-5z"/> 16562</svg>` 16563 , Jx = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16564 <path d="M7 22v-6h10v6h-10zM9 18v2h6v-2h-6zM7 14v-6h10v6h-10zM9 10v2h6v-2h-6zM7 6v-6h10v6h-10zM9 2v2h6v-2h-6z" opacity="0.4"/> 16565 <path d="M17 6v-2h3v2h-3zM17 14v-2h3v2h-3zM17 22v-2h3v2h-3zM2 22v-18h5v2h-3v6h3v2h-3v6h3v2h-5z"/> 16566</svg>` 16567 , Zx = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16568 <path d="M7 22v-6h10v6h-10zM9 18v2h6v-2h-6zM7 14v-6h10v6h-10zM9 10v2h6v-2h-6zM7 6v-6h10v6h-10zM9 2v2h6v-2h-6z" opacity="0.4"/> 16569 <path d="M4 16v-2h16v2h-16zM4 8v-2h16v2h-16z"/> 16570</svg>` 16571 , G2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16572<path d="M1.6 10.1l3.2-1.6 -3.2-1.6c-.8-.4-.8-1.4 0-1.8l9-4.5c.2-.1 .6-.1 .8 0l9 4.5c.8 .4 .8 1.4 0 1.8l-3.2 1.6 3.2 1.6c.8 .4 .8 1.4 0 1.8l-3.2 1.6 3.2 1.6c.8 .4 .8 1.4 0 1.8l-9 4.5c-.2 .1-.6 .1-.8 0l-9-4.5c-.8-.4-.8-1.4 0-1.8l3.2-1.6 -3.2-1.6c-.8-.4-.8-1.4 0-1.8zM15 14.6l-3.6 1.8c-.2 .1-.6 .1-.8 0l-3.6-1.8 -2.8 1.4 6.8 3.4 6.8-3.4 -2.8-1.4zM11 2.6l-6.8 3.4 6.8 3.4 6.8-3.4 -6.8-3.4zM7 9.6l-2.8 1.4 6.8 3.4 6.8-3.4 -2.8-1.4 -3.6 1.8c-.2 .1-.6 .1-.8 0l-3.6-1.8z"/> 16573</svg>` 16574 , H2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16575<path d="M2.6 11.1l4.2-2.1 2.2 1.1 -3.8 1.9 5.8 2.9 5.8-2.9 -3.8-1.9 2.2-1.1 4.2 2.1c.8 .4 .8 1.4 0 1.8l-3.2 1.6 3.2 1.6c.8 .4 .8 1.4 0 1.8l-8 4c-.2 .1-.6 .1-.8 0l-8-4c-.8-.4-.8-1.4 0-1.8l3.2-1.6 -3.2-1.6c-.8-.4-.8-1.4 0-1.8zM14 15.6l-2.6 1.3c-.2 .1-.6 .1-.8 0l-2.6-1.3 -2.8 1.4 5.8 2.9 5.8-2.9 -2.8-1.4z" op
16575acity="0.7"/> 16576<path d="M1 5.9l10-5 10 5 -10 5 -10-5z" opacity="0.3"/> 16577<path d="M.6 5.1l10-5c.2-.1 .6-.1 .8 0l10 5c.8 .4 .8 1.4 0 1.8l-10 5c-.2 .1-.6 .1-.8 0l-10-5c-.8-.4-.8-1.4 0-1.8zM11 2.1l-7.8 3.9 7.8 3.9 7.8-3.9 -7.8-3.9z"/> 16578</svg>` 16579 , $2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16580<path d="M7.1 12.1l3.9 1.9 3.9-1.9 6.1 3 -10 5 -10-5 6.1-3z" opacity="0.3"/> 16581<path d="M.6 15.9c-.8-.4-.8-1.4 0-1.8l5.6-2.8 2.2 1.1 -5.2 2.6 7.8 3.9 7.8-3.9 -5.2-2.6 2.2-1.1 5.6 2.8c.8 .4 .8 1.4 0 1.8l-10 5c-.2 .1-.6 .1-.8 0l-10-5z"/> 16582<path d="M2 10c0-.4 .2-.7 .6-.9l3.2-1.6 -3.2-1.6c-.4-.1-.6-.5-.6-.9 0-.4 .2-.7 .6-.9l8-4c.2-.1 .6-.1 .8 0l8.1 4c.3 .2 .5 .5 .5 .9 0 .4-.2 .8-.5 .9l-3.3 1.6 3.3 1.6c.3 .2 .5 .5 .5 .9 0 .4-.2 .7-.5 .9l-8.1 4c-.2 .2-.6 .2-.8 0l-8-4c-.4-.2-.6-.5-.6-.9zM8 8.6l-2.8 1.4 5.8 2.9 5.8-2.9 -2.8-1.4 -2.6 1.3c-.2 .2-.6 .2-.8 0l-2.6-1.3zM11 2.1l-5.8 2.9 5.8 2.9 5.8-2.9 -5.8-2.9z" opacity="0.7"/> 16583</svg>` 16584 , X2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16585<path d="M2.6 14.08l4.2-2.1 2.2 1.1 -3.8 1.9 5.8 2.9 5.8-2.9 -3.8-1.9 2.2-1.1 4.2 2.1c.81 .4 .81 1.39 0 1.8l-8 4c-.2 .1-.6 .1-.8 0l-8-4c-.81-.41-.81-1.4 0-1.8z" opacity="0.7"/> 16586<path d="M1 8.88l10-5 10 5 -10 5 -10-5z" opacity="0.3"/> 16587<path d="M.6 8.08l10-5.01c.2-.09 .6-.09 .8 0l10 5.01c.8 .4 .8 1.4 0 1.8l-10 5c-.2 .1-.6 .1-.8 0l-10-5c-.8-.4-.8-1.4 0-1.8zM11 5.08l-7.8 3.9 7.8 3.9 7.8-3.9 -7.8-3.9z"/> 16588</svg>` 16589 , Y2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16590<path d="M7.1 10l3.9 2 3.9-2 6.1 3.1 -10 5 -10-5 6.1-3.1z" opacity="0.3"/> 16591<path d="M.6 13.9c-.8-.4-.8-1.4 0-1.8l5.6-2.8 2.2 1.1 -5.2 2.6 7.8 3.9 7.8-3.9 -5.2-2.6 2.2-1.1 5.6 2.8c.8 .4 .8 1.4 0 1.8l-10 5c-.2 .1-.6 .1-.8 0l-10-5z"/> 16592<path d="M2 8c0-.4 .2-.7 .6-.9l8-4c.2-.1 .6-.1 .8 0l8.1 4c.3 .2 .5 .5 .5 .9 0 .4-.2 .7-.5 .9l-8.1 4c-.2 .1-.6 .1-.8 0l-8-4c-.4-.2-.6-.5-.6-.9zM11 5.1l-5.8 2.9 5.8 2.9 5.8-2.9 -5.8-2.9z" opacity="0.7"/> 16593</svg>` 16594 , K2 = '<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"><path d="M0 0h4v4h-4zm1 1v2h2v-2 M18 0h4v4h-4zm1 1v2h2v-2 M0 18h4v4h-4zm1 1v2h2v-2 M18 18h4v4h-4zm1 1v2h2v-2z"/><path d="M1 3h2v16h-2z M3 1h16v2h-16z M19 3h2v16h-2z M3 19h16v2h-16z"/><path d="M5 5h8v4h4v8h-8v-4h-4v-8zM13 11v2h-2v2h4v-4h-2zM11 7h-4v4h4v-4z"/></svg>' 16595 , W2 = '<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"><path d="M0 0h4v4h-4zm1 1v2h2v-2 M11 0h4v4h-4zm1 1v2h2v-2 M0 11h4v4h-4zm1 1v2h2v-2 M7 7h4v4h-4zm1 1v2h2v-2 M18 7h4v4h-4zm1 1v2h2v-2 M18 18h4v4h-4zm1 1v2h2v-2 M7 18h4v4h-4zm1 1v2h2v-2"/><path d="M1 3h2v9h-2z M3 1h9v2h-9z M12 3h2v6h-2z M3 12h6v2h-6 M8 10h2v9h-2z M10 8h9v2h-9z M19 10h2v9h-2z M10 19h9v2h-9"/></svg>' 16596 , Qx = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16597<path d="M0 1h8v8h-8v-8zM6 3h-4v4h4v-4z"/> 16598<path d="M0 13h8v8h-8v-8zM6 15h-4v4h4v-4z"/> 16599<path d="M9 4.3h2c2.6-0.1 3 2.3 3.2 3.5 0.4 1.7 0.6 2.4 1.8 2.5l2.7-0.1-1.2-1.2c-0.3-0.3-0.3-0.7 0-1 0.3-0.3 0.7-0.3 1 0l2.5 2.5c0.3 0.3 0.3 0.7 0 1l-2.5 2.5c-0.3 0.3-0.7 0.3-1 0-0.3-0.3-0.3-0.7 0-1l1.2-1.3h-2.7c-1.2 0.1-1.4 0.8-1.8 2.5-0.2 1.2-0.6 3.6-3.2 3.5h-2v-1.5h2c1.2 0.1 1.4-0.7 1.8-2.4 0.1-0.8 0.4-2 1.2-2.8-0.8-0.8-1.1-2-1.2-2.8-0.4-1.7-0.6-2.4-1.8-2.5h-2v-1.5z"/> 16600</svg>` 16601 , eC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor">' 16602<path d="M0 1h8v8h-8v-8zM6 3h-4v4h4v-4z"/> 16603<path d="M0 13h8v8h-8v-8zM6 15h-4v4h4v-4z"/> 16604<path d="M9 10.3l2-0.1c0 0 0 0 0 0 1.2 0 1.4-0.7 1.8-2.4 0.2-1.2 0.6-3.5 3.2-3.5l2.7-0.1-1.2-1.2c-0.3-0.3-0.3-0.7 0-1 0.3-0.3 0.7-0.3 1 0l2.5 2.5c0.3 0.3 0.3 0.7 0 1l-2.5 2.5c-0.3 0.3-0.7 0.3-1 0-0.3-0.3-0.3-0.7 0-1l1.2-1.2h-2.7c-1.2-0.1-1.4 0.7-1.8 2.4-0.1 0.8-0.4 2-1.2 2.8 0.8 0.8 1.1 2 1.2 2.8 0.4 1.7 0.6 2.4 1.8 2.5l2.7-0.1-1.2-1.2c-0.3-0.3-0.3-0.7 0-1 0.3-0.3 0.7-0.3 1 0l2.5 2.5c0.3 0.3 0.3 0.7 0 1l-2.5 2.5c-0.3 0.3-0.7 0.3-1 0-0.3-0.3-0.3-0.7 0-1l1.2-1.2-2.7-0.1c-2.6 0-3-2.3-3.2-3.5-0.4-1.7-0.6-2.4-1.8-2.4h-2v-1.5z"/> 16605</svg>` 16606 , tC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16607<path d="M10 0h2v22h-2v-22z"/> 16608<path d="M11 3h7v4c2.21 0 4 1.79 4 4 0 2.21-1.79 4-4 4v4h-7v-16zM16 5h-4v12h4v-4h2c1.1 0 2-0.9 2-2 0-1.1-0.9-2-2-2h-2v-4z""/> 16609<path d="M1 11c0-1.66 1.34-3 3-3h1v-4h6v14h-6v-4h-1c-1.66 0-3-1.34-3-3z" fill-opacity="0.3"/> 16610<path d="M0 11c0-2.21 1.79-4 4-4v-4h7v16h-7v-4c-2.21 0-4-1.79-4-4zM4 9c-1.1 0-2 0.9-2 2 0 1.1 0.9 2 2 2h2v4h4v-12h-4v4h-2z"/> 16611</svg>` 16612 , lC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16613<path d="M0 10h22v2h-22v-2z"/> 16614<path d="M3 11h16v7h-4c0 2.21-1.79 4-4 4-2.21 0-4-1.79-4-4h-4v-7zM17 12h-12v4h4v2c0 1.1 0.9 2 2 2 1.1 0 2-0.9 2-2v-2h4v-4z"/> 16615<path d="M4 5h4v-1c0-1.66 1.34-3 3-3 1.66 0 3 1.34 3 3v1h4v6h-14v-6z" fill-opacity="0.3"/> 16616<path d="M3 4h4c0-2.21 1.79-4 4-4 2.21 0 4 1.79 4 4h4v7h-16v-7zM9 6h-4v4h12v-4h-4v-2c0-1.1-0.9-2-2-2-1.1 0-2 0.9-2 2v2z"/> 16617</svg>` 16618 , nC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16619 <path d="M5 10h9v9h-9z" fill-opacity="0.3"/> 16620 <path d="M4 9h11v11h-11zM13 11h-7v7h7z"/> 16621 <path d="M8 4l5-3v2c1.6 0 3.5 0.6 5 2.1 1 1 2 2.8 2 4.9v1h-2v-1c0-1.2-0.3-2.4-1.5-3.5-0.7-0.8-1.8-1.5-3.5-1.5v2z"/> 16622</svg>` 16623 , sC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16624 <path d="M8 10h9v9h-9z" fill-opacity="0.3"/> 16625 <path d="M7 9h11v11h-11zM16 11h-7v7h7z"/> 16626 <path d="M2 10c0-2.1 1-3.9 2-4.9 1.5-1.5 3.4-2.1 5-2.1v-2l5 3-5 3v-2c-1.7 0-2.8 0.7-3.5 1.5-1.2 1.1-1.5 2.3-1.5 3.5v1h-2z"/> 16627</svg>` 16628 , oC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16629<path d="M0 7c0-1.1 .9-2 2-2 .74 0 1.39 .4 1.73 1h4.44c.41-1.17 1.52-2 2.83-2 1.31 0 2.42 .83 2.83 2h4.44c.34-.6 .99-1 1.73-1 1.1 0 2 .9 2 2 0 1.1-.9 2-2 2-.74 0-1.39-.4-1.73-1h-4.44c0 .01-.01 .02-.01 .03 4.94 2 6.17 9.09 6.17 11.97h-1c0-2.29-.99-9.31-5.68-11.09-.55 .67-1.38 1.09-2.31 1.09-.94 0-1.77-.43-2.32-1.1-4.68 1.75-5.69 8.79-5.69 11.1h-1c0-2.88 1.25-10.01 6.19-11.98-.01-.01-.01-.01-.01-.02h-4.44c-.34 .6-.99 1-1.73 1-1.1 0-2-.9-2-2zM11 6c-.55 0-1 .45-1 1 0 .55 .45 1 1 1 .55 0 1-.45 1-1 0-.55-.45-1-1-1z"/> 16630</svg>` 16631 , iC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16632<path d="M1 12c0-1.1 .9-2 2-2 .34 0 .66 .08 .94 .23l4.13-2.58c-.05-.21-.07-.43-.07-.65 0-1.66 1.34-3 3-3 1.66 0 3 1.34 3 3 0 .22-.02 .44-.07 .65l4.13 2.58c.28-.15 .6-.23 .94-.23 1.1 0 2 .9 2 2 0 1.1-.9 2-2 2-1.1 0-2-.9-2-2 0-.02 0-.05 0-.07l-3.43-2.14c2.04 2.18 4.75 5.75 5.75 10.21h-1.03c-1.1-4.64-4.18-8.29-6.13-10.23-.36 .15-.75 .23-1.16 .23-.41 0-.8-.08-1.16-.23-1.95 1.94-5.03 5.59-6.13 10.23h-1.03c1-4.46 3.71-8.03 5.75-10.21l-3.43 2.14c0 .02 0 .05 0 .07 0 1.1-.9 2-2 2-1.1 0-2-.9-2-2zM11 6c-.55 0-1 .45-1 1 0 .55 .45 1 1 1 .55 0 1-.45 1-1 0-.55-.45-1-1-1z"/> 16633</svg>` 16634 , rC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16635<path d="M4 7h2c0 1.88 0.6 2.15 0.88 2.36 1.09 0.79 2.73 0.64 4.12 0.64 1.99 0 7-0.31 7 5h-2c0-1.88-0.6-2.15-0.88-2.36-1-0.72-2.58-0.64-4.12-0.64-1.99 0-7 0.31-7-5z"/> 16636<path d="M2 5c0-1.3 0.98-3 3-3 1.3 0 3 0.98 3 3 0 1.3-0.98 3-3 3-1.3 0-3-0.98-3-3zM5 4c-0.27 0-1 0.22-1 1 0 0.27 0.22 1 1 1 0.27 0 1-0.22 1-1 0-0.27-0.22-1-1-1zM14 17c0-1.3 0.98-3 3-3 1.3 0 3 0.98 3 3 0 1.3-0.98 3-3 3-1.3 0-3-0.98-3-3zM17 16c-0.27 0-1 0.22-1 1 0 0.27 0.22 1 1 1 0.27 0 1-0.22 1-1 0-0.27-0.22-1-1-1z"/> 16637</svg>` 16638 , aC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16639<path d="M5.29 6.71l1.42-1.42 10 10-1.42 1.42-10-10z"/> 16640<path d="M2 5c0-1.3 0.98-3 3-3 1.3 0 3 0.98 3 3 0 1.3-0.98 3-3 3-1.3 0-3-0.98-3-3zM5 4c-0.27 0-1 0.22-1 1 0 0.27 0.22 1 1 1 0.27 0 1-0.22 1-1 0-0.27-0.22-1-1-1zM14 17c0-1.3 0.98-3 3-3 1.3 0 3 0.98 3 3 0 1.3-0.98 3-3 3-1.3 0-3-0.98-3-3zM17 16c-0.27 0-1 0.22-1 1 0 0.27 0.22 1 1 1 0.27 0 1-0.22 1-1 0-0.27-0.22-1-1-1z"/> 16641</svg>` 16642 , dC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16643<path d="M 2 4h 4.6l-1.3-1.3c-0.4-0.4-0.4-1 0-1.4 0.4-0.4 1-0.4 1.4 0l 3 3c 0.4 0.4 0.4 1 0 1.4l-3 3c-0.4 0.4-1 0.4-1.4 0 -0.4-0.4-0.4-1 0-1.4l 1.3-1.3h-4.6v-2zM 2 17c 0-2.2 1.8-4 4-4h 0.2c 0.3-1 1.3-2 2.8-2 0.7 0 1.4 0.2 2 0.7 0.5-0.4 1.1-0.7 2-0.7 1.1 0 2.4 0.7 2.8 2 0.1 0 0.1 0 0.2 0 2.2 0 4 1.8 4 4 0 2.2-1.8 4-4 4h-10c-2.2 0-4-1.8-4-4zM 6 15c-1.1 0-2 0.9-2 2 0 1.1 0.9 2 2 2h 10c 1.1 0 2-0.9 2-2 0-1.1-0.9-2-2-2h-0.2c-0.3 1-1.3 2-2.8 2 -0.7 0-1.4-0.2-2-0.7 -0.5 0.4-1.1 0.7-2 0.7 -1.1 0-2.4-0.7-2.8-2h-0.2zM 9 13c-0.3 0-1 0.2-1 1 0 0.3 0.2 1 1 1 0.3 0 1-0.2 1-1 0-0.3-0.2-1-1-1zM 12.3 5.7c-0.4-0.4-0.4-1 0-1.4l 3-3c 0.4-0.4 1-0.4 1.4 0 0.4 0.4 0.4 1 0 1.4l-1.3 1.3h 4.6v 2h-4.6l 1.3 1.3c 0.4 0.4 0.4 1 0 1.4 -0.4 0.4-1 0.4-1.4 0l-3-3zM 13 13c-0.3 0-1 0.2-1 1 0 0.3 0.2 1 1 1 0.3 0 1-0.2 1-1 0-0.3-0.2-1-1-1z" /> 16644</svg>` 16645 , uC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16646<path d="M2 15h6.2c.3-1 1.3-2 2.8-2 1.1 0 2.4 .7 2.8 2h6.2v2h-6.2c-.3 1-1.3 2-2.8 2 -1.1 0-2.4-.7-2.8-2h-6.2v-2zM11 15c-.3 0-1 .2-1 1 0 .3 .2 1 1 1 .3 0 1-.2 1-1 0-.3-.2-1-1-1z"/> 16647<path d="M2.3 5.7c-.4-.4-.4-1 0-1.4l3-3c.4-.4 1-.4 1.4 0 .4 .4 .4 1 0 1.4l-1.3 1.3h4.6v2h-4.6l1.3 1.3c.4 .4 .4 1 0 1.4 -.4 .4-1 .4-1.4 0l-3-3zM12 4h4.6l-1.3-1.3c-.4-.4-.4-1 0-1.4 .4-.4 1-.4 1.4 0l3 3c.4 .4 .4 1 0 1.4l-3 3c-.4 .4-1 .4-1.4 0 -.4-.4-.4-1 0-1.4l1.3-1.3h-4.6v-2z"/> 16648</svg>` 16649 , hC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16650<path d="M 3 4h 10.2c 0.4-1.2 1.5-2 2.8-2 1.7 0 3 1.3 3 3 0 1.7-1.3 3-3 3 -1.3 0-2.4-0.8-2.8-2h-10.2v-2zM 3 17c 0-1.7 1.3-3 3-3 1.3 0 2.4 0.8 2.8 2h 10.2v 2h-10.2c-0.4 1.2-1.5 2-2.8 2 -1.7 0-3-1.3-3-3zM 6 16c-0.6 0-1 0.4-1 1 0 0.6 0.4 1 1 1 0.6 0 1-0.4 1-1 0-0.6-0.4-1-1-1zM 9.8 13.9l-1.5-1.3 1.3-1.5 1.5 1.3 -1.3 1.5zM 12.4 10.9l-1.5-1.3 1.3-1.5 1.5 1.2 -1.3 1.6zM 16 4c-0.6 0-1 0.4-1 1 0 0.6 0.4 1 1 1 0.6 0 1-0.4 1-1 0-0.6-0.4-1-1-1z"/> 16651</svg>` 16652 , cC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16653<path d="M6 14h 11.6l-1.3-1.3c-0.4-0.4-0.4-1 0-1.4 0.4-0.4 1-0.4 1.4 0l 3 3c 0.4 0.4 0.4 1 0 1.4l-3 3c-0.4 0.4-1 0.4-1.4 0 -0.4-0.4-0.4-1 0-1.4l 1.3-1.3h-11.6v-2z"/> 16654<path d="M 17 6h-11.6l 1.3-1.3c 0.4-0.4 0.4-1 0-1.4 -0.4-0.4-1-0.4-1.4 0l-3 3c-0.4 0.4-0.4 1 0 1.4l 3 3c 0.4 0.4 1 0.4 1.4 0 0.4-0.4 0.4-1 0-1.4l-1.3-1.3h 11.6v-2z" 16655</svg>` 16656 , fC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16657<path d="M0 4h2v2h-2v-2zM4 4h2v2h-2v-2zM8 4h2v2h-2v-2zM12 4h2v2h-2v-2zM16 4h2v2h-2v-2zM20 4h2v2h-2v-2zM20 8h2v2h-2v-2zM20 12h2v2h-2v-2zM20 16h2v2h-2v-2zM16 16h2v2h-2v-2zM12 16h2v2h-2v-2zM8 16h2v2h-2v-2zM4 16h2v2h-2v-2zM0 16h2v2h-2v-2zM0 12h2v2h-2v-2zM0 8h2v2h-2v-2z"/> 16658</svg>` 16659 , pC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16660<path d="M2 5c0-1 0-2 1-3l1 2c0 0 0 0 0 1v2h-2v-2zM2 8h2v1c0 1 0 1 0 1l-2 1c0-1 0-1 0-2v-1zM4 12l1-1c0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0v2c0 0 0 0 0 0 0 0 0 0 0 0 -1 0-2 0-2-1zM4 14h2v2h-2v-2zM5 17h2v2h-2v-2zM5 1c0 0 0 0 1 0h1v2h-1c0 0-1 0-1 0v-2zM6 20h2v2h-2v-2zM7 14h3v2h-3v-2zM8 11c1 0 1 0 2 0v2c0 0-1 0-2 0v-2zM9 1h2v2h-2v-2zM12 13v-2c0 0 1 0 2 0v2c-1 0-1 0-2 0zM13 1h2v2h-2v-2zM16 13v-2c0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0l1 2c0 0-1 0-2 0 0 0 0 0 0 0 0 0 0 0 0 0zM17 3v-2c1 0 2 1 2 1l-1 2c-1-1-1-1-1-1zM18 10c0 0 0 0 0-1v-1h2v1c0 1 0 1 0 2l-2-1zM18 5h2c0 0 0 0 0 0v2h-2v-2c0 0 0 0 0 0z"/> 16661</svg>` 16662 , gC = ` 16663<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16664<path d="M1.9 12.1l1.8-0.8c0.7 1.6 2.5 4.1 4.4 5.5l-1.1 1.6c-2.3-1.6-4.3-4.4-5.1-6.3zM1.9 8.9c0.7-1.9 2.7-4.5 4.9-6.2l1.2 1.6c-1.9 1.5-3.7 3.8-4.3 5.4l-1.8-0.8z" opacity="0.3"/> 16665<path d="M0.5 10.5c0-1.1 0.9-2 2-2 1.1 0 2 0.9 2 2 0 1.1-0.9 2-2 2-1.1 0-2-0.9-2-2zM2.5 9.5c-0.6 0-1 0.4-1 1 0 0.6 0.4 1 1 1 0.6 0 1-0.4 1-1 0-0.6-0.4-1-1-1zM6.5 18.5c0-1.1 0.9-2 2-2 1.1 0 2 0.9 2 2 0 1.1-0.9 2-2 2-1.1 0-2-0.9-2-2zM6.5 2.5c0-1.1 0.9-2 2-2 1.1 0 2 0.9 2 2 0 1.1-0.9 2-2 2-1.1 0-2-0.9-2-2zM8.5 17.5c-0.6 0-1 0.4-1 1 0 0.6 0.4 1 1 1 0.6 0 1-0.4 1-1 0-0.6-0.4-1-1-1zM8.5 1.5c-0.6 0-1 0.4-1 1 0 0.6 0.4 1 1 1 0.6 0 1-0.4 1-1 0-0.6-0.4-1-1-1zM17.5 18.5c-6.3-4.1-6.3-11.9 0-16 0 0 0 0 0 0 0-1.1 0.9-2 2-2 1.1 0 2 0.9 2 2 0 1.1-0.9 2-2 2-0.4 0-0.7-0.1-1-0.3-4.9 3.3-4.9 9.3 0 12.6 0.3-0.2 0.6-0.3 1-0.3 1.1 0 2 0.9 2 2 0 1.1-0.9 2-2 2-1.1 0-2-0.9-2-2 0 0 0 0 0 0zM19.5 17.5c-0.6 0-1 0.4-1 1 0 0.6 0.4 1 1 1 0.6 0 1-0.4 1-1 0-0.6-0.4-1-1-1zM19.5 1.5c-0.6 0-1 0.4-1 1 0 0.6 0.4 1 1 1 0.6 0 1-0.4 1-1 0-0.6-0.4-1-1-1z"/> 16666</svg>` 16667 , mC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16668<path d="M4 2h9.66c0.73 0 1.4 0.19 2.01 0.56 0.61 0.38 1.1 0.91 1.46 1.59 0.35 0.68 0.53 1.43 0.53 2.27 0 2.22-0.81 3.61-2.42 4.19v0.1c1.84 0.53 2.76 2.03 2.76 4.5 0 0.94-0.19 1.78-0.56 2.5-0.37 0.72-0.88 1.29-1.53 1.69-0.64 0.4-1.35 0.6-2.13 0.6h-9.78v-18zM12.92 5.95h-4.92v3.06h4.92c0.31 0 0.57-0.13 0.77-0.4 0.21-0.27 0.31-0.61 0.31-1.01v-0.26c0-0.39-0.11-0.71-0.32-0.98-0.21-0.27-0.46-0.41-0.76-0.41zM13.26 12.92h-5.26v3.08h5.26c0.31 0 0.57-0.13 0.77-0.4 0.21-0.27 0.31-0.61 0.31-1.01v-0.26c0-0.4-0.1-0.74-0.31-1.01-0.2-0.27-0.46-0.4-0.77-0.4z"/> 16669</svg>` 16670 , yC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16671<path d="M4.22 20l0.56-2 3-0.3 3.73-13.4-2.84-0.3 0.55-2h8.56l-0.56 2-3 0.3-3.73 13.4 2.84 0.3-0.55 2h-8.56z"/> 16672</svg>` 16673 , vC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16674<path d="M3 19h16v2h-16v-2z"/> 16675<path d="M4 10.84l0.01-8.84h2.9l-0.03 8.34c0 1.49 0.17 2.63 0.5 3.44 0.34 0.81 0.82 1.37 1.46 1.68 0.64 0.32 1.42 0.48 2.33 0.48 0.83 0 1.53-0.16 2.12-0.48 0.59-0.32 1.05-0.88 1.36-1.69 0.32-0.81 0.48-1.95 0.48-3.43v-8.34h2.87v8.89c0 2.29-0.57 4.04-1.71 5.27-1.13 1.23-2.87 1.84-5.2 1.84-1.71 0-3.08-0.28-4.13-0.85-1.04-0.57-1.8-1.39-2.26-2.46-0.47-1.07-0.7-2.35-0.7-3.85z"/> 16676</svg>` 16677 , bC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16678<path d="M10.81 20c-0.94 0-1.8-0.13-2.6-0.38-0.79-0.25-1.52-0.62-2.17-1.12-0.66-0.5-1.24-1.13-1.76-1.9l1.47-2.2c0.81 1.15 1.61 1.97 2.41 2.45 0.8 0.48 1.72 0.72 2.75 0.72 0.64 0 1.25-0.1 1.81-0.31 0.57-0.21 1.03-0.51 1.38-0.9 0.36-0.39 0.54-0.86 0.54-1.41 0-0.37-0.09-0.68-0.27-0.95-0.17-0.27-0.4-0.5-0.69-0.69-0.28-0.19-0.61-0.35-0.98-0.49-0.37-0.13-0.75-0.24-1.14-0.33-0.39-0.09-0.77-0.17-1.15-0.24-0.85-0.17-1.61-0.39-2.28-0.66-0.67-0.28-1.24-0.63-1.7-1.05-0.47-0.43-0.82-0.93-1.06-1.5-0.24-0.58-0.36-1.24-0.36-1.99 0-0.77 0.15-1.46 0.44-2.09 0.3-0.62 0.71-1.16 1.24-1.6 0.53-0.44 1.15-0.78 1.86-1.01 0.71-0.23 1.48-0.35 2.32-0.35 0.88 0 1.68 0.12 2.41 0.35 0.72 0.23 1.37 0.58 1.94 1.04 0.57 0.46 1.05 1.02 1.42 1.68l-1.54 1.93c-0.34-0.55-0.73-1.02-1.17-1.4-0.45-0.38-0.94-0.68-1.46-0.88-0.52-0.2-1.08-0.3-1.66-0.3-0.67 0-1.26 0.1-1.77 0.3-0.51 0.2-0.91 0.48-1.21 0.84-0.3 0.36-0.45 0.79-0.45 1.29 0 0.4 0.09 0.75 0.26 1.06 0.17 0.31 0.42 0.57 0.74 0.79 0.32 0.22 0.72 0.4 1.19 0.55 0.48 0.15 1.02 0.28 1.64 0.4 0.8 0.15 1.56 0.35 2.27 0.59 0.7 0.24 1.32 0.54 1.85 0.91 0.53 0.37 0.94 0.82 1.23 1.35 0.29 0.53 0.44 1.18 0.44 1.95 0 1.12-0.25 2.09-0.76 2.92
16678-0.51 0.84-1.23 1.48-2.15 1.94-0.92 0.46-2.01 0.69-3.28 0.69z"/> 16679<path d="M2 11h18v2h-18v-2z"/> 16680</svg>` 16681 , MC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16682<path d="M2 4c0-.55 .45-1 1-1h16c.55 0 1 .45 1 1v14c0 .55-.45 1-1 1h-16c-.55 0-1-.45-1-1v-14zM18 5h-14v12h14v-12z"/> 16683</svg>` 16684 , SC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16685<path d="M2 9c0-3.9 3.1-7 7-7h11v2h-6.1c0.2 0.1 0.3 0.3 0.4 0.5l-1.5 1.3c-0.3-0.5-0.8-0.8-1.3-1.1l0.5-0.7h-3c-2.8 0-5 2.2-5 5v2.8l0.6-0.3c0.3 0.4 0.7 0.9 1.1 1.2l-1.3 1.5c-0.2-0.1-0.3-0.2-0.4-0.3v6.1h-2v-11zM6.3 15.5l0.8-1.9c0.4 0.2 0.9 0.3 1.4 0.4 0.1 0 0.1 0 0.2 0l-0.1 2c-0.1 0-0.2 0-0.3 0-0.7-0.1-1.4-0.3-2-0.5zM10.4 13.8c0.5-0.1 1-0.4 1.5-0.7l1.1 1.6c-0.6 0.5-1.3 0.8-2.1 1l-0.5-1.9zM13 11.9c0.4-0.4 0.6-0.9 0.8-1.4l1.9 0.5c-0.2 0.8-0.6 1.5-1 2.1l-1.7-1.2zM13.7 7.2l1.8-0.7c0.3 0.7 0.5 1.4 0.5 2.2l-2 0.1c0-0.6-0.1-1.1-0.3-1.6z"/> 16686</svg>` 16687 , wC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16688<path d="M1 11c0-4.97 4.48-9 10-9 5.52 0 10 4.03 10 9 0 4.97-4.48 9-10 9-5.52 0-10-4.03-10-9zM11 4c-4.42 0-8 3.14-8 7 0 3.86 3.58 7 8 7 4.42 0 8-3.14 8-7 0-3.86-3.58-7-8-7z"/> 16689</svg>` 16690 , PC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16691<path d="M2 11c0-2.13 0.85-4.58 2.64-6.36 1.38-1.39 3.67-2.64 6.36-2.64 2.13 0 4.58 0.85 6.36 2.64 1.39 1.38 2.64 3.67 2.64 6.36 0 2.13-0.85 4.58-2.64 6.36-1.38 1.39-3.67 2.64-6.36 2.64-2.13 0-4.58-0.85-6.36-2.64-1.39-1.38-2.64-3.67-2.64-6.36zM6.05 6.05c-1.11 1.11-2.05 2.66-2.05 4.95 0 1.73 0.54 3.44 2.05 4.95 1.11 1.11 2.66 2.05 4.95 2.05 1.73 0 3.44-0.54 4.95-2.05 1.11-1.11 2.05-2.66 2.05-4.95 0-1.73-0.54-3.44-2.05-4.95-1.11-1.11-2.66-2.05-4.95-2.05-1.73 0-3.44 0.54-4.95 2.05z"/> 16692</svg>` 16693 , xC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16694<path d="M1.1 8.8c-.2-.4 0-.9 .3-1.1l9-6.5c.4-.3 .8-.3 1.2 0l9 6.5c.3 .2 .5 .7 .3 1.1l-3.4 10.5c-.1 .4-.5 .7-.9 .7h-11.2c-.4 0-.8-.3-.9-.7l-3.5-10.5zM11 3.2l-7.8 5.7 3 9.1h9.6l3-9.1 -7.8-5.7z" /> 16695</svg>` 16696 , CC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16697<path d="M2 9c0-3.9 3.1-7 7-7h11v2h-6.1c0.2 0.1 0.3 0.3 0.4 0.5l-1.5 1.3c-0.3-0.5-0.8-0.8-1.3-1.1l0.5-0.7h-3c-2.8 0-5 2.2-5 5v2.8l0.6-0.3c0.3 0.4 0.7 0.9 1.1 1.2l-1.3 1.5c-0.2-0.1-0.3-0.2-0.4-0.3v6.1h-2v-11zM6.3 15.5l0.8-1.9c0.4 0.2 0.9 0.3 1.4 0.4 0.1 0 0.1 0 0.2 0l-0.1 2c-0.1 0-0.2 0-0.3 0-0.7-0.1-1.4-0.3-2-0.5zM10.4 13.8c0.5-0.1 1-0.4 1.5-0.7l1.1 1.6c-0.6 0.5-1.3 0.8-2.1 1l-0.5-1.9zM13 11.9c0.4-0.4 0.6-0.9 0.8-1.4l1.9 0.5c-0.2 0.8-0.6 1.5-1 2.1l-1.7-1.2zM13.7 7.2l1.8-0.7c0.3 0.7 0.5 1.4 0.5 2.2l-2 0.1c0-0.6-0.1-1.1-0.3-1.6z"/> 16698</svg>` 16699 , _C = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16700 <path d="M 0.8 9.8c-1.1-0.9-0.5-2.8 0.9-2.8h 6l1.8-5.7c 0.4-1.3 2.6-1.3 3 0l1.8 5.7h 6c 1.4 0 2 1.9 0.9 2.8l-4.8 3.5 1.8 5.7c 0.4 1.3-1 2.6-2.4 1.7l-4.8-3.5 -4.8 3.5c-1.4 0.9-2.8-0.4-2.4-1.7l 1.8-5.7 -4.8-3.5zM 2.5 8.8l 4.7 3.4c 0.3 0.2 0.5 0.7 0.4 1l-1.8 5.6 4.7-3.5c 0.3-0.2 0.7-0.2 1 0l 4.7 3.5 -1.8-5.6c-0.1-0.3 0.1-0.8 0.4-1l 4.7-3.4h-5.8c-0.4 0-0.8-0.3-0.9-0.6l-1.8-5.6 -1.8 5.6c-0.1 0.3-0.5 0.6-0.9 0.6h-5.8z" /> 16701</svg>` 16702 , TC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16703 <path d="M1 7.4l3.5-5.4 3.5 5.4h-2.4v8h2.4l-3.5 5.4-3.5-5.4h2.3v-8h-2.3zM9.3 21l4.7-15.8 1-3.2 1 3.2 4.7 15.8h-2l-3.7-12.1-3.7 12.1h-2z" /> 16704</svg>` 16705 , kC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16706 <path d="M1.3 14c0-.5 .5-1 1-1h3.2l4.5-9.4c.1-.1 .1-.2 .2-.3 0 0 0 0 0 0 0 0 0 0 .1 0 0-.1 .1-.2 .2-.2 .2-.1 .3-.1 .4-.1 .2 0 .3 0 .4 .1 .1 0 .2 .1 .3 .2 0 0 0 0 0 0 0 0 .1 0 .1 0 0 .1 .1 .2 .1 .3l4.6 9.4h3.3c.5 0 1 .5 1 1 0 .6-.5 1-1 1h-2.3l1.2 2.6c.2 .5 0 1.1-.5 1.3 -.5 .2-1.1 0-1.3-.5l-1.7-3.4h-8.3l-1.6 3.4c-.2 .5-.8 .7-1.3 .4 -.5-.2-.7-.8-.5-1.3l1.2-2.5h-2.3c-.5 0-1-.4-1-1zM7.8 13h6.4l-3.3-6.7 -3.1 6.7z" /> 16707</svg>` 16708 , EC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16709 <path d="M1.3 15.6v2h3.7c.5 0 .9-.2 1-.7l2.3-7.1c.4-1.2 1.5-2 2.7-2 1.2 0 2.3 .8 2.7 2l2.3 7.1c.1 .5 .5 .7 1 .7h3.7v-2h-3l-2.1-6.4c-.7-2-2.5-3.4-4.6-3.4 -2.1 0-3.9 1.4-4.6 3.4l-2.1 6.4h-3z" /> 16710</svg>` 16711 , DC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16712 <path d="M1.3 15.6v2c4 0 7.5-2.6 8.8-6.5l.9-2.8 .9 2.8c1.3 3.9 4.8 6.5 8.8 6.5v-2c-3.1 0-5.9-2.1-6.9-5.1l-1.8-5.8c-.2-.4-.6-.7-1-.7 -.4 0-.8 .3-1 .7l-1.8 5.8c-1 3-3.8 5.1-6.9 5.
167121z" /> 16713</svg>` 16714 , q2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16715<path d="M 2 4h 4.6l-1.3-1.3c-0.4-0.4-0.4-1 0-1.4 0.4-0.4 1-0.4 1.4 0l 3 3c 0.4 0.4 0.4 1 0 1.4l-3 3c-0.4 0.4-1 0.4-1.4 0 -0.4-0.4-0.4-1 0-1.4l 1.3-1.3h-4.6v-2zM 2 17c 0-2.2 1.8-4 4-4h 0.2c 0.3-1 1.3-2 2.8-2 0.7 0 1.4 0.2 2 0.7 0.5-0.4 1.1-0.7 2-0.7 1.1 0 2.4 0.7 2.8 2 0.1 0 0.1 0 0.2 0 2.2 0 4 1.8 4 4 0 2.2-1.8 4-4 4h-10c-2.2 0-4-1.8-4-4zM 6 15c-1.1 0-2 0.9-2 2 0 1.1 0.9 2 2 2h 10c 1.1 0 2-0.9 2-2 0-1.1-0.9-2-2-2h-0.2c-0.3 1-1.3 2-2.8 2 -0.7 0-1.4-0.2-2-0.7 -0.5 0.4-1.1 0.7-2 0.7 -1.1 0-2.4-0.7-2.8-2h-0.2zM 9 13c-0.3 0-1 0.2-1 1 0 0.3 0.2 1 1 1 0.3 0 1-0.2 1-1 0-0.3-0.2-1-1-1zM 12.3 5.7c-0.4-0.4-0.4-1 0-1.4l 3-3c 0.4-0.4 1-0.4 1.4 0 0.4 0.4 0.4 1 0 1.4l-1.3 1.3h 4.6v 2h-4.6l 1.3 1.3c 0.4 0.4 0.4 1 0 1.4 -0.4 0.4-1 0.4-1.4 0l-3-3zM 13 13c-0.3 0-1 0.2-1 1 0 0.3 0.2 1 1 1 0.3 0 1-0.2 1-1 0-0.3-0.2-1-1-1z" /> 16716</svg>` 16717 , OC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16718<path d="M5 1h12v2h-12zM5 19h12v2h-12z" /> 16719<path d="M7.3 8.7c-0.4-0.4-0.4-1 0-1.4l3-3c0.4-0.4 1-0.4 1.4 0l3 3c0.4 0.4 0.4 1 0 1.4-0.4 0.4-1 0.4-1.4 0l-1.3-1.3v7.2l1.3-1.3c0.4-0.4 1-0.4 1.4 0 0.4 0.4 0.4 1 0 1.4l-3 3c-0.4 0.4-1 0.4-1.4 0l-3-3c-0.4-0.4-0.4-1 0-1.4 0.4-0.4 1-0.4 1.4 0l1.3 1.3v-7.2l-1.3 1.3c-0.4 0.4-1 0.4-1.4 0z" /> 16720</svg>` 16721 , AC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16722<path d="M0.35 9.78c-.11-.83 .47-1.58 1.29-1.69 .83-.1 1.58 .48 1.69 1.3 0 .05 .01 .1 .02 .15 .27-1.04 .54-2.06 .8-2.72 .12-.31 .63-1.74 1.95-1.76 1.34-.01 1.9 1.41 2.09 1.86 .26 .63 .54 1.53 .82 2.49 .13-1.51 .26-2.98 .39-3.83 .06-.39 .21-2.24 1.72-2.32 .29-.02 1.24 .05 1.54 1.15 .03 .1 .12 .42 .25 .88 .79 2.79 1.49 4.86 2.05 6.3 .31-2.2 .73-4.9 1.47-6.01 .75-1.1 1.98-1.19 2.84-.5 .66 .53 1.31 1.63 2.21 5.37 .2 .8-.3 1.61-1.1 1.81-.81 .19-1.62-.3-1.82-1.11-.1-.45-.21-.85-.3-1.2-.3 1.77-.58 3.9-.8 4.9-.11 .5-.37 1.89-1.62 2.08-1.53 .23-2.41-1.45-2.79-2.21-.42-.82-.84-1.87-1.24-2.99-.11 1.08-.23 2.08-.37 2.79-.1 .56-.37 2.21-1.78 2.36-1.48 .15-2.03-1.58-2.12-1.81-.38-1-.88-2.9-1.34-4.54-.43 1.76-.95 3.78-1.61 4.58-.79 .97-2.06 .94-2.81 .07-.49-.57-.94-1.63-1.43-5.4z"/> 16723</svg>` 16724 , IC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16725<path d="M0.35 9.78c-.11-.83 .47-1.58 1.29-1.69 .83-.1 1.58 .48 1.69 1.3 0 .05 .01 .1 .02 .15 .27-1.04 .54-2.06 .8-2.72 .12-.31 .63-1.74 1.95-1.76 1.34-.01 1.9 1.41 2.09 1.86 .26 .63 .54 1.53 .82 2.49 .13-1.51 .26-2.98 .39-3.83 .06-.39 .21-2.24 1.72-2.32 .29-.02 1.24 .05 1.54 1.15 .03 .1 .12 .42 .25 .88 .76 2.67 1.43 4.68 1.98 6.11-.51 .36-.83 .94-.83 1.6v1.06h-1.06c-.09 0-.18 0-.26 .01-.32-.69-.63-1.5-.93-2.34-.11 1.08-.23 2.08-.37 2.79-.02 .11-.05 .27-.09 .45-.15 .25-.25 .53-.28 .84-.26 .52-.68 .99-1.41 1.07-1.48 .15-2.03-1.58-2.12-1.81-.38-1-.88-2.9-1.34-4.54-.43 1.76-.95 3.78-1.61 4.58-.79 .97-2.06 .94-2.81 .07-.49-.57-.94-1.63-1.43-5.4zM15 11.33c.3-2.15 .72-4.68 1.43-5.75 .75-1.1 1.98-1.19 2.84-.5 .66 .53 1.31 1.63 2.21 5.37 .2 .8-.3 1.61-1.1 1.81-.19 .05-.39 .05-.57 .02-.22-.55-.68-.97-1.25-1.14-.1-.45-.21-.84-.3-1.19-.06 .36-.12 .73-.18 1.11-.03 0-.05 0-.08 0h-2c-.37 0-.71 .1-1 .27z"/> 16726<path d="M13 16h3v-3h2v3h3v2h-3v3h-2v-3h-3v-2z"/> 16727</svg>` 16728 , LC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16729<path d="M2.29 13.84c-0.39-0.39-0.39-1.02 0-1.41l10-10.13c0.39-0.4 1.02-0.4 1.42-0.01l6 6c0.39 0.39 0.39 1.02 0 1.41l-8.86 9c-0.19 0.19-0.45 0.3-0.71 0.3h-2.28c-0.26 0-0.52-0.11-0.7-0.29l-4.87-4.87zM6.9 10.61l-2.49 2.52 3.87 3.87h1.44l1.77-1.8-4.59-4.59zM12.19 14.49l5.4-5.48-4.59-4.59-5.4 5.47 4.59 4.6z"/> 16730<path d="M3 18h6.24v1h-6.24v-1zM15 18h5v1h-5v-1z"/> 16731</svg>` 16732 , VC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16733<path d="M1 6c0-1.1 0.9-2 2-2 1.1 0 2 0.9 2 2 0 0.41-0.12 0.79-0.33 1.1l3.45 6.9c0 0 0.01 0 0.01 0l4.08-6.11c-0.14-0.27-0.21-0.57-0.21-0.89 0-1.1 0.9-2 2-2 1.1 0 2 0.9 2 2 0 0.3-0.06 0.58-0.18 0.83l2.99 4.18c0.06-0.01 0.12-0.01 0.19-0.01 1.1 0 2 0.9 2 2 0 1.1-0.9 2-2 2-1.1 0-2-0.9-2-2 0-0.3 0.06-0.58 0.18-0.83l-2.99-4.18c-0.06 0.01-0.12 0.01-0.19 0.01-0.04 0-0.09 0-0.13 0l-4.08 6.11c0.14 0.27 0.21 0.57 0.21 0.89 0 1.1-0.9 2-2 2-1.1 0-2-0.9-2-2 0-0.41 0.12-0.79 0.33-1.1l-3.45-6.9c-1.05-0.07-1.88-0.94-1.88-2zM3 5c-0.55 0-1 0.45-1 1 0 0.55 0.45 1 1 1 0.55 0 1-0.45 1-1 0-0.55-0.45-1-1-1zM8 15c-0.55 0-1 0.45-1 1 0 0.55 0.45 1 1 1 0.55 0 1-0.45 1-1 0-0.55-0.45-1-1-1zM14 6c-0.55 0-1 0.45-1 1 0 0.55 0.45 1 1 1 0.55 0 1-0.45 1-1 0-0.55-0.45-1-1-1zM19 13c-0.55 0-1 0.45-1 1 0 0.55 0.45 1 1 1 0.55 0 1-0.45 1-1 0-0.55-0.45-1-1-1z"/> 16734</svg>` 16735 , NC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16736<path d="M1.58 14.41c-0.64-0.64-0.9-1.93 0-2.83 0.55-0.55 1.59-0.82 2.44-0.31l1.54-1.54c-0.69-0.99-0.92-2.6 0.33-3.84 0.81-0.81 2.37-1.3 3.71-0.43 0.18-0.11 0.36-0.21 0.54-0.31l1.15-1.14c-0.39-0.69-0.43-1.69 0.3-2.43 0.64-0.64 1.93-0.9 2.83 0 0.64 0.64 0.9 1.93 0 2.83-0.02 0.01-0.03 0.03-0.05 0.04 0.83 0.19 1.7 0.59 2.43 1.28 2.54 2.41 2.51 6.65 0.89 10.23 0.41 0.69 0.47 1.71-0.28 2.46-0.64 0.64-1.93 0.9-2.83 0-0.64-0.64-0.9-1.93 0-2.83 0.33-0.33 0.83-0.56 1.36-0.58 0.83-1.79 0.98-3.32 0.88-4.56-0.15-1.77-0.78-2.69-1.4-3.27-0.9-0.86-1.67-0.9-2.4-0.86-0.75 0.05-1.46 0.28-2.19 0.69 0.35 0.96 0.28 2.15-0.7 3.12-0.84 0.84-2.5 1.34-3.87 0.32l-1.54 1.54c0.38 0.69 0.42 1.69-0.31 2.42-0.64 0.64-1.93 0.9-2.83 0zM1.99 12.99c0 0.15-0.02 0.39 0.3 0.71 0.12 0.12 0.28 0.3 0.7 0.3 0.15 0 0.39 0.02 0.71-0.3 0.12-0.12 0.3-0.28 0.3-0.71 0-0.14 0.02-0.38-0.3-0.7-0.12-0.13-0.28-0.3-0.71-0.3-0.14 0-0.38-0.02-0.7 0.3-0.13 0.12-0.3 0.28-0.3 0.7zM7.3 7.3c-0.19 0.19-0.55 0.87 0 1.42 0.19 0.19 0.87 0.55 1.42 0 0.19-0.19 0.55-0.87 0-1.42-0.19-0.19-0.87-0.55-1.42 0zM12 2.99c0 0.15-0.02 0.39 0.3 0.71 0.12 0.12 0.28 0.3 0.71 0.3 0.14 0 0.38 0.02 0.7-0.3 0.13-0.12 0.3-0.28 0.3-0.71 0-0.14 0.02-0.38-0.3-0.7-0.12-0.13-0.28-0.3-0.7-0.3-0.15 0-0.39-0.02-0.71 0.3-0.12 0.12-0.3 0.28-0.3 0.7zM14.99 17.01c0 0.14-0.02 0.38 0.3 0.7 0.12 0.13 0.28 0.3 0.7 0.3 0.15 0 0.39 0.02 0.71-0.3 0.12-0.12 0.3-0.28 0.3-0.7 0-0.15 0.02-0.39-0.3-0.71-0.12-0.12-0.28-0.3-0.71-0.3-0.14 0-0.38-0.02-0.7 0.3-0.13 0.12-0.3 0.28-0.3 0.71z"/> 16737</svg>` 16738 , RC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16739<path d="M2.21 13.11c-1.01-2.68 0.75-6.48 2.92-9.39-0.08-0.23-0.13-0.47-0.13-0.72 0-1.1 0.9-2 2-2 1.1 0 2 0.9 2 2 0 1.1-0.9 2-2 2-0.11 0-0.21-0.01-0.31-0.02-1.99 2.65-2.98 5.33-2.68 7.02 0.89 0.01 1.65 0.6 1.9 1.41 1.03-0.21 2.48-0.96 4.22-1.85 1.62-0.84 4.45-2.45 6.67-2.16 0.34-0.25 0.75-0.4 1.2-0.4 1.1 0 2 0.9 2 2 0 0.39-0.11 0.75-0.3 1.05 0.26 0.74 0.38 1.6 0.24 2.53-0.17 1.14-0.79 2.57-2.01 3.88 0.04 0.18 0.07 0.35 0.07 0.54 0 1.1-0.9 2-2 2-1.1 0-2-0.9-2-2 0-1.1 0.9-2 2-2 0.18 0 0.36 0.02 0.53 0.07 0.98-1.03 1.31-2.01 1.43-2.78 0.08-0.53 0.06-0.95-0.01-1.29-0.97-0.02-1.78-0.76-1.93-1.7-2.53 0.14-7.29 4.03-10.61 4.12-0.36 0.36-0.86 0.58-1.41 0.58-1.1 0-2-0.9-2-2 0-0.32 0.07-0.62 0.21-0.89zM4 13c-0.55 0-1 0.45-1 1 0 0.55 0.45 1 1 1 0.55 0 1-0.45 1-1 0-0.55-0.45-1-1-1zM7 2c-0.55 0-1 0.45-1 1 0 0.55 0.45 1 1 1 0.55 0 1-0.45 1-1 0-0.55-0.45-1-1-1zM16 18c-0.55 0-1 0.45-1 1 0 0.55 0.45 1 1 1 0.55 0 1-0.45 1-1 0-0.55-0.45-1-1-1zM18 10c-0.55 0-1 0.45-1 1 0 0.55 0.45 1 1 1 0.55 0 1-0.45 1-1 0-0.55-0.45-1-1-1z"/> 16740</svg>` 16741 , FC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor">
16742<path d="M13.07 19.75c-2.68 1.01-6.48-0.75-9.39-2.92-0.23 0.08-0.47 0.13-0.72 0.13-1.1 0-2-0.9-2-2 0-1.1 0.9-2 2-2 1.1 0 2 0.9 2 2 0 0.11-0.01 0.21-0.02 0.31 2.65 1.99 5.33 2.98 7.02 2.68 0.01-0.89 0.6-1.65 1.41-1.9-0.21-1.03-0.96-2.48-1.85-4.22-0.84-1.62-2.45-4.45-2.16-6.67-0.25-0.34-0.4-0.75-0.4-1.2 0-1.1 0.9-2 2-2 0.39 0 0.75 0.11 1.05 0.3 0.74-0.26 1.6-0.38 2.53-0.24 1.14 0.17 2.57 0.79 3.88 2.01 0.18-0.04 0.35-0.07 0.54-0.07 1.1 0 2 0.9 2 2 0 1.1-0.9 2-2 2-1.1 0-2-0.9-2-2 0-0.18 0.02-0.36 0.07-0.53-1.03-0.98-2.01-1.31-2.78-1.43-0.53-0.08-0.95-0.06-1.29 0.01-0.02 0.97-0.76 1.78-1.7 1.93 0.14 2.53 4.03 7.29 4.12 10.61 0.36 0.36 0.58 0.86 0.58 1.41 0 1.1-0.9 2-2 2-0.32 0-0.62-0.07-0.89-0.21zM12.96 17.96c0 0.55 0.45 1 1 1 0.55 0 1-0.45 1-1 0-0.55-0.45-1-1-1-0.55 0-1 0.45-1 1zM1.96 14.96c0 0.55 0.45 1 1 1 0.55 0 1-0.45 1-1 0-0.55-0.45-1-1-1-0.55 0-1 0.45-1 1zM17.96 5.96c0 0.55 0.45 1 1 1 0.55 0 1-0.45 1-1 0-0.55-0.45-1-1-1-0.55 0-1 0.45-1 1zM9.96 3.96c0 0.55 0.45 1 1 1 0.55 0 1-0.45 1-1 0-0.55-0.45-1-1-1-0.55 0-1 0.45-1 1z"/> 16743</svg>` 16744 , BC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16745<path d="M2 11c0-4.97 4.03-9 9-9 4.97 0 9 4.03 9 9 0 4.97-4.03 9-9 9-4.97 0-9-4.03-9-9zM11 4c-3.87 0-7 3.13-7 7 0 3.87 3.13 7 7 7 3.87 0 7-3.13 7-7 0-3.87-3.13-7-7-7z"/> 16746<path d="M7 10h3v-3h2v3h3v2h-3v3h-2v-3h-3v-2z"/> 16747</svg>` 16748 , zC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16749<path d="M1.95 18.42c-0.39-0.39-0.39-1.02 0-1.41l2.01-2 1.25-2.59c0.05-0.1 0.12-0.2 0.19-0.27l3.77-3.77c-0.32-0.79-0.31-1.81 0.56-2.68 0.18-0.18 1.2-0.94 2.35-0.69 1.28-2.47 4.43-5.97 7.98-2.42 3.43 3.43-0.1 6.56-2.58 7.84 0.19 0.72 0.08 1.58-0.68 2.34-0.19 0.19-1.41 1.1-2.69 0.57l-3.76 3.76c-0.07 0.07-0.17 0.14-0.27 0.19l-2.59 1.25-2 2.01c-0.39 0.39-1.02 0.39-1.41 0l-2.13-2.13zM5.49 16.3l-1.41 1.42 0.7 0.7 1.42-1.41c0.08-0.08 0.17-0.14 0.27-0.19l2.59-1.26 4.21-4.21-2.12-2.12-4.21 4.21-1.26 2.59c-0.05 0.1-0.11 0.19-0.19 0.27zM14.68 11.35c0 0 0 0 0 0 0.09 0.09 0.1 0.18 0.35 0.18 0.14-0.01 0.17 0.02 0.36-0.18 0.08-0.07 0.17-0.11 0.17-0.36 0.01-0.17 0.04-0.14-0.17-0.34-0.25-0.25-0.35-0.6-0.27-0.94 0.08-0.34 0.33-0.61 0.66-0.72 1.99-0.66 5.11-2.74 2.86-4.99-2.39-2.39-4.47 0.73-5.13 2.72-0.11 0.33-0.38 0.58-0.72 0.66-0.34 0.08-0.69-0.02-0.94-0.27-0.08-0.09-0.09-0.18-0.34-0.17-0.15 0-0.17-0.02-0.36 0.17-0.08 0.08-0.17 0.11-0.18 0.36 0 0.18-0.03 0.14 0.18 0.35l3.53 3.53z"/> 16750</svg>` 16751 , UC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16752 <path d="M10 11.1c0-0.1 0-0.1 0-0.1v-5c0-0.6 0.4-1 1-1 0.6 0 1 0.4 1 1v4.5l2.6 1.7c0.4 0.3 0.5 0.9 0.2 1.4-0.3 0.4-0.9 0.5-1.4 0.2l-2.9-2c-0.1 0-0.1 0-0.1 0-0.1-0.1-0.2-0.2-0.3-0.3 0-0.1-0.1-0.3-0.1-0.4z"/> 16753 <path d="M2.1 12.3c-0.1-0.8-0.1-1.5-0.1-2.2 0.6 0.3 1.4 0.4 2 0.2 0 0.5 0 1.1 0.1 1.7 0.5 3.8 4.1 6.5 7.9 5.9 3.8-0.5 6.5-4.1 5.9-7.9-0.5-3.8-4.1-6.5-7.9-5.9-1.2 0.1-2.3 0.6-3.1 1.3l0.8 0.7c0.1 0.1 0.1 0.3 0.1 0.5 0 0.2-0.2 0.3-0.3 0.4l-4.1 1.4c-0.2 0-0.4 0-0.5-0.1-0.1-0.2-0.2-0.4-0.1-0.5l1.1-4.2c0.1-0.2 0.2-0.3 0.4-0.3 0.1-0.1 0.3 0 0.5 0.1l0.6 0.6c1.2-1 2.7-1.7 4.3-1.9 4.9-0.7 9.5 2.7 10.2 7.6 0.7 4.9-2.7 9.5-7.6 10.2-4.9 0.7-9.5-2.7-10.2-7.6z"/> 16754</svg>` 16755 , GC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16756 <path d="M0 2h22v2h-22zM0 7h22v4h-22zM0 14h22v6h-22z"/> 16757</svg>` 16758 , HC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16759 <path d="M9 11.5c0-.82 .39-1.54 1-2v-6.5c0-.55 .45-1 1-1h10v3h-8v4.5c.48 .36 .83 .89 .95 1.5h7.05v1h-7.05c-.12 .61-.47 1.14-.95 1.5v4.5h8v3h-10c-.55 0-1-.45-1-1v-6.5c-.61-.46-1-1.18-1-2zM11.5 10c-.83 0-1.5 .67-1.5 1.5 0 .83 .67 1.5 1.5 1.5 .83 0 1.5-.67 1.5-1.5 0-.83-.67-1.5-1.5-1.5z"/> 16760</svg>` 16761 , $C = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16762 <path d="M1 3c0-.55 .45-1 1-1h19v3h-17v13h17v3h-19c-.55 0-1-.45-1-1v-17zM9 11.5c0-1.38 1.12-2.5 2.5-2.5 1.21 0 2.22 .86 2.45 2h7.05v1h-7.05c-.23 1.14-1.24 2-2.45 2 -1.38 0-2.5-1.12-2.5-2.5zM11.5 10c-.83 0-1.5 .67-1.5 1.5 0 .83 .67 1.5 1.5 1.5 .83 0 1.5-.67 1.5-1.5 0-.83-.67-1.5-1.5-1.5z" /> 16763</svg>` 16764 , XC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16765 <path d="M1 11.5c0-5.25 4.25-9.5 9.5-9.5h10.5v3h-10.5c-3.59 0-6.5 2.91-6.5 6.5 0 3.59 2.91 6.5 6.5 6.5h10.5v3h-10.5c-5.25 0-9.5-4.25-9.5-9.5zM9 11.5c0-1.38 1.12-2.5 2.5-2.5 1.21 0 2.22 .86 2.45 2h7.05v1h-7.05c-.23 1.14-1.24 2-2.45 2 -1.38 0-2.5-1.12-2.5-2.5zM11.5 10c-.83 0-1.5 .67-1.5 1.5 0 .83 .67 1.5 1.5 1.5 .83 0 1.5-.67 1.5-1.5 0-.83-.67-1.5-1.5-1.5z"/> 16766</svg>` 16767 , YC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16768 <path d="M1 2.5c0-.83 .67-1.5 1.5-1.5h18.5v3h-17v17h-3v-18.5zM7 9.5c0-1.38 1.12-2.5 2.5-2.5 1.21 0 2.22 .86 2.45 2h9.05v1h-9.05c-.2 .98-.97 1.75-1.95 1.95v9.05h-1v-9.05c-1.14-.23-2-1.24-2-2.45zM9.5 8c-.83 0-1.5 .67-1.5 1.5 0 .83 .67 1.5 1.5 1.5 .83 0 1.5-.67 1.5-1.5 0-.83-.67-1.5-1.5-1.5zM15 15h6v3h-3v3h-3v-6z"/> 16769</svg>` 16770 , KC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16771 <path d="M1 9.5c0-.4 .16-.78 .44-1.06l7-7c.28-.28 .66-.44 1.06-.44h11.5v3h-10.88l-6.12 6.12v10.88h-3v-11.5zM7 9.5c0-1.38 1.12-2.5 2.5-2.5 1.21 0 2.22 .86 2.45 2h9.05v1h-9.05c-.2 .98-.97 1.75-1.95 1.95v9.05h-1v-9.05c-1.14-.23-2-1.24-2-2.45zM9.5 8c-.83 0-1.5 .67-1.5 1.5 0 .83 .67 1.5 1.5 1.5 .83 0 1.5-.67 1.5-1.5 0-.83-.67-1.5-1.5-1.5zM15 15h6v3h-3v3h-3v-6z"/> 16772</svg>` 16773 , WC = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16774 <path d="M1 9.5c0-4.69 3.81-8.5 8.5-8.5h11.5v3h-11.5c-3.04 0-5.5 2.46-5.5 5.5v11.5h-3v-11.5zM7 9.5c0-1.38 1.12-2.5 2.5-2.5 1.21 0 2.22 .86 2.45 2h9.05v1h-9.05c-.2 .98-.97 1.75-1.95 1.95v9.05h-1v-9.05c-1.14-.23-2-1.24-2-2.45zM9.5 8c-.83 0-1.5 .67-1.5 1.5 0 .83 .67 1.5 1.5 1.5 .83 0 1.5-.67 1.5-1.5 0-.83-.67-1.5-1.5-1.5zM15 15h6v3h-3v3h-3v-6z"/> 16775</svg>` 16776 , ff = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16777<path d="M6 10h4v-4h3v4h4v3h-4v4h-3v-4h-4z"/> 16778</svg>` 16779 , j2 = `<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"> 16780<path d="M5 10h10v3h-10z"/> 16781</svg>` 16782 , qC = `<svg viewBox="0 0 32 32" width="16" height="16"> 16783 <g style="clip-path: path('M9 25c0-9 7-16 16-16 9 0 16 7 16 16 0 9-7 16-16 16-9 0-16-7-16-16zM25 15c-6 0-10 4-10 10 0 6 4 10 10 10 6 0 10-4 10-10 0-6-4-10-10-10z');"> 16784 <g style="filter: blur(4px);"> 16785 <path d="M-2-9l18 25 16-25z" fill="#f00" /> 16786 <path d="M34 41l-18-25-19 25z" fill="#0ff" /> 16787 <path d="M2-9h-11v27l25-2z" fill="#ff0" /> 16788 <path d="M41 14l-25 2 14 25h11z" fill="#00f" /> 16789 <path d="M-9 16v25h11l14-25z" fill="#0f0" /> 16790 <path d="M30-9l-14 25h25v-25z" fill="#f0f" /> 16791 </g> 16792 </g> 16793 </svg>` 16794 , jC = `<svg viewBox="0 0 32 32" width="32" height="32" fill="currentColor"> 16795<path d="M8 3c0-0.4 0.24-0.76 0.61-0.92 0.36-0.16 0.79-0.08 1.08 0.2l16.55 15.75c0.26 0.25 0.37 0.62 0.28 0.97-0.09 0.35-0.36 0.63-0.71 0.72l-5.72 1.54 2.7 6.29c0.22 0.51-0.02 1.1-0.52 1.31l-3.68 1.58c-0.51 0.22-1.1-0.02-1.31-0.52l-2.7-6.3-5.06 3.08c-0.3 0.19-0.69 0.2-1.01 0.02-0.31-0.18-0.51-0.51-0.51-0.87v-22.85zM23.57 18.25l-13.57-12.92v18.74l4.52-2.75c0.25-0.16 0.55-0.19 0.83-0.1 0.27 0.09 0.5 0.29 0.61 0.56l2.76 6.43 1.84-0.79-2.76-6.43c-0.11-0.27-0.11-0.57 0.02-0.83 0.13
16795-0.26 0.36-0.46 0.64-0.53l5.11-1.38z"/> 16796</svg>` 16797 , JC = `<svg viewBox="0 0 32 32" width="32" height="32" fill="currentColor"> 16798<path d="M6.43 7.94c-0.75-1.65-0.33-4.25 1.97-5.3 1.65-0.76 4.25-0.34 5.31 1.97 0.42 0.93 0.48 2.16 0.02 3.25l-1.54-1.3c-0.03-0.03-0.07-0.05-0.1-0.08 0.03-0.25 0.01-0.59-0.2-1.04-0.14-0.31-0.32-0.74-1.12-1.04-0.27-0.1-0.71-0.32-1.53 0.06-0.32 0.14-0.74 0.31-1.04 1.12-0.1 0.27-0.32 0.7 0.05 1.53 0.11 0.24 0.24 0.55 0.66 0.81 0 0.06-0.01 0.12-0.01 0.17v1.99c-1-0.29-1.93-0.97-2.47-2.14z"/> 16799<path d="M10.49 29.92c-0.37-0.16-0.6-0.52-0.6-0.92l0.01-20.91c0-0.39 0.23-0.74 0.58-0.9 0.35-0.17 0.77-0.11 1.07 0.14l16.09 13.52c0.31 0.26 0.43 0.68 0.32 1.06-0.12 0.38-0.45 0.66-0.85 0.7l-9.1 0.99-6.43 6.12c-0.29 0.28-0.72 0.36-1.09 0.2zM11.9 10.24l-0.01 16.43 4.99-4.76c0.16-0.15 0.36-0.24 0.58-0.27l7.1-0.76-12.66-10.64z"/> 16800</svg>` 16801 , ZC = `<svg viewBox="0 0 32 32" width="32" height="32" fill="currentColor"> 16802<path d="M5.1 10v-6h21.9l0.1 6h-1.5l-1.1-4h-7.4l-0.1 19.7 4 1v1.3h-10v-1.3l4-1 0.1-19.7h-7.5l-1 4h-1.5z"/> 16803</svg>` 16804 , QC = `<svg viewBox="0 0 32 32" width="32" height="32" fill="currentColor"> 16805<path d="M17.39 24.44c0.37-0.64 0.65-1.31 0.84-2h10.04l-5.99-10.43-3.94 6.88c-0.19-0.87-0.51-1.67-0.94-2.39l4.02-7c0.18-0.31 0.51-0.5 0.86-0.5 0.36 0 0.69 0.19 0.87 0.5l7.72 13.44c0.17 0.31 0.17 0.69 0 1-0.18 0.31-0.51 0.5-0.87 0.5h-12.61z"/> 16806<path d="M3 20.5c0-1.72 0.68-3.79 2.2-5.3 1.11-1.11 3.02-2.2 5.3-2.2 1.72 0 3.79 0.68 5.3 2.2 1.11 1.11 2.2 3.02 2.2 5.3 0 1.72-0.68 3.79-2.2 5.3-1.11 1.11-3.02 2.2-5.3 2.2-1.72 0-3.79-0.68-5.3-2.2-1.11-1.11-2.2-3.02-2.2-5.3zM6.61 16.61c-0.84 0.84-1.61 2.02-1.61 3.89 0 1.31 0.37 2.65 1.61 3.89 0.84 0.84 2.02 1.61 3.89 1.61 1.31 0 2.65-0.37 3.89-1.61 0.84-0.84 1.61-2.02 1.61-3.89 0-1.31-0.37-2.65-1.61-3.89-0.84-0.84-2.02-1.61-3.89-1.61-1.31 0-2.65 0.37-3.89 1.61z"/> 16807<path d="M7 12.78c-0.8 0.37-1.48 0.82-2 1.25v-9.03c0-0.55 0.45-1 1-1h13c0.55 0 1 0.45 1 1v4.96l-2 3.49v-7.45h-11v6.78z"/> 16808</svg>` 16809 , e_ = `<svg viewBox="0 0 32 32" width="32" height="32" fill="currentColor"> 16810<path d="M16 11c0-1.3 0.98-3.01 3-3.01 1.3 0 3 0.99 3 3.01 0 1.3-0.98 3-3 3-1.3 0-3-0.98-3-3zM19 10c-0.27 0-1 0.22-1 1 0 0.27 0.22 1 1 1 0.27 0 1-0.22 1-1 0-0.27-0.22-1-1-1z"/> 16811<path d="M2 6c0-0.55 0.45-1 1-1h26c0.55 0 1 0.45 1 1v20c0 0.55-0.45 1-1 1h-26c-0.55 0-1-0.45-1-1v-20zM4 16.97l5.39-4.14c0.36-0.27 0.86-0.27 1.22 0l6.4 4.91 3.39-2.54c0.36-0.27 0.84-0.27 1.2 0l6.4 4.8v-13h-24v9.97zM4 19.49v5.51h24v-2.5l-7-5.25-7.4 5.55-1.2-1.6 2.95-2.21-5.35-4.1-6 4.6z"/> 16812</svg>` 16813 , t_ = `<svg viewBox="0 0 32 32" width="32" height="32" fill="currentColor"> 16814<path d="M3.29 28.7c-0.28-0.28-0.37-0.7-0.22-1.07l3.61-9.12c0.05-0.12 0.13-0.24 0.22-0.34l14.85-14.84c0.92-0.92 2.82-1.43 4.24 0l2.83 2.82c0.92 0.92 1.43 2.82 0 4.25l-14.85 14.85c-0.1 0.1-0.22 0.17-0.35 0.23l-9.27 3.46c-0.37 0.14-0.79 0.04-1.06-0.24zM6.78 23.7l1.59 1.6 4.12-1.54-4.11-4.11-1.6 4.05zM13.27 23.12l11.31-11.31-4.24-4.24-11.32 11.31 4.25 4.24zM25.29 11.1l2.12-2.12c0.19-0.19 0.55-0.86 0-1.41l-2.83-2.83c-0.19-0.19-0.86-0.55-1.41 0l-2.13 2.12 4.25 4.24z"/> 16815</svg>` 16816 , l_ = `<svg viewBox="0 0 32 32" width="32" height="32" fill="currentColor"> 16817<path d="M2.05 19.55c-1.41-1.41-.75-2.47-.39-2.89 1.01-1.18 3.39-2.09 5.77-4.47l3.53-3.53c.31-.31 .77-.38 1.16-.19l5 2.5c2.6-2.74 3.63-5.03 5.16-6.55 1.77-1.77 5.01-3.14 7.79-2 .24 .1 .44 .29 .54 .53 1.07 2.49-.21 6.07-1.96 7.82-1.59 1.65-3.83 2.58-6.57 5.17l2.51 5c.19 .38 .11 .85-.19 1.15l-3.54 3.54c-2.78 2.79-6.16 6.56-8.78 3.93l-10.03-10.01zM8.84 13.61c-2.38 2.38-4.98 3.69-5.6 4.27 .04 .06 .11 .15 .23 .26l1.57 1.56c1.08-.35 2.29-.85 3.36-1.49-.81 1.04-1.7 1.87-2.47 2.38l2.26 2.26c.51-.16 1.1-.31 1.93-.83-.47 .61-.85 1.09-1.29 1.48l.93 .92c.84-.25 2.16-1.01 3.86-1.89-1.32 1.59-1.91 2.21-2.6 3.16l1.04 1.03c.45-.14 .56-.13 1.27-.58-.33 .57-.32 .8-.71 1.15l.87 .86c.68 .68 1.64 .38 5.96-3.94l.71-.7-10.61-10.61-.71 .71zM11.87 10.58l-1.61 1.61 10.6 10.61 1.61-1.61-2.5-5.01c-.19-.39-.12-.85 .19-1.16 3.08-3.08 5.6-4.14 7.05-5.64l.02-.01c1.18-1.19 2.07-3.62 1.67-5.24-1.84-.49-4.02 .52-5.21 1.7-1.4 1.4-2.57 3.99-5.66 7.07-.3 .31-.76 .38-1.15 .19l-5.01-2.51z" fill-rule="nonzero"/> 16818</svg>` 16819 , n_ = `<svg viewBox="0 0 32 32" width="32" height="32" fill="currentColor"> 16820<path d="M22.6 21.85c-0.16 0.25-0.42 0.42-0.71 0.46-4.48 0.64-9.53 2.32-11.5 3.48-0.03 0.78-0.34 1.57-1.02 2.25-1.1 1.1-3.34 1.61-4.95 0-1.1-1.1-1.61-3.34 0-4.95 0.55-0.54 1.37-0.94 2.25-1.01 1.21-2.04 2.79-7.22 3.48-11.52 0.05-0.29 0.22-0.54 0.46-0.69l11.31-7.07c0.4-0.25 0.91-0.19 1.24 0.14l6.37 6.36c0.32 0.33 0.38 0.85 0.14 1.24l-7.07 11.31zM10.24 23.62c2.72-1.33 7.32-2.65 10.9-3.22l6.41-10.25-5.24-5.23-10.26 6.41c-0.66 3.87-1.97 8.31-3.24 10.93l-1.81 1.81c-0.42-0.03-0.84 0.12-1.16 0.44-0.46 0.46-0.56 1.15-0.3 1.7l10.04-10.03c-0.27-0.56-0.17-1.24 0.29-1.71 0.59-0.58 1.53-0.58 2.12 0 0.59 0.59 0.59 1.54 0 2.13-0.46 0.46-1.15 0.56-1.71 0.29l-10.03 10.03c0.56 0.27 1.25 0.17 1.71-0.29 0.32-0.32 0.46-0.75 0.43-1.16l1.85-1.85z"/> 16821</svg>` 16822 , s_ = { 16823 group: K2, 16824 ungroup: W2, 16825 combinePaths: Qx, 16826 separatePaths: eC, 16827 undo: k2, 16828 redo: E2, 16829 copy: b2, 16830 cut: Ix, 16831 paste: M2, 16832 selectAll: S2, 16833 selectNone: w2, 16834 newDocument: Ex, 16835 openFile: Dx, 16836 saveFileAs: Ox, 16837 print: Lx, 16838 docProperties: Ax, 16839 settings: P2, 16840 userInterface: x2, 16841 privacy: Vx, 16842 darkMode: zx, 16843 arrange: G2, 16844 toFront: H2, 16845 toBack: $2,
16846 oneToFront: X2, 16847 oneToBack: Y2, 16848 deleteSelection: Zr, 16849 duplicate: ec, 16850 duplicateModel: ec, 16851 alignLeft: D2, 16852 alignRight: O2, 16853 alignCenterHor: A2, 16854 alignTop: I2, 16855 alignBottom: L2, 16856 alignCenterVer: V2, 16857 alignHorLeftBound: N2, 16858 alignHorCenterBound: R2, 16859 alignHorRightBound: F2, 16860 alignVerTopBound: B2, 16861 alignVerCenterBound: z2, 16862 alignVerBottomBound: U2 16863}; 16864function o_(l) { 16865 return s_[l] ?? "" 16866} 16867const i_ = { 16868 name: "SvgIcon", 16869 props: { 16870 svg: String, 16871 attrs: Object 16872 }, 16873 methods: { 16874 update(l) { 16875 let e = this.$refs.svg 16876 , t = this.attrs; 16877 t && Object.keys(t).forEach(s=>{ 16878 let o = t[s]; 16879 o === null ? e.removeAttribute(o) : e.setAttribute(s, o) 16880 } 16881 ); 16882 let n = document.createRange().createContextualFragment(l); 16883 if (n.childElementCount > 0 && n.children[0].tagName === "svg") { 16884 let s = n.children[0]; 16885 e.replaceChildren(...s.children), 16886 Array.from(s.attributes).forEach(i=>{ 16887 let r = i.nodeName; 16888 (!this.attrs || this.attrs[r] === void 0) && !e.hasAttribute(r) && e.setAttribute(r, i.nodeValue) 16889 } 16890 ) 16891 } 16892 } 16893 }, 16894 mounted() { 16895 this.update(this.svg) 16896 }, 16897 watch: { 16898 svg(l) { 16899 this.update(l) 16900 } 16901 } 16902} 16903 , r_ = { 16904 class: "svg-icon", 16905 ref: "svg" 16906}; 16907function a_(l, e, t, n, s, o) { 16908 return N(), 16909 $("svg", r_, null, 512) 16910} 16911const gt = ie(i_, [["render", a_]]) 16912 , Cp = 20; 16913let _p, Tp; 16914function kp(l, e) { 16915 let t = e ? Tp : _p; 16916 if (t == null) { 16917 let n = Math.min(l.width, l.height); 16918 t = l.getContext("2d").createImageData(n, n); 16919 let o = t.data 16920 , i = []; 16921 for (let a = 0; a <= 100; a++) 16922 i.push(Lm(a * 3.6, 100, 50)); 16923 let r = 0; 16924 for (let a = 0; a < n; a++) 16925 for (let d = 0; d < n; d++) { 16926 let u = Math.atan2(d - n / 2, a - n / 2) / (2 * Math.PI) + .5; 16927 if (e && Math.abs((u + 1 / 24 + .005) % (1 / 12)) < .01) 16928 o[r++] = 0, 16929 o[r++] = 0, 16930 o[r++] = 0, 16931 o[r++] = 0; 16932 else { 16933 e && (u = Math.round(12 * u) / 12); 16934 let h = (i.length - 1) * u 16935 , c = i[Math.floor(h)] 16936 , f = i[Math.ceil(h)] 16937 , p = h % 1 16938 , g = 1 - p; 16939 o[r++] = Math.round(c[0] * g + f[0] * p), 16940 o[r++] = Math.round(c[1] * g + f[1] * p), 16941 o[r++] = Math.round(c[2] * g + f[2] * p), 16942 o[r++] = 255 16943 } 16944 } 16945 e ? Tp = t : _p = t 16946 } 16947 l.getContext("2d").putImageData(t, 0, 0) 16948} 16949const d_ = { 16950 name: "HueRing", 16951 props: { 16952 modelValue: { 16953 type: Number, 16954 default: 0 16955 } 16956 }, 16957 data() { 16958 return { 16959 segmented: !1, 16960 mounted: !1 16961 } 16962 }, 16963 emits: ["update:modelValue", "input"], 16964 created() { 16965 this.isDragging = !1, 16966 this.reverse = !1 16967 }, 16968 methods: { 16969 onPointerdown(l) { 16970 if (!this.$refs.contentContainer.contains(l.target) && l.buttons === 1 && !this.isDragging) { 16971 let e = this.$refs.hueRing.getBoundingClientRect() 16972 , t = l.clientX - e.x 16973 , n = l.clientY - e.y 16974 , s = e.height; 16975 Math.hypot(s / 2 - t, s / 2 - n) < s / 2 + 4 && (this.isDragging = !0, 16976 document.addEventListener("pointermove", this.onDocPointermove, !0), 16977 document.addEventListener("pointerup", this.endDrag), 16978 document.addEventListener("pointercancel", this.endDrag), 16979 this.isDragging = !0, 16980 this.updateFromPointerEvent(l)) 16981 } 16982 }, 16983 endDrag() { 16984 this.removeDocumentEventListeners(), 16985 this.isDragging = !1 16986 }, 16987 updateFromPointerEvent(l) { 16988 if (this.isDragging) { 16989 let t = this.$refs.gradientCanvas.getBoundingClientRect() 16990 , n = l.clientX - t.left - t.width / 2 16991 , s = l.clientY - t.top - t.height / 2 16992 , i = (Math.atan2(s, -n) - Math.PI / 2) / (2 * Math.PI) + .5; 16993 i < 0 && (i += 1), 16994 l.altKey ? (this.segmented = !0, 16995 i = Math.round(i * 12) / 12, 16996 i === 1 && (i = 0)) : this.segmented = !1, 16997 this.$emit("input", i), 16998 this.$emit("update:modelValue", i) 16999 } 17000 }, 17001 removeDocumentEventListeners() { 17002 document.removeEventListener("pointermove", this.onDocPointermove, !0), 17003 document.removeEventListener("pointerup", this.endDrag), 17004 document.removeEventListener("pointercancel", this.endDrag) 17005 }, 17006 onDocPointermove(l) { 17007 l.buttons === 1 || l.type === "touchmove" ? (this.updateFromPointerEvent(l), 17008 l.preventDefault()) : this.isDragging && this.endDrag(
17008) 17009 }, 17010 onKeyEvent(l) { 17011 l.key === "Alt" && (l.type === "keydown" ? this.segmented = !0 : l.type === "keyup" && (this.segmented = !1), 17012 l.preventDefault()) 17013 }, 17014 onFocusout() { 17015 this.segmented = !1 17016 } 17017 }, 17018 computed: { 17019 indicatorTransform() { 17020 if (this.mounted) { 17021 let l; 17022 this.$refs.gradientCanvas != null ? l = this.$refs.gradientCanvas.offsetWidth / 2 : l = 0; 17023 let e = 2 * Math.PI * this.modelValue 17024 , t = l - Math.cos(e) * (l - Cp / 2); 17025 return "translate(" + (l - Math.sin(e) * (l - Cp / 2)) + "px, " + t + "px) rotate(-" + e + "rad)" 17026 } else 17027 return "" 17028 }, 17029 hueColorCss() { 17030 let l = hr(this.modelValue, 1, 1); 17031 return Rm(l) 17032 } 17033 }, 17034 mounted() { 17035 kp(this.$refs.gradientCanvas, !1), 17036 kp(this.$refs.segmentsCanvas, !0), 17037 this.mounted = !0 17038 }, 17039 unmounted() { 17040 this.removeDocumentEventListeners() 17041 } 17042} 17043 , u_ = { 17044 ref: "hueRing", 17045 class: "hue-ring" 17046} 17047 , h_ = { 17048 ref: "segmentsCanvas", 17049 class: "hue-segments-canvas", 17050 width: "220", 17051 height: "220" 17052} 17053 , c_ = { 17054 class: "inner-circle" 17055} 17056 , f_ = { 17057 ref: "contentContainer", 17058 class: "content-container" 17059}; 17060function p_(l, e, t, n, s, o) { 17061 return N(), 17062 $("div", u_, [_("div", { 17063 class: "outer-circle", 17064 onPointermove: e[0] || (e[0] = (...i)=>o.updateFromPointerEvent && o.updateFromPointerEvent(...i)), 17065 onPointerdown: e[1] || (e[1] = (...i)=>o.onPointerdown && o.onPointerdown(...i)), 17066 onPointerup: e[2] || (e[2] = (...i)=>o.endDrag && o.endDrag(...i)), 17067 onKeydown: e[3] || (e[3] = Ah((...i)=>o.onKeyEvent && o.onKeyEvent(...i), ["alt"])), 17068 onKeyup: e[4] || (e[4] = (...i)=>o.onKeyEvent && o.onKeyEvent(...i)), 17069 onFocusout: e[5] || (e[5] = (...i)=>o.onFocusout && o.onFocusout(...i)), 17070 tabIndex: "0" 17071 }, [_("canvas", h_, null, 512), _("canvas", { 17072 ref: "gradientCanvas", 17073 class: "hue-gradient-canvas", 17074 style: xe({ 17075 opacity: s.segmented ? 0 : 1 17076 }), 17077 width: "220", 17078 height: "220" 17079 }, null, 4), e[6] || (e[6] = _("div", { 17080 class: "outer-circle-shadow" 17081 }, null, -1)), _("div", c_, [_("div", f_, [vt(l.$slots, "default", {}, void 0, !0)], 512)])], 32), _("div", { 17082 ref: "h-indicator", 17083 class: "h-indicator", 17084 style: xe({ 17085 transform: o.indicatorTransform, 17086 background: o.hueColorCss 17087 }) 17088 }, null, 4)], 512) 17089} 17090const g_ = ie(d_, [["render", p_], ["__scopeId", "data-v-45800461"]]); 17091class Ho { 17092 toolOptions = {}; 17093 toolbarOptionsComponent; 17094 optionsComponent; 17095 isSuspended = !1; 17096 constructor(e) { 17097 Gs(this, Ho), 17098 this.name = e, 17099 me(this), 17100 cw(e, this) 17101 } 17102 getName() { 17103 return this.name 17104 } 17105 getZoom() { 17106 return V().zoom 17107 } 17108 getDocumentModel() { 17109 return V().activeDocument 17110 } 17111 getModelForElement(e) { 17112 return e == null ? null : this.getDocumentModel()?.getSelectableModel(e) 17113 } 17114 getToolbarOptionsComponent() { 17115 return this.optionsComponent == null && this.toolbarOptionsComponent != null && (this.optionsComponent = Fd({ 17116 extends: this.toolbarOptionsComponent, 17117 data: ()=>({ 17118 tool: ns(this), 17119 toolOptions: this.toolOptions 17120 }) 17121 })), 17122 this.optionsComponent 17123 } 17124 setActive(e, t) { 17125 As() 17126 } 17127 setSuspended(e) { 17128 this.isSuspended = !0 17129 } 17130 handleKeyDownEvent(e) {} 17131 handleKeyUpEvent(e) {} 17132 handleKeyPressEvent(e) {} 17133 handleMouseWheelEvent(e) {} 17134 handlePointerDownEvent(e, t, n) {} 17135 handlePointerDownOutsideEvent(e) {} 17136 handlePointerUpEvent(e, t, n) {} 17137 handlePointerMoveEvent(e, t, n) {} 17138 handlePointerClickEvent(e, t, n, s) {} 17139 handlePointerRightClickEvent(e, t, n) {} 17140 handlePointerenterEvent(e) {} 17141 handlePointerleaveEvent(e) {} 17142 startPointerDrag(e, t, n, s, o) {} 17143 cancelPointerDrag() { 17144 return !1 17145 } 17146 onSelectionGeometryChanged() {} 17147 onFocusLost(e, t) { 17148 this.handlePointerUpEvent(new Event("focusLost"), e, t, !0) 17149 } 17150 onViewportFocus() {} 17151 onModelSelectionChanged(e, t) {} 17152 onNodePointsSelectionChanged(e, t, n, s) {} 17153 onNodePointsMoved(e, t) {} 17154 onNodePointsChanged(e, t, n, s) {} 17155 onTextSelectionChanged(e, t, n) {} 17156 getContextActions(e, t) {} 17157 setCursor(e, t, n) { 17158 V().setEditorCursor(t, n, e) 17159 } 17160} 17161const J2 = new Map; 17162function m_(l) { 17163 return J2.get(l) 17164} 17165function y_(l, e) { 17166 J2.set(l, e) 17167} 17168const tc = "Alt" 17169 , cs = "ArrowDown" 17170 , Io = "ArrowLeft" 17171 , Lo = "ArrowRight" 17172 , hn = "ArrowUp" 17173 , su = "Backspace" 17174 , Fs = "Control" 17175 , ou = "Delete" 17176 , Qr = "Enter" 17177 , $s = "Escape" 17178 , Vn = "Shift" 17179 , Ep = " " 17180 , Rl = 11 17181 , Il = 10 17182 , ho = Il * Rl 17183 , co = Math.floor(Rl / 2) 17184 , Jo = 2; 17185class v_ extends Ho { 17186 svg = null; 17187 svgImage = null; 17188 svgCanvas = null; 17189 svgCanvasContext = null; 17190 viewport = null; 17191 xPrev = 0; 17192 yPrev = 0; 17193 isPositioned = !1; 17194 color = new ce; 17195 colorFormat = "hex"; 17196 documentKeydownListener; 17197 constructor() { 17198 super("eyedropper"), 17199 this.precisionZoomCanvas = ki(ho - 1, ho - 1), 17200 this.precisionDiv = this.createPrecisionDiv(), 17201 this.mainDiv = this.createMainDiv(), 17202 this.mainDiv.prepend(this.precisionDiv) 17203 } 17204 getColorString() { 17205 return this.colorFormat === "rgba" ? this.color.toRgbaFunction() : this.colorFormat === "rgb" ? this.color.toRgbFunction() : this.color.toHex() 17206 } 17207 createMainDiv() { 17208 let e = Vl("div", null, { 17209 display: "flex", 17210 flexDirection: "column", 17211 alignItems: "center", 17212 position: "absolute", 17213 top: "0", 17214 left: "0", 17215 minWidth: "0", 17216 width: "0", 17217 pointerEvents: "none" 17218 }); 17219 return this.colorDiv = this.createColorDiv(), 17220 e.appendChild(this.colorDiv), 17221 e 17222 } 17223 createColorDiv() { 17224 let e = Vl("div", {}, { 17225 display: "flex", 17226 alignItems: "center", 17227 flex: "1 0 auto", 17228 padding: "3px 6px", 17229 borderRadius: "3px", 17230 boxShadow: "0 1px 8px 0 rgb(0 0 0/.1), 0 2px 3px 0 rgb(0 0 0/.07), 0 3px 2px -2px rgb(0 0 0/.06)", 17231 background: "rgb(255 255 255 / 0.7)", 17232 marginTop: "8px" 17233 }); 17234 return e.appendChild(Vl("div", {}, { 17235 borderRadius: "50%", 17236 border: "1px solid #ddd", 17237 width: "16px", 17238 height: "16px", 17239 transition: "background 200ms" 17240 })), 17241 e.appendChild(Vl("div", {}, { 17242 fontFamily: '"Roboto Mono", monospace', 17243 fontSize: "14px", 17244 fontWeight: "500", 17245 color: "rgb(0 0 0 / 0.6)", 17246 marginLeft: "4px" 17247 })), 17248 e 17249 } 17250 createPrecisionDiv() { 17251 let e = Jo + co 17252 , t = Jo + ho / 2 17253 , n = Vl("div", null, { 17254 border: "1px solid #ddd", 17255 borderRadius: "50%", 17256 position: "absolute", 17257 top: "0", 17258 left: "0" 17259 }); 17260 n.appendChild(Vl("div", null, { 17261 width: Rl + "px", 17262 height: Rl + "px", 17263 border: Jo - 1 + "px solid #fff", 17264 borderRadius: "50%", 17265 boxSizing: "content-box" 17266 }));
17267 let s = Vl("canvas", { 17268 width: t, 17269 height: t 17270 }, { 17271 position: "absolute", 17272 top: "0", 17273 left: "0" 17274 }) 17275 , o = s.getContext("2d"); 17276 o.fillStyle = "#e0e0e0", 17277 o.globalAlpha = .4, 17278 o.beginPath(), 17279 o.arc(e, e, e, Math.PI, -Math.PI / 2, !0), 17280 o.lineTo(t, 0), 17281 o.arc(t, t, t, -Math.PI / 2, Math.PI, !0), 17282 o.fill(); 17283 let i = Vl("div", null, { 17284 width: ho - 1 + "px", 17285 height: ho - 1 + "px", 17286 background: "#fff", 17287 border: Jo + "px solid #fff", 17288 borderRadius: "50%", 17289 overflow: "hidden", 17290 isolation: "isolate", 17291 boxShadow: "0 1px 8px 0 rgb(0 0 0/.1), 0 2px 3px 0 rgb(0 0 0/.07), 0 3px 2px -2px rgb(0 0 0/.06)", 17292 boxSizing: "content-box" 17293 }); 17294 i.appendChild(this.precisionZoomCanvas); 17295 let r = Vl("div", null, { 17296 position: "relative", 17297 minWidth: 2 * Jo + ho + "px" 17298 }); 17299 return r.appendChild(s), 17300 r.appendChild(n), 17301 r.appendChild(i), 17302 r 17303 } 17304 updateZoomCanvas(e, t) { 17305 let n = this.svgCanvasContext 17306 , s = this.precisionZoomCanvas 17307 , o = s.getContext("2d"); 17308 o.fillStyle = "#ddd", 17309 o.fillRect(0, 0, s.width, s.height); 17310 let i = n.getImageData(e - co, t - co, Rl, Rl).data 17311 , r = 4 * co * Rl + 4 * co 17312 , a = i.slice(r, r + 3) 17313 , d = i[r + 3] / 255; 17314 this.color = new ce(a,d); 17315 for (let h = 0; h < Rl; h++) 17316 for (let c = 0; c < Rl; c++) { 17317 let f = 4 * c * Rl + 4 * h 17318 , p = i[f + 3]; 17319 if (p < 255) { 17320 o.fillStyle = "#fff"; 17321 let g = h * Il 17322 , y = c * Il 17323 , m = Il / 2; 17324 o.fillRect(g, y, m, m), 17325 o.fillRect(g + m, y + m, m, m) 17326 } 17327 p > 0 && (o.fillStyle = "rgb(" + i[f] + " " + i[f + 1] + " " + i[f + 2] + ")", 17328 o.globalAlpha = i[f + 3] / 255, 17329 o.fillRect(h * Il, c * Il, Il - 1, Il - 1), 17330 o.globalAlpha = 1) 17331 } 17332 let u = .299 * a[0] + .587 * a[1] + .114 * a[2] > 180; 17333 o.strokeStyle = u ? "#888" : "#fff", 17334 o.beginPath(), 17335 o.rect(co * Il - 1, co * Il - 1, Il + 1, Il + 1), 17336 o.stroke() 17337 } 17338 updateColorDiv() { 17339 let e = this.getColorString() 17340 , t = .299 * this.color.r + .587 * this.color.g + .114 * this.color.b > 180 17341 , n = this.colorDiv; 17342 n.children[1].innerHTML = e, 17343 n.children[0].style.background = e, 17344 t ? n.style.color = "rgb(0 0 0 / 0.8)" : n.style.color = "#fff" 17345 } 17346 handlePointerDownEvent(e, t, n) { 17347 this.isPositioned && (this.callback(this.color, e), 17348 e.preventDefault(), 17349 this.isPositioned = !1) 17350 } 17351 handlePointerClickEvent(e, t, n) { 17352 e.preventDefault() 17353 } 17354 handlePointerMoveEvent(e, t, n) { 17355 this.svg.parentElement.contains(e.target2) ? (this.isPositioned = !0, 17356 this.mainDiv.style.setProperty("visibility", "visible"), 17357 this.xPrev = e.clientX, 17358 this.yPrev = e.clientY, 17359 this.updateEyedropperPosition(this.xPrev, this.yPrev)) : this.mainDiv.style.setProperty("visibility", "hidden") 17360 } 17361 updateEyedropperPosition(e, t) { 17362 let n, s; 17363 if (this.svgCanvas != null) { 17364 let o = this.viewport.getBoundingClientRect(); 17365 this.updateZoomCanvas(Math.round(e - o.x), Math.round(t - o.y)); 17366 let i = this.svg.parentElement.getBoundingClientRect(); 17367 n = Math.round(e - i.x + (ho - Rl) / 2), 17368 s = Math.round(t - i.y - (Jo + Rl / 2)) 17369 } 17370 this.mainDiv.style.transform = "translate(" + n + "px, " + s + "px)", 17371 this.updateColorDiv() 17372 } 17373 handlePointerUpEvent(e, t, n) { 17374 this.isPositioned && (this.callback(this.color, e), 17375 e.preventDefault(), 17376 this.isPositioned = !1) 17377 } 17378 onDocumentKeydown(e) { 17379 if (e.ctrlKey && e.key === "c") { 17380 kr(this.getColorString()); 17381 return 17382 } 17383 let t = !0; 17384 switch (e.key) { 17385 case hn: 17386 this.yPrev -= 1; 17387 break; 17388 case cs: 17389 this.yPrev += 1; 17390 break; 17391 case Io: 17392 this.xPrev -= 1; 17393 break; 17394 case Lo: 17395 this.xPrev += 1; 17396 break; 17397 default: 17398 t = !1 17399 } 17400 t && (e.preventDefault(), 17401 window.requestAnimationFrame(()=>{ 17402 this.updateEyedropperPosition(this.xPrev, this.yPrev) 17403 } 17404 )) 17405 } 17406 handleChange() { 17407 this.updateSvgCanvas(), 17408 this.updateEyedropperPosition(this.xPrev, this.yPrev) 17409 } 17410 setActive(e) { 17411 e ? (this.viewport = m_("svgViewport"), 17412 this.svg = this.getDocumentModel().baseElement, 17413 this.createSvgCanvas(), 17414 this.svg.parentElement.appendChild(this.mainDiv), 17415 this.svg.parentElement.style.setProperty("cursor", "none"), 17416 this.handleChange = this.handleChange.bind(this), 17417 this.svgObserver = new ResizeObserver(this.handleChange), 17418 this.svgObserver.observe(this.svg.parentElement), 17419 this.svgObserver.observe(this.viewport), 17420 this.viewport.addEventListener("scroll", this.handleChange), 17421 this.mainDiv.style.setProperty("visibility", "hidden"), 17422 this.isPositioned = !1, 17423 this.documentKeydownListener = t=>this.onDocumentKeydown(t), 17424 document.addEventListener("keydown", this.documentKeydownListener)) : (this.mainDiv.remove(), 17425 this.svgObserver.disconnect(), 17426 this.viewport.removeEventListener("scroll", this.handleChange), 17427 this.svg.parentElement.style.removeProperty("cursor"), 17428 this.svg = null, 17429 this.svgImage = null, 17430 this.svgCanvas = null, 17431 document.removeEventListener("keydown", this.documentKeydownListener), 17432 this.documentKeydownListener = null) 17433 } 17434 createSvgCanvas() { 17435 let e = this.svg 17436 , t = new XMLSerializer().serializeToString(e) 17437 , n = e.width.baseVal.value 17438 , s = e.height.baseVal.value; 17439 t = '<svg xmlns="http://www.w3.org/2000/svg" width="' + n + '" height="' + s + '" viewBox="' + -2 * n + " " + -2 * s + " " + 5 * n + " " + 5 * s + '">' + t + "</svg>", 17440 this.svgToCanvas(t) 17441 } 17442 svgToCanvas(e) { 17443 let t = "data:image/svg+xml;utf8," + encodeURIComponent(e); 17444 this.svgImage = new Image, 17445 this.svgImage.src = t, 17446 this.svgImage.decode().then(()=>{ 17447 this.updateSvgCanvas() 17448 } 17449 ) 17450 } 17451 updateSvgCanvas() { 17452 let e = this.svgCanvas; 17453 e == null && (e = Vl("canvas"), 17454 this.svgCanvas = e); 17455 let t = this.viewport; 17456 (e.width !== t.clientWidth || e.height !== t.clientHeight) && (e.width = t.clientWidth, 17457 e.height = t.clientHeight); 17458 let n = this.svg.getBoundingClientRect() 17459 , s = t.getBoundingClientRect() 17460 , o = e.getContext("2d", { 17461 willReadFrequently: !0 17462 }); 17463 o.clearRect(0, 0, e.width, e.height); 17464 let i = this.svgImage; 17465 o.drawImage(i, 2 / 5 * i.width, 2 / 5 * i.height, i.width / 5, i.height / 5, n.x - s.x, n.y - s.y, n.width, n.height), 17466 this.svgCanvasContext = o 17467 } 17468 setColorSelectCallback(e) { 17469 this.callback = e 17470 } 17471} 17472const hi = new v_ 17473 , b_ = { 17474 name: "HyCheckbox", 17475 props: { 17476 label: String, 17477 modelValue: { 17478 type: Boolean, 17479 default: !1 17480 }, 17481 disabled: Boolean, 17482 name: String, 17483 type: String 17484 }, 17485 data() { 17486 return { 17487 focus: !1, 17488 focusVisible: !1 17489 } 17490 },
17491 emits: ["update:modelValue", "focus", "blur"], 17492 watch: { 17493 focus(l) { 17494 this.focusVisible = l && this.$refs.input.matches(":focus-visible") 17495 } 17496 }, 17497 methods: { 17498 onFocus(l) { 17499 this.focus = !0, 17500 this.$emit("focus", l) 17501 }, 17502 onBlur(l) { 17503 this.focus = !1, 17504 this.$emit("blur", l) 17505 }, 17506 onChange(l) { 17507 let e = l.target.checked; 17508 this.$emit("update:modelValue", e, l) 17509 } 17510 } 17511} 17512 , M_ = ["disabled", "checked", "name"] 17513 , S_ = { 17514 class: "hy-checkbox-label" 17515}; 17516function w_(l, e, t, n, s, o) { 17517 return N(), 17518 $("label", { 17519 class: Ne(["hy-element", { 17520 "hy-checkbox": t.type !== "button", 17521 "hy-checkbox-button": t.type === "button", 17522 "hy-disabled": t.disabled, 17523 "hy-selected": t.modelValue, 17524 "hy-focus-visible": s.focusVisible 17525 }]), 17526 role: "checkbox" 17527 }, [_("input", { 17528 ref: "input", 17529 class: "hy-checkbox-input", 17530 type: "checkbox", 17531 disabled: t.disabled, 17532 checked: t.modelValue, 17533 name: t.name, 17534 onChange: e[0] || (e[0] = (...i)=>o.onChange && o.onChange(...i)), 17535 onFocus: e[1] || (e[1] = (...i)=>o.onFocus && o.onFocus(...i)), 17536 onBlur: e[2] || (e[2] = (...i)=>o.onBlur && o.onBlur(...i)) 17537 }, null, 40, M_), _("span", S_, [vt(l.$slots, "default"), l.$slots.default ? be("", !0) : (N(), 17538 $(Pe, { 17539 key: 0 17540 }, [ve(se(t.label), 1)], 64))])], 2) 17541} 17542const ml = ie(b_, [["render", w_]]) 17543 , P_ = { 17544 name: "OpacitySlider", 17545 props: { 17546 modelValue: { 17547 type: ce, 17548 default: 0 17549 }, 17550 min: { 17551 default: 0, 17552 type: Number 17553 }, 17554 max: { 17555 default: 100, 17556 type: Number 17557 }, 17558 precision: { 17559 default: 0, 17560 type: Number 17561 } 17562 }, 17563 data: ()=>({}), 17564 computed: { 17565 percentValue: function() { 17566 let l = this.modelValue == null ? 1 : this.modelValue.a; 17567 return Math.min(100, Math.max(0, 100 * l)) 17568 }, 17569 overlayGradient() { 17570 let l = this.modelValue || new ce(0,0,0) 17571 , e = l.r + ", " + l.g + ", " + l.b; 17572 return "linear-gradient(rgba(" + e + ",1), rgba(" + e + ",0))" 17573 }, 17574 colorHex() { 17575 return this.modelValue == null ? "#000" : this.modelValue.toHex() 17576 } 17577 }, 17578 emits: ["update:opacity", "change"], 17579 created: function() { 17580 this.isDragging = !1, 17581 this.reverse = !1 17582 }, 17583 unmounted() { 17584 this.endDrag() 17585 }, 17586 methods: { 17587 startDrag: function(l) { 17588 l.buttons === 1 && !this.isDragging && (this.isDragging = !0, 17589 l.target.focus(), 17590 document.addEventListener("pointermove", this.onDocumentPointermove), 17591 document.addEventListener("pointerup", this.endDrag), 17592 this.isDragging = !0, 17593 this.updateFromPointerEvent(l)) 17594 }, 17595 endDrag() { 17596 document.removeEventListener("pointermove", this.onDocumentPointermove), 17597 document.removeEventListener("pointerup", this.endDrag), 17598 this.isDragging = !1 17599 }, 17600 updateFromPointerEvent(l) { 17601 if (this.isDragging) { 17602 let e = this.$refs.track 17603 , t = e.getBoundingClientRect() 17604 , n = l.clientY - t.top 17605 , s = this.min 17606 , o = this.max 17607 , i = Math.min(o, Math.max(s, (o - s) * (1 - n / e.offsetHeight))) 17608 , r = this.precision 17609 , a = Math.pow(10, r); 17610 i = Math.round(i * a) / a, 17611 i = this.reverse ? o - i : i, 17612 i !== this.percentValue && this.emitValueChange(i) 17613 } 17614 }, 17615 onDocumentPointermove(l) { 17616 l.buttons === 1 || l.type === "touchmove" ? (l.stopPropagation(), 17617 l.preventDefault(), 17618 this.updateFromPointerEvent(l)) : this.isDragging && this.endDrag(
17618) 17619 }, 17620 onKeydown(l) { 17621 let e = l.key; 17622 if (e === "ArrowUp" || e === "+") { 17623 let t = this.percentValue 17624 , n = Math.max(this.min, Math.min(this.max, t + 1)); 17625 n = this.reverse ? this.max - n : n, 17626 n !== t && this.emitValueChange(n) 17627 } else if (e === "ArrowDown" || e === "-") { 17628 let t = this.percentValue 17629 , n = Math.max(this.min, Math.min(this.max, t - 1)); 17630 n = this.reverse ? this.max - n : n, 17631 n !== t && this.emitValueChange(n) 17632 } 17633 }, 17634 emitValueChange(l) { 17635 this.$emit("update:opacity", l) 17636 } 17637 } 17638} 17639 , x_ = { 17640 ref: "track", 17641 class: "track" 17642} 17643 , C_ = { 17644 class: "track-background" 17645}; 17646function __(l, e, t, n, s, o) { 17647 return N(), 17648 $("div", { 17649 ref: "slider", 17650 class: "slider", 17651 tabindex: "0", 17652 onPointerdown: e[0] || (e[0] = (...i)=>o.startDrag && o.startDrag(...i)), 17653 onPointerup: e[1] || (e[1] = (...i)=>o.endDrag && o.endDrag(...i)), 17654 onKeydown: e[2] || (e[2] = (...i)=>o.onKeydown && o.onKeydown(...i)) 17655 }, [_("div", x_, [_("div", C_, [_("div", { 17656 class: "track-overlay", 17657 style: xe({ 17658 background: o.overlayGradient 17659 }) 17660 }, null, 4)]), _("div", { 17661 class: "indicator", 17662 style: xe({ 17663 top: 100 - o.percentValue + "%", 17664 background: o.colorHex 17665 }) 17666 }, null, 4)], 512)], 544) 17667} 17668const T_ = ie(P_, [["render", __], ["__scopeId", "data-v-e73895bb"]]) 17669 , pf = new WeakMap 17670 , ci = new WeakMap; 17671let $u; 17672function k_(l) { 17673 $u?.disconnect(); 17674 let e = lc(l); 17675 return e.setAttribute("id", "svgCopy"), 17676 e.style.setProperty("--tolerance", 500 / V().zoom + "px"), 17677 e.style.opacity = "0", 17678 $u = new MutationObserver((t,n)=>{ 17679 let s = null; 17680 for (const o of t) 17681 if (o.type === "childList") { 17682 for (let i of o.removedNodes) 17683 Z2(i); 17684 for (let i of o.addedNodes) 17685 lc(i, o.nextSibling) 17686 } else if (o.type === "attributes") { 17687 s == null && (s = new Map); 17688 let i = o.target 17689 , r = o.attributeName; 17690 s.has(i) ? s.get(i).push(r) : s.set(i, [r]) 17691 } 17692 s?.forEach((o,i)=>E_(i, o)) 17693 } 17694 ), 17695 $u.observe(l, { 17696 attributes: !0, 17697 childList: !0, 17698 subtree: !0 17699 }), 17700 e 17701} 17702function lc(l, e) { 17703 let t = l.cloneNode(); 17704 ci.set(l, t), 17705 pf.set(t, l), 17706 l instanceof Element && (t.removeAttribute("id"), 17707 t.removeAttribute("stroke-width"), 17708 Q2(l, t)); 17709 let n = l.parentElement 17710 , s = n && ci.get(n); 17711 s?.insertBefore(t, ci.get(e)); 17712 for (let o of l.childNodes) 17713 lc(o); 17714 return t 17715} 17716function Z2(l) { 17717 let e = ci.get(l); 17718 if (e.remove(), 17719 ci.delete(l), 17720 pf.delete(e), 17721 l.children) 17722 for (let t of l.children) 17723 Z2(t) 17724} 17725function E_(l, e) { 17726 let t = ci.get(l); 17727 if (t == null) 17728 return; 17729 let n = !1; 17730 for (let s of e) { 17731 let o = l.getAttribute(s); 17732 o == null ? t.removeAttribute(s) : t.setAttribute(s, o), 17733 !n && (s === "style" || s === "stroke" || s === "fill" || s === "stroke-width" || s === "stroke-linejoin" || s === "stroke-linecap") && (n = !0) 17734 } 17735 n && Q2(l, t) 17736} 17737function Q2(l, e) { 17738 let t = window.getComputedStyle(l); 17739 if (t.getPropertyValue("stroke") !== "none") { 17740 e.style.setProperty("stroke-linejoin", t.getPropertyValue("stroke-linejoin")), 17741 e.style.setProperty("stroke-linecap", t.getPropertyValue("stroke-linecap")), 17742 e.style.setProperty("stroke-dasharray", t.getPropertyValue("stroke-dasharray")); 17743 let o = t.getPropertyValue("stroke-width"); 17744 e.style.setProperty("stroke-width", "calc(" + o + " + 2 * var(--tolerance))") 17745 } else 17746 t.getPropertyValue("fill") !== "none" ? (e.style.setProperty("stroke", "#000"), 17747 e.style.setProperty("stroke-linejoin", "round"), 17748 e.style.setProperty("stroke-linecap", "round"), 17749 e.style.setProperty("stroke-dasharray", "none"), 17750 e.style.setProperty("stroke-width", "calc(2 * var(--tolerance))")) : e.style.setProperty("stroke", "none") 17751} 17752function D_(l) { 17753 let e = document.elementsFromPoint(l.clientX, l.clientY)[1]; 17754 return pf.get(e) ?? l.target 17755} 17756const ma = 0 17757 , O_ = 1 17758 , A_ = 2; 17759let ya = null, va = null, Qi = 0, er = 0, Pn = null, Xu, Yu = !1, ln = !1, ba = null, Ma = null, Ht = "none", Sa = 0, mn = null, Ra, Kt; 17760function I_(l) { 17761 Ra = l; 17762 let e = Ra.viewport; 17763 Kt != null && console.error("EventManager initialized"),
17764 Kt = e, 17765 window.addEventListener("blur", function() { 17766 let t = V() 17767 , n = t.subTool || t.tool; 17768 if (n != null) { 17769 let s = xi([Qi, er]); 17770 n.onFocusLost(s[0], s[1]) 17771 } 17772 ln && (ln = !1, 17773 Pn = null) 17774 }), 17775 Kt.addEventListener("keydown", Ms, {}), 17776 Kt.addEventListener("keyup", Ms, {}), 17777 Kt.addEventListener("keypress", Ms, {}), 17778 document.addEventListener("pointerdown", Ms, {}), 17779 document.addEventListener("pointerup", Ms, {}), 17780 Kt.addEventListener("pointerenter", Ms, {}), 17781 Kt.addEventListener("pointerleave", Ms, {}), 17782 document.addEventListener("contextmenu", t=>{ 17783 t.ctrlKey || t.preventDefault() 17784 } 17785 , {}), 17786 Dp(document, "pointermove", Ms, {}), 17787 Kt.addEventListener("touchstart", async function(t) { 17788 let n = t.touches 17789 , s = n.length; 17790 if (s === 0) 17791 Ht = "none"; 17792 else if (s === 1) 17793 Ht = "normal"; 17794 else if (Ht === "none" || Ht === "normal") { 17795 ba = Kt.scrollLeft, 17796 Ma = Kt.scrollTop, 17797 Ht = "pan", 17798 Pn = null; 17799 let o = V() 17800 , i = o.subTool || o.tool; 17801 i != null && await i.cancelPointerDrag() 17802 } 17803 Sa = Zo(n), 17804 mn = n, 17805 t.preventDefault() 17806 }), 17807 document.addEventListener("touchend", function(t) { 17808 let n = t.touches; 17809 mn = n, 17810 Sa = Zo(n), 17811 n.length === 0 ? (ln = !1, 17812 Ht = "none") : n.length === 1 && (Ht = "normal") 17813 }), 17814 document.addEventListener("touchcancel", function(t) { 17815 let n = t.touches; 17816 mn = n, 17817 Sa = Zo(n), 17818 n.length === 0 ? (ln = !1, 17819 Ht = "none") : n.length === 1 && (Ht = "normal") 17820 }), 17821 Dp(document, "touchmove", function(t) { 17822 let n = V() 17823 , s = t.touches; 17824 if (Ht === "pan" && Math.abs(Sa - Zo(s)) > 16 && (Ht = "zoom", 17825 ba = Kt.scrollLeft, 17826 Ma = Kt.scrollTop), 17827 s.length > 1 && mn != null && mn.length > 1) { 17828 if (Ht === "zoom") { 17829 let o = mn[0] 17830 , i = mn[1] 17831 , r = s[0] 17832 , a = s[1] 17833 , d = (o.clientX + i.clientX) / 2 17834 , u = (o.clientY + i.clientY) / 2 17835 , h = (r.clientX + a.clientX) / 2 17836 , c = (r.clientY + a.clientY) / 2 17837 , f = Zo(mn) 17838 , p = Zo(s) 17839 , g = n.zoom 17840 , y = g * p / f; 17841 Ra.zoomTo(y, g, d, u, null, null, h - d, c - u, null, null, 0) 17842 } else if (Ht === "pan") { 17843 let o = mn[0] 17844 , i = s[0]; 17845 ba += o.clientX - i.clientX, 17846 Ma += o.clientY - i.clientY, 17847 Kt.scrollTo({ 17848 left: ba, 17849 top: Ma, 17850 behavior: "instant" 17851 }) 17852 } 17853 } 17854 mn = s 17855 }) 17856} 17857function Zo(l) { 17858 if (l.length > 1) { 17859 let e = l[0] 17860 , t = l[1]; 17861 return Math.hypot(t.clientX - e.clientX, t.clientY - e.clientY) 17862 } else 17863 return 0 17864} 17865function Dp(l, e, t, n) { 17866 let s, o = [], i; 17867 l.addEventListener(e, function(r) { 17868 if (s = r, 17869 typeof s.getCoalescedEvents == "function") { 17870 let a = s.getCoalescedEvents(); 17871 o = o == null ? a : o.concat(a) 17872 } 17873 i == null && (i = window.requestAnimationFrame(()=>{ 17874 t(s, o), 17875 i = null, 17876 o = null 17877 } 17878 )) 17879 }, n) 17880} 17881function Ms(l, e) { 17882 let t = V() 17883 , n = t.subTool || t.tool; 17884 if (n == null) 17885 return; 17886 let s = l.type; 17887 if (l instanceof PointerEvent) { 17888 Qi = l.clientX, 17889 er = l.clientY; 17890 let o = ey(l); 17891 if (!ln && !o) { 17892 s === "pointerdown" ? n.handlePointerDownOutsideEvent(l) : s === "pointermove" && (t.pointerX = null, 17893 t.pointerY = null); 17894 return 17895 } 17896 if (l.defaultPrevented) 17897 return; 17898 let i; 17899 if ((s === "pointermove" || s === "pointerrawupdate") && e != null && e.length > 0) { 17900 i = []; 17901 for (let u of e) 17902 i.push(u.clientX), 17903 i.push(u.clientY) 17904 } else 17905 i = [Qi, er]; 17906 let r = xi(i) 17907 , a = r.at(-2) 17908 , d = r.at(-1); 17909 switch (l.target2 = D_(l), 17910 s) { 17911 case "pointerenter": 17912 n.handlePointerenterEvent(l); 17913 break; 17914 case "pointerleave": 17915 n.handlePointerleaveEvent(l); 17916 break; 17917 case "pointerdown": 17918 if (Ht !== "normal" && Ht !== "pan" && Ht !== "zoom") { 17919 let u = l.timeStamp || performance.now(); 17920 Yu = u - Xu < 300, 17921 Xu = u, 17922 Pn = l.button, 17923 ya = Qi, 17924 va = er, 17925 l.button === ma && n.handlePointerDownEvent(l, a, d, Yu), 17926 l.defaultPrevented || Kt.focus() 17927 } 17928 break; 17929 case "pointerup": 17930 l.button === Pn && (n.handlePointerUpEvent(l, a, d, ln && Pn === ma), 17931 Pn === A_ ? (Ra.onRightPointerClickEvent(l), 17932 n.handlePointerRightClickEvent(l, a, d)) : !ln && Pn === ma && n.handlePointerClickEvent(l, a, d, Yu), 17933 ya = null, 17934 va = null, 17935 Pn = null, 17936 ln = !1); 17937 break; 17938 case "click": 17939 break; 17940 case "pointermove": 17941 case "pointerrawupdate": 17942 if (t.pointerX = a, 17943 t.pointerY = d, 17944 Ht !== "pan" && Ht !== "zoom") { 17945 if (Pn === O_)
17946 Kt.scrollLeft -= l.movementX, 17947 Kt.scrollTop -= l.movementY; 17948 else if (n.handlePointerMoveEvent(l, a, d, ln, r), 17949 !ln && Pn === ma) { 17950 let u = (l.timeStamp || performance.now()) - Xu 17951 , h = Se(Qi - ya, er - va); 17952 if (u > 200 && h >= 2 || h > 10) { 17953 ln = !0; 17954 let c = xi([ya, va]); 17955 n.startPointerDrag(l, a, d, c[0], c[1]) 17956 } 17957 } 17958 } 17959 break 17960 } 17961 l.preventDefault() 17962 } else if (l instanceof KeyboardEvent) { 17963 if (l.defaultPrevented) 17964 return; 17965 switch (s) { 17966 case "keydown": 17967 n.handleKeyDownEvent(l); 17968 break; 17969 case "keyup": 17970 n.handleKeyUpEvent(l); 17971 break; 17972 case "keypress": 17973 n.handleKeyPressEvent(l); 17974 break 17975 } 17976 } 17977} 17978function ey(l) { 17979 let e = l.target; 17980 for (; e && e.tagName !== "BODY"; ) { 17981 if (e === Kt) 17982 return !0; 17983 e = e.parentElement 17984 } 17985 return !1 17986} 17987function xi(l) { 17988 const e = V(); 17989 let t = e.svgClientBounds 17990 , n = t.width / e.documentSettings.width 17991 , s = t.height / e.documentSettings.height; 17992 (!Number.isFinite(n) || n === 0) && (n = e.zoom / 100), 17993 (!Number.isFinite(s) || s === 0) && (s = e.zoom / 100); 17994 for (let o = 0; o < l.length; o += 2) 17995 l[o] = (l[o] - t.x) / n, 17996 l[o + 1] = (l[o + 1] - t.y) / s; 17997 return l 17998} 17999function ty(l) { 18000 const e = V(); 18001 let t = e.svgClientBounds 18002 , n = t.width / e.documentSettings.width 18003 , s = t.height / e.documentSettings.height; 18004 (!Number.isFinite(n) || n === 0) && (n = e.zoom / 100), 18005 (!Number.isFinite(s) || s === 0) && (s = e.zoom / 100); 18006 for (let o = 0; o < l.length; o += 2) 18007 l[o] = l[o] * n + t.x, 18008 l[o + 1] = l[o + 1] * s + t.y; 18009 return l 18010} 18011const Vr = new Map; 18012function ly(l) { 18013 let e = Vr.get(l.type); 18014 e?.forEach(t=>t(l)) 18015} 18016function Jn(l, e) { 18017 let t = Vr.get(l); 18018 if (t == null) 18019 t = [], 18020 Vr.set(l, t), 18021 window.addEventListener(l, ly); 18022 else if (t.includes(e)) 18023 return; 18024 t.unshift(e) 18025} 18026function Zn(l, e) { 18027 let t = Vr.get(l); 18028 if (t != null) { 18029 let n = t.indexOf(e); 18030 n >= 0 && (t.splice(n, 1), 18031 t.length === 0 && (Vr.delete(l), 18032 window.removeEventListener(l, ly))) 18033 } 18034} 18035const L_ = { 18036 name: "HyInputNumber", 18037 props: { 18038 modelValue: { 18039 type: [Number, String], 18040 default: 0 18041 }, 18042 disabled: Boolean, 18043 autofocus: Boolean, 18044 parser: Function, 18045 formatter: Function, 18046 min: { 18047 type: Number, 18048 default: -1 / 0 18049 }, 18050 max: { 18051 type: Number, 18052 default: 1 / 0 18053 }, 18054 step: { 18055 type: Number, 18056 default: 1 18057 }, 18058 showButtons: { 18059 type: Boolean, 18060 default: !1 18061 } 18062 }, 18063 data() { 18064 return { 18065 value: 0, 18066 downElement: null, 18067 intervalId: null 18068 } 18069 }, 18070 computed: { 18071 formattedValue: { 18072 get() { 18073 return this.formatter == null ? "" + this.value : this.formatter(this.value) 18074 }, 18075 set(l) { 18076 let e = parseFloat(this.parser == null ? l : this.parser(l)); 18077 this.value = isNaN(e) ? this.value : this.clampValue(e) 18078 } 18079 } 18080 },
18081 emits: ["update:modelValue", "change", "input", "focus", "blur"], 18082 watch: { 18083 modelValue: { 18084 handler() { 18085 this.value = this.clampValue(this.modelValue) 18086 }, 18087 immediate: !0 18088 } 18089 }, 18090 methods: { 18091 onInputKeydown(l) { 18092 let e = !1; 18093 switch (l.keyCode) { 18094 case 13: 18095 this.updateValue(), 18096 this.$emit("input", this.modelValue), 18097 e = !0; 18098 break; 18099 case 32: 18100 this.updateValue(), 18101 this.$emit("input", this.modelValue), 18102 e = !0; 18103 break; 18104 case 38: 18105 this.increment(), 18106 e = !0; 18107 break; 18108 case 40: 18109 this.decrement(), 18110 e = !0; 18111 break 18112 } 18113 e && l.preventDefault() 18114 }, 18115 onInputFocus(l) { 18116 let e = this.$refs.input; 18117 e && (e.select(), 18118 this.$emit("focus", l)) 18119 }, 18120 onInputBlur(l) { 18121 this.updateValue(), 18122 this.$emit("blur", l) 18123 }, 18124 onPointerDown(l) { 18125 let e = l.target; 18126 (e === this.$refs.increment || e === this.$refs.decrement) && (e === this.$refs.increment ? this.increment() : this.decrement(), 18127 this.downElement = e, 18128 this.intervalId = setTimeout(()=>{ 18129 this.downElement === this.$refs.increment ? this.intervalId = setInterval(()=>this.increment(), 80) : this.intervalId = setInterval(()=>this.decrement(), 80) 18130 } 18131 , 500), 18132 document.addEventListener("pointerup", this.onDocumentPointerUp)) 18133 }, 18134 onDocumentPointerUp(l) { 18135 this.intervalId != null ? (clearInterval(this.intervalId), 18136 this.intervalId = null) : l.target === this.downElement && (l.target === this.$refs.increment ? this.increment() : l.target === this.$refs.decrement && this.decrement()), 18137 this.downElement = null, 18138 document.removeEventListener("pointerup", this.onDocumentPointerUp) 18139 }, 18140 updateValue() { 18141 let l = this.$refs.input; 18142 l != null && (this.formattedValue = l.value, 18143 this.value !== this.modelValue ? this.emitUpdate() : this.$forceUpdate()) 18144 }, 18145 clampValue(l) { 18146 return this.min != null && (l = Math.max(this.min, l)), 18147 this.max != null && (l = Math.min(this.max, l)), 18148 l 18149 }, 18150 emitUpdate() { 18151 this.$emit("update:modelValue", this.value), 18152 this.$emit("change", this.value) 18153 }, 18154 increment() { 18155 let l = this.clampValue(this.value + this.step); 18156 this.value !== l && (this.value = l, 18157 this.emitUpdate(), 18158 this.$emit("input", this.modelValue)) 18159 }, 18160 decrement() { 18161 let l = this.clampValue(this.value - this.step); 18162 this.value !== l && (this.value = l, 18163 this.emitUpdate(), 18164 this.$emit("input", this.modelValue)) 18165 } 18166 } 18167} 18168 , V_ = { 18169 key: 0, 18170 class: "hy-group-prefix", 18171 style: { 18172 "margin-left": "4px" 18173 } 18174} 18175 , N_ = ["value", "disabled", "autofocus", "min", "max", "step"] 18176 , R_ = { 18177 key: 1, 18178 class: "hy-input-number-buttons" 18179}; 18180function F_(l, e, t, n, s, o) { 18181 return N(), 18182 $("div", { 18183 class: Ne(["hy-input-number hy-element", { 18184 "hy-disabled": t.disabled 18185 }]) 18186 }, [l.$slots.prefix ? (N(), 18187 $("span", V_, [vt(l.$slots, "prefix")])) : be("", !0), _("input", { 18188 ref: "input", 18189 type: "text", 18190 inputmode: "numeric", 18191 autocomplete: "off", 18192 value: o.formattedValue, 18193 disabled: t.disabled, 18194 autofocus: t.autofocus, 18195 min: t.min, 18196 max: t.max, 18197 step: t.step, 18198 onKeydown: e[0] || (e[0] = (...i)=>o.onInputKeydown && o.onInputKeydown(...i)), 18199 onFocus: e[1] || (e[1] = (...i)=>o.onInputFocus && o.onInputFocus(...i)), 18200 onBlur: e[2] || (e[2] = (...i)=>
18200o.onInputBlur && o.onInputBlur(...i)) 18201 }, null, 40, N_), t.showButtons ? (N(), 18202 $("div", R_, [_("span", { 18203 ref: "increment", 18204 onPointerdown: e[3] || (e[3] = (...i)=>o.onPointerDown && o.onPointerDown(...i)), 18205 tabIndex: "-1", 18206 role: "spinbutton" 18207 }, [...e[5] || (e[5] = [_("svg", { 18208 viewBox: "0 0 16 16" 18209 }, [_("path", { 18210 fill: "none", 18211 stroke: "currentColor", 18212 "stroke-width": "2", 18213 d: "M4 10l4-4l4 4" 18214 })], -1)])], 544), _("span", { 18215 ref: "decrement", 18216 onPointerdown: e[4] || (e[4] = (...i)=>o.onPointerDown && o.onPointerDown(...i)), 18217 tabIndex: "-1", 18218 role: "spinbutton" 18219 }, [...e[6] || (e[6] = [_("svg", { 18220 viewBox: "0 0 16 16" 18221 }, [_("path", { 18222 fill: "none", 18223 stroke: "currentColor", 18224 "stroke-width": "2", 18225 d: "M4 6l4 4l4-4" 18226 })], -1)])], 544)])) : be("", !0)], 2) 18227} 18228const Lt = ie(L_, [["render", F_]]) 18229 , B_ = { 18230 name: "HyInput", 18231 props: { 18232 modelValue: [Number, String], 18233 disabled: Boolean, 18234 placeholder: String, 18235 autofocus: Boolean 18236 }, 18237 data() { 18238 return { 18239 value: null 18240 } 18241 }, 18242 emits: ["update:modelValue", "focus", "blur"], 18243 watch: { 18244 value(l) { 18245 this.updateValue(l) 18246 }, 18247 modelValue: { 18248 handler(l) { 18249 this.value = l 18250 }, 18251 immediate: !0 18252 } 18253 }, 18254 methods: { 18255 onInputFocus() { 18256 this.$refs.input.select(), 18257 this.$emit("focus", event) 18258 }, 18259 onInputBlur(l) { 18260 this.$emit("blur", l) 18261 }, 18262 updateValue(l) { 18263 l !== this.modelValue && this.$emit("update:modelValue", l) 18264 }, 18265 focus() { 18266 this.$refs.input.focus() 18267 } 18268 }, 18269 mounted() { 18270 this.value = this.modelValue 18271 } 18272} 18273 , z_ = { 18274 key: 0, 18275 class: "hy-group-prefix", 18276 style: { 18277 "margin-left": "4px" 18278 } 18279} 18280 , U_ = ["disabled", "placeholder", "autofocus"] 18281 , G_ = { 18282 key: 1, 18283 class: "hy-group-suffix" 18284}; 18285function H_(l, e, t, n, s, o) { 18286 return N(), 18287 $("div", { 18288 class: Ne(["hy-input hy-element", { 18289 "hy-input-group-prefix": l.$slots.groupPrefix, 18290 "hy-input-group-suffix": l.$slots.groupSuffix, 18291 "hy-disabled": t.disabled 18292 }]) 18293 }, [l.$slots.prefix ? (N(), 18294 $("span", z_, [vt(l.$slots, "prefix")])) : be("", !0), wl(_("input", { 18295 ref: "input", 18296 type: "text", 18297 class: "hy-input-input", 18298 onFocus: e[0] || (e[0] = (...i)=>o.onInputFocus && o.onInputFocus(...i)), 18299 onBlur: e[1] || (e[1] = (...i)=>o.onInputBlur && o.onInputBlur(...i)), 18300 "onUpdate:modelValue": e[2] || (e[2] = i=>s.value = i), 18301 disabled: t.disabled, 18302 placeholder: t.placeholder, 18303 autofocus: t.autofocus 18304 }, null, 40, U_), [[SS, s.value]]), l.$slots.suffix ? (N(), 18305 $("span", G_, [vt(l.$slots, "suffix")])) : be("", !0)], 2) 18306} 18307const Xs = ie(B_, [["render", H_]]) 18308 , Ku = "RGBA" 18309 , Op = "HSLA" 18310 , Wu = "Hex" 18311 , $_ = { 18312 name: "ColorInput", 18313 components: { 18314 SvgIcon: gt, 18315 HyDropdown: xl, 18316 HyButton: nt, 18317 HyInput: Xs, 18318 HyInputNumber: Lt 18319 }, 18320 props: { 18321 color: { 18322 type: ce, 18323 required: !0 18324 } 18325 }, 18326 data() { 18327 return { 18328 editColor: new ce, 18329 type: Ku, 18330 pasteDisabled: !0, 18331 consts: me({ 18332 TYPE_RGBA: Ku, 18333 TYPE_HSLA: Op, 18334 TYPE_HEX: Wu 18335 }), 18336 svg: me({ 18337 copySvg: b2, 18338 pasteSvg: M2 18339 }) 18340 } 18341 }, 18342 computed: { 18343 r: { 18344 get() { 18345 return this.color.r 18346 }, 18347 set(l) { 18348 this.editColor.r = l, 18349 this.emitUpdate() 18350 } 18351 }, 18352 g: { 18353 get() { 18354 return this.color.g 18355 }, 18356 set(l) { 18357 this.editColor.g = l, 18358 this.emitUpdate() 18359 } 18360 }, 18361 b: { 18362 get() { 18363 return this.color.b 18364 }, 18365 set(l) { 18366 this.editColor.b = l, 18367 this.emitUpdate() 18368 } 18369 }, 18370 a: { 18371 get() { 18372 return this.color.a 18373 }, 18374 set(l) { 18375 this.editColor.a = l, 18376 this.emitUpdate() 18377 } 18378 }, 18379 hex: { 18380 get() { 18381 return this.color.toHex(this.color.a < 1) 18382 }, 18383 set(l) { 18384 /#[A-Fa-f0-9]{6}/.test(l) && (this.editColor.set(l), 18385 this.emitUpdate()) 18386 } 18387 } 18388 }, 18389 methods: { 18390 onDropdownOpen() { 18391 Nh().then(l=>{ 18392 this.pasteDisabled = l == null || At(l) == null 18393 } 18394 ) 18395 }, 18396 onTypeClick(l) { 18397 this.type = l, 18398 this.$refs.dropdown.close() 18399 }, 18400 onCopyClick() { 18401 let l = this.type 18402 , e = this.color 18403 , t = l === Wu ? e.toHex(e.a < 1) : e.toRgbaFunction(); 18404 kr(t), 18405 this.$refs.dropdown.close() 18406 }, 18407 onPasteClick() { 18408 Nh().then(l=>{ 18409 if (l) { 18410 let e = At(l); 18411 e && (this.editColor = new ce(e), 18412 this.emitUpdate()) 18413 } 18414 } 18415 ), 18416 this.$refs.dropdown.close() 18417 }, 18418 emitUpdate() { 18419 this.$emit("color:update", this.editColor) 18420 } 18421 }, 18422 emits: ["color:update"], 18423 watch: { 18424 color: { 18425 handler(l) { 18426 this.editColor.set(l) 18427 }, 18428 deep: !0, 18429 immediate: !0 18430 } 18431 }, 18432 created() { 18433 this.TYPE_RGBA = Ku, 18434 this.TYPE_HSLA = Op, 18435 this.TYPE_HEX = Wu 18436 } 18437} 18438 , X_ = { 18439 style: { 18440 display: "flex", 18441 "align-items": "center", 18442 "column-gap": "8px" 18443 } 18444} 18445 , Y_ = { 18446 style: { 18447 display: "grid" 18448 } 18449} 18450 , K_ = { 18451 key: 0, 18452 class: "grid" 18453} 18454 , W_ = { 18455 key: 1, 18456 class: "grid" 18457} 18458 , q_ = { 18459 key: 2, 18460 class: "grid" 18461} 18462 , j_ = { 18463 class: "dropdown-content" 18464} 18465 , J_ = { 18466 style: { 18467 display: "flex", 18468 "align-items": "center", 18469 gap: "8px" 18470 } 18471} 18472 , Z_ = { 18473 style: { 18474 display: "flex", 18475 "align-items": "center", 18476 gap: "8px" 18477 } 18478}; 18479function Q_(l, e, t, n, s, o) { 18480 const i = E("hy-input-number") 18481 , r = E("hy-input") 18482 , a = E("hy-button") 18483 , d = E("svg-icon") 18484 , u = E("hy-dropdown"); 18485 return N(), 18486 $("div", X_, [_("div", null, se(s.type), 1), _("div", Y_, [s.type === s.consts.TYPE_RGBA ? (N(), 18487 $("div", K_, [w(i, { 18488 modelValue: o.r, 18489 "onUpdate:modelValue": e[0] || (e[0] = h=>o.r = h), 18490 min: 0, 18491 max: 255, 18492 showButtons: !1, 18493 class: "number-input" 18494 }, null, 8, ["modelValue"]), w(i, { 18495 modelValue: o.g, 18496 "onUpdate:modelValue": e[1] || (e[1] = h=>o.g = h), 18497 min: 0, 18498 max: 255, 18499 showButtons: !1, 18500 class: "number-input" 18501 }, null, 8, ["modelValue"]), w(i, { 18502 modelValue: o.b, 18503 "onUpdate:modelValue": e[2] || (e[2] = h=>o.b = h), 18504 min: 0, 18505 max: 255, 18506 showButtons: !1, 18507 class: "number-input" 18508 }, null, 8, ["modelValue"]), w(i, { 18509 modelValue: o.a, 18510 "onUpdate:modelValue": e[3] || (e[3] = h=>o.a = h), 18511 min: 0, 18512 max: 1, 18513 showButtons: !1, 18514 class: "number-input" 18515 }, null, 8, ["modelValue"])])) : be("", !0), s.type === s.consts.TYPE_HEX ? (N(), 18516 $("div", W_, [w(r, { 18517 modelValue: o.hex, 18518 "onUpdate:modelValue": e[4] || (e[4] = h=>o.hex = h), 18519 style: { 18520 "grid-column": "span 4", 18521 "text-align": "center", 18522 height: "26px", 18523 "min-width": "0", 18524 "font-feature-settings": "'tnum'" 18525 } 18526 }, null, 8, ["modelValue"])])) : be("", !0), s.type === s.consts.TYPE_HSLA ? (N(), 18527 $("div", q_, [w(i, { 18528 showButtons: !1, 18529 class: "number-input" 18530 }), w(i, { 18531 showButtons: !1, 18532 class: "number-input" 18533 }), w(i, { 18534 showButtons: !1, 18535 class: "number-input" 18536 }), w(i, { 18537 showButtons: !1, 18538 class: "number-input" 18539 })])) : be("", !0)]), w(u, { 18540 ref: "dropdown", 18541 onOpen: o.onDropdownOpen, 18542 style: { 18543 border: "none", 18544 padding: "0 8px" 18545 } 18546 }, {
18547 default: O(()=>[_("div", j_, [w(a, { 18548 onClick: e[5] || (e[5] = h=>o.onTypeClick(s.consts.TYPE_RGBA)) 18549 }, { 18550 default: O(()=>[...e[7] || (e[7] = [ve("RGBA", -1)])]), 18551 _: 1 18552 }), w(a, { 18553 onClick: e[6] || (e[6] = h=>o.onTypeClick(s.consts.TYPE_HEX)) 18554 }, { 18555 default: O(()=>[...e[8] || (e[8] = [ve("Hex", -1)])]), 18556 _: 1 18557 }), e[9] || (e[9] = _("div", { 18558 class: "dropdown-separator" 18559 }, null, -1)), w(a, { 18560 onClick: o.onCopyClick 18561 }, { 18562 default: O(()=>[_("div", J_, [w(d, { 18563 svg: s.svg.copySvg 18564 }, null, 8, ["svg"]), _("div", null, se(l.$t("actions.copy")), 1)])]), 18565 _: 1 18566 }, 8, ["onClick"]), w(a, { 18567 onClick: o.onPasteClick, 18568 disabled: s.pasteDisabled 18569 }, { 18570 default: O(()=>[_("div", Z_, [w(d, { 18571 svg: s.svg.pasteSvg 18572 }, null, 8, ["svg"]), _("div", null, se(l.$t("actions.paste")), 1)])]), 18573 _: 1 18574 }, 8, ["onClick", "disabled"])])]), 18575 _: 1 18576 }, 8, ["onOpen"])]) 18577} 18578const e3 = ie($_, [["render", Q_], ["__scopeId", "data-v-1fa4da8a"]]) 18579 , t3 = { 18580 name: "ColorArray", 18581 components: { 18582 HyTooltip: pt, 18583 SvgIcon: gt 18584 }, 18585 props: { 18586 color: ce 18587 }, 18588 data() { 18589 return { 18590 svgs: me({ 18591 colorHistorySvg: UC 18592 }) 18593 } 18594 }, 18595 emits: ["colorSelected"], 18596 methods: { 18597 onSwatchClick(l) { 18598 let e = this.$store.recentColors[l]; 18599 e != null && this.$emit("colorSelected", new ce(e)) 18600 } 18601 } 18602} 18603 , l3 = { 18604 class: "color-swatches" 18605} 18606 , n3 = { 18607 class: "color-array" 18608} 18609 , s3 = ["onClick"]; 18610function o3(l, e, t, n, s, o) { 18611 const i = E("svg-icon") 18612 , r = E("hy-tooltip"); 18613 return N(), 18614 $("div", l3, [w(i, { 18615 ref: "historyIcon", 18616 svg: s.svgs.colorHistorySvg 18617 }, null, 8, ["svg"]), w(r, { 18618 "get-target": ()=>l.$refs.historyIcon, 18619 label: l.$t("colorPicker.previousColors") 18620 }, null, 8, ["get-target", "label"]), _("div", n3, [(N(!0), 18621 $(Pe, null, Gt(l.$store.recentColors, (a,d)=>(N(), 18622 $("div", { 18623 key: d, 18624 style: xe({ 18625 background: a, 18626 borderStyle: a ? "solid" : "dashed" 18627 }), 18628 class: "color-swatch", 18629 onClick: u=>o.onSwatchClick(d) 18630 }, null, 12, s3))), 128))])]) 18631} 18632const i3 = ie(t3, [["render", o3], ["__scopeId", "data-v-3e6dee20"]]) 18633 , r3 = { 18634 name: "ColorPicker", 18635 components: { 18636 ColorArray: i3, 18637 ColorInput: e3, 18638 HueRing: g_, 18639 HyCheckbox: ml, 18640 HyTooltip: pt, 18641 OpacitySlider: T_, 18642 SvgIcon: gt 18643 }, 18644 props: { 18645 modelValue: { 18646 type: ce, 18647 default: new ce(0,0,0) 18648 }, 18649 hasAlpha: { 18650 type: Boolean, 18651 default: !0 18652 }, 18653 showSwatches: { 18654 type: Boolean, 18655 default: !0 18656 } 18657 }, 18658 data() { 18659 return { 18660 hue: 0, 18661 saturation: 0, 18662 brightness: 1, 18663 hueBackground: "#ff0000", 18664 sliderValue: 0, 18665 opacity: 100, 18666 eyedropperSvg: zC 18667 } 18668 }, 18669 computed: { 18670 colorHex() { 18671 return this.modelValue == null ? "#000000" : this.modelValue.toHex() 18672 }, 18673 hueInt: { 18674 get() { 18675 return Math.round(255 * this.hue) 18676 }, 18677 set(l) { 18678 Math.round(255 * this.hue) !== l && (this.hue = l / 255) 18679 } 18680 }, 18681 saturationInt: { 18682 get() { 18683 return Math.round(255 * this.saturation) 18684 }, 18685 set(l) { 18686 Math.round(255 * this.saturation) !== l && (this.saturation = l / 255) 18687 } 18688 }, 18689 brightnessInt: { 18690 get() { 18691 return Math.round(255 * this.brightness) 18692 }, 18693 set(l) { 18694 Math.round(255 * this.brightness) !== l && (this.brightness = l / 255) 18695 } 18696 }, 18697 isEyedropper() { 18698 return this.$store.subTool === hi 18699 } 18700 }, 18701 emits: ["update:modelValue"], 18702 methods: { 18703 setOpacity(l) { 18704 this.opacity = l,
18705 this.updateValue() 18706 }, 18707 setColor(l) { 18708 this.$emit("update:modelValue", l) 18709 }, 18710 sbSelectorKeydown(l) { 18711 let e = !0; 18712 switch (l.key) { 18713 case "ArrowUp": 18714 this.brightness = Math.min(1, this.brightness + .01); 18715 break; 18716 case "ArrowDown": 18717 this.brightness = Math.max(0, this.brightness - .01); 18718 break; 18719 case "ArrowLeft": 18720 this.saturation = Math.max(0, this.saturation - .01); 18721 break; 18722 case "ArrowRight": 18723 this.saturation = Math.min(1, this.saturation + .01); 18724 break; 18725 default: 18726 e = !1 18727 } 18728 e && (this.updateValue(), 18729 l.preventDefault()) 18730 }, 18731 updateView() { 18732 let l = this.modelValue 18733 , e = l.r 18734 , t = l.g 18735 , n = l.b 18736 , s = hr(this.hue, this.saturation, this.brightness); 18737 if (s[0] !== e || s[1] !== t || s[2] !== n) { 18738 let o = ZS(e, t, n); 18739 this.hue = o[0], 18740 this.saturation = o[1], 18741 this.brightness = o[2] 18742 } 18743 this.opacity = l.a * 100 18744 }, 18745 updateValue() { 18746 this.updateFrameId || (this.updateFrameId = requestAnimationFrame(()=>{ 18747 let l = hr(this.hue, this.saturation, this.brightness); 18748 new ce(l,this.opacity / 100).equals(this.modelValue) || this.$emit("update:modelValue", new ce(l,this.opacity / 100)), 18749 this.updateFrameId = null 18750 } 18751 )) 18752 }, 18753 onSbPointerdown(l) { 18754 let e = this.$refs.sbSelector; 18755 e.style.cursor = "none"; 18756 let t = l.offsetX 18757 , n = l.offsetY 18758 , s = e.offsetWidth 18759 , o = e.offsetHeight; 18760 (!l.ctrlKey || l.shiftKey) && (this.saturation = Math.max(0, Math.min(1, t / s))), 18761 (!l.shiftKey || l.ctrlKey) && (this.brightness = Math.max(0, Math.min(1, 1 - n / o))), 18762 this.updateValue(), 18763 document.addEventListener("pointermove", this.documentPointermove, !0) 18764 }, 18765 onSbPointerup() { 18766 this.endDrag() 18767 }, 18768 documentPointermove(l) { 18769 if (!l.defaultPrevented) 18770 if (l.buttons !== 1) 18771 this.endDrag(); 18772 else { 18773 let e = this.$refs.sbSelector 18774 , t = l.pageX - (window.scrollX + e.getBoundingClientRect().left) 18775 , n = l.pageY - (window.scrollY + e.getBoundingClientRect().top) 18776 , s = e.offsetWidth 18777 , o = e.offsetHeight; 18778 (!l.ctrlKey || l.shiftKey) && (this.saturation = Math.max(0, Math.min(1, t / s))), 18779 (!l.shiftKey || l.ctrlKey) && (this.brightness = Math.max(0, Math.min(1, 1 - n / o))), 18780 this.updateValue(), 18781 l.preventDefault() 18782 } 18783 }, 18784 endDrag() { 18785 document.removeEventListener("pointermove", this.documentPointermove, !0); 18786 let l = this.$refs.sbSelector; 18787 l.style.cursor = "crosshair" 18788 }, 18789 eyedropperPointerdown(l) { 18790 !ey(l) && !this.$refs.eyedropper.$el.contains(l.target) && (l.preventDefault(), 18791 this.toggleEyedropper()) 18792 }, 18793 toggleEyedropper() { 18794 this.isEyedropper ? (this.$store.setSubTool(this.originalSubTool), 18795 this.originalSubTool = null) : (this.originalSubTool = this.$store.subTool, 18796 this.$store.setSubTool(hi), 18797 hi.setColorSelectCallback((l,e)=>{ 18798 this.$emit("update:modelValue", new ce(l)), 18799 e.shiftKey || this.toggleEyedropper() 18800 } 18801 )) 18802 }, 18803 onCopy(l) { 18804 !l.defaultPrevented && l.clipboardData && (l.clipboardData.setData("text/plain", this.modelValue.toRgbaFunction()), 18805 l.preventDefault()) 18806 }, 18807 onPaste(l) { 18808 if (!l.defaultPrevented) { 18809 let e = (l.clipboardData || window.clipboardData).getData("text"); 18810 e && At(e) && this.setColor(new ce(e)), 18811 l.preventDefault() 18812 } 18813 } 18814 }, 18815 mounted() { 18816 this.updateView(), 18817 Jn("cut", this.onCopy), 18818 Jn("copy", this.onCopy), 18819 Jn("paste", this.onPaste) 18820 }, 18821 beforeUnmount() {
18822 this.endDrag(), 18823 this.isEyedropper && this.toggleEyedropper(), 18824 document.removeEventListener("pointermove", this.documentPointermove), 18825 document.removeEventListener("pointerup", this.endDrag), 18826 Zn("cut", this.onCopy), 18827 Zn("copy", this.onCopy), 18828 Zn("paste", this.onPaste) 18829 }, 18830 watch: { 18831 hue(l) { 18832 let e = hr(l, 1, 1); 18833 this.hueBackground = lf(e[0], e[1], e[2]) 18834 }, 18835 saturation(l) { 18836 let e = this.$refs.sbSelector 18837 , t = this.$refs.sbIndicator 18838 , n = e.clientWidth; 18839 t.style.left = Math.round(l * n) + "px" 18840 }, 18841 brightness(l) { 18842 let e = this.$refs.sbSelector 18843 , t = this.$refs.sbIndicator 18844 , n = e.clientHeight; 18845 t.style.top = Math.round((1 - l) * n) + "px" 18846 }, 18847 modelValue: { 18848 handler() { 18849 this.updateView() 18850 }, 18851 deep: !0 18852 }, 18853 isEyedropper: { 18854 handler(l) { 18855 l ? document.addEventListener("pointerdown", this.eyedropperPointerdown, !0) : document.removeEventListener("pointerdown", this.eyedropperPointerdown, !0) 18856 }, 18857 immediate: !0 18858 } 18859 } 18860} 18861 , a3 = { 18862 class: "color-picker" 18863} 18864 , d3 = { 18865 class: "controls" 18866} 18867 , u3 = { 18868 class: "hsb-selector" 18869} 18870 , h3 = { 18871 key: 0, 18872 class: "opacity-slider" 18873}; 18874function c3(l, e, t, n, s, o) { 18875 const i = E("hue-ring") 18876 , r = E("opacity-slider") 18877 , a = E("hy-tooltip") 18878 , d = E("svg-icon") 18879 , u = E("hy-checkbox") 18880 , h = E("color-input") 18881 , c = E("color-array"); 18882 return N(), 18883 $("div", a3, [_("div", d3, [_("div", u3, [w(i, { 18884 modelValue: s.hue, 18885 "onUpdate:modelValue": e[3] || (e[3] = f=>s.hue = f), 18886 class: "hue-ring", 18887 onInput: e[4] || (e[4] = f=>{ 18888 s.hue = f, 18889 o.updateValue() 18890 } 18891 ) 18892 }, { 18893 default: O(()=>[_("div", { 18894 ref: "sbSelector", 18895 class: "sb-selector", 18896 style: xe({ 18897 background: "content-box " + s.hueBackground 18898 }), 18899 onKeydown: e[0] || (e[0] = (...f)=>o.sbSelectorKeydown && o.sbSelectorKeydown(...f)), 18900 onPointerdown: e[1] || (e[1] = (...f)=>o.onSbPointerdown && o.onSbPointerdown(...f)), 18901 onPointerup: e[2] || (e[2] = (...f)=>o.onSbPointerup && o.onSbPointerup(...f)), 18902 tabindex: "0" 18903 }, [e[6] || (e[6] = _("div", { 18904 class: "white-gradient" 18905 }, null, -1)), e[7] || (e[7] = _("div", { 18906 class: "black-gradient" 18907 }, null, -1)), _("div", { 18908 ref: "sbIndicator", 18909 class: "sb-indicator", 18910 style: xe({ 18911 background: o.colorHex 18912 }) 18913 }, null, 4)], 36)]), 18914 _: 1 18915 }, 8, ["modelValue"])]), t.hasAlpha ? (N(), 18916 $("div", h3, [w(r, { 18917 "model-value": t.modelValue, 18918 "onUpdate:opacity": o.setOpacity 18919 }, null, 8, ["model-value", "onUpdate:opacity"])])) : be("", !0), w(u, { 18920 ref: "eyedropper", 18921 type: "button", 18922 class: "eyedropper-button", 18923 "model-value": o.isEyedropper, 18924 onInput: o.toggleEyedropper 18925 }, { 18926 default: O(()=>[w(a, { 18927 "get-target": ()=>l.$refs.eyedropper, 18928 label: l.$t("colorPicker.eyedropper") 18929 }, null, 8, ["get-target", "label"]), w(d, { 18930 svg: s.eyedropperSvg 18931 }, null, 8, ["svg"])]), 18932 _: 1 18933 }, 8, ["model-value", "onInput"])]), w(h, { 18934 class: "color-input", 18935 color: t.modelValue, 18936 "onColor:update": o.setColor 18937 }, null, 8, ["color", "onColor:update"]), t.showSwatches ? (N(), 18938 pe(c, { 18939 key: 0, 18940 class: "color-swatches", 18941 onColorSelected: e[5] || (e[5] = f=>this.setColor(f)), 18942 color: t.modelValue 18943 }, null, 8, ["color"])) : be("", !0)]) 18944} 18945const ea = ie(r3, [["render", c3], ["__scopeId", "data-v-653ed195"]]) 18946 , f3 = { 18947 name: "CanvasBackgroundSelector", 18948 components: { 18949 ColorPicker: ea,
18950 HyPopover: Ql, 18951 HyButton: nt, 18952 SvgIcon: gt, 18953 HyRadio: en, 18954 HyTooltip: pt, 18955 HyDropdown: xl 18956 }, 18957 data() { 18958 return { 18959 bgValues: ["white", "#222", "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAAAAABzpdGLAAAACXBIWXMAAArwAAAK8AFCrDSYAAAAGElEQVR42mPYBgP/YYBhsArBWXC5wSoEAMRMFJqIStfPAAAAAElFTkSuQmCC) repeat fixed"], 18960 colorwheelSvg: me(qC), 18961 showColorpicker: !1, 18962 freeColor: null, 18963 bgSvg: me(`<svg width="18" height="18" viewBox="0 0 18 18"> 18964 <path d="M0 0 18 0 18 18z" fill="currentColor" opacity="0.4"/> 18965 </svg>`) 18966 } 18967 }, 18968 computed: { 18969 background: { 18970 get() { 18971 return this.$store.appSettings.editor.canvasBackground 18972 }, 18973 set(l) { 18974 this.$store.appSettings.editor.canvasBackground = l 18975 } 18976 } 18977 }, 18978 methods: { 18979 close() { 18980 this.showColorpicker = !1, 18981 this.$refs.dropdown.close() 18982 }, 18983 openColorpicker() { 18984 this.freeColor = new ce(At(this.background) || "white"), 18985 this.showColorpicker = !0 18986 }, 18987 updateFromFreeColor(l) { 18988 this.background = l.toCss() 18989 } 18990 } 18991} 18992 , p3 = { 18993 class: "dropdown-content" 18994}; 18995function g3(l, e, t, n, s, o) { 18996 const i = E("svg-icon") 18997 , r = E("hy-tooltip") 18998 , a = E("hy-button") 18999 , d = E("color-picker") 19000 , u = E("hy-popover") 19001 , h = E("hy-dropdown"); 19002 return N(), 19003 pe(h, { 19004 ref: "dropdown", 19005 popupSecondaryPos: "center", 19006 onClose: o.close, 19007 style: { 19008 padding: "0", 19009 width: "18px", 19010 height: "18px", 19011 margin: "1px", 19012 background: "none" 19013 } 19014 }, { 19015 button: O(()=>[w(i, { 19016 svg: s.bgSvg 19017 }, null, 8, ["svg"]), w(r, { 19018 getTarget: ()=>l.$refs.dropdown, 19019 label: l.$t("canvasBgDropdown.canvasBg") 19020 }, null, 8, ["getTarget", "label"])]), 19021 arrow: O(()=>[...e[2] || (e[2] = [])]), 19022 default: O(()=>[_("div", p3, [(N(!0), 19023 $(Pe, null, Gt(s.bgValues, c=>(N(), 19024 pe(a, { 19025 key: c, 19026 onClick: f=>o.background = c, 19027 class: "bg-button", 19028 style: xe({ 19029 background: c, 19030 backgroundAttachment: "local" 19031 }) 19032 }, null, 8, ["onClick", "style"]))), 128)), w(a, { 19033 ref: "colorBtn", 19034 class: "bg-button", 19035 style: { 19036 border: "none" 19037 }, 19038 onClick: o.openColorpicker 19039 }, { 19040 default: O(()=>[w(i, { 19041 svg: s.colorwheelSvg, 19042 width: "24", 19043 height: "24" 19044 }, null, 8, ["svg"])]), 19045 _: 1 19046 }, 8, ["onClick"]), w(u, { 19047 show: s.showColorpicker, 19048 getSource: ()=>l.$refs.colorBtn, 19049 style: { 19050 padding: "16px" 19051 }, 19052 onClose: e[1] || (e[1] = c=>s.showColorpicker = !1) 19053 }, { 19054 default: O(()=>[w(d, { 19055 modelValue: s.freeColor, 19056 "onUpdate:modelValue": [e[0] || (e[0] = c=>s.freeColor = c), o.updateFromFreeColor], 19057 hasAlpha: !1, 19058 showSwatches: !1 19059 }, null, 8, ["modelValue", "onUpdate:modelValue"])]), 19060 _: 1 19061 }, 8, ["show", "getSource"])])]), 19062 _: 1 19063 }, 8, ["onClose"]) 19064} 19065const m3 = ie(f3, [["render", g3], ["__scopeId", "data-v-0c5079d8"]]) 19066 , y3 = { 19067 name: "StatusBar", 19068 components: { 19069 CanvasBackgroundSelector: m3 19070 }, 19071 data() { 19072 return {} 19073 }, 19074 computed: { 19075 currentX() { 19076 return this.$store.pointerX == null ? "" : Math.round(this.$store.pointerX) 19077 }, 19078 currentY() { 19079 return this.$store.pointerY == null ? "" : Math.round(this.$store.pointerY) 19080 } 19081 } 19082} 19083 , v3 = { 19084 class: "status-bar" 19085} 19086 , b3 = { 19087 class: "coordinate" 19088} 19089 , M3 = { 19090 class: "coordinate" 19091}; 19092function S3(l, e, t, n, s, o) { 19093 const i = E("canvas-background-selector"); 19094 return N(), 19095 $("div", v3, [w(i), _("div", b3, "x: " + se(o.currentX), 1), _("div", M3, "y: " + se(o.currentY), 1), e[0] || (e[0] = _("div", { 19096 style: { 19097 flex: "1 1 0" 19098 } 19099 }, null, -1))]) 19100} 19101const w3 = ie(y3, [["render", S3], ["__scopeId", "data-v-3509d06a"]]); 19102let P3 = "#f0f0f0" 19103 , x3 = "#fff" 19104 , C3 = "#808080" 19105 , _3 = "rgb(0 0 0 / 1" 19106 , T3 = "#202020" 19107 , k3 = "#303030" 19108 , E3 = "#808080" 19109 , D3 = "rgb(204 204 204 / 0.5)"; 19110const O3 = { 19111 name: "Ruler", 19112 props: { 19113 isVertical: { 19114 type: Boolean, 19115 default: !1 19116 } 19117 }, 19118 data() { 19119 return { 19120 showIndicator: !1 19121 } 19122 }, 19123 computed: { 19124 isDarkMode() {
19125 return this.$store.appSettings.ui.darkMode.isDark 19126 } 19127 }, 19128 created() { 19129 this.contentOffset = 100, 19130 this.contentWidth = 100, 19131 this.contentUnits = 100 19132 }, 19133 mounted() { 19134 this.isVertical ? (this.setWidth(18), 19135 this.setHeight(100)) : (this.setWidth(100), 19136 this.setHeight(18)), 19137 this.$refs.canvas.addEventListener("contextrestored", this.syncSize); 19138 let e = new ResizeObserver(this.syncSize); 19139 e.observe(this.$refs.ruler), 19140 this.resizeObserver = e, 19141 this.syncSize() 19142 }, 19143 beforeUnmount() { 19144 this.$refs.canvas.removeEventListener("contextrestored", this.syncSize), 19145 this.resizeObserver != null && this.resizeObserver.disconnect() 19146 }, 19147 watch: { 19148 "$store.pointerX"(l) { 19149 this.isVertical || this.updateIndicator(l) 19150 }, 19151 "$store.pointerY"(l) { 19152 this.isVertical && this.updateIndicator(l) 19153 }, 19154 isDarkMode() { 19155 this.syncSize() 19156 } 19157 }, 19158 methods: { 19159 syncSize() { 19160 let l = this.$refs.ruler; 19161 this.setWidth(l.offsetWidth), 19162 this.setHeight(l.offsetHeight), 19163 this.updateScale(this.contentOffset, this.contentWidth, this.contentUnits, !0) 19164 }, 19165 setWidth(l) { 19166 l *= Math.max(1, window?.devicePixelRatio ?? 1); 19167 let e = this.$refs.canvas; 19168 e != null && l !== e.width && (e.width = l) 19169 }, 19170 setHeight(l) { 19171 l *= Math.max(1, window?.devicePixelRatio ?? 1); 19172 let e = this.$refs.canvas; 19173 e != null && l !== e.height && (e.height = l) 19174 }, 19175 updateScale(l, e, t, n=!1) { 19176 let s = this.$refs.canvas; 19177 if (s == null) 19178 return; 19179 const o = Math.max(1, window?.devicePixelRatio ?? 1); 19180 if (!n && this.contentOffset === l && this.contentWidth === e && this.contentUnits === t || e === 0) 19181 return; 19182 this.contentWidth = e, 19183 this.contentUnits = t, 19184 this.contentOffset = l; 19185 let i = e / t 19186 , r = 4 19187 , a = 10 19188 , d = 10; 19189 if (i < r) 19190 do 19191 a *= 2, 19192 i *= 2, 19193 d = 20, 19194 i < r && (a *= 2.5, 19195 i *= 2.5, 19196 d = 5, 19197 i < r && (a *= 2, 19198 i *= 2, 19199 d = 10)); 19200 while (i < r); 19201 else 19202 for (; i / 2 >= r; ) 19203 a /= 2, 19204 i /= 2, 19205 d = 5, 19206 i / 2 >= r && (a /= 2.5, 19207 i /= 2.5, 19208 d = 20, 19209 i / 2 >= r && (a /= 2, 19210 i /= 2, 19211 d = 10)); 19212 let u = "9px" 19213 , h = "Inter" 19214 , c = a - Math.trunc(a) 19215 , f = 0; 19216 if (c !== 0) 19217 for (; c < 1; ) 19218 c *= 10, 19219 f++; 19220 let p = this.isVertical 19221 , g = (p ? s.height : s.width) / o 19222 , y = (p ? s.width : s.height) / o 19223 , m = s.getContext("2d"); 19224 m.save(), 19225 m.scale(o, o), 19226 p && (m.translate(0, g), 19227 m.rotate(-Math.PI / 2)); 19228 let b = 10 * i 19229 , M = this.isDarkMode; 19230 m.fillStyle = M ? T3 : P3, 19231 m.fillRect(0, 0, g, y), 19232 m.fillStyle = M ? k3 : x3, 19233 m.fillRect(p ? g - l - e : l, 0, e, y), 19234 m.lineWidth = 1, 19235 m.strokeStyle = M ? E3 : C3, 19236 m.fillStyle = M ? D3 : _3, 19237 m.beginPath(); 19238 let S = Math.floor(-l / b) 19239 , x = Math.ceil((g - l) / b + 1); 19240 for (let P = S; P < x; P++) { 19241 let C = P * b + l; 19242 if (p && (C = g - C), 19243 d === 5) 19244 for (let T = 0; T < 5; T++) { 19245 let k = C + 2 * i * T 19246 , D = T === 0 ? 6 : 3; 19247 m.moveTo(k + .5, y), 19248 m.lineTo(k + .5, y - D) 19249 } 19250 else 19251 for (let T = 0; T < 10; T++) { 19252 let k = C + i * T 19253 , D = T === 0 || T === 5 ? 6 : 3; 19254 m.moveTo(k + .5, y), 19255 m.lineTo(k + .5, y - D) 19256 } 19257 } 19258 m.stroke(), 19259 m.textAlign = "center", 19260 m.font = u + " " + h; 19261 for (let P = S; P < x; P++) { 19262 let C = P * b + l; 19263 p && (C = g - C); 19264 let T = (a * P).toFixed(f); 19265 m.fillText(T, C + .5, y - 8) 19266 }
19267 m.restore() 19268 }, 19269 updateIndicator(l) { 19270 let e = this.$refs.indicator.style; 19271 if (l == null) 19272 e.setProperty("visibility", "hidden"); 19273 else { 19274 e.setProperty("visibility", "visible"); 19275 let t = Math.ceil(this.contentOffset + l * this.contentWidth / this.contentUnits) - 1 + "px"; 19276 this.isVertical ? e.setProperty("transform", "translate(0," + t + ")") : e.setProperty("transform", "translate(" + t + ",0)") 19277 } 19278 } 19279 } 19280} 19281 , A3 = { 19282 ref: "canvas", 19283 class: "scale-canvas" 19284} 19285 , I3 = { 19286 ref: "indicator", 19287 class: "indicator" 19288}; 19289function L3(l, e, t, n, s, o) { 19290 return e[0] || (mi(-1, !0), 19291 (e[0] = _("div", { 19292 ref: "ruler", 19293 class: Ne(["ruler", [t.isVertical ? "vertical" : "horizontal"]]) 19294 }, [_("canvas", A3, null, 512), _("div", I3, null, 512)], 2)).cacheIndex = 0, 19295 mi(1), 19296 e[0]) 19297} 19298const V3 = ie(O3, [["render", L3], ["__scopeId", "data-v-415810ae"]]) 19299 , N3 = { 19300 name: "HyScrollview", 19301 inheritAttrs: !1, 19302 props: { 19303 horizontal: { 19304 type: Boolean, 19305 default: !0 19306 }, 19307 vertical: { 19308 type: Boolean, 19309 default: !0 19310 }, 19311 smooth: { 19312 type: Boolean, 19313 default: !0 19314 }, 19315 hideScrollbars: { 19316 type: Boolean, 19317 default: !1 19318 }, 19319 class: String, 19320 style: Object, 19321 contentStyle: String 19322 }, 19323 data() { 19324 return { 19325 isDragging: !1 19326 } 19327 }, 19328 mounted() { 19329 this.updateScrollbars(), 19330 this.resizeObserver = new ResizeObserver(this.updateScrollbars), 19331 this.resizeObserver.observe(this.$refs.scrollviewContent), 19332 this.setSmooth(this.smooth) 19333 }, 19334 beforeUnmount() { 19335 this.endDrag(), 19336 this.resizeObserver.disconnect() 19337 }, 19338 methods: { 19339 updateScrollbars() { 19340 let l = this.$refs.scrollview 19341 , e = this.$refs.scrollviewContent 19342 , t = this.$refs.scrollbarX; 19343 if (this.horizontal && t) { 19344 let s = t.children[0] 19345 , o = l.offsetWidth 19346 , i = e.offsetWidth; 19347 if (o >= i) 19348 t.style.setProperty("display", "none"); 19349 else { 19350 let r = Math.max(20, o * o / i) 19351 , d = l.scrollLeft / (i - o) * (o - r) 19352 , u = s.style; 19353 u.setProperty("width", r + "px"), 19354 u.setProperty("margin-left", d + "px"), 19355 t.style.removeProperty("display") 19356 } 19357 } 19358 let n = this.$refs.scrollbarY; 19359 if (this.vertical && n) { 19360 let s = n.children[0] 19361 , o = l.offsetHeight 19362 , i = e.offsetHeight; 19363 if (o >= i) 19364 n.style.setProperty("display", "none"); 19365 else { 19366 let r = Math.max(20, o * o / i) 19367 , d = l.scrollTop / (i - o) * (o - r) 19368 , u = s.style; 19369 u.setProperty("height", r + "px"), 19370 u.setProperty("margin-top", d + "px"), 19371 n.style.removeProperty("display") 19372 } 19373 } 19374 }, 19375 onWheel(l) { 19376 l.defaultPrevented || this.updateScrollbars() 19377 }, 19378 onScrollbarWheel(l) { 19379 this.setSmooth(!1); 19380 let e = this.$refs.scrollview; 19381 l.shiftKey ? this.horizontal && (e.scrollLeft += l.deltaX) : this.vertical && (e.scrollTop += l.deltaY), 19382 el(()=>this.setSmooth(!0)) 19383 }, 19384 onThumbPointerdown(l) { 19385 this.startDrag(l), 19386 l.preventDefault() 19387 }, 19388 onTrackPointerdown(l) { 19389 let e = l.target; 19390 if (e !== this.$refs.scrollbarX && e !== this.$refs.scrollbarY) 19391 return; 19392 let t = e === this.$refs.scrollbarX, n = e.children[0].getBoundingClientRect(), s = this.$refs.scrollview, o; 19393 t ? (o = l.clientX < n.x ? -1 : l.clientX > n.x + n.width ? Hu : uo, 19394 s.scrollLeft += .875 * o * s.offsetWidth) : (o = l.clientY < n.y ? -1 : l.clientY > n.y + n.height ? Hu : uo, 19395 s.scrollTop += .875 * o * s.offsetHeight), 19396 this.startDrag(l), 19397 l.preventDefault() 19398 }, 19399 onPointermove(l) { 19400 let e = this.dragData; 19401 if (e != null) { 19402 let t = this.$refs.scrollview
19403 , n = this.getScrollRatio(e.axis); 19404 e.axis === uo ? t.scrollLeft = (l.clientX - e.clientX) / n + e.scrollLeft : t.scrollTop = (l.clientY - e.clientY) / n + e.scrollTop 19405 } 19406 }, 19407 startDrag(l) { 19408 this.isDragging = !0; 19409 let e = this.$refs.scrollview 19410 , t = this.horizontal && l.target === this.$refs.scrollbarX.children[0] ? uo : Hu; 19411 this.dragData = { 19412 axis: t, 19413 clientX: l.clientX, 19414 scrollLeft: e.scrollLeft, 19415 clientY: l.clientY, 19416 scrollTop: e.scrollTop 19417 }, 19418 this.setSmooth(!1), 19419 this.$refs.scrollviewContainer.classList.add(t === uo ? "hy-active-x" : "hy-active-y"), 19420 document.addEventListener("pointermove", this.onPointermove), 19421 document.addEventListener("pointerup", this.endDrag), 19422 document.addEventListener("focusout", this.onFocusOut) 19423 }, 19424 endDrag() { 19425 if (this.isDragging) { 19426 this.isDragging = !1; 19427 let l = this.dragData.axis; 19428 this.$refs.scrollviewContainer.classList.remove(l === uo ? "hy-active-x" : "hy-active-y"), 19429 this.dragData = null, 19430 this.setSmooth(!0), 19431 document.removeEventListener("pointermove", this.onPointermove), 19432 document.removeEventListener("pointerup", this.endDrag), 19433 document.removeEventListener("focusout", this.onFocusOut) 19434 } 19435 }, 19436 onFocusOut(l) { 19437 l.relatedTarget == null && this.endDrag() 19438 }, 19439 getScrollRatio(l) { 19440 let e = this.$refs.scrollview 19441 , t = this.$refs.scrollviewContent; 19442 return l === uo ? e.offsetWidth / t.offsetWidth : e.offsetHeight / t.offsetHeight 19443 }, 19444 setSmooth(l) { 19445 if (this.smooth) { 19446 let e = this.$refs.scrollview; 19447 e.style.scrollBehavior = l ? "smooth" : "auto" 19448 } 19449 }, 19450 setFocus() { 19451 this.$refs.scrollview.focus() 19452 } 19453 } 19454}; 19455function R3(l, e, t, n, s, o) { 19456 return N(), 19457 $("div", { 19458 ref: "scrollviewContainer", 19459 class: Ne(["hy-scrollview-container", this.class]), 19460 style: xe(t.style) 19461 }, [_("div", Wl({ 19462 ref: "scrollview" 19463 }, l.$attrs, { 19464 class: ["hy-scrollview", { 19465 "hy-scrollview-horizontal": t.horizontal, 19466 "hy-scrollview-vertical": t.vertical 19467 }], 19468 onPointerenter: e[0] || (e[0] = (...i)=>o.updateScrollbars && o.updateScrollbars(...i)), 19469 onWheelPassive: e[1] || (e[1] = (...i)=>o.onWheel && o.onWheel(...i)), 19470 onScrollPassive: e[2] || (e[2] = (...i)=>o.updateScrollbars && o.updateScrollbars(...i)) 19471 }), [_("div", { 19472 ref: "scrollviewContent", 19473 class: "hy-scrollview-content", 19474 style: xe(t.contentStyle) 19475 }, [vt(l.$slots, "default")], 4)], 16), t.horizontal && !t.hideScrollbars ? (N(), 19476 $("div", { 19477 key: 0, 19478 ref: "scrollbarX", 19479 class: "hy-scrollbar hy-scrollbar-x", 19480 onWheelPassive: e[4] || (e[4] = (...i)=>o.onScrollbarWheel && o.onScrollbarWheel(...i)), 19481 onPointerdown: e[5] || (e[5] = (...i)=>o.onTrackPointerdown && o.onTrackPointerdown(...i)) 19482 }, [_("div", { 19483 class: "hy-scrollbar-thumb", 19484 onPointerdown: e[3] || (e[3] = (...i)=>o.onThumbPointerdown && o.onThumbPointerdown(...i)) 19485 }, null, 32)], 544)) : be("", !0), t.vertical && !t.hideScrollbars ? (N(), 19486 $("div", { 19487 key: 1, 19488 ref: "scrollbarY", 19489 class: "hy-scrollbar hy-scrollbar-y", 19490 onWheelPassive: e[7] || (e[7] = (...i)=>o.onScrollbarWheel && o.onScrollbarWheel(...i)), 19491 onPointerdown: e[8] || (e[8] = (...i)=>o.onTrackPointerdown && o.onTrackPointerdown(...i)) 19492 }, [_("div", { 19493 class: "hy-scrollbar-thumb", 19494 onPointerdown: e[6] || (e[6] = (...i)=>o.onThumbPointerdown && o.onThumbPointerdown(...i)) 19495 }, null, 32)], 544)) : be("", !0)], 6) 19496} 19497const $o = ie(N3, [["render", R3]]); 19498/*! 19499 * shared v11.3.1 19500 * (c) 2026 kazuya kawaguchi 19501 * Released under the MIT License. 19502 */ 19503function F3(l, e) { 19504 typeof console < "u" && (console.warn("[intlify] " + l), 19505 e && console.warn(e.stack)) 19506} 19507const od = typeof window < "u" 19508 , Ys = (l,e=!1)=>e ? Symbol.for(l) : Symbol(l) 19509 , B3 = (l,e,t)=>z3({ 19510 l, 19511 k: e, 19512 s: t 19513}) 19514 , z3 = l=>JSON.stringify(l).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/\u0027/g, "\\u0027") 19515 , Rt = l=>typeof l == "number" && isFinite(l) 19516 , ny = l=>mf(l) === "[object Date]" 19517 , id = l=>mf(l) === "[object RegExp]" 19518 , iu = l=>st(l) && Object.keys(l).length === 0 19519 , Yt = Object.assign 19520 , U3 = Object.create 19521 , ht = (l=null)=>U3(l); 19522let Ap; 19523const gf = ()=>Ap || (Ap = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : ht()); 19524function Ip(l) { 19525 return l.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/\//g, "/").replace(/=/g, "=") 19526} 19527function Lp(l) { 19528 return l.replace(/&(?![a-zA-Z0-9#]{2,6};)/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">") 19529} 19530function G3(l) { 19531 return l = l.replace(/(\w+)\s*=\s*"([^"]*)"/g, (n,s,o)=>`${s}="${Lp(o)}"`), 19532 l = l.replace(/(\w+)\s*=\s*'([^']*)'/g, (n,s,o)=>`${s}='${Lp(o)}'`),
19533 /\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(l) && (l = l.replace(/(\s+)(on)(\w+\s*=)/gi, "$1on$3")), 19534 [/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi, /(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach(n=>{ 19535 l = l.replace(n, "$1javascript:") 19536 } 19537 ), 19538 l 19539} 19540const H3 = Object.prototype.hasOwnProperty; 19541function $l(l, e) { 19542 return H3.call(l, e) 19543} 19544const Ot = Array.isArray 19545 , kt = l=>typeof l == "function" 19546 , ge = l=>typeof l == "string" 19547 , Pt = l=>typeof l == "boolean" 19548 , at = l=>l !== null && typeof l == "object" 19549 , $3 = l=>at(l) && kt(l.then) && kt(l.catch) 19550 , sy = Object.prototype.toString 19551 , mf = l=>sy.call(l) 19552 , st = l=>mf(l) === "[object Object]" 19553 , X3 = l=>l == null ? "" : Ot(l) || st(l) && l.toString === sy ? JSON.stringify(l, null, 2) : String(l); 19554function yf(l, e="") { 19555 return l.reduce((t,n,s)=>s === 0 ? t + n : t + e + n, "") 19556} 19557const wa = l=>!at(l) || Ot(l); 19558function Fa(l, e) { 19559 if (wa(l) || wa(e)) 19560 throw new Error("Invalid value"); 19561 const t = [{ 19562 src: l, 19563 des: e 19564 }]; 19565 for (; t.length; ) { 19566 const {src: n, des: s} = t.pop(); 19567 Object.keys(n).forEach(o=>{ 19568 o !== "__proto__" && (at(n[o]) && !at(s[o]) && (s[o] = Array.isArray(n[o]) ? [] : ht()), 19569 wa(s[o]) || wa(n[o]) ? s[o] = n[o] : t.push({ 19570 src: n[o], 19571 des: s[o] 19572 })) 19573 } 19574 ) 19575 } 19576} 19577/*! 19578 * message-compiler v11.3.1 19579 * (c) 2026 kazuya kawaguchi 19580 * Released under the MIT License. 19581 */ 19582function Y3(l, e, t) { 19583 return { 19584 line: l, 19585 column: e, 19586 offset: t 19587 } 19588} 19589function nc(l, e, t) { 19590 return { 19591 start: l, 19592 end: e 19593 } 19594} 19595const it = { 19596 EXPECTED_TOKEN: 1, 19597 INVALID_TOKEN_IN_PLACEHOLDER: 2, 19598 UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3, 19599 UNKNOWN_ESCAPE_SEQUENCE: 4, 19600 INVALID_UNICODE_ESCAPE_SEQUENCE: 5, 19601 UNBALANCED_CLOSING_BRACE: 6, 19602 UNTERMINATED_CLOSING_BRACE: 7, 19603 EMPTY_PLACEHOLDER: 8, 19604 NOT_ALLOW_NEST_PLACEHOLDER: 9, 19605 INVALID_LINKED_FORMAT: 10, 19606 MUST_HAVE_MESSAGES_IN_PLURAL: 11, 19607 UNEXPECTED_EMPTY_LINKED_MODIFIER: 12, 19608 UNEXPECTED_EMPTY_LINKED_KEY: 13, 19609 UNEXPECTED_LEXICAL_ANALYSIS: 14 19610} 19611 , K3 = 17; 19612function ru(l, e, t={}) { 19613 const {domain: n, messages: s, args: o} = t 19614 , i = l 19615 , r = new SyntaxError(String(i)); 19616 return r.code = l, 19617 e && (r.location = e), 19618 r.domain = n, 19619 r 19620} 19621function W3(l) { 19622 throw l 19623} 19624const yn = " " 19625 , q3 = "\r" 19626 , tl = ` 19627` 19628 , j3 = "\u2028" 19629 , J3 = "\u2029"; 19630function Z3(l) { 19631 const e = l; 19632 let t = 0 19633 , n = 1 19634 , s = 1 19635 , o = 0; 19636 const i = C=>e[C] === q3 && e[C + 1] === tl 19637 , r = C=>e[C] === tl 19638 , a = C=>e[C] === J3 19639 , d = C=>e[C] === j3 19640 , u = C=>i(C) || r(C) || a(C) || d(C) 19641 , h = ()=>t 19642 , c = ()=>n 19643 , f = ()=>s 19644 , p = ()=>o 19645 , g = C=>i(C) || a(C) || d(C) ? tl : e[C] 19646 , y = ()=>g(t) 19647 , m = ()=>g(t + o); 19648 function b() { 19649 return o = 0, 19650 u(t) && (n++, 19651 s = 0), 19652 i(t) && t++, 19653 t++, 19654 s++, 19655 e[t] 19656 } 19657 function M() { 19658 return i(t + o) && o++, 19659 o++, 19660 e[t + o] 19661 } 19662 function S() { 19663 t = 0, 19664 n = 1, 19665 s = 1, 19666 o = 0 19667 } 19668 function x(C=0) { 19669 o = C 19670 } 19671 function P() { 19672 const C = t + o; 19673 for (; C !== t; ) 19674 b(); 19675 o = 0 19676 } 19677 return { 19678 index: h, 19679 line: c, 19680 column: f, 19681 peekOffset: p, 19682 charAt: g, 19683 currentChar: y, 19684 currentPeek: m, 19685 next: b, 19686 peek: M, 19687 reset: S, 19688 resetPeek: x, 19689 skipToPeek: P 19690 } 19691} 19692const Gn = void 0 19693 , Q3 = "." 19694 , Vp = "'" 19695 , e4 = "tokenizer"; 19696function t4(l, e={}) { 19697 const t = e.location !== !1 19698 , n = Z3(l) 19699 , s = ()=>n.index() 19700 , o = ()=>Y3(n.line(), n.column(), n.index()) 19701 , i = o() 19702 , r = s() 19703 , a = { 19704 currentType: 13, 19705 offset: r, 19706 startLoc: i, 19707 endLoc: i, 19708 lastType: 13, 19709 lastOffset: r, 19710 lastStartLoc: i, 19711 lastEndLoc: i, 19712 braceNest: 0, 19713 inLinked: !1, 19714 text: "" 19715 } 19716 , d = ()=>a 19717 , {onError: u} = e; 19718 function h(A, L, G, ...X) { 19719 const ue = d(); 19720 if (L.column += G, 19721 L.offset += G, 19722 u) { 19723 const Z = t ? nc(ue.startLoc, L) : null 19724 , H = ru(A, Z, { 19725 domain: e4, 19726 args: X 19727 }); 19728 u(H) 19729 } 19730 } 19731 function c(A, L, G) { 19732 A.endLoc = o(), 19733 A.currentType = L; 19734 const X = { 19735 type: L 19736 }; 19737 return t && (X.loc = nc(A.startLoc, A.endLoc)), 19738 G != null && (X.value = G), 19739 X 19740 } 19741 const f = A=>c(A, 13); 19742 function p(A, L) { 19743 return A.currentChar() === L ? (A.next(), 19744 L) : (h(it.EXPECTED_TOKEN, o(), 0, L), 19745 "") 19746 } 19747 function g(A) { 19748 let L = ""; 19749 for (; A.currentPeek() === yn || A.currentPeek() === tl; ) 19750 L += A.currentPeek(), 19751 A.peek(); 19752 return L 19753 } 19754 function y(A) { 19755 const L = g(A);
19756 return A.skipToPeek(), 19757 L 19758 } 19759 function m(A) { 19760 if (A === Gn) 19761 return !1; 19762 const L = A.charCodeAt(0); 19763 return L >= 97 && L <= 122 || L >= 65 && L <= 90 || L === 95 19764 } 19765 function b(A) { 19766 if (A === Gn) 19767 return !1; 19768 const L = A.charCodeAt(0); 19769 return L >= 48 && L <= 57 19770 } 19771 function M(A, L) { 19772 const {currentType: G} = L; 19773 if (G !== 2) 19774 return !1; 19775 g(A); 19776 const X = m(A.currentPeek()); 19777 return A.resetPeek(), 19778 X 19779 } 19780 function S(A, L) { 19781 const {currentType: G} = L; 19782 if (G !== 2) 19783 return !1; 19784 g(A); 19785 const X = A.currentPeek() === "-" ? A.peek() : A.currentPeek() 19786 , ue = b(X); 19787 return A.resetPeek(), 19788 ue 19789 } 19790 function x(A, L) { 19791 const {currentType: G} = L; 19792 if (G !== 2) 19793 return !1; 19794 g(A); 19795 const X = A.currentPeek() === Vp; 19796 return A.resetPeek(), 19797 X 19798 } 19799 function P(A, L) { 19800 const {currentType: G} = L; 19801 if (G !== 7) 19802 return !1; 19803 g(A); 19804 const X = A.currentPeek() === "."; 19805 return A.resetPeek(), 19806 X 19807 } 19808 function C(A, L) { 19809 const {currentType: G} = L; 19810 if (G !== 8) 19811 return !1; 19812 g(A); 19813 const X = m(A.currentPeek()); 19814 return A.resetPeek(), 19815 X 19816 } 19817 function T(A, L) { 19818 const {currentType: G} = L; 19819 if (!(G === 7 || G === 11)) 19820 return !1; 19821 g(A); 19822 const X = A.currentPeek() === ":"; 19823 return A.resetPeek(), 19824 X 19825 } 19826 function k(A, L) { 19827 const {currentType: G} = L; 19828 if (G !== 9) 19829 return !1; 19830 const X = ()=>{ 19831 const Z = A.currentPeek(); 19832 return Z === "{" ? m(A.peek()) : Z === "@" || Z === "|" || Z === ":" || Z === "." || Z === yn || !Z ? !1 : Z === tl ? (A.peek(), 19833 X()) : I(A, !1) 19834 } 19835 , ue = X(); 19836 return A.resetPeek(), 19837 ue 19838 } 19839 function D(A) { 19840 g(A); 19841 const L = A.currentPeek() === "|"; 19842 return A.resetPeek(), 19843 L 19844 } 19845 function I(A, L=!0) { 19846 const G = (ue=!1,Z="")=>{ 19847 const H = A.currentPeek(); 19848 return H === "{" || H === "@" || !H ? ue : H === "|" ? !(Z === yn || Z === tl) : H === yn ? (A.peek(), 19849 G(!0, yn)) : H === tl ? (A.peek(), 19850 G(!0, tl)) : !0 19851 } 19852 , X = G(); 19853 return L && A.resetPeek(), 19854 X 19855 } 19856 function F(A, L) { 19857 const G = A.currentChar(); 19858 return G === Gn ? Gn : L(G) ? (A.next(), 19859 G) : null 19860 } 19861 function Y(A) { 19862 const L = A.charCodeAt(0); 19863 return L >= 97 && L <= 122 || L >= 65 && L <= 90 || L >= 48 && L <= 57 || L === 95 || L === 36 19864 } 19865 function q(A) { 19866 return F(A, Y) 19867 } 19868 function re(A) { 19869 const L = A.charCodeAt(0); 19870 return L >= 97 && L <= 122 || L >= 65 && L <= 90 || L >= 48 && L <= 57 || L === 95 || L === 36 || L === 45 19871 } 19872 function ne(A) { 19873 return F(A, re) 19874 } 19875 function te(A) { 19876 const L = A.charCodeAt(0); 19877 return L >= 48 && L <= 57 19878 } 19879 function he(A) { 19880 return F(A, te) 19881 } 19882 function Me(A) { 19883 const L = A.charCodeAt(0); 19884 return L >= 48 && L <= 57 || L >= 65 && L <= 70 || L >= 97 && L <= 102 19885 } 19886 function De(A) { 19887 return F(A, Me) 19888 } 19889 function ye(A) { 19890 let L = "" 19891 , G = ""; 19892 for (; L = he(A); ) 19893 G += L; 19894 return G 19895 } 19896 function _e(A) { 19897 let L = ""; 19898 for (; ; ) { 19899 const G = A.currentChar(); 19900 if (G === "\\") { 19901 const X = A.peek(); 19902 X === "{" || X === "}" || X === "@" || X === "|" || X === "\\" ? (L += G + X, 19903 A.next(), 19904 A.next()) : (A.resetPeek(), 19905 L += G, 19906 A.next()) 19907 } else { 19908 if (G === "{" || G === "}" || G === "@" || G === "|" || !G) 19909 break; 19910 if (G === yn || G === tl) 19911 if (I(A)) 19912 L += G, 19913 A.next(); 19914 else { 19915 if (D(A)) 19916 break; 19917 L += G, 19918 A.next() 19919 } 19920 else 19921 L += G, 19922 A.next() 19923 } 19924 } 19925 return L 19926 } 19927 function Ge(A) { 19928 y(A); 19929 let L = "" 19930 , G = ""; 19931 for (; L = ne(A); ) 19932 G += L; 19933 const X = A.currentChar(); 19934 if (X && X !== "}" && X !== Gn && X !== yn && X !== tl && X !== "ã") { 19935 const ue = Qe(A); 19936 return h(it.INVALID_TOKEN_IN_PLACEHOLDER, o(), 0, G + ue), 19937 G + ue 19938 } 19939 return A.currentChar() === Gn && h(it.UNTERMINATED_CLOSING_BRACE, o(), 0), 19940 G 19941 } 19942 function $e(A) { 19943 y(A); 19944 let L = ""; 19945 return A.currentChar() === "-" ? (A.next(), 19946 L += `-${ye(A)}`) : L += ye(A), 19947 A.currentChar() === Gn && h(it.UNTERMINATED_CLOSING_BRACE, o(), 0), 19948 L 19949 } 19950 function Re(A) { 19951 return A !== Vp && A !== tl 19952 } 19953 function Be(A) { 19954 y(A), 19955 p(A, "'"); 19956 let L = "" 19957 , G = ""; 19958 for (; L = F(A, Re); ) 19959 L === "\\" ? G += Ze(A) : G += L; 19960 const X = A.currentChar(); 19961 return X === tl || X === Gn ? (h(it.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, o(), 0), 19962 X === tl && (A.next(), 19963 p(A, "'")), 19964 G) : (p(A, "'"), 19965 G) 19966 } 19967 function Ze(A) { 19968 const L = A.currentChar(); 19969 switch (L) { 19970 case "\\":
vendor: 6,000 bytes, lines 19971-20184
19971 case "'": 19972 return A.next(), 19973 `\\${L}`; 19974 case "u": 19975 return Xe(A, L, 4); 19976 case "U": 19977 return Xe(A, L, 6); 19978 default: 19979 return h(it.UNKNOWN_ESCAPE_SEQUENCE, o(), 0, L), 19980 "" 19981 } 19982 } 19983 function Xe(A, L, G) { 19984 p(A, L); 19985 let X = ""; 19986 for (let ue = 0; ue < G; ue++) { 19987 const Z = De(A); 19988 if (!Z) { 19989 h(it.INVALID_UNICODE_ESCAPE_SEQUENCE, o(), 0, `\\${L}${X}${A.currentChar()}`); 19990 break 19991 } 19992 X += Z 19993 } 19994 return `\\${L}${X}` 19995 } 19996 function dt(A) { 19997 return A !== "{" && A !== "}" && A !== yn && A !== tl 19998 } 19999 function Qe(A) { 20000 y(A); 20001 let L = "" 20002 , G = ""; 20003 for (; L = F(A, dt); ) 20004 G += L; 20005 return G 20006 } 20007 function Ct(A) { 20008 let L = "" 20009 , G = ""; 20010 for (; L = q(A); ) 20011 G += L; 20012 return G 20013 } 20014 function R(A) { 20015 const L = G=>{ 20016 const X = A.currentChar(); 20017 return X === "{" || X === "@" || X === "|" || X === "(" || X === ")" || !X || X === yn ? G : (G += X, 20018 A.next(), 20019 L(G)) 20020 } 20021 ; 20022 return L("") 20023 } 20024 function U(A) { 20025 y(A); 20026 const L = p(A, "|"); 20027 return y(A), 20028 L 20029 } 20030 function K(A, L) { 20031 let G = null; 20032 switch (A.currentChar()) { 20033 case "{": 20034 return L.braceNest >= 1 && h(it.NOT_ALLOW_NEST_PLACEHOLDER, o(), 0), 20035 A.next(), 20036 G = c(L, 2, "{"), 20037 y(A), 20038 L.braceNest++, 20039 G; 20040 case "}": 20041 return L.braceNest > 0 && L.currentType === 2 && h(it.EMPTY_PLACEHOLDER, o(), 0), 20042 A.next(), 20043 G = c(L, 3, "}"), 20044 L.braceNest--, 20045 L.braceNest > 0 && y(A), 20046 L.inLinked && L.braceNest === 0 && (L.inLinked = !1), 20047 G; 20048 case "@": 20049 return L.braceNest > 0 && h(it.UNTERMINATED_CLOSING_BRACE, o(), 0), 20050 G = Q(A, L) || f(L), 20051 L.braceNest = 0, 20052 G; 20053 default: 20054 { 20055 let ue = !0 20056 , Z = !0 20057 , H = !0; 20058 if (D(A)) 20059 return L.braceNest > 0 && h(it.UNTERMINATED_CLOSING_BRACE, o(), 0), 20060 G = c(L, 1, U(A)), 20061 L.braceNest = 0, 20062 L.inLinked = !1, 20063 G; 20064 if (L.braceNest > 0 && (L.currentType === 4 || L.currentType === 5 || L.currentType === 6)) 20065 return h(it.UNTERMINATED_CLOSING_BRACE, o(), 0), 20066 L.braceNest = 0, 20067 J(A, L); 20068 if (ue = M(A, L)) 20069 return G = c(L, 4, Ge(A)), 20070 y(A), 20071 G; 20072 if (Z = S(A, L)) 20073 return G = c(L, 5, $e(A)), 20074 y(A), 20075 G; 20076 if (H = x(A, L)) 20077 return G = c(L, 6, Be(A)), 20078 y(A), 20079 G; 20080 if (!ue && !Z && !H) 20081 return G = c(L, 12, Qe(A)), 20082 h(it.INVALID_TOKEN_IN_PLACEHOLDER, o(), 0, G.value), 20083 y(A), 20084 G; 20085 break 20086 } 20087 } 20088 return G 20089 } 20090 function Q(A, L) { 20091 const {currentType: G} = L; 20092 let X = null; 20093 const ue = A.currentChar(); 20094 switch ((G === 7 || G === 8 || G === 11 || G === 9) && (ue === tl || ue === yn) && h(it.INVALID_LINKED_FORMAT, o(), 0), 20095 ue) { 20096 case "@": 20097 return A.next(), 20098 X = c(L, 7, "@"), 20099 L.inLinked = !0, 20100 X; 20101 case ".": 20102 return y(A), 20103 A.next(), 20104 c(L, 8, "."); 20105 case ":": 20106 return y(A), 20107 A.next(), 20108 c(L, 9, ":"); 20109 default: 20110 return D(A) ? (X = c(L, 1, U(A)), 20111 L.braceNest = 0, 20112 L.inLinked = !1, 20113 X) : P(A, L) || T(A, L) ? (y(A), 20114 Q(A, L)) : C(A, L) ? (y(A), 20115 c(L, 11, Ct(A))) : k(A, L) ? (y(A), 20116 ue === "{" ? K(A, L) || X : c(L, 10, R(A))) : (G === 7 && h(it.INVALID_LINKED_FORMAT, o(), 0), 20117 L.braceNest = 0, 20118 L.inLinked = !1, 20119 J(A, L)) 20120 } 20121 } 20122 function J(A, L) { 20123 let G = { 20124 type: 13 20125 }; 20126 if (L.braceNest > 0) 20127 return K(A, L) || f(L); 20128 if (L.inLinked) 20129 return Q(A, L) || f(L); 20130 switch (A.currentChar()) { 20131 case "{": 20132 return K(A, L) || f(L); 20133 case "}": 20134 return h(it.UNBALANCED_CLOSING_BRACE, o(), 0), 20135 A.next(), 20136 c(L, 3, "}"); 20137 case "@": 20138 return Q(A, L) || f(L); 20139 default: 20140 { 20141 if (D(A)) 20142 return G = c(L, 1, U(A)), 20143 L.braceNest = 0, 20144 L.inLinked = !1, 20145 G; 20146 if (I(A)) 20147 return c(L, 0, _e(A)); 20148 break 20149 } 20150 } 20151 return G 20152 } 20153 function le() { 20154 const {currentType: A, offset: L, startLoc: G, endLoc: X} = a; 20155 return a.lastType = A, 20156 a.lastOffset = L, 20157 a.lastStartLoc = G, 20158 a.lastEndLoc = X, 20159 a.offset = s(), 20160 a.startLoc = o(), 20161 n.currentChar() === Gn ? c(a, 13) : J(n, a) 20162 } 20163 return { 20164 nextToken: le, 20165 currentOffset: s, 20166 currentPosition: o, 20167 context: d 20168 } 20169} 20170const l4 = "parser" 20171 , n4 = /(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g 20172 , s4 = /\\([\\@{}|])/g; 20173function o4(l, e) { 20174 return e 20175} 20176function i4(l, e, t) { 20177 switch (l) { 20178 case "\\\\": 20179 return "\\"; 20180 case "\\'": 20181 return "'"; 20182 default: 20183 { 20184 const n = parseInt(e || t, 16);
20185 return n <= 55295 || n >= 57344 ? String.fromCodePoint(n) : "�" 20186 } 20187 } 20188} 20189function r4(l={}) { 20190 const e = l.location !== !1 20191 , {onError: t} = l; 20192 function n(m, b, M, S, ...x) { 20193 const P = m.currentPosition(); 20194 if (P.offset += S, 20195 P.column += S, 20196 t) { 20197 const C = e ? nc(M, P) : null 20198 , T = ru(b, C, { 20199 domain: l4, 20200 args: x 20201 }); 20202 t(T) 20203 } 20204 } 20205 function s(m, b, M) { 20206 const S = { 20207 type: m 20208 }; 20209 return e && (S.start = b, 20210 S.end = b, 20211 S.loc = { 20212 start: M, 20213 end: M 20214 }), 20215 S 20216 } 20217 function o(m, b, M, S) { 20218 e && (m.end = b, 20219 m.loc && (m.loc.end = M)) 20220 } 20221 function i(m, b) { 20222 const M = m.context() 20223 , S = s(3, M.offset, M.startLoc); 20224 return S.value = b.replace(s4, o4), 20225 o(S, m.currentOffset(), m.currentPosition()), 20226 S 20227 } 20228 function r(m, b) { 20229 const M = m.context() 20230 , {lastOffset: S, lastStartLoc: x} = M 20231 , P = s(5, S, x); 20232 return P.index = parseInt(b, 10), 20233 m.nextToken(), 20234 o(P, m.currentOffset(), m.currentPosition()), 20235 P 20236 } 20237 function a(m, b) { 20238 const M = m.context() 20239 , {lastOffset: S, lastStartLoc: x} = M 20240 , P = s(4, S, x); 20241 return P.key = b, 20242 m.nextToken(), 20243 o(P, m.currentOffset(), m.currentPosition()), 20244 P 20245 } 20246 function d(m, b) { 20247 const M = m.context() 20248 , {lastOffset: S, lastStartLoc: x} = M 20249 , P = s(9, S, x); 20250 return P.value = b.replace(n4, i4), 20251 m.nextToken(), 20252 o(P, m.currentOffset(), m.currentPosition()), 20253 P 20254 } 20255 function u(m) { 20256 const b = m.nextToken() 20257 , M = m.context() 20258 , {lastOffset: S, lastStartLoc: x} = M 20259 , P = s(8, S, x); 20260 return b.type !== 11 ? (n(m, it.UNEXPECTED_EMPTY_LINKED_MODIFIER, M.lastStartLoc, 0), 20261 P.value = "", 20262 o(P, S, x), 20263 { 20264 nextConsumeToken: b, 20265 node: P 20266 }) : (b.value == null && n(m, it.UNEXPECTED_LEXICAL_ANALYSIS, M.lastStartLoc, 0, vn(b)), 20267 P.value = b.value || "", 20268 o(P, m.currentOffset(), m.currentPosition()), 20269 { 20270 node: P 20271 }) 20272 } 20273 function h(m, b) { 20274 const M = m.context() 20275 , S = s(7, M.offset, M.startLoc); 20276 return S.value = b, 20277 o(S, m.currentOffset(), m.currentPosition()), 20278 S 20279 } 20280 function c(m) { 20281 const b = m.context() 20282 , M = s(6, b.offset, b.startLoc); 20283 let S = m.nextToken(); 20284 if (S.type === 8) { 20285 const x = u(m); 20286 M.modifier = x.node, 20287 S = x.nextConsumeToken || m.nextToken() 20288 } 20289 switch (S.type !== 9 && n(m, it.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, vn(S)), 20290 S = m.nextToken(), 20291 S.type === 2 && (S = m.nextToken()), 20292 S.type) { 20293 case 10: 20294 S.value == null && n(m, it.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, vn(S)), 20295 M.key = h(m, S.value || ""); 20296 break; 20297 case 4: 20298 S.value == null && n(m, it.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, vn(S)), 20299 M.key = a(m, S.value || ""); 20300 break; 20301 case 5: 20302 S.value == null && n(m, it.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, vn(S)), 20303 M.key = r(m, S.value || ""); 20304 break; 20305 case 6: 20306 S.value == null && n(m, it.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, vn(S)), 20307 M.key = d(m, S.value || ""); 20308 break; 20309 default: 20310 { 20311 n(m, it.UNEXPECTED_EMPTY_LINKED_KEY, b.lastStartLoc, 0); 20312 const x = m.context() 20313 , P = s(7, x.offset, x.startLoc); 20314 return P.value = "", 20315 o(P, x.offset, x.startLoc), 20316 M.key = P, 20317 o(M, x.offset, x.startLoc), 20318 { 20319 nextConsumeToken: S, 20320 node: M 20321 } 20322 } 20323 } 20324 return o(M, m.currentOffset(), m.currentPosition()), 20325 { 20326 node: M 20327 } 20328 } 20329 function f(m) { 20330 const b = m.context() 20331 , M = b.currentType === 1 ? m.currentOffset() : b.offset 20332 , S = b.currentType === 1 ? b.endLoc : b.startLoc 20333 , x = s(2, M, S); 20334 x.items = []; 20335 let P = null; 20336 do {
20337 const k = P || m.nextToken(); 20338 switch (P = null, 20339 k.type) { 20340 case 0: 20341 k.value == null && n(m, it.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, vn(k)), 20342 x.items.push(i(m, k.value || "")); 20343 break; 20344 case 5: 20345 k.value == null && n(m, it.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, vn(k)), 20346 x.items.push(r(m, k.value || "")); 20347 break; 20348 case 4: 20349 k.value == null && n(m, it.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, vn(k)), 20350 x.items.push(a(m, k.value || "")); 20351 break; 20352 case 6: 20353 k.value == null && n(m, it.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, vn(k)), 20354 x.items.push(d(m, k.value || "")); 20355 break; 20356 case 7: 20357 { 20358 const D = c(m); 20359 x.items.push(D.node), 20360 P = D.nextConsumeToken || null; 20361 break 20362 } 20363 } 20364 } while (b.currentType !== 13 && b.currentType !== 1); 20365 const C = b.currentType === 1 ? b.lastOffset : m.currentOffset() 20366 , T = b.currentType === 1 ? b.lastEndLoc : m.currentPosition(); 20367 return o(x, C, T), 20368 x 20369 } 20370 function p(m, b, M, S) { 20371 const x = m.context(); 20372 let P = S.items.length === 0; 20373 const C = s(1, b, M); 20374 C.cases = [], 20375 C.cases.push(S); 20376 do { 20377 const T = f(m); 20378 P || (P = T.items.length === 0), 20379 C.cases.push(T) 20380 } while (x.currentType !== 13); 20381 return P && n(m, it.MUST_HAVE_MESSAGES_IN_PLURAL, M, 0), 20382 o(C, m.currentOffset(), m.currentPosition()), 20383 C 20384 } 20385 function g(m) { 20386 const b = m.context() 20387 , {offset: M, startLoc: S} = b 20388 , x = f(m); 20389 return b.currentType === 13 ? x : p(m, M, S, x) 20390 } 20391 function y(m) { 20392 const b = t4(m, Yt({}, l)) 20393 , M = b.context() 20394 , S = s(0, M.offset, M.startLoc); 20395 return e && S.loc && (S.loc.source = m), 20396 S.body = g(b), 20397 l.onCacheKey && (S.cacheKey = l.onCacheKey(m)), 20398 M.currentType !== 13 && n(b, it.UNEXPECTED_LEXICAL_ANALYSIS, M.lastStartLoc, 0, m[M.offset] || ""), 20399 o(S, b.currentOffset(), b.currentPosition()), 20400 S 20401 } 20402 return { 20403 parse: y 20404 } 20405} 20406function vn(l) { 20407 if (l.type === 13) 20408 return "EOF"; 20409 const e = (l.value || "").replace(/\r?\n/gu, "\\n"); 20410 return e.length > 10 ? e.slice(0, 9) + "â¦" : e 20411} 20412function a4(l, e={}) { 20413 const t = { 20414 ast: l, 20415 helpers: new Set 20416 }; 20417 return { 20418 context: ()=>t, 20419 helper: o=>(t.helpers.add(o), 20420 o) 20421 } 20422} 20423function Np(l, e) { 20424 for (let t = 0; t < l.length; t++) 20425 vf(l[t], e) 20426} 20427function vf(l, e) { 20428 switch (l.type) { 20429 case 1: 20430 Np(l.cases, e), 20431 e.helper("plural"); 20432 break; 20433 case 2: 20434 Np(l.items, e); 20435 break; 20436 case 6: 20437 { 20438 vf(l.key, e), 20439 e.helper("linked"), 20440 e.helper("type"); 20441 break 20442 } 20443 case 5: 20444 e.helper("interpolate"), 20445 e.helper("list"); 20446 break; 20447 case 4: 20448 e.helper("interpolate"), 20449 e.helper("named"); 20450 break 20451 } 20452} 20453function d4(l, e={}) { 20454 const t = a4(l); 20455 t.helper("normalize"), 20456 l.body && vf(l.body, t); 20457 const n = t.context(); 20458 l.helpers = Array.from(n.helpers) 20459} 20460function u4(l) { 20461 const e = l.body; 20462 return e.type === 2 ? Rp(e) : e.cases.forEach(t=>Rp(t)), 20463 l 20464} 20465function Rp(l) { 20466 if (l.items.length === 1) { 20467 const e = l.items[0]; 20468 (e.type === 3 || e.type === 9) && (l.static = e.value, 20469 delete e.value) 20470 } else { 20471 const e = []; 20472 for (let t = 0; t < l.items.length; t++) { 20473 const n = l.items[t]; 20474 if (!(n.type === 3 || n.type === 9) || n.value == null) 20475 break; 20476 e.push(n.value) 20477 } 20478 if (e.length === l.items.length) { 20479 l.static = yf(e); 20480 for (let t = 0; t < l.items.length; t++) { 20481 const n = l.items[t]; 20482 (n.type === 3 || n.type === 9) && delete n.value 20483 } 20484 } 20485 } 20486} 20487function li(l) { 20488 switch (l.t = l.type, 20489 l.type) { 20490 case 0: 20491 { 20492 const e = l; 20493 li(e.body), 20494 e.b = e.body, 20495 delete e.body; 20496 break 20497 } 20498 case 1: 20499 { 20500 const e = l 20501 , t = e.cases; 20502 for (let n = 0; n < t.length; n++) 20503 li(t[n]); 20504 e.c = t, 20505 delete e.cases; 20506 break 20507 } 20508 case 2: 20509 { 20510 const e = l 20511 , t = e.items; 20512 for (let n = 0; n < t.length; n++) 20513 li(t[n]); 20514 e.i = t, 20515 delete e.items, 20516 e.static && (e.s = e.static, 20517 delete e.static); 20518 break 20519 } 20520 case 3: 20521 case 9: 20522 case 8: 20523 case 7: 20524 { 20525 const e = l; 20526 e.value && (e.v = e.value, 20527 delete e.value); 20528 break 20529 } 20530 case 6: 20531 { 20532 const e = l; 20533 li(e.key), 20534 e.k = e.key, 20535 delete e.key, 20536 e.modifier && (li(e.modifier), 20537 e.m = e.modifier, 20538 delete e.modifier); 20539 break 20540 } 20541 case 5: 20542 { 20543 const e = l; 20544 e.i = e.index, 20545 delete e.index; 20546 break 20547 } 20548 case 4: 20549 { 20550 const e = l; 20551 e.k = e.key, 20552 delete e.key; 20553 break 20554 } 20555 } 20556 delete l.type 20557} 20558function h4(l, e) { 20559 const {filename: t, breakLineCode: n, needIndent: s} = e
vendor: 6,648 bytes, lines 20560-20856
20560 , o = e.location !== !1 20561 , i = { 20562 filename: t, 20563 code: "", 20564 column: 1, 20565 line: 1, 20566 offset: 0, 20567 map: void 0, 20568 breakLineCode: n, 20569 needIndent: s, 20570 indentLevel: 0 20571 }; 20572 o && l.loc && (i.source = l.loc.source); 20573 const r = ()=>i; 20574 function a(g, y) { 20575 i.code += g 20576 } 20577 function d(g, y=!0) { 20578 const m = y ? n : ""; 20579 a(s ? m + " ".repeat(g) : m) 20580 } 20581 function u(g=!0) { 20582 const y = ++i.indentLevel; 20583 g && d(y) 20584 } 20585 function h(g=!0) { 20586 const y = --i.indentLevel; 20587 g && d(y) 20588 } 20589 function c() { 20590 d(i.indentLevel) 20591 } 20592 return { 20593 context: r, 20594 push: a, 20595 indent: u, 20596 deindent: h, 20597 newline: c, 20598 helper: g=>`_${g}`, 20599 needIndent: ()=>i.needIndent 20600 } 20601} 20602function c4(l, e) { 20603 const {helper: t} = l; 20604 l.push(`${t("linked")}(`), 20605 Ci(l, e.key), 20606 e.modifier ? (l.push(", "), 20607 Ci(l, e.modifier), 20608 l.push(", _type")) : l.push(", undefined, _type"), 20609 l.push(")") 20610} 20611function f4(l, e) { 20612 const {helper: t, needIndent: n} = l; 20613 l.push(`${t("normalize")}([`), 20614 l.indent(n()); 20615 const s = e.items.length; 20616 for (let o = 0; o < s && (Ci(l, e.items[o]), 20617 o !== s - 1); o++) 20618 l.push(", "); 20619 l.deindent(n()), 20620 l.push("])") 20621} 20622function p4(l, e) { 20623 const {helper: t, needIndent: n} = l; 20624 if (e.cases.length > 1) { 20625 l.push(`${t("plural")}([`), 20626 l.indent(n()); 20627 const s = e.cases.length; 20628 for (let o = 0; o < s && (Ci(l, e.cases[o]), 20629 o !== s - 1); o++) 20630 l.push(", "); 20631 l.deindent(n()), 20632 l.push("])") 20633 } 20634} 20635function g4(l, e) { 20636 e.body ? Ci(l, e.body) : l.push("null") 20637} 20638function Ci(l, e) { 20639 const {helper: t} = l; 20640 switch (e.type) { 20641 case 0: 20642 g4(l, e); 20643 break; 20644 case 1: 20645 p4(l, e); 20646 break; 20647 case 2: 20648 f4(l, e); 20649 break; 20650 case 6: 20651 c4(l, e); 20652 break; 20653 case 8: 20654 l.push(JSON.stringify(e.value), e); 20655 break; 20656 case 7: 20657 l.push(JSON.stringify(e.value), e); 20658 break; 20659 case 5: 20660 l.push(`${t("interpolate")}(${t("list")}(${e.index}))`, e); 20661 break; 20662 case 4: 20663 l.push(`${t("interpolate")}(${t("named")}(${JSON.stringify(e.key)}))`, e); 20664 break; 20665 case 9: 20666 l.push(JSON.stringify(e.value), e); 20667 break; 20668 case 3: 20669 l.push(JSON.stringify(e.value), e); 20670 break 20671 } 20672} 20673const m4 = (l,e={})=>{ 20674 const t = ge(e.mode) ? e.mode : "normal" 20675 , n = ge(e.filename) ? e.filename : "message.intl"; 20676 e.sourceMap; 20677 const s = e.breakLineCode != null ? e.breakLineCode : t === "arrow" ? ";" : ` 20678` 20679 , o = e.needIndent ? e.needIndent : t !== "arrow" 20680 , i = l.helpers || [] 20681 , r = h4(l, { 20682 filename: n, 20683 breakLineCode: s, 20684 needIndent: o 20685 }); 20686 r.push(t === "normal" ? "function __msg__ (ctx) {" : "(ctx) => {"), 20687 r.indent(o), 20688 i.length > 0 && (r.push(`const { ${yf(i.map(u=>`${u}: _${u}`), ", ")} } = ctx`), 20689 r.newline()), 20690 r.push("return "), 20691 Ci(r, l), 20692 r.deindent(o), 20693 r.push("}"), 20694 delete l.helpers; 20695 const {code: a, map: d} = r.context(); 20696 return { 20697 ast: l, 20698 code: a, 20699 map: d ? d.toJSON() : void 0 20700 } 20701} 20702; 20703function y4(l, e={}) { 20704 const t = Yt({}, e) 20705 , n = !!t.jit 20706 , s = !!t.minify 20707 , o = t.optimize == null ? !0 : t.optimize 20708 , r = r4(t).parse(l); 20709 return n ? (o && u4(r), 20710 s && li(r), 20711 { 20712 ast: r, 20713 code: "" 20714 }) : (d4(r, t), 20715 m4(r, t)) 20716} 20717/*! 20718 * core-base v11.3.1 20719 * (c) 2026 kazuya kawaguchi 20720 * Released under the MIT License. 20721 */ 20722function v4() { 20723 typeof __INTLIFY_PROD_DEVTOOLS__ != "boolean" && (gf().__INTLIFY_PROD_DEVTOOLS__ = !1) 20724} 20725function In(l) { 20726 return at(l) && bf(l) === 0 && ($l(l, "b") || $l(l, "body")) 20727} 20728const oy = ["b", "body"]; 20729function b4(l) { 20730 return Ks(l, oy) 20731} 20732const iy = ["c", "cases"]; 20733function M4(l) { 20734 return Ks(l, iy, []) 20735} 20736const ry = ["s", "static"]; 20737function S4(l) { 20738 return Ks(l, ry) 20739} 20740const ay = ["i", "items"]; 20741function w4(l) { 20742 return Ks(l, ay, []) 20743} 20744const dy = ["t", "type"]; 20745function bf(l) { 20746 return Ks(l, dy) 20747} 20748const uy = ["v", "value"]; 20749function Pa(l, e) { 20750 const t = Ks(l, uy); 20751 if (t != null) 20752 return t; 20753 throw Nr(e) 20754} 20755const hy = ["m", "modifier"]; 20756function P4(l) { 20757 return Ks(l, hy) 20758} 20759const cy = ["k", "key"]; 20760function x4(l) { 20761 const e = Ks(l, cy); 20762 if (e) 20763 return e; 20764 throw Nr(6) 20765} 20766function Ks(l, e, t) { 20767 for (let n = 0; n < e.length; n++) { 20768 const s = e[n]; 20769 if ($l(l, s) && l[s] != null) 20770 return l[s] 20771 } 20772 return t 20773} 20774const fy = [...oy, ...iy, ...ry, ...ay, ...cy, ...hy, ...uy, ...dy]; 20775function Nr(l) { 20776 return new Error(`unhandled node type: ${l}`) 20777} 20778function qu(l) { 20779 return t=>C4(t, l) 20780} 20781function C4(l, e) { 20782 const t = b4(e); 20783 if (t == null) 20784 throw Nr(0); 20785 if (bf(t) === 1) { 20786 const o = M4(t); 20787 return l.plural(o.reduce((i,r)=>[...i, Fp(l, r)], [])) 20788 } else 20789 return Fp(l, t) 20790} 20791function Fp(l, e) { 20792 const t = S4(e); 20793 if (t != null) 20794 return l.type === "text" ? t : l.normalize([t]); 20795 { 20796 const n = w4(e).reduce((s,o)=>[...s, sc(l, o)], []); 20797 return l.normalize(n) 20798 } 20799} 20800function sc(l, e) { 20801 const t = bf(e); 20802 switch (t) { 20803 case 3: 20804 return Pa(e, t); 20805 case 9: 20806 return Pa(e, t); 20807 case 4: 20808 { 20809 const n = e; 20810 if ($l(n, "k") && n.k) 20811 return l.interpolate(l.named(n.k)); 20812 if ($l(n, "key") && n.key) 20813 return l.interpolate(l.named(n.key)); 20814 throw Nr(t) 20815 } 20816 case 5: 20817 { 20818 const n = e; 20819 if ($l(n, "i") && Rt(n.i)) 20820 return l.interpolate(l.list(n.i)); 20821 if ($l(n, "index") && Rt(n.index)) 20822 return l.interpolate(l.list(n.index)); 20823 throw Nr(t) 20824 } 20825 case 6: 20826 { 20827 const n = e 20828 , s = P4(n) 20829 , o = x4(n); 20830 return l.linked(sc(l, o), s ? sc(l, s) : void 0, l.type) 20831 } 20832 case 7: 20833 return Pa(e, t); 20834 case 8: 20835 return Pa(e, t); 20836 default: 20837 throw new Error(`unhandled node on format message part: ${t}`) 20838 } 20839} 20840const _4 = l=>l; 20841let xa = ht(); 20842function T4(l, e={}) { 20843 let t = !1; 20844 const n = e.onError || W3; 20845 return e.onError = s=>{ 20846 t = !0, 20847 n(s) 20848 } 20849 , 20850 { 20851 ...y4(l, e), 20852 detectError: t 20853 } 20854} 20855function k4(l, e) { 20856 if (ge(l)) {
20857 Pt(e.warnHtmlMessage) && e.warnHtmlMessage; 20858 const n = (e.onCacheKey || _4)(l) 20859 , s = xa[n]; 20860 if (s) 20861 return s; 20862 const {ast: o, detectError: i} = T4(l, { 20863 ...e, 20864 location: !1, 20865 jit: !0 20866 }) 20867 , r = qu(o); 20868 return i ? r : xa[n] = r 20869 } else { 20870 const t = l.cacheKey; 20871 if (t) { 20872 const n = xa[t]; 20873 return n || (xa[t] = qu(l)) 20874 } else 20875 return qu(l) 20876 } 20877} 20878let Rr = null; 20879function E4(l) { 20880 Rr = l 20881} 20882function D4(l, e, t) { 20883 Rr && Rr.emit("i18n:init", { 20884 timestamp: Date.now(), 20885 i18n: l, 20886 version: e, 20887 meta: t 20888 }) 20889} 20890const O4 = A4("function:translate"); 20891function A4(l) { 20892 return e=>Rr && Rr.emit(l, e) 20893} 20894const Qn = { 20895 INVALID_ARGUMENT: K3, 20896 INVALID_DATE_ARGUMENT: 18, 20897 INVALID_ISO_DATE_ARGUMENT: 19, 20898 NOT_SUPPORT_LOCALE_PROMISE_VALUE: 21, 20899 NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: 22, 20900 NOT_SUPPORT_LOCALE_TYPE: 23 20901} 20902 , I4 = 24; 20903function es(l) { 20904 return ru(l, null, void 0) 20905} 20906function Mf(l, e) { 20907 return e.locale != null ? Bp(e.locale) : Bp(l.locale) 20908} 20909let ju; 20910function Bp(l) { 20911 if (ge(l)) 20912 return l; 20913 if (kt(l)) { 20914 if (l.resolvedOnce && ju != null) 20915 return ju; 20916 if (l.constructor.name === "Function") { 20917 const e = l(); 20918 if ($3(e)) 20919 throw es(Qn.NOT_SUPPORT_LOCALE_PROMISE_VALUE); 20920 return ju = e 20921 } else 20922 throw es(Qn.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION) 20923 } else 20924 throw es(Qn.NOT_SUPPORT_LOCALE_TYPE) 20925} 20926function L4(l, e, t) { 20927 return [...new Set([t, ...Ot(e) ? e : at(e) ? Object.keys(e) : ge(e) ? [e] : [t]])] 20928} 20929function oc(l, e, t) { 20930 const n = ge(t) ? t : rd 20931 , s = l; 20932 s.__localeChainCache || (s.__localeChainCache = new Map); 20933 let o = s.__localeChainCache.get(n); 20934 if (!o) { 20935 o = []; 20936 let i = [t]; 20937 for (; Ot(i); ) 20938 i = zp(o, i, e); 20939 const r = Ot(e) || !st(e) ? e : e.default ? e.default : null; 20940 i = ge(r) ? [r] : r, 20941 Ot(i) && zp(o, i, !1), 20942 s.__localeChainCache.set(n, o) 20943 } 20944 return o 20945} 20946function zp(l, e, t) { 20947 let n = !0; 20948 for (let s = 0; s < e.length && Pt(n); s++) { 20949 const o = e[s]; 20950 ge(o) && (n = V4(l, e[s], t)) 20951 } 20952 return n 20953} 20954function V4(l, e, t) { 20955 let n; 20956 const s = e.split("-"); 20957 do { 20958 const o = s.join("-"); 20959 n = N4(l, o, t), 20960 s.splice(-1, 1) 20961 } while (s.length && n === !0); 20962 return n 20963} 20964function N4(l, e, t) { 20965 let n = !1; 20966 if (!l.includes(e) && (n = !0, 20967 e)) { 20968 n = e[e.length - 1] !== "!"; 20969 const s = e.replace(/!/g, ""); 20970 l.push(s), 20971 (Ot(t) || st(t)) && t[s] && (n = t[s]) 20972 } 20973 return n 20974} 20975const Ws = []; 20976Ws[0] = { 20977 w: [0], 20978 i: [3, 0], 20979 "[": [4], 20980 o: [7] 20981}; 20982Ws[1] = { 20983 w: [1], 20984 ".": [2], 20985 "[": [4], 20986 o: [7] 20987}; 20988Ws[2] = { 20989 w: [2], 20990 i: [3, 0], 20991 0: [3, 0] 20992}; 20993Ws[3] = { 20994 i: [3, 0], 20995 0: [3, 0], 20996 w: [1, 1], 20997 ".": [2, 1], 20998 "[": [4, 1], 20999 o: [7, 1] 21000}; 21001Ws[4] = { 21002 "'": [5, 0], 21003 '"': [6, 0], 21004 "[": [4, 2], 21005 "]": [1, 3], 21006 o: 8, 21007 l: [4, 0] 21008}; 21009Ws[5] = { 21010 "'": [4, 0], 21011 o: 8, 21012 l: [5, 0] 21013}; 21014Ws[6] = { 21015 '"': [4, 0], 21016 o: 8, 21017 l: [6, 0] 21018}; 21019const R4 = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/; 21020function F4(l) { 21021 return R4.test(l) 21022} 21023function B4(l) { 21024 const e = l.charCodeAt(0) 21025 , t = l.charCodeAt(l.length - 1); 21026 return e === t && (e === 34 || e === 39) ? l.slice(1, -1) : l 21027} 21028function z4(l) { 21029 if (l == null) 21030 return "o"; 21031 switch (l.charCodeAt(0)) { 21032 case 91: 21033 case 93: 21034 case 46: 21035 case 34: 21036 case 39: 21037 return l; 21038 case 95: 21039 case 36: 21040 case 45: 21041 return "i"; 21042 case 9: 21043 case 10: 21044 case 13: 21045 case 160: 21046 case 65279: 21047 case 8232: 21048 case 8233: 21049 return "w" 21050 } 21051 return "i" 21052} 21053function U4(l) { 21054 const e = l.trim(); 21055 return l.charAt(0) === "0" && isNaN(parseInt(l)) ? !1 : F4(e) ? B4(e) : "*" + e 21056} 21057function G4(l) { 21058 const e = []; 21059 let t = -1, n = 0, s = 0, o, i, r, a, d, u, h; 21060 const c = []; 21061 c[0] = ()=>{ 21062 i === void 0 ? i = r : i += r 21063 } 21064 , 21065 c[1] = ()=>{ 21066 i !== void 0 && (e.push(i), 21067 i = void 0) 21068 } 21069 , 21070 c[2] = ()=>{ 21071 c[0](), 21072 s++ 21073 } 21074 , 21075 c[3] = ()=>{ 21076 if (s > 0) 21077 s--, 21078 n = 4, 21079 c[0](); 21080 else { 21081 if (s = 0, 21082 i === void 0 || (i = U4(i), 21083 i === !1)) 21084 return !1; 21085 c[1]() 21086 } 21087 } 21088 ; 21089 function f() { 21090 const p = l[t + 1]; 21091 if (n === 5 && p === "'" || n === 6 && p === '"') 21092 return t++, 21093 r = "\\" + p, 21094 c[0](), 21095 !0 21096 } 21097 for (; n !== null; ) 21098 if (t++, 21099 o = l[t], 21100 !(o === "\\" && f())) { 21101 if (a = z4(o), 21102 h = Ws[n], 21103 d = h[a] || h.l || 8, 21104 d === 8 || (n = d[0], 21105 d[1] !== void 0 && (u = c[d[1]], 21106 u && (r = o, 21107 u() === !1)))) 21108 return; 21109 if (n === 7) 21110 return e 21111 } 21112} 21113const Up = new Map; 21114function H4(l, e) { 21115 return at(l) ? l[e] : null 21116} 21117function $4(l, e) { 21118 if (!at(l)) 21119 return null; 21120 let t = Up.get(e); 21121 if (t || (t = G4(e), 21122 t && Up.set(e, t)), 21123 !t) 21124 return null; 21125 const n = t.length; 21126 let s = l 21127 , o = 0; 21128 for (; o < n; ) { 21129 const i = t[o]; 21130 if (fy.includes(i) && In(s) || !at(s) || !$l(s, i)) 21131 return null; 21132 const r = s[i]; 21133 if (r === void 0 || kt(s)) 21134 return null; 21135 s = r, 21136 o++ 21137 } 21138 return s 21139} 21140const X4 = "11.3.1" 21141 , au = -1 21142 , rd = "en-US" 21143 , ad = "" 21144 , Gp = l=>`${l.charAt(0).toLocaleUpperCase()}${l.substr(1)}`; 21145function Y4() { 21146 return { 21147 upper: (l,e)=>e === "text" && ge(l) ? l.toUpperCase() : e === "vnode" && at(l) && "__v_isVNode"in l ? l.children.toUpperCase() : l, 21148 lower: (l,e)=>e === "text" && ge(l) ? l.toLowerCase() : e === "vnode" && at(l) && "__v_isVNode"in l ? l.children.toLowerCase() : l, 21149 capitalize: (l,e)=>e === "text" && ge(l) ? Gp(l) : e === "vnode" && at(l) && "__v_isVNode"in l ? Gp(l.children) : l 21150 } 21151} 21152let py; 21153function K4(l) { 21154 py = l 21155} 21156let gy; 21157function W4(l) { 21158 gy = l 21159} 21160let my; 21161function q4(l) { 21162 my = l 21163} 21164let yy = null; 21165const j4 = l=>{ 21166 yy = l 21167} 21168 , J4 = ()=>yy; 21169let vy = null; 21170const Hp = l=>{ 21171 vy = l 21172} 21173 , Z4 = ()=>vy; 21174let $p = 0; 21175function Q4(l={}) {
21176 const e = kt(l.onWarn) ? l.onWarn : F3 21177 , t = ge(l.version) ? l.version : X4 21178 , n = ge(l.locale) || kt(l.locale) ? l.locale : rd 21179 , s = kt(n) ? rd : n 21180 , o = Ot(l.fallbackLocale) || st(l.fallbackLocale) || ge(l.fallbackLocale) || l.fallbackLocale === !1 ? l.fallbackLocale : s 21181 , i = st(l.messages) ? l.messages : Ju(s) 21182 , r = st(l.datetimeFormats) ? l.datetimeFormats : Ju(s) 21183 , a = st(l.numberFormats) ? l.numberFormats : Ju(s) 21184 , d = Yt(ht(), l.modifiers, Y4()) 21185 , u = l.pluralRules || ht() 21186 , h = kt(l.missing) ? l.missing : null 21187 , c = Pt(l.missingWarn) || id(l.missingWarn) ? l.missingWarn : !0 21188 , f = Pt(l.fallbackWarn) || id(l.fallbackWarn) ? l.fallbackWarn : !0 21189 , p = !!l.fallbackFormat 21190 , g = !!l.unresolving 21191 , y = kt(l.postTranslation) ? l.postTranslation : null 21192 , m = st(l.processor) ? l.processor : null 21193 , b = Pt(l.warnHtmlMessage) ? l.warnHtmlMessage : !0 21194 , M = !!l.escapeParameter 21195 , S = kt(l.messageCompiler) ? l.messageCompiler : py 21196 , x = kt(l.messageResolver) ? l.messageResolver : gy || H4 21197 , P = kt(l.localeFallbacker) ? l.localeFallbacker : my || L4 21198 , C = at(l.fallbackContext) ? l.fallbackContext : void 0 21199 , T = l 21200 , k = at(T.__datetimeFormatters) ? T.__datetimeFormatters : new Map 21201 , D = at(T.__numberFormatters) ? T.__numberFormatters : new Map 21202 , I = at(T.__meta) ? T.__meta : {}; 21203 $p++; 21204 const F = { 21205 version: t, 21206 cid: $p, 21207 locale: n, 21208 fallbackLocale: o, 21209 messages: i, 21210 modifiers: d, 21211 pluralRules: u, 21212 missing: h, 21213 missingWarn: c, 21214 fallbackWarn: f, 21215 fallbackFormat: p, 21216 unresolving: g, 21217 postTranslation: y, 21218 processor: m, 21219 warnHtmlMessage: b, 21220 escapeParameter: M, 21221 messageCompiler: S, 21222 messageResolver: x, 21223 localeFallbacker: P, 21224 fallbackContext: C, 21225 onWarn: e, 21226 __meta: I 21227 }; 21228 return F.datetimeFormats = r, 21229 F.numberFormats = a, 21230 F.__datetimeFormatters = k, 21231 F.__numberFormatters = D, 21232 __INTLIFY_PROD_DEVTOOLS__ && D4(F, t, I), 21233 F 21234} 21235const Ju = l=>({ 21236 [l]: ht() 21237}); 21238function Sf(l, e, t, n, s) { 21239 const {missing: o, onWarn: i} = l; 21240 if (o !== null) { 21241 const r = o(l, t, e, s); 21242 return ge(r) ? r : e 21243 } else 21244 return e 21245} 21246function zi(l, e, t) { 21247 const n = l; 21248 n.__localeChainCache = new Map, 21249 l.localeFallbacker(l, t, e) 21250} 21251function e5(l, e) { 21252 return l === e ? !1 : l.split("-")[0] === e.split("-")[0] 21253} 21254function t5(l, e) { 21255 const t = e.indexOf(l); 21256 if (t === -1) 21257 return !1; 21258 for (let n = t + 1; n < e.length; n++) 21259 if (e5(l, e[n])) 21260 return !0; 21261 return !1 21262} 21263function Xp(l, ...e) { 21264 const {datetimeFormats: t, unresolving: n, fallbackLocale: s, onWarn: o, localeFallbacker: i} = l 21265 , {__datetimeFormatters: r} = l; 21266 if (!ge(e[0]) && !ny(e[0]) && !Rt(e[0])) 21267 return ad; 21268 const [a,d,u,h] = ic(...e) 21269 , c = Pt(u.missingWarn) ? u.missingWarn : l.missingWarn; 21270 Pt(u.fallbackWarn) ? u.fallbackWarn : l.fallbackWarn; 21271 const f = !!u.part 21272 , p = Mf(l, u) 21273 , g = i(l, s, p); 21274 if (!ge(a) || a === "") 21275 return new Intl.DateTimeFormat(p.replace(/!/g, ""),h).format(d); 21276 let y = {}, m, b = null; 21277 const M = "datetime format"; 21278 for (let P = 0; P < g.length && (m = g[P], 21279 y = t[m] || {}, 21280 b = y[a], 21281 !st(b)); P++) 21282 Sf(l, a, m, c, M); 21283 if (!st(b) || !ge(m)) 21284 return n ? au : a; 21285 let S = `${m}__${a}`; 21286 iu(h) || (S = `${S}__${JSON.stringify(h)}`); 21287 let x = r.get(S); 21288 return x || (x = new Intl.DateTimeFormat(m,Yt({}, b, h)), 21289 r.set(S, x)), 21290 f ? x.formatToParts(d) : x.format(d) 21291} 21292const by = ["localeMatcher", "weekday", "era", "year", "month", "day", "hour", "minute", "second", "timeZoneName", "formatMatcher", "hour12", "timeZone", "dateStyle", "timeStyle", "calendar", "dayPeriod", "numberingSystem", "hourCycle", "fractionalSecondDigits"]; 21293function ic(...l) { 21294 const [e,t,n,s] = l 21295 , o = ht(); 21296 let i = ht(), r; 21297 if (ge(e)) { 21298 const a = e.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/); 21299 if (!a) 21300 throw es(Qn.INVALID_ISO_DATE_ARGUMENT); 21301 const d = a[3] ? a[3].trim().startsWith("T") ? `${a[1].trim()}${a[3].trim()}` : `${a[1].trim()}T${a[3].trim()}` : a[1].trim(); 21302 r = new Date(d); 21303 try { 21304 r.toISOString() 21305 } catch { 21306 throw es(Qn.INVALID_ISO_DATE_ARGUMENT) 21307 } 21308 } else if (ny(e)) { 21309 if (isNaN(e.getTime())) 21310 throw es(Qn.INVALID_DATE_ARGUMENT); 21311 r = e 21312 } else if (Rt(e)) 21313 r = e; 21314 else 21315 throw es(Qn.INVALID_ARGUMENT); 21316 return ge(t) ? o.key = t : st(t) && Object.keys(t).forEach(a=>{ 21317 by.includes(a) ? i[a] = t[a] : o[a] = t[a] 21318 } 21319 ), 21320 ge(n) ? o.locale = n : st(n) && (i = n), 21321 st(s) && (i = s), 21322 [o.key || "", r, o, i] 21323} 21324function Yp(l, e, t) { 21325 const n = l; 21326 for (const s in t) { 21327 const o = `${e}__${s}`; 21328 n.__datetimeFormatters.has(o) && n.__datetimeFormatters.delete(o) 21329 } 21330} 21331function Kp(l, ...e) { 21332 const {numberFormats: t, unresolving: n, fallbackLocale: s, onWarn: o, localeFallbacker: i} = l 21333 , {__numberFormatters: r} = l; 21334 if (!Rt(e[0])) 21335 return ad; 21336 const [a,d,u,h] = rc(...e) 21337 , c = Pt(u.missingWarn) ? u.missingWarn : l.missingWarn; 21338 Pt(u.fallbackWarn) ? u.fallbackWarn : l.fallbackWarn; 21339 const f = !!u.part 21340 , p = Mf(l, u) 21341 , g = i(l, s, p); 21342 if (!ge(a) || a === "") 21343 return new Intl.NumberFormat(p.replace(/!/g, ""),h).format(d); 21344 let y = {}, m, b = null; 21345 const M = "number format"; 21346 for (let P = 0; P < g.length && (m = g[P], 21347 y = t[m] || {}, 21348 b = y[a], 21349 !st(b)); P++) 21350 Sf(l, a, m, c, M); 21351 if (!st(b) || !ge(m)) 21352 return n ? au : a; 21353 let S = `${m}__${a}`; 21354 iu(h) || (S = `${S}__${JSON.stringify(h)}`); 21355 let x = r.get(S); 21356 return x || (x = new Intl.NumberFormat(m,Yt({}, b, h)), 21357 r.set(S, x)), 21358 f ? x.formatToParts(d) : x.format(d) 21359} 21360const My = ["localeMatcher", "style", "currency", "currencyDisplay", "currencySign", "useGrouping", "minimumIntegerDigits", "minimumFractionDigits", "maximumFractionDigits", "minimumSignificantDigits", "maximumSignificantDigits", "compactDisplay", "notation", "signDisplay", "unit", "unitDisplay", "roundingMode", "roundingPriority", "roundingIncrement", "trailingZeroDisplay"]; 21361function rc(...l) { 21362 const [e,t,n,s] = l 21363 , o = ht(); 21364 let i = ht(); 21365 if (!Rt(e)) 21366 throw es(Qn.INVALID_ARGUMENT); 21367 const r = e; 21368 return ge(t) ? o.key = t : st(t) && Object.keys(t).forEach(a=>{ 21369 My.includes(a) ? i[a] = t[a] : o[a] = t[a] 21370 } 21371 ), 21372 ge(n) ? o.locale = n : st(n) && (i = n), 21373 st(s) && (i = s), 21374 [o.key || "", r, o, i] 21375} 21376function Wp(l, e, t) { 21377 const n = l; 21378 for (const s in t) { 21379 const o = `${e}__${s}`; 21380 n.__numberFormatters.has(o) && n.__numberFormatters.delete(o) 21381 } 21382} 21383const l5 = l=>l 21384 , n5 = l=>"" 21385 , s5 = "text" 21386 , o5 = l=>l.length === 0 ? "" : yf(l) 21387 , i5 = X3; 21388function Zu(l, e) { 21389 return l = Math.abs(l), 21390 e === 2 ? l === 1 ? 0 : 1 : Math.min(l, 2) 21391} 21392function r5(l) { 21393 const e = Rt(l.pluralIndex) ? l.pluralIndex : -1; 21394 return Rt(l.named?.count) ? l.named.count : Rt(l.named?.n) ? l.named.n : e 21395} 21396function a5(l={}) { 21397 const e = l.locale 21398 , t = r5(l) 21399 , n = ge(e) && kt(l.pluralRules?.[e]) ? l.pluralRules[e] : Zu 21400 , s = n === Zu ? void 0 : Zu 21401 , o = m=>m[n(t, m.length, s)] 21402 , i = l.list || [] 21403 , r = m=>i[m] 21404 , a = l.named || ht(); 21405 Rt(l.pluralIndex) && (a.count ||= l.pluralIndex, 21406 a.n ||= l.pluralIndex); 21407 const d = m=>a[m]; 21408 function u(m, b) { 21409 const M = kt(l.messages) ? l.messages(m, !!b) : at(l.messages) ? l.messages[m] : !1; 21410 return M || (l.parent ? l.parent.message(m) : n5) 21411 } 21412 const h = m=>l.modifiers ? l.modifiers[m] : l5 21413 , c = kt(l.processor?.normalize) ? l.processor.normalize : o5 21414 , f = kt(l.processor?.interpolate) ? l.processor.interpolate : i5 21415 , p = ge(l.processor?.type) ? l.processor.type : s5 21416 , y = { 21417 list: r, 21418 named: d, 21419 plural: o, 21420 linked: (m,...b)=>{ 21421 const [M,S] = b; 21422 let x = "text" 21423 , P = ""; 21424 b.length === 1 ? at(M) ? (P = M.modifier || P, 21425 x = M.type || x) : ge(M) && (P = M || P) : b.length === 2 && (ge(M) && (P = M || P), 21426 ge(S) && (x = S || x)); 21427 const C = u(m, !0)(y) 21428 , T = C === "" || C === void 0 ? m : C 21429 , k = x === "vnode" && Ot(T) && P ? T[0] : T; 21430 return P ? h(P)(k, x) : k 21431 } 21432 , 21433 message: u, 21434 type: p, 21435 interpolate: f, 21436 normalize: c, 21437 values: Yt(ht(), i, a) 21438 }; 21439 return y 21440} 21441const qp = ()=>"" 21442 , zl = l=>kt(l); 21443function jp(l, ...e) { 21444 const {fallbackFormat: t, postTranslation: n, unresolving: s, messageCompiler: o, fallbackLocale: i, messages: r} = l 21445 , [a,d] = ac(...e) 21446 , u = Pt(d.missingWarn) ? d.missingWarn : l.missingWarn 21447 , h = Pt(d.fallbackWarn) ? d.fallbackWarn : l.fallbackWarn 21448 , c = Pt(d.escapeParameter) ? d.escapeParameter : l.escapeParameter 21449 , f = !!d.resolvedMessage 21450 , p = ge(d.default) || Pt(d.default) ? Pt(d.default) ? o ? a : ()=>a : d.default : t ? o ? a : ()=>a : null 21451 , g = t || p != null && (ge(p) || kt(p)) 21452 , y = Mf(l, d); 21453 c && d5(d); 21454 let[m,b,M] = f ? [a, y, r[y] || ht()] : Sy(l, a, y, i, h, u) 21455 , S = m 21456 , x = a; 21457 if (!f && !(ge(S) || In(S) || zl(S)) && g && (S = p, 21458 x = S), 21459 !f && (!(ge(S) || In(S) || zl(S)) || !ge(b))) 21460 return s ? au : a; 21461 let P = !1; 21462 const C = ()=>{ 21463 P = !0 21464 }
vendor: 5,086 bytes, lines 21465-21647
21465 , T = zl(S) ? S : wy(l, a, b, S, x, C); 21466 if (P) 21467 return S; 21468 const k = c5(l, b, M, d) 21469 , D = a5(k) 21470 , I = u5(l, T, D); 21471 let F = n ? n(I, a) : I; 21472 if (c && ge(F) && (F = G3(F)), 21473 __INTLIFY_PROD_DEVTOOLS__) { 21474 const Y = { 21475 timestamp: Date.now(), 21476 key: ge(a) ? a : zl(S) ? S.key : "", 21477 locale: b || (zl(S) ? S.locale : ""), 21478 format: ge(S) ? S : zl(S) ? S.source : "", 21479 message: F 21480 }; 21481 Y.meta = Yt({}, l.__meta, J4() || {}), 21482 O4(Y) 21483 } 21484 return F 21485} 21486function d5(l) { 21487 Ot(l.list) ? l.list = l.list.map(e=>ge(e) ? Ip(e) : e) : at(l.named) && Object.keys(l.named).forEach(e=>{ 21488 ge(l.named[e]) && (l.named[e] = Ip(l.named[e])) 21489 } 21490 ) 21491} 21492function Sy(l, e, t, n, s, o) { 21493 const {messages: i, onWarn: r, messageResolver: a, localeFallbacker: d} = l 21494 , u = d(l, n, t); 21495 let h = ht(), c, f = null; 21496 const p = "translate"; 21497 for (let g = 0; g < u.length && (c = u[g], 21498 h = i[c] || ht(), 21499 (f = a(h, e)) === null && (f = h[e]), 21500 !(ge(f) || In(f) || zl(f))); g++) 21501 if (!t5(c, u)) { 21502 const y = Sf(l, e, c, o, p); 21503 y !== e && (f = y) 21504 } 21505 return [f, c, h] 21506} 21507function wy(l, e, t, n, s, o) { 21508 const {messageCompiler: i, warnHtmlMessage: r} = l; 21509 if (zl(n)) { 21510 const d = n; 21511 return d.locale = d.locale || t, 21512 d.key = d.key || e, 21513 d 21514 } 21515 if (i == null) { 21516 const d = (()=>n); 21517 return d.locale = t, 21518 d.key = e, 21519 d 21520 } 21521 const a = i(n, h5(l, t, s, n, r, o)); 21522 return a.locale = t, 21523 a.key = e, 21524 a.source = n, 21525 a 21526} 21527function u5(l, e, t) { 21528 return e(t) 21529} 21530function ac(...l) { 21531 const [e,t,n] = l 21532 , s = ht(); 21533 if (!ge(e) && !Rt(e) && !zl(e) && !In(e)) 21534 throw es(Qn.INVALID_ARGUMENT); 21535 const o = Rt(e) ? String(e) : (zl(e), 21536 e); 21537 return Rt(t) ? s.plural = t : ge(t) ? s.default = t : st(t) && !iu(t) ? s.named = t : Ot(t) && (s.list = t), 21538 Rt(n) ? s.plural = n : ge(n) ? s.default = n : st(n) && Yt(s, n), 21539 [o, s] 21540} 21541function h5(l, e, t, n, s, o) { 21542 return { 21543 locale: e, 21544 key: t, 21545 warnHtmlMessage: s, 21546 onError: i=>{ 21547 throw o && o(i), 21548 i 21549 } 21550 , 21551 onCacheKey: i=>B3(e, t, i) 21552 } 21553} 21554function c5(l, e, t, n) { 21555 const {modifiers: s, pluralRules: o, messageResolver: i, fallbackLocale: r, fallbackWarn: a, missingWarn: d, fallbackContext: u} = l 21556 , c = { 21557 locale: e, 21558 modifiers: s, 21559 pluralRules: o, 21560 messages: (f,p)=>{ 21561 let g = i(t, f); 21562 if (g == null && (u || p)) { 21563 const [y,,m] = Sy(u || l, f, e, r, a, d); 21564 g = y ?? i(m, f) 21565 } 21566 if (ge(g) || In(g)) { 21567 let y = !1; 21568 const b = wy(l, f, e, g, f, ()=>{ 21569 y = !0 21570 } 21571 ); 21572 return y ? qp : b 21573 } else 21574 return zl(g) ? g : qp 21575 } 21576 }; 21577 return l.processor && (c.processor = l.processor), 21578 n.list && (c.list = n.list), 21579 n.named && (c.named = n.named), 21580 Rt(n.plural) && (c.pluralIndex = n.plural), 21581 c 21582} 21583v4(); 21584/*! 21585 * vue-i18n v11.3.1 21586 * (c) 2026 kazuya kawaguchi 21587 * Released under the MIT License. 21588 */ 21589const f5 = "11.3.1"; 21590function p5() { 21591 typeof __INTLIFY_PROD_DEVTOOLS__ != "boolean" && (gf().__INTLIFY_PROD_DEVTOOLS__ = !1) 21592} 21593const Zl = { 21594 UNEXPECTED_RETURN_TYPE: I4, 21595 INVALID_ARGUMENT: 25, 21596 MUST_BE_CALL_SETUP_TOP: 26, 21597 NOT_INSTALLED: 27, 21598 REQUIRED_VALUE: 28, 21599 INVALID_VALUE: 29, 21600 NOT_INSTALLED_WITH_PROVIDE: 31, 21601 UNEXPECTED_ERROR: 32 21602}; 21603function cn(l, ...e) { 21604 return ru(l, null, void 0) 21605} 21606const dc = Ys("__translateVNode") 21607 , uc = Ys("__datetimeParts") 21608 , hc = Ys("__numberParts") 21609 , g5 = Ys("__setPluralRules") 21610 , m5 = Ys("__injectWithOption") 21611 , cc = Ys("__dispose"); 21612function Fr(l) { 21613 if (!at(l) || In(l)) 21614 return l; 21615 for (const e in l) 21616 if ($l(l, e)) 21617 if (!e.includes(".")) 21618 at(l[e]) && Fr(l[e]); 21619 else { 21620 const t = e.split(".") 21621 , n = t.length - 1; 21622 let s = l 21623 , o = !1; 21624 for (let i = 0; i < n; i++) { 21625 if (t[i] === "__proto__") 21626 throw new Error(`unsafe key: ${t[i]}`); 21627 if (t[i]in s || (s[t[i]] = ht()), 21628 !at(s[t[i]])) { 21629 o = !0; 21630 break 21631 } 21632 s = s[t[i]] 21633 } 21634 if (o || (In(s) ? fy.includes(t[n]) || delete l[e] : (s[t[n]] = l[e], 21635 delete l[e])), 21636 !In(s)) { 21637 const i = s[t[n]]; 21638 at(i) && Fr(i) 21639 } 21640 } 21641 return l 21642} 21643function Py(l, e) { 21644 const {messages: t, __i18n: n, messageResolver: s, flatJson: o} = e 21645 , i = st(t) ? t : Ot(n) ? ht() : { 21646 [l]: ht() 21647 };
21648 if (Ot(n) && n.forEach(r=>{ 21649 if ("locale"in r && "resource"in r) { 21650 const {locale: a, resource: d} = r; 21651 a ? (i[a] = i[a] || ht(), 21652 Fa(d, i[a])) : Fa(d, i) 21653 } else 21654 ge(r) && Fa(JSON.parse(r), i) 21655 } 21656 ), 21657 s == null && o) 21658 for (const r in i) 21659 $l(i, r) && Fr(i[r]); 21660 return i 21661} 21662function xy(l) { 21663 return l.type 21664} 21665function y5(l, e, t) { 21666 let n = at(e.messages) ? e.messages : ht(); 21667 "__i18nGlobal"in t && (n = Py(l.locale.value, { 21668 messages: n, 21669 __i18n: t.__i18nGlobal 21670 })); 21671 const s = Object.keys(n); 21672 s.length && s.forEach(o=>{ 21673 l.mergeLocaleMessage(o, n[o]) 21674 } 21675 ); 21676 { 21677 if (at(e.datetimeFormats)) { 21678 const o = Object.keys(e.datetimeFormats); 21679 o.length && o.forEach(i=>{ 21680 l.mergeDateTimeFormat(i, e.datetimeFormats[i]) 21681 } 21682 ) 21683 } 21684 if (at(e.numberFormats)) { 21685 const o = Object.keys(e.numberFormats); 21686 o.length && o.forEach(i=>{ 21687 l.mergeNumberFormat(i, e.numberFormats[i]) 21688 } 21689 ) 21690 } 21691 } 21692} 21693function Jp(l) { 21694 return w(Kr, null, l, 0) 21695} 21696function wf() { 21697 return Ti() 21698} 21699const Zp = "__INTLIFY_META__" 21700 , Qp = ()=>[] 21701 , v5 = ()=>!1; 21702let eg = 0; 21703function tg(l) { 21704 return ((e,t,n,s)=>l(t, n, wf() || void 0, s)) 21705} 21706const b5 = ()=>{ 21707 const l = wf(); 21708 let e = null; 21709 return l && (e = xy(l)[Zp]) ? { 21710 [Zp]: e 21711 } : null 21712} 21713; 21714function Cy(l={}) { 21715 const {__root: e, __injectWithOption: t} = l 21716 , n = e === void 0 21717 , s = l.flatJson 21718 , o = od ? Nd : ns; 21719 let i = Pt(l.inheritLocale) ? l.inheritLocale : !0; 21720 const r = o(e && i ? e.locale.value : ge(l.locale) ? l.locale : rd) 21721 , a = o(e && i ? e.fallbackLocale.value : ge(l.fallbackLocale) || Ot(l.fallbackLocale) || st(l.fallbackLocale) || l.fallbackLocale === !1 ? l.fallbackLocale : r.value) 21722 , d = o(Py(r.value, l)) 21723 , u = o(st(l.datetimeFormats) ? l.datetimeFormats : { 21724 [r.value]: {} 21725 }) 21726 , h = o(st(l.numberFormats) ? l.numberFormats : { 21727 [r.value]: {} 21728 }); 21729 let c = e ? e.missingWarn : Pt(l.missingWarn) || id(l.missingWarn) ? l.missingWarn : !0 21730 , f = e ? e.fallbackWarn : Pt(l.fallbackWarn) || id(l.fallbackWarn) ? l.fallbackWarn : !0 21731 , p = e ? e.fallbackRoot : Pt(l.fallbackRoot) ? l.fallbackRoot : !0 21732 , g = !!l.fallbackFormat 21733 , y = kt(l.missing) ? l.missing : null 21734 , m = kt(l.missing) ? tg(l.missing) : null 21735 , b = kt(l.postTranslation) ? l.postTranslation : null 21736 , M = e ? e.warnHtmlMessage : Pt(l.warnHtmlMessage) ? l.warnHtmlMessage : !0 21737 , S = !!l.escapeParameter; 21738 const x = e ? e.modifiers : st(l.modifiers) ? l.modifiers : {}; 21739 let P = l.pluralRules || e && e.pluralRules, C; 21740 C = (()=>{ 21741 n && Hp(null); 21742 const H = { 21743 version: f5, 21744 locale: r.value, 21745 fallbackLocale: a.value, 21746 messages: d.value, 21747 modifiers: x, 21748 pluralRules: P, 21749 missing: m === null ? void 0 : m, 21750 missingWarn: c, 21751 fallbackWarn: f, 21752 fallbackFormat: g, 21753 unresolving: !0, 21754 postTranslation: b === null ? void 0 : b, 21755 warnHtmlMessage: M, 21756 escapeParameter: S, 21757 messageResolver: l.messageResolver, 21758 messageCompiler: l.messageCompiler, 21759 __meta: { 21760 framework: "vue" 21761 } 21762 }; 21763 H.datetimeFormats = u.value, 21764 H.numberFormats = h.value, 21765 H.__datetimeFormatters = st(C) ? C.__datetimeFormatters : void 0, 21766 H.__numberFormatters = st(C) ? C.__numberFormatters : void 0; 21767 const W = Q4(H); 21768 return n && Hp(W), 21769 W 21770 } 21771 )(), 21772 zi(C, r.value, a.value); 21773 function k() { 21774 return [r.value, a.value, d.value, u.value, h.value] 21775 } 21776 const D = So({ 21777 get: ()=>r.value, 21778 set: H=>{ 21779 C.locale = H, 21780 r.value = H 21781 } 21782 }) 21783 , I = So({ 21784 get: ()=>a.value, 21785 set: H=>{ 21786 C.fallbackLocale = H, 21787 a.value = H, 21788 zi(C, r.value, H) 21789 } 21790 }) 21791 , F = So(()=>d.value) 21792 , Y = So(()=>u.value) 21793 , q = So(()=>h.value); 21794 function re() { 21795 return kt(b) ? b : null 21796 } 21797 function ne(H) { 21798 b = H, 21799 C.postTranslation = H 21800 } 21801 function te() { 21802 return y 21803 } 21804 function he(H) { 21805 H !== null && (m = tg(H)), 21806 y = H,
21807 C.missing = m 21808 } 21809 const Me = (H,W,fe,we,Fe,We)=>{ 21810 k(); 21811 let Ye; 21812 try { 21813 __INTLIFY_PROD_DEVTOOLS__, 21814 n || (C.fallbackContext = e ? Z4() : void 0), 21815 Ye = H(C) 21816 } finally { 21817 __INTLIFY_PROD_DEVTOOLS__, 21818 n || (C.fallbackContext = void 0) 21819 } 21820 if (fe !== "translate exists" && Rt(Ye) && Ye === au || fe === "translate exists" && !Ye) { 21821 const [Vt,al] = W(); 21822 return e && p ? we(e) : Fe(Vt) 21823 } else { 21824 if (We(Ye)) 21825 return Ye; 21826 throw cn(Zl.UNEXPECTED_RETURN_TYPE) 21827 } 21828 } 21829 ; 21830 function De(...H) { 21831 return Me(W=>Reflect.apply(jp, null, [W, ...H]), ()=>ac(...H), "translate", W=>Reflect.apply(W.t, W, [...H]), W=>W, W=>ge(W)) 21832 } 21833 function ye(...H) { 21834 const [W,fe,we] = H; 21835 if (we && !at(we)) 21836 throw cn(Zl.INVALID_ARGUMENT); 21837 return De(W, fe, Yt({ 21838 resolvedMessage: !0 21839 }, we || {})) 21840 } 21841 function _e(...H) { 21842 return Me(W=>Reflect.apply(Xp, null, [W, ...H]), ()=>ic(...H), "datetime format", W=>Reflect.apply(W.d, W, [...H]), ()=>ad, W=>ge(W) || Ot(W)) 21843 } 21844 function Ge(...H) { 21845 return Me(W=>Reflect.apply(Kp, null, [W, ...H]), ()=>rc(...H), "number format", W=>Reflect.apply(W.n, W, [...H]), ()=>ad, W=>ge(W) || Ot(W)) 21846 } 21847 function $e(H) { 21848 return H.map(W=>ge(W) || Rt(W) || Pt(W) ? Jp(String(W)) : W) 21849 } 21850 const Be = { 21851 normalize: $e, 21852 interpolate: H=>H, 21853 type: "vnode" 21854 }; 21855 function Ze(...H) { 21856 return Me(W=>{ 21857 let fe; 21858 const we = W; 21859 try { 21860 we.processor = Be, 21861 fe = Reflect.apply(jp, null, [we, ...H]) 21862 } finally { 21863 we.processor = null 21864 } 21865 return fe 21866 } 21867 , ()=>ac(...H), "translate", W=>W[dc](...H), W=>[Jp(W)], W=>Ot(W)) 21868 } 21869 function Xe(...H) { 21870 return Me(W=>Reflect.apply(Kp, null, [W, ...H]), ()=>rc(...H), "number format", W=>W[hc](...H), Qp, W=>ge(W) || Ot(W)) 21871 } 21872 function dt(...H) { 21873 return Me(W=>Reflect.apply(Xp, null, [W, ...H]), ()=>ic(...H), "datetime format", W=>W[uc](...H), Qp, W=>ge(W) || Ot(W)) 21874 } 21875 function Qe(H) { 21876 P = H, 21877 C.pluralRules = P 21878 } 21879 function Ct(H, W) { 21880 return Me(()=>{ 21881 if (!H) 21882 return !1; 21883 const fe = ge(W) ? W : r.value 21884 , we = ge(W) ? [fe] : oc(C, a.value, fe); 21885 for (let Fe = 0; Fe < we.length; Fe++) { 21886 const We = K(we[Fe]); 21887 let Ye = C.messageResolver(We, H); 21888 if (Ye === null && (Ye = We[H]), 21889 In(Ye) || zl(Ye) || ge(Ye)) 21890 return !0 21891 } 21892 return !1 21893 } 21894 , ()=>[H], "translate exists", fe=>Reflect.apply(fe.te, fe, [H, W]), v5, fe=>Pt(fe)) 21895 }
21896 function R(H) { 21897 let W = null; 21898 const fe = oc(C, a.value, r.value); 21899 for (let we = 0; we < fe.length; we++) { 21900 const Fe = d.value[fe[we]] || {} 21901 , We = C.messageResolver(Fe, H); 21902 if (We != null) { 21903 W = We; 21904 break 21905 } 21906 } 21907 return W 21908 } 21909 function U(H) { 21910 const W = R(H); 21911 return W ?? (e ? e.tm(H) || {} : {}) 21912 } 21913 function K(H) { 21914 return d.value[H] || {} 21915 } 21916 function Q(H, W) { 21917 if (s) { 21918 const fe = { 21919 [H]: W 21920 }; 21921 for (const we in fe) 21922 $l(fe, we) && Fr(fe[we]); 21923 W = fe[H] 21924 } 21925 d.value[H] = W, 21926 C.messages = d.value 21927 } 21928 function J(H, W) { 21929 d.value[H] = d.value[H] || {}; 21930 const fe = { 21931 [H]: W 21932 }; 21933 if (s) 21934 for (const we in fe) 21935 $l(fe, we) && Fr(fe[we]); 21936 W = fe[H], 21937 Fa(W, d.value[H]), 21938 C.messages = d.value 21939 } 21940 function le(H) { 21941 return u.value[H] || {} 21942 } 21943 function A(H, W) { 21944 u.value[H] = W, 21945 C.datetimeFormats = u.value, 21946 Yp(C, H, W) 21947 } 21948 function L(H, W) { 21949 u.value[H] = Yt(u.value[H] || {}, W), 21950 C.datetimeFormats = u.value, 21951 Yp(C, H, W) 21952 } 21953 function G(H) { 21954 return h.value[H] || {} 21955 } 21956 function X(H, W) { 21957 h.value[H] = W, 21958 C.numberFormats = h.value, 21959 Wp(C, H, W) 21960 } 21961 function ue(H, W) { 21962 h.value[H] = Yt(h.value[H] || {}, W), 21963 C.numberFormats = h.value, 21964 Wp(C, H, W) 21965 } 21966 eg++, 21967 e && od && (Ie(e.locale, H=>{ 21968 i && (r.value = H, 21969 C.locale = H, 21970 zi(C, r.value, a.value)) 21971 } 21972 ), 21973 Ie(e.fallbackLocale, H=>{ 21974 i && (a.value = H, 21975 C.fallbackLocale = H, 21976 zi(C, r.value, a.value)) 21977 } 21978 )); 21979 const Z = { 21980 id: eg, 21981 locale: D, 21982 fallbackLocale: I, 21983 get inheritLocale() { 21984 return i 21985 }, 21986 set inheritLocale(H) { 21987 i = H, 21988 H && e && (r.value = e.locale.value, 21989 a.value = e.fallbackLocale.value, 21990 zi(C, r.value, a.value)) 21991 }, 21992 get availableLocales() { 21993 return Object.keys(d.value).sort() 21994 }, 21995 messages: F, 21996 get modifiers() { 21997 return x 21998 }, 21999 get pluralRules() { 22000 return P || {} 22001 }, 22002 get isGlobal() { 22003 return n 22004 }, 22005 get missingWarn() { 22006 return c 22007 }, 22008 set missingWarn(H) { 22009 c = H, 22010 C.missingWarn = c 22011 }, 22012 get fallbackWarn() { 22013 return f 22014 }, 22015 set fallbackWarn(H) { 22016 f = H, 22017 C.fallbackWarn = f 22018 }, 22019 get fallbackRoot() { 22020 return p 22021 }, 22022 set fallbackRoot(H) { 22023 p = H 22024 }, 22025 get fallbackFormat() { 22026 return g 22027 }, 22028 set fallbackFormat(H) { 22029 g = H, 22030 C.fallbackFormat = g 22031 }, 22032 get warnHtmlMessage() { 22033 return M 22034 }, 22035 set warnHtmlMessage(H) { 22036 M = H, 22037 C.warnHtmlMessage = H 22038 }, 22039 get escapeParameter() { 22040 return S 22041 }, 22042 set escapeParameter(H) { 22043 S = H, 22044 C.escapeParameter = H 22045 }, 22046 t: De, 22047 getLocaleMessage: K, 22048 setLocaleMessage: Q, 22049 mergeLocaleMessage: J, 22050 getPostTranslationHandler: re, 22051 setPostTranslationHandler: ne, 22052 getMissingHandler: te, 22053 setMissingHandler: he, 22054 [g5]: Qe 22055 }; 22056 return Z.datetimeFormats = Y, 22057 Z.numberFormats = q, 22058 Z.rt = ye, 22059 Z.te = Ct, 22060 Z.tm = U, 22061 Z.d = _e, 22062 Z.n = Ge, 22063 Z.getDateTimeFormat = le, 22064 Z.setDateTimeFormat = A, 22065 Z.mergeDateTimeFormat = L, 22066 Z.getNumberFormat = G, 22067 Z.setNumberFormat = X, 22068 Z.mergeNumberFormat = ue, 22069 Z[m5] = t, 22070 Z[dc] = Ze, 22071 Z[uc] = dt, 22072 Z[hc] = Xe, 22073 Z 22074} 22075const Pf = { 22076 tag: { 22077 type: [String, Object] 22078 }, 22079 locale: { 22080 type: String 22081 }, 22082 scope: { 22083 type: String, 22084 validator: l=>l === "parent" || l === "global", 22085 default: "parent" 22086 }, 22087 i18n: { 22088 type: Object 22089 } 22090}; 22091function M5({slots: l}, e) { 22092 return e.length === 1 && e[0] === "default" ? (l.default ? l.default() : []).reduce((n,s)=>[...n, ...s.type === Pe ? s.children : [s]], []) : e.reduce((t,n)=>{ 22093 const s = l[n]; 22094 return s && (t[n] = s()), 22095 t 22096 } 22097 , ht()) 22098} 22099function _y() { 22100 return Pe 22101} 22102const S5 = Fd({ 22103 name: "i18n-t", 22104 props: Yt({ 22105 keypath: { 22106 type: String, 22107 required: !0 22108 }, 22109 plural: { 22110 type: [Number, String], 22111 validator: l=>Rt(l) || !isNaN(l) 22112 } 22113 }, Pf), 22114 setup(l, e) { 22115 const {slots: t, attrs: n} = e 22116 , s = l.i18n || xf({ 22117 useScope: l.scope, 22118 __useComponent: !0 22119 }); 22120 return ()=>{ 22121 const o = Object.keys(t).filter(h=>h[0] !== "_") 22122 , i = ht(); 22123 l.locale && (i.locale = l.locale), 22124 l.plural !== void 0 && (i.plural = ge(l.plural) ? +l.plural : l.plural); 22125 const r = M5(e, o)
22126 , a = s[dc](l.keypath, r, i) 22127 , d = Yt(ht(), n) 22128 , u = ge(l.tag) || at(l.tag) ? l.tag : _y(); 22129 return Xd(u, d, a) 22130 } 22131 } 22132}) 22133 , lg = S5; 22134function w5(l) { 22135 return Ot(l) && !ge(l[0]) 22136} 22137function Ty(l, e, t, n) { 22138 const {slots: s, attrs: o} = e; 22139 return ()=>{ 22140 const i = { 22141 part: !0 22142 }; 22143 let r = ht(); 22144 l.locale && (i.locale = l.locale), 22145 ge(l.format) ? i.key = l.format : at(l.format) && (ge(l.format.key) && (i.key = l.format.key), 22146 r = Object.keys(l.format).reduce((c,f)=>t.includes(f) ? Yt(ht(), c, { 22147 [f]: l.format[f] 22148 }) : c, ht())); 22149 const a = n(l.value, i, r); 22150 let d = [i.key]; 22151 Ot(a) ? d = a.map((c,f)=>{ 22152 const p = s[c.type] 22153 , g = p ? p({ 22154 [c.type]: c.value, 22155 index: f, 22156 parts: a 22157 }) : [c.value]; 22158 return w5(g) && (g[0].key = `${c.type}-${f}`), 22159 g 22160 } 22161 ) : ge(a) && (d = [a]); 22162 const u = Yt(ht(), o) 22163 , h = ge(l.tag) || at(l.tag) ? l.tag : _y(); 22164 return Xd(h, u, d) 22165 } 22166} 22167const P5 = Fd({ 22168 name: "i18n-n", 22169 props: Yt({ 22170 value: { 22171 type: Number, 22172 required: !0 22173 }, 22174 format: { 22175 type: [String, Object] 22176 } 22177 }, Pf), 22178 setup(l, e) { 22179 const t = l.i18n || xf({ 22180 useScope: l.scope, 22181 __useComponent: !0 22182 }); 22183 return Ty(l, e, My, (...n)=>t[hc](...n)) 22184 } 22185}) 22186 , ng = P5; 22187function x5(l, e) { 22188 const t = l; 22189 if (l.mode === "composition") 22190 return t.__getInstance(e) || l.global; 22191 { 22192 const n = t.__getInstance(e); 22193 return n != null ? n.__composer : l.global.__composer 22194 } 22195} 22196function C5(l) { 22197 const e = i=>{ 22198 const {instance: r, value: a} = i; 22199 if (!r || !r.$) 22200 throw cn(Zl.UNEXPECTED_ERROR); 22201 const d = x5(l, r.$) 22202 , u = sg(a); 22203 return [Reflect.apply(d.t, d, [...og(u)]), d] 22204 } 22205 ; 22206 return { 22207 created: (i,r)=>{ 22208 const [a,d] = e(r); 22209 od && (i.__i18nWatcher = Ie(d.locale, ()=>{ 22210 r.instance && r.instance.$forceUpdate() 22211 } 22212 )), 22213 i.__composer = d, 22214 i.textContent = a 22215 } 22216 , 22217 unmounted: i=>{ 22218 od && i.__i18nWatcher && (i.__i18nWatcher(), 22219 i.__i18nWatcher = void 0, 22220 delete i.__i18nWatcher), 22221 i.__composer && (i.__composer = void 0, 22222 delete i.__composer) 22223 } 22224 , 22225 beforeUpdate: (i,{value: r})=>{ 22226 if (i.__composer) { 22227 const a = i.__composer 22228 , d = sg(r); 22229 i.textContent = Reflect.apply(a.t, a, [...og(d)]) 22230 } 22231 } 22232 , 22233 getSSRProps: i=>{ 22234 const [r] = e(i); 22235 return { 22236 textContent: r 22237 } 22238 } 22239 } 22240} 22241function sg(l) { 22242 if (ge(l)) 22243 return { 22244 path: l 22245 }; 22246 if (st(l)) { 22247 if (!("path"in l)) 22248 throw cn(Zl.REQUIRED_VALUE, "path"); 22249 return l 22250 } else 22251 throw cn(Zl.INVALID_VALUE) 22252} 22253function og(l) { 22254 const {path: e, locale: t, args: n, choice: s, plural: o} = l 22255 , i = {} 22256 , r = n || {}; 22257 return ge(t) && (i.locale = t), 22258 Rt(s) && (i.plural = s), 22259 Rt(o) && (i.plural = o), 22260 [e, r, i] 22261} 22262function _5(l, e, ...t) { 22263 const n = st(t[0]) ? t[0] : {}; 22264 (Pt(n.globalInstall) ? n.globalInstall : !0) && ([lg.name, "I18nT"].forEach(o=>l.component(o, lg)), 22265 [ng.name, "I18nN"].forEach(o=>l.component(o, ng)), 22266 [rg.name, "I18nD"].forEach(o=>l.component(o, rg))), 22267 l.directive("t", C5(e)) 22268} 22269const T5 = Ys("global-vue-i18n"); 22270function k5(l={}) { 22271 const e = Pt(l.globalInjection) ? l.globalInjection : !0 22272 , t = new Map 22273 , [n,s] = E5(l) 22274 , o = Ys(""); 22275 function i(u) { 22276 return t.get(u) || null 22277 } 22278 function r(u, h) { 22279 t.set(u, h) 22280 } 22281 function a(u) { 22282 t.delete(u) 22283 } 22284 const d = { 22285 get mode() { 22286 return "composition" 22287 }, 22288 async install(u, ...h) { 22289 if (u.__VUE_I18N_SYMBOL__ = o, 22290 u.provide(u.__VUE_I18N_SYMBOL__, d), 22291 st(h[0])) { 22292 const p = h[0]; 22293 d.__composerExtend = p.__composerExtend, 22294 d.__vueI18nExtend = p.__vueI18nExtend 22295 } 22296 let c = null; 22297 e && (c = R5(u, d.global)), 22298 _5(u, d, ...h); 22299 const f = u.unmount; 22300 u.unmount = ()=>{ 22301 c && c(), 22302 d.dispose(), 22303 f() 22304 } 22305 }, 22306 get global() { 22307 return s 22308 }, 22309 dispose() { 22310 n.stop() 22311 }, 22312 __instances: t, 22313 __getInstance: i, 22314 __setInstance: r, 22315 __deleteInstance: a 22316 }; 22317 return d 22318} 22319function xf(l={}) { 22320 const e = wf(); 22321 if (e == null) 22322 throw cn(Zl.MUST_BE_CALL_SETUP_TOP); 22323 if (!e.isCE && e.appContext.app != null && !e.appContext.app.__VUE_I18N_SYMBOL__) 22324 throw cn(Zl.NOT_INSTALLED); 22325 const t = D5(e) 22326 , n = A5(t) 22327 , s = xy(e) 22328 , o = O5(l, s); 22329 if (o === "global") 22330 return y5(n, l, s), 22331 n; 22332 if (o === "parent") { 22333 let a = I5(t, e, l.__useComponent); 22334 return a == null && (a = n), 22335 a 22336 } 22337 const i = t; 22338 let r = i.__getInstance(e); 22339 if (r == null) { 22340 const a = Yt({}, l); 22341 "__i18n"in s && (a.__i18n = s.__i18n), 22342 n && (a.__root = n), 22343 r = Cy(a), 22344 i.__composerExtend && (r[cc] = i.__composerExtend(r)), 22345 V5(i, e, r), 22346 i.__setInstance(e, r) 22347 } 22348 return r 22349} 22350function E5(l, e) { 22351 const t = Nc() 22352 , n = t.run(()=>Cy(l)); 22353 if (n == null) 22354 throw cn(Zl.UNEXPECTED_ERROR); 22355 return [t, n] 22356} 22357function D5(l) { 22358 const e = di(l.isCE ? T5 : l.appContext.app.__VUE_I18N_SYMBOL__); 22359 if (!e) 22360 throw cn(l.isCE ? Zl.NOT_INSTALLED_WITH_PROVIDE : Zl.UNEXPECTED_ERROR); 22361 return e 22362} 22363function O5(l, e) { 22364 return iu(l) ? "__i18n"in e ? "local" : "global" : l.useScope ? l.useScope : "local" 22365} 22366function A5(l) { 22367 return l.mode === "composition" ? l.global : l.global.__composer 22368} 22369function I5(l, e, t=!1) { 22370 let n = null; 22371 const s = e.root; 22372 let o = L5(e, t); 22373 for (; o != null; ) { 22374 const i = l; 22375 if (l.mode === "composition" && (n = i.__getInstance(o)), 22376 n != null || s === o) 22377 break; 22378 o = o.parent 22379 } 22380 return n 22381} 22382function L5(l, e=!1) { 22383 return l == null ? null : e && l.vnode.ctx || l.parent 22384} 22385function V5(l, e, t) { 22386 Ud(()=>{} 22387 , e), 22388 Kc(()=>{ 22389 const n = t; 22390 l.__deleteInstance(e); 22391 const s = n[cc]; 22392 s && (s(), 22393 delete n[cc]) 22394 } 22395 , e) 22396} 22397const N5 = ["locale", "fallbackLocale", "availableLocales"] 22398 , ig = ["t", "rt", "d", "n", "tm", "te"]; 22399function R5(l, e) { 22400 const t = Object.create(null);
22401 return N5.forEach(s=>{ 22402 const o = Object.getOwnPropertyDescriptor(e, s); 22403 if (!o) 22404 throw cn(Zl.UNEXPECTED_ERROR); 22405 const i = wt(o.value) ? { 22406 get() { 22407 return o.value.value 22408 }, 22409 set(r) { 22410 o.value.value = r 22411 } 22412 } : { 22413 get() { 22414 return o.get && o.get() 22415 } 22416 }; 22417 Object.defineProperty(t, s, i) 22418 } 22419 ), 22420 l.config.globalProperties.$i18n = t, 22421 ig.forEach(s=>{ 22422 const o = Object.getOwnPropertyDescriptor(e, s); 22423 if (!o || !o.value) 22424 throw cn(Zl.UNEXPECTED_ERROR); 22425 Object.defineProperty(l.config.globalProperties, `$${s}`, o) 22426 } 22427 ), 22428 ()=>{ 22429 delete l.config.globalProperties.$i18n, 22430 ig.forEach(s=>{ 22431 delete l.config.globalProperties[`$${s}`] 22432 } 22433 ) 22434 } 22435} 22436const F5 = Fd({ 22437 name: "i18n-d", 22438 props: Yt({ 22439 value: { 22440 type: [Number, Date], 22441 required: !0 22442 }, 22443 format: { 22444 type: [String, Object] 22445 } 22446 }, Pf), 22447 setup(l, e) { 22448 const t = l.i18n || xf({ 22449 useScope: l.scope, 22450 __useComponent: !0 22451 }); 22452 return Ty(l, e, by, (...n)=>t[uc](...n)) 22453 } 22454}) 22455 , rg = F5; 22456p5(); 22457K4(k4); 22458W4($4); 22459q4(oc); 22460if (__INTLIFY_PROD_DEVTOOLS__) { 22461 const l = gf(); 22462 l.__INTLIFY__ = !0, 22463 E4(l.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__) 22464} 22465class qs extends Fn { 22466 properties = {}; 22467 constructor(e) { 22468 super(e), 22469 Gs(this, qs) 22470 } 22471 getShapePropertyNames() { 22472 return [] 22473 } 22474 setShapeProperty(e, t) {} 22475 getShapePropertyValue(e) {} 22476 toPathModel() { 22477 let e = this.getSelfTransform() 22478 , t = this.getPaths(e, !0) 22479 , n = new bt(t) 22480 , s = this.getParentModel(); 22481 n.setSelfTransform(s && s.getAggregateTransform()); 22482 let o = this.getFillPaint(); 22483 o && (o = o.clone(), 22484 o.updateViewFromModel()), 22485 n.setFillPaint(o); 22486 let i = this.getStrokePaint(); 22487 return i && (i = i.clone(), 22488 i.updateViewFromModel()), 22489 n.setStrokePaint(i), 22490 n.setStrokePaint(i), 22491 n.setStrokeStyle(this.getStrokeStyle()), 22492 n.setSelfTransform(null), 22493 n 22494 } 22495} 22496class du extends qs { 22497 static type = "circle"; 22498 cx = 50; 22499 cy = 50; 22500 r = 50; 22501 constructor() { 22502 let e = de("ellipse"); 22503 super(e) 22504 } 22505 clone() { 22506 let e = super.clone(); 22507 return e.cx = this.cx, 22508 e.cy = this.cy, 22509 e.r = this.r, 22510 e.applyTransformToElement(), 22511 e 22512 } 22513 setGeometryAttrs(e, t, n) { 22514 this.cx = e, 22515 this.cy = t, 22516 this.r = n, 22517 this.applyTransformToElement() 22518 } 22519 getCx() { 22520 return this.cx 22521 } 22522 setCx(e) { 22523 this.cx = e, 22524 this.applyTransformToElement() 22525 } 22526 getCy() { 22527 return this.cy 22528 } 22529 setCy(e) { 22530 this.cy = e, 22531 this.applyTransformToElement() 22532 } 22533 getR() { 22534 return this.r 22535 } 22536 setR(e) { 22537 this.r = e, 22538 this.applyTransformToElement() 22539 } 22540 toPathModel() { 22541 let e = super.toPathModel(); 22542 for (let t of e.getSinglePathModels()[0].getNodePoints()) 22543 t.setNodeType(yt); 22544 return e 22545 } 22546 getPaths(e, t, n) { 22547 let s = this.getCx(), o = this.getCy(), i = this.getR(), r, a; 22548 if (e == null || e.isIdentity) 22549 r = new B(i,0), 22550 a = new B(0,i); 22551 else { 22552 let S = new B(s,o); 22553 e.transformXY(S), 22554 s = S.x, 22555 o = S.y; 22556 let x = e.decomposeSingularValue() 22557 , P = new oe(x.u[0],x.u[1],x.u[2],x.u[3]).getRotation() 22558 , C = i * x.s[0] 22559 , T = i * x.s[1] 22560 , k = Math.cos(P) 22561 , D = Math.sin(P); 22562 r = new B(C * k,C * D), 22563 a = new B(T * -D,T * k) 22564 } 22565 let d = r.multiplyScalar(.552284749831) 22566 , u = a.multiplyScalar(.552284749831) 22567 , h = s + r.x 22568 , c = o + r.y 22569 , f = s + a.x 22570 , p = o + a.y 22571 , g = s - r.x 22572 , y = o - r.y 22573 , m = s - a.x 22574 , b = o - a.y 22575 , M = new ft; 22576 return M.appendCurveValues([h, c, h + u.x, c + u.y, f + d.x, p + d.y, f, p]), 22577 M.appendCurveValues([f, p, f - d.x, p - d.y, g + u.x, y + u.y, g, y]), 22578 M.appendCurveValues([g, y, g - u.x, y - u.y, m - d.x, b - d.y, m, b]), 22579 M.appendCurveValues([m, b, m + d.x, b + d.y, h - u.x, c - u.y, h, c]), 22580 M.close(), 22581 [M] 22582 } 22583 getBounds() { 22584 let e = this.getCx() 22585 , t = this.getCy() 22586 , n = this.getR(); 22587 return new Ve(e - n,t - n,2 * n,2 * n) 22588 } 22589 getTransformedBounds(e) { 22590 e = e ?? this.getAggregateTransform(); 22591 let t = this.r 22592 , n = new B(this.cx,this.cy); 22593 if (e.isIdentity) 22594 return new Ve(n.x - t,n.y - t,2 * t,2 * t); 22595 { 22596 e.transformXY(n); 22597 let s = e.decomposeSingularValue() 22598 , o = new oe(s.u[0],s.u[1],s.u[2],s.u[3]).getRotation() 22599 , i = t * s.s[0] 22600 , r = t * s.s[1] 22601 , a = Math.cos(o) 22602 , d = Math.sin(o) 22603 , u = Math.sqrt(i ** 2 * a ** 2 + r ** 2 * d ** 2) 22604 , h = Math.sqrt(i ** 2 * d ** 2 + r ** 2 * a ** 2); 22605 return new Ve(n.x - u,n.y - h,2 * u,2 * h) 22606 } 22607 } 22608 applyTransformToElement() { 22609 let e = this.getAggregateTransform() 22610 , t = new B(this.cx,this.cy); 22611 e.transformXY(t); 22612 let n = this.getR() 22613 , s = e.decomposeSingularValue() 22614 , o = new oe(s.u[0],s.u[1],s.u[2],s.u[3]).getRotation() 22615 , i = this.baseElement; 22616 i.setAttribute("cx", t.x), 22617 i.setAttribute("cy", t.y), 22618 i.setAttribute("rx", n * s.s[0]), 22619 i.setAttribute("ry", n * s.s[1]); 22620 let r = new oe().rotate(o, t.x, t.y); 22621 r.isIdentity ? i.removeAttribute("transform") : i.setAttribute("transform", r.toSvgValue()); 22622 for (let a of [this.fillPaint, this.strokePaint]) 22623 a && a.setModelTransform(e, r) 22624 } 22625 toJSON() { 22626 return Object.assign(super.toJSON(), { 22627 cx: this.cx, 22628 cy: this.cy, 22629 r: this.r 22630 }) 22631 } 22632 setJSON(e) { 22633 super.setJSON(e), 22634 this.r = e.r, 22635 this.cx = e.cx, 22636 this.cy = e.cy, 22637 this.applyTransformToElement() 22638 } 22639} 22640class uu extends qs { 22641 static type = "rectangle"; 22642 x = 0; 22643 y = 0; 22644 width = 100; 22645 height = 100; 22646 cornerRounding = 0; 22647 constructor(e=0) { 22648 let t = de("path"); 22649 super(t), 22650 this.cornerRounding = e 22651 } 22652 clone() { 22653 let e = super.clone(); 22654 return e.x = this.x, 22655 e.y = this.y,
22656 e.width = this.width, 22657 e.height = this.height, 22658 e.cornerRounding = this.cornerRounding, 22659 e._updatePathData(this.getAggregateTransform()), 22660 e 22661 } 22662 getShapePropertyNames() { 22663 return ["x", "y", "width", "height", "cornerRounding"] 22664 } 22665 setShapeProperty(e, t) { 22666 e === "x" ? this.x = t : e === "y" ? this.y = t : e === "width" ? this.width = t : e === "height" ? this.height = t : e === "cornerRounding" && (this.cornerRounding = Math.min(1, Math.max(0, t || 0))), 22667 this._updatePathData(this.getAggregateTransform()), 22668 this.modelChanged() 22669 } 22670 getShapePropertyValue(e) { 22671 if (e === "x") 22672 return this.x; 22673 if (e === "y") 22674 return this.y; 22675 if (e === "width") 22676 return this.width; 22677 if (e === "height") 22678 return this.height; 22679 if (e === "cornerRounding") 22680 return this.cornerRounding 22681 } 22682 getX() { 22683 return this.x 22684 } 22685 setX(e) { 22686 e !== this.x && (this.x = e, 22687 this._updatePathData()) 22688 } 22689 getY() { 22690 return this.y 22691 } 22692 setY(e) { 22693 e !== this.y && (this.y = e, 22694 this._updatePathData()) 22695 } 22696 getWidth() { 22697 return this.width 22698 } 22699 setWidth(e) { 22700 e !== this.width && (this.width = e, 22701 this._updatePathData()) 22702 } 22703 getHeight() { 22704 return this.height 22705 } 22706 setHeight(e) { 22707 e !== this.height && (this.height = e, 22708 this._updatePathData()) 22709 } 22710 _updatePathData(e) { 22711 this.baseElement.setAttribute("d", this.getPathData(e)) 22712 } 22713 getPaths(e, t, n) { 22714 let s = this.cornerRounding / 2 22715 , o = this.getWidth() 22716 , i = this.getHeight() 22717 , r = this.getX() 22718 , a = this.getY() 22719 , d = r + o 22720 , u = a + i 22721 , h = new ft; 22722 if (s !== 0) { 22723 let c = function(D, I, F, Y) { 22724 return [D, I, D, I, F, Y, F, Y] 22725 } 22726 , f = function(D, I, F, Y) { 22727 const q = .5522847498307935; 22728 let re = F - D 22729 , ne = Y - I 22730 , te = re * ne; 22731 return [D, I, te > 0 ? D + re * q : D, te > 0 ? I : I + ne * q, te < 0 ? F - re * q : F, te < 0 ? Y : Y - ne * q, F, Y] 22732 } 22733 , g = this._aggregateTransform.decompose() 22734 , y = g.scale[0] 22735 , m = g.scale[1] 22736 , b = Math.abs(o * y / (i * m)) 22737 , M = b > 1 ? s / b : s 22738 , S = b > 1 ? s : s * b 22739 , x = r + o * M 22740 , P = d - o * M 22741 , C = a + i * S 22742 , T = u - i * S; 22743 [c(x, a, P, a), f(P, a, d, C), c(d, C, d, T), f(d, T, P, u), c(P, u, x, u), f(x, u, r, T), c(r, T, r, C), f(r, C, x, a)].forEac
22743h(D=>h.appendCurveValues(e.transformArray(D))) 22744 } else if (e == null || e.isIdentity) 22745 h.appendCurveValues([r, a, r, a, d, a, d, a]), 22746 h.appendCurveValues([d, a, d, a, d, u, d, u]), 22747 h.appendCurveValues([d, u, d, u, r, u, r, u]), 22748 h.appendCurveValues([r, u, r, u, r, a, r, a]); 22749 else { 22750 let c = e.transformXY(new B(r,a)) 22751 , f = e.transformXY(new B(d,a)) 22752 , p = e.transformXY(new B(d,u)) 22753 , g = e.transformXY(new B(r,u)); 22754 h.appendCurveValues([c.x, c.y, c.x, c.y, f.x, f.y, f.x, f.y]), 22755 h.appendCurveValues([f.x, f.y, f.x, f.y, p.x, p.y, p.x, p.y]), 22756 h.appendCurveValues([p.x, p.y, p.x, p.y, g.x, g.y, g.x, g.y]), 22757 h.appendCurveValues([g.x, g.y, g.x, g.y, c.x, c.y, c.x, c.y]) 22758 } 22759 return h.close(), 22760 [h] 22761 } 22762 getBounds() { 22763 return new Ve(this.getX(),this.getY(),this.getWidth(),this.getHeight()) 22764 } 22765 getPointsString(e) { 22766 let t = this.x 22767 , n = this.y 22768 , s = t + this.width 22769 , o = n + this.height; 22770 if (e == null || e.isIdentity) 22771 return t + "," + n + " " + s + "," + n + " " + s + "," + o + " " + t + "," + o; 22772 { 22773 let i = e.transformXY(new B(t,n)) 22774 , r = i.x + "," + i.y + " "; 22775 return e.transformXY(i.set(s, n)), 22776 r += i.x + "," + i.y + " ", 22777 e.transformXY(i.set(s, o)), 22778 r += i.x + "," + i.y + " ", 22779 e.transformXY(i.set(t, o)), 22780 r += i.x + "," + i.y, 22781 r 22782 } 22783 } 22784 applyTransformToElement() { 22785 let e = this.getAggregateTransform(); 22786 this._updatePathData(e); 22787 for (let t of [this.fillPaint, this.strokePaint]) 22788 t && t.setModelTransform(e, null) 22789 } 22790 toJSON() { 22791 return Object.assign(super.toJSON(), { 22792 x: this.x, 22793 y: this.y, 22794 width: this.width, 22795 height: this.height 22796 }) 22797 } 22798 setJSON(e) { 22799 super.setJSON(e), 22800 this.x = e.x, 22801 this.y = e.y, 22802 this.width = e.width, 22803 this.height = e.height, 22804 this.applyTransformToElement() 22805 } 22806} 22807class Cf extends qs { 22808 static type = "ellipse"; 22809 cx = 50; 22810 cy = 50; 22811 rx = 50; 22812 ry = 50; 22813 constructor() { 22814 let e = de("ellipse"); 22815 super(e) 22816 } 22817 clone() { 22818 let e = super.clone(); 22819 return e.cx = this.cx, 22820 e.cy = this.cy, 22821 e.rx = this.rx, 22822 e.ry = this.ry, 22823 e.applyTransformToElement(), 22824 e 22825 } 22826 setGeometryAttrs(e, t, n, s) { 22827 this.cx = e, 22828 this.cy = t, 22829 this.rx = n, 22830 this.ry = s, 22831 this.applyTransformToElement() 22832 } 22833 getCx() { 22834 return this.cx 22835 } 22836 setCx(e) { 22837 this.cx = e, 22838 this.applyTransformToElement() 22839 } 22840 getCy() { 22841 return this.cy 22842 } 22843 setCy(e) { 22844 this.cy = e, 22845 this.applyTransformToElement() 22846 } 22847 getRx() { 22848 return this.rx 22849 } 22850 setRx(e) { 22851 this.rx = e, 22852 this.applyTransformToElement() 22853 } 22854 getRy() { 22855 return this.ry 22856 } 22857 setRy(e) { 22858 this.ry = e, 22859 this.applyTransformToElement() 22860 } 22861 toPathModel() { 22862 let e = super.toPathModel(); 22863 for (let t of e.getSinglePathModels()[0].getNodePoints()) 22864 t.setNodeType(yt); 22865 return e 22866 } 22867 getPaths(e, t) { 22868 let n = this.getCx(), s = this.getCy(), o = this.getRx(), i = this.getRy(), r, a; 22869 if (e == null || e.isIdentity) 22870 r = new B(o,0), 22871 a = new B(0,i); 22872 else { 22873 let S = new B(n,s); 22874 e.transformXY(S), 22875 n = S.x, 22876 s = S.y; 22877 let x; 22878 o === i ? x = o : Math.abs(o) < Math.abs(i) ? (e = e.clone().scale(o / i, 1), 22879 x = i) : (e = e.clone().scale(1, i / o), 22880 x = o); 22881 let P = e.decomposeSingularValue() 22882 , C = new oe(P.u[0],P.u[1],P.u[2],P.u[3]).getRotation() 22883 , T = x * P.s[0] 22884 , k = x * P.s[1] 22885 , D = Math.cos(C) 22886 , I = Math.sin(C); 22887 r = new B(T * D,T * I), 22888 a = new B(k * -I,k * D) 22889 } 22890 let d = r.multiplyScalar(.552284749831) 22891 , u = a.multiplyScalar(.552284749831) 22892 , h = n + r.x 22893 , c = s + r.y 22894 , f = n + a.x 22895 , p = s + a.y 22896 , g = n - r.x 22897 , y = s - r.y 22898 , m = n - a.x 22899 , b = s - a.y 22900 , M = new ft; 22901 return M.appendCurveValues([h, c, h + u.x, c + u.y, f + d.x, p + d.y, f, p]), 22902 M.appendCurveValues([f, p, f - d.x, p - d.y, g + u.x, y + u.y, g, y]), 22903 M.appendCurveValues([g, y, g - u.x, y - u.y, m - d.x, b - d.y, m, b]), 22904 M.appendCurveValues([m, b, m + d.x, b + d.y, h - u.x, c - u.y, h, c]), 22905 M.close(), 22906 [M] 22907 } 22908 getBounds() { 22909 let e = this.getCx() 22910 , t = this.getCy() 22911 , n = this.getRx() 22912 , s = this.getRy() 22913 , o = new B(e,t) 22914 , i = new B(e + n,t) 22915 , r = new B(e,t + s) 22916 , a = Se(i.x - o.x, r.x - o.x) 22917 , d = Se(i.y - o.y, r.y - o.y); 22918 return new Ve(o.x - a,o.y - d,2 * a,2 * d) 22919 } 22920 getTransformedBounds(e) { 22921 e = e ?? this.getAggregateTransform(); 22922 let t = this.rx 22923 , n = this.ry 22924 , s = new B(this.cx,this.cy); 22925 if (e.isIdentity) 22926 return new Ve(s.x - t,s.y - n,2 * t,2 * n); 22927 { 22928 e.transformXY(s); 22929 let o; 22930 t === n ? o = t : Math.abs(t) < Math.abs(n) ? (e.scale(t / n, 1), 22931 o = n) : (e.scale(1, n / t), 22932 o = t); 22933 let i = e.decomposeSingularValue() 22934 , r = new oe(i.u[0],i.u[1],i.u[2],i.u[3]).getRotation() 22935 , a = o * i.s[0] 22936 , d = o * i.s[1]
22937 , u = Math.cos(r) 22938 , h = Math.sin(r) 22939 , c = Math.sqrt(a ** 2 * u ** 2 + d ** 2 * h ** 2) 22940 , f = Math.sqrt(a ** 2 * h ** 2 + d ** 2 * u ** 2); 22941 return new Ve(s.x - c,s.y - f,2 * c,2 * f) 22942 } 22943 } 22944 applyTransformToElement() { 22945 let e = this.getAggregateTransform() 22946 , t = new B(this.cx,this.cy); 22947 e.transformXY(t); 22948 let n = this.rx, s = this.ry, o; 22949 n === s ? o = n : Math.abs(n) < Math.abs(s) ? (e.scale(n / s, 1), 22950 o = s) : (e.scale(1, s / n), 22951 o = n); 22952 let i = e.decomposeSingularValue() 22953 , r = new oe(i.u[0],i.u[1],i.u[2],i.u[3]).getRotation(!1) 22954 , a = this.baseElement; 22955 a.setAttribute("cx", t.x), 22956 a.setAttribute("cy", t.y), 22957 a.setAttribute("rx", o * i.s[0]), 22958 a.setAttribute("ry", o * i.s[1]); 22959 let d = new oe().rotate(r, t.x, t.y); 22960 d.isIdentity ? a.removeAttribute("transform") : a.setAttribute("transform", d.toSvgValue()), 22961 e = this.getAggregateTransform(); 22962 for (let u of [this.fillPaint, this.strokePaint]) 22963 u && u.setModelTransform(e, d) 22964 } 22965 toJSON() { 22966 return Object.assign(super.toJSON(), { 22967 cx: this.cx, 22968 cy: this.cy, 22969 rx: this.rx, 22970 ry: this.ry 22971 }) 22972 } 22973 setJSON(e) { 22974 super.setJSON(e), 22975 this.rx = e.rx, 22976 this.ry = e.ry, 22977 this.cx = e.cx, 22978 this.cy = e.cy, 22979 this.applyTransformToElement() 22980 } 22981} 22982class hu extends Jl { 22983 static type = "clipPath"; 22984 fillPathElement; 22985 strokePathElement; 22986 contentGroupElement; 22987 constructor() { 22988 let e = Es(8) 22989 , t = Es(8) 22990 , n = de("path", { 22991 id: e, 22992 d: "" 22993 }) 22994 , s = de("use", { 22995 href: "#" + e, 22996 fill: "none" 22997 }) 22998 , o = de("g", { 22999 "clip-path": "url(#" + t + ")" 23000 }) 23001 , i = de("use", { 23002 href: "#" + e, 23003 fill: "none" 23004 }) 23005 , r = de("g", null, null, [de("clipPath", { 23006 id: t 23007 }, null, [n]), s, o, i]); 23008 super(r), 23009 this.clipPathElement = n, 23010 this.fillPathElement = s, 23011 this.strokePathElement = i, 23012 this.contentGroupElement = o 23013 } 23014 clone() { 23015 let e = super.clone() 23016 , t = Es(8) 23017 , n = Es(8) 23018 , s = e.baseElement; 23019 return s.children[0].setAttribute("id", n), 23020 e.clipPathElement = s.children[0].children[0], 23021 e.clipPathElement.setAttribute("id", t), 23022 e.fillPathElement = s.children[1], 23023 e.fillPathElement.setAttribute("href", "#" + t), 23024 e.contentGroupElement = s.children[2], 23025 e.contentGroupElement.setAttribute("clip-path", "url(#" + n + ")"), 23026 e.contentGroupElement.replaceChildren(), 23027 e.strokePathElement = s.children[3], 23028 e.strokePathElement.setAttribute("href", "#" + t), 23029 this._childModels.forEach(o=>e.insertChildAt(o.clone())), 23030 e 23031 } 23032 getChildContainerElement() { 23033 return this.contentGroupElement 23034 } 23035 _getFillElement() { 23036 return this.fillPathElement 23037 } 23038 _getStrokeElement() { 23039 return this.strokePathElement 23040 } 23041 _getPathDataElement() { 23042 return this.clipPathElement 23043 } 23044 toJSON() { 23045 return Object.assign(super.toJSON(), { 23046 childModels: this.getChildModels().map(e=>e.toJSON()) 23047 }) 23048 } 23049 setJSON(e) { 23050 super.setJSON(e); 23051 let t = e.childModels; 23052 if (t && Array.isArray(t)) { 23053 let n = t.map(s=>Ef(s)); 23054 this.insertChildrenAt(n.filter(s=>s != null)) 23055 } 23056 } 23057} 23058class Bs extends qs { 23059 static type = "star"; 23060 cx = 50; 23061 cy = 50; 23062 size = 100; 23063 points; 23064 pointSize; 23065 outerRounding; 23066 innerRounding; 23067 bounds; 23068 constructor(e=5, t=.5, n=0, s=0) { 23069 let o = de("path"); 23070 super(o), 23071 this.points = e, 23072 this.pointSize = t, 23073 this.outerRounding = n, 23074 this.innerRounding = s, 23075 this._updatePathData() 23076 } 23077 clone() { 23078 let e = super.clone(); 23079 return e.cx = this.cx, 23080 e.cy = this.cy, 23081 e.size = this.size, 23082 e.points = this.points, 23083 e.pointSize = this.pointSize, 23084 e.outerRounding = this.outerRounding, 23085 e.innerRounding = this.innerRounding, 23086 e._updatePathData(this.getAggregateTransform()), 23087 e 23088 } 23089 getShapePropertyNames() { 23090 return ["points", "pointSize", "outerRounding", "innerRounding"] 23091 } 23092 setShapeProperty(e, t) { 23093 e === "points" ? this.points = t : e === "pointSize" ? this.pointSize = t : e === "outerRounding" ? (this.outerRounding = t, 23094 this.innerRounding = Math.min(this.innerRounding, 1 - t)) : e === "innerRounding" && (this.innerRounding = t, 23095 this.outerRounding = Math.min(this.outerRounding, 1 - t)); 23096 let s = this.createStar(this.points, 100, this.pointSize, this.outerRounding, this.innerRounding).getBoundsCoords() 23097 , o = this.bounds
23098 , i = this.getSelfTransform(); 23099 i.translate((o.width - (s[2] - s[0])) / 2, (o.height - (s[3] - s[1])) / 2), 23100 this.setSelfTransform(i), 23101 this._updatePathData(i), 23102 this.modelChanged() 23103 } 23104 getShapePropertyValue(e) { 23105 if (e === "points") 23106 return this.points; 23107 if (e === "pointSize") 23108 return this.pointSize == null ? Bs.getAutoPointSize(this.points) : this.pointSize; 23109 if (e === "outerRounding") 23110 return this.outerRounding; 23111 if (e === "innerRounding") 23112 return this.innerRounding 23113 } 23114 getBounds() { 23115 return this.bounds || this._updatePathData(), 23116 this.bounds.clone() 23117 } 23118 getTransformedBounds(e) { 23119 if (e = e ?? this.getAggregateTransform(), 23120 e.isIdentity) 23121 return this.getBounds(); 23122 { 23123 let t = this.createStar(this.points, 100, this.pointSize, this.outerRounding, this.innerRounding); 23124 t.applyTransform(e); 23125 let n = t.getBoundsCoords(); 23126 return new Ve(n[0],n[1],n[2] - n[0],n[3] - n[1]) 23127 } 23128 } 23129 _updatePathData(e) { 23130 this.baseElement.setAttribute("d", this.getPathData(e)) 23131 } 23132 getPaths(e, t, n) { 23133 let s = this.createStar(this.points, 100, this.pointSize, this.outerRounding, this.innerRounding) 23134 , o = s.getBoundsCoords(); 23135 return this.bounds = new Ve(o[0],o[1],o[2] - o[0],o[3] - o[1]), 23136 s.applyTransform(e), 23137 [s] 23138 } 23139 applyTransformToElement() { 23140 let e = this.getAggregateTransform(); 23141 this._updatePathData(e); 23142 for (let t of [this.fillPaint, this.strokePaint]) 23143 t && t.setModelTransform(e, null) 23144 } 23145 createStar(e, t, n, s=0, o=0, i) { 23146 const r = Number.EPSILON; 23147 n == null && (n = Bs.getAutoPointSize(e)); 23148 let a = 2 * Math.PI / e 23149 , d = t / 2 23150 , u = d * Math.cos(a / 2) * (1 - n) 23151 , h = d - u * Math.cos(a / 2) 23152 , c = u * Math.sin(a / 2) 23153 , f = 2 * Math.atan(c / h) 23154 , p = s * c / Math.sin(Math.PI / 2 - f / 2) 23155 , g = t / 2 23156 , y = Math.sqrt(p ** 2 + s ** 2 * (c ** 2 + h ** 2)) - p 23157 , m = [] 23158 , b = new B(g + s * c,s * h); 23159 if (s > 0) { 23160 let T = new B(g - s * c,s * h) 23161 , k = 4 / 3 * p * Math.tan((Math.PI / 2 - f / 2) / 4) 23162 , D = new B(c,-h).setLength(k) 23163 , I = new B(-c,-h).setLength(k); 23164 m.push([T.x, T.y, T.x + D.x, T.y + D.y, g - k, y, g, y]), 23165 m.push([g, y, g + k, y, b.x + I.x, b.y + I.y, b.x, b.y]) 23166 } 23167 let M; 23168 Math.abs(o + s - 1) > r ? (M = new B(g + (1 - o) * c,(1 - o) * h), 23169 m.push([b.x, b.y, b.x, b.y, M.x, M.y, M.x, M.y])) : M = b.clone(); 23170 let S = t / 2 23171 , x = t / 2; 23172 if (o > 0) { 23173 let T = d * Math.sin(a / 2) 23174 , k = Math.hypot(c, h) 23175 , D = 2 * Math.asin(T / k) 23176 , I = o * T / Math.sin(Math.PI / 2 - D / 2) 23177 , F = 4 / 3 * I * Math.tan((Math.PI / 2 - D / 2) / 2) 23178 , Y = new B(g - (1 - o) * c,(1 - o) * h).rotate(a, S, x) 23179 , q = new B(c,h).setLength(F) 23180 , re = q.rotate(-Math.PI + D).negate(!0); 23181 m.push([M.x, M.y, M.x + q.x, M.y + q.y, Y.x + re.x, Y.y + re.y, Y.x, Y.y]) 23182 } 23183 let P = m.slice(); 23184 for (let T = 1; T < e; T++) { 23185 let k = new oe; 23186 k.rotate(2 * Math.PI * T / e, S, x); 23187 let D = m.map(Y=>k.transformArray(Y, [])) 23188 , I = P.at(-1).at(-2) 23189 , F = P.at(-1).at(-1); 23190 if (Math.abs(o + s - 1) > r) { 23191 let Y = D.at(0)[0] 23192 , q = D.at(0)[1]; 23193 P.push([I, F, I, F, Y, q, Y, q]) 23194 } else 23195 D.at(0)[0] = I, 23196 D.at(0)[1] = F; 23197 P.push(...D) 23198 } 23199 let C = P.reduce((T,k)=>gl(k, T), null); 23200 return P.forEach(T=>n2(T, -C[0], -C[1])), 23201 i && !i.isIdentity && P.forEach(T=>i.transformArray(T)), 23202 new ft(P.map(T=>
23202new Mt(T)),!0) 23203 } 23204 static getAutoPointSize(e) { 23205 if (e <= 4) 23206 return .5; 23207 let t = 2 * Math.PI / e 23208 , n = new B(0,1) 23209 , s = [n]; 23210 for (let i = 1; i < 4; i++) 23211 s.push(n.rotate(i * t)); 23212 return 1 - Tl(s[0], s[2].subtract(s[0]), s[1], s[3].subtract(s[1])).getLength() / Math.cos(t / 2) 23213 } 23214 toJSON() { 23215 return Object.assign(super.toJSON(), { 23216 cx: this.cx, 23217 cy: this.cy, 23218 size: this.size, 23219 points: this.points, 23220 pointSize: this.pointSize, 23221 outerRounding: this.outerRounding, 23222 innerRounding: this.innerRounding 23223 }) 23224 } 23225 setJSON(e) { 23226 super.setJSON(e), 23227 this.cx = e.cx, 23228 this.cy = e.cy, 23229 this.size = e.size, 23230 this.points = e.points, 23231 this.pointSize = e.pointSize, 23232 this.outerRounding = e.outerRounding, 23233 this.innerRounding = e.innerRounding, 23234 this._updatePathData(), 23235 this.applyTransformToElement() 23236 } 23237} 23238class _f extends qs { 23239 static type = "polygon"; 23240 size = 100; 23241 sides; 23242 cornerRounding; 23243 circularity; 23244 bounds; 23245 constructor(e=5, t=0, n=0) { 23246 let s = de("path"); 23247 super(s), 23248 this.sides = e, 23249 this.cornerRounding = t, 23250 this.circularity = n, 23251 this._updatePathData() 23252 } 23253 clone() { 23254 let e = super.clone(); 23255 return e.size = this.size, 23256 e.sides = this.sides, 23257 e.cornerRounding = this.cornerRounding, 23258 e.circularity = this.circularity, 23259 e._updatePathData(this.getAggregateTransform()), 23260 e 23261 } 23262 getShapePropertyNames() { 23263 return ["sides", "cornerRounding"] 23264 } 23265 setShapeProperty(e, t) { 23266 if (e === "sides" ? this.sides = t : e === "cornerRounding" && (this.cornerRounding = t), 23267 e === "sides" || e === "cornerRounding") { 23268 let n = this.bounds 23269 , s = n.width 23270 , o = n.height; 23271 this._updatePathData(); 23272 let i = this.bounds 23273 , r = this.getSelfTransform(); 23274 r.translate((s - i.width) / 2, (o - i.height) / 2), 23275 this.setSelfTransform(r), 23276 this._updatePathData(r), 23277 this.modelChanged() 23278 } 23279 } 23280 getShapePropertyValue(e) { 23281 if (e === "sides") 23282 return this.sides; 23283 if (e === "cornerRounding") 23284 return this.cornerRounding 23285 } 23286 getBounds() { 23287 return this.bounds || this._updatePathData(), 23288 this.bounds.clone() 23289 } 23290 getTransformedBounds(e) { 23291 if (e = e ?? this.getAggregateTransform(), 23292 e.isIdentity) 23293 return this.getBounds(); 23294 { 23295 let t = this.sides 23296 , n = this.createPolygon(t, 100, this.cornerRounding, this.circularity); 23297 n.applyTransform(e); 23298 let s = n.getBoundsCoords(); 23299 return new Ve(s[0],s[1],s[2] - s[0],s[3] - s[1]) 23300 } 23301 } 23302 _updatePathData(e) { 23303 this.baseElement.setAttribute("d", this.getPathData(e)) 23304 } 23305 getPaths(e, t, n) { 23306 let s = this.sides 23307 , o = this.createPolygon(s, 100, this.cornerRounding, this.circularity) 23308 , i = o.getBoundsCoords(); 23309 return this.bounds = new Ve(i[0],i[1],i[2] - i[0],i[3] - i[1]), 23310 o.applyTransform(e), 23311 [o] 23312 } 23313 applyTransformToElement() { 23314 let e = this.getAggregateTransform(); 23315 this._updatePathData(e); 23316 for (let t of [this.fillPaint, this.strokePaint]) 23317 t && t.setModelTransform(e, null) 23318 } 23319 createPolygon(e, t, n=0, s=0, o) { 23320 const i = Number.EPSILON; 23321 (s > 1 - i || n > 1 - i) && (n = 1, 23322 s = 0); 23323 let r = 2 * Math.PI / e 23324 , a = r * (1 - n) 23325 , d = new B(t / 2,t / 2) 23326 , u = [] 23327 , h = function(m, b, M) { 23328 let S = b.subtract(m); 23329 if (Math.abs(S.cross(M)) < 1e-12) 23330 return [[m.x, m.y, m.x, m.y, b.x, b.y, b.x, b.y]]; 23331 { 23332 let x = M.getAngleTo(S, !0) 23333 , P = Math.abs(S.getLength() / 2 / Math.sin(x)
23333) 23334 , C = new B(-M.y,M.x).setLength(P, !0).add(m, !0) 23335 , T = 2 * x 23336 , k = T > Math.PI / 2 + i 23337 , D = 4 / 3 * P * Math.tan(T / (k ? 8 : 4)) 23338 , I = M.setLength(D) 23339 , F = I.rotate(T); 23340 if (k) { 23341 let Y = m.rotate(T / 2, C.x, C.y) 23342 , q = I.rotate(T / 2); 23343 return [[m.x, m.y, m.x + I.x, m.y + I.y, Y.x - q.x, Y.y - q.y, Y.x, Y.y], [Y.x, Y.y, Y.x + q.x, Y.y + q.y, b.x - F.x, b.y - F.y, b.x, b.y]] 23344 } else 23345 return [[m.x, m.y, m.x + I.x, m.y + I.y, b.x - F.x, b.y - F.y, b.x, b.y]] 23346 } 23347 } 23348 , c = new B(d.x + Math.tan(a / 2) * t / 2,d.y + t / 2) 23349 , f = new B(t - c.x,c.y) 23350 , p = c.subtract(d).setLength(1).rotate(Math.PI / 2 + (1 - s) * a / 2); 23351 if (c.dist(f) > Number.EPSILON && u.push(...h(c, f, p)), 23352 n > 0) { 23353 let m = c.rotate(r, d.x, d.y); 23354 u.push(...h(f, m, new B(p.x,-p.y))) 23355 } 23356 let g = u.slice(); 23357 for (let m = 1; m < e; m++) 23358 u.push(...g.map(b=>Tw(b.slice(), r * m, d.x, d.y))); 23359 let y = u.reduce((m,b)=>gl(b, m), null); 23360 return u.forEach(m=>n2(m, -y[0], -y[1])), 23361 o && !o.isIdentity && u.forEach(m=>o.transformArray(m)), 23362 new ft(u.map(m=>new Mt(m)),!0) 23363 } 23364 toJSON() { 23365 return Object.assign(super.toJSON(), { 23366 size: this.size, 23367 sides: this.sides, 23368 cornerRounding: this.cornerRounding, 23369 circularity: this.circularity 23370 }) 23371 } 23372 setJSON(e) { 23373 super.setJSON(e), 23374 this.size = e.size, 23375 this.sides = e.sides, 23376 this.cornerRounding = e.cornerRounding, 23377 this.circularity = e.circularity, 23378 this._updatePathData(), 23379 this.applyTransformToElement() 23380 } 23381} 23382class Ue { 23383 isSignificant; 23384 isClosed = !1; 23385 constructor(e=!0) { 23386 this.isSignificant = e 23387 } 23388 addEdit(e) { 23389 return !1 23390 } 23391 async undo() { 23392 throw new Error("undo() not implemented") 23393 } 23394 async redo() { 23395 throw new Error("redo() not implemented") 23396 } 23397 close() { 23398 this.isClosed = !0 23399 } 23400} 23401class Ba extends Ue { 23402 _textSpan; 23403 _offset; 23404 _removedText; 23405 _insertedText; 23406 constructor(e, t, n, s) { 23407 super(!0), 23408 this._textSpan = e, 23409 this._offset = t, 23410 this._removedText = n || "", 23411 this._insertedText = s || "" 23412 } 23413 async undo() { 23414 let e = this._textSpan 23415 , t = this._offset 23416 , n = e.getText(); 23417 n = n.substring(0, t) + this._removedText + n.substring(t + this._insertedText.length), 23418 this._textSpan.setText(n) 23419 } 23420 async redo() { 23421 let e = this._textSpan 23422 , t = this._offset 23423 , n = e.getText(); 23424 n = n.substring(0, t) + this._insertedText + n.substring(t + this._removedText.length), 23425 e.setText(n) 23426 } 23427} 23428class tr extends Ue { 23429 _textModel; 23430 _lineIndex; 23431 _spanIndex; 23432 _removedSpans; 23433 _insertedSpans; 23434 constructor(e, t, n, s) { 23435 super(!0), 23436 this._textModel = e.getTextModel(), 23437 this._lineIndex = e.getLineIndex(), 23438 this._spanIndex = t, 23439 this._removedSpans = n, 23440 this._insertedSpans = s 23441 } 23442 async undo() { 23443 this._applyEdit(this._insertedSpans, this._removedSpans) 23444 } 23445 async redo() { 23446 this._applyEdit(this._removedSpans, this._insertedSpans) 23447 } 23448 _applyEdit(e, t) { 23449 let n = this._textModel.textLines[this._lineIndex] 23450 , s = this._spanIndex; 23451 if (e != null) 23452 for (let o = 0; o < e.length; o++) 23453 n.removeTextSpanModelFrom(s); 23454 if (t != null) 23455 for (let o = 0; o < t.length; o++) 23456 n.insertTextSpanModelAt(t[o], s + o) 23457 } 23458} 23459let ky = class extends Ue { 23460 _textSpan; 23461 _name; 23462 _oldValue; 23463 _newValue; 23464 constructor(e, t, n, s) { 23465 super(!0), 23466 this._textSpan = e, 23467 this._name = t, 23468 this._oldValue = n, 23469 this._newValue = s 23470 } 23471 async undo() { 23472 await this.setAttributeValue(this._oldValue) 23473 } 23474 async redo() { 23475 await this.setAttributeValue(this._newValue) 23476 } 23477 async setAttributeValue(e) { 23478 await this._textSpan.textStyle.setStyleAttribute(this._name, e) 23479 } 23480} 23481;
23482class Wn { 23483 _textModel; 23484 _textSpanModels; 23485 y = 0; 23486 constructor(e, t) { 23487 this._textModel = e, 23488 this._textSpanModels = t ? t.slice() : [] 23489 } 23490 getText() { 23491 let e = ""; 23492 return this._textSpanModels.forEach(t=>e += t.getText()), 23493 e 23494 } 23495 getTextModel() { 23496 return this._textModel 23497 } 23498 getLineIndex() { 23499 return this._textModel.textLines.indexOf(this) 23500 } 23501 getTextSpans() { 23502 return this._textSpanModels 23503 } 23504 getFirstTextSpanIndex() { 23505 let e = 0; 23506 for (let t of this._textModel.textLines) { 23507 if (t === this) 23508 break; 23509 e += t.getTextSpans().length 23510 } 23511 return e 23512 } 23513 getTextLength() { 23514 let e = 0; 23515 for (let t of this._textSpanModels) 23516 e += t.getTextLength(); 23517 return e 23518 } 23519 isEmpty() { 23520 let e = this._textSpanModels; 23521 return e.length === 1 && e[0].isLineBreakSpan 23522 } 23523 insertTextSpanModelAt(e, t) { 23524 let n = this._textSpanModels; 23525 t === 0 && this._textSpanModels.length > 0 && n[0].removePositionAttributes(); 23526 let s = this.getFirstTextSpanIndex() + t; 23527 this._textModel.insertChildAt(e, s), 23528 n.splice(t, 0, e) 23529 } 23530 removeTextSpanModelFrom(e) { 23531 let t = this._textSpanModels; 23532 e < 0 && (e = t.length + e), 23533 t.splice(e, 1); 23534 let n = this.getFirstTextSpanIndex() + e; 23535 this._textModel.removeChildFrom(n) 23536 } 23537 removeTextSpanModels() { 23538 let e = this._textSpanModels 23539 , t = this.getFirstTextSpanIndex(); 23540 for (let n = 0; n < e.length; n++) 23541 this._textModel.removeChildFrom(t); 23542 e.splice(0) 23543 } 23544 getAscent() { 23545 let e = 0 23546 , t = this._textSpanModels 23547 , n = t.length === 1; 23548 for (let s = 0, o = n ? 1 : t.length - 1; s < o; s++) { 23549 let i = t[s]; 23550 e = Math.max(e, i.getAscent()) 23551 } 23552 return e 23553 } 23554 getDescent() { 23555 let e = 0 23556 , t = this._textSpanModels 23557 , n = t.length === 1; 23558 for (let s = 0, o = n ? 1 : t.length - 1; s < o; s++) { 23559 let i = t[s]; 23560 e = Math.min(e, i.getDescent()) 23561 } 23562 return e 23563 } 23564 getLineGap() { 23565 let e = 0 23566 , t = this._textSpanModels 23567 , n = t.length === 1; 23568 for (let s = 0, o = n ? 1 : t.length - 1; s < o; s++) { 23569 let i = t[s] 23570 , r = i.getStylePropertyValue("font-size", !0); 23571 r = parseInt(r); 23572 let a = i.getFont(); 23573 e = Math.min(e, a.getLineGap(r)) 23574 } 23575 return e 23576 } 23577 getBounds() { 23578 let e, t = this._textSpanModels; 23579 for (let n = 0; n < t.length; n++) { 23580 let s = t[n].getBounds(); 23581 s && n === t.length - 1 && (s.width = 0), 23582 e = e ? e.addRect(s) : s 23583 } 23584 return e 23585 } 23586 getOffsetForPoint(e, t) { 23587 let n = e.x 23588 , s = e.y 23589 , o = Number.MAX_VALUE 23590 , i = -Number.MAX_VALUE 23591 , r = 0 23592 , a = 0 23593 , d = this._textSpanModels; 23594 for (let u = 0; u < d.length - 1; u++) { 23595 let h = d[u] 23596 , c = h.getBounds(); 23597 if (t && (s = c.y + c.height / 2), 23598 n >= c.x - r && s >= c.y - r && n <= c.x + c.width + r && s <= c.y + c.height + r) { 23599 let f = h.getTSpan(); 23600 if (sd) { 23601 let p = this._textModel.textElement.ownerSVGElement.createSVGPoint(); 23602 p.x = n, 23603 p.y = s; 23604 let g = f.getCharNumAtPosition(p); 23605 return g === -1 && (g = n < (c.x + c.width) / 2 ? 0 : h.getTextLength() - 1), 23606 a + g 23607 } else { 23608 let p = c.x; 23609 for (let g = 0, y = f.getNumberOfChars(); g < y; g++) { 23610 let m = f.getExtentOfChar(g).width; 23611 if (n < p + m) 23612 return a + g + (n < p + m / 2 ? 0 : 1); 23613 p += m 23614 } 23615 } 23616 } else 23617 c.x < o && (o = c.x), 23618 c.x > i && (i = c.x), 23619 a += h.getTextLength() 23620 } 23621 if (t) { 23622 if (n <= o) 23623 return 0; 23624 if (n >= i) 23625 return a - 1 23626 } 23627 return -1 23628 } 23629 getTextSpanModelAt(e, t) { 23630 e > 0 && t === -1 && e--; 23631 for (let n of this._textSpanModels) { 23632 let s = n.getTextLength(); 23633 if (s > e) 23634 return n; 23635 e -= s 23636 } 23637 return null 23638 } 23639 getCaretBounds(e) { 23640 let t = this._textSpanModels, n, s; 23641 for (n of t) { 23642 if (s = n.getTextLength(), 23643 s > e) 23644 break; 23645 e -= s 23646 } 23647 let o = n.getTSpan(), i; 23648 e <= 0 ? i = o.getStartPositionOfChar(0).x : e >= s ? i = o.getEndPositionOfChar(o.getNumberOfChars() - 1).x : i = o.getStartPositionOfChar(e).x; 23649 let r = this._textModel.textElement 23650 , a = oe.fromSvgValue(r.getAttribute("transform")).tx 23651 , d = this.getAscent() 23652 , u = this.getDescent(); 23653 return new Ve(i + a,this.y - d,0,d - u) 23654 } 23655 breakLine(e, t) { 23656 let n = this._textModel 23657 , s = this._textSpanModels; 23658 if (e === 0) { 23659 let o = s[0] 23660 , i = o.clone(); 23661 i.setLineEndSpan(), 23662 n.insertChildAt(i, n.getChildModelIndex(o)); 23663 let r = new Wn(n,s.slice(0)); 23664 return s.splice(0, s.length, i), 23665 r 23666 } else { 23667 for (let o = 0; o < s.length; o++) { 23668 let i = s[o] 23669 , r = i.getText() 23670 , a = r.length; 23671 if (a >= e) { 23672 if (a > e) { 23673 let h = i.clone(e, a); 23674 s.splice(o + 1, 0, h), 23675 i.setText(r.substring(0, e)), 23676 n.insertChildAt(h, n.getChildModelIndex(i) + 1), 23677 t && (t.addEdit(new Ba(i,e,h.getText(),null)), 23678 t.addEdit(new tr(this,o + 1,null,[h]))) 23679 } 23680 let d = i.clone(0, 0); 23681 d.setLineEndSpan(), 23682 n.insertChildAt(d, n.getChildModelIndex(i) + 1); 23683 let u = new Wn(n,s.slice(o + 1)); 23684 return s.splice(o + 1), 23685 s.push(d), 23686 u 23687 } else 23688 e -= a 23689 } 23690 return new Wn(n,[]) 23691 } 23692 } 23693 splitTextSpan(e, t, n) { 23694 let s = this._textModel 23695 , o = this._textSpanModels 23696 , i = o[e] 23697 , a = i.getText().length; 23698 if (t === 0 || t >= a) 23699 return; 23700 let d = s.getChildModelIndex(i); 23701 s.removeChildFrom(d); 23702 let u = i.clone(0, t) 23703 , h = i.clone(t, a - t); 23704 u.copyPositionAttributes(i), 23705 s.insertChildAt(u, d), 23706 s.insertChildAt(h, d + 1), 23707 o.splice(e, 1, u, h), 23708 n && n.addEdit(new tr(this,e,[i],[u, h])) 23709 } 23710 deleteText(e, t, n) { 23711 let s = this._textSpanModels; 23712 for (let o = 0; o < s.length; ) { 23713 let i = s[o] 23714 , r = i.getText() 23715 , a = r.length; 23716 if (e === 0 && t >= a) { 23717 if (this.removeTextSpanModelFrom(o), 23718 n && n.addEdit(new tr(this,o,[i],[])), 23719 t -= a, 23720 t === 0) 23721 break 23722 } else { 23723 if (e < a) { 23724 let d = Math.min(a - e, t); 23725 n && n.addEdit(new Ba(i,e,r.substring(e, e + d),"")); 23726 let u = r.substring(0, e) + r.substring(e + d); 23727 if (i.setText(u), 23728 e = 0, 23729 t -= d, 23730 t === 0) 23731 break 23732 } else 23733 e -= a; 23734 o++ 23735 } 23736 } 23737 } 23738 insertText(e, t, n, s) { 23739 let o = this._textSpanModels; 23740 for (let i = 0; i < o.length; i++) { 23741 let r = o[i] 23742 , a = r.getText() 23743 , d = a.length; 23744 if (d >= t) { 23745 if (o.length > 1 && (n == null || n.equals(r.textStyle))) 23746 r.setText(a.substring(0, t) + e + a.substring(t)), 23747 s && s.addEdit(new Ba(r,t,"",e)); 23748 else { 23749 let u = r.clone(0, 0); 23750 u.setText(e), 23751 n && (u.textStyle.set(n), 23752 t === d && i === o.length - 1 && o[i + 1].textStyle.set(n)); 23753 let h = i; 23754 t === 0 ? i === 0 && (u.copyPositionAttributes(r), 23755 r.removePositionAttributes()) : (this.splitTextSpan(i, t, s), 23756 h++), 23757 this.insertTextSpanModelAt(u, h), 23758 s && s.addEdit(new tr(this,h,[],[u])) 23759 } 23760 break 23761 } else 23762 t -= d 23763 } 23764 } 23765 async setStyleAttribute(e, t, n, s, o) { 23766 let i = this._textSpanModels; 23767 for (let r = 0; s > 0; r++) { 23768 let a = i[r] 23769 , d = a.textStyle 23770 , u = a.getTextLength(); 23771 n >= u ? n -= u : (d.hasStyleAttribute(e, t) || (n === 0 && s >= u || (n > 0 && (this.splitTextSpan(r, n, o), 23772 n = 0, 23773 r++, 23774 a = i[r], 23775 u = a.getTextLength()), 23776 s < u && (this.splitTextSpan(r, s, o), 23777 a = i[r], 23778 u = a.getTextLength())), 23779 o && o.addEdit(new ky(a,e,a.textStyle[e],t)), 23780 await a.textStyle.setStyleAttribute(e, t)), 23781 s -= u - n, 23782 n = 0) 23783 } 23784 } 23785 toJSON() { 23786 return { 23787 textSpans: this._textSpanModels || [], 23788 y: this.y 23789 } 23790 } 23791 setJSON(e) { 23792 super.setJSON(e), 23793 this.y = e.y; 23794 let t = e.textSpans; 23795 t && Array.isArray(t) && (this.textSpans = t.map(n=>Wn.fromJSON(n))) 23796 } 23797 static fromJSON(e) { 23798 let t = new Wn; 23799 return t.setJSON(e), 23800 t 23801 } 23802} 23803class Nn extends DataView { 23804 constructor(e, t, n) { 23805 super(e, t, n) 23806 } 23807 getUint24(e) { 23808 return this.getUint8(e) << 16 | this.getUint16(e + 1) 23809 } 23810 getFixed(e) { 23811 let t = this.getInt16(e) 23812 , n = this.getInt16(e + 2); 23813 return t + n / 65535 23814 } 23815 getF2Dot14(e) { 23816 let t = this.getUint8(e) 23817 , n = this.getUint8(e + 1); 23818 return -(t >>
23818 6 & 2) + (t >> 6 & 1) + ((t & 63) << 8 | n) / 16384 23819 } 23820 getLongDateTime(e, t) { 23821 let n = this.readUint64(e, t); 23822 return new Date(n * 1e3 - 20828484e5) 23823 } 23824 getTag(e) { 23825 return String.fromCharCode(this.getUint8(e), this.getUint8(e + 1), this.getUint8(e + 2), this.getUint8(e + 3)) 23826 } 23827 getOffset16(e, t=0) { 23828 return t + this.getUint16(t + e, !1) 23829 } 23830 getOffset32(e, t=0) { 23831 return t + this.getUint32(t + e, !1) 23832 } 23833} 23834Nn.prototype.getFWORD = Nn.prototype.getInt16; 23835Nn.prototype.getUFWORD = Nn.prototype.getUint16; 23836Nn.prototype.getCard8 = Nn.prototype.getUint8; 23837Nn.prototype.getCard16 = Nn.prototype.getUint16; 23838class El extends Nn { 23839 tag; 23840 font; 23841 constructor(e, t, n, s, o) { 23842 super(n, s, o), 23843 this.tag = e, 23844 this.font = t 23845 } 23846 init() {} 23847 getFeatureOffsetMap(e, t) { 23848 if (this.byteLength < 8) 23849 return null; 23850 e == null && (e = "DFLT"); 23851 let n = this.getUint16(4), s = this.getUint16(n), o; 23852 for (let h = 0, c = n + 2; h < s; h++, 23853 c += 6) { 23854 let f = this.getTag(c); 23855 if (f === e) { 23856 o = n + this.getOffset16(c + 4); 23857 break 23858 } else 23859 (f === "DFLT" || o == null && f === "latn") && (o = n + this.getOffset16(c + 4)) 23860 } 23861 if (o == null || o === n) 23862 return null; 23863 let i = this.getOffset16(0, o); 23864 if (i === o) 23865 return null; 23866 if (t != null && t !== "DFLT") { 23867 let h = this.getUint16(o + 2) 23868 , c = o + 4; 23869 for (let f = 0; f < h; f++) { 23870 if (this.getTag(c) === e) { 23871 i = o + this.getOffset16(c + 4); 23872 break 23873 } 23874 c += 6 23875 } 23876 } 23877 let r = [] 23878 , a = this.getUint16(i + 4); 23879 for (let h = 0, c = i + 6; h < a; h++, 23880 c += 2) 23881 r.push(this.getUint16(c)); 23882 let d = new Map 23883 , u = this.getUint16(6); 23884 for (let h = 0; h < r.length; h++) 23885 try { 23886 let c = r[h] 23887 , f = this.getTag(u + 2 + 6 * c) 23888 , p = this.getOffset16(6 + 6 * c, u); 23889 d.set(f, p) 23890 } catch (c) { 23891 console.error(c) 23892 } 23893 return d 23894 } 23895 applyFeatures(e, t, n, s) { 23896 let o = this.getFeatureOffsetMap(n ?? "DFLT", s); 23897 if (o == null) 23898 return; 23899 let i = new Map; 23900 for (let a of e) { 23901 let d = o.get(a); 23902 if (d != null) { 23903 let u = this.getUint16(d + 2); 23904 for (let h = 0; h < u; h++) { 23905 let c = this.getUint16(d + 4 + 2 * h); 23906 i.has(c) || i.set(c, a) 23907 } 23908 } 23909 } 23910 let r = Array.from(i.keys()).sort((a,d)=>a - d); 23911 for (let a of r) 23912 this.processLookupList(a, t) 23913 } 23914 processLookupList(e, t, n=0, s=t.length) { 23915 let o = this.getUint16(8) 23916 , i = this.getOffset16(2 + e * 2, o); 23917 if (i !== o) { 23918 let r = this.getUint16(i) 23919 , a = this.getUint16(i + 2) 23920 , d = this.getUint16(i + 4) 23921 , u = this.getUint16(i + 6 + 2 * d) 23922 , h = []; 23923 for (let c = 0; c < d; c++) 23924 h.push(this.getOffset16(6 + c * 2, i)); 23925 if (r === 8) { 23926 for (let c = s - 1; c >= n; c--) 23927 for (let f of h) 23928 if (this.processLookup(r, f, t, c, a, u) !== -1) 23929 break 23930 } else { 23931 let c = t.length; 23932 for (let f = n; f < s; ) { 23933 let p = -1; 23934 for (let g of h) 23935 if (p = this.processLookup(r, g, t, f, a, u), 23936 p !== -1) 23937 break; 23938 if (p === -1) 23939 f++; 23940 else { 23941 f += p; 23942 let g = t.length - c; 23943 g !== 0 && (s += g, 23944 c = t.length) 23945 } 23946 } 23947 } 23948 } 23949 } 23950 getCoverageIndex(e, t) { 23951 if (t >= 0) { 23952 let n = this.getUint16(e); 23953 if (n === 1) { 23954 let s = this.getUint16(e + 2); 23955 return this.searchUint16(t, e + 4, s) 23956 } else if (n === 2) { 23957 let s = this.getUint16(e + 2); 23958 return this.searchRangeUint16(t, e + 4, s, !0) 23959 } else 23960 console.error("Unknown coverage format", n) 23961 } 23962 return -1 23963 } 23964 getClassValue(e, t) { 23965 if (t >= 0) { 23966 let n = this.getUint16(e); 23967 if (n === 1) { 23968 let s = this.getUint16(e + 2); 23969 if (s <= t) { 23970 let o = this.getUint16(e + 4); 23971 if (s + o > t) 23972 return this.getUint16(e + 6 + 2 * (t - s)) 23973 } 23974 } else if (n === 2) { 23975 let s = this.getUint16(e + 2) 23976 , o = this.searchRangeUint16(t, e + 4, s); 23977 return o >= 0 ? o : 0 23978 } 23979 } 23980 return 0 23981 } 23982 searchRangeUint16(e, t, n, s=!1) { 23983 let o = 0 23984 , i = n - 1; 23985 for (; o <= i; ) { 23986 let r = i + o >> 1 23987 , a = t + 6 * r 23988 , d = this.getUint16(a); 23989 if (e < d) 23990 i = r - 1; 23991 else if (e > this.getUint16(a + 2)) 23992 o = r + 1; 23993 else { 23994 let u = this.getUint16(a + 4); 23995 return s && (u += e - d), 23996 u 23997 } 23998 } 23999 return -1 24000 } 24001 searchUint16(e, t, n) { 24002 let s = 0 24003 , o = n - 1; 24004 for (; s < o; ) { 24005 let i = o + s >> 1 24006 , r = this.getUint16(t + 2 * i); 24007 if (e > r) 24008 s = i + 1; 24009 else if (e < r) 24010 o = i - 1; 24011 else 24012 return i 24013 } 24014 return e === this.getUint16(t + 2 * s) ? s : -1 24015 } 24016 matchSeqIds(e, t, n, s, o, i=0, r=0) { 24017 let a = o ? -1 : 1 24018 , d = 0; 24019 for (let u = n; d !== s && u >= 0 && u < t.length; u += a) { 24020 let h = t[u]; 24021 if (h != null) { 24022 let c = h.id; 24023 if (!this.isSkip(c, i, r)) 24024 if (this.getUint16(e + d * 2) === c) 24025 d++; 24026 else 24027 break 24028 } 24029 } 24030 return d === s 24031 } 24032 matchSeqClasses(e, t, n, s, o, i, r=0, a=0) { 24033 let d = i ? -1 : 1 24034 , u = 0; 24035 for (let h = s; u !== o && h >= 0 && h < n.length; h += d) { 24036 let c = n[h]; 24037 if (c != null) { 24038 let f = c.id; 24039 if (!this.isSkip(f, r, a)) { 24040 let p = this.getUint16(t + u * 2); 24041 if (this.getClassValue(e, f) === p) 24042 u++; 24043 else 24044 break 24045 } 24046 } 24047 } 24048 return u === o 24049 } 24050 nestedSeqLookup(e, t, n, s) { 24051 for (let o = 0; o < e; o++) { 24052 let i = this.getUint16(t + o * 4) 24053 , r = s + i; 24054 if (r < n.length) { 24055 let a = this.getUint16(t + o * 4 + 2); 24056 this.processLookupList(a, n, r, r + 1) 24057 } 24058 } 24059 } 24060 matchSeqCoverage(e, t, n, s, o, i, r=0, a=0) { 24061 let d = i ? -1 : 1 24062 , u = 0; 24063 for (let h = s; u < o && h >= 0 && h < n.length; h += d) { 24064 let c = n[h]; 24065 if (c != null) { 24066 let f = c.id; 24067 if (!this.isSkip(f, r, a)) { 24068 let p = e + this.getOffset16(t + u * 2); 24069 if (this.getCoverageIndex(p, f) >= 0) 24070 u++; 24071 else 24072 break 24073 } 24074 } 24075 } 24076 return u === o 24077 } 24078 isSkip(e, t, n) { 24079 if ((t & 30) === 0) 24080 return !1; 24081 { 24082 let s = this.font.getGlyphClass(e) 24083 , o = !1; 24084 switch (s) { 24085 case 1: 24086 o = (t & 2) !== 0; 24087 break; 24088 case 2: 24089 o = (t & 4) !== 0; 24090 break; 24091 case 3: 24092 if ((t & 8) !== 0) 24093 o = !0; 24094 else if ((t & 16) !== 0) { 24095 let i = this.font.tableMap.GDEF; 24096 i && n >= 0 ? o = i.getMarkGlyphSetCoverage(e, n) < 0 : o = !0 24097 } 24098 break 24099 } 24100 return o 24101 } 24102 } 24103} 24104class B5 { 24105 offset; 24106 data; 24107 constructor(e, t=0) { 24108 this.data = e, 24109 this.offset = t 24110 } 24111 readUint8() { 24112 let e = this.data.getUint8(this.offset); 24113 return this.offset++, 24114 e 24115 } 24116 readUint16() { 24117 let e = this.data.getUint16(this.offset); 24118 return this.offset += 2, 24119 e 24120 } 24121 readUint32() { 24122 let e = this.data.getUint32(this.offset); 24123 return this.offset += 4, 24124 e 24125 } 24126} 24127function z5(l=4) { 24128 if (l == null) 24129 return e=>e; 24130 { 24131 const e = 10 ** l 24132 , t = Number.EPSILON * e; 24133 return n=>{ 24134 let s = n * e + t * n; 24135 return (s + (s > 0 ? .5 : -.5) << 0) / e 24136 } 24137 } 24138} 24139function U5(l, e, t) { 24140 let n = ""; 24141 for (let s = 0; s < t; s++) { 24142 let o = e[s]; 24143 o >= 0 && (s > 0 || !l) && (n += " "), 24144 n += o 24145 } 24146 return n 24147} 24148class za { 24149 contours = []; 24150 appendPathData(e) { 24151 this.contours.push(...e.contours) 24152 } 24153 appendContour(e) { 24154 this.contours.push(e) 24155 } 24156 getPointCoordsAt(e) { 24157 for (let t of this.contours) 24158 if (t.length <= e) 24159 e -= t.length; 24160 else { 24161 let n = t[e]; 24162 return n.slice(n.length - 2) 24163 } 24164 return [0, 0] 24165 } 24166 translate(e, t) {
24167 (e !== 0 || t !== 0) && this.contours.forEach(n=>n.forEach(s=>{ 24168 for (let o = 0; o < s.length; ) 24169 s[o++] += e, 24170 s[o++] += t; 24171 return s 24172 } 24173 )) 24174 } 24175 transform(e) { 24176 e != null && !e.isIdentity && this.contours.forEach(t=>t.forEach(n=>e.transformArray(n))) 24177 } 24178 toPaths() { 24179 let e = []; 24180 for (let t of this.contours) { 24181 let n = t[0] 24182 , s = n[0] 24183 , o = n[1] 24184 , i = []; 24185 for (let r = 1; r < t.length; r++) { 24186 n = t[r]; 24187 let a, d, u; 24188 if (n.length === 2) 24189 d = n[0], 24190 u = n[1], 24191 a = [s, o, s, o, d, u, d, u], 24192 s = n[0], 24193 o = n[1]; 24194 else if (n.length === 4) { 24195 let h = n[0] 24196 , c = n[1]; 24197 d = n[2], 24198 u = n[3], 24199 a = [s, o, (s + 2 * h) / 3, (o + 2 * c) / 3, (d + 2 * h) / 3, (u + 2 * c) / 3, d, u] 24200 } else 24201 d = n[4], 24202 u = n[5], 24203 a = [s, o, n[0], n[1], n[2], n[3], d, u]; 24204 i.push(new Mt(a)), 24205 s = d, 24206 o = u 24207 } 24208 e.push(new ft(i,!0)) 24209 } 24210 return e 24211 } 24212 toPathDataString(e) { 24213 let t = z5(e) 24214 , n = ""; 24215 for (let s of this.contours) 24216 if (s.length > 1) { 24217 let o = [] 24218 , i = s[0] 24219 , r = t(i[0]) 24220 , a = t(i[1]); 24221 o.push("M"), 24222 i[0] = r, 24223 i[1] = a; 24224 for (let h = 1; h < s.length; h++) { 24225 i = s[h]; 24226 let c = t(i[i.length - 2] - r), f = t(i[i.length - 1] - a), p; 24227 if (i.length === 2) 24228 c === 0 ? f === 0 ? p = "" : (p = "v", 24229 i[0] = f) : f === 0 ? (p = "h", 24230 i[0] = c) : (p = "l", 24231 i[0] = c, 24232 i[1] = f); 24233 else if (i.length === 4) { 24234 let g = t(i[0] - r) 24235 , y = t(i[1] - a); 24236 g === 0 && c === 0 ? f !== 0 ? (p = "v", 24237 i[0] = f) : p = "" : y === 0 && f === 0 ? c !== 0 ? (p = "h", 24238 i[0] = c) : p = "" : g === 0 && y === 0 || g === c && y === f || c / g === f / y ? (p = "l", 24239 i[0] = c, 24240 i[1] = f) : (p = "q", 24241 i[0] = g, 24242 i[1] = y, 24243 i[2] = c, 24244 i[3] = f) 24245 } else { 24246 let g = t(i[0] - r) 24247 , y = t(i[1] - a) 24248 , m = t(i[2] - r) 24249 , b = t(i[3] - a); 24250 p = "c", 24251 i[0] = g, 24252 i[1] = y, 24253 i[2] = m, 24254 i[3] = b, 24255 i[4] = c, 24256 i[5] = f 24257 } 24258 o.push(p), 24259 r += c, 24260 a += f 24261 } 24262 for (let h = 0; h < o.length; h++) { 24263 let c = o[h]; 24264 if (c === "h" || c === "v" || c === "l") { 24265 let f = s[h]; 24266 for (; c === o[h + 1]; ) { 24267 let p = s[h + 1]; 24268 if (c === "h" || c === "v") 24269 p[0] += f[0], 24270 o[h] = ""; 24271 else if (c === "l") 24272 if (p[0] / f[0] === p[1] / f[1]) 24273 p[0] += f[0], 24274 p[1] += f[1], 24275 o[h] = ""; 24276 else 24277 break; 24278 f = p, 24279 h++ 24280 } 24281 f[0] === 0 && (c === "h" || c === "v" || c === "l" && f[1] === 0) && (o[h
24281] = "") 24282 } else if (c === "q") { 24283 let f = h; 24284 for (; f > 0; ) { 24285 let p = o[f - 1]; 24286 if (p === "q") { 24287 f--; 24288 break 24289 } else if (p === "t") 24290 f--; 24291 else 24292 break 24293 } 24294 if (f < h) { 24295 let p = s[f] 24296 , g = p[0] - p[2] 24297 , y = p[1] - p[3]; 24298 for (f++; f < h; ) { 24299 let b = s[f]; 24300 g = -b[0] - g, 24301 y = -b[1] - y, 24302 f++ 24303 } 24304 let m = s[h]; 24305 g === -m[0] && y === -m[1] && (m.splice(0, 2), 24306 o[h] = "t") 24307 } 24308 } 24309 } 24310 let d = "" 24311 , u = !1; 24312 for (let h = 0; h < o.length; h++) { 24313 let c = o[h]; 24314 if (c !== "") { 24315 c !== d && (n += c, 24316 u = !0); 24317 let f = 0; 24318 switch (c) { 24319 case "v": 24320 case "h": 24321 f = 1; 24322 break; 24323 case "l": 24324 case "t": 24325 case "M": 24326 f = 2; 24327 break; 24328 case "q": 24329 f = 4; 24330 break; 24331 case "c": 24332 f = 6; 24333 break 24334 } 24335 f > 0 && (n += U5(u, s[h], f)), 24336 u = !1, 24337 d = c 24338 } 24339 } 24340 n += "z" 24341 } 24342 return n 24343 } 24344} 24345const ag = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "e", "e-", "", "-"]; 24346class G5 extends El { 24347 globalSubrIndexOffs; 24348 globalSubrBias; 24349 subrIndexOffs; 24350 charStringsIndexOffs; 24351 defaultWidthX = 0; 24352 nominalWidthX = 0; 24353 fdArrayOffs = 0; 24354 fdSelectOffs = 0; 24355 isCIDFont = !1; 24356 init() { 24357 this.getCard8(0), 24358 this.getCard8(1); 24359 let t = this.getCard8(2) 24360 , n = this.getIndexEndOffset(t) 24361 , s = this.getIndexEndOffset(n); 24362 this.globalSubrIndexOffs = this.getIndexEndOffset(s); 24363 let o = this.getCard16(this.globalSubrIndexOffs); 24364 this.globalSubrBias = this.getSubrNumberBias(o); 24365 let i = this.readCFFDictIndexData(n); 24366 if (i.length > 1) 24367 throw new Error("CFF table contains multiple fonts"); 24368 let r = i[0]; 24369 this.charStringsIndexOffs = r[17] ? r[17][0] : 0; 24370 let a = r[1230] || []; 24371 if (this.isCIDFont = a[0] != null && a[1] != null, 24372 this.isCIDFont && (this.fdArrayOffs = r[1236][0] || 0, 24373 this.fdSelectOffs = r[1237][0] || 0), 24374 r[18] != null && r[18][0] > 0) { 24375 let d = r[18][1] 24376 , u = this.readCFFDictData(d, d + r[18][0]); 24377 this.defaultWidthX = u[20] || 0, 24378 this.nominalWidthX = u[21] || 0, 24379 this.subrIndexOffs = d + u[19][0] 24380 } 24381 } 24382 getFDIndex(e) { 24383 let t = this.fdSelectOffs 24384 , n = this.getCard8(t++); 24385 if (n === 0) 24386 return this.getCard8(t + e); 24387 if (n === 3) { 24388 let s = this.getCard16(t); 24389 t += 2; 24390 let o = this.getCard16(t); 24391 if (t += 2, 24392 o !== 0) 24393 throw new Error("CFF - Illegal first GID in FDSelect table format 3: " + o); 24394 let i; 24395 for (let r = 0; r < s; r++) { 24396 let a = this.getCard8(t++); 24397 if (i = this.getCard16(t), 24398 t += 2, 24399 e >= o && e < i) 24400 return a; 24401 o = i 24402 } 24403 throw new Error("Glyph index out of range " + e) 24404 } else 24405 throw new Error("CFF - Unsupported FDSelect format " + n) 24406 } 24407 readCFFDictIndexData(e) { 24408 const t = []; 24409 let n = this.getUint16(e) 24410 , s = this.getOffSize(e + 2) 24411 , o = e + 3 24412 , i = e + 2 + s * (n + 1) 24413 , r = i + this.getOffset(o, s); 24414 for (let a = 0; a < n; a++) { 24415 let d = r; 24416 o += s, 24417 r = i + this.getOffset(o, s), 24418 t.push(this.readCFFDictData(d, r)) 24419 } 24420 return t 24421 } 24422 readCFFDictData(e, t) { 24423 let n = [] 24424 , s = [] 24425 , o = new B5(this,e); 24426 for (; o.offset < t; ) { 24427 let i = o.readUint8(); 24428 if (i <= 21) { 24429 let r = i; 24430 r === 12 && (r = 1200 + o.readUint8()), 24431 n[r] = s, 24432 s = [] 24433 } else { 24434 let r = this.readOperand(i, o); 24435 s.push(r) 24436 } 24437 } 24438 return n 24439 } 24440 readOperand(e, t) { 24441 if (e === 28) 24442 return t.readUint16(); 24443 if (e === 29) 24444 return t.readUint32(); 24445 if (e === 30) { 24446 let n = ""; 24447 for (let s = 0; ; s++) { 24448 let o = t.readUint8() 24449 , i = o >> 4; 24450 if (i === 15) 24451 break; 24452 if (n += ag[i], 24453 i = o & 15, 24454 i === 15) 24455 break; 24456 if (n += ag[i], 24457 s >= 1024) 24458 throw new Error("Unexpectedly long BCD") 24459 } 24460 return parseFloat(n) 24461 } else { 24462 if (e >= 32 && e <= 246) 24463 return e - 139; 24464 { 24465 let n = t.readUint8(); 24466 if (e >= 247 && e <= 250) 24467 return (e - 247) * 256 + n + 108; 24468 if (e >= 251 && e <= 254) 24469 return -(e - 251) * 256 - n - 108 24470 } 24471 } 24472 throw new Error("Unknown first byte " + e) 24473 } 24474 getOffSize(e) { 24475 return this.getUint8(e) 24476 } 24477 getOffset(e, t) { 24478 let n = 0; 24479 for (let s = 0; s < t; s += 1) 24480 n <<= 8, 24481 n += this.getUint8(e + s); 24482 return n 24483 } 24484 getIndexEndOffset(e) { 24485 let t = this.getCard16(e); 24486 if (t === 0) 24487 return e + 2; 24488 { 24489 let n = this.getOffSize(e + 2) 24490 , s = e + 2 + n * (t + 1); 24491 return s + this.getOffset(s + 1 - n, n) 24492 } 24493 } 24494 getSubrNumberBias(e) { 24495 return e < 1240 ? 107 : e < 33900 ? 1131 : 32768 24496 } 24497 getIndexObject(e, t) { 24498 let n = this.getCard16(e) 24499 , s = this.getOffSize(e + 2) 24500 , o = e + 2 + s * (n + 1) 24501 , i = o + this.getOffset(e + 3 + t * s, s) 24502 , r = o + this.getOffset(e + 3 + (t + 1) * s, s); 24503 return new Uint8Array(this.buffer,this.byteOffset + i,r - i) 24504 } 24505 getIndexObjectOffset(e, t) { 24506 let n = this.getCard16(e) 24507 , s = this.getOffSize(e + 2); 24508 return e + 2 + s * (n + 1) + this.getOffset(e + 3 + t * s, s) 24509 } 24510 getPathData(e, t=1, n=0, s=0, o=1, i=0, r=0) { 24511 let a; 24512 this.defaultWidthX; 24513 let d = this.nominalWidthX; 24514 if (this.isCIDFont) { 24515 let x = this.getFDIndex(e) 24516 , P = this.getIndexObjectOffset(this.fdArrayOffs, x) 24517 , C = this.getIndexObjectOffset(this.fdArrayOffs, x + 1) 24518 , T = this.readCFFDictData(P, C) 24519 , k = this.readCFFDictData(T[18][1], T[18][1] + T[18][0]); 24520 a = T[18][1] + k[19][0], 24521 k[20], 24522 d = k[21] || 0 24523 } else 24524 a = this.subrIndexOffs; 24525 let u = this.getIndexObject(this.charStringsIndexOffs, e) 24526 , h = new za 24527 , c = [] 24528 , f = 0 24529 , p = 0 24530 , g = [] 24531 , y = 0 24532 , m = ()=>{ 24533 d + g.shift() 24534 } 24535 , b = ()=>{ 24536 c.length > 0 && (h.appendContour(c), 24537 c = []) 24538 } 24539 , M = (...x)=>{ 24540 let P = []; 24541 for (let C = 0; C < x.length; ) { 24542 let T = x[C++] || 0
24543 , k = x[C++] || 0; 24544 f += T, 24545 p -= k; 24546 let D = t * f + s * p + i 24547 , I = n * f + o * p + r; 24548 P.push(D, I) 24549 } 24550 c.push(P) 24551 } 24552 , S = x=>{ 24553 for (let P = 0; P < x.length; P++) { 24554 let C = x[P]; 24555 if (C < 32) 24556 switch (C) { 24557 case 12: 24558 switch (C = x[++P], 24559 C) { 24560 case 34: 24561 { 24562 let T = p; 24563 M(g.shift(), 0, g.shift(), g.shift(), g.shift(), 0), 24564 M(g.shift(), 0, g.shift(), T - p, g.shift(), 0); 24565 break 24566 } 24567 case 35: 24568 { 24569 M(g.shift(), g.shift(), g.shift(), g.shift(), g.shift(), g.shift()), 24570 M(g.shift(), g.shift(), g.shift(), g.shift(), g.shift(), g.shift()), 24571 g.shift(); 24572 break 24573 } 24574 case 36: 24575 { 24576 let T = p; 24577 M(g.shift(), g.shift(), g.shift(), g.shift(), g.shift(), 0), 24578 M(g.shift(), 0, g.shift(), g.shift(), g.shift(), T - p); 24579 break 24580 } 24581 case 37: 24582 { 24583 let T = f 24584 , k = p; 24585 M(g.shift(), g.shift(), g.shift(), g.shift(), g.shift(), g.shift()), 24586 Math.abs(f - T) > Math.abs(p - k) ? M(g.shift(), g.shift(), g.shift(), g.shift(), g.shift(), k - p) : M(g.shift(), g.shift(), g.shift(), g.shift(), T - f, g.shift()); 24587 break 24588 } 24589 default: 24590 console.warn("unknown operator 12" + C) 24591 } 24592 break; 24593 case 5: 24594 for (; g.length >= 2; ) 24595 M(g.shift(), g.shift()); 24596 break; 24597 case 6: 24598 for (; g.length >= 1; ) 24599 M(g.shift(), 0), 24600 g.length >= 1 && M(0, g.shift()); 24601 break; 24602 case 7: 24603 for (; g.length >= 1; ) 24604 M(0, g.shift()), 24605 g.length >= 1 && M(g.shift(), 0); 24606 break; 24607 case 8: 24608 for (; g.length >= 6; ) 24609 M(g.shift(), g.shift(), g.shift(), g.shift(), g.shift(), g.shift()); 24610 break; 24611 case 4: 24612 b(), 24613 g.length > 1 && m(), 24614 M(0, g.pop()); 24615 break; 24616 case 21: 24617 b(), 24618 g.length > 2 && m(), 24619 M(g.shift(), g.shift()); 24620 break; 24621 case 22: 24622 b(), 24623 g.length > 1 && m(), 24624 M(g.pop(), 0); 24625 break; 24626 case 24: 24627 for (; g.length >= 8; ) 24628 M(g.shift(), g.shift(), g.shift(), g.shift(), g.shift(), g.shift()); 24629 M(g.shift(), g.shift()); 24630 break; 24631 case 25: 24632 for (; g.length >= 8; ) 24633 M(g.shift(), g.shift()); 24634 M(g.shift(), g.shift(), g.shift(), g.shift(), g.shift(), g.shift()); 24635 break; 24636 case 26: 24637 for (; g.length > 0; ) { 24638 let T = g.length % 2 === 1 ? g.shift() : 0; 24639 M(T, g.shift(), g.shift(), g.shift(), 0, g.shift()) 24640 } 24641 break; 24642 case 27: 24643 for (; g.length > 0; ) { 24644 let T = g.length % 2 === 1 ? g.shift() : 0 24645 , k = g.shift(); 24646 M(k, T, g.shift(), g.shift(), g.shift(), 0) 24647 } 24648 break; 24649 case 30: 24650 for (; g.length > 0; ) 24651 if (M(0, g.shift(), g.shift(), g.shift(), g.shift(), g.length === 1 ? g.shift() : 0), 24652 g.length > 0) { 24653 let T = g.shift() 24654 , k = g.shift() 24655 , D = g.shift() 24656 , I = g.shift() 24657 , F = g.length === 1 ? g.shift() : 0; 24658 M(T, 0, k, D, F, I) 24659 } 24660 break; 24661 case 31: 24662 for (; g.length > 0; ) { 24663 let T = g.shift() 24664 , k = g.shift() 24665 , D = g.shift() 24666 , I = g.shift() 24667 , F = g.length === 1 ? g.shift() : 0; 24668 M(T, 0, k, D, F, I), 24669 g.length > 0 && M(0, g.shift(), g.shift(), g.shift(), g.shift(), g.length === 1 ? g.shift() : 0) 24670 } 24671 break; 24672 case 10: 24673 { 24674 let T = this.getCard16(a)
24675 , k = this.getSubrNumberBias(T) 24676 , D = g.pop() + k 24677 , I = this.getIndexObject(a, D); 24678 S(I) 24679 } 24680 break; 24681 case 29: 24682 { 24683 let T = g.pop() + this.globalSubrBias 24684 , k = this.getIndexObject(this.globalSubrIndexOffs, T); 24685 S(k) 24686 } 24687 break; 24688 case 28: 24689 g.push((x[++P] << 8 | x[++P]) << 16 >> 16); 24690 break; 24691 case 14: 24692 b(); 24693 break; 24694 case 11: 24695 return; 24696 case 1: 24697 case 3: 24698 case 18: 24699 case 19: 24700 case 20: 24701 case 23: 24702 g.length % 2 === 1 && m(), 24703 y += g.length >> 1, 24704 g.splice(0), 24705 (C === 19 || C === 20) && (P += Math.ceil(y / 8)); 24706 break; 24707 default: 24708 console.warn("Unknown charstring operator " + C) 24709 } 24710 else if (C === 255) 24711 g.push((x[++P] << 24 | x[++P] << 16 | x[++P] << 8 | x[++P]) / 65536); 24712 else if (C >= 251) { 24713 let T = x[++P]; 24714 g.push(-(C - 251) * 256 - T - 108) 24715 } else if (C >= 247) { 24716 let T = x[++P]; 24717 g.push((C - 247) * 256 + T + 108) 24718 } else 24719 g.push(C - 139) 24720 } 24721 } 24722 ; 24723 return S(u), 24724 b(), 24725 h 24726 } 24727} 24728class H5 extends El { 24729 subtableFormat; 24730 subtableData; 24731 init() { 24732 let e = this.getUint16(2), t = -1, n; 24733 for (let s = 0, o = 4; s < e; s++, 24734 o += 8) { 24735 let i = this.getUint16(o) 24736 , r = this.getUint16(o + 2) 24737 , a = $5(i, r); 24738 a > t && (t = a, 24739 n = this.getUint32(o + 4)) 24740 } 24741 if (n == null) 24742 throw new Error("No supported cmap tables found"); 24743 this.subtableFormat = this.getUint16(n), 24744 this.subtableData = new DataView(this.buffer,this.byteOffset + n) 24745 } 24746 getGlyphIdForCode(e) { 24747 switch (this.subtableFormat) { 24748 case 0: 24749 return this._getIndexForCodeFormat0(e, this.subtableData); 24750 case 4: 24751 return this._getIndexForCodeFormat4(e, this.subtableData); 24752 case 12: 24753 return this._getIndexForCodeFormat12(e, this.subtableData); 24754 case 13: 24755 return this._getIndexForCodeFormat13(e, this.subtableData); 24756 default: 24757 return 0 24758 } 24759 } 24760 _getIndexForCodeFormat0(e, t) { 24761 return e < 0 || e > 255 ? 0 : t.getUint8(6 + e) 24762 } 24763 _getIndexForCodeFormat12(e, t) { 24764 let n = t.getUint32(12) 24765 , s = 0 24766 , o = 0 24767 , i = n - 1; 24768 for (; o <= i; ) { 24769 let r = o + i >>> 1 24770 , a = r * 12 + 16 24771 , d = t.getUint32(a); 24772 if (d > e) 24773 i = r - 1; 24774 else if (t.getUint32(a + 4) < e) 24775 o = r + 1; 24776 else { 24777 s = t.getUint32(a + 8) + (e - d); 24778 break 24779 } 24780 } 24781 return s 24782 } 24783 _getIndexForCodeFormat13(e, t) { 24784 let n = t.getUint32(12) 24785 , s = 0 24786 , o = n - 1; 24787 for (; s <= o; ) { 24788 let i = s + o >>> 1 24789 , r = i * 12 + 16; 24790 if (t.getUint32(r) > e) 24791 o = i - 1; 24792 else if (t.getUint32(r + 4) < e) 24793 s = i + 1; 24794 else 24795 return t.getUint32(r + 8) 24796 } 24797 return 0 24798 } 24799 _getIndexForCodeFormat4(e, t) { 24800 let n = 0 24801 , s = t.getUint16(6) / 2 24802 , o = -1 24803 , i = 0 24804 , r = s; 24805 for (; i < r; ) { 24806 let a = i + r >>> 1 24807 , d = a * 2 + 14; 24808 t.getUint16(d) < e ? i = a + 1 : (r = a, 24809 o = a) 24810 } 24811 if (o >= 0) { 24812 let a = 16 + 2 * s + 2 * o 24813 , d = t.getUint16(a); 24814 if (d <= e) { 24815 let u = t.getInt16(a + 2 * s) 24816 , h = a + 4 * s 24817 , c = t.getUint16(h); 24818 if (c !== 0) { 24819 let f = c + (e - d) * 2 + h; 24820 n = t.getUint16(f), 24821 n !== 0 && (n = n + u & 65535) 24822 } else 24823 n = e + u & 65535 24824 } 24825 } 24826 return n 24827 } 24828} 24829function $5(l, e) { 24830 if (l === 0) 24831 switch (e) { 24832 case 0: 24833 return 1; 24834 case 1: 24835 return 2; 24836 case 2: 24837 return 3; 24838 case 3: 24839 return 4; 24840 case 4: 24841 return 6 24842 } 24843 else if (l === 3) 24844 switch (e) { 24845 case 0: 24846 return 0; 24847 case 1: 24848 return 3; 24849 case 10: 24850 return 5 24851 } 24852 return -1 24853}
24854class X5 extends El { 24855 init() {} 24856 getGlyphClass(e) { 24857 let t = this.getOffset16(4); 24858 return t > 0 ? this.getClassValue(t, e) : 0 24859 } 24860 getMarkGlyphSetCoverage(e, t) { 24861 if (this.getUint16(2) >= 2) { 24862 let s = this.getOffset16(12) 24863 , o = this.getOffset32(4 + 4 * t, s); 24864 return this.getCoverageIndex(o, e) 24865 } 24866 return -1 24867 } 24868} 24869class Y5 extends El { 24870 getPathData(e, t=1, n=0, s=0, o=1, i=0, r=0) { 24871 let a = this.font.tableMap.loca.getOffsetForGlyphId(e); 24872 if (a >= 0) { 24873 let d = this.getInt16(a); 24874 return d >= 0 ? this.getSimpleGlyphPathData(a, d, t, n, s, o, i, r) : this.getCompoundGlyphPathData(a, t, n, s, o, i, r) 24875 } else 24876 return new za 24877 } 24878 getSimpleGlyphPathData(e, t, n, s, o, i, r, a) { 24879 e += 10; 24880 let d = new Uint16Array(t); 24881 for (let m = 0; m < t; m++, 24882 e += 2) 24883 d[m] = this.getUint16(e); 24884 let u = this.getUint16(e); 24885 e += 2 + u; 24886 let h = d[d.length - 1] + 1, c = new Int8Array(h), f; 24887 for (let m = 0; m < h; ) 24888 if (f = this.getUint8(e++), 24889 c[m++] = f, 24890 f & 8) { 24891 let b = this.getUint8(e++); 24892 c.fill(f, m, m += b) 24893 } 24894 let p = new Float32Array(h * 2) 24895 , g = 0; 24896 for (let m = 0; m < h; m++) 24897 f = c[m], 24898 f & 2 ? (f & 16 ? g += this.getUint8(e) : g -= this.getUint8(e), 24899 e++) : f & 16 || (g += this.getInt16(e), 24900 e += 2), 24901 p[2 * m] = g; 24902 let y = 0; 24903 for (let m = 0; m < h; m++) 24904 f = c[m], 24905 f & 4 ? (f & 32 ? y -= this.getUint8(e) : y += this.getUint8(e), 24906 e++) : f & 32 || (y -= this.getInt16(e), 24907 e += 2), 24908 p[2 * m + 1] = y; 24909 if (r !== 0 || a !== 0 || n !== 1 || s !== 0 || o !== 0 || i !== 1) 24910 for (let m = 0; m < p.length; m += 2) { 24911 let b = p[m] 24912 , M = p[m + 1]; 24913 p[m] = n * b + o * M + r, 24914 p[m + 1] = s * b + i * M + a 24915 } 24916 return this.toPathData(d, c, p) 24917 } 24918 toPathData(e, t, n) { 24919 let s = new za, o, i = 0, r = 0, a, d = 0, u = 0, h, c = -1; 24920 for (let f = 0; f < e.length; f++) { 24921 let p = [null]; 24922 h = c + 1, 24923 c = e[f]; 24924 for (let g = h; g <= c; g++) { 24925 let y = t[g] 24926 , m = n[2 * g] 24927 , b = n[2 * g + 1] 24928 , M = (y & 1) !== 0; 24929 g === h ? (i = m, 24930 r = b, 24931 o = M, 24932 M && (p[0] = [m, b])) : (M ? a ? p.push([m, b]) : p.push([d, u, m, b]) : a || p.push([d, u, (m + d) / 2, (b + u) / 2]), 24933 g === c && (o || (p[0] = [M ? m : (m + i) / 2, M ? b : (b + r) / 2]), 24934 M || p.push([m, b, o ? i : (m + i) / 2, o ? r : (b + r) / 2]))), 24935 d = m, 24936 u = b, 24937 a = M 24938 } 24939 p.length > 1 && s.appendContour(p) 24940 } 24941 return s 24942 } 24943 getCompoundGlyphPathData(e, t=1, n=0, s=0, o=1, i=0, r=0) { 24944 e += 10; 24945 let a = new za, d; 24946 do { 24947 d = this.getUint16(e); 24948 let u = this.getUint16(e + 2); 24949 e += 4; 24950 let h = 1 24951 , c = 0 24952 , f = 0 24953 , p = 1 24954 , g = 0 24955 , y = 0 24956 , m = -1 24957 , b = -1; 24958 d & 1 ? (d & 2 ? (g = this.getInt16(e), 24959 y = -this.getInt16(e + 2)) : (m = this.getUint16(e), 24960 b = this.getUint16(e + 2)), 24961 e += 4) : (d & 2 ? (g = this.getInt8(e), 24962 y = -this.getInt8(e + 1)) : (m = this.getUint8(e), 24963 b = this.getUint8(e + 1)), 24964 e += 2), 24965 d & 8 ? (h = this.getF2Dot14(e), 24966 p = h, 24967 e += 2) : d & 64 ? (h = this.getF2Dot14(e), 24968 p = this.getF2Dot14(e + 2), 24969 e += 4) : d & 128 && (h = this.getF2Dot14(e), 24970 c = this.getF2Dot14(e + 2), 24971 f = this.getF2Dot14(e + 4), 24972 p = this.getF2Dot14(e + 6), 24973 e += 8); 24974 let M = t * h + s * c 24975 , S = n * h + o * c 24976 , x = t * f + s * p 24977 , P = n * f + o * p 24978 , C = i + t * g + s * y 24979 , T = r + n * g + o * y 24980 , k = this.getPathData(u, M, S, x, P, C, T); 24981 if ((d & 2) === 0) { 24982 let D = a.getPointCoords(m) 24983 , I = k.getPointCoords(b) 24984 , F = I[0] - D[0] 24985 , Y = I[1] - D[1]; 24986 k.translate(F, Y) 24987 }
24988 k.contours.forEach(D=>a.appendContour(D)) 24989 } while (d & 32); 24990 return a 24991 } 24992 getXMin(e) { 24993 let t = this.font.tableMap.loca.getOffsetForGlyphId(e); 24994 return t >= 0 ? this.getInt16(t + 2) : 0 24995 } 24996 getYMin(e) { 24997 let t = this.font.tableMap.loca.getOffsetForGlyphId(e); 24998 return t >= 0 ? this.getInt16(t + 4) : 0 24999 } 25000} 25001class K5 extends El { 25002 init() {} 25003 processLookup(e, t, n, s, o, i) { 25004 let r = this.getUint16(t); 25005 if (e === 1) { 25006 if (r === 1) 25007 return this.positioningLookup1_1(t, n, s); 25008 if (r === 2) 25009 return this.positioningLookup1_2(t, n, s) 25010 } else if (e === 2) { 25011 if (r === 1) 25012 return this.positioningLookup2_1(t, n, s, o); 25013 if (r === 2) 25014 return this.positioningLookup2_2(t, n, s, o) 25015 } else if (e === 3) { 25016 if (r === 1) 25017 return this.positioningLookup3_1(t, n, s, o, i) 25018 } else if (e === 4) { 25019 if (r === 1) 25020 return this.positioningLookup4_1(t, n, s, o, i) 25021 } else if (e === 5) { 25022 if (r === 1) 25023 return this.positioningLookup5_1(t, n, s, o, i) 25024 } else if (e === 6) { 25025 if (r === 1) 25026 return this.positioningLookup6_1(t, n, s, o, i) 25027 } else if (e === 7) { 25028 if (r === 1) 25029 return this.positioningLookup7_1(t, n, s, o, i); 25030 if (r === 2) 25031 return this.positioningLookup7_2(t, n, s, o, i); 25032 if (r === 3) 25033 return this.positioningLookup7_3(t, n, s, o, i) 25034 } else if (e === 8) { 25035 if (r === 1) 25036 return this.positioningLookup8_1(t, n, s, o, i); 25037 if (r === 2) 25038 return this.positioningLookup8_2(t, n, s, o, i); 25039 if (r === 3) 25040 return this.positioningLookup8_3(t, n, s, o, i) 25041 } else if (e === 9 && r === 1) 25042 return this.positioningLookup9_1(t, n, s, o, i); 25043 return console.error("Unsupported positioning lookupType " + e + "." + r), 25044 -1 25045 } 25046 positioningLookup1_1(e, t, n) { 25047 let s = this.getOffset16(2, e) 25048 , o = t[n].id; 25049 if (this.getCoverageIndex(s, o) >= 0) { 25050 let r = this.getUint16(e + 4); 25051 return this.getPosData(e + 6, r, t, n), 25052 1 25053 } 25054 return -1 25055 } 25056 positioningLookup1_2(e, t, n) { 25057 let s = this.getOffset16(2, e) 25058 , o = t[n].id 25059 , i = this.getCoverageIndex(s, o); 25060 if (i >= 0) { 25061 let r = this.getUint16(e + 4) 25062 , a = Ui(r) 25063 , d = e + 8 + a * i; 25064 return this.getPosData(d, r, t, n), 25065 1 25066 } 25067 return -1 25068 } 25069 positioningLookup2_1(e, t, n, s) { 25070 let o = this.nextGlyphIndex(t, n, s); 25071 if (o < 0) 25072 return -1; 25073 let i = this.getOffset16(2, e) 25074 , r = t[n].id; 25075 if (r >= 0) { 25076 let a = this.getCoverageIndex(i, r); 25077 if (a >= 0) { 25078 let d = t[o].id; 25079 if (d >= 0) { 25080 let u = this.getOffset16(10 + 2 * a, e) 25081 , h = this.getUint16(u) 25082 , c = this.getUint16(e + 4) 25083 , f = this.getUint16(e + 6) 25084 , p = Ui(c) 25085 , g = Ui(f) 25086 , y = 0 25087 , m = h - 1; 25088 for (; y <= m; ) { 25089 let b = m + y >> 1 25090 , M = u + 2 + b * (2 + p + g) 25091 , S = this.getUint16(M); 25092 if (S < d) 25093 y = b + 1; 25094 else if (S > d) 25095 m = b - 1; 25096 else 25097 return this.getPosData(M + 2, c, t, n), 25098 this.getPosData(M + 2 + p, f, t, o), 25099 1 25100 } 25101 } 25102 } 25103 } 25104 return -1 25105 } 25106 positioningLookup2_2(e, t, n, s) { 25107 let o = this.nextGlyphIndex(t, n, s); 25108 if (o < 0) 25109 return -1; 25110 let i = this.getOffset16(2, e) 25111 , r = this.getUint16(e + 14) 25112 , a = t[n].id; 25113 if (this.getCoverageIndex(i, a) >= 0) { 25114 let u = t[o].id 25115 , h = this.getOffset16(8, e) 25116 , c = this.getOffset16(10, e) 25117 , f = this.getClassValue(h, a) 25118 , p = this.getClassValue(c, u); 25119 if (p >= 0) { 25120 let g = this.getUint16(e + 4) 25121 , y = this.getUint16(e + 6) 25122 , m = Ui(g) 25123 , b = Ui(y) 25124 , M = e + 16 + (f * r + p) * (m + b); 25125 return this.getPosData(M, g, t, n), 25126 this.getPosData(M + m, y, t, o), 25127 1 25128 } 25129 } 25130 return -1 25131 } 25132 positioningLookup3_1(e, t, n, s, o) { 25133 let i = this.nextGlyphIndex(t, n, s, o); 25134 if (i < 0) 25135 return -1; 25136 let r = this.getOffset16(2, e) 25137 , a = t[n] 25138 , d = t[i] 25139 , u = this.getCoverageIndex(r, a.id); 25140 if (u < 0) 25141 return -1; 25142 let h = e + 6 + 4 * u 25143 , c = e + this.getOffset16(h + 2); 25144 if (c === e) 25145 return -1; 25146 let f = this.getCoverageIndex(r, d.id); 25147 if (f < 0) 25148 return -1; 25149 let p = e + 6 + 4 * f 25150 , g = e + this.getOffset16(p); 25151 if (g === e) 25152 return -1; 25153 let y = this.getUint16(c) 25154 , m = this.getUint16(g); 25155 if (m === 1 && y === 1) { 25156 let b = this.getInt16(c + 2) 25157 , M = this.getInt16(c + 4) 25158 , S = this.getInt16(g + 2) 25159 , x = this.getInt16(g + 4); 25160 return (s & 1) !== 0 ? (d.setAdvance(b), 25161 a.setPositioning(-S, d.getPosY() + x - M), 25162 a.addAdvance(-S, !0)) : (a.setAdvance(b), 25163 d.setPositioning(-S, a.getPosY() + M - x), 25164 d.addAdvance(-S, !0)), 25165 1 25166 } else 25167 console.error("Unsupported anchor format " + m + ", " + y); 25168 return -1 25169 } 25170 positioningLookup4_1(e, t, n, s, o) { 25171 let i = n - 1; 25172 for (; i >= 0; ) { 25173 let f = this.font.getGlyphClass(t[i].id); 25174 if (f === 3 || this.isSkip(t[i].id, s, o)) 25175 i--; 25176 else { 25177 f !== 1 && (i = -1); 25178 break 25179 } 25180 } 25181 if (i < 0) 25182 return -1; 25183 let r = this.getOffset16(2, e) 25184 , a = this.getOffset16(4, e) 25185 , d = this.getUint16(e + 6) 25186 , u = t[n] 25187 , h = u.id 25188 , c = this.getCoverageIndex(r, h); 25189 if (c >= 0) { 25190 let f = t[i] 25191 , p = this.getCoverageIndex(a, f.id); 25192 if (p >= 0) { 25193 let g = this.getOffset16(8, e) 25194 , y = g + 2 + c * 4 25195 , m = this.getUint16(y) 25196 , b = g + this.getOffset16(y + 2) 25197 , M = this.getOffset16(10, e) 25198 , S = M + 2 + p * d * 2 25199 , x = M + this.getOffset16(S + m * 2) 25200 , P = this.getAnchorCoords(b) 25201 , C = this.getAnchorCoords(x); 25202 return u.setPositioning(f.getPosX() + C[0] - P[0], f.getPosY() + C[1] - P[1]), 25203 u.isCombined = !0, 25204 1 25205 } 25206 } 25207 return -1 25208 } 25209 positioningLookup5_1(e, t, n, s, o) { 25210 let i = n - 1; 25211 for (; i >= 0; ) { 25212 let h = this.font.getGlyphClass(t[i].id); 25213 if (h === 3 || this.isSkip(t[i].id, s, o)) 25214 i--; 25215 else { 25216 h !== 2 && (i = -1); 25217 break 25218 } 25219 } 25220 if (i < 0) 25221 return -1; 25222 let r = this.getOffset16(2, e) 25223 , a = t[n] 25224 , d = a.id 25225 , u = this.getCoverageIndex(r, d); 25226 if (u >= 0) { 25227 let h = this.getOffset16(4, e) 25228 , c = t[i].id 25229 , f = this.getCoverageIndex(h, c); 25230 if (f >= 0) { 25231 let p = this.getOffset16(8, e) 25232 , g = p + 2 + u * 4 25233 , y = this.getUint16(g) 25234 , m = p + this.getOffset16(g + 2) 25235 , b = this.getOffset16(10, e) 25236 , M = this.getOffset16(2 + f * 2, b) 25237 , S = this.getUint16(M); 25238 for (let x = 0; x < S; x++) { 25239 let P = this.getOffset16(2 + y * 2, M); 25240 if (P !== M) { 25241 let C = this.getAnchorCoords(P) 25242 , T = this.getAnchorCoords(m) 25243 , k = t[i]; 25244 a.setPositioning(k.getPosX() + C[0] - T[0], k.getPosY() + C[1] - T[1]), 25245 a.isCombined = !0; 25246 break 25247 } 25248 } 25249 return 2 25250 } 25251 } 25252 return -1 25253 } 25254 positioningLookup6_1(e, t, n, s, o) { 25255 let i = n - 1; 25256 for (; i >= 0 && this.isSkip(t[i].id, s, o); ) 25257 i--; 25258 if (i < 0) 25259 return -1; 25260 let r = this.getOffset16(2, e) 25261 , a = this.getOffset16(4, e) 25262 , d = this.getUint16(e + 6) 25263 , u = t[n].id 25264 , h = this.getCoverageIndex(r, u); 25265 if (h >= 0) { 25266 let c = t[i].id 25267 , f = this.getCoverageIndex(a, c); 25268 if (f >= 0) { 25269 let p = this.getOffset16(8, e) 25270 , g = p + 2 + h * 4 25271 , y = this.getUint16(g) 25272 , m = p + this.getOffset16(g + 2) 25273 , b = this.getOffset16(10, e) 25274 , M = b + 2 + f * d * 2 25275 , S = b + this.getOffset16(M + y * 2) 25276 , x = this.getAnchorCoords(m) 25277 , P = this.getAnchorCoords(S) 25278 , C = t[i] 25279 , T = t[n];
25280 return T.setPositioning(C.getPosX() + P[0] - x[0], C.getPosY() + P[1] - x[1]), 25281 T.isCombined = !0, 25282 1 25283 } 25284 } 25285 return -1 25286 } 25287 positioningLookup7_1(e, t, n, s=0, o=0) { 25288 let i = this.getOffset16(2, e) 25289 , r = this.getCoverageIndex(i, t[n].id); 25290 if (r >= 0) { 25291 let a = this.getOffset16(6 + r * 2, e) 25292 , d = this.getUint16(a); 25293 for (let u = 0; u < d; u++) { 25294 let h = this.getOffset16(2 + u * 2, a) 25295 , c = this.getUint16(h) 25296 , f = 0; 25297 for (let p = n + 1; f < c - 1 && p < t.length; p++) 25298 if (!this.isSkip(t[p].id, s, o)) { 25299 if (t[p].id !== this.getUint16(h + 4 + f * 2)) 25300 break; 25301 f++ 25302 } 25303 if (f >= c - 1) { 25304 let p = t.length 25305 , g = this.getUint16(h + 2) 25306 , y = h + 4 + (c - 1) * 2; 25307 return this.nestedSeqLookup(g, y, t, n), 25308 c + (t.length - p) 25309 } 25310 } 25311 } 25312 return -1 25313 } 25314 positioningLookup7_2(e, t, n, s=0, o=0) { 25315 let i = this.getOffset16(2, e); 25316 if (this.getCoverageIndex(i, t[n].id) >= 0) { 25317 let a = this.getOffset16(4, e) 25318 , d = this.getClassValue(a, t[n].id) 25319 , u = this.getUint16(e + 6); 25320 if (d >= u) 25321 return -1; 25322 let h = this.getOffset16(8 + d * 2, e); 25323 if (h !== e) { 25324 let c = this.getUint16(h); 25325 for (let f = 0; f < c; f++) { 25326 let p = this.getOffset16(2 + f * 2, h) 25327 , g = this.getUint16(p); 25328 if (g > 0) { 25329 let y = 0; 25330 for (let m = n + 1; y < g - 1 && m < t.length; m++) 25331 if (!this.isSkip(t[m].id, s, o)) { 25332 let b = this.getUint16(p + 4 + y * 2); 25333 if (this.getClassValue(a, t[m].id) !== b) 25334 break; 25335 y++ 25336 } 25337 if (y >= g - 1) { 25338 let m = t.length 25339 , b = this.getUint16(p + 2) 25340 , M = p + 4 + (g - 1) * 2; 25341 return this.nestedSeqLookup(b, M, t, n), 25342 g + (t.length - m) 25343 } 25344 } 25345 } 25346 } 25347 } 25348 return -1 25349 } 25350 positioningLookup7_3(e, t, n, s=0, o=0) { 25351 let i = this.getUint16(e + 2) 25352 , r = e + 6; 25353 if (!this.matchSeqCoverage(e, r, t, n, i, !1, s, o)) 25354 return -1; 25355 let a = t.length 25356 , d = this.getUint16(e + 4) 25357 , u = e + 6 + i * 2; 25358 return this.nestedSeqLookup(d, u, t, n), 25359 i + (t.length - a) 25360 } 25361 positioningLookup8_1(e, t, n, s, o) { 25362 let i = this.getOffset16(2, e) 25363 , r = this.getCoverageIndex(i, t[n].id); 25364 if (r >= 0) { 25365 let a = this.getOffset16(6 + r * 2, e); 25366 if (a !== e) { 25367 let d = this.getUint16(a); 25368 for (let u = 0; u < d; u++) { 25369 let h = this.getOffset16(2 + u * 2, a) 25370 , c = this.getUint16(h); 25371 if (!this.matchSeqIds(h + 2, t, n - 1, c, !0, s, o)) 25372 continue; 25373 let f = h + 2 + c * 2 25374 , p = this.getUint16(f); 25375 if (!this.matchSeqIds(f + 2, t, n + 1, p - 1, !1, s, o)) 25376 continue; 25377 let g = f + 2 + (p - 1) * 2 25378 , y = this.getUint16(g); 25379 if (!this.matchSeqIds(g + 2, t, n + p, y, !1, s, o)) 25380 continue; 25381 let m = this.getUint16(g + 2 + y * 2) 25382 , b = g + 2 + y * 2 + 2; 25383 return this.nestedSeqLookup(m, b, t, n), 25384 p 25385 } 25386 } 25387 } 25388 return -1 25389 } 25390 positioningLookup8_2(e, t, n, s, o) { 25391 let i = this.getOffset16(2, e); 25392 if (this.getCoverageIndex(i, t[n].id) >= 0) { 25393 let a = this.getOffset16(4, e) 25394 , d = this.getOffset16(6, e) 25395 , u = this.getOffset16(8, e) 25396 , h = this.getClassValue(d, t[n].id) 25397 , c = this.getUint16(e + 10); 25398 if (h >= c) 25399 return -1; 25400 let f = this.getOffset16(12 + h * 2, e); 25401 if (f !== e) { 25402 let p = this.getUint16(f); 25403 for (let g = 0; g < p; g++) { 25404 let y = this.getOffset16(2 + g * 2, f) 25405 , m = this.getUint16(y); 25406 if (!this.matchSeqClasses(a, y + 2, t, n - 1, m, !0, s, o)) 25407 continue; 25408 let b = y + 2 + m * 2 25409 , M = this.getUint16(b); 25410 if (!this.matchSeqClasses(d, b + 2, t, n + 1, M - 1, !1, s, o)) 25411 continue; 25412 let S = b + 2 + (M - 1) * 2 25413 , x = this.getUint16(S); 25414 if (!this.matchSeqClasses(u, S + 2, t, n + M, x, !1, s, o)) 25415 continue; 25416 let P = this.getUint16(S + 2 + x * 2) 25417 , C = S + 2 + x * 2 + 2; 25418 return this.nestedSeqLookup(P, C, t, n), 25419 M 25420 } 25421 } 25422 } 25423 return -1 25424 } 25425 positioningLookup8_3(e, t, n, s, o) { 25426 let i = this.getUint16(e + 2) 25427 , r = e + 4; 25428 if (!this.matchSeqCoverage(e, r, t, n - 1, i, !0, s, o)) 25429 return -1; 25430 let a = this.getUint16(r + i * 2) 25431 , d = r + 2 + i * 2; 25432 if (!this.matchSeqCoverage(e, d, t, n, 1, !1, 0, 0) || !this.matchSeqCoverage(e, d + 2, t, n + 1, a - 1, !1, s, o)) 25433 return -1; 25434 let u = this.getUint16(d + a * 2) 25435 , h = d + 2 + a * 2; 25436 if (!this.matchSeqCoverage(e, h, t, n + a, u, !1, s, o)) 25437 return -1; 25438 let c = this.getUint16(h + u * 2) 25439 , f = h + u * 2 + 2; 25440 return this.nestedSeqLookup(c, f, t, n), 25441 a 25442 } 25443 positioningLookup9_1(e, t, n, s, o) { 25444 let i = this.getUint16(e + 2) 25445 , r = e + this.getOffset32(e + 4); 25446 return this.processLookup(i, r, t, n, s, o) 25447 } 25448 getPosData(e, t, n, s) { 25449 if (t !== 0) { 25450 let o = n[s]; 25451 if ((t & 1) !== 0) { 25452 let i = this.getInt16(e); 25453 o.setPositioning(i, 0), 25454 e += 2 25455 } 25456 if ((t & 2) !== 0) { 25457 let i = this.getInt16(e); 25458 o.setPositioning(0, i), 25459 e += 2 25460 } 25461 if ((t & 4) !== 0) { 25462 let i = this.getInt16(e); 25463 o.addAdvance(i), 25464 e += 2 25465 } 25466 } 25467 } 25468 nextGlyphIndex(e, t, n, s=0) { 25469 for (let o = t + 1; o < e.length; o++) 25470 if (!this.isSkip(e[o].id, n, s)) 25471 return o; 25472 return -1 25473 } 25474 getAnchorCoords(e) { 25475 let t = this.getInt16(e + 2) 25476 , n = this.getInt16(e + 4); 25477 return [t, n] 25478 } 25479} 25480function Ui(l) { 25481 let e = 0; 25482 for (; l !== 0; ) 25483 e += 2 * (l & 1), 25484 l >>= 1; 25485 return e 25486}
25487class W5 extends El { 25488 gdefTableView; 25489 init() { 25490 this.gdefTableView = this.font.tableMap.GDEF 25491 } 25492 processLookup(e, t, n, s, o, i) { 25493 let r = this.getUint16(t); 25494 if (e === 1) { 25495 if (r === 1) 25496 return this.substitutionLookup1_1(t, n, s); 25497 if (r === 2) 25498 return this.substitutionLookup1_2(t, n, s) 25499 } else if (e === 2) { 25500 if (r === 1) 25501 return this.substitutionLookup2_1(t, n, s) 25502 } else if (e === 3) { 25503 if (r === 1) 25504 return this.substitutionLookup3_1(t, n, s, o, i) 25505 } else if (e === 4) { 25506 if (r === 1) 25507 return this.substitutionLookup4_1(t, n, s, o, i) 25508 } else if (e === 5) { 25509 if (r === 1) 25510 return this.substitutionLookup5_1(t, n, s, o, i); 25511 if (r === 2) 25512 return this.substitutionLookup5_2(t, n, s, o, i); 25513 if (r === 3) 25514 return this.substitutionLookup5_3(t, n, s, o, i) 25515 } else if (e === 6) { 25516 if (r === 1) 25517 return this.substitutionLookup6_1(t, n, s, o, i); 25518 if (r === 2) 25519 return this.substitutionLookup6_2(t, n, s, o, i); 25520 if (r === 3) 25521 return this.substitutionLookup6_3(t, n, s, o, i) 25522 } else if (e === 7) { 25523 if (r === 1) 25524 return this.substitutionLookup7_1(t, n, s, o, i) 25525 } else if (e === 8 && r === 1) 25526 return this.substitutionLookup8_1(t, n, s, o, i); 25527 return console.error("Unsupported substitution lookupType " + e + "." + r), 25528 -1 25529 } 25530 substitutionLookup1_1(e, t, n) { 25531 let s = this.getOffset16(2, e) 25532 , o = t[n].id; 25533 if (this.getCoverageIndex(s, o) >= 0) { 25534 let i = this.getInt16(e + 4) 25535 , r = o + i; 25536 return t[n] = this.font.createGlyphData(r), 25537 1 25538 } 25539 return -1 25540 } 25541 substitutionLookup1_2(e, t, n) { 25542 let s = this.getOffset16(2, e) 25543 , o = this.getCoverageIndex(s, t[n].id); 25544 if (o >= 0) { 25545 let i = this.getUint16(e + 6 + o * 2); 25546 return t[n] = this.font.createGlyphData(i), 25547 1 25548 } 25549 return -1 25550 } 25551 substitutionLookup2_1(e, t, n) { 25552 let s = this.getOffset16(2, e) 25553 , o = this.getCoverageIndex(s, t[n].id); 25554 if (o >= 0) { 25555 let i = this.getOffset16(6 + o * 2, e) 25556 , r = this.getUint16(i) 25557 , a = []; 25558 for (let d = 0; d < r; d++) { 25559 let u = this.getUint16(i + 2 + 2 * d); 25560 a.push(this.font.createGlyphData(u)) 25561 } 25562 return t.splice(n, 1, ...a), 25563 r 25564 } 25565 return -1 25566 } 25567 substitutionLookup3_1(e, t, n, s) { 25568 return -1 25569 } 25570 substitutionLookup4_1(e, t, n, s, o) { 25571 let i = this.getOffset16(2, e) 25572 , r = this.getCoverageIndex(i, t[n].id); 25573 if (r >= 0) { 25574 let a = this.getOffset16(6 + r * 2, e) 25575 , d = this.getUint16(a); 25576 for (let u = 0; u < d; u++) { 25577 let h = this.getOffset16(2 + u * 2, a) 25578 , c = this.getUint16(h + 2) 25579 , f = []; 25580 for (let p = n + 1; f.length < c - 1 && p < t.length; p++) { 25581 let g = t[p]; 25582 if (!this.isSkip(g.id, s, o)) { 25583 let y = this.getUint16(h + 4 + f.length * 2); 25584 if (g.id !== y) 25585 break; 25586 f.push(p) 25587 } 25588 } 25589 if (f.length === c - 1) { 25590 let p = this.getUint16(h); 25591 for (t[n] = this.font.createGlyphData(p); f.length > 0; ) 25592 t.splice(f.pop(), 1); 25593 return 1 25594 } 25595 } 25596 } 25597 return -1 25598 } 25599 substitutionLookup5_1(e, t, n, s, o) { 25600 let i = this.getOffset16(2, e) 25601 , r = this.getCoverageIndex(i, t[n].id); 25602 if (r >= 0) { 25603 let a = this.getOffset16(6 + r * 2, e) 25604 , d = this.getUint16(a); 25605 for (let u = 0; u < d; u++) { 25606 let h = this.getOffset16(2 + u * 2, a) 25607 , c = this.getUint16(h) 25608 , f = 0; 25609 for (let p = n + 1; f < c - 1 && p < t.length; p++) { 25610 let g = t[p]; 25611 if (g == null) 25612 break; 25613 if (!this.isSkip(g.id, s, o)) { 25614 if (g.id !== this.getUint16(h + 4 + f * 2)) 25615 break; 25616 f++ 25617 } 25618 } 25619 if (f >= c - 1) { 25620 let p = t.length 25621 , g = this.getUint16(h + 2) 25622 , y = h + 4 + (c - 1) * 2; 25623 return this.nestedSeqLookup(g, y, t, n), 25624 t.length - p 25625 } 25626 } 25627 } 25628 return -1 25629 } 25630 substitutionLookup5_2(e, t, n, s, o) { 25631 let i = this.getOffset16(2, e) 25632 , r = t[n]; 25633 if (this.getCoverageIndex(i, r.id) >= 0) { 25634 let d = this.getOffset16(4, e) 25635 , u = this.getClassValue(d, r.id) 25636 , h = this.getUint16(e + 6); 25637 if (u >= h) 25638 return -1; 25639 let c = this.getOffset16(8 + u * 2, e); 25640 if (c !== e) { 25641 let f = this.getUint16(c); 25642 for (let p = 0; p < f; p++) { 25643 let g = this.getOffset16(2 + p * 2, c) 25644 , y = this.getUint16(g); 25645 if (y > 0) { 25646 let m = 0; 25647 for (let b = n + 1; m < y - 1 && b < t.length; b++) 25648 if (!this.isSkip(t[b].id, s, o)) { 25649 let M = this.getUint16(g + 4 + m * 2); 25650 if (this.getClassValue(d, t[b].id) !== M) 25651 break; 25652 m++ 25653 } 25654 if (m >= y - 1) { 25655 let b = t.length 25656 , M = this.getUint16(g + 2) 25657 , S = g + 4 + (y - 1) * 2; 25658 return this.nestedSeqLookup(M, S, t, n), 25659 y + (t.length - b) 25660 } 25661 } 25662 } 25663 } 25664 } 25665 return -1 25666 } 25667 substitutionLookup5_3(e, t, n, s, o) { 25668 let i = this.getUint16(e + 2) 25669 , r = e + 6; 25670 if (!this.matchSeqCoverage(e, r, t, n, i, !1, s, o)) 25671 return -1; 25672 let a = this.getUint16(e + 4) 25673 , d = e + 6 + i * 2 25674 , u = t.length; 25675 return this.nestedSeqLookup(a, d, t, n), 25676 t.length - u 25677 } 25678 substitutionLookup6_1(e, t, n, s, o) { 25679 let i = this.getOffset16(2, e) 25680 , r = t[n].id 25681 , a = this.getCoverageIndex(i, r); 25682 if (a >= 0) { 25683 let d = this.getOffset16(6 + a * 2, e); 25684 if (d !== e) { 25685 let u = this.getUint16(d); 25686 for (let h = 0; h < u; h++) { 25687 let c = this.getOffset16(2 + h * 2, d) 25688 , f = this.getUint16(c); 25689 if (!this.matchSeqIds(c + 2, t, n - 1, f, !0, s, o)) 25690 continue; 25691 let p = c + 2 + f * 2 25692 , g = this.getUint16(p); 25693 if (!this.matchSeqIds(p + 2, t, n + 1, g - 1, !1, s, o)) 25694 continue; 25695 let y = p + 2 + (g - 1) * 2 25696 , m = this.getUint16(y); 25697 if (!this.matchSeqIds(y + 2, t, n + g, m, !1, s, o)) 25698 continue; 25699 let b = t.length 25700 , M = this.getUint16(y + 2 + m * 2) 25701 , S = y + 2 + m * 2 + 2; 25702 return this.nestedSeqLookup(M, S, t, n), 25703 g + (t.length - b) 25704 } 25705 } 25706 } 25707 return -1 25708 } 25709 substitutionLookup6_2(e, t, n, s, o) { 25710 let i = this.getOffset16(2, e); 25711 if (this.getCoverageIndex(i, t[n].id) >= 0) { 25712 let a = this.getOffset16(4, e) 25713 , d = this.getOffset16(6, e) 25714 , u = this.getOffset16(8, e) 25715 , h = this.getClassValue(d, t[n].id) 25716 , c = this.getUint16(e + 10); 25717 if (h >= c) 25718 return -1; 25719 let f = this.getOffset16(12 + h * 2, e); 25720 if (f !== e) { 25721 let p = this.getUint16(f); 25722 for (let g = 0; g < p; g++) { 25723 let y = this.getOffset16(2 + g * 2, f) 25724 , m = this.getUint16(y); 25725 if (!this.matchSeqClasses(a, y + 2, t, n - 1, m, !0, s, o)) 25726 continue; 25727 let b = y + 2 + m * 2 25728 , M = this.getUint16(b); 25729 if (!this.matchSeqClasses(d, b + 2, t, n + 1, M - 1, !1, s, o)) 25730 continue; 25731 let S = b + 2 + (M - 1) * 2 25732 , x = this.getUint16(S); 25733 if (!this.matchSeqClasses(u, S + 2, t, n + M, x, !1, s, o)) 25734 continue; 25735 let P = t.length 25736 , C = this.getUint16(S + 2 + x * 2) 25737 , T = S + 2 + x * 2 + 2; 25738 return this.nestedSeqLookup(C, T, t, n), 25739 M + (t.length - P) 25740 } 25741 } 25742 } 25743 return -1 25744 } 25745 substitutionLookup6_3(e, t, n, s, o) { 25746 let i = e + 2 25747 , r = this.getUint16(i); 25748 if (!this.matchSeqCoverage(e, i + 2, t, n - 1, r, !0, s, o)) 25749 return -1; 25750 let a = i + 2 + r * 2 25751 , d = this.getUint16(a); 25752 if (!this.matchSeqCoverage(e, a + 2, t, n, 1, !1, 0, 0) || !this.matchSeqCoverage(e, a + 4, t, n + 1, d - 1, !1, s, o)) 25753 return -1; 25754 let u = a + 2 + d * 2 25755 , h = this.getUint16(u); 25756 if (!this.matchSeqCoverage(e, u + 2, t, n + d, h, !1, s, o)) 25757 return -1; 25758 let c = t.length 25759 , f = u + 2 + h * 2 25760 , p = this.getUint16(f); 25761 return this.nestedSeqLookup(p, f + 2, t, n), 25762 Math.max(0, d + (t.length - c)) 25763 } 25764 substitutionLookup7_1(e, t, n, s, o) { 25765 let i = this.getUint16(e + 2) 25766 , r = e + this.getOffset32(e + 4); 25767 return this.processLookup(i, r, t, n, s, o) 25768 } 25769 substitutionLookup8_1(e, t, n, s, o) { 25770 let i = this.getOffset16(2, e) 25771 , r = this.getCoverageIndex(i, t[n].id); 25772 if (r >= 0) { 25773 let a = !0 25774 , d = e + 4 25775 , u = this.getUint16(d); 25776 d += 2; 25777 let h = 0; 25778 for (let c = n - 1; h < u && c >= 0; c--) { 25779 let f = t[c]; 25780 if (f == null) { 25781 a = !1; 25782 break 25783 } 25784 if (!this.isSkip(f.id, s, o)) { 25785 if (this.getCoverageIndex(e + this.getOffset16(d + h * 2), f.id) < 0) { 25786 a = !1; 25787 break 25788 } 25789 h++ 25790 } 25791 } 25792 if (h < u && (a = !1), 25793 a) { 25794 d += u * 2; 25795 let c = this.getUint16(d); 25796 d += 2, 25797 h = 0; 25798 for (let f = n + 1; h < c && f < t.length; f++) { 25799 let p = t[f]; 25800 if (p == null) { 25801 a = !1; 25802 break 25803 } 25804 if (!this.isSkip(p.id, s, o)) { 25805 if (this.getCoverageIndex(e + this.getOffset16(d + h * 2), p.id) < 0) { 25806 a = !1; 25807 break 25808 } 25809 h++ 25810 } 25811 } 25812 if (h < c && (a = !1), 25813 a) { 25814 d += c * 2 + 2; 25815 let f = this.getUint16(d + r * 2); 25816 return t[n] = this.font.createGlyphData(f), 25817 1 25818 } 25819 } 25820 } 25821 return -1 25822 } 25823}
25824class q5 extends El { 25825 getUnitsPerEm() { 25826 return this.getUint16(18) 25827 } 25828 getIndexToLocFormat() { 25829 return this.getInt16(50) 25830 } 25831} 25832class j5 extends El { 25833 getAscender() { 25834 return this.getInt16(4) 25835 } 25836 getDescender() { 25837 return this.getInt16(6) 25838 } 25839 getLineGap() { 25840 return this.getInt16(8) 25841 } 25842 getNumberOfHMetrics() { 25843 return this.getUint16(34) 25844 } 25845} 25846class J5 extends El { 25847 numberOfHMetrics; 25848 init() { 25849 this.numberOfHMetrics = this.font.tableMap.hhea.getNumberOfHMetrics() 25850 } 25851 getAdvanceWidth(e) { 25852 return e < this.numberOfHMetrics ? this.getUint16(e * 4) : this.getUint16((this.numberOfHMetrics - 1) * 4) 25853 } 25854 getLeftSideBearing(e) { 25855 let t = this.numberOfHMetrics; 25856 return e < t ? this.getInt16(e * 4 + 2) : this.getInt16(t * 4 + (e - t) * 2) 25857 } 25858} 25859class Z5 extends El { 25860 init() { 25861 this.tableVersion = this.getUint16(0) 25862 } 25863 getKerning(e, t) { 25864 return this.tableVersion === 0 ? this.getKerningWindows(e, t) : this.tableVersion === 1 ? this.getKerningApple(e, t) : 0 25865 } 25866 getKerningWindows(e, t) { 25867 let n = this.getUint16(2) 25868 , s = 4; 25869 for (let o = 0; o < n; o++) { 25870 let i = this.getUint16(s + 2) 25871 , r = this.getUint16(s + 6) 25872 , a = s + 14 25873 , d = e << 16 | t 25874 , u = 0 25875 , h = r - 1; 25876 for (; u <= h; ) { 25877 let c = u + h >>> 1 25878 , f = a + c * 6 25879 , p = this.getUint16(f) << 16 | this.getUint16(f + 2); 25880 if (p < d) 25881 u = c + 1; 25882 else if (p > d) 25883 h = c - 1; 25884 else 25885 return this.getInt16(f + 4) 25886 } 25887 s += i 25888 } 25889 return 0 25890 } 25891 getKerningApple(e, t) { 25892 let n = this.getUint32(4) 25893 , s = 8; 25894 for (let o = 0; o < n; o++) { 25895 let i = this.getUint32(s); 25896 if ((this.getUint16(s + 4) & 255) === 0) { 25897 let d = this.getUint16(s + 6) 25898 , u = s + 16 25899 , h = e << 16 | t 25900 , c = 0 25901 , f = d - 1; 25902 for (; c <= f; ) { 25903 let p = c + f >>> 1 25904 , g = u + p * 6 25905 , y = this.getUint16(g) << 16 | this.getUint16(g + 2); 25906 if (y < h) 25907 c = p + 1; 25908 else if (y > h) 25909 f = p - 1; 25910 else 25911 return this.getInt16(g + 4) 25912 } 25913 } 25914 s += i 25915 } 25916 return 0 25917 } 25918} 25919class Q5 extends El { 25920 indexToLocFormat; 25921 init() { 25922 this.indexToLocFormat = this.font.tableMap.head.getIndexToLocFormat() 25923 } 25924 getOffsetForGlyphId(e) { 25925 try { 25926 let t, n; 25927 if (this.indexToLocFormat === 1) { 25928 let s = e * 4; 25929 t = this.getOffset32(s), 25930 n = this.getUint32(s + 4) - t 25931 } else { 25932 let s = e * 2; 25933 t = this.getUint16(s) * 2, 25934 n = this.getUint16(s + 2) * 2 - t 25935 } 25936 return n === 0 ? -1 : t 25937 } catch (t) { 25938 return console.error(t), 25939 -1 25940 } 25941 } 25942} 25943class eT extends El { 25944 getNameRecords() { 25945 let e = this.getUint16(2) 25946 , t = this.getOffset16(4) 25947 , n = [] 25948 , s = 6; 25949 for (let o = 0; o < e; o++, 25950 s += 12) { 25951 let i = this.getUint16(s) 25952 , r = this.getUint16(s + 2) 25953 , a = this.getUint16(s + 4) 25954 , d = this.getUint16(s + 6) 25955 , u = this.getUint16(s + 8) 25956 , h = this.getOffset16(s + 10) 25957 , c = new TextDecoder("utf-16be") 25958 , f = new Uint8Array(this.buffer,this.byteOffset + t + h,u) 25959 , p = c.decode(f); 25960 n.push(new tT(i,r,a,d,p)) 25961 } 25962 return n 25963 } 25964} 25965class tT { 25966 platformId; 25967 encodingId; 25968 languageId; 25969 nameId; 25970 text; 25971 constructor(e, t, n, s, o) { 25972 this.platformId = e, 25973 this.encodingId = t, 25974 this.languageId = n, 25975 this.nameId = s, 25976 this.text = o 25977 } 25978} 25979class lT { 25980 id; 25981 codepoint; 25982 advance; 25983 advanceOffs = 0; 25984 pos; 25985 isCombined = !1; 25986 constructor(e, t, n) { 25987 this.id = e, 25988 this.advance = t ?? 0, 25989 this.codepoint = n ?? 0 25990 } 25991 getPosX() { 25992 return this.pos ? this.pos[0] : 0 25993 } 25994 getPosY() { 25995 return this.pos ? this.pos[1] : 0 25996 } 25997 setPositioning(e, t) { 25998 this.pos == null ? this.pos = [e, t] : (this.pos[0] = e, 25999 this.pos[1] = t) 26000 } 26001 getAdvance() { 26002 return this.advance + this.advanceOffs 26003 } 26004 setAdvance(e) { 26005 this.advanceOffs = e - this.advance 26006 } 26007 addAdvance(e, t) { 26008 t ? this.advanceOffs = e : this.advanceOffs += e 26009 } 26010} 26011const nT = [[1568, "D.RRRRDRDRDDDDDRRRRDDDDDDDDDDDDDCDDDDDDDRDD"], [1646, "DD.RRR.RRRDDDDDDDDDDDDDDDDRRRRRRRRRRRRRRRRRRDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDRDDRRRRRRRRRDRDRDDRR.R"], [1807, "TR.DDDRRRRRDDDDRDDDDDDDDDRDRDRDDR"], [1869, "RDDDDDDDDDDDRRRDDDDDDDDDDDDDDDRRDDDDRDRRDDDRRDDDDDD"], [1994, "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"], [2042, "C"], [2112, "RDDDDDRRDRDDDDDDDDDDRDRRR"], [2144, "D.DDDD.RDRR.....RRRRRRRRRRRRRRRRRRRCCCD...DDDDRD"], [2208, "DD
26011DDDDDDDDRRR..DD.RDDDDDDRDDDDDDDDDDDDDDD"], [6151, "D..C"], [6176, "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"], [6277, "TTDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD.D"], [8205, "C"], [43072, "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL"], [68288, "DDDDDR.R.RR..LRRRRRDDDDLDDDDDRDDDR..R"], [68331, "DDDDR"], [68480, "DRDRRRDDDRDDRDRRDR"], [68521, "RRRRDD"], [68864, "LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDRD"], [69314, "RDD.DD"], [69424, "DDDRDDDDDDDDDDDDDDDDD"], [69457, "DDDR"], [69488, "DDDDRRDDDDDDDDDDDD"], [69552, "D.DDRRR.DRRDDRDD.DRRD....RDL"], [125184, "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"], [125259, "T"]] 26012 , Ey = new Map; 26013for (let[l,e] of nT) { 26014 let t = l; 26015 for (let n = 0; n < e.length; n++) { 26016 let s = e[n]; 26017 s !== "." && Ey.set(t, s), 26018 t++ 26019 } 26020} 26021function sT(l) { 26022 return l >= 1536 && l <= 2303 ? "arab" : l >= 2304 && l <= 2431 ? "dev2" : l >= 3584 && l <= 3711 ? "thai" : l >= 1424 && l <= 1535 ? "hebr" : l >= 1024 && l <= 1279 ? "cyrl" : l >= 880 && l <= 1023 ? "grek" : l >= 6016 && l <= 6143 ? "khmr" : l >= 44032 && l <= 55215 ? "hang" : l >= 4096 && l <= 4255 ? "mym2" : l >= 65 && l <= 591 ? "latn" : l <= 64 || l >= 592 && l <= 879 || l >= 8192 && l <= 11263 ? null : "latn" 26023} 26024function Qu(l) { 26025 return Ey.get(l) || "U" 26026} 26027const Tt = 0 26028 , Ut = 1 26029 , kn = 2 26030 , bl = 3 26031 , _t = 4 26032 , fc = 5 26033 , Co = 6 26034 , dd = 7 26035 , Bt = 8 26036 , oT = 9 26037 , Dy = 10 26038 , Oy = 11 26039 , Ay = 12 26040 , Br = 13 26041 , iT = 14 26042 , rT = 15 26043 , aT = 16 26044 , dT = 17 26045 , uT = 18 26046 , hT = 19 26047 , cT = 20 26048 , fT = 21 26049 , pT = 22; 26050function Iy(l) { 26051 return l >= 1536 && l <= 1791 ? l >= 1632 && l <= 1641 || l >= 1536 && l <= 1541 ? bl : l === 1544 || l === 1547 || l === 1549 ? kn : l === 1545 || l === 1546 ? Co : l >= 1611 && l <= 1631 || l === 1648 || l >= 1750 && l <= 1756 || l >= 1759 && l <= 1764 || l >= 1767 && l <= 1768 || l >= 1770 && l <= 1773 ? Bt : kn : l >= 1792 && l <= 2303 ? l >= 1840 && l <= 1866 || l >= 1958 && l <= 1968 || l >= 2070 && l <= 2083 || l >= 2085 && l <= 2087 || l >= 2089 && l <= 2093 || l >= 2137 && l <= 2139 || l >= 2259 && l <= 2303 ? Bt : kn : l >= 1424 && l <= 1535 ? l >= 1425 && l <= 1469 || l === 1471 || l >= 1473 && l <= 1474 || l >= 1476 && l <= 1477 || l === 1479 ? Bt : Ut : l >= 48 && l <= 57 ? _t : l === 43 || l === 45 ? fc : l === 44 || l === 46 || l === 47 || l === 58 ? dd : l === 35 || l === 36 || l === 37 || l >= 162 && l <= 165 ? Co : l === 32 || l === 160 ? Ay : l === 9 || l === 11 ? Oy : l === 10 || l === 13 || l === 28 || l === 29 || l === 30 || l === 31 || l === 133 || l === 8233 ? Dy : l === 8206 ? Tt : l === 8207 ? Ut : l === 8234 ? iT : l === 8235 ? aT : l === 8236 ? uT : l === 8237 ? rT : l === 8238 ? dT : l === 8294 ? hT : l === 8295 ? cT : l === 8296 ? fT : l === 8297 ? pT : l >= 8192 && l <= 8303 ? Br : l <= 767 || l >= 880 && l <= 1423 || l >= 2304 && l <= 8191 ? Tt : l >= 8448 && l <= 11263 ? Br : l >= 12288 && l <= 40959 || l >= 44032 && l <= 55215 ? Tt : l >= 64336 && l <= 65023 || l >= 65136 && l <= 65279 ? kn : Tt 26052} 26053function gT(l) { 26054 for (let e of l) { 26055 if (e === Tt) 26056 return 0; 26057 if (e === Ut || e === kn) 26058 return 1 26059 } 26060 return 0 26061} 26062function mT(l) { 26063 let e = l.length; 26064 if (e === 0) 26065 return { 26066 levels: [], 26067 paragraphLevel: 0 26068 }; 26069 let t = new Array(e) 26070 , n = new Array(e); 26071 for (let h = 0; h < e; h++) 26072 t[h] = l.charCodeAt(h), 26073 n[h] = Iy(t[h]); 26074 let s = gT(n) 26075 , o = n.slice() 26076 , i = s % 2 === 0 ? Tt : Ut 26077 , r = i 26078 , a = i; 26079 for (let h = 0; h < e; h++) 26080 o[h] === Bt ? o[h] = a : a = o[h]; 26081 let d = i; 26082 for (let h = 0; h < e; h++) { 26083 let c = o[h]; 26084 c === Tt || c === Ut || c === kn ? d = c : c === _t && d === kn && (o[h] = bl) 26085 } 26086 for (let h = 0; h < e; h++) 26087 o[h] === kn && (o[h] = Ut); 26088 for (let h = 1; h < e - 1; h++) { 26089 let c = o[h]; 26090 c === fc && o[h - 1] === _t && o[h + 1] === _t ? o[h] = _t : c === dd && (o[h - 1] === _t && o[h + 1] === _t ? o[h] = _t : o[h - 1] === bl && o[h + 1] === bl && (o[h] = bl)) 26091 } 26092 for (let h = 0; h < e; h++) 26093 if (o[h] === Co) { 26094 let c = !1; 26095 for (let f = h - 1; f >= 0 && (o[f] === Co || o[f] === _t); f--) 26096 if (o[f] === _t) { 26097 c = !0; 26098 break 26099 } 26100 if (!c) { 26101 for (let f = h + 1; f < e && (o[f] === Co || o[f] === _t); f++) 26102 if (o[f] === _t) { 26103 c = !0; 26104 break 26105 } 26106 }
26107 c && (o[h] = _t) 26108 } 26109 for (let h = 0; h < e; h++) { 26110 let c = o[h]; 26111 (c === fc || c === Co || c === dd) && (o[h] = Br) 26112 } 26113 d = i; 26114 for (let h = 0; h < e; h++) { 26115 let c = o[h]; 26116 c === Tt || c === Ut ? d = c : c === _t && d === Tt && (o[h] = Tt) 26117 } 26118 yT(o, t, e, i, s); 26119 for (let h = 0; h < e; h++) { 26120 let c = o[h]; 26121 if (c === Br || c === Ay || c === Dy || c === Oy || c === oT) { 26122 let f = i; 26123 for (let g = h - 1; g >= 0; g--) { 26124 let y = o[g]; 26125 if (y === Tt || y === Ut || y === bl || y === _t) { 26126 f = y === bl || y === _t ? Ut : y; 26127 break 26128 } 26129 } 26130 let p = r; 26131 for (let g = h + 1; g < e; g++) { 26132 let y = o[g]; 26133 if (y === Tt || y === Ut || y === bl || y === _t) { 26134 p = y === bl || y === _t ? Ut : y; 26135 break 26136 } 26137 } 26138 f === p ? o[h] = f : o[h] = s % 2 === 0 ? Tt : Ut 26139 } 26140 } 26141 let u = new Array(e); 26142 for (let h = 0; h < e; h++) { 26143 let c = o[h]; 26144 s % 2 === 0 ? c === Ut ? u[h] = s + 1 : c === bl || c === _t ? u[h] = s + 2 : u[h] = s : c === Tt || c === _t || c === bl ? u[h] = s + 1 : u[h] = s 26145 } 26146 return { 26147 levels: u, 26148 paragraphLevel: s 26149 } 26150} 26151const pc = new Map([[40, 41], [91, 93], [123, 125], [171, 187], [8216, 8217], [8220, 8221], [8249, 8250], [8261, 8262], [8317, 8318], [8333, 8334], [8968, 8969], [8970, 8971], [9001, 9002], [10214, 10215], [10216, 10217], [10218, 10219], [10088, 10089], [10090, 10091], [10092, 10093], [10094, 10095], [10096, 10097], [10098, 10099], [10100, 10101], [12296, 12297], [12298, 12299], [12300, 12301], [12302, 12303], [12304, 12305], [12308, 12309], [12310, 12311], [12312, 12313], [12314, 12315], [64830, 64831], [65113, 65114], [65115, 65116], [65117, 65118], [65288, 65289], [65339, 65341], [65371, 65373], [65375, 65376]]) 26152 , gc = new Map; 26153for (let[l,e] of pc) 26154 gc.set(e, l); 26155function yT(l, e, t, n, s) { 26156 let o = s % 2 === 0 ? Tt : Ut 26157 , i = [] 26158 , r = []; 26159 for (let a = 0; a < t; a++) { 26160 if (l[a] !== Br) 26161 continue; 26162 let d = e[a]; 26163 if (pc.has(d)) { 26164 if (i.length >= 63) 26165 break; 26166 i.push({ 26167 index: a, 26168 close: pc.get(d) 26169 }) 26170 } else if (gc.has(d)) { 26171 let u = gc.get(d); 26172 for (let h = i.length - 1; h >= 0; h--) 26173 if (e[i[h].index] === u) { 26174 r.push({ 26175 open: i[h].index, 26176 close: a 26177 }), 26178 i.length = h; 26179 break 26180 } 26181 } 26182 } 26183 r.sort((a,d)=>a.open - d.open); 26184 for (let {open: a, close: d} of r) { 26185 let u = null; 26186 for (let c = a + 1; c < d; c++) { 26187 let f = l[c]; 26188 if (f === Tt) { 26189 u = Tt; 26190 break 26191 } 26192 if (f === Ut || f === bl || f === _t) { 26193 u = Ut; 26194 break 26195 } 26196 } 26197 let h; 26198 if (u === o) 26199 h = o; 26200 else if (u != null) { 26201 let c = n; 26202 for (let f = a - 1; f >= 0; f--) { 26203 let p = l[f]; 26204 if (p === Tt) { 26205 c = Tt; 26206 break 26207 } 26208 if (p === Ut || p === bl || p === _t) { 26209 c = Ut; 26210 break 26211 } 26212 } 26213 h = c === u ? u : o 26214 } else 26215 continue; 26216 l[a] = h, 26217 l[d] = h 26218 } 26219} 26220function vT(l) { 26221 let e = l.length 26222 , t = new Array(e); 26223 for (let o = 0; o < e; o++) 26224 t[o] = o; 26225 let n = 0 26226 , s = 1 / 0; 26227 for (let o = 0; o < e; o++) 26228 l[o] > n && (n = l[o]), 26229 l[o] % 2 === 1 && l[o] < s && (s = l[o]); 26230 if (s === 1 / 0) 26231 return t; 26232 for (let o = n; o >= s; o--) { 26233 let i = 0; 26234 for (; i < e; ) 26235 if (l[t[i]] >= o) { 26236 let r = i; 26237 for (; i < e && l[t[i]] >= o; ) 26238 i++; 26239 let a = r 26240 , d = i - 1; 26241 for (; a < d; ) { 26242 let u = t[a]; 26243 t[a] = t[d], 26244 t[d] = u, 26245 a++, 26246 d-- 26247 } 26248 } else 26249 i++ 26250 } 26251 return t 26252} 26253function bT(l, e) { 26254 let t = l.tableMap.cmap 26255 , n = l.tableMap.GPOS 26256 , s = l.tableMap.kern 26257 , {levels: o} = mT(e) 26258 , i = new Array(e.length) 26259 , r = "latn"; 26260 for (let c = 0; c < e.length; c++) { 26261 let f = sT(e.charCodeAt(c)); 26262 f != null && (r = f), 26263 i[c] = r 26264 } 26265 let a = [] 26266 , d = [] 26267 , u = 0; 26268 for (let c = 0; c <= e.length; c++) { 26269 let f = c === e.length 26270 , p = !f && c > 0 && (o[c] !== o[c - 1] || i[c] !== i[c - 1]); 26271 if (f || p) { 26272 if (c > u) { 26273 let g = []; 26274 for (let b = u; b < c; b++) { 26275 let M = e.charCodeAt(b) 26276 , S = t.getGlyphIdForCode(M); 26277 g.push(l.createGlyphData(S, M)) 26278 } 26279 let y = i[u]; 26280 if (MT(l, g, y, ""), 26281 n == null && s != null) 26282 for (let b = 0; b < g.length - 1; b++) { 26283 let M = g[b]; 26284 M.addAdvance(s.getKerning(M.id, g[b + 1].id)) 26285 } 26286 let m = o[u]; 26287 for (let b of g) 26288 a.push(b), 26289 d.push(m) 26290 } 26291 u = c 26292 } 26293 } 26294 return vT(d).map(c=>a[c]) 26295} 26296function MT(l, e, t, n) { 26297 switch (qe(l, ["rvrn"], e, t, n), 26298 t) { 26299 case "arab": 26300 qe(l, ["ccmp", "locl"], e, t, n), 26301 ST(l, e, t, n), 26302 qe(l, ["rlig", "rclt", "calt"], e, t, n), 26303 qe(l, ["mset"], e, t, n), 26304 qe(l, ["curs", "dist", "kern"], e, t, n), 26305 qe(l, ["abvm", "blwm", "mark", "mkmk"], e, t, n); 26306 break; 26307 case "dev2": 26308 qe(l, ["locl", "ccmp", "nukt", "akhn"], e, t, n), 26309 qe(l, ["rphf"], e, t, n), 26310 qe(l, ["pref"], e, t, n), 26311 qe(l, ["rkrf", "abvf", "blwf", "half", "pstf", "vatu", "cjct"], e, t, n), 26312 qe(l, ["pres", "abvs", "blws", "psts", "haln"], e, t, n), 26313 qe(l, ["curs", "dist", "kern"], e, t, n), 26314 qe(l, ["abvm", "blwm", "mark", "mkmk"], e, t, n); 26315 break; 26316 case "khmr": 26317 qe(l, ["ccmp", "locl"], e, t, n), 26318 qe(l, ["pref", "blwf", "abvf", "pstf"], e, t, n), 26319 qe(l, ["clig"], e, t, n), 26320 qe(l, ["rlig", "rclt", "calt"], e, t, n), 26321 qe(l, ["curs", "dist", "kern"], e, t, n), 26322 qe(l, ["abvm", "blwm", "mark", "mkmk"], e, t, n); 26323 break; 26324 case "mym2": 26325 qe(l, ["locl", "ccmp"], e, t, n), 26326 qe(l, ["rphf"], e, t, n), 26327 qe(l, ["pref"], e, t, n), 26328 qe(l, ["blwf"], e, t, n), 26329 qe(l, ["pstf"], e, t, n), 26330 qe(l, ["pres", "abvs", "blws", "psts"], e, t, n), 26331 qe(l, ["curs", "dist", "kern"], e, t, n), 26332 qe(l, ["abvm", "blwm", "mark", "mkmk"], e, t, n); 26333 break; 26334 case "hang": 26335 qe(l, ["ccmp", "locl"], e, t, n), 26336 qe(l, ["ljmo", "vjmo", "tjmo"], e, t, n), 26337 qe(l, ["clig", "rclt", "liga"], e, t, n), 26338 qe(l, ["curs", "dist", "kern"], e, t, n), 26339 qe(l, ["abvm", "blwm", "mark", "mkmk"], e, t, n); 26340 break; 26341 default: 26342 qe(l, ["ccmp", "locl"], e, t, n), 26343 qe(l, ["rlig", "rclt", "calt", "liga", "clig"], e, t, n), 26344 qe(l, ["curs", "dist", "kern"], e, t, n), 26345 qe(l, ["abvm", "blwm", "mark", "mkmk"], e, t, n); 26346 break 26347 } 26348} 26349function ST(l, e, t, n) { 26350 let s = l.tableMap.GSUB; 26351 if (s == null) 26352 return; 26353 let o = new Array(e.length); 26354 for (let i = 0; i < e.length; i++) { 26355 let r = Qu(e[i].codepoint); 26356 if (r === "T" || r === "U" || r === "C") 26357 continue; 26358 let a = !1; 26359 for (let u = i - 1; u >= 0; u--) { 26360 let h = Qu(e[u].codepoint); 26361 if (h !== "T") { 26362 a = h === "D" || h === "L" || h === "C"; 26363 break 26364 } 26365 } 26366 let d = !1; 26367 for (let u = i + 1; u < e.length; u++) { 26368 let h = Qu(e[u].codepoint); 26369 if (h !== "T") { 26370 d = h === "D" || h === "R" || h === "C"; 26371 break 26372 } 26373 } 26374 r === "D" ? a && d ? o[i] = "medi" : a ? o[i] = "fina" : d ? o[i] = "init" : o[i] = "isol" : r === "R" ? o[i] = a ? "fina" : "isol" : r === "L" && (o[i] = d ? "init" : "isol") 26375 } 26376 for (let i = 0; i < e.length; i++) 26377 if (o[i] != null) { 26378 let r = [e[i]]; 26379 s.applyFeatures([o[i]], r, t, n), 26380 e[i] = r[0] 26381 } 26382} 26383function qe(l, e, t, n, s) { 26384 let o = l.tableMap.GSUB; 26385 o?.applyFeatures(e, t, n, s); 26386 let i = l.tableMap.GPOS; 26387 i?.applyFeatures(e, t, n, s) 26388} 26389function wT(l, e, t=16, n, s, o, i, r, a, d) { 26390 let u = l.tableMap 26391 , h = u.CFF 26392 , c = u.glyf 26393 , f = u.head 26394 , p = u.hmtx 26395 , g = bT(l, e) 26396 , y = [] 26397 , m = 0 26398 , b = 0; 26399 for (let P = 0; P < g.length; P++) { 26400 let C = g[P] 26401 , T = C.id 26402 , k = C.getPosX() 26403 , D = C.getPosY(); 26404 if (!l.isCFFOpenType) { 26405 let I = p.getLeftSideBearing(T); 26406 k += I - c.getXMin(T) 26407 } 26408 C.isCombined || (b = m, 26409 m += C.getAdvance()), 26410 l.isCFFOpenType ? y.push(h.getPathData(T, 1, 0, 0, 1, b + k, -D)) : y.push(c.getPathData(T, 1, 0, 0, 1, b + k, -D)) 26411 } 26412 let M = f.getUnitsPerEm() 26413 , S = t / M; 26414 n = n ? n.clone() : new oe, 26415 n.scale(S, S), 26416 s && (n = n.skewX(-14 * Math.PI / 180)); 26417 let x = []; 26418 for (let P of y) 26419 if (o) { 26420 let C = P.toPaths(); 26421 C = jl(C, null, d); 26422 let T = Bo(C, t / S * .016, null, !1, "butt", "miter", 4); 26423 x.push(on(T, n, a)) 26424 } else 26425 P.transform(n), 26426 x.push(P.toPathDataString(a)); 26427 if (r) { 26428 let P, C; 26429 if (sd) { 26430 let Y = u.hhea; 26431 P = M / 10, 26432 C = -(Y.getAscender() / 3 + P / 2) 26433 } else { 26434 let Y = u["OS/2"]; 26435 P = Y.getInt16(26), 26436 C = -Y.getInt16(28) 26437 } 26438 let T = C + P 26439 , k = n.transformXY(new B(0,C)) 26440 , D = n.transformXY(new B(m,C)) 26441 , I = n.transformXY(new B(m,T)) 26442 , F = n.transformXY(new B(0,T)); 26443 x.push("M" + k.x + "," + k.y + "L" + D.x + "," + D.y + "," + I.x + "," + I.y + "," + F.x + "," + F.y + "z") 26444 } 26445 if (i) { 26446 let P, C; 26447 if (sd) 26448 C = M / 20, 26449 P = M / 10; 26450 else { 26451 let Y = u.post; 26452 C = -Y.getInt16(8), 26453 P = Y.getInt16(10) 26454 } 26455 let T = C + P 26456 , k = n.transformXY(new B(0,C)) 26457 , D = n.transformXY(new B(m,C)) 26458 , I = n.transformXY(new B(m,T)) 26459 , F = n.transformXY(new B(0,T)); 26460 x.push("M" + k.x + "," + k.y + "L" + D.x + "," + D.y + "," + I.x + "," + I.y + "," + F.x + "," + F.y + "z") 26461 } 26462 return x 26463} 26464const PT = { 26465 CFF: G5, 26466 cmap: H5, 26467 GDEF: X5, 26468 glyf: Y5, 26469 GPOS: K5, 26470 GSUB: W5, 26471 head: q5, 26472 hhea: j5, 26473 hmtx: J5, 26474 kern: Z5, 26475 loca: Q5, 26476 name: eT 26477}; 26478class Tf { 26479 fontFamily; 26480 fontDataView; 26481 tableMap; 26482 isCFFOpenType; 26483 constructor(e, t) { 26484 this.fontFamily = e; 26485 let n = new Nn(t); 26486 this.fontDataView = n; 26487 let s = n.getUint32(0); 26488 if (s === 65536) 26489 this.isCFFOpenType = !1; 26490 else if (s === 1330926671) 26491 this.isCFFOpenType = !0; 26492 else 26493 throw new Error("Unsupported font format (sfntVersion 0x" + s.toString(16) + ")"); 26494 let o = Tf.getTableRecords(n) 26495 , i = {}; 26496 this.tableMap = i; 26497 for (let r of o) { 26498 let a = r.tag.trim(); 26499 i[a] = new (PT[a] || El)(a,this,t,r.offset,r.length) 26500 }
26501 Object.keys(i).forEach(r=>i[r].init()), 26502 this.calculateChecksum(n) 26503 } 26504 getArrayBuffer() { 26505 return this.fontDataView.buffer 26506 } 26507 static getTableRecords(e) { 26508 let t = e.getUint16(4) 26509 , n = [] 26510 , s = 12; 26511 for (let o = s + 16 * t; s < o; s += 16) 26512 n.push({ 26513 tag: e.getTag(s), 26514 checksum: e.getUint32(s + 4), 26515 offset: e.getUint32(s + 8), 26516 length: e.getUint32(s + 12) 26517 }); 26518 return n 26519 } 26520 getPathDatas(e, t, n, s, o, i, r, a, d) { 26521 return wT(this, e, t, n, s, o, i, r, a, d) 26522 } 26523 createGlyphData(e, t) { 26524 let s = this.getGlyphClass(e) === 3 ? 0 : this.tableMap.hmtx.getAdvanceWidth(e); 26525 return new lT(e,s,t) 26526 } 26527 getGlyphClass(e) { 26528 return this.tableMap.GDEF ? this.tableMap.GDEF.getGlyphClass(e) : 0 26529 } 26530 calculateChecksum(e) { 26531 let t = 0 26532 , n = e.byteLength 26533 , s = 0; 26534 for (; t <= n - 4; t += 4) { 26535 let o = e.getUint32(t); 26536 s = s + o 26537 } 26538 if (t < n) { 26539 let o = e.getUint8(t++) << 24 | (t < n ? e.getUint8(t++) << 16 : 0) | (t < n ? e.getUint8(t++) << 8 : 0) | (t < n ? e.getUint8(t) : 0); 26540 s = s + o 26541 } 26542 return s &= 4294967295, 26543 s > 0 ? s : s + 4294967296 26544 } 26545 getAscent(e) { 26546 return this.ascent == null && this.initLineMetrics(), 26547 e * this.ascent 26548 } 26549 getDescent(e) { 26550 return this.descent == null && this.initLineMetrics(), 26551 e * this.descent 26552 } 26553 getLineGap(e) { 26554 return this.lineGap == null && this.initLineMetrics(), 26555 e * this.lineGap 26556 } 26557 initLineMetrics() { 26558 let e = this.tableMap 26559 , n = e.head.getUnitsPerEm() 26560 , s = e["OS/2"]; 26561 if ((s.getUint16(62) & 128) !== 0) { 26562 let r = s.getInt16(68) 26563 , a = s.getInt16(70) 26564 , d = s.getInt16(72); 26565 this.ascent = r / n, 26566 this.descent = a / n, 26567 this.lineGap = d / n 26568 } else { 26569 let r = e.hhea 26570 , a = r.getAscender() 26571 , d = r.getDescender() 26572 , u = r.getLineGap(); 26573 this.ascent = a / n,
26574 this.descent = d / n, 26575 this.lineGap = u / n 26576 } 26577 } 26578} 26579const xT = "AIzaSyCFGFZ09d4QOOHhky4XH-Dw7gAKqilzxQQ"; 26580let Gi; 26581async function Ly() { 26582 Gi == null && (Gi = fetch("https://www.googleapis.com/webfonts/v1/webfonts?key=" + xT).then(l=>l.json()).then(l=>l.items)); 26583 try { 26584 await Gi 26585 } catch (l) { 26586 console.log("error", l), 26587 Gi = [] 26588 } 26589 return Gi 26590} 26591async function CT(l="Roboto", e, t) { 26592 let n = await Ly(); 26593 if (n == null) 26594 return null; 26595 let s = l.toLowerCase() 26596 , o = n.find(a=>a.family?.toLowerCase() === s); 26597 if (o == null) 26598 return null; 26599 let i; 26600 i = "regular"; 26601 let r = o.files[i]; 26602 return r == null && t && (r = o.files.italic), 26603 r == null && (r = o.files.regular ?? o.files[0], 26604 r == null) ? null : (r = r.replace('http://", "https://'), 26605 Vy(r)) 26606} 26607async function Vy(l) { 26608 let e = await fetch(l); 26609 return console.log(e), 26610 (await e.blob()).arrayBuffer() 26611} 26612function _T(l) { 26613 let e = "" 26614 , t = new Uint8Array(l) 26615 , n = t.byteLength; 26616 for (let s = 0; s < n; s++) 26617 e += String.fromCharCode(t[s]); 26618 return window.btoa(e) 26619} 26620const _o = new Map 26621 , mc = new Map 26622 , TT = (await Vy("fonts/Roboto-Regular.ttf").then(l=>ud("Roboto", l))).font; 26623function yc(l, e) { 26624 let t = mc.get(l); 26625 t == null && (t = new Set, 26626 mc.set(l, t)), 26627 t.add(e) 26628} 26629async function kf(l, e=!0) { 26630 V().appSettings.privacy.allowGoogleFonts, 26631 l = Ny(l); 26632 let t = _o.get(l); 26633 return t == null && (t = ud(l), 26634 _o.set(l, t)), 26635 t instanceof Promise && (t = await t, 26636 t == null && (e ? (await kf("Roboto", !1), 26637 t = _o.get("Roboto")) : t = null), 26638 _o.set(l, t)), 26639 t ? t.font : null 26640} 26641async function ud(l, e) { 26642 if (e == null && (e = await CT(l), 26643 e == null)) 26644 return; 26645 let t = new FontFace(l,e); 26646 document.fonts.add(t); 26647 let n = new Tf(l,e); 26648 try { 26649 await document.fonts.load('8px "' + l + '"') 26650 } catch (o) { 26651 console.error(o) 26652 } 26653 let s = { 26654 font: n, 26655 fontFace: t 26656 }; 26657 return _o.set(l, s), 26658 s 26659} 26660function dg(l, e) { 26661 l = Ny(l); 26662 let t = mc.get(l); 26663 if (t != null && (t.delete(e), 26664 t.size === 0)) { 26665 let n = _o.get(l).fontFace; 26666 document.fonts.delete(n), 26667 _o.delete(l) 26668 } 26669} 26670function Ny(l) { 26671 return l = l.trim(), 26672 l = l.replaceAll('"', ""), 26673 l 26674} 26675const ug = 24 26676 , kT = "Roboto"; 26677function Ca(l, e, t) { 26678 return e == null && t && (e = t.style.getPropertyValue("text-decoration").includes("line-through")), 26679 l == null && t && (l = t.style.getPropertyValue("text-decoration").includes("underline")), 26680 l ? e ? "underline line-through" : "underline" : e ? "line-through" : "none" 26681} 26682class zo { 26683 textSpanModel; 26684 font; 26685 fontFamily; 26686 fontSize; 26687 bold; 26688 italic; 26689 underline; 26690 strikethrough; 26691 fill; 26692 fillRule; 26693 stroke; 26694 strokeStyle; 26695 matchesSelection; 26696 constructor(e) { 26697 this.textSpanModel = e, 26698 this.setBold(!1), 26699 this.setItalic(!1), 26700 this.setUnderline(!1), 26701 this.setStrikethrough(!1), 26702 this.setFontSize(ug), 26703 this.setFont(TT), 26704 this.setFill(new et(new ce(0,0,0))), 26705 this.setFillRule("nonzero"), 26706 this.setStroke(null), 26707 this.setStrokeStyle(new Qt) 26708 } 26709 setFontSize(e) { 26710 this.fontSize = e; 26711 let t = e + "px"; 26712 this.setModelStyleProperty("font-size", t) 26713 } 26714 setFont(e) { 26715 this.font = e, 26716 this.fontFamily = e.fontFamily, 26717 this.setModelStyleProperty("font-family", this.fontFamily) 26718 } 26719 async setFontFamily(e) { 26720 this.fontFamily !== e && (this.fontFamily = e, 26721 this.font = await kf(e), 26722 this.setModelStyleProperty("font-family", e)) 26723 } 26724 setBold(e) { 26725 this.bold = e, 26726 this.setModelStyleProperty("font-weight", e ? "600" : "300") 26727 } 26728 setItalic(e) { 26729 this.italic = e, 26730 this.setModelStyleProperty("font-style", e ? "italic" : "normal") 26731 } 26732 setUnderline(e) { 26733 this.underline = e; 26734 let t = Ca(e, this.strikethrough); 26735 this.setModelStyleProperty("text-decoration", t) 26736 } 26737 setStrikethrough(e) { 26738 this.strikethrough = e; 26739 let t = Ca(this.underline, e); 26740 this.setModelStyleProperty("text-decoration", t) 26741 } 26742 setFill(e) { 26743 this.fill = e, 26744 this.setModelStyleProperty("fill", e) 26745 } 26746 setFillRule(e) { 26747 this.fillRule = e, 26748 this.setModelStyleProperty("fill-rule", e) 26749 } 26750 setStroke(e) { 26751 this.stroke = e, 26752 this.setModelStyleProperty("stroke", e) 26753 } 26754 setStrokeStyle(e) { 26755 e = e.clone(), 26756 this.strokeStyle = e, 26757 this.setModelStyleProperty("strokeStyle", e) 26758 } 26759 setModelStyleProperty(e, t) { 26760 this.textSpanModel && this.textSpanModel.setStyleProperty(e, t) 26761 } 26762 hasStyleAttribute(e, t) { 26763 let n = this[e]; 26764 return e === "fill" || e === "stroke" || e === "strokeStyle" ? n == null ? t == null : n.equals(t) : this[e] === t 26765 } 26766 async setStyleAttribute(e, t) { 26767 switch (e) { 26768 case "bold": 26769 this.setBold(t); 26770 break; 26771 case "italic": 26772 this.setItalic(t); 26773 break; 26774 case "strikethrough": 26775 this.setStrikethrough(t); 26776 break; 26777 case "underline": 26778 this.setUnderline(t); 26779 break; 26780 case "fontFamily": 26781 await this.setFontFamily(t); 26782 break; 26783 case "fontSize": 26784 this.setFontSize(t); 26785 break; 26786 case "fill": 26787 this.setFill(t); 26788 break; 26789 case "fillRule": 26790 this.setFillRule(t); 26791 break; 26792 case "stroke": 26793 this.setStroke(t); 26794 break; 26795 case "strokeStyle": 26796 this.setStrokeStyle(t); 26797 break; 26798 default: 26799 console.error("Unknown attribute " + e) 26800 } 26801 } 26802 getCssProperty(e, t) { 26803 let n, s; 26804 switch (e) { 26805 case "bold": 26806 n = "font-weight", 26807 s = this.bold ? "600" : "400"; 26808 break; 26809 case "italic": 26810 n = "font-style", 26811 s = this.italic ? "italic" : "none"; 26812 break; 26813 case "strikethrough": 26814 n = "text-decoration", 26815 s = Ca(this.underline, null, t); 26816 break; 26817 case "underline": 26818 n = "text-decoration", 26819 s = Ca(null, this.strikethrough, t); 26820 break; 26821 case "fontFamily": 26822 n = "font-family", 26823 s = this.fontFamily; 26824 break; 26825 case "fontSize": 26826 n = "font-size", 26827 s = this.fontSize; 26828 break; 26829 case "fill": 26830 n = "fill", 26831 s = this.fill; 26832 break; 26833 case "fillRule": 26834 n = "fill-rule", 26835 s = this.fillRule; 26836 break; 26837 case "stroke": 26838 n = "stroke", 26839 s = this.stroke; 26840 break; 26841 default: 26842 console.error("Unknown attribute " + e) 26843 } 26844 return [n, s] 26845 } 26846 async setFromElement(e) { 26847 let t = getComputedStyle(e) 26848 , n = t.getPropertyValue("font-weight"); 26849 this.setBold(parseInt(n) > 500); 26850 let s = t.getPropertyValue("font-style"); 26851 this.setItalic(s === "italic" || s === "oblique"); 26852 let o = t.getPropertyValue("text-decoration"); 26853 this.setUnderline(o.includes("underline")), 26854 this.setStrikethrough(o.includes("line-through")); 26855 let i = t.getPropertyValue("font-size"); 26856 this.setFontSize(i === "" ? ug : parseInt(i)); 26857 let r = t.getPropertyValue("font-family"); 26858 return r = r.replaceAll('"', ""), 26859 await this.setFontFamily(r === "" ? kT : r), 26860 this 26861 } 26862 set(e) { 26863 e && (this.setFont(e.font), 26864 this.setFontSize(e.fontSize), 26865 this.setBold(e.bold), 26866 this.setItalic(e.italic), 26867 this.setUnderline(e.underline), 26868 this.setStrikethrough(e.strikethrough), 26869 this.setFill(e.fill && e.fill.clone()), 26870 this.setFillRule(e.fillRule && e.fillRule), 26871 this.setStroke(e.stroke && e.stroke.clone()), 26872 this.setStrokeStyle(e.strokeStyle)) 26873 } 26874 equals(e) { 26875 return e ? this.bold === e.bold && this.italic === e.italic && this.underline === e.underline && this.strikethrough === e.strikethrough && this.fontSize === e.fontSize && this.fontFamily === e.fontFamily && (this.fill == null ? e.fill == null : this.fill.equals(e.fill)) && this.fillRule === e.fillRule && (this.stroke == null ? e.stroke == null : this.stroke.equals(e.stroke)) && (this.strokeStyle == null ? e.strokeStyle == null : this.strokeStyle.equals(e.strokeStyle)) : !1 26876 } 26877 toJSON() { 26878 return { 26879 fontFamily: this.fontFamily, 26880 fontSize: this.fontSize, 26881 bold: this.bold, 26882 italic: this.italic, 26883 underline: this.underline,
26884 strikethrough: this.strikethrough 26885 } 26886 } 26887 setJSON(e) { 26888 this.setFontFamily(e.fontFamily), 26889 this.setFontSize(e.fontSize), 26890 this.setBold(e.bold), 26891 this.setItalic(e.italic), 26892 this.setUnderline(e.underline), 26893 this.setStrikethrough(e.strikethrough) 26894 } 26895 static fromJSON(e) { 26896 let t = new zo; 26897 return t.setJSON(e), 26898 t 26899 } 26900} 26901const ET = "Â "; 26902class zr extends Nt { 26903 static type = "textSpan"; 26904 textStyle; 26905 isLineBreakSpan = !1; 26906 constructor(e) { 26907 e == null && (e = de("tspan", { 26908 style: "white-space: pre;" 26909 })), 26910 super(e), 26911 this.textStyle = new zo(this) 26912 } 26913 getTSpan() { 26914 return this.baseElement 26915 } 26916 setLineEndSpan() { 26917 this.baseElement.textContent = ET, 26918 this.isLineBreakSpan = !0 26919 } 26920 getText() { 26921 return this.baseElement.textContent 26922 } 26923 setText(e) { 26924 this.baseElement.textContent = e, 26925 this.isLineBreakSpan = !1 26926 } 26927 getTextLength() { 26928 return this.getText().length 26929 } 26930 getAscent() { 26931 let e = this.getStylePropertyValue("font-size", !0); 26932 return e = parseInt(e), 26933 this.getFont().getAscent(e) 26934 } 26935 getDescent() { 26936 let e = this.getStylePropertyValue("font-size", !0); 26937 return e = parseInt(e), 26938 this.getFont().getDescent(e) 26939 } 26940 getBoundsOld() { 26941 let e = this.baseElement; 26942 if (e.getNumberOfChars() === 0) 26943 return null; 26944 { 26945 let t = e.getStartPositionOfChar(0) 26946 , s = e.getNumberOfChars() === 0 ? 0 : e.getSubStringLength(0, e.getNumberOfChars()) 26947 , o = this.getAscent() 26948 , i = this.getDescent(); 26949 return new Ve(t.x,t.y - o,s,o - i) 26950 } 26951 } 26952 getBounds() { 26953 const e = this.baseElement 26954 , t = e.textContent 26955 , n = e.getNumberOfChars(); 26956 if (n === 0) 26957 return null; 26958 const s = /[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/ 26959 , o = /[A-Za-z\u00C0-\u024F\u1E00-\u1EFF]/ 26960 , i = s.test(t) 26961 , r = o.test(t) 26962 , a = i && r 26963 , d = new Set; 26964 if (!a) 26965 d.add(0), 26966 d.add(n - 1); 26967 else { 26968 let b = function(x) { 26969 return s.test(x) ? 2 : o.test(x) ? 1 : 0 26970 } 26971 , M = 0 26972 , S = b(t[0]); 26973 for (let x = 1; x < n; x++) { 26974 const P = b(t[x]); 26975 (P !== 0 && S !== 0 && P !== S || P !== 0 && S === 0) && (d.add(M), 26976 d.add(x - 1), 26977 M = x, 26978 S = P) 26979 } 26980 d.add(M), 26981 d.add(n - 1) 26982 } 26983 let u = 1 / 0 26984 , h = -1 / 0; 26985 for (const g of d) 26986 try { 26987 const y = e.getExtentOfChar(g); 26988 u = Math.min(u, y.x, y.x + y.width), 26989 h = Math.max(h, y.x, y.x + y.width) 26990 } catch {} 26991 if (u === 1 / 0) 26992 return null; 26993 let c; 26994 try { 26995 c = e.getStartPositionOfChar(0).y 26996 } catch { 26997 return null 26998 } 26999 const f = this.getAscent() 27000 , p = this.getDescent(); 27001 return new Ve(u,c - f,h - u,f - p) 27002 } 27003 getFont() { 27004 return this.textStyle.font 27005 } 27006 getStylePropertyValue(e) { 27007 let t = this.baseElement.style.getPropertyValue(e); 27008 return e === "font-family" && (t = t.replaceAll('"', "")), 27009 t 27010 } 27011 setStyleProperty(e, t) { 27012 if (!(this.isLineBreakSpan && e !== "font-family" && e !== "font-size" && e !== "fill" && e !== "stroke")) 27013 if (e === "font-family") { 27014 if (this.getDocumentModel()) { 27015 let s = this.getStylePropertyValue(e, !0); 27016 s !== t && (s !== "" && dg(s, this), 27017 yc(t, this)) 27018 } 27019 t[0] !== '"' && t[0] !== "'" && (t = '"' + t + '"'), 27020 this.baseElement.style.setProperty(e, t) 27021 } else 27022 e === "fill" || e === "stroke" ? this.setPaint(t, e) : e === "strokeStyle" ? this.setStrokeStyle(t) : this.baseElement.style.setProperty(e, t) 27023 } 27024 setPaint(e, t, n=!1) { 27025 e != null && e.isTransformable() && (e = e.clone()), 27026 super.setPaint(e, t, n) 27027 } 27028 copyPositionAttributes(e) { 27029 let t = this.baseElement 27030 , n = e.baseElement; 27031 for (let s of ["x", "dy"]) { 27032 let o = n.getAttribute(s); 27033 o ? t.setAttribute(s, o) : t.removeAttribute(s) 27034 } 27035 } 27036 removePositionAttributes() { 27037 let e = this.baseElement; 27038 e.removeAttribute("x"), 27039 e.removeAttribute("dy") 27040 } 27041 clone(e, t) { 27042 let n = new zr(this.baseElement.cloneNode(!0)); 27043 return e != null && n.setText(n.getText().substr(e, t)), 27044 n.textStyle.set(this.textStyle), 27045 n.removePositionAttributes(), 27046 n 27047 } 27048 applyTransformToElement() { 27049 let e = this.getParentModel() 27050 , t = e ? e.getAggregateTransform() : null; 27051 for (let o of [this.fillPaint, this.strokePaint]) 27052 o && o.setModelTransform(t, t);
27053 let n = this.getStrokeStyle() 27054 , s = n.width; 27055 if (s) { 27056 let o = t.decompose().scale 27057 , i = s / Math.max(...o); 27058 this.baseElement.style.setProperty("stroke-width", i + "px"), 27059 this.baseElement.style.setProperty("stroke-dasharray", n.getScaledDashArray(i)) 27060 } 27061 } 27062 ancestorChanged() { 27063 let e = this._documentModel; 27064 super.ancestorChanged(); 27065 let t = this._documentModel; 27066 if (t == null != (e == null)) { 27067 let s = this.textStyle.fontFamily; 27068 e != null && dg(s), 27069 t != null && yc(s, this) 27070 } 27071 let n = this.getAggregateTransform(); 27072 for (let s of [this.fillPaint, this.strokePaint]) 27073 s && (s.setModelTransform(n, n), 27074 s.updateModelFromView()) 27075 } 27076 toJSON() { 27077 return { 27078 text: this.getText(), 27079 textStyle: this.textStyle 27080 } 27081 } 27082 setJSON(e) { 27083 if (e.textStyle) { 27084 this.setText(e.text); 27085 let t = new zo(this); 27086 t.setJSON(e.textStyle), 27087 this.textStyle = t 27088 } 27089 } 27090} 27091class Ry extends Ue { 27092 _textModel; 27093 _lineIndex; 27094 _lineOffset; 27095 constructor(e, t, n) { 27096 super(!0), 27097 this._textModel = e, 27098 this._lineIndex = t, 27099 this._lineOffset = n 27100 } 27101 async undo() { 27102 await this._textModel.mergeLineWithNext(this._lineIndex, !0) 27103 } 27104 async redo() { 27105 await this._textModel.breakLine(this._lineIndex, this._lineOffset, !0) 27106 } 27107} 27108class Fy extends Ue { 27109 _textModel; 27110 _lineIndex; 27111 _textSpanModels; 27112 constructor(e, t, n) { 27113 super(!0), 27114 this._textModel = e, 27115 this._lineIndex = t, 27116 this._textSpanModels = n.slice() 27117 } 27118 async undo() { 27119 this._textModel.insertTextLine(this._lineIndex, this._textSpanModels) 27120 } 27121 async redo() { 27122 this._textModel.deleteTextLine(this._lineIndex) 27123 } 27124} 27125class By extends Ue { 27126 _textModel; 27127 _lineIndex; 27128 _lineOffset; 27129 constructor(e, t, n) { 27130 super(!0), 27131 this._textModel = e, 27132 this._lineIndex = t, 27133 this._lineOffset = n 27134 } 27135 async undo() { 27136 await this._textModel.breakLine(this._lineIndex, this._lineOffset, !0) 27137 } 27138 async redo() { 27139 await this._textModel.mergeLineWithNext(this._lineIndex, !0) 27140 } 27141} 27142class Rn extends Fn { 27143 static type = "text"; 27144 textElement; 27145 textLines = []; 27146 textAlignment = "left"; 27147 _fillRule = "nonzero"; 27148 constructor(e, t=0, n=0) { 27149 let s = de("g"); 27150 super(s); 27151 let o = de("g"); 27152 s.appendChild(o); 27153 let i = de("text", { 27154 style: "font-weight: 400; font-style: normal; text-decoration: none; font-family: Roboto; font-size:12px;" 27155 }); 27156 this.textElement = i, 27157 s.appendChild(i); 27158 let r = new zr; 27159 r.textStyle.set(e), 27160 this.insertChildAt(r, 0), 27161 r.setLineEndSpan(); 27162 let a = new Wn(this,[r]); 27163 this.textLines.push(a), 27164 this.layoutLines(), 27165 this.updateBidiAttributes(), 27166 this.setSelfTransform(new oe().translate(t, n)) 27167 } 27168 clone() { 27169 let e = new Rn; 27170 this.copyAttributes(e), 27171 e.deleteTextLine(0); 27172 for (let t of this.textLines) { 27173 let n = t.getTextSpans().map(s=>{ 27174 let o = s.clone(); 27175 return e.insertChildAt(o), 27176 o 27177 } 27178 ); 27179 e.textLines.push(new Wn(e,n)) 27180 } 27181 return e 27182 } 27183 copyAttributes(e) { 27184 super.copyAttributes(e), 27185 e.setAlignment?.(this.textAlignment), 27186 e.setFillRule(this.fillRule) 27187 } 27188 toPathModel() { 27189 let e = this.getSelfTransform() 27190 , t = this.getPaths(e) 27191 , n = new bt(t); 27192 return this.copyAttributes(n), 27193 n 27194 } 27195 toPathModels() { 27196 let e = [] 27197 , t = this.getSelfTransform() 27198 , n = this.getPathDataArray(t).map(o=>o.join("")) 27199 , s = this.getTextSpanModels(); 27200 for (let o = 0; o < s.length; o++) 27201 if (n[o]) {
27202 let r = Xl(n[o]) 27203 , a = new bt(r); 27204 s[o].copyAttributes(a), 27205 e.push(a) 27206 } 27207 return e 27208 } 27209 getBounds() { 27210 let e = null; 27211 for (let t of this.textLines) { 27212 let n = t.getBounds(); 27213 e = e == null ? n : e.addRect(n) 27214 } 27215 return e 27216 } 27217 applyTransformToElement() { 27218 let e = this.getAggregateTransform(); 27219 e.isIdentity ? this.baseElement.removeAttribute("transform") : this.baseElement.setAttribute("transform", e.toSvgValue()); 27220 for (let t of [this.fillPaint, this.strokePaint]) 27221 t && t.setModelTransform(e, e) 27222 } 27223 getChildContainerElement() { 27224 return this.textElement 27225 } 27226 getOverlayPathInfo() { 27227 let e, t = this.getBounds(); 27228 if (t == null) 27229 e = ""; 27230 else { 27231 let n = t.x 27232 , s = t.y 27233 , o = n + t.width 27234 , i = s + t.height; 27235 e = "M" + n + " " + s + "H" + o + "V" + i + "H" + n + "z" 27236 } 27237 return { 27238 pathData: e, 27239 transform: this.getAggregateTransform() 27240 } 27241 } 27242 getPaths(e, t, n) { 27243 return this.getPathDataArray(e).reduce((o,i)=>o.concat(Xl(i.join(""))), []) 27244 } 27245 getPathData(e, t, n) { 27246 return this.getPathDataArray(e, t, n).map(o=>o.join("")).join("") 27247 } 27248 getPathDataArray(e, t, n) { 27249 let s = [] 27250 , o = 0; 27251 for (let i of this.textLines) 27252 for (let r of i.getTextSpans()) { 27253 let a = r.getTSpan() 27254 , d = r.getText() 27255 , u = a.getAttribute("dy"); 27256 if (o += parseFloat(u || 0), 27257 r.isLineBreakSpan) 27258 s.push([]); 27259 else { 27260 let h = r.textStyle 27261 , c = h.fontSize 27262 , f = a.getStartPositionOfChar(0) 27263 , p = (e?.clone() ?? new oe).translate(f.x, o) 27264 , g = h.italic 27265 , y = h.bold 27266 , m = h.underline 27267 , b = h.strikethrough 27268 , M = h.font 27269 , S = h.fillRule ?? this.getFiillRule() ?? "nonzero" 27270 , x = M.getPathDatas(d, parseFloat(c), p, g, y, m, b, n, S); 27271 s.push(x) 27272 } 27273 } 27274 return s 27275 } 27276 getText(e=0, t) { 27277 t == null && (t = this.getTextLength() - e); 27278 let n = ""; 27279 for (let s = 0; s < this.textLines.length; s++) { 27280 let i = this.textLines[s].getTextSpans(); 27281 for (let r = 0; r < i.length; r++) { 27282 let d = i[r].getText() 27283 , u = d.length; 27284 if (u > e) 27285 if (r === i.length - 1) 27286 n += ` 27287`, 27288 e = 0, 27289 t--; 27290 else { 27291 let h = Math.min(u - e, t); 27292 if (n += d.substring(e, e + h), 27293 e = 0, 27294 t -= h, 27295 t === 0) 27296 break 27297 } 27298 else 27299 e -= u 27300 } 27301 } 27302 return n 27303 } 27304 getTextLength() { 27305 let e = 0; 27306 for (let t of this.textLines) 27307 e += t.getTextLength(); 27308 return e 27309 } 27310 isEmpty() { 27311 return this.textLines.length === 1 && this.textLines[0].isEmpty() 27312 } 27313 getOffsetForPoint(e, t) { 27314 let n = e.x, s = e.y, o = 0, i = 0, r, a, d = Number.MAX_VALUE; 27315 for (let u of this.textLines) { 27316 let h = u.getBounds(); 27317 if (t) { 27318 let c = Math.abs(h.y + h.height / 2 - e.y); 27319 c < d && (d = c, 27320 r = u, 27321 a = i) 27322 } else if (n >= h.x - o && s >= h.y - o && n <= h.x + h.width + o && s <= h.y + h.height + o) { 27323 r = u, 27324 a = i; 27325 break 27326 } 27327 i += u.getTextLength() 27328 } 27329 if (r != null) { 27330 let u = r.getOffsetForPoint(e, t); 27331 if (u !== -1) 27332 return a + u 27333 } 27334 return -1 27335 } 27336 insertText(e, t, n, s) { 27337 if (e = e.replace("\r", ""), 27338 e.length === 0) 27339 return; 27340 let o = e.split(/(\n)/g).filter(r=>r !== "") 27341 , i = this.textLines; 27342 for (let r = 0; r < i.length; r++) { 27343 let a = i[r] 27344 , d = a.getTextLength(); 27345 if (d > t) { 27346 for (let u of o) 27347 u === ` 27348` ? (a = this.breakLine(r, t, !1, s), 27349 t = 0, 27350 r++) : (a.insertText(u, t, n, s), 27351 t += u.length); 27352 break 27353 } 27354 t -= d 27355 } 27356 this.layoutLines(), 27357 this.updateBidiAttributes(), 27358 this.modelChanged() 27359 } 27360 deleteTextLine(e) { 27361 let t = this.textLines 27362 , n = t[e]; 27363 return n.removeTextSpanModels(), 27364 t.splice(e, 1), 27365 n 27366 } 27367 insertTextLine(e, t) { 27368 let n = this.textLines 27369 , s = new Wn(this,t); 27370 n.splice(e, 0, s); 27371 let o = s.getFirstTextSpanIndex(); 27372 for (let i = 0; i < t.length; i++) 27373 this.insertChildAt(t[i], o + i); 27374 return s 27375 } 27376 breakLine(e, t, n, s) { 27377 let o = this.textLines 27378 , r = o[e].breakLine(t, s); 27379 return o.splice(e + 1, 0, r), 27380 s && s.addEdit(new Ry(this,e,t)), 27381 n && this.layoutLines(), 27382 r 27383 } 27384 mergeLineWithNext(e, t, n) { 27385 let s = this.textLines 27386 , o = s[e]; 27387 o.removeTextSpanModelFrom(-1); 27388 let i = o.getTextLength() 27389 , r = o.getTextSpans() 27390 , d = s[e + 1].getTextSpans(); 27391 d[0].removePositionAttributes(), 27392 r.splice(r.length, 0, ...d), 27393 s.splice(e + 1, 1), 27394 n && n.addEdit(new By(this,e,i)), 27395 t && this.layoutLines() 27396 } 27397 deleteText(e, t, n) { 27398 if (t === 0) 27399 return; 27400 let s = this.textLines 27401 , o = !1; 27402 for (let i = 0; i < s.length && t > 0; ) { 27403 let r = s[i] 27404 , a = r.getTextLength(); 27405 e < a ? e + t >= a ? e === 0 ? (n && n.addEdit(new Fy(this,i,r.getTextSpans())), 27406 r.removeTextSpanModels(), 27407 s.splice(i, 1), 27408 t -= a) : (r.deleteText(e, a - e - 1, n), 27409 o = !0, 27410 t -= a - e, 27411 t === 0 && i < s.length - 1 && this.mergeLineWithNext(i, !1, n), 27412 i++, 27413 e = 0) : (r.deleteText(e, t, n), 27414 e === 0 && o && this.mergeLineWithNext(i - 1, !1, n), 27415 e = 0, 27416 t = 0) : (e -= a, 27417 i++) 27418 } 27419 this.layoutLines(), 27420 this.updateBidiAttributes(), 27421 this.modelChanged() 27422 } 27423 layoutLines() { 27424 let e = this.textLines 27425 , t = e[0].getTextSpans()[0]; 27426 t.removePositionAttributes(); 27427 let n = 0; 27428 e[0].y = 0; 27429 for (let s = 1; s < e.length; s++) { 27430 let o = e[s - 1] 27431 , i = e[s] 27432 , r = o.getAscent() 27433 , a = o.getDescent() 27434 , d = i.getLineGap() 27435 , u = i.getAscent() 27436 , c = (r - a) * 1 - r + u + d; 27437 t = i.getTextSpans()[0], 27438 t.baseElement.setAttribute("x", 0), 27439 t.baseElement.setAttribute("dy", c), 27440 n += c, 27441 i.y = n 27442 } 27443 } 27444 async setStyleAttribute(e, t, n, s, o) { 27445 for (let i of this.textLines) { 27446 let r = i.getTextLength(); 27447 if (n >= r) 27448 n -= r;
27449 else { 27450 let a = Math.min(n + s, r) - n; 27451 if (await i.setStyleAttribute(e, t, n, a, o), 27452 s -= a, 27453 n = 0, 27454 s <= 0) 27455 break 27456 } 27457 } 27458 this.layoutLines(), 27459 this.modelChanged() 27460 } 27461 updateBidiAttributes() { 27462 const e = this.getText(); 27463 let t = !1; 27464 for (let s = 0; s < e.length; s++) { 27465 let o = Iy(e.charCodeAt(s)); 27466 if (o === Ut || o === kn) { 27467 t = !0; 27468 break 27469 } 27470 } 27471 let n = this.textElement; 27472 t ? n.setAttribute("direction", "rtl") : n.removeAttribute("direction"), 27473 n.setAttribute("unicode-bidi", "plaintext") 27474 } 27475 getTextSpanModels() { 27476 let e = []; 27477 return this.textLines.forEach(t=>e.push(...t.getTextSpans())), 27478 e 27479 } 27480 getTextSpanModelAt(e, t=1) { 27481 let n; 27482 for (n of this.textLines) { 27483 let s = n.getTextLength(); 27484 if (s > e) 27485 return n.getTextSpanModelAt(e, t); 27486 e -= s 27487 } 27488 return null 27489 } 27490 getLineIndex(e) { 27491 let t = this.textLines; 27492 for (let n = 0; n < t.length; n++) { 27493 let s = t[n].getTextLength(); 27494 if (s > e) 27495 return n; 27496 e -= s 27497 } 27498 return t.length - 1 27499 } 27500 getLineOffsetRange(e) { 27501 let t = 0; 27502 for (let s = 0; s < e; s++) 27503 t += this.textLines[s].getTextLength(); 27504 let n = t + this.textLines[e].getTextLength(); 27505 return [t, n] 27506 } 27507 getOffsetInLine(e, t) { 27508 let n = this.textElement 27509 , s = this.getLineOffsetRange(e); 27510 if (t <= n.getStartPositionOfChar(s[0]).x) 27511 return s[0]; 27512 if (t >= n.getStartPositionOfChar(s[1] - 1).x) 27513 return s[1] - 1; 27514 for (let o = s[0]; o < s[1]; o++) { 27515 let i = n.getEndPositionOfChar(o); 27516 if (t <= i.x) { 27517 let r = n.getExtentOfChar(o).width; 27518 return i.x - t < r / 2 ? o + 1 : o 27519 } 27520 } 27521 return s[0] 27522 } 27523 getCaretBounds(e) { 27524 let t; 27525 for (t of this.textLines) { 27526 let n = t.getTextLength(); 27527 if (n > e) 27528 break; 27529 e -= n 27530 } 27531 return t.getCaretBounds(e) 27532 } 27533 getAlignment() { 27534 return this.textAlignment 27535 } 27536 setAlignment(e) { 27537 if (this.textAlignment !== e) { 27538 let t = this.textElement 27539 , n = e === "right" ? "end" : e === "center" ? "middle" : "start"; 27540 t.setAttribute("text-anchor", n); 27541 let s = t.getBBox().width 27542 , o = this.textAlignment || "left" 27543 , i = o === "right" ? s : o === "center" ? s / 2 : 0 27544 , a = (e === "right" ? s : e === "center" ? s / 2 : 0) - i 27545 , d = this.getSelfTransform(); 27546 d.translate(a, 0), 27547 this.setSelfTransform(d), 27548 this.textAlignment = e 27549 } 27550 } 27551 setParagraphStyleAttribute(e, t) { 27552 if (e === "alignment" && this.textAlignment !== t) { 27553 let n = this.textElement 27554 , s = t === "right" ? "end" : t === "center" ? "middle" : "start"; 27555 n.setAttribute("text-anchor", s); 27556 let o = n.getBBox().width 27557 , i = this.textAlignment || "left" 27558 , r = i === "right" ? o : i === "center" ? o / 2 : 0 27559 , d = (t === "right" ? o : t === "center" ? o / 2 : 0) - r 27560 , u = this.getSelfTransform(); 27561 u.translate(d, 0), 27562 this.setSelfTransform(u), 27563 this.textAlignment = t 27564 } 27565 } 27566 async setPaint(e, t) { 27567 await this.setStyleAttribute(t, e, 0, this.getTextLength()) 27568 } 27569 setStrokeStyle(e) { 27570 this.setStyleAttribute("strokeStyle", e, 0, this.getTextLength()) 27571 } 27572 getFillPaint() { 27573 return this.getTextSpanModelAt(0)?.getFillPaint() 27574 } 27575 getStrokePaint() { 27576 return this.getTextSpanModelAt(0)?.getStrokePaint() 27577 } 27578 getStrokeStyle() { 27579 return this.getTextSpanModelAt(0)?.getStrokeStyle() 27580 } 27581 _getStrokeElement() { 27582 return null 27583 } 27584 _getFillElement() { 27585 return null 27586 } 27587 getFillRule() { 27588 return this._fillRule 27589 } 27590 setFillRule(e) { 27591 this._fillRule = e, 27592 e === "evenodd" ? this.baseElement.setAttribute("fill-rule", e) : this.baseElement.removeAttribute("fill-rule") 27593 } 27594 printModel() { 27595 console.log("---"); 27596 for (let e = 0; e < this.textLines.length; e++) { 27597 let n = this.textLines[e].getTextSpans(); 27598 console.log("line " + e); 27599 for (let s = 0; s < n.length; s++) 27600 console.log("span " + s + ": '" + n[s].getText().replace(` 27601`, "\\n") + "'") 27602 } 27603 } 27604 toJSON() { 27605 return Object.assign(super.toJSON(), { 27606 textLines: this.textLines, 27607 textAlignment: this.textAlignment 27608 }) 27609 } 27610 setJSON(e) { 27611 super.setJSON(e); 27612 let t = e.textLines; 27613 t && Array.isArray(t) && (this.deleteTextLine(0), 27614 t.forEach(n=>{ 27615 let s = n.textSpans.map(i=>zr.fromJSON(i)) 27616 , o = this.insertTextLine(this.textLines.length, s); 27617 o.y = t.y 27618 } 27619 )), 27620 this.setAlignment(e.textAlignment), 27621 this.layoutLines(), 27622 this.updateBidiAttributes() 27623 } 27624} 27625function Ef(l) { 27626 let e = l.modelType; 27627 if (e === "circle") 27628 return du.fromJSON(l); 27629 if (e === "ellipse") 27630 return Cf.fromJSON(l); 27631 if (e === "rectangle") 27632 return uu.fromJSON(l); 27633 if (e === "star") 27634 return Bs.fromJSON(l); 27635 if (e === "polygon") 27636 return _f.fromJSON(l); 27637 if (e === "group") 27638 return Uo.fromJSON(l); 27639 if (e === "clipPath") 27640 return hu.fromJSON(l); 27641 if (e === "path") 27642 return bt.fromJSON(l); 27643 if (e === "text") 27644 return Rn.fromJSON(l) 27645} 27646class Uo extends Nt { 27647 static type = "group"; 27648 constructor() { 27649 let e = de("g"); 27650 super(e) 27651 } 27652 clone() { 27653 let e = new Uo;
27654 return this._childModels.forEach(t=>e.insertChildAt(t.clone())), 27655 this.copyAttributes(e), 27656 e 27657 } 27658 getPaths(e, t, n) { 27659 let s = []; 27660 for (let o of this._childModels) 27661 s = s.concat(o.getPaths(o.getAggregateTransform(), t, n)); 27662 return s 27663 } 27664 getPathData(e, t, n) { 27665 let s = ""; 27666 for (let o of this._childModels) { 27667 let i = o.getSelfTransform(); 27668 i.preMultiplyWith(e), 27669 s += o.getPathData(i, t, n) 27670 } 27671 return s 27672 } 27673 getOverlayPathInfo() { 27674 return { 27675 pathData: this.getPathData(null, -1), 27676 transform: this.getAggregateTransform() 27677 } 27678 } 27679 getBounds() { 27680 let e; 27681 for (let t of this._childModels) { 27682 let n = t.getTransformedBounds(t.getSelfTransform()); 27683 e = e == null ? n : e.addRect(n) 27684 } 27685 return e 27686 } 27687 getTransformedBounds(e) { 27688 e = e ?? this.getAggregateTransform(); 27689 let t; 27690 for (let n of this._childModels) { 27691 let s = n.getTransformedBounds(n.getSelfTransform().preMultiplyWith(e)); 27692 t = t == null ? s : t.addRect(s) 27693 } 27694 return t 27695 } 27696 getPaint(e) { 27697 let t = Lr(this._childModels); 27698 return t != null ? t.getPaint(e) : super.getPaint(e) 27699 } 27700 getStrokeStyle() { 27701 let e = Lr(this._childModels); 27702 return e != null ? e.getStrokeStyle() : super.getStrokeStyle() 27703 } 27704 setPaint(e, t) { 27705 t === "fill" ? this.fillPaint = e : this.strokePaint = e 27706 } 27707 setStrokeStyle(e) { 27708 super.setStrokeStyle(e); 27709 for (let t of this._childModels) 27710 t.setStrokeStyle(e) 27711 } 27712 toJSON() { 27713 return Object.assign(super.toJSON(), { 27714 childModels: this.getChildModels().map(e=>e.toJSON()) 27715 }) 27716 } 27717 setJSON(e) { 27718 super.setJSON(e); 27719 let t = e.childModels; 27720 if (t && Array.isArray(t)) { 27721 let n = t.map(s=>Ef(s)); 27722 this.insertChildrenAt(n.filter(s=>s != null)) 27723 } 27724 } 27725} 27726class cu { 27727 title = ""; 27728 description = ""; 27729 width = 512; 27730 height = 512; 27731 gridX = 32; 27732 gridY = 32; 27733 setSize(e, t) { 27734 this.width = e, 27735 this.height = t 27736 } 27737 clone() { 27738 return new cu().set(this) 27739 } 27740 set(e) { 27741 return this.width = e.width, 27742 this.height = e.height, 27743 this.title = e.title, 27744 this.description = e.description, 27745 this 27746 } 27747} 27748let DT = -1; 27749class Ei { 27750 _id; 27751 _name; 27752 _color = new ce; 27753 constructor(e, t, n) { 27754 this._name = e, 27755 this._color = t, 27756 this._id = n ?? ++DT 27757 } 27758 get id() { 27759 return this._id 27760 } 27761 set id(e) { 27762 throw new Error("id is readonly") 27763 } 27764 get name() { 27765 return this._name 27766 } 27767 set name(e) { 27768 this._name = e 27769 } 27770 setName(e) { 27771 this._name = e 27772 } 27773 get color() { 27774 return this._color 27775 } 27776 setColor(e) { 27777 this._color = e && e.clone() 27778 } 27779 equals(e) { 27780 return e._name === this.name && e.color.equals(this._color) 27781 } 27782 toJSON() { 27783 return { 27784 name: this.name, 27785 color: this.color.toCss(), 27786 id: this.id 27787 } 27788 } 27789 static fromJSON(e) { 27790 let t = e.id 27791 , n = e.name 27792 , s = new ce(e.color); 27793 if (t != null && n != null) 27794 return new Ei(n,s,t) 27795 } 27796} 27797class OT extends Ue { 27798 documentModel; 27799 globalColor; 27800 groupIndex; 27801 index; 27802 constructor(e, t, n, s) { 27803 super(!0), 27804 this.documentModel = e, 27805 this.globalColor = t, 27806 this.index = s 27807 } 27808 async undo() { 27809 this.documentModel.addGlobalColor(this.globalColor, this.groupIndex, this.index) 27810 } 27811 async redo() { 27812 this.documentModel.deleteGlobalColor(this.globalColor) 27813 } 27814} 27815class zy extends Ue { 27816 documentModel; 27817 globalColor; 27818 groupIndex; 27819 constructor(e, t, n) { 27820 super(!0), 27821 this.documentModel = e, 27822 this.globalColor = t, 27823 this.groupIndex = n 27824 } 27825 async undo() { 27826 this.documentModel.deleteGlobalColor(this.globalColor) 27827 } 27828 async redo() { 27829 this.documentModel.addGlobalColor(this.globalColor, this.groupIndex) 27830 } 27831} 27832class fi extends cr { 27833 static type = "document"; 27834 elementModelMap = new WeakMap; 27835 idDefMap = new Map; 27836 defsElement; 27837 modelChangeCallbacks = new WeakMap; 27838 globalColorGroups = [{ 27839 name: "", 27840 colors: [] 27841 }]; 27842 x = 0; 27843 y = 0; 27844 documentSettings = Et(new cu); 27845 constructor(e=512, t=512) { 27846 let n = de("svg", { 27847 width: e, 27848 height: t,
27849 viewBox: "0 0 " + e + " " + t, 27850 style: "position: absolute; display: block; overflow: visible;" 27851 }); 27852 super(n); 27853 let s = de("defs"); 27854 n.appendChild(s), 27855 this.defsElement = s, 27856 this._documentModel = this, 27857 this.setSize(e, t) 27858 } 27859 getDefsElement() { 27860 return this.defsElement 27861 } 27862 get svg() { 27863 throw new Error("use baseElement instead") 27864 } 27865 getBounds() { 27866 return new Ve(0,0,this.getWidth(),this.getHeight()) 27867 } 27868 getWidth() { 27869 return this.documentSettings.width 27870 } 27871 getHeight() { 27872 return this.documentSettings.height 27873 } 27874 setSize(e, t) { 27875 (e !== this.getWidth() || t !== this.getHeight()) && (this.documentSettings.setSize(e, t), 27876 this.baseElement.setAttribute("width", e), 27877 this.baseElement.setAttribute("height", t)) 27878 } 27879 applyOffsetToChildren() { 27880 let e = this.x || 0 27881 , t = this.y || 0; 27882 if (e !== 0 || t !== 0) { 27883 let n = new oe; 27884 n.translate(e, t), 27885 this.getChildModels().forEach(o=>o.setSelfTransform(o.getSelfTransform().preMultiplyWith(n))) 27886 } 27887 this.x = 0, 27888 this.y = 0 27889 } 27890 getSelfTransform() { 27891 return new oe 27892 } 27893 getAggregateTransform() { 27894 return new oe 27895 } 27896 getModel(e) { 27897 let t; 27898 for (; e != null && (t = this.elementModelMap.get(e), 27899 t == null); ) 27900 e = e.parentNode; 27901 return t 27902 } 27903 getSelectableModel(e) { 27904 return e.tagName === "tspan" ? e = e.parentElement.parentElement : e.tagName === "text" && (e = e.parentElement), 27905 this.getModel(e) 27906 } 27907 registerModel(e) { 27908 let t = e.baseElement; 27909 this.elementModelMap.set(t, e) 27910 } 27911 unregisterModel(e) { 27912 this.elementModelMap.delete(e.baseElement); 27913 let t = e.getFillPaint(); 27914 t && t.isTransformable() && this.deleteDefsEntry(t.paintModelOrColor); 27915 let n = e.getStrokePaint(); 27916 n && n.isTransformable() && this.deleteDefsEntry(n.paintModelOrColor), 27917 this.modelChangeCallbacks.delete(e) 27918 } 27919 addModelChangeCallback(e, t) { 27920 let n = this.modelChangeCallbacks 27921 , s = n.get(e); 27922 s != null ? s.includes(t) || s.push(t) : n.set(e, [t]) 27923 } 27924 removeModelChangeCallback(e, t) { 27925 let n = this.modelChangeCallbacks 27926 , s = n.get(e); 27927 if (s != null) { 27928 let o = s.indexOf(t); 27929 o >= 0 && (s.length === 1 ? n.delete(e) : s.splice(o, 1)) 27930 } 27931 } 27932 modelChanged(e) { 27933 let n = this.modelChangeCallbacks.get(e); 27934 n?.forEach(s=>s()) 27935 } 27936 addDefsEntry(e) { 27937 this.defsElement.appendChild(e.baseElement), 27938 this.idDefMap.set(e.getId(), e) 27939 } 27940 deleteDefsEntry(e) { 27941 e.baseElement.remove(), 27942 this.idDefMap.delete(e.getId()) 27943 } 27944 getDefsEntry(e) { 27945 return this.idDefMap.get(e) 27946 } 27947 getDefs() { 27948 return this.idDefMap.values() 27949 } 27950 getGlobalColor(e) { 27951 let t; 27952 for (let n of this.globalColorGroups) 27953 if ((t = n.colors.find(s=>s.id === e)) != null) 27954 return t 27955 } 27956 getGlobalColorByName(e) { 27957 let t; 27958 for (let n of this.globalColorGroups) 27959 if ((t = n.colors.find(s=>s.name === e)) != null) 27960 return t 27961 } 27962 addGlobalColor(e, t, n) { 27963 console.log(JSON.stringify(this.globalColorGroups), t); 27964 let s = this.globalColorGroups[t || 0].colors; 27965 n = n == null ? s.length : Math.min(s.length, n || Number.MAX_VALUE), 27966 s.splice(n, 0, e); 27967 let o = ae(); 27968 return o.inProgress || o.addEdit(new zy(this,e,t || 0,n)), 27969 e 27970 } 27971 deleteGlobalColor(e) { 27972 let t = this.getModels(!1) 27973 , n = new Map 27974 , s = new Map; 27975 t.forEach(i=>{ 27976 if (i instanceof Nt) { 27977 let r = i.getFillPaint(); 27978 r && r.isUsingGlobalColor(e) && n.set(i, r.convertGlobalColors()); 27979 let a = i.getStrokePaint(); 27980 a && a.isUsingGlobalColor(e) && s.set(i, a.convertGlobalColors()) 27981 } 27982 } 27983 ); 27984 let o = z(); 27985 n.size > 0 && o.setModelsPaint(Array.from(n.keys()), Array.from(n.values()), "fill"), 27986 s.size > 0 && o.setModelsPaint(Array.from(s.keys()), Array.from(s.values()), "stroke"), 27987 this.globalColorGroups.forEach((i,r)=>{ 27988 let a = i.colors 27989 , d = a.findIndex(u=>
27989u.name === e.name); 27990 if (d >= 0) { 27991 a.splice(d, 1); 27992 let u = ae(); 27993 u.inProgress || u.addEdit(new OT(this,e,r,d)) 27994 } 27995 } 27996 ) 27997 } 27998 globalColorChanged(e, t, n) { 27999 n && this.getModels(!1).forEach(r=>{ 28000 if (r instanceof Nt) { 28001 let a = [] 28002 , d = r.getFillPaint(); 28003 d && a.push(...d.getGlobalColorRefs()); 28004 let u = r.getStrokePaint(); 28005 u && a.push(...u.getGlobalColorRefs()), 28006 e.id 28007 } 28008 } 28009 ); 28010 let s = e.name 28011 , o = e.color; 28012 this.baseElement.style.setProperty("--" + s, o ? o.toCss() : "") 28013 } 28014 setGlobalColorName(e, t) { 28015 e.setName(t), 28016 this.globalColorChanged(e, !0, !1) 28017 } 28018 setGlobalColorColor(e, t) { 28019 e.setColor(t), 28020 this.globalColorChanged(e, !1, !0) 28021 } 28022 getGlobalColorRefs() { 28023 let e = []; 28024 return this.getModels(!1).forEach(n=>{ 28025 let s = n.getFillPaint(); 28026 s && e.push(...s.getGlobalColorRefs()); 28027 let o = n.getStrokePaint(); 28028 o && e.push(...o.getGlobalColorRefs()) 28029 } 28030 ), 28031 e 28032 } 28033 getGlobalColorUsages(e) { 28034 return this.getModels(!1).filter(n=>{ 28035 if (n instanceof Nt) { 28036 let s = n.getFillPaint() 28037 , o = n.getStrokePaint(); 28038 return e == null ? s?.getType() === il || o?.getType() === il : s?.isUsingGlobalColor(e) || o?.isUsingGlobalColor(e) 28039 } else 28040 return !1 28041 } 28042 ) 28043 } 28044 toJSON() { 28045 return Object.assign(super.toJSON(), { 28046 width: this.getWidth(), 28047 height: this.getHeight(), 28048 childModels: this.getChildModels().map(e=>e.toJSON()) 28049 }) 28050 } 28051 setJSON(e) { 28052 super.setJSON(e); 28053 let t = e.width 28054 , n = e.height; 28055 this.setSize(t, n); 28056 let s = e.childModels; 28057 if (s && Array.isArray(s)) { 28058 let o = s.map(i=>Ef(i)); 28059 this.insertChildrenAt(o.filter(i=>i != null)) 28060 } 28061 } 28062} 28063function hd(l, e) { 28064 let t = l[e] 28065 , n = t === "(" ? ")" : t === "[" ? "]" : t === "{" ? "}" : null; 28066 if (n) { 28067 let s = 1; 28068 for (let o = e + 1; o < l.length; o++) { 28069 let i = l[o]; 28070 if (i === t) 28071 s++; 28072 else if (i === n && (s--, 28073 s === 0)) 28074 return o 28075 } 28076 } 28077 return -1 28078} 28079function AT(l) { 28080 let e = [] 28081 , t = Array.from(l.ownerDocument.styleSheets); 28082 for (let s of t) { 28083 let o = hg(s); 28084 for (; o.length > 0; ) { 28085 let i = o.shift() 28086 , r = i.constructor.name; 28087 i.styleSheet ? o.splice(0, 0, ...hg(i.styleSheet)) : r === "CSSMediaRule" ? matchMedia(i.conditionText || "").matches && o.splice(0, 0, ...i.cssRules) : r === "CSSSupportsRule" ? CSS.supports(i.conditionText || "") && o.splice(0, 0, ...i.cssRules) : r === "CSSContainerRule" || l.matches(i.selectorText) && e.push(i) 28088 } 28089 } 28090 let n = new Map; 28091 return e.forEach(s=>n.set(s, vc(l, s.selectorText))), 28092 e.sort((s,o)=>n.get(o).compareTo(n.get(s))), 28093 e 28094} 28095function hg(l) { 28096 if (l.disabled) 28097 return []; 28098 let e = l.media?.mediaText; 28099 if (e && !window.matchMedia(e).matches) 28100 return []; 28101 try { 28102 return Array.from(l.cssRules) 28103 } catch { 28104 return [] 28105 } 28106} 28107function vc(l, e) { 28108 let t = IT(e) 28109 , n = new Uy; 28110 for (let s of t) 28111 if (l == null || l.matches(s)) { 28112 let o = zT(s); 28113 o.compareTo(n) > 0 && (n = o) 28114 } 28115 return n 28116} 28117function IT(l) { 28118 let e = [] 28119 , t = 0; 28120 for (let n = 0; n <= l.length; n++) { 28121 let s = l.charAt(n); 28122 if (s === "," || s === "") { 28123 let o = l.substring(t, n).trim(); 28124 o && e.push(o), 28125 t = n + 1 28126 } else if (s === "(") { 28127 let o = hd(l, n); 28128 o > n ? n = o + 1 : n = l.length 28129 } 28130 } 28131 return e 28132} 28133const LT = /:(?:after|before|first-letter|first-line|selection)|::[\w-]+(\()?/ 28134 , VT = /:([\w-]+)(\()?/ 28135 , NT = /\[[^\]]+\]/g 28136 , RT = /#[\w-]+/g 28137 , FT = /\.[\w-]+/g 28138 , BT = /[\w-]+/g; 28139function zT(l) { 28140 let e = new Uy, t; 28141 for (; t = l.match(LT); ) { 28142 e.c++; 28143 let s = t.index 28144 , o = s + t[0].length; 28145 t[1] != null && (o = hd(l, o - 1) + 1, 28146 o === 0 && (o = l.length)), 28147 l = l.slice(0, s) + l.slice(o) 28148 } 28149 let n; 28150 for (; n = l.match(VT); ) {
28151 let s = n[1] 28152 , o = n.index; 28153 if (n[2] != null) { 28154 let i = o + s.length + 2 28155 , r = hd(l, i - 1); 28156 r === -1 && (r = l.length); 28157 let a = l.substring(i, r); 28158 s === "where" || (s === "not" || s === "is" || s === "has" ? e.add(vc(null, a)) : (s === "nth-child" || s === "last-child") && (e.add(vc(null, a)), 28159 e.b++)), 28160 l = l.slice(0, i - s.length - 2) + l.slice(r + 1) 28161 } else 28162 e.b++, 28163 l = l.slice(0, o) + l.slice(o + s.length + 1) 28164 } 28165 return l = l.replace(NT, ()=>(e.b++, 28166 "")), 28167 l = l.replace(RT, ()=>(e.a++, 28168 "")), 28169 l = l.replace(FT, ()=>(e.b++, 28170 "")), 28171 l = l.replace(BT, ()=>(e.c++, 28172 "")), 28173 e 28174} 28175class Uy { 28176 a = 0; 28177 b = 0; 28178 c = 0; 28179 compareTo(e) { 28180 return this.a - e.a || this.b - e.b || this.c - e.c 28181 } 28182 add(e) { 28183 this.a += e.a, 28184 this.b += e.b, 28185 this.c += e.c 28186 } 28187} 28188const lr = 0 28189 , UT = 1; 28190class Hi { 28191 precedence; 28192 associativity; 28193 constructor(e, t) { 28194 this.precedence = e, 28195 this.associativity = t 28196 } 28197} 28198const Ua = { 28199 "^": new Hi(4,UT), 28200 "*": new Hi(3,lr), 28201 "/": new Hi(3,lr), 28202 "+": new Hi(2,lr), 28203 "-": new Hi(2,lr) 28204} 28205 , GT = /^[+-]?(?:[0-9]+(?:\.[0-9]+)?|\.[0-9]+)(?:[eE][+-]?[0-9]+)?/ 28206 , HT = /^([_a-zA-Z][_a-zA-Z1-9]*)/ 28207 , $T = /^\s+$/; 28208function XT(l) { 28209 const e = [] 28210 , t = []; 28211 let n = 0 28212 , s = !1; 28213 for (; n < l.length; ) { 28214 let o = l[n]; 28215 if (!$T.test(o)) 28216 if (s) { 28217 let i = Ua[o]; 28218 if (i != null) { 28219 let r = i.precedence 28220 , a = i.associativity 28221 , d = e.at(-1) 28222 , u = Ua[d]; 28223 for (; u && (u.precedence > r || u.precedence === r && a === lr); ) 28224 t.push(d), 28225 e.pop(), 28226 d = e.at(-1), 28227 u = Ua[d]; 28228 e.push(o), 28229 s = !1 28230 } else if (o === ")") { 28231 let r = e.at(-1); 28232 for (; r !== "("; ) 28233 t.push(e.pop()), 28234 r = e.at(-1); 28235 e.pop(), 28236 s = !0 28237 } else 28238 throw new Error('Invalid char: "' + o + '"') 28239 } else if (o === "(") 28240 e.push(o), 28241 s = !1; 28242 else { 28243 let i = l.substring(n), r; 28244 if ((r = i.match(GT)) != null) 28245 t.push(parseFloat(r[0])), 28246 o = r[0], 28247 s = !0; 28248 else if ((r = i.match(HT)) != null) 28249 t.push(r[0]), 28250 o = r[0], 28251 s = !0; 28252 else 28253 throw new Error('Invalid char: "' + o + '"') 28254 } 28255 n += o.length 28256 } 28257 for (; e.length > 0; ) 28258 t.push(e.pop()); 28259 return t 28260} 28261function YT(l) { 28262 const e = []; 28263 for (let t of l) 28264 if (Ua[t]) { 28265 let n = e.pop(), s = e.pop(), o; 28266 if (t === "+" || t === "-") { 28267 o = s; 28268 for (let i of Object.keys(n)) 28269 o[i] = t === "+" ? (s[i] || 0) + n[i] : (s[i] || 0) - n[i] 28270 } else if (t === "*" || t === "/") { 28271 o = {}; 28272 for (let i of Object.keys(s)) 28273 for (let r of Object.keys(n)) 28274 o[i + r] = t === "*" ? s[i] * n[r] : s[i] / n[r] 28275 } 28276 e.push(o) 28277 } else 28278 typeof t == "number" ? e.push({ 28279 "": t 28280 }) : e.push({ 28281 [t]: 1 28282 }); 28283 return e.at(-1) 28284} 28285function KT(l) { 28286 let e = XT(l); 28287 return YT(e) 28288} 28289function Gy(l, e, t, n) { 28290 console.log(l, e); 28291 let s, o, i, r; 28292 if (e) 28293 if ((r = e.match(/^\s*var\(\s*--(\S+)\s*(?:,\s*(\S.*\S)\s*)?\)/)) != null) { 28294 s = r[1]; 28295 let a = r[2]; 28296 if (s.match(/\S+__MOD(\S*)/) != null) { 28297 let u = n.rootElement 28298 , h = Df(u, "--" + s)[0]; 28299 return Gy(l, h, t, n) 28300 } else 28301 o = bc(s, a, t) 28302 } else if ((r = e.match(/^\s*(oklab|oklch|lab|lch)\(\s*from\s+var\(/)) != null) { 28303 let a = hd(e, r[0].length - 1) + 1; 28304 if (a) { 28305 let u = e.substring(r[0].length - 4, a).match(/^\s*var\(\s*--(\S+)\s*(?:,\s*(\S.*\S)\s*)?\)/); 28306 s = u[1], 28307 o = bc(u[1], u[2], t); 28308 let h = r[1] 28309 , c = [...h.substring(h.length - 3)] 28310 , p = e.substring(a).match(/\s*(calc\(.*?\)|[a-z]|\d*\.?\d+)\s+(calc\(.*?\)|[a-z]|\d*\.?\d+)\s+(calc\(.*?\)|[a-z]|\d*\.?\d+)\s*(?:\/\s*(calc\(.*?\)|[a-z]|\d*\.?\d+))?/);
28311 p && (i = new jd(h,..._a(h, p[1], c[0]),..._a(h, p[2], c[1]),..._a(h, p[3], c[2]),_a(h, p[4], "a")[1])) 28312 } 28313 } else 28314 (r = e.match(/^\s*color-mix\(\s*(\S+)\s*,\s*(\S.*\S)\s*,\s*(\S.*\S)\s*\)/)) != null; 28315 if (console.log(s, o, i), 28316 s) { 28317 let a = n.getGlobalColor(s, new ce(o)); 28318 return new Xt(n.documentModel,a.id,i) 28319 } else 28320 return t.getPropertyValue(l) === "none" ? null : new ce(t.getPropertyValue(l)) 28321} 28322function bc(l, e, t) { 28323 let n = t.getPropertyValue("--" + l); 28324 if (n) 28325 return n; 28326 { 28327 let s = e?.match(/^\s*var\(\s*--(\S+)\s*(?:,\s*(\S.*\S)\s*)?\)/); 28328 return s ? bc(s[1], s[2], t) : e 28329 } 28330} 28331function _a(l, e, t) { 28332 if (e != null && (e = e.trim()), 28333 e) { 28334 if (e === "none") 28335 return [0, 0]; 28336 if (e.startsWith("calc(")) { 28337 let n = e.substring(5, e.length - 1); 28338 try { 28339 let s = KT(n); 28340 return [s[t] || 0, s[""] || 0] 28341 } catch (s) { 28342 return console.error(s.message()), 28343 [1, 0] 28344 } 28345 } else { 28346 if (e === t) 28347 return [1, 0]; 28348 if (e.endsWith("%")) { 28349 let n = parseFloat(e) / 100 28350 , s = 1; 28351 return l === "oklch" ? t === "c" && (s = .4) : l === "oklab" ? (t === "a" || t === "b") && (s = .4) : l === "lab" && (t === "l" ? s = 100 : (t === "a" || t === "b") && (s = 125)), 28352 [0, n * s] 28353 } else if (/(?:deg|grad|rad|turn)$/.test(e)) { 28354 const n = e.match(/^(.*)(deg|grad|rad|turn)$/); 28355 let s = parseFloat(n[1]); 28356 switch (n[2]) { 28357 case "grad": 28358 s = s * .9; 28359 break; 28360 case "rad": 28361 s = s * (180 / Math.PI); 28362 break; 28363 case "turn": 28364 s = s * 360; 28365 break 28366 } 28367 return [0, s] 28368 } else { 28369 let n = parseFloat(e); 28370 return isFinite(n) ? [0, n] : [1, 0] 28371 } 28372 } 28373 } else 28374 return [1, 0] 28375} 28376function Hy(l) { 28377 let e = "" 28378 , t = Df(l, "d"); 28379 for (let n of t) 28380 if (n) { 28381 let s = n.match(/^\s*path\(["'](.*)["']\)\s*$/); 28382 if (s != null) { 28383 e = s[1].trim(); 28384 break 28385 } 28386 } 28387 return e || (e = l.getAttribute("d") || ""), 28388 e 28389} 28390function Df(l, e) { 28391 let t = [] 28392 , n = WT(l, e); 28393 n && t.push(n); 28394 let s = AT(l); 28395 for (let i of s) { 28396 let r = i.style.getPropertyValue(e); 28397 r && (i.style.getPropertyPriority(e) && (r += " !important"), 28398 t.push(r)) 28399 } 28400 let o = /\s*!\s*important\s*$/i; 28401 for (let i = t.length - 1; i >= 0; i--) { 28402 let r = t[i] 28403 , a = r.match(o); 28404 a && (r = r.substring(0, r.length - a[0].length), 28405 i === 0 ? t[0] = r : (t.splice(i, 1), 28406 t.push(r))) 28407 } 28408 return t 28409} 28410function WT(l, e) { 28411 let t = l.getAttribute("style"); 28412 if (t) { 28413 let n = t.split(";"); 28414 for (let s of n) { 28415 let o = s.indexOf(":"); 28416 if (s.substring(0, o).trim() === e) 28417 return s.substring(o + 1).trim() 28418 } 28419 } 28420 return "" 28421} 28422class qT { 28423 documentModel; 28424 rootElement; 28425 baseWidth; 28426 baseHeight; 28427 baseSize; 28428 precision; 28429 transform; 28430 globalColors = new Map; 28431 constructor(e, t) { 28432 this.documentModel = e, 28433 this.rootElement = t 28434 } 28435 getGlobalColor(e, t) { 28436 let n = this.documentModel.getGlobalColorByName(e); 28437 return n == null && (n = this.documentModel.addGlobalColor(new Ei(e,t))), 28438 n 28439 } 28440} 28441const jT = /^\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?)\s*([a-zA-Z]*|%)\s*$/; 28442class fu { 28443 value; 28444 unit; 28445 constructor(e=0, t=null) { 28446 this.value = e, 28447 this.unit = t 28448 } 28449 static parse(e) { 28450 if (e == null || e === "") 28451 return null; 28452 { 28453 let t = e.match(jT); 28454 if (t == null) 28455 return null; 28456 { 28457 let n = parseFloat(t[1]); 28458 return new fu(n,t[2]) 28459 } 28460 } 28461 } 28462} 28463function xt(l, e, t=1, n) { 28464 let s; 28465 if (l) { 28466 let o = fu.parse(l); 28467 if (o && (s = o.value, 28468 s)) { 28469 let i = o.unit; 28470 if (i === "%") 28471 t != null ? s *= t / 100 : s = null; 28472 else if (i === "em") { 28473 let r = parseFloat(n && getComputedStyle(n).getPropertyValue("font-size")) || 16; 28474 s *= r 28475 } else 28476 i === "rem" ? s *= 16 : i === "vw" ? n?.ownerSVGElement ? s *= n.ownerSVGElement.getBBox().width : s = null : i === "vm" && (n?.ownerSVGElement ? s *= n.ownerSVGElement.getBBox().height : s = null) 28477 } 28478 } 28479 return s == null && (s = e), 28480 s 28481} 28482function $y(l, e, t=!0) { 28483 let n; 28484 if (l != null && l !== "") { 28485 let s = fu.parse(l); 28486 s && (n = s.value, 28487 n && s.unit === "%" && t && (n *= n / 100)) 28488 } 28489 return n == null && (n = e), 28490 n 28491} 28492function yr(l, e, t=null) { 28493 let n = l.getAttribute(e) 28494 , s = parseFloat(n); 28495 return isNaN(s) && (s = t), 28496 s 28497} 28498function JT(l, e, t=!1) { 28499 let n = l.getAttribute(e); 28500 return n == null ? t : n === "true" || n === !0 28501} 28502function cg(l, e, t) { 28503 let n = l.getAttribute(e); 28504 return n == null ? t : "" + n 28505} 28506function ZT(l) { 28507 KS(l, "-hyvector"), 28508 Mc(l, new Set) 28509} 28510function Mc(l, e) { 28511 if (!e.has(l)) { 28512 if (fs(l) === "use") { 28513 let s = (l.getAttribute("href") || l.getAttributeNS("http://www.w3.org/1999/xlink", "href")).substring(1) 28514 , o = l.ownerDocument.getElementById(s); 28515 if (o == null) 28516 return null; 28517 Mc(o, e); 28518 let i = de("g", { 28519 isUseElementGroup: "true" 28520 }); 28521 l.replaceWith(i), 28522 i.appendChild(o.cloneNode(!0)),
28523 [...l.attributes].forEach(r=>{ 28524 let a = r.nodeName; 28525 if (a !== "href" && !i.hasAttribute(a)) { 28526 let d = r.nodeValue; 28527 i.setAttribute(a, d) 28528 } 28529 } 28530 ) 28531 } 28532 let t = l.children; 28533 for (let n of t) 28534 Mc(n, e); 28535 e.add(l) 28536 } 28537} 28538async function zs(l) { 28539 l = l.trim(), 28540 l = l.replace(/^<!doctype.*?>\s*/i, ""), 28541 /^<\?xml/.test(l) || (/<svg/.test(l) ? l.match(/^<svg[^>]*xmlns=/m) || (l = l.replace("<svg", '<svg xmlns="http://www.w3.org/2000/svg"')) : l = '<svg xmlns="http://www.w3.org/2000/svg">' + l + "</svg>"); 28542 let e = new self.DOMParser().parseFromString(l, "image/svg+xml"); 28543 e.querySelector("parsererror") && (e = new self.DOMParser().parseFromString(l, "text/html")); 28544 let t; 28545 if (e.children.length > 0) { 28546 let n; 28547 try { 28548 let s = e.getElementsByTagNameNS("http://www.w3.org/2000/svg", "svg")[0]; 28549 s.childElementCount === 1 && s.children[0].tagName === "svg" && (s = s.children[0]), 28550 ZT(s); 28551 let o = s.viewBox?.baseVal; 28552 o && (o.width <= 0 || o.height <= 0) && (o = null), 28553 s.hasAttribute("width") || s.setAttribute("width", o ? o.width : 300), 28554 s.hasAttribute("height") || s.setAttribute("height", o ? o.height : 150), 28555 s.style.setProperty("position", "static"); 28556 let i = document.createElement("div"); 28557 i.style.setProperty("position", "fixed"), 28558 i.style.setProperty("display", "flex"), 28559 i.appendChild(s), 28560 n = document.createElement("iframe"), 28561 n.style.setProperty("position", "fixed"), 28562 n.style.setProperty("opacity", "0"), 28563 n.style.setProperty("zoom", 1 / (window.devicePixelRatio ?? 1)), 28564 document.body.appendChild(n), 28565 n.setAttribute("sandbox", ""), 28566 n.contentDocument.body.appendChild(i); 28567 let r = s.width?.baseVal?.value 28568 , a = s.height?.baseVal?.value; 28569 if (!Number.isFinite(r) || r <= 0 || !Number.isFinite(a) || a <= 0) { 28570 let p = s.getBoundingClientRect(); 28571 (!Number.isFinite(r) || r <= 0) && (r = p.width), 28572 (!Number.isFinite(a) || a <= 0) && (a = p.height) 28573 } 28574 t = new fi(r,a); 28575 let d = new qT(t,s) 28576 , u = s.getAttribute("xmlns:hyvector"); 28577 d.isHyvectorSvg = u != null && u !== "", 28578 d.hyvectorNS = u; 28579 let h = parseFloat(s.getAttribute("x")) 28580 , c = parseFloat(s.getAttribute("y")); 28581 if (t.x = isNaN(h) ? 0 : h, 28582 t.y = isNaN(c) ? 0 : c, 28583 d.baseWidth = o && o.width || r, 28584 d.baseHeight = o && o.height || a, 28585 d.baseSize = Se(d.baseWidth, d.baseHeight) / Math.sqrt(2), 28586 d.transform = QT(s, r, a, o), 28587 d.isHyvectorSvg) { 28588 let p = s.getAttribute("hyvector:globalColors"); 28589 if (p) { 28590 let g = []; 28591 for (let y of p.split(";")) { 28592 let m = y.indexOf(":") 28593 , b = m >= 0 ? y.substring(0, m).trim() : "" 28594 , S = y.substring(m + 1).split(",").map(x=>{ 28595 x = x.trim(); 28596 let P = x.indexOf(" "); 28597 return P > 0 ? new Ei(x.substring(0, P),new ce(x.substring(P + 1))) : null 28598 } 28599 ).filter(x=>x != null); 28600 S.length > 0 && g.push({ 28601 name: b, 28602 colors: S 28603 }) 28604 } 28605 t.globalColorGroups = g.length > 0 ? g : [[]] 28606 } 28607 } 28608 let f = s.children; 28609 for (let p of f) { 28610 let g = await Di(p, t, d); 28611 g != null && (g.setSelfTransform(g.getSelfTransform().preMultiplyWith(d.transform)), 28612 t.insertChildAt(g)) 28613 } 28614 let p = t.getModels(!1); 28615 for (let g of p) 28616 g.transformUpdated(); 28617 for (let g of p) 28618 g.applyTransformToElement() 28619 } catch (s) { 28620 console.log(s), 28621 t = new fi 28622 } finally { 28623 n?.remove() 28624 } 28625 } else 28626 t = new fi; 28627 return t 28628} 28629function QT(l, e, t, n) { 28630 let[s,o] = (l.getAttribute("preserveAspectRatio") || "").split(/(?=d)/g) 28631 , i = 1 28632 , r = 1;
28633 s === "none" ? (i = n ? e / n.width : 1, 28634 r = n ? t / n.height : 1) : o === "slice" ? (i = n ? Math.max(e / n.width, t / n.height) : 1, 28635 r = n ? Math.max(e / n.width, t / n.height) : 1) : (i = n ? Math.min(e / n.width, t / n.height) : 1, 28636 r = n ? Math.min(e / n.width, t / n.height) : 1); 28637 let a, d; 28638 return n ? (a = (e - n.width * i) / 2 - n.x * i, 28639 d = (t - n.height * r) / 2 - n.y * r) : (a = 0, 28640 d = 0), 28641 new oe().scale(i, r).preTranslate(a, d) 28642} 28643async function Di(l, e, t) { 28644 if (!XS(l)) 28645 return null; 28646 let n = fs(l), s = getComputedStyle(l), o; 28647 switch (n) { 28648 case "a": 28649 o = await pg(l, s, e, t); 28650 break; 28651 case "circle": 28652 o = await n6(l, s, e, t); 28653 break; 28654 case "ellipse": 28655 o = await s6(l, s, e, t); 28656 break; 28657 case "g": 28658 o = await pg(l, s, e, t); 28659 break; 28660 case "line": 28661 o = await i6(l, s, e, t); 28662 break; 28663 case "path": 28664 o = await r6(l, s, e, t); 28665 break; 28666 case "polygon": 28667 o = await d6(l, s, e, t); 28668 break; 28669 case "polyline": 28670 o = await u6(l, s, e, t); 28671 break; 28672 case "rect": 28673 o = await o6(l, s, e, t); 28674 break; 28675 case "image": 28676 o = await c6(l, s, e, t); 28677 break; 28678 case "switch": 28679 o = await g6(l, s, e, t); 28680 break; 28681 case "text": 28682 o = await p6(l, s, e, t); 28683 break; 28684 case "use": 28685 o = await Ky(l, s, e, t); 28686 break; 28687 case "title": 28688 y6(l, e); 28689 break; 28690 case "desc": 28691 v6(l, e); 28692 break 28693 } 28694 if (o == null) 28695 return null; 28696 let i = s.getPropertyValue("clip-path"); 28697 if (i != null && i !== "none") { 28698 let a = await l6(o, l, s, e, t); 28699 a != null && (o = a) 28700 } 28701 let r = e6(l); 28702 return r && o.setLabel(r), 28703 o 28704} 28705function e6(l) { 28706 return cg(l, "hyvector:label") || cg(l, "inkscape:label") 28707} 28708function To(l, e, t, n) { 28709 let s, o = Df(e, l); 28710 for (let i of o) 28711 if (s = fg(l, i, t, e, n), 28712 s !== void 0) 28713 break; 28714 if (s === void 0) { 28715 let i = e.getAttribute(l); 28716 s = fg(l, i, t, e, n) 28717 } 28718 return s 28719} 28720function cd(l, e, t, n) { 28721 let s = To(l, e, t, n); 28722 if (s == null) 28723 return s; 28724 { 28725 let o = s.getType(); 28726 if (o === Sl || o === il) 28727 return s.paintModelOrColor 28728 } 28729} 28730function fg(l, e, t, n, s) { 28731 let o; 28732 e = e?.trim(); 28733 let i = t.getPropertyValue(l); 28734 if (i === "none") 28735 o = null; 28736 else if (e === "currentColor") 28737 o = new et(new ce); 28738 else if (i.startsWith("url(")) { 28739 let r = Om(i); 28740 if (r != null) { 28741 let a, d = s.rootElement.getElementById(r); 28742 if (d != null) { 28743 let u = fs(d); 28744 u === "linearGradient" ? a = qy(d, n, s) : u === "radialGradient" ? a = jy(d, n, s) : u === "pattern" && (a = f6(d, n, s)) 28745 } 28746 if (a != null) 28747 o = new et(a); 28748 else { 28749 let u = i.match(/url\(.*\)\s*(.+)/); 28750 if (u) { 28751 let h = At(u[1]); 28752 h != null && (o = new et(new ce(h))) 28753 } 28754 } 28755 } 28756 } else if (/var\(\s*--\S+/.test(e)) { 28757 let r = Gy(l, e, t, s); 28758 o = new et(r) 28759 } else { 28760 let r = i || e; 28761 if (r && r !== "none" && r !== "null") { 28762 let a = At(r); 28763 a != null ? o = new et(new ce(a)) : console.warn("Unhandled paint value " + r) 28764 } 28765 } 28766 return o 28767} 28768function si(l, e) { 28769 if (l != null && e != null) { 28770 let t = parseFloat(e); 28771 if (!isNaN(t) && t < 1) 28772 switch (l.type) { 28773 case Wt: 28774 case sl: 28775 { 28776 let n = l.paintModelOrColor; 28777 for (let s = n.getStopCount() - 1; s >= 0; s--) { 28778 let o = n.getStopColor(s); 28779 o.a *= t, 28780 n.setStopColor(s, o) 28781 } 28782 break 28783 } 28784 case Sl: 28785 l.paintModelOrColor.a *= t; 28786 break; 28787 case il: 28788 l.paintModelOrColor.colorModification.alpha *= t; 28789 break; 28790 case Ml: 28791 { 28792 let n = l.paintModelOrColor; 28793 n.color && (n.color.a *= t), 28794 n.background && (n.background.a *= t); 28795 break 28796 } 28797 } 28798 } 28799} 28800function Of(l, e) { 28801 for (; l && !l.getCTM; ) 28802 l = l.parentElement; 28803 if (l == null) 28804 return new DOMMatrixReadOnly; 28805 let t = l.getCTM(), n, s = l.parentElement; 28806 for (; s; ) { 28807 if (s === e.rootElement) { 28808 n = e.transform.toDOMMatrix(); 28809 break 28810 } else if (s.getCTM) { 28811 n = s.getCTM(); 28812 break 28813 } 28814 s = s.parentElement 28815 } 28816 return n ? n.inverse().multiply(t) : t 28817} 28818function fn(l, e, t, n) { 28819 Xy(l, e, t, n), 28820 Yy(l, e, t, n); 28821 let s = $t(t.getPropertyValue("opacity")); 28822 isNaN(s) || l.setOpacity(s); 28823 let o = t.getPropertyValue("mix-blend-mode"); 28824 l.setBlendMode(o); 28825 let i = t.display === "none" || t.visibility === "hidden"; 28826 l.setHidden(i), 28827 t6(l, e, t, n) 28828} 28829function Xy(l, e, t, n) { 28830 let s = To("fill", e, t, n); 28831 si(s, t.getPropertyValue("fill-opacity")), 28832 l.setFillPaint(s) 28833} 28834function Yy(l, e, t, n) { 28835 let s = To("stroke", e, t, n); 28836 si(s, t.getPropertyValue("stroke-opacity")), 28837 l.setStrokePaint(s); 28838 let o = xt(t.getPropertyValue(Hh), 1, n.baseSize) 28839 , i = e.getCTM() 28840 , r = i ? (Math.hypot(i.a, i.b) + Math.hypot(i.c, i.d)) / 2 : 1; 28841 o *= r; 28842 let a = t.getPropertyValue($h)
28843 , d = t.getPropertyValue(Xh) 28844 , u = parseFloat(t.getPropertyValue(ji)); 28845 isNaN(u) && (u = 4); 28846 let h = t.getPropertyValue(Va); 28847 h = Qt.unscaleDashArray(1 / o, h); 28848 let c = xt(t.getPropertyValue(Ji), 0, n.baseSize); 28849 c *= r, 28850 l.setStrokeStyle(new Qt(o,a,d,u,h,c)) 28851} 28852function t6(l, e, t, n) { 28853 let s = Of(e, n) 28854 , o = oe.fromSVGMatrix(s); 28855 o.isIdentity || l.setSelfTransform(l.getSelfTransform().preMultiplyWith(o)) 28856} 28857async function Ky(l, e, t, n) { 28858 let s = l.children[0]; 28859 if (s == null) 28860 return null; 28861 let o = await Di(s, t, n); 28862 if (o == null) 28863 return null; 28864 let i = o.getSelfTransform() 28865 , r = yr(l, "x", 0) 28866 , a = yr(l, "y", 0); 28867 i.preTranslate(r, a); 28868 let d = e.getPropertyValue("transform"), u; 28869 return d === "none" && rf ? u = oe.fromSvgValue(l.getAttribute("transform")) : u = oe.fromCssValue(d), 28870 i.preMultiplyWith(u), 28871 o.setSelfTransform(i), 28872 o 28873} 28874async function l6(l, e, t, n, s) { 28875 let o = new hu 28876 , i = t.getPropertyValue("clip-path") 28877 , r = Om(i) 28878 , a = s.rootElement.getElementById(r); 28879 if (a == null) 28880 return null; 28881 let d = [] 28882 , u = []; 28883 for (let h of a.children) { 28884 let c = await Di(h, o, s); 28885 if (c != null) { 28886 d.push(c); 28887 let f = getComputedStyle(h).getPropertyValue("clip-rule"); 28888 u.push(f === "evenodd" ? "evenodd" : "nonzero") 28889 } 28890 } 28891 if (d.length > 0) { 28892 let h = d[0] 28893 , c = u[0] 28894 , f = h.getSelfTransform() 28895 , p = jl(h.getPaths(f, -1, !0), null, c); 28896 for (let y = 1; y < d.length; y++) { 28897 h = d[y], 28898 c = u[y]; 28899 let m = h.getSelfTransform() 28900 , b = h.getPaths(m, -1, !0); 28901 p = jl(p, b, c) 28902 } 28903 let g = on(p); 28904 return o.setPathData(g), 28905 o.setSelfTransform(l.getSelfTransform()), 28906 l.setSelfTransform(null), 28907 o.insertChildAt(l), 28908 o 28909 } 28910} 28911function n6(l, e, t, n) { 28912 let s = new du 28913 , o = xt(e.getPropertyValue("cx"), 0, n.baseWidth) 28914 , i = xt(e.getPropertyValue("cy"), 0, n.baseHeight) 28915 , r = xt(e.getPropertyValue("r"), 0, n.baseSize) 28916 , a = new oe().translate(-50, -50).preScale(r / 50, r / 50).preTranslate(o, i); 28917 return s.setSelfTransform(s.getSelfTransform().multiplyWith(a)), 28918 fn(s, l, e, n), 28919 s 28920} 28921function s6(l, e, t, n) { 28922 let s = new Cf; 28923 if (n.isHyvectorSvg) { 28924 fn(s, l, e, n); 28925 let o = oe.fromSvgValue(l.getAttribute("hyvector:transform")); 28926 s.setSelfTransform(o) 28927 } else { 28928 let o = xt(e.getPropertyValue("cx"), 50, n.baseWidth) 28929 , i = xt(e.getPropertyValue("cy"), 50, n.baseHeight) 28930 , r = e.getPropertyValue("rx") 28931 , a = e.getPropertyValue("ry"); 28932 r == null || r === "auto" ? (a = a == null || a === "auto" ? 0 : xt(a, 0, n.baseWidth), 28933 r = a) : (r = xt(r, 50, n.baseWidth), 28934 a = a == null || a === "auto" ? r : xt(a, 0, n.baseHeight)); 28935 let d = new oe().translate(-50, -50).preScale(r / 50, a / 50).preTranslate(o, i); 28936 s.setSelfTransform(d), 28937 fn(s, l, e, n) 28938 } 28939 return s 28940} 28941function o6(l, e, t, n) { 28942 let s = new uu 28943 , o = xt(e.getPropertyValue("x"), 0, n.baseWidth) 28944 , i = xt(e.getPropertyValue("y"), 0, n.baseHeight) 28945 , r = xt(e.getPropertyValue("width"), 0, n.baseWidth) 28946 , a = xt(e.getPropertyValue("height"), 0, n.baseHeight) 28947 , d = xt(e.getPropertyValue("rx"), 0, r) 28948 , u = xt(e.getPropertyValue("ry"), 0, a) 28949 , h = r === 0 ? 0 : d / r 28950 , c = a === 0 ? 0 : u / a; 28951 if (s.setX(o || 0), 28952 s.setY(i || 0), 28953 s.setWidth(r || 0), 28954 s.setHeight(a || 0), 28955 s.setShapeProperty("cornerRounding", Math.max(h, c)), 28956 n.isHyvectorSvg) { 28957 let f = oe.fromSvgValue(l.getAttribute("hyvector:transform")); 28958 s.setSelfTransform(f) 28959 } 28960 return fn(s, l, e, n), 28961 s 28962} 28963function i6(l, e, t, n) { 28964 let s = new bt 28965 , o = xt(l.getAttribute("x1"), 0, n.baseWidth) 28966 , i = xt(l.getAttribute("y1"), 0, n.baseHeight) 28967 , r = xt(l.getAttribute("x2"), 0, n.baseWidth) 28968 , a = xt(l.getAttribute("y2"), 0, n.baseHeight) 28969 , d = "M" + o + " " + i + "L" + r + " " + a; 28970 return s.setPathData(d), 28971 fn(s, l, e, n), 28972 s 28973} 28974function r6(l, e, t, n) { 28975 if (n.isHyvectorSvg && l.getAttribute("hyvector:pathType") === "shape") 28976 return a6(l, e, t, n); 28977 let s = Hy(l); 28978 if (s !== "") { 28979 let o = new bt; 28980 fn(o, l, e, n); 28981 let i = e.getPropertyValue("fill-rule"); 28982 if (o.setFillRule(i), 28983 n.isHyvectorSvg) { 28984 let a = l.getAttribute("hyvector:transform"); 28985 a != null && (a = oe.fromSvgValue(a), 28986 o.setSelfTransform(a)), 28987 s = l.getAttribute("hyvector:d") || s 28988 } 28989 o.setPathData(s); 28990 let r = l.getAttribute("hyvector:nodetypes") || l.getAttribute("sodipodi:nodetypes"); 28991 if (r) { 28992 let a = m6(r); 28993 o.setNodeTypes(a) 28994 } 28995 return o.isEmpty() ? null : o 28996 } 28997} 28998function a6(l, e, t, n) { 28999 let s = l.getAttribute("hyvector:shapeType"), o; 29000 if (s === "rectangle" ? o = new uu : s === "polygon" ? o = new _f : s === "star" && (o = new Bs), 29001 o != null) { 29002 if (fn(o, l, e, n), 29003 n.isHyvectorSvg) { 29004 let r = oe.fromSvgValue(l.getAttribute("hyvector:transform")); 29005 o.setSelfTransform(r) 29006 } 29007 let i = o.getShapePropertyNames(); 29008 for (let r of i) { 29009 let a = l.getAttribute("hyvector:" + r);
29010 a != null && (a = a === "true" || a === "false" ? a : parseFloat(a), 29011 o.setShapeProperty(r, a)) 29012 } 29013 } 29014 return o 29015} 29016function d6(l, e, t, n) { 29017 let s = l.getAttribute("points") 29018 , o = a2(s, !0) 29019 , i = new bt(o); 29020 return fn(i, l, e, n), 29021 i 29022} 29023function u6(l, e, t, n) { 29024 let s = l.getAttribute("points") 29025 , o = a2(s, !1) 29026 , i = new bt(o); 29027 return fn(i, l, e, n), 29028 i 29029} 29030async function pg(l, e, t, n) { 29031 if (l.getAttribute("isUseElementGroup")) 29032 return await Ky(l, e, t, n); 29033 if ((n.isHyvectorSvg ? l.getAttribute("hyvector:groupType") : null) === "clip") 29034 return await h6(l, e, t, n); 29035 { 29036 let i = new Uo, r; 29037 if (n.isHyvectorSvg) 29038 r = oe.fromSvgValue(l.getAttribute("hyvector:transform")); 29039 else { 29040 let h = Of(l, n); 29041 r = oe.fromSVGMatrix(h) 29042 } 29043 i.setSelfTransform(r); 29044 let a = $t(e.getPropertyValue("opacity")); 29045 isNaN(a) || i.setOpacity(a); 29046 let d = e.getPropertyValue("mix-blend-mode"); 29047 i.setBlendMode(d); 29048 let u = e.display === "none" || e.visibility === "hidden"; 29049 i.setHidden(u); 29050 for (let h of l.children) { 29051 let c = await Di(h, i, n); 29052 c != null && i.insertChildAt(c) 29053 } 29054 return i 29055 } 29056} 29057async function h6(l, e, t, n) { 29058 let s = new hu; 29059 fn(s, l, e, n), 29060 Xy(s, l.children[1], getComputedStyle(l.children[1]), n), 29061 Yy(s, l.children[3], getComputedStyle(l.children[3]), n); 29062 let o = l.children[0].children[0] 29063 , i = oe.fromSvgValue(o.getAttribute("transform")); 29064 if (s.setSelfTransform(i), 29065 n.isHyvectorSvg) { 29066 let d = l.getAttribute("hyvector:d"); 29067 s.setPathData(d); 29068 let u = oe.fromSvgValue(l.getAttribute("hyvector:transform")); 29069 s.setSelfTransform(u) 29070 } else { 29071 let d = Hy(o); 29072 s.setPathData(d) 29073 } 29074 let a = l.children[2].children; 29075 for (let d of a) { 29076 let u = await Di(d, s, n); 29077 if (u != null) { 29078 let h = u.getSelfTransform(); 29079 s.insertChildAt(u), 29080 u.setSelfTransform(h) 29081 } 29082 } 29083 return s 29084} 29085function c6(l, e, t, n) { 29086 let s = $t(l.getAttribute("x"), 0, n.baseWidth) 29087 , o = $t(l.getAttribute("y"), 0, n.baseHeight) 29088 , i = $t(l.getAttribute("width"), 0, n.baseWidth) 29089 , r = $t(l.getAttribute("height"), 0, n.baseHeight) 29090 , a = l.getAttribute("href") || l.getAttributeNS("http://www.w3.org/1999/xlink", "href") 29091 , d = new Fo(a,s,o,i,r) 29092 , u = Of(l, n) 29093 , h = oe.fromSVGMatrix(u); 29094 return d.setSelfTransform(h), 29095 d 29096} 29097function Wy(l, e, t) { 29098 let n = [l]; 29099 do { 29100 let s = null 29101 , o = l.getAttribute("href") || l.getAttributeNS("http://www.w3.org/1999/xlink", "href"); 29102 if (o && o[0] === "#" && (s = e.rootElement.getElementById(o.substring(1))), 29103 s != null) { 29104 if (n.includes(s)) 29105 break; 29106 if (t) 29107 n.push(s); 29108 else { 29109 let i = fs(s); 29110 t.some(r=>r.toLowerCase() === i) && n.push(s) 29111 } 29112 } 29113 l = s 29114 } while (l); 29115 return n 29116} 29117function nl(l, e, t) { 29118 for (let n of l) { 29119 let s = n.getAttribute(e); 29120 if (s) 29121 return s 29122 } 29123 return t 29124} 29125function qy(l, e, t) { 29126 let n, s = l.getAttribute("href") || l.getAttributeNS("http://www.w3.org/1999/xlink", "href"); 29127 if (s != null) { 29128 s[0] === "#" && (s = s.substring(1)); 29129 let g = t.rootElement.getElementById(s) 29130 , y = fs(g); 29131 (y === "radialGradient" || y === "linearGradient") && (n = qy(g, e, t)) 29132 } 29133 n == null && (n = new Mi); 29134 let o = Wy(l, t, ["linearGradient", "radialGradient"]) 29135 , i = nl(o, "gradientUnits") !== "userSpaceOnUse" 29136 , r = i ? 1 : t.baseWidth 29137 , a = i ? 1 : t.baseHeight 29138 , d = $t(nl(o, "x1", "0%"), 0, r) 29139 , u = $t(nl(o, "y1", "0%"), 0, a) 29140 , h = $t(nl(o, "x2", "100%"), 0, r) 29141 , c = $t(nl(o, "y2", "0%"), 0, a); 29142 if (i) { 29143 let g = e.getBBox(); 29144 d = d * g.width + g.x, 29145 u = u * g.height + g.y, 29146 h = h * g.width + g.x, 29147 c = c * g.height + g.y 29148 } 29149 n.p1.set(d, u), 29150 n.p2.set(h, c); 29151 let f = nl(o, "spreadMethod"); 29152 if (n.setSpreadMethod(f), 29153 !t.isHyvectorSvg) { 29154 let g = nl(o, "gradientTransform"); 29155 if (g) { 29156 let y = oe.fromSvgValue(g) 29157 , m = n.p2 29158 , b = n.p1 29159 , M = B.interpolate(m, b, .5) 29160 , S = new B(-(b.y - M.y),b.x - M.x).add(M, !0); 29161 y.transformXY(m), 29162 y.transformXY(b), 29163 y.transformXY(S), 29164 y.transformXY(M); 29165 let x = new B(-(S.y - M.y),S.x - M.x); 29166 m.subtract(M, !0).projectOn(x, !0).add(M, !0), 29167 b.subtract(M, !0).projectOn(x, !0).add(M, !0) 29168 } 29169 } 29170 n.baseElement.setAttribute("gradientUnits", "userSpaceOnUse"), 29171 n.updateViewFromModel(); 29172 let p = 0; 29173 for (let g of o) { 29174 let y = !1; 29175 for (let m of g.children) 29176 if (fs(m) === "stop") { 29177 y = !0; 29178 let b = window.getComputedStyle(m) 29179 , M = $t(m.getAttribute("offset"), 0); 29180 isNaN(M) || M < p ? M = p : M > 1 && (M = 1); 29181 let S = cd("stop-color", m, b, t) 29182 , x = $y(b.getPropertyValue("stop-opacity"), 1); 29183 n.insertStop(M, S, x), 29184 p = M 29185 } 29186 if (y) 29187 break 29188 } 29189 return n 29190} 29191function jy(l, e, t) { 29192 let n, s = l.getAttribute("href") || l.getAttributeNS("http://www.w3.org/1999/xlink", "href"); 29193 if (s != null) { 29194 s[0] === "#" && (s = s.substring(1)); 29195 let b = t.rootElement.getElementById(s) 29196 , M = fs(b); 29197 (M === "radialGradient" || M === "linearGradient") && (n = jy(b, e, t)) 29198 } 29199 n == null && (n = new Si); 29200 let o = Wy(l, t, ["linearGradient", "radialGradient"]) 29201 , i = nl(o, "gradientUnits") !== "userSpaceOnUse" 29202 , r = i ? 1 : t.baseWidth 29203 , a = i ? 1 : t.baseHeight 29204 , d = i ? 1 : t.baseSize 29205 , u = $t(nl(o, "cx", "50%"), 0, r) 29206 , h = $t(nl(o, "cy", "50%"), 0, a) 29207 , c = $t(nl(o, "r", "50%"), d / 2, d) 29208 , f = $t(nl(o, "fx", null), u, r) 29209 , p = $t(nl(o, "fy", null), h, a) 29210 , g = $t(nl(o, "fr", "0"), 0, d); 29211 if (i) { 29212 let b = e.getBBox(); 29213 u = u * b.width + b.x, 29214 h = h * b.height + b.y, 29215 f = f * b.width + b.x, 29216 p = p * b.height + b.y, 29217 c *= Se(b.width, b.height) / Math.sqrt(2), 29218 g *= Se(b.width, b.height) / Math.sqrt(2) 29219 } 29220 n.pC.x = u, 29221 n.pC.y = h, 29222 n.r = c, 29223 n.setPF(new B(f,p)), 29224 n.setRF(g), 29225 n.baseElement.setAttribute("gradientUnits", "userSpaceOnUse"); 29226 let y = nl(o, "spreadMethod"); 29227 if (n.setSpreadMethod(y), 29228 t.isHyvectorSvg) { 29229 let b = oe.fromSvgValue(nl(o, "hyvector:paintTransform")); 29230 n.paintTransform.setFromTransform(b) 29231 } else { 29232 let b = l.getAttribute("gradientTransform"); 29233 b && (b = oe.fromSvgValue(b), 29234 n.paintTransform.setFromTransform(b)) 29235 } 29236 n.updateViewFromModel(),
29237 n.updateModelFromView(); 29238 let m = 0; 29239 for (let b of l.children) 29240 if (fs(b) === "stop") { 29241 let M = window.getComputedStyle(b) 29242 , S = $t(b.getAttribute("offset"), 0); 29243 isNaN(S) || S < m ? S = m : S > 1 && (S = 1); 29244 let x = cd("stop-color", b, M, t) 29245 , P = $y(M.getPropertyValue("stop-opacity"), 1); 29246 n.insertStop(S, x, P), 29247 m = S 29248 } 29249 return n 29250} 29251function f6(l, e, t) { 29252 let n = getComputedStyle(l) 29253 , s = l.getAttribute("hyvector:patternType") 29254 , o = cd("hyvector:color", l, n, t) 29255 , i = cd("hyvector:background", l, n, t) 29256 , r = yr(l, "hyvector:scale", 1) 29257 , a = yr(l, "hyvector:rotation", 0) 29258 , d = yr(l, "hyvector:density", .2) 29259 , u = JT(l, "hyvector:inverse", !1); 29260 return new bi(s,o,i,r,a,d,u) 29261} 29262async function p6(l, e, t, n) { 29263 let s = new Rn; 29264 fn(s, l, e, n); 29265 let o = e.getPropertyValue("font-size"); 29266 s.textElement.style.setProperty("font-size", o); 29267 let i = xt(l.getAttribute("x"), 0, n.baseWidth) 29268 , r = xt(l.getAttribute("y"), 0, n.baseHeight) 29269 , a = 0; 29270 for (let u = 0; u < l.childNodes.length; u++) { 29271 let h = l.childNodes[u], c = h.textContent.trim(), f; 29272 if (h.nodeType === Node.TEXT_NODE || h.nodeType === Node.CDATA_SECTION_NODE) { 29273 f = new zo, 29274 await f.setFromElement(l); 29275 let p = getComputedStyle(l) 29276 , g = To("fill", l, p, n); 29277 si(g, p.getPropertyValue("fill-opacity")), 29278 f.setFill(g); 29279 let y = To("stroke", l, p, n); 29280 si(y, p.getPropertyValue("stroke-opacity")), 29281 f.setStroke(y) 29282 } else if (fs(h) === "tspan") { 29283 f = new zo, 29284 await f.setFromElement(h); 29285 let p = getComputedStyle(h) 29286 , g = To("fill", l, p, n); 29287 si(g, p.getPropertyValue("fill-opacity")), 29288 f.setFill(g); 29289 let y = To("stroke", l, p, n); 29290 if (si(y, p.getPropertyValue("stroke-opacity")), 29291 f.setStroke(y), 29292 h.getAttribute("x") === "0" || h.getAttribute("hyvector:linestart") != null) 29293 if (u === 0) { 29294 let m = xt(h.getAttribute("dy"), 0, null, h); 29295 r += m 29296 } else 29297 c = ` 29298` + c 29299 } 29300 (i || r) && s.setSelfTransform(s.getSelfTransform().preTranslate(i, r)), 29301 s.insertText(c, a, f), 29302 a = s.getTextLength() - 1 29303 } 29304 let d = l.getAttribute("text-anchor"); 29305 return s.setAlignment(d === "end" ? "right" : d === "middle" ? "center" : "left"), 29306 s 29307} 29308async function g6(l, e, t, n) { 29309 let s = (navigator.language || "en").split("-")[0], o; 29310 for (let i of l.children) { 29311 let r = i.getAttribute("requiredExtensions"); 29312 if (r == null || r === "") { 29313 let a = i.getAttribute("systemLanguage"); 29314 if (a == null || a.includes(s)) { 29315 o = i; 29316 break 29317 } else 29318 a.includes("en") && (o = i) 29319 } 29320 } 29321 if (o != null) 29322 return await Di(o, t, n) 29323} 29324function $t(l, e=null, t=1) { 29325 return (l == null || l === "") && (l = e), 29326 typeof l == "string" && (l = l.trim(), 29327 l.charAt(l.length - 1) === "%" ? l = parseFloat(l.substring(0, l.length - 1)) * t / 100 : l = parseFloat(l)), 29328 typeof l == "number" ? l : e 29329} 29330function m6(l) { 29331 let e = []; 29332 for (let t = 0; t < l.length; t++) { 29333 let n = l.charCodeAt(t) 29334 , s = 0; 29335 for (; n >= 48 && n <= 57; ) 29336 s = 10 * s + n - 48, 29337 n = l.charCodeAt(++t); 29338 let o; 29339 switch (l[t]) { 29340 case 115: 29341 case 122: 29342 case 97: 29343 o = "s"; 29344 break; 29345 case 99: 29346 o = "c" 29347 } 29348 if (o) 29349 for (s = Math.max(1, s); s > 0; s--) 29350 e.push(o) 29351 } 29352 return e 29353} 29354function y6(l, e) { 29355 e.getType() === "document" && (e.documentSettings.title = (l.textContent || "").trim()) 29356} 29357function v6(l, e) { 29358 e.getType() === "document" && (e.documentSettings.description = (l.textContent || "").trim()) 29359} 29360function fs(l) { 29361 if (l == null) 29362 return null; 29363 let e = l.nodeName 29364 , t = e.lastIndexOf(":"); 29365 return t >= 0 ? e.substring(t + 1) : e 29366} 29367class Ce { 29368 name; 29369 disabled; 29370 constructor(e, t=!1) { 29371 return Gs(this, Ce), 29372 this.name = e, 29373 this.disabled = t, 29374 Et(this) 29375 } 29376 performAction(e) { 29377 As() 29378 } 29379 setDisabled(e) { 29380 this.disabled = e 29381 } 29382} 29383class b6 extends Ce { 29384 constructor() { 29385 super("openFile") 29386 } 29387 async performAction() { 29388 if (window.showOpenFilePicker) { 29389 let e; 29390 try { 29391 [e] = await window.showOpenFilePicker({ 29392 multiple: !1, 29393 types: [{ 29394 description: "SVG Files", 29395 accept: { 29396 "image/svg+xml": [".svg", ".svgz"] 29397 } 29398 }] 29399 }) 29400 } catch {} 29401 if (e) { 29402 const n = await (await e.getFile()).text(); 29403 let s = await zs(n); 29404 this.setDocument(s) 29405 } 29406 } else { 29407 let e = document.createElement("input"); 29408 e.type = "file", 29409 e.accept = ".svg,.svgz", 29410 e.onchange = async t=>{ 29411 let s = await t.target.files[0].text() 29412 , o = await zs(s); 29413 this.setDocument(o) 29414 } 29415 , 29416 e.click() 29417 } 29418 } 29419 setDocument(e) { 29420 let t = V(); 29421 z().setModelsSelected([], t.selectedModels), 29422 t.setActiveDocument(e), 29423 t.documentSettings.setSize(e.getWidth(), e.getHeight()); 29424 let s = Kd(e.getWidth(), e.getHeight()) 29425 , o = t.appSettings;
29426 o.editor.grid.gridX = s, 29427 o.editor.grid.gridY = s, 29428 ae().reset() 29429 } 29430} 29431let M6 = new b6; 29432const S6 = { 29433 name: "HyField", 29434 props: { 29435 label: { 29436 type: String, 29437 default: "" 29438 }, 29439 disabled: Boolean 29440 } 29441} 29442 , w6 = { 29443 class: "hy-field-label" 29444} 29445 , P6 = { 29446 class: "hy-field-content" 29447}; 29448function x6(l, e, t, n, s, o) { 29449 return N(), 29450 $("div", { 29451 class: Ne(["hy-field", { 29452 "hy-field-disabled": t.disabled 29453 }]) 29454 }, [_("div", w6, se(t.label), 1), _("div", P6, [vt(l.$slots, "default", { 29455 disabled: t.disabled 29456 })])], 2) 29457} 29458const js = ie(S6, [["render", x6]]) 29459 , C6 = { 29460 name: "HyGroup" 29461} 29462 , _6 = { 29463 class: "hy-group" 29464}; 29465function T6(l, e, t, n, s, o) { 29466 return N(), 29467 $("div", _6, [vt(l.$slots, "default")]) 29468} 29469const Dt = ie(C6, [["render", T6]]) 29470 , k6 = { 29471 name: "HyDialog", 29472 inheritAttrs: !1, 29473 props: { 29474 title: { 29475 type: String, 29476 default: "" 29477 }, 29478 show: { 29479 type: Boolean, 29480 default: !1 29481 }, 29482 onPointerdownOutside: { 29483 type: [Function, String], 29484 default: null 29485 }, 29486 onEscapeKey: { 29487 type: [Function, String], 29488 default: "cancel" 29489 }, 29490 onEnterKey: { 29491 type: [Function, String], 29492 default: null 29493 }, 29494 elevation: { 29495 type: Number, 29496 default: 10 29497 }, 29498 modal: { 29499 type: Boolean, 29500 default: !1 29501 }, 29502 backdropStyle: { 29503 type: String 29504 }, 29505 hideHeader: { 29506 type: Boolean 29507 } 29508 }, 29509 data() { 29510 return { 29511 dialogLeft: 0, 29512 dialogTop: 0, 29513 dragStartPointerPos: null, 29514 dragStartElementPos: null, 29515 dragAnimationFrame: null 29516 } 29517 }, 29518 emits: ["close", "cancel", "pointerdownOutside"], 29519 computed: { 29520 isCentered() { 29521 return this.getSource == null && this.getSrcBounds == null 29522 } 29523 }, 29524 unmounted() { 29525 this.removeGlobalEventListeners(), 29526 this.removeDocumentDragEvenListeners() 29527 }, 29528 methods: { 29529 focus() { 29530 if (this.$refs.dialog) { 29531 let l = ld(this.$refs.dialog); 29532 if (l.length > 0) { 29533 let e = l.find(t=>t.autofocus) || l[0]; 29534 e === this.$refs.closeButton && l.length > 1 && (e = l[1]), 29535 this.$nextTick(()=>{ 29536 e.focus() 29537 } 29538 ) 29539 } 29540 } 29541 }, 29542 getPrimaryButton(l) { 29543 if (l == null) 29544 l = this.$refs.dialog; 29545 else if (l.tagName === "BUTTON" && l.classList.contains("hy-primary-btn")) 29546 return l.getAttribute("disabled") ? null : l; 29547 let e = [...l.children]; 29548 for (let t of e) { 29549 let n = this.getPrimaryButton(t); 29550 if (n !== void 0) 29551 return n 29552 } 29553 }, 29554 emitCancel(l) { 29555 this.$emit("cancel", l) 29556 }, 29557 onPointerdown(l) { 29558 let e = this.$refs.modal 29559 , t = l.target; 29560 if (this.modal && t === e) { 29561 if (l.preventDefault(), 29562 l.type === "pointerdown") { 29563 let n = this.onPointerdownOutside; 29564 n && (typeof n == "string" ? this.$emit("onPointerdownOutside", l) : n(l)) 29565 } 29566 } else { 29567 let n = e.parentElement 29568 , s = t 29569 , o = !1; 29570 for (; s != null && s !== n; ) { 29571 if (s.parentElement === n) { 29572 Array.prototype.indexOf.call(n.children, e) > Array.prototype.indexOf.call(n.children, s) && (o = !0); 29573 break 29574 } 29575 s = s.parentElement 29576 } 29577 if (o && l.type === "pointerdown") { 29578 let i = this.onPointerdownOutside; 29579 i && (typeof i == "string" ? this.$emit("onPointerdownOutside", l) : i(l)) 29580 } 29581 } 29582 }, 29583 onKeydown(l) { 29584 if (!l.defaultPrevented) { 29585 if (l.key === "Escape") { 29586 let e = this.onEscapeKey; 29587 e != null && (typeof e == "string" ? this.$emit(e, l) : e(l), 29588 l.preventDefault()) 29589 } else if (l.key === "Enter") { 29590 let e = this.onEnterKey; 29591 e != null && (typeof e == "string" ? this.$emit(e, l) : e(l), 29592 l.preventDefault()) 29593 } else if (l.key === "Tab" && this.$refs.dialog) { 29594 let e = ld(this.$refs.dialog); 29595 if (e.length > 0) { 29596 let t = e[0] 29597 , n = e[e.length - 1]; 29598 l.shiftKey ? document.activeElement === t && (n.focus(), 29599 l.preventDefault()) : document.activeElement === n && (t.focus(), 29600 l.preventDefault()) 29601 } 29602 } 29603 } 29604 }, 29605 addGlobalEventListeners() { 29606 document.addEventListener("pointerdown", this.onPointerdown, !0) 29607 }, 29608 removeGlobalEventListeners() { 29609 document.removeEventListener("pointerdown", this.onPointerdown, !0) 29610 }, 29611 addDocumentDragEvenListeners() { 29612 document.addEventListener("pointermove", this.onPointermove), 29613 document.addEventListener("pointerup", this.endDialogDrag, { 29614 once: !0 29615 }), 29616 document.addEventListener("pointercancel", this.endDialogDrag, { 29617 once: !0 29618 }) 29619 }, 29620 removeDocumentDragEvenListeners() { 29621 document.removeEventListener("pointermove", this.onPointermove), 29622 document.removeEventListener("pointerup", this.endDialogDrag), 29623 document.removeEventListener("pointercancel", this.endDialogDrag) 29624 }, 29625 onDialogPointerdown(l) { 29626 if (!l.defaultPrevented) { 29627 let e = l.target; 29628 for (; e && !Er(e); ) 29629 e = e.parentElement; 29630 e === document.body && l.preventDefault() 29631 } 29632 }, 29633 onHeaderPointerdown(l) { 29634 if (!l.defaultPrevented && l.target === this.$refs.header) { 29635 this.dragStartPointerPos = new B(l.clientX,l.clientY); 29636 let t = this.$refs.dialog.getBoundingClientRect(); 29637 this.dragStartElementPos = new B(t.x,t.y), 29638 this.addDocumentDragEvenListeners(), 29639 l.preventDefault() 29640 } 29641 }, 29642 onPointermove(l) { 29643 if (this.dragStartPointerPos != null) 29644 return this.dragAnimationFrame != null && window.cancelAnimationFrame(this.dragAnimationFrame), 29645 this.dragAnimationFrame = window.requestAnimationFrame(()=>{ 29646 let t = this.$refs.modal.getBoundingClientRect() 29647 , n = this.$refs.dialog 29648 , s = n.getBoundingClientRect() 29649 , o = l.clientY - this.dragStartPointerPos.y + this.dragStartElementPos.y 29650 , i = l.clientX - this.dragStartPointerPos.x + this.dragStartElementPos.x; 29651 o = Math.max(0, Math.min(t.height - s.height, o)), 29652 i = Math.max(0, Math.min(t.width - s.width, i)
29652), 29653 n.style.setProperty("top", o + "px"), 29654 n.style.setProperty("left", i + "px"), 29655 n.style.setProperty("transform", "none"), 29656 this.dragAnimationFrame = null 29657 } 29658 ), 29659 !1 29660 }, 29661 endDialogDrag() { 29662 return this.dragAnimationFrame != null && (window.cancelAnimationFrame(this.dragAnimationFrame), 29663 this.dragAnimationFrame = null), 29664 this.dragStartPointerPos = null, 29665 this.dragStartElementPos = null, 29666 this.removeDocumentDragEvenListeners(), 29667 !1 29668 } 29669 }, 29670 watch: { 29671 show: { 29672 immediate: !0, 29673 handler(l) { 29674 if (l ? this.addGlobalEventListeners() : this.removeGlobalEventListeners(), 29675 l) 29676 el(()=>this.focus()); 29677 else { 29678 let e = document.activeElement; 29679 e != null && this.$refs.dialog && this.$refs.dialog.contains(e) && e.blur() 29680 } 29681 } 29682 } 29683 } 29684} 29685 , E6 = { 29686 class: "title" 29687} 29688 , D6 = { 29689 ref: "contentContainer", 29690 class: "hy-dialog-content-container" 29691} 29692 , O6 = { 29693 key: 1, 29694 class: "hy-dialog-actions" 29695}; 29696function A6(l, e, t, n, s, o) { 29697 return N(), 29698 pe(I1, { 29699 to: "body" 29700 }, [w(Za, { 29701 name: "hy-dialog-fade" 29702 }, { 29703 default: O(()=>[t.show ? (N(), 29704 $("div", { 29705 key: 0, 29706 ref: "modal", 29707 class: Ne(["modal hy-backdrop", [t.modal ? "blocking-modal" : "non-blocking-modal"]]), 29708 style: xe(t.backdropStyle) 29709 }, [wl(_("div", Wl({ 29710 ref: "dialog", 29711 class: ["hy-dialog", { 29712 dragging: s.dragStartPointerPos != null 29713 }] 29714 }, l.$attrs, { 29715 onPointerdown: e[2] || (e[2] = (...i)=>o.onDialogPointerdown && o.onDialogPointerdown(...i)), 29716 onKeydown: e[3] || (e[3] = (...i)=>o.onKeydown && o.onKeydown(...i)) 29717 }), [t.hideHeader ? be("", !0) : (N(), 29718 $("div", { 29719 key: 0, 29720 ref: "header", 29721 class: "hy-dialog-header", 29722 onPointerdown: e[1] || (e[1] = (...i)=>o.onHeaderPointerdown && o.onHeaderPointerdown(...i)) 29723 }, [_("div", E6, se(t.title), 1), _("button", { 29724 ref: "closeButton", 29725 class: "close-button", 29726 onClick: e[0] || (e[0] = (...i)=>o.emitCancel && o.emitCancel(...i)) 29727 }, [...e[4] || (e[4] = [_("svg", { 29728 width: "16", 29729 height: "16",
29730 viewBox: "0 0 8 8" 29731 }, [_("path", { 29732 d: "M2 2L6 6M2 6L6 2", 29733 "stroke-width": "1", 29734 stroke: "currentColor", 29735 fill: "none" 29736 })], -1)])], 512)], 544)), _("div", D6, [vt(l.$slots, "default", { 29737 ref: "content" 29738 })], 512), l.$slots.actions ? (N(), 29739 $("div", O6, [vt(l.$slots, "actions")])) : be("", !0)], 16), [[ef, t.show]])], 6)) : be("", !0)]), 29740 _: 3 29741 })]) 29742} 29743const pn = ie(k6, [["render", A6]]) 29744 , I6 = { 29745 name: "HySelect", 29746 components: { 29747 HyButton: nt, 29748 HyPopover: Ql 29749 }, 29750 props: { 29751 modelValue: null, 29752 items: { 29753 type: Array, 29754 default: ()=>[] 29755 }, 29756 labelField: String, 29757 valueField: String, 29758 disabled: Boolean, 29759 localized: Boolean 29760 }, 29761 data() { 29762 return { 29763 isMounted: !1, 29764 listOpen: !1 29765 } 29766 }, 29767 computed: { 29768 selIndex() { 29769 let l = Oe(this.modelValue); 29770 return this.items.findIndex(e=>this.getItemValue(e) === l) 29771 }, 29772 selItem() { 29773 return this.items ? this.items[this.selIndex] : null 29774 }, 29775 labelWidth() { 29776 let l = 0; 29777 if (this.isMounted) { 29778 let e = this.$refs.label; 29779 for (let t of this.items) { 29780 let n = this.getItemLabel(t); 29781 l = Math.max(l, Dm(e, n)) 29782 } 29783 } 29784 return l 29785 } 29786 }, 29787 mounted() { 29788 this.isMounted = !0 29789 }, 29790 emits: ["update:modelValue", "close"], 29791 methods: { 29792 getItemLabel(l) { 29793 if (l == null) 29794 return ""; 29795 if (typeof l != "object" || this.labelField == null) 29796 return "" + l; 29797 { 29798 let e = this.labelField 29799 , t = l[e]; 29800 return t == null ? "" : this.localized ? this.$t(t) : t 29801 } 29802 }, 29803 getItemValue(l) { 29804 if (l == null || typeof l != "object" || this.valueField == null) 29805 return l; 29806 { 29807 let e = this.valueField; 29808 return l[e] 29809 } 29810 }, 29811 selectItem(l) { 29812 this.$emit("update:modelValue", this.getItemValue(l)) 29813 }, 29814 setListOpen(l) { 29815 this.listOpen = l 29816 }, 29817 onBlur() { 29818 this.setListOpen(!1) 29819 }, 29820 onButtonClick(l) { 29821 !l.defaultPrevented && !this.disabled && (l.preventDefault(), 29822 this.preventOpenOnButtonClick || this.setListOpen(!this.listOpen)) 29823 }, 29824 onButtonPointerdown(l) { 29825 this.preventOpenOnButtonClick = l.defaultPrevented 29826 }, 29827 onItemPointerdown(l, e) { 29828 this.listOpen = !1, 29829 this.selectItem(e), 29830 l.preventDefault(), 29831 l.stopPropagation() 29832 }, 29833 onKeydown(l) { 29834 if (l.defaultPrevented) 29835 return; 29836 let e = !1 29837 , t = l.key; 29838 if (t === " " || t === Qr) 29839 this.listOpen ? (this.setListOpen(!1), 29840 e = !0) : (this.listOpen = !0, 29841 e = !0); 29842 else if (t === $s) 29843 this.listOpen && (this.setListOpen(!1), 29844 e = !0); 29845 else if (t === hn || t === cs) { 29846 let n = this.items; 29847 if (n.length > 1) { 29848 let s = this.selIndex; 29849 t === hn ? s = s <= 0 ? n.length - 1 : s - 1 : s = s >= n.length - 1 ? 0 : s + 1, 29850 this.selectItem(n[s]), 29851 e = !0 29852 } 29853 } 29854 e && l.preventDefault() 29855 }, 29856 onPointerdownOutside(l) { 29857 this.listOpen && (this.listOpen = !1, 29858 this.$emit("close"), 29859 this.$refs.button.$el.contains(l.target) && l.preventDefault()) 29860 } 29861 } 29862} 29863 , L6 = { 29864 class: "hy-select-button-content" 29865} 29866 , V6 = { 29867 key: 0, 29868 style: { 29869 display: "flex", 29870 "align-items": "center", 29871 overflow: "hidden" 29872 } 29873} 29874 , N6 = { 29875 key: 1, 29876 style: { 29877 display: "flex", 29878 "align-items": "center", 29879 overflow: "hidden" 29880 } 29881} 29882 , R6 = { 29883 key: 0 29884} 29885 , F6 = { 29886 class: "hy-notouch-scrollable hy-select-items-container" 29887} 29888 , B6 = ["onPointerdown"] 29889 , z6 = ["onPointerdown"]; 29890function U6(l, e, t, n, s, o) { 29891 const i = E("hy-button") 29892 , r = E("hy-popover"); 29893 return N(), 29894 $(Pe, null, [w(i, Wl({ 29895 ref: "button", 29896 class: ["hy-select", { 29897 "hy-select-open": s.listOpen 29898 }], 29899 onClick: o.onButtonClick, 29900 onPointerdown: o.onButtonPointerdown, 29901 onKeydown: o.onKeydown, 29902 onBlur: o.onBlur, 29903 "aria-haspopup": "listbox"
29904 }, l.$attrs, { 29905 disabled: t.disabled 29906 }), { 29907 default: O(()=>[_("div", L6, [l.$slots.button ? (N(), 29908 $("div", V6, [vt(l.$slots, "button", { 29909 value: t.modelValue 29910 })])) : l.$slots.default ? (N(), 29911 $("div", N6, [vt(l.$slots, "default", { 29912 value: t.modelValue, 29913 item: o.selItem 29914 })])) : (N(), 29915 $("span", { 29916 key: 2, 29917 ref: "label", 29918 style: xe([{ 29919 "margin-left": "12px", 29920 "text-align": "start" 29921 }, { 29922 width: o.labelWidth + "px" 29923 }]) 29924 }, se(o.getItemLabel(o.selItem)), 5)), e[2] || (e[2] = _("div", { 29925 style: { 29926 flex: "0 0 auto" 29927 } 29928 }, [_("svg", { 29929 viewBox: "0 0 32 32", 29930 "data-icon": "down", 29931 width: "0.6em", 29932 height: "0.6em", 29933 "aria-hidden": "true", 29934 focusable: "false" 29935 }, [_("path", { 29936 d: "M2 7l14 16 14-16", 29937 fill: "none", 29938 stroke: "currentColor", 29939 "stroke-width": "6", 29940 opacity: "0.9" 29941 })])], -1))])]), 29942 _: 3 29943 }, 16, ["class", "onClick", "onPointerdown", "onKeydown", "onBlur", "disabled"]), w(r, { 29944 show: s.listOpen, 29945 primaryPos: "bottom", 29946 secondaryPos: "start", 29947 "get-source": ()=>l.$refs.button, 29948 arrowSize: 0, 29949 class: "hy-elevation-4", 29950 style: { 29951 "border-radius": "3px" 29952 }, 29953 onClose: e[0] || (e[0] = a=>s.listOpen = !1), 29954 onCancel: e[1] || (e[1] = a=>s.listOpen = !1), 29955 role: "listBox", 29956 onPointerdownOutside: o.onPointerdownOutside 29957 }, { 29958 default: O(()=>[l.$slots.sticky ? (N(), 29959 $("div", R6, [vt(l.$slots, "sticky")])) : be("", !0), _("div", null, [_("div", F6, [l.$slots.default ? (N(!0), 29960 $(Pe, { 29961 key: 0 29962 }, Gt(t.items, a=>(N(), 29963 $("div", { 29964 key: a, 29965 class: Ne(["hy-select-item", { 29966 "hy-select-item-selected": a === o.selItem 29967 }]), 29968 onPointerdown: d=>o.onItemPointerdown(d, a) 29969 }, [vt(l.$slots, "default", { 29970 value: o.getItemValue(a) 29971 })], 42, B6))), 128)) : (N(!0), 29972 $(Pe, { 29973 key: 1 29974 }, Gt(t.items, a=>(N(), 29975 $("div", { 29976 key: a, 29977 class: Ne(["hy-select-item", { 29978 "hy-select-item-selected": a === o.selItem 29979 }]), 29980 onPointerdown: d=>o.onItemPointerdown(d, a) 29981 }, se(o.getItemLabel(a)), 43, z6))), 128))])])]), 29982 _: 3 29983 }, 8, ["show", "get-source", "onPointerdownOutside"])], 64) 29984} 29985const Dl = ie(I6, [["render", U6]]); 29986function G6(l, e, t, n=!1) { 29987 if (l == null) 29988 return null; 29989 e == null && (e = " "); 29990 let s = new Set(t) 29991 , o = Number.MAX_SAFE_INTEGER 29992 , i = 0 29993 , r = ` 29994` 29995 , a = [r] 29996 , d = l.split(/(<!--|-->|<!\[|]]>|<\?|\?>)/g) 29997 , u = d.length 29998 , h = "" 29999 , c = 0; 30000 for (; c < u; ) { 30001 let f = d[c++]; 30002 if (f) { 30003 let p = f === "<!--" ? "-->" : f === "<![" ? "]]>" : f === "<?" ? "?>" : null; 30004 if (p) 30005 for (h += r + f; c < u && f !== p; ) 30006 f = d[c++], 30007 h += f; 30008 else { 30009 let g = f.split(/([<>])/g), y = !1, m; 30010 for (let b = 0; b < g.length; ) 30011 if (m = g[b++], 30012 m === "<") { 30013 if (m = g[b++] || "", 30014 m[0] === "/") 30015 i -= i ? 1 : 0, 30016 r = a[i], 30017 i < o ? y || (h += r) : i === o && (o = Number.MAX_SAFE_INTEGER), 30018 y = !1; 30019 else if (m[0] === "!" || m[m.length - 1] === "/") 30020 i <= o && (h += r), 30021 y = !1; 30022 else { 30023 if (i <= o) { 30024 h += r; 30025 let M = (m.match(/\S+/) || [null])[0]; 30026 s.has(M) && (o = i) 30027 } 30028 i++, 30029 r = a[i] || (a[i] = r + e), 30030 y = !0 30031 } 30032 if (b++, 30033 n) { 30034 let M, S = ""; 30035 for (; (M = m.match(/\s+([:a-zA-Z_][:a-zA-Z_\-.0-9]*(?:="[^"]*")?)/)) != null; ) 30036 M.index > 0 && (S += m.substring(0, M.index), 30037 m = m.substring(M.index)), 30038 S += a[i] + e + M[1], 30039 m = m.substring(M[0].length); 30040 S && (m = S + a[i] + e + m) 30041 } 30042 h += "<" + m + ">" 30043 } else 30044 h += m, 30045 y && m.includes(` 30046`) && (y = !1) 30047 } 30048 } 30049 } 30050 return u ? h.slice(1) : h 30051} 30052const H6 = { 30053 hyvectorSvg: !0, 30054 inlineSvg: !1, 30055 freeSize: !1, 30056 precision: 2, 30057 fonts: "embed", 30058 applyTransform: !1, 30059 globalColorVars: !0, 30060 globalColorVarsFallback: !0, 30061 beautify: !0, 30062 xmlIndent: 2 30063}; 30064async function Jy(l, e, t) { 30065 t = Object.assign(structuredClone(H6), t); 30066 let n = de("svg"); 30067 t.hyvectorSvg && n.setAttribute("xmlns:hyvector", "https://www.pic.net"); 30068 let s = t.x || 0 30069 , o = t.y || 0; 30070 (s !== 0 || o !== 0) && (n.setAttribute("x", s), 30071 n.setAttribute("y", o)), 30072 !t.freeSize && t.width != null && n.setAttribute("width", t.width), 30073 !t.freeSize && t.height != null && n.setAttribute("height", t.height); 30074 let i = t.viewBox || l.baseElement.getAttribute("viewBox"); 30075 i && n.setAttribute("viewBox", i); 30076 let r = l.documentSettings.title.trim(); 30077 r && n.appendChild(J6(r)); 30078 let a = l.documentSettings.description.trim(); 30079 a && n.appendChild(Z6(a)); 30080 let d = l.globalColorGroups; 30081 if (d.length > 0 && d[0].colors.length > 0) { 30082 let y = d.reduce((m,b)=>{ 30083 let M = b.name 30084 , S = b.colors; 30085 return S && S.length && (M && (m += M + ": "), 30086 m += S.map(x=>x.name + " " + x.color.toCss()).join(", ")), 30087 m += ";", 30088 m 30089 } 30090 , ""); 30091 n.setAttribute("hyvector:globalColors", y) 30092 } 30093 let u = de("style"); 30094 if (t.globalColorVars && t.globalColorVarsFallback) { 30095 let y = "";
30096 if (l.getModels(!1).forEach(m=>{ 30097 if (m instanceof Nt) { 30098 let b = [] 30099 , M = m.getFillPaint(); 30100 M && b.push(...M.getGlobalColorRefs()); 30101 let S = m.getStrokePaint(); 30102 S && b.push(...S.getGlobalColorRefs()); 30103 for (let x of b) 30104 x.colorModification && !x.colorModification.isIdentity() && (y += " --" + x.getFallbackCssVarName() + ": " + x.toCss() + `; 30105`) 30106 } 30107 } 30108 ), 30109 y) { 30110 let m = ` 30111 @supports (fill: oklch(from red l c h / 1)) { 30112 svg { 30113` + y + ` } 30114 }`; 30115 u.appendChild(document.createTextNode(m)) 30116 } 30117 } 30118 u.childNodes.length > 0 && n.appendChild(u); 30119 let h = de("defs") 30120 , c = Zy(e || l.getChildModels()) 30121 , f = await e8(c, t); 30122 f?.childNodes.length > 0 && h.appendChild(f); 30123 let p = e ? e.reduce((y,m)=>m.getDefsModels(!0, y), new Set) : l.getDefs(); 30124 for (let y of p) 30125 h.appendChild(await Ur(y, t)); 30126 h.childElementCount > 0 && n.appendChild(h); 30127 for (let y of e ?? l.getChildModels()) { 30128 let m = await Ur(y, t); 30129 n.appendChild(m), 30130 e != null && t.hyvectorSvg && m.setAttribute("hyvector:transform", y.getAggregateTransform().toSvgValue()) 30131 } 30132 Qy(n, t); 30133 let g = new XMLSerializer().serializeToString(n); 30134 if (t.inlineSvg && (g = g.replace(/xmlns="http:\/\/www.w3.org\/2000\/svg"\s*/, "")), 30135 t.beautify) { 30136 let y = " ".repeat(t.xmlIndent); 30137 g = G6(g, y, ["text"], !0) 30138 } 30139 return g 30140} 30141function Zy(l, e) { 30142 e == null && (e = new Set); 30143 for (let t of l) 30144 if (t.getType() === "textSpan") { 30145 let n = t.textStyle.fontFamily; 30146 e.add(n) 30147 } else 30148 Zy(t.getChildModels(), e); 30149 return e 30150} 30151async function Ur(l, e) { 30152 let t; 30153 switch (l.getType()) { 30154 case "text": 30155 t = await X6(l, e); 30156 break; 30157 case "path": 30158 t = await Sc(l, e); 30159 break; 30160 case "clipPath": 30161 t = await Y6(l, e); 30162 break; 30163 case "rectangle": 30164 case "polygon": 30165 case "star": 30166 t = K6(l, e); 30167 break; 30168 case "circle": 30169 case "ellipse": 30170 t = W6(l, e); 30171 break; 30172 case "group": 30173 t = await $6(l, e); 30174 break; 30175 case "linearGradient": 30176 case "radialGradient": 30177 t = q6(l, e); 30178 break; 30179 case "pattern": 30180 t = j6(l, e); 30181 break; 30182 case "defs": 30183 break; 30184 default: 30185 t = l.baseElement.cloneNode(!1); 30186 for (let n of l.getChildModels()) { 30187 let s = await Ur(n, e); 30188 t.appendChild(s) 30189 } 30190 } 30191 if (l.getLabel) { 30192 let n = l.getLabel(); 30193 n && (e.hyvectorSvg && t.setAttribute("hyvector:label", n), 30194 e.inkscapeSvg && t.setAttribute("inkscape:label", n)) 30195 } 30196 return t 30197} 30198async function $6(l, e) { 30199 let t = l.baseElement.cloneNode(!1); 30200 if (e.hyvectorSvg) { 30201 let n = l.getSelfTransform(); 30202 n.isIdentity || t.setAttribute("hyvector:transform", n.toSvgValue()) 30203 } 30204 for (let n of l.getChildModels()) { 30205 let s = await Ur(n, e); 30206 t.appendChild(s) 30207 } 30208 return t 30209} 30210async function X6(l, e) { 30211 let t = e.fonts === "topath", n = e.hyvectorSvg, s; 30212 if (t) { 30213 let a = l.toPathModels(); 30214 if (a.length === 1) 30215 s = await Sc(a[0], e); 30216 else { 30217 s = de("g"); 30218 for (let d of a) 30219 s.appendChild(await Sc(d, e)) 30220 } 30221 if (!n) 30222 return s 30223 } 30224 let o = l.textElement 30225 , i = []; 30226 l.textLines.forEach(a=>{ 30227 let d = a.getTextSpans().map(u=>u.getTSpan().cloneNode(!0)); 30228 d.length > 1 && (d.pop(), 30229 n && d[0].setAttribute("hyvector:linestart", ""), 30230 i.push(...d)) 30231 } 30232 ), 30233 o = o.cloneNode(!1), 30234 o.append(...i); 30235 let r = l.baseElement; 30236 if (o.setAttribute("transform", r.getAttribute("transform")), 30237 o.style.setProperty("fill", r.style.getPropertyValue("fill")), 30238 o.style.setProperty("stroke", r.style.getPropertyValue("stroke")), 30239 n && t) { 30240 let a = document.createElement("hyvector:text");
30241 return [...o.attributes].forEach(u=>a.setAttribute(u.nodeName, u.nodeValue)), 30242 [...o.children].forEach(u=>a.appendChild(u)), 30243 de("g", { 30244 "hyvector:grouptype": "text" 30245 }, null, [s, a]) 30246 } else 30247 return o 30248} 30249async function Sc(l, e) { 30250 let t = l.baseElement.cloneNode(!1); 30251 e.hyvectorSvg && (t.setAttribute("hyvector:transform", l.getSelfTransform().toSvgValue()), 30252 t.setAttribute("hyvector:d", l.getPathData()), 30253 t.setAttribute("hyvector:nodetypes", Q6(l))); 30254 30255 let n = l.getElementTransform().clone(); 30256 30257 // ========== 强å¶ä¿®æ£æ¨ªåç¼©æ¾ ========== 30258 if (n && !n.isIdentity) { 30259 // 计ç®å½åXè½´ç¼©æ¾æ¯ä¾ 30260 let scaleX = Math.sqrt(n._a * n._a + n._b * n._b); 30261 // 妿X轴缩æ¾ä¸æ¯1ï¼å 许微å°çæµ®ç¹è¯¯å·®ï¼ï¼åå°å ¶ä¿®æ£ä¸º1 30262 if (Math.abs(scaleX - 1) > 0.0001) { 30263 n._a /= scaleX; 30264 n._b /= scaleX; 30265 n._c /= scaleX; 30266 n._d /= scaleX; 30267 // 注æï¼ä¸ä¿®æ¹ _tx å _tyï¼ä¿æå ç´ çä½ç½®ä¸å 30268 } 30269 } 30270 // ====================================== 30271 30272 let s = l.getAggregateTransform().preMultiplyWith(n.invert()); 30273 t.setAttribute("d", l.getPathData(s, -1, e.precision)); 30274 pu(t, l, e); 30275 return t; 30276} 30277async function Y6(l, e) { 30278 let t = l.baseElement 30279 , n = t.cloneNode(!1); 30280 e.hyvectorSvg && (n.setAttribute("hyvector:groupType", "clip"), 30281 n.setAttribute("hyvector:transform", l.getSelfTransform().toSvgValue()), 30282 n.setAttribute("hyvector:d", l.getPathData())); 30283 let s = t.children[0].cloneNode(!0); 30284 s.children[0].setAttribute("d", l.getPathData(l.getPathDataTransform(), -1, e.precision)), 30285 n.appendChild(s), 30286 n.appendChild(l._getFillElement().cloneNode(!1)); 30287 let o = l.getChildContainerElement().cloneNode(!1); 30288 n.appendChild(o); 30289 for (let i of l.getChildModels()) { 30290 let r = await Ur(i, e); 30291 o.appendChild(r) 30292 } 30293 return n.appendChild(l._getStrokeElement().cloneNode(!1)), 30294 pu(n.children[1], l, e), 30295 n 30296} 30297function K6(l, e) { 30298 let t = l.baseElement.cloneNode(!1) 30299 , n = l.getType(); 30300 if (e.hyvectorSvg) { 30301 t.setAttribute("hyvector:pathType", "shape"), 30302 t.setAttribute("hyvector:shapeType", n); 30303 let s = l.getShapePropertyNames(); 30304 for (let o of s) { 30305 let i = l.getShapePropertyValue(o); 30306 o != null && t.setAttribute("hyvector:" + o, i) 30307 } 30308 } 30309 if (t.setAttribute("d", l.getPathData(l.getAggregateTransform(), -1, e.precision)), 30310 t.removeAttribute("transform"), 30311 e.hyvectorSvg) { 30312 let s = l.getSelfTransform(); 30313 s.isIdentity || t.setAttribute("hyvector:transform", s.toSvgValue()) 30314 } 30315 return pu(t, l, e), 30316 t 30317} 30318function W6(l, e) { 30319 let t = l.baseElement.cloneNode(!1); 30320 if (e.hyvectorSvg) { 30321 let n = l.getSelfTransform(); 30322 n.isIdentity || t.setAttribute("hyvector:transform", n.toSvgValue()) 30323 } 30324 return pu(t, l, e), 30325 t 30326} 30327function q6(l, e) { 30328 let t = l.baseElement.cloneNode(!0); 30329 return e.hyvectorSvg && t.setAttribute("hyvector:paintTransform", l.paintTransform.toSvgValue()), 30330 t 30331} 30332function j6(l, e) { 30333 let t = l.baseElement.cloneNode(!0); 30334 return e.hyvectorSvg && (t.setAttribute("hyvector:patternType", l.patternType), 30335 t.setAttribute("hyvector:color", l.color ? l.color.toCss() : "none"), 30336 t.setAttribute("hyvector:background", l.background ? l.background.toCss() : "none"), 30337 t.setAttribute("hyvector:scale", l.scale), 30338 t.setAttribute("hyvector:rotation", l.rotation), 30339 t.setAttribute("hyvector:density", l.density), 30340 t.setAttribute("hyvector:inverse", l.inverse)), 30341 t 30342} 30343function pu(l, e, t) { 30344 gg(l, e, "fill", t), 30345 gg(l, e, "stroke", t) 30346} 30347function gg(l, e, t, n) { 30348 let s = e.getPaint(t) 30349 , o = l.style; 30350 if (s == null) 30351 t === "fill" ? l.setAttribute(t, "none") : l.removeAttribute(t), 30352 o.removeProperty(t); 30353 else if (s.getType() === il) { 30354 let r = s.paintModelOrColor; 30355 n.globalColorVars ? n.globalColorVarsFallback && !r.colorModification.isIdentity() ? (l.setAttribute(t, r.toColor().toCss()), 30356 o.setProperty(t, r.toFallbackCss())) : o.setProperty(t, r.toCss()) : (o.removeProperty(t), 30357 l.setAttribute(t, r.toColor().toCss())) 30358 } else 30359 o.removeProperty(t), 30360 l.setAttribute(t, s.toCssValue()) 30361} 30362function J6(l) { 30363 let e = de("title"); 30364 return e.textContent = l, 30365 e 30366} 30367function Z6(l) { 30368 let e = de("desc"); 30369 return e.textContent = l, 30370 e 30371} 30372function Q6(l) { 30373 let e = ""; 30374 for (let t of l.getSinglePathModels()) { 30375 let n = null 30376 , s = 0; 30377 for (let o of t.getNodePoints()) { 30378 let i = o.getNodeType(); 30379 s === 0 || i === n ? s++ : (e += (s === 1 ? "" : s) + (n === yt ? "s" : "c"), 30380 s = 1), 30381 n = i 30382 } 30383 s > 0 && (e += (s === 1 ? "" : s) + (n === yt ? "s" : "c")) 30384 } 30385 return e 30386} 30387async function e8(l, e) { 30388 if (l.size > 0) 30389 if (e.fonts === "embed" || e.fonts === "link") { 30390 let t = ""; 30391 for (let s of l.keys()) 30392 if (t += ` 30393`, 30394 e.fonts === "embed") { 30395 let o = await kf(s); 30396 if (o) { 30397 let i = o.getArrayBuffer() 30398 , a = 'url("data:font/ttf;base64,' + _T(i) + '");'; 30399 t += '@font-face { font-family: "' + s + '"; src: ' + a + "}" 30400 } 30401 } else 30402 t += `@import url('https://fonts.googleapis.com/css2?family=${s.replaceAll(" ", "+")}&display=swap');`; 30403 let n = de("style"); 30404 return n.appendChild(document.createTextNode(t)), 30405 n 30406 } else 30407 return null 30408} 30409function Qy(l, e) { 30410 let t = e?.precision; 30411 if (t != null) { 30412 for (let n of ["r", "rx", "ry", "cx", "cy", "x", "y", "width", "height", "x1", "y1", "x2", "y2"]) { 30413 let s = l.getAttribute(n); 30414 s && l.setAttribute(n, "" + Je(parseFloat(s), t)) 30415 } 30416 for (let n of l.children) 30417 Qy(n, e) 30418 } 30419 for (let n of l.attributes) 30420 n.value === "" && l.removeAttribute(n.name) 30421} 30422const t8 = { 30423 name: "SvgExportOptions", 30424 components: { 30425 HySelect: Dl, 30426 HyCheckbox: ml, 30427 HyInputNumber: Lt, 30428 HyField: js 30429 }, 30430 props: { 30431 svgOptions: Object 30432 }, 30433 data() { 30434 return { 30435 fontsItems: [{ 30436 value: "embed", 30437 label: "fileSaveDialog.embed" 30438 }, { 30439 value: "link", 30440 label: "fileSaveDialog.linkToGoogle" 30441 }, { 30442 value: "name", 30443 label: "fileSaveDialog.fontName" 30444 }, { 30445 value: "topath", 30446 label: "fileSaveDialog.convertToPaths" 30447 }], 30448 localSvgOptions: {} 30449 } 30450 }, 30451 mounted() { 30452 this.localSvgOptions = this.svgOptions 30453 } 30454} 30455 , l8 = { 30456 style: { 30457 padding: "16px 24px", 30458 display: "flex", 30459 "flex-direction": "column", 30460 gap: "12px", 30461 "align-items": "flex-start" 30462 } 30463}; 30464function n8(l, e, t, n, s, o) { 30465 const i = E("hy-select") 30466 , r = E("hy-field") 30467 , a = E("hy-input-number") 30468 , d = E("hy-checkbox"); 30469 return N(), 30470 $("div", l8, [w(r, { 30471 label: l.$t("fileSaveDialog.fontHandling") 30472 }, {
30473 default: O(()=>[w(i, { 30474 modelValue: s.localSvgOptions.fonts, 30475 "onUpdate:modelValue": e[0] || (e[0] = u=>s.localSvgOptions.fonts = u), 30476 items: s.fontsItems, 30477 valueField: "value", 30478 labelField: "label", 30479 localized: "" 30480 }, null, 8, ["modelValue", "items"])]), 30481 _: 1 30482 }, 8, ["label"]), w(r, { 30483 label: l.$t("fileSaveDialog.precision") 30484 }, { 30485 default: O(()=>[w(a, { 30486 modelValue: s.localSvgOptions.precision, 30487 "onUpdate:modelValue": e[1] || (e[1] = u=>s.localSvgOptions.precision = u), 30488 min: 0, 30489 max: 16, 30490 class: "dimension-input" 30491 }, null, 8, ["modelValue"])]), 30492 _: 1 30493 }, 8, ["label"]), l.$isDevelopment ? (N(), 30494 $(Pe, { 30495 key: 0 30496 }, [w(r, { 30497 label: l.$t("fileSaveDialog.globalColorVars") 30498 }, { 30499 default: O(()=>[w(d, { 30500 modelValue: s.localSvgOptions.globalColorVars, 30501 "onUpdate:modelValue": e[2] || (e[2] = u=>s.localSvgOptions.globalColorVars = u) 30502 }, null, 8, ["modelValue"])]), 30503 _: 1 30504 }, 8, ["label"]), w(r, { 30505 label: l.$t("fileSaveDialog.useColorModFallback") 30506 }, { 30507 default: O(()=>[w(d, { 30508 modelValue: s.localSvgOptions.globalColorVarsFallback, 30509 "onUpdate:modelValue": e[3] || (e[3] = u=>s.localSvgOptions.globalColorVarsFallback = u) 30510 }, null, 8, ["modelValue"])]), 30511 _: 1 30512 }, 8, ["label"])], 64)) : be("", !0)]) 30513} 30514const s8 = ie(t8, [["render", n8]]) 30515 , o8 = { 30516 name: "FileSaveDialog", 30517 components: { 30518 SvgExportOptions: s8, 30519 HyDropdown: xl, 30520 HyButton: nt, 30521 HyCheckbox: ml, 30522 HyDialog: pn, 30523 HyField: js, 30524 HyGroup: Dt, 30525 HyInput: Xs, 30526 HyInputNumber: Lt, 30527 HySelect: Dl 30528 }, 30529 props: { 30530 show: { 30531 type: Boolean, 30532 default: !1 30533 } 30534 }, 30535 data() { 30536 return { 30537 fileName: "untitled", 30538 fileType: "svg", 30539 fileTypeItems: [{ 30540 value: "svg", 30541 label: ".svg" 30542 }, { 30543 value: "png", 30544 label: ".png" 30545 }, { 30546 value: "webp", 30547 label: ".webp" 30548 }], 30549 svgOptions: { 30550 hyvectorSvg: !0, 30551 inlineSvg: !1, 30552 freeSize: !1, 30553 precision: 2, 30554 fonts: "embed", 30555 applyTransform: !1, 30556 globalColorVars: !0, 30557 globalColorVarsFallback: !0 30558 }, 30559 imageWidth: 0, 30560 imageHeight: 0, 30561 keepRatio: !0, 30562 svgType: "hyvector" 30563 } 30564 }, 30565 computed: { 30566 isFreeSize() { 30567 return this.svgOptions.freeSize && this.fileType === "svg" 30568 } 30569 }, 30570 emits: ["close", "cancel"], 30571 methods: { 30572 t(l) { 30573 return this.$t("fileSaveDialog." + l) 30574 }, 30575 parseSize(l) { 30576 return l.replace(/[^0-9]/g, "") || "0" 30577 }, 30578 formatSize(l) { 30579 return l + "px" 30580 }, 30581 download() { 30582 this.close(), 30583 el(async()=>{ 30584 let l = await this.createImageAsBlob(); 30585 if (l) { 30586 let e = this.fileType; 30587 ev(l, this.fileName + "." + e) 30588 } 30589 } 30590 ) 30591 }, 30592 save() { 30593 this.close(), 30594 el(async()=>{ 30595 let l = await this.createImageAsBlob(); 30596 if (l) { 30597 let e = this.fileType; 30598 i8(l, this.fileName + "." + e) 30599 } 30600 } 30601 ) 30602 }, 30603 close() { 30604 this.$emit("close") 30605 }, 30606 cancel() { 30607 this.$emit("cancel") 30608 }, 30609 async createImageAsBlob() { 30610 let l = this.fileType, e = this.$store.activeDocument, t; 30611 if (l === "svg") { 30612 let n = Object.assign({}, this.svgOptions); 30613 n.freeSize || (n.width = this.imageWidth, 30614 n.height = this.imageHeight); 30615 let s = await Jy(e, null, n); 30616 t = new Blob([s],{ 30617 type: "image/svg+xml;charset=utf-8" 30618 }) 30619 } else if (l === "png" || l === "webp") { 30620 let n = e.baseElement.cloneNode(!0) 30621 , s = new XMLSerializer().serializeToString(n) 30622 , o = await Wd(s, null, this.imageWidth, this.imageHeight); 30623 t = await new Promise(i=>o.toBlob(i, "image/" + l, 1)) 30624 } 30625 return t 30626 }, 30627 updateRatio(l) { 30628 if (this.keepRatio) { 30629 let e = this.$store.activeDocument 30630 , t = parseFloat(e.baseElement.getAttribute("width") || 0) 30631 , n = parseFloat(e.baseElement.getAttribute("height") || 0); 30632 l === !0 ? this.imageWidth = Math.round(this.imageHeight * t / n) : this.imageHeight = Math.round(this.imageWidth * n / t) 30633 } 30634 } 30635 }, 30636 watch: { 30637 show: { 30638 handler(l) { 30639 if (l) { 30640 let e = this.$store.activeDocument;
30641 this.imageWidth = e.getWidth() || 0, 30642 this.imageHeight = e.getHeight() || 0 30643 } 30644 }, 30645 immediate: !0 30646 } 30647 } 30648}; 30649async function i8(l, e) { 30650 if (window.showSaveFilePicker) 30651 try { 30652 const t = { 30653 suggestedName: e, 30654 types: [{ 30655 description: "SVG Files", 30656 accept: { 30657 "image/svg": [".svg"] 30658 } 30659 }] 30660 } 30661 , s = await (await window.showSaveFilePicker(t)).createWritable(); 30662 await s.write(l), 30663 await s.close() 30664 } catch (t) { 30665 t.name === "AbortError" || console.error(t) 30666 } 30667 else 30668 ev(l, e) 30669} 30670function ev(l, e) { 30671 let t = document.createElement("a") 30672 , n = URL.createObjectURL(l); 30673 t.href = n, 30674 t.download = e, 30675 t.click(), 30676 URL.revokeObjectURL(n) 30677} 30678const r8 = { 30679 class: "content fields-container", 30680 style: { 30681 "align-items": "stretch" 30682 } 30683} 30684 , a8 = { 30685 style: { 30686 display: "flex", 30687 "align-items": "stretch" 30688 } 30689} 30690 , d8 = { 30691 class: "fields-container" 30692} 30693 , u8 = { 30694 class: "keep-ratio-group" 30695}; 30696function h8(l, e, t, n, s, o) { 30697 const i = E("hy-input") 30698 , r = E("hy-select") 30699 , a = E("hy-group") 30700 , d = E("hy-field") 30701 , u = E("hy-input-number") 30702 , h = E("hy-checkbox") 30703 , c = E("svg-export-options") 30704 , f = E("hy-dropdown") 30705 , p = E("hy-button") 30706 , g = E("hy-dialog"); 30707 return N(), 30708 pe(g, { 30709 show: t.show, 30710 modal: "", 30711 title: o.t("saveFile"), 30712 primaryPos: "center", 30713 secondaryPos: "center", 30714 onClose: o.close, 30715 onCancel: o.cancel, 30716 style: { 30717 "max-width": "100vw" 30718 } 30719 }, { 30720 actions: O(()=>[w(p, { 30721 onClick: o.save, 30722 primary: "" 30723 }, { 30724 default: O(()=>[ve(se(l.$t("save")), 1)]), 30725 _: 1 30726 }, 8, ["onClick"]), w(p, { 30727 onClick: o.cancel 30728 }, { 30729 default: O(()=>[ve(se(l.$t("cancel")), 1)]), 30730 _: 1 30731 }, 8, ["onClick"])]), 30732 default: O(()=>[_("div", null, [_("div", r8, [w(d, { 30733 label: o.t("fileName") 30734 }, { 30735 default: O(()=>[w(a, null, { 30736 default: O(()=>[w(i, { 30737 modelValue: s.fileName, 30738 "onUpdate:modelValue": e[0] || (e[0] = y=>s.fileName = y), 30739 class: "filename-input", 30740 placeholder: "untitled", 30741 spellcheck: "false", 30742 style: { 30743 "min-width": "100px" 30744 } 30745 }, null, 8, ["modelValue"]), w(r, { 30746 modelValue: s.fileType, 30747 "onUpdate:modelValue": e[1] || (e[1] = y=>s.fileType = y), 30748 class: "filetype-select", 30749 items: s.fileTypeItems, 30750 valueField: "value", 30751 labelField: "label" 30752 }, null, 8, ["modelValue", "items"])]), 30753 _: 1 30754 })]), 30755 _: 1 30756 }, 8, ["label"]), _("div", a8, [_("div", d8, [w(d, { 30757 label: o.t("width"), 30758 disabled: o.isFreeSize 30759 }, { 30760 default: O(({disabled: y})=>[w(u, { 30761 modelValue: s.imageWidth, 30762 "onUpdate:modelValue": e[2] || (e[2] = m=>s.imageWidth = m), 30763 disabled: y, 30764 min: 0, 30765 max: 4096, 30766 formatter: o.formatSize, 30767 parser: o.parseSize, 30768 onChange: o.updateRatio, 30769 class: "dimension-input" 30770 }, null, 8, ["modelValue", "disabled", "formatter", "parser", "onChange"])]), 30771 _: 1 30772 }, 8, ["label", "disabled"]), w(d, { 30773 label: o.t("height"), 30774 disabled: o.isFreeSize 30775 }, { 30776 default: O(({disabled: y})=>[w(u, { 30777 modelValue: s.imageHeight, 30778 "onUpdate:modelValue": e[3] || (e[3] = m=>s.imageHeight = m), 30779 disabled: y, 30780 min: 0, 30781 max: 4096, 30782 formatter: o.formatSize, 30783 parser: o.parseSize, 30784 onChange: e[4] || (e[4] = m=>o.updateRatio(!0)), 30785 class: "dimension-input" 30786 }, null, 8, ["modelValue", "disabled", "formatter", "parser"])]), 30787 _: 1 30788 }, 8, ["label", "disabled"])]), _("div", u8, [_("div", { 30789 class: Ne(["keep-ratio-indicator-top", { 30790 disabled: o.isFreeSize || !s.keepRatio 30791 }]) 30792 }, null, 2), w(h, { 30793 modelValue: s.keepRatio, 30794 "onUpdate:modelValue": e[5] || (e[5] = y=>s.keepRatio = y), 30795 disabled: o.isFreeSize, 30796 onChange: o.updateRatio 30797 }, { 30798 default: O(()=>[ve(se(o.t("keepRatio")), 1)]), 30799 _: 1 30800 }, 8, ["modelValue", "disabled", "onChange"]), _("div", { 30801 class: Ne(["keep-ratio-indicator-bottom", { 30802 disabled: o.isFreeSize || !s.keepRatio 30803 }]) 30804 }, null, 2)])]), _("div", { 30805 class: "fields-container", 30806 style: xe({ 30807 visibility: s.fileType === "svg" ? "visible" : "hidden" 30808 }) 30809 }, [w(d, { 30810 label: o.t("freeSize"), 30811 disabled: s.fileType !== "svg" 30812 }, { 30813 default: O(({disabled: y})=>[w(h, { 30814 modelValue: s.svgOptions.freeSize, 30815 "onUpdate:modelValue": e[6] || (e[6] = m=>s.svgOptions.freeSize = m), 30816 disabled: y 30817 }, null, 8, ["modelValue", "disabled"])]), 30818 _: 1 30819 }, 8, ["label", "disabled"])], 4), _("div", { 30820 class: "fields-container", 30821 style: xe([{ 30822 visibility: s.fileType === "svg" ? "visible" : "hidden" 30823 }, { 30824 gap: "0px" 30825 }]) 30826 }, [w(d, { 30827 label: l.$t("fileSaveDialog.svgType") 30828 }, { 30829 default: O(()=>[w(h, { 30830 modelValue: s.svgOptions.hyvectorSvg, 30831 "onUpdate:modelValue": e[7] || (e[7] = y=>s.svgOptions.hyvectorSvg = y), 30832 onChange: o.updateRatio 30833 }, { 30834 default: O(()=>[...e[9] || (e[9] = [ve(se("Include PIC.NET editor data"), -1)])]), 30835 _: 1 30836 }, 8, ["modelValue", "onChange"])]), 30837 _: 1 30838 }, 8, ["label"]), w(d, null, { 30839 default: O(()=>[w(h, { 30840 modelValue: s.svgOptions.inlineSvg, 30841 "onUpdate:modelValue": e[8] || (e[8] = y=>s.svgOptions.inlineSvg = y), 30842 onChange: o.updateRatio 30843 }, { 30844 default: O(()=>[...e[10] || (e[10] = [ve(se("Inline SVG"), -1)])]), 30845 _: 1 30846 }, 8, ["modelValue", "onChange"])]), 30847 _: 1 30848 })], 4), _("div", { 30849 class: "fields-container", 30850 style: xe({ 30851 visibility: s.fileType === "svg" ? "visible" : "hidden" 30852 }) 30853 }, [w(d, { 30854 label: "" 30855 }, { 30856 default: O(()=>[w(f, { 30857 label: o.t("moreOptions") 30858 }, { 30859 default: O(()=>[w(c, { 30860 svgOptions: s.svgOptions 30861 }, null, 8, ["svgOptions"])]), 30862 _: 1 30863 }, 8, ["label"])]), 30864 _: 1 30865 })], 4)])])]), 30866 _: 1 30867 }, 8, ["show", "title", "onClose", "onCancel"]) 30868} 30869const c8 = ie(o8, [["render", h8], ["__scopeId", "data-v-2ceba815"]]); 30870let mg, fd = Et({ 30871 show: !0, 30872 onCancel: ()=>fd.show = !1, 30873 onClose: ()=>fd.show = !1 30874}); 30875function f8() { 30876 mg == null && (mg = gs(c8, fd).instance), 30877 fd.show = !0 30878} 30879class p8 extends Ce { 30880 constructor() { 30881 super("saveFileAs") 30882 } 30883 performAction() { 30884 f8() 30885 } 30886} 30887let g8 = new p8; 30888async function tv() { 30889 let l = V() 30890 , e = { 30891 inlineSvg: !1, 30892 precision: 4 30893 } 30894 , t = l.activeDocument 30895 , n = 0 30896 , s = 0 30897 , o = t.getWidth() 30898 , i = t.getHeight() 30899 , r = l.selectedModels.slice(); 30900 if (r.length > 0) { 30901 r.sort((h,c)=>{ 30902 let f = h.getPathToRoot().reverse() 30903 , p = c.getPathToRoot().reverse() 30904 , g = Math.max(f.length, p.length); 30905 for (let y = 0; y < g; y++) 30906 if (f[y] !== p[y]) 30907 return y === 0 ? 0 : f[0] == null ? 1 : p[0] == null ? -1 : f[y - 1].getChildModelIndex(f[y]) - p[y - 1].getChildModelIndex(p[y]); 30908 return 0 30909 } 30910 ); 30911 let u = null; 30912 for (let h of r) { 30913 let c = h.getTransformedStrokeBounds(); 30914 u = u == null ? c : u.addRect(c) 30915 } 30916 if (u == null) 30917 return; 30918 n = u.x, 30919 s = u.y, 30920 o = u.width, 30921 i = u.height, 30922 e.viewBox = u.x + " " + u.y + " " + o + " " + i 30923 } else 30924 r = null; 30925 e.x = n, 30926 e.y = s, 30927 e.width = o, 30928 e.height = i; 30929 let a = !1 30930 , d = Jy(t, r, e); 30931 if (window.ClipboardItem) { 30932 let u = d.then(c=>Wd(c, null, o, i).then(async f=>new Promise(p=>f.toBlob(p)))) 30933 , h = d.then(c=>new Blob([c],{ 30934 type: "text/plain" 30935 })); 30936 try { 30937 let c = await navigator.clipboard.write([new window.ClipboardItem({ 30938 "image/png": u, 30939 "text/plain": h 30940 })]); 30941 a = !0 30942 } catch (c) { 30943 console.error(c) 30944 } 30945 } 30946 a || d.then(u=>kr(u)) 30947} 30948class m8 extends Ce { 30949 constructor() { 30950 super("copy") 30951 } 30952 performAction() { 30953 tv() 30954 } 30955} 30956class y8 extends Ce { 30957 constructor() { 30958 super("cut") 30959 } 30960 async performAction() { 30961 await tv(); 30962 let e = V() 30963 , t = ae(); 30964 t.startCompoundEdit(); 30965 let n = e.selectedModels.slice() 30966 , s = z(); 30967 s.setModelsSelected(null, n), 30968 s.removeModels(n), 30969 t.endCompoundEdit() 30970 } 30971} 30972let v8 = new m8 30973 , b8 = new y8; 30974const M8 = { 30975 name: "MessageDialog", 30976 components: { 30977 HyButton: nt, 30978 HyDialog: pn, 30979 HyField: js 30980 }, 30981 props: { 30982 title: { 30983 type: String, 30984 default: "" 30985 }, 30986 message: { 30987 type: String, 30988 default: "" 30989 }, 30990 show: { 30991 type: Boolean 30992 }, 30993 approve: { 30994 type: Function 30995 }, 30996 decline: { 30997 type: Function 30998 } 30999 }, 31000 data() { 31001 return {} 31002 }, 31003 methods: { 31004 close() { 31005 this?.approve() 31006 }, 31007 cancel() { 31008 this?.decline() 31009 } 31010 } 31011} 31012 , S8 = { 31013 class: "content-container" 31014}; 31015function w8(l, e, t, n, s, o) { 31016 const i = E("hy-button") 31017 , r = E("hy-dialog"); 31018 return N(), 31019 pe(r, { 31020 show: t.show, 31021 modal: "", 31022 title: t.title, 31023 onClose: o.close, 31024 onCancel: o.cancel 31025 }, {
31026 default: O(()=>[_("div", S8, se(t.message), 1)]), 31027 actions: O(()=>[w(i, { 31028 onClick: o.cancel 31029 }, { 31030 default: O(()=>[...e[0] || (e[0] = [ve("Cancel", -1)])]), 31031 _: 1 31032 }, 8, ["onClick"]), w(i, { 31033 onClick: o.close, 31034 primary: "" 31035 }, { 31036 default: O(()=>[...e[1] || (e[1] = [ve("OK", -1)])]), 31037 _: 1 31038 }, 8, ["onClick"])]), 31039 _: 1 31040 }, 8, ["show", "title", "onClose", "onCancel"]) 31041} 31042const P8 = ie(M8, [["render", w8], ["__scopeId", "data-v-1643aa64"]]); 31043class x8 extends Ce { 31044 constructor() { 31045 super("paste", !1) 31046 } 31047 performAction(e) { 31048 if (e != null && e.type === "paste" || navigator.clipboard && navigator.clipboard.read) { 31049 const n = V().activeDocument == null; 31050 return lv(e, n), 31051 !0 31052 } else 31053 return !1 31054 } 31055} 31056class C8 extends Ce { 31057 props = Et({ 31058 show: !0, 31059 title: "Warning", 31060 message: "Dismiss changes on current document?", 31061 approve: ()=>this.confirm(), 31062 decline: ()=>this.cancel() 31063 }); 31064 unmount; 31065 constructor() { 31066 super("pasteAsNew", !1) 31067 } 31068 performAction(e) { 31069 return navigator.clipboard && navigator.clipboard.read ? (this.showConfirmDialog(), 31070 !0) : !1 31071 } 31072 showConfirmDialog() { 31073 const e = gs(P8, this.props); 31074 this.unmount = e.unmount 31075 } 31076 cancel() { 31077 this.hideDialog() 31078 } 31079 confirm() { 31080 this.hideDialog(), 31081 lv(null, !0) 31082 } 31083 hideDialog() { 31084 this.unmount(), 31085 this.unmount = null 31086 } 31087} 31088async function lv(l, e) { 31089 let t = !1; 31090 try { 31091 if (l != null && l.type === "paste") { 31092 let n = l.clipboardData; 31093 if (!t) 31094 for (let s of n.items) 31095 s.type === "image/svg+xml" && console.warn("Handling of image/svg+xml not implemented due to lack of browser support."); 31096 if (!t) 31097 for (let s of n.items) 31098 s.type === "text/plain" && await new Promise(o=>{ 31099 s.getAsString(i=>{ 31100 zs(i).then(r=>{ 31101 if (e) 31102 yg(r); 31103 else { 31104 let a = V() 31105 , d = z() 31106 , u = d.insertDocumentModel(r); 31107 window.requestAnimationFrame(()=>{ 31108 d.setModelsSelected(u, a.selectedModels) 31109 } 31110 ) 31111 } 31112 t = !0, 31113 o() 31114 } 31115 ) 31116 } 31117 ) 31118 } 31119 ); 31120 if (!t) { 31121 for (let s of n.items) 31122 if (s.type === "image/png") { 31123 eh(s.getAsFile(), e), 31124 t = !0; 31125 break 31126 } 31127 } 31128 if (!t && n.files != null) 31129 for (let s of n.files) { 31130 let o = s.type; 31131 o === "image/png" && (eh(s, e), 31132 t = !0) 31133 } 31134 } else if (navigator.clipboard && navigator.clipboard.read) { 31135 let n = await navigator.clipboard.read().catch(s=>{ 31136 console.error(s) 31137 } 31138 ); 31139 if (n != null) 31140 for (let s of n) { 31141 let o = s.types; 31142 o != null && (o.includes("text/plain") && await s.getType("text/plain").then(i=>i.text()).then(i=>zs(i)).then(i=>{ 31143 if (e) 31144 yg(i); 31145 else { 31146 let r = V() 31147 , a = z() 31148 , d = a.insertDocumentModel(i); 31149 window.requestAnimationFrame(()=>{ 31150 a.setModelsSelected(d, r.selectedModels) 31151 } 31152 ) 31153 } 31154 t = !0 31155 } 31156 ), 31157 !t && o.includes("image/png") && s.getType("image/png").then(i=>{ 31158 eh(i, e), 31159 t = !0 31160 } 31161 )) 31162 } 31163 } 31164 } catch (n) { 31165 console.error(n) 31166 } 31167 return t 31168} 31169function yg(l) { 31170 let e = V(); 31171 z().setModelsSelected([], e.selectedModels), 31172 e.setActiveDocument(l), 31173 e.documentSettings.setSize(l.getWidth(), l.getHeight()); 31174 let n = Kd(l.getWidth(), l.getHeight()) 31175 , s = e.appSettings;
31176 s.editor.grid.gridX = n, 31177 s.editor.grid.gridY = n, 31178 ae().reset() 31179} 31180function eh(l, e) { 31181 let t = new FileReader; 31182 t.addEventListener("load", async function() { 31183 let n = new Fo; 31184 await n.setImageDataUrl(this.result); 31185 let s = V() 31186 , o = z(); 31187 o.insertModels([n]), 31188 o.setModelsSelected([n], s.selectedModels) 31189 }, !1), 31190 t.readAsDataURL(l) 31191} 31192const _8 = new x8 31193 , T8 = new C8; 31194class k8 extends Ce { 31195 constructor() { 31196 super("print") 31197 } 31198 performAction() { 31199 let e = 1024 31200 , n = V().activeDocument 31201 , s = n.getWidth() 31202 , o = n.getHeight() 31203 , i = Math.min(e / n.getWidth(), e / n.getHeight()) 31204 , r = new XMLSerializer().serializeToString(n.baseElement); 31205 Wd(r, null, s * i, o * i).then(a=>{ 31206 a.style.setProperty("width", "100%"), 31207 a.style.setProperty("object-fit", "contain"), 31208 document.getElementById("print-content").appendChild(a), 31209 window.setTimeout(()=>{ 31210 document.addEventListener("pointerdown", ()=>{ 31211 a.remove(), 31212 a = null 31213 } 31214 , { 31215 once: !0 31216 }), 31217 window.print() 31218 } 31219 , 50) 31220 } 31221 ) 31222 } 31223} 31224const E8 = new k8 31225 , D8 = { 31226 name: "HyLabel", 31227 props: { 31228 label: String, 31229 disabled: Boolean 31230 } 31231} 31232 , O8 = { 31233 style: { 31234 display: "flex", 31235 "align-items": "center", 31236 gap: "8px" 31237 } 31238}; 31239function A8(l, e, t, n, s, o) { 31240 return N(), 31241 $("div", O8, [_("div", { 31242 class: Ne(["hy-label", { 31243 "hy-label-disabled": t.disabled 31244 }]) 31245 }, se(t.label), 3), vt(l.$slots, "default", { 31246 disabled: t.disabled 31247 })]) 31248} 31249const Bn = ie(D8, [["render", A8]]) 31250 , I8 = function({style: l}, {value: e}) { 31251 l.visibility = e ? "" : "hidden" 31252} 31253 , L8 = { 31254 name: "HyList", 31255 props: { 31256 modelValue: null, 31257 items: { 31258 type: Array, 31259 default: ()=>[] 31260 }, 31261 labelField: String, 31262 valueField: String, 31263 disabled: Boolean 31264 }, 31265 computed: { 31266 selIndex() { 31267 return this.items.findIndex(l=>this.getItemValue(l) === this.modelValue) 31268 }, 31269 selItem() { 31270 return this.items ? this.items[this.selIndex] : null 31271 }, 31272 labelWidth() { 31273 let l = 0; 31274 if (this.isMounted) { 31275 let e = this.$refs.label; 31276 for (let t of this.items) { 31277 let n = this.getItemLabel(t); 31278 l = Math.max(l, Dm(e, n)) 31279 } 31280 } 31281 return l 31282 } 31283 }, 31284 emits: ["update:modelValue"], 31285 methods: { 31286 getItemLabel(l) { 31287 let e = this.labelField; 31288 return l == null ? "" : e ? l[e] : "" + l 31289 }, 31290 getItemValue(l) { 31291 let e = this.valueField; 31292 return l == null ? null : e ? l[e] : l 31293 }, 31294 selectItem(l) { 31295 this.$emit("update:modelValue", this.getItemValue(l)) 31296 }, 31297 onItemPointerdown(l, e) { 31298 this.selectItem(e) 31299 }, 31300 onKeydown(l) { 31301 if (!l.defaultPrevented) { 31302 let e = !1 31303 , t = l.key; 31304 if (t === " " || t === Qr) 31305 this.listOpen ? (this.setListOpen(!1), 31306 e = !0) : t === " " && (this.listOpen = !0, 31307 e = !0); 31308 else if (t === $s) 31309 this.listOpen && (this.setListOpen(!1), 31310 e = !0); 31311 else if (t === hn || t === cs) { 31312 let n = this.items; 31313 if (n.length > 1) { 31314 let s = this.selIndex; 31315 t === hn ? s = s <= 0 ? n.length - 1 : s - 1 : s = s >= n.length - 1 ? 0 : s + 1, 31316 this.selectItem(n[s]), 31317 e = !0 31318 } 31319 } 31320 e && l.preventDefault() 31321 } 31322 }, 31323 onPointerdownOutside(l) { 31324 this.listOpen = !1, 31325 l.preventDefault() 31326 } 31327 } 31328} 31329 , V8 = { 31330 class: "hy-list hy-notouch-scrollable" 31331} 31332 , N8 = ["onPointerdown"] 31333 , R8 = ["onPointerdown"]; 31334function F8(l, e, t, n, s, o) { 31335 return N(), 31336 $("ul", V8, [l.$slots.default ? (N(!0), 31337 $(Pe, { 31338 key: 0 31339 }, Gt(t.items, i=>(N(), 31340 $("li", { 31341 key: i, 31342 class: Ne(["hy-list-item", { 31343 "hy-list-item-selected": i === o.selItem 31344 }]), 31345 onPointerdown: r=>o.onItemPointerdown(r, i) 31346 }, [vt(l.$slots, "default", {
31347 value: o.getItemValue(i), 31348 item: i 31349 })], 42, N8))), 128)) : (N(!0), 31350 $(Pe, { 31351 key: 1 31352 }, Gt(t.items, i=>(N(), 31353 $("li", { 31354 key: i, 31355 class: Ne(["hy-list-item", { 31356 "hy-list-item-selected": i === o.selItem 31357 }]), 31358 onPointerdown: r=>o.onItemPointerdown(r, i) 31359 }, se(o.getItemLabel(i)), 43, R8))), 128))]) 31360} 31361const B8 = ie(L8, [["render", F8]]) 31362 , z8 = { 31363 name: "HySwitch", 31364 props: { 31365 modelValue: { 31366 type: Boolean, 31367 default: !1 31368 }, 31369 disabled: Boolean, 31370 name: String, 31371 type: String, 31372 inputStyle: String 31373 }, 31374 data() { 31375 return { 31376 focus: !1, 31377 downX: null, 31378 downTime: null, 31379 dragged: !1 31380 } 31381 }, 31382 emits: ["update:modelValue", "change"], 31383 unmounted() { 31384 this.removeDragListeners() 31385 }, 31386 methods: { 31387 handleChange(l) { 31388 let e = l.target.checked; 31389 this.$emit("update:modelValue", e, l), 31390 this.$emit("change", l) 31391 }, 31392 setChecked(l) { 31393 l !== this.modelValue && this.$emit("update:modelValue", l) 31394 }, 31395 onPointerdown(l) { 31396 this.downX = l.clientX, 31397 this.downTime = performance.now(), 31398 this.dragged = !1, 31399 this.addDragListeners() 31400 }, 31401 onPointermove(l) { 31402 if (this.downX == null) 31403 return; 31404 let e = this.$refs.input 31405 , t = e.getBoundingClientRect() 31406 , n = t.height 31407 , s = l.clientX - t.x 31408 , o = Math.max(0, Math.min(t.width - n, s - n / 2)); 31409 e.style.setProperty("padding-left", o + "px"), 31410 Math.abs(l.clientX - this.downX) > 1 && performance.now() - this.downTime > 150 && (this.setChecked(s > t.width / 2), 31411 this.dragged = !0) 31412 }, 31413 onPointerup(l) { 31414 let e = this.$refs.input; 31415 if (e.style.removeProperty("padding-left"), 31416 this.dragged) { 31417 let t = e.getBoundingClientRect() 31418 , n = l.clientX - t.x; 31419 this.setChecked(n > t.width / 2) 31420 } 31421 this.downX = null, 31422 this.removeDragListeners() 31423 }, 31424 onClick(l) { 31425 this.dragged && l.preventDefault(), 31426 l.stopPropagation() 31427 }, 31428 addDragListeners() { 31429 document.addEventListener("pointermove", this.onPointermove), 31430 document.addEventListener("pointerup", this.onPointerup), 31431 document.addEventListener("pointercancel", this.onPointerup) 31432 }, 31433 removeDragListeners() { 31434 document.removeEventListener("pointermove", this.onPointermove), 31435 document.removeEventListener("pointerup", this.onPointerup), 31436 document.removeEventListener("pointercancel", this.onPointerup) 31437 } 31438 } 31439} 31440 , U8 = ["checked", "name"]; 31441function G8(l, e, t, n, s, o) { 31442 return N(), 31443 $("label", { 31444 onClick: e[4] || (e[4] = (...i)=>o.onClick && o.onClick(...i)), 31445 class: Ne(["hy-element hy-switch", { 31446 "hy-disabled": t.disabled, 31447 "hy-selected": t.modelValue 31448 }]) 31449 }, [_("input", { 31450 ref: "input", 31451 class: "hy-switch-input", 31452 style: xe(t.inputStyle), 31453 type: "checkbox", 31454 checked: t.modelValue, 31455 name: t.name, 31456 role: "switch", 31457 onPointerdown: e[0] || (e[0] = (...i)=>o.onPointerdown && o.onPointerdown(...i)), 31458 onChange: e[1] || (e[1] = (...i)=>o.handleChange && o.handleChange(...i)), 31459 onFocus: e[2] || (e[2] = i=>s.focus = !0), 31460 onBlur: e[3] || (e[3] = i=>s.focus = !1) 31461 }, null, 44, U8)], 2) 31462} 31463const nv = ie(z8, [["render", G8]]) 31464 , H8 = { 31465 name: "PrivacySettingsItem", 31466 components: { 31467 HyScrollview: $o, 31468 HySwitch: nv 31469 }, 31470 props: { 31471 name: String, 31472 selName: String, 31473 defaultExpanded: Boolean, 31474 alwaysEnabled: Boolean 31475 }, 31476 emits: ["selected"], 31477 computed: { 31478 enabled: { 31479 get() {
31480 return this.alwaysEnabled ? !0 : V().appSettings.privacy[this.name] 31481 }, 31482 set(l) { 31483 this.alwaysEnabled || (V().appSettings.privacy[this.name] = l) 31484 } 31485 } 31486 }, 31487 methods: { 31488 onClick() { 31489 this.$emit("selected", this.selName === this.name ? null : this.name) 31490 } 31491 } 31492} 31493 , $8 = { 31494 class: "arrow" 31495} 31496 , X8 = ["innerHTML"]; 31497function Y8(l, e, t, n, s, o) { 31498 const i = E("hy-switch") 31499 , r = E("hy-scrollview"); 31500 return N(), 31501 $(Pe, null, [_("div", { 31502 class: "header", 31503 onClick: e[1] || (e[1] = (...a)=>o.onClick && o.onClick(...a)) 31504 }, [_("div", $8, [(N(), 31505 $("svg", { 31506 viewBox: "0 0 16 16", 31507 width: "24", 31508 height: "24", 31509 style: xe([{ 31510 display: "block" 31511 }, { 31512 transform: "rotate(" + (t.selName === t.name ? 90 : 0) + "deg)" 31513 }]) 31514 }, [...e[2] || (e[2] = [_("path", { 31515 d: "M6.3 5.7c-0.4-0.4-0.4-1 0-1.4 0.4-0.4 1-0.4 1.4 0l3 3c0.4 0.4 0.4 1 0 1.4l-3 3c-0.4 0.4-1 0.4-1.4 0-0.4-0.4-0.4-1 0-1.4l2.3-2.3-2.3-2.3z", 31516 fill: "currentColor", 31517 opacity: "0.6" 31518 }, null, -1)])], 4))]), ve(" " + se(l.$t("privacySettings." + t.name + ".title")) + " ", 1), w(i, { 31519 modelValue: o.enabled, 31520 "onUpdate:modelValue": e[0] || (e[0] = a=>o.enabled = a), 31521 inputStyle: "background:" + (o.enabled ? "rgb(133, 224, 144)" : "rgb(255, 125, 144)"), 31522 style: { 31523 "margin-left": "auto" 31524 } 31525 }, null, 8, ["modelValue", "inputStyle"])]), t.selName === t.name ? (N(), 31526 pe(r, { 31527 key: 0, 31528 class: "content" 31529 }, {
31530 default: O(()=>[_("div", { 31531 innerHTML: l.$t("privacySettings." + t.name + ".html") 31532 }, null, 8, X8)]), 31533 _: 1 31534 })) : be("", !0)], 64) 31535} 31536const sv = ie(H8, [["render", Y8], ["__scopeId", "data-v-2c5e0195"]]) 31537 , K8 = { 31538 name: "SettingsDialog", 31539 components: { 31540 PrivacySettingsItem: sv, 31541 SvgIcon: gt, 31542 HyList: B8, 31543 HySelect: Dl, 31544 HyLabel: Bn, 31545 HyButton: nt, 31546 HyCheckbox: ml, 31547 HyDialog: pn 31548 }, 31549 props: { 31550 show: { 31551 type: Boolean, 31552 default: !1 31553 } 31554 }, 31555 data() { 31556 return { 31557 settings: null, 31558 selGroup: null, 31559 groups: me([{ 31560 name: "general", 31561 svg: P2 31562 }, { 31563 name: "ui", 31564 svg: x2 31565 }]) 31566 } 31567 }, 31568 directives: { 31569 Visible: I8 31570 }, 31571 beforeMount() { 31572 this.updateSettingsFromStore(), 31573 this.selGroup = this.groups[0].name 31574 }, 31575 methods: { 31576 updateSettingsFromStore() { 31577 this.settings = JSON.parse(JSON.stringify(this.$store.a
31577ppSettings)) 31578 }, 31579 cancel() { 31580 this.$emit("close") 31581 }, 31582 close() { 31583 let l = JSON.parse(JSON.stringify(this.settings)); 31584 Object.assign(this.$store.appSettings, l), 31585 this.$emit("close") 31586 } 31587 }, 31588 watch: { 31589 show(l) { 31590 l && this.updateSettingsFromStore() 31591 } 31592 } 31593} 31594 , W8 = { 31595 class: "content" 31596} 31597 , q8 = { 31598 class: "list-container" 31599} 31600 , j8 = { 31601 class: "nav-item" 31602} 31603 , J8 = { 31604 style: { 31605 display: "grid", 31606 "min-width": "200px", 31607 "min-height": "120px", 31608 padding: "32px 32px 16px" 31609 } 31610} 31611 , Z8 = { 31612 style: { 31613 "grid-area": "1 / 1", 31614 display: "flex", 31615 "flex-direction": "column", 31616 padding: "0 16px", 31617 gap: "16px" 31618 } 31619} 31620 , Q8 = { 31621 style: { 31622 "grid-area": "1 / 1", 31623 display: "flex", 31624 "flex-direction": "column", 31625 padding: "0 16px", 31626 gap: "16px" 31627 } 31628} 31629 , ek = { 31630 style: { 31631 "grid-area": "1 / 1", 31632 display: "flex", 31633 "flex-direction": "column", 31634 padding: "0 16px", 31635 gap: "16px" 31636 } 31637}; 31638function tk(l, e, t, n, s, o) { 31639 const i = E("svg-icon") 31640 , r = E("hy-list") 31641 , a = E("hy-select") 31642 , d = E("hy-label") 31643 , u = E("hy-checkbox") 31644 , h = E("privacy-settings-item") 31645 , c = E("hy-button") 31646 , f = E("hy-dialog") 31647 , p = Gd("visible"); 31648 return N(), 31649 pe(f, { 31650 show: t.show, 31651 modal: "", 31652 title: l.$t("dialogs.settings.settings"), 31653 primaryPos: "center", 31654 secondaryPos: "center", 31655 onClose: o.close, 31656 onCancel: o.cancel 31657 }, { 31658 actions: O(()=>[w(c, { 31659 onClick: o.close, 31660 primary: "" 31661 }, { 31662 default: O(()=>[ve(se(l.$t("ok")), 1)]), 31663 _: 1 31664 }, 8, ["onClick"]), w(c, { 31665 onClick: o.cancel 31666 }, { 31667 default: O(()=>[ve(se(l.$t("cancel")), 1)]), 31668 _: 1 31669 }, 8, ["onClick"])]), 31670 default: O(()=>[_("div", W8, [_("div", q8, [w(r, { 31671 items: s.groups, 31672 modelValue: s.selGroup, 31673 "onUpdate:modelValue": e[0] || (e[0] = g=>s.selGroup = g), 31674 "value-field": "name", 31675 style: { 31676 height: "180px", 31677 "padding-top": "24px" 31678 } 31679 }, { 31680 default: O(({item: g})=>[_("div", j8, [w(i, { 31681 svg: g.svg 31682 }, null, 8, ["svg"]), _("span", null, se(l.$t("dialogs.settings." + g.name)), 1)])]), 31683 _: 1 31684 }, 8, ["items", "modelValue"])]), _("div", J8, [wl((N(), 31685 $("div", Z8, [w(d, { 31686 label: l.$t("language") 31687 }, { 31688 default: O(()=>[w(a, { 31689 items: ["de", "en", "zh"], 31690 modelValue: s.settings.general.language, 31691 "onUpdate:modelValue": e[1] || (e[1] = g=>s.settings.general.language = g) 31692 }, null, 8, ["modelValue"])]), 31693 _: 1 31694 }, 8, ["label"])])), [[p, s.selGroup === "general"]]), wl((N(), 31695 $("div", Q8, [w(u, { 31696 modelValue: s.settings.ui.showRulers, 31697 "onUpdate:modelValue": e[2] || (e[2] = g=>s.settings.ui.showRulers = g) 31698 }, { 31699 default: O(()=>[ve(se(l.$t("actions.toggleRulers")), 1)]), 31700 _: 1 31701 }, 8, ["modelValue"]), w(u, { 31702 modelValue: s.settings.ui.showTooltips, 31703 "onUpdate:modelValue": e[3] || (e[3] = g=>s.settings.ui.showTooltips = g) 31704 }, { 31705 default: O(()=>[ve(se(l.$t("actions.toggleTooltips")), 1)]), 31706 _: 1 31707 }, 8, ["modelValue"]), w(u, { 31708 modelValue: s.settings.ui.darkMode.isDark, 31709 "onUpdate:modelValue": e[4] || (e[4] = g=>s.settings.ui.darkMode.isDark = g) 31710 }, { 31711 default: O(()=>[ve(se(l.$t("actions.toggleDarkMode")), 1)]), 31712 _: 1 31713 }, 8, ["modelValue"])])), [[p, s.selGroup === "ui"]]), wl((N(), 31714 $("div", ek, [(N(!0), 31715 $(Pe, null, Gt(s.settings.privacy, (g,y)=>(N(), 31716 pe(h, { 31717 name: y 31718 }, null, 8, ["name"]))), 256))])), [[p, s.selGroup === "privacy"]])])])]), 31719 _: 1 31720 }, 8, ["show", "title", "onClose", "onCancel"]) 31721} 31722const lk = ie(K8, [["render", tk], ["__scopeId", "data-v-408e1307"]]); 31723let vg, pd = Et({ 31724 show: !0, 31725 onCancel: ()=>pd.show = !1, 31726 onClose: ()=>pd.show = !1 31727}); 31728function nk() { 31729 vg == null && (vg = gs(lk, pd).instance), 31730 pd.show = !0 31731} 31732class sk extends Ce { 31733 constructor() { 31734 super("settings", !1) 31735 } 31736 performAction() { 31737 nk() 31738 } 31739} 31740let ok = new sk; 31741class ik extends Ce { 31742 constructor() { 31743 super("selectAll", !0), 31744 Ie(()=>V().activeDocument?.getChildModels().length, e=>{ 31745 this.disabled = (e ?? 0) === 0 31746 } 31747 ) 31748 } 31749 performAction(e) { 31750 if (e && e.defaultPrevented) 31751 return; 31752 let t = V() 31753 , n = z() 31754 , s = V().tool; 31755 if (s && s.name === "nodes") { 31756 let o = n.getSelectedModelsNodePoints(); 31757 n.setNodePointsSelected(o) 31758 } else { 31759 let o = t.activeDocument.getChildModels(); 31760 n.setModelsSelected(o, null) 31761 } 31762 } 31763} 31764const ov = new ik; 31765class rk extends Ce { 31766 constructor() { 31767 super("selectNone", !0), 31768 Ie(V().selectedModels, e=>{ 31769 this.disabled = e.length === 0 31770 } 31771 ) 31772 } 31773 performAction(e) { 31774 if (e && e.defaultPrevented) 31775 return; 31776 let t = V() 31777 , n = z() 31778 , s = V().tool; 31779 s && s.name === "nodes" ? n.sortedSelNodePoints.length > 0 && n.setNodePointsSelected(null, n.sortedSelNodePoints) : t.selectedModels && n.setModelsSelected(null, t.selectedModels) 31780 } 31781} 31782const iv = new rk; 31783class ak extends Ce { 31784 constructor() { 31785 super("toPath", !0), 31786 Ie(V().selectedModels, e=>{ 31787 this.disabled = e.length < 1 31788 } 31789 ) 31790 } 31791 async performAction() { 31792 z().convertSelectionToPath(); 31793 let t = V() 31794 , n = t.tool.name; 31795 n !== "selection" && n !== "nodes" && n !== "shape" && t.setTool("selection") 31796 } 31797} 31798let dk = new ak; 31799class pi extends Ue { 31800 _paintTarget; 31801 _models; 31802 _oldPaints; 31803 _newPaints; 31804 constructor(e, t, n) { 31805 super(), 31806 this._paintTarget = e, 31807 this._models = t, 31808 this._oldPaints = n 31809 } 31810 async undo() { 31811 let e = this._paintTarget; 31812 this._newPaints == null && (this._newPaints = this._models.map(n=>n.getPaint(e))), 31813 z().setModelsPaint(this._models, this._oldPaints, e), 31814 V().updateSelectionStyle(!0, !0, !1) 31815 } 31816 async redo() { 31817 let e = this._paintTarget; 31818 z().setModelsPaint(this._models, this._newPaints, e), 31819 V().updateSelectionStyle(e === "fill", e === "stroke", !1) 31820 } 31821 addEdit(e) { 31822 if (this.isClosed || !(e instanceof pi) || e._paintTarget !== this._paintTarget || e._models.length !== this._models.length) 31823 return !1; 31824 for (let t = 0; t < this._models.length; t++) 31825 if (this._models[t] !== e._models[t]) 31826 return !1; 31827 return !0 31828 } 31829} 31830function bg(l, e, t, n=0, s="round", o="round", i=4) { 31831 let r = l.getCurves().map(y=>y.v), a; 31832 t == null || t.length === 0 ? a = [] : a = t.split(" ").map(y=>Ee(1e-6, parseFloat(y))); 31833 let d = a.length 31834 , u = 0 31835 , h = a[0]; 31836 for (; n > 0; ) { 31837 let y = a.reduce((m,b)=>m + b, 0); 31838 n %= y, 31839 h > n ? (h -= n, 31840 n = 0) : (n -= h, 31841 u = (u + 1) % d, 31842 h = a[u]) 31843 }
31844 let c = [] 31845 , f = []; 31846 if (a.length === 0) 31847 c = [r]; 31848 else { 31849 for (let y of r) { 31850 let m = 1e-8 31851 , b = o2(y) 31852 , M = 0 31853 , S = 0; 31854 for (; S < 1; ) { 31855 let x; 31856 M + h >= b - m ? (x = 1, 31857 u % 2 === 0 && f.push(Ln(y, S, x)), 31858 h -= b - M, 31859 h < m && (u = (u + 1) % d, 31860 h = a[u])) : (M += h, 31861 x = Aw(y, M, { 31862 nPoints: 8, 31863 tolerance: 1e-4 31864 }), 31865 u % 2 === 0 && f.push(Ln(y, S, x)), 31866 u = (u + 1) % d, 31867 h = a[u], 31868 c.push(f), 31869 f = []), 31870 S = x 31871 } 31872 } 31873 f.length > 0 && c.push(f) 31874 } 31875 let p = e / 2 31876 , g = []; 31877 for (let y of c) 31878 if (y && y.length > 0) { 31879 let m = new ft(y.map(b=>new Mt(b)),!1); 31880 g.push(...Bo([m], p, null, !1, s, o, i) || []) 31881 } 31882 return g 31883} 31884function uk(l) { 31885 const e = l instanceof Rn; 31886 let t = !1; 31887 if (e) { 31888 for (let s of l.getTextSpanModels()) 31889 if (s.getStrokeStyle()?.width > 0 && s.getStrokePaint() != null) { 31890 t = !0; 31891 break 31892 } 31893 } else 31894 t = l.getStrokeStyle()?.width > 0 && l.getStrokePaint() != null; 31895 let n = []; 31896 if (t) { 31897 let s = l.getParentModel() 31898 , o = l.getAggregateTransform() 31899 , i = e ? l.getPathDataArray(o, -1).map(a=>Xl(a.join(""))) : [l.getPaths(o, -1)] 31900 , r = e ? l.getTextSpanModels() : [l]; 31901 for (let a = 0; a < r.length; a++) { 31902 let d = r[a] 31903 , u = i[a]; 31904 if (e && !(d.getStrokeStyle()?.width > 0 && d.getStrokePaint() != null)) 31905 continue; 31906 let h = d.getStrokePaint() 31907 , c = d.getStrokeStyle() 31908 , f = c.width 31909 , p = c.linecap 31910 , g = c.linejoin 31911 , y = c.miterlimit 31912 , m = [] 31913 , b = u.filter(x=>x.isClosed()); 31914 if (b.length > 0) { 31915 if (c.calcDasharray.length === 0) { 31916 b = xo(b); 31917 let x = Bo(b, f / 2, null, !1, p, g, y) 31918 , P = Bo(b, -f / 2, null, !1, p, g, y); 31919 m.push(...lu(x, P)) 31920 } else 31921 m = b.reduce((x,P)=>x.concat(bg(P, f, c.calcDasharray, c.getCalcDashoffset(), p, g, y)), []); 31922 m.forEach(x=>x.applyTransform(s.getAggregateTransform().invert())) 31923 } 31924 let M = u.filter(x=>!x.isClosed()); 31925 M.length > 0 && (m = M.reduce((x,P)=>x.concat(bg(P, f, c.calcDasharray, c.getCalcDashoffset(), p, g, y)), [])); 31926 let S = new bt(m); 31927 S.setFillPaint(h.clone()), 31928 S.setStrokePaint(null), 31929 n.push(S) 31930 } 31931 } 31932 return n 31933} 31934class hk extends Ce { 31935 constructor() { 31936 super("strokeToPath", !0), 31937 Ie(V().selectedModels, e=>{ 31938 this.disabled = e.length < 1 31939 } 31940 ) 31941 } 31942 performAction() { 31943 let e = V() 31944 , t = z() 31945 , n = ae(); 31946 n.startCompoundEdit(); 31947 let s = e.selectedModels.slice() 31948 , o = [] 31949 , i = [] 31950 , r = Ke(s); 31951 for (let a of r) { 31952 let d = uk(a); 31953 if (d?.length > 0) { 31954 let u = a.getParentModel() 31955 , h = u.getChildModelIndex(a); 31956 t.insertModelsAt(d, u, h + 1), 31957 d.push(...d), 31958 o.push(a) 31959 } 31960 } 31961 if (o.length > 0) { 31962 let a = o.map(u=>u.getStrokePaint()); 31963 o.forEach(u=>u.setStrokePaint(null)); 31964 let d = new pi("stroke",o,a); 31965 n.addEdit(d) 31966 } 31967 n.endCompoundEdit(), 31968 i.length > 0 && t.setModelsSelected(i, s) 31969 } 31970} 31971let ck = new hk; 31972const fk = { 31973 name: "AboutDialog", 31974 components: { 31975 HyButton: nt, 31976 HyDialog: pn 31977 }, 31978 props: { 31979 show: Boolean 31980 }, 31981 computed: { 31982 version() { 31983 let l = "0.9.25".split("."); 31984 return l[0] === "0" ? "1.0 beta " + l[1] : l[0] + "." + l[1] 31985 }, 31986 build() { 31987 return "0.9.25" 31988 } 31989 }, 31990 emits: ["close"], 31991 methods: { 31992 close() { 31993 this.$emit("close", {}) 31994 } 31995 } 31996} 31997 , pk = { 31998 style: { 31999 display: "flex", 32000 "flex-direction": "column", 32001 "align-items": "center" 32002 } 32003} 32004 , gk = { 32005 class: "content-container" 32006} 32007 , mk = { 32008 class: "text-container" 32009} 32010 , yk = { 32011 style: { 32012 "margin-bottom": "32px" 32013 } 32014}; 32015function vk(l, e, t, n, s, o) { 32016 const i = E("hy-button") 32017 , r = E("hy-dialog"); 32018 return N(), 32019 pe(r, { 32020 show: t.show, 32021 modal: "", 32022 title: l.$t("dialogs.about.aboutHyvector"), 32023 onClose: e[0] || (e[0] = a=>l.$emit("close")), 32024 onCancel: e[1] || (e[1] = a=>l.$emit("close")) 32025 }, {
32026 default: O(()=>[_("div", pk, [_("div", gk, [e[5] || (e[5] = _("div", { 32027 class: "logo-container" 32028 }, [_("svg", { 32029 xmlns: "http://www.w3.org/2000/svg", 32030 width: "128", 32031 height: "128", 32032 viewBox: "0 0 32 32" 32033 }, [_("defs", null, [_("linearGradient", { 32034 gradientUnits: "userSpaceOnUse", 32035 id: "y9eUYKDT", 32036 x1: "33.14", 32037 y1: "31.65", 32038 x2: "16.89", 32039 y2: "11.44", 32040 gradientTransform: "scale(0.99989152, 1.0766625)" 32041 }, [_("stop", { 32042 offset: "0", 32043 "stop-color": "#00daab" 32044 }), _("stop", { 32045 offset: "0.6280934997612081", 32046 "stop-color": "#15a8e5" 32047 }), _("stop", { 32048 offset: "1", 32049 "stop-color": "#0a6fff" 32050 })]), _("linearGradient", { 32051 gradientUnits: "userSpaceOnUse", 32052 id: "fgVCuIqp", 32053 x1: "32.88", 32054 y1: "31.57", 32055 x2: "16.21", 32056 y2: "10.6", 32057 gradientTransform: "scale(0.99989152, 1.0766625)" 32058 }, [_("stop", { 32059 offset: "0", 32060 "stop-color": "#ffa84b" 32061 }), _("stop", { 32062 offset: "0.5778150013514928", 32063 "stop-color": "#ff5252" 32064 }), _("stop", { 32065 offset: "1", 32066 "stop-color": "#fe3f95" 32067 })]), _("linearGradient", { 32068 gradientUnits: "userSpaceOnUse", 32069 id: "RIVfy5GW", 32070 x1: "13.51", 32071 y1: "11.74", 32072 x2: "22.45", 32073 y2: "34.37", 32074 gradientTransform: "scale(0.99989152, 1.0766625)" 32075 }, [_("stop", { 32076 offset: "0", 32077 "stop-color": "#0a6fff" 32078 }), _("stop", { 32079 offset: "0.4523188366588331", 32080 "stop-color": "#d569e7" 32081 }), _("stop", { 32082 offset: "0.652049114833548", 32083 "stop-color": "#e462fd" 32084 }), _("stop", { 32085 offset: "1", 32086 "stop-color": "#ff3e91" 32087 })]), _("linearGradient", { 32088 gradientUnits: "userSpaceOnUse", 32089 id: "bV2PvCjG", 32090 x1: "22.63", 32091 y1: "33.5", 32092 x2: "14.73", 32093 y2: "10.38", 32094 gradientTransform: "scale(0.99989152, 1.0766625)" 32095 }, [_("stop", { 32096 offset: "0", 32097 "stop-color": "#0a6fff" 32098 }), _("stop", { 32099 offset: "0.3635292870657785", 32100 "stop-color": "#d569e7" 32101 }), _("stop", { 32102 offset: "0.652049114833548", 32103 "stop-color": "#e462fd" 32104 }), _("stop", { 32105 offset: "1", 32106 "stop-color": "#ff3e91" 32107 })])]), _("path", { 32108 style: { 32109 fill: "none", 32110 stroke: 'url("#y9eUYKDT")' 32111 }, 32112 "stroke-width": "3.9974163114190104", 32113 "stroke-linecap": "round", 32114 "stroke-linejoin": "round", 32115 d: "M16.17 10.73c1.89 1.37 3.75 3.36 5.75 3.36 1.75 0 4.16-2.13 6.09-3.43 2.03-1.36 4.91 0.13 4.91 2.98v21.5", 32116 transform: "translate(-2.91511571, -8.13873366)" 32117 }), _("path", { 32118 style: { 32119 fill: "none", 32120 stroke: 'url("#fgVCuIqp")' 32121 }, 32122 "stroke-width": "3.9974163114190104", 32123 "stroke-linecap": "round", 32124 "stroke-linejoin": "round", 32125 d: "M16.17 10.63c1.89 1.35 3.75 3.32 5.75 3.32 1.75 0 4.16-2.03 6.09-3.33 2.03-1.34 4.89 0.14 4.89 2.95v21.46", 32126 transform: "translate(34.90470655, 40.03233005) rotate(180)" 32127 }), _("path", { 32128 style: { 32129 fill: "none", 32130 stroke: 'url("#RIVfy5GW")' 32131 }, 32132 "stroke-width": "3.9974163114190104", 32133 "stroke-linecap": "round", 32134 "stroke-linejoin": "round", 32135 d: "M15.85 10.72c-2.33-1.76-5.67 0.36-4.92 4.12l1.41 5.25c0.99 2.6 2.3 4.01 4.91 4.01h1.34", 32136 transform: "translate(-2.59313178, -8.09256118)" 32137 }), _("path", { 32138 style: { 32139 fill: "none", 32140 stroke: 'url("#bV2PvCjG")' 32141 }, 32142 "stroke-width": "3.9974163114190104", 32143 "stroke-linecap": "round", 32144 "stroke-linejoin": "round", 32145 d: "M15.85 10.72c-2.33-1.76-5.67 0.36-4.92 4.12l1.41 5.25c0.99 2.6 2.3 4.01 4.91 4.01h1.34", 32146 transform: "translate(34.58271956, 40.08562249) rotate(180)" 32147 })])], -1)), _("div", mk, [e[2] || (e[2] = _("h1", null, "PIC.NET", -1)), _("p", null, "v" + se(o.version) + " (build " + se(o.build) + ")", 1), e[3] || (e[3] = _("p", { 32148 class: "copyright" 32149 }, [_("span", { 32150 style: { 32151 "white-space": "nowrap" 32152 } 32153 }, "Copyright 2019-2026"), ve(), _("span", { 32154 style: { 32155 "white-space": "nowrap" 32156 } 32157 }, "PIC.NET")], -1)), e[4] || (e[4] = _("p", null, [_("br"), ve(" Please report bugs and request features at "), _("br"), _("a", { 32158 target: "_new", 32159 rel: "noopener noreferrer", 32160 href: "https://www.pic.net" 32161 }, "PIC.NET")], -1))])]), _("div", yk, [w(i, { 32162 primary: "", 32163 onClick: o.close 32164 }, { 32165 default: O(()=>[ve(se(l.$t("ok")), 1)]), 32166 _: 1 32167 }, 8, ["onClick"])])])]), 32168 _: 1 32169 }, 8, ["show", "title"]) 32170} 32171const bk = ie(fk, [["render", vk], ["__scopeId", "data-v-1db8eb9f"]]); 32172let Mg, wc = Et({ 32173 show: !0, 32174 onClose: ()=>wc.show = !1 32175}); 32176class Mk extends Ce { 32177 constructor() { 32178 super("showAbout", !1) 32179 } 32180 performAction() { 32181 Sk() 32182 } 32183} 32184function Sk() { 32185 Mg == null && (Mg = gs(bk, wc).instance), 32186 wc.show = !0 32187} 32188let wk = new Mk; 32189if (An) { 32190 let l = function() { 32191 for (let e = 0; e < arguments.length; e++) { 32192 let t = arguments[e]; 32193 window._consoleOutput += ` 32194 32195` + t, 32196 t && t.stack && (window._consoleOutput += ` 32197` + t.stack) 32198 } 32199 }; 32200 window.addEventListener("unhandledrejection", function(e) { 32201 window._consoleOutput += ` 32202
32203Unhandled Rejection 32204` + (e && e.reason && e.reason.stack) 32205 }), 32206 window.onerror = function(e, t, n, s, o) { 32207 window._consoleOutput += ` 32208 32209Error: ` + e + ` 32210` + (o && o.stack) 32211 } 32212 , 32213 console.log = l, 32214 console.info = l, 32215 console.error = l, 32216 console.warn = l, 32217 window._consoleOutput = "Chromium: " + sd + " isSafari: " + yw + " isFirefox " + rf, 32218 window._consoleOutput += ` 32219navigator.userAgent: ` + navigator.userAgent, 32220 window._consoleOutput += ` 32221navigator.platform: ` + navigator.platform 32222} 32223const Pk = { 32224 name: "ConsoleDialog", 32225 components: { 32226 HyScrollview: $o, 32227 HyDialog: pn 32228 }, 32229 props: { 32230 show: Boolean 32231 }, 32232 data() { 32233 return { 32234 content: "" 32235 } 32236 }, 32237 emits: ["close"], 32238 methods: { 32239 close() { 32240 this.$emit("close", {}) 32241 } 32242 }, 32243 watch: { 32244 show: { 32245 handler(l) { 32246 l && (this.content = (window._consoleOutput || "").replace(/\r?\n/g, "<br>")) 32247 }, 32248 immediate: !0 32249 } 32250 } 32251} 32252 , xk = { 32253 style: { 32254 "text-align": "left" 32255 }, 32256 tabindex: "0" 32257} 32258 , Ck = ["innerHTML"]; 32259function _k(l, e, t, n, s, o) { 32260 const i = E("hy-scrollview") 32261 , r = E("hy-dialog"); 32262 return N(), 32263 pe(r, { 32264 title: "Console", 32265 show: t.show, 32266 onClose: e[0] || (e[0] = a=>l.$emit("close")), 32267 onCancel: e[1] || (e[1] = a=>l.$emit("close")), 32268 style: { 32269 width: "100%", 32270 height: "100%", 32271 "max-height": "100vh" 32272 } 32273 }, { 32274 default: O(()=>[w(i, { 32275 style: { 32276 height: "100%", 32277 "min-height": "0" 32278 }, 32279 horizontal: !1 32280 }, { 32281 default: O(()=>[_("div", xk, [_("div", { 32282 innerHTML: s.content 32283 }, null, 8, Ck)])]), 32284 _: 1 32285 })]), 32286 _: 1 32287 }, 8, ["show"]) 32288} 32289const Tk = ie(Pk, [["render", _k]]); 32290let Sg, Pc = Et({ 32291 show: !0, 32292 onClose: ()=>Pc.show = !1 32293}); 32294class kk extends Ce { 32295 constructor() { 32296 super("showConsole", !An) 32297 } 32298 performAction() { 32299 Ek() 32300 } 32301} 32302function Ek() { 32303 Sg == null && (Sg = gs(Tk, Pc).instance), 32304 Pc.show = !0 32305} 32306let Dk = new kk; 32307const Ok = { 32308 name: "LicensesDialog", 32309 components: { 32310 HyButton: nt, 32311 HyPopover: Ql, 32312 HyScrollview: $o, 32313 HyDialog: pn 32314 }, 32315 props: { 32316 show: Boolean 32317 }, 32318 data() { 32319 return { 32320 licenseItems: [], 32321 selLicenseItem: null, 32322 showLicenseItem: !1 32323 } 32324 }, 32325 emits: ["close"], 32326 methods: { 32327 close() { 32328 this.$emit("close", {}) 32329 }, 32330 async loadJson() { 32331 await fetch("ossLicenses.json").then(l=>l.json()).then(l=>this.licenseItems = l) 32332 }, 32333 onPointerdownOutsideItem(l) { 32334 l.preventDefault(), 32335 this.selLicenseItem = null 32336 } 32337 }, 32338 beforeMount() { 32339 this.loadJson() 32340 }, 32341 watch: { 32342 show: { 32343 handler(l) { 32344 l && (this.content = (window._consoleOutput || "").replace(/\r?\n/g, "<br>")) 32345 }, 32346 immediate: !0 32347 } 32348 } 32349} 32350 , Ak = { 32351 style: { 32352 display: "flex", 32353 "flex-direction": "column", 32354 "align-items": "stretch", 32355 padding: "16px" 32356 } 32357} 32358 , Ik = ["onClick"] 32359 , Lk = { 32360 style: { 32361 height: "100%", 32362 display: "flex", 32363 "flex-direction": "column", 32364 "align-items": "center", 32365 "justify-content": "stretch", 32366 padding: "32px" 32367 } 32368} 32369 , Vk = { 32370 class: "licence-content" 32371} 32372 , Nk = { 32373 style: { 32374 overflow: "auto", 32375 flex: "1 1 auto", 32376 margin: "24px 0 16px 0" 32377 } 32378} 32379 , Rk = { 32380 style: { 32381 "white-space": "pre-wrap", 32382 "text-align": "center" 32383 } 32384}; 32385function Fk(l, e, t, n, s, o) { 32386 const i = E("hy-scrollview") 32387 , r = E("hy-dialog") 32388 , a = E("hy-button") 32389 , d = E("hy-popover"); 32390 return N(), 32391 $(Pe, null, [w(r, { 32392 title: l.$t("dialogs.licenses.usedLibraries"), 32393 show: t.show, 32394 onClose: e[0] || (e[0] = u=>l.$emit("close")), 32395 onCancel: e[1] || (e[1] = u=>l.$emit("close")), 32396 onPointerdownOutside: e[2] || (e[2] = u=>l.$emit("close")), 32397 class: "license-dialog" 32398 }, {
32399 default: O(()=>[w(i, { 32400 style: { 32401 height: "100%", 32402 "min-height": "0" 32403 }, 32404 horizontal: !1 32405 }, { 32406 default: O(()=>[_("div", Ak, [(N(!0), 32407 $(Pe, null, Gt(s.licenseItems, u=>(N(), 32408 $("button", { 32409 key: u, 32410 onClick: h=>s.selLicenseItem = u, 32411 class: "item-button" 32412 }, se(u.name), 9, Ik))), 128))])]), 32413 _: 1 32414 })]), 32415 _: 1 32416 }, 8, ["title", "show"]), w(d, { 32417 title: "License", 32418 show: s.selLicenseItem != null, 32419 "use-backdrop": !0, 32420 onClose: e[4] || (e[4] = u=>l.$emit("close")), 32421 onPointerdownOutside: o.onPointerdownOutsideItem, 32422 style: { 32423 "max-width": "90vw", 32424 "max-height": "90vh", 32425 width: "480px", 32426 height: "600px" 32427 } 32428 }, { 32429 default: O(()=>[_("div", Lk, [_("div", Vk, [_("h4", null, "Module: " + se(s.selLicenseItem.name || ""), 1), _("p", null, "Author: " + se(s.selLicenseItem.author && s.selLicenseItem.author.name || ""), 1), _("p", null, "Version: " + se(s.selLicenseItem.version || ""), 1), _("p", null, "License Type: " + se(s.selLicenseItem.license || ""), 1), _("div", Nk, [_("p", Rk, "License: " + se(s.selLicenseItem.licenseText || ""), 1)])]), w(a, { 32430 onClick: e[3] || (e[3] = u=>s.selLicenseItem = null), 32431 primary: "", 32432 style: { 32433 flex: "0 0 auto", 32434 "margin-top": "16px" 32435 } 32436 }, { 32437 default: O(()=>[...e[5] || (e[5] = [ve("Close", -1)])]), 32438 _: 1 32439 })])]), 32440 _: 1 32441 }, 8, ["show", "onPointerdownOutside"])], 64) 32442} 32443const Bk = ie(Ok, [["render", Fk]]); 32444let wg, xc = Et({ 32445 show: !0, 32446 onClose: ()=>xc.show = !1 32447}); 32448class zk extends Ce { 32449 constructor() { 32450 super("showLicenses", !1) 32451 } 32452 performAction() { 32453 Uk() 32454 } 32455} 32456function Uk() { 32457 wg == null && (wg = gs(Bk, xc).instance), 32458 xc.show = !0 32459} 32460let Gk = new zk; 32461const Hk = { 32462 name: "NewDocumentPanel", 32463 components: { 32464 HySelect: Dl, 32465 HyScrollview: $o, 32466 HyButton: nt, 32467 HyInputNumber: Lt 32468 }, 32469 props: { 32470 show: { 32471 type: Boolean 32472 }, 32473 compact: { 32474 type: Boolean 32475 }, 32476 hideButton: Boolean 32477 }, 32478 data() { 32479 return { 32480 width: 640, 32481 height: 480, 32482 tab: "new", 32483 sizeIndex: -1, 32484 selectedSizeGroup: null, 32485 sizeGroups: me([{ 32486 name: "Canvas", 32487 items: [[480, 320, "px", "Small (3:2)"], [640, 480, "px", "Medium (4:3)"], [800, 600, "px", "Large (4:3)"], [800, 800, "px", "Square (1:1)"], [1024, 768, "px", "XL (4:3)"]] 32488 }, { 32489 name: "Web", 32490 items: [[390, 844, "px", "Mobile Portrait"], [768, 1024, "px", "Tablet Portrait"], [1024, 768, "px", "Tablet Landscape"], [1366, 768, "px", "Laptop Standard"], [1440, 900, "px", "Laptop Widescreen"], [1920, 1080, "px", "Desktop HD"], [2560, 1440, "px", "Desktop 2K"]] 32491 }, { 32492 name: "Banners", 32493 items: [[300, 250, "px", "Medium Rectangle"], [300, 600, "px", "Half Page"], [728, 90, "px", "Leaderboard"], [970, 250, "px", "Billboard"], [160, 600, "px", "Wide Skyscraper"], [1200, 630, "px", "Open Graph / Link Preview"]] 32494 }, { 32495 name: "Icons & Logos", 32496 items: [[16, 16, "px", "Favicon (Small)"], [32, 32, "px", "Favicon (Large)"], [24, 24, "px", "UI Icon Standard"], [48, 48, "px", "App Icon (Small)"], [180, 180, "px", "Apple Touch Icon"], [256, 256, "px", "Web Application Icon"], [512, 512, "px", "App Icon (Large)"], [1024, 1024, "px", "Logo Master"]] 32497 }, { 32498 name: "Social Media", 32499 items: [[1080, 1080, "px", "Square Post (1:1)"], [1080, 1350, "px", "Portrait Post (4:5)"], [1200, 628, "px", "Landscape Post"], [1080, 1920, "px", "Story / Reel (9:16)"], [1280, 720, "px", "Video Thumbnail"], [1500, 500, "px", "Profile Header / Banner"]] 32500 }]) 32501 } 32502 }, 32503 emits: ["close", "cancel"], 32504 methods: { 32505 parseDimension(l) { 32506 return l.replace(/[^0-9]/g, "") || "0" 32507 }, 32508 formatDimension(l) { 32509 return l + "px" 32510 }, 32511 createNew() { 32512 el(this.apply) 32513 }, 32514 close() { 32515 this.$emit("close", {}) 32516 }, 32517 cancel() { 32518 this.$emit("cancel") 32519 }, 32520 navigate(l) { 32521 if (!this.selectedSizeGroup) 32522 return; 32523 const e = this.selectedSizeGroup.items.length - 1; 32524 l === 1 && this.sizeIndex < e ? this.sizeIndex++ : l === -1 && this.sizeIndex > 0 && this.sizeIndex-- 32525 }, 32526 updateSelIndex() { 32527 this.selectedSizeGroup && (this.sizeIndex = this.selectedSizeGroup.items.findIndex(l=>l[0] === this.width && l[1] === this.height)) 32528 }, 32529 async apply(l, e) { 32530 z().clearSelection(), 32531 l ??= this.width, 32532 e ??= this.height; 32533 let n = new fi(l,e) 32534 , s = this.$store; 32535 s.setActiveDocument(n); 32536 let o = Kd(l, e)
32537 , i = s.appSettings; 32538 i.editor.grid.gridX = o, 32539 i.editor.grid.gridY = o, 32540 this.$emit("close") 32541 } 32542 }, 32543 watch: { 32544 width() { 32545 this.updateSelIndex() 32546 }, 32547 height() { 32548 this.updateSelIndex() 32549 }, 32550 sizeIndex: { 32551 handler(l) { 32552 if (l < 0 || !this.selectedSizeGroup.items) 32553 return; 32554 let e = this.selectedSizeGroup.items[l]; 32555 e && (this.width = e[0], 32556 this.height = e[1]), 32557 this.$nextTick(()=>{ 32558 let t = this.$refs.listItems[l]; 32559 t && t.scrollIntoView({ 32560 block: "nearest", 32561 behavior: "instant" 32562 }) 32563 } 32564 ) 32565 }, 32566 immediate: !0 32567 }, 32568 selectedSizeGroup(l) { 32569 if (!l) 32570 return; 32571 const e = l.items.findIndex(t=>t[0] === this.width && t[1] === this.height); 32572 e !== -1 ? this.sizeIndex = e : l.items.length > 0 ? this.sizeIndex = 0 : this.sizeIndex = -1 32573 } 32574 }, 32575 beforeMount() { 32576 const l = this.sizeGroups.find(e=>e.items.some(t=>t[0] === this.width && t[1] === this.height)); 32577 this.selectedSizeGroup = l || this.sizeGroups[0], 32578 this.updateSelIndex() 32579 } 32580} 32581 , $k = { 32582 class: "container" 32583} 32584 , Xk = { 32585 class: "size-container" 32586} 32587 , Yk = { 32588 class: "size-grid" 32589} 32590 , Kk = { 32591 key: 0, 32592 class: "create-button-container" 32593} 32594 , Wk = { 32595 key: 0, 32596 class: "list-container" 32597} 32598 , qk = { 32599 class: "list-header" 32600} 32601 , jk = { 32602 class: "list-title" 32603} 32604 , Jk = ["onPointerdown"]; 32605function Zk(l, e, t, n, s, o) { 32606 const i = E("hy-input-number") 32607 , r = E("hy-button") 32608 , a = E("hy-select") 32609 , d = E("hy-scrollview"); 32610 return wl((N(), 32611 $("div", $k, [_("div", Xk, [_("div", Yk, [_("div", null, se(l.$t("dialogs.newFile.width")), 1), e[7] || (e[7] = _("div", null, null, -1)), _("div", null, se(l.$t("dialogs.newFile.height")), 1), e[8] || (e[8] = _("div", null, null, -1)), w(i, { 32612 modelValue: s.width, 32613 "onUpdate:modelValue": e[0] || (e[0] = u=>s.width = u), 32614 min: 1, 32615 max: 4096, 32616 formatter: o.formatDimension, 32617 parser: o.parseDimension, 32618 autofocus: "" 32619 }, null, 8, ["modelValue", "formatter", "parser"]), e[9] || (e[9] = _("div", { 32620 style: { 32621 "font-size": "18px" 32622 } 32623 }, "Ã", -1)), w(i, { 32624 modelValue: s.height, 32625 "onUpdate:modelValue": e[1] || (e[1] = u=>s.height = u), 32626 min: 1, 32627 max: 4096, 32628 formatter: o.formatDimension, 32629 parser: o.parseDimension 32630 }, null, 8, ["modelValue", "formatter", "parser"]), t.hideButton ? be("", !0) : (N(), 32631 $("div", Kk, [w(r, { 32632 onClick: o.createNew, 32633 primary: "" 32634 }, { 32635 default: O(()=>[ve(se(l.$t("create")), 1)]), 32636 _: 1 32637 }, 8, ["onClick"])]))])]), t.compact ? be("", !0) : (N(), 32638 $("div", Wk, [_("div", qk, [_("div", jk, se(l.$t("dialogs.newFile.standardFormats")), 1), w(a, { 32639 modelValue: s.selectedSizeGroup, 32640 "onUpdate:modelValue": e[2] || (e[2] = u=>s.selectedSizeGroup = u), 32641 items: s.sizeGroups, 32642 "label-field": "name" 32643 }, null, 8, ["modelValue", "items"])]), w(d, { 32644 class: "list-scrollview" 32645 }, { 32646 default: O(()=>[_("ul", { 32647 tabindex: "0", 32648 onKeydown: [e[4] || (e[4] = Ia(Ah(u=>o.navigate(1), ["prevent"]), ["down"])), e[5] || (e[5] = Ia(Ah(u=>o.navigate(-1), ["prevent"]), ["up"])), e[6] || (e[6] = Ia((...u)=>o.createNew && o.createNew(...u), ["enter"]))], 32649 class: "sizes-list" 32650 }, [(N(!0), 32651 $(Pe, null, Gt(s.selectedSizeGroup?.items, (u,h)=>(N(), 32652 $("li", { 32653 key: u, 32654 onPointerdown: c=>s.sizeIndex = h, 32655 onDblclick: e[3] || (e[3] = (...c)=>o.createNew && o.createNew(...c)), 32656 class: Ne(["list-item", { 32657 active: h === s.sizeIndex 32658 }]) 32659 }, [_("div", { 32660 ref_for: !0, 32661 ref: "listItems", 32662 class: "size-item" 32663 }, [_("div", null, se(u[3]), 1), _("div", null, se(u[0] + "x" + u[1] + u[2]), 1)], 512)], 42, Jk))), 128))], 32)]), 32664 _: 1 32665 })]))], 512)), [[ef, s.tab === "new"]]) 32666} 32667const rv = ie(Hk, [["render", Zk], ["__scopeId", "data-v-b600bd09"]]) 32668 , Qk = { 32669 name: "NewDocumentDialog", 32670 components: { 32671 HyButton: nt, 32672 NewDocumentPanel: rv, 32673 HyDialog: pn 32674 }, 32675 props: { 32676 show: { 32677 type: Boolean 32678 } 32679 }, 32680 data() { 32681 return { 32682 compact: !1 32683 } 32684 }, 32685 emits: ["cancel", "close"], 32686 methods: { 32687 create() { 32688 this.$refs.newDocPanel?.createNew(), 32689 this.close() 32690 }, 32691 close() { 32692 this.$emit("close") 32693 }, 32694 cancel() { 32695 this.$emit("cancel") 32696 } 32697 }, 32698 watch: { 32699 show: { 32700 handler() { 32701 this.compact = window.innerWidth < 620 32702 }, 32703 immediate: !0 32704 } 32705 } 32706}; 32707function eE(l, e, t, n, s, o) { 32708 const i = E("new-document-panel") 32709 , r = E("hy-button") 32710 , a = E("hy-dialog"); 32711 return N(), 32712 pe(a, { 32713 show: t.show, 32714 title: l.$t("dialogs.newFile.newFile"), 32715 modal: "", 32716 onClose: o.close, 32717 onCancel: o.cancel 32718 }, {
32719 actions: O(()=>[w(r, { 32720 onClick: o.create, 32721 primary: "" 32722 }, { 32723 default: O(()=>[ve(se(l.$t("create")), 1)]), 32724 _: 1 32725 }, 8, ["onClick"]), w(r, { 32726 onClick: o.cancel 32727 }, { 32728 default: O(()=>[ve(se(l.$t("cancel")), 1)]), 32729 _: 1 32730 }, 8, ["onClick"])]), 32731 default: O(()=>[w(i, { 32732 ref: "newDocPanel", 32733 class: Ne(["new-document-panel", { 32734 compact: s.compact 32735 }]), 32736 onClose: o.close, 32737 onCancel: o.cancel, 32738 "hide-button": "", 32739 compact: s.compact 32740 }, null, 8, ["class", "onClose", "onCancel", "compact"])]), 32741 _: 1 32742 }, 8, ["show", "title", "onClose", "onCancel"]) 32743} 32744const tE = ie(Qk, [["render", eE], ["__scopeId", "data-v-8720db43"]]); 32745let Pg, gd = Et({ 32746 show: !0, 32747 onClose: lE, 32748 onCancel: nE 32749}); 32750function lE() { 32751 gd.show = !1 32752} 32753function nE() { 32754 gd.show = !1 32755} 32756class sE extends Ce { 32757 constructor() { 32758 super("newDocument", !1) 32759 } 32760 performAction() { 32761 oE() 32762 } 32763} 32764function oE() { 32765 Pg == null && (Pg = gs(tE, gd).instance), 32766 gd.show = !0 32767} 32768let iE = new sE; 32769const rE = { 32770 name: "DocumentPropertiesDialog", 32771 components: { 32772 HyInput: Xs, 32773 HyButton: nt, 32774 HyDialog: pn, 32775 HyField: js, 32776 HyInputNumber: Lt 32777 }, 32778 props: { 32779 show: { 32780 type: Boolean 32781 } 32782 }, 32783 emits: ["cancel", "close"], 32784 data() { 32785 return { 32786 editDocumentSettings: new cu 32787 } 32788 }, 32789 methods: { 32790 parseSize(l) { 32791 return l.replace(/[^0-9]/g, "") || "0" 32792 }, 32793 formatSize(l) { 32794 return l + "px" 32795 }, 32796 async apply() { 32797 this.$store.activeDocument.documentSettings.set(this.editDocumentSettings), 32798 this.close() 32799 }, 32800 close() { 32801 this.$emit("close") 32802 }, 32803 cancel() { 32804 this.$emit("cancel") 32805 } 32806 }, 32807 watch: { 32808 show: { 32809 handler(l) { 32810 if (l) { 32811 let e = this.$store.activeDocument; 32812 this.editDocumentSettings.set(e.documentSettings.clone()) 32813 } 32814 }, 32815 immediate: !0 32816 } 32817 } 32818} 32819 , aE = { 32820 class: "content-container" 32821}; 32822function dE(l, e, t, n, s, o) { 32823 const i = E("hy-input") 32824 , r = E("hy-field") 32825 , a = E("hy-input-number") 32826 , d = E("hy-button") 32827 , u = E("hy-dialog"); 32828 return N(), 32829 pe(u, { 32830 show: t.show, 32831 onClose: o.close, 32832 onCancel: o.cancel, 32833 title: l.$t("dialogs.properties.docProperties"), 32834 modal: !0 32835 }, { 32836 actions: O(()=>[w(d, { 32837 onClick: o.apply, 32838 primary: "" 32839 }, { 32840 default: O(()=>[ve(se(l.$t("ok")), 1)]), 32841 _: 1 32842 }, 8, ["onClick"]), w(d, { 32843 onClick: o.cancel 32844 }, { 32845 default: O(()=>[ve(se(l.$t("cancel")), 1)]), 32846 _: 1 32847 }, 8, ["onClick"])]), 32848 default: O(()=>[_("div", aE, [w(r, { 32849 label: l.$t("dialogs.properties.name") 32850 }, { 32851 default: O(()=>[w(i, { 32852 modelValue: s.editDocumentSettings.title, 32853 "onUpdate:modelValue": e[0] || (e[0] = h=>s.editDocumentSettings.title = h) 32854 }, null, 8, ["modelValue"])]), 32855 _: 1 32856 }, 8, ["label"]), w(r, { 32857 label: l.$t("dialogs.properties.description") 32858 }, { 32859 default: O(()=>[w(i, { 32860 modelValue: s.editDocumentSettings.description, 32861 "onUpdate:modelValue": e[1] || (e[1] = h=>s.editDocumentSettings.description = h) 32862 }, null, 8, ["modelValue"])]), 32863 _: 1 32864 }, 8, ["label"]), w(r, { 32865 label: l.$t("dialogs.properties.width") 32866 }, { 32867 default: O(()=>[w(a, { 32868 modelValue: s.editDocumentSettings.width, 32869 "onUpdate:modelValue": e[2] || (e[2] = h=>s.editDocumentSettings.width = h), 32870 min: 1, 32871 max: 4096, 32872 formatter: o.formatSize, 32873 parser: o.parseSize, 32874 class: "integer-input" 32875 }, null, 8, ["modelValue", "formatter", "parser"])]), 32876 _: 1 32877 }, 8, ["label"]), w(r, { 32878 label: l.$t("dialogs.properties.height") 32879 }, { 32880 default: O(()=>[w(a, { 32881 modelValue: s.editDocumentSettings.height, 32882 "onUpdate:modelValue": e[3] || (e[3] = h=>s.editDocumentSettings.height = h), 32883 min: 1, 32884 max: 4096, 32885 formatter: o.formatSize, 32886 parser: o.parseSize, 32887 class: "integer-input" 32888 }, null, 8, ["modelValue", "formatter", "parser"])]), 32889 _: 1 32890 }, 8, ["label"])])]), 32891 _: 1 32892 }, 8, ["show", "onClose", "onCancel", "title"]) 32893} 32894const uE = ie(rE, [["render", dE], ["__scopeId", "data-v-8c8550e2"]]); 32895let xg, md = Et({ 32896 show: !0, 32897 onCancel: ()=>md.show = !1, 32898 onClose: ()=>md.show = !1 32899}); 32900class hE extends Ce { 32901 constructor() { 32902 super("docProperties", !1) 32903 } 32904 performAction() { 32905 cE() 32906 } 32907} 32908function cE() { 32909 xg == null && (xg = gs(uE, md).instance), 32910 md.show = !0 32911} 32912let fE = new hE; 32913class Xo extends Ce { 32914 selected; 32915 constructor(e, t=!1, n=!1) { 32916 super(e, t), 32917 this.selected = n 32918 } 32919 get isToggleAction() { 32920 return !0 32921 } 32922} 32923class Af extends Ue { 32924 _singlePathModels; 32925 _nodeIndices; 32926 _oldDatas; 32927 _newDatas; 32928 constructor(e, t) { 32929 super(!0); 32930 let n = new Map; 32931 for (let s = 0; s < e.length; s++) { 32932 let o = e[s] 32933 , i = o.getSinglePathModel() 32934 , r = n.get(i); 32935 r == null && (r = [[], []], 32936 n.set(i, r)), 32937 r[0].push(o.getIndex()), 32938 r[1].push(t[s]) 32939 } 32940 this._singlePathModels = Array.from(n.keys()), 32941 this._nodeIndices = [], 32942 this._oldDatas = [],
32943 this._singlePathModels.forEach(s=>{ 32944 let o = n.get(s); 32945 this._nodeIndices.push(o[0]), 32946 this._oldDatas.push(...o[1]) 32947 } 32948 ) 32949 } 32950 getNewNodePointData(e) { 32951 throw new Error("not implemented") 32952 } 32953 setNodePointsDatas(e, t) { 32954 throw new Error("not implemented") 32955 } 32956 async undo() { 32957 if (!this._newDatas) { 32958 let e = []; 32959 for (let t = 0; t < this._singlePathModels.length; t++) { 32960 let n = this._singlePathModels[t]; 32961 this._nodeIndices[t].forEach(o=>e.push(this.getNewNodePointData(n.getNodePointAt(o)))) 32962 } 32963 this._newDatas = e 32964 } 32965 this.setNodePointsDatas(this._getNodePoints(), this._oldDatas) 32966 } 32967 async redo() { 32968 this.setNodePointsDatas(this._getNodePoints(), this._newDatas) 32969 } 32970 _getNodePoints() { 32971 let e = []; 32972 for (let t = 0; t < this._singlePathModels.length; t++) { 32973 let n = this._singlePathModels[t] 32974 , s = this._nodeIndices[t]; 32975 e.push(...s.map(o=>n.getNodePointAt(o))) 32976 } 32977 return e 32978 } 32979 addEdit(e) { 32980 if (this.isClosed || this.constructor !== e.constructor || this._singlePathModels.length !== e._singlePathModels.length) 32981 return !1; 32982 for (let t = 0; t < this._singlePathModels.length; t++) 32983 if (this._singlePathModels[t] !== e._singlePathModels[t] || !Rw(this._nodeIndices[t], e._nodeIndices[t])) 32984 return !1; 32985 return this._newDatas = e._newDatas, 32986 !0 32987 } 32988} 32989class av extends Af { 32990 constructor(e, t) { 32991 super(e, t) 32992 } 32993 getNewNodePointData(e) { 32994 return e.getNodeType() 32995 } 32996 setNodePointsDatas(e, t) { 32997 z().setNodePointTypes(e, t) 32998 } 32999} 33000let th = null; 33001function Ta() { 33002 th == null && (th = requestIdleCallback(()=>{ 33003 th = null; 33004 let l = z() 33005 , e = l.sortedSelNodePoints 33006 , t = e.length > 0 33007 , n = !1 33008 , s = !1 33009 , o = !1 33010 , i = !1; 33011 for (let r of e) { 33012 if (r.getNodeType() === yt ? n = !0 : s = !0, 33013 !o || !i) { 33014 let a = r.getPrevious(); 33015 a != null && l.isPathPointSelected(a) && (r.inX === r.x && r.inY === r.y && a.outX === a.x && a.outY === a.y ? o = !0 : i = !0) 33016 } 33017 if (n && s && o && i) 33018 break 33019 } 33020 yd.setDisabled(!t), 33021 yd.selected = !s, 33022 vd.setDisabled(!t), 33023 vd.selected = !n, 33024 bd.setDisabled(!i && !o), 33025 Md.setDisabled(!i && !o), 33026 bd.selected = !i, 33027 Md.selected = !o, 33028 If.setDisabled(!t) 33029 } 33030 , { 33031 timeout: 200 33032 })) 33033} 33034Ie(()=>V().elementManager, (l,e)=>{ 33035 l && (l.addPointSelectionCallback(Ta), 33036 l.addNodePointsChangeCallback(Ta)), 33037 e && (e.removePointSelectionCallback(Ta), 33038 l.removeNodePointsChangeCallback(Ta)) 33039} 33040); 33041class pE extends Ce { 33042 constructor() { 33043 super("toSmoothNodes", !0) 33044 } 33045 performAction() { 33046 let e = z() 33047 , t = e.sortedSelNodePoints; 33048 e.setNodePointTypes(t, t.map(()=>yt)) 33049 } 33050} 33051class gE extends Xo { 33052 constructor() { 33053 super("toCornerNodes", !0, !1) 33054 } 33055 performAction() { 33056 let e = z() 33057 , t = e.sortedSelNodePoints; 33058 e.setNodePointTypes(t, t.map(()=>eu)) 33059 } 33060} 33061class mE extends Xo { 33062 constructor() { 33063 super("toLine", !0, !1) 33064 } 33065 performAction() { 33066 let e = z() 33067 , t = e.sortedSelNodePoints 33068 , n = new Map; 33069 for (let s of t) { 33070 let o = s.getPrevious(); 33071 if (o != null && e.isPathPointSelected(o) && !(o.outX === o.x && o.outY === o.x && s.inX === s.x && s.inY === s.x)) { 33072 let r = n.get(o) || o.toCoords() 33073 , a = n.get(s) || s.toCoords(); 33074 if (r.splice(4, 2, o.x, o.y), 33075 a.splice(2, 2, s.x, s.y), 33076 o.getNodeType() === yt) { 33077 let d = Se(r[0] - r[2], r[1] - r[3]) 33078 , u = Se(a[0] - r[0], a[1] - r[1]); 33079 d > 0 && u > 0 && (r[2] = r[0] + (r[0] - a[0]) * d / u, 33080 r[3] = r[1] + (r[1] - a[1]) * d / u) 33081 } 33082 if (s.getNodeType() === yt) { 33083 let d = Se(a[4] - a[0], a[5] - a[1]) 33084 , u = Se(a[0] - r[0], a[1] - r[1]); 33085 d > 0 && u > 0 && (a[4] = a[0] + (a[0] - r[0]) * d / u, 33086 a[5] = a[1] + (a[1] - r[1]) * d / u) 33087 } 33088 n.set(o, r), 33089 n.set(s, a) 33090 } 33091 } 33092 n.size > 0 && e.moveNodePoints(Array.from(n.keys()), Array.from(n.values())
33092) 33093 } 33094} 33095class yE extends Xo { 33096 constructor() { 33097 super("toCurve", !0, !1) 33098 } 33099 performAction() { 33100 let e = z() 33101 , t = e.sortedSelNodePoints 33102 , n = new Map 33103 , s = []; 33104 for (let o of t) { 33105 let i = o.getPrevious() 33106 , r = o.getNext(); 33107 if (r != null) { 33108 let a = o.getV0() 33109 , d = o.getV1() 33110 , u = a && Ae(a) && e.isPathPointSelected(i) 33111 , h = Ae(d) && e.isPathPointSelected(r); 33112 if (u && h) { 33113 a = a.slice(), 33114 d = d.slice(), 33115 gr(a, d); 33116 let c = o.toCoords(); 33117 u && (c[2] = a[4], 33118 c[3] = a[5]), 33119 h && (c[4] = d[2], 33120 c[5] = d[3]), 33121 u && h && s.push(o), 33122 n.set(o, c) 33123 } else if (h && !(Ae(r.getV1()) && e.isPathPointSelected(r.getNext()))) { 33124 let c = o.toCoords(); 33125 c[4] = (d[0] * 2 + d[6]) / 3, 33126 c[5] = (d[1] * 2 + d[7]) / 3, 33127 n.set(o, c); 33128 let f = r.toCoords(); 33129 f[2] = (d[0] + d[6] * 2) / 3, 33130 f[3] = (d[1] + d[7] * 2) / 3, 33131 n.set(r, f) 33132 } 33133 } 33134 } 33135 if (n.size > 0) { 33136 let o = ae(); 33137 if (o.startCompoundEdit(), 33138 e.moveNodePoints(Array.from(n.keys()), Array.from(n.values())), 33139 s.length) { 33140 let i = s.map(r=>r.getNodeType()); 33141 s.forEach(r=>r.setNodeType(yt, !1)), 33142 o.addEdit(new av(s,i)) 33143 } 33144 o.endCompoundEdit() 33145 } 33146 } 33147} 33148class vE extends Ce { 33149 constructor() { 33150 super("reversePath", !0) 33151 } 33152 performAction() { 33153 let e = z() 33154 , t = new Set; 33155 e.sortedSelNodePoints.forEach(s=>t.add(s.getSinglePathModel())), 33156 e.reversePaths(Array.from(t)) 33157 } 33158} 33159const yd = new pE 33160 , vd = new gE 33161 , bd = new mE 33162 , Md = new yE 33163 , If = new vE; 33164class bE extends Ce { 33165 constructor() { 33166 super("booleanUnite", !0), 33167 Ie(V().selectedModels, e=>{ 33168 this.disabled = e.length < 1 33169 } 33170 ) 33171 } 33172 performAction(e) { 33173 let n = V().selectedModels.slice() 33174 , s = z() 33175 , o = s.booleanUniteModels(n, e); 33176 s.setModelsSelected(o == null ? null : [o], n) 33177 } 33178} 33179class ME extends Ce { 33180 constructor() { 33181 super("booleanSubtract", !0), 33182 Ie(V().selectedModels, e=>{ 33183 this.disabled = e.length <= 1 33184 } 33185 ) 33186 } 33187 performAction(e) { 33188 let n = V().selectedModels.slice() 33189 , s = z() 33190 , o = s.booleanSubtractModels(n, e); 33191 s.setModelsSelected(o == null ? null : [o], n) 33192 } 33193} 33194class SE extends Ce { 33195 constructor() { 33196 super("booleanIntersect", !0), 33197 Ie(V().selectedModels, e=>{ 33198 this.disabled = e.length <= 1 33199 } 33200 ) 33201 } 33202 performAction(e) { 33203 let n = V().selectedModels.slice() 33204 , s = z() 33205 , o = s.booleanIntersectModels(n, e); 33206 s.setModelsSelected(o == null ? null : [o], n) 33207 } 33208} 33209let Lf = new bE 33210 , Vf = new ME 33211 , Nf = new SE 33212 , wE = class extends Xo { 33213 constructor() { 33214 super("toggleRulers", !1, !0), 33215 Ie(()=>V().appSettings.ui.showRulers, e=>this.selected = e, { 33216 immediate: !0 33217 }) 33218 } 33219 performAction() { 33220 console.log("perform rulers action", V().appSettings.ui.showRulers, this.selected), 33221 V().appSettings.ui.showRulers = !this.selected 33222 } 33223} 33224 , PE = new wE; 33225class xE extends Xo { 33226 constructor() { 33227 super("toggleTooltips", !1, !0), 33228 Ie(()=>V().appSettings.ui.showTooltips, e=>this.selected = e, { 33229 immediate: !0 33230 }) 33231 } 33232 performAction() { 33233 V().appSettings.ui.showTooltips = !this.selected 33234 } 33235} 33236let CE = new xE; 33237class _E extends Xo { 33238 constructor() {
33239 super("toggleDarkMode", !1, V().appSettings.ui.darkMode.isDark), 33240 Ie(()=>V().appSettings.ui.darkMode.isDark, e=>this.selected = e) 33241 } 33242 performAction() { 33243 V().appSettings.ui.darkMode.isDark = !this.selected, 33244 V().appSettings.ui.darkMode.automatic = !1 33245 } 33246} 33247let TE = new _E; 33248const kE = { 33249 name: "AccentColorDialog", 33250 components: { 33251 ColorPicker: ea, 33252 HyPopover: Ql 33253 }, 33254 props: { 33255 show: { 33256 type: Boolean, 33257 default: !1 33258 } 33259 }, 33260 data() { 33261 return { 33262 color: new ce 33263 } 33264 }, 33265 emits: ["close", "cancel"], 33266 watch: { 33267 color(l) { 33268 this.updateColor(l) 33269 }, 33270 show(l) { 33271 l && this.initColor() 33272 } 33273 }, 33274 mounted() { 33275 this.initColor() 33276 }, 33277 methods: { 33278 initColor() { 33279 let l = new ce(this.$store.appSettings.ui.accentColor); 33280 this.color.set(l), 33281 this.originalColor = l.clone() 33282 }, 33283 onPointerdownOutside() { 33284 this.$store.subTool !== hi && this.close() 33285 }, 33286 updateColor(l) {
33287 this.$store.appSettings.ui.accentColor = l.toCss() 33288 }, 33289 cancel() { 33290 this.updateColor(this.originalColor), 33291 this.$emit("cancel") 33292 }, 33293 close() { 33294 this.$emit("close") 33295 } 33296 } 33297} 33298 , EE = { 33299 class: "content" 33300} 33301 , DE = { 33302 class: "color-picker-container" 33303}; 33304function OE(l, e, t, n, s, o) { 33305 const i = E("color-picker") 33306 , r = E("hy-popover"); 33307 return N(), 33308 pe(r, { 33309 show: t.show, 33310 primaryPos: "center", 33311 secondaryPos: "center", 33312 onClose: o.close, 33313 onCancel: o.cancel, 33314 onPointerdownOutside: o.onPointerdownOutside 33315 }, { 33316 default: O(()=>[_("div", EE, [_("div", { 33317 class: "color-preview", 33318 style: xe({ 33319 background: s.color.toHex() 33320 }) 33321 }, null, 4), _("div", DE, [w(i, { 33322 modelValue: s.color, 33323 "onUpdate:modelValue": e[0] || (e[0] = a=>s.color = a), 33324 hasAlpha: !1 33325 }, null, 8, ["modelValue"])])])]), 33326 _: 1 33327 }, 8, ["show", "onClose", "onCancel", "onPointerdownOutside"]) 33328} 33329const AE = ie(kE, [["render", OE], ["__scopeId", "data-v-5e8c56d6"]]); 33330let Cg, Sd = Et({ 33331 show: !0, 33332 onCancel: ()=>Sd.show = !1, 33333 onClose: ()=>Sd.show = !1 33334}); 33335function IE() { 33336 Cg == null && (Cg = gs(AE, Sd).instance), 33337 Sd.show = !0 33338} 33339class LE extends Ce { 33340 iconSvg = '<svg viewBox="0 0 22 22" width="22" height="22"><circle cx="10" cy="10" r="10" style="fill: var(--accent-color);"/></svg>'; 33341 constructor() { 33342 super("accentColor", !1) 33343 } 33344 performAction() { 33345 IE() 33346 } 33347} 33348let VE = new LE; 33349class NE extends Ce { 33350 constructor() { 33351 super("fullscreen", !1) 33352 } 33353 performAction() { 33354 document.fullscreenElement || document.webkitFullscreenElement ? document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen && document.webkitExitFullscreen() : document.documentElement.requestFullscreen ? document.documentElement.requestFullscreen() : document.documentElement.webkitRequestFullscreen && document.documentElement.webkitRequestFullscreen() 33355 } 33356} 33357let RE = new NE; 33358class FE extends Ce { 33359 constructor() { 33360 super("zenmode", !1) 33361 } 33362 performAction() { 33363 document.fullscreenElement || document.webkitFullscreenElement ? (document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen && document.webkitExitFullscreen(), 33364 document.body.classList.add("zenmode")) : (document.documentElement.requestFullscreen ? document.documentElement.requestFullscreen() : document.documentElement.webkitRequestFullscreen && document.documentElement.webkitRequestFullscreen(), 33365 document.body.classList.remove("zenmode")) 33366 } 33367} 33368let BE = new FE; 33369class zE extends Ce { 33370 constructor() { 33371 super("toClippath", !0), 33372 Ie(V().selectedModels, e=>{ 33373 this.disabled = e.find(t=>t.getType() !== "clipPath" && t.getType() !== "group") == null 33374 } 33375 ) 33376 } 33377 async performAction() { 33378 let t = V().selectedModels.slice(); 33379 UE(t.find(n=>n.getType() !== "clipPath" && n.getType() !== "group")) 33380 } 33381} 33382function UE(l) { 33383 let e = z(); 33384 if (l.getType() !== "clipPath" && l.getType() !== "group") { 33385 let t = new hu 33386 , n = l.getPaths(null, -1, !0); 33387 t.setPaths(n), 33388 l.copyAttributes(t); 33389 let s = l.getParentModel() 33390 , o = s.getChildModelIndex(l) 33391 , i = ae(); 33392 i.startCompoundEdit(), 33393 e.removeModelsAt(s, o, 1), 33394 e.insertModelAt(t, s, o), 33395 i.endCompoundEdit(), 33396 e.setModelsSelected([t], store.selectedModels) 33397 } 33398} 33399const GE = new zE; 33400class Dn extends Ue { 33401 _models; 33402 _oldTransforms; 33403 _newTransforms; 33404 constructor(e, t) { 33405 super(!0), 33406 this._models = e, 33407 this._oldTransforms = t 33408 } 33409 async undo() { 33410 this._newTransforms ??= this._models.map(e=>e.getSelfTransform()), 33411 this._setTransforms(this._oldTransforms) 33412 } 33413 async redo() { 33414 this._setTransforms(this._newTransforms) 33415 } 33416 _setTransforms(e) {
33417 this._models.forEach((t,n)=>t.setSelfTransform(e[n])) 33418 } 33419 addEdit(e) { 33420 return this.isClosed || !(e instanceof Dn) || !r2(e._models, this._models) ? !1 : (this._newTransforms = e._newTransforms, 33421 !0) 33422 } 33423} 33424class HE extends Ce { 33425 constructor() { 33426 super("group", !0), 33427 Ie(V().selectedModels, e=>{ 33428 this.disabled = e.length <= 1 33429 } 33430 ) 33431 } 33432 performAction() { 33433 let t = V().selectedModels.slice(); 33434 if (nu(t), 33435 t.length > 1) { 33436 let n = ae(); 33437 n.startCompoundEdit(); 33438 let s = z(); 33439 s.setModelsSelected(null, t); 33440 let o = new Uo 33441 , i = t[0] 33442 , r = i.getParentModel(); 33443 s.insertModelAt(o, r, r.getChildModelIndex(i) + 1); 33444 let a = o.getAggregateTransform().invert() 33445 , d = t.map(u=>u.getSelfTransform()); 33446 for (let u of t) { 33447 d.push(u.getSelfTransform()); 33448 let h = u.getAggregateTransform().preMultiplyWith(a); 33449 u.setSelfTransform(h) 33450 } 33451 s.removeModels(t), 33452 s.insertModelsAt(t, o, 0), 33453 n.addEdit(new Dn(t,d)), 33454 s.setModelsSelected([o], null), 33455 n.endCompoundEdit() 33456 } 33457 } 33458} 33459const dv = new HE; 33460class $E extends Ce { 33461 constructor() { 33462 super("ungroup", !0), 33463 Ie(V().selectedModels, e=>{ 33464 let t = !0; 33465 if (e.length >= 1) { 33466 for (let n of e) 33467 if (n.getType() === "group") { 33468 t = !1; 33469 break 33470 } 33471 } 33472 this.disabled = t 33473 } 33474 ) 33475 } 33476 performAction() { 33477 let n = V().selectedModels.filter(s=>s.getType() === "group"); 33478 if (n.length > 0) { 33479 let s = ae(); 33480 s.startCompoundEdit(); 33481 let o = z(); 33482 o.setModelsSelected(null, n); 33483 let i = []; 33484 for (let r of n) { 33485 let a = r.getParentModel() 33486 , d = a.getAggregateTransform().invert() 33487 , u = a.getChildModelIndex(r) 33488 , h = r.getChildModels(); 33489 i.push(...h); 33490 let c = []; 33491 h.forEach(f=>{ 33492 c.push(f.getSelfTransform()), 33493 f.setSelfTransform(f.getAggregateTransform().multiplyWith(d)) 33494 } 33495 ), 33496 o.removeModelsAt(r, 0, h.length), 33497 o.insertModelsAt(h, a, u), 33498 s.addEdit(new Dn(h,c)), 33499 r.getType() === "group" && o.removeModel(r) 33500 } 33501 o.setModelsSelected(i, null), 33502 s.endCompoundEdit() 33503 } 33504 } 33505} 33506let uv = new $E; 33507class XE extends Ce { 33508 constructor() { 33509 super("separatePaths", !0), 33510 Ie(V().selectedModels, e=>{ 33511 this.disabled = e.length === 0 33512 } 33513 ) 33514 } 33515 performAction() { 33516 let t = V().selectedModels.slice(); 33517 if (t.length === 0) 33518 return; 33519 let n = ae(); 33520 n.startCompoundEdit(); 33521 let s = z(); 33522 s.setModelsSelected(null, t); 33523 let o = []; 33524 for (let i of t) 33525 if (i.getType() === "path") { 33526 let r = i.getSinglePathModels(); 33527 if (r.length > 1) { 33528 let a = r.map(d=>{ 33529 let u = new bt([d.getPath().clone()]); 33530 return i.copyAttributes(u), 33531 o.push(u), 33532 u 33533 } 33534 ); 33535 s.replaceModel(i, a) 33536 } else 33537 o.push(i) 33538 } else 33539 o.push(i); 33540 s.setModelsSelected(o, null), 33541 n.endCompoundEdit() 33542 } 33543} 33544let YE = new XE; 33545class KE extends Ce { 33546 constructor() { 33547 super("combinePaths", !0), 33548 Ie(V().selectedModels, e=>{ 33549 this.disabled = e.length < 2 33550 } 33551 ) 33552 } 33553 performAction() { 33554 let t = V().selectedModels.slice(); 33555 if (t.length === 0) 33556 return; 33557 let n = ae(); 33558 n.startCompoundEdit(); 33559 let s = z(); 33560 s.setModelsSelected(null, t); 33561 let o = Ke(t); 33562 if (o.length > 1) { 33563 let i = o.at(-1) 33564 , r = []; 33565 for (let h of o) { 33566 let c = h.getAggregateTransform() 33567 , f = h.getPaths(c, 0, !0); 33568 r.push(...f) 33569 } 33570 let a = i.getParentModel() 33571 , d = new bt(r) 33572 , u = a.getChildModelIndex(i); 33573 s.insertModelAt(d, a, u + 1), 33574 d.setSelfTransform(a.getAggregateTransform().invert()), 33575 i.copyGraphicsAttributes(d), 33576 s.removeModels(o), 33577 s.setModelsSelected([d], null), 33578 n.endCompoundEdit() 33579 } 33580 } 33581} 33582let WE = new KE; 33583function Oi() { 33584 return self.hyApp.config.globalProperties.$editorComponent 33585} 33586class qE extends Ce { 33587 constructor() { 33588 super("zoomIn", !0) 33589 } 33590 performAction() { 33591 Oi().zoomStep(-.5) 33592 } 33593} 33594class jE extends Ce { 33595 constructor() { 33596 super("zoomOut", !0) 33597 } 33598 performAction() { 33599 Oi().zoomStep(.5) 33600 } 33601} 33602class JE extends Ce { 33603 constructor() { 33604 super("zoomToDocument", !1) 33605 } 33606 performAction() { 33607 Oi().zoomToDocument() 33608 } 33609} 33610class ZE extends Ce { 33611 constructor() { 33612 super("zoomToSelection", !0), 33613 Ie(V().selectedModels, e=>{ 33614 this.disabled = e.length === 0 33615 } 33616 ) 33617 } 33618 performAction() { 33619 Oi().zoomToSelection() 33620 } 33621} 33622class QE extends Ce { 33623 constructor() { 33624 super("centerDocument", !1) 33625 } 33626 performAction() { 33627 Oi().centerDocument(!0) 33628 } 33629} 33630class eD extends Ce { 33631 constructor() { 33632 super("centerSelection", !0), 33633 Ie(V().selectedModels, e=>{ 33634 this.disabled = e.length === 0 33635 } 33636 ) 33637 } 33638 performAction() { 33639 Oi().centerSelection(!0) 33640 } 33641} 33642const hv = new QE 33643 , cv = new eD 33644 , tD = new qE 33645 , lD = new jE 33646 , fv = new JE 33647 , pv = new ZE; 33648class nD extends Ce { 33649 constructor() { 33650 super("undo", !0), 33651 Ie(()=>V().undoManager, (e,t)=>{ 33652 t && t.removeStateListener(this), 33653 e.addStateListener(this) 33654 } 33655 ), 33656 this.updateEnabled() 33657 } 33658 undoStateChanged() { 33659 this.updateEnabled() 33660 } 33661 updateEnabled() { 33662 let e = ae(); 33663 this.setDisabled(e == null ? !0 : !e.canUndo()) 33664 } 33665 performAction() { 33666 ae().undo() 33667 } 33668} 33669let gv = new nD; 33670class sD extends Ce { 33671 constructor() { 33672 super("redo", !0), 33673 Ie(()=>V().undoManager, (e,t)=>{ 33674 t && t.removeStateListener(this), 33675 e.addStateListener(this) 33676 } 33677 ), 33678 this.updateEnabled() 33679 } 33680 undoStateChanged() { 33681 this.updateEnabled() 33682 } 33683 updateEnabled() { 33684 let e = ae(); 33685 this.setDisabled(e == null ? !0 : !e.canRedo()) 33686 } 33687 performAction() { 33688 ae().redo() 33689 } 33690} 33691let mv = new sD; 33692class Ai extends Ce {
33693 alignHor; 33694 alignVer; 33695 constructor(e, t) { 33696 let n = e || t || "" 33697 , s = n[0].toUpperCase() + n.slice(1) + (n === "center" ? e ? "Hor" : "Ver" : ""); 33698 super("align" + s, !0), 33699 this.alignHor = e, 33700 this.alignVer = t, 33701 Ie(V().selectedModels, o=>{ 33702 this.disabled = o.length < 1 33703 } 33704 ) 33705 } 33706 performAction(e) { 33707 yv(this.alignHor, this.alignHor, this.alignVer, this.alignVer, e) 33708 } 33709} 33710function oD(l, e, t) { 33711 return e === "left" ? l - t.x : e === "right" ? l - (t.x + t.width) : e === "center" ? l - (t.x + t.width / 2) : 0 33712} 33713function iD(l, e, t) { 33714 return e === "top" ? l - t.y : e === "bottom" ? l - (t.y + t.height) : e === "center" ? l - (t.y + t.height / 2) : 0 33715} 33716function yv(l, e, t, n, s) { 33717 let o = V() 33718 , i = o.selectedModels 33719 , r = i.length 33720 , a = !1; 33721 if (r > 0) { 33722 let d = s?.reference; 33723 d == null && (d = r === 1 ? "document" : "selection"); 33724 let u = s?.alignAsGroup, h, c; 33725 if (d === "document") 33726 c = o.activeDocument.getBounds(); 33727 else if (d === "selection") 33728 for (let m of i) { 33729 let b = m.getTransformedBounds(); 33730 c = c == null ? b : c.addRect(b) 33731 } 33732 else 33733 d === "firstSelected" ? (h = i.at(0), 33734 c = h.getTransformedBounds()) : (h = i.at(-1), 33735 c = h.getTransformedBounds()); 33736 let f; 33737 e === "left" ? f = c.x : e === "right" ? f = c.x + c.width : f = c.x + c.width / 2; 33738 let p; 33739 n === "top" ? p = c.y : n === "bottom" ? p = c.y + c.height : p = c.y + c.height / 2; 33740 let g; 33741 if (u) { 33742 for (let m of i) 33743 if (m !== h) { 33744 let b = m.getTransformedBounds(); 33745 g = g == null ? b : g.addRect(b) 33746 } 33747 } 33748 let y = []; 33749 for (let m of i) { 33750 let b = g || m.getTransformedBounds() 33751 , M = l == null ? 0 : oD(f, l, b) 33752 , S = t == null ? 0 : iD(p, t, b); 33753 if (M || S) { 33754 a = !0; 33755 let x = m.getAggregateTransform() 33756 , P = m.getParentModel().getAggregateTransform(); 33757 x.preTranslate(M, S).preMultiplyWith(P.invert()), 33758 y.push(x) 33759 } else 33760 y.push(m.getSelfTransform()) 33761 } 33762 a && z().setSelModelsTransforms(y, o.selectionTransform.clone(), !0) 33763 } 33764 return a 33765} 33766const rD = new Ai("left",null) 33767 , aD = new Ai("right",null) 33768 , dD = new Ai("center",null) 33769 , uD = new Ai(null,"top") 33770 , hD = new Ai(null,"bottom") 33771 , cD = new Ai(null,"center") 33772 , lh = 1 33773 , Rf = 2; 33774class Js extends Ce { 33775 direction; 33776 constructor(e) { 33777 super("distribute" + e[0].toUpperCase() + e.substring(1), !0), 33778 this.direction = e, 33779 Ie(V().selectedModels, t=>{ 33780 this.disabled = t.length < 2 33781 } 33782 ) 33783 } 33784 performAction(e) { 33785 let t = this.direction; 33786 t === "horBetween" ? wd(!0, e) : t === "verBetween" ? wd(!1, e) : Cc(t, e) 33787 } 33788} 33789function Cc(l, e, t) { 33790 let s = V().selectedModels 33791 , o = s.length 33792 , i = !1; 33793 if (o > 1) { 33794 let r = l 33795 , a = new Map; 33796 s.forEach((f,p)=>{ 33797 let g = f.getTransformedBounds(), y; 33798 r ? (y = g.x, 33799 e === "right" ? y += g.width : e === "center" && (y += g.width / 2)) : (y = g.y, 33800 e === "bottom" ? y += g.height : e === "center" && (y += g.height / 2)), 33801 a.set(p, y) 33802 } 33803 ); 33804 let d = [...Array(o).keys()].sort((f,p)=>a.get(f) - a.get(p)) 33805 , u = a.get(d.at(0)) 33806 , h = a.get(d.at(-1)) 33807 , c = []; 33808 d.forEach((f,p)=>{ 33809 let g = 0, y = 0, m = a.get(f), b; 33810 if (t && t.mode === Rf) { 33811 let S = t.distance || 0; 33812 e === "left" || e === "top" ? b = u + p * S : e === "right" || e === "bottom" ? b = h - (o - p - 1) * S : b = (u + h) / 2 - o * S / 2 + p * S 33813 } else 33814 b = u + p * (h - u) / (o - 1); 33815 r ? g = b - m : y = b - m; 33816 let M = s[f]; 33817 if (g || y) { 33818 i = !0; 33819 let S = M.getAggregateTransform() 33820 , x = M.getParentModel().getAggregateTransform(); 33821 S.preTranslate(g, y).preMultiplyWith(x.invert()), 33822 c[f] = S 33823 } else
33824 c[f] = M.getSelfTransform() 33825 } 33826 ), 33827 i && z().setSelModelsTransforms(c, V().selectionTransform.clone(), !0) 33828 } 33829 return i 33830} 33831function wd(l=!1, e) { 33832 let t = e && e.mode === Rf ? e.distance : null 33833 , n = store.selectedModels 33834 , s = n.length; 33835 if (s < 2) 33836 return; 33837 let o = new Map; 33838 n.forEach(y=>o.set(y, y.getTransformedBounds())); 33839 let i = [...Array(s).keys()].sort((y,m)=>{ 33840 let b = o.get(n[y]) 33841 , M = o.get(n[m]); 33842 return l ? b.x + b.width / 2 - (M.x + M.width / 2) : b.y + b.height / 2 - (M.y + M.height / 2) 33843 } 33844 ) 33845 , r = o.get(n[i[0]]) 33846 , a = l ? r.x : r.y 33847 , d = -Number.MAX_VALUE 33848 , u = null 33849 , h = 0; 33850 for (let y = 0; y < s; y++) { 33851 let m = n[y] 33852 , b = o.get(m) 33853 , M = l ? b.x : b.y 33854 , S = l ? b.width : b.height; 33855 M + S > d && (d = M + S, 33856 u = m), 33857 h += S 33858 } 33859 let c = 0; 33860 t == null ? t = (d - a - h) / (s - 1) : c = (d - a - (h + t * (s - 1))) / 2; 33861 let f = [] 33862 , p = a + c 33863 , g = !1; 33864 for (let y of i) { 33865 let m = n[y] 33866 , b = m.getSelfTransform(); 33867 if (c !== 0 || m !== u) { 33868 let M = o.get(m) 33869 , S = l ? p - M.x : 0 33870 , x = l ? 0 : p - M.y; 33871 if (S || x) { 33872 g = !0, 33873 b = m.getAggregateTransform(); 33874 let P = m.getParentModel().getAggregateTransform(); 33875 b.preTranslate(S, x).preMultiplyWith(P.invert()) 33876 } else 33877 b = m.getSelfTransform(); 33878 p += (l ? M.width : M.height) + t 33879 } 33880 f[y] = b 33881 } 33882 if (g) { 33883 let y = V().selectionTransform.clone(); 33884 z().setSelModelsTransforms(f, y, !0) 33885 } 33886 return g 33887} 33888function fD(l, e, t) { 33889 l === "between" ? wd(!0, t) : l != null && Cc(!0, l, t), 33890 e === "between" ? wd(!1, t) : e != null && Cc(!1, e, t) 33891} 33892const pD = new Js("horLeft") 33893 , gD = new Js("horRight") 33894 , mD = new Js("horCenter"); 33895new Js("horBetween"); 33896const yD = new Js("verTop") 33897 , vD = new Js("verBottom") 33898 , bD = new Js("verCenter"); 33899new Js("verBetween"); 33900class MD extends Ce { 33901 constructor() { 33902 super("oneToFront", !0), 33903 Ie(V().selectedModels, e=>{ 33904 this.disabled = e.length < 1 33905 } 33906 ) 33907 } 33908 performAction() { 33909 let t = V().selectedModels; 33910 if (t.length > 0) { 33911 let n = ae(); 33912 n.startCompoundEdit(); 33913 let s = z(); 33914 for (let o of t) { 33915 let i = o.getParentModel(); 33916 if (i != null) { 33917 let r = i.getChildModelIndex(o); 33918 r < i._childModels.length - 1 && (s.removeModelAt(i, r), 33919 s.insertModelAt(o, i, r + 1)) 33920 } 33921 } 33922 n.endCompoundEdit() 33923 } 33924 } 33925} 33926let vv = new MD; 33927class SD extends Ce { 33928 constructor() { 33929 super("toFront", !0), 33930 Ie(V().selectedModels, e=>{ 33931 this.disabled = e.length < 1 33932 } 33933 ) 33934 } 33935 performAction() { 33936 let t = V().selectedModels; 33937 if (t.length > 0) { 33938 let n = ae(); 33939 n.startCompoundEdit(); 33940 let s = z(); 33941 for (let o of t) { 33942 let i = o.getDocumentModel() 33943 , r = o.getParentModel(); 33944 if (r != null) { 33945 let a = r.getChildModelIndex(o); 33946 (r !== i || a < i.getChildModelCount() - 1) && (s.removeModelAt(r, a), 33947 s.insertModelAt(o, i, i.getChildModelCount())) 33948 } 33949 } 33950 n.endCompoundEdit() 33951 } 33952 } 33953} 33954let bv = new SD; 33955class wD extends Ce { 33956 constructor() { 33957 super("oneToBack", !0), 33958 Ie(V().selectedModels, e=>{ 33959 this.disabled = e.length < 1 33960 } 33961 ) 33962 } 33963 performAction() { 33964 let t = V().selectedModels; 33965 if (t.length > 0) { 33966 let n = ae(); 33967 n.startCompoundEdit(); 33968 let s = z(); 33969 for (let o of t) { 33970 let i = o.getParentModel(); 33971 if (i != null) { 33972 let r = i.getChildModelIndex(o); 33973 r > 0 && (s.removeModelAt(i, r), 33974 s.insertModelAt(o, i, r - 1)) 33975 } 33976 } 33977 n.endCompoundEdit() 33978 } 33979 } 33980} 33981let Mv = new wD; 33982class PD extends Ce { 33983 constructor() { 33984 super("toBack", !0), 33985 Ie(V().selectedModels, e=>{ 33986 this.disabled = e.length < 1 33987 } 33988 ) 33989 } 33990 performAction() { 33991 let t = V().selectedModels; 33992 if (t.length > 0) { 33993 let n = z() 33994 , s = ae(); 33995 s.startCompoundEdit(); 33996 for (let o of t) { 33997 let i = o.getDocumentModel() 33998 , r = o.getParentModel(); 33999 if (r != null) { 34000 let a = r.getChildModelIndex(o); 34001 (r !== i || a > 0) && (n.removeModelAt(r, a), 34002 n.insertModelAt(o, i, 0)) 34003 } 34004 } 34005 s.endCompoundEdit() 34006 } 34007 } 34008} 34009let Sv = new PD; 34010class xD extends Ce { 34011 constructor() { 34012 super("duplicate", !0), 34013 Ie(V().selectedModels, e=>{ 34014 this.disabled = e.length < 1 34015 } 34016 ) 34017 } 34018 performAction() { 34019 let e = z() 34020 , n = V().selectedModels; 34021 if (n.length > 0) { 34022 let s = ae(); 34023 s.startCompoundEdit(); 34024 for (let o of n) { 34025 let i = o.clone() 34026 , r = o.getParentModel(); 34027 if (r != null) { 34028 let a = r.getChildModelIndex(o); 34029 e.insertModelAt(i, r, a) 34030 } 34031 } 34032 s.endCompoundEdit() 34033 } 34034 } 34035} 34036let wv = new xD; 34037class CD extends Ce { 34038 constructor() { 34039 super("deleteSelection", !0), 34040 Ie(V().selectedModels, e=>{ 34041 this.disabled = e.length === 0 34042 } 34043 ) 34044 } 34045 performAction() { 34046 Pv() 34047 } 34048} 34049function Pv() { 34050 let l = V() 34051 , e = z() 34052 , t = ae(); 34053 t.startCompoundEdit(); 34054 let n = l.tool; 34055 if (n && n.name === "nodes" && e.sortedSelNodePoints.length > 0) 34056 e.deleteSelectedNodePoints(); 34057 else { 34058 let s = l.selectedModels.slice(); 34059 e.setModelsSelected(null, s), 34060 e.removeModels(s) 34061 } 34062 t.endCompoundEdit() 34063} 34064const xv = new CD; 34065let _D = { 34066 openFile: "Ctrl+O", 34067 saveFileAs: "Ctrl+S", 34068 cut: "Ctrl+X", 34069 copy: "Ctrl+C", 34070 paste: "Ctrl+V", 34071 print: "Ctrl+P", 34072 deleteSelection: "Delete", 34073 settings: "", 34074 selectAll: "Ctrl+A", 34075 toPath: "", 34076 strokeToPath: "", 34077 about: "", 34078 newDocument: "", 34079 docProperties: "", 34080 toSmooth: "", 34081 toCorner: "",
34082 toLine: "", 34083 toCurve: "", 34084 booleanUnite: "", 34085 booleanSubtract: "", 34086 booleanIntersect: "", 34087 undo: "Ctrl+Z", 34088 redo: "Ctrl+Shift+Z", 34089 toggleRulers: "", 34090 toggleTooltips: "", 34091 accentColor: "", 34092 fullscreen: "F11", 34093 toggleDarkMode: "", 34094 group: "", 34095 ungroup: "", 34096 alignLeft: "", 34097 alignRight: "", 34098 alignCenterHor: "", 34099 alignTop: "", 34100 alignBottom: "", 34101 alignCenterVer: "", 34102 duplicate: "Ctrl+D", 34103 zoomIn: "Ctrl++", 34104 zoomOut: "Ctrl+-" 34105}, TD = { 34106 openFile: "âO", 34107 saveFileAs: "âS", 34108 cut: "âX", 34109 copy: "âC", 34110 paste: "âV", 34111 deleteSelection: "Delete", 34112 print: "âP", 34113 settings: "", 34114 selectAll: "âA", 34115 toPath: "", 34116 strokeToPath: "", 34117 about: "", 34118 newDocument: "", 34119 docProperties: "", 34120 toSmooth: "", 34121 toCorner: "", 34122 toLine: "", 34123 toCurve: "", 34124 booleanUnite: "", 34125 booleanSubtract: "", 34126 booleanIntersect: "", 34127 undo: "âZ", 34128 redo: "â§âZ", 34129 toggleRulers: "", 34130 toggleTooltips: "", 34131 accentColor: "", 34132 fullscreen: "âF", 34133 toggleDarkMode: "", 34134 group: "", 34135 ungroup: "", 34136 alignLeft: "", 34137 alignRight: "", 34138 alignCenterHor: "", 34139 alignTop: "", 34140 alignBottom: "", 34141 alignCenterVer: "", 34142 duplicate: "âD", 34143 zoomIn: "â+", 34144 zoomOut: "â-" 34145}, kD = [M6, g8, b8, v8, xv, _8, T8, E8, ok, ov, iv, dk, ck, GE, wk, Dk, Gk, iE, fE, yd, vd, bd, Md, If, Lf, Vf, Nf, gv, mv, PE, CE, VE, RE, BE, TE, dv, uv, YE, WE, rD, aD, dD, uD, hD, cD, pD, mD, gD, yD, bD, vD, vv, bv, Mv, Sv, wv, hv, cv, tD, lD, fv, pv], vr, nh, Ga, Cv = An ? {} : jm ? TD : _D; 34146for (let l of kD) 34147 OD(l.name, l, Cv[l.name]); 34148function _c(l, e) { 34149 if (l != null) { 34150 let t = vr[l]; 34151 if (t != null) { 34152 let n = t.performAction(e); 34153 return n ?? !0 34154 } 34155 } 34156 return !1 34157} 34158function ED(l) { 34159 return Cv[l] 34160} 34161function _g(l) { 34162 return vr[l] 34163} 34164function DD(l) { 34165 return Ga.get(l) 34166} 34167function OD(l, e, t) { 34168 vr === void 0 && (vr = {}), 34169 nh === void 0 && (nh = {}), 34170 Ga === void 0 && (Ga = new Map), 34171 vr[l] = e, 34172 nh[l] = t, 34173 t != null && Ga.set(t, l) 34174} 34175const AD = '<svg viewBox="0 0 22 22" width="22" height="22" fill="currentColor"><path d="M2.44 11.06c-0.59-0.59-0.59-1.53 0-2.12 0.59-0.59 1.53-0.59 2.12 0l2.94 2.94 7.44-7.44c0.59-0.59 1.53-0.59 2.12 0 0.59 0.59 0.59 1.53 0 2.12l-8.5 8.5c-0.59 0.59-1.53 0.59-2.12 0z"/></svg>' 34176 , ID = { 34177 name: "HyMenuItem", 34178 props: { 34179 actionName: String, 34180 itemData: Object, 34181 itemIndex: Number, 34182 selected: Boolean, 34183 isIconless: Boolean 34184 }, 34185 data() { 34186 return { 34187 componentName: null, 34188 actionObj: null, 34189 shortcut: null, 34190 isSubmenu: !1, 34191 iconSvg: null 34192 } 34193 }, 34194 computed: { 34195 label() { 34196 return this.itemData?.label ? this.$t(this.itemData.label, null) : this.itemData?.name ? this.$t("menus." + this.itemData.name + ".label", null) : this.actionName ? this.$t("actions." + this.actionName, null) : "" 34197 }, 34198 affixHtml() { 34199 return this.itemData?.labelAffixHtml ? this.itemData.labelAffixHtml : "" 34200 }, 34201 mnemonicCharIndex() { 34202 let l = "menus." + this.actionName + ".mnemonic" 34203 , e = this.$i18n.global.te(l) ? this.$t(l) : "" 34204 , t = this.label; 34205 return e && t ? t.toLowerCase().indexOf(e.toLowerCase()) : -1 34206 }, 34207 labelStart() { 34208 let l = this.label || "" 34209 , e = this.mnemonicCharIndex; 34210 return e > 0 ? l.substring(0, e) : "" 34211 }, 34212 labelEnd() { 34213 let l = this.label || "" 34214 , e = this.mnemonicCharIndex; 34215 return e >= 0 ? l.substring(e + 1) : l 34216 }, 34217 labelMnemonic() { 34218 let l = this.label || "" 34219 , e = this.mnemonicCharIndex; 34220 return e >= 0 ? l.charAt(e) : "" 34221 }, 34222 checked() { 34223 return !!this.actionObj?.selected 34224 }, 34225 disabled() { 34226 return !this.isSubmenu && !!this.actionObj?.disabled 34227 }, 34228 selectable() { 34229 return this.componentName == null && !this.disabled 34230 } 34231 }, 34232 emits: ["actionPerformed"], 34233 mounted() { 34234 this.componentName = this.itemData?.componentName, 34235 this.actionObj = this.itemData?.actionObj ?? _g(this.actionName), 34236 this.shortcut = this.actionObj?.shortcut ?? ED(this.actionName), 34237 this.isSubmenu = !!this.itemData?.itemDatas, 34238 this.actionObj?.isToggleAction ? this.iconSvg = this.checked ? AD : "" : this.iconSvg = this.actionObj?.iconSvg ?? o_(this.actionName) 34239 }, 34240 methods: { 34241 performAction() { 34242 if (!this.isSubmenu) { 34243 let l = this.itemData 34244 , e = l.actionName 34245 , t = l.actionObj || _g(e); 34246 if (!t || t.disabled) 34247 return; 34248 t.performAction ? t.performAction() : _c(e), 34249 this.$emit("actionPerformed", e) 34250 } 34251 } 34252 } 34253} 34254 , LD = ["innerHTML"] 34255 , VD = { 34256 class: "hy-menu-item-label" 34257} 34258 , ND = { 34259 class: "hy-menu-item-mnemonic" 34260} 34261 , RD = ["innerHTML"] 34262 , FD = { 34263 key: 3, 34264 class: "hy-menu-item-arrow" 34265} 34266 , BD = { 34267 key: 4, 34268 class: "hy-menu-item-shortcut" 34269}; 34270function zD(l, e, t, n, s, o) { 34271 return N(), 34272 $("div", { 34273 ref: "menuItem", 34274 class: Ne(["hy-menu-item", { 34275 "hy-selected": o.selectable && t.selected, 34276 "hy-disabled": o.disabled 34277 }]) 34278 }, [t.isIconless ? be("", !0) : (N(), 34279 $("div", { 34280 key: 0, 34281 class: "hy-menu-item-icon", 34282 innerHTML: s.iconSvg 34283 }, null, 8, LD)), _("div", VD, [_("span", null, se(o.labelStart), 1), _("span", ND, se(o.labelMnemonic), 1), _("span", null, se(o.labelEnd), 1)]), s.componentName ? (N(), 34284 pe(G1(s.componentName), { 34285 key: 1 34286 })) : be("", !0), o.affixHtml ? (N(), 34287 $("div", { 34288 key: 2, 34289 innerHTML: o.affixHtml 34290 }, null, 8, RD)) : s.isSubmenu ? (N(), 34291 $("div", FD, [...e[0] || (e[0] = [_("svg", {
34292 viewBox: "0 0 16 16", 34293 width: "16", 34294 height: "16" 34295 }, [_("path", { 34296 d: "M5.3 4.7c-0.4-0.4-0.4-1 0-1.4 0.4-0.4 1-0.4 1.4 0l4 4c0.4 0.4 0.4 1 0 1.4l-4 4c-0.4 0.4-1 0.4-1.4 0-0.4-0.4-0.4-1 0-1.4l3.3-3.3-3.3-3.3z", 34297 fill: "currentColor", 34298 opacity: "0.7" 34299 })], -1)])])) : s.shortcut ? (N(), 34300 $("div", BD, se(s.shortcut), 1)) : be("", !0)], 2) 34301} 34302const UD = ie(ID, [["render", zD]]) 34303 , GD = { 34304 name: "HyMenu", 34305 components: { 34306 HyMenuItem: UD, 34307 HyPopover: Ql 34308 }, 34309 props: { 34310 itemDatas: Array, 34311 isIconless: Boolean, 34312 isOpen: Boolean, 34313 getSource: Function, 34314 getSourceBounds: Function, 34315 isSubmenu: Boolean, 34316 useBackdrop: Boolean, 34317 menuContentStyle: Object 34318 }, 34319 data() { 34320 return { 34321 selIndex: -1, 34322 submenuTrianglePoint: null, 34323 isSubmenuOpen: !1, 34324 submenuItemIndex: null, 34325 submenuItems: null, 34326 submenuSourceBounds: null, 34327 menuItems: me([]) 34328 } 34329 },
34330 emits: ["actionPerformed", "close", "focusOut"], 34331 watch: { 34332 isOpen: { 34333 handler(l) { 34334 l ? this.addKeydownListener() : (this.setItemSelected(-1), 34335 this.closeSubmenu(), 34336 this.removeKeydownListener(), 34337 this.selIndex = -1) 34338 }, 34339 immediate: !0 34340 } 34341 }, 34342 unmounted() { 34343 this.removeKeydownListener() 34344 }, 34345 methods: { 34346 isMouseEvent(l) { 34347 return l.pointerType !== "pen" && l.pointerType !== "touch" 34348 }, 34349 layout() { 34350 this.$refs.popover.layout() 34351 }, 34352 onActionPerformed(l) { 34353 this.$emit("actionPerformed", l) 34354 }, 34355 onPointerleave(l) { 34356 this.isMouseEvent(l) && (this.submenuItemIndex !== this.selIndex && this.setItemSelected(-1), 34357 this.submenuTrianglePoint = null) 34358 }, 34359 onPointerdownOutside(l) { 34360 !this.isSubmenu && !(this.getSource && this.getSource().contains(l.target)) && this.$emit("close") 34361 }, 34362 onKeydown(l) { 34363 let e = l.key 34364 , t = this.selIndex 34365 , n = !1; 34366 e === "ArrowUp" ? this.isSubmenuOpen || (this.selectPrevious(), 34367 n = !0) : e === "ArrowDown" ? this.isSubmenuOpen || (this.selectNext(), 34368 n = !0) : e === "ArrowRight" ? this.isSubmenuOpen || (t >= 0 ? this.itemDatas[t].itemDatas && (this.openSubmenu(t, !0), 34369 n = !0) : this.isSubmenu && this.selectFirst()) : e === "ArrowLeft" ? this.isSubmenu && (this.$emit("close", this), 34370 n = !0) : e === " " || e === "Enter" ? t >= 0 ? this.isSubmenuOpen || (this.itemDatas[t].itemDatas ? this.openSubmenu(t, !0) : this.menuItems[t].performAction(), 34371 n = !0) : (this.$emit("close", this), 34372 n = !0) : e === "Tab" ? this.$emit("close", this) : e === "Escape" && this.$emit("close", this), 34373 n && l.preventDefault() 34374 }, 34375 addKeydownListener() { 34376 document.addEventListener("keydown", this.onKeydown, !0) 34377 }, 34378 removeKeydownListener() { 34379 document.removeEventListener("keydown", this.onKeydown, !0) 34380 }, 34381 selectFirst() { 34382 let e = this.menuItems.find(t=>t && t.selectable); 34383 e && this.setItemSelected(e.itemIndex) 34384 }, 34385 selectNext() { 34386 let l = this.menuItems 34387 , e = this.selIndex 34388 , t = l.find((s,o)=>o > e && s && s.selectable); 34389 t == null && e !== -1 && (t = l.find(s=>s && s.selectable)); 34390 let n = t ? t.itemIndex : -1; 34391 this.setItemSelected(n) 34392 }, 34393 selectPrevious() { 34394 let l = this.menuItems 34395 , e = this.selIndex 34396 , t = l.findLast((s,o)=>o < e && s && s.selectable); 34397 t == null && e !== -1 && (t = l.findLast(s=>s && s.selectable)); 34398 let n = t ? t.itemIndex : -1; 34399 this.setItemSelected(n) 34400 }, 34401 setItemSelected(l) { 34402 this.selIndex = l 34403 }, 34404 openSubmenu(l, e=!1) { 34405 let t = this.itemDatas[l].itemDatas 34406 , n = this.menuItems[l]; 34407 if (n) { 34408 let o = n.$el.getBoundingClientRect(); 34409 this.submenuSourceBounds = new Ve(o.x + o.width - 4,o.y,1,1), 34410 this.submenuItems = t, 34411 this.isSubmenuOpen = !0, 34412 this.submenuItemIndex = l, 34413 el(()=>{ 34414 this.$refs.submenu && this.$refs.submenu.layout() 34415 } 34416 ), 34417 e && el(()=>this.$refs.submenu.selectFirst()) 34418 } 34419 }, 34420 closeSubmenu() { 34421 this.isSubmenuOpen = !1, 34422 this.submenuItemIndex = -1, 34423 this.submenuTrianglePoint = null 34424 }, 34425 updateSubmenuTrianglePoint(l) { 34426 this.submenuTrianglePoint != null && this.submenuTrianglePoint.x < l.clientX && this.submenuTrianglePoint.set(l.clientX, l.clientY) 34427 }, 34428 insideSubmenuTriangle(l) { 34429 let e = this.submenuTrianglePoint; 34430 if (e) { 34431 let t = l.clientX 34432 , n = l.clientY 34433 , o = this.$refs.submenu.$refs.content.getBoundingClientRect() 34434 , i = o.x 34435 , r = o.y 34436 , a = o.y + o.height 34437 , d = e.x 34438 , u = e.y; 34439 return t >= d && n >= u && Bh(d, u, i, r, t, n, !0, !1, !0) < 2 && Bh(d, u, i, a, t, n, !0, !1, !0) > -2 34440 } 34441 return !1 34442 }, 34443 onPointermove(l) { 34444 this.isMouseEvent(l) && (this.isSubmenuOpen ? this.insideSubmenuTriangle(l) ? this.updateSubmenuTrianglePoint(l) : (this.closeSubmenu(), 34445 this.setItemSelected(-1)) : this.setItemSelected(-1)) 34446 }, 34447 onMenuItemTouchstart(l, e) { 34448 this.isSubmenuOpen && e === this.selIndex ? (this.closeSubmenu(), 34449 this.setItemSelected(e), 34450 l.preventDefault()) : (this.setItemSelected(e), 34451 this.itemDatas[e].itemDatas && (this.openSubmenu(e), 34452 l.preventDefault())) 34453 }, 34454 onMenuItemPointermove(l, e) { 34455 this.isMouseEvent(l) && (this.isSubmenuOpen ? e === this.submenuItemIndex ? this.submenuTrianglePoint = new B(l.clientX,l.clientY) : this.insideSubmenuTriangle(l) ? this.updateSubmenuTrianglePoint(l) : this.closeSubmenu() : this.selIndex !== e && (this.setItemSelected(e), 34456 this.itemDatas[e].itemDatas && this.openSubmenu(e)), 34457 l.stopPropagation()) 34458 }, 34459 onMenuItemClick(l, e) { 34460 if (l.defaultPrevented || l.button !== 0 && this.isMouseEvent(l)) 34461 return; 34462 let t = this.menuItems[e]; 34463 t.isSubmenu ? this.isSubmenuOpen ? this.closeSubmenu() : this.openSubmenu(e) : t.performAction() 34464 } 34465 } 34466}; 34467function HD(l, e, t, n, s, o) { 34468 const i = E("hy-menu-item") 34469 , r = E("hy-popover") 34470 , a = E("hy-menu"); 34471 return N(), 34472 $(Pe, null, [w(r, Wl({ 34473 ref: "popover", 34474 show: t.isOpen, 34475 primaryPos: "bottom", 34476 secondaryPos: "start", 34477 getSource: t.getSource, 34478 getSrcBounds: t.getSourceBounds, 34479 arrowSize: 0, 34480 class: "hy-elevation-10", 34481 style: { 34482 "border-radius": "8px" 34483 }, 34484 "use-backdrop": !1, 34485 onPointermove: o.onPointermove, 34486 onPointerleave: o.onPointerleave, 34487 onPointercancel: o.onPointerleave, 34488 onPointerdownOutside: o.onPointerdownOutside, 34489 role: "menu" 34490 }, l.$attrs), { 34491 default: O(()=>[_("div", { 34492 class: "hy-menu-content", 34493 ref: "content", 34494 style: xe(t.menuContentStyle) 34495 }, [(N(!0), 34496 $(Pe, null, Gt(t.itemDatas, (d,u)=>(N(), 34497 $(Pe, { 34498 key: d 34499 }, [d === "-" ? (N(), 34500 $("div", { 34501 key: 0, 34502 class: "hy-menu-separator", 34503 ref_for: !0, 34504 ref: ()=>
34504s.menuItems[u] = null 34505 }, null, 512)) : d ? (N(), 34506 pe(i, { 34507 key: 1, 34508 ref_for: !0, 34509 ref: h=>s.menuItems[u] = h, 34510 actionName: d.actionName, 34511 itemIndex: u, 34512 itemData: d, 34513 isIconless: t.isIconless, 34514 selected: s.selIndex === u, 34515 onPointermove: h=>o.onMenuItemPointermove(h, u), 34516 onActionPerformed: o.onActionPerformed, 34517 onTouchstart: h=>o.onMenuItemTouchstart(h, u), 34518 onClick: h=>o.onMenuItemClick(h, u) 34519 }, null, 8, ["actionName", "itemIndex", "itemData", "isIconless", "selected", "onPointermove", "onActionPerformed", "onTouchstart", "onClick"])) : be("", !0)], 64))), 128))], 4)]), 34520 _: 1 34521 }, 16, ["show", "getSource", "getSrcBounds", "onPointermove", "onPointerleave", "onPointercancel", "onPointerdownOutside"]), s.isSubmenuOpen ? (N(), 34522 pe(a, { 34523 key: 0, 34524 ref: "submenu", 34525 isOpen: "", 34526 "is-submenu": "", 34527 itemDatas: s.submenuItems, 34528 onClose: o.closeSubmenu, 34529 onActionPerformed: o.onActionPerformed, 34530 getSourceBounds: ()=>s.submenuSourceBounds 34531 }, null, 8, ["itemDatas", "onClose", "onActionPerformed", "getSourceBounds"])) : be("", !0)], 64) 34532} 34533const Ff = ie(GD, [["render", HD]]) 34534 , $D = { 34535 name: "EditorMenu", 34536 components: { 34537 HyMenu: Ff 34538 }, 34539 data() { 34540 return { 34541 isMenuOpen: !1, 34542 contextMenuActions: qn([]), 34543 getContextMenuBounds: null 34544 } 34545 }, 34546 methods: { 34547 open(l, e, t, n) { 34548 this.getContextMenuBounds = ()=>new Ve(l,e,1,1), 34549 this.updateMenuActions(t, n), 34550 this.isMenuOpen = !0 34551 }, 34552 close() { 34553 this.isMenuOpen = !1 34554 }, 34555 updateMenuActions(l, e) { 34556 let t = this.$store.tool.getContextActions(l, e) || []; 34557 t.push({ 34558 actionName: "cut" 34559 }, { 34560 actionName: "copy" 34561 }, { 34562 actionName: "paste" 34563 }, null, { 34564 actionName: "duplicate" 34565 }, { 34566 actionName: "selectAll" 34567 }, { 34568 actionName: "selectNone" 34569 }, { 34570 actionName: "deleteSelection" 34571 }, null, { 34572 actionName: "group" 34573 }, { 34574 actionName: "ungroup" 34575 }, null, { 34576 label: "actions.align", 34577 itemDatas: [{ 34578 actionName: "alignLeft" 34579 }, { 34580 actionName: "alignRight" 34581 }, { 34582 actionName: "alignCenterHor" 34583 }, { 34584 actionName: "alignTop" 34585 }, { 34586 actionName: "alignBottom" 34587 }, { 34588 actionName: "alignCenterVer" 34589 }] 34590 }, { 34591 label: "actions.arrange", 34592 itemDatas: [{ 34593 actionName: "toFront" 34594 }, { 34595 actionName: "toBack" 34596 }, { 34597 actionName: "oneToFront" 34598 }, { 34599 actionName: "oneToBack" 34600 }] 34601 }, null, { 34602 actionName: "toPath" 34603 }, { 34604 actionName: "strokeToPath" 34605 }), 34606 this.contextMenuActions = qn(t) 34607 } 34608 } 34609}; 34610function XD(l, e, t, n, s, o) { 34611 const i = E("hy-menu"); 34612 return N(), 34613 pe(i, { 34614 isOpen: s.isMenuOpen, 34615 onClose: o.close, 34616 onActionPerformed: o.close, 34617 itemDatas: s.contextMenuActions, 34618 getSourceBounds: s.getContextMenuBounds 34619 }, null, 8, ["isOpen", "onClose", "onActionPerformed", "itemDatas", "getSourceBounds"]) 34620} 34621const YD = ie($D, [["render", XD]]) 34622 , Ss = [2.33, 3.125, 4.67, 6.25, 8.33, 12.5, 16.67, 25, 33.33, 50, 66.67, 100, 150, 200, 300, 400, 600, 800, 1200, 1600, 2400, 3200, 4800, 6400, 9600] 34623 , KD = { 34624 name: "Editor", 34625 components: { 34626 EditorMenu: YD, 34627 HyScrollview: $o,
34628 Ruler: V3 34629 }, 34630 data() { 34631 return { 34632 targetZoom: 100, 34633 showOverlay: !0 34634 } 34635 }, 34636 computed: { 34637 showRulers() { 34638 return this.$store.appSettings.ui.showRulers 34639 }, 34640 svg() { 34641 let l = this.activeDocument; 34642 return l == null ? null : l.baseElement 34643 }, 34644 svgWidth() { 34645 let l = this.activeDocument; 34646 return l == null ? 0 : l.getWidth() 34647 }, 34648 svgHeight() { 34649 let l = this.activeDocument; 34650 return l == null ? 0 : l.getHeight() 34651 }, 34652 activeDocument() { 34653 return V().activeDocument 34654 }, 34655 gridSettings() { 34656 return V().appSettings.editor.grid 34657 }, 34658 isMobile() { 34659 return An 34660 } 34661 }, 34662 created() { 34663 this.requestedAnimationFrame = null 34664 }, 34665 mounted() { 34666 this.viewport = this.$refs.svgViewport.$el.children[0]; 34667 let l = this.viewport; 34668 y_("svgViewport", l), 34669 this.svgViewportObserver = new ResizeObserver(this.handleResize), 34670 this.svgViewportObserver.observe(l), 34671 l.addEventListener("wheel", this.onViewportWheel, { 34672 capture: !0 34673 }), 34674 l.addEventListener("scroll", this.onViewportScroll, { 34675 passive: !0 34676 }), 34677 l.addEventListener("pointermove", this.onViewportPointermove, { 34678 capture: !0 34679 }), 34680 document.addEventListener("keydown", this.onKeydown), 34681 document.addEventListener("keyup", this.onKeyup), 34682 document.addEventListener("focusout", this.onFocusout), 34683 I_(this), 34684 this.updateLayout() 34685 }, 34686 beforeUnmount() { 34687 this.svgViewportObserver.disconnect(); 34688 let l = this.viewport; 34689 l.removeEventListener("wheel", this.onViewportWheel, { 34690 capture: !0 34691 }), 34692 l.removeEventListener("scroll", this.onViewportScroll, { 34693 passive: !0 34694 }), 34695 l.removeEventListener("pointermove", this.onViewportPointermove, { 34696 capture: !0 34697 }), 34698 document.removeEventListener("keydown", this.onKeydown), 34699 document.removeEventListener("keyup", this.onKeyup), 34700 document.removeEventListener("focusout", this.onFocusout) 34701 }, 34702 methods: { 34703 getSvg() { 34704 return this.$refs.svgContainer.children[2] 34705 }, 34706 getSvgEventOverlay() { 34707 return this.$refs.svgContainer.children[1] 34708 }, 34709 getSvgOverlay() { 34710 return this.$refs.svgContainer.children[3] 34711 }, 34712 onRightPointerClickEvent(l, e, t) { 34713 l.ctrlKey || this.$refs.contextMenu.open(l.clientX, l.clientY, e, t) 34714 }, 34715 async setDocumentModel(l) { 34716 let e = this.getSvg() 34717 , t = l.baseElement; 34718 t.setAttribute("id", "svgNew"), 34719 e.replaceWith(t), 34720 this.updateLayout(), 34721 this.updateSvgClientBounds(); 34722 let n = this.getSvgEventOverlay() 34723 , s = k_(t); 34724 s.style.setProperty("--tolerance", 500 / this.$store.zoom + "px"), 34725 n.replaceWith(s), 34726 this.updateLayout(), 34727 this.updateSvgClientBounds() 34728 }, 34729 setDocumentSize(l, e) { 34730 this.$store.zoom = 100, 34731 this.targetZoom = 100,
34732 this.getSvg().setAttribute("viewBox", "0 0 " + l + " " + e), 34733 this.getSvgEventOverlay().setAttribute("viewBox", "0 0 " + l + " " + e), 34734 this.getSvgOverlay().setAttribute("viewBox", "0 0 " + l + " " + e), 34735 this.updateLayout(); 34736 let o = this.viewport 34737 , i = o.clientWidth 34738 , r = o.clientHeight 34739 , a = (i + l) / 2 34740 , d = (r + e) / 2; 34741 o.scrollLeft = a, 34742 o.scrollTop = d, 34743 this.updateRulers(), 34744 this.updateSvgClientBounds(), 34745 this.updateOutsideMask(), 34746 j().updateGrid() 34747 }, 34748 handleResize(l) { 34749 let e = this.viewportBounds 34750 , t = l[0].contentRect 34751 , n = this.viewport 34752 , s = n.scrollLeft 34753 , o = n.scrollTop; 34754 if (this.viewportBounds = t, 34755 this.updateLayout(), 34756 e != null) { 34757 let i = this.$store.zoom 34758 , r = Math.max(1, i / 100) 34759 , a = s + (t.width - e.width) * r 34760 , d = o + (t.height - e.height) * r; 34761 n.scrollTo({ 34762 left: a, 34763 top: d, 34764 behavior: "instant" 34765 }) 34766 } 34767 this.updateRulers() 34768 }, 34769 zoomToDocument() { 34770 let l = this.svgWidth 34771 , e = this.svgHeight; 34772 this.zoomToBounds(new Ve(0,0,l,e)) 34773 }, 34774 zoomToSelection() { 34775 let l = this.$store.selectionBounds?.clone().transform(this.$store.selectionTransform); 34776 l ? this.zoomToBounds(l) : this.zoomToDocument() 34777 }, 34778 centerDocument(l=!0) { 34779 const e = { 34780 x: 0, 34781 y: 0, 34782 width: this.svgWidth, 34783 height: this.svgHeight 34784 }; 34785 this.centerRect(e, l) 34786 }, 34787 centerSelection() { 34788 let l = this.$store.selectionBounds?.clone().transform(this.$store.selectionTransform); 34789 l ? this.centerRect(l) : this.centerDocument() 34790 }, 34791 centerRect(l, e=!0) { 34792 const t = this.viewport 34793 , n = t.getBoundingClientRect() 34794 , s = this.$store.zoom 34795 , o = Math.max(1, s / 100) * n.width 34796 , i = Math.max(1, s / 100) * n.height 34797 , r = l.width * s / 100 34798 , a = l.height * s / 100 34799 , d = l.x * s / 100 34800 , u = l.y * s / 100 34801 , h = o + d + r / 2 - n.width / 2 34802 , c = i + u + a / 2 - n.height / 2; 34803 t.scrollTo({ 34804 left: h, 34805 top: c, 34806 behavior: e ? "smooth" : "auto" 34807 }), 34808 this.updateRulers(), 34809 this.updateSvgClientBounds() 34810 }, 34811 zoomToBounds(l, e=32, t=!0) { 34812 if (l == null) 34813 return; 34814 let n = this.viewport 34815 , s = n.getBoundingClientRect() 34816 , o = s.width 34817 , i = s.height 34818 , r = o / (l.width + 2 * e) 34819 , a = i / (l.height + 2 * e) 34820 , d = Math.floor(Math.min(r, a) * 100) 34821 , u = this.$store.zoom 34822 , h = l.x + l.width / 2 34823 , c = l.y + l.height / 2 34824 , f = t ? 250 : 0; 34825 if (f === 0) { 34826 let P = s.x + o / 2 34827 , C = s.y + i / 2; 34828 this.zoomTo(d, u, P, C, h, c, 0, 0, null, null, 0); 34829 return 34830 } 34831 let p = Math.max(1, u / 100) * o 34832 , g = Math.max(1, u / 100) * i 34833 , y = h * u / 100 + p - n.scrollLeft 34834 , m = c * u / 100 + g - n.scrollTop 34835 , b = o / 2 - y 34836 , M = i / 2 - m 34837 , S = y + s.x 34838 , x = m + s.y; 34839 this.zoomTo(d, u, S, x, h, c, b, M, null, null, f) 34840 }, 34841 updateLayout() { 34842 let e = this.viewport.getBoundingClientRect() 34843 , t = this.$refs.svgContainer
34844 , n = this.$refs.documentBackground 34845 , s = this.$store.zoom 34846 , o = this.svgWidth 34847 , i = this.svgHeight 34848 , r = Math.round(s / 100 * o) 34849 , a = Math.round(s / 100 * i) 34850 , d = "0 0 " + o + " " + i 34851 , u = [this.getSvg(), this.getSvgEventOverlay(), this.getSvgOverlay()]; 34852 for (let h of u) 34853 h && (h.setAttribute("width", r), 34854 h.setAttribute("height", a), 34855 h.setAttribute("viewBox", d), 34856 h.setAttribute("preserveAspectRatio", "none")); 34857 let c = Math.max(1, s / 100) * e.width 34858 , f = Math.max(1, s / 100) * e.height; 34859 t.style.padding = f + "px " + c + "px", 34860 t.style.width = r + "px", 34861 t.style.height = a + "px", 34862 n.style.width = r + "px", 34863 n.style.height = a + "px" 34864 }, 34865 updateRulers() { 34866 let l = this.viewport 34867 , e = this.getSvg() 34868 , t = this.$refs.rulerHor 34869 , n = this.$refs.rulerVert 34870 , s = this.$store.zoom; 34871 if (t) { 34872 let o = this.svgWidth 34873 , i = l.scrollLeft 34874 , r = e ? e.clientWidth : 0 34875 , a = Math.max(1, s / 100) * l.clientWidth; 34876 t.updateScale(a - i, r, o) 34877 } 34878 if (n) { 34879 let o = this.svgHeight 34880 , i = l.scrollTop 34881 , r = e ? e.clientHeight : 0 34882 , a = Math.max(1, s / 100) * l.clientHeight; 34883 n.updateScale(a - i, r, o) 34884 } 34885 }, 34886 updateSvgClientBounds() { 34887 let l = this.getSvg() 34888 , e = l ? l.getBoundingClientRect() : new Ve; 34889 this.$store.svgClientBounds.set(e) 34890 }, 34891 updateOutsideMask() { 34892 let l = this.$store.activeDocument 34893 , e = l.getWidth() 34894 , t = l.getHeight() 34895 , n = "M-100000-100000h200000v200000h-200000zM0 0v" + t + "h" + e + "v" + -t + "z"; 34896 document.getElementById("outsideMaskPath").setAttribute("d", n) 34897 }, 34898 zoomTo(l, e, t, n, s, o, i=0, r=0, a, d, u=0) { 34899 this.requestedAnimationFrame && (cancelAnimationFrame(this.requestedAnimationFrame), 34900 this.requestedAnimationFrame = null), 34901 this.targetZoom = l, 34902 this.requestedAnimationFrame = requestAnimationFrame(()=>{ 34903 this.requestedAnimationFrame = null, 34904 e == null && (e = this.$store.zoom), 34905 a == null && (a = performance.now() - u / 10, 34906 d = a); 34907 let h = performance.now() 34908 , c = u === 0 ? 1 : Math.max(.1, Math.min(1, (h - a) / u)) 34909 , f = u === 0 ? c : (d - a) / u; 34910 if ((c - f) / (1 - f) > 2 / 3 && (c = 1), 34911 c > 0) { 34912 let p = this.viewport 34913 , g = p.getBoundingClientRect(); 34914 (t == null || n == null) && (t = g.x + g.width / 2, 34915 n = g.y + g.height / 2), 34916 (s == null || o == null) && ([s,o] = xi([t, n])); 34917 let y = (1 - c) * e + c * this.targetZoom; 34918 this.$store.zoom = y, 34919 this.updateLayout(); 34920 let m = Math.max(1, y / 100) * g.width 34921 , b = Math.max(1, y / 100) * g.height 34922 , M = t - g.x + i * c 34923 , S = n - g.y + r * c 34924 , x = Math.round(m + s * y / 100) - Math.round(M) 34925 , P = Math.round(b + o * y / 100) - Math.round(S); 34926 p.scrollTo({ 34927 left: x, 34928 top: P, 34929 behavior: "auto" 34930 }), 34931 this.updateSvgClientBounds() 34932 } 34933 c < 1 && this.zoomTo(this.targetZoom, e, t, n, s, o, i, r, a, h, u) 34934 } 34935 ) 34936 }, 34937 onViewportScroll() { 34938 this.updateRulers(), 34939 this.updateSvgClientBounds() 34940 }, 34941 onViewportWheel(l) { 34942 if (l.ctrlKey) { 34943 let e = l.deltaY; 34944 this.zoomStep(e / 360, l.clientX, l.clientY), 34945 l.preventDefault() 34946 } 34947 }, 34948 onKeydown(l) { 34949 l.key === Ep && (this.panInfo || this.setPanMode(!0), 34950 l.preventDefault()) 34951 }, 34952 onKeyup(l) { 34953 l.key === Ep && this.setPanMode(!1) 34954 }, 34955 onFocusout() { 34956 this.setPanMode(!1) 34957 }, 34958 onViewportPointermove(l) { 34959 let e = this.panInfo; 34960 if (e != null) { 34961 let t = l.screenX 34962 , n = l.screenY; 34963 e.xPrev != null && (this.viewport.scrollLeft -= t - e.xPrev, 34964 this.viewport.scrollTop -= n - e.yPrev), 34965 e.xPrev = t, 34966 e.yPrev = n, 34967 this.$store.setEditorCursor("grabbing"), 34968 l.preventDefault() 34969 } 34970 }, 34971 setPanMode(l) { 34972 if (l) { 34973 let e = this.$store.editorCursor; 34974 this.panInfo = { 34975 cursorType: e?.type || "default", 34976 cursorRotation: e?.rotation || 0, 34977 cursorIsGlobal: e?.isGlobal || !1 34978 }, 34979 this.$store.setEditorCursor("grabbing") 34980 } else { 34981 let e = this?.panInfo; 34982 e && (this.$store.setEditorCursor(e.cursorType, e.cursorRotation, e.cursorIsGlobal), 34983 this.panInfo = null) 34984 } 34985 }, 34986 snapToZoomStep(l, e, t) { 34987 let n = Number.MAX_VALUE 34988 , s = -1; 34989 for (let i = 0; i < Ss.length; i++) { 34990 let r = Math.abs(Ss[i] - l); 34991 if (r < n) 34992 s = i, 34993 n = r; 34994 else if (r >= n) 34995 break 34996 } 34997 let o = Ss[s]; 34998 return n > t || o === e ? l : (l > e && o < e ? (s = Math.min(Ss.length - 1, s++), 34999 o = Ss[s]) : (s = Math.max(0, s--), 35000 o = Ss[s]), 35001 o) 35002 }, 35003 zoomStep(l, e, t, n=!1) { 35004 let s = this.$store.zoom 35005 , o = l > 0 ? this.targetZoom / (1 + l) : this.targetZoom * (1 - l); 35006 o = Math.min(Ss.at(-1), Math.max(Ss.at(0), o)), 35007 o = this.snapToZoomStep(o, this.targetZoom, Math.abs(l * this.targetZoom) * 2 / 3), 35008 s !== o && this.zoomTo(o, s, e, t, null, null, 0, 0, null, null, n ? 0 : 120) 35009 }, 35010 adaptOverlayStyleToZoom() { 35011 let l = 5 35012 , e = this.$store.zoom
35013 , t = this.getSvgOverlay() 35014 , n = t.getElementById("__selGroup"); 35015 if (n) { 35016 let i = n.style; 35017 i.setProperty("--unitradius", 100 / e + "px"), 35018 i.setProperty("--pointradius", l * 100 / e + "px"), 35019 i.setProperty("--pointradiussmall", 300 / e + "px") 35020 } 35021 let s = this.getSvgEventOverlay(); 35022 s && s.style.setProperty("--tolerance", 500 / e + "px"), 35023 t.getElementById("__scaleTemplatePattern").setAttribute("patternTransform", "scale(" + 100 / e + ")") 35024 }, 35025 updateShowOverlay() { 35026 this.targetZoom !== this.$store.zoom && !An ? this.showOverlay = !1 : setTimeout(()=>{ 35027 this.targetZoom === this.$store.zoom || An ? (this.showOverlay = !0, 35028 this.adaptOverlayStyleToZoom()) : this.showOverlay = !1 35029 } 35030 , 50) 35031 } 35032 }, 35033 watch: { 35034 showOverlay(l) { 35035 let e = l ? "visible" : "hidden" 35036 , t = this.$refs.svgContainer; 35037 t.children[1].style.visibility = e, 35038 t.children[3].style.visibility = e 35039 }, 35040 activeDocument(l) { 35041 this.setDocumentModel(l) 35042 }, 35043 "$store.documentSettings": { 35044 handler(l) { 35045 this.setDocumentSize(l.width, l.height) 35046 }, 35047 deep: !0 35048 }, 35049 "$store.editorCursor": { 35050 handler(l) { 35051 let e = Zm(l.type, l.rotation) 35052 , t = document.body 35053 , n = this.viewport; 35054 l.isGlobal ? (n.style.removeProperty("cursor"), 35055 t.style.setProperty("cursor", e), 35056 t.classList.add("global-cursor")) : (n.style.setProperty("cursor", e), 35057 t.style.setProperty("cursor", "var(--cursor-default, default)"), 35058 t.classList.remove("global-cursor")) 35059 }, 35060 deep: !0 35061 }, 35062 gridSettings: { 35063 handler() { 35064 j().updateGrid() 35065 }, 35066 deep: !0 35067 }, 35068 "$store.zoom"() { 35069 this.updateShowOverlay() 35070 }, 35071 targetZoom() { 35072 this.updateShowOverlay() 35073 } 35074 } 35075} 35076 , WD = { 35077 class: "editor" 35078} 35079 , qD = { 35080 key: 0, 35081 class: "ruler-corner" 35082} 35083 , jD = { 35084 ref: "svgContainer", 35085 class: "svg-container" 35086}; 35087function JD(l, e, t, n, s, o) { 35088 const i = E("ruler") 35089 , r = E("hy-scrollview") 35090 , a = E("editor-menu"); 35091 return N(), 35092 $("div", WD, [o.showRulers ? (N(), 35093 $("div", qD)) : be("", !0), o.showRulers ? (N(), 35094 pe(i, { 35095 key: 1, 35096 ref: "rulerHor" 35097 }, null, 512)) : be("", !0), o.showRulers ? (N(), 35098 pe(i, { 35099 key: 2, 35100 ref: "rulerVert", 35101 "is-vertical": "" 35102 }, null, 512)) : be("", !0), w(r, { 35103 smooth: !1, 35104 ref: "svgViewport", 35105 class: "viewport", 35106 tabIndex: "0", 35107 "hide-scrollbars": o.isMobile 35108 }, { 35109 default: O(()=>[_("div", jD, [_("div", { 35110 ref: "documentBackground", 35111 class: "document-background", 35112 style: xe({ 35113 background: l.$store?.appSettings.editor.canvasBackground ?? "#fff" 35114 }) 35115 }, null, 4), e[0] || (e[0] = _("svg", { 35116 width: "1024", 35117 height: "1024",
35118 viewBox: "0 0 1024 1024" 35119 }, null, -1)), e[1] || (e[1] = _("svg", { 35120 width: "1024", 35121 height: "1024", 35122 viewBox: "0 0 1024 1024" 35123 }, null, -1)), e[2] || (e[2] = _("svg", { 35124 "pointer-events": "none", 35125 width: "1024", 35126 height: "1024", 35127 viewBox: "0 0 1024 1024" 35128 }, [_("defs", null, [_("linearGradient", { 35129 id: "startEndNodeGradient" 35130 }, [_("stop", { 35131 offset: "40%", 35132 "stop-color": "#FFD3D3" 35133 }), _("stop", { 35134 offset: "45%", 35135 "stop-color": "#AC3D3D" 35136 }), _("stop", { 35137 offset: "55%", 35138 "stop-color": "#48963F" 35139 }), _("stop", { 35140 offset: "60%", 35141 "stop-color": "#D0FBCB" 35142 })]), _("linearGradient", { 35143 id: "startEndNodeSelGradient" 35144 }, [_("stop", { 35145 offset: "40%", 35146 "stop-color": "#F38282" 35147 }), _("stop", { 35148 offset: "45%", 35149 "stop-color": "#AC3D3D" 35150 }), _("stop", { 35151 offset: "55%", 35152 "stop-color": "#48963F" 35153 }), _("stop", { 35154 offset: "60%", 35155 "stop-color": "#84D97B" 35156 })]), _("linearGradient", { 35157 id: "startEndNodeBorderGradient" 35158 }, [_("stop", { 35159 offset: "50%", 35160 "stop-color": "#AC3D3D" 35161 }), _("stop", { 35162 offset: "50%", 35163 "stop-color": "#48963F" 35164 })]), _("pattern", { 35165 id: "checkeredPattern", 35166 x: "0", 35167 y: "0", 35168 width: "10", 35169 height: "10", 35170 patternUnits: "userSpaceOnUse" 35171 }, [_("rect", { 35172 fill: "#ffffff", 35173 x: "0", 35174 y: "0", 35175 width: "10", 35176 height: "10" 35177 }), _("rect", { 35178 fill: "#aaaaaa", 35179 x: "0", 35180 y: "0", 35181 width: "5", 35182 height: "5" 35183 }), _("rect", { 35184 fill: "#aaaaaa", 35185 x: "5", 35186 y: "5", 35187 width: "5", 35188 height: "5" 35189 })]), _("pattern", { 35190 id: "__scaleTemplatePattern", 35191 patternContentUnits: "userSpaceOnUse", 35192 patternUnits: "userSpaceOnUse" 35193 }), _("pattern", { 35194 id: "addFillPattern", 35195 width: "10", 35196 height: "10", 35197 stroke: "#22bb00", 35198 fill: "none", 35199 href: "#__scaleTemplatePattern", 35200 "stroke-width": "1.3", 35201 "stroke-opacity": "0.8" 35202 }, [_("path", { 35203 d: "M-2,3 l9,9M3,-2 l9,9" 35204 })]), _("pattern", { 35205 id: "removeFillPattern", 35206 width: "10", 35207 height: "10", 35208 stroke: "#ff4422", 35209 fill: "none", 35210 href: "#__scaleTemplatePattern", 35211 "stroke-width": "1.3", 35212 "stroke-opacity": "0.8" 35213 }, [_("path", { 35214 d: "M-2,3 l9,9M3,-2 l9,9" 35215 })]), _("pattern", { 35216 id: "highlightFillPattern", 35217 width: "10", 35218 height: "10", 35219 stroke: "#2288ff", 35220 fill: "rgb(80 160 255 / 0.2)", 35221 href: "#__scaleTemplatePattern", 35222 "stroke-width": "1.3", 35223 "stroke-opacity": "0.8", 35224 patternContentUnits: "userSpaceOnUse", 35225 patternUnits: "userSpaceOnUse" 35226 }, [_("rect", { 35227 x: "-1", 35228 y: "-1", 35229 width: "20", 35230 height: "20" 35231 }), _("path", { 35232 d: "M-2,3 l9,9M3,-2 l9,9" 35233 })])]), _("path", { 35234 id: "outsideMaskPath", 35235 class: "outside-mask-path", 35236 d: "" 35237 }), _("g", { 35238 id: "__selGroup", 35239 class: "__selGroup", 35240 "pointer-events": "none" 35241 })], -1))], 512)]), 35242 _: 1 35243 }, 8, ["hide-scrollbars"]), w(a, { 35244 ref: "contextMenu" 35245 }, null, 512)]) 35246} 35247const ZD = ie(KD, [["render", JD]]) 35248 , _v = new Map 35249 , Tv = new Map 35250 , br = new Map; 35251function QD(l, e, t, n) { 35252 if (l.disabled || e(), 35253 !br.has(l)) { 35254 let s = setTimeout(()=>{ 35255 let r = setInterval(()=>{ 35256 l.disabled ? Tc(l) : e() 35257 } 35258 , n); 35259 br.set(l, r) 35260 } 35261 , t); 35262 br.set(l, s), 35263 Bf(l, !0); 35264 let o = ()=>Tc(l) 35265 , i = [["pointerup", o], ["pointercancel", o], ["touchend", o], ["touchcancel", o]];
35266 i.forEach(r=>document.addEventListener(r[0], r[1])), 35267 Tv.set(l, i) 35268 } 35269} 35270function Tc(l) { 35271 let e = br.get(l); 35272 e != null && (clearInterval(e), 35273 br.delete(l)), 35274 Bf(l, !0) 35275} 35276function Bf(l, e) { 35277 if (!e) { 35278 let n = _v.get(l); 35279 n && n.forEach(s=>l.removeEventListener(s[0], s[1])) 35280 } 35281 let t = Tv.get(l); 35282 t && t.forEach(n=>document.removeEventListener(n[0], n[1])) 35283} 35284const kv = { 35285 beforeMount: (l,e)=>{ 35286 let t = e.value 35287 , n = e.arg && e.arg.match(/\d+/g) || [] 35288 , s = n[0] == null ? 500 : parseFloat(n[0]) 35289 , o = n[1] == null ? 80 : parseFloat(n[1]) 35290 , i = ()=>QD(l, t, s, o) 35291 , r = ()=>Tc(l) 35292 , a = [["pointerdown", i], ["blur", r], ["keydown", d=>d.key === " " ? i() : null], ["keyup", d=>d.key === " " ? r() : null], ["keydown", d=>d.key === "Enter" ? i() : null], ["keyup", d=>d.key === "Enter" ? r() : null]]; 35293 a.forEach(d=>l.addEventListener(d[0], d[1])), 35294 _v.set(l, a) 35295 } 35296 , 35297 beforeUnmount: l=>{ 35298 Bf(l, !1) 35299 } 35300} 35301 , eO = { 35302 name: "StrokeStyleEditor", 35303 components: { 35304 HyLabel: Bn, 35305 HyButton: nt, 35306 SvgIcon: gt, 35307 HyTooltip: pt, 35308 HySelect: Dl, 35309 HyInput: Xs, 35310 HyDropdown: xl, 35311 HyField: js, 35312 HyGroup: Dt, 35313 HyInputNumber: Lt, 35314 HyRadio: en 35315 }, 35316 directives: { 35317 RepeatButton: kv 35318 }, 35319 props: { 35320 strokeStyle: { 35321 type: Qt, 35322 default: new Qt 35323 }, 35324 compact: Boolean, 35325 disabled: Boolean 35326 }, 35327 data() { 35328 return { 35329 editStrokeStyle: new Qt, 35330 dashArrayTemplates: me(["", "12 4", "8 4", "4 4", "4 2", "2 2", "2 1", "1 1", "4 2 1 2", "4 2 1 2 1 2"]), 35331 sampleStrokeWidth: 2, 35332 svgs: me({ 35333 strokeStyleSvg: GC, 35334 strokeCapButtSvg: HC, 35335 strokeCapSquareSvg: $C, 35336 strokeCapRoundSvg: XC, 35337 strokeJoinMiterSvg: YC, 35338 strokeJoinBevelSvg: KC, 35339 strokeJoinRoundSvg: WC, 35340 incrementSvg: ff, 35341 decrementSvg: j2 35342 }) 35343 } 35344 }, 35345 computed: { 35346 strokeWidth: { 35347 get() { 35348 return this.editStrokeStyle.width 35349 }, 35350 set(l) { 35351 l = Math.max(.01, Math.min(256, l)), 35352 this.editStrokeStyle.width = l 35353 } 35354 }, 35355 isDashed() { 35356 let l = (this.editStrokeStyle.dasharray || "").trim(); 35357 return l !== "" && l !== "0 " 35358 } 35359 }, 35360 emits: ["update:strokeStyle"], 35361 methods: { 35362 toPrecision: Je, 35363 parseSize(l) { 35364 let e = parseFloat(l); 35365 return isNaN(e) ? this.strokeWidth : Math.min(1024, Math.max(.01, Je(e, 2))) 35366 }, 35367 formatSize(l) { 35368 return l + "px" 35369 }, 35370 onDashArrayClick(l) { 35371 this.editStrokeStyle.dasharray = l, 35372 this.editStrokeStyle.updateDashArray() 35373 }, 35374 scaleDashArray(l, e, t="butt") { 35375 let n = l.match(/(\d?\.?\d+)+/g); 35376 if (n == null) 35377 return ""; 35378 let s = n.map(o=>+o); 35379 if (s.length > 0) { 35380 s.length % 2 && s.push(...s); 35381 let o = t === "round" || t === "square" ? 1 : 0; 35382 if (o !== 0) 35383 for (let i = 1, r = s.length; i < r; i += 2) { 35384 let a = i - 1 35385 , d = i < r - 1 ? i + 1 : 0 35386 , u = Math.min(n[a], n[d], o); 35387 s[a] -= u / 2, 35388 s[d] -= u / 2, 35389 s[i] += u 35390 } 35391 } 35392 for (let o = 0; o < s.length; o++) 35393 s[o] *= e; 35394 return s.join(" ") 35395 }, 35396 setCustomDasharray(l) { 35397 this.editStrokeStyle.dasharray = l 35398 }, 35399 setScaleDasharray(l) { 35400 let e = this.editStrokeStyle 35401 , t = e.width 35402 , n = e.dasharray 35403 , s = e.linecap; 35404 e.calcDasharray = this.scaleDashArray(n, l ? t : 1, s), 35405 e.scaleDasharray = l 35406 }, 35407 onClose() { 35408 el(()=>{ 35409 let l = this.editStrokeStyle; 35410 l.updateDashArray(), 35411 this.$emit("update:strokeStyle", l) 35412 } 35413 ) 35414 }, 35415 updateStrokePreview() { 35416 let l = this.$refs.previewPath; 35417 if (l) { 35418 let e = this.strokeStyle 35419 , t = Math.min(16, e.width); 35420 l.setAttribute("stroke-width", t); 35421 let n = e.scaleDasharray ? e.getScaledDashArray(t) : e.dasharray; 35422 l.setAttribute("stroke-dasharray", n), 35423 l.setAttribute("stroke-linecap", e.linecap) 35424 } 35425 } 35426 }, 35427 watch: { 35428 editStrokeStyle: { 35429 handler(l) { 35430 this.$refs.dropdown?.popoverOpen && (l.updateDashArray(), 35431 this.$emit("update:strokeStyle", l)) 35432 }, 35433 deep: !0 35434 }, 35435 strokeStyle: { 35436 handler(l) { 35437 this.editStrokeStyle.set(l), 35438 this.updateStrokePreview() 35439 }, 35440 deep: !0 35441 } 35442 }, 35443 mounted() { 35444 this.editStrokeStyle.set(this.strokeStyle), 35445 this.updateStrokePreview() 35446 } 35447} 35448 , tO = { 35449 style: { 35450 "font-variant-numeric": "tabular-nums", 35451 "margin-right": "4px" 35452 } 35453} 35454 , lO = { 35455 width: "100", 35456 height: "32",
35457 viewBox: "0 0 100 32" 35458} 35459 , nO = { 35460 ref: "previewPath", 35461 d: "M2 16H100", 35462 fill: "none", 35463 stroke: "currentColor" 35464} 35465 , sO = { 35466 class: "content" 35467} 35468 , oO = { 35469 class: "row-group" 35470} 35471 , iO = { 35472 class: "row-group" 35473} 35474 , rO = { 35475 class: "row-group" 35476} 35477 , aO = { 35478 style: { 35479 margin: "0 2px 0 8px", 35480 overflow: "hidden", 35481 display: "flex", 35482 "align-items": "center" 35483 } 35484} 35485 , dO = { 35486 width: "240", 35487 height: "16" 35488} 35489 , uO = ["stroke-dasharray"] 35490 , hO = { 35491 style: { 35492 display: "flex", 35493 "margin-left": "8px", 35494 gap: "inherit" 35495 } 35496}; 35497function cO(l, e, t, n, s, o) { 35498 const i = E("svg-icon") 35499 , r = E("hy-tooltip") 35500 , a = E("hy-button") 35501 , d = E("hy-input-number") 35502 , u = E("hy-group") 35503 , h = E("hy-field") 35504 , c = E("hy-radio") 35505 , f = E("hy-select") 35506 , p = E("hy-input") 35507 , g = E("hy-label") 35508 , y = E("hy-checkbox") 35509 , m = E("hy-dropdown") 35510 , b = Gd("repeat-button"); 35511 return N(), 35512 pe(m, { 35513 ref: "dropdown", 35514 disabled: t.disabled, 35515 onClose: o.onClose, 35516 style: xe([{ 35517 padding: "0 4px" 35518 }, { 35519 width: t.compact ? "auto" : "130px" 35520 }]) 35521 }, aM({ 35522 button: O(()=>[t.compact ? (N(), 35523 pe(i, { 35524 key: 0, 35525 svg: s.svgs.strokeStyleSvg 35526 }, null, 8, ["svg"])) : (N(), 35527 $(Pe, { 35528 key: 1 35529 }, [_("div", tO, se(o.toPrecision(s.editStrokeStyle.width, 2)) + "px ", 1), (N(), 35530 $("svg", lO, [_("path", nO, null, 512)]))], 64)), w(r, { 35531 "get-target": ()=>l.$refs.dropdown, 35532 label: l.$t("strokeStyleEditor.strokeStyle") 35533 }, null, 8, ["get-target", "label"])]), 35534 default: O(()=>[_("div", sO, [_("div", oO, [w(h, { 35535 label: l.$t("strokeStyleEditor.strokeWidth") 35536 }, { 35537 default: O(()=>[w(u, null, { 35538 default: O(()=>[wl((N(), 35539 pe(a, { 35540 disabled: o.strokeWidth <= .01, 35541 style: { 35542 padding: "0 6px" 35543 } 35544 }, { 35545 default: O(()=>[w(i, { 35546 svg: s.svgs.decrementSvg 35547 }, null, 8, ["svg"])]), 35548 _: 1 35549 }, 8, ["disabled"])), [[b, ()=>o.strokeWidth--]]), w(d, { 35550 modelValue: s.editStrokeStyle.width, 35551 "onUpdate:modelValue": e[0] || (e[0] = M=>s.editStrokeStyle.width = M), 35552 min: 0, 35553 max: 256, 35554 formatter: o.formatSize, 35555 parser: o.parseSize, 35556 class: "dimension-input", 35557 autofocus: "" 35558 }, null, 8, ["modelValue", "formatter", "parser"]), wl((N(), 35559 pe(a, { 35560 disabled: o.strokeWidth >= 256, 35561 style: { 35562 padding: "0 6px" 35563 } 35564 }, { 35565 default: O(()=>[w(i, { 35566 svg: s.svgs.incrementSvg 35567 }, null, 8, ["svg"])]), 35568 _: 1 35569 }, 8, ["disabled"])), [[b, ()=>o.strokeWidth++]])]), 35570 _: 1 35571 })]), 35572 _: 1 35573 }, 8, ["label"])]), _("div", iO, [w(h, { 35574 label: l.$t("strokeStyleEditor.lineCap") 35575 }, { 35576 default: O(()=>[w(u, { 35577 style: { 35578 flex: "1 1 auto" 35579 } 35580 }, { 35581 default: O(()=>[w(c, { 35582 ref: "capRound", 35583 type: "button", 35584 modelValue: s.editStrokeStyle.linecap, 35585 "onUpdate:modelValue": e[1] || (e[1] = M=>s.editStrokeStyle.linecap = M), 35586 value: "round", 35587 name: "lineCap" 35588 }, { 35589 default: O(()=>[w(i, { 35590 svg: s.svgs.strokeCapRoundSvg 35591 }, null, 8, ["svg"]), w(r, { 35592 getTarget: ()=>l.$refs.capRound, 35593 label: l.$t("strokeStyleEditor.round") 35594 }, null, 8, ["getTarget", "label"])]), 35595 _: 1 35596 }, 8, ["modelValue"]), w(c, { 35597 ref: "capButt", 35598 type: "button", 35599 modelValue: s.editStrokeStyle.linecap, 35600 "onUpdate:modelValue": e[2] || (e[2] = M=>s.editStrokeStyle.linecap = M), 35601 value: "butt", 35602 name: "lineCap" 35603 }, { 35604 default: O(()=>[w(i, { 35605 svg: s.svgs.strokeCapButtSvg 35606 }, null, 8, ["svg"]), w(r, { 35607 getTarget: ()=>l.$refs.capButt, 35608 label: l.$t("strokeStyleEditor.butt") 35609 }, null, 8, ["getTarget", "label"])]), 35610 _: 1 35611 }, 8, ["modelValue"]), w(c, { 35612 ref: "capSquare", 35613 type: "button", 35614 modelValue: s.editStrokeStyle.linecap, 35615 "onUpdate:modelValue": e[3] || (e[3] = M=>s.editStrokeStyle.linecap = M), 35616 value: "square", 35617 name: "lineCap" 35618 }, { 35619 default: O(()=>[w(i, { 35620 svg: s.svgs.strokeCapSquareSvg 35621 }, null, 8, ["svg"]), w(r, { 35622 getTarget: ()=>l.$refs.capSquare, 35623 label: l.$t("strokeStyleEditor.square") 35624 }, null, 8, ["getTarget", "label"])]), 35625 _: 1 35626 }, 8, ["modelValue"])]), 35627 _: 1 35628 })]), 35629 _: 1 35630 }, 8, ["label"]), w(h, { 35631 label: l.$t("strokeStyleEditor.lineJoin") 35632 }, { 35633 default: O(()=>[w(u, null, { 35634 default: O(()=>[w(c, { 35635 ref: "joinRound", 35636 type: "button", 35637 modelValue: s.editStrokeStyle.linejoin, 35638 "onUpdate:modelValue": e[4] || (e[4] = M=>s.editStrokeStyle.linejoin = M), 35639 value: "round", 35640 name: "lineJoin" 35641 }, { 35642 default: O(()=>[w(i, { 35643 svg: s.svgs.strokeJoinRoundSvg 35644 }, null, 8, ["svg"]), w(r, { 35645 getTarget: ()=>l.$refs.joinRound, 35646 label: l.$t("strokeStyleEditor.round") 35647 }, null, 8, ["getTarget", "label"])]), 35648 _: 1 35649 }, 8, ["modelValue"]), w(c, { 35650 ref: "joinBevel", 35651 type: "button", 35652 modelValue: s.editStrokeStyle.linejoin, 35653 "onUpdate:modelValue": e[5] || (e[5] = M=>s.editStrokeStyle.linejoin = M), 35654 value: "bevel", 35655 name: "lineJoin" 35656 }, { 35657 default: O(()=>[w(i, { 35658 svg: s.svgs.strokeJoinBevelSvg 35659 }, null, 8, ["svg"]), w(r, { 35660 getTarget: ()=>l.$refs.joinBevel, 35661 label: l.$t("strokeStyleEditor.bevel") 35662 }, null, 8, ["getTarget", "label"])]), 35663 _: 1 35664 }, 8, ["modelValue"]), w(c, { 35665 ref: "joinMiter", 35666 type: "button", 35667 modelValue: s.editStrokeStyle.linejoin, 35668 "onUpdate:modelValue": e[6] || (e[6] = M=>
35668s.editStrokeStyle.linejoin = M), 35669 value: "miter", 35670 name: "lineJoin" 35671 }, { 35672 default: O(()=>[w(i, { 35673 svg: s.svgs.strokeJoinMiterSvg 35674 }, null, 8, ["svg"]), w(r, { 35675 getTarget: ()=>l.$refs.joinMiter, 35676 label: l.$t("strokeStyleEditor.miter") 35677 }, null, 8, ["getTarget", "label"])]), 35678 _: 1 35679 }, 8, ["modelValue"])]), 35680 _: 1 35681 })]), 35682 _: 1 35683 }, 8, ["label"]), w(h, { 35684 label: l.$t("strokeStyleEditor.miterLimit"), 35685 disabled: s.editStrokeStyle.linejoin !== "miter" 35686 }, { 35687 default: O(({disabled: M})=>[w(d, { 35688 modelValue: s.editStrokeStyle.miterlimit, 35689 "onUpdate:modelValue": e[7] || (e[7] = S=>s.editStrokeStyle.miterlimit = S), 35690 disabled: M, 35691 min: 0, 35692 max: 4096, 35693 formatter: S=>S + "", 35694 parser: o.parseSize, 35695 class: "dimension-input" 35696 }, null, 8, ["modelValue", "disabled", "formatter", "parser"])]), 35697 _: 1 35698 }, 8, ["label", "disabled"])]), _("div", rO, [w(h, { 35699 label: l.$t("strokeStyleEditor.strokePattern") 35700 }, { 35701 default: O(()=>[w(f, { 35702 ref: "dashArraysSelect", 35703 items: s.dashArrayTemplates, 35704 modelValue: s.editStrokeStyle.dasharray, 35705 "onUpdate:modelValue": o.onDashArrayClick, 35706 style: { 35707 width: "120px", 35708 flex: "1 1 0" 35709 } 35710 }, { 35711 default: O(({value: M})=>[_("div", aO, [(N(), 35712 $("svg", dO, [_("line", { 35713 x1: "0", 35714 y1: "8", 35715 x2: "320", 35716 y2: "8", 35717 stroke: "currentColor", 35718 "stroke-width": "2", 35719 "stroke-dasharray": o.scaleDashArray(M || "", s.sampleStrokeWidth) 35720 }, null, 8, uO)]))])]), 35721 _: 1 35722 }, 8, ["items", "modelValue", "onUpdate:modelValue"])]), 35723 _: 1 35724 }, 8, ["label"]), w(h, { 35725 label: l.$t("strokeStyleEditor.customPattern") 35726 }, { 35727 default: O(()=>[w(p, { 35728 modelValue: s.editStrokeStyle.dasharray, 35729 onInput: e[8] || (e[8] = M=>o.setCustomDasharray(M.target.value)), 35730 style: { 35731 width: "100px" 35732 } 35733 }, null, 8, ["modelValue"]), _("div", hO, [w(g, { 35734 disabled: !o.isDashed, 35735 label: l.$t("strokeStyleEditor.offset") 35736 }, null, 8, ["disabled", "label"]), w(d, { 35737 modelValue: s.editStrokeStyle.dashoffset, 35738 "onUpdate:modelValue": e[9] || (e[9] = M=>s.editStrokeStyle.dashoffset = M), 35739 disabled: !o.isDashed 35740 }, null, 8, ["modelValue", "disabled"])])]), 35741 _: 1 35742 }, 8, ["label"]), w(h, { 35743 disabled: !o.isDashed 35744 }, { 35745 default: O(({disabled: M})=>[w(y, { 35746 modelValue: s.editStrokeStyle.scaleDasharray, 35747 "onUpdate:modelValue": o.setScaleDasharray, 35748 disabled: M 35749 }, { 35750 default: O(()=>[ve(se(l.$t("strokeStyleEditor.scalePattern")), 1)]), 35751 _: 1 35752 }, 8, ["modelValue", "onUpdate:modelValue", "disabled"])]), 35753 _: 1 35754 }, 8, ["disabled"])])])]), 35755 _: 2 35756 }, [t.compact ? { 35757 name: "arrow", 35758 fn: O(()=>[]), 35759 key: "0" 35760 } : void 0]), 1032, ["disabled", "onClose", "style"]) 35761} 35762const gu = ie(eO, [["render", cO], ["__scopeId", "data-v-ca538c4d"]]) 35763 , fO = { 35764 name: "DimInput", 35765 components: { 35766 HyInputNumber: Lt 35767 }, 35768 props: { 35769 modelValue: Number, 35770 unit: String, 35771 min: Number, 35772 max: Number, 35773 step: { 35774 type: Number, 35775 default: 1 35776 }, 35777 f: { 35778 type: Number, 35779 default: 1 35780 }, 35781 decimals: { 35782 type: Number, 35783 default: 0 35784 }, 35785 isFixedDecimals: Boolean 35786 },
35787 emits: ["update:modelValue", "change", "input", "focus", "blur"], 35788 methods: { 35789 parse(l) { 35790 if (l === "") 35791 return (this.min == null || this.min <= 0) && (this.min == null || this.min <= 0) ? 0 : this.modelValue; 35792 let e = parseFloat(l); 35793 return e /= this.f, 35794 e 35795 }, 35796 format(l) { 35797 return l *= this.f, 35798 l = Je(l, this.decimals), 35799 this.isFixedDecimals && (l = l.toFixed(2)), 35800 l + (this.unit || "") 35801 } 35802 } 35803}; 35804function pO(l, e, t, n, s, o) { 35805 const i = E("hy-input-number"); 35806 return N(), 35807 pe(i, { 35808 parser: o.parse, 35809 formatter: o.format, 35810 min: t.min, 35811 max: t.max, 35812 step: t.step, 35813 modelValue: t.modelValue, 35814 "onUpdate:modelValue": e[0] || (e[0] = r=>l.$emit("update:modelValue", r)), 35815 onInput: e[1] || (e[1] = r=>l.$emit("input", r)), 35816 onChange: e[2] || (e[2] = r=>l.$emit("change", r)) 35817 }, null, 8, ["parser", "formatter", "min", "max", "step", "modelValue"]) 35818} 35819const ms = ie(fO, [["render", pO]]) 35820 , gO = { 35821 name: "HySlider", 35822 props: { 35823 modelValue: { 35824 type: Number, 35825 default: 40 35826 }, 35827 min: { 35828 type: Number, 35829 default: 0 35830 }, 35831 max: { 35832 type: Number, 35833 default: 1 35834 }, 35835 scaleMin: { 35836 type: Number 35837 }, 35838 scaleMax: { 35839 type: Number 35840 }, 35841 step: { 35842 type: Number, 35843 default: .01 35844 }, 35845 disabled: { 35846 type: Boolean, 35847 default: !1 35848 } 35849 }, 35850 computed: { 35851 percent() { 35852 let l = this.scaleMin == null ? this.min : this.scaleMin 35853 , e = this.scaleMax == null ? this.max : this.scaleMax; 35854 return Math.min(100, Math.max(0, (this.modelValue - l) / (e - l) * 100)) 35855 } 35856 }, 35857 emits: ["update:modelValue"], 35858 methods: { 35859 onPointerdown: function(l) { 35860 this.disabled || l.buttons === 1 && !this.isDragging && (this.isDragging = !0, 35861 document.addEventListener("pointermove", this.onDocumentPointermove), 35862 document.addEventListener("pointerup", this.endDrag), 35863 document.addEventListener("pointercancel", this.endDrag), 35864 this.isDragging = !0, 35865 l.target !== this.$refs.knob && this.updateFromPointerEvent(l)) 35866 }, 35867 endDrag() { 35868 document.removeEventListener("pointermove", this.onDocumentPointermove), 35869 document.removeEventListener("pointerup", this.endDrag), 35870 document.removeEventListener("pointercancel", this.endDrag), 35871 this.isDragging = !1 35872 }, 35873 updateFromPointerEvent(l) { 35874 if (this.isDragging) { 35875 let e = this.$refs.track 35876 , t = e.getBoundingClientRect() 35877 , n = l.clientX - t.left 35878 , s = this.min 35879 , o = this.max 35880 , i = this.scaleMin == null ? s : this.scaleMin 35881 , r = this.scaleMax == null ? o : this.scaleMax 35882 , a = Math.min(o, Math.max(s, i + (r - i) * (n / e.offsetWidth))); 35883 a !== this.modelValue && this.emitValueChange(a) 35884 } 35885 }, 35886 onDocumentPointermove(l) { 35887 this.disabled || (l.buttons === 1 || l.type === "touchmove" ? (l.stopPropagation(), 35888 l.preventDefault(), 35889 this.updateFromPointerEvent(l)) : this.isDragging && this.endDrag()) 35890 }, 35891 onKeydown(l) { 35892 if (this.disabled) 35893 return; 35894 let e = l.key; 35895 if (e === "ArrowUp" || e === "+") { 35896 let t = this.modelValue 35897 , n = Math.max(this.min, Math.min(this.max, t + 1)); 35898 n !== t && this.emitValueChange(n) 35899 } else if (e === "ArrowDown" || e === "-") { 35900 let t = this.modelValue 35901 , n = Math.max(this.min, Math.min(this.max, t - 1)); 35902 n !== t && this.emitValueChange(n) 35903 } 35904 }, 35905 emitValueChange(l) { 35906 this.$emit("update:modelValue", l) 35907 } 35908 }, 35909 beforeUnmount() {
35910 this.endDrag() 35911 }, 35912 watch: { 35913 disabled(l) { 35914 l && this.endDrag() 35915 } 35916 } 35917} 35918 , mO = ["tabIndex"] 35919 , yO = { 35920 class: "hy-slider-track", 35921 ref: "track" 35922} 35923 , vO = ["disabled"]; 35924function bO(l, e, t, n, s, o) { 35925 return N(), 35926 $("div", { 35927 class: Ne(["hy-slider", { 35928 "hy-disabled": t.disabled 35929 }]), 35930 onPointerdown: e[0] || (e[0] = (...i)=>o.onPointerdown && o.onPointerdown(...i)), 35931 onPointerup: e[1] || (e[1] = (...i)=>o.endDrag && o.endDrag(...i)), 35932 onKeydown: e[2] || (e[2] = (...i)=>o.onKeydown && o.onKeydown(...i)), 35933 tabIndex: t.disabled ? null : 0 35934 }, [_("div", yO, [_("div", { 35935 class: "hy-slider-track-fill", 35936 style: xe({ 35937 width: o.percent + "%" 35938 }) 35939 }, null, 4), _("div", { 35940 class: "hy-slider-knob", 35941 ref: "knob", 35942 style: xe({ 35943 left: o.percent + "%" 35944 }) 35945 }, null, 4)], 512), _("input", { 35946 type: "range", 35947 disabled: t.disabled 35948 }, null, 8, vO)], 42, mO) 35949} 35950const ta = ie(gO, [["render", bO]]) 35951 , MO = { 35952 name: "GlobalColorDialog", 35953 components: { 35954 HyLabel: Bn, 35955 HyPopover: Ql, 35956 ColorPicker: ea, 35957 HyInput: Xs 35958 }, 35959 props: { 35960 name: String, 35961 color: ce, 35962 show: { 35963 type: Boolean, 35964 default: !1 35965 }, 35966 getSource: Function 35967 }, 35968 data() { 35969 return { 35970 showDeleteDialog: !1, 35971 deleteColorUsage: null, 35972 svgs: me({ 35973 deleteSvg: Zr 35974 }) 35975 } 35976 }, 35977 emits: ["close", "cancel", "update:name", "update:color"], 35978 methods: { 35979 setName(l) { 35980 this.$emit("update:name", l) 35981 }, 35982 setColor(l) { 35983 this.$emit("update:color", l) 35984 } 35985 } 35986} 35987 , SO = { 35988 style: { 35989 display: "flex", 35990 "flex-direction": "column", 35991 "align-items": "stretch", 35992 gap: "32px", 35993 padding: "24px 16px", 35994 background: "inherit" 35995 } 35996} 35997 , wO = { 35998 style: { 35999 display: "flex", 36000 "align-items": "center", 36001 gap: "16px" 36002 } 36003}; 36004function PO(l, e, t, n, s, o) { 36005 const i = E("hy-label") 36006 , r = E("hy-input") 36007 , a = E("color-picker") 36008 , d = E("hy-popover"); 36009 return N(), 36010 pe(d, Wl(l.$attrs, { 36011 show: t.show, 36012 getSource: t.getSource, 36013 "primary-pos": "bottom", 36014 "secondary-pos": "start", 36015 title: "Global Colors", 36016 onCancel: e[0] || (e[0] = u=>l.$emit("close")), 36017 onClose: e[1] || (e[1] = u=>l.$emit("close")) 36018 }), { 36019 default: O(()=>[_("div", SO, [_("div", wO, [w(i, null, { 36020 default: O(()=>[...e[2] || (e[2] = [ve("Color Name:", -1)])]), 36021 _: 1 36022 }), w(r, { 36023 "model-value": t.name, 36024 "onUpdate:modelValue": o.setName 36025 }, null, 8, ["model-value", "onUpdate:modelValue"])]), w(a, { 36026 "model-value": t.color, 36027 "onUpdate:modelValue": o.setColor 36028 }, null, 8, ["model-value", "onUpdate:modelValue"])])]), 36029 _: 1 36030 }, 16, ["show", "getSource"]) 36031} 36032const xO = ie(MO, [["render", PO]]); 36033class zf extends Ue { 36034 documentModel; 36035 globalColor; 36036 oldColor; 36037 newColor; 36038 constructor(e, t, n) { 36039 super(!0), 36040 this.documentModel = e, 36041 this.globalColor = t, 36042 this.oldColor = n, 36043 this.newColor = t.color && t.color.clone() 36044 } 36045 async undo() { 36046 this.documentModel.setGlobalColorColor(this.globalColor, this.oldColor) 36047 } 36048 async redo() { 36049 this.documentModel.setGlobalColorColor(this.globalColor, this.newColor) 36050 } 36051 addEdit(e) { 36052 return this.isClosed || !(e instanceof zf) || e.globalColor !== this.globalColor ? !1 : (this.newColor = e.newColor, 36053 !0) 36054 } 36055} 36056class Uf extends Ue { 36057 documentModel; 36058 globalColor; 36059 oldName; 36060 newName; 36061 constructor(e, t, n) { 36062 super(!0), 36063 this.documentModel = e, 36064 this.globalColor = t, 36065 this.oldName = n, 36066 this.newName = t.name 36067 } 36068 async undo() { 36069 this.documentModel.setGlobalColorName(this.globalColor, this.oldName) 36070 } 36071 async redo() { 36072 this.documentModel.setGlobalColorName(this.globalColor, this.newName) 36073 } 36074 addEdit(e) { 36075 return this.isClosed || !(e instanceof Uf) || e.globalColor !== this.globalColor ? !1 : (this.newName = e.newName, 36076 !0) 36077 } 36078} 36079const CO = '<svg viewBox="0 0 22 22" fill="currentColor">
36079 <path d="M2 10c0-0.6 0.4-1 1-1h6v-6c0-0.6 0.4-1 1-1h2c0.6 0 1 0.4 1 1v6h6c0.6 0 1 0.4 1 1v2c0 0.6-0.4 1-1 1h-6v6c0 0.6-0.4 1-1 1h-2c-0.6 0-1-0.4-1-1v-6h-6c-0.6 0-1-0.4-1-1v-2z"/></svg>' 36080 , _O = '<svg viewBox="0 0 22 22" fill="currentColor"> <path d="M7 0.9c0-1.3 1.1-2.5 2.5-2.5 0 0 0 0 0 0l3 0.1c1.4 0 2.5 1.1 2.5 2.5v14c0 0.2 0 0.3-0.1 0.4l-3 6c-0.2 0.4-0.5 0.6-0.9 0.6-0.4 0-0.7-0.2-0.9-0.6l-3-6c-0.1-0.1-0.1-0.2-0.1-0.4v-14c0 0 0 0 0 0 0 0 0 0 0-0.1zM9.5 0.4c-0.3 0-0.5 0.3-0.5 0.5 0 0 0 0.1 0 0.1 0 0 0 0 0 0.1v1.9h4v-2c0-0.3-0.2-0.5-0.5-0.5 0 0 0 0 0 0l-3-0.1zM13 4h-4v10h4v-10zM12.9 15h-3.8l1 2h1.8l1-2z" transform="translate(9.95862137, -3.49287347) rotate(45)"/></svg>' 36081 , TO = `<svg viewBox="0 0 22 22" fill="currentColor"> <path d="M0 11c0-0.6 0.4-1 1-1h4c0.6 0 1 0.4 1 1 0 0.6-0.4 1-1 1h-4c-0.6 0-1-0.4-1-1zM3.2 4.6c-0.4-0.4-0.4-1 0-1.4 0.4-0.4 1-0.4 1.4 0l2.9 2.9c0.4 0.3 0.4 1 0 1.4-0.4 0.4-1.1 0.4-1.4 0l-2.9-2.9zM3.2 18.8c-0.4-0.4-0.4-1 0-1.4l2.9-2.9c0.3-0.4 1-0.4 1.4 0 0.4 0.4 0.4 1.1 0 1.4l-2.9 2.9c-0.4 0.4-1 0.4-1.4 0zM7 11c0-2.2 1.8-4 4-4 2.2 0 4 1.8 4 4 0 2.2-1.8 4-4 4-2.2 0-4-1.8-4-4zM11 9c-1.1 0-2 0.9-2 2 0 1.1 0.9 2 2 2 1.1 0 2-0.9 2-2 0-1.1-0.9-2-2-2zM10 1c0-0.6 0.4-1 1-1 0.6 0 1 0.4 1 1v4c0 0.6-0.4 1-1 1-0.6 0-1-0.4-1-1v-4zM10 17c0-0.6 0.4-1 1-1 0.6 0 1 0.4 1 1v4c0 0.6-0.4 1-1 1-0.6 0-1-0.4-1-1v-4zM14.5 15.9c-0.4-0.3-0.4-1 0-1.4 0.4-0.4 1.1-0.4 1.4 0l2.9 2.9c0.4 0.4 0.4 1 0 1.4-0.4 0.4-1 0.4-1.4 0l-2.9-2.9zM14.5 7.5c-0.4-0.4-0.4-1.1 0-1.4l2.9-2.9c0.4-0.4 1-0.4 1.4 0 0.4 0.4 0.4 1 0 1.4l-2.9 2.9c-0.3 0.4-1 0.4-1.4 0zM16 11c0-0.6 0.4-1 1-1h4c0.6 0 1 0.4 1 1 0 0.6-0.4 1-1 1h-4c-0.6 0-1-0.4-1-1z" /> 36082</svg>` 36083 , kO = '<svg viewBox="0 0 22 22" fill="currentColor"><path d="M3 14c0-2.3 1.1-6.2 7.3-12.9 0.2-0.2 0.4-0.4 0.7-0.4 0.3 0 0.5 0.2 0.7 0.4 6.2 6.7 7.3 10.6 7.3 12.9 0 4.4-3.6 8-8 8-4.4 0-8-3.6-8-8zM11 3.2c-4.2 4.8-6 8.4-6 10.8 0 3.3 2.7 6 6 6 3.3 0 6-2.7 6-6 0-2.4-1.8-6-6-10.8z"/><path d="M4.3 12c-0.2 0.7-0.3 1.4-0.3 2 0 3.9 3.1 7 7 7 3.9 0 7-3.1 7-7 0-0.6-0.1-1.3-0.3-2h-13.4z"/></svg>' 36084 , EO = '<svg viewBox="0 0 22 22" fill="currentColor"> <path d="M1 11c0-5.5 4.5-10 10-10 5.5 0 10 4.5 10 10 0 5.5-4.5 10-10 10-5.5 0-10-4.5-10-10zM11 3c-4.4 0-8 3.6-8 8 0 4.4 3.6 8 8 8 4.4 0 8-3.6 8-8 0-4.4-3.6-8-8-8z" /> <path d="M8 3v3h-3v-1.7l-1.5 1.7h1.5v3h-2.8l-0.1 3h2.9v3h-2.1l2.1 2.7v-2.7h3v3h-2.7l2.7 1.5v-1.5h3v-3h-3v-3h3v-3h-3v-3h3v-3h-3zM8 9v3h-3v-3h3z" /></svg>' 36085 , DO = { 36086 name: "GlobalColorPicker", 36087 components: { 36088 HyDialog: pn, 36089 SvgIcon: gt, 36090 HyTooltip: pt, 36091 HyLabel: Bn, 36092 GlobalColorDialog: xO, 36093 HySlider: ta, 36094 HyButton: nt 36095 }, 36096 props: { 36097 modelValue: Xt, 36098 fallbackColor: ce 36099 }, 36100 data() { 36101 return { 36102 colorGroup: null, 36103 colors: [], 36104 isColorPickerVisible: !1, 36105 showColorDialog: !1, 36106 showDeleteDialog: !1, 36107 svgs: me({ 36108 addSvg: CO, 36109 deleteSvg: Zr, 36110 editSvg: _O, 36111 lightnessSvg: TO, 36112 saturationSvg: kO, 36113 opacitySvg: EO 36114 }) 36115 } 36116 }, 36117 emits: ["update:modelValue", "update:globalColor"], 36118 mounted() { 36119 this.updateGlobalColors() 36120 }, 36121 methods: { 36122 getColorpickerSource() { 36123 let l = this.selColorIndex; 36124 return l >= 0 ? this.$refs.colorSwatches[l] : null 36125 }, 36126 updateGlobalColors() { 36127 let e = this.$store.activeDocument.globalColorGroups[0]; 36128 this.colorGroup = e, 36129 this.colors.splice(0, this.colors.length, ...e.colors) 36130 }, 36131 addGlobalColor() { 36132 let l = this.$store.activeDocument, e = l.globalColorGroups.reduce((s,o)=>s + o.colors.length, 0), t; 36133 do 36134 t = "color" + e++; 36135 while (l.getGlobalColorByName(t) != null); 36136 let n = l.addGlobalColor(new Ei(t,this.fallbackColor || new ce)); 36137 this.updateGlobalColors(), 36138 this.modelValue.documentModel = l, 36139 this.modelValue.globalColorId = n.id 36140 }, 36141 editGlobalColor() { 36142 this.showColorDialog = !0 36143 }, 36144 requestDeleteGlobalColor() { 36145 let l = Oe(this.colorGroup.colors[this.selColorIndex]); 36146 this.$store.activeDocument.getGlobalColorUsages(l).length > 0 ? this.showDeleteDialog = !0 : this.deleteGlobalColor(l) 36147 }, 36148 acceptDeleteGlobalColor(l) { 36149 if (l) { 36150 let e = Oe(this.colorGroup.colors[this.selColorIndex]); 36151 this.deleteGlobalColor(e) 36152 } 36153 this.showDeleteDialog = !1 36154 }, 36155 deleteGlobalColor(l) { 36156 l = Oe(l), 36157 this.modelValue.globalColor = null, 36158 this.$store.activeDocument.deleteGlobalColor(l), 36159 this.updateGlobalColors() 36160 }, 36161 changeGlobalColorColor(l) { 36162 let e = this.colors[this.selColorIndex]; 36163 if (e != null) { 36164 let t = e.color 36165 , n = this.$store.activeDocument; 36166 n.setGlobalColorColor(e, l),
36167 ae().addEdit(new zf(n,e,t)) 36168 } 36169 this.$emit("update:globalColor", this.globalColor) 36170 }, 36171 changeGlobalColorName(l) { 36172 let e = this.modelValue.getGlobalColor(); 36173 if (e) { 36174 let t = e.name 36175 , n = this.$store.activeDocument; 36176 n.setGlobalColorName(e, l), 36177 ae().addEdit(new Uf(n,e,t)) 36178 } 36179 }, 36180 onSwatchClick(l) { 36181 let e = this.modelValue; 36182 e == null ? this.$emit("update:modelValue", new Xt(this.$store.activeDocument,l.id)) : (e.documentModel = this.$store.activeDocument, 36183 e.globalColorId !== l.id ? e.globalColorId = l.id : this.editGlobalColor()) 36184 } 36185 }, 36186 computed: { 36187 selColorIndex() { 36188 let l = this.colors; 36189 if (this.colors == null || this.modelValue?.globalColorId === -1) 36190 return -1; 36191 for (let e = 0; e < l.length; e++) 36192 if (l[e].id === this.modelValue.globalColorId) 36193 return e; 36194 return -1 36195 }, 36196 lightness: { 36197 get() { 36198 return this.modelValue ? this.modelValue.colorModification.params[1] : 0 36199 }, 36200 set(l) { 36201 this.updateGlobalColors(), 36202 this.modelValue && (this.modelValue.colorModification.params[1] = Je(l, 2)) 36203 } 36204 }, 36205 saturation: { 36206 get() { 36207 return this.modelValue ? this.modelValue.colorModification.params[2] : 1 36208 }, 36209 set(l) { 36210 this.modelValue && (this.modelValue.colorModification.params[2] = Je(l, 2)) 36211 } 36212 }, 36213 alpha: { 36214 get() { 36215 return this.modelValue ? this.modelValue.colorModification.alpha : 1 36216 }, 36217 set(l) { 36218 this.modelValue && (this.modelValue.colorModification.alpha = Je(l, 2)) 36219 } 36220 } 36221 }, 36222 watch: { 36223 modelValue: { 36224 handler(l) { 36225 l.getGlobalColor() && this.$emit("update:modelValue", l) 36226 }, 36227 deep: !0, 36228 immediate: !0 36229 } 36230 } 36231} 36232 , OO = { 36233 style: { 36234 display: "flex", 36235 "flex-direction": "row", 36236 "justify-content": "center", 36237 width: "100%" 36238 } 36239} 36240 , AO = { 36241 style: { 36242 display: "grid", 36243 "grid-template-columns": "repeat(8, 34px)", 36244 "grid-auto-rows": "34px", 36245 flex: "0 0 auto" 36246 } 36247} 36248 , IO = ["onClick"] 36249 , LO = { 36250 style: { 36251 display: "flex", 36252 "flex-direction": "row", 36253 "justify-content": "flex-end", 36254 gap: "8px", 36255 width: "100%" 36256 } 36257} 36258 , VO = { 36259 style: { 36260 width: "100%", 36261 display: "flex", 36262 "align-items": "center", 36263 "justify-content": "stretch", 36264 gap: "16px" 36265 } 36266} 36267 , NO = { 36268 ref: "lightnessIcon" 36269} 36270 , RO = { 36271 style: { 36272 width: "4em", 36273 "font-variant-numeric": "tabular-nums", 36274 "text-align": "right" 36275 } 36276} 36277 , FO = { 36278 style: { 36279 width: "100%", 36280 display: "flex", 36281 "align-items": "center", 36282 "justify-content": "stretch", 36283 gap: "16px" 36284 } 36285} 36286 , BO = { 36287 ref: "saturationIcon" 36288} 36289 , zO = { 36290 style: { 36291 width: "4em", 36292 "font-variant-numeric": "tabular-nums", 36293 "text-align": "right" 36294 } 36295} 36296 , UO = { 36297 style: { 36298 width: "100%", 36299 display: "flex", 36300 "align-items": "center", 36301 "justify-content": "stretch", 36302 gap: "16px" 36303 } 36304} 36305 , GO = { 36306 ref: "opacityIcon" 36307} 36308 , HO = { 36309 style: { 36310 width: "4em", 36311 "font-variant-numeric": "tabular-nums", 36312 "text-align": "right" 36313 } 36314}; 36315function $O(l, e, t, n, s, o) { 36316 const i = E("hy-tooltip") 36317 , r = E("svg-icon") 36318 , a = E("hy-button") 36319 , d = E("hy-label") 36320 , u = E("hy-slider") 36321 , h = E("global-color-dialog") 36322 , c = E("hy-dialog"); 36323 return N(), 36324 $(Pe, null, [_("div", Wl({ 36325 class: "color-var-picker" 36326 }, l.$attrs), [_("div", OO, [_("div", AO, [(N(!0), 36327 $(Pe, null, Gt(s.colors, (f,p)=>(N(), 36328 $("div", { 36329 ref_for: !0, 36330 ref: "colorSwatches", 36331 key: f, 36332 style: xe([{ 36333 "border-radius": "50%", 36334 border: "3px solid white", 36335 display: "flex", 36336 "align-items": "center", 36337 "justify-content": "center" 36338 }, { 36339 "border-color": p === o.selColorIndex ? "var(--accent-color)" : "transparent" 36340 }]), 36341 onClick: g=>o.onSwatchClick(f) 36342 }, [_("div", { 36343 style: xe([{ 36344 width: "24px", 36345 height: "24px", 36346 "border-radius": "50%", 36347 margin: "2px" 36348 }, { 36349 background: f.color.toCss() 36350 }]) 36351 }, null, 4), w(i, { 36352 "get-target": ()=>l.$refs.colorSwatches[p], 36353 label: f.name 36354 }, null, 8, ["get-target", "label"])], 12, IO))), 128)), (N(!0), 36355 $(Pe, null, Gt(Math.max(0, 16 - s.colors.length), (f,p)=>(N(), 36356 $("div", { 36357 key: p, 36358 style: { 36359 "border-radius": "50%", 36360 border: "3px solid transparent" 36361 } 36362 }, [...e[8] || (e[8] = [_("div", { 36363 style: { 36364 width: "24px", 36365 height: "24px", 36366 "border-radius": "50%", 36367 margin: "3px", 36368 border: "1px dashed #aaa" 36369 } 36370 }, null, -1)])]))), 128))])]), _("div", LO, [w(a, { 36371 ref: "addButton", 36372 onClick: e[0] || (e[0] = f=>{ 36373 o.addGlobalColor(), 36374 s.showColorDialog = !0 36375 } 36376 ) 36377 }, {
36378 default: O(()=>[w(r, { 36379 width: "22", 36380 height: "22", 36381 svg: s.svgs.addSvg 36382 }, null, 8, ["svg"]), w(i, { 36383 getTarget: ()=>l.$refs.addButton, 36384 label: "Add" 36385 }, null, 8, ["getTarget"])]), 36386 _: 1 36387 }, 512), w(a, { 36388 ref: "deleteButton", 36389 onClick: o.requestDeleteGlobalColor, 36390 disabled: o.selColorIndex < 0 36391 }, { 36392 default: O(()=>[w(r, { 36393 width: "22", 36394 height: "22", 36395 svg: s.svgs.deleteSvg 36396 }, null, 8, ["svg"]), w(i, { 36397 getTarget: ()=>l.$refs.deleteButton, 36398 label: "Delete" 36399 }, null, 8, ["getTarget"])]), 36400 _: 1 36401 }, 8, ["onClick", "disabled"])]), w(d, null, { 36402 default: O(()=>[...e[9] || (e[9] = [ve("Modify", -1)])]), 36403 _: 1 36404 }), _("div", VO, [_("div", NO, [w(r, { 36405 width: "22", 36406 height: "22", 36407 svg: s.svgs.lightnessSvg 36408 }, null, 8, ["svg"]), w(i, { 36409 getTarget: ()=>l.$refs.lightnessIcon, 36410 label: "Lightness" 36411 }, null, 8, ["getTarget"])], 512), w(u, { 36412 modelValue: o.lightness, 36413 "onUpdate:modelValue": e[1] || (e[1] = f=>o.lightness = f), 36414 min: -1, 36415 max: 1 36416 }, null, 8, ["modelValue"]), _("span", RO, se(o.lightness.toFixed(2)), 1)]), _("div", FO, [_("div", BO, [w(r, { 36417 width: "22", 36418 height: "22", 36419 svg: s.svgs.saturationSvg 36420 }, null, 8, ["svg"]), w(i, { 36421 getTarget: ()=>l.$refs.saturationIcon, 36422 label: "Saturation" 36423 }, null, 8, ["getTarget"])], 512), w(u, { 36424 modelValue: o.saturation, 36425 "onUpdate:modelValue": e[2] || (e[2] = f=>o.saturation = f), 36426 min: 0, 36427 max: 2 36428 }, null, 8, ["modelValue"]), _("span", zO, se(o.saturation.toFixed(2)), 1)]), _("div", UO, [_("div", GO, [w(r, { 36429 width: "22", 36430 height: "22", 36431 svg: s.svgs.opacitySvg 36432 }, null, 8, ["svg"]), w(i, { 36433 getTarget: ()=>l.$refs.opacityIcon, 36434 label: "Opacity" 36435 }, null, 8, ["getTarget"])], 512), w(u, { 36436 modelValue: o.alpha, 36437 "onUpdate:modelValue": e[3] || (e[3] = f=>o.alpha = f), 36438 min: 0, 36439 max: 1 36440 }, null, 8, ["modelValue"]), _("span", HO, se(o.alpha.toFixed(2)), 1)])], 16), w(h, { 36441 show: s.showColorDialog, 36442 onClose: e[4] || (e[4] = f=>{ 36443 s.showColorDialog = !1 36444 } 36445 ), 36446 getSource: o.getColorpickerSource, 36447 color: s.colors[o.selColorIndex]?.color, 36448 "onUpdate:color": o.changeGlobalColorColor, 36449 name: t.modelValue?.globalColor?.name, 36450 "onUpdate:name": o.changeGlobalColorName 36451 }, null, 8, ["show", "getSource", "color", "onUpdate:color", "name", "onUpdate:name"]), w(c, { 36452 show: s.showDeleteDialog, 36453 onCancel: e[7] || (e[7] = f=>o.acceptDeleteGlobalColor(!1)), 36454 title: "Delete Global Color", 36455 modal: !0 36456 }, { 36457 actions: O(()=>[w(a, { 36458 onClick: e[5] || (e[5] = f=>o.acceptDeleteGlobalColor(!0)), 36459 primary: "" 36460 }, { 36461 default: O(()=>[ve(se(l.$t("ok")), 1)]), 36462 _: 1 36463 }), w(a, { 36464 onClick: e[6] || (e[6] = f=>o.acceptDeleteGlobalColor(!1)) 36465 }, { 36466 default: O(()=>[ve(se(l.$t("cancel")), 1)]), 36467 _: 1 36468 })]), 36469 default: O(()=>[e[10] || (e[10] = _("div", { 36470 style: { 36471 padding: "24px 26px" 36472 } 36473 }, " Usage of the global color will be converted to static colors. ", -1))]), 36474 _: 1 36475 }, 8, ["show"])], 64) 36476} 36477const Ev = ie(DO, [["render", $O], ["__scopeId", "data-v-356f9471"]]) 36478 , fo = "color" 36479 , sh = "globalColor" 36480 , Tg = "none" 36481 , XO = '<svg viewBox="0 0 32 32" fill="currentColor"><path d="M0 0v32h32v-32z" fill-opacity="0.6"/></svg>' 36482 , YO = '<svg viewBox="0 0 32 32" fill="currentColor"><path style="" d="M21.8 32c-5.6 0-10.2-4.6-10.2-10.2 0-5.6 4.6-10.2 10.2-10.2 5.6 0 10.2 4.6 10.2 10.2 0 5.6-4.6 10.2-10.2 10.2zM19.3 14.8c-2.6 0.9-4.6 3.4-4.9 6.3h3.5c0.1-2.5 0.6-4.8 1.4-6.3zM17.9 22.4h-3.5c0.3 3.1 2.3 5.4 4.9 6.4-0.8-1.6-1.3-3.8-1.4-6.4zM21.8 14.4c-1.1 0-2.5 2.6-2.6 6.7h5.1c-0.2-4.1-1.5-6.7-2.5-6.7zM24.3 22.4h-5.1c0.1 4.1 1.5 6.7 2.6 6.7 1 0 2.3-2.6 2.5-6.7zM29.1 21.1c-0.3-2.9-2.2-5.4-5-6.3 0.9 1.5 1.5 3.8 1.5 6.3h3.5zM25.6 22.4c0 2.6-0.6 4.8-1.5 6.4 2.8-1 4.7-3.3 5-6.4h-3.5z"/><path style="" d="M0 0h32v13.6c-2.4-3-6.1-4.9-10.2-4.9-7.2 0-13.1 5.9-13.1 13.1 0 4.1 1.9 7.8 4.9 10.2h-13.6v-32z" op
36482acity="0.6"/></svg>' 36483 , KO = '<svg viewBox="0 0 32 32" fill="currentColor"><path d="M0 30L32 0L32 4L0 34z"/></svg>>' 36484 , WO = { 36485 name: "ColorButton", 36486 components: { 36487 SvgIcon: gt, 36488 HyRadio: en, 36489 GlobalColorPicker: Ev, 36490 HyGroup: Dt, 36491 HyPopover: Ql, 36492 ColorPicker: ea, 36493 HyButton: nt, 36494 HyTooltip: pt 36495 }, 36496 props: { 36497 modelValue: [ce, Xt], 36498 tooltip: String, 36499 allowNoColor: Boolean 36500 }, 36501 data() { 36502 return { 36503 isColorDialogVisible: !1, 36504 originalColor: null, 36505 colorType: fo, 36506 color: new ce, 36507 globalColorRef: new Xt, 36508 colorCss: "transparent", 36509 globalColorCss: null, 36510 svgs: me({ 36511 solidColorSvg: XO, 36512 globalColorSvg: YO, 36513 noPaintSvg: KO 36514 }) 36515 } 36516 }, 36517 watch: { 36518 modelValue: { 36519 handler(l) { 36520 l = Oe(l), 36521 l instanceof ce ? (this.color = l, 36522 this.colorType = fo) : l instanceof Xt ? (this.globalColorRef = l, 36523 this.colorType = sh) : this.colorType = Tg, 36524 this.updatePreview() 36525 }, 36526 deep: !0, 36527 immediate: !0 36528 }, 36529 color(l) { 36530 this.colorType === fo && this.$emit("update:modelValue", l) 36531 }, 36532 colorType(l) { 36533 l === fo ? this.$emit("update:modelValue", this.color) : l === sh ? this.globalColorRef.getGlobalColor() != null && this.$emit("update:modelValue", this.globalColorRef) : (this.$emit("update:modelValue", null), 36534 this.isColorDialogVisible = !1) 36535 } 36536 }, 36537 emits: ["update:modelValue", "update:globalColor"], 36538 methods: { 36539 updatePreview() { 36540 this.updateRequestId == null && (this.updateRequestId = requestAnimationFrame(()=>{ 36541 this.updateRequestId = null; 36542 let l = "transparent" 36543 , e = null; 36544 if (this.modelValue != null) 36545 if (this.colorType === fo) 36546 l = this.color.toCss(), 36547 e = null; 36548 else { 36549 let t = this.globalColorRef 36550 , n = t.getGlobalColor(); 36551 n != null && (l = t.toCss(), 36552 e = n.color.toCss()) 36553 } 36554 this.colorCss = l, 36555 this.globalColorCss = e 36556 } 36557 )) 36558 }, 36559 setDialogVisible(l) { 36560 l ? (this.colorType === Tg && (this.colorType = fo), 36561 this.originalColor = this.modelValue?.clone()) : this.$refs.button.$el.focus(), 36562 this.isColorDialogVisible = l 36563 }, 36564 onPointerdown(l) { 36565 this.preventOpenOnButtonClick = l.defaultPrevented 36566 }, 36567 onClick(l) { 36568 !this.preventOpenOnButtonClick && !this.disabled && !l.defaultPrevented && (this.setDialogVisible(!0), 36569 l.preventDefault()) 36570 }, 36571 onPointerdownOutside(l) { 36572 l.defaultPrevented; 36573 let e = this.$store.subTool; 36574 if (e == null) 36575 l.preventDefault(), 36576 this.setDialogVisible(!1); 36577 else if (e !== hi) { 36578 let t = [l.pageX, l.pageY] 36579 , n = xi(t); 36580 (e.hitTest == null || e.hitTest(n[0], n[1]) == null) && (this.setDialogVisible(!1), 36581 l.preventDefault()) 36582 } 36583 }, 36584 onColorUpdate(l) { 36585 this.colorType === fo && this.$emit("update:modelValue", l) 36586 }, 36587 onGlobalColorUpdate(l) { 36588 this.updatePreview(), 36589 this.$emit("update:globalColor", l) 36590 }, 36591 onGlobalColorRefUpdate(l) { 36592 l != null && this.colorType === sh && this.$emit("update:modelValue", l), 36593 this.updatePreview() 36594 } 36595 } 36596} 36597 , qO = { 36598 key: 0, 36599 class: "tabs" 36600} 36601 , jO = { 36602 class: "icon-container" 36603} 36604 , JO = { 36605 class: "icon-container" 36606} 36607 , ZO = { 36608 class: "icon-container" 36609} 36610 , QO = { 36611 class: "tab-content-container" 36612}; 36613function eA(l, e, t, n, s, o) { 36614 const i = E("hy-tooltip") 36615 , r = E("hy-button") 36616 , a = E("hy-group") 36617 , d = E("svg-icon") 36618 , u = E("hy-radio") 36619 , h = E("color-picker") 36620 , c = E("global-color-picker") 36621 , f = E("hy-popover"); 36622 return N(), 36623 $(Pe, null, [w(a, nb(rm(l.$attrs)), { 36624 default: O(()=>[w(r, Wl({ 36625 ref: "button", 36626 class: ["color-button", { 36627 "no-background": t.modelValue == null 36628 }] 36629 }, l.$attrs, { 36630 onClick: o.onClick, 36631 onPointerdown: o.onPointerdown 36632 }), { 36633 default: O(()=>[_("div", { 36634 class: "color-circle", 36635 style: xe({ 36636 background: s.colorCss 36637 }) 36638 }, null, 4), s.globalColorCss ? (N(), 36639 $("div", { 36640 key: 0, 36641 class: "global-color-circle", 36642 style: xe({ 36643 background: s.globalColorCss 36644 }) 36645 }, null, 4)) : be("", !0), w(i, { 36646 "get-target": ()=>l.$refs.button, 36647 label: t.tooltip 36648 }, null, 8, ["get-target", "label"])]), 36649 _: 1 36650 }, 16, ["class", "onClick", "onPointerdown"])]), 36651 _: 1 36652 }, 16), w(f, { 36653 getSource: ()=>l.$refs.button, 36654 "primary-pos": "bottom", 36655 "secondary-pos": "start", 36656 "arrow-size": 16, 36657 show: s.isColorDialogVisible, 36658 onClose: e[3] || (e[3] = p=>o.setDialogVisible(!1)), 36659 onPointerdownOutside: o.onPointerdownOutside, 36660 isAutonomous: "" 36661 }, {
36662 default: O(()=>[l.$isDevelopment ? (N(), 36663 $("div", qO, [w(u, { 36664 type: "button", 36665 ref: "colorButton", 36666 name: "colorType", 36667 modelValue: s.colorType, 36668 "onUpdate:modelValue": e[0] || (e[0] = p=>s.colorType = p), 36669 value: "color", 36670 class: "tab-button" 36671 }, { 36672 default: O(()=>[_("div", jO, [w(d, { 36673 svg: s.svgs.solidColorSvg 36674 }, null, 8, ["svg"])]), w(i, { 36675 getTarget: ()=>l.$refs.colorButton, 36676 label: l.$t("color"), 36677 primaryPos: "bottom" 36678 }, null, 8, ["getTarget", "label"])]), 36679 _: 1 36680 }, 8, ["modelValue"]), w(u, { 36681 type: "button", 36682 ref: "globalColorButton", 36683 name: "colorType", 36684 modelValue: s.colorType, 36685 "onUpdate:modelValue": e[1] || (e[1] = p=>s.colorType = p), 36686 value: "globalColor", 36687 class: "tab-button" 36688 }, { 36689 default: O(()=>[_("div", JO, [w(d, { 36690 svg: s.svgs.globalColorSvg 36691 }, null, 8, ["svg"])]), w(i, { 36692 getTarget: ()=>l.$refs.globalColorButton, 36693 label: l.$t("globalColor"), 36694 primaryPos: "bottom" 36695 }, null, 8, ["getTarget", "label"])]), 36696 _: 1 36697 }, 8, ["modelValue"]), t.allowNoColor ? (N(), 36698 pe(u, { 36699 key: 0, 36700 type: "button", 36701 ref: "noColorButton", 36702 name: "colorType", 36703 modelValue: s.colorType, 36704 "onUpdate:modelValue": e[2] || (e[2] = p=>s.colorType = p), 36705 value: "none", 36706 class: "tab-button" 36707 }, { 36708 default: O(()=>[_("div", ZO, [w(d, { 36709 svg: s.svgs.noPaintSvg 36710 }, null, 8, ["svg"])]), w(i, { 36711 getTarget: ()=>l.$refs.noColorButton, 36712 label: l.$t("noColor"), 36713 primaryPos: "bottom" 36714 }, null, 8, ["getTarget", "label"])]), 36715 _: 1 36716 }, 8, ["modelValue"])) : be("", !0)])) : be("", !0), e[4] || (e[4] = ve("> ", -1)), _("div", QO, [s.colorType === "color" ? (N(), 36717 pe(h, { 36718 key: 0, 36719 modelValue: s.color, 36720 "onUpdate:modelValue": o.onColorUpdate, 36721 style: { 36722 padding: "16px 16px" 36723 } 36724 }, null, 8, ["modelValue", "onUpdate:modelValue"])) : be("", !0), s.colorType === "globalColor" ? (N(), 36725 pe(c, { 36726 key: 1, 36727 modelValue: s.globalColorRef, 36728 "onUpdate:modelValue": o.onGlobalColorRefUpdate, 36729 "onUpdate:globalColor": o.onGlobalColorUpdate 36730 }, null, 8, ["modelValue", "onUpdate:modelValue", "onUpdate:globalColor"])) : be("", !0)])]), 36731 _: 1 36732 }, 8, ["getSource", "show", "onPointerdownOutside"])], 64) 36733} 36734const Dv = ie(WO, [["render", eA], ["__scopeId", "data-v-160709a9"]]); 36735function tA(l) { 36736 let e = /(linear|radial)-gradient\(\s*(.*)\s*\)/i.exec(l); 36737 if (!e) 36738 return null; 36739 let t = e[1].toLowerCase() 36740 , n = e[2] 36741 , s = Av(n, ",") 36742 , o = { 36743 type: t 36744 }; 36745 if (console.log(t, ...s), 36746 t === "linear") { 36747 let i; 36748 if (s[0].startsWith("to")) { 36749 let r = /^\s*to\s+(left|right|top|bottom)(?:\s+(left|right|top|bottom))?\s*$/.exec(s[0]); 36750 if (r) { 36751 let a = 0 36752 , d = 0; 36753 r.slice(1).forEach(u=>{ 36754 u === "right" ? a = 1 : u === "left" ? a = -1 : u === "top" ? d = 1 : u === "bottom" && (d = -1) 36755 } 36756 ), 36757 i = Math.atan2(a, d) * 180 / Math.PI 36758 } 36759 } else 36760 i = nA(s[0], !0); 36761 i != null ? s.shift() : i = 180, 36762 o.angle = i 36763 } else if (t === "radial") { 36764 o.shape = "ellipse", 36765 o.size = "farthest-corner", 36766 o.position = "center"; 36767 let i = s[0].toLowerCase(); 36768 if (!Ov(i).color || /circle|ellipse|closest|farthest|at\s/.test(i)) { 36769 let a = s.shift() 36770 , d = a.split(/\sat\s/) 36771 , u = d[0].trim(); 36772 if (d.length > 1 ? o.position = d[1].trim() : a.startsWith("at ") && (o.position = a.substring(3).trim(), 36773 u = ""), 36774 u) { 36775 u.includes("circle") ? o.shape = "circle" : u.includes("ellipse") && (o.shape = "ellipse"); 36776 let h = u.match(/closest-side|closest-corner|farthest-side|farthest-corner/); 36777 if (h) 36778 o.size = h[0]; 36779 else { 36780 let c = u.replace(/circle|ellipse/g, "").trim(); 36781 c && (o.size = c) 36782 } 36783 } 36784 } 36785 } 36786 return o.stops = lA(s), 36787 o 36788} 36789function lA(l) { 36790 let e = []; 36791 for (let t of l) { 36792 let n = Ov(t); 36793 for (let s of n.offsets) 36794 e.push({ 36795 color: n.color, 36796 offset: s, 36797 isHint: n.color == null 36798 }) 36799 } 36800 if (e.length > 0) { 36801 e[0].offset == null && (e[0].offset = 0), 36802 e[e.length - 1].offset == null && (e[e.length - 1].offset = 1); 36803 let t = 1; 36804 for (; t < e.length - 1; ) 36805 if (e[t].offset == null) { 36806 let n = t + 1; 36807 for (; n < e.length - 1 && e[n].offset == null; ) 36808 n++; 36809 let s = (e[n].offset - e[t - 1].offset) / (n - t + 1); 36810 for (let o = t; o < n; o++) 36811 e[o].offset = e[o - 1].offset + s; 36812 t = n 36813 } else 36814 t++ 36815 } 36816 return e 36817} 36818function Ov(l) { 36819 let e = Av(l, " ") 36820 , t = e[0] 36821 , n = At(t) 36822 , s = [] 36823 , o = n == null ? 0 : 1; 36824 for (let i = o; i < e.length; i++) { 36825 let r = qd.parse(e[i]); 36826 r && r.unit === "%" && s.push(r.value / 100) 36827 } 36828 return s.length === 0 && s.push(null), 36829 { 36830 color: n ? new ce(n) : null, 36831 offsets: s 36832 } 36833} 36834function nA(l, e=!1) { 36835 let t = qd.parse(l); 36836 if (!t) 36837 return null; 36838 let n = t.value ?? 0, s; 36839 switch (t.unit) { 36840 case "rad": 36841 s = e ? n * 180 / Math.PI : n; 36842 break; 36843 case "deg": 36844 s = e ? n : n * Math.PI / 180; 36845 break; 36846 case "grad": 36847 s = e ? n * 180 / 200 : n * Math.PI / 200; 36848 break; 36849 case "turn": 36850 s = e ? n * 360 : n * 2 * Math.PI; 36851 break; 36852 default: 36853 s = null 36854 } 36855 return s 36856} 36857function Av(l, e) { 36858 let t = 0 36859 , n = 0 36860 , s = []; 36861 for (let o = 0; o <= l.length; o++) { 36862 let i = l[o]; 36863 if (i === "(") 36864 t++; 36865 else if (i === ")") 36866 t--; 36867 else if (t === 0 && i === e || o === l.length) { 36868 let r = l.substring(n, o).trim(); 36869 r && s.push(r), 36870 n = o + 1 36871 } 36872 } 36873 return s 36874} 36875const sA = `<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor"> 36876 <path d="M4 13.25c0-4.25 2-6.25 7-12.25 5 6 7 8 7 12.25 0 3.73-3.13 6.75-7 6.75 -3.87 0-7-3.02-7-6.75z" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> 36877 <path d="M11 1v19c3.87 0 7-3.02 7-6.75 0-4.25-2-6.25-7-12.25z" /> 36878</svg>` 36879 , oA = `<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor"> 36880<path d="M0 2h3v7h9.59l-2.3-2.29c-.39-.39-.39-1.03 0-1.42 .39-.39 1.03-.39 1.42 0l4 4c.39 .39 .39 1.03 0 1.42l-4 4c-.39 .39-1.03 .39-1.42 0 -.39-.39-.39-1.03 0-1.42l2.3-2.29h-9.59v7h-3v-16z" /> 36881</svg>` 36882 , iA = `<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor"> 36883<path d="M0 0h20v20h-20v-20zM4 2v2h-2v3h2v3h3v-3h3v3h-3v3h3v3h-3v2h11v-16h-8v2h-3v-2h-3zM4 10h-2v3h2v-3zM4 16h-2v2h2v-2zM4 4h3v3h-3v-3zM7 13h-3v3h3v-3z" /> 36884<path d="M0 0h20v20h-20v-20zM4 2v2h-2v3h2v3h3v-3h3v3h-3v3h3v3h-3v2h11v-16h-8v2h-3v-2h-3zM4 10h-2v3h2v-3zM4 16h-2v2h2v-2zM4 4h3v3h-3v-3zM7 13h-3v3h3v-3z" /> 36885</svg>` 36886 , rA = { 36887 name: "GradientPicker", 36888 components: { 36889 ColorButton: Dv, 36890 HyButton: nt, 36891 HyMenu: Ff, 36892 HySlider: ta, 36893 HySelect: Dl, 36894 HyField: js, 36895 DimInput: ms, 36896 SvgIcon: gt 36897 }, 36898 props: { 36899 modelValue: Object, 36900 selStopIndex: Number 36901 }, 36902 data() { 36903 return { 36904 previewUpdater: 1, 36905 hoverStopIndex: -1, 36906 dragStopIndex: -1, 36907 dragStopRemoved: null, 36908 colorPickerColor: new ce, 36909 isColorPickerVisible: !1, 36910 svgs: me({ 36911 deleteSvg: Zr, 36912 addSvg: ff, 36913 moreVer: kx, 36914 colorSvg: sA, 36915 offsetSvg: oA, 36916 opacitySvg: iA 36917 }), 36918 isStopMenuOpen: !1, 36919 stopMenuItems: [{ 36920 label: "gradientPicker.delete", 36921 actionObj: { 36922 performAction: ()=>this.deleteStop(this.selStopIndex) 36923 } 36924 }, { 36925 label: "gradientPicker.addBefore", 36926 actionObj: { 36927 performAction: ()=>this.addStop(this.selStopIndex, !0) 36928 } 36929 }, { 36930 label: "gradientPicker.addAfter", 36931 actionObj: { 36932 performAction: ()=>{ 36933 this.addStop(this.selStopIndex, !1), 36934 this.setSelStopIndex(this.selStopIndex + 1) 36935 } 36936 } 36937 }], 36938 spreadMethodItems: me([{ 36939 label: "gradientPicker.pad", 36940 value: "pad" 36941 }, { 36942 label: "gradientPicker.reflect", 36943 value: "reflect" 36944 }, { 36945 label: "gradientPicker.repeat", 36946 value: "repeat" 36947 }]) 36948 } 36949 }, 36950 computed: { 36951 stops() { 36952 return this.modelValue == null ? [] : this.modelValue.stops 36953 }, 36954 selStop() { 36955 return this.stops[this.selStopIndex] 36956 }, 36957 selStopOffsetPercent: { 36958 get() { 36959 let l = this.selStop; 36960 return l ? l.offsetPercent : 0 36961 }, 36962 set(l) { 36963 let e = this.selStop; 36964 e && (e.offsetPercent = l) 36965 } 36966 }, 36967 selStopOpacity: { 36968 get() { 36969 let l = this.selStop; 36970 return l ? l.opacity : 1 36971 }, 36972 set(l) { 36973 let e = this.selStop; 36974 e && (e.opacity = l) 36975 } 36976 }, 36977 gradientModel() { 36978 return this.modelValue 36979 },
36980 sliderBackgroundCss() { 36981 if (!this.previewUpdater) 36982 return; 36983 let l = "linear-gradient(90deg"; 36984 for (let e of this.stops) { 36985 let t = e.color instanceof ce ? e.color.clone() : e.color.toColor(); 36986 t.a *= e.opacity, 36987 l += ", " + t.toCss() + " " + Math.round(100 * e.offset) + "%" 36988 } 36989 return l += ")", 36990 l 36991 }, 36992 prevStopOffset() { 36993 let l = this.selStopIndex; 36994 return l <= 0 ? 0 : this.stops[l - 1].offsetPercent 36995 }, 36996 nextStopOffset() { 36997 let l = this.selStopIndex; 36998 return l >= this.stops.length - 1 ? 100 : this.stops[l + 1].offsetPercent 36999 } 37000 }, 37001 emits: ["update:modelValue", "update:globalColor", "update:colorPickerVisible", "update:selStopIndex"], 37002 mounted() { 37003 this.updateColorPickerFromStop(), 37004 Jn("paste", this.onPaste), 37005 Jn("pointermove", this.updateHoverStopIndex) 37006 }, 37007 beforeUnmount() { 37008 this.removeDocumentListeners(), 37009 Zn("paste", this.onPaste), 37010 Zn("pointermove", this.updateHoverStopIndex) 37011 }, 37012 methods: { 37013 t(l) { 37014 return this.$t("gradientPicker." + l) 37015 }, 37016 toggleStopMenuOpen() { 37017 this.isStopMenuOpen = !this.isStopMenuOpen 37018 }, 37019 deleteStop(l) { 37020 this.stops.splice(l, 1), 37021 this.setSelStopIndex(Math.max(0, l - 1)) 37022 }, 37023 addStop(l, e=!1) { 37024 if (l < 0 || l >= this.stops.length) 37025 return; 37026 let t = this.stops[l] 37027 , n = this.stops[e ? l - 1 : l + 1] 37028 , s = t.color.toColor() 37029 , o = n ? n.color.toColor() : s 37030 , i = n ? (t.offset + n.offset) / 2 : e ? 0 : 1 37031 , r = n ? s.blend(.5, o) : o 37032 , a = e ? l : l + 1; 37033 this.stops.splice(a, 0, new ks(i,r,1)) 37034 }, 37035 setSelStopIndex(l) { 37036 l !== this.selStopIndex && this.$emit("update:selStopIndex", l) 37037 }, 37038 setSpreadMethod(l) { 37039 this.modelValue.setSpreadMethod(l) 37040 }, 37041 updateSelStopColor(l) { 37042 this.modelValue.setStopColor(this.selStopIndex, l), 37043 this.colorPickerColor.constructor === l.constructor ? this.colorPickerColor.set(l) : this.colorPickerColor = l.clone() 37044 }, 37045 onGlobalColorUpdate(l) { 37046 this.$emit("update:globalColor", l), 37047 this.previewUpdater++ 37048 }, 37049 updateColorPickerFromStop() { 37050 let l = this.modelValue.getStopColor(this.selStopIndex); 37051 this.colorPickerColor.constructor === l.constructor ? this.colorPickerColor.set(l) : this.colorPickerColor = l.clone() 37052 }, 37053 addDocumentListeners() { 37054 document.addEventListener("pointermove", this.onDocumentPointerMove), 37055 document.addEventListener("pointerup", this.onDocumentPointerUp) 37056 }, 37057 removeDocumentListeners() { 37058 document.removeEventListener("pointermove", this.onDocumentPointerMove), 37059 document.removeEventListener("pointerup", this.onDocumentPointerUp) 37060 }, 37061 updateHoverStopIndex(l) { 37062 let e = 12 37063 , t = -1; 37064 if (l.target.classList.contains("color-stop")) { 37065 let n = this.stops 37066 , o = this.$refs.slider.getBoundingClientRect() 37067 , i = l.clientX - o.left 37068 , r = Number.MAX_VALUE; 37069 for (let a = 0; a < n.length; a++) { 37070 let d = n[a] 37071 , u = Math.abs(i - d.offset * o.width); 37072 if (u < e && u <= r && (t = a, 37073 r = u, 37074 d.offset === 1)) 37075 break 37076 } 37077 } 37078 this.hoverStopIndex = t 37079 }, 37080 onStopPointerMove(l) { 37081 l.buttons !== 0 || l.type 37082 }, 37083 onSliderKeyDown(l) { 37084 let e = l.key 37085 , t = this.selStopIndex; 37086 if (e === "Delete" || l.key === "Backspace") 37087 t >= 0 && this.stops.length > 1 && (this.stops.splice(t, 1), 37088 this.dragStopIndex = 0, 37089 this.setSelStopIndex(Math.max(0, t - 1))); 37090 else if (e === "ArrowRight") 37091 t < this.stops.length - 1 && this.setSelStopIndex(t + 1); 37092 else if (e === "ArrowLeft") 37093 t > 0 && this.setSelStopIndex(t - 1); 37094 else if (e === "ArrowUp" || e === "+") { 37095 let n = this.stops[t]; 37096 n && this.setSelStopIndex(this.gradientModel.setStopOffset(t, n.offset + .01, !l.ctrlKey)) 37097 } else if (e === "ArrowDown" || e === "-") { 37098 let n = this.stops[t]; 37099 n && this.setSelStopIndex(this.gradientModel.setStopOffset(t, n.offset - .01, !l.ctrlKey)) 37100 } 37101 }, 37102 onPointerDown(l) { 37103 this.updateHoverStopIndex(l),
37104 this.$refs.slider.focus(); 37105 let t = this.$refs.slider.getBoundingClientRect() 37106 , s = (l.clientX - t.left) / t.width 37107 , o = this.hoverStopIndex; 37108 if (this.dragStopIndex = o, 37109 o >= 0) 37110 this.setSelStopIndex(o); 37111 else { 37112 let i = this.gradientModel.insertStop(s, null, 1, l.ctrlKey); 37113 this.dragStopIndex = i, 37114 this.setSelStopIndex(i), 37115 this.hoverStopIndex = i 37116 } 37117 this.addDocumentListeners(), 37118 l.stopPropagation(), 37119 l.preventDefault() 37120 }, 37121 onDocumentPointerMove(l) { 37122 let e = this.dragStopIndex; 37123 if (console.log(e), 37124 e >= 0) { 37125 let t = this.stops 37126 , s = this.$refs.slider.getBoundingClientRect() 37127 , o = l.clientX - s.left; 37128 if (l.clientY - s.top > 56) 37129 this.dragStopRemoved == null && e > 0 && e < t.length - 1 && (this.dragStopRemoved = t[e], 37130 t.splice(e, 1), 37131 this.setSelStopIndex(Math.max(0, this.selStopIndex - 1)), 37132 this.hoverStopIndex = -1); 37133 else { 37134 this.dragStopRemoved != null && (t.splice(e, 0, this.dragStopRemoved), 37135 this.dragStopRemoved = null, 37136 this.setSelStopIndex(e)); 37137 let r = Math.max(0, Math.min(1, o / s.width)); 37138 (e === 0 && r !== 0 || e === t.length - 1 && r !== 1) && (this.gradientModel.insertStop(e === 0 ? 0 : 1, t[e].color, t[e].opacity), 37139 e = e === 0 ? 1 : t.length - 2, 37140 this.dragStopIndex = e, 37141 this.hoverStopIndex = e, 37142 this.setSelStopIndex(e)); 37143 let a = this.gradientModel.setStopOffset(e, r, !l.ctrlKey); 37144 a !== e && (this.dragStopIndex = a, 37145 this.setSelStopIndex(a)) 37146 } 37147 l.stopPropagation(), 37148 l.preventDefault() 37149 } 37150 }, 37151 onDocumentPointerUp(l) { 37152 this.removeDocumentListeners(), 37153 this.dragStopIndex = -1, 37154 this.dragStopRemoved = null, 37155 l.preventDefault() 37156 }, 37157 onPaste(l) { 37158 tA(""), 37159 l.preventDefault() 37160 } 37161 }, 37162 watch: { 37163 stops: { 37164 handler(l) { 37165 this.setSelStopIndex(Math.min(this.selStopIndex, l.length - 1)), 37166 this.$emit("update:modelValue", this.gradientModel), 37167 this.updateColorPickerFromStop() 37168 }, 37169 deep: !0 37170 }, 37171 selStopIndex: { 37172 handler() { 37173 this.updateColorPickerFromStop() 37174 }, 37175 immediate: !0 37176 } 37177 } 37178} 37179 , aA = { 37180 class: "gradient-picker" 37181} 37182 , dA = { 37183 class: "stops-editor-container", 37184 tabindex: "0" 37185} 37186 , uA = { 37187 class: "gradient-preview" 37188} 37189 , hA = { 37190 class: "controls" 37191} 37192 , cA = { 37193 class: "stops-dropdown-item" 37194}; 37195function fA(l, e, t, n, s, o) { 37196 const i = E("hy-select") 37197 , r = E("svg-icon") 37198 , a = E("hy-button") 37199 , d = E("hy-menu") 37200 , u = E("hy-field") 37201 , h = E("color-button") 37202 , c = E("hy-slider") 37203 , f = E("dim-input"); 37204 return N(), 37205 $("div", aA, [_("div", dA, [_("div", { 37206 ref: "slider", 37207 class: "stops-editor", 37208 onPointerdown: e[1] || (e[1] = (...p)=>o.onPointerDown && o.onPointerDown(...p)), 37209 onPointermove: e[2] || (e[2] = (...p)=>o.onStopPointerMove && o.onStopPointerMove(...p)), 37210 onKeydown: e[3] || (e[3] = (...p)=>o.onSliderKeyDown && o.onSliderKeyDown(...p)) 37211 }, [_("div", uA, [_("div", { 37212 style: xe({ 37213 background: o.sliderBackgroundCss 37214 }) 37215 }, null, 4)]), w(gS, { 37216 name: "color-stops", 37217 tag: "div", 37218 mode: "out-in", 37219 style: { 37220 background: "inherit" 37221 } 37222 }, { 37223 default: O(()=>[(N(!0), 37224 $(Pe, null, Gt(o.stops, (p,g)=>(N(), 37225 $("div", { 37226 key: p, 37227 class: Ne(["color-stop", { 37228 "sel-color-stop": t.selStopIndex === g, 37229 "hover-color-stop": s.hoverStopIndex === g 37230 }]), 37231 style: xe({ 37232 left: Math.round(p.offset * 100) + "%", 37233 color: s.previewUpdater && p.color.toCss() 37234 }), 37235 onPointerdown: e[0] || (e[0] = (...y)=>o.onPointerDown && o.onPointerDown(...y)) 37236 }, [...e[8] || (e[8] = [_("div", { 37237 class: "color-stop-overlay" 37238 }, null, -1)])], 38))), 128))]), 37239 _: 1 37240 })], 544)]), _("div", hA, [w(u, { 37241 label: o.t("stop") 37242 }, {
37243 default: O(()=>[w(i, { 37244 ref: "indicesDropdown", 37245 modelValue: t.selStopIndex, 37246 items: o.stops.map((p,g)=>g), 37247 "onUpdate:modelValue": o.setSelStopIndex 37248 }, { 37249 button: O(({value: p})=>[_("span", { 37250 ref: "label", 37251 style: { 37252 "margin-left": "12px", 37253 width: "20px" 37254 } 37255 }, se(p), 513)]), 37256 default: O(({value: p})=>[_("div", cA, [_("span", { 37257 ref: "label" 37258 }, se(p), 513), _("div", { 37259 style: xe({ 37260 background: o.stops[p].color.toCss() 37261 }) 37262 }, null, 4)])]), 37263 _: 1 37264 }, 8, ["modelValue", "items", "onUpdate:modelValue"]), w(a, { 37265 ref: "stopMenuBtn", 37266 style: { 37267 padding: "0", 37268 border: "none", 37269 background: "none", 37270 color: "#666" 37271 }, 37272 onClick: o.toggleStopMenuOpen 37273 }, { 37274 default: O(()=>[w(r, { 37275 svg: s.svgs.moreVer 37276 }, null, 8, ["svg"])]), 37277 _: 1 37278 }, 8, ["onClick"]), w(d, { 37279 "is-open": s.isStopMenuOpen, 37280 onClose: o.toggleStopMenuOpen, 37281 onActionPerformed: o.toggleStopMenuOpen, 37282 getSource: ()=>l.$refs.stopMenuBtn.$el, 37283 itemDatas: s.stopMenuItems, 37284 "is-iconless": !0, 37285 menuContentStyle: { 37286 minWidth: "120px" 37287 } 37288 }, null, 8, ["is-open", "onClose", "onActionPerformed", "getSource", "itemDatas"])]), 37289 _: 1 37290 }, 8, ["label"]), w(u, { 37291 label: o.t("stopColor") 37292 }, { 37293 default: O(()=>[w(h, { 37294 "model-value": s.colorPickerColor, 37295 "onUpdate:modelValue": o.updateSelStopColor, 37296 "onUpdate:globalColor": o.onGlobalColorUpdate 37297 }, null, 8, ["model-value", "onUpdate:modelValue", "onUpdate:globalColor"])]), 37298 _: 1 37299 }, 8, ["label"]), w(u, { 37300 label: o.t("stopOffset") 37301 }, { 37302 default: O(()=>[w(c, { 37303 modelValue: o.selStopOffsetPercent, 37304 "onUpdate:modelValue": e[4] || (e[4] = p=>o.selStopOffsetPercent = p), 37305 scaleMin: 0, 37306 scaleMax: 100, 37307 min: o.prevStopOffset, 37308 max: o.nextStopOffset 37309 }, null, 8, ["modelValue", "min", "max"]), w(f, { 37310 modelValue: o.selStopOffsetPercent, 37311 "onUpdate:modelValue": e[5] || (e[5] = p=>o.selStopOffsetPercent = p), 37312 min: o.prevStopOffset, 37313 max: o.nextStopOffset, 37314 unit: "%" 37315 }, null, 8, ["modelValue", "min", "max"])]), 37316 _: 1 37317 }, 8, ["label"]), w(u, { 37318 label: o.t("stopOpacity") 37319 }, { 37320 default: O(()=>[w(c, { 37321 modelValue: o.selStopOpacity, 37322 "onUpdate:modelValue": e[6] || (e[6] = p=>o.selStopOpacity = p), 37323 min: 0, 37324 max: 1, 37325 step: .01 37326 }, null, 8, ["modelValue"]), w(f, { 37327 modelValue: o.selStopOpacity, 37328 "onUpdate:modelValue": e[7] || (e[7] = p=>o.selStopOpacity = p), 37329 min: 0, 37330 max: 1, 37331 step: .01, 37332 f: 100, 37333 unit: "%" 37334 }, null, 8, ["modelValue"])]), 37335 _: 1 37336 }, 8, ["label"]), w(u, { 37337 label: o.t("spreadMethod"), 37338 style: { 37339 "margin-top": "16px" 37340 } 37341 }, { 37342 default: O(()=>[w(i, { 37343 modelValue: t.modelValue._spreadMethod, 37344 items: s.spreadMethodItems, 37345 valueField: "value", 37346 labelField: "label", 37347 localized: "", 37348 "onUpdate:modelValue": o.setSpreadMethod 37349 }, null, 8, ["modelValue", "items", "onUpdate:modelValue"])]), 37350 _: 1 37351 }, 8, ["label"])])]) 37352} 37353const pA = ie(rA, [["render", fA], ["__scopeId", "data-v-1d17a52d"]]); 37354class Gf { 37355 x; 37356 y; 37357 types; 37358 distances = []; 37359 constructor(e=0, t=0, n=[]) { 37360 this.x = e, 37361 this.y = t, 37362 this.types = n 37363 } 37364} 37365function Vo(l, e, t, n) { 37366 let s = V()
37367 , o = s.appSettings.editor 37368 , i = o.alignment.enabled && o.alignment.toGrid 37369 , r = o.alignment.enabled && o.alignment.toElements 37370 , a = o.alignment.enabled && o.alignment.toNodes; 37371 if (t != null) 37372 return gA(l, e, t, r, i); 37373 let d = new Gf; 37374 d.x = l, 37375 d.y = e, 37376 d.distances = [null, null], 37377 d.types = [null, null]; 37378 let u, h, c = s.zoom / 100, f = Number.MAX_VALUE, p = Number.MAX_VALUE, g = s.appSettings.editor.pointTolerance / c, y = !1; 37379 if (a) { 37380 let m = n && n.sortedNodePoints || Lv() 37381 , b = mA(l, e, m, g); 37382 b && (d.x = b.xTransformed, 37383 d.y = b.yTransformed, 37384 d.types = ["node", "node"], 37385 y = !0) 37386 } 37387 if (!y) { 37388 if (r) { 37389 let m = g 37390 , b = n && n.modelBoundsEntries || Hf(); 37391 for (let M of b) 37392 if (M.model.getType() !== "group") { 37393 let x = M.xBounds; 37394 for (let C of x) 37395 u = Math.abs(l - C), 37396 u <= m && u < f && (f = u, 37397 d.x = C, 37398 d.distances[0] = u, 37399 d.types[0] = "element"); 37400 let P = M.yBounds; 37401 for (let C of P) 37402 h = Math.abs(e - C), 37403 h <= m && h < p && (p = h, 37404 d.y = C, 37405 d.distances[1] = h, 37406 d.types[1] = "element") 37407 } 37408 } 37409 if (i) { 37410 let m = V() 37411 , b = m.activeDocument.getBounds() 37412 , M = m.appSettings.editor.grid.gridX || 64 37413 , S = m.appSettings.editor.grid.gridY || 64 37414 , x = g 37415 , P = Math.round(l / M) * M; 37416 P >= b.x && P <= b.x + b.width && (u = Math.abs(l - P), 37417 u < f && u <= x && (d.x = P, 37418 d.distances[0] = u, 37419 d.types[0] = "grid")); 37420 let C = Math.round(e / S) * S; 37421 C >= b.y && C <= b.y + b.height && (h = Math.abs(e - C), 37422 h < p && h <= x && (d.y = C, 37423 d.distances[1] = h, 37424 d.types[1] = "grid")) 37425 } 37426 } 37427 return d 37428} 37429function gA(l, e, t, n, s, o) { 37430 let i = new B(l,e) 37431 , r = new Gf; 37432 r.x = i.x, 37433 r.y = i.y; 37434 let a = V() 37435 , d = a.zoom / 100 37436 , u = Number.MAX_VALUE 37437 , h = a.appSettings.editor.pointTolerance / d; 37438 if (n) { 37439 let c = h 37440 , f = Hf(); 37441 for (let p = 0; p <= 1; p++) { 37442 const g = p === 0 ? new B(0,1) : new B(1,0); 37443 for (let y of f) { 37444 let m = p === 0 ? y.xBounds : y.yBounds; 37445 for (let b = 0; b < 2; b++) { 37446 let M = p === 0 ? l : e; 37447 if (Math.abs(m[b] - M) <= c) { 37448 let S = new B(p === 0 ? m[b] : l,p === 1 ? m[b] : e) 37449 , x = Tl(i, t, S, g) 37450 , P = i.dist(x); 37451 P <= c && P <= u && (u = P, 37452 r.distances[0] = P, 37453 r.distances[1] = P, 37454 r.types[p] = "element", 37455 (r.x !== x.x || r.y !== x.y) && (r.x = x.x, 37456 r.y = x.y, 37457 r.types[1 - p] = null)) 37458 } 37459 } 37460 } 37461 } 37462 } 37463 if (s) { 37464 let f = V().appSettings 37465 , p = f.editor.grid.gridX || 64 37466 , g = f.editor.grid.gridY || 64 37467 , y = h 37468 , m = Math.round(l / p) * p 37469 , b = Math.round(e / g) * g 37470 , M = new B(m,b) 37471 , S = Tl(i, t, M, new B(0,1)) 37472 , x = Tl(i, t, M, new B(1,0)) 37473 , P = S ? i.dist(S) : Number.POSITIVE_INFINITY 37474 , C = x ? i.dist(x) : Number.POSITIVE_INFINITY; 37475 P <= y && P <= u && (u = P, 37476 r.x = S.x, 37477 r.y = S.y, 37478 r.distances[0] = P, 37479 r.distances[1] = P, 37480 r.types[0] = "grid", 37481 r.types[1] = null), 37482 C <= y && C <= u && (r.x = x.x, 37483 r.y = x.y, 37484 r.distances[0] = C, 37485 r.distances[1] = C, 37486 r.types[1] = "grid", 37487 r.types[0] === "grid" && x.equals(S) || (r.types[0] = null)) 37488 } 37489 return r 37490} 37491function Kl(l, e, t, n, s, o) { 37492 let i = Math.abs(e - n) 37493 , r = Math.abs(l - t); 37494 if (i < Number.EPSILON && r < Number.EPSILON) { 37495 let p = new Gf(l,e,[null, null]); 37496 return p.angle = 0, 37497 p 37498 } 37499 let a, d; 37500 if (s) { 37501 let p = (l + t + e - n) / 2, g = (l - t + e + n) / 2, y = Se(l - p, e - g), m = (t + l + n - e) / 2, b = (t - l + n + e) / 2, M = Se(l - m, e - b), S; 37502 a = new B(0,0), 37503 r < i ? (l = t, 37504 d = Math.PI / 2, 37505 a.set(0, 1), 37506 S = r) : (e = n, 37507 d = 0, 37508 a.set(1, 0), 37509 S = i), 37510 y < S && (l = p, 37511 e = g, 37512 S = y, 37513 d = Math.PI / 4, 37514 a.set(1, 1)), 37515 M < S && (l = m, 37516 e = b, 37517 d = -Math.PI / 4, 37518 a.set(1, -1)) 37519 }
37520 let h = V().appSettings.editor 37521 , c = h.alignment.enabled && h.alignment.toGrid 37522 , f = Vo(l, e, c ? a : null, c); 37523 return f.angle = d, 37524 f 37525} 37526function Hf() { 37527 let l = [] 37528 , e = Iv(); 37529 for (let t of e) 37530 if (t.getType() !== "group") { 37531 let n = t.getTransformedBounds(); 37532 n != null && l.push({ 37533 xBounds: [n.x, n.x + n.width], 37534 yBounds: [n.y, n.y + n.height], 37535 model: t 37536 }) 37537 } 37538 return l 37539} 37540function Iv(l, e) { 37541 if (l == null && (l = V().activeDocument), 37542 e == null && (e = []), 37543 l.getChildModelCount() > 0) { 37544 let t = z() 37545 , n = l.getChildModels(); 37546 for (let s of n) 37547 t.isModelSelected(s) || (e.push(s), 37548 Iv(s, e)) 37549 } 37550 return e 37551} 37552function Lv(l=!0, e=!0) { 37553 let t = z() 37554 , n = [] 37555 , s = Ke(V().activeDocument.getChildModels()); 37556 for (let d of s) 37557 if ((e || !t.isModelSelected(d)) && d instanceof Jl) { 37558 let u = d.getSinglePathModels(); 37559 for (let h of u) 37560 h.getNodeCount() > 1 && n.push(h.getNodePoints()) 37561 } 37562 let o = new Set(n.flat()); 37563 l || t.sortedSelNodePoints.forEach(u=>o.delete(u)); 37564 let i = Array.from(o) 37565 , r = [...Array(i.length).keys()] 37566 , a = i.map(d=>d.xTransformed); 37567 return r.sort((d,u)=>a[d] - a[u]), 37568 r.map(d=>i[d]) 37569} 37570function mA(l, e, t, n=4) { 37571 if (t == null || t.length === 0) 37572 return null; 37573 let s = yA(l - n, t) 37574 , o = t[s]; 37575 if (o == null) 37576 return null; 37577 let i = Math.hypot(o.xTransformed - l, o.yTransformed - e); 37578 for (; ++s < t.length; ) { 37579 let r = t[s] 37580 , a = r.xTransformed; 37581 if (Math.abs(a - l) >= i || a > l && a - l > n) 37582 break; 37583 let d = Math.hypot(a - l, r.yTransformed - e); 37584 d < i && (i = d, 37585 o = r) 37586 } 37587 return i <= n ? o : null 37588} 37589function yA(l, e) { 37590 let t = 0 37591 , n = e.length; 37592 for (; t < n; ) { 37593 let s = n + t >>> 1; 37594 l > e[s].xTransformed ? t = s + 1 : n = s 37595 } 37596 return t 37597} 37598class Vv { 37599 modelBoundsEntries; 37600 sortedNodePoints; 37601 constructor(e, t) { 37602 this.modelBoundsEntries = Hf(), 37603 this.sortedNodePoints = Lv(e, t) 37604 } 37605} 37606class $f extends Ho { 37607 gradientModel; 37608 activeElement = null; 37609 isDragging = !1; 37610 unwatchGradientModel; 37611 constructor(e) { 37612 super(e) 37613 } 37614 setGradientModel(e) { 37615 this.gradientModel = e 37616 } 37617 async setActive(e) { 37618 if (e) { 37619 let t = V() 37620 , n = j(); 37621 n.hideResizeFrame(); 37622 let s = this.gradientModel 37623 , o = t.selectedModels; 37624 if (s == null || o.length === 0) 37625 return; 37626 this.showGradient(); 37627 for (let i of o) 37628 n.showModelOverlay(i); 37629 this.unwatchGradientModel = Ie(s, ()=>this.renderGradientOverlay(), { 37630 deep: !0 37631 }) 37632 } else { 37633 this.unwatchGradientModel && (this.unwatchGradientModel(), 37634 this.unwatchGradientModel = null), 37635 this.hideGradient(); 37636 let t = V() 37637 , n = j(); 37638 for (let s of t.selectedModels) 37639 n.removeModelOverlay(s) 37640 } 37641 } 37642 hideGradient() { 37643 let e = this.gradientModel; 37644 e != null && j().hideGradientElement(e) 37645 } 37646 startPointerDrag(e, t, n, s, o) { 37647 this.activeElement != null && (this.isDragging = !0) 37648 } 37649 hitTest(e, t) { 37650 let n = this.gradientModel; 37651 if (n != null) { 37652 let o = 10 / (this.getZoom() / 100); 37653 return n.hitTest(e, t, o, n) 37654 } 37655 } 37656 handlePointerDownEvent(e, t, n) { 37657 let s = this.gradientModel 37658 , o = this.hitTest(t, n); 37659 if (o != null) 37660 if (o.x = t, 37661 o.y = n, 37662 o.type === "line" && e.ctrlKey) { 37663 let i = s.getStopCount(); 37664 if (i > 2) { 37665 let r = o.offset 37666 , a = -1; 37667 for (let d = 1; d < i; d++) { 37668 let u = s.getStopOffset(d) 37669 , h = s.getStopOffset(d - 1); 37670 if (u > r) { 37671 d !== i - 1 && (d === 1 || (u - r) / (u - h) < .5) ? a = d : a = d - 1; 37672 break 37673 } 37674 } 37675 a >= 0 && (s.setStopOffset(a, r), 37676 o.type = "stop", 37677 o.index = a) 37678 } 37679 this.setActiveElement(o), 37680 this.activeElement.pStart = new B(t,n) 37681 } else 37682 this.setActiveElement(o), 37683 this.activeElement.pStart = new B(t,n); 37684 this.activeElement != null && (this.activeElement.selected = !0, 37685 this.renderGradientOverlay()) 37686 } 37687 handlePointerUpEvent(e, t, n) { 37688 this.activeElement != null ? this.activeElement.selected = !1 : super.handlePointerUpEvent(e, t, n), 37689 this.isDragging = !1 37690 } 37691 handlePointerClickEvent(e, t, n) { 37692 let s = this.hitTest(t, n); 37693 if (s != null) { 37694 let o = this.gradientModel; 37695 e.shiftKey && (s.type === "stop" && s.index > 0 && s.index < o.getStopCount() - 1 ? o.removeStop(s.index) : s.type === "line" && o.insertStop(s.offset)) 37696 } 37697 } 37698 setActiveElement(e) { 37699 this.activeElement = e, 37700 e && e.type === "stop" && (this.activeStopChangeCallback(e.index), 37701 this.renderGradientOverlay()) 37702 } 37703 renderGradientOverlay() { 37704 j().updateGradientElement(this.gradientModel, this.activeElement) 37705 } 37706} 37707class vA extends $f { 37708 constructor() { 37709 super("linearGradient") 37710 } 37711 showGradient() { 37712 let e = this.gradientModel 37713 , t = j(); 37714 t.showGradientElement(e), 37715 t.updateGradientElement(e, null) 37716 } 37717 handlePointerMoveEvent(e, t, n) { 37718 if (e.buttons !== 0 && !this.isDragging) 37719 return !1; 37720 let s = this.gradientModel; 37721 if (s == null) 37722 return; 37723 const o = e.shiftKey 37724 , i = e.ctrlKey 37725 , r = e.altKey && !o; 37726 let a = this.activeElement; 37727 if (a != null && a.selected) { 37728 let d = s.p1View 37729 , u = s.p2View; 37730 if (a.type === "line") { 37731 let h = t 37732 , c = n 37733 , f = a.x 37734 , p = a.y; 37735 d.addScalar(h - f, c - p, !0), 37736 u.addScalar(h - f, c - p, !0), 37737 a.x = h, 37738 a.y = c,
37739 s.updateModelFromView() 37740 } else { 37741 let h = a.index 37742 , c = t 37743 , f = n 37744 , p = h === 0 37745 , g = h === s.getStopCount() - 1; 37746 if (p) { 37747 if (r) { 37748 let y = Kl(t, n, u.x, u.y, !0); 37749 c = y.x, 37750 f = y.y 37751 } else if (o) { 37752 let y = Jt(d.x, d.y, u.x, u.y, c, f); 37753 c = y.x, 37754 f = y.y 37755 } 37756 d.set(c, f), 37757 s.updateModelFromView() 37758 } else if (g) { 37759 if (r) { 37760 let y = Kl(t, n, d.x, d.y, !0); 37761 c = y.x, 37762 f = y.y 37763 } else if (o) { 37764 let y = Jt(d.x, d.y, u.x, u.y, c, f); 37765 c = y.x, 37766 f = y.y 37767 } 37768 u.set(c, f), 37769 s.updateModelFromView() 37770 } else { 37771 let y = ds(d.x, d.y, u.x, u.y, c, f, !1); 37772 y = Math.max(0, Math.min(1, y)); 37773 let m = o 37774 , b = !m && !i; 37775 a.index = s.setStopOffset(h, y, b, m) 37776 } 37777 } 37778 } else { 37779 let d = this.hitTest(t, n), u; 37780 d != null ? d.type === "stop" ? (this.setCursor(!1, "pointer"), 37781 u = d) : (this.setCursor(!1, "move"), 37782 u = null) : (u = null, 37783 this.setCursor(!1, "default")), 37784 (u == null ? this.activeElement != null : this.activeElement == null || u.index !== this.activeElement.index) && (this.activeElement = u, 37785 j().updateGradientElement(s, u)) 37786 } 37787 } 37788} 37789const ka = new vA; 37790class bA extends $f { 37791 constructor() { 37792 super("radialGradient") 37793 } 37794 showGradient() { 37795 let e = this.gradientModel; 37796 e.updateViewFromModel(); 37797 let t = e.getPFocus(); 37798 e.updateModelFromView(), 37799 e.setPFocus(t); 37800 let n = j(); 37801 n.showGradientElement(e), 37802 n.updateGradientElement(e, null) 37803 } 37804 handlePointerMoveEvent(e, t, n) { 37805 if (e.buttons !== 0 && !this.isDragging) 37806 return !1; 37807 let s = this.gradientModel; 37808 if (s == null) 37809 return; 37810 const o = e.shiftKey 37811 , i = e.ctrlKey; 37812 e.altKey; 37813 let r = this.activeElement; 37814 if (r != null && r.selected) { 37815 let a = s.pCenter 37816 , d = r.axis === 0 ? s.pR1View : s.pR2View 37817 , u = r.index 37818 , h = t 37819 , c = n 37820 , f = u === 0 37821 , p = u === s.getStopCount() - 1; 37822 if (r.type === "line") { 37823 let g = s.pCenter.x - r.x 37824 , y = s.pCenter.y - r.y 37825 , m = Kl(h + g, c + y, s.pCenter.x, s.pCenter.y, !1); 37826 h = m.x - g, 37827 c = m.y - y, 37828 s.move(h - r.x, c - r.y), 37829 this.activeElement.x = h, 37830 this.activeElement.y = c 37831 } else if (f) { 37832 let g = s.getPFocus() 37833 , y = s.rFRel === 0 ? g : s.getStopPoint(0, this.activeElement.axis, this.activeElement.negative, g); 37834 if (i) 37835 g.addScalar(h - y.x, c - y.y, !0), 37836 s.setPFocus(g); 37837 else if (o) { 37838 let m = r.negative ? a.subtract(d) : d.subtract(a) 37839 , b = Jt(g.x, g.y, g.x + m.x, g.y + m.y, h, c, !0) 37840 , M = Math.abs(m.x) > Math.abs(m.y) ? (b.x - g.x) / m.x : (b.y - g.y) / m.y; 37841 M = Math.max(0, M); 37842 let x = 1 - s.pFRel.getLength() - .001; 37843 M = Math.min(x, M), 37844 s.setRFRel(M) 37845 } else 37846 s.move(h - y.x, c - y.y) 37847 } else if (p) { 37848 let g = o 37849 , y = !i; 37850 if (g) { 37851 let b = Jt(a.x, a.y, d.x, d.y, h, c); 37852 h = b.x, 37853 c = b.y 37854 } 37855 let m; 37856 r.negative ? m = new B(2 * a.x - h,2 * a.y - c) : m = new B(h,c), 37857 s.setPRView(m, r.axis, y) 37858 } else { 37859 let g, y = s.getStopPoint(0, r.axis, r.negative); 37860 if (r.negative) { 37861 let M = a.multiplyScalar(2).subtract(d, !0); 37862 g = ds(y.x, y.y, M.x, M.y, h, c, !1) 37863 } else 37864 g = ds(y.x, y.y, d.x, d.y, h, c, !1); 37865 g = Math.max(0, Math.min(1, g)); 37866 let m = o 37867 , b = !m && !i; 37868 r.index = s.setStopOffset(u, g, b, m) 37869 } 37870 j().updateGradientElement(s, this.activeElement) 37871 } else { 37872 let a = this.hitTest(t, n), d; 37873 a != null ? a.type === "stop" ? (this.setCursor(!1, "pointer"), 37874 d = a) : (this.setCursor(!1, "move"), 37875 d = null) : (d = null, 37876 this.setCursor(!1, "default")), 37877 (d == null ? this.activeElement != null : this.activeElement == null || d.index !== this.activeElement.index) && (this.activeElement = d, 37878 j().updateGradientElement(s, d)) 37879 } 37880 } 37881} 37882const Ea = new bA; 37883class MA extends Ho { 37884 constructor() { 37885 super("emptypaint") 37886 } 37887 setActive(e) { 37888 let t = V(); 37889 if (e) { 37890 let n = j(); 37891 for (let s of t.selectedModels) 37892 n.showModelOverlay(s); 37893 n.hideResizeFrame() 37894 } else { 37895 let n = j(); 37896 for (let s of t.selectedModels) 37897 n.removeModelOverlay(s) 37898 } 37899 } 37900} 37901const kg = new MA 37902 , SA = { 37903 name: "PatternPicker", 37904 components: { 37905 ColorButton: Dv, 37906 DimInput: ms, 37907 HySelect: Dl, 37908 HySlider: ta, 37909 HyCheckbox: ml, 37910 HyField: js, 37911 HyInputNumber: Lt 37912 }, 37913 props: { 37914 modelValue: Object 37915 }, 37916 data() { 37917 return { 37918 previewSvg: "", 37919 patternTypes: me([[nd, tt / 4, .1], [nd, -tt / 4, .1], [Fm, tt / 4, .1], [Fh, 0, .25], [Fh, tt / 4, .25], [Bm, 0, .5], [zm, 0, .5], [Um, 0, .4]]), 37920 rotationAngles: me([0, 30, 45, 60, 90, 120, 135, 150, 180]), 37921 selPatternTemplate: null, 37922 bgBackup: new ce(255,255,255) 37923 } 37924 }, 37925 computed: { 37926 rotation: { 37927 get() { 37928 return this.modelValue ? Je(this.modelValue.getRotation() * 180 / tt, 2) : 0 37929 }, 37930 set(l) { 37931 this.modelValue.setRotation(l * tt / 180) 37932 } 37933 }, 37934 scale: { 37935 get() { 37936 return this.modelValue ? this.modelValue.getScale() * 100 : 0 37937 }, 37938 set(l) { 37939 this.modelValue.setScale(l / 100) 37940 } 37941 }, 37942 density: { 37943 get() { 37944 return this.modelValue ? this.modelValue.density * 100 : 20 37945 }, 37946 set(l) { 37947 this.modelValue.setDensity(l / 100) 37948 } 37949 }, 37950 color: { 37951 get() { 37952 return this.modelValue ? this.modelValue.color : null 37953 }, 37954 set(l) { 37955 this.modelValue.setColor(l) 37956 } 37957 }, 37958 background: { 37959 get() { 37960 return this.modelValue.background 37961 }, 37962 set(l) {
37963 this.modelValue.setBackground(l) 37964 } 37965 }, 37966 inverse: { 37967 get() { 37968 return this.modelValue ? this.modelValue.isInverse() : !1 37969 }, 37970 set(l) { 37971 this.modelValue.setInverse(l) 37972 } 37973 } 37974 }, 37975 emits: ["update:modelValue", "update:globalColor"], 37976 mounted() { 37977 this.color = this.modelValue.color && this.modelValue.color.clone(), 37978 this.selPatternTemplate = this.patternTypes.find(l=>l[0] === this.modelValue.patternType), 37979 this.updatePreviewSvg() 37980 }, 37981 methods: { 37982 updatePreviewSvg() { 37983 this.previewSvg = np(this.modelValue.patternType, this.color, this.modelValue.background, this.modelValue.rotation, this.modelValue.density, this.modelValue.scale, this.modelValue.inverse) 37984 }, 37985 createPreviewSvg(l) { 37986 return l = l || this.patternTypes[0], 37987 np(l[0], "currentColor", null, l[1], l[2]) 37988 }, 37989 onPatternTypeClick(l) { 37990 let e = this.modelValue; 37991 (l[0] !== e.patternType || l[1] !== e.rotation) && (e.setPatternType(l[0]), 37992 e.setRotation(l[1]), 37993 e.setDensity(l[2]), 37994 e.setInverse(!1)), 37995 this.updatePreviewSvg() 37996 }, 37997 onGlobalColorUpdate(l) { 37998 this.updatePreviewSvg(), 37999 this.$emit("update:globalColor", l) 38000 } 38001 }, 38002 watch: { 38003 modelValue: { 38004 handler(l) { 38005 this.updatePreviewSvg(), 38006 this.$emit("update:modelValue", l) 38007 }, 38008 deep: !0, 38009 immediate: !0 38010 } 38011 } 38012} 38013 , wA = { 38014 class: "pattern-picker" 38015} 38016 , PA = { 38017 class: "preview-container" 38018} 38019 , xA = { 38020 class: "preview" 38021} 38022 , CA = ["innerHTML"] 38023 , _A = { 38024 class: "controls" 38025} 38026 , TA = { 38027 style: { 38028 width: "126px", 38029 height: "30px", 38030 overflow: "hidden" 38031 } 38032} 38033 , kA = ["innerHTML"]; 38034function EA(l, e, t, n, s, o) { 38035 const i = E("hy-select") 38036 , r = E("hy-field") 38037 , a = E("color-button") 38038 , d = E("dim-input") 38039 , u = E("hy-group") 38040 , h = E("hy-slider") 38041 , c = E("hy-input-number") 38042 , f = E("hy-checkbox"); 38043 return N(), 38044 $("div", wA, [_("div", PA, [_("div", xA, [_("div", { 38045 innerHTML: s.previewSvg 38046 }, null, 8, CA)])]), _("div", _A, [w(r, { 38047 label: l.$t("patternPicker.type") 38048 }, { 38049 default: O(()=>[w(i, { 38050 ref: "typesDropdown", 38051 modelValue: s.selPatternTemplate, 38052 "onUpdate:modelValue": [e[0] || (e[0] = p=>s.selPatternTemplate = p), o.onPatternTypeClick], 38053 items: s.patternTypes, 38054 style: { 38055 height: "32px", 38056 flex: "1 1 0", 38057 background: "transparent", 38058 "padding-left": "0", 38059 "max-width": "80px" 38060 } 38061 }, { 38062 default: O(({value: p})=>[_("div", TA, [_("div", { 38063 innerHTML: o.createPreviewSvg(p) 38064 }, null, 8, kA)])]), 38065 _: 1 38066 }, 8, ["modelValue", "items", "onUpdate:modelValue"])]), 38067 _: 1 38068 }, 8, ["label"]), w(r, { 38069 label: l.$t("patternPicker.colors") 38070 }, { 38071 default: O(()=>[w(a, { 38072 modelValue: o.color, 38073 "onUpdate:modelValue": e[1] || (e[1] = p=>o.color = p), 38074 "onUpdate:globalColor": o.onGlobalColorUpdate 38075 }, null, 8, ["modelValue", "onUpdate:globalColor"]), w(a, { 38076 modelValue: o.background, 38077 "onUpdate:modelValue": e[2] || (e[2] = p=>o.background = p), 38078 "onUpdate:globalColor": o.onGlobalColorUpdate, 38079 "allow-no-color": !0 38080 }, null, 8, ["modelValue", "onUpdate:globalColor"])]), 38081 _: 1 38082 }, 8, ["label"]), w(r, { 38083 label: l.$t("patternPicker.rotation") 38084 }, { 38085 default: O(()=>[w(u, null, { 38086 default: O(()=>[w(d, { 38087 modelValue: o.rotation, 38088 "onUpdate:modelValue": e[3] || (e[3] = p=>o.rotation = p), 38089 unit: "°" 38090 }, null, 8, ["modelValue"]), w(i, { 38091 modelValue: o.rotation, 38092 "onUpdate:modelValue": e[4] || (e[4] = p=>o.rotation = p), 38093 items: s.rotationAngles 38094 }, { 38095 button: O(()=>[...e[10] || (e[10] = [])]), 38096 default: O(({value: p})=>[_("span", null, se(p) + "°", 1)]), 38097 _: 1 38098 }, 8, ["modelValue", "items"])]), 38099 _: 1 38100 })]), 38101 _: 1 38102 }, 8, ["label"]), w(r, { 38103 label: l.$t("patternPicker.density") 38104 }, {
38105 default: O(()=>[w(h, { 38106 modelValue: o.density, 38107 "onUpdate:modelValue": e[5] || (e[5] = p=>o.density = p), 38108 min: 1, 38109 max: 100 38110 }, null, 8, ["modelValue"]), w(c, { 38111 modelValue: o.density, 38112 "onUpdate:modelValue": e[6] || (e[6] = p=>o.density = p) 38113 }, null, 8, ["modelValue"])]), 38114 _: 1 38115 }, 8, ["label"]), w(r, { 38116 label: l.$t("patternPicker.scale") 38117 }, { 38118 default: O(()=>[w(h, { 38119 modelValue: o.scale, 38120 "onUpdate:modelValue": e[7] || (e[7] = p=>o.scale = p), 38121 min: 1, 38122 max: 1e3 38123 }, null, 8, ["modelValue"]), w(c, { 38124 modelValue: o.scale, 38125 "onUpdate:modelValue": e[8] || (e[8] = p=>o.scale = p) 38126 }, null, 8, ["modelValue"])]), 38127 _: 1 38128 }, 8, ["label"]), w(r, { 38129 label: l.$t("patternPicker.inverted") 38130 }, { 38131 default: O(()=>[w(f, { 38132 modelValue: o.inverse, 38133 "onUpdate:modelValue": e[9] || (e[9] = p=>o.inverse = p) 38134 }, null, 8, ["modelValue"])]), 38135 _: 1 38136 }, 8, ["label"])])]) 38137} 38138const DA = ie(SA, [["render", EA], ["__scopeId", "data-v-207216c5"]]) 38139 , OA = '<svg viewBox="0 0 32 32" fill="currentColor"><path d="M0 0v32h32v-32z" fill-opacity="0.6"/></svg>' 38140 , AA = '<svg viewBox="0 0 32 32" fill="currentColor"><path d="M32 11v12l-9 9h-12l21-21z" fill-opacity="0.8"" stroke="none"/><path d="M32 23v9h-9l9-9z" /><path d="M0 9v-9h9l-9 9z" fill-opacity="0"/><path d="M31 0h1v11l-21 21h-11v-1l31-31z" fill-opacity="0.6"/><path d="M19 0h12l-31 31v-12l19-19z" fill-opacity="0.4"/><path d="M19 0l-19 19v-10l9-9h10z" fill-opacity="0.2"/></svg>' 38141 , IA = '<svg viewBox="0 0 32 32" fill="currentColor"><path d="M0 0h32v32h-32v-32zM16 0c-8.84 0-16 7.16-16 16 0 8.84 7.16 16 16 16 8.84 0 16-7.16 16-16 0-8.84-7.16-16-16-16z" opacity="0.75"/><path d="M0 16c0-8.84 7.16-16 16-16 8.84 0 16 7.16 16 16 0 8.84-7.16 16-16 16-8.84 0-16-7.16-16-16zM16 5c-6.0775 0-11 4.9225-11 11 0 6.0775 4.9225 11 11 11 6.0775 0 11-4.9225 11-11 0-6.0775-4.9225-11-11-11z" opacity="0.5"/><path d="M5 16c0-6.0775 4.9225-11 11-11 6.0775 0 11 4.9225 11 11 0 6.0775-4.9225 11-11 11-6.0775 0-11-4.9225-11-11zM16 10c-3.315 0-6 2.685-6 6 0 3.315 2.685 6 6 6 3.315 0 6-2.685 6-6 0-3.315-2.685-6-6-6z" opacity="0.25"/><path d="M22 16c0 3.315-2.685 6-6 6-3.315 0-6-2.685-6-6 0-3.315 2.685-6 6-6 3.315 0 6 2.685 6 6z" opacity="0"/></svg>' 38142 , LA = '<svg viewBox="0 0 32 32" fill="currentColor"><path d="M0 23.6v2.8l5.6 5.6h2.8l-8.4-8.4zM0 16.4l15.6 15.6h2.8l-18.4-18.4v2.8zM0 6.4l25.6 25.6h2.8l-28.4-28.4v2.8zM3.5 0l28.5 28.5v-2.8l-25.7-25.7h-2.8zM13.6 0l18.4 18.4v-2.8l-15.6-15.6h-2.8zM23.6 0l8.4 8.4v-2.8l-5.6-5.6h-2.8z"/></svg>' 38143 , VA = '<svg viewBox="0 0 32 32" fill="currentColor"><path style="" d="M21.8 32c-5.6 0-10.2-4.6-10.2-10.2 0-5.6 4.6-10.2 10.2-10.2 5.6 0 10.2 4.6 10.2 10.2 0 5.6-4.6 10.2-10.2 10.2zM19.3 14.8c-2.6 0.9-4.6 3.4-4.9 6.3h3.5c0.1-2.5 0.6-4.8 1.4-6.3zM17.9 22.4h-3.5c0.3 3.1 2.3 5.4 4.9 6.4-0.8-1.6-1.3-3.8-1.4-6.4zM21.8 14.4c-1.1 0-2.5 2.6-2.6 6.7h5.1c-0.2-4.1-1.5-6.7-2.5-6.7zM24.3 22.4h-5.1c0.1 4.1 1.5 6.7 2.6 6.7 1 0 2.3-2.6 2.5-6.7zM29.1 21.1c-0.3-2.9-2.2-5.4-5-6.3 0.9 1.5 1.5 3.8 1.5 6.3h3.5zM25.6 22.4c0 2.6-0.6 4.8-1.5 6.4 2.8-1 4.7-3.3 5-6.4h-3.5z"/><path style="" d="M0 0h32v13.6c-2.4-3-6.1-4.9-10.2-4.9-7.2 0-13.1 5.9-13.1 13.1 0 4.1 1.9 7.8 4.9 10.2h-13.6v-32z" opacity="0.6"/></svg>' 38144 , NA = '<svg viewBox="0 0 32 32" fill="currentColor"><path d="M0 30L32 0L32 4L0 34z"/></svg>>' 38145 , RA = { 38146 name: "PaintDialog", 38147 components: { 38148 GlobalColorPicker: Ev, 38149 PatternPicker: DA, 38150 HyTooltip: pt, 38151 SvgIcon: gt, 38152 ColorPicker: ea, 38153 GradientPicker: pA, 38154 HyPopover: Ql, 38155 HyRadio: en 38156 }, 38157 emits: ["update:paint", "update:globalColor", "close"], 38158 props: { 38159 show: { 38160 type: Boolean, 38161 default: !1 38162 }, 38163 paintGroup: { 38164 type: ql, 38165 required: !0 38166 }, 38167 getSource: Function, 38168 onPointerdownOutside: Function 38169 }, 38170 data() { 38171 return { 38172 paintType: null, 38173 color: null, 38174 globalColorRef: null, 38175 globalColorPreviewColor: null, 38176 linearGradientModel: null, 38177 radialGradientModel: null, 38178 patternModel: null, 38179 active: !1, 38180 svgs: me({ 38181 solidColorSvg: OA, 38182 linearGradientSvg: AA, 38183 radialGradientSvg: IA, 38184 patternSvg: LA, 38185 globalColorSvg: VA, 38186 noPaintSvg: NA 38187 }), 38188 selGradientStopIndex: 0, 38189 originalPaint: null 38190 } 38191 }, 38192 watch: { 38193 show(l) { 38194 if (l) { 38195 let e = Oe(this.paintGroup); 38196 this.paintType = e.paintType, 38197 this.color = e.color.clone(), 38198 this.globalColorRef = e.globalColorRef?.clone(), 38199 this.linearGradientModel = e.linearGradientModel.clone(), 38200 this.radialGradientModel = e.radialGradientModel.clone(), 38201 this.patternModel = e.patternModel.clone(), 38202 this.originalPaint = e.getPaint()?.clone(), 38203 this.syncColor(this.paintType), 38204 el(()=>this.active = !0) 38205 } else { 38206 this.active = !1, 38207 this.color = null, 38208 this.globalColorRef = null, 38209 this.linearGradientModel = null, 38210 this.radialGradientModel = null, 38211 this.patternModel = null, 38212 this.paintType = null; 38213 let t = Oe(this.paintGroup).getPaint(); 38214 t && !t.equals(this.originalPaint) && this.$store.addRecentPaint(t) 38215 } 38216 }, 38217 paintType(l, e) { 38218 let t = this.$store; 38219 l == null ? (t.setSubTool(null), 38220 this.show && this.close()) : l === Wt ? (this.updatePaintBounds(l) && (this.linearGradientModel = this.paintGroup.linearGradientModel), 38221 ka.setGradientModel(this.linearGradientModel), 38222 ka.activeStopChangeCallback = this.setSelGradientStopIndex, 38223 ka.renderGradientOverlay(), 38224 t.setSubTool(ka)) : l === sl ? (this.updatePaintBounds(l) && (this.radialGradientModel = this.paintGroup.radialGradientModel), 38225 Ea.setGradientModel(this.radialGradientModel), 38226 Ea.activeStopChangeCallback = this.setSelGradientStopIndex, 38227 Ea.renderGradientOverlay(), 38228 t.setSubTool(Ea)) : t.setSubTool(kg), 38229 this.syncColor(e), 38230 this.updatePaint() 38231 }, 38232 linearGradientModel: { 38233 handler(l) { 38234 l != null && this.updatePaint() 38235 }, 38236 deep: !0 38237 }, 38238 radialGradientModel: { 38239 handler(l) { 38240 l != null && this.updatePaint() 38241 }, 38242 deep: !0 38243 }, 38244 patternModel: { 38245 handler(l) { 38246 l != null && this.updatePaint() 38247 }, 38248 deep: !0 38249 } 38250 }, 38251 methods: { 38252 updatePaint() { 38253 if (this.active) { 38254 let l = this.paintType, e; 38255 l === Sl ? e = new et(this.color) : l === il ? (this.globalColorRef.getGlobalColor() != null && (e = new et(Oe(this.globalColorRef))), 38256 this.globalColorPreviewColor = this.globalColorRef.toColor()) : l === Wt ? e = new et(Oe(this.linearGradientModel)) : l === sl ? e = new et(Oe(this.radialGradientModel)) : l === Ml ? e = new et(Oe(this.patternModel)) : e = null, 38257 e !== void 0 && this.$emit("update:paint", e) 38258 } 38259 }, 38260 syncColor(l) { 38261 if (l == null) 38262 return; 38263 let e = null; 38264 l === Sl ? e = this.color : l === il ? e = this.globalColorRef?.toColor() : l === Wt ? e = this.linearGradientModel?.getStopColor
38264(0) : l === sl ? e = this.radialGradientModel?.getStopColor(0) : l === Ml && (e = this.patternModel?.getColor()), 38265 e instanceof ce && (l !== Sl && this.color.set(e), 38266 l === Wt ? this.radialGradientModel.setStops(this.linearGradientModel.stops) : l === sl ? this.linearGradientModel.setStops(this.radialGradientModel.stops) : (this.linearGradientModel.setColor(e), 38267 this.radialGradientModel.setColor(e)), 38268 l !== Ml && (e = this.patternModel.setColor(e))) 38269 }, 38270 close() { 38271 this.$emit("close") 38272 }, 38273 updatePaintBounds(l) { 38274 let e = this.$store 38275 , t = e.textSelection.textModel || Lr(e.selectedModels); 38276 if (t != null) { 38277 let n = this.paintGroup.paintTarget, s = t.getPaint(n), o = s ? s.type !== l : !0, i; 38278 if (o) { 38279 for (let r of e.selectedModels) { 38280 let a = r.getTransformedBounds(); 38281 i = i ? i.addRect(a) : a 38282 } 38283 if (e.textSelection.textModel) { 38284 let r = e.textSelection.textModel.getTransformedBounds(); 38285 i = i ? i.addRect(r) : r 38286 } 38287 } else 38288 i = t.getTransformedBounds(); 38289 return this.paintGroup.setPaintBounds(l, i, o), 38290 !0 38291 } 38292 return !1 38293 }, 38294 onGlobalColorUpdate(l) { 38295 this.globalColorPreviewColor = this.globalColorRef.toColor(), 38296 this.$emit("update:globalColor", l); 38297 let e = this.$store.subTool; 38298 e instanceof $f && e.renderGradientOverlay() 38299 }, 38300 setSelGradientStopIndex(l) { 38301 this.selGradientStopIndex = l 38302 } 38303 } 38304} 38305 , FA = { 38306 class: "tabs" 38307} 38308 , BA = { 38309 class: "icon-container" 38310} 38311 , zA = { 38312 class: "icon-container" 38313} 38314 , UA = { 38315 class: "icon-container" 38316} 38317 , GA = { 38318 class: "icon-container" 38319} 38320 , HA = { 38321 class: "icon-container" 38322} 38323 , $A = { 38324 class: "icon-container" 38325} 38326 , XA = { 38327 class: "tab-content-container" 38328} 38329 , YA = { 38330 key: 0, 38331 class: "tab-content" 38332} 38333 , KA = { 38334 class: "color-preview-container" 38335} 38336 , WA = { 38337 key: 1, 38338 class: "tab-content" 38339} 38340 , qA = { 38341 class: "color-preview-container" 38342} 38343 , jA = { 38344 key: 2, 38345 class: "tab-content" 38346} 38347 , JA = { 38348 key: 3, 38349 class: "tab-content" 38350} 38351 , ZA = { 38352 key: 4, 38353 class: "tab-content" 38354}; 38355function QA(l, e, t, n, s, o) { 38356 const i = E("svg-icon") 38357 , r = E("hy-tooltip") 38358 , a = E("hy-radio") 38359 , d = E("color-picker") 38360 , u = E("global-color-picker") 38361 , h = E("gradient-picker") 38362 , c = E("pattern-picker") 38363 , f = E("hy-popover"); 38364 return N(), 38365 pe(f, { 38366 ref: "popover", 38367 show: t.show, 38368 getSource: t.getSource, 38369 "primary-pos": "bottom", 38370 "secondary-pos": "start", 38371 onPointerdownOutside: t.onPointerdownOutside, 38372 onCancel: o.close, 38373 backdropStyle: "background: transparent; pointer-events: none;" 38374 }, {
38375 default: O(()=>[_("div", FA, [w(a, { 38376 type: "button", 38377 ref: "colorButton", 38378 modelValue: s.paintType, 38379 "onUpdate:modelValue": e[0] || (e[0] = p=>s.paintType = p), 38380 value: "color", 38381 name: "paintType", 38382 class: "tab-button" 38383 }, { 38384 default: O(()=>[_("div", BA, [w(i, { 38385 svg: s.svgs.solidColorSvg 38386 }, null, 8, ["svg"])]), w(r, { 38387 getTarget: ()=>l.$refs.colorButton, 38388 label: l.$t("color"), 38389 primaryPos: "bottom" 38390 }, null, 8, ["getTarget", "label"])]), 38391 _: 1 38392 }, 8, ["modelValue"]), l.$isDevelopment ? (N(), 38393 pe(a, { 38394 key: 0, 38395 type: "button", 38396 ref: "globalColorButton", 38397 modelValue: s.paintType, 38398 "onUpdate:modelValue": e[1] || (e[1] = p=>s.paintType = p), 38399 value: "globalColor", 38400 name: "paintType", 38401 class: "tab-button" 38402 }, { 38403 default: O(()=>[_("div", zA, [w(i, { 38404 svg: s.svgs.globalColorSvg 38405 }, null, 8, ["svg"])]), w(r, { 38406 getTarget: ()=>l.$refs.globalColorButton, 38407 label: l.$t("globalColor"), 38408 primaryPos: "bottom" 38409 }, null, 8, ["getTarget", "label"])]), 38410 _: 1 38411 }, 8, ["modelValue"])) : be("", !0), w(a, { 38412 type: "button", 38413 ref: "linGradButton", 38414 modelValue: s.paintType, 38415 "onUpdate:modelValue": e[2] || (e[2] = p=>s.paintType = p), 38416 value: "linearGradient", 38417 name: "paintType", 38418 class: "tab-button" 38419 }, { 38420 default: O(()=>[_("div", UA, [w(i, { 38421 svg: s.svgs.linearGradientSvg 38422 }, null, 8, ["svg"])]), w(r, { 38423 getTarget: ()=>l.$refs.linGradButton, 38424 label: l.$t("linearGradient"), 38425 primaryPos: "bottom" 38426 }, null, 8, ["getTarget", "label"])]), 38427 _: 1 38428 }, 8, ["modelValue"]), w(a, { 38429 type: "button", 38430 ref: "radGradButton", 38431 modelValue: s.paintType, 38432 "onUpdate:modelValue": e[3] || (e[3] = p=>s.paintType = p), 38433 value: "radialGradient", 38434 name: "paintType", 38435 class: "tab-button" 38436 }, { 38437 default: O(()=>[_("div", GA, [w(i, { 38438 svg: s.svgs.radialGradientSvg 38439 }, null, 8, ["svg"])]), w(r, { 38440 getTarget: ()=>l.$refs.radGradButton, 38441 label: l.$t("radialGradient"), 38442 primaryPos: "bottom" 38443 }, null, 8, ["getTarget", "label"])]), 38444 _: 1 38445 }, 8, ["modelValue"]), w(a, { 38446 type: "button", 38447 ref: "patternButton", 38448 modelValue: s.paintType, 38449 "onUpdate:modelValue": e[4] || (e[4] = p=>s.paintType = p), 38450 value: "pattern", 38451 name: "paintType", 38452 class: "tab-button" 38453 }, { 38454 default: O(()=>[_("div", HA, [w(i, { 38455 svg: s.svgs.patternSvg 38456 }, null, 8, ["svg"])]), w(r, { 38457 getTarget: ()=>l.$refs.patternButton, 38458 label: l.$t("pattern"), 38459 primaryPos: "bottom" 38460 }, null, 8, ["getTarget", "label"])]), 38461 _: 1 38462 }, 8, ["modelValue"]), w(a, { 38463 type: "button", 38464 ref: "noPaintButton", 38465 modelValue: s.paintType, 38466 "onUpdate:modelValue": e[5] || (e[5] = p=>s.paintType = p), 38467 value: null, 38468 name: "paintType", 38469 class: "tab-button" 38470 }, { 38471 default: O(()=>[_("div", $A, [w(i, { 38472 svg: s.svgs.noPaintSvg 38473 }, null, 8, ["svg"])]), w(r, { 38474 getTarget: ()=>l.$refs.noPaintButton, 38475 label: l.$t("noPaint"), 38476 primaryPos: "bottom" 38477 }, null, 8, ["getTarget", "label"])]), 38478 _: 1 38479 }, 8, ["modelValue"])]), _("div", XA, [s.paintType === "color" ? (N(), 38480 $("div", YA, [_("div", KA, [_("div", { 38481 class: "color-preview", 38482 style: xe({ 38483 color: s.color ? s.color.toCss() : "transparent" 38484 }) 38485 }, null, 4)]), w(d, { 38486 ref: "colorPicker", 38487 modelValue: s.color, 38488 "onUpdate:modelValue": [e[6] || (e[6] = p=>s.color = p), o.updatePaint] 38489 }, null, 8, ["modelValue", "onUpdate:modelValue"])])) : s.paintType === "globalColor" ? (N(), 38490 $("div", WA, [_("div", qA, [_("div", { 38491 class: "color-preview", 38492 style: xe({ 38493 color: s.globalColorPreviewColor?.toCss() ?? "transparent" 38494 }) 38495 }, null, 4)]), w(u, { 38496 modelValue: s.globalColorRef, 38497 "onUpdate:modelValue": [e[7] || (e[7] = p=>s.globalColorRef = p), o.updatePaint], 38498 fallbackColor: s.color, 38499 "onUpdate:globalColor": o.onGlobalColorUpdate 38500 }, null, 8, ["modelValue", "fallbackColor", "onUpdate:modelValue", "onUpdate:globalColor"])])) : s.paintType === "linearGradient" ? (N(), 38501 $("div", jA, [w(h, { 38502 modelValue: s.linearGradientModel, 38503 selStopIndex: s.selGradientStopIndex, 38504 "onUpdate:selStopIndex": e[8] || (e[8] = p=>s.selGradientStopIndex = p), 38505 "onUpdate:globalColor": o.onGlobalColorUpdate 38506 }, null, 8, ["modelValue", "selStopIndex", "onUpdate:globalColor"])])) : s.paintType === "radialGradient" ? (N(), 38507 $("div", JA, [w(h, { 38508 modelValue: s.radialGradientModel, 38509 selStopIndex: s.selGradientStopIndex, 38510 "onUpdate:selStopIndex": e[9] || (e[9] = p=>s.selGradientStopIndex = p), 38511 "onUpdate:globalColor": o.onGlobalColorUpdate 38512 }, null, 8, ["modelValue", "selStopIndex", "onUpdate:globalColor"])])) : s.paintType === "pattern" ? (N(), 38513 $("div", ZA, [w(c, { 38514 modelValue: s.patternModel, 38515 "onUpdate:modelValue": o.updatePaint, 38516 "onUpdate:globalColor": o.onGlobalColorUpdate 38517 }, null, 8, ["modelValue", "onUpdate:modelValue", "onUpdate:globalColor"])])) : be("", !0)])]), 38518 _: 1 38519 }, 8, ["show", "getSource", "onPointerdownOutside", "onCancel"]) 38520} 38521const e9 = ie(RA, [["render", QA], ["__scopeId", "data-v-eacfc9ee"]]) 38522 , t9 = { 38523 name: "PaintButton", 38524 inheritAttrs: !1, 38525 components: { 38526 HyButton: nt, 38527 HyTooltip: pt, 38528 PaintDialog: e9 38529 }, 38530 emits: ["update:paint", "showDialog"], 38531 props: { 38532 paintGroup: ql, 38533 paintTarget: String, 38534 allowNoPaint: { 38535 type: Boolean, 38536 default: !0 38537 }, 38538 disabled: { 38539 type: Boolean, 38540 default: !1 38541 } 38542 }, 38543 data() { 38544 return { 38545 isPaintDialogOpen: !1, 38546 isChanged: !1 38547 } 38548 }, 38549 computed: { 38550 isNoPaint() { 38551 return this.paintGroup == null || this.paintGroup.isNoPaint 38552 }, 38553 background() { 38554 return this.disabled || this.isNoPaint ? "transparent" : this.paintGroup?.paintType === Ml ? "#ffffff" : "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAAAAACoWZBhAAAAHElEQVR42mM8wwAExiCCiQEOCDIZ/4PIs6RqAwDNHgLeFwMXyAAAAABJRU5ErkJggg==) repeat fixed" 38555 }, 38556 selectedModels() { 38557 return this.$store.selectedModels 38558 }, 38559 textSelection() { 38560 return this.$store.textSelection 38561 }, 38562 tooltip() { 38563 let l = this.paintTarget + "Paint"; 38564 return this.$t(l) 38565 } 38566 }, 38567 watch: { 38568 paintGroup: { 38569 handler() { 38570 this.updatePreview() 38571 }, 38572 deep: !0, 38573 immediate: !0 38574 }, 38575 disabled() {} 38576 }, 38577 methods: { 38578 updatePreview() { 38579 this.updateRequestId == null && (this.updateRequestId = requestAnimationFrame(()=>{ 38580 this.updateRequestId = null; 38581 let l = this.$refs.previewSvg; 38582 if (l) { 38583 let e = this.$refs.previewNone 38584 , t = this.$refs.previewRect 38585 , n = this.$refs.previewCircle 38586 , s = Oe(this.paintGroup) 38587 , o = s.getPaint(); 38588 if (o) { 38589 o = o.clone(); 38590 let i = s.getPaintBounds(); 38591 o.mapPaintBounds(i, new Ve(0,0,32,32)), 38592 o.applyToPreviewSvg(l), 38593 t.removeAttribute("visibility"), 38594 e.setAttribute("visibility", "hidden") 38595 } else 38596 t.setAttribute("visibility", "hidden"), 38597 n.setAttribute("visibility", "hidden"), 38598 e.removeAttribute("visibility") 38599 } 38600 } 38601 )) 38602 }, 38603 toggleNoPaint() { 38604 let l = this.paintGroup 38605 , e = !l.isNoPaint; 38606 this.$emit("update:paint", e ? null : l.getPaint(l.paintType)), 38607 this.isChanged = !0 38608 }, 38609 onPaintUpdate(l) { 38610 this.$emit("update:paint", l), 38611 this.isChanged = !0 38612 }, 38613 onGlobalColorUpdate() { 38614 this.updatePreview() 38615 }, 38616 setDialogOpen(l) { 38617 l ? this.isChanged = !1 : (this.$refs.button.$el.focus(), 38618 this.isChanged && this.$store.addRecentPaint(this.paintGroup.getPaint())), 38619 this.isPaintDialogOpen = l, 38620 this.$emit("showDialog", l) 38621 }, 38622 onPointerdown(l) { 38623 this.preventOpenOnButtonClick = l.defaultPrevented 38624 }, 38625 onClick(l) { 38626 !l.defaultPrevented && !this.disabled && (l.preventDefault(), 38627 this.preventOpenOnButtonClick || el(()=>{ 38628 this.isNoPaint && this.toggleNoPaint(), 38629 this.setDialogOpen(!0), 38630 l.preventDefault() 38631 } 38632 )) 38633 }, 38634 onPointerdownOutside(l) { 38635 if (l.defaultPrevented) 38636 return; 38637 let e = this.$editorComponent?.viewport.contains(l.target) 38638 , t = this.$refs.button.$el.contains(l.target) 38639 , n = this.$store.subTool; 38640 if (n == null) 38641 this.setDialogOpen(!1), 38642 (e || t) && l.preventDefault(); 38643 else if (n !== hi) { 38644 let s = [l.pageX, l.pageY] 38645 , o = xi(s);
38646 (n.hitTest == null || n.hitTest(o[0], o[1]) == null) && (this.setDialogOpen(!1), 38647 t && l.preventDefault()) 38648 } 38649 } 38650 } 38651} 38652 , l9 = { 38653 ref: "previewSvg", 38654 viewBox: "0 0 32 32", 38655 preserveAspectRatio: "xMidYMid slice" 38656} 38657 , n9 = { 38658 ref: "previewRect", 38659 x: "0", 38660 y: "0", 38661 width: "32", 38662 height: "32" 38663} 38664 , s9 = { 38665 ref: "previewCircle", 38666 cx: "24", 38667 cy: "24", 38668 r: "7", 38669 class: "preview-circle" 38670} 38671 , o9 = { 38672 ref: "previewNone", 38673 d: "M-2 32L31 0", 38674 stroke: "rgb(230 51 0 / 0.7)" 38675} 38676 , i9 = { 38677 key: 0, 38678 class: "stroke-inner-rect" 38679}; 38680function r9(l, e, t, n, s, o) { 38681 const i = E("hy-tooltip") 38682 , r = E("hy-button") 38683 , a = E("paint-dialog"); 38684 return N(), 38685 $(Pe, null, [w(r, Wl({ 38686 ref: "button", 38687 class: "paint-button" 38688 }, l.$attrs, { 38689 onClick: o.onClick, 38690 onPointerdown: o.onPointerdown, 38691 disabled: t.disabled 38692 }), { 38693 default: O(()=>[_("div", { 38694 class: "background", 38695 style: xe({ 38696 background: o.background 38697 }) 38698 }, null, 4), (N(), 38699 $("svg", l9, [e[1] || (e[1] = _("defs", null, null, -1)), _("rect", n9, null, 512), _("circle", s9, null, 512), _("path", o9, null, 512)], 512)), t.paintTarget === "stroke" ? (N(), 38700 $("div", i9)) : be("", !0), w(i, { 38701 "get-target": ()=>l.$refs.button, 38702 label: o.tooltip 38703 }, null, 8, ["get-target", "label"])]), 38704 _: 1 38705 }, 16, ["onClick", "onPointerdown", "disabled"]), w(a, { 38706 class: "paint-button-dialog", 38707 getSource: ()=>l.$refs.button, 38708 "paint-group": t.paintGroup, 38709 show: s.isPaintDialogOpen, 38710 onClose: e[0] || (e[0] = d=>o.setDialogOpen(!1)), 38711 onPointerdownOutside: o.onPointerdownOutside, 38712 "onUpdate:paint": o.onPaintUpdate, 38713 "onUpdate:globalColor": o.onGlobalColorUpdate 38714 }, null, 8, ["getSource", "paint-group", "show", "onPointerdownOutside", "onUpdate:paint", "onUpdate:globalColor"])], 64) 38715} 38716const mu = ie(t9, [["render", r9], ["__scopeId", "data-v-dba07730"]]) 38717 , a9 = { 38718 name: "PaintPreview", 38719 components: { 38720 HySelect: Dl, 38721 PaintButton: mu, 38722 StrokeStyleEditor: gu 38723 }, 38724 props: { 38725 collapsed: { 38726 type: Boolean, 38727 default: !1 38728 } 38729 }, 38730 data() { 38731 return { 38732 fillPaintGroup: null, 38733 strokePaintGroup: null, 38734 changed: !1, 38735 fillRuleItems: me([{ 38736 label: "evenodd", 38737 value: "evenodd" 38738 }, { 38739 label: "nonzero", 38740 value: "nonzero" 38741 }]) 38742 } 38743 }, 38744 computed: { 38745 hasStroke: { 38746 get() { 38747 return this.strokePaintGroup != null && !this.strokePaintGroup.isNoPaint 38748 }, 38749 set(l) { 38750 let e = this.strokePaintGroup; 38751 e.isNoPaint = !l; 38752 let t = l ? e.getPaint() : null 38753 , n = z(); 38754 n.setSelectionPaint(t, "stroke"), 38755 l && (n.setSelectionStrokeStyle(this.strokeStyle), 38756 this.$store.strokeStyle.set(this.strokeStyle)) 38757 } 38758 }, 38759 hasFill: { 38760 get() { 38761 return this.fillPaintGroup != null && !this.fillPaintGroup.isNoPaint 38762 }, 38763 set(l) { 38764 let e = this.fillPaintGroup; 38765 e.isNoPaint = !l; 38766 let t = l ? e.getPaint() : null; 38767 z().setSelectionPaint(t, "fill") 38768 } 38769 }, 38770 strokeStyle() { 38771 return this.$store.strokeStyle 38772 }, 38773 fillRule: { 38774 get() { 38775 return this.$store.selectionFillRule 38776 }, 38777 set(l) { 38778 z().setSelectionFillRule(l) 38779 } 38780 }, 38781 noSelection() { 38782 return !(this.$store.selectedModels?.length || this.$store.textSelection?.textModel) 38783 } 38784 }, 38785 methods: { 38786 onShowPaintDialog(l) { 38787 l ? this.$store.updateSelectionStyle() : this.changed 38788 }, 38789 onPaintUpdate(l, e) { 38790 (e === "stroke" ? this.strokePaintGroup : this.fillPaintGroup).setPaint(l), 38791 z().setSelectionPaint(l, e) 38792 }, 38793 onStrokeStyleUpdate(l) { 38794 this.strokeStyle.set(l), 38795 z().setSelectionStrokeStyle(l) 38796 } 38797 }, 38798 beforeMount() { 38799 let l = this.$store; 38800 this.fillPaintGroup = l.fillPaintGroup, 38801 this.strokePaintGroup = l.strokePaintGroup 38802 } 38803} 38804 , d9 = { 38805 class: "paint" 38806} 38807 , u9 = { 38808 key: 0, 38809 class: "label" 38810} 38811 , h9 = { 38812 class: "paint-field" 38813} 38814 , c9 = { 38815 class: "paint" 38816} 38817 , f9 = { 38818 key: 0, 38819 class: "label" 38820}; 38821function p9(l, e, t, n, s, o) { 38822 const i = E("paint-button") 38823 , r = E("hy-select") 38824 , a = E("stroke-style-editor"); 38825 return N(), 38826 $("div", { 38827 class: Ne(["container", { 38828 collapsed: t.collapsed 38829 }]) 38830 }, [_("div", d9, [t.collapsed ? be("", !0) : (N(),
38831 $("div", u9, se(l.$t("fillPaint")), 1)), _("div", h9, [w(i, { 38832 "paint-group": s.fillPaintGroup, 38833 "paint-target": "fill", 38834 "onUpdate:paint": e[0] || (e[0] = d=>o.onPaintUpdate(d, "fill")), 38835 onShowDialog: o.onShowPaintDialog, 38836 disabled: o.noSelection 38837 }, null, 8, ["paint-group", "onShowDialog", "disabled"]), l.$isDevelopment && o.fillRule ? (N(), 38838 pe(r, { 38839 key: 0, 38840 modelValue: o.fillRule, 38841 "onUpdate:modelValue": e[1] || (e[1] = d=>o.fillRule = d), 38842 items: s.fillRuleItems, 38843 valueField: "value", 38844 labelField: "label" 38845 }, null, 8, ["modelValue", "items"])) : be("", !0)])]), _("div", c9, [t.collapsed ? be("", !0) : (N(), 38846 $("div", f9, se(l.$t("strokePaint")), 1)), _("div", { 38847 class: "paint-field", 38848 style: xe({ 38849 "flex-direction": t.collapsed ? "column" : "row" 38850 }) 38851 }, [w(i, { 38852 "paint-group": s.strokePaintGroup, 38853 "paint-target": "stroke", 38854 "onUpdate:paint": e[2] || (e[2] = d=>o.onPaintUpdate(d, "stroke")), 38855 onShowDialog: o.onShowPaintDialog, 38856 disabled: o.noSelection 38857 }, null, 8, ["paint-group", "onShowDialog", "disabled"]), w(a, { 38858 compact: t.collapsed, 38859 strokeStyle: o.strokeStyle, 38860 "onUpdate:strokeStyle": o.onStrokeStyleUpdate, 38861 disabled: !o.hasStroke || o.noSelection 38862 }, null, 8, ["compact", "strokeStyle", "onUpdate:strokeStyle", "disabled"])], 4)])], 2) 38863} 38864const g9 = ie(a9, [["render", p9], ["__scopeId", "data-v-afd78878"]]) 38865 , m9 = { 38866 name: "ActionButton", 38867 components: { 38868 HyButton: nt, 38869 HyTooltip: pt, 38870 SvgIcon: gt 38871 }, 38872 props: { 38873 action: { 38874 type: Ce, 38875 default: null 38876 }, 38877 options: Object, 38878 iconSvg: String 38879 }, 38880 computed: { 38881 label() { 38882 let l = this.action.name 38883 , e = this.$t("actions." + l); 38884 return e == null && (e = l), 38885 e 38886 }, 38887 disabled() { 38888 return !this.action || this.action.disabled 38889 } 38890 }, 38891 emits: ["clicked"], 38892 methods: { 38893 onClick() { 38894 this.action.performAction(this.options), 38895 this.$emit("clicked") 38896 } 38897 }, 38898 mounted() {} 38899}; 38900function y9(l, e, t, n, s, o) { 38901 const i = E("svg-icon") 38902 , r = E("hy-tooltip") 38903 , a = E("hy-button"); 38904 return N(), 38905 pe(a, { 38906 ref: "button", 38907 onClick: o.onClick, 38908 disabled: o.disabled 38909 }, { 38910 default: O(()=>[t.iconSvg ? (N(), 38911 pe(i, { 38912 key: 0, 38913 svg: t.iconSvg 38914 }, null, 8, ["svg"])) : (N(), 38915 $(Pe, { 38916 key: 1 38917 }, [ve(se(o.label), 1)], 64)), w(r, { 38918 getTarget: ()=>l.$refs.button, 38919 label: o.label 38920 }, null, 8, ["getTarget", "label"])]), 38921 _: 1 38922 }, 8, ["onClick", "disabled"]) 38923} 38924const Ii = ie(m9, [["render", y9]]); 38925class Nv extends Ce { 38926 isVertical; 38927 constructor(e) { 38928 super("mirror" + e[0].toUpperCase() + e.substring(1), !0), 38929 this.isVertical = e === "vertical", 38930 Ie(V().selectedModels, t=>{ 38931 this.disabled = t.length < 1 38932 } 38933 ) 38934 } 38935 performAction() { 38936 let e = V() 38937 , t = z() 38938 , n = e.selectedModels; 38939 if (n.length > 0) { 38940 let s = this.isVertical 38941 , o = e.selectionBounds.clone() 38942 , i = e.selectionTransform 38943 , r = o.clone().transform(i) 38944 , a = s ? 1 : -1 38945 , d = s ? -1 : 1 38946 , u = this.isVertical ? 0 : r.x + r.width / 2 38947 , h = this.isVertical ? r.y + r.height / 2 : 0 38948 , c = []; 38949 for (let p of n) 38950 c.push(p.getSelfTransform().preScale(a, d, u, h)); 38951 let f = i.clone().preScale(a, d, u, h); 38952 t.setSelModelsTransforms(c, f, !0) 38953 } 38954 } 38955} 38956const v9 = new Nv("horizontal") 38957 , b9 = new Nv("vertical") 38958 , M9 = { 38959 name: "TransformEditor", 38960 components: { 38961 SvgIcon: gt, 38962 ActionButton: Ii, 38963 HyRadio: en, 38964 HyTooltip: pt, 38965 DimInput: ms, 38966 HyButton: nt, 38967 HyInputNumber: Lt 38968 }, 38969 data() { 38970 return { 38971 x: 0, 38972 y: 0, 38973 width: 0, 38974 height: 0, 38975 rotate: 0, 38976 skewX: 0, 38977 xBounds: 0, 38978 yBounds: 0, 38979 widthBounds: 0, 38980 heightBounds: 0, 38981 mirrorHorAction: v9, 38982 mirrorVerAction: b9, 38983 svgs: me({ 38984 mirrorHor: tC, 38985 mirrorVert: lC, 38986 rotateLeft90: nC, 38987 rotateRight90: sC 38988 }) 38989 } 38990 }, 38991 computed: { 38992 disabled() { 38993 return this.$store.selectedModels.length === 0 38994 }, 38995 selectionBounds() { 38996 return this.$store.selectionBounds 38997 }, 38998 selectionTransform() { 38999 return this.$store.selectionTransform 39000 }, 39001 transformedSelectionBounds() { 39002 return this.$store.transformedSelectionBounds 39003 }, 39004 resizeMode: { 39005 get() { 39006 return this.$store.resizeMode 39007 }, 39008 set(l) { 39009 this.$store.resizeMode = l 39010 } 39011 } 39012 }, 39013 methods: { 39014 updateData() { 39015 if (this.resizeMode === "transform") { 39016 let l = this.$store.selectionBounds ?? new Ve 39017 , e = this.$store.selectionTransform 39018 , t = e.decomposeAlt(!0); 39019 this.skewX = t.skew[0]; 39020 let {a: n, b: s, c: o, d: i, tx: r, ty: a} = e 39021 , d = e.getDeterminant() 39022 , u = Math.sqrt(n * n + s * s) 39023 , h = u === 0 ? 0 : d / u 39024 , c = Math.atan2(s, n) * (180 / Math.PI) 39025 , f = n * l.x + o * l.y + r 39026 , p = s * l.x + i * l.y + a; 39027 this.rotate = c, 39028 this.x = f, 39029 this.y = p, 39030 this.width = Math.abs(l.width * u), 39031 this.height = Math.abs(l.height * h) 39032 } else { 39033 let l = this.$store.transformedSelectionBounds; 39034 this.xBounds = l.x, 39035 this.yBounds = l.y, 39036 this.widthBounds = l.width, 39037 this.heightBounds = l.height; 39038 let e = this.$store.selectionTransform 39039 , {a: t, b: n} = e; 39040 this.rotate = Math.atan2(n, t) * (180 / Math.PI) 39041 } 39042 }, 39043 onTransformInput() { 39044 let l = this.$store.selectionBounds ?? new Ve 39045 , e = this.$store.selectionTransform 39046 , t = e.a * e.d - e.b * e.c 39047 , n = Math.sqrt(e.a * e.a + e.b * e.b) 39048 , o = (n === 0 ? 0 : t / n) < 0 39049 , i = this.width / l.width 39050 , r = this.height / l.height * (o ? -1 : 1) 39051 , a = new oe; 39052 a.preTranslate(-l.x, -l.y), 39053 a.preScale(i, r), 39054 a.preSkewX(this.skewX * Math.PI / 180), 39055 a.preRotate(this.rotate * Math.PI / 180), 39056 a.preTranslate(this.x, this.y), 39057 this.setSelectionTransform(a) 39058 }, 39059 onRotateInput(l) { 39060 let e = this.$store.selectionBounds 39061 , t = this.$store.selectionTransform.clone() 39062 , {a: n, b: s} = t 39063 , o = Math.atan2(s, n); 39064 const i = t.transformXY({ 39065 x: e.x + e.width / 2, 39066 y: e.y + e.height / 2 39067 }); 39068 t.preRotate(l * Math.PI / 180 - o, i.x, i.y), 39069 this.setSelectionTransform(t) 39070 }, 39071 onSkewInput(l) { 39072 let e = this.$store.selectionBounds 39073 , t = this.$store.selectionTransform.clone(); 39074 const n = t.transformXY({ 39075 x: e.x + e.width / 2, 39076 y: e.y + e.height / 2 39077 }); 39078 let s = t.decomposeAlt(!1) 39079 , o = s.rotate 39080 , i = s.skew[0]; 39081 l *= Math.PI / 180, 39082 t.preRotate(-o, n.x, n.y), 39083 t.preSkewX(-i, n.y), 39084 t.preSkewX(l, n.y), 39085 t.preRotate(o, n.x, n.y), 39086 this.setSelectionTransform(t) 39087 }, 39088 onBoundsInput() { 39089 let l = this.$store.transformedSelectionBounds 39090 , e = this.xBounds 39091 , t = this.yBounds 39092 , n = Math.max(1e-7, this.widthBounds) 39093 , s = Math.max(1e-7, this.heightBounds) 39094 , o = n / l.width 39095 , i = s / l.height 39096 , a = this.$store.selectionTransform.clone(); 39097 a.preTranslate(-l.x, -l.y), 39098 a.preScale(o, i), 39099 a.preTranslate(e, t), 39100 this.setSelectionTransform(a) 39101 }, 39102 setSelectionTransform(l) { 39103 let e = this.$store.selectionTransform 39104 , t = e.invert(!0).preMultiplyWith(l); 39105 if (!t.isIdentity) { 39106 let n = ae(); 39107 n.startCompoundEdit(); 39108 let o = V().selectedModels 39109 , i = []; 39110 for (let a of o) 39111 i.push(a.getSelfTransform().preMultiplyWith(t)); 39112 z().setSelModelsTransforms(i, l, !0), 39113 n.endCompoundEdit(), 39114 e.setFromTransform(l) 39115 } 39116 }, 39117 async applyTransform() { 39118 let e = this.$store.selectionTransform.decompose() 39119 , t = e.rotate 39120 , n = e.skew[0]; 39121 if (t === 0 && n === 0) 39122 return; 39123 z().applySelectionTransform(); 39124 let o = this.$store.tool.name; 39125 o !== "selection" && o !== "nodes" && o !== "shape" && this.$store.setTool("selection"), 39126 this.$store.selectionTransform.set(1, 0, 0, 1, 0, 0), 39127 this.$store.tool.onSelectionGeometryChanged() 39128 }, 39129 formatNumber(l) { 39130 return l.toFixed(2) 39131 } 39132 }, 39133 watch: { 39134 resizeMode() { 39135 this.updateData() 39136 }, 39137 selectionTransform: { 39138 handler() { 39139 this.updateData() 39140 }, 39141 deep: !0 39142 }, 39143 selectionBounds: { 39144 handler() { 39145 this.updateData() 39146 }, 39147 deep: !0 39148 }, 39149 transformedSelectionBounds: { 39150 handler() { 39151 this.resizeMode === "bounds" && this.updateData() 39152 }, 39153 deep: !0 39154 } 39155 }, 39156 beforeMount() { 39157 this.updateData() 39158 } 39159} 39160 , S9 = { 39161 key: 0, 39162 style: { 39163 display: "grid", 39164 "grid-template-columns": "1fr 1fr", 39165 "margin-bottom": "16px" 39166 } 39167} 39168 , w9 = { 39169 class: "row" 39170} 39171 , P9 = { 39172 class: "field" 39173} 39174 , x9 = { 39175 class: "field" 39176} 39177 , C9 = { 39178 ref: "width" 39179} 39180 , _9 = { 39181 class: "row" 39182} 39183 , T9 = { 39184 class: "field" 39185} 39186 , k9 = { 39187 class: "field" 39188} 39189 , E9 = { 39190 ref: "height" 39191} 39192 , D9 = { 39193 style: { 39194 display: "flex", 39195 "align-items": "center" 39196 } 39197} 39198 , O9 = { 39199 class: "row" 39200} 39201 , A9 = { 39202 class: "field" 39203} 39204 , I9 = { 39205 ref: "rotate" 39206} 39207 , L9 = { 39208 class: "field" 39209} 39210 , V9 = { 39211 ref: "skewX" 39212} 39213 , N9 = { 39214 class: "row" 39215} 39216 , R9 = { 39217 class: "field" 39218} 39219 , F9 = { 39220 class: "field" 39221} 39222 , B9 = { 39223 ref: "width" 39224} 39225 , z9 = { 39226 class: "row" 39227} 39228 , U9 = { 39229 class: "field" 39230} 39231 , G9 = { 39232 class: "field" 39233} 39234 , H9 = { 39235 ref: "height" 39236} 39237 , $9 = { 39238 class: "transform-buttons" 39239}; 39240function X9(l, e, t, n, s, o) { 39241 const i = E("hy-radio") 39242 , r = E("hy-input-number") 39243 , a = E("hy-tooltip") 39244 , d = E("dim-input") 39245 , u = E("svg-icon") 39246 , h = E("hy-button") 39247 , c = E("hy-group") 39248 , f = E("action-button"); 39249 return N(), 39250 $("div", { 39251 class: Ne({ 39252 disabled: o.disabled 39253 }) 39254 }, [l.$isDevelopment ? (N(), 39255 $("div", S9, [w(i, { 39256 type: "button", 39257 name: "resizeMode", 39258 modelValue: o.resizeMode, 39259 "onUpdate:modelValue": e[0] || (e[0] = p=>o.resizeMode = p), 39260 value: "bounds" 39261 }, {
39262 default: O(()=>[...e[14] || (e[14] = [ve("Bounds", -1)])]), 39263 _: 1 39264 }, 8, ["modelValue"]), w(i, { 39265 type: "button", 39266 name: "resizeMode", 39267 modelValue: o.resizeMode, 39268 "onUpdate:modelValue": e[1] || (e[1] = p=>o.resizeMode = p), 39269 value: "transform" 39270 }, { 39271 default: O(()=>[...e[15] || (e[15] = [ve("Transform", -1)])]), 39272 _: 1 39273 }, 8, ["modelValue"])])) : be("", !0), o.resizeMode === "transform" ? (N(), 39274 $(Pe, { 39275 key: 1 39276 }, [_("div", w9, [_("div", P9, [e[16] || (e[16] = _("span", null, "X", -1)), w(r, { 39277 modelValue: s.x, 39278 "onUpdate:modelValue": e[2] || (e[2] = p=>s.x = p), 39279 disabled: o.disabled, 39280 formatter: o.formatNumber, 39281 onChange: o.onTransformInput 39282 }, null, 8, ["modelValue", "disabled", "formatter", "onChange"])]), _("div", x9, [_("span", C9, "W", 512), w(a, { 39283 "get-target": ()=>l.$refs.width, 39284 label: l.$t("transformEditor.width") 39285 }, null, 8, ["get-target", "label"]), w(r, { 39286 modelValue: s.width, 39287 "onUpdate:modelValue": e[3] || (e[3] = p=>s.width = p), 39288 min: 0, 39289 disabled: o.disabled, 39290 formatter: o.formatNumber, 39291 onChange: o.onTransformInput 39292 }, null, 8, ["modelValue", "disabled", "formatter", "onChange"])])]), _("div", _9, [_("div", T9, [e[17] || (e[17] = _("span", null, "Y", -1)), w(r, { 39293 modelValue: s.y, 39294 "onUpdate:modelValue": e[4] || (e[4] = p=>s.y = p), 39295 disabled: o.disabled, 39296 formatter: o.formatNumber, 39297 onChange: o.onTransformInput 39298 }, null, 8, ["modelValue", "disabled", "formatter", "onChange"])]), _("div", k9, [_("span", E9, "H", 512), w(a, { 39299 "get-target": ()=>l.$refs.height, 39300 label: l.$t("transformEditor.height") 39301 }, null, 8, ["get-target", "label"]), w(r, { 39302 modelValue: s.height, 39303 "onUpdate:modelValue": e[5] || (e[5] = p=>s.height = p), 39304 min: 0, 39305 disabled: o.disabled, 39306 formatter: o.formatNumber, 39307 onChange: o.onTransformInput 39308 }, null, 8, ["modelValue", "disabled", "formatter", "onChange"])])]), _("div", D9, [_("div", null, [_("div", O9, [_("div", A9, [_("span", I9, [e[18] || (e[18] = _("svg", { 39309 width: "22", 39310 height: "22",
39311 viewBox: "0 0 22 22", 39312 fill: "currentColor" 39313 }, [_("path", { 39314 d: "M2 11h2c0-1.6 0.6-3.5 2.1-4.9 1-1.1 2.8-2.1 4.9-2.1v2c-1.2 0-2.4 0.3-3.5 1.5-0.8 0.7-1.5 1.8-1.5 3.5h2l-3 5-3-5zM11 16c1.2 0 2.4-0.3 3.5-1.5 0.8-0.7 1.5-1.8 1.5-3.5h-2l3-5 3 5h-2c0 1.6-0.6 3.5-2.1 5-1 1-2.8 2-4.9 2v-2z" 39315 })], -1)), w(a, { 39316 "get-target": ()=>l.$refs.rotate, 39317 label: l.$t("transformEditor.rotate") 39318 }, null, 8, ["get-target", "label"])], 512), w(d, { 39319 modelValue: s.rotate, 39320 "onUpdate:modelValue": e[6] || (e[6] = p=>s.rotate = p), 39321 min: -180, 39322 max: 180, 39323 disabled: o.disabled, 39324 onChange: o.onRotateInput, 39325 unit: "°", 39326 decimals: 2 39327 }, null, 8, ["modelValue", "disabled", "onChange"])]), _("div", L9, [_("span", V9, [e[19] || (e[19] = _("svg", { 39328 width: "22", 39329 height: "22", 39330 viewBox: "0 0 22 22", 39331 fill: "currentColor" 39332 }, [_("path", { 39333 d: "M0.1 16.2c-0.2-0.3-0.1-0.8 0.1-1.1l8-9.7c0.2-0.3 0.5-0.4 0.8-0.4h12c0.4 0 0.7 0.2 0.9 0.6 0.2 0.3 0.1 0.7-0.1 1l-8 9.8c-0.2 0.2-0.5 0.4-0.8 0.4h-12c-0.4 0-0.7-0.2-0.9-0.6zM9.5 7l-6.4 7.8h9.4l6.4-7.8h-9.4z" 39334 })], -1)), w(a, { 39335 "get-target": ()=>l.$refs.skewX, 39336 label: l.$t("transformEditor.skewX") 39337 }, null, 8, ["get-target", "label"])], 512), w(d, { 39338 modelValue: s.skewX, 39339 "onUpdate:modelValue": e[7] || (e[7] = p=>s.skewX = p), 39340 min: -89, 39341 max: 89, 39342 disabled: o.disabled, 39343 onChange: o.onSkewInput, 39344 unit: "°", 39345 decimals: 2 39346 }, null, 8, ["modelValue", "disabled", "onChange"])])])])])], 64)) : (N(), 39347 $(Pe, { 39348 key: 2 39349 }, [_("div", N9, [_("div", R9, [e[20] || (e[20] = _("span", null, "X", -1)), w(r, { 39350 modelValue: s.xBounds, 39351 "onUpdate:modelValue": e[8] || (e[8] = p=>s.xBounds = p), 39352 disabled: o.disabled, 39353 formatter: o.formatNumber, 39354 onChange: o.onBoundsInput 39355 }, null, 8, ["modelValue", "disabled", "formatter", "onChange"])]), _("div", F9, [_("span", B9, "W", 512), w(a, { 39356 "get-target": ()=>l.$refs.widthBounds, 39357 label: l.$t("transformEditor.width") 39358 }, null, 8, ["get-target", "label"]), w(r, { 39359 modelValue: s.widthBounds, 39360 "onUpdate:modelValue": e[9] || (e[9] = p=>s.widthBounds = p), 39361 disabled: o.disabled, 39362 formatter: o.formatNumber, 39363 onChange: o.onBoundsInput 39364 }, null, 8, ["modelValue", "disabled", "formatter", "onChange"])])]), _("div", z9, [_("div", U9, [e[21] || (e[21] = _("span", null, "Y", -1)), w(r, { 39365 modelValue: s.yBounds, 39366 "onUpdate:modelValue": e[10] || (e[10] = p=>s.yBounds = p), 39367 disabled: o.disabled, 39368 formatter: o.formatNumber, 39369 onChange: o.onBoundsInput 39370 }, null, 8, ["modelValue", "disabled", "formatter", "onChange"])]), _("div", G9, [_("span", H9, "H", 512), w(a, { 39371 "get-target": ()=>l.$refs.heightBounds, 39372 label: l.$t("transformEditor.height") 39373 }, null, 8, ["get-target", "label"]), w(r, { 39374 modelValue: s.heightBounds, 39375 "onUpdate:modelValue": e[11] || (e[11] = p=>s.heightBounds = p), 39376 disabled: o.disabled, 39377 formatter: o.formatNumber, 39378 onChange: o.onBoundsInput 39379 }, null, 8, ["modelValue", "disabled", "formatter", "onChange"])])])], 64)), _("div", $9, [w(c, null, { 39380 default: O(()=>[w(h, { 39381 ref: "rotateLeft90", 39382 class: "transform-button", 39383 disabled: o.disabled, 39384 onClick: e[12] || (e[12] = p=>o.onRotateInput(s.rotate - 90)) 39385 }, { 39386 default: O(()=>[w(u, { 39387 svg: s.svgs.rotateLeft90 39388 }, null, 8, ["svg"])]), 39389 _: 1 39390 }, 8, ["disabled"]), w(a, { 39391 "get-target": ()=>l.$refs.rotateLeft90, 39392 label: l.$t("transformEditor.rotateLeft90") 39393 }, null, 8, ["get-target", "label"]), w(h, { 39394 ref: "rotateRight90", 39395 class: "transform-button", 39396 disabled: o.disabled, 39397 onClick: e[13] || (e[13] = p=>o.onRotateInput(s.rotate + 90)) 39398 }, { 39399 default: O(()=>[w(u, { 39400 svg: s.svgs.rotateRight90 39401 }, null, 8, ["svg"])]), 39402 _: 1 39403 }, 8, ["disabled"]), w(a, { 39404 "get-target": ()=>l.$refs.rotateRight90, 39405 label: l.$t("transformEditor.rotateRight90") 39406 }, null, 8, ["get-target", "label"])]), 39407 _: 1 39408 }), w(c, null, { 39409 default: O(()=>[w(f, { 39410 class: "transform-button", 39411 action: s.mirrorHorAction, 39412 "icon-svg": s.svgs.mirrorHor 39413 }, null, 8, ["action", "icon-svg"]), w(f, { 39414 class: "transform-button", 39415 action: s.mirrorVerAction, 39416 "icon-svg": s.svgs.mirrorVert 39417 }, null, 8, ["action", "icon-svg"])]), 39418 _: 1 39419 })])], 2) 39420} 39421const Y9 = ie(M9, [["render", X9], ["__scopeId", "data-v-4e6cb2e5"]]) 39422 , K9 = { 39423 name: "OpacityIcon", 39424 props: { 39425 opacity: { 39426 type: Number, 39427 default: 0 39428 } 39429 } 39430} 39431 , W9 = { 39432 width: "22", 39433 height: "22",
39434 viewBox: "0 0 22 22", 39435 fill: "currentColor" 39436} 39437 , q9 = ["width"]; 39438function j9(l, e, t, n, s, o) { 39439 return N(), 39440 $("svg", W9, [e[0] || (e[0] = _("ellipse", { 39441 "stroke-width": "2", 39442 cx: "11", 39443 cy: "8", 39444 rx: "7", 39445 ry: "7", 39446 style: { 39447 fill: "none", 39448 stroke: "currentColor" 39449 } 39450 }, null, -1)), e[1] || (e[1] = _("path", { 39451 d: "M11 1c-3.9 0-7 3.1-7 7 0 3.9 3.1 7 7 7v-14z", 39452 "fill-opacity": "0.5" 39453 }, null, -1)), _("rect", { 39454 x: "1", 39455 y: "19", 39456 width: 20 * t.opacity, 39457 height: "3" 39458 }, null, 8, q9), e[2] || (e[2] = _("rect", { 39459 x: "1", 39460 y: "19", 39461 width: "20", 39462 height: "3", 39463 "fill-opacity": "0.2" 39464 }, null, -1))]) 39465} 39466const J9 = ie(K9, [["render", j9]]) 39467 , Z9 = { 39468 name: "SelectionDetailsSidebar", 39469 components: { 39470 HyDropdown: xl, 39471 HySlider: ta, 39472 HySelect: Dl, 39473 HyTooltip: pt, 39474 OpacityIcon: J9, 39475 DimInput: ms, 39476 TransformEditor: Y9, 39477 PaintPreview: g9 39478 }, 39479 props: { 39480 collapsed: Boolean 39481 }, 39482 data() { 39483 return { 39484 isNarrowWindow: !1, 39485 blendModeItems: me([{ 39486 label: "blendModes.normal", 39487 value: "normal" 39488 }, { 39489 label: "blendModes.multiply", 39490 value: "multiply" 39491 }, { 39492 label: "blendModes.screen", 39493 value: "screen" 39494 }, { 39495 label: "blendModes.overlay", 39496 value: "overlay" 39497 }, { 39498 label: "blendModes.darken", 39499 value: "darken" 39500 }, { 39501 label: "blendModes.lighten", 39502 value: "lighten" 39503 }, { 39504 label: "blendModes.colorDodge", 39505 value: "color-dodge" 39506 }, { 39507 label: "blendModes.colorBurn", 39508 value: "color-burn" 39509 }]) 39510 } 39511 }, 39512 computed: { 39513 selectedModels() { 39514 return this.$store.selectedModels 39515 }, 39516 opacity: { 39517 get() { 39518 return this.$store.selectionOpacity 39519 }, 39520 set(l) { 39521 z().setSelectionOpacity(l) 39522 } 39523 }, 39524 opacityPercent: { 39525 get() { 39526 return Math.round(this.opacity * 100) 39527 }, 39528 set(l) { 39529 this.opacity = Math.round(l) / 100 39530 } 39531 }, 39532 blur: { 39533 get() { 39534 return this.$store.selectionBlur 39535 }, 39536 set(l) { 39537 z().setSelectionBlur(l) 39538 } 39539 }, 39540 blendMode: { 39541 get() { 39542 return this.$store.selectionBlendMode 39543 }, 39544 set(l) { 39545 z().setSelectionBlendMode(l) 39546 } 39547 } 39548 } 39549} 39550 , Q9 = { 39551 key: 0 39552} 39553 , eI = { 39554 class: "container" 39555} 39556 , tI = { 39557 key: 0, 39558 class: "group" 39559} 39560 , lI = { 39561 class: "group-content" 39562} 39563 , nI = { 39564 class: "group" 39565} 39566 , sI = { 39567 class: "group" 39568} 39569 , oI = { 39570 class: "group-header" 39571} 39572 , iI = { 39573 class: "group-content" 39574} 39575 , rI = { 39576 key: 0, 39577 class: "group" 39578} 39579 , aI = { 39580 class: "group-header" 39581} 39582 , dI = { 39583 class: "group-content" 39584} 39585 , uI = { 39586 key: 1, 39587 class: "group" 39588} 39589 , hI = { 39590 class: "group-header" 39591} 39592 , cI = { 39593 class: "group-content" 39594} 39595 , fI = { 39596 key: 2 39597} 39598 , pI = { 39599 style: { 39600 display: "flex", 39601 "flex-direction": "column", 39602 gap: "8px", 39603 "align-items": "start", 39604 padding: "16px 16px" 39605 } 39606} 39607 , gI = { 39608 class: "label" 39609} 39610 , mI = { 39611 style: { 39612 display: "flex", 39613 "flex-direction": "row", 39614 gap: "16px", 39615 "align-items": "center", 39616 width: "200px", 39617 "padding-left": "8px" 39618 } 39619}; 39620function yI(l, e, t, n, s, o) { 39621 const i = E("transform-editor") 39622 , r = E("paint-preview") 39623 , a = E("hy-slider") 39624 , d = E("dim-input") 39625 , u = E("hy-select") 39626 , h = E("opacity-icon") 39627 , c = E("hy-tooltip") 39628 , f = E("hy-dropdown"); 39629 return N(), 39630 $("div", { 39631 class: Ne(["top-container", { 39632 collapsed: t.collapsed 39633 }]) 39634 }, [l.$isDevelopment ? (N(), 39635 $("div", Q9, se(o.selectedModels.length) + " Selected ", 1)) : be("", !0), _("div", eI, [t.collapsed ? be("", !0) : (N(), 39636 $("div", tI, [e[7] || (e[7] = _("div", { 39637 class: "group-header" 39638 }, "Transform", -1)), _("div", lI, [w(i)])])), _("div", nI, [w(r, { 39639 collapsed: t.collapsed 39640 }, null, 8, ["collapsed"])]), t.collapsed ? (N(), 39641 $("div", fI, [w(f, { 39642 "popover-style": "border-radius: 5px;", 39643 style: { 39644 width: "32px", 39645 padding: "0", 39646 "margin-top": "8px" 39647 }, 39648 disabled: o.selectedModels.length === 0 39649 }, {
39650 button: O(()=>[w(h, { 39651 opacity: o.opacity 39652 }, null, 8, ["opacity"]), w(c, { 39653 getTarget: ()=>l.$refs.openButton, 39654 label: l.$t("opacity") 39655 }, null, 8, ["getTarget", "label"])]), 39656 arrow: O(()=>[...e[8] || (e[8] = [])]), 39657 default: O(()=>[_("div", pI, [_("div", gI, se(l.$t("opacity")), 1), _("div", mI, [w(a, { 39658 modelValue: o.opacityPercent, 39659 "onUpdate:modelValue": e[5] || (e[5] = p=>o.opacityPercent = p), 39660 min: 0, 39661 max: 100, 39662 step: 1, 39663 disabled: o.selectedModels.length === 0 39664 }, null, 8, ["modelValue", "disabled"]), w(d, { 39665 modelValue: o.opacity, 39666 "onUpdate:modelValue": e[6] || (e[6] = p=>o.opacity = p), 39667 unit: "%", 39668 f: 100, 39669 step: .01, 39670 decimals: 2, 39671 min: 0, 39672 max: 1, 39673 disabled: o.selectedModels.length === 0 39674 }, null, 8, ["modelValue", "disabled"])])])]), 39675 _: 1 39676 }, 8, ["disabled"])])) : (N(), 39677 $(Pe, { 39678 key: 1 39679 }, [_("div", sI, [_("div", oI, se(l.$t("opacity")), 1), _("div", iI, [w(a, { 39680 modelValue: o.opacityPercent, 39681 "onUpdate:modelValue": e[0] || (e[0] = p=>o.opacityPercent = p), 39682 min: 0, 39683 max: 100, 39684 step: 1, 39685 disabled: o.selectedModels.length === 0 39686 }, null, 8, ["modelValue", "disabled"]), w(d, { 39687 modelValue: o.opacity, 39688 "onUpdate:modelValue": e[1] || (e[1] = p=>o.opacity = p), 39689 unit: "%", 39690 f: 100, 39691 step: .01, 39692 decimals: 2, 39693 min: 0, 39694 max: 1, 39695 disabled: o.selectedModels.length === 0 39696 }, null, 8, ["modelValue", "disabled"])])]), l.$isDevelopment ? (N(), 39697 $("div", rI, [_("div", aI, se(l.$t("blur")), 1), _("div", dI, [w(a, { 39698 modelValue: o.blur, 39699 "onUpdate:modelValue": e[2] || (e[2] = p=>o.blur = p), 39700 min: 0, 39701 max: 10, 39702 step: .01, 39703 disabled: o.selectedModels.length === 0 39704 }, null, 8, ["modelValue", "disabled"]), w(d, { 39705 modelValue: o.blur, 39706 "onUpdate:modelValue": e[3] || (e[3] = p=>o.blur = p), 39707 unit: "px", 39708 f: 1, 39709 step: 1, 39710 decimals: 0, 39711 min: 0, 39712 max: 100, 39713 disabled: o.selectedModels.length === 0 39714 }, null, 8, ["modelValue", "disabled"])])])) : be("", !0), l.$isDevelopment ? (N(), 39715 $("div", uI, [_("div", hI, se(l.$t("blendMode")), 1), _("div", cI, [w(u, { 39716 modelValue: o.blendMode, 39717 "onUpdate:modelValue": e[4] || (e[4] = p=>o.blendMode = p), 39718 items: s.blendModeItems, 39719 valueField: "value", 39720 labelField: "label", 39721 localized: "" 39722 }, null, 8, ["modelValue", "items"])])])) : be("", !0)], 64))])], 2) 39723} 39724const vI = ie(Z9, [["render", yI], ["__scopeId", "data-v-ad53b3db"]]); 39725let oh; 39726class po { 39727 constructor(e, t, n, s, o) { 39728 let i = de("g") 39729 , r = de(t, n, (s || "") + " outline"); 39730 return o == null && (o = de(t, n, s)), 39731 i.appendChild(r), 39732 i.appendChild(o), 39733 oh == null && (oh = i.setAttribute), 39734 i.setAttribute = (a,d)=>{ 39735 switch (a) { 39736 case "transform": 39737 case "visibility": 39738 oh.call(i, a, d); 39739 break; 39740 case "stroke": 39741 case "fill": 39742 o.setAttribute(a, d); 39743 break; 39744 default: 39745 r.setAttribute(a, d), 39746 o.setAttribute(a, d) 39747 } 39748 } 39749 , 39750 i.setVisible = a=>{ 39751 i.setAttribute("visibility", a ? "visible" : "hidden") 39752 } 39753 , 39754 i.addClass = a=>{ 39755 r.classList.add(a), 39756 o.classList.add(a) 39757 } 39758 , 39759 i.removeClass = a=>{ 39760 r.classList.remove(a), 39761 o.classList.remove(a) 39762 } 39763 , 39764 e?.appendChild(i), 39765 i 39766 } 39767} 39768class Rv extends ut { 39769 _x; 39770 _y; 39771 _inX; 39772 _inY; 39773 _outX; 39774 _outY; 39775 _hasHandles = !1; 39776 constructor(e, t, n, s, o, i) { 39777 super(), 39778 this._x = e, 39779 this._y = t, 39780 this._inX = n ?? e, 39781 this._inY = s ?? t, 39782 this._outX = o ?? e, 39783 this._outY = i ?? t 39784 } 39785 get x() { 39786 return this._x 39787 } 39788 set x(e) { 39789 this._x = e 39790 } 39791 get y() { 39792 return this._y 39793 } 39794 set y(e) { 39795 this._y = e 39796 } 39797 get xTransformed() { 39798 return this._x 39799 } 39800 get yTransformed() { 39801 return this._y 39802 } 39803 get outX() { 39804 return this._outX 39805 } 39806 set outX(e) { 39807 this._outX = e 39808 } 39809 get outY() { 39810 return this._outY 39811 } 39812 set outY(e) { 39813 this._outY = e 39814 } 39815 get outXTransformed() { 39816 return this._outX 39817 } 39818 set outXTransformed(e) { 39819 this._outX = e 39820 } 39821 get outYTransformed() { 39822 return this._outY 39823 } 39824 set outYTransformed(e) { 39825 this._outY = e 39826 } 39827 get inX() { 39828 return this._inX 39829 } 39830 set inX(e) { 39831 this._inX = e 39832 } 39833 get inY() { 39834 return this._inY 39835 } 39836 set inY(e) { 39837 this._inY = e 39838 } 39839 get inXTransformed() { 39840 return this._inX 39841 } 39842 set inXTransformed(e) { 39843 this._inX = e 39844 } 39845 get inYTransformed() { 39846 return this._inY 39847 } 39848 set inYTransformed(e) { 39849 this._inY = e 39850 } 39851 getPrevious() { 39852 return null 39853 } 39854 getNext() { 39855 return null 39856 } 39857 getV0() { 39858 return null 39859 } 39860 getV1() { 39861 return null 39862 } 39863} 39864const bn = "Center" 39865 , Da = "Left"
39866 , bI = "Right" 39867 , ih = "Top" 39868 , MI = "Bottom"; 39869class SI { 39870 constructor() { 39871 this.modelOverlays = {}, 39872 this.modelOverlayMap = new WeakMap, 39873 this.startEndNodesSet = new Set, 39874 this.selGroup = document.getElementById("__selGroup"), 39875 this.textGroup = this.createOverlayGroup(this.selGroup), 39876 this.pathsGroup = this.createOverlayGroup(this.selGroup), 39877 this.selectorGroup = this.createOverlayGroup(this.selGroup), 39878 this.handleLinesGroup = this.createOverlayGroup(this.selGroup, null, "handle-lines"), 39879 this.fixedHandleLinesGroup = this.createOverlayGroup(this.selGroup, null, "handle-lines"), 39880 this.nodePointsGroup = this.createOverlayGroup(this.selGroup, null, "node-points"), 39881 this.controlPointsGroup = this.createOverlayGroup(this.selGroup, null, "control-points"), 39882 this.fixedControlPointsGroup = this.createOverlayGroup(this.selGroup, null, "control-points"), 39883 this.selNodePointsGroup = this.createOverlayGroup(this.selGroup, null, "sel-node-points"), 39884 this.selBoundsGroup = this.createOverlayGroup(this.selGroup), 39885 this.selFramesGroup = this.createOverlayGroup(this.selGroup), 39886 this.gradientsGroup = this.createOverlayGroup(this.selGroup); 39887 let e = de("path", { 39888 stroke: "grey", 39889 opacity: .3, 39890 "vector-effect": "non-scaling-stroke", 39891 "shape-rendering": "crispEdges" 39892 }); 39893 this.gridElement = e, 39894 this.selGroup.appendChild(e), 39895 this.updateGrid() 39896 } 39897 getModelOverlayMap(e="none", t="default") { 39898 let n = this.modelOverlays[e]; 39899 n == null && (n = {}, 39900 this.modelOverlays[e] = n); 39901 let s = n[t]; 39902 s == null && (s = {}, 39903 n[t] = s); 39904 let o = s[t]; 39905 return o == null && (o = new Map, 39906 s[t] = o), 39907 o 39908 } 39909 createOverlayGroup(e, t, n) { 39910 let s = de("g", t, n); 39911 return e.appendChild(s), 39912 s 39913 } 39914 updateGrid() { 39915 let e = V() 39916 , t = e.activeDocument 39917 , n = e.appSettings 39918 , s = n.editor.grid.show === !0; 39919 if (t && s) { 39920 let o = n.editor.grid.gridX || 100 39921 , i = n.editor.grid.gridY || 150 39922 , r = t.getWidth() 39923 , a = t.getHeight() 39924 , d = ""; 39925 for (let u = o; u < r; u += o) 39926 d += "M" + u + ",0V" + a; 39927 for (let u = i; u < a; u += i) 39928 d += "M0," + u + "H" + r; 39929 this.gridElement.setAttribute("d", d), 39930 this.gridElement.removeAttribute("visibility") 39931 } else 39932 this.gridElement.setAttribute("visibility", "hidden") 39933 } 39934 showAlignLines(e, t, n, s) { 39935 let o = this.alignPathsGroup; 39936 if (n || s) { 39937 o == null && (o = de("g", null, null, [de("path", { 39938 stroke: "teal", 39939 strokeWidth: "1", 39940 "vector-effect": "non-scaling-stroke" 39941 }), de("path", { 39942 stroke: "magenta", 39943 strokeWidth: "1", 39944 "vector-effect": "non-scaling-stroke" 39945 })]), 39946 this.alignPathsGroup = o); 39947 let i = ["", ""]; 39948 n && (i[n === "element" ? 0 : 1] += "M" + e + "-524288v1048576"), 39949 s && (i[s === "element" ? 0 : 1] += "M-524288," + t + "h1048576"), 39950 o.children[0].setAttribute("d", i[0]), 39951 o.children[1].setAttribute("d", i[1]), 39952 this.selGroup.appendChild(o) 39953 } else 39954 o?.remove() 39955 } 39956 updateSelBounds(e, t) { 39957 let n = this.selBoundsGroup; 39958 for (; n.children.length > e.length; ) 39959 n.removeChild(n.lastChild); 39960 for (; n.children.length < e.length; ) { 39961 let s = de("rect", { 39962 stroke: "green", 39963 fill: "none" 39964 }, "bounds-rect"); 39965 n.appendChild(s) 39966 } 39967 for (let s = 0; s < e.length; s++) { 39968 let o = e[s] 39969 , i = t[s] 39970 , r = o.x 39971 , a = o.y 39972 , d = o.width 39973 , u = o.height 39974 , h = n.children[s]; 39975 h.setAttribute("x", r), 39976 h.setAttribute("y", a), 39977 h.setAttribute("width", d), 39978 h.setAttribute("height", u), 39979 i != null && !i.isIdentity ? h.setAttribute("transform", i.toSvgValue()) : h.removeAttribute("transform") 39980 } 39981 } 39982 clearSelBounds() { 39983 this.selBoundsGroup.replaceChildren() 39984 } 39985 showResizeFrame(e, t) { 39986 if (this.resizeFrameOverlay == null) { 39987 let n = this.selFramesGroup 39988 , o = { 39989 rect: new po(n,"rect",null,"selection-rect"), 39990 handles: [] 39991 }; 39992 for (let i = 0; i < 8; i++) { 39993 let r = new po(n,"rect",{ 39994 x: "-0.5em", 39995 y: "-0.5em", 39996 width: "1em", 39997 height: "1em", 39998 "shape-rendering": "crispEdges" 39999 },"selection-handle"); 40000 o.handles.push(r) 40001 } 40002 this.resizeFrameOverlay = o 40003 } 40004 this.updateResizeFrame(e, t) 40005 } 40006 hideResizeFrame() { 40007 if (this.resizeFrameOverlay != null) { 40008 this.resizeFrameOverlay.rect.remove(); 40009 let t = this.resizeFrameOverlay.handles; 40010 for (let n of t) 40011 n.remove(); 40012 this.resizeFrameOverlay = null 40013 } 40014 } 40015 updateResizeFrame(e, t) { 40016 if (e == null) { 40017 this.hideResizeFrame(); 40018 return 40019 } 40020 let n = e.x 40021 , s = e.y 40022 , o = e.width 40023 , i = e.height 40024 , r = this.resizeFrameOverlay.rect; 40025 r.setAttribute("x", n), 40026 r.setAttribute("y", s), 40027 r.setAttribute("width", o), 40028 r.setAttribute("height", i), 40029 t != null && !t.isIdentity ? r.setAttribute("transform", t.toSvgValue()) : r.removeAttribute("transform"); 40030 let a = new B(0,0) 40031 , d = 0; 40032 for (let u of [ih, bn, MI]) 40033 for (let h of [Da, bn, bI]) 40034 (u !== bn || h !== bn) && (a.x = n + (h === Da ? 0 : h === bn ? o / 2 : o), 40035 a.y = s + (u === ih ? 0 : u === bn ? i / 2 : i), 40036 t?.transformXY(a), 40037 this.resizeFrameOverlay.handles[d].setAttribute("transform", "translate(" + a.x + "," + a.y + ")"), 40038 d++) 40039 } 40040 setHoverHandleOverlay(e, t) { 40041 if (e != null) { 40042 let n; 40043 if (this.resizeFrameOverlay != null) { 40044 let s = e.posHor 40045 , o = e.posVer; 40046 if (!(s === bn && o === bn)) { 40047 let i; 40048 o === bn ? i = s === Da ? 3 : 4 : i = (o === ih ? 0 : 5) + (s === Da ? 0 : s === bn ? 1 : 2), 40049 n = this.resizeFrameOverlay.handles[i].children[1],
40050 t ? n.classList.add("hover") : n.classList.remove("hover") 40051 } 40052 } 40053 } 40054 } 40055 showModelOverlay(e, t, n) { 40056 let s = this.getModelOverlayMap(t, n); 40057 if (s.get(e) == null) { 40058 let o; 40059 if (e instanceof Nt) { 40060 let i = e.getOverlayPathInfo(); 40061 if (i != null) 40062 if (n === "transform" || n === "highlight") { 40063 let r = e.getPathData(e.getAggregateTransform(), 0, 6); 40064 o = de("path", { 40065 d: r 40066 }), 40067 o.classList.add("selection-path") 40068 } else { 40069 o = de("path", { 40070 d: i.pathData || "" 40071 }); 40072 let r = i.transform; 40073 r != null && !r.isIdentity && o.setAttribute("transform", r.toSvgValue()) 40074 } 40075 } else 40076 e instanceof Rn || e instanceof Fo ? o = null : console.warn("Path generation for element type not implemented", typeof e, e); 40077 o != null && (o.classList.add("selection-path"), 40078 n === "highlight" && o.classList.add("selection-path-highlight"), 40079 this.pathsGroup.appendChild(o), 40080 s.set(e, o)) 40081 } 40082 } 40083 updateModelOverlay(e, t, n) { 40084 let o = this.getModelOverlayMap(t, n).get(e); 40085 if (o != null) 40086 if (n === "transform") { 40087 let i = e.getPathData(e.getAggregateTransform(), 0, 6); 40088 o.setAttribute("d", i) 40089 } else { 40090 let i = e.getOverlayPathInfo(); 40091 o.setAttribute("d", i.pathData || ""); 40092 let r = i.transform; 40093 r != null && !r.isIdentity ? o.setAttribute("transform", r.toSvgValue()) : o.removeAttribute("transform"), 40094 this.updateStartEndNodes() 40095 } 40096 } 40097 removeModelOverlay(e, t, n) { 40098 let s = this.getModelOverlayMap(t, n) 40099 , o = s.get(e); 40100 o != null && (s.delete(e), 40101 o.remove()) 40102 } 40103 removeAllModelOverlays(e) { 40104 let t = this.modelOverlays[e]; 40105 if (t != null) { 40106 t = {}, 40107 this.modelOverlays[e] = t; 40108 for (let n of Object.values(t)) 40109 for (let s of Object.values(n)) { 40110 for (let o of s.entries()) 40111 o[1].remove(); 40112 s.clear() 40113 } 40114 delete t[e] 40115 } 40116 } 40117 showOverlayPath(e, t, n) { 40118 let s = de("g") 40119 , o = de("path", { 40120 d: t, 40121 stroke: "var(--overlay-color)", 40122 fill: "none", 40123 "vector-effect": "non-scaling-stroke" 40124 }); 40125 s.appendChild(o), 40126 this.pathsGroup.appendChild(s); 40127 let i = []; 40128 for (let a of n) { 40129 let d = de("circle", { 40130 cx: a.x, 40131 cy: a.y 40132 }); 40133 s.appendChild(d), 40134 i.push(d) 40135 } 40136 let r = { 40137 group: s, 40138 path: o, 40139 points: i 40140 }; 40141 this.modelOverlayMap.set(e, r) 40142 } 40143 hideOverlayPath(e) { 40144 let t = this.modelOverlayMap.get(e); 40145 t != null && (this.modelOverlayMap.delete(e), 40146 t.group.remove()) 40147 } 40148 updateOverlayPath(e, t, n) { 40149 let s = this.modelOverlayMap.get(e) 40150 , o = s.group; 40151 for (s.path.setAttribute("d", t); n.length < s.points.length; ) 40152 s.points.pop().remove(); 40153 for (; n.length > s.points.length; ) { 40154 let i = de("circle", { 40155 cx: 0, 40156 cy: 0 40157 }, ["path-point"]); 40158 o.appendChild(i), 40159 s.points.push(i) 40160 } 40161 for (let i = 0; i < n.length; i++) { 40162 let r = n[i] 40163 , a = s.points[i]; 40164 a.setAttribute("cx", r.x), 40165 a.setAttribute("cy", r.y) 40166 } 40167 } 40168 setAddModeOverlay(e, t) { 40169 let n = this.modelOverlayMap.get(e); 40170 n && (t ? n.classList.add("add-mode-overlay") : n.classList.remove("add-mode-overlay")) 40171 } 40172 setRemoveModeOverlay(e, t) { 40173 let n = this.modelOverlayMap.get(e); 40174 n && (t ? n.classList.add("remove-mode-overlay") : n.classList.remove("remove-mode-overlay")) 40175 } 40176 showClipBounds(e) { 40177 let t = Bo(e.getPaths(null, -1, !0), 30, null, !0) 40178 , n = lu(t, e.getPaths(null, -1, !0)) 40179 , s = on(n) 40180 , o = de("path", { 40181 fill: "rgb(255 0 0 / 0.1)", 40182 d: s 40183 }); 40184 this.selGroup.appendChild(o) 40185 } 40186 showSelectorElement(e) { 40187 let t = de("polygon", null, ["selector-polygon"]); 40188 this.modelOverlayMap.set(e, t), 40189 this.selectorGroup.appendChild(t) 40190 } 40191 updateSelectorElement(e) { 40192 this.modelOverlayMap.get(e).setAttribute("points", e.getPointsString()) 40193 } 40194 hideSelectorElement(e) { 40195 let t = this.modelOverlayMap.get(e); 40196 t && t.remove() 40197 } 40198 showPathPointsOverlay(e) { 40199 let t = document.createDocumentFragment() 40200 , n = document.createDocumentFragment(); 40201 for (let s of e) 40202 if (!this.modelOverlayMap.has(s)) { 40203 let o; 40204 if (s instanceof ut) { 40205 let i = this.createNodePointElement(s); 40206 t.appendChild(i), 40207 o = { 40208 groupElement: null, 40209 nodePointElement: i, 40210 handleLineElement: null 40211 } 40212 } else { 40213 let i = this.createControlPointElement(); 40214 n.appendChild(i), 40215 o = i 40216 } 40217 this.modelOverlayMap.set(s, o) 40218 } 40219 this.nodePointsGroup.appendChild(t), 40220 this.controlPointsGroup.appendChild(n), 40221 this.updateStartEndNodes() 40222 } 40223 removePathPointOverlay(e) { 40224 let t = this.modelOverlayMap.get(e); 40225 t != null && (e instanceof ut ? (t.nodePointElement.remove(), 40226 t.groupElement != null && t.groupElement.remove(), 40227 t.handleLineElement != null && t.handleLineElement.remove()) : t.remove(), 40228 this.modelOverlayMap.delete(e)) 40229 } 40230 createNodePointElement(e) { 40231 return de("circle", { 40232 cx: e.xTransformed, 40233 cy: e.yTransformed 40234 }) 40235 } 40236 createControlPointElement() { 40237 return de("circle", { 40238 display: "none" 40239 }) 40240 } 40241 createHandleLineElement() { 40242 return de("polyline") 40243 } 40244 updateHandleLineElement(e, t=0, n=0) { 40245 let s = this.modelOverlayMap.get(e); 40246 if (s == null) 40247 return; 40248 let o = s.handleLineElement 40249 , i = z() 40250 , r = e.getPath() 40251 , a = r != null 40252 , d = a && r.isClosed() 40253 , u = !a && e instanceof Rv 40254 , h = d || a && e.getIndex() !== 0 40255 , c = d || a && e.getIndex() !== r.getCurveCount() 40256 , f = h && i.isPathPointSelected(e.controlPointIn) 40257 , p = c && i.isPathPointSelected(e.controlPointOut); 40258 if (f || p || u) { 40259 o == null && (o = this.createHandleLineElement(), 40260 this.handleLinesGroup.appendChild(o), 40261 s.handleLineElement = o); 40262 let g = ""; 40263 (f || u) && (g += e.inXTransformed + t + "," + (e.inYTransformed + n) + ","), 40264 g += e.xTransformed + t + "," + (e.yTransformed + n), 40265 (p || u) && (g += "," + (e.outXTransformed + t) + "," + (e.outYTransformed + n)), 40266 o.setAttribute("points", g), 40267 o.removeAttribute("display") 40268 } else 40269 o?.setAttribute("display", "none") 40270 } 40271 setSelectedPointsTranslate(e=0, t=0, n) { 40272 let s = this.handleLinesGroup.getAttribute("transform") 40273 , i = oe.fromSvgValue(s).translate(e, t).toSvgValue(); 40274 this.handleLinesGroup.setAttribute("transform", i), 40275 this.controlPointsGroup.setAttribute("transform", i), 40276 this.selNodePointsGroup.setAttribute("transform", i) 40277 } 40278 initNodePointsDrag(e) { 40279 let t = new Set 40280 , n = new Set; 40281 for (let s of e) { 40282 let o = this.modelOverlayMap.get(s); 40283 o && t.add(o); 40284 let i = s.nodePoint 40285 , r = this.modelOverlayMap.get(i); 40286 r && n.add(r.handleLineElement) 40287 } 40288 this.fixedControlPointsGroup.append(...t), 40289 this.fixedHandleLinesGroup.append(...n) 40290 } 40291 endNodePointsDrag() { 40292 this.handleLinesGroup.removeAttribute("transform"), 40293 this.controlPointsGroup.removeAttribute("transform"), 40294 this.selNodePointsGroup.removeAttribute("transform"), 40295 this.controlPointsGroup.append(...this.fixedControlPointsGroup.children), 40296 this.handleLinesGroup.append(...this.fixedHandleLinesGroup.children) 40297 } 40298 updatePathPointCoordinates(e, t=0, n=0) { 40299 for (let s of e) { 40300 let o = s instanceof ut 40301 , i = o ? s : s.nodePoint 40302 , r = this.modelOverlayMap.get(i); 40303 if (o) { 40304 let c = r.nodePointElement; 40305 this.setPathPointElementPosition(c, i.xTransformed + t, i.yTransformed + n) 40306 } 40307 this.updateHandleLineElement(i, t, n); 40308 let a = i.controlPointIn 40309 , d = this.modelOverlayMap.get(a); 40310 d != null && this.setPathPointElementPosition(d, a.xTransformed + t, a.yTransformed + n); 40311 let u = i.controlPointOut 40312 , h = this.modelOverlayMap.get(u); 40313 h != null && this.setPathPointElementPosition(h, u.xTransformed + t, u.yTransformed + n) 40314 } 40315 this.updateStartEndNodes() 40316 } 40317 setPathPointElementPosition(e, t, n) { 40318 t != null && e.setAttribute("cx", t), 40319 n != null && e.setAttribute("cy", n) 40320 } 40321 setPathPointSelected(e, t, n) { 40322 if (e != null) { 40323 let s = this.modelOverlayMap.get(e) 40324 , o = e instanceof ut ? s?.nodePointElement : s; 40325 if (o != null) 40326 if (e instanceof Is) 40327 t ? (this.setPathPointElementPosition(o, e.xTransformed, e.yTransformed), 40328 o.removeAttribute("display")) : o.setAttribute("display", "none"); 40329 else { 40330 let i = s.groupElement; 40331 if (t) { 40332 i == null && (i = de("g"), 40333 s.groupElement = i, 40334 o.replaceWith(i)); 40335 let r = this.selNodePointsGroup; 40336 if (n == null) 40337 r.insertBefore(o, r.children[0]); 40338 else { 40339 let a = this.modelOverlayMap.get(n) 40340 , d = n instanceof ut ? a.nodePointElement : a; 40341 r.insertBefore(o, d && d.nextSibling) 40342 } 40343 } else 40344 i.appendChild(o) 40345 } 40346 } 40347 } 40348 showCurvePointOverlay(e) { 40349 this.curvePointElement == null && (this.curvePointElement = de("circle", null, "curve-point"), 40350 this.selGroup.appendChild(this.curvePointElement)), 40351 this.curvePointElement.setAttribute("cx", e.x), 40352 this.curvePointElement.setAttribute("cy", e.y), 40353 this.curvePointElement.removeAttribute("display") 40354 } 40355 hideCurvePointOverlay() { 40356 this.curvePointElement != null && this.curvePointElement.setAttribute("display", "none") 40357 } 40358 updateStartEndNodes() { 40359 let e = (r,a)=>{ 40360 let d = r.classList; 40361 (a == null || !d.contains(a)) && (d.contains("start-end-node") ? (d.remove("start-end-node"), 40362 r.style.removeProperty("transform")) : d.contains("start-node") ? d.remove("start-node") : d.contains("end-node") && d.remove("end-node"), 40363 a != null && d.add(a)) 40364 } 40365 , t = this.startEndNodesSet 40366 , n = new Set 40367 , s = V() 40368 , o = this.modelOverlayMap 40369 , i = Ke(s.selectedModels); 40370 for (let r of i) 40371 if (r.isPath()) 40372 for (let a of r.getSinglePathModels()) { 40373 let d = a.getNodePoints(); 40374 if (d.length > 0) 40375 if (a.isClosed()) { 40376 let u = d.at(0); 40377 if (o.has(u)) { 40378 let h = o.get(u).nodePointElement; 40379 e(h, "start-end-node"); 40380 let c = u.getV0() 40381 , f = u.getV1() 40382 , p = Te(c, 1, 1).add(Te(f, 0, 1)); 40383 p.getLength() < 1e-12 && (p = Ro(c, 1, 1)); 40384 let g = p.getAngle() 40385 , y = r.getAggregateTransform(); 40386 g += y.getRotation(), 40387 h.style.setProperty("transform", "rotate(" + g + "rad)"), 40388 t.delete(h), 40389 n.add(h) 40390 } 40391 } else { 40392 let u = d.at(0); 40393 if (o.has(u)) { 40394 let c = o.get(u).nodePointElement; 40395 e(c, "start-node"), 40396 t.delete(c), 40397 n.add(c) 40398 } 40399 let h = d.at(-1); 40400 if (o.has(h)) { 40401 let c = o.get(h).nodePointElement; 40402 e(c, "end-node"), 40403 t.delete(c), 40404 n.add(c) 40405 } 40406 } 40407 } 40408 t.forEach(r=>e(r, null)), 40409 this.startEndNodesSet = n 40410 } 40411 setPrimaryPointOverlay(e, t) { 40412 let n = this.modelOverlayMap.get(e); 40413 e instanceof ut && (n = n.nodePointElement), 40414 t ? n.classList.add("primary") : n.classList.remove("primary") 40415 } 40416 setHoverPointOverlay(e, t) { 40417 let n = this.modelOverlayMap.get(e); 40418 n && (e instanceof ut && (n = n.nodePointElement),
40419 t ? n.classList.add("hover") : n.classList.remove("hover")) 40420 } 40421 showFreehandPath(e, t, n, s) { 40422 let o = de("g", { 40423 opacity: .5, 40424 "stroke-linejoin": "round", 40425 "stroke-linecap": "round", 40426 fill: "none" 40427 }); 40428 s != null && o.setAttribute("transform", s.toSvgValue()); 40429 let i = de("polyline", { 40430 "stroke-width": +e, 40431 stroke: t || "#00AE04" 40432 }); 40433 o.appendChild(i); 40434 let r = de("polyline", { 40435 style: "stroke-width: calc(" + e + "px - 3 * var(--unitradius))", 40436 stroke: n || "#8DEB8F" 40437 }); 40438 o.appendChild(r), 40439 this.selGroup.appendChild(o), 40440 this.freehandPath = o 40441 } 40442 updateFreehandPath(e) { 40443 this.freehandPath.children[0].setAttribute("points", e), 40444 this.freehandPath.children[1].setAttribute("points", e) 40445 } 40446 hideFreehandPath() { 40447 this.freehandPath && this.freehandPath.remove() 40448 } 40449 showDirVector0(e, t) { 40450 this.dirVector0 == null && (this.dirVector0 = de("line", { 40451 stroke: "green", 40452 fill: "none" 40453 }), 40454 this.selGroup.appendChild(this.dirVector0)), 40455 this.dirVector0.setAttribute("x1", e.x), 40456 this.dirVector0.setAttribute("y1", e.y), 40457 this.dirVector0.setAttribute("x2", e.x + t.x), 40458 this.dirVector0.setAttribute("y2", e.y + t.y) 40459 } 40460 showDirVector1(e, t) { 40461 this.dirVector1 == null && (this.dirVector1 = de("line", { 40462 stroke: "green", 40463 fill: "none" 40464 }), 40465 this.selGroup.appendChild(this.dirVector1)), 40466 this.dirVector1.setAttribute("x1", e.x), 40467 this.dirVector1.setAttribute("y1", e.y), 40468 this.dirVector1.setAttribute("x2", e.x + t.x), 40469 this.dirVector1.setAttribute("y2", e.y + t.y) 40470 } 40471 showGradientElement(e) { 40472 this.gradientModel = e; 40473 let t = de("g"); 40474 t.appendChild(de("g")), 40475 t.appendChild(de("g")); 40476 let n = { 40477 gradientGroup: t 40478 }; 40479 this.modelOverlayMap.set(e, n), 40480 e.getType() === Wt ? this.initLinearGradientGroupElement(n, e) : this.initRadialGradientGroupElement(n, e), 40481 this.gradientsGroup.appendChild(t) 40482 } 40483 hideGradientElement(e) { 40484 let t = this.modelOverlayMap.get(e); 40485 t != null && (this.modelOverlayMap.delete(e), 40486 t.gradientGroup.remove()) 40487 } 40488 initLinearGradientGroupElement(e, t) { 40489 let n = e.gradientGroup; 40490 for (; n.firstChild != null; ) 40491 n.firstChild.remove(); 40492 e.axisLines = [], 40493 e.axisLines.push(new po(n,"line",null,"gradient-line")); 40494 let s = t.getStopCount(); 40495 e.stopCircles = []; 40496 for (let o = 0; o < s; o++) { 40497 let i = de("g", null, "gradient-stop"); 40498 i.appendChild(de("circle")), 40499 i.appendChild(de("circle")), 40500 n.appendChild(i), 40501 e.stopCircles.push(i) 40502 } 40503 } 40504 initRadialGradientGroupElement(e, t) { 40505 let n = e.gradientGroup; 40506 for (; n.firstChild != null; ) 40507 n.firstChild.remove(); 40508 e.colorStopEllipse = new po(n,"ellipse",null,"gradient-guide-line"), 40509 e.axisLines = []; 40510 for (let o = 0; o < 2; o++) 40511 e.axisLines.push(new po(n,"line",null,"gradient-guide-line")); 40512 e.focusLines = []; 40513 for (let o = 0; o < 4; o++) 40514 e.focusLines.push(new po(n,"line",null,"gradient-line")); 40515 e.focusEllipse = new po(n,"ellipse",null,"gradient-line"); 40516 let s = 4 * t.getStopCount(); 40517 e.stopCircles = []; 40518 for (let o = 0; o < s; o++) { 40519 let i = de("g", null, "gradient-stop"); 40520 i.appendChild(de("circle")), 40521 i.appendChild(de("circle")), 40522 n.appendChild(i), 40523 e.stopCircles.push(i) 40524 } 40525 } 40526 updateGradientElement(e, t) { 40527 e.getType() === "linearGradient" ? this.updateLinearGradientElement(e, t) : this.updateRadialGradientElement(e, t) 40528 } 40529 updateLinearGradientElement(e, t) { 40530 let n = this.modelOverlayMap.get(e); 40531 if (n == null) 40532 return; 40533 let s = e.getStopCount(); 40534 n.stopCircles.length !== s && this.initLinearGradientGroupElement(n, e); 40535 let o = Array.from(Array(s).keys()); 40536 o.splice(0, 1), 40537 o.splice(s - 1, 0, 0); 40538 let i = -1; 40539 t != null && (i = o.indexOf(t.index)); 40540 let r = e.p1View 40541 , a = e.p2View 40542 , u = n.axisLines[0]; 40543 u.setAttribute("transform", "translate(" + r.x + "," + r.y + ")"), 40544 u.setAttribute("x2", a.x - r.x), 40545 u.setAttribute("y2", a.y - r.y); 40546 let h = n.stopCircles 40547 , c = (p,g,y)=>{ 40548 let m = e.getStopOffset(p) 40549 , b = B.interpolate(r, a, m) 40550 , M = h[g]; 40551 M.setAttribute("transform", "translate(" + b.x + "," + b.y + ")"), 40552 M.setAttribute("color", y), 40553 M.classList.remove("selected") 40554 } 40555 , f = 0; 40556 for (let p of o) { 40557 for (let g = 0; g < 2; g++) {
40558 let m = e.getStopColor(p).toCss(); 40559 c(p, f, m) 40560 } 40561 f++ 40562 } 40563 i !== -1 && h[i].classList.add("selected") 40564 } 40565 updateRadialGradientElement(e, t) { 40566 let n = this.modelOverlayMap.get(e); 40567 if (n == null) 40568 return; 40569 n.stopCircles.length !== 4 * e.getStopCount() && this.initRadialGradientGroupElement(n, e); 40570 let s = e.getStopCount() 40571 , o = Array.from(Array(s).keys()); 40572 o.splice(0, 1), 40573 o.splice(s - 1, 0, 0); 40574 let i = -1; 40575 t != null && t.type === "stop" && (i = o.indexOf(t.index) * 4, 40576 t.axis === 1 && (i += 2), 40577 t.negative && (i += 1)); 40578 let r = e.pCenter 40579 , a = e.getPFocus() 40580 , d = e.pR1View 40581 , u = e.pR2View 40582 , h = r.multiplyScalar(2).subtract(d, !0) 40583 , c = r.multiplyScalar(2).subtract(u, !0) 40584 , f = e.rFRel 40585 , p = P=>f + (1 - f) * P 40586 , g = n.colorStopEllipse; 40587 if (t != null && t.selected && t.type === "stop") { 40588 let P = t.index === 0 ? s - 1 : t.index 40589 , C = e.getStopOffset(P) 40590 , T = a.x + (r.x - a.x) * C 40591 , k = a.y + (r.y - a.y) * C; 40592 C = p(C); 40593 let D = d.dist(r) * C 40594 , I = u.dist(r) * C 40595 , F = Math.atan2(d.y - r.y, d.x - r.x) 40596 , Y = new oe().rotate(F, T, k); 40597 g.setAttribute("cx", T), 40598 g.setAttribute("cy", k), 40599 g.setAttribute("rx", D), 40600 g.setAttribute("ry", I), 40601 g.setAttribute("transform", Y.toSvgValue()), 40602 g.setAttribute("opacity", "1") 40603 } else 40604 g.setAttribute("opacity", "0"); 40605 let y = n.axisLines; 40606 for (let P = 0; P < 2; P++) { 40607 let C = P === 0 ? d : u 40608 , T = P === 0 ? h : c 40609 , k = y[P]; 40610 k.setAttribute("transform", "translate(" + T.x + "," + T.y + ")"), 40611 k.setAttribute("x2", C.x - T.x), 40612 k.setAttribute("y2", C.y - T.y), 40613 k.setVisible(t != null && t.selected && t.index === s - 1) 40614 } 40615 let m = n.focusLines; 40616 for (let P = 0; P < 2; P++) { 40617 let C = m[2 * P] 40618 , T = P === 0 ? h : c 40619 , k = e.getStopPoint(0, P, !0); 40620 C.setAttribute("transform", "translate(" + k.x + "," + k.y + ")"), 40621 C.setAttribute("x2", T.x - k.x), 40622 C.setAttribute("y2", T.y - k.y), 40623 C = m[2 * P + 1]; 40624 let D = P === 0 ? d : u; 40625 k = e.getStopPoint(0, P, !1), 40626 C.setAttribute("transform", "translate(" + k.x + "," + k.y + ")"), 40627 C.setAttribute("x2", D.x - k.x), 40628 C.setAttribute("y2", D.y - k.y) 40629 } 40630 let b = n.focusEllipse; 40631 if (f > 0) { 40632 let P = d.dist(r) * f 40633 , C = u.dist(r) * f 40634 , T = Math.atan2(d.y - r.y, d.x - r.x) 40635 , k = a.x 40636 , D = a.y 40637 , I = new oe().rotate(T, k, D); 40638 b.setAttribute("cx", k), 40639 b.setAttribute("cy", D), 40640 b.setAttribute("rx", P), 40641 b.setAttribute("ry", C), 40642 b.setAttribute("transform", I.toSvgValue()), 40643 b.setAttribute("opacity", "1") 40644 } else 40645 b.setAttribute("opacity", "0"); 40646 let M = n.stopCircles 40647 , S = (P,C,T,k,D)=>{
40648 let I = e.getStopPoint(P, T, k) 40649 , F = M[4 * C + 2 * T + (k ? 1 : 0)]; 40650 F.setAttribute("transform", "translate(" + I.x + "," + I.y + ")"), 40651 F.setAttribute("color", D), 40652 F.classList.remove("selected") 40653 } 40654 , x = 0; 40655 for (let P of o) { 40656 for (let C = 0; C < 2; C++) { 40657 let k = e.getStopColor(P).toCss(); 40658 S(P, x, C, !0, k), 40659 S(P, x, C, !1, k) 40660 } 40661 x++ 40662 } 40663 i !== -1 && M[i].classList.add("selected") 40664 } 40665 showTextSelection(e, t, n) { 40666 let s = e.baseElement.children[0]; 40667 for (; s.firstChild != null; ) 40668 s.firstChild.remove(); 40669 if (n === 0) 40670 return; 40671 let o = e.textElement 40672 , i = 0; 40673 for (let r of e.getChildModels()) { 40674 let d = r.getText().length 40675 , u = t - i; 40676 if (i + d > t) { 40677 let h = oe.fromSvgValue(o.getAttribute("transform")).tx 40678 , c = r.getBounds() 40679 , f = o.getStartPositionOfChar(Math.max(i, i + u)) 40680 , p = Math.min(d, t + n - i) 40681 , g = p < d ? o.getStartPositionOfChar(i + p) : o.getEndPositionOfChar(i + p - 1) 40682 , y = de("rect", { 40683 x: Math.min(f.x, g.x) + h, 40684 y: c.y, 40685 width: Math.abs(g.x - f.x), 40686 height: c.height, 40687 style: "pointer-events: none;" 40688 }, ["hyvector-text-selection"]); 40689 s.appendChild(y) 40690 } 40691 if (i += d, 40692 i >= t + n) 40693 break 40694 } 40695 } 40696 clearTextSelection(e) { 40697 if (e != null) { 40698 let t = e.baseElement.children[0]; 40699 if (t.tagName === "g") 40700 for (; t.firstChild != null; ) 40701 t.firstChild.remove() 40702 } 40703 } 40704 showCaret(e, t) { 40705 let n = this.textGroup.children[0]; 40706 n == null && (n = de("rect", { 40707 width: 2, 40708 fill: "#000000" 40709 }), 40710 this.textGroup.appendChild(n)); 40711 let i = V().activeDocument.getModel(e); 40712 if (i == null) 40713 return; 40714 let r = i.getCaretBounds(t) 40715 , a = i.getAggregateTransform(); 40716 n.setAttribute("x", r.x), 40717 n.setAttribute("y", r.y), 40718 n.setAttribute("height", r.height), 40719 n.setAttribute("transform", a.toSvgValue()) 40720 } 40721 hideCaret() { 40722 let e = this.textGroup.children[0]; 40723 e?.remove() 40724 } 40725 showGuideLine(e, t, n, s) { 40726 let o = document.getElementById("__selGroup"); 40727 if (s == null) { 40728 s = de("g", { 40729 opacity: .7 40730 }); 40731 let c = de("line", { 40732 stroke: "#ffffff", 40733 "stroke-width": 2, 40734 opacity: .5, 40735 "vector-effect": "non-scaling-stroke" 40736 }); 40737 s.appendChild(c); 40738 let f = de("circle", { 40739 fill: "#3cb371", 40740 stroke: "#ffffff", 40741 "stroke-width": .5, 40742 opacity: 1, 40743 cx: e, 40744 cy: t, 40745 r: 4 40746 }, ["guide-line-center"]); 40747 s.appendChild(f); 40748 let p = de("line", { 40749 stroke: "#3cb371", 40750 "vector-effect": "non-scaling-stroke" 40751 }); 40752 s.appendChild(p) 40753 } 40754 let i = s.children[2] 40755 , r = s.children[0] 40756 , a = s.children[1]; 40757 a.setAttribute("cx", e), 40758 a.setAttribute("cy", t), 40759 s.parentNode == null && o.appendChild(s); 40760 let d = new Ve(-524288,-524288,1048576,1048576) 40761 , u = Math.tan(n) 40762 , h = rw(new B(e,t), new B(1,u), d.x, d.y, d.x + d.width, d.y + d.height); 40763 if (h != null) 40764 for (let c of [i, r]) 40765 c.setAttribute("x1", h[0].x), 40766 c.setAttribute("y1", h[0].y), 40767 c.setAttribute("x2", h[1].x), 40768 c.setAttribute("y2", h[1].y); 40769 return s 40770 } 40771 hideGuide(e) { 40772 e != null && e.parentNode != null && e.remove() 40773 } 40774} 40775class Pd extends Ue { 40776 _edits = []; 40777 level = 0; 40778 constructor() { 40779 super(!1) 40780 } 40781 addEdit(e) { 40782 if (this.isClosed) 40783 return !1; 40784 let t = this._edits.at(-1); 40785 return t && t.addEdit(e) || (this._edits.push(e), 40786 this.isSignificant || (this.isSignificant = e.isSignificant)), 40787 !0 40788 } 40789 getEditCount() { 40790 return this._edits.length 40791 } 40792 getEdit(e) { 40793 return this._edits[e] 40794 } 40795 async undo() { 40796 let e = this._edits; 40797 for (let t = e.length - 1; t >= 0; t--) 40798 await e[t].undo() 40799 } 40800 async redo() { 40801 for (let e of this._edits) 40802 await e.redo() 40803 } 40804} 40805function kc(l) { 40806 console.error(l) 40807} 40808class wI { 40809 listeners = me([]); 40810 undoStack = []; 40811 redoStack = []; 40812 currentCompoundEdit; 40813 inProgress = !1; 40814 reset() { 40815 this.undoStack.splice(0), 40816 this.redoStack.splice(0), 40817 this.currentCompoundEdit = null, 40818 this.inProgress = !1, 40819 this.fireStateChanged() 40820 } 40821 canUndo(e=!1) { 40822 return e ? this.undoStack.find(t=>t.isSignificant) != null : this.undoStack.length > 0 40823 } 40824 canRedo() { 40825 return this.redoStack.length > 0 40826 } 40827 undo() { 40828 this.inProgress || (this.inProgress = !0,
40829 this._undoAsync().then(()=>this.inProgress = !1)) 40830 } 40831 async undoAsync() { 40832 this.inProgress || (this.inProgress = !0, 40833 await this._undoAsync(), 40834 this.inProgress = !1) 40835 } 40836 async _undoAsync() { 40837 let e = this.undoStack, t = this.redoStack, n = !1, s; 40838 do 40839 if (s = e.pop(), 40840 s) { 40841 try { 40842 s.close(), 40843 await s.undo() 40844 } catch (o) { 40845 kc(o) 40846 } 40847 if (t.push(s), 40848 n = !0, 40849 s.isSignificant) 40850 break 40851 } 40852 while (s != null); 40853 n && this.fireStateChanged() 40854 } 40855 redo() { 40856 this.inProgress || (this.inProgress = !0, 40857 this._redoAsync().then(()=>this.inProgress = !1)) 40858 } 40859 async redoAsync() { 40860 this.inProgress || (this.inProgress = !0, 40861 await this._redoAsync(), 40862 this.inProgress = !1) 40863 } 40864 async _redoAsync() { 40865 let e = this.undoStack, t = this.redoStack, n = !1, s; 40866 do 40867 if (s = t.pop(), 40868 s) { 40869 try { 40870 await s.redo() 40871 } catch (o) { 40872 kc(o) 40873 } 40874 if (e.push(s), 40875 n = !0, 40876 s.isSignificant) 40877 break 40878 } 40879 while (s != null && t.at(-1)); 40880 n && this.fireStateChanged() 40881 } 40882 getLastEdit() { 40883 return this.undoStack.at(-1) 40884 } 40885 async undoUntil(e) { 40886 if (e == null || this.undoStack.includes(e)) { 40887 this.inProgress = !0; 40888 let t = this.undoStack.at(-1); 40889 for (; t != null && t !== e; ) 40890 await this._undoAsync(), 40891 t = this.undoStack.at(-1); 40892 this.inProgress = !1 40893 } 40894 } 40895 startCompoundEdit() { 40896 let e = this.currentCompoundEdit; 40897 e instanceof Pd && !e.isClosed ? e.level++ : this.currentCompoundEdit = new Pd 40898 } 40899 endCompoundEdit(e=!1) { 40900 let t = this.currentCompoundEdit; 40901 if (t != null) 40902 if (t.level > 0) 40903 t.level--; 40904 else { 40905 this.currentCompoundEdit = null; 40906 let n = t.getEditCount(); 40907 n > 0 && (n === 1 ? this.addEdit(t.getEdit(0)) : (e || t.close(), 40908 this.undoStack.push(t)), 40909 this.fireStateChanged()) 40910 } 40911 } 40912 addEdit(e) { 40913 let t = !1; 40914 if (this.currentCompoundEdit) 40915 this.currentCompoundEdit.addEdit(e); 40916 else { 40917 let n = this.getLastEdit(); 40918 (!n || !n.addEdit(e)) && (n?.close(), 40919 this.undoStack.push(e), 40920 t = !0) 40921 } 40922 this.redoStack.length > 0 && (this.redoStack.splice(0), 40923 t = !0), 40924 t && this.fireStateChanged() 40925 } 40926 fireStateChanged() { 40927 let e = this.listeners; 40928 for (let t of e) 40929 t.undoStateChanged() 40930 } 40931 addStateListener(e) { 40932 this.listeners.push(e) 40933 } 40934 removeStateListener(e) { 40935 let t = this.listeners; 40936 for (let n = t.length - 1; n >= 0; n--) 40937 t[n] === e && t.splice(n, 0, 1) 40938 } 40939} 40940const PI = { 40941 file: { 40942 label: "File", 40943 mnemonic: "F" 40944 }, 40945 edit: { 40946 label: "Edit", 40947 mnemonic: "E" 40948 }, 40949 object: { 40950 label: "Object", 40951 mnemonic: "O" 40952 }, 40953 view: { 40954 label: "View", 40955 mnemonic: "V" 40956 }, 40957 help: { 40958 label: "Help", 40959 mnemonic: "H" 40960 }, 40961 new: { 40962 label: "New" 40963 }, 40964 open: { 40965 label: "Open", 40966 mnemonic: "O" 40967 }, 40968 saveAs: { 40969 label: "Save as...", 40970 mnemonic: "S" 40971 }, 40972 print: { 40973 label: "Print", 40974 mnemonic: "P" 40975 }, 40976 settings: { 40977 label: "Settings", 40978 mnemonic: "T" 40979 } 40980} 40981 , xI = { 40982 selection: { 40983 name: "Selection Tool" 40984 }, 40985 nodes: { 40986 name: "Nodes Tool", 40987 selModeRect: "Rectangular selection", 40988 selModeLasso: "Lasso selection" 40989 }, 40990 pen: { 40991 name: "Bézier Tool", 40992 mode: "Mode", 40993 bezier: "Construct path", 40994 polyline: "Polyline", 40995 elliptic: "Auto generate curves", 40996 closePath: "Close path" 40997 }, 40998 pencil: { 40999 name: "Pencil Tool", 41000 smoothing: "Smoothing", 41001 closePath: "Close path" 41002 }, 41003 paintbrush: { 41004 name: "Paintbrush Tool", 41005 width: "Width", 41006 brush: "Brush", 41007 brushWidth: "Brush width", 41008 mode: "Mode", 41009 normal: "Normal", 41010 add: "Add",
41011 erase: "Erase", 41012 brushShape: "Brush shape", 41013 aspectRatio: "Aspect ratio", 41014 rotation: "Rotation" 41015 }, 41016 text: { 41017 name: "Text Tool", 41018 font: "Font", 41019 fontSize: "Font size", 41020 bold: "Bold", 41021 italic: "Italic", 41022 underline: "Underline", 41023 strikethrough: "Strike-through", 41024 alignLeft: "Left align", 41025 alignCenter: "Center align", 41026 alignRight: "Right align", 41027 search: "Search", 41028 filterFonts: "Filter fonts" 41029 }, 41030 shape: { 41031 name: "Shape Tool", 41032 shape: "Shape", 41033 rectangle: "Rectangle", 41034 ellipse: "Ellipse", 41035 polygon: "Polygon", 41036 star: "Star", 41037 rectangleOptions: { 41038 cornerRounding: "Corner rounding" 41039 }, 41040 polygonOptions: { 41041 sides: "Sides", 41042 cornerRounding: "Corner rounding" 41043 }, 41044 starOptions: { 41045 points: "Points", 41046 pointSize: "Point size", 41047 autoPointSize: "Set point size automatically", 41048 rounding: "Rounding", 41049 outerRounding: "Outer rounding", 41050 innerRounding: "Inner rounding" 41051 } 41052 }, 41053 image: { 41054 name: "Image Tool" 41055 }, 41056 contour: { 41057 name: "Contour Tool" 41058 }, 41059 corner: { 41060 name: "Corner Rounding" 41061 }, 41062 devLongshadow: { 41063 name: "Long shadow (Development)" 41064 }, 41065 devStrokePainting: { 41066 name: "Stroke Painting (Development)" 41067 }, 41068 devCurveOffset: { 41069 name: "Curve Offset (Development)" 41070 }, 41071 devCurveMerge: { 41072 name: "Curve Merging (Development)" 41073 }, 41074 devCornerRounding: { 41075 name: "Corner Rounding (Development)" 41076 }, 41077 devPerspective: { 41078 name: "Perspective (Development)" 41079 } 41080} 41081 , CI = { 41082 start: { 41083 newDocument: "New Document", 41084 openFile: "Open File", 41085 createNewDocument: "Create a new document", 41086 openExistingFile: "Open an existing file" 41087 }, 41088 newFile: { 41089 newFile: "New File", 41090 title: "Title", 41091 width: "Width", 41092 height: "Height", 41093 presets: "Presets", 41094 untitled: "untitled", 41095 standardFormats: "Standard formats" 41096 }, 41097 properties: { 41098 docProperties: "Document Properties", 41099 name: "Name", 41100 description: "Description", 41101 width: "Width", 41102 height: "Height" 41103 }, 41104 settings: { 41105 settings: "Settings", 41106 general: "General", 41107 ui: "User interface", 41108 privacy: "Privacy" 41109 }, 41110 about: { 41111 aboutHyvector: "About PIC.NET" 41112 }, 41113 licenses: { 41114 usedLibraries: "Used Libraries" 41115 } 41116} 41117 , _I = { 41118 accentColor: "Accent color...", 41119 align: "Align", 41120 alignLeft: "Align left", 41121 alignRight: "Align right", 41122 alignCenterHor: "Center horizontally", 41123 alignTop: "Align top", 41124 alignBottom: "Align bottom", 41125 alignCenterVer: "Center vertically", 41126 arrange: "Arrange", 41127 distribute: "Distribute", 41128 distributeHorLeft: "Distribute left", 41129 distributeHorCenter: "Distribute horizontal center", 41130 distributeHorRight: "Distribute right",
41131 distributeHorBetween: "Distribute horizontal distance between", 41132 distributeVerTop: "Distribute top", 41133 distributeVerCenter: "Distribute vertical center", 41134 distributeVerBottom: "Distribute bottom", 41135 distributeVerBetween: "Distribute vertical distance between", 41136 console: "Console", 41137 deleteModel: "Delete", 41138 deleteSelection: "Delete selection", 41139 duplicate: "Duplicate", 41140 duplicateModel: "Duplicate", 41141 newDocument: "New...", 41142 saveFileAs: "Save as...", 41143 openFile: "Open...", 41144 cut: "Cut", 41145 copy: "Copy", 41146 fullscreen: "Fullscreen", 41147 paste: "Paste", 41148 pasteAsNew: "Paste as new document", 41149 print: "Print...", 41150 undo: "Undo", 41151 redo: "Redo", 41152 toBack: "To back", 41153 toFront: "To front", 41154 oneToBack: "One to back", 41155 oneToFront: "One to front", 41156 booleanPathOps: "Boolean path operations", 41157 booleanUnite: "Unite", 41158 booleanSubtract: "Subtract", 41159 booleanIntersect: "Intersect", 41160 mirrorHorizontal: "Mirror horizontally", 41161 mirrorVertical: "Mirror vertically", 41162 rotate: "Rotate", 41163 group: "Group", 41164 ungroup: "Ungroup", 41165 selectAll: "Select all", 41166 selectNone: "Select none", 41167 toPath: "Convert to path", 41168 strokeToPath: "Convert stroke to path", 41169 toClippath: "Convert to clippath", 41170 toSmoothNodes: "To smooth", 41171 toCornerNodes: "To corner", 41172 toCurve: "To curve", 41173 toLine: "To line", 41174 deleteSelectedNodes: "Delete Points", 41175 toggleDarkMode: "Dark Mode", 41176 toggleRulers: "Show rulers", 41177 toggleTooltips: "Show tooltips", 41178 closePath: "Close path", 41179 openPath: "Open path", 41180 subdividePaths: "Subdivide path at selected nodes", 41181 connectPaths: "Connect paths", 41182 reversePath: "Reverse path orientation", 41183 docProperties: "Document properties...", 41184 settings: "Settings...", 41185 showAbout: "About PIC.NET...", 41186 separatePaths: "Separate compound path", 41187 combinePaths: "Combine paths", 41188 reportIssue: "Report issue", 41189 showLicenses: "Show licenses...", 41190 showConsole: "Show console", 41191 zoomIn: "Zoom in", 41192 zoomOut: "Zoom out", 41193 zoomToDocument: "Zoom to document", 41194 zoomToSelection: "Zoom to selection", 41195 centerDocument: "Center document", 41196 centerSelection: "Center selection" 41197} 41198 , TI = { 41199 bg: "Bulgarian", 41200 de: "German", 41201 en: "English", 41202 es: "Spanish", 41203 fr: "French", 41204 it: "Italian", 41205 jp: "Japanese", 41206 nl: "Dutch", 41207 pl: "Polish", 41208 tr: "Turkish", 41209 zh: "Chinese (Simplified)" 41210} 41211 , kI = { 41212 title: "Insert image", 41213 dropOrPaste: "Drop or paste image file here or", 41214 browseLocal: "Browse local image files" 41215} 41216 , EI = { 41217 saveFile: "Save File", 41218 fileName: "File name", 41219 width: "Width", 41220 height: "Height", 41221 keepRatio: "Keep ratio", 41222 freeSize: "Free size", 41223 moreOptions: "More options", 41224 svgType: "SVG Type", 41225 fontHandling: "Font handling", 41226 embed: "Embed", 41227 linkToGoogle: "Link to Google Fonts", 41228 fontName: "Only font name", 41229 convertToPaths: "Convert to paths", 41230 precision: "Precision" 41231} 41232 , DI = { 41233 setFill: "Set fill", 41234 clearFill: "Clear fill", 41235 setStroke: "Set stroke", 41236 clearStroke: "Clear stroke" 41237} 41238 , OI = { 41239 eyedropper: "Eyedropper", 41240 previousColors: "Previous colors" 41241} 41242 , AI = { 41243 stop: "Stop", 41244 stopColor: "Color", 41245 stopOffset: "Offset", 41246 stopOpacity: "Opacity", 41247 spreadMethod: "Spread method", 41248 pad: "Pad", 41249 reflect: "Reflect", 41250 repeat: "Repeat", 41251 addBefore: "Add before", 41252 addAfter: "Add after", 41253 delete: "Delete" 41254} 41255 , II = { 41256 type: "Type", 41257 colors: "Colors", 41258 rotation: "Rotation", 41259 density: "Density", 41260 scale: "Scale", 41261 inverted: "Inverted" 41262} 41263 , LI = { 41264 strokeStyle: "Stroke style", 41265 strokeWidth: "Stroke width", 41266 lineCap: "Line cap", 41267 lineJoin: "Line join", 41268 butt: "Butt", 41269 square: "Square", 41270 round: "Round", 41271 bevel: "Bevel", 41272 miter: "Miter", 41273 miterLimit: "Miter limit", 41274 strokePattern: "Dashing", 41275 customPattern: "Pattern", 41276 offset: "Offset", 41277 scalePattern: "Scale pattern" 41278} 41279 , VI = { 41280 horAlignment: "Horizontal alignment", 41281 verAlignment: "Vertical alignment", 41282 alignHorLeft: "Left", 41283 alignHorCenter: "Center horizontally", 41284 alignHorRight: "Right", 41285 alignVerTop: "Top", 41286 alignVerCenter: "Center vertically", 41287 alignVerBottom: "Bottom", 41288 relativeTo: "Relative to", 41289 selection: "Selection", 41290 document: "Document", 41291 lastSelected: "Last selected object", 41292 firstSelected: "First selected object", 41293 selectBoundsSide: "Select relative bounds side", 41294 alignAsGroup: "Align as group", 41295 horBoundsSide: "Horizontal bounds side", 41296 verBoundsSide: "Vertical bounds side" 41297} 41298 , NI = { 41299 left: "Left", 41300 center: "Center", 41301 right: "Right", 41302 top: "Top", 41303 bottom: "Bottom", 41304 between: "Between", 41305 horDistribution: "Horizontal distribution", 41306 verDistribution: "Vertical distribution", 41307 selectionBounds: "Distribute within selection bounds", 41308 stepDistance: "Set fixed step distance" 41309} 41310 , RI = { 41311 direction: "Direction", 41312 right: "Right", 41313 left: "Left", 41314 angle: "Angle", 41315 free: "Free" 41316} 41317 , FI = { 41318 showGrid: "Show Grid", 41319 width: "Width", 41320 height: "Height" 41321} 41322 , BI = { 41323 canvasBg: "Canvas background" 41324}
41325 , zI = { 41326 booleanOperation: "Path operation", 41327 primaryObject: "Primary object", 41328 backmost: "Backmost object", 41329 frontmost: "Frontmost object", 41330 lastSelected: "Last selected object", 41331 firstSelected: "First selected object", 41332 keepOriginal: "Keep original objects" 41333} 41334 , UI = { 41335 useSnapAlign: "Use snap align", 41336 snapToGrid: "Snap to grid", 41337 snapToObjects: "Snap to objects", 41338 snapToNodes: "Snap to nodes", 41339 showGuides: "Show guides" 41340} 41341 , GI = { 41342 transform: "Transform", 41343 width: "Width", 41344 height: "Height", 41345 rotate: "Rotate", 41346 skewX: "Skew", 41347 rotateLeft90: "Rotate left 90°", 41348 rotateRight90: "Rotate right 90°" 41349} 41350 , HI = "Accept" 41351 , $I = "Decline" 41352 , XI = "Language" 41353 , YI = "Color" 41354 , KI = "Global color" 41355 , WI = "Linear gradient" 41356 , qI = "Radial gradient" 41357 , jI = "Pattern" 41358 , JI = "No color" 41359 , ZI = "No paint" 41360 , QI = "Fill" 41361 , e7 = "Stroke" 41362 , t7 = "Opacity" 41363 , l7 = "Blur" 41364 , n7 = "Blend Mode" 41365 , s7 = "Objects" 41366 , o7 = "Grid" 41367 , i7 = "File" 41368 , r7 = "Save" 41369 , a7 = "Download" 41370 , d7 = "Close" 41371 , u7 = "Cancel" 41372 , h7 = "OK" 41373 , c7 = "Create" 41374 , f7 = "Apply" 41375 , p7 = "More options" 41376 , g7 = "No objects" 41377 , m7 = "Show object hierarchy" 41378 , y7 = "Toggle selection details" 41379 , v7 = "Zoom" 41380 , b7 = { 41381 normal: "Normal", 41382 multiply: "Multiply", 41383 screen: "Screen", 41384 overlay: "Overlay", 41385 darken: "Darken", 41386 lighten: "Lighten", 41387 colorDodge: "Color dodge", 41388 colorBurn: "Color burn", 41389 hardLight: "Hard light", 41390 "soft-light": "Soft light", 41391 difference: "Difference", 41392 exclusion: "Exclusion", 41393 hue: "Hue", 41394 saturation: "Saturation", 41395 color: "Color", 41396 luminosity: "Luminosity" 41397} 41398 , M7 = { 41399 all: "Alle", 41400 arabic: "Arabic", 41401 bengali: "Bengali", 41402 "chinese-hongkong": "Chinese (Hong Kong)", 41403 "chinese-simplified": "Chinese (Simplified)", 41404 "chinese-traditional": "Chinese (Traditional)", 41405 cyrillic: "Cyrillic", 41406 "cyrillic-ext": "Cyrillic Extended", 41407 devanagari: "Devanagari", 41408 greek: "Greek", 41409 "greek-ext": "Greek Extended", 41410 gujarati: "Gujarati", 41411 gurmukhi: "Gurmukhi", 41412 hebrew: "Hebrew", 41413 japanese: "Japanese", 41414 kannada: "Kannada", 41415 khmer: "Khmer", 41416 korean: "Korean", 41417 latin: "Latin", 41418 "latin-ext": "Latin Extended", 41419 malayalam: "Malayalm", 41420 myanmar: "Myanmar", 41421 oriya: "Oriya", 41422 sinhala: "Sinhala", 41423 tamil: "Tamil", 41424 telugu: "Telugu", 41425 thai: "Thai", 41426 tibetan: "Tibetan", 41427 vietnamese: "Vietnamese" 41428} 41429 , S7 = { 41430 privacySettings: "Privacy Settings", 41431 allowGoogleFonts: { 41432 title: "Use Google Fonts", 41433 html: `<p>To give the user access to a large number of font designs, this app uses the Google Fonts service by Google LLC, 1600 Amphitheatre Parkway Mountain Vie
41433w, CA 94043, USA ("Google"). When accessing the Google Font service your browser connects to Google's servers, which includes trasmitting your IP address. Google's server then transfers the font data to your end device, where it will be stored in the browser's cache.</p><p>Use of Google Fonts is in the interest of providing a large variety of fonts to the user to choose from during the design process of vector graphics. The legal basis is Art. 6 (1) (f) GDPR.</p><p>Information on Google's data processing can be found at <a href="https://policies.google.com/privacy" target="_blank">Googleâs privacy</a> policy and in the <a href="https://developers.google.com/fonts/faq" target="_blank">Google Fonts FAQ</a></p>` 41434 }, 41435 allowSaveState: { 41436 title: "Save state", 41437 html: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut varius cursus leo quis scelerisque. Sed vitae risus id elit vulputate cursus vel quis nunc. Sed dictum convallis nulla in porta. Morbi dolor neque, tincidunt eu porttitor at, vestibulum a libero. Donec at posuere ipsum. Quisque eleifend libero sagittis tempor consequat. Proin tellus lorem, sagittis in iaculis quis, lacinia in erat." 41438 } 41439} 41440 , w7 = { 41441 menus: PI, 41442 tools: xI, 41443 dialogs: CI, 41444 actions: _I, 41445 locales: TI, 41446 openImageDialog: kI, 41447 fileSaveDialog: EI, 41448 paintButton: DI, 41449 colorPicker: OI, 41450 gradientPicker: AI, 41451 patternPicker: II, 41452 strokeStyleEditor: LI, 41453 alignDropdown: VI, 41454 distributeDropdown: NI, 41455 rotationDropdown: RI, 41456 gridDropdown: FI, 41457 canvasBgDropdown: BI, 41458 boolOpsDropdown: zI, 41459 snapAlignDropdown: UI, 41460 transformEditor: GI, 41461 accept: HI, 41462 decline: $I, 41463 language: XI, 41464 color: YI, 41465 globalColor: KI, 41466 linearGradient: WI, 41467 radialGradient: qI, 41468 pattern: jI, 41469 noColor: JI, 41470 noPaint: ZI, 41471 fillPaint: QI, 41472 strokePaint: e7, 41473 opacity: t7, 41474 blur: l7, 41475 blendMode: n7, 41476 objects: s7, 41477 grid: o7, 41478 file: i7, 41479 save: r7, 41480 download: a7, 41481 close: d7, 41482 cancel: u7, 41483 ok: h7, 41484 create: c7, 41485 apply: f7, 41486 moreOptions: p7, 41487 noObjects: g7, 41488 showObjectTree: m7, 41489 toggleSelectionDetails: y7, 41490 zoom: v7, 41491 blendModes: b7, 41492 scripts: M7, 41493 privacySettings: S7 41494} 41495 , P7 = { 41496 file: { 41497 label: "Datei", 41498 mnemonic: "D" 41499 }, 41500 edit: { 41501 label: "Bearbeiten", 41502 mnemonic: "E" 41503 }, 41504 object: { 41505 label: "Objekt", 41506 mnemonic: "O" 41507 }, 41508 view: { 41509 label: "Ansicht", 41510 mnemonic: "A" 41511 }, 41512 help: { 41513 label: "Hilfe", 41514 mnemonic: "H" 41515 }, 41516 new: { 41517 label: "Neu" 41518 }, 41519 open: { 41520 label: "Ãffnen", 41521 mnemonic: "O" 41522 }, 41523 saveAs: { 41524 label: "Speichern als...", 41525 mnemonic: "S" 41526 }, 41527 print: { 41528 label: "Drucken", 41529 mnemonic: "P" 41530 }, 41531 settings: { 41532 label: "Einstellungen", 41533 mnemonic: "T" 41534 } 41535} 41536 , x7 = { 41537 selection: { 41538 name: "Auswahl Werkzeug" 41539 }, 41540 nodes: { 41541 name: "Knoten Werkzeug", 41542 selModeRect: "Rechteckige Auswahl", 41543 selModeLasso: "Lassoauswahl" 41544 }, 41545 pen: { 41546 name: "Bézier Werkzeug", 41547 mode: "Modus", 41548 bezier: "Bézier", 41549 polyline: "Polylinie", 41550 elliptic: "Kurven automatisch generieren", 41551 closePath: "Pfad schlieÃen" 41552 }, 41553 pencil: { 41554 name: "Stift Werkzeug", 41555 smoothing: "Glättung", 41556 closePath: "Pfad schlieÃen" 41557 }, 41558 paintbrush: { 41559 name: "Pinsel Werkzeug", 41560 brush: "Pinsel", 41561 width: "Breite", 41562 brushWidth: "Pinselbreite", 41563 mode: "Modus", 41564 normal: "Normal", 41565 add: "Hinzufügen", 41566 erase: "Radieren", 41567 brushShape: "Pinselform", 41568 aspectRatio: "Seitenverhältnis", 41569 rotation: "Drehung" 41570 }, 41571 text: { 41572 name: "Text Werkzeug", 41573 font: "Schriftart", 41574 fontSize: "SchriftgröÃe", 41575 bold: "Fett", 41576 italic: "Kursiv", 41577 underline: "Unterstrichen", 41578 strikethrough: "Durchgestrichen", 41579 alignLeft: "Linksbündig", 41580 alignCenter: "Zentriert", 41581 alignRight: "Rechtsbündig", 41582 search: "Suchen", 41583 filterFonts: "Schriftarten filtern" 41584 }, 41585 shape: { 41586 name: "Form Werkzeug", 41587 shape: "Form", 41588 rectangle: "Rechteck", 41589 ellipse: "Ellipse", 41590 polygon: "Polygon", 41591 star: "Stern", 41592 rectangleOptions: { 41593 cornerRounding: "Eckenrundung" 41594 }, 41595 polygonOptions: { 41596 sides: "Seiten", 41597 cornerRounding: "Eckenrundung" 41598 }, 41599 starOptions: { 41600 points: "Spitzen", 41601 pointSize: "GröÃe der Spitzen", 41602 autoPointSize: "GröÃe der Spitzen automatisch setzen", 41603 rounding: "Rundung", 41604 outerRounding: "ÃuÃere Rundung", 41605 innerRounding: "Innere Rundung" 41606 } 41607 }, 41608 image: { 41609 name: "Bild Werkzeug" 41610 }, 41611 contour: { 41612 name: "Kontur Werkzeug" 41613 }, 41614 corner: { 41615 name: "Ecken Rundung" 41616 }, 41617 devLongshadow: { 41618 name: "Long shadow (Development)" 41619 }, 41620 devStrokePainting: { 41621 name: "Stroke Painting (Development)" 41622 }, 41623 devCurveOffset: { 41624 name: "Curve Offset (Development)" 41625 }, 41626 devCurveMerge: { 41627 name: "Curve Merging (Development)" 41628 }, 41629 devCornerRounding: { 41630 name: "Corner Rounding (Development)" 41631 }, 41632 devPerspective: { 41633 name: "Persepctive (Development)" 41634 } 41635} 41636 , C7 = { 41637 start: { 41638 newDocument: "Neue Grafik", 41639 openFile: "Datei öffnen", 41640 createNewDocument: "Neue Grafik erstellen",
41641 openExistingFile: "Bestehende Datei öffnen" 41642 }, 41643 newFile: { 41644 newFile: "Neue Grafik", 41645 name: "Titel", 41646 width: "Breite", 41647 height: "Höhe", 41648 presets: "Voreinstellungen", 41649 untitled: "unbenannt", 41650 standardFormats: "Standardformate" 41651 }, 41652 properties: { 41653 docProperties: "Dokumenteigenschaften", 41654 name: "Name", 41655 description: "Beschreibung", 41656 width: "Breite", 41657 height: "Höhe" 41658 }, 41659 settings: { 41660 settings: "Einstellungen", 41661 general: "Allgemein", 41662 ui: "Benutzeroberfläche", 41663 privacy: "Datenschutz" 41664 }, 41665 about: { 41666 aboutHyvector: "Ãber PIC.NET" 41667 }, 41668 licenses: { 41669 usedLibraries: "Verwendete Bibliotheken" 41670 } 41671} 41672 , _7 = { 41673 accentColor: "Akzentfarbe...", 41674 align: "Ausrichten", 41675 alignLeft: "Links ausrichten", 41676 alignRight: "Rechts ausrichten", 41677 alignCenterHor: "Horizontal zentrieren", 41678 alignTop: "Oben ausrichten", 41679 alignBottom: "Unten ausrichten", 41680 alignCenterVer: "Vertikal zentrieren", 41681 arrange: "Anordnen", 41682 distribute: "Verteilen", 41683 distributeHorLeft: "Verteilen links", 41684 distributeHorCenter: "Verteien zentriert", 41685 distributeHorRight: "Verteilen rechts",
41686 distributeHorBetween: "Abstand zwischen Objekten verteilen", 41687 distributeVerTop: "Verteilen oben", 41688 distributeVerCenter: "Verteilen zentriert", 41689 distributeVerBottom: "Verteilen unten", 41690 distributeVerBetween: "Abstand zwischen Objekten verteilen", 41691 console: "Konsole", 41692 deleteModel: "Löschen", 41693 deleteSelection: "Auswahl löschen", 41694 duplicate: "Duplizieren", 41695 duplicateModel: "Duplizieren", 41696 newDocument: "Neu...", 41697 saveFileAs: "Speichern als...", 41698 openFile: "Ãffnen...", 41699 cut: "Ausschneiden", 41700 copy: "Kopieren", 41701 fullscreen: "Vollbildschirm", 41702 paste: "Einfügen", 41703 pasteAsNew: "Als neues Dokument öffnen", 41704 print: "Drucken...", 41705 undo: "Rückgängig", 41706 redo: "Wiederholen", 41707 toBack: "Nach hinten", 41708 toFront: "Nach vorne", 41709 oneToBack: "Eins nach hinten", 41710 oneToFront: "Eins nach vorne", 41711 booleanPathOps: "Boolsche Pfadoperationen", 41712 booleanUnite: "Vereinen", 41713 booleanSubtract: "Abziehen", 41714 booleanIntersect: "Ãberschneidung", 41715 mirrorHorizontal: "Horizontal spiegeln", 41716 mirrorVertical: "Vertikal spiegeln", 41717 rotate: "Drehen", 41718 group: "Gruppieren", 41719 ungroup: "Gruppierung aufheben", 41720 selectAll: "Alles auswählen", 41721 selectNone: "Nichts auswählen", 41722 toPath: "In Pfad umwandeln", 41723 strokeToPath: "Kontur in Pfad umwandeln", 41724 toClippath: "In Clip-Pfad umwandeln", 41725 toSmoothNodes: "In geglättet umwandeln", 41726 toCornerNodes: "In Spitze umwandeln", 41727 toCurve: "In Kurve", 41728 toLine: "In Linie", 41729 deleteSelectedNodes: "Punkte Löschen", 41730 toggleDarkMode: "Dark Mode", 41731 toggleRulers: "Lineale anzeigen", 41732 toggleTooltips: "Tootips anzeigen", 41733 closePath: "Pfad schlieÃen", 41734 openPath: "Pfad öffnen", 41735 subdividePaths: "Pfad an ausgewählten Knoten auftrennen", 41736 connectPaths: "Pfade verbinden", 41737 reversePath: "Pfadrichtung umkehren", 41738 docProperties: "Dateieigenschaften...", 41739 settings: "Einstellungen...", 41740 showAbout: "Ãber PIC.NET...", 41741 separatePaths: "Zusammengesetzen Pfad auftrennen", 41742 combinePaths: "Pfade zusammenfügen", 41743 reportIssue: "Problem melden", 41744 showLicenses: "Lizenzen anzeigen...", 41745 showConsole: "Konsole anzeigen", 41746 zoomIn: "Hineinzooment", 41747 zoomOut: "Herauszoomen", 41748 zoomToDocument: "Auf Dokument zoomen", 41749 zoomToSelection: "Auf Auswahl zoomen", 41750 centerDocument: "Dokument zentrieren", 41751 centerSelection: "Auswahl zentrieren" 41752} 41753 , T7 = { 41754 bg: "Bulgarisch", 41755 de: "Deutsch", 41756 en: "Englisch", 41757 es: "Spanisch", 41758 fr: "Französisch", 41759 it: "Italienisch", 41760 jp: "Japanisch", 41761 nl: "Niederländisch", 41762 pl: "Polish", 41763 tr: "Türkisch", 41764 zh: "Chinesisch (vereinfacht)" 41765} 41766 , k7 = { 41767 title: "Bild Einfügen", 41768 dropOrPaste: "Bilddatei hier ablegen, einfügen oder", 41769 browseLocal: "Lokale Bilddateien durchsuchen" 41770} 41771 , E7 = { 41772 saveFile: "Datei Speichern", 41773 fileName: "Dateiname", 41774 untitled: "unbenannt", 41775 width: "Breite", 41776 height: "Höhe", 41777 keepRatio: "Verhältnis beibehalten", 41778 freeSize: "Freie GröÃe", 41779 moreOptions: "Weitere Optionen", 41780 svgType: "SVG-typ", 41781 fontHandling: "Schriftarten", 41782 embed: "Einbetten", 41783 linkToGoogle: "Link zu Google Fonts", 41784 fontName: "Nur Name der Schriftart", 41785 convertToPaths: "In Pfade umwandeln", 41786 precision: "Nachkommastellen" 41787} 41788 , D7 = { 41789 setFill: "Füllung anwenden", 41790 clearFill: "Füllung entfernen", 41791 setStroke: "Kontur anwenden", 41792 clearStroke: "Kontur entfernen" 41793} 41794 , O7 = { 41795 eyedropper: "Pipette", 41796 previousColors: "Vorherige Farben" 41797} 41798 , A7 = { 41799 stop: "Stop", 41800 stopColor: "Farbe", 41801 stopOffset: "Position", 41802 stopOpacity: "Deckkraft", 41803 spreadMethod: "Extrapolation", 41804 pad: "Auffüllen", 41805 reflect: "Spiegeln", 41806 repeat: "Wiederholen", 41807 addBefore: "Davor einfügen", 41808 addAfter: "Danach einfügen", 41809 delete: "Löschen" 41810} 41811 , I7 = { 41812 type: "Typ", 41813 colors: "Farben", 41814 rotation: "Drehung", 41815 density: "Dichte", 41816 scale: "Skalierung", 41817 inverted: "Invertiert" 41818} 41819 , L7 = { 41820 strokeStyle: "Linienstil", 41821 strokeWidth: "Linienbreite", 41822 lineCap: "Ende", 41823 lineJoin: "Ecke", 41824 butt: "Stumpf", 41825 square: "Quadratisch", 41826 round: "Rund", 41827 bevel: "Abgeschrägt", 41828 miter: "Gehrung", 41829 miterLimit: "Gehrungslimit", 41830 strokePattern: "Strichelung", 41831 customPattern: "Muster", 41832 offset: "Versatz", 41833 scalePattern: "Strichelung skalieren" 41834} 41835 , V7 = { 41836 horAlignment: "Horizontale Ausrichtung", 41837 verAlignment: "Vertikale Ausrichtung", 41838 alignHorLeft: "Links", 41839 alignHorCenter: "Horizontal zentriert", 41840 alignHorRight: "Rechts", 41841 alignVerTop: "Oben", 41842 alignVerCenter: "Vertikal zentriert", 41843 alignVerBottom: "Unten", 41844 relativeTo: "Relativ zu", 41845 selection: "Auswahl", 41846 document: "Dokument", 41847 lastSelected: "Zuletzt ausgewähltes Objekt", 41848 firstSelected: "Zuerst ausgewähltes Objekt", 41849 selectBoundsSide: "Seite des relativen Rahmens festlegen", 41850 alignAsGroup: "Als Gruppe ausrichten", 41851 horBoundsSide: "Horizontale Seite des Bezugsrahmens", 41852 verBoundsSide: "Vertikale Seite des Bezugsrahmens" 41853} 41854 , N7 = { 41855 left: "Links", 41856 center: "Zentriert", 41857 right: "Rechts", 41858 top: "Oben", 41859 bottom: "Unten", 41860 between: "Zwischen", 41861 horDistribution: "Horizontal verteilen", 41862 verDistribution: "Vertikal verteilen", 41863 selectionBounds: "Innerhalb auswahlbereich verteilen", 41864 stepDistance: "Schrittabstand festlegen" 41865} 41866 , R7 = { 41867 canvasBg: "Hintergrundfarbe für Leinwand" 41868} 41869 , F7 = { 41870 booleanOperation: "Pfadoperation", 41871 primaryObject: "Primärobjekt", 41872 backmost: "Hinterstes Objekt", 41873 frontmost: "Vorderstes Objekt", 41874 lastSelected: "Zuletzt ausgewähltes Objekt", 41875 firstSelected: "Zuerst ausgewähltes Objekt", 41876 keepOriginal: "Originalobjekte beibehalten" 41877} 41878 , B7 = { 41879 direction: "Richtung", 41880 right: "Rechts", 41881 left: "Links", 41882 angle: "Winkel", 41883 free: "Frei" 41884} 41885 , z7 = { 41886 showGrid: "Gitter anzeigen", 41887 width: "Breite", 41888 height: "Höhe" 41889} 41890 , U7 = { 41891 useSnapAlign: "Magnetisch ausrichten",
41892 snapToGrid: "An Gitter ausrichten", 41893 snapToObjects: "An Objekten ausrichten", 41894 snapToNodes: "An Knoten ausrichten", 41895 showGuides: "Hilfslinien anzeigen" 41896} 41897 , G7 = { 41898 transform: "Transformation", 41899 width: "Breite", 41900 height: "Höhe", 41901 rotate: "Drehung", 41902 skewX: "Scherung", 41903 rotateLeft90: "Links drehen 90°", 41904 rotateRight90: "Rechts drehen 90°" 41905} 41906 , H7 = "Akzeptieren" 41907 , $7 = "Ablehnen" 41908 , X7 = "Sprache" 41909 , Y7 = "Farbe" 41910 , K7 = "Globale Farbe" 41911 , W7 = "Linearer Gradient" 41912 , q7 = "Radialer Gradient" 41913 , j7 = "Muster" 41914 , J7 = "Keine Farbe" 41915 , Z7 = "Keine Farbe" 41916 , Q7 = "Füllung" 41917 , eL = "Kontur" 41918 , tL = "Deckkraft" 41919 , lL = "Unschärfe" 41920 , nL = "Blend Modus" 41921 , sL = "Objekte" 41922 , oL = "Raster" 41923 , iL = "Datei" 41924 , rL = "Speichern" 41925 , aL = "Herunterladen" 41926 , dL = "SchlieÃen" 41927 , uL = "Abbrechen" 41928 , hL = "OK" 41929 , cL = "Erstellen" 41930 , fL = "Anwenden" 41931 , pL = "Weitere Optionen" 41932 , gL = "Keine Objectke" 41933 , mL = "Objekt-Hierarchie einblenden" 41934 , yL = "Auswahldeteils aus-/einklappen" 41935 , vL = "Zoom" 41936 , bL = { 41937 normal: "Normal", 41938 multiply: "Multiply", 41939 screen: "Screen", 41940 overlay: "Overlay", 41941 darken: "Darken", 41942 lighten: "Lighten", 41943 colorDodge: "Color dodge", 41944 colorBurn: "Color burn", 41945 hardLight: "Hard light", 41946 "soft-light": "Soft light", 41947 difference: "Difference", 41948 exclusion: "Exclusion", 41949 hue: "Hue", 41950 saturation: "Saturation", 41951 color: "Color", 41952 luminosity: "Luminosity" 41953} 41954 , ML = { 41955 all: "Alle", 41956 arabic: "Arabisch", 41957 bengali: "Bengali", 41958 "chinese-hongkong": "Chinesisch (Hong Kong)", 41959 "chinese-simplified": "Chinesisch (vereinfacht)", 41960 "chinese-traditional": "Chinesisch (traditionell)", 41961 cyrillic: "Kyrillisch", 41962 "cyrillic-ext": "Kyrillisch erweitert", 41963 devanagari: "Devanagari", 41964 greek: "Griechisch", 41965 "greek-ext": "Griechisch erweitert", 41966 gujarati: "Gujarati", 41967 gurmukhi: "Gurmukhi", 41968 hebrew: "Hebräisch", 41969 japanese: "Japanisch", 41970 kannada: "Kannada", 41971 khmer: "Khmer", 41972 korean: "Koreanisch", 41973 latin: "Lateinisch", 41974 "latin-ext": "Lateinisch erweitert", 41975 malayalam: "Malayalm", 41976 myanmar: "Birmanisch", 41977 oriya: "Oriya", 41978 sinhala: "Singhalesisch", 41979 tamil: "Tamil", 41980 telugu: "Telugu", 41981 thai: "Thailändisch", 41982 tibetan: "Tibetisch", 41983 vietnamese: "Vietnamesisch" 41984} 41985 , SL = { 41986 menus: P7, 41987 tools: x7, 41988 dialogs: C7, 41989 actions: _7, 41990 locales: T7, 41991 openImageDialog: k7, 41992 fileSaveDialog: E7, 41993 paintButton: D7, 41994 colorPicker: O7, 41995 gradientPicker: A7, 41996 patternPicker: I7, 41997 strokeStyleEditor: L7, 41998 alignDropdown: V7, 41999 distributeDropdown: N7, 42000 canvasBgDropdown: R7, 42001 boolOpsDropdown: F7, 42002 rotationDropdown: B7, 42003 gridDropdown: z7, 42004 snapAlignDropdown: U7, 42005 transformEditor: G7, 42006 accept: H7, 42007 decline: $7, 42008 language: X7, 42009 color: Y7, 42010 globalColor: K7, 42011 linearGradient: W7, 42012 radialGradient: q7, 42013 pattern: j7, 42014 noColor: J7, 42015 noPaint: Z7, 42016 fillPaint: Q7, 42017 strokePaint: eL, 42018 opacity: tL, 42019 blur: lL, 42020 blendMode: nL, 42021 objects: sL, 42022 grid: oL, 42023 file: iL, 42024 save: rL, 42025 download: aL, 42026 close: dL, 42027 cancel: uL, 42028 ok: hL, 42029 create: cL, 42030 apply: fL, 42031 moreOptions: pL, 42032 noObjects: gL, 42033 showObjectTree: mL, 42034 toggleSelectionDetails: yL, 42035 zoom: vL, 42036 blendModes: bL, 42037 scripts: ML 42038} 42039 , zhMessages = { 42040 ...w7, 42041 menus: { 42042 ...PI, 42043 file: { 42044 ...PI.file, 42045 label: "æä»¶" 42046 }, 42047 edit: { 42048 ...PI.edit, 42049 label: "ç¼è¾" 42050 }, 42051 object: { 42052 ...PI.object, 42053 label: "对象" 42054 }, 42055 view: { 42056 ...PI.view, 42057 label: "è§å¾" 42058 }, 42059 help: { 42060 ...PI.help, 42061 label: "帮å©" 42062 }, 42063 new: { 42064 label: "æ°å»º" 42065 }, 42066 open: { 42067 ...PI.open, 42068 label: "æå¼" 42069 }, 42070 saveAs: { 42071 ...PI.saveAs, 42072 label: "å¦å为..." 42073 }, 42074 print: { 42075 ...PI.print, 42076 label: "æå°" 42077 }, 42078 settings: { 42079 ...PI.settings, 42080 label: "设置" 42081 } 42082 }, 42083 tools: { 42084 ...xI, 42085 selection: { 42086 name: "éæ©å·¥å ·" 42087 }, 42088 nodes: { 42089 name: "èç¹å·¥å ·", 42090 selModeRect: "ç©å½¢éæ©", 42091 selModeLasso: "å¥ç´¢éæ©" 42092 }, 42093 pen: { 42094 ...xI.pen, 42095 name: "è´å¡å°å·¥å ·", 42096 mode: "模å¼", 42097 bezier: "ç»å¶è·¯å¾", 42098 polyline: "æçº¿", 42099 elliptic: "èªå¨çææ²çº¿", 42100 closePath: "éåè·¯å¾" 42101 }, 42102 pencil: { 42103 ...xI.pencil, 42104 name: "é ç¬å·¥å ·", 42105 smoothing: "å¹³æ»", 42106 closePath: "éåè·¯å¾" 42107 }, 42108 paintbrush: { 42109 ...xI.paintbrush, 42110 name: "ç»ç¬å·¥å ·", 42111 width: "宽度", 42112 brush: "ç»ç¬", 42113 brushWidth: "ç»ç¬å®½åº¦", 42114 mode: "模å¼", 42115 normal: "æ®é", 42116 add: "æ·»å ",
42117 erase: "æ¦é¤", 42118 brushShape: "ç»ç¬å½¢ç¶", 42119 aspectRatio: "宽髿¯", 42120 rotation: "æè½¬" 42121 }, 42122 text: { 42123 ...xI.text, 42124 name: "æåå·¥å ·", 42125 font: "åä½", 42126 fontSize: "åå·", 42127 bold: "ç²ä½", 42128 italic: "æä½", 42129 underline: "ä¸å线", 42130 strikethrough: "å é¤çº¿", 42131 alignLeft: "左对é½", 42132 alignCenter: "å± ä¸å¯¹é½", 42133 alignRight: "å³å¯¹é½", 42134 search: "æç´¢", 42135 filterFonts: "çéåä½" 42136 }, 42137 shape: { 42138 ...xI.shape, 42139 name: "å½¢ç¶å·¥å ·", 42140 shape: "å½¢ç¶", 42141 rectangle: "ç©å½¢", 42142 ellipse: "æ¤å", 42143 polygon: "å¤è¾¹å½¢", 42144 star: "æå½¢", 42145 rectangleOptions: { 42146 cornerRounding: "åè§" 42147 }, 42148 polygonOptions: { 42149 sides: "è¾¹æ°", 42150 cornerRounding: "åè§" 42151 }, 42152 starOptions: { 42153 points: "è§æ°", 42154 pointSize: "å è§å¤§å°", 42155 autoPointSize: "èªå¨è®¾ç½®å è§å¤§å°", 42156 rounding: "åè§", 42157 outerRounding: "å¤åè§", 42158 innerRounding: "å åè§" 42159 } 42160 }, 42161 image: { 42162 name: "å¾åå·¥å ·" 42163 }, 42164 contour: { 42165 name: "è½®å»å·¥å ·" 42166 }, 42167 corner: { 42168 name: "åè§å·¥å ·" 42169 } 42170 }, 42171 dialogs: { 42172 ...CI, 42173 start: { 42174 newDocument: "æ°å»ºææ¡£", 42175 openFile: "æå¼æä»¶", 42176 createNewDocument: "åå»ºæ°ææ¡£", 42177 openExistingFile: "æå¼ç°ææä»¶" 42178 }, 42179 newFile: { 42180 newFile: "æ°å»ºæä»¶", 42181 title: "æ é¢", 42182 width: "宽度", 42183 height: "é«åº¦", 42184 presets: "é¢è®¾", 42185 untitled: "æªå½å", 42186 standardFormats: "æ å尺寸" 42187 }, 42188 properties: { 42189 docProperties: "ææ¡£å±æ§", 42190 name: "åç§°", 42191 description: "æè¿°", 42192 width: "宽度", 42193 height: "é«åº¦" 42194 }, 42195 settings: { 42196 settings: "设置", 42197 general: "常è§", 42198 ui: "çé¢", 42199 privacy: "éç§" 42200 }, 42201 about: { 42202 aboutHyvector: "å ³äº PIC.NET" 42203 }, 42204 licenses: { 42205 usedLibraries: "使ç¨ç弿ºåº" 42206 } 42207 }, 42208 actions: { 42209 ..._I, 42210 accentColor: "强è°è²...", 42211 align: "对é½", 42212 alignLeft: "左对é½", 42213 alignRight: "å³å¯¹é½", 42214 alignCenterHor: "æ°´å¹³å± ä¸", 42215 alignTop: "é¡¶é¨å¯¹é½", 42216 alignBottom: "åºé¨å¯¹é½", 42217 alignCenterVer: "åç´å± ä¸", 42218 arrange: "æå", 42219 distribute: "åå¸", 42220 distributeHorLeft: "æå·¦ä¾§åå¸", 42221 distributeHorCenter: "ææ°´å¹³ä¸å¿åå¸", 42222 distributeHorRight: "æå³ä¾§åå¸",
42223 distributeHorBetween: "æ°´å¹³çè·åå¸", 42224 distributeVerTop: "æé¡¶é¨åå¸", 42225 distributeVerCenter: "æåç´ä¸å¿åå¸", 42226 distributeVerBottom: "æåºé¨åå¸", 42227 distributeVerBetween: "åç´çè·åå¸", 42228 console: "æ§å¶å°", 42229 deleteModel: "å é¤", 42230 deleteSelection: "å 餿é对象", 42231 duplicate: "å¤å¶å¯¹è±¡", 42232 duplicateModel: "å¤å¶å¯¹è±¡", 42233 newDocument: "æ°å»º...", 42234 saveFileAs: "å¦å为...", 42235 openFile: "æå¼...", 42236 cut: "åªå", 42237 copy: "å¤å¶", 42238 fullscreen: "å ¨å±", 42239 paste: "ç²è´´", 42240 pasteAsNew: "ç²è´´ä¸ºæ°ææ¡£", 42241 print: "æå°...", 42242 undo: "æ¤é", 42243 redo: "éå", 42244 toBack: "ç½®äºåºå±", 42245 toFront: "ç½®äºé¡¶å±", 42246 oneToBack: "ä¸ç§»ä¸å±", 42247 oneToFront: "ä¸ç§»ä¸å±", 42248 booleanPathOps: "å¸å°è·¯å¾è¿ç®", 42249 booleanUnite: "åå¹¶", 42250 booleanSubtract: "ç¸å", 42251 booleanIntersect: "ç¸äº¤", 42252 mirrorHorizontal: "水平翻转", 42253 mirrorVertical: "åç´ç¿»è½¬", 42254 rotate: "æè½¬", 42255 group: "ç¼ç»", 42256 ungroup: "åæ¶ç¼ç»", 42257 selectAll: "å ¨é", 42258 selectNone: "åæ¶éæ©", 42259 toPath: "转æ¢ä¸ºè·¯å¾", 42260 strokeToPath: "æè¾¹è½¬æ¢ä¸ºè·¯å¾", 42261 toClippath: "转æ¢ä¸ºåªåè·¯å¾", 42262 toSmoothNodes: "转为平æ»èç¹", 42263 toCornerNodes: "转为å°è§èç¹", 42264 toCurve: "转为æ²çº¿", 42265 toLine: "转为ç´çº¿", 42266 deleteSelectedNodes: "å é¤èç¹", 42267 toggleDarkMode: "æ·±è²æ¨¡å¼", 42268 toggleRulers: "æ¾ç¤ºæ å°º", 42269 toggleTooltips: "æ¾ç¤ºå·¥å ·æç¤º", 42270 closePath: "éåè·¯å¾", 42271 openPath: "æå¼è·¯å¾", 42272 subdividePaths: "卿éèç¹å¤ç»åè·¯å¾", 42273 connectPaths: "è¿æ¥è·¯å¾", 42274 reversePath: "åè½¬è·¯å¾æ¹å", 42275 docProperties: "ææ¡£å±æ§...", 42276 settings: "设置...", 42277 showAbout: "å ³äº PIC.NET...", 42278 separatePaths: "æåå¤åè·¯å¾", 42279 combinePaths: "å并为å¤åè·¯å¾", 42280 reportIssue: "æ¥åé®é¢", 42281 showLicenses: "æ¥ç弿ºè®¸å¯...", 42282 showConsole: "æ¾ç¤ºæ§å¶å°", 42283 zoomIn: "æ¾å¤§", 42284 zoomOut: "缩å°", 42285 zoomToDocument: "缩æ¾è³ææ¡£", 42286 zoomToSelection: "缩æ¾è³æé对象", 42287 centerDocument: "å± ä¸ææ¡£", 42288 centerSelection: "å± ä¸æé对象" 42289 }, 42290 locales: { 42291 ...TI, 42292 de: "å¾·è¯", 42293 en: "è±è¯", 42294 zh: "ç®ä½ä¸æ" 42295 }, 42296 openImageDialog: { 42297 title: "æå ¥å¾å", 42298 dropOrPaste: "å°å¾åæä»¶ææ¾æç²è´´å°è¿éï¼æè ", 42299 browseLocal: "æµè§æ¬å°å¾å" 42300 }, 42301 fileSaveDialog: { 42302 ...EI, 42303 saveFile: "ä¿åæä»¶", 42304 fileName: "æä»¶å", 42305 width: "宽度", 42306 height: "é«åº¦", 42307 keepRatio: "ä¿ææ¯ä¾", 42308 freeSize: "èªç±å°ºå¯¸", 42309 moreOptions: "æ´å¤é项", 42310 svgType: "SVG ç±»å", 42311 fontHandling: "åä½å¤ç", 42312 embed: "åµå ¥åä½", 42313 linkToGoogle: "龿¥å° Google Fonts", 42314 fontName: "ä» ä¿çåä½åç§°", 42315 convertToPaths: "转æ¢ä¸ºè·¯å¾", 42316 precision: "精度" 42317 }, 42318 paintButton: { 42319 setFill: "设置填å ", 42320 clearFill: "æ¸ é¤å¡«å ", 42321 setStroke: "设置æè¾¹", 42322 clearStroke: "æ¸ é¤æè¾¹" 42323 }, 42324 colorPicker: { 42325 eyedropper: "å¸ç®¡", 42326 previousColors: "æè¿ä½¿ç¨çé¢è²" 42327 }, 42328 gradientPicker: { 42329 ...AI, 42330 stop: "è²æ ", 42331 stopColor: "é¢è²", 42332 stopOffset: "ä½ç½®", 42333 stopOpacity: "ä¸éæåº¦", 42334 spreadMethod: "æ©å±æ¹å¼", 42335 pad: "å¡«å ", 42336 reflect: "éå", 42337 repeat: "éå¤", 42338 addBefore: "å¨å颿·»å ", 42339 addAfter: "å¨å颿·»å ", 42340 delete: "å é¤" 42341 }, 42342 patternPicker: { 42343 type: "ç±»å", 42344 colors: "é¢è²", 42345 rotation: "æè½¬", 42346 density: "å¯åº¦", 42347 scale: "缩æ¾", 42348 inverted: "åç¸" 42349 }, 42350 strokeStyleEditor: { 42351 ...LI, 42352 strokeStyle: "æè¾¹æ ·å¼", 42353 strokeWidth: "æè¾¹å®½åº¦", 42354 lineCap: "端ç¹", 42355 lineJoin: "è¿æ¥", 42356 butt: "平头", 42357 square: "æ¹å¤´", 42358 round: "å头", 42359 bevel: "ææ¥", 42360 miter: "å°è§", 42361 miterLimit: "å°è§éå¶", 42362 strokePattern: "è线", 42363 customPattern: "èªå®ä¹æ ·å¼", 42364 offset: "åç§»", 42365 scalePattern: "ç¼©æ¾æ ·å¼" 42366 },
42367 alignDropdown: { 42368 ...VI, 42369 horAlignment: "水平对é½", 42370 verAlignment: "åç´å¯¹é½", 42371 alignHorLeft: "左对é½", 42372 alignHorCenter: "æ°´å¹³å± ä¸", 42373 alignHorRight: "å³å¯¹é½", 42374 alignVerTop: "é¡¶é¨å¯¹é½", 42375 alignVerCenter: "åç´å± ä¸", 42376 alignVerBottom: "åºé¨å¯¹é½", 42377 relativeTo: "ç¸å¯¹äº", 42378 selection: "æé对象", 42379 document: "ææ¡£", 42380 lastSelected: "æåéæ©ç对象", 42381 firstSelected: "æå éæ©ç对象", 42382 selectBoundsSide: "éæ©ç¸å¯¹è¾¹ç", 42383 alignAsGroup: "ä½ä¸ºæ´ä½å¯¹é½", 42384 horBoundsSide: "水平边ç", 42385 verBoundsSide: "åç´è¾¹ç" 42386 }, 42387 distributeDropdown: { 42388 ...NI, 42389 left: "左侧", 42390 center: "ä¸å¿", 42391 right: "å³ä¾§", 42392 top: "é¡¶é¨", 42393 bottom: "åºé¨", 42394 between: "é´è·", 42395 horDistribution: "æ°´å¹³åå¸", 42396 verDistribution: "åç´åå¸", 42397 selectionBounds: "å¨éæ©èå´å åå¸", 42398 stepDistance: "åºå®é´è·" 42399 }, 42400 rotationDropdown: { 42401 direction: "æ¹å", 42402 right: "å³", 42403 left: "å·¦", 42404 angle: "è§åº¦", 42405 free: "èªç±" 42406 }, 42407 gridDropdown: { 42408 showGrid: "æ¾ç¤ºç½æ ¼", 42409 width: "宽度", 42410 height: "é«åº¦" 42411 }, 42412 canvasBgDropdown: { 42413 canvasBg: "ç»å¸èæ¯" 42414 }, 42415 boolOpsDropdown: { 42416 ...zI, 42417 booleanOperation: "è·¯å¾è¿ç®", 42418 primaryObject: "主对象", 42419 backmost: "æåºå±å¯¹è±¡", 42420 frontmost: "æé¡¶å±å¯¹è±¡", 42421 lastSelected: "æåéæ©ç对象", 42422 firstSelected: "æå éæ©ç对象", 42423 keepOriginal: "ä¿çå对象" 42424 }, 42425 snapAlignDropdown: { 42426 useSnapAlign: "å¯ç¨å¸é", 42427 snapToGrid: "å¸éå°ç½æ ¼", 42428 snapToObjects: "å¸éå°å¯¹è±¡", 42429 snapToNodes: "å¸éå°èç¹", 42430 showGuides: "æ¾ç¤ºåè线" 42431 }, 42432 transformEditor: { 42433 transform: "忢", 42434 width: "宽度", 42435 height: "é«åº¦", 42436 rotate: "æè½¬", 42437 skewX: "徿", 42438 rotateLeft90: "åå·¦æè½¬ 90°", 42439 rotateRight90: "åå³æè½¬ 90°" 42440 }, 42441 accept: "æ¥å", 42442 decline: "æç»", 42443 language: "è¯è¨", 42444 color: "é¢è²", 42445 globalColor: "å ¨å±é¢è²", 42446 linearGradient: "çº¿æ§æ¸å", 42447 radialGradient: "å¾åæ¸å", 42448 pattern: "徿¡", 42449 noColor: "æ é¢è²", 42450 noPaint: "æ å¡«å ", 42451 fillPaint: "å¡«å ", 42452 strokePaint: "æè¾¹", 42453 opacity: "ä¸éæåº¦", 42454 blur: "模ç³", 42455 blendMode: "æ··åæ¨¡å¼", 42456 objects: "对象", 42457 grid: "ç½æ ¼", 42458 file: "æä»¶", 42459 save: "ä¿å", 42460 download: "ä¸è½½", 42461 close: "å ³é", 42462 cancel: "åæ¶", 42463 ok: "ç¡®å®", 42464 create: "å建", 42465 apply: "åºç¨", 42466 moreOptions: "æ´å¤é项", 42467 noObjects: "没æå¯¹è±¡", 42468 showObjectTree: "æ¾ç¤ºå¯¹è±¡å±çº§", 42469 toggleSelectionDetails: "åæ¢éæ©è¯¦æ ", 42470 zoom: "缩æ¾", 42471 blendModes: { 42472 ...b7, 42473 normal: "æ£å¸¸", 42474 multiply: "æ£çå åº", 42475 screen: "滤è²", 42476 overlay: "å å ", 42477 darken: "åæ", 42478 lighten: "å亮", 42479 colorDodge: "é¢è²åæ·¡", 42480 colorBurn: "é¢è²å æ·±", 42481 hardLight: "强å ", 42482 "soft-light": "æå ", 42483 difference: "å·®å¼", 42484 exclusion: "æé¤", 42485 hue: "è²ç¸", 42486 saturation: "饱å度", 42487 color: "é¢è²", 42488 luminosity: "æåº¦" 42489 }, 42490 privacySettings: { 42491 ...S7, 42492 privacySettings: "éç§è®¾ç½®", 42493 allowGoogleFonts: { 42494 ...S7.allowGoogleFonts, 42495 title: "ä½¿ç¨ Google Fonts" 42496 }, 42497 allowSaveState: { 42498 ...S7.allowSaveState, 42499 title: "ä¿ååºç¨ç¶æ" 42500 } 42501 } 42502} 42503 , wL = ["de", "en", "zh"]
42504 , PL = navigator.languages 42505 , xL = PL.map(l=>l.split("-")[0]).find(l=>wL.includes(l)) ?? "en" 42506 , Gr = k5({ 42507 locale: xL, 42508 fallbackLocale: "en", 42509 messages: { 42510 en: w7, 42511 de: SL, 42512 zh: zhMessages 42513 } 42514}); 42515class Eg extends Xo { 42516 locale; 42517 constructor(e) { 42518 super("locale", !1, Gr.global.locale.value === e), 42519 this.locale = e, 42520 Ie(()=>Gr.global.locale.value, t=>this.selected = t === this.locale) 42521 } 42522 performAction() { 42523 CL(this.locale) 42524 } 42525} 42526function CL(l) { 42527 V().appSettings.general.language = l 42528} 42529const _L = { 42530 name: "HyMenuBarItem", 42531 components: { 42532 SvgIcon: gt, 42533 HyMenu: Ff 42534 }, 42535 props: { 42536 name: String, 42537 iconSvg: String, 42538 selected: Boolean, 42539 index: Number, 42540 itemDatas: Array, 42541 isTopMenu: Boolean 42542 }, 42543 data() { 42544 return { 42545 isOpen: !1, 42546 selIndex: -1 42547 } 42548 }, 42549 computed: { 42550 label() { 42551 return this.name && this.$t("menus." + this.name + ".label", null) 42552 }, 42553 mnemonic() { 42554 return this.name && this.$t("menus." + this.name + ".mnemonic", null) 42555 }, 42556 mnemonicCharIndex() { 42557 let l = this.mnemonic 42558 , e = this.label; 42559 return l && e ? e.toLowerCase().indexOf(l.toLowerCase()) : -1 42560 }, 42561 labelStart() { 42562 let l = this.label || "" 42563 , e = this.mnemonicCharIndex; 42564 return e > 0 ? l.substring(0, e) : "" 42565 }, 42566 labelEnd() { 42567 let l = this.label || "" 42568 , e = this.mnemonicCharIndex; 42569 return e >= 0 ? l.substring(e + 1) : l 42570 }, 42571 labelMnemonic() { 42572 let l = this.label || "" 42573 , e = this.mnemonicCharIndex; 42574 return e >= 0 ? l.charAt(e) : "" 42575 } 42576 }, 42577 emits: ["actionPerformed", "open", "close"], 42578 watch: { 42579 selected(l) { 42580 l || (this.isOpen = !1) 42581 } 42582 }, 42583 methods: { 42584 onActionPerformed(l) { 42585 this.close(), 42586 this.$emit("actionPerformed", l) 42587 }, 42588 open() { 42589 (this.itemDatas ? this.itemDatas.length : 0) > 0 && !this.isOpen && (this.selIndex = -1, 42590 this.isOpen = !0, 42591 this.$emit("open", this)) 42592 }, 42593 close() { 42594 this.isOpen && (this.isOpen = !1, 42595 this.$emit("close", this)) 42596 } 42597 } 42598} 42599 , TL = { 42600 class: "hy-menu-mnemonic" 42601}; 42602function kL(l, e, t, n, s, o) { 42603 const i = E("svg-icon") 42604 , r = E("hy-menu"); 42605 return N(), 42606 $("div", { 42607 ref: "menuBarItem", 42608 class: Ne(["hy-menu-bar-item", { 42609 "hy-menu-bar-item-open": s.isOpen, 42610 "hy-selected": t.selected 42611 }]), 42612 "aria-haspopup": "menu" 42613 }, [t.iconSvg ? (N(), 42614 pe(i, { 42615 key: 0, 42616 svg: t.iconSvg 42617 }, null, 8, ["svg"])) : be("", !0), o.labelStart || o.labelEnd ? (N(), 42618 $(Pe, { 42619 key: 1 42620 }, [_("span", null, se(o.labelStart), 1), _("span", TL, se(o.labelMnemonic), 1), _("span", null, se(o.labelEnd), 1)], 64)) : be("", !0), w(r, { 42621 isOpen: s.isOpen, 42622 itemDatas: t.itemDatas, 42623 onClose: o.close, 42624 onActionPerformed: o.onActionPerformed, 42625 "is-iconless": t.isTopMenu, 42626 getSource: ()=>l.$refs.menuBarItem, 42627 menuContentStyle: { 42628 minWidth: t.isTopMenu ? "160px" : "280px" 42629 } 42630 }, null, 8, ["isOpen", "itemDatas", "onClose", "onActionPerformed", "is-iconless", "getSource", "menuContentStyle"])], 2) 42631} 42632const EL = ie(_L, [["render", kL]]) 42633 , DL = { 42634 name: "HyMenuBar", 42635 components: { 42636 HyMenuBarItem: EL 42637 }, 42638 props: { 42639 collapsed: Boolean, 42640 menuDatas: Array 42641 }, 42642 data() { 42643 return { 42644 selIndex: -1, 42645 isActive: !1, 42646 isFocused: !1, 42647 renderedMenuDatas: null 42648 } 42649 }, 42650 mounted() { 42651 document.addEventListener("keydown", this.onKeydown), 42652 document.addEventListener("keyup", this.onKeyup) 42653 }, 42654 unmounted() { 42655 document.removeEventListener("keydown", this.onKeydown), 42656 document.removeEventListener("keyup", this.onKeyup) 42657 }, 42658 methods: { 42659 onItemPointerenter(l, e) { 42660 l.pointerType === "mouse" && this.selIndex !== e && this.isFocused && this.setSelected(e) 42661 }, 42662 onItemPointerleave(l) { 42663 !this.isFocused && this.selIndex === l && !this.$refs.menuBarItems[l].isOpen && this.setSelected(-1) 42664 }, 42665 onItemPointerdown(l, e) { 42666 if (l.button !== 0) 42667 return; 42668 let t = this.$refs.menuBarItems[e]; 42669 t.isOpen ? t.close() : (this.setSelected(e), 42670 t.open()) 42671 }, 42672 onBlur() { 42673 this.setSelected(-1), 42674 this.isFocused = !1 42675 }, 42676 onFocus() { 42677 this.isFocused = !0; 42678 let l = this.$refs.menuBarItems.findIndex(e=>e.$el.matches(":hover")); 42679 l < 0 && (l = 0), 42680 this.setSelected(l) 42681 }, 42682 onKeydown(l) { 42683 if (!l.defaultPrevented && !(l.altKey && !l.repeat)) { 42684 if (document.activeElement === this.$refs.menuBar) { 42685 let e = l.key 42686 , t = this.selIndex; 42687 if (e === "ArrowLeft") 42688 t >= 0 && this.setSelected(t === 0 ? this.renderedMenuDatas.length - 1 : t - 1); 42689 else if (e === "ArrowRight") 42690 t >= 0 && this.setSelected(t === this.renderedMenuDatas.length - 1 ? 0 : t + 1); 42691 else if (e === " " || e === "Enter" || e === "ArrowDown") { 42692 if (t >= 0) { 42693 let n = this.$refs.menuBarItems[t]; 42694 n.isOpen || n.open() 42695 } 42696 } else 42697 e === "Escape" && t >= 0 && this.$refs.menuBarItems[t].close() 42698 } 42699 } 42700 }, 42701 onKeyup(l) { 42702 l.key === "Alt" && !l.repeat && (this.isActive = !1) 42703 }, 42704 setSelected(l) { 42705 let e = this.$refs.menuBarItems[this.selIndex] 42706 , t = this.$refs.menuBarItems[l]; 42707 this.selIndex = l, 42708 e && t && e.isOpen && t.open() 42709 } 42710 }, 42711 watch: { 42712 collapsed: { 42713 handler(l) { 42714 l ? this.renderedMenuDatas = [{ 42715 iconSvg: '<svg viewBox="0 0 16 16" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2"><path d="M2 3h12m0 5h-12m0 5h12"/></svg>', 42716 itemDatas: this.menuDatas 42717 }] : this.renderedMenuDatas = this.menuDatas.slice() 42718 }, 42719 immediate: !0 42720 } 42721 } 42722}; 42723function OL(l, e, t, n, s, o) { 42724 const i = E("hy-menu-bar-item"); 42725 return N(), 42726 $("div", { 42727 ref: "menuBar", 42728 class: Ne(["hy-menu-bar", { 42729 active: s.isActive 42730 }]), 42731 onBlur: e[0] || (e[0] = (...r)=>o.onBlur && o.onBlur(...r)), 42732 onFocus: e[1] || (e[1] = (...r)=>o.onFocus && o.onFocus(...r)), 42733 tabIndex: "0" 42734 }, [(N(!0), 42735 $(Pe, null, Gt(s.renderedMenuDatas, (r,a)=>(N(), 42736 pe(i, { 42737 ref_for: !0, 42738 ref: "menuBarItems", 42739 key: a, 42740 index: a, 42741 name: r.name, 42742 "icon-svg": r.iconSvg, 42743 itemDatas: r.itemDatas, 42744 selected: s.selIndex === a, 42745 "is-top-menu": t.collapsed, 42746 onPointerenter: d=>o.onItemPointerenter(d, a), 42747 onPointerleave: d=>o.onItemPointerleave(a), 42748 onPointercancel: d=>o.onItemPointerleave(a), 42749 onPointerdown: d=>o.onItemPointerdown(d, a) 42750 }, null, 8, ["index", "name", "icon-svg", "itemDatas", "selected", "is-top-menu", "onPointerenter", "onPointerleave", "onPointercancel", "onPointerdown"]))), 128))], 34) 42751} 42752const AL = ie(DL, [["render", OL]]); 42753class IL extends Ce { 42754 url; 42755 constructor(e) { 42756 super("openUrl"), 42757 this.url = e 42758 } 42759 performAction() { 42760 window.open(this.url, "_blank").focus() 42761 } 42762} 42763const LL = { 42764 name: "MainMenu", 42765 components: { 42766 HyMenuBar: AL 42767 }, 42768 props: { 42769 collapsed: Boolean 42770 }, 42771 data() { 42772 return { 42773 menuDatas: me([{ 42774 name: "file", 42775 itemDatas: [{ 42776 actionName: "newDocument" 42777 }, {
42778 actionName: "openFile" 42779 }, { 42780 actionName: "saveFileAs" 42781 }, { 42782 actionName: "print" 42783 }, "-", { 42784 actionName: "docProperties" 42785 }, { 42786 actionName: "settings" 42787 }] 42788 }, { 42789 name: "edit", 42790 itemDatas: [{ 42791 actionName: "undo" 42792 }, { 42793 actionName: "redo" 42794 }, "-", { 42795 actionName: "cut" 42796 }, { 42797 actionName: "copy" 42798 }, { 42799 actionName: "paste" 42800 }, "-", { 42801 actionName: "pasteAsNew" 42802 }, "-", { 42803 actionName: "selectAll" 42804 }, { 42805 actionName: "selectNone" 42806 }, { 42807 actionName: "deleteSelection" 42808 }] 42809 }, { 42810 name: "object", 42811 itemDatas: [{ 42812 actionName: "duplicate" 42813 }, "-", { 42814 actionName: "group" 42815 }, { 42816 actionName: "ungroup" 42817 }, "-", { 42818 actionName: "toPath" 42819 }, { 42820 actionName: "strokeToPath" 42821 }, { 42822 actionName: "toClippath" 42823 }, { 42824 actionName: "separatePaths" 42825 }, { 42826 actionName: "combinePaths" 42827 }] 42828 }, { 42829 name: "view", 42830 itemDatas: [{ 42831 actionName: "toggleRulers" 42832 }, { 42833 actionName: "toggleTooltips" 42834 }, { 42835 actionName: "toggleDarkMode" 42836 }, { 42837 actionName: "accentColor" 42838 }, { 42839 actionName: "fullscreen" 42840 }] 42841 }, { 42842 name: "help", 42843 itemDatas: [{ 42844 label: "language", 42845 itemDatas: [{ 42846 label: "locales.en", 42847 actionObj: new Eg("en") 42848 }, { 42849 label: "locales.de", 42850 actionObj: new Eg("de") 42851 }, { 42852 label: "locales.zh", 42853 actionObj: new Eg("zh") 42854 }] 42855 }, An && { 42856 actionName: "showConsole" 42857 }, { 42858 actionName: "showLicenses" 42859 }, { 42860 label: "actions.reportIssue", 42861 labelAffixHtml: '<svg width="16" height="16" viewBox="0 0 20 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M9 3h-5v11h11v-5M7 11l9-9M11 2h5v5"/></svg>', 42862 actionObj: new IL("https://www.pic.net") 42863 }, { 42864 actionName: "showAbout" 42865 }] 42866 }]) 42867 } 42868 } 42869}; 42870function VL(l, e, t, n, s, o) { 42871 const i = E("hy-menu-bar"); 42872 return N(), 42873 pe(i, { 42874 menuDatas: s.menuDatas, 42875 collapsed: t.collapsed 42876 }, null, 8, ["menuDatas", "collapsed"]) 42877} 42878const NL = ie(LL, [["render", VL]]) 42879 , RL = { 42880 name: "ZoomDropdown", 42881 components: { 42882 ActionButton: Ii, 42883 HyTooltip: pt, 42884 HyButton: nt, 42885 HyGroup: Dt, 42886 HyDropdown: xl, 42887 DimInput: ms 42888 }, 42889 data() { 42890 return { 42891 zoomToDocument: fv, 42892 zoomToSelection: pv, 42893 centerDocument: hv, 42894 centerSelection: cv 42895 } 42896 }, 42897 computed: { 42898 zoom: { 42899 get() { 42900 return Math.round(this.$store.zoom) 42901 }, 42902 set(l) { 42903 l = Math.round(l), 42904 this.$editorComponent.zoomTo(l) 42905 } 42906 } 42907 }, 42908 methods: { 42909 incrementZoom() { 42910 this.$editorComponent.zoomStep(-.5) 42911 }, 42912 decrementZoom() { 42913 this.$editorComponent.zoomStep(.5) 42914 }, 42915 close() { 42916 this.$refs.zoomDropdown.close() 42917 } 42918 } 42919} 42920 , FL = { 42921 class: "dropdown-content" 42922} 42923 , BL = { 42924 class: "zoom-input", 42925 style: { 42926 display: "flex", 42927 "align-items": "center", 42928 gap: "8px" 42929 } 42930}; 42931function zL(l, e, t, n, s, o) { 42932 const i = E("dim-input") 42933 , r = E("hy-button") 42934 , a = E("action-button") 42935 , d = E("hy-dropdown") 42936 , u = E("hy-tooltip") 42937 , h = E("hy-group"); 42938 return N(), 42939 pe(h, { 42940 ref: "group", 42941 class: "zoom-editor" 42942 }, {
42943 default: O(()=>[w(i, { 42944 modelValue: o.zoom, 42945 "onUpdate:modelValue": e[0] || (e[0] = c=>o.zoom = c), 42946 min: 2, 42947 max: 9600, 42948 unit: "%", 42949 style: { 42950 width: "60px", 42951 border: "none", 42952 "text-align": "right", 42953 background: "none" 42954 } 42955 }, null, 8, ["modelValue"]), w(d, { 42956 ref: "zoomDropdown", 42957 style: { 42958 padding: "0 6px" 42959 }, 42960 class: "hy-toolbar-element" 42961 }, { 42962 default: O(()=>[_("div", FL, [_("div", BL, [w(r, { 42963 class: "button", 42964 onClick: o.decrementZoom 42965 }, { 42966 default: O(()=>[...e[3] || (e[3] = [ve("-", -1)])]), 42967 _: 1 42968 }, 8, ["onClick"]), w(i, { 42969 class: "input", 42970 modelValue: o.zoom, 42971 "onUpdate:modelValue": e[1] || (e[1] = c=>o.zoom = c), 42972 unit: "%" 42973 }, null, 8, ["modelValue"]), w(r, { 42974 class: "button", 42975 onClick: e[2] || (e[2] = c=>o.incrementZoom()) 42976 }, { 42977 default: O(()=>[...e[4] || (e[4] = [ve("+", -1)])]), 42978 _: 1 42979 })]), w(a, { 42980 action: s.zoomToDocument, 42981 class: "menu-button", 42982 onClicked: o.close 42983 }, null, 8, ["action", "onClicked"]), w(a, { 42984 action: s.centerDocument, 42985 class: "menu-button", 42986 onClicked: o.close 42987 }, null, 8, ["action", "onClicked"]), w(a, { 42988 action: s.zoomToSelection, 42989 class: "menu-button", 42990 onClicked: o.close 42991 }, null, 8, ["action", "onClicked"]), w(a, { 42992 action: s.centerSelection, 42993 class: "menu-button", 42994 onClicked: o.close 42995 }, null, 8, ["action", "onClicked"])])]), 42996 _: 1 42997 }, 512), w(u, { 42998 getTarget: ()=>l.$refs.group, 42999 label: l.$t("zoom") 43000 }, null, 8, ["getTarget", "label"])]), 43001 _: 1 43002 }, 512) 43003} 43004const UL = ie(RL, [["render", zL], ["__scopeId", "data-v-88c9756a"]]) 43005 , GL = { 43006 name: "GridAlignSettings", 43007 components: { 43008 HySwitch: nv, 43009 HyLabel: Bn, 43010 HyTooltip: pt, 43011 SvgIcon: gt, 43012 HyGroup: Dt, 43013 HyDropdown: xl, 43014 HyCheckbox: ml, 43015 HyInputNumber: Lt 43016 }, 43017 data() { 43018 return { 43019 gridSettings: {}, 43020 alignSettings: {}, 43021 svgs: me({ 43022 gridSvg: Ux, 43023 alignSvg: Gx 43024 }) 43025 } 43026 }, 43027 computed: { 43028 editorSettings() {
43029 return this.$store.appSettings.editor 43030 }, 43031 gridEnabled: { 43032 get() { 43033 return this.gridSettings.show 43034 }, 43035 set(l) { 43036 this.gridSettings.show = l 43037 } 43038 }, 43039 alignEnabled: { 43040 get() { 43041 return this.alignSettings.enabled 43042 }, 43043 set(l) { 43044 this.alignSettings.enabled = l 43045 } 43046 } 43047 }, 43048 methods: { 43049 parseSize(l) { 43050 return l.replace(/[^0-9]/g, "") || "0" 43051 }, 43052 formatSize(l) { 43053 return l + "px" 43054 }, 43055 onDropdownOpen() { 43056 this.gridSettings = this.editorSettings.grid, 43057 this.alignSettings = this.editorSettings.alignment, 43058 this.originalGridSettings = Object.assign({}, this.editorSettings.grid), 43059 this.originalAlignSettings = Object.assign({}, this.editorSettings.alignment) 43060 }, 43061 onDropdownCancel() { 43062 Object.assign(this.editorSettings.grid, this.originalGridSettings), 43063 Object.assign(this.editorSettings.alignment, this.originalAlignSettings) 43064 } 43065 }, 43066 watch: { 43067 gridSettings: { 43068 handler() { 43069 j().updateGrid() 43070 }, 43071 deep: !0 43072 } 43073 } 43074} 43075 , HL = { 43076 style: { 43077 display: "flex", 43078 "flex-direction": "column", 43079 gap: "32px", 43080 padding: "32px 24px 32px 32px" 43081 } 43082} 43083 , $L = { 43084 style: { 43085 display: "flex", 43086 "flex-direction": "column", 43087 gap: "16px", 43088 "align-items": "flex-start" 43089 } 43090} 43091 , XL = { 43092 style: { 43093 display: "grid", 43094 "grid-template-columns": "1fr 60px", 43095 "align-items": "center", 43096 gap: "8px 16px", 43097 "margin-left": "16px" 43098 } 43099} 43100 , YL = { 43101 style: { 43102 display: "flex", 43103 "flex-direction": "column", 43104 gap: "24px" 43105 } 43106} 43107 , KL = { 43108 style: { 43109 display: "flex", 43110 "flex-direction": "column", 43111 gap: "16px", 43112 "margin-left": "16px" 43113 } 43114}; 43115function WL(l, e, t, n, s, o) { 43116 const i = E("svg-icon") 43117 , r = E("hy-tooltip") 43118 , a = E("hy-checkbox") 43119 , d = E("hy-switch") 43120 , u = E("hy-label") 43121 , h = E("hy-input-number") 43122 , c = E("hy-dropdown") 43123 , f = E("hy-group"); 43124 return N(), 43125 $("div", null, [w(f, { 43126 style: { 43127 "margin-left": "auto" 43128 } 43129 }, { 43130 default: O(()=>[w(a, { 43131 type: "button", 43132 ref: "gridButton", 43133 modelValue: o.editorSettings.grid.show, 43134 "onUpdate:modelValue": e[0] || (e[0] = p=>o.editorSettings.grid.show = p), 43135 class: "hy-toolbar-element", 43136 style: { 43137 padding: "8px 8px" 43138 } 43139 }, { 43140 default: O(()=>[w(i, { 43141 svg: s.svgs.gridSvg 43142 }, null, 8, ["svg"]), w(r, { 43143 getTarget: ()=>l.$refs.gridButton, 43144 label: l.$t("grid") 43145 }, null, 8, ["getTarget", "label"])]), 43146 _: 1 43147 }, 8, ["modelValue"]), w(a, { 43148 type: "button", 43149 ref: "alignmentButton", 43150 modelValue: o.editorSettings.alignment.enabled, 43151 "onUpdate:modelValue": e[1] || (e[1] = p=>o.editorSettings.alignment.enabled = p), 43152 class: "hy-toolbar-element", 43153 style: { 43154 padding: "8px 8px" 43155 } 43156 }, { 43157 default: O(()=>[w(i, { 43158 svg: s.svgs.alignSvg 43159 }, null, 8, ["svg"]), w(r, { 43160 getTarget: ()=>l.$refs.alignmentButton, 43161 label: l.$t("actions.align") 43162 }, null, 8, ["getTarget", "label"])]), 43163 _: 1 43164 }, 8, ["modelValue"]), w(c, { 43165 style: { 43166 padding: "0 6px" 43167 }, 43168 class: "hy-toolbar-element", 43169 onOpen: o.onDropdownOpen, 43170 onCancel: o.onDropdownCancel 43171 }, { 43172 default: O(()=>[_("div", HL, [_("div", $L, [w(u, { 43173 label: l.$t("gridDropdown.showGrid"), 43174 style: { 43175 width: "100%", 43176 "justify-content": "space-between", 43177 gap: "32px" 43178 } 43179 }, { 43180 default: O(()=>[w(d, { 43181 modelValue: o.editorSettings.grid.show, 43182 "onUpdate:modelValue": e[2] || (e[2] = p=>o.editorSettings.grid.show = p) 43183 }, null, 8, ["modelValue"])]), 43184 _: 1 43185 }, 8, ["label"]), _("div", XL, [w(u, { 43186 disabled: !o.gridEnabled, 43187 label: l.$t("gridDropdown.width") 43188 }, null, 8, ["disabled", "label"]), w(h, { 43189 modelValue: s.gridSettings.gridX, 43190 "onUpdate:modelValue": e[3] || (e[3] = p=>
43190s.gridSettings.gridX = p), 43191 min: 0, 43192 max: 4096, 43193 formatter: o.formatSize, 43194 parser: o.parseSize, 43195 class: "dimension-input", 43196 disabled: !o.gridEnabled 43197 }, null, 8, ["modelValue", "formatter", "parser", "disabled"]), w(u, { 43198 disabled: !o.gridEnabled, 43199 label: l.$t("gridDropdown.height") 43200 }, null, 8, ["disabled", "label"]), w(h, { 43201 modelValue: s.gridSettings.gridY, 43202 "onUpdate:modelValue": e[4] || (e[4] = p=>s.gridSettings.gridY = p), 43203 min: 0, 43204 max: 4096, 43205 formatter: o.formatSize, 43206 parser: o.parseSize, 43207 class: "dimension-input", 43208 disabled: !o.gridEnabled 43209 }, null, 8, ["modelValue", "formatter", "parser", "disabled"])])]), _("div", YL, [w(u, { 43210 label: l.$t("snapAlignDropdown.useSnapAlign"), 43211 style: { 43212 width: "100%", 43213 "justify-content": "space-between", 43214 gap: "32px" 43215 } 43216 }, { 43217 default: O(()=>[w(d, { 43218 modelValue: o.alignEnabled, 43219 "onUpdate:modelValue": e[5] || (e[5] = p=>o.alignEnabled = p) 43220 }, null, 8, ["modelValue"])]), 43221 _: 1 43222 }, 8, ["label"]), _("div", KL, [w(a, { 43223 modelValue: s.alignSettings.toGrid, 43224 "onUpdate:modelValue": e[6] || (e[6] = p=>s.alignSettings.toGrid = p), 43225 disabled: !o.alignEnabled, 43226 label: l.$t("snapAlignDropdown.snapToGrid") 43227 }, null, 8, ["modelValue", "disabled", "label"]), w(a, { 43228 modelValue: s.alignSettings.toElements, 43229 "onUpdate:modelValue": e[7] || (e[7] = p=>s.alignSettings.toElements = p), 43230 disabled: !o.alignEnabled, 43231 label: l.$t("snapAlignDropdown.snapToObjects") 43232 }, null, 8, ["modelValue", "disabled", "label"]), w(a, { 43233 modelValue: s.alignSettings.toNodes, 43234 "onUpdate:modelValue": e[8] || (e[8] = p=>s.alignSettings.toNodes = p), 43235 disabled: !o.alignEnabled, 43236 label: l.$t("snapAlignDropdown.snapToNodes") 43237 }, null, 8, ["modelValue", "disabled", "label"]), w(a, { 43238 modelValue: s.alignSettings.showGuides, 43239 "onUpdate:modelValue": e[9] || (e[9] = p=>s.alignSettings.showGuides = p), 43240 disabled: !o.alignEnabled, 43241 label: l.$t("snapAlignDropdown.showGuides"), 43242 style: { 43243 "margin-top": "8px" 43244 } 43245 }, null, 8, ["modelValue", "disabled", "label"])])])])]), 43246 _: 1 43247 }, 8, ["onOpen", "onCancel"])]), 43248 _: 1 43249 })]) 43250} 43251const qL = ie(GL, [["render", WL]]) 43252 , jL = { 43253 name: "TopBar", 43254 components: { 43255 GridAlignSettings: qL, 43256 ActionButton: Ii, 43257 ZoomDropdown: UL, 43258 MainMenu: NL 43259 }, 43260 data() { 43261 return { 43262 width: 0, 43263 isSmallWidth: !1, 43264 undoAction: gv, 43265 redoAction: mv, 43266 svgs: me({ 43267 undoSvg: k2, 43268 redoSvg: E2 43269 }) 43270 } 43271 }, 43272 mounted() { 43273 const l = new ResizeObserver(()=>{ 43274 let e = this.$refs.topBar; 43275 e && (this.width = e.clientWidth, 43276 this.isSmallWidth = this.$refs.topBar.clientWidth <= 780) 43277 } 43278 ); 43279 l.observe(this.$refs.topBar, { 43280 box: "border-box" 43281 }), 43282 this.resizeObserver = l 43283 }, 43284 beforeUnmount() { 43285 this.resizeObserver.disconnect() 43286 } 43287} 43288 , JL = { 43289 class: "settings-panel" 43290} 43291 , picNetLogoLinkProps = { 43292 class: "brand-logo-link", 43293 href: "https://www.pic.net/", 43294 target: "_blank", 43295 rel: "noopener noreferrer", 43296 title: "PIC.NET" 43297} 43298 , picNetLogoImageProps = { 43299 class: "brand-logo", 43300 src: "https://www.pic.net/collage/logo.svg", 43301 alt: "PIC.NET" 43302} 43303 , ZL = { 43304 style: { 43305 display: "flex", 43306 "justify-content": "flex-end", 43307 gap: "8px", 43308 flex: "1 0 auto" 43309 } 43310}; 43311function QL(l, e, t, n, s, o) { 43312 const i = E("main-menu") 43313 , r = E("action-button") 43314 , a = E("hy-group") 43315 , d = E("zoom-dropdown") 43316 , u = E("grid-align-settings"); 43317 return N(), 43318 $("div", { 43319 ref: "topBar", 43320 class: Ne(["top-bar", { 43321 "small-top-bar": s.isSmallWidth 43322 }]) 43323 }, [_("a", picNetLogoLinkProps, [_("img", picNetLogoImageProps)]), w(i, { 43324 collapsed: s.isSmallWidth 43325 }, null, 8, ["collapsed"]), _("div", JL, [w(a, null, { 43326 default: O(()=>[w(r, { 43327 action: s.undoAction, 43328 "icon-svg": s.svgs.undoSvg, 43329 class: "hy-toolbar-element" 43330 }, null, 8, ["action", "icon-svg"]), w(r, { 43331 action: s.redoAction, 43332 "icon-svg": s.svgs.redoSvg, 43333 class: "hy-toolbar-element" 43334 }, null, 8, ["action", "icon-svg"])]), 43335 _: 1 43336 }), _("div", ZL, [s.width >= 420 ? (N(), 43337 pe(d, { 43338 key: 0 43339 })) : be("", !0), w(u)]), vt(l.$slots, "default", {}, void 0, !0)])], 2) 43340} 43341const eV = ie(jL, [["render", QL], ["__scopeId", "data-v-df099bde"]]) 43342 , tV = { 43343 name: "PrivacyBanner", 43344 components: {
43345 HyPopover: Ql, 43346 PrivacySettingsItem: sv 43347 }, 43348 data() { 43349 return { 43350 show: !1, 43351 selItemName: null 43352 } 43353 }, 43354 methods: { 43355 onClick() { 43356 localStorage.setItem("cookieSeen", "shown"), 43357 this.show = !1 43358 } 43359 }, 43360 computed: { 43361 privacySettings: { 43362 get() { 43363 return V().appSettings.privacy 43364 } 43365 } 43366 }, 43367 mounted() { 43368 console.log(Oe(this.privacySettings)), 43369 this.$isDevelopment 43370 } 43371} 43372 , lV = { 43373 class: "container" 43374} 43375 , nV = { 43376 class: "header" 43377} 43378 , sV = { 43379 class: "items-list" 43380}; 43381function oV(l, e, t, n, s, o) { 43382 const i = E("privacy-settings-item") 43383 , r = E("hy-button") 43384 , a = E("hy-popover"); 43385 return N(), 43386 pe(a, { 43387 show: s.show, 43388 style: { 43389 "max-width": "90vw", 43390 "max-height": "90vh", 43391 width: "480px", 43392 height: "640px" 43393 }, 43394 "use-backdrop": "", 43395 "backdrop-style": "background: rgb(0 0 0 / 0.2);" 43396 }, { 43397 default: O(()=>[_("div", lV, [_("div", nV, se(l.$t("privacySettings.privacySettings")), 1), _("div", sV, [(N(!0), 43398 $(Pe, null, Gt(o.privacySettings, (d,u)=>(N(), 43399 pe(i, { 43400 key: u, 43401 name: u, 43402 selName: s.selItemName, 43403 onSelected: e[0] || (e[0] = h=>s.selItemName = h) 43404 }, null, 8, ["name", "selName"]))), 128))]), w(r, { 43405 onClick: o.onClick, 43406 primary: !0, 43407 class: "button" 43408 }, { 43409 default: O(()=>[...e[1] || (e[1] = [ve("Akzeptieren", -1)])]), 43410 _: 1 43411 }, 8, ["onClick"])])]), 43412 _: 1 43413 }, 8, ["show"]) 43414} 43415const iV = ie(tV, [["render", oV], ["__scopeId", "data-v-b87b1a3c"]]) 43416 , Hr = new Map 43417 , xd = new Map; 43418let rh = null; 43419function Fv(l, e, t=0) { 43420 if (!Hr.has(l)) 43421 if (Xf(l), 43422 t === 0) 43423 Hr.set(l, e), 43424 Bv(); 43425 else { 43426 let n = setTimeout(()=>{ 43427 xd.delete(l), 43428 Fv(l, e, 0) 43429 } 43430 , t); 43431 xd.set(l, n) 43432 } 43433} 43434function Xf(l) { 43435 Hr.delete(l); 43436 let e = xd.get(l); 43437 e && (clearTimeout(e), 43438 xd.delete(l)) 43439} 43440function Bv() { 43441 Hr.size === 0 || rh != null || (rh = requestAnimationFrame(async()=>{ 43442 rh = null; 43443 const l = 10 43444 , e = performance.now(); 43445 let t = e, n = Hr.entries(), s; 43446 for (; (s = n.next()) && s.value && t - e < l; ) { 43447 let o = s.value[0] 43448 , i = s.value[1]; 43449 Xf(o), 43450 await rV(o, i), 43451 t = performance.now() 43452 } 43453 Bv() 43454 } 43455 )) 43456} 43457async function rV(l, e) { 43458 let t = l.getDocumentModel(); 43459 if (t == null || t === l) 43460 return ""; 43461 let n = l.getTransformedStrokeBounds(); 43462 if (n == null) 43463 return ""; 43464 let s = Math.max(n.width, n.height, 1) * .06 43465 , o = { 43466 x: n.x - s, 43467 y: n.y - s, 43468 width: n.width + 2 * s, 43469 height: n.height + 2 * s 43470 } 43471 , i = l.baseElement 43472 , r = l.getDefsModels() 43473 , a = ""; 43474 r.size > 0 && (a = "<defs>", 43475 r.forEach(d=>a += tp(d.baseElement.outerHTML)), 43476 a += "</defs>"); 43477 let d = '<svg xmlns="http://www.w3.org/2000/svg" width="' + e.width + '" height="' + e.height + '" viewBox="' + o.x + " " + o.y + " " + o.width + " " + o.height + '" fill="transparent">' + a + tp(i.outerHTML) + "</svg>"; 43478 await Wd(d, e) 43479} 43480let Dg; 43481(function(l) { 43482 let e = (function() { 43483 function n() { 43484 this._dropEffect = "move", 43485 this._effectAllowed = "all", 43486 this._data = {} 43487 } 43488 return Object.defineProperty(n.prototype, "dropEffect", { 43489 get: function() { 43490 return this._dropEffect 43491 }, 43492 set: function(s) { 43493 this._dropEffect = s 43494 }, 43495 enumerable: !0, 43496 configurable: !0 43497 }), 43498 Object.defineProperty(n.prototype, "effectAllowed", { 43499 get: function() { 43500 return this._effectAllowed 43501 }, 43502 set: function(s) { 43503 this._effectAllowed = s 43504 }, 43505 enumerable: !0, 43506 configurable: !0 43507 }), 43508 Object.defineProperty(n.prototype, "types", { 43509 get: function() { 43510 return Object.keys(this._data) 43511 }, 43512 enumerable: !0, 43513 configurable: !0 43514 }), 43515 n.prototype.clearData = function(s) { 43516 s !== null ? delete this._data[s.toLowerCase()] : this._data = {} 43517 } 43518 , 43519 n.prototype.getData = function(s) { 43520 let o = s.toLowerCase() 43521 , i = this._data[o]; 43522 return o === "text" && i == null && (i = this._data["text/plain"]), 43523 i || "" 43524 } 43525 , 43526 n.prototype.setData = function(s, o) { 43527 this._data[s.toLowerCase()] = o 43528 } 43529 , 43530 n.prototype.setDragImage = function(s, o, i) { 43531 let r = t._instance; 43532 r._imgCustom = s, 43533 r._imgOffset = { 43534 x: o, 43535 y: i 43536 } 43537 } 43538 , 43539 n 43540 } 43541 )(); 43542 l.DataTransfer = e; 43543 let t = (function() { 43544 function n() { 43545 if (this._lastClick = 0, 43546 n._instance) 43547 throw "DragDropTouch instance already created."; 43548 let s = !1; 43549 if (document.addEventListener("test", function() {}, {
43550 get passive() { 43551 return s = !0, 43552 !0 43553 } 43554 }), 43555 navigator.maxTouchPoints) { 43556 let o = document 43557 , i = this._touchstart.bind(this) 43558 , r = this._touchmove.bind(this) 43559 , a = this._touchend.bind(this) 43560 , d = s ? { 43561 passive: !1, 43562 capture: !1 43563 } : !1; 43564 o.addEventListener("touchstart", i, d), 43565 o.addEventListener("touchmove", r, d), 43566 o.addEventListener("touchend", a), 43567 o.addEventListener("touchcancel", a) 43568 } 43569 } 43570 return n.getInstance = function() { 43571 return n._instance 43572 } 43573 , 43574 n.prototype._touchstart = function(s) { 43575 let o = this; 43576 if (this._shouldHandle(s)) { 43577 this._reset(); 43578 let i = this._closestDraggable(s.target); 43579 i && !this._dispatchEvent(s, "mousemove", s.target) && !this._dispatchEvent(s, "mousedown", s.target) && (this._dragSource = i, 43580 this._ptDown = this._getPoint(s), 43581 this._lastTouch = s, 43582 setTimeout(function() { 43583 o._dragSource === i && o._img === null && o._dispatchEvent(s, "contextmenu", i) && o._reset() 43584 }, n._CTXMENU), 43585 n._ISPRESSHOLDMODE && (this._pressHoldInterval = setTimeout(function() { 43586 o._isDragEnabled = !0, 43587 o._touchmove(s) 43588 }, n._PRESSHOLDAWAIT))) 43589 } 43590 } 43591 , 43592 n.prototype._touchmove = function(s) { 43593 if (this._shouldCancelPressHoldMove(s)) { 43594 this._reset(); 43595 return 43596 } 43597 if (this._shouldHandleMove(s) || this._shouldHandlePressHoldMove(s)) { 43598 let o = this._getTarget(s); 43599 if (this._dispatchEvent(s, "mousemove", o)) { 43600 this._lastTouch = s, 43601 s.preventDefault(); 43602 return 43603 } 43604 if (this._dragSource && !this._img && this._shouldStartDragging(s)) { 43605 if (this._dispatchEvent(this._lastTouch, "dragstart", this._dragSource)) { 43606 this._dragSource = null; 43607 return 43608 } 43609 this._createImage(s), 43610 this._dispatchEvent(s, "dragenter", o) 43611 } 43612 this._img && (this._lastTouch = s, 43613 s.preventDefault(), 43614 this._dispatchEvent(s, "drag", this._dragSource), 43615 o !== this._lastTarget && (this._dispatchEvent(this._lastTouch, "dragleave", this._lastTarget, o), 43616 this._dispatchEvent(s, "dragenter", o, this._lastTarget), 43617 this._lastTarget = o), 43618 this._moveImage(s), 43619 this._isDropZone = this._dispatchEvent(s, "dragover", o)) 43620 } 43621 } 43622 , 43623 n.prototype._touchend = function(s) { 43624 if (this._shouldHandle(s)) { 43625 if (this._dispatchEvent(this._lastTouch, "mouseup", s.target)) { 43626 s.preventDefault(); 43627 return 43628 } 43629 this._img || (this._dragSource = null, 43630 this._dispatchEvent(this._lastTouch, "click", s.target), 43631 this._lastClick = Date.now()), 43632 this._destroyImage(), 43633 this._dragSource && (s.type.indexOf("cancel") < 0 && this._isDropZone && this._dispatchEvent(this._lastTouch, "drop", this._lastTarget), 43634 this._dispatchEvent(this._lastTouch, "dragend", this._dragSource), 43635 this._reset()) 43636 } 43637 } 43638 , 43639 n.prototype._shouldHandle = function(s) { 43640 return s && !s.defaultPrevented && s.touches && s.touches.length < 2 43641 } 43642 , 43643 n.prototype._shouldHandleMove = function(s) { 43644 return !n._ISPRESSHOLDMODE && this._shouldHandle(s) 43645 } 43646 , 43647 n.prototype._shouldHandlePressHoldMove = function(s) { 43648 return n._ISPRESSHOLDMODE && this._isDragEnabled && s && s.touches && s.touches.length 43649 } 43650 , 43651 n.prototype._shouldCancelPressHoldMove = function(s) { 43652 return n._ISPRESSHOLDMODE && !this._isDragEnabled && this._getDelta(s) > n._PRESSHOLDMARGIN 43653 } 43654 , 43655 n.prototype._shouldStartDragging = function(s) { 43656 let o = this._getDelta(s); 43657 return o > n._THRESHOLD || n._ISPRESSHOLDMODE && o >= n._PRESSHOLDTHRESHOLD 43658 } 43659 , 43660 n.prototype._reset = function() { 43661 this._destroyImage(), 43662 this._dragSource = null, 43663 this._lastTouch = null, 43664 this._lastTarget = null, 43665 this._ptDown = null, 43666 this._isDragEnabled = !1, 43667 this._isDropZone = !1, 43668 this._dataTransfer = new e, 43669 clearInterval(this._pressHoldInterval) 43670 } 43671 , 43672 n.prototype._getPoint = function(s, o) { 43673 return s && s.touches && (s = s.touches[0]), 43674 { 43675 x: o ? s.pageX : s.clientX, 43676 y: o ? s.pageY : s.clientY 43677 } 43678 } 43679 , 43680 n.prototype._getDelta = function(s) { 43681 if (n._ISPRESSHOLDMODE && !this._ptDown) 43682 return 0; 43683 let o = this._getPoint(s); 43684 return Math.abs(o.x - this._ptDown.x) + Math.abs(o.y - this._ptDown.y) 43685 } 43686 , 43687 n.prototype._getTarget = function(s) { 43688 let o = this._getPoint(s) 43689 , i = document.elementFromPoint(o.x, o.y); 43690 for (; i && getComputedStyle(i).pointerEvents == "none"; ) 43691 i = i.parentElement; 43692 return i 43693 } 43694 , 43695 n.prototype._createImage = function(s) { 43696 this._img && this._destroyImage(); 43697 let o = this._imgCustom || this._dragSource; 43698 if (this._img = o.cloneNode(!0), 43699 this._copyStyle(o, this._img), 43700 this._img.style.top = this._img.style.left = "-9999px", 43701 !this._imgCustom) { 43702 let i = o.getBoundingClientRect() 43703 , r = this._getPoint(s); 43704 this._imgOffset = { 43705 x: r.x - i.left, 43706 y: r.y - i.top 43707 }, 43708 this._img.style.opacity = n._OPACITY.toString() 43709 } 43710 this._moveImage(s), 43711 document.body.appendChild(this._img) 43712 } 43713 , 43714 n.prototype._destroyImage = function() { 43715 this._img && this._img.parentElement && this._img.parentElement.removeChild(this._img), 43716 this._img = null, 43717 this._imgCustom = null 43718 } 43719 , 43720 n.prototype._moveImage = function(s) { 43721 let o = this; 43722 requestAnimationFrame(function() { 43723 if (o._img) { 43724 let i = o._getPoint(s, !0) 43725 , r = o._img.style; 43726 r.position = "absolute", 43727 r.pointerEvents = "none", 43728 r.zIndex = "999999", 43729 r.left = Math.round(i.x - o._imgOffset.x) + "px", 43730 r.top = Math.round(i.y - o._imgOffset.y) + "px" 43731 } 43732 }) 43733 } 43734 , 43735 n.prototype._copyProps = function(s, o, i) { 43736 for (let r = 0; r < i.length; r++) { 43737 let a = i[r]; 43738 s[a] = o[a] 43739 } 43740 } 43741 , 43742 n.prototype._copyStyle = function(s, o) {
43743 if (n._rmvAtts.forEach(function(r) { 43744 o.removeAttribute(r) 43745 }), 43746 s instanceof HTMLCanvasElement) { 43747 let r = s 43748 , a = o; 43749 a.width = r.width, 43750 a.height = r.height, 43751 a.getContext("2d").drawImage(r, 0, 0) 43752 } 43753 let i = getComputedStyle(s); 43754 for (let r = 0; r < i.length; r++) { 43755 let a = i[r]; 43756 a.indexOf("transition") < 0 && (o.style[a] = i[a]) 43757 } 43758 o.style.pointerEvents = "none"; 43759 for (let r = 0; r < s.children.length; r++) 43760 this._copyStyle(s.children[r], o.children[r]) 43761 } 43762 , 43763 n.prototype._setOffsetAndLayerProps = function(s, o) { 43764 let i; 43765 s.offsetX === void 0 && (i = o.getBoundingClientRect(), 43766 s.offsetX = s.clientX - i.x, 43767 s.offsetY = s.clientY - i.y), 43768 s.layerX === void 0 && (i = i || o.getBoundingClientRect(), 43769 s.layerX = s.pageX - i.left, 43770 s.layerY = s.pageY - i.top) 43771 } 43772 , 43773 n.prototype._dispatchEvent = function(s, o, i, r) { 43774 if (s && i) { 43775 let a = new Event(o,{ 43776 bubbles: !0, 43777 cancelable: !0 43778 }) 43779 , d = s.touches ? s.touches[0] : s; 43780 return a.button = 0, 43781 a.which = a.buttons = 1, 43782 this._copyProps(a, s, n._kbdProps), 43783 this._copyProps(a, d, n._ptProps), 43784 this._setOffsetAndLayerProps(a, i), 43785 a.dataTransfer = this._dataTransfer, 43786 a.relatedTarget = r, 43787 i.dispatchEvent(a), 43788 a.defaultPrevented 43789 } 43790 return !1 43791 } 43792 , 43793 n.prototype._closestDraggable = function(s) { 43794 for (; s; s = s.parentElement) 43795 if (s.draggable) 43796 return s; 43797 return null 43798 } 43799 , 43800 n 43801 } 43802 )(); 43803 t._instance = new t, 43804 t._THRESHOLD = 5, 43805 t._OPACITY = .5, 43806 t._DBLCLICK = 500, 43807 t._CTXMENU = 900, 43808 t._ISPRESSHOLDMODE = !1, 43809 t._PRESSHOLDAWAIT = 400, 43810 t._PRESSHOLDMARGIN = 25, 43811 t._PRESSHOLDTHRESHOLD = 0, 43812 t._rmvAtts = "id,class,style,draggable".split(","), 43813 t._kbdProps = "altKey,ctrlKey,metaKey,shiftKey".split(","), 43814 t._ptProps = "pageX,pageY,clientX,clientY,screenX,screenY,offsetX,offsetY".split(","), 43815 l.DragDropTouch = t 43816} 43817)(Dg || (Dg = {})); 43818let ah = !1; 43819const aV = { 43820 name: "ModelTreeNode", 43821 components: { 43822 HyInput: Xs 43823 }, 43824 props: { 43825 node: Object, 43826 rowHeight: { 43827 type: Number, 43828 default: 32 43829 } 43830 }, 43831 data() { 43832 return { 43833 hover: !1, 43834 label: "", 43835 locked: !1, 43836 inLocked: !1, 43837 hidden: !0, 43838 inHidden: !1, 43839 treeLinesData: "", 43840 editing: !1, 43841 canvasSize: 20 * Math.max(1, window?.devicePixelRatio ?? 1) 43842 } 43843 }, 43844 inject: ["dragData", "setDropTarget", "setNodeOpen", "onModelChanged", "onModelHidden", "onModelLocked", "onNodeDragover", "setTreeFocus"], 43845 computed: { 43846 model() { 43847 return this.node.model 43848 }, 43849 open() { 43850 return this.node.open 43851 }, 43852 treeLevel() { 43853 return this.node.level 43854 }, 43855 showHideButton() { 43856 return !this.inHidden && (this.hidden || this.hover || An && this.node.selected) 43857 }, 43858 showLockButton() { 43859 return !this.inLocked && (this.locked || this.hover || An && this.node.selected) 43860 } 43861 }, 43862 methods: { 43863 onHideClick(l) { 43864 this.hidden = !this.hidden, 43865 this.model.setHidden(this.hidden), 43866 this.onModelHidden(this.model, this.hidden), 43867 l.preventDefault() 43868 }, 43869 onHideTouchstart(l) { 43870 this.onHideClick(l) 43871 }, 43872 onLockClick(l) { 43873 this.locked = !this.locked, 43874 this.model.setLocked(this.locked), 43875 this.onModelLocked(this.model, this.locked), 43876 l.preventDefault() 43877 }, 43878 updateLabel() { 43879 this.label = this.getLabel() 43880 }, 43881 updateThumbnail(l) { 43882 Fv(this.model, this.$refs.thumbnail, l ? 0 : 500) 43883 }, 43884 getLabel() { 43885 let l = this.model.getLabel(); 43886 if (l?.length > 0) 43887 return l; 43888 let e = this.model.getType(); 43889 switch (e) { 43890 case "document": 43891 l = "document"; 43892 break; 43893 case "path": 43894 l = "path"; 43895 break; 43896 case "clipPath": 43897 l = "clip-path"; 43898 break; 43899 case "group": 43900 l = "group"; 43901 break; 43902 case "circle": 43903 l = "circle"; 43904 break; 43905 case "rectangle": 43906 l = "rectangle"; 43907 break; 43908 case "ellipse": 43909 l = "ellipse"; 43910 break; 43911 case "polygon": 43912 l = "polygon"; 43913 break; 43914 case "star": 43915 l = "star"; 43916 break; 43917 case "image": 43918 l = "image"; 43919 break; 43920 case "text": 43921 l = "text"; 43922 break; 43923 case "textSpan": 43924 l = "text span"; 43925 break; 43926 default: 43927 console.error("unknown model type: " + e), 43928 l = e 43929 } 43930 return l 43931 }, 43932 onDragstart(l) { 43933 l.dataTransfer.dropEffect = "move",
43934 l.dataTransfer.setDragImage(new Image, 0, 0); 43935 let e = V(); 43936 this.dragData.models = e.selectedModels.slice(), 43937 this.dragData.startOffsetX = l.offsetX, 43938 this.dragData.startLevel = this.treeLevel 43939 }, 43940 onDragend(l) {}, 43941 onDragover(l) { 43942 let e = this.node; 43943 this.onNodeDragover(l, e, this.$refs.node), 43944 !e.open && e.model.getChildModelCount() > 0 && this.openTimeout == null && (this.openTimeout = window.setTimeout(()=>{ 43945 this.setNodeOpen(e, !0), 43946 this.openTimeout = null 43947 } 43948 , 1e3)) 43949 }, 43950 onDrop() { 43951 let l = this.dragData 43952 , e = l.insertParent; 43953 if (e != null) { 43954 let t = z() 43955 , n = l.models.slice(); 43956 nu(n); 43957 let s = l.insertIndex 43958 , o = !0; 43959 if (n.every(i=>i.getParentModel() === e)) { 43960 let i = n.map(r=>e.getChildModelIndex(r)).sort((r,a)=>r - a); 43961 i.every((r,a,d)=>a === 0 || d[a - 1] === r - 1) && s >= i.at(0) && s <= i.at(-1) + 1 && (o = !1) 43962 } 43963 if (o) { 43964 let i = ae(); 43965 i.startCompoundEdit(); 43966 let r = e.getAggregateTransform().invert() 43967 , a = [] 43968 , d = []; 43969 n.forEach(h=>{ 43970 let f = h.getParentModel().getAggregateTransform().preMultiplyWith(r); 43971 if (!f.isIdentity) { 43972 let p = h.getSelfTransform(); 43973 h.setSelfTransform(p.preMultiplyWith(f, !0)), 43974 a.push(h), 43975 d.push(p) 43976 } 43977 } 43978 ), 43979 i.addEdit(new Dn(a,d)); 43980 let u = new Set(n); 43981 for (let h = s - 1; h >= 0; h--) 43982 u.has(e.getChildModel(h)) && s--; 43983 t.removeModels(n), 43984 el(()=>{ 43985 t.insertModelsAt(n, e, s), 43986 i.endCompoundEdit() 43987 } 43988 ) 43989 } 43990 } 43991 this.setDropTarget(null) 43992 }, 43993 onDragenter(l) { 43994 this.onDragover(l) 43995 }, 43996 onDragleave(l) { 43997 this.openTimeout != null && (window.clearTimeout(this.openTimeout), 43998 this.openTimeout = null); 43999 let e = l.relatedTarget; 44000 if (!e?.classList.contains("tree-node")) { 44001 let t = e?.parentElement 44002 , n = !1; 44003 for (; t != null; ) { 44004 if (t.classList.contains("positioner")) { 44005 n = !0; 44006 break 44007 } 44008 t = t.parentElement 44009 } 44010 n || this.setDropTarget(null) 44011 } 44012 l.preventDefault() 44013 }, 44014 onPointerdown(l) { 44015 l.pointerType !== "pen" && l.pointerType !== "touch" && !this.node.selected ? (this.onItemSelectEvent(l), 44016 ah = !0) : ah = !1 44017 }, 44018 onClick(l) { 44019 ah || this.onItemSelectEvent(l) 44020 }, 44021 onLabelClick(l) { 44022 console.log("Edit"), 44023 (this.node.selected || this.node.inSelection) && (console.log("Edit"), 44024 l.preventDefault()) 44025 }, 44026 onItemSelectEvent(l) { 44027 if (l.defaultPrevented || l.target === this.$refs.arrow) 44028 return; 44029 let e = z(); 44030 if (l.shiftKey) 44031 e.selectModelRange(this.model, this.ctrlKey); 44032 else if (l.ctrlKey) 44033 this.node.selected ? e.setModelsSelected(null, [this.model]) : e.setModelsSelected([this.model], null); 44034 else { 44035 let t = V(); 44036 e.setModelsSelected([this.model], t.selectedModels) 44037 } 44038 }, 44039 onArrowTouchstart(l) { 44040 l.preventDefault() 44041 }, 44042 onArrowPointerdown(l) { 44043 this.setNodeOpen(this.node, !this.node.open), 44044 l.preventDefault() 44045 }, 44046 onPointerenter(l) { 44047 l.buttons === 0 && (this.hover = !0, 44048 this.showOverlay()) 44049 }, 44050 onPointerleave() { 44051 this.hover = !1, 44052 this.hideOverlay() 44053 }, 44054 startLabelEdit() { 44055 this.editing = !0, 44056 this.$nextTick(()=>this.$refs.labelInput.focus()) 44057 }, 44058 onEditKeydown(l) { 44059 let e = l.key; 44060 e === $s ? (this.cancelLabelEdit(), 44061 this.preventDefault = !0) : e === Qr && (this.endLabelEdit(), 44062 this.preventDefault = !1), 44063 l.stopPropagation() 44064 }, 44065 endLabelEdit() { 44066 this.editing && (this.editing = !1, 44067 z().setModelLabel(this.node.model, this.$refs.labelInput.value), 44068 this.updateLabel()) 44069 }, 44070 cancelLabelEdit() { 44071 this.editing = !1 44072 }, 44073 onLabelInputBlur(l) { 44074 console.log("blur"), 44075 this.endLabelEdit(), 44076 l.preventDefault(), 44077 this.setTreeFocus() 44078 }, 44079 showOverlay() { 44080 j().showModelOverlay(this.model, "modelTree", "highlight") 44081 }, 44082 hideOverlay() { 44083 j().removeModelOverlay(this.model, "modelTree", "highlight") 44084 }, 44085 notifyModelChanged() { 44086 this.onModelChanged(this.model) 44087 },
44088 updateInHidden() { 44089 let l = this.node.model; 44090 this.inHidden = l.isInHidden() 44091 }, 44092 updateInLocked() { 44093 let l = this.node.model; 44094 this.inLocked = l.isInLocked() 44095 }, 44096 updateTreeLinesData() { 44097 let l = "" 44098 , e = this.treeLevel 44099 , t = this.node.model 44100 , n = t.getParentModel() 44101 , s = 23.5 + e * 20; 44102 if (l += "M" + (s + 12) + "," + this.rowHeight / 2 + "h-12", 44103 n.getChildModel(0) === t ? l += "v-" + (this.rowHeight / 2 + 8) : l += "M" + s + ",-8v" + (this.rowHeight + 16), 44104 e >= 0) 44105 for (let o = e - 1; o >= 0; o--) 44106 t = n, 44107 n = t.getParentModel(), 44108 s -= 20, 44109 n.getChildModel(0) !== t && (l += "M" + s + ",-8v" + (this.rowHeight + 16)); 44110 this.treeLinesData = l 44111 } 44112 }, 44113 updated() { 44114 this.updateTreeLinesData() 44115 }, 44116 mounted() { 44117 this.hidden = this.model.isHidden(), 44118 this.inHidden = this.model.isInHidden(), 44119 this.locked = this.model.isLocked(), 44120 this.updateLabel(), 44121 this.updateThumbnail(!0), 44122 this.model.addChangeCallback(this.notifyModelChanged), 44123 this.$refs.thumbnail.addEventListener("contextrestored", this.synchSize) 44124 }, 44125 beforeUnmount() { 44126 Xf(this.model), 44127 this.hideOverlay(), 44128 this.model.removeChangeCallback(this.notifyModelChanged), 44129 this.$refs.thumbnail.removeEventListener("contextrestored", this.synchSize) 44130 } 44131} 44132 , dV = ["draggable"] 44133 , uV = { 44134 ref: "treeLinesData", 44135 class: "tree-lines", 44136 "shape-rendering": "crispEdges" 44137} 44138 , hV = ["d"] 44139 , cV = { 44140 class: "content" 44141} 44142 , fV = ["width", "height"] 44143 , pV = { 44144 style: { 44145 "margin-left": "auto", 44146 display: "flex" 44147 } 44148} 44149 , gV = { 44150 key: 0, 44151 viewBox: "0 0 16 16", 44152 width: "16", 44153 height: "16" 44154} 44155 , mV = { 44156 key: 1, 44157 viewBox: "0 0 16 16", 44158 width: "16", 44159 height: "16" 44160} 44161 , yV = ["disabled"] 44162 , vV = { 44163 key: 0, 44164 viewBox: "0 0 16 16", 44165 width: "16", 44166 height: "16" 44167} 44168 , bV = { 44169 key: 1, 44170 viewBox: "0 0 16 16", 44171 width: "16", 44172 height: "16" 44173}; 44174function MV(l, e, t, n, s, o) { 44175 const i = E("hy-input"); 44176 return N(), 44177 $("div", { 44178 ref: "node", 44179 class: Ne(["tree-node", { 44180 "tree-node-selected": t.node.selected, 44181 "tree-node-in-selection": t.node.inSelection, 44182 open: o.open, 44183 "tree-node-hover": s.hover, 44184 "tree-node-hidden": s.hidden || s.inHidden 44185 }]), 44186 style: xe({ 44187 height: t.rowHeight + "px" 44188 }), 44189 draggable: t.node.selected, 44190 onPointerdown: e[6] || (e[6] = (...r)=>o.onPointerdown && o.onPointerdown(...r)), 44191 onClick: e[7] || (e[7] = (...r)=>o.onClick && o.onClick(...r)), 44192 onDragstart: e[8] || (e[8] = (...r)=>o.onDragstart && o.onDragstart(...r)), 44193 onDragend: e[9] || (e[9] = (...r)=>o.onDragend && o.onDragend(...r)), 44194 onDragenter: e[10] || (e[10] = (...r)=>o.onDragenter && o.onDragenter(...r)), 44195 onDragover: e[11] || (e[11] = (...r)=>o.onDragover && o.onDragover(...r)), 44196 onDrop: e[12] || (e[12] = (...r)=>o.onDrop && o.onDrop(...r)), 44197 onDragleave: e[13] || (e[13] = (...r)=>o.onDragleave && o.onDragleave(...r)), 44198 onPointerenter: e[14] || (e[14] = (...r)=>o.onPointerenter && o.onPointerenter(...r)), 44199 onPointerleave: e[15] || (e[15] = (...r)=>o.onPointerleave && o.onPointerleave(...r)) 44200 }, [_("div", { 44201 ref: "arrowContainer", 44202 class: "arrow-container", 44203 style: xe({ 44204 width: 32 + o.treeLevel * 20 + "px" 44205 }) 44206 }, [(N(), 44207 $("svg", uV, [_("path", { 44208 d: s.treeLinesData 44209 }, null, 8, hV)], 512)), t.node.hasChildren ? (N(), 44210 $("div", { 44211 key: 0, 44212 ref: "arrow", 44213 class: "arrow", 44214 onTouchstart: e[0] || (e[0] = (...r)=>o.onArrowTouchstart && o.onArrowTouchstart(...r)), 44215 onPointerdown: e[1] || (e[1] = (...r)=>o.onArrowPointerdown && o.onArrowPointerdown(...r)) 44216 }, [...e[16] || (e[16] = [_("svg", {
44217 viewBox: "0 0 15 15", 44218 width: "15", 44219 height: "15" 44220 }, [_("path", { 44221 d: "M5.8 4.7c-0.4-0.4-0.4-1 0-1.4 0.4-0.4 1-0.4 1.4 0l3.5 3.5c0.4 0.4 0.4 1 0 1.4l-3.5 3.5c-0.4 0.4-1 0.4-1.4 0-0.4-0.4-0.4-1 0-1.4l2.8-2.8-2.8-2.8z", 44222 fill: "currentColor", 44223 opacity: "0.6" 44224 })], -1)])], 544)) : be("", !0)], 4), _("div", cV, [_("canvas", { 44225 ref: "thumbnail", 44226 class: "thumbnail", 44227 width: s.canvasSize, 44228 height: s.canvasSize 44229 }, null, 8, fV), s.editing ? (N(), 44230 pe(i, { 44231 key: 0, 44232 ref: "labelInput", 44233 "model-value": s.label, 44234 onFocusout: o.onLabelInputBlur, 44235 onKeydown: o.onEditKeydown 44236 }, null, 8, ["model-value", "onFocusout", "onKeydown"])) : (N(), 44237 $("div", { 44238 key: 1, 44239 class: "label", 44240 onDblclick: e[2] || (e[2] = (...r)=>o.startLabelEdit && o.startLabelEdit(...r)) 44241 }, se(s.label), 33))]), _("div", pV, [l.$isDevelopment ? (N(), 44242 $("button", { 44243 key: 0, 44244 type: "button", 44245 class: "actions-menu-button", 44246 onClick: e[3] || (e[3] = (...r)=>o.onLockClick && o.onLockClick(...r)), 44247 tabindex: "-1", 44248 style: xe({ 44249 visibility: o.showLockButton ? "visible" : "hidden" 44250 }) 44251 }, [s.locked || s.inLocked ? (N(), 44252 $("svg", gV, [...e[17] || (e[17] = [_("path", { 44253 d: "M 3 5.5c 0-6 9-6 9 0v 8.2c 0 0.7-0.6 1.3-1.3 1.3h-6.4c-0.7 0-1.3-0.6-1.3-1.3v-8.2zM 10 7v-1.5c 0-3.4-5-3.4-5 0v 1.5h 5z", 44254 fill: "currentColor" 44255 }, null, -1)])])) : (N(), 44256 $("svg", mV, [...e[18] || (e[18] = [_("path", { 44257 d: "M 3 8.3c 0-0.7 0.6-1.3 1.3-1.3h 5.7v-2c 0-5.3 6-5.3 6 0v 1h-2v-1c 0-2.6-2-2.6-2 0v 8.7c 0 0.7-0.6 1.3-1.3 1.3h-6.4c-0.7 0-1.3-0.6-1.3-1.3v-5.4z", 44258 fill: "currentColor" 44259 }, null, -1)])]))], 4)) : be("", !0), _("button", { 44260 type: "button", 44261 class: "actions-menu-button", 44262 onClick: e[4] || (e[4] = (...r)=>o.onHideClick && o.onHideClick(...r)), 44263 tabindex: "-1", 44264 disabled: s.inHidden, 44265 style: xe({ 44266 visibility: o.showHideButton ? "visible" : "hidden" 44267 }), 44268 onTouchstart: e[5] || (e[5] = (...r)=>o.onHideTouchstart && o.onHideTouchstart(...r)) 44269 }, [s.hidden ? (N(), 44270 $("svg", vV, [...e[19] || (e[19] = [_("path", { 44271 d: "M0.6 11.5c-0.1-0.2-0.1-0.6 0-0.8l0.8-0.7c-0.1-0.2-0.2-0.3-0.3-0.5-0.2-0.5 0-1.1 0.5-1.4 0.5-0.2 1.1 0 1.3 0.6 0.7 1.5 2.7 2.7 5.1 2.7 2.4 0 4.4-1.2 5.1-2.7 0.2-0.5 0.8-0.7 1.3-0.5 0.5 0.3 0.7 0.9 0.5 1.4-0.1 0.1-0.2 0.3-0.2 0.4l0.7 0.7c0.1 0.2 0.1 0.6 0 0.8-0.2 0.1-0.6 0.1-0.8 0l-0.5-0.6c-0.7 0.7-1.6 1.4-2.7 1.8l0.2 0.6c0.1 0.3 0 0.6-0.3 0.7-0.2 0-0.5-0.1-0.6-0.4l-0.2-0.5c-0.8 0.2-1.6 0.3-2.5 0.3-0.9 0-1.7-0.1-2.5-0.3l-0.2 0.5c-0.1 0.3-0.4 0.4-0.6 0.4-0.3-0.1-0.4-0.4-0.3-0.7l0.2-0.6c-1.1-0.4-2-1.1-2.6-1.9l-0.6 0.7c-0.2 0.1-0.6 0.1-0.8 0z", 44272 fill: "currentColor" 44273 }, null, -1)])])) : (N(), 44274 $("svg", bV, [...e[20] || (e[20] = [_("path", { 44275 d: "M1.1 8.9c-0.1-0.3-0.1-0.5 0-0.8 2.3-5.5 11.5-5.5 13.8 0 0.1 0.3 0.1 0.5 0 0.8-2.3 5.5-11.5 5.5-13.8 0zM6.7 6.1c-1.5 0.3-2.9 1.1-3.6 2.4 0.7 1.3 2.1 2.1 3.6 2.4-0.8-0.5-1.4-1.4-1.4-2.4 0-1 0.6-1.9 1.4-2.4zM9.3 10.9c1.5-0.3 2.9-1.1 3.6-2.4-0.7-1.3-2.1-2.1-3.6-2.4 0.8 0.5 1.4 1.4 1.4 2.4 0 1-0.6 1.9-1.4 2.4z", 44276 fill: "currentColor" 44277 }, null, -1)])]))], 44, yV)])], 46, dV) 44278} 44279const SV = ie(aV, [["render", MV]]); 44280let wV = class { 44281 modelClosedMap = me(new WeakMap); 44282 modelIndexMap = me(new WeakMap); 44283 modelList = qn([]); 44284 constructor() {} 44285 initTree(e) { 44286 let t = this.collectChildModels(e); 44287 this.modelList.splice(0, this.modelList.length, ...t), 44288 this.updateIndices() 44289 } 44290 collectChildModels(e, t=[]) { 44291 let n = e.getType(); 44292 return (n === "group" || n === "clipPath" || n === "document") && !this.modelClosedMap.get(e) && e.getChildModels().reverse().forEach(i=>{ 44293 (i instanceof Fn || i.getType() === "group") && (t.push(i), 44294 this.collectChildModels(i, t)) 44295 } 44296 ), 44297 t 44298 } 44299 updateIndices(e=0) { 44300 let t = this.modelList; 44301 for (let n = e; n < t.length; n++) 44302 this.modelIndexMap.set(t[n], n) 44303 } 44304 setModelOpen(e, t) { 44305 if (!!this.modelClosedMap.get(e) != !!t) 44306 return; 44307 let n = this.modelList 44308 , s = this.modelIndexMap.get(e); 44309 t ? (this.modelClosedMap.set(e, !t), 44310 n.splice(s + 1, 0, ...this.collectChildModels(e))) : (n.splice(s + 1, this.collectChildModels(e).length), 44311 this.modelClosedMap.set(e, !t)), 44312 this.updateIndices(s + 1) 44313 } 44314 onModelsDeleted(e, t, n) { 44315 let s = []; 44316 e.forEach(r=>s.push(r, ...this.collectChildModels(r))); 44317 let o = this.modelIndexMap; 44318 s.sort((r,a)=>o.get(a) - o.get(r)); 44319 let i = this.modelList;
44320 s.forEach(r=>{ 44321 let a = o.get(r); 44322 i.splice(a, 1), 44323 o.delete(r) 44324 } 44325 ), 44326 this.updateIndices() 44327 } 44328 onModelsInserted(e, t, n) { 44329 let s = this.modelList 44330 , o = t.getType() === "document" ? -1 : this.modelIndexMap.get(t); 44331 if (!this.modelClosedMap.get(t) && (o === -1 || s[o] === t)) { 44332 let i = e.reduce((a,d)=>a += this.collectChildModels(d).length + 1, 0) 44333 , r = this.collectChildModels(t); 44334 s.splice(o + 1, r.length - i, ...r), 44335 this.updateIndices() 44336 } 44337 } 44338 getPreviousModel(e) { 44339 let t = this.modelIndexMap.get(e); 44340 return t > 0 ? this.modelList[t - 1] : null 44341 } 44342 getNextModel(e) { 44343 let t = this.modelIndexMap.get(e); 44344 return t < this.modelList.length - 1 ? this.modelList[t + 1] : null 44345 } 44346} 44347; 44348class PV { 44349 hasChildren = !1; 44350 open = !0; 44351 level = 0; 44352 model; 44353 selected = !1; 44354 inSelection = !1; 44355 constructor(e) { 44356 this.model = me(e), 44357 this.hasChildren = e.getChildModels().length > 0 && e.getType() !== "text", 44358 this.updateLevel(), 44359 this.updateSelectionState() 44360 } 44361 updateLevel() { 44362 let e = -1 44363 , t = this.model.getParentModel(); 44364 for (; t != null; ) 44365 e++, 44366 t = t.getParentModel(); 44367 this.level = e 44368 } 44369 updateSelectionState() { 44370 let e = this.model 44371 , t = z() 44372 , n = t.isModelSelected(e) 44373 , s = n; 44374 if (!n) 44375 for (e = e.getParentModel(); e != null; ) { 44376 if (t.isModelSelected(e)) { 44377 s = !0; 44378 break 44379 } 44380 e = e.getParentModel() 44381 } 44382 this.selected = n, 44383 this.inSelection = s 44384 } 44385} 44386const xV = { 44387 name: "ModelTree", 44388 components: { 44389 HyScrollview: $o, 44390 ModelTreeNode: SV 44391 }, 44392 data() { 44393 return { 44394 consts: me({ 44395 endDropTargetHeight: 12 44396 }), 44397 modelTree: me(new wV), 44398 rootHeight: 500, 44399 rowHeight: 34, 44400 nodePadding: 2, 44401 startIndex: 0, 44402 autoscrollIncr: 0, 44403 dragData: me({ 44404 models: null, 44405 insertParent: null, 44406 insertIndex: -1, 44407 insertLevel: 0 44408 }), 44409 insertStyle: { 44410 top: 0, 44411 left: 0 44412 }, 44413 insertClass: null 44414 } 44415 }, 44416 computed: { 44417 containerHeight() { 44418 return this.modelTree.modelList.length * this.rowHeight + this.consts.endDropTargetHeight 44419 }, 44420 visibleNodes() { 44421 let l = this.modelTree 44422 , e = l.modelList.length 44423 , t = Math.min(e - this.startIndex, Math.ceil(this.rootHeight / this.rowHeight) + 2 * this.nodePadding) 44424 , n = l.modelList.slice(this.startIndex, this.startIndex + t) 44425 , s = l.modelClosedMap; 44426 return Et(n.map(o=>{ 44427 let i = new PV(o); 44428 return i.open = !s.get(o), 44429 Et(i) 44430 } 44431 )) 44432 }, 44433 positionerOffsY() { 44434 return this.startIndex * this.rowHeight 44435 } 44436 }, 44437 methods: { 44438 scrollToIndex(l) { 44439 let e = this.modelTree; 44440 if (l < 0 || l >= e.modelList.length || this.$refs.modelTree == null) 44441 return; 44442 let t = this.$refs.modelTree.$el.children[0], n = t.scrollTop, s = this.rowHeight, o = Math.ceil(n / s), i = Math.max(0, Math.floor((n + this.rootHeight) / s) - 1), r; 44443 l < o ? r = l * s : l > i && (r = l * s - this.rootHeight + s), 44444 r != null && t.scrollTo({ 44445 top: r, 44446 behavior: "instant" 44447 }) 44448 }, 44449 scrollToModel(l) { 44450 if (l == null) 44451 return; 44452 let e = this.modelTree.modelIndexMap.get(l); 44453 e != null && this.scrollToIndex(e) 44454 }, 44455 onScroll() { 44456 this.animationRef == null && (this.animationRef = requestAnimationFrame(()=>{ 44457 let l = this.$refs.modelTree.$el.children[0].scrollTop 44458 , e = Math.floor(l / this.rowHeight) - this.nodePadding; 44459 this.startIndex = Math.max(0, e), 44460 this.animationRef = null 44461 } 44462 )) 44463 }, 44464 setDropTarget(l, e, t, n) { 44465 let s = this.insertStyle; 44466 if (l == null) 44467 s.visibility = "hidden", 44468 this.insertClass = null; 44469 else { 44470 let o = this.$refs.positioner.getBoundingClientRect() 44471 , i = l.getBoundingClientRect(); 44472 this.insertClass = n ? "middle-insert" : "end-insert", 44473 s.visibility = "visible", 44474 s.left = e + "px", 44475 s.top = i.y - o.y + t + "px" 44476 } 44477 }, 44478 setNodeOpen(l, e) { 44479 this.modelTree.setModelOpen(l.model, e), 44480 l.open = e 44481 }, 44482 updateRootHeight() { 44483 let l = this.$refs.modelTree; 44484 l != null && (this.rootHeight = l.$el.children[0].offsetHeight) 44485 }, 44486 onKeydown(l) { 44487 let e = l.key 44488 , t = V() 44489 , n = z() 44490 , s = t.selectedModels[0]; 44491 if ((s && this.modelTree.modelIndexMap.get(s)) != null) { 44492 if (e === Lo) 44493 this.modelTree.setModelOpen(s, !0); 44494 else if (e === Io) 44495 this.modelTree.setModelOpen(s, !1); 44496 else if (e === cs) { 44497 let i = s 44498 , r = i.getParentModel() 44499 , a = r.getChildModelIndex(i); 44500 if (a === 0 ? i = r : i = r.getChildModel(a - 1), 44501 i == null || i.getType() === "document") 44502 return; 44503 n.setModelsSelected([i], t.selectedModels); 44504 let d = this.modelTree.modelIndexMap.get(i); 44505 d != null && this.scrollToIndex(d), 44506 l.preventDefault() 44507 } else if (e === hn) { 44508 let i = s 44509 , r = i.getParentModel() 44510 , a = r.getChildModelIndex(i); 44511 if (a === r.getChildModelCount() - 1 ? i = r : i = r.getChildModel(a + 1), 44512 i == null || i.getType() === "document") 44513 return; 44514 n.setModelsSelected([i], t.selectedModels); 44515 let d = this.modelTree.modelIndexMap.get(i); 44516 d != null && this.scrollToIndex(d), 44517 l.preventDefault() 44518 } else if (e === ou || e === su) { 44519 let i = t.selectedModels.slice() 44520 , r = ae(); 44521 r.startCompoundEdit(); 44522 for (let a of i) 44523 n.removeModel(a); 44524 n.setModelsSelected([], i), 44525 r.endCompoundEdit(), 44526 l.preventDefault() 44527 } 44528 } 44529 }, 44530 onEndDrag(l) { 44531 this.dragData.models && this.dragData.models.length > 0 && (this.dragData.insertParent = this.modelTree.modelList[0], 44532 this.dragData.insertIndex = 0, 44533 this.dragData.insertLevel = 0, 44534 l.dataTransfer.dropEffect = "move", 44535 this.setDropTarget(this.$refs.endDiv, this.treeLevelToIndent(1))), 44536 l.preventDefault() 44537 }, 44538 onEndDrop() { 44539 let l = this.dragData.models?.slice(); 44540 if (l && l.length > 0) { 44541 nu(l); 44542 let e = z() 44543 , t = ae(); 44544 t.startCompoundEdit(); 44545 for (let n = l.length - 1; n >= 0; n--) { 44546 let s = l[n] 44547 , o = s.getDocumentModel() 44548 , i = s.getSelfTransform() 44549 , r = s.getAggregateTransform(); 44550 s.setSelfTransform(r), 44551 t.addEdit(new Dn([s],[i])), 44552 e.removeModel(s), 44553 e.insertModelAt(s, o, 0) 44554 } 44555 t.endCompoundEdit() 44556 } 44557 this.setDropTarget(null) 44558 }, 44559 onDragleave() { 44560 this.setDropTarget(null) 44561 }, 44562 onModelHidden(l, e) { 44563 let t = l.getModels(!1); 44564 for (let n of t) { 44565 let s = this.$refs["node-" + n._modelId];
44566 s != null && s[0] != null && s[0].updateInHidden() 44567 } 44568 }, 44569 onModelLocked(l, e) { 44570 let t = l.getModels(!1); 44571 for (let n of t) { 44572 let s = this.$refs["node-" + n._modelId]; 44573 s != null && s[0] != null && s[0].updateInLocked() 44574 } 44575 }, 44576 onModelChanged(l) { 44577 this.updateModelLabel(l), 44578 this.updateModelThumbnail(l, !0); 44579 let e = l.getParentModel(); 44580 for (; e != null && e.getType() !== "document"; ) 44581 this.updateModelThumbnail(e, !1), 44582 e = e.getParentModel() 44583 }, 44584 updateModelLabel(l) { 44585 let e = this.$refs["node-" + l._modelId]; 44586 e != null && e[0] != null && e[0].updateLabel() 44587 }, 44588 updateModelThumbnail(l, e) { 44589 let t = this.$refs["node-" + l._modelId]; 44590 if (t != null && t[0] != null && (t[0].updateThumbnail(), 44591 e)) { 44592 let n = t[0].node 44593 , s = n.model; 44594 if (n.open && s.hasChildModels()) 44595 for (let o of s.getChildModels()) 44596 this.updateModelThumbnail(o, !0) 44597 } 44598 }, 44599 treeLevelToIndent(l) { 44600 return 15 + l * 20 44601 }, 44602 onNodeDragover(l, e, t) { 44603 let n = this.dragData.models; 44604 if (n != null && n.length > 0) { 44605 let s = e.model, o = l.offsetY, i = t.offsetHeight, r = o < i / 2, a, d; 44606 r ? (a = this.modelTree.getPreviousModel(s), 44607 d = s) : (a = s, 44608 d = this.modelTree.getNextModel(s)); 44609 let u = this.dragData.startLevel + Math.round((l.offsetX - this.dragData.startOffsetX) / 20), h = g=>!n.some(y=>y === g || y.isAncestorOf(g)), c = null, f, p; 44610 if (a == null) 44611 c = d.getParentModel(), 44612 f = c.getChildModelCount(), 44613 p = 0, 44614 h(d) || (c = null); 44615 else if (d == null) 44616 for (f = 0, 44617 c = a.getParentModel(), 44618 p = c.getModelTreeLevel(); c != null && c.getParentModel() != null && !(p <= u && h(c)); ) 44619 c = c.getParentModel(), 44620 p--; 44621 else if (a === d.getParentModel()) 44622 c = a, 44623 f = c.getChildModelCount(), 44624 p = c.getModelTreeLevel(); 44625 else if (a.getParentModel() === d.getParentModel()) 44626 p = a.getModelTreeLevel() - 1, 44627 (a.getType() === "group" || a.getType() === "clipPath") && p < u && h(a) ? (c = a, 44628 f = 0, 44629 p++) : (c = a.getParentModel(), 44630 f = c.getChildModelIndex(a)); 44631 else { 44632 for (c = a.getParentModel(), 44633 p = c.getModelTreeLevel(); c != null && c !== d.getParentModel(); ) { 44634 if (p <= u && h(c)) { 44635 f = 0; 44636 break 44637 } 44638 c = c.getParentModel(), 44639 p-- 44640 } 44641 c === d.getParentModel() && (p = c.getModelTreeLevel(), 44642 f = c.getChildModelIndex(d) + 1) 44643 } 44644 if (c != null && !h(c) && (c = null), 44645 c) { 44646 l.dataTransfer.dropEffect = "move", 44647 this.dragData.insertParent = c, 44648 this.dragData.insertLevel = p, 44649 this.dragData.insertIndex = f; 44650 let g = this.treeLevelToIndent(p + 1) 44651 , y = f !== 0; 44652 this.setDropTarget(t, g, r ? 0 : i, y) 44653 } else 44654 l.dataTransfer.dropEffect = "none", 44655 this.dragData.insertParent = null, 44656 this.dragData.insertIndex = -1, 44657 this.setDropTarget(null) 44658 } 44659 l.preventDefault() 44660 }, 44661 onGlobalDragover(l) { 44662 if (rf || An) { 44663 let e = l.clientY 44664 , t = this.$refs.modelTree.$el.getBoundingClientRect(); 44665 e < t.top + 20 ? this.autoscrollIncr = -100 : e > t.bottom - 20 ? this.autoscrollIncr = 100 : this.autoscrollIncr = 0, 44666 this.autoscroll() 44667 } 44668 }, 44669 autoscroll() { 44670 if (this.autoscrollTimeoutId != null) 44671 return; 44672 let l = this.autoscrollIncr 44673 , e = this.$refs.modelTree.$el.children[0]; 44674 if (l !== 0 && e) { 44675 let t = Math.max(0, Math.min(e.clientHeight - e.scrollHeight), e.scrollTop + l); 44676 e.scrollTo({ 44677 top: t, 44678 behavior: "smooth" 44679 }), 44680 e.scrollTop > 0 && t + e.scrollHeight < e.clientHeight - 1 ? this.autoscrollTimeoutId = setTimeout(()=>{ 44681 this.autoscrollTimeoutId = null, 44682 this.autoscroll() 44683 } 44684 , 20) : this.autoscrollIncr = 0 44685 } 44686 }, 44687 onModelsInserted(l, e, t) { 44688 this.modelTree.onModelsInserted(l, e, t),
44689 this.visibleNodes.forEach(n=>n.updateLevel()) 44690 }, 44691 onModelsDeleted(l, e, t) { 44692 this.modelTree.onModelsDeleted(l, e, t), 44693 this.visibleNodes.forEach(n=>n.updateLevel()) 44694 }, 44695 onModelsSelected(l, e, t) { 44696 if (!t && l && l.length > 0) { 44697 let n = l[0]; 44698 this.scrollToModel(n) 44699 } 44700 this.visibleNodes.forEach(n=>n.updateSelectionState()) 44701 }, 44702 setFocus() { 44703 console.log("focus", document.activeElement), 44704 this.$refs.modelTree.setFocus() 44705 } 44706 }, 44707 watch: { 44708 "$store.activeDocument"(l) { 44709 this.modelTree.initTree(l) 44710 } 44711 }, 44712 provide() { 44713 return { 44714 setNodeOpen: this.setNodeOpen, 44715 dragData: this.dragData, 44716 setDropTarget: this.setDropTarget, 44717 onModelChanged: this.onModelChanged, 44718 onModelHidden: this.onModelHidden, 44719 onModelLocked: this.onModelLocked, 44720 onNodeDragover: this.onNodeDragover, 44721 setTreeFocus: this.setFocus 44722 } 44723 }, 44724 mounted() { 44725 let l = z(); 44726 l.addModelsInsertCallback(this.onModelsInserted), 44727 l.addModelsRemoveCallback(this.onModelsDeleted), 44728 l.addModelSelectionCallback(this.onModelsSelected); 44729 let e = new ResizeObserver(this.updateRootHeight); 44730 e.observe(this.$refs.modelTree.$el), 44731 this.resizeObserver = e, 44732 this.updateRootHeight(), 44733 document.addEventListener("dragover", this.onGlobalDragover); 44734 let n = V().activeDocument; 44735 n && this.modelTree.initTree(n) 44736 }, 44737 beforeUnmount() { 44738 let l = z(); 44739 l.removeModelsInsertCallback(this.onModelsInserted), 44740 l.removeModelsRemoveCallback(this.onModelsDeleted), 44741 l.removeModelSelectionCallback(this.onModelsSelected), 44742 this.resizeObserver && this.resizeObserver.disconnect(), 44743 document.removeEventListener("dragover", this.onGlobalDragover) 44744 } 44745} 44746 , CV = { 44747 key: 0, 44748 class: "no-objects-message" 44749}; 44750function _V(l, e, t, n, s, o) { 44751 const i = E("model-tree-node") 44752 , r = E("hy-scrollview"); 44753 return N(), 44754 pe(r, { 44755 horizontal: !1, 44756 ref: "modelTree", 44757 onKeydown: o.onKeydown, 44758 tabindex: "0", 44759 class: "model-tree", 44760 onScrollPassive: o.onScroll 44761 }, { 44762 default: O(()=>[_("div", { 44763 class: "container model-tree-viewport", 44764 ref: "viewport", 44765 style: xe({ 44766 height: o.containerHeight + "px" 44767 }) 44768 }, [_("div", { 44769 class: "positioner", 44770 ref: "positioner", 44771 style: xe({ 44772 transform: "translateY(" + o.positionerOffsY + "px)" 44773 }) 44774 }, [(N(!0), 44775 $(Pe, null, Gt(o.visibleNodes, a=>(N(), 44776 pe(i, { 44777 key: a.model, 44778 ref_for: !0, 44779 ref: "node-" + a.model._modelId, 44780 node: a, 44781 rowHeight: s.rowHeight 44782 }, null, 8, ["node", "rowHeight"]))), 128)), _("div", { 44783 ref: "endDiv", 44784 style: xe({ 44785 height: s.consts.endDropTargetHeight + "px" 44786 }), 44787 onDragenter: e[0] || (e[0] = a=>a.preventDefault()), 44788 onDragover: e[1] || (e[1] = (...a)=>o.onEndDrag && o.onEndDrag(...a)), 44789 onDrop: e[2] || (e[2] = (...a)=>o.onEndDrop && o.onEndDrop(...a)), 44790 onDragleave: e[3] || (e[3] = (...a)=>o.onDragleave && o.onDragleave(...a)) 44791 }, null, 36), _("div", { 44792 class: Ne(["insert-indicator", [s.insertClass]]), 44793 style: xe(s.insertStyle) 44794 }, null, 6)], 4)], 4), o.visibleNodes.length === 0 ? (N(), 44795 $("div", CV, se(l.$t("noObjects")), 1)) : be("", !0)]), 44796 _: 1 44797 }, 8, ["onKeydown", "onScrollPassive"]) 44798} 44799const TV = ie(xV, [["render", _V], ["__scopeId", "data-v-6fce9e46"]]) 44800 , kV = { 44801 name: "TreeSidebar", 44802 components: { 44803 ModelTree: TV 44804 }, 44805 props: { 44806 show: Boolean 44807 }, 44808 methods: { 44809 close() { 44810 this.$emit("close") 44811 } 44812 } 44813} 44814 , EV = { 44815 key: 0, 44816 class: "tree-sidebar" 44817} 44818 , DV = { 44819 class: "header" 44820} 44821 , OV = { 44822 class: "tree-container" 44823}; 44824function AV(l, e, t, n, s, o) { 44825 const i = E("model-tree"); 44826 return t.show ? (N(), 44827 $("div", EV, [_("div", DV, [_("div", null, se(l.$t("objects")), 1), _("button", { 44828 class: "close-button", 44829 onClick: e[0] || (e[0] = (...r)=>o.close && o.close(...r)) 44830 }, [...e[1] || (e[1] = [_("svg", {
44831 viewBox: "0 0 14 14", 44832 width: "14", 44833 height: "14", 44834 stroke: "currentColor", 44835 "stroke-width": "2", 44836 fill: "none", 44837 "stroke-linecap": "round", 44838 "stroke-linejoin": "round" 44839 }, [_("path", { 44840 d: "M11 3l-4 4 4 4" 44841 }), _("path", { 44842 d: "M5 3l-4 4 4 4" 44843 })], -1)])])]), _("div", OV, [w(i, { 44844 style: { 44845 flex: "1 1 0" 44846 } 44847 })])])) : be("", !0) 44848} 44849const IV = ie(kV, [["render", AV], ["__scopeId", "data-v-63547a31"]]); 44850class Yf { 44851 started = !1; 44852 timestamp; 44853 startX; 44854 startY; 44855 minDist = 4; 44856 minTime = 50; 44857 minTime2 = 700; 44858 constructor(e, t) { 44859 this.timestamp = performance.now(), 44860 this.startX = e, 44861 this.startY = t 44862 } 44863 dragStarted(e, t) { 44864 if (!this.started) { 44865 let n = performance.now() - this.timestamp; 44866 if (n >= this.minTime) 44867 if (n > this.minTime2) 44868 this.started = !0; 44869 else { 44870 let s = Math.hypot(e - this.startX, t - this.startY) 44871 , o = V().zoom; 44872 s * o / 100 >= this.minDist && (this.started = !0) 44873 } 44874 } 44875 return this.started 44876 } 44877} 44878const vl = "Center" 44879 , Qo = "Left" 44880 , go = "Right" 44881 , mo = "Top" 44882 , ws = "Bottom" 44883 , dh = "handle" 44884 , LV = "frame" 44885 , VV = "content" 44886 , Fl = 1 44887 , Mn = 2 44888 , yo = 3 44889 , $i = 4 44890 , Xi = 5; 44891class NV { 44892 type; 44893 point; 44894 posHor; 44895 posVer; 44896 oppositePoint; 44897 movingCorners; 44898 directionVectors; 44899 transformType; 44900 constructor(e, t, n, s, o, i, r, a) { 44901 this.type = e, 44902 this.point = t, 44903 this.posHor = n, 44904 this.posVer = s, 44905 this.oppositePoint = o, 44906 this.movingCorners = i, 44907 this.directionVectors = r, 44908 this.transformType = a 44909 } 44910} 44911class Og extends Yf { 44912 handle; 44913 startModelTransforms; 44914 selectionStartBounds; 44915 selectionStartTransform; 44916 constructor(e, t, n, s, o, i) { 44917 super(e, t), 44918 this.handle = n, 44919 this.startModelTransforms = s, 44920 this.selectionStartBounds = o, 44921 this.selectionStartTransform = i 44922 } 44923} 44924class yl extends Ho { 44925 dragInfo; 44926 hoverHandle; 44927 guideOverlay; 44928 showSelectionFrame = !0; 44929 resizeMode = "transform"; 44930 unwatchResizeMode; 44931 selFrameBounds; 44932 selFrameTransform; 44933 constructor(e) { 44934 super(e), 44935 Gs(this, yl) 44936 } 44937 setActive(e, t) { 44938 let n = V(); 44939 if (e) { 44940 let s = j(); 44941 for (let o of n.selectedModels) 44942 s.showModelOverlay(o); 44943 this.updateSelectionFrame(), 44944 this.resizeMode === "bounds" ? (this.selFrameBounds = n.transformedSelectionBounds, 44945 this.selFrameTransform = new oe) : (this.selFrameBounds = n.selectionBounds, 44946 this.selFrameTransform = n.selectionTransform), 44947 this.setCursor(!1, "default"), 44948 this.unwatchResizeMode = Ie(()=>n.resizeMode, (o,i)=>{ 44949 this.setResizeMode(o) 44950 } 44951 , { 44952 immediate: !0 44953 }) 44954 } else { 44955 let s = j(); 44956 for (let o of n.selectedModels) 44957 s.removeModelOverlay(o); 44958 s.hideResizeFrame(), 44959 s.clearSelBounds(), 44960 this.unwatchResizeMode?.() 44961 } 44962 } 44963 setResizeMode(e) { 44964 this.resizeMode = e; 44965 let t = V(); 44966 this.resizeMode === "bounds" ? (this.selFrameBounds = t.transformedSelectionBounds, 44967 this.selFrameTransform = new oe) : (this.selFrameBounds = t.selectionBounds, 44968 this.selFrameTransform = t.selectionTransform), 44969 this.updateSelectionFrame() 44970 } 44971 handlePointerDownEvent(e, t, n) { 44972 e.buttons === 1 && (this.updateDragInfo(t, n), 44973 this.updateHoverHandle(t, n), 44974 this.hitTestContext = new Vv(!1,!0)) 44975 } 44976 updateDragInfo(e, t, n) { 44977 let s = V() 44978 , o = this.getHandleAt(e, t, n) 44979 , i = new Map; 44980 for (let r of s.selectedModels) 44981 i.set(r, r.getAggregateTransform()); 44982 this.resizeMode === "transform" ? this.dragInfo = new Og(e,t,o,i,s.selectionBounds?.clone(),s.selectionTransform.clone()) : this.dragInfo = new Og(e,t,o,i,s.transformedSelectionBounds?.clone(),new oe) 44983 } 44984 handlePointerMoveEvent(e, t, n) { 44985 if (e.buttons !== 0 && this.dragInfo == null) 44986 return; 44987 const s = e.shiftKey 44988 , o = e.ctrlKey 44989 , i = e.altKey; 44990 let r = j() 44991 , a = this.dragInfo; 44992 if (a?.handle != null) { 44993 let d = a.handle; 44994 const u = d == null ? null : d.posHor 44995 , h = d == null ? null : d.posVer 44996 , c = u === vl 44997 , f = h === vl; 44998 let p = d ? d.transformType : Fl 44999 , g = p === Mn ? o : p === yo ? !o : !1 45000 , y = t - a.startX 45001 , m = n - a.startY; 45002 if (d != null) { 45003 if (!a.dragStarted(t, n)) 45004 return; 45005 let b = d.point 45006 , M = null 45007 , S = null 45008 , x = d.directionVectors; 45009 p === $i ? (M = x[0], 45010 S = new B(-x[0].y,x[0].x)) : p === Mn ? i ? (M = new B(-x[0].y,x[0].x), 45011 S = x[0]) : (M = x[1], 45012 S = x[0]) : p === yo && g && (M = x[0], 45013 S = x[1]); 45014 let P = null 45015 , C = null; 45016 for (let T of d.movingCorners) { 45017 let k = M, D; 45018 if (p === Mn && g && !i) { 45019 let I = s ? B.interpolate(b, d.oppositePoint, .5) : d.oppositePoint; 45020 k = T.subtract(I), 45021 D = Tl(T, k, new B(b.x + y,b.y + m), S) 45022 } else 45023 M != null ? D = Tl(T, M, new B(T.x + y,T.y + m), S) : D = new B(T.x + y,T.y + m); 45024 if (D != null) { 45025 let I = Vo(D.x, D.y, k, this.hitTestContext); 45026 if (p === yo) 45027 P = I.types[0] != null ? I : null, 45028 C = I.types[1] != null ? I : null, 45029 t = I.x - T.x + a.startX, 45030 n = I.y - T.y + a.startY; 45031 else if (p === Mn || p === $i && !o) { 45032 if (I.types[0] != null || I.types[1] != null) 45033 if (p === Mn && !i && o) { 45034 let F = Tl(new B(I.x,I.y), S, b, M); 45035 P = I.types[0] != null ? I : null, 45036 C = I.types[1] != null ? I : null, 45037 t = F.x - T.x + a.startX, 45038 n = F.y - T.y + a.startY 45039 } else 45040 (P == null || I.distances[0] < P.distances[0]) && (P = I.types[0] != null ? I : null, 45041 C = I.types[1] != null ? I : null, 45042 t = I.x - T.x + a.startX, 45043 n = I.y - T.y + a.startY) 45044 } else 45045 p === Fl && (I.types[0] != null && (P == null || I.distances[0] < P.distances[0]) && (P = I, 45046 t = I.x - T.x + a.startX), 45047 I.types[1] != null && (C == null || I.distances[1] < C.distances[1]) && (C = I, 45048 n = I.y - T.y + a.startY)) 45049 } 45050 } 45051 if (V().isShowAlignGuides()) 45052 if (P != null || C != null) { 45053 let T = P == null ? C.x : P.x 45054 , k = C == null ? P.y : C.y; 45055 r.showAlignLines(T, k, P && P.types[0], C && C.types[1]) 45056 } else 45057 r.showAlignLines(0, 0, !1, !1) 45058 } 45059 if (d != null && !(f && c)) { 45060 const b = u === go 45061 , M = h === ws; 45062 let S = a.selectionStartTransform 45063 , x = a.selectionStartBounds 45064 , P = new B(a.startX,a.startY) 45065 , C = new B(t,n); 45066 if (p === $i) { 45067 let T = f 45068 , k = S.decompose(!1, T) 45069 , D = k.skew; 45070 delete k.skew; 45071 let I = oe.compose(k, !1); 45072 I.invTransformXY(P), 45073 I.invTransformXY(C); 45074 let F, Y = s; 45075 if (T) { 45076 let re = C.y - P.y, ne = Y ? x.width / 2 : x.width, te; 45077 if (o) { 45078 let Me = .08333333333333333 * Math.PI 45079 , De = k.scale[1] / k.scale[0] 45080 , ye = Math.tan(D[1]) 45081 , _e = Math.atan((ye + (b ? 1 : -1) * re / ne) * De) 45082 , Ge = Me * Math.round(_e / Me) 45083 , $e = Math.PI / 2 - Me; 45084 Ge = Math.max(Math.min(Ge, $e), -$e), 45085 te = Math.atan(Math.tan(Ge) / De - ye) 45086 } else 45087 te = Math.atan2((b ? 1 : -1) * re, ne); 45088 let he = x.x + (b && !Y ? 0 : ne); 45089 F = S.clone().skewY(te, he) 45090 } else { 45091 let re = C.x - P.x, ne = Y ? x.height / 2 : x.height, te; 45092 if (o) { 45093 let Me = .08333333333333333 * Math.PI 45094 , De = k.scale[0] / k.scale[1] 45095 , ye = Math.tan(D[0]) 45096 , _e = Math.atan((ye + (M ? 1 : -1) * re / ne) * De) 45097 , Ge = Me * Math.round(_e / Me) 45098 , $e = Math.PI / 2 - Me; 45099 Ge = Math.max(Math.min(Ge, $e), -$e), 45100 te = Math.atan(Math.tan(Ge) / De - ye) 45101 } else 45102 te = Math.atan2((M ? 1 : -1) * re, ne); 45103 let he = x.y + (M && !Y ? 0 : ne); 45104 F = S.clone().skewX(te, he) 45105 } 45106 let q = S.invert(!0).preMultiplyWith(F); 45107 this.changeSelectionTransform(q, F) 45108 } else if (p === Xi) { 45109 let T = new B(x.x,x.y); 45110 T.x += x.width / 2, 45111 T.y += x.height / 2, 45112 S.transformXY(T); 45113 let k = Math.atan2(P.x - T.x, P.y - T.y) 45114 , D = Math.atan2(C.x - T.x, C.y - T.y) 45115 , I = k - D; 45116 if (o) { 45117 let q = .08333333333333333 * Math.PI 45118 , re = S.getRotation(); 45119 I = q * Math.round((re + I) / q), 45120 I -= re 45121 } 45122 let F = new oe().rotate(I, T.x, T.y) 45123 , Y = F.multiplyWith(S, !0); 45124 this.changeSelectionTransform(F, Y), 45125 this.updateCursor(Xi, u, h) 45126 } else if (p === Mn || p === yo) { 45127 S.invTransformXY(P), 45128 S.invTransformXY(C); 45129 let T = C.x - P.x, k = C.y - P.y, D = s, I, F, Y, q; 45130 f ? (F = 0, 45131 q = 0) : D ? (F = M ? -k : k, 45132 q = M ? 2 * k : -2 * k) : (F = M ? 0 : k, 45133 q = M ? k : -k), 45134 c ? (I = 0, 45135 Y = 0) : D ? (I = b ? -T : T, 45136 Y = b ? 2 * T : -2 * T) : (I = b ? 0 : T, 45137 Y = b ? T : -T); 45138 let re = 1 + Y / x.width 45139 , ne = 1 + q / x.height; 45140 if (Math.abs(re) < 1e-8 && (re = 1e-8), 45141 Math.abs(ne) < 1e-8 && (ne = 1e-8), 45142 p === Mn && i) { 45143 let te = S.decompose(!1, f) 45144 , he = new oe; 45145 he.translate(te.translate[0], te.translate[1]), 45146 he.rotate(te.rotate), 45147 he.scale(te.scale[0], te.scale[1]), 45148 c ? (he.scale(1, ne, 0, x.y + (D ? x.height / 2 : M ? 0 : x.height)), 45149 he.skewX(te.skew[0])) : (he.scale(re, 1, x.x + (D ? x.width / 2 : b ? 0 : x.width), 0), 45150 he.skewY(te.skew[1])); 45151 let Me = S.invert(!0).preMultiplyWith(he); 45152 this.changeSelectionTransform(Me, he) 45153 } else { 45154 g && (c || !f && Math.abs(re) > Math.abs(ne) ? (re = Math.abs(ne) * (re > 0 ? 1 : -1), 45155 Y = (re - 1) * x.width, 45156 c ? I = -Y / 2 : b ? I = D ? -Y / 2 : 0 : I = D ? -Y / 2 : -Y) : (f || !c && Math.abs(re) < Math.abs(ne)) && (ne = Math.abs(re) * (ne > 0 ? 1 : -1), 45157 q = (ne - 1) * x.height, 45158 f ? F = -q / 2 : M ? F = D ? -q / 2 : 0 : F = D ? -q / 2 : -q)); 45159 let te = S.clone(); 45160 te.translate(x.x, x.y), 45161 te.scale(re, ne), 45162 te.translate(re === 0 ? 0 : I / re - x.x, ne === 0 ? 0 : F / ne - x.y); 45163 let he = S.invert(!0).preMultiplyWith(te); 45164 this.changeSelectionTransform(he, te), 45165 this.updateCursor(Mn, u, h) 45166 } 45167 } 45168 } else if (p === Fl) { 45169 if (o) { 45170 let P = a.startX 45171 , C = a.startY 45172 , T = Kl(t, n, P, C, !0); 45173 t = T.x, 45174 n = T.y; 45175 let k = T.angle 45176 , D = a.selectionStartBounds 45177 , I = D.x + D.width / 2 45178 , F = D.y + D.height / 2 45179 , Y = new B(I,F); 45180 a.selectionStartTransform.transformXY(Y), 45181 this.guideOverlay = r.showGuideLine(Y.x, Y.y, k, this.guideOverlay) 45182 } else 45183 r.hideGuide(this.guideOverlay); 45184 let b = t - a.startX 45185 , M = n - a.startY 45186 , S = new oe(1,0,0,1,b,M) 45187 , x = S.multiplyWith(a.selectionStartTransform, !0); 45188 this.changeSelectionTransform(S, x) 45189 } 45190 } else 45191 this.updateHoverHandle(t, n, e.target2) 45192 } 45193 updateHoverHandle(e, t, n, s=!0) { 45194 let o = j() 45195 , i = e == null || t == null ? null : this.getHandleAt(e, t); 45196 this.hoverHandle != null && o.setHoverHandleOverlay(this.hoverHandle, !1), 45197 i != null && o.setHoverHandleOverlay(i, !0), 45198 this.hoverHandle = i; 45199 let r = z() 45200 , a = V() 45201 , d = i && i.transformType; 45202 if (d == null && s) { 45203 if (!n) { 45204 let h = ty([a.pointerX, a.pointerY]); 45205 n = document.elementFromPoint(h[0], h[1]) 45206 } 45207 let u = this.getModelForElement(n); 45208 u != null && r.isModelSelected(u, !0) && (d = Fl) 45209 } 45210 this.updateCursor(d, i && i.posHor, i && i.posVer) 45211 } 45212 cancelPointerDrag(e, t) { 45213 if (this.dragInfo != null) { 45214 let n = j(); 45215 if (n.hideGuide(this.guideOverlay), 45216 n.showAlignLines(0, 0, !1, !1), 45217 this.dragInfo = null, 45218 this.updateHoverHandle(e, t, null), 45219 this.resizeMode === "bounds") { 45220 let s = V(); 45221 this.selFrameBounds = s.transformedSelectionBounds, 45222 this.selFrameTransform = new oe, 45223 this.updateSelectionFrame() 45224 } 45225 } 45226 } 45227 handlePointerUpEvent(e, t, n) { 45228 let s = e.pointerType === "touch" || e.pointerType === "pen"; 45229 this.cancelPointerDrag(s ? null : t, s ? null : n) 45230 } 45231 handlePointerleaveEvent(e) { 45232 j().hideGuide(this.guideOverlay) 45233 } 45234 handleKeyDownEvent(e) { 45235 let t = e.key 45236 , n = e.repeat 45237 , s = !1;
45237 45238 t === ou || e.key === su ? n || (Pv(), 45239 s = !0) : !e.ctrlKey && !e.altKey && (t === hn ? (this.moveSelectedModels(0, -1), 45240 s = !0) : t === cs ? (this.moveSelectedModels(0, 1), 45241 s = !0) : t === Io ? (this.moveSelectedModels(-1, 0), 45242 s = !0) : t === Lo && (this.moveSelectedModels(1, 0), 45243 s = !0)), 45244 s && e.preventDefault() 45245 } 45246 handleKeyUpEvent(e) { 45247 let t = e.key 45248 , n = !1; 45249 t === tc && this.dragInfo != null && (n = !0), 45250 n && e.preventDefault() 45251 } 45252 moveSelectedModels(e, t) { 45253 let n = V(); 45254 if (n.selectedModels.length > 0) { 45255 let o = new oe(1,0,0,1,e,t) 45256 , i = n.selectionTransform 45257 , r = o.multiplyWith(i, !0); 45258 this.changeSelectionTransform(o, r) 45259 } 45260 } 45261 changeSelectionTransform(e, t) { 45262 let s = V().selectedModels 45263 , o = this.dragInfo?.startModelTransforms 45264 , i = []; 45265 for (let a of s) { 45266 let u = (o ? o.get(a) : a.getSelfTransform()).preMultiplyWith(e, !0); 45267 u.preMultiplyWith(a.getParentModel().getAggregateTransform().invert()), 45268 i.push(u) 45269 } 45270 z().setSelModelsTransforms(i, t, !1), 45271 this.resizeMode === "bouns" ? this.selFrameTransform = V().selectionTransform.multiplyWith(this.dragInfo.selectionStartTransform.invert()) : this.selFrameTransform = t.clone() 45272 } 45273 getHandleAt(e, t, n) { 45274 let s = this.selFrameBounds; 45275 if (s == null) 45276 return null; 45277 let o = [new B(s.x,s.y), new B(s.x + s.width,s.y), new B(s.x + s.width,s.y + s.height), new B(s.x,s.y + s.height)] 45278 , i = this.selFrameTransform; 45279 i && o.forEach(P=>i.transformXY(P)); 45280 let r = o[1].subtract(o[0]), a = o[3].subtract(o[0]), d, u, h, c, f, p = 1500 / this.getZoom(), g = 2 * p, y = Number.MAX_VALUE, m = new B(e,t), b = B.interpolate(o[0], o[2], .5), M = m.dist(b), S = !1, x; 45281 for (let P = 0; P < 4; P++) { 45282 let C = o[P] 45283 , T = o[P < 3 ? P + 1 : 0] 45284 , k = Jt(C.x, C.y, T.x, T.y, e, t, !1) 45285 , D = m.dist(k); 45286 if (D <= 3 * p) { 45287 let I = M <= k.dist(b); 45288 if (D < Math.min(y, I ? p : g) && (C.dist(k) < p && (d = dh, 45289 u = C, 45290 h = P % 3 ? go : Qo, 45291 c = P < 2 ? mo : ws, 45292 f = o[P < 2 ? P + 2 : P - 2], 45293 y = D, 45294 S = S || D < p, 45295 x = S ? yo : Xi), 45296 T.dist(k) < p && (d = dh, 45297 u = C, 45298 h = P < 2 ? go : Qo, 45299 c = P % 3 ? ws : mo, 45300 f = o[P < 2 ? P + 2 : P - 2], 45301 y = D, 45302 S = S || D < p, 45303 x = S ? yo : Xi)), 45304 !S && D < Math.min(y, I ? p : g)) { 45305 let Y = B.interpolate(C, T, .5); 45306 k.dist(Y) < p ? (d = dh, 45307 u = Y, 45308 h = P === 1 ? go : P === 3 ? Qo : vl, 45309 c = P === 0 ? mo : P === 2 ? ws : vl, 45310 f = B.interpolate(o[P < 2 ? P + 2 : P - 2], o[P > 0 ? P - 1 : 3], .5), 45311 y = m.dist(k), 45312 x = D < p ? Mn : $i) : D < p && (d = LV, 45313 u = C, 45314 h = vl, 45315 c = vl, 45316 y = m.dist(k), 45317 x = Fl) 45318 } 45319 } 45320 } 45321 if (n && (d = VV, 45322 u = m, 45323 h = vl, 45324 c = vl, 45325 x = Fl), 45326 u != null) { 45327 let P = []; 45328 h !== go && (c !== mo && P.push(o[3]), 45329 c !== ws && P.push(o[0])), 45330 h !== Qo && (c !== mo && P.push(o[2]), 45331 c !== ws && P.push(o[1])); 45332 let C; 45333 if (h === vl) 45334 c !== vl && (C = [r, a]); 45335 else if (c === vl) 45336 C = [a, r]; 45337 else if (h === Qo && c === mo || h === go && c === ws) { 45338 let T = o[2].subtract(o[0]); 45339 C = [T, new B(-T.y,T.x)] 45340 } else { 45341 let T = o[3].subtract(o[1]); 45342 C = [T, new B(-T.y,T.x)] 45343 } 45344 return new NV(d,u,h,c,f,P,C,x) 45345 } 45346 return null 45347 } 45348 onModelSelectionChanged(e, t) { 45349 let n = j(); 45350 if (t != null) 45351 for (let o = t.length - 1; o >= 0; o--) { 45352 let i = t[o]; 45353 (e == null || !e.includes(i)) && n.removeModelOverlay(i) 45354 } 45355 if (e != null) 45356 for (let o of e) 45357 n.showModelOverlay(o); 45358 let s = V(); 45359 s.selectionTransform.set(), 45360 this.updateSelectionFrame(), 45361 this.updateHoverHandle(s.pointerX, s.pointerY, null), 45362 this.resizeMode === "bounds" ? (this.selFrameBounds = s.transformedSelectionBounds, 45363 this.selFrameTransform = new oe) : (this.selFrameBounds = s.selectionBounds, 45364 this.selFrameTransform = s.selectionTransform) 45365 } 45366 updateSelectionFrame() { 45367 let e = j() 45368 , t = V() 45369 , n = t.selectedModels; 45370 if (n.length > 0) 45371 if (this.resizeMode === "bounds") { 45372 let s, o, i; 45373 if (n.length === 1) { 45374 let r = n[0]; 45375 o = r.getAggregateTransform(), 45376 s = r.getBounds(), 45377 i = r.getTransformedBounds(r.getAggregateTransform()) 45378 } else { 45379 o = t.selectionTransform; 45380 let r = o.invert(!0);
45381 n.forEach(a=>{ 45382 let d = a.getAggregateTransform().preMultiplyWith(r) 45383 , u = a.getTransformedBounds(d); 45384 a.getTransformedBounds(a.getAggregateTransform()), 45385 s = s ? s.addRect(u) : u, 45386 i = i ? i.addRect(u) : u 45387 } 45388 ) 45389 } 45390 t.selectionTransform.setFromTransform(o), 45391 t.selectionBounds = s, 45392 t.transformedSelectionBounds = i, 45393 this.showSelectionFrame && (e.showResizeFrame(this.selFrameBounds, this.selFrameTransform), 45394 this.selFrameTransform.isIdentity ? e.clearSelBounds() : e.updateSelBounds([i], [new oe])) 45395 } else { 45396 let s, o, i; 45397 if (n.length === 1) { 45398 let r = n[0]; 45399 o = r.getAggregateTransform(), 45400 s = r.getBounds(), 45401 i = r.getTransformedBounds() 45402 } else { 45403 o = t.selectionTransform; 45404 let r = o.invert(!0); 45405 n.forEach(a=>{ 45406 let d = a.getAggregateTransform().preMultiplyWith(r) 45407 , u = a.getTransformedBounds(d) 45408 , h = a.getTransformedBounds(); 45409 i = i ? i.addRect(h) : h, 45410 s = s ? s.addRect(u) : u 45411 } 45412 ) 45413 } 45414 t.transformedSelectionBounds = i, 45415 t.selectionTransform.setFromTransform(o), 45416 t.selectionBounds = s, 45417 this.showSelectionFrame && e.showResizeFrame(s, o) 45418 } 45419 else 45420 t.selectionTransform.set(1, 0, 0, 1, 0, 0), 45421 t.selectionBounds = null, 45422 e.hideResizeFrame(), 45423 e.clearSelBounds() 45424 } 45425 onSelectionGeometryChanged() { 45426 let e = V() 45427 , t = j(); 45428 for (let n of e.selectedModels) 45429 t.updateModelOverlay(n); 45430 this.updateSelectionFrame(), 45431 this.resizeMode === "bounds" ? this.dragInfo || (this.selFrameBounds = e.transformedSelectionBounds, 45432 this.selFrameTransform = new oe) : (this.selFrameBounds = e.selectionBounds, 45433 this.selFrameTransform = e.selectionTransform) 45434 } 45435 onTextSelectionChanged() { 45436 let e = V() 45437 , t = j(); 45438 for (let n of e.selectedModels) 45439 n.getType() === "text" && t.updateModelOverlay(n); 45440 this.updateSelectionFrame() 45441 } 45442 onNodePointsMoved(e, t) { 45443 let n = z() 45444 , s = j(); 45445 for (let o of t) { 45446 for (; o && !n.isModelSelected(o); ) 45447 o = o.getParentModel(); 45448 o && s.updateModelOverlay(o) 45449 } 45450 this.updateSelectionFrame() 45451 } 45452 onNodePointsChanged(e, t, n, s) { 45453 j().updateModelOverlay(e), 45454 this.updateSelectionFrame() 45455 } 45456 updateCursor(e, t, n) { 45457 let s = this.selFrameTransform, o; 45458 switch (e) { 45459 case Fl: 45460 o = "move"; 45461 break; 45462 case Mn: 45463 case yo: 45464 o = "scale"; 45465 break; 45466 case $i: 45467 o = "skew"; 45468 break; 45469 case Xi: 45470 o = "rotate"; 45471 break; 45472 default: 45473 o = "default" 45474 } 45475 if (t == null) 45476 this.setCursor(!1, o); 45477 else { 45478 let i, r = t === Qo ? -1 : 1, a = n === mo ? -1 : 1, d = new B(r,0), u = new B(0,a); 45479 if (s != null && !s.isIdentity) { 45480 let c = s.decomposeAlt(); 45481 c.translate[0] = 0, 45482 c.translate[1] = 0, 45483 s = oe.composeAlt(c), 45484 s.transformXY(d), 45485 s.transformXY(u) 45486 } 45487 o === "rotate" ? (d.setLength(1), 45488 u.setLength(1), 45489 i = d.add(u).getAngle(!0), 45490 i += 45) : o === "skew" ? t === vl ? i = d.getAngle(!0) : i = u.getAngle(!0) : o === "scale" && (t === vl ? i = u.getAngle(!0) : n === vl ? i = d.getAngle(!0) : i = (d.getAngle(!0) + u.getAngle(!0)) / 2); 45491 let h = o !== "default" && this.dragInfo != null; 45492 this.setCursor(h, o, i) 45493 } 45494 } 45495} 45496class yu { 45497 xStart; 45498 yStart; 45499 constructor(e, t) { 45500 Gs(this, yu), 45501 this.xStart = e, 45502 this.yStart = t 45503 } 45504 moveTo(e, t) { 45505 As() 45506 } 45507 getPointsString() { 45508 As() 45509 } 45510 getPointsInFill() { 45511 As() 45512 } 45513} 45514class RV extends yu { 45515 xMin; 45516 xMax; 45517 yMin; 45518 yMax; 45519 models; 45520 modelsBounds; 45521 originalSelModels; 45522 selectOnTouch; 45523 constructor(e, t, n, s, o) { 45524 super(n, s), 45525 this.xMin = n, 45526 this.yMin = s, 45527 this.xMax = n, 45528 this.yMax = s, 45529 this.models = e, 45530 this.modelsBounds = e.map(i=>i.getTransformedBounds()), 45531 this.originalSelModels = t, 45532 this.selectOnTouch = !!o 45533 } 45534 moveTo(e, t) { 45535 this.xMin = He(this.xStart, e), 45536 this.yMin = He(this.yStart, t), 45537 this.xMax = Ee(this.xStart, e), 45538 this.yMax = Ee(this.yStart, t) 45539 } 45540 getPointsString() { 45541 return "" + this.xMin + "," + this.yMin + " " + this.xMax + "," + this.yMin + " " + this.xMax + "," + this.yMax + " " + this.xMin + "," + this.yMax 45542 } 45543 getModelsInFill() { 45544 let e = this.modelsBounds 45545 , t = this.models 45546 , n = new Set; 45547 for (let s = 0; s < e.length; s++) { 45548 let o = e[s]; 45549 o != null && this.isBoundsSelected(o) && n.add(t[s]) 45550 } 45551 return n 45552 } 45553 isBoundsSelected(e) { 45554 return this.selectOnTouch ? e.x <= this.xMax && e.y <= this.yMax && e.x + e.width >= this.xMin && e.y + e.height >= this.yMin : e.x >= this.xMin && e.y >= this.yMin && e.x + e.width <= this.xMax && e.y + e.height <= this.yMax 45555 } 45556} 45557const FV = { 45558 name: "AlignDropdown", 45559 components: { 45560 HySelect: Dl, 45561 HyRadio: en, 45562 HyGroup: Dt, 45563 HyCheckbox: ml, 45564 HyTooltip: pt, 45565 SvgIcon: gt, 45566 HyDropdown: xl 45567 }, 45568 data() { 45569 return Object.assign(this.getInitialData(), { 45570 alignHorBoundsItems: me(["left", "center", "right"]), 45571 alignVerBoundsItems: me(["top", "center", "bottom"]), 45572 referenceOptions: me([{ 45573 value: "lastSelected", 45574 label: "Last Selected" 45575 }, { 45576 value: "firstSelected", 45577 label: "First Selected" 45578 }, { 45579 value: "document", 45580 label: "Document" 45581 }, { 45582 value: "selection", 45583 label: "Selection" 45584 }]), 45585 svgs: me({ 45586 alignElements: Hx, 45587 alignElementsLeft: D2, 45588 alignElementsRight: O2, 45589 alignElementsCenterHor: A2, 45590 alignElementsTop: I2, 45591 alignElementsBottom: L2, 45592 alignElementsCenterVer: V2 45593 }), 45594 boundsSideHorSvgs: me({ 45595 left: N2, 45596 center: R2, 45597 right: F2 45598 }), 45599 boundsSideVerSvgs: me({ 45600 top: B2, 45601 center: z2, 45602 bottom: U2 45603 }) 45604 }) 45605 }, 45606 computed: { 45607 selModelsCount() { 45608 let l = V().selectedModels; 45609 return l ? l.length : 0 45610 } 45611 }, 45612 methods: { 45613 getInitialData() { 45614 return { 45615 selectBoundsSide: !1, 45616 alignVer: null, 45617 alignHor: null, 45618 boundsSideHor: "left", 45619 boundsSideVer: "top", 45620 options: { 45621 reference: "selection", 45622 alignAsGroup: !1, 45623 boundsSide: null 45624 } 45625 } 45626 }, 45627 onOpen() { 45628 Object.assign(this.$data, this.getInitialData()), 45629 this.selModelsCount < 2 && (this.options.reference = "document"), 45630 this.lastUndoEdit = ae().getLastEdit() 45631 }, 45632 async updateAlignment() { 45633 await ae().undoUntil(this.lastUndoEdit); 45634 let e = this.alignHor 45635 , t = e && this.selectBoundsSide ? this.boundsSideHor : e 45636 , n = this.alignVer 45637 , s = n && this.selectBoundsSide ? this.boundsSideVer : n; 45638 yv(e, t, n, s, this.options) 45639 } 45640 }, 45641 watch: { 45642 alignHor(l) { 45643 l && !this.selectBoundsSide && (this.boundsSideHor = l), 45644 this.updateAlignment() 45645 }, 45646 alignVer(l) { 45647 l && !this.selectBoundsSide && (this.boundsSideVer = l), 45648 this.updateAlignment() 45649 }, 45650 boundsSideHor() { 45651 this.selectBoundsSide && (this.alignHor || this.alignVer) && this.updateAlignment() 45652 }, 45653 boundsSideVer() { 45654 this.selectBoundsSide && (this.alignHor || this.alignVer) && this.updateAlignment() 45655 }, 45656 selectBoundsSide(l) { 45657 if (!l) { 45658 let e = !1; 45659 this.alignHor && this.boundsSideHor !== this.alignHor && (this.boundsSideHor = this.alignHor, 45660 e = !0), 45661 this.alignVer && this.boundsSideVer !== this.alignVer && (this.boundsSideVer = this.alignVer, 45662 e = !0), 45663 e && this.updateAlignment() 45664 } 45665 }, 45666 options: { 45667 handler() { 45668 (this.alignHor || this.alignVer) && this.updateAlignment() 45669 }, 45670 deep: !0 45671 } 45672 } 45673} 45674 , BV = { 45675 ref: "container", 45676 class: "container" 45677} 45678 , zV = { 45679 style: { 45680 display: "flex", 45681 "align-items": "center", 45682 gap: "16px" 45683 } 45684} 45685 , UV = { 45686 style: { 45687 "line-height": "0", 45688 "padding-left": "4px" 45689 } 45690} 45691 , GV = { 45692 style: { 45693 display: "flex", 45694 "align-items": "center", 45695 gap: "8px" 45696 } 45697} 45698 , HV = { 45699 style: { 45700 display: "flex", 45701 "align-items": "center", 45702 gap: "16px" 45703 } 45704} 45705 , $V = { 45706 style: { 45707 "line-height": "0", 45708 "padding-left": "4px" 45709 } 45710} 45711 , XV = { 45712 style: { 45713 display: "flex", 45714 "align-items": "center", 45715 gap: "8px" 45716 } 45717} 45718 , YV = { 45719 style: { 45720 "align-self": "start" 45721 } 45722} 45723 , KV = { 45724 style: { 45725 display: "flex", 45726 "flex-direction": "column", 45727 gap: "8px" 45728 } 45729} 45730 , WV = { 45731 style: { 45732 "grid-column": "span 2", 45733 display: "flex", 45734 "flex-direction": "column", 45735 gap: "8px", 45736 "align-items": "flex-start" 45737 } 45738}; 45739function qV(l, e, t, n, s, o) { 45740 const i = E("svg-icon") 45741 , r = E("hy-tooltip") 45742 , a = E("hy-radio") 45743 , d = E("hy-group") 45744 , u = E("hy-select") 45745 , h = E("hy-checkbox") 45746 , c = E("hy-dropdown"); 45747 return N(), 45748 pe(c, { 45749 ref: "openButton", 45750 disabled: o.selModelsCount === 0, 45751 onOpen: o.onOpen, 45752 "popover-style": "max-width: 100vw;", 45753 popupSecondaryPos: "center" 45754 }, {
45755 button: O(()=>[w(i, { 45756 svg: l.svgs.alignElements 45757 }, null, 8, ["svg"]), w(r, { 45758 getTarget: ()=>l.$refs.openButton, 45759 label: l.$t("actions.align") 45760 }, null, 8, ["getTarget", "label"])]), 45761 default: O(()=>[_("div", BV, [_("span", null, se(l.$t("alignDropdown.horAlignment")), 1), _("div", zV, [w(d, null, { 45762 default: O(()=>[w(a, { 45763 ref: "alignHorLeft", 45764 type: "button", 45765 modelValue: l.alignHor, 45766 "onUpdate:modelValue": e[0] || (e[0] = f=>l.alignHor = f), 45767 name: "alignHor", 45768 value: "left", 45769 uncheckedValue: null 45770 }, { 45771 default: O(()=>[w(i, { 45772 svg: l.svgs.alignElementsLeft 45773 }, null, 8, ["svg"]), w(r, { 45774 getTarget: ()=>l.$refs.alignHorLeft, 45775 label: l.$t("alignDropdown.alignHorLeft") 45776 }, null, 8, ["getTarget", "label"])]), 45777 _: 1 45778 }, 8, ["modelValue"]), w(a, { 45779 ref: "alignHorCenter", 45780 type: "button", 45781 modelValue: l.alignHor, 45782 "onUpdate:modelValue": e[1] || (e[1] = f=>l.alignHor = f), 45783 name: "alignHor", 45784 value: "center", 45785 uncheckedValue: null 45786 }, { 45787 default: O(()=>[w(i, { 45788 svg: l.svgs.alignElementsCenterHor 45789 }, null, 8, ["svg"]), w(r, { 45790 getTarget: ()=>l.$refs.alignHorCenter, 45791 label: l.$t("alignDropdown.alignHorCenter") 45792 }, null, 8, ["getTarget", "label"])]), 45793 _: 1 45794 }, 8, ["modelValue"]), w(a, { 45795 ref: "alignHorRight", 45796 type: "button", 45797 modelValue: l.alignHor, 45798 "onUpdate:modelValue": e[2] || (e[2] = f=>l.alignHor = f), 45799 name: "alignHor", 45800 value: "right", 45801 uncheckedValue: null 45802 }, { 45803 default: O(()=>[w(i, { 45804 svg: l.svgs.alignElementsRight 45805 }, null, 8, ["svg"]), w(r, { 45806 getTarget: ()=>l.$refs.alignHorRight, 45807 label: l.$t("alignDropdown.alignHorRight") 45808 }, null, 8, ["getTarget", "label"])]), 45809 _: 1 45810 }, 8, ["modelValue"])]), 45811 _: 1 45812 }), w(u, { 45813 ref: "horBoundSide", 45814 items: l.alignHorBoundsItems, 45815 modelValue: l.boundsSideHor, 45816 "onUpdate:modelValue": e[3] || (e[3] = f=>l.boundsSideHor = f), 45817 style: xe({ 45818 visibility: l.selectBoundsSide ? "visible" : "hidden" 45819 }) 45820 }, { 45821 button: O(({value: f})=>[_("div", UV, [w(i, { 45822 svg: l.boundsSideHorSvgs[f] 45823 }, null, 8, ["svg"])]), w(r, { 45824 getTarget: ()=>l.$refs.horBoundSide, 45825 label: l.$t("alignDropdown.horBoundsSide") 45826 }, null, 8, ["getTarget", "label"])]), 45827 default: O(({value: f})=>[_("div", GV, [w(i, { 45828 svg: l.boundsSideHorSvgs[f] 45829 }, null, 8, ["svg"]), ve(" " + se(f), 1)])]), 45830 _: 1 45831 }, 8, ["items", "modelValue", "style"])]), _("span", null, se(l.$t("alignDropdown.verAlignment")), 1), _("div", HV, [w(d, null, { 45832 default: O(()=>[w(a, { 45833 ref: "alignVerTop", 45834 type: "button", 45835 modelValue: l.alignVer, 45836 "onUpdate:modelValue": e[4] || (e[4] = f=>l.alignVer = f), 45837 name: "alignVer", 45838 value: "top", 45839 uncheckedValue: null 45840 }, { 45841 default: O(()=>[w(i, { 45842 svg: l.svgs.alignElementsTop 45843 }, null, 8, ["svg"]), w(r, { 45844 getTarget: ()=>l.$refs.alignVerTop, 45845 label: l.$t("alignDropdown.alignVerTop") 45846 }, null, 8, ["getTarget", "label"])]), 45847 _: 1 45848 }, 8, ["modelValue"]), w(a, { 45849 ref: "alignVerCenter", 45850 type: "button", 45851 modelValue: l.alignVer, 45852 "onUpdate:modelValue": e[5] || (e[5] = f=>l.alignVer = f), 45853 name: "alignVer", 45854 value: "center", 45855 uncheckedValue: null 45856 }, { 45857 default: O(()=>[w(i, { 45858 svg: l.svgs.alignElementsCenterVer 45859 }, null, 8, ["svg"]), w(r, { 45860 getTarget: ()=>l.$refs.alignVerCenter, 45861 label: l.$t("alignDropdown.alignVerCenter") 45862 }, null, 8, ["getTarget", "label"])]), 45863 _: 1 45864 }, 8, ["modelValue"]), w(a, { 45865 ref: "alignVerBottom", 45866 type: "button", 45867 modelValue: l.alignVer, 45868 "onUpdate:modelValue": e[6] || (e[6] = f=>l.alignVer = f), 45869 name: "alignVer", 45870 value: "bottom", 45871 uncheckedValue: null 45872 }, { 45873 default: O(()=>[w(i, { 45874 svg: l.svgs.alignElementsBottom 45875 }, null, 8, ["svg"]), w(r, { 45876 getTarget: ()=>l.$refs.alignVerBottom, 45877 label: l.$t("alignDropdown.alignVerBottom") 45878 }, null, 8, ["getTarget", "label"])]), 45879 _: 1 45880 }, 8, ["modelValue"])]), 45881 _: 1 45882 }), w(u, { 45883 ref: "verBoundSide", 45884 items: l.alignVerBoundsItems,
45885 modelValue: l.boundsSideVer, 45886 "onUpdate:modelValue": e[7] || (e[7] = f=>l.boundsSideVer = f), 45887 style: xe({ 45888 visibility: l.selectBoundsSide ? "visible" : "hidden" 45889 }) 45890 }, { 45891 button: O(({value: f})=>[_("div", $V, [w(i, { 45892 svg: l.boundsSideVerSvgs[f] 45893 }, null, 8, ["svg"])]), w(r, { 45894 getTarget: ()=>l.$refs.verBoundSide, 45895 label: l.$t("alignDropdown.verBoundsSide") 45896 }, null, 8, ["getTarget", "label"])]), 45897 default: O(({value: f})=>[_("div", XV, [w(i, { 45898 svg: l.boundsSideVerSvgs[f] 45899 }, null, 8, ["svg"]), _("span", null, se(f), 1)])]), 45900 _: 1 45901 }, 8, ["items", "modelValue", "style"])]), _("span", YV, se(l.$t("alignDropdown.relativeTo")), 1), _("div", KV, [w(a, { 45902 label: l.$t("alignDropdown.selection"), 45903 modelValue: l.options.reference, 45904 "onUpdate:modelValue": e[8] || (e[8] = f=>l.options.reference = f), 45905 value: "selection", 45906 name: "reference", 45907 disabled: o.selModelsCount < 2 45908 }, null, 8, ["label", "modelValue", "disabled"]), w(a, { 45909 label: l.$t("alignDropdown.document"), 45910 modelValue: l.options.reference, 45911 "onUpdate:modelValue": e[9] || (e[9] = f=>l.options.reference = f), 45912 value: "document", 45913 name: "reference" 45914 }, null, 8, ["label", "modelValue"]), w(a, { 45915 label: l.$t("alignDropdown.lastSelected"), 45916 modelValue: l.options.reference, 45917 "onUpdate:modelValue": e[10] || (e[10] = f=>l.options.reference = f), 45918 value: "lastSelected", 45919 name: "reference", 45920 disabled: o.selModelsCount < 2 45921 }, null, 8, ["label", "modelValue", "disabled"]), w(a, { 45922 label: l.$t("alignDropdown.firstSelected"), 45923 modelValue: l.options.reference, 45924 "onUpdate:modelValue": e[11] || (e[11] = f=>l.options.reference = f), 45925 value: "firstSelected", 45926 name: "reference", 45927 disabled: o.selModelsCount < 2 45928 }, null, 8, ["label", "modelValue", "disabled"])]), _("div", WV, [w(h, { 45929 modelValue: l.selectBoundsSide, 45930 "onUpdate:modelValue": e[12] || (e[12] = f=>l.selectBoundsSide = f), 45931 label: l.$t("alignDropdown.selectBoundsSide") 45932 }, null, 8, ["modelValue", "label"]), w(h, { 45933 modelValue: l.options.alignAsGroup, 45934 "onUpdate:modelValue": e[13] || (e[13] = f=>l.options.alignAsGroup = f), 45935 label: l.$t("alignDropdown.alignAsGroup"), 45936 disabled: o.selModelsCount < 2 45937 }, null, 8, ["modelValue", "label", "disabled"])])], 512)]), 45938 _: 1 45939 }, 8, ["disabled", "onOpen"]) 45940} 45941const jV = ie(FV, [["render", qV], ["__scopeId", "data-v-c2f73969"]]) 45942 , JV = { 45943 name: "BooleanOpsDropdown", 45944 components: { 45945 HyLabel: Bn, 45946 HyRadio: en, 45947 HyCheckbox: ml, 45948 SvgIcon: gt, 45949 HyTooltip: pt, 45950 HyDropdown: xl 45951 }, 45952 data() { 45953 return { 45954 boolOp: null, 45955 options: { 45956 primaryModelType: "back", 45957 keepOriginalModels: !1 45958 }, 45959 singleSelection: !1, 45960 svgs: me({ 45961 booleanOps: Nx, 45962 booleanUnite: C2, 45963 booleanSubtract: _2, 45964 booleanIntersect: T2 45965 }), 45966 isOpen: !1 45967 } 45968 }, 45969 computed: { 45970 selModelsCount() { 45971 let l = V().selectedModels; 45972 return l ? l.length : 0 45973 }, 45974 disabled() { 45975 return this.selModelsCount < 1 && !this.isOpen 45976 } 45977 }, 45978 methods: { 45979 getInitialData() { 45980 return { 45981 boolOp: null, 45982 options: { 45983 primaryModelType: "back", 45984 keepOriginalModels: !1 45985 } 45986 } 45987 }, 45988 async updatePathOp() { 45989 let l = ae(); 45990 await l.undoUntil(this.lastUndoEdit), 45991 l.startCompoundEdit(); 45992 let e = this.boolOp; 45993 e && (e === "unite" ? await Lf.performAction(this.options) : e === "subtract" ? await Vf.performAction(this.options) : e === "intersect" && await Nf.performAction(this.options)), 45994 l.endCompoundEdit() 45995 }, 45996 onOpen() { 45997 this.isOpen = !0, 45998 Object.assign(this.$data, this.getInitialData()), 45999 this.singleSelection = this.selModelsCount < 2, 46000 this.lastUndoEdit = ae().getLastEdit() 46001 }, 46002 onClose() { 46003 this.isOpen = !1, 46004 this.lastUndoEdit = null 46005 } 46006 }, 46007 watch: { 46008 boolOp() { 46009 this.updatePathOp() 46010 }, 46011 options: { 46012 handler() { 46013 this.boolOp && this.updatePathOp() 46014 }, 46015 deep: !0 46016 } 46017 } 46018} 46019 , ZV = { 46020 class: "container" 46021} 46022 , QV = { 46023 style: { 46024 display: "flex", 46025 "flex-direction": "column", 46026 gap: "8px" 46027 } 46028} 46029 , eN = { 46030 style: { 46031 "grid-column": "span 2", 46032 display: "flex", 46033 "flex-direction": "column", 46034 gap: "8px", 46035 "align-items": "flex-start" 46036 } 46037}; 46038function tN(l, e, t, n, s, o) { 46039 const i = E("svg-icon") 46040 , r = E("hy-tooltip") 46041 , a = E("hy-radio") 46042 , d = E("hy-group") 46043 , u = E("hy-label") 46044 , h = E("hy-checkbox") 46045 , c = E("hy-dropdown"); 46046 return N(), 46047 pe(c, { 46048 ref: "openButton", 46049 disabled: o.disabled, 46050 onOpen: o.onOpen, 46051 onClose: o.onClose, 46052 popupSecondaryPos: "center" 46053 }, {
46054 button: O(()=>[...e[8] || (e[8] = [])]), 46055 default: O(()=>[_("div", ZV, [_("span", null, se(l.$t("boolOpsDropdown.booleanOperation")), 1), w(d, null, { 46056 default: O(()=>[w(a, { 46057 ref: "boolOpUnite", 46058 type: "button", 46059 modelValue: s.boolOp, 46060 "onUpdate:modelValue": e[0] || (e[0] = f=>s.boolOp = f), 46061 name: "boolOp", 46062 value: "unite", 46063 uncheckedValue: null 46064 }, { 46065 default: O(()=>[w(i, { 46066 svg: s.svgs.booleanUnite 46067 }, null, 8, ["svg"]), w(r, { 46068 getTarget: ()=>l.$refs.boolOpUnite, 46069 label: l.$t("actions.booleanUnite") 46070 }, null, 8, ["getTarget", "label"])]), 46071 _: 1 46072 }, 8, ["modelValue"]), w(a, { 46073 ref: "boolOpSubtract", 46074 type: "button", 46075 modelValue: s.boolOp, 46076 "onUpdate:modelValue": e[1] || (e[1] = f=>s.boolOp = f), 46077 name: "boolOp", 46078 value: "subtract", 46079 uncheckedValue: null, 46080 disabled: s.singleSelection 46081 }, { 46082 default: O(()=>[w(i, { 46083 svg: s.svgs.booleanSubtract 46084 }, null, 8, ["svg"]), w(r, { 46085 getTarget: ()=>l.$refs.boolOpSubtract, 46086 label: l.$t("actions.booleanSubtract") 46087 }, null, 8, ["getTarget", "label"])]), 46088 _: 1 46089 }, 8, ["modelValue", "disabled"]), w(a, { 46090 ref: "boolOpIntersect", 46091 type: "button", 46092 modelValue: s.boolOp, 46093 "onUpdate:modelValue": e[2] || (e[2] = f=>s.boolOp = f), 46094 name: "boolOp", 46095 value: "intersect", 46096 uncheckedValue: null, 46097 disabled: s.singleSelection 46098 }, { 46099 default: O(()=>[w(i, { 46100 svg: s.svgs.booleanIntersect 46101 }, null, 8, ["svg"]), w(r, { 46102 getTarget: ()=>l.$refs.boolOpIntersect, 46103 label: l.$t("actions.booleanIntersect") 46104 }, null, 8, ["getTarget", "label"])]), 46105 _: 1 46106 }, 8, ["modelValue", "disabled"])]), 46107 _: 1 46108 }), w(u, { 46109 disabled: s.singleSelection, 46110 label: l.$t("boolOpsDropdown.primaryObject"), 46111 style: { 46112 "align-self": "start", 46113 height: "18px" 46114 } 46115 }, null, 8, ["disabled", "label"]), _("div", QV, [w(a, { 46116 label: l.$t("boolOpsDropdown.backmost"), 46117 modelValue: s.options.primaryModelType, 46118 "onUpdate:modelValue": e[3] || (e[3] = f=>s.options.primaryModelType = f), 46119 value: "back", 46120 name: "reference", 46121 disabled: s.singleSelection 46122 }, null, 8, ["label", "modelValue", "disabled"]), w(a, { 46123 label: l.$t("boolOpsDropdown.frontmost"), 46124 modelValue: s.options.primaryModelType, 46125 "onUpdate:modelValue": e[4] || (e[4] = f=>s.options.primaryModelType = f), 46126 value: "front", 46127 name: "reference", 46128 disabled: s.singleSelection 46129 }, null, 8, ["label", "modelValue", "disabled"]), w(a, { 46130 label: l.$t("boolOpsDropdown.lastSelected"), 46131 modelValue: s.options.primaryModelType, 46132 "onUpdate:modelValue": e[5] || (e[5] = f=>s.options.primaryModelType = f), 46133 value: "lastSelected", 46134 name: "reference", 46135 disabled: s.singleSelection 46136 }, null, 8, ["label", "modelValue", "disabled"]), w(a, { 46137 label: l.$t("boolOpsDropdown.firstSelected"), 46138 modelValue: s.options.primaryModelType, 46139 "onUpdate:modelValue": e[6] || (e[6] = f=>s.options.primaryModelType = f), 46140 value: "firstSelected", 46141 name: "reference", 46142 disabled: s.singleSelection 46143 }, null, 8, ["label", "modelValue", "disabled"])]), _("div", eN, [w(h, { 46144 modelValue: s.options.keepOriginalModels, 46145 "onUpdate:modelValue": e[7] || (e[7] = f=>s.options.keepOriginalModels = f), 46146 label: l.$t("boolOpsDropdown.keepOriginal") 46147 }, null, 8, ["modelValue", "label"])])])]), 46148 _: 1 46149 }, 8, ["disabled", "onOpen", "onClose"]) 46150} 46151const lN = ie(JV, [["render", tN], ["__scopeId", "data-v-d238f54a"]]) 46152 , nN = { 46153 name: "DistributeDropdown", 46154 components: { 46155 DimInput: ms, 46156 HyRadio: en, 46157 HyGroup: Dt, 46158 HyTooltip: pt, 46159 SvgIcon: gt, 46160 HyDropdown: xl 46161 }, 46162 data() { 46163 return { 46164 distrHor: null, 46165 distrVer: null, 46166 options: { 46167 mode: lh, 46168 distance: 10 46169 }, 46170 DISTRIBUTION_MODE_SELECTION_BOUNDS: lh, 46171 DISTRIBUTION_MODE_CUSTOM_DISTANCE: Rf, 46172 referenceOptions: me([{ 46173 value: "lastSelected", 46174 label: "Last Selected" 46175 }, { 46176 value: "firstSelected", 46177 label: "First Selected" 46178 }, { 46179 value: "document", 46180 label: "Document" 46181 }, { 46182 value: "selection", 46183 label: "Selection" 46184 }]), 46185 svgs: me({ 46186 distributeElements: $x, 46187 distributeHorLeft: Xx, 46188 distributeHorCenter: Yx, 46189 distributeHorRight: Kx,
46190 distributeHorBetween: Wx, 46191 distributeVerTop: qx, 46192 distributeVerCenter: jx, 46193 distributeVerBottom: Jx, 46194 distributeVerBetween: Zx 46195 }) 46196 } 46197 }, 46198 computed: { 46199 selectedModelsCount() { 46200 let l = V().selectedModels; 46201 return l ? l.length : 0 46202 } 46203 }, 46204 methods: { 46205 getInitialData() { 46206 return { 46207 distrHor: null, 46208 distrVer: null, 46209 options: { 46210 mode: lh, 46211 distance: 10 46212 } 46213 } 46214 }, 46215 onOpen() { 46216 Object.assign(this.$data, this.getInitialData()), 46217 this.lastUndoEdit = ae().getLastEdit() 46218 }, 46219 async updateDistribution() { 46220 await ae().undoUntil(this.lastUndoEdit), 46221 fD(this.distrHor, this.distrVer, this.options) 46222 } 46223 }, 46224 watch: { 46225 distrHor() { 46226 this.updateDistribution() 46227 }, 46228 distrVer() { 46229 this.updateDistribution() 46230 }, 46231 options: { 46232 handler() { 46233 (this.distrHor || this.distrVer) && this.updateDistribution() 46234 }, 46235 deep: !0 46236 } 46237 } 46238} 46239 , sN = { 46240 class: "container" 46241} 46242 , oN = { 46243 style: { 46244 "grid-column": "span 2", 46245 display: "flex", 46246 "flex-direction": "column", 46247 gap: "8px", 46248 "align-items": "flex-start" 46249 } 46250} 46251 , iN = { 46252 style: { 46253 display: "flex", 46254 gap: "16px" 46255 } 46256}; 46257function rN(l, e, t, n, s, o) { 46258 const i = E("svg-icon") 46259 , r = E("hy-tooltip") 46260 , a = E("hy-radio") 46261 , d = E("hy-group") 46262 , u = E("dim-input") 46263 , h = E("hy-dropdown"); 46264 return N(), 46265 pe(h, { 46266 ref: "openButton", 46267 disabled: o.selectedModelsCount < 2, 46268 onOpen: o.onOpen, 46269 "popover-style": "max-width: 100vw;", 46270 popupSecondaryPos: "center" 46271 }, { 46272 button: O(()=>[w(i, { 46273 svg: s.svgs.distributeElements 46274 }, null, 8, ["svg"]), w(r, { 46275 getTarget: ()=>l.$refs.openButton, 46276 label: l.$t("actions.distribute") 46277 }, null, 8, ["getTarget", "label"])]), 46278 default: O(()=>[_("div", sN, [_("span", null, se(l.$t("distributeDropdown.horDistribution")), 1), w(d, null, { 46279 default: O(()=>[w(a, { 46280 ref: "distrHorLeft", 46281 type: "button", 46282 modelValue: s.distrHor, 46283 "onUpdate:modelValue": e[0] || (e[0] = c=>s.distrHor = c), 46284 name: "distrHor", 46285 value: "left", 46286 uncheckedValue: null 46287 }, { 46288 default: O(()=>[w(i, { 46289 svg: s.svgs.distributeHorLeft 46290 }, null, 8, ["svg"]), w(r, { 46291 getTarget: ()=>l.$refs.distrHorLeft, 46292 label: l.$t("distributeDropdown.left") 46293 }, null, 8, ["getTarget", "label"])]), 46294 _: 1 46295 }, 8, ["modelValue"]), w(a, { 46296 ref: "distrHorCenter", 46297 type: "button", 46298 modelValue: s.distrHor, 46299 "onUpdate:modelValue": e[1] || (e[1] = c=>s.distrHor = c), 46300 name: "distrHor", 46301 value: "center", 46302 uncheckedValue: null 46303 }, { 46304 default: O(()=>[w(i, { 46305 svg: s.svgs.distributeHorCenter 46306 }, null, 8, ["svg"]), w(r, { 46307 getTarget: ()=>l.$refs.distrHorCenter, 46308 label: l.$t("distributeDropdown.center") 46309 }, null, 8, ["getTarget", "label"])]), 46310 _: 1 46311 }, 8, ["modelValue"]), w(a, { 46312 ref: "distrHorRight", 46313 type: "button", 46314 modelValue: s.distrHor, 46315 "onUpdate:modelValue": e[2] || (e[2] = c=>s.distrHor = c), 46316 name: "distrHor", 46317 value: "right", 46318 uncheckedValue: null 46319 }, { 46320 default: O(()=>[w(i, { 46321 svg: s.svgs.distributeHorRight 46322 }, null, 8, ["svg"]), w(r, { 46323 getTarget: ()=>l.$refs.distrHorRight, 46324 label: l.$t("distributeDropdown.right") 46325 }, null, 8, ["getTarget", "label"])]), 46326 _: 1 46327 }, 8, ["modelValue"]), w(a, { 46328 ref: "distrHorBetween", 46329 type: "button", 46330 modelValue: s.distrHor, 46331 "onUpdate:modelValue": e[3] || (e[3] = c=>s.distrHor = c), 46332 name: "distrHor", 46333 value: "between", 46334 uncheckedValue: null 46335 }, { 46336 default: O(()=>[w(i, {
46337 svg: s.svgs.distributeHorBetween 46338 }, null, 8, ["svg"]), w(r, { 46339 getTarget: ()=>l.$refs.distrHorBetween, 46340 label: l.$t("distributeDropdown.between") 46341 }, null, 8, ["getTarget", "label"])]), 46342 _: 1 46343 }, 8, ["modelValue"])]), 46344 _: 1 46345 }), _("span", null, se(l.$t("distributeDropdown.verDistribution")), 1), w(d, null, { 46346 default: O(()=>[w(a, { 46347 ref: "distrVerTop", 46348 type: "button", 46349 modelValue: s.distrVer, 46350 "onUpdate:modelValue": e[4] || (e[4] = c=>s.distrVer = c), 46351 name: "distrVer", 46352 value: "top", 46353 uncheckedValue: null 46354 }, { 46355 default: O(()=>[w(i, { 46356 svg: s.svgs.distributeVerTop 46357 }, null, 8, ["svg"]), w(r, { 46358 getTarget: ()=>l.$refs.distrVerTop, 46359 label: l.$t("distributeDropdown.top") 46360 }, null, 8, ["getTarget", "label"])]), 46361 _: 1 46362 }, 8, ["modelValue"]), w(a, { 46363 ref: "distrVerCenter", 46364 type: "button", 46365 modelValue: s.distrVer, 46366 "onUpdate:modelValue": e[5] || (e[5] = c=>s.distrVer = c), 46367 name: "distrVer", 46368 value: "center", 46369 uncheckedValue: null 46370 }, { 46371 default: O(()=>[w(i, { 46372 svg: s.svgs.distributeVerCenter 46373 }, null, 8, ["svg"]), w(r, { 46374 getTarget: ()=>l.$refs.distrVerCenter, 46375 label: l.$t("distributeDropdown.center") 46376 }, null, 8, ["getTarget", "label"])]), 46377 _: 1 46378 }, 8, ["modelValue"]), w(a, { 46379 ref: "distrVerBottom", 46380 type: "button", 46381 modelValue: s.distrVer, 46382 "onUpdate:modelValue": e[6] || (e[6] = c=>s.distrVer = c), 46383 name: "distrVer", 46384 value: "bottom", 46385 uncheckedValue: null 46386 }, { 46387 default: O(()=>[w(i, { 46388 svg: s.svgs.distributeVerBottom 46389 }, null, 8, ["svg"]), w(r, { 46390 getTarget: ()=>l.$refs.distrVerBottom, 46391 label: l.$t("distributeDropdown.bottom") 46392 }, null, 8, ["getTarget", "label"])]), 46393 _: 1 46394 }, 8, ["modelValue"]), w(a, { 46395 ref: "distrVerBetween", 46396 type: "button", 46397 modelValue: s.distrVer, 46398 "onUpdate:modelValue": e[7] || (e[7] = c=>s.distrVer = c), 46399 name: "distrVer", 46400 value: "between", 46401 uncheckedValue: null 46402 }, { 46403 default: O(()=>[w(i, { 46404 svg: s.svgs.distributeVerBetween 46405 }, null, 8, ["svg"]), w(r, { 46406 getTarget: ()=>l.$refs.distrVerBetween, 46407 label: l.$t("distributeDropdown.between") 46408 }, null, 8, ["getTarget", "label"])]), 46409 _: 1 46410 }, 8, ["modelValue"])]), 46411 _: 1 46412 }), _("div", oN, [w(a, { 46413 modelValue: s.options.mode, 46414 "onUpdate:modelValue": e[8] || (e[8] = c=>s.options.mode = c), 46415 value: s.DISTRIBUTION_MODE_SELECTION_BOUNDS, 46416 name: "distributionMode", 46417 label: l.$t("distributeDropdown.selectionBounds") 46418 }, null, 8, ["modelValue", "value", "label"]), _("div", iN, [w(a, { 46419 modelValue: s.options.mode, 46420 "onUpdate:modelValue": e[9] || (e[9] = c=>s.options.mode = c), 46421 value: s.DISTRIBUTION_MODE_CUSTOM_DISTANCE, 46422 name: "distributionMode", 46423 label: l.$t("distributeDropdown.stepDistance") 46424 }, null, 8, ["modelValue", "value", "label"]), w(u, { 46425 modelValue: s.options.distance, 46426 "onUpdate:modelValue": e[10] || (e[10] = c=>s.options.distance = c), 46427 disabled: s.options.mode !== s.DISTRIBUTION_MODE_CUSTOM_DISTANCE, 46428 unit: "px" 46429 }, null, 8, ["modelValue", "disabled"])])])])]), 46430 _: 1 46431 }, 8, ["disabled", "onOpen"]) 46432} 46433const aN = ie(nN, [["render", rN], ["__scopeId", "data-v-baa11207"]]) 46434 , dN = { 46435 name: "ArrangeDropdown", 46436 components: { 46437 ActionButton: Ii, 46438 HyGroup: Dt, 46439 HyTooltip: pt, 46440 SvgIcon: gt, 46441 HyDropdown: xl 46442 }, 46443 data() { 46444 return { 46445 options: { 46446 reference: "lastSelected", 46447 alignAsGroup: !1 46448 }, 46449 referenceOptions: me([{ 46450 value: "lastSelected", 46451 label: "Last Selected" 46452 }, { 46453 value: "firstSelected", 46454 label: "First Selected" 46455 }, { 46456 value: "document", 46457 label: "Document" 46458 }, { 46459 value: "selection", 46460 label: "Selection" 46461 }]), 46462 svgs: me({ 46463 arrange: G2, 46464 toFront: H2, 46465 toBack: $2,
46466 oneToFront: X2, 46467 oneToBack: Y2 46468 }), 46469 toFrontAction: bv, 46470 toBackAction: Sv, 46471 oneToFrontAction: vv, 46472 oneToBackAction: Mv 46473 } 46474 }, 46475 computed: { 46476 selectedModelsCount() { 46477 let l = V().selectedModels; 46478 return l ? l.length : 0 46479 } 46480 }, 46481 methods: { 46482 actionPerformed() { 46483 this.$refs.openButton.close() 46484 } 46485 } 46486} 46487 , uN = { 46488 class: "container" 46489}; 46490function hN(l, e, t, n, s, o) { 46491 const i = E("svg-icon") 46492 , r = E("hy-tooltip") 46493 , a = E("action-button") 46494 , d = E("hy-group") 46495 , u = E("hy-dropdown"); 46496 return N(), 46497 pe(u, { 46498 ref: "openButton", 46499 disabled: o.selectedModelsCount === 0, 46500 popupSecondaryPos: "center" 46501 }, { 46502 button: O(()=>[w(i, { 46503 svg: s.svgs.arrange 46504 }, null, 8, ["svg"]), w(r, { 46505 getTarget: ()=>l.$refs.openButton, 46506 label: l.$t("actions.arrange") 46507 }, null, 8, ["getTarget", "label"])]), 46508 default: O(()=>[_("div", uN, [w(d, null, { 46509 default: O(()=>[w(a, { 46510 action: s.toFrontAction, 46511 iconSvg: s.svgs.toFront, 46512 options: s.options, 46513 onClick: o.actionPerformed 46514 }, null, 8, ["action", "iconSvg", "options", "onClick"]), w(a, { 46515 action: s.toBackAction, 46516 iconSvg: s.svgs.toBack, 46517 options: s.options, 46518 onClick: o.actionPerformed 46519 }, null, 8, ["action", "iconSvg", "options", "onClick"]), w(a, { 46520 action: s.oneToFrontAction, 46521 iconSvg: s.svgs.oneToFront, 46522 options: s.options, 46523 onClick: o.actionPerformed 46524 }, null, 8, ["action", "iconSvg", "options", "onClick"]), w(a, { 46525 action: s.oneToBackAction, 46526 iconSvg: s.svgs.oneToBack, 46527 options: s.options, 46528 onClick: o.actionPerformed 46529 }, null, 8, ["action", "iconSvg", "options", "onClick"])]), 46530 _: 1 46531 })])]), 46532 _: 1 46533 }, 8, ["disabled"]) 46534} 46535const cN = ie(dN, [["render", hN], ["__scopeId", "data-v-bb9cd651"]]) 46536 , fN = { 46537 name: "SelectionOptionsComponent", 46538 components: { 46539 ActionButton: Ii, 46540 ArrangeDropdown: cN, 46541 DistributeDropdown: aN, 46542 BooleanOpsDropdown: lN, 46543 AlignDropdown: jV, 46544 HyGroup: Dt 46545 }, 46546 data() { 46547 return { 46548 tool: null, 46549 toolOptions: null, 46550 booleanUniteAction: Lf, 46551 booleanSubtractAction: Vf, 46552 booleanIntersectAction: Nf, 46553 duplicateAction: wv, 46554 deleteSelectionAction: xv, 46555 groupAction: dv, 46556 ungroupAction: uv, 46557 selectAllAction: ov, 46558 selectNoneAction: iv, 46559 svgs: me({ 46560 booleanUnite: C2, 46561 booleanSubtract: _2, 46562 booleanIntersect: T2, 46563 group: K2, 46564 ungroup: W2, 46565 duplicateSvg: ec, 46566 deleteSvg: Zr, 46567 selectAll: S2, 46568 selectNone: w2 46569 }) 46570 } 46571 }, 46572 computed: { 46573 hasStroke() { 46574 let l = this.toolOptions.strokePaintGroup; 46575 return l != null && !l.isNoPaint 46576 } 46577 }, 46578 methods: { 46579 onFillPaintUpdate(l) { 46580 this.toolOptions.fillPaintGroup.setPaint(l), 46581 z().setSelectionPaint(l, "fill") 46582 }, 46583 onStrokePaintUpdate(l) { 46584 this.toolOptions.strokePaintGroup.setPaint(l), 46585 z().setSelectionPaint(l, "stroke") 46586 }, 46587 onStrokeStyleUpdate(l) { 46588 this.toolOptions.strokeStyle.set(l), 46589 z().setSelectionStrokeStyle(l) 46590 } 46591 } 46592}; 46593function pN(l, e, t, n, s, o) { 46594 const i = E("align-dropdown") 46595 , r = E("distribute-dropdown") 46596 , a = E("hy-group") 46597 , d = E("action-button") 46598 , u = E("boolean-ops-dropdown") 46599 , h = E("arrange-dropdown"); 46600 return N(), 46601 $("div", null, [w(a, null, { 46602 default: O(()=>[w(i, { 46603 class: "hy-toolbar-element" 46604 }), w(r, { 46605 class: "hy-toolbar-element" 46606 })]), 46607 _: 1 46608 }), w(a, null, { 46609 default: O(()=>[w(d, { 46610 action: s.booleanUniteAction, 46611 iconSvg: s.svgs.booleanUnite, 46612 class: "hy-toolbar-element" 46613 }, null, 8, ["action", "iconSvg"]), w(d, { 46614 action: s.booleanSubtractAction, 46615 iconSvg: s.svgs.booleanSubtract, 46616 class: "hy-toolbar-element" 46617 }, null, 8, ["action", "iconSvg"]), w(d, { 46618 action: s.booleanIntersectAction, 46619 iconSvg: s.svgs.booleanIntersect, 46620 class: "hy-toolbar-element" 46621 }, null, 8, ["action", "iconSvg"]), w(u, { 46622 class: "hy-toolbar-element" 46623 })]), 46624 _: 1 46625 }), w(h, { 46626 class: "hy-toolbar-element" 46627 }), w(a, null, { 46628 default: O(()=>[w(d, { 46629 action: s.groupAction, 46630 iconSvg: s.svgs.group, 46631 class: "hy-toolbar-element" 46632 }, null, 8, ["action", "iconSvg"]), w(d, { 46633 action: s.ungroupAction, 46634 iconSvg: s.svgs.ungroup, 46635 class: "hy-toolbar-element" 46636 }, null, 8, ["action", "iconSvg"])]), 46637 _: 1 46638 }), w(a, null, { 46639 default: O(()=>[w(d, { 46640 action: s.duplicateAction, 46641 "icon-svg": s.svgs.duplicateSvg, 46642 class: "hy-toolbar-element" 46643 }, null, 8, ["action", "icon-svg"]), w(d, { 46644 action: s.deleteSelectionAction, 46645 "icon-svg": s.svgs.deleteSvg, 46646 class: "hy-toolbar-element" 46647 }, null, 8, ["action", "icon-svg"])]), 46648 _: 1 46649 }), w(a, null, { 46650 default: O(()=>[w(d, { 46651 action: s.selectAllAction, 46652 "icon-svg": s.svgs.selectAll, 46653 class: "hy-toolbar-element" 46654 }, null, 8, ["action", "icon-svg"]), w(d, { 46655 action: s.selectNoneAction, 46656 "icon-svg": s.svgs.selectNone, 46657 class: "hy-toolbar-element" 46658 }, null, 8, ["action", "icon-svg"])]), 46659 _: 1 46660 })]) 46661} 46662const gN = ie(fN, [["render", pN]]); 46663class mN extends Yf { 46664 selector; 46665 constructor(e, t, n) { 46666 super(e, t), 46667 this.selector = n 46668 } 46669} 46670class yN extends yl { 46671 selector; 46672 dragSelectorInfo; 46673 toolOptions = { 46674 fillPaintGroup: V().fillPaintGroup, 46675 strokePaintGroup: V().strokePaintGroup, 46676 strokeStyle: V().strokeStyle 46677 }; 46678 toolbarOptionsComponent = gN; 46679 constructor() { 46680 super("selection") 46681 } 46682 setActive(e, t) { 46683 super.setActive(e, t), 46684 e || this.endSelectorSelection() 46685 } 46686 setSuspended(e) { 46687 if (super.setSuspended(e), 46688 !e) { 46689 let t = V() 46690 , n = j(); 46691 for (let s of t.selectedModels) 46692 n.showModelOverlay(s); 46693 this.updateSelectionFrame(), 46694 this.setCursor(!1, "default") 46695 } 46696 } 46697 startPointerDrag(e, t, n, s, o) {} 46698 handlePointerClickEvent(e, t, n, s) { 46699 let o = e.shiftKey 46700 , i = e.ctrlKey 46701 , r = V() 46702 , a = z() 46703 , d = e.target2 46704 , u = this.getDocumentModel() 46705 , h = u.baseElement; 46706 if (h === d || !h.contains(d)) 46707 o || a.setModelsSelected(null, r.selectedModels); 46708 else if (s) { 46709 let c; 46710 switch (d.tagName) { 46711 case "text": 46712 case "tspan": 46713 c = "text"; 46714 break; 46715 case "path": 46716 c = "nodes"; 46717 break 46718 } 46719 c != null && (r.setTool(c), 46720 r.tool.handlePointerClickEvent(e, t, n, !1)) 46721 } else { 46722 let c = u.getSelectableModel(d); 46723 if (!i) 46724 for (; c.getParentModel().getType() === "group" || c.getParentModel().getType() === "clipPath"; ) 46725 c = c.getParentModel(); 46726 if (o) 46727 a.isModelSelected(c) ? a.setModelsSelected(null, [c]) : a.isModelSelected(c, !0) || a.setModelsSelected([c], null); 46728 else { 46729 let f = r.selectedModels; 46730 if (f.length === 1 && (c === f[0] || c.isAncestorOf(f[0])
46730)) { 46731 if (e.pointerType === "touch" || e.pointerType === "pen") { 46732 c = u.getSelectableModel(d); 46733 let p = c.getParentModel(); 46734 for (; (p.getType() === "group" || p.getType() === "clipPath") && p !== f[0]; ) 46735 c = p, 46736 p = c.getParentModel(); 46737 c !== f[0] && a.setModelsSelected([c], f) 46738 } 46739 } else 46740 a.setModelsSelected([c], f) 46741 } 46742 } 46743 } 46744 handlePointerDownEvent(e, t, n) { 46745 if (e.buttons === 1 && (super.handlePointerDownEvent(e, t, n), 46746 this.dragInfo?.handle == null)) { 46747 let s = e.ctrlKey 46748 , o = this.getModelForElement(e.target2) 46749 , i = z(); 46750 if (o != null && !s) 46751 super.updateDragInfo(t, n, i.isModelSelected(o, !0)), 46752 super.updateCursor(Fl); 46753 else { 46754 let a = this.getDocumentModel().getModels(!1).filter(c=>c.getType() !== "textSpan") 46755 , d = V() 46756 , u = new Set(d.selectedModels) 46757 , h = new RV(a,u,t,n); 46758 this.dragSelectorInfo = new mN(t,n,h), 46759 this.setCursor(!0, "selectorRect") 46760 } 46761 } 46762 } 46763 handlePointerMoveEvent(e, t, n) { 46764 if (this.dragSelectorInfo != null) { 46765 let s = this.dragSelectorInfo.started; 46766 if (this.dragSelectorInfo.dragStarted(t, n)) { 46767 let o = this.dragSelectorInfo.selector 46768 , i = e.shiftKey 46769 , r = e.ctrlKey; 46770 if (!s && (j().showSelectorElement(o), 46771 !i)) { 46772 let a = V(); 46773 z().setModelsSelected(null, a.selectedModels, !0) 46774 } 46775 o.moveTo(t, n), 46776 this.updateSelectorSelection(i, r) 46777 } 46778 } else 46779 super.handlePointerMoveEvent(e, t, n) 46780 } 46781 updateSelectorSelection(e, t) { 46782 let n = z() 46783 , s = this.dragSelectorInfo.selector 46784 , o = s.getModelsInFill() 46785 , i = []; 46786 e && s.originalSelModels.forEach(d=>o.add(d)); 46787 for (let d of o) 46788 if (t) 46789 (d.getType() === "group" || d.getType() === "clipPath") && o.delete(d); 46790 else { 46791 let u = d.getParentModel(); 46792 for (; u != null && u.getType() !== "document"; ) { 46793 if (u.getType() === "group" || u.getType() === "clipPath") { 46794 o.delete(d); 46795 break 46796 } 46797 u = u.getParentModel() 46798 } 46799 } 46800 let a = V().selectedModels; 46801 for (let d of a) 46802 o.has(d) || i.push(d), 46803 o.delete(d); 46804 (o.size !== 0 || i.length !== 0) && n.setModelsSelected(Array.from(o), i, !0), 46805 j().updateSelectorElement(s) 46806 } 46807 endSelectorSelection() { 46808 if (this.dragSelectorInfo != null) 46809 return j().hideSelectorElement(this.dragSelectorInfo.selector), 46810 this.dragSelectorInfo = null, 46811 !0 46812 } 46813 cancelPointerDrag() { 46814 return this.endSelectorSelection(), 46815 super.cancelPointerDrag() 46816 } 46817 handleKeyDownEvent(e) { 46818 let t = e.key 46819 , n = e.repeat; 46820 (t === Vn || t === Fs) && this.dragSelectorInfo != null && (n || this.updateSelectorSelection(e.shiftKey, e.ctrlKey)), 46821 super.handleKeyDownEvent(e) 46822 } 46823 handleKeyUpEvent(e) { 46824 let t = e.key; 46825 (t === Vn || t === Fs) && this.dragSelectorInfo != null ? this.updateSelectorSelection(e.shiftKey, e.ctrlKey) : super.handleKeyUpEvent(e) 46826 } 46827 updateHoverHandle(e, t, n) { 46828 this.dragSelectorInfo ? this.hoverHandle != null && (j().setHoverHandleOverlay(this.hoverHandle, !1), 46829 this.hoverHandle = null) : super.updateHoverHandle(e, t, n) 46830 } 46831} 46832new yN; 46833class vu extends yu { 46834 xMin; 46835 xMax; 46836 yMin; 46837 yMax; 46838 sortedPoints; 46839 originalSelPoints; 46840 constructor(e, t, n, s) { 46841 super(e, t), 46842 this.xMin = e, 46843 this.yMin = t, 46844 this.xMax = e, 46845 this.yMax = t; 46846 let o = n.slice(); 46847 o.sort((i,r)=>i.xTransformed - r.xTransformed), 46848 this.sortedPoints = o, 46849 this.originalSelPoints = s 46850 } 46851 moveTo(e, t) { 46852 this.xMin = Math.min(this.xStart, e), 46853 this.yMin = Math.min(this.yStart, t), 46854 this.xMax = Math.max(this.xStart, e), 46855 this.yMax = Math.max(this.yStart, t) 46856 } 46857 getPointsString() { 46858 return "" + this.xMin + "," + this.yMin + " " + this.xMax + "," + this.yMin + " " + this.xMax + "," + this.yMax + " " + this.xMin + "," + this.yMax 46859 } 46860 getPointsInFill() { 46861 let e = this.sortedPoints 46862 , t = new Set 46863 , n = Cd(this.xMin, e) 46864 , s = Cd(this.xMax, e); 46865 for (; s < e.length && e[s].xTransformed <= this.xMax; ) 46866 s++; 46867 for (; n < s; n++) { 46868 let o = e[n] 46869 , i = o.yTransformed; 46870 i >= this.yMin && i <= this.yMax && t.add(o) 46871 } 46872 return t 46873 } 46874} 46875function Cd(l, e) { 46876 let t = 0 46877 , n = e.length; 46878 for (; t < n; ) { 46879 let s = n + t >>> 1; 46880 l > e[s].xTransformed ? t = s + 1 : n = s 46881 } 46882 return t 46883} 46884class _d extends vu { 46885 _pointsStr = ""; 46886 selPoints = new Set; 46887 windings; 46888 lines = []; 46889 lastPolylineCoords; 46890 xStart; 46891 yStart; 46892 constructor(e, t, n, s) { 46893 super(e, t, n, s), 46894 this.windings = new Int16Array(n.length), 46895 this.xStart = e, 46896 this.yStart = t, 46897 this._pointsStr = "" + e + "," + t 46898 } 46899 getPointsString() { 46900 return this._pointsStr 46901 } 46902 moveTo(e, t) { 46903 let n = this._pointsStr 46904 , s = this.lastPolylineCoords; 46905 if (s == null) 46906 this.lastPolylineCoords = [this.xStart, this.yStart, e, t]; 46907 else if ((s[2] - s[0]) / (s[3] - s[1]) === (e - s[2]) / (t - s[3])) { 46908 s.splice(2, 2, e, t); 46909 let r = n.lastIndexOf(" "); 46910 n = n.substring(0, r === -1 ? n.length : r) 46911 } else 46912 s.splice(0, 4, s[2], s[3], e, t); 46913 this._pointsStr = n + " " + e + "," + t; 46914 let o = this.lines 46915 , i = o.at(-1); 46916 i == null ? o.push([this.xStart, this.yStart, e, t]) : o.push([i[2], i[3], e, t]) 46917 } 46918 _updateWindings() { 46919 let e = this.sortedPoints 46920 , t = this.lines; 46921 if (t.length < 2) 46922 return; 46923 let n = t.at(-1); 46924 t.push([n[2], n[3], this.xStart, this.yStart]); 46925 let[s,o,i,r] = t[0]; 46926 for (let u = 0; u < t.length; u++) { 46927 let h = t[u]; 46928 h[2] < s && (s = h[2]), 46929 h[2] > i && (i = h[2]), 46930 h[3] < o && (o = h[3]), 46931 h[3] > r && (r = h[3]) 46932 } 46933 let a = Cd(s, e) 46934 , d = Cd(i, e); 46935 for (; d < e.length && e[d].xTransformed <= i; ) 46936 d++; 46937 for (; a < d; a++) { 46938 let u = e[a] 46939 , h = u.yTransformed; 46940 if (h >= o && h <= r) { 46941 let c = u.xTransformed 46942 , f = 0; 46943 for (let p = 0; p < t.length; p++) { 46944 let[g,y,m,b] = t[p]; 46945 c >= Math.min(g, m) && c < Math.max(g, m) && h >= Math.min(y, b) && (h >
46945 Math.max(y, b) || (c - g) / (m - g) * (b - y) + y < h) && (f += Math.sign(m - g)) 46946 } 46947 if (f !== 0) { 46948 let p = this.windings[a] + f; 46949 this.windings[a] = p, 46950 p !== 0 ? this.selPoints.add(u) : this.selPoints.delete(u) 46951 } 46952 } 46953 } 46954 this.lines = [[this.xStart, this.yStart, n[2], n[3]]] 46955 } 46956 getPointsInFill() { 46957 return this._updateWindings(), 46958 new Set(this.selPoints) 46959 } 46960} 46961Ie(()=>V().elementManager, (l,e)=>{ 46962 l && l.addPointSelectionCallback(Ag), 46963 e && e.removePointSelectionCallback(Ag) 46964} 46965); 46966let uh = null; 46967function Ag() { 46968 uh == null && (uh = requestIdleCallback(()=>{ 46969 uh = null; 46970 let l = z() 46971 , e = !0 46972 , t = null; 46973 for (let n of l.sortedSelNodePoints) { 46974 let s = n.getSinglePathModel(); 46975 if (s !== t) 46976 if (s.isClosed()) 46977 t = s; 46978 else { 46979 e = !1; 46980 break 46981 } 46982 } 46983 zv.disabled = e 46984 } 46985 , { 46986 timeout: 200 46987 })) 46988} 46989class vN extends Ce { 46990 constructor() { 46991 super("closePath", !0) 46992 } 46993 performAction() { 46994 let e = z() 46995 , t = new Set 46996 , n = new Set 46997 , s = null; 46998 for (let i of e.sortedSelNodePoints) { 46999 let r = i.getSinglePathModel(); 47000 r !== s && (r.isClosed() ? s = r : (n.add(r), 47001 t.add(r.getPathModel()))) 47002 } 47003 let o = ae(); 47004 o.startCompoundEdit(), 47005 n.forEach(i=>e.closeSinglePathModel(i)), 47006 o.endCompoundEdit() 47007 } 47008} 47009const zv = new vN; 47010class la { 47011 coords; 47012 type; 47013 radius; 47014 constructor(e) { 47015 e != null && this.set(e.toCoords(), e.getNodeType(), e.radius) 47016 } 47017 set(e, t, n) { 47018 this.coords = e, 47019 this.type = t, 47020 this.radius = n 47021 } 47022 applyDataToNode(e, t=!0) { 47023 e.setNodeType(this.type, t), 47024 e.radius = this.radius 47025 } 47026 transform(e) { 47027 return e.transformArray(this.coords), 47028 this 47029 } 47030 clone() { 47031 let e = new la; 47032 return e.set(this.coords.slice(), this.type, this.radius), 47033 e 47034 } 47035} 47036Ie(()=>V().elementManager, (l,e)=>{ 47037 l && l.addPointSelectionCallback(Ig), 47038 e && e.removePointSelectionCallback(Ig) 47039} 47040); 47041let hh = null; 47042function Ig() { 47043 hh == null && (hh = requestIdleCallback(()=>{ 47044 hh = null; 47045 let l = z() 47046 , e = !0 47047 , t = 0 47048 , n = null; 47049 for (let s of l.sortedSelNodePoints) { 47050 let o = s.getSinglePathModel(); 47051 if (o !== n) { 47052 if (!o.isClosed() && (t++, 47053 t > 1)) { 47054 e = !1; 47055 break 47056 } 47057 n = o 47058 } 47059 } 47060 Uv.disabled = e 47061 } 47062 , { 47063 timeout: 200 47064 })) 47065} 47066class bN extends Ce { 47067 constructor() { 47068 super("connectPaths", !0) 47069 } 47070 performAction() { 47071 let e = z() 47072 , t = null 47073 , n = new Set 47074 , s = null; 47075 for (let a of e.selectedNodePoints) { 47076 let d = a.getSinglePathModel(); 47077 d !== s && (d.isClosed() || (t == null ? t = d : d !== t && n.add(d)), 47078 s = d) 47079 } 47080 if (n.size === 0) 47081 return; 47082 let o = ae(); 47083 o.startCompoundEdit(), 47084 e.setNodePointsSelected(null, e.sortedSelNodePoints); 47085 let i = [] 47086 , r = t.getPathModel().getAggregateTransform().invert(); 47087 n.forEach(a=>{ 47088 let d = a.getPathModel().getAggregateTransform().preMultiplyWith(r); 47089 i.push(...a.getNodePoints().map(h=>new la(h).transform(d))); 47090 let u = a.getPathModel(); 47091 u.getSinglePathModels().length <= 1 ? (e.setModelsSelected(null, [u]), 47092 e.removeModel(u)) : e.removeSinglePathModel(a) 47093 } 47094 ), 47095 e.insertNodePoints(t, t.getNodeCount(), i), 47096 o.endCompoundEdit() 47097 } 47098} 47099const Uv = new bN; 47100Ie(()=>V().elementManager, (l,e)=>{ 47101 l && l.addPointSelectionCallback(Lg), 47102 e && e.removePointSelectionCallback(Lg) 47103} 47104); 47105let ch = null; 47106function Lg() {
47107 ch == null && (ch = requestIdleCallback(()=>{ 47108 ch = null; 47109 let l = z() 47110 , e = !0 47111 , t = null; 47112 for (let n of l.sortedSelNodePoints) { 47113 let s = n.getSinglePathModel(); 47114 if (s !== t) 47115 if (s.isClosed()) { 47116 e = !1; 47117 break 47118 } else 47119 t = s 47120 } 47121 Gv.setDisabled(e) 47122 } 47123 , { 47124 timeout: 200 47125 })) 47126} 47127class MN extends Ce { 47128 constructor() { 47129 super("openPath", !0) 47130 } 47131 performAction() { 47132 let e = z() 47133 , t = new Set 47134 , n = null; 47135 for (let s of e.sortedSelNodePoints) { 47136 let o = s.getSinglePathModel(); 47137 o !== n && (o.isClosed() && t.add(s), 47138 n = o) 47139 } 47140 t.forEach(s=>{ 47141 let o = s.getSinglePathModel() 47142 , i = s.getIndex(); 47143 e.shiftNodePoints(o, i), 47144 e.openSinglePathModel(o) 47145 } 47146 ) 47147 } 47148} 47149const Gv = new MN; 47150Ie(()=>V().elementManager, (l,e)=>{ 47151 l && l.addPointSelectionCallback(Vg), 47152 e && e.removePointSelectionCallback(Vg) 47153} 47154); 47155let fh = null; 47156function Vg() { 47157 fh == null && (fh = requestIdleCallback(()=>{ 47158 fh = null; 47159 let l = z() 47160 , e = !0; 47161 for (let t of l.sortedSelNodePoints) { 47162 let n = t.getSinglePathModel(); 47163 if (n.isClosed() || t.getIndex() > 0 && t.getIndex() < n.getNodeCount() - 1) { 47164 e = !1; 47165 break 47166 } 47167 } 47168 Hv.setDisabled(e) 47169 } 47170 , { 47171 timeout: 200 47172 })) 47173} 47174class SN extends Ce { 47175 constructor() { 47176 super("subdividePaths", !0) 47177 } 47178 performAction() { 47179 let e = z() 47180 , t = new Map; 47181 for (let n of e.sortedSelNodePoints) { 47182 let s = n.getSinglePathModel(); 47183 if (s.isClosed() || n.getIndex() > 0 && n.getIndex() < s.getNodeCount() - 1) { 47184 let o = t.get(s); 47185 o ? o.push(n) : (o = [n], 47186 t.set(s, o)) 47187 } 47188 } 47189 if (t.size > 0) { 47190 let n = ae(); 47191 n.startCompoundEdit(); 47192 let s = e.sortedSelNodePoints[0]; 47193 e.setNodePointsSelected(null, e.sortedSelNodePoints), 47194 t.forEach((o,i)=>{ 47195 let r = o.map(a=>a.getIndex()); 47196 e.subdivideSinglePathModel(i, r) 47197 } 47198 ), 47199 e.setNodePointsSelected([s], null), 47200 n.endCompoundEdit() 47201 } 47202 } 47203} 47204const Hv = new SN 47205 , wN = { 47206 name: "NodesOptionsComponent", 47207 components: { 47208 ActionButton: Ii, 47209 HyGroup: Dt 47210 }, 47211 data() { 47212 return { 47213 tool: null, 47214 toolOptions: null, 47215 toLineAction: bd, 47216 toCurveAction: Md, 47217 toSmoothAction: yd, 47218 toCornerAction: vd, 47219 closePathAction: zv, 47220 openPathAction: Gv, 47221 subdividePathsAction: Hv, 47222 connectPathsAction: Uv, 47223 reversePathsAction: If, 47224 svgs: me({ 47225 cornerNodeSvg: iC, 47226 smoothNodeSvg: oC, 47227 toLineSvg: aC, 47228 toCurveSvg: rC, 47229 closePathSvg: dC, 47230 openPathSvg: uC, 47231 connectPathsSvg: hC, 47232 reversePathSvg: cC, 47233 selModeRectSvg: fC, 47234 selModeLassoSvg: pC 47235 }) 47236 } 47237 } 47238}; 47239function PN(l, e, t, n, s, o) { 47240 const i = E("action-button") 47241 , r = E("hy-group"); 47242 return N(), 47243 $("div", null, [w(r, null, { 47244 default: O(()=>[w(i, { 47245 action: s.toCornerAction, 47246 primary: s.toCornerAction.selected, 47247 iconSvg: s.svgs.cornerNodeSvg, 47248 class: "hy-toolbar-element" 47249 }, null, 8, ["action", "primary", "iconSvg"]), w(i, { 47250 action: s.toSmoothAction, 47251 primary: s.toSmoothAction.selected, 47252 iconSvg: s.svgs.smoothNodeSvg, 47253 class: "hy-toolbar-element" 47254 }, null, 8, ["action", "primary", "iconSvg"])]), 47255 _: 1 47256 }), w(r, null, { 47257 default: O(()=>[w(i, { 47258 action: s.toCurveAction, 47259 primary: s.toCurveAction.selected, 47260 iconSvg: s.svgs.toCurveSvg, 47261 class: "hy-toolbar-element" 47262 }, null, 8, ["action", "primary", "iconSvg"]), w(i, { 47263 action: s.toLineAction, 47264 primary: s.toLineAction.selected, 47265 iconSvg: s.svgs.toLineSvg, 47266 class: "hy-toolbar-element" 47267 }, null, 8, ["action", "primary", "iconSvg"])]), 47268 _: 1 47269 }), w(r, null, { 47270 default: O(()=>[w(i, { 47271 action: s.closePathAction, 47272 iconSvg: s.svgs.closePathSvg, 47273 class: "hy-toolbar-element" 47274 }, null, 8, ["action", "iconSvg"]), w(i, { 47275 action: s.subdividePathsAction, 47276 iconSvg: s.svgs.openPathSvg, 47277 class: "hy-toolbar-element" 47278 }, null, 8, ["action", "iconSvg"])]), 47279 _: 1 47280 }), w(r, null, { 47281 default: O(()=>[w(i, { 47282 action: s.connectPathsAction, 47283 iconSvg: s.svgs.connectPathsSvg, 47284 class: "hy-toolbar-element" 47285 }, null, 8, ["action", "iconSvg"])]), 47286 _: 1 47287 }), w(r, null, { 47288 default: O(()=>[w(i, { 47289 action: s.reversePathsAction, 47290 iconSvg: s.svgs.reversePathSvg, 47291 class: "hy-toolbar-element" 47292 }, null, 8, ["action", "iconSvg"])]), 47293 _: 1 47294 })]) 47295} 47296const xN = ie(wN, [["render", PN]]); 47297class ts extends Af { 47298 constructor(e, t) { 47299 super(e, t) 47300 } 47301 getNewNodePointData(e) { 47302 return e.toCoords() 47303 } 47304 setNodePointsDatas(e, t) { 47305 let n = z() 47306 , s = t; 47307 n.moveNodePoints(e, s) 47308 } 47309} 47310class Kf extends Ue { 47311 _singlePathModel; 47312 _insertIndex; 47313 _nodeInfos; 47314 _adjacentControlPoints; 47315 constructor(e, t, n, s) { 47316 super(!0), 47317 this._singlePathModel = e, 47318 this._insertIndex = t, 47319 this._nodeInfos = n.map(o=>new la(o)), 47320 this._adjacentControlPoints = s 47321 } 47322 async undo() { 47323 z().removeNodePoints(this._singlePathModel, this._insertIndex, this._nodeInfos.length) 47324 } 47325 async redo() { 47326 z().insertNodePoints(this._singlePathModel, this._insertIndex, this._nodeInfos.slice(), this._adjacentControlPoints) 47327 } 47328} 47329class CN extends Yf { 47330 pathPoint; 47331 pointStartX; 47332 pointStartY; 47333 wasPointSelected; 47334 constructor(e, t, n) { 47335 super(e, t), 47336 this.pathPoint = n, 47337 this.pointStartX = n.xTransformed, 47338 this.pointStartY = n.yTransformed, 47339 this.wasPointSelected = z().isPathPointSelected(n) 47340 } 47341 getPointerOffsetX() { 47342 return this.pointStartX - this.startX 47343 } 47344 getPointerOffsetY() { 47345 return this.pointStartY - this.startY 47346 } 47347} 47348class _N extends yl { 47349 hoverPoint; 47350 hoverCurveLocation; 47351 dragStartCoords; 47352 dragStartNeighborCoords; 47353 selector; 47354 isSelModeToggled = !1; 47355 toolOptions = Et({ 47356 selectorType: "rect" 47357 }); 47358 toolbarOptionsComponent = xN; 47359 constructor() { 47360 super("nodes") 47361 } 47362 setSelModeToggled(e) { 47363 this.isSelModeToggled !== e && (this.isSelModeToggled = e, 47364 this.toolOptions.selectorType = this.toolOptions.selectorType === "rect" ? "lasso" : "rect") 47365 } 47366 getNeighboringNodePoints(e) { 47367 let t = new Set; 47368 if (e && e.length > 0) { 47369 let n = e[0] 47370 , s = e.length; 47371 for (let o = 0; o < s; o++) { 47372 let i = e[o] 47373 , r = i.getPrevious() 47374 , a = e[o === 0 ? e.length - 1 : o - 1]; 47375 r !== a && r !== n && r && t.add(r); 47376 let d = i.getNext() 47377 , u = e[o === s - 1 ? 0 : o + 1]; 47378 d !== u && d !== n && (d && t.add(d), 47379 n = u) 47380 } 47381 } 47382 return t 47383 } 47384 handlePointerClickEvent(e, t, n, s) { 47385 let o = e.shiftKey 47386 , i = V() 47387 , r = z() 47388 , a = this.dragPointInfo; 47389 if (a != null) { 47390 let d = a.pathPoint; 47391 d instanceof ut && (o ? a.wasPointSelected && r.setNodePointsSelected(null, [d]) : r.setN
47391odePointsSelected([d], r.sortedSelNodePoints)), 47392 this.setDragPoint(null) 47393 } else { 47394 if (this.hoverCurveLocation != null) { 47395 let h = this.hoverCurveLocation 47396 , c = h.t 47397 , f = h.curveIndex 47398 , p = h.singlePathModel 47399 , g = Ae(p.getCurve(f).v) 47400 , y = p.getNodePointAt(f) 47401 , m = p.getNodePointAt(f + 1) 47402 , b = y.toCoords() 47403 , M = m.toCoords() 47404 , S = p.splitCurve(f, c); 47405 g || S.setNodeType(yt), 47406 j().showPathPointsOverlay([S, S.controlPointIn, S.controlPointOut]); 47407 let P = ae(); 47408 P.startCompoundEdit(), 47409 P.addEdit(new Kf(p,f + 1,[S])), 47410 P.addEdit(new ts([y, m],[b, M])), 47411 r.setNodePointsSelected([S], r.sortedSelNodePoints), 47412 P.endCompoundEdit(), 47413 this.setHoverPoint(S), 47414 this.setHoverCurveLocation(null), 47415 e.preventDefault(); 47416 return 47417 } 47418 if (s) { 47419 i.setTool("selection"), 47420 i.tool.handlePointerClickEvent(e, t, n, !1); 47421 return 47422 } 47423 let d = e.target2 47424 , u = this.getDocumentModel(); 47425 if (u.baseElement === d || !u.baseElement.contains(d)) 47426 o || r.setModelsSelected(null, i.selectedModels); 47427 else { 47428 let h = u.getSelectableModel(d); 47429 if (h.isPath()) { 47430 let c = r.isModelSelected(h); 47431 o ? c ? r.setModelsSelected(null, [h]) : r.setModelsSelected([h], null) : (c && this.clearPathPointSelection(!0, !0), 47432 r.setModelsSelected([h], i.selectedModels)) 47433 } else 47434 o ? r.isModelSelected(h) ? r.setModelsSelected(null, [h]) : r.setModelsSelected([h], null) : r.setModelsSelected([h], i.selectedModels) 47435 } 47436 } 47437 } 47438 handlePointerDownEvent(e, t, n) { 47439 let s = e.shiftKey 47440 , o = z() 47441 , r = V().appSettings.editor.pointTolerance * 100 / this.getZoom(); 47442 e.pointerType === "touch" && (r *= 2); 47443 let a = o.getPathPointsAt(t, n, r); 47444 if (a.length > 0) { 47445 let d = a[0]; 47446 if (this.setDragPoint(d, t, n), 47447 d instanceof ut) { 47448 o.isPathPointSelected(d) || (s || this.clearPathPointSelection(!0, !0), 47449 o.setNodePointsSelected([d], null)); 47450 let u = o.sortedSelNodePoints; 47451 this.dragStartCoords = u.map(c=>[c.x, c.y, c.inX, c.inY, c.outX, c.outY]); 47452 let h = Array.from(this.getNeighboringNodePoints(u)); 47453 this.dragStartNeighborCoords = h.map(c=>[c.x, c.y, c.inX, c.inY, c.outX, c.outY]) 47454 } else { 47455 let u = d.nodePoint; 47456 this.dragStartCoords = [[u.x, u.y, u.inX, u.inY, u.outX, u.outY]], 47457 this.dragStartNeighborCoords = null 47458 } 47459 this.hitTestContext = new Vv(!1,!0) 47460 } else 47461 this.setDragPoint(null), 47462 super.handlePointerDownEvent(e, t, n) 47463 } 47464 startPointerDrag(e, t, n, s, o) { 47465 if (this.dragPointInfo != null) { 47466 let i = z() 47467 , r = j() 47468 , a = []; 47469 for (let d of i.selectedControlPoints) 47470 i.isPathPointSelected(d.nodePoint) || a.push(d); 47471 r.initNodePointsDrag(a), 47472 this.setHoverCurveLocation(null) 47473 } else if (this.hoverCurveLocation != null) { 47474 let i = this.hoverCurveLocation 47475 , r = i.curveIndex 47476 , a = i.singlePathModel.getNodePoints() 47477 , d = a[r] 47478 , u = a[r < a.length - 1 ? r + 1 : 0]; 47479 this.dragStartCoords = [d.toCoords(), u.toCoords()] 47480 } else { 47481 let i = z() 47482 , r = j() 47483 , a = i.getSelectedModelsNodePoints() 47484 , d = new Set(i.sortedSelNodePoints) 47485 , u = this.toolOptions.selectorType; 47486 u === "lasso" && !this.isCtrlKey || u === "rect" && this.isCtrlKey ? this.selector = new _d(s,o,a,d) : this.selector = new vu(s,o,a,d), 47487 r.showSelectorElement(this.selector), 47488 this.clearPathPointSelection(!1, !0) 47489 } 47490 } 47491 handlePointerMoveEvent(e, t, n) { 47492 let s = V() 47493 , o = z() 47494 , i = j() 47495 , r = e.shiftKey; 47496 if ((e.buttons & 1) !== 0) { 47497 let d = this.dragPointInfo; 47498 if (d != null) { 47499 if (!d.dragStarted(t, n)) 47500 return; 47501 t += d.getPointerOffsetX(), 47502 n += d.getPointerOffsetY(); 47503 let u = d.pathPoint; 47504 if (e.ctrlKey) { 47505 let c, f; 47506 if (u instanceof ut) 47507 c = d.pointStartX, 47508 f = d.pointStartY; 47509 else { 47510 let y = u.nodePoint; 47511 c = y.xTransformed, 47512 f = y.yTransformed 47513 } 47514 let p = Kl(t, n, c, f, !0); 47515 t = p.x, 47516 n = p.y; 47517 let g = p.angle; 47518 this.guideOverlay = i.showGuideLine(c, f, g, this.guideOverlay), 47519 s.isShowAlignGuides() && i.showAlignLines(p.x, p.y, p.t
47519ypes[0], p.types[1]) 47520 } else { 47521 let c; 47522 if (u instanceof Is) { 47523 let p = u.nodePoint, g = p.getNodeType(), y = p.xTransformed, m = p.yTransformed, b = p.getV0Transformed(), M = p.getV1Transformed(), S; 47524 if (g === yt && b && Ae(b) && !Pl(b)) 47525 S = Te(b, 1, -1); 47526 else if (g === yt && M && Ae(M) && !Pl(M)) 47527 S = Te(M, 0, 1); 47528 else if (r) { 47529 let x = d.pointStartX 47530 , P = d.pointStartY; 47531 S = new B(x - y,P - m) 47532 } 47533 if (S && S.getLength() > 1e-8) { 47534 let x = Jt(y, m, S.x, S.y, t, n, !0, !0); 47535 t = x.x, 47536 n = x.y, 47537 c = S 47538 } 47539 } 47540 let f = Vo(t, n, c, this.hitTestContext); 47541 t = f.x, 47542 n = f.y, 47543 s.isShowAlignGuides() && i.showAlignLines(f.x, f.y, f.types[0], f.types[1]), 47544 i.hideGuide(this.guideOverlay) 47545 } 47546 if (u instanceof Is) 47547 this.moveControlPoint(u, r, t, n); 47548 else { 47549 let c = t - u.xTransformed 47550 , f = n - u.yTransformed; 47551 this.moveNodePoints(o.selectedNodePoints, c, f, !0) 47552 } 47553 } else if (this.selector != null) 47554 this.selector.moveTo(t, n), 47555 i.updateSelectorElement(this.selector), 47556 this.updateSelectorSelection(r); 47557 else if (this.hoverCurveLocation != null) { 47558 let u = this.hoverCurveLocation; 47559 u.v0 == null && (u.v0 = u.curve.v.slice(), 47560 u.p0 = u.p.clone()); 47561 let h = u.v0 47562 , c = u.t 47563 , f = u.pathModel.getAggregateTransform(); 47564 u.p = new B(t,n); 47565 let p = f.invTransformXY(u.p0.clone()) 47566 , g = f.invTransformXY(new B(t,n)) 47567 , y = Iw(h, p, g, c) 47568 , m = u.curveIndex 47569 , b = u.singlePathModel 47570 , M = b.getNodePoints() 47571 , S = M[m] 47572 , x = M[m === M.length - 1 ? 0 : m + 1] 47573 , P = S.toCoords(); 47574 P.splice(4, 2, y[2], y[3]); 47575 let C = x.toCoords(); 47576 if (C.splice(2, 2, y[4], y[5]), 47577 e.shiftKey) { 47578 let T = Te(h, 0, 1) 47579 , k = Te(h, 1, 1) 47580 , D = Jt(h[0], h[1], h[0] + T.x, h[1] + T.y, P[4], P[5]) 47581 , I = Jt(h[6], h[7], h[6] + k.x, h[7] + k.y, C[2], C[3]); 47582 P.splice(4, 2, D.x, D.y), 47583 C.splice(2, 2, I.x, I.y) 47584 } else { 47585 if (S.getNodeType() === yt) { 47586 let D = b.getCurve(m - 1)?.v; 47587 if (D && Ae(D)) { 47588 let I = Jt(D[0], D[1], D[6], D[7], P[4], P[5]); 47589 P.splice(4, 2, I.x, I.y) 47590 } else { 47591 let I = Se(P[0] - P[2], P[1] - P[3]) 47592 , F = Se(P[0] - P[4], P[1] - P[5]); 47593 I > 0 && F > 0 && (P[2] = P[0] - (P[4] - P[0]) * I / F, 47594 P[3] = P[1] - (P[5] - P[1]) * I / F) 47595 } 47596 } 47597 if (x.getNodeType() === yt) { 47598 let D = b.getCurve(m + 1)?.v; 47599 if (D && Ae(D)) { 47600 let I = Jt(D[0], D[1], D[6], D[7], C[2], C[3]); 47601 C.splice(2, 2, I.x, I.y) 47602 } else { 47603 let I = Se(C[0] - C[2], C[1] - C[3]) 47604 , F = Se(C[0] - C[4], C[1] - C[5]); 47605 I > 0 && F > 0 && (C[4] = C[0] - (C[2] - C[0]) * F / I, 47606 C[5] = C[1] - (C[3] - C[1]) * F / I) 47607 } 47608 } 47609 } 47610 o.moveNodePoints([S, x], [P, C]), 47611 i.showCurvePointOverlay(u.p) 47612 } 47613 } else {
47614 let d = s.appSettings.editor.pointTolerance * 100 / this.getZoom(), u = o.getPathPointsAt(t, n, d)[0], h; 47615 if (u != null) 47616 u !== this.hoverPoint && this.setHoverPoint(u); 47617 else { 47618 this.setHoverPoint(null); 47619 let c = s.selectedModels; 47620 h = o.getCurveLocationAt(c, t, n, d) 47621 } 47622 h != null ? (i.showCurvePointOverlay(h.p), 47623 this.hoverCurveLocation = h) : this.hoverCurveLocation != null && (i.hideCurvePointOverlay(), 47624 this.hoverCurveLocation = null) 47625 } 47626 this.setSelModeToggled(!!e.ctrlKey), 47627 this.updateCursor() 47628 } 47629 handlePointerUpEvent(e, t, n, s) { 47630 s && (this.endPointerDrag(), 47631 this.updateCursor()) 47632 } 47633 cancelPointerDrag(e, t) { 47634 this.endPointerDrag(), 47635 this.updateCursor() 47636 } 47637 endPointerDrag() { 47638 let e = z() 47639 , t = j(); 47640 t.hideGuide(this.guideOverlay); 47641 let n = this.dragPointInfo; 47642 if (n != null) { 47643 let s = n.pathPoint 47644 , o = ae(); 47645 if (!o.inProgress) 47646 if (s instanceof Is) { 47647 let i = new ts([s.nodePoint],this.dragStartCoords); 47648 o.addEdit(i) 47649 } else { 47650 o.startCompoundEdit(); 47651 let i = e.sortedSelNodePoints; 47652 o.addEdit(new ts(i,this.dragStartCoords)); 47653 let r = Array.from(this.getNeighboringNodePoints(i)); 47654 o.addEdit(new ts(r,this.dragStartNeighborCoords)), 47655 o.endCompoundEdit() 47656 } 47657 this.setDragPoint(null), 47658 t.showAlignLines(0, 0, !1, !1), 47659 t.endNodePointsDrag(), 47660 t.updatePathPointCoordinates(e.sortedSelNodePoints), 47661 this.hoverPoint = null 47662 } else if (this.hoverCurveLocation == null) { 47663 if (this.selector != null) { 47664 let s = e.sortedSelNodePoints; 47665 s = s.concat(Array.from(this.getNeighboringNodePoints(s))); 47666 for (let o of s) 47667 this.updateControlPointsSelection(o); 47668 t.hideSelectorElement(this.selector) 47669 } 47670 } 47671 this.dragStartCoords = null, 47672 this.dragStartNeighborCoords = null, 47673 this.selector = null 47674 } 47675 updateSelectorSelection(e) { 47676 let t = this.selector 47677 , n = t.sortedPoints 47678 , s = t.getPointsInFill() 47679 , o = t.prevSelPoints 47680 , i = t.prevAddOriginalSelPoints 47681 , r = t.originalSelPoints 47682 , a = [] 47683 , d = []; 47684 for (let u of n) { 47685 let h = s.has(u) 47686 , c = o != null && o.has(u); 47687 (e && !c || i && !h) && r.has(u) && (e && (h = !0), 47688 i && (c = !0)), 47689 (!o || h !== c) && (h ? a.push(u) : d.push(u)) 47690 } 47691 (a.length || d.length) && z().setNodePointsSelected(a, d), 47692 t.prevSelPoints = s, 47693 t.prevAddOriginalSelPoints = e 47694 } 47695 handleKeyDownEvent(e) { 47696 let t = e.key 47697 , n = e.repeat 47698 , s = z() 47699 , o = !1; 47700 if (t === Vn && this.selector != null) 47701 n || this.updateSelectorSelection(!0); 47702 else if (t === Fs) 47703 this.setSelModeToggled(!0); 47704 else if (t === ou || e.key === su) 47705 !n && s.sortedSelNodePoints.length > 0 && (this.deleteSelectedNodePoints(), 47706 this.setHoverPoint(null), 47707 this.setDragPoint(null), 47708 o = !0); 47709 else if (t === $s) 47710 this.clearPathPointSelection(!0, !0), 47711 o = !0; 47712 else if (e.altKey) { 47713 if (t === Io) { 47714 let i = s.sortedSelNodePoints.slice(); 47715 if (i.length > 0) { 47716 let a = i.at(-1).getPrevious(); 47717 a && s.setNodePointsSelected([a], i) 47718 } 47719 o = !0 47720 } else if (t === Lo) { 47721 let i = s.sortedSelNodePoints.slice(); 47722 if (i.length > 0) { 47723 let a = i.at(-1).getNext(); 47724 a && s.setNodePointsSelected([a], i) 47725 } 47726 o = !0 47727 } 47728 } else if (t === hn || t === cs || t === Io || t === Lo) { 47729 let i = s.sortedSelNodePoints 47730 , r = i.map(u=>u.toCoords()) 47731 , a = t === Io ? -1 : t === Lo ? 1 : 0 47732 , d = t === hn ? -1 : t === cs ? 1 : 0; 47733 r.forEach(u=>{ 47734 for (let h = 0; h < u.length; h++) 47735 u[h] += h % 2 === 0 ? a : d 47736 } 47737 ), 47738 s.moveNodePoints(i, r), 47739 o = !0 47740 } 47741 o && e.preventDefault() 47742 } 47743 handleKeyUpEvent(e) { 47744 let t = e.key; 47745 t === Vn && this.selector != null ? this.updateSelectorSelection(!1) : t === Fs && this.setSelModeToggled(!1) 47746 } 47747 deleteSelectedNodePoints() { 47748 z().deleteSelectedNodePoints(),
47749 this.updateCursor() 47750 } 47751 setDragPoint(e, t, n) { 47752 let s = j(); 47753 this.dragPointInfo != null && s.setPrimaryPointOverlay(this.dragPointInfo.pathPoint, !1), 47754 e == null ? this.dragPointInfo = null : (this.dragPointInfo = new CN(t,n,e), 47755 s.setPrimaryPointOverlay(e, !0)) 47756 } 47757 setHoverPoint(e) { 47758 let t = j(); 47759 this.hoverPoint != null && t.setHoverPointOverlay(this.hoverPoint, !1), 47760 this.hoverPoint = e, 47761 e != null && t.setHoverPointOverlay(e, !0) 47762 } 47763 setHoverCurveLocation(e) { 47764 let t = j(); 47765 e != null ? (t.showCurvePointOverlay(e.p), 47766 this.hoverCurveLocation = e) : this.hoverCurveLocation != null && (t.hideCurvePointOverlay(), 47767 this.hoverCurveLocation = null) 47768 } 47769 updateControlPointsSelection(e) { 47770 let t = z() 47771 , n = j() 47772 , s = e.controlPointIn 47773 , o = e.controlPointOut 47774 , i = !e.equalsControlPointIn() 47775 , r = !e.equalsControlPointOut(); 47776 if (!t.isPathPointSelected(e)) { 47777 if (i) { 47778 let a = e.getPrevious(); 47779 i = i && a != null && t.isPathPointSelected(a) 47780 } 47781 if (r) { 47782 let a = e.getNext(); 47783 r = a != null && t.isPathPointSelected(a) 47784 } 47785 } 47786 t.setControlPointSelected(s, i), 47787 t.setControlPointSelected(o, r), 47788 n.setPathPointSelected(s, i), 47789 n.setPathPointSelected(o, r), 47790 n.updateHandleLineElement(e) 47791 } 47792 onNodePointsSelectionChanged(e, t) { 47793 let n = j(), s = z(), o; 47794 if (e && e.length > 0) { 47795 e.sort((r,a)=>r.compare(a)); 47796 let i = s.sortedSelNodePoints; 47797 for (let r of e) { 47798 let a = s.getSelectedNodePointIndex(r); 47799 o = i[a - 1], 47800 n.setPathPointSelected(r, !0, o) 47801 } 47802 } 47803 if (t && t.length > 0) 47804 for (let i of t) 47805 n.setPathPointSelected(i, !1); 47806 if (this.selector == null) { 47807 for (let i of e) 47808 this.updateControlPointsSelection(i); 47809 for (let i of t) 47810 this.updateControlPointsSelection(i); 47811 for (let i of this.getNeighboringNodePoints(e)) 47812 this.updateControlPointsSelection(i); 47813 for (let i of this.getNeighboringNodePoints(t)) 47814 this.updateControlPointsSelection(i) 47815 } 47816 } 47817 onNodePointsMoved(e, t) { 47818 j().updatePathPointCoordinates(e); 47819 for (let s of e) 47820 this.updateControlPointsSelection(s); 47821 for (let s of t) 47822 this.updateSelModelOverlay(s) 47823 } 47824 onNodePointsChanged(e, t, n, s) { 47825 let o = j(); 47826 if (t) { 47827 let i = []; 47828 t.forEach(r=>{ 47829 i.push(r, r.controlPointIn, r.controlPointOut) 47830 } 47831 ), 47832 o.showPathPointsOverlay(i); 47833 for (let r of t) 47834 o.updateHandleLineElement(r) 47835 } 47836 n && n.forEach(i=>{ 47837 o.removePathPointOverlay(i), 47838 o.removePathPointOverlay(i.controlPointIn), 47839 o.removePathPointOverlay(i.controlPointOut) 47840 } 47841 ), 47842 o.updateStartEndNodes(), 47843 this.updateSelModelOverlay(e) 47844 } 47845 clearPathPointSelection(e, t) { 47846 let n = z() 47847 , s = n.sortedSelNodePoints; 47848 if (t) { 47849 let o = j(); 47850 for (let i of n.selectedControlPoints) 47851 o.setPathPointSelected(i, !1); 47852 n.clearControlPointsSelection(), 47853 s = s.concat(Array.from(this.getNeighboringNodePoints(s))); 47854 for (let i of s) 47855 o.updateHandleLineElement(i) 47856 } 47857 e && n.setNodePointsSelected(null, s) 47858 } 47859 showSelModelOverlay(e) { 47860 let t = j(); 47861 if (t.showModelOverlay(e, "nodesTool"), 47862 e.isPath()) { 47863 t.showModelOverlay(e, "nodesTool", "transform"); 47864 let n = e.getSinglePathModels() 47865 , s = []; 47866 for (let o of n) { 47867 let i = o.getNodePoints(); 47868 for (let r of i) 47869 s.push(r.controlPointIn), 47870 s.push(r.controlPointOut), 47871 s.push(r) 47872 } 47873 t.showPathPointsOverlay(s) 47874 } 47875 } 47876 hideSelModelOverlay(e) { 47877 let t = j(); 47878 if (t.removeModelOverlay(e, "nodesTool"), 47879 e.isPath()) { 47880 t.removeModelOverlay(e, "nodesTool", "transform"); 47881 for (let n of e.getSinglePathModels()) { 47882 let s = n.getNodePoints(); 47883 for (let o of s) 47884 t.removePathPointOverlay(o), 47885 t.removePathPointOverlay(o.controlPointIn), 47886 t.removePathPointOverlay(o.controlPointOut) 47887 } 47888 } 47889 } 47890 updateSelModelOverlay(e) { 47891 let t = j(); 47892 t.updateModelOverlay(e, "nodesTool"), 47893 e.isPath() && t.updateModelOverlay(e, "nodesTool", "transform") 47894 } 47895 moveNodePoints(e, t, n, s) { 47896 let o = j(), i, r, a = new Set, d = null, u = new Set, h = new Set; 47897 for (let f of e) { 47898 let p = f.getPathModel(); 47899 if (p !== d) { 47900 a.add(p); 47901 let m = p.getAggregateTransform().invert(); 47902 if (m.isIdentity) 47903 i = t, 47904 r = n, 47905 r = n; 47906 else { 47907 let b = f.xTransformed 47908 , M = f.yTransformed 47909 , S = new B(b,M); 47910 m.transformXY(S); 47911 let x = new B(b + t,M + n); 47912 m.transformXY(x), 47913 i = x.x - S.x, 47914 r = x.y - S.y 47915 } 47916 d = p 47917 } 47918 f.move(i, r, i, r, i, r), 47919 f.moveTransformed(t, n, t, n, t, n); 47920 let g = f.getPrevious(); 47921 g != null && Ae(f.getV0()) && (f.getNodeType() === yt && (f.setSmooth(!1, !0), 47922 h.add(f)), 47923 !e.has(g) && g.getNodeType() === yt && (g.setSmooth(!0, !1), 47924 u.add(g))); 47925 let y = f.getNext(); 47926 y != null && Ae(f.getV1()) && (f.getNodeType() === yt && (f.setSmooth(!0, !1), 47927 h.add(f)), 47928 !e.has(y) && y.getNodeType() === yt && (y.setSmooth(!1, !0), 47929 u.add(y))) 47930 } 47931 for (let f of a) 47932 f.pathDataUpdated(), 47933 this.updateSelModelOverlay(f); 47934 z().fireModelsUpdated(a), 47935 s ? o.setSelectedPointsTranslate(t, n, h) : o.updatePathPointCoordinates(e), 47936 o.updatePathPointCoordinates(u) 47937 }
47938 moveControlPoint(e, t, n, s) { 47939 let o = j() 47940 , i = e.nodePoint 47941 , r = i.getPathModel() 47942 , a = r.getAggregateTransform() 47943 , d = new B(n,s); 47944 a.invTransformXY(d); 47945 let u = new B(d.x - e.x,d.y - e.y) 47946 , h = i.getNodeType() === yt; 47947 if (h = t ? !h : h, 47948 e.isInControlPoint()) { 47949 if (i.inX += u.x, 47950 i.inY += u.y, 47951 h) { 47952 let c = Se(i.inX - i.x, i.inY - i.y); 47953 if (c > Number.EPSILON) { 47954 let f = Se(i.outX - i.x, i.outY - i.y); 47955 i.outX = i.x + (i.x - i.inX) * f / c, 47956 i.outY = i.y + (i.y - i.inY) * f / c 47957 } 47958 } 47959 } else if (i.outX += u.x, 47960 i.outY += u.y, 47961 h) { 47962 let c = Se(i.outX - i.x, i.outY - i.y); 47963 if (c > Number.EPSILON) { 47964 let f = Se(i.inX - i.x, i.inY - i.y); 47965 i.inX = i.x + (i.x - i.outX) * f / c, 47966 i.inY = i.y + (i.y - i.outY) * f / c 47967 } 47968 } 47969 i.updateTransformedCoords(a), 47970 r.pathDataUpdated(), 47971 this.updateSelModelOverlay(r), 47972 o.updatePathPointCoordinates([e]) 47973 } 47974 onModelSelectionChanged(e, t) { 47975 let n = t && Ke(t) 47976 , s = e && Ke(e); 47977 if (n != null) 47978 for (let o = n.length - 1; o >= 0; o--) { 47979 let i = n[o]; 47980 this.hideSelModelOverlay(i) 47981 } 47982 if (s != null) 47983 for (let o of s) 47984 this.showSelModelOverlay(o) 47985 } 47986 onSelectionGeometryChanged() { 47987 let e = V() 47988 , t = j() 47989 , n = e.selectedModels 47990 , s = Ke(n); 47991 for (let o of s) 47992 if (o instanceof Jl) 47993 for (let i of o._singlePathModels) 47994 t.updatePathPointCoordinates(i.getNodePoints()); 47995 for (let o of s) 47996 this.updateSelModelOverlay(o) 47997 } 47998 getContextActions(e, t) { 47999 return [{ 48000 actionName: "toCornerNodes" 48001 }, { 48002 actionName: "toSmoothNodes" 48003 }] 48004 } 48005 updateCursor() { 48006 this.selector ? this.selector instanceof _d ? this.setCursor(!0, "selectorLasso") : this.setCursor(!0, "selectorRect") : this.dragPointInfo ? this.setCursor(!0, "nodesPoint") : this.hoverPoint ? this.setCursor(!1, "nodesPoint") : this.setCursor(!1, "nodes") 48007 } 48008 setActive(e) { 48009 let t = V() 48010 , n = z() 48011 , s = j(); 48012 if (e) { 48013 this.setCursor(!1, "nodes"); 48014 let o = t.selectedModels; 48015 for (let i of Ke(o)) 48016 this.showSelModelOverlay(i); 48017 for (let i of n.sortedSelNodePoints) 48018 s.setPathPointSelected(i, !0); 48019 for (let i of n.sortedSelNodePoints) 48020 this.updateControlPointsSelection(i) 48021 } else { 48022 for (let i of n.sortedSelNodePoints) 48023 s.setPathPointSelected(i, !1); 48024 for (let i of n.selectedControlPoints) 48025 s.setPathPointSelected(i, !1); 48026 let o = t.selectedModels; 48027 for (let i of Ke(o)) 48028 this.hideSelModelOverlay(i); 48029 this.setHoverPoint(null), 48030 this.setDragPoint(null), 48031 this.setHoverCurveLocation(null), 48032 this.selector != null && (s.hideSelectorElement(this.selector), 48033 this.selector = null) 48034 } 48035 } 48036} 48037new _N; 48038function ph(l, e, t=.5) { 48039 let n = l[0] 48040 , s = l[1] 48041 , o = l[6] 48042 , i = l[7] 48043 , r = e[6] 48044 , a = e[7] 48045 , d = Se(o - n, i - s) 48046 , u = Se(r - o, a - i) 48047 , h = K0(d, t) 48048 , c = h * h 48049 , f = K0(u, t) 48050 , p = f * f; 48051 if (f === 0) 48052 l[4] = o, 48053 l[5] = o; 48054 else { 48055 let g = 2 * p + 3 * f * h + c 48056 , y = 3 * f * (f + h); 48057 l[4] = (p * n + g * o - c * r) / y, 48058 l[5] = (p * s + g * i - c * a) / y 48059 } 48060 if (h === 0) 48061 e[2] = o, 48062 e[3] = i; 48063 else { 48064 let g = 2 * c + 3 * h * f + p 48065 , y = 3 * h * (h + f); 48066 e[2] = (c * r + g * o - p * n) / y, 48067 e[3] = (c * a + g * i - p * s) / y 48068 } 48069} 48070const TN = { 48071 name: "PenOptionsComponent", 48072 components: { 48073 StrokeStyleEditor: gu, 48074 PaintButton: mu, 48075 HyCheckbox: ml, 48076 HyLabel: Bn, 48077 HyTooltip: pt, 48078 HyGroup: Dt, 48079 HyRadio: en, 48080 SvgIcon: gt 48081 }, 48082 data() { 48083 return { 48084 tool: null, 48085 toolOptions: null, 48086 svgs: me({ 48087 polylineSvg: VC, 48088 bezierSvg: NC, 48089 catmullSvg: RC, 48090 ellipticSvg: FC,
48091 autoCloseSvg: q2 48092 }) 48093 } 48094 }, 48095 methods: { 48096 onPaintUpdate(l, e) { 48097 (e === "stroke" ? this.toolOptions.strokePaintGroup : this.toolOptions.fillPaintGroup).setPaint(l) 48098 }, 48099 onStrokeStyleUpdate(l) { 48100 this.toolOptions.strokeStyle.set(l) 48101 } 48102 } 48103}; 48104function kN(l, e, t, n, s, o) { 48105 const i = E("paint-button") 48106 , r = E("stroke-style-editor") 48107 , a = E("hy-group") 48108 , d = E("svg-icon") 48109 , u = E("hy-tooltip") 48110 , h = E("hy-radio") 48111 , c = E("hy-label") 48112 , f = E("hy-checkbox"); 48113 return N(), 48114 $("div", null, [w(i, { 48115 "paint-target": "fill", 48116 "paint-group": s.toolOptions.fillPaintGroup, 48117 "onUpdate:paint": e[0] || (e[0] = p=>o.onPaintUpdate(p, "fill")) 48118 }, null, 8, ["paint-group"]), w(a, null, { 48119 default: O(()=>[w(i, { 48120 "paint-target": "stroke", 48121 "paint-group": s.toolOptions.strokePaintGroup, 48122 "onUpdate:paint": e[1] || (e[1] = p=>o.onPaintUpdate(p, "stroke")) 48123 }, null, 8, ["paint-group"]), w(r, { 48124 "stroke-style": s.toolOptions.strokeStyle, 48125 compact: "", 48126 "onUpdate:strokeStyle": o.onStrokeStyleUpdate, 48127 disabled: s.toolOptions.strokePaintGroup.isNoPaint 48128 }, null, 8, ["stroke-style", "onUpdate:strokeStyle", "disabled"])]), 48129 _: 1 48130 }), w(c, { 48131 label: l.$t("tools.pen.mode") + ":" 48132 }, { 48133 default: O(()=>[w(a, null, { 48134 default: O(()=>[w(h, { 48135 ref: "bezier", 48136 type: "button", 48137 modelValue: s.toolOptions.type, 48138 "onUpdate:modelValue": e[2] || (e[2] = p=>s.toolOptions.type = p), 48139 value: "bezier", 48140 name: "penType", 48141 class: "hy-toolbar-element" 48142 }, { 48143 default: O(()=>[w(d, { 48144 svg: s.svgs.bezierSvg 48145 }, null, 8, ["svg"]), w(u, { 48146 getTarget: ()=>l.$refs.bezier, 48147 label: l.$t("tools.pen.bezier") 48148 }, null, 8, ["getTarget", "label"])]), 48149 _: 1 48150 }, 8, ["modelValue"]), w(h, { 48151 ref: "polyline", 48152 type: "button", 48153 modelValue: s.toolOptions.type, 48154 "onUpdate:modelValue": e[3] || (e[3] = p=>s.toolOptions.type = p), 48155 value: "polyline", 48156 name: "penType", 48157 class: "hy-toolbar-element" 48158 }, { 48159 default: O(()=>[w(d, {
48160 svg: s.svgs.polylineSvg 48161 }, null, 8, ["svg"]), w(u, { 48162 getTarget: ()=>l.$refs.polyline, 48163 label: l.$t("tools.pen.polyline") 48164 }, null, 8, ["getTarget", "label"])]), 48165 _: 1 48166 }, 8, ["modelValue"]), l.$isDevelopment ? (N(), 48167 pe(h, { 48168 key: 0, 48169 ref: "catmullRom", 48170 type: "button", 48171 modelValue: s.toolOptions.type, 48172 "onUpdate:modelValue": e[4] || (e[4] = p=>s.toolOptions.type = p), 48173 value: "catmullRom", 48174 name: "penType", 48175 class: "hy-toolbar-element" 48176 }, { 48177 default: O(()=>[w(d, { 48178 svg: s.svgs.catmullSvg 48179 }, null, 8, ["svg"])]), 48180 _: 1 48181 }, 8, ["modelValue"])) : be("", !0), w(h, { 48182 ref: "elliptic", 48183 type: "button", 48184 modelValue: s.toolOptions.type, 48185 "onUpdate:modelValue": e[5] || (e[5] = p=>s.toolOptions.type = p), 48186 value: "elliptic", 48187 name: "penType", 48188 class: "hy-toolbar-element" 48189 }, { 48190 default: O(()=>[w(d, { 48191 svg: s.svgs.ellipticSvg 48192 }, null, 8, ["svg"]), w(u, { 48193 getTarget: ()=>l.$refs.elliptic, 48194 label: l.$t("tools.pen.elliptic") 48195 }, null, 8, ["getTarget", "label"])]), 48196 _: 1 48197 }, 8, ["modelValue"])]), 48198 _: 1 48199 })]), 48200 _: 1 48201 }, 8, ["label"]), w(f, { 48202 ref: "closePath", 48203 type: "button", 48204 modelValue: s.toolOptions.closePath, 48205 "onUpdate:modelValue": e[6] || (e[6] = p=>s.toolOptions.closePath = p), 48206 class: "hy-toolbar-element" 48207 }, {
48208 default: O(()=>[w(d, { 48209 svg: s.svgs.autoCloseSvg 48210 }, null, 8, ["svg"]), w(u, { 48211 getTarget: ()=>l.$refs.closePath, 48212 label: l.$t("tools.pen.closePath") 48213 }, null, 8, ["getTarget", "label"])]), 48214 _: 1 48215 }, 8, ["modelValue"])]) 48216} 48217const EN = ie(TN, [["render", kN]]) 48218 , gh = "bezier" 48219 , Yi = "catmullRom" 48220 , Ng = "elliptic"; 48221class DN extends Ho { 48222 isHandleDrag = !1; 48223 editPath; 48224 pathModel; 48225 lastNodePoint; 48226 pointerDownTime; 48227 isClosed; 48228 toolOptions = { 48229 type: gh, 48230 fillPaintGroup: new ql("fill"), 48231 strokePaintGroup: new ql("stroke",new et(new ce(0,0,0))), 48232 strokeStyle: new Qt, 48233 closePath: !1 48234 }; 48235 toolbarOptionsComponent = EN; 48236 constructor() { 48237 super("pen"), 48238 this.reset() 48239 } 48240 reset() { 48241 this.isHandleDrag = !1, 48242 this.lastNodePoint = null, 48243 this.editPath = null, 48244 this.pathModel = null, 48245 this.isClosed = !1 48246 } 48247 setActive(e) { 48248 if (e) { 48249 this.setCursor(!1, "pen"); 48250 let t = this.toolOptions; 48251 t.fillPaintGroup.isNoPaint && t.strokePaintGroup.isNoPaint && t.strokePaintGroup.setNoPaint(!1), 48252 this.reset() 48253 } else { 48254 this.endDrawing(); 48255 let t = V() 48256 , n = z() 48257 , s = j(); 48258 s.hideOverlayPath(this.editPath); 48259 for (let i of n.sortedSelNodePoints) 48260 s.setPathPointSelected(i, !1); 48261 for (let i of n.selectedControlPoints) 48262 s.setPathPointSelected(i, !1); 48263 let o = t.selectedModels; 48264 for (let i of Ke(o)) 48265 this.showSelModelOverlay(i, !1); 48266 this.reset() 48267 } 48268 } 48269 getPath() { 48270 let e = this.pathModel; 48271 return e && e._singlePathModels[0].getPath() 48272 } 48273 handlePointerDownEvent(e, t, n) { 48274 let s = e.ctrlKey 48275 , o = j() 48276 , i = V() 48277 , r = i.appSettings.editor.pointTolerance * 100 / this.getZoom() 48278 , a = this.lastNodePoint 48279 , d = a ? Se(a.x - t, a.y - n) : 0 48280 , u = e.timeStamp || performance.now(); 48281 if (this.pointerDownTime != null && u - this.pointerDownTime < 350 && d < r) { 48282 this.endDrawing(); 48283 return 48284 } 48285 let h = z(); 48286 if (a == null) { 48287 h.setModelsSelected(null, i.selectedModels); 48288 let c = Kl(t, n, 0, 0, !1); 48289 t = c.x, 48290 n = c.y; 48291 let f = new Rv(t,n); 48292 this.lastNodePoint = f, 48293 j().showPathPointsOverlay([f]), 48294 this.toolOptions.type === gh ? this.isHandleDrag = !0 : this.addPointToEditPath(t, n, !1) 48295 } else { 48296 if (this.editPath != null) { 48297 let c = this.editPath.getFirstCurve().getStartPoint(); 48298 if (Se(c.x - t, c.y - n) < r) { 48299 this.isClosed = !0, 48300 this.pathModel.getSinglePathModels()[0].setClosed(!0), 48301 this.syncPath(), 48302 this.endDrawing(), 48303 this.updatePathData(); 48304 return 48305 } 48306 } 48307 if (d > r) { 48308 let c = Kl(t, n, a.x, a.y, s); 48309 if (t = c.x, 48310 n = c.y, 48311 this.pathModel == null) { 48312 let p = new bt([new ft]); 48313 this.pathModel = p, 48314 p.setStrokeStyle(this.toolOptions.strokeStyle), 48315 z().insertModels([p]), 48316 this.updatePathColors() 48317 } 48318 this.updateLastNodePoint(e.shiftKey, e.ctrlKey, e.altKey, t, n), 48319 this.syncPath(); 48320 let f = this.editPath; 48321 o.updateOverlayPath(f, on([f]), this.getEditPathPoints()), 48322 a.set(t, n, t, n, t, n), 48323 a._hasHandles = !1, 48324 o.removePathPointOverlay(a.controlPointIn), 48325 o.removePathPointOverlay(a.controlPointOut), 48326 o.updatePathPointCoordinates([a]), 48327 this.toolOptions.type === gh ? this.isHandleDrag = !0 : this.addPointToEditPath(t, n, !1) 48328 } 48329 this.syncPath() 48330 } 48331 this.pointerDownTime = u, 48332 this.setCursor(!0, "pen") 48333 } 48334 handlePointerDownOutsideEvent() { 48335 this.endDrawing() 48336 } 48337 handlePointerUpEvent(e, t, n) { 48338 this.isHandleDrag && (this.lastNodePoint != null && this.addPointToEditPath(t, n, e.ctrlKey), 48339 this.isHandleDrag = !1), 48340 this.setCursor(!1, "pen") 48341 } 48342 cancelPointerDrag() { 48343 super.cancelPointerDrag(), 48344 this.endDrawing() 48345 } 48346 addPointToEditPath(e, t) { 48347 let n = this.lastNodePoint; 48348 if (n != null) { 48349 let s = this.editPath; 48350 s == null && (s = new ft,
48351 this.editPath = s, 48352 j().showOverlayPath(s, on([s]), [])); 48353 let o = new Mt([n.x, n.y, n.outX, n.outY, n.x, n.y, n.x, n.y]); 48354 s.appendCurve(o) 48355 } 48356 } 48357 handlePointerMoveEvent(e, t, n) { 48358 let s = V(); 48359 if (this.lastNodePoint != null) { 48360 let o = s.appSettings.editor.pointTolerance * 100 / this.getZoom() 48361 , i = this.editPath && this.editPath.getFirstCurve().getStartPoint() || new B(this.lastNodePoint.x,this.lastNodePoint.y); 48362 if (Se(i.x - t, i.y - n) < o) 48363 t = i.x, 48364 n = i.y; 48365 else { 48366 let r = 200 / this.getZoom(); 48367 Se(this.lastNodePoint.x - t, this.lastNodePoint.y - n) < r && (t = this.lastNodePoint.x, 48368 n = this.lastNodePoint.y) 48369 } 48370 this.updateLastNodePoint(e.shiftKey, e.ctrlKey, e.altKey, t, n), 48371 this.syncPath() 48372 } else if (s.isShowAlignGuides()) { 48373 let o = Vo(t, n, null); 48374 j().showAlignLines(o.x, o.y, o.types[0], o.types[1]) 48375 } 48376 } 48377 handlePointerleaveEvent() { 48378 j().showAlignLines(0, 0, null, null) 48379 } 48380 updateLastNodePoint(e, t, n, s, o) { 48381 let i = this.lastNodePoint; 48382 if (i != null) { 48383 let r = j() 48384 , a = Kl(s, o, i.x, i.y, t); 48385 s = a.x, 48386 o = a.y, 48387 V().isShowAlignGuides() && r.showAlignLines(a.x, a.y, a.types[0], a.types[1]); 48388 let u = this.editPath; 48389 if (this.isHandleDrag) { 48390 let h = i.controlPointIn 48391 , c = i.controlPointOut; 48392 if (i.outX = s, 48393 i.outY = o, 48394 r.setPathPointSelected(h, !0), 48395 r.setPathPointSelected(c, !0), 48396 n) 48397 i.setNodeType(eu); 48398 else { 48399 if (i.inX = 2 * i.x - s, 48400 i.inY = 2 * i.y - o, 48401 u != null) { 48402 let f = u.getLastCurve().v; 48403 f[4] = i.inX, 48404 f[5] = i.inY 48405 } 48406 i.setNodeType(yt) 48407 } 48408 i._hasHandles || (r.showPathPointsOverlay([h, c]), 48409 i._hasHandles = !0), 48410 r.updatePathPointCoordinates([i]) 48411 } else { 48412 if (u != null) { 48413 let c = u.getLastCurve().v; 48414 c[4] = c[6] = s, 48415 c[5] = c[7] = o 48416 } 48417 let h = this.toolOptions.type; 48418 if ((h === Yi || h === Ng) && this.pathModel != null && u.getCurveCount() > 1) { 48419 let c = u.getCurve(-2).v 48420 , f = u.getLastCurve().v; 48421 n ? (c.splice(4, 2, c[6], c[7]), 48422 f.splice(2, 2, f[0], f[1])) : h === Yi ? ph(c, f) : gr(c, f) 48423 } 48424 } 48425 u != null && r.updateOverlayPath(u, on([u]), this.getEditPathPoints()), 48426 this.syncPath() 48427 } 48428 } 48429 handleKeyDownEvent(e) { 48430 if (!e.repeat) 48431 if (e.key === tc) { 48432 let t = V(); 48433 this.updateLastNodePoint(e.shiftKey, e.ctrlKey, !0, t.pointerX, t.pointerY) 48434 } else if (e.key === Fs) { 48435 let t = V(); 48436 this.updateLastNodePoint(e.shiftKey, !0, e.altKey, t.pointerX, t.pointerY) 48437 } else 48438 e.key === $s || e.key === Qr ? this.endDrawing() : e.key === "z" && e.ctrlKey && this.lastNodePoint && e.preventDefault() 48439 } 48440 handleKeyUpEvent(e) { 48441 if (e.key === Fs) { 48442 let t = V(); 48443 this.updateLastNodePoint(e.shiftKey, !1, e.altKey, t.pointerX, t.pointerY) 48444 } else if (e.key === tc && this.lastNodePoint != null) { 48445 let t = V(); 48446 this.updateLastNodePoint(e.shiftKey, e.ctrlKey, !1, t.pointerX, t.pointerY), 48447 e.preventDefault() 48448 } 48449 } 48450 handleKeyPressEvent() {} 48451 onFocusLost() { 48452 this.endDrawing() 48453 } 48454 endDrawing() { 48455 let e = j() 48456 , t = this.pathModel 48457 , n = this.editPath; 48458 if (t != null) { 48459 let o = this.toolOptions.type; 48460 if (!this.isClosed && this.toolOptions.closePath && (this.syncPath(), 48461 this.isClosed = !0, 48462 this.pathModel.getSinglePathModels()[0].setClosed(!0), 48463 this.updatePathData()), 48464 this.isClosed && (o === Yi || o === Ng)) { 48465 let d = this.getPath() 48466 , u = d.getCurve(-2).v 48467 , h = d.getCurve(-1).v 48468 , c = h.slice(); 48469 o === Yi ? ph(u, h) : gr(u, h), 48470 h[4] = c[4], 48471 h[5] = c[5], 48472 u = d.getCurve(-1).v, 48473 h = d.getCurve(0).v, 48474 c = h.slice(), 48475 o === Yi ? ph(u, h) : gr(u, h), 48476 h[4] = c[4], 48477 h[5] = c[5], 48478 this.updatePathData() 48479 } 48480 t.getSinglePathModels()[0].setNodeTypes(), 48481 t.transformUpdated(); 48482 let r = V(); 48483 z().setModelsSelected([t], r.selectedModels) 48484 } 48485 n != null && e.hideOverlayPath(n); 48486 let s = this.lastNodePoint; 48487 s != null && (e.removePathPointOverlay(s), 48488 e.removePathPointOverlay(s.controlPointIn), 48489 e.removePathPointOverlay(s.controlPointOut)), 48490 this.reset() 48491 } 48492 updatePathData() { 48493 this.pathModel != null && this.pathModel.pathDataUpdated() 48494 } 48495 updatePathColors() { 48496 let e = this.pathModel; 48497 if (e != null) { 48498 let t = this.toolOptions.strokePaintGroup.getPaint(); 48499 e.setStrokePaint(t && t.clone()), 48500 t != null && e.setStrokeStyle(this.toolOptions.strokeStyle); 48501 let n = this.toolOptions.fillPaintGroup.getPaint(); 48502 e.setFillPaint(n && n.clone()) 48503 } 48504 } 48505 onModelSelectionChanged(e, t) { 48506 e?.forEach(n=>this.showSelModelOverlay(n, !0)), 48507 t?.forEach(n=>this.showSelModelOverlay(n, !1)) 48508 } 48509 showSelModelOverlay(e, t) { 48510 let n = j(); 48511 if (e.isPath()) { 48512 t ? n.showModelOverlay(e, this.name) : n.removeModelOverlay(e, this.name); 48513 let s = e.getSinglePathModels() 48514 , o = []; 48515 for (let i of s) { 48516 let r = i.getNodePoints(); 48517 for (let a = 0; a < r.length; a++) { 48518 let d = r[a]; 48519 o.push(d) 48520 } 48521 } 48522 t ? n.showPathPointsOverlay(o) : o.forEach(i=>
48522n.removePathPointOverlay(i)) 48523 } 48524 } 48525 syncPath() { 48526 let e = this.editPath 48527 , t = this.getPath(); 48528 if (e != null && t != null) { 48529 let n = this.pathModel.getSinglePathModels()[0] 48530 , s = e.getCurveCount() - (this.isClosed || this.isHandleDrag ? 0 : 1); 48531 t.getCurveCount() > s ? n.removeNodePoints(s - 1, t.getCurveCount() - s) : t.getCurveCount() < s ? n.insertCurveValues(null, [e.getCurve(this.isHandleDrag ? -1 : -2).v]) : n.getPath().getCurves().forEach((o,i)=>o.setValues(e.getCurve(i).v)), 48532 this.updatePathData() 48533 } 48534 } 48535 getEditPathPoints() { 48536 let e = [] 48537 , t = this.editPath 48538 , n = t && t.getCurves(); 48539 if (n && n.length > 0) { 48540 let s = n[0].v; 48541 e.push(new B(s[0],s[1])), 48542 n.forEach(o=>e.push(new B(o.v[6],o.v[7]))) 48543 } 48544 return e 48545 } 48546} 48547new DN; 48548const ON = { 48549 name: "PencilOptionsComponent", 48550 components: { 48551 PaintButton: mu, 48552 HyGroup: Dt, 48553 StrokeStyleEditor: gu, 48554 SvgIcon: gt, 48555 HyTooltip: pt, 48556 HyInputNumber: Lt, 48557 HyCheckbox: ml, 48558 HyLabel: Bn 48559 }, 48560 data() { 48561 return { 48562 tool: null, 48563 toolOptions: null, 48564 svgs: me({ 48565 autoCloseSvg: q2, 48566 smoothingSvg: gC 48567 }) 48568 } 48569 }, 48570 methods: { 48571 onPaintUpdate(l, e) { 48572 (e === "stroke" ? this.toolOptions.strokePaintGroup : this.toolOptions.fillPaintGroup).setPaint(l) 48573 }, 48574 onStrokeStyleUpdate(l) { 48575 this.toolOptions.strokeStyle.set(l) 48576 } 48577 } 48578}; 48579function AN(l, e, t, n, s, o) { 48580 const i = E("paint-button") 48581 , r = E("stroke-style-editor") 48582 , a = E("hy-group") 48583 , d = E("hy-input-number") 48584 , u = E("hy-tooltip") 48585 , h = E("hy-label") 48586 , c = E("svg-icon") 48587 , f = E("hy-checkbox"); 48588 return N(), 48589 $("div", null, [w(i, { 48590 "paint-target": "fill", 48591 "paint-group": s.toolOptions.fillPaintGroup, 48592 "onUpdate:paint": e[0] || (e[0] = p=>o.onPaintUpdate(p, "fill")) 48593 }, null, 8, ["paint-group"]), w(a, null, { 48594 default: O(()=>[w(i, { 48595 "paint-target": "stroke", 48596 "paint-group": s.toolOptions.strokePaintGroup, 48597 "onUpdate:paint": e[1] || (e[1] = p=>o.onPaintUpdate(p, "stroke")) 48598 }, null, 8, ["paint-group"]), w(r, { 48599 "stroke-style": s.toolOptions.strokeStyle, 48600 compact: "", 48601 disabled: s.toolOptions.strokePaintGroup.isNoPaint, 48602 "onUpdate:strokeStyle": o.onStrokeStyleUpdate 48603 }, null, 8, ["stroke-style", "disabled", "onUpdate:strokeStyle"])]), 48604 _: 1 48605 }), w(h, { 48606 ref: "smoothing", 48607 label: l.$t("tools.pencil.smoothing") 48608 }, { 48609 default: O(()=>[w(d, { 48610 ref: "smoothing", 48611 size: "24", 48612 min: 1, 48613 max: 20, 48614 modelValue: s.toolOptions.smoothing, 48615 "onUpdate:modelValue": e[2] || (e[2] = p=>s.toolOptions.smoothing = p), 48616 "show-buttons": !1 48617 }, null, 8, ["modelValue"]), w(u, { 48618 getTarget: ()=>l.$refs.smoothing, 48619 label: l.$t("tools.pencil.smoothing") 48620 }, null, 8, ["getTarget", "label"])]), 48621 _: 1 48622 }, 8, ["label"]), w(f, { 48623 ref: "closePath", 48624 type: "button", 48625 modelValue: s.toolOptions.closePath, 48626 "onUpdate:modelValue": e[3] || (e[3] = p=>s.toolOptions.closePath = p), 48627 class: "hy-toolbar-element" 48628 }, {
48629 default: O(()=>[w(c, { 48630 svg: s.svgs.autoCloseSvg 48631 }, null, 8, ["svg"]), w(u, { 48632 getTarget: ()=>l.$refs.closePath, 48633 label: l.$t("tools.pen.closePath") 48634 }, null, 8, ["getTarget", "label"])]), 48635 _: 1 48636 }, 8, ["modelValue"])]) 48637} 48638const IN = ie(ON, [["render", AN]]); 48639function Ec(l, e=2, t=0, n) { 48640 let s = e ** 2; 48641 n ??= l.length - 1; 48642 let o = [l[0]]; 48643 return Dc(l, t, n, s, o), 48644 o.push(l[n]), 48645 o 48646} 48647function Dc(l, e, t, n, s) { 48648 let o = l[e] 48649 , i = l[t] 48650 , r = n 48651 , a = null; 48652 for (let d = e + 1; d < t; d++) { 48653 let u = l[d] 48654 , h = Bh(o.x, o.y, i.x, i.y, u.x, u.y, !1, !0); 48655 h > r && (a = d, 48656 r = h) 48657 } 48658 a != null && (a > e + 1 && Dc(l, e, a, n, s), 48659 s.push(l[a]), 48660 a < t - 1 && Dc(l, a, t, n, s)) 48661} 48662function LN(l, e) { 48663 if (!Array.isArray(l)) 48664 throw new TypeError("Parameter points not an array"); 48665 for (let o = l.length - 1; o >= 1; o--) 48666 l[o].equals(l[o - 1]) && l.splice(o, 1); 48667 if (l.length < 2) 48668 return []; 48669 let t = l.at(1).subtract(l.at(0)) 48670 , n = l.at(-2).subtract(l.at(-1)) 48671 , s = []; 48672 return Oc(l, s, e, 0, l.length - 1, t, n), 48673 s 48674} 48675function Oc(l, e, t, n, s, o, i) { 48676 if (s === n + 1) { 48677 let r = l[n] 48678 , a = l[s] 48679 , d = r.dist(a) / 3 48680 , u = o.clone().setLength(d).add(r, !0) 48681 , h = i.clone().setLength(d).add(a, !0); 48682 e.push([r.x, r.y, u.x, u.y, h.x, h.y, a.x, a.y]) 48683 } else { 48684 let r = VN(l, n, s), a = Ee(t, t * t), d; 48685 for (let h = 0; h <= 4; h++) { 48686 let c = NN(l, n, s, r, o, i) 48687 , f = FN(l, n, s, c, r); 48688 if (f.error < t) { 48689 e.push(c); 48690 return 48691 } else if (d = f.index, 48692 f.error >= a || !RN(n, s, l, r, c)) 48693 break 48694 } 48695 let u = l[d - 1].subtract(l[d + 1]); 48696 Oc(l, e, t, n, d, o, u), 48697 Oc(l, e, t, d, s, u.negate(), i) 48698 } 48699} 48700function VN(l, e, t) { 48701 let n = Array(t - e) 48702 , s = 0; 48703 n[0] = s; 48704 for (let o = e + 1; o <= t; o++) 48705 s += l[o].dist(l[o - 1]), 48706 n[o - e] = s; 48707 for (let o = 1; o < n.length; o++) 48708 n[o] /= s; 48709 return n 48710} 48711function NN(l, e, t, n, s, o) { 48712 let i = Number.EPSILON 48713 , r = l[e] 48714 , a = l[t] 48715 , d = [[0, 0], [0, 0]] 48716 , u = [0, 0]; 48717 for (let S = 0, x = t - e + 1; S < x; S++) { 48718 let P = n[S] 48719 , C = 1 - P 48720 , T = 3 * P * C 48721 , k = C * C * C 48722 , D = T * C 48723 , I = T * P 48724 , F = P * P * P 48725 , Y = s.clone().setLength(D) 48726 , q = o.clone().setLength(I) 48727 , re = l[e + S].subtract(r.multiplyScalar(k + D)).subtract(a.multiplyScalar(I + F)); 48728 d[0][0] += Y.dot(Y), 48729 d[0][1] += Y.dot(q), 48730 d[1][0] = d[0][1], 48731 d[1][1] += q.dot(q), 48732 u[0] += Y.dot(re), 48733 u[1] += q.dot(re) 48734 } 48735 let h = d[0][0] * d[1][1] - d[1][0] * d[0][1], c, f; 48736 if (ee(h) < i) { 48737 let S = d[0][0] + d[0][1] 48738 , x = d[1][0] + d[1][1]; 48739 c = ee(S) > i ? u[0] / S : ee(x) > i ? u[1] / x : 0, 48740 f = c 48741 } else { 48742 let S = d[0][0] * u[1] - d[1][0] * u[0]; 48743 c = (u[0] * d[1][1] - u[1] * d[0][1]) / h, 48744 f = S / h 48745 } 48746 let p = r.dist(a), g = i * p, y, m; 48747 if (c < g || f < g) 48748 c = f = p / 3; 48749 else { 48750 let S = a.subtract(r); 48751 y = s.clone().setLength(c), 48752 m = o.clone().setLength(f), 48753 y.dot(S) - m.dot(S) > p * p && (c = f = p / 3, 48754 y = m = null) 48755 } 48756 let b = (y || s.clone().setLength(c)).add(r, !0) 48757 , M = (m || o.clone().setLength(f)).add(a, !0); 48758 return [r.x, r.y, b.x, b.y, M.x, M.y, a.x, a.y] 48759} 48760function RN(l, e, t, n, s) { 48761 let[o,i,r,a,d,u,h,c] = It(s); 48762 for (let f = l; f < e; f++) { 48763 let p = t[f], g = n[f - l], y = g * g, m = y * g, b = o * m + r * y + d * g + h, M = i * m + a * y + u * g + c, S = 3 * o * y + 2 * r * g + d, x = 3 * i * y + 2 * a * g + u, P = 6 * o * g + 2 * r, C = 6 * i * g + 2 * a, T = b - p.x, k = M - p.y, D, I = S * S + x * x + T * P + k * C; 48764 if (I === 0) 48765 D = g; 48766 else { 48767 let F = T * S + k * x; 48768 D = g - F / I 48769 } 48770 n[f - l] = D 48771 } 48772 return n.find((f,p)=>p > 0 && f <= n[p - 1] || f < 0 || f > 1) == null 48773} 48774function FN(l, e, t, n, s) { 48775 let o = new hs(n) 48776 , i = Em((t - e + 1) / 2) 48777 , r = 0; 48778 for (let a = e + 1; a < t; a++) { 48779 let u = ze(n, o.fromLengthParameter(s[a - e])).distSquared(l[a]); 48780 u >= r && (r = u, 48781 i = a) 48782 } 48783 return { 48784 error: lt(r), 48785 index: i 48786 } 48787} 48788class BN extends yl { 48789 prevTimestamp; 48790 isDrawing = !1; 48791 currentPos; 48792 pathModel; 48793 points; 48794 bounds; 48795 fillPaintBounds; 48796 strokePaintBounds; 48797 toolOptions = { 48798 fillPaintGroup: new ql("fill"), 48799 strokePaintGroup: new ql("stroke",new et(new ce(0,0,0))), 48800 strokeStyle: new Qt, 48801 smoothing: 2, 48802 closePath: !1, 48803 mode: "normal" 48804 }; 48805 toolbarOptionsComponent = IN; 48806 isShiftKey = !1; 48807 constructor() { 48808 super("pencil"), 48809 this.showSelectionFrame = !1 48810 } 48811 handlePointerDownEvent(e, t, n) { 48812 if (this.setCursor(!0, "pencil"), 48813 this.points == null) { 48814 this.currentPos = new B(t,n), 48815 this.points = [this.currentPos.clone()], 48816 this.prevTimestamp = e.timeStamp || performance.now(); 48817 let s = new bt([new ft]) 48818 , o = this.toolOptions 48819 , i = o.fillPaintGroup 48820 , r = i.getPaint(); 48821 s.setFillPaint(r && r.clone()); 48822 let a = o.strokePaintGroup 48823 , d = a.getPaint(); 48824 s.setStrokePaint(d && d.clone()), 48825 d != null && s.setStrokeStyle(o.strokeStyle), 48826 s.transformUpdated(), 48827 this.pathModel = s, 48828 this.bounds = new Ve(t,n,1,1), 48829 this.fillPaintBounds = i.getPaintBounds(), 48830 this.strokePaintBounds = a.getPaintBounds(), 48831 j().showModelOverlay(s) 48832 } 48833 } 48834 startPointerDrag(e, t, n, s, o) { 48835 this.isDrawing = !0 48836 } 48837 handlePointerMoveEvent(e, t, n, s, o) { 48838 const i = e.ctrlKey; 48839 let r = this.points; 48840 if (r != null) { 48841 let a = this.pathModel 48842 , d = a.getSinglePathModels()[0]; 48843 d.isClosed() && (d.setClosed(!1), 48844 d.getNodeCount() > 1 && d.removeNodePoints(-1, 1)); 48845 let u = this.currentPos || new B(t,n) 48846 , h = this.bounds; 48847 for (let c = 0; c < o.length; c += 2) { 48848 t = o[c], 48849 n = o[c + 1]; 48850 let f = [u.x, u.y, u.x, u.y, t, n, t, n]; 48851 d.appendCurveValues(f); 48852 let p = new B(t,n); 48853 r.push(p), 48854 this.currentPos.set(t, n), 48855 this.bounds.addPoint(t, n) 48856 } 48857 this.isDrawing && (a.getParentModel() == null && z().insertModels([a]), 48858 this.setPathClosed(i), 48859 this.updatePathData(), 48860 a.getFillPaint() && this.fillPaintBounds && (a.getFillPaint().mapPaintBounds(this.fillPaintBounds, h), 48861 this.fillPaintBounds.set(h)), 48862 a.getStrokePaint() && this.strokePaintBounds && (a.getFillPaint().mapPaintBounds(this.strokePaintBounds, h), 48863 this.strokePaintBounds.set(h)), 48864 j().updateModelOverlay(a)) 48865 } 48866 } 48867 setPathClosed(e) { 48868 if (this.pathModel != null) { 48869 let t = this.pathModel.getSinglePathModels()[0]; 48870 t.isClosed() !== e && t.setClosed(e) 48871 } 48872 } 48873 updatePathData() { 48874 this.pathModel != null && this.pathModel.pathDataUpdated() 48875 } 48876 async handlePointerUpEvent(e, t, n) { 48877 this.isPointerDown = !1, 48878 this.endDrawing(e) 48879 } 48880 cancelPointerDrag() { 48881 this.endDrawing(null) 48882 } 48883 endDrawing(e) { 48884 if (this.isDrawing) { 48885 let n = this.getZoom() / 100 48886 , o = this.toolOptions.smoothing / n 48887 , i = z() 48888 , r = this.points 48889 , a = Ec(r, o); 48890 a.length === 2 && r.length > 2 && a.splice(1, 0, r[Math.floor(r.length / 2)]), 48891 r = a; 48892 let d = [0]; 48893 for (let c = 1; c < r.length - 1; c++) { 48894 let f = r[c - 1] 48895 , p = r[c] 48896 , g = r[c + 1] 48897 , y = p.x - f.x 48898 , m = p.y - f.y 48899 , b = g.x - p.x 48900 , M = g.y - p.y; 48901 (y * b + m * M) / Math.sqrt((y * y + m * m) * (b * b + M * M)) < .17365 && d.push(c) 48902 } 48903 d.push(r.length - 1); 48904 let u = []; 48905 for (let c = 1; c < d.length; c++) 48906 u.push(...LN(r.slice(d[c - 1], d[c] + 1), o)); 48907 let h = u.map(c=>new Mt(c)); 48908 if (h.length > 0) { 48909 let c = this.pathModel 48910 , f = c.getSinglePathModels().pop() 48911 , p = this.toolOptions.closePath || (e == null ? f.isClosed() : e.ctrlKey); 48912 c.addSinglePathModels([new Pi(c,new ft(h,p))]), 48913 this.updatePathData(); 48914 { 48915 let g = V(); 48916 i.setModelsSelected([c], g.selectedModels) 48917 } 48918 } 48919 } 48920 j().removeModelOverlay(this.pathModel), 48921 this.pathModel = null, 48922 this.points = null, 48923 this.currentPos = null, 48924 this.transform = null, 48925 this.isDrawing = !1, 48926 this.bounds = null, 48927 this.fillPaintBounds = null, 48928 this.strokePaintBounds = null, 48929 this.setCursor(!1, "pencil") 48930 } 48931 addToSelectedPaths(e) { 48932 let t = V() 48933 , n = z() 48934 , s = t.selectedModels.slice() 48935 , o = Ke(s.slice().reverse()).reverse(); 48936 if (o.length >= 1) { 48937 let i = o[0] 48938 , r = i.getAggregateTransform() 48939 , a = e.getPaths(r.invert(!0), -1, !0) 48940 , d = i.getPaths(null, -1, !0) 48941 , u = i.getFillRule() 48942 , h = jl(d, a, u); 48943 if (h.length === 0) 48944 n.removeModel(i), 48945 n.setModelsSelected([], [i]), 48946 i = null; 48947 else { 48948 let c; 48949 if (i instanceof Jl) { 48950 let f = h.map(p=>new Pi(i,p)); 48951 n.setSinglePathModels(i, f) 48952 } else { 48953 let f = i.getSelfTransform(); 48954 c = i.toPathModel(), 48955 c.setSelfTransform(f), 48956 n.replaceModel(i, [c]), 48957 n.isModelSelected(i) && n.setModelsSelected([c], [i]), 48958 i = c, 48959 i.setPaths(h), 48960 i.applySelfTransform() 48961 } 48962 } 48963 } 48964 } 48965 handleKeyDownEvent(e) { 48966 e.repeat || (e.key === Fs ? this.isDrawing && (this.setPathClosed(!0), 48967 this.updatePathData()) : e.key === Vn && (this.isShiftKey = !0, 48968 this.updateDrawMode())) 48969 } 48970 handleKeyUpEvent(e) { 48971 e.key === Fs ? (this.setPathClosed(!1), 48972 this.updatePathData()) : e.key === Vn && (this.isShiftKey = !1, 48973 this.updateDrawMode()) 48974 } 48975 updateDrawMode() { 48976 let e = this.toolOptions.eraserMode 48977 , t = !e && this.isShiftKey 48978 , s = V().selectedModels; 48979 for (let o of s) { 48980 let i = j(); 48981 i.setAddModeOverlay(o, t), 48982 i.setRemoveModeOverlay(o, e) 48983 } 48984 } 48985 onModelSelectionChanged(e, t) {} 48986 setActive(e) { 48987 if (e) { 48988 this.setCursor(!1, "pencil"); 48989 let t = this.toolOptions; 48990 t.fillPaintGroup.isNoPaint && t.strokePaintGroup.isNoPaint && t.strokePaintGroup.setNoPaint(!1) 48991 } else 48992 this.endDrawing() 48993 } 48994} 48995new BN; 48996class mh extends B { 48997 pressure; 48998 velocity; 48999 constructor(e, t, n, s) { 49000 super(e, t), 49001 this.pressure = n || .5, 49002 this.velocity = s 49003 } 49004 mergeWith(e) { 49005 return this.pressure != null && (this.pressure = (this.pressure + e.pressure) / 2), 49006 this.velocity != null && (this.velocity = (this.velocity + e.velocity) / 2), 49007 this 49008 } 49009} 49010const zN = { 49011 name: "BrushShapeDropdown", 49012 components: { 49013 HySlider: ta, 49014 DimInput: ms, 49015 HyTooltip: pt, 49016 HyDropdown: xl 49017 }, 49018 props: { 49019 aspectRatio: Number, 49020 rotation: Number 49021 }, 49022 computed: { 49023 brushTransform() { 49024 let l = this.aspectRatio 49025 , e = this.rotation * Math.PI / 180; 49026 return new oe().preScale(l, 1).preRotate(e) 49027 } 49028 }, 49029 emits: ["update:aspectRatio", "update:rotation"], 49030 methods: { 49031 emitAspectRatio(l) { 49032 this.$emit("update:aspectRatio", l) 49033 }, 49034 emitRotation(l) { 49035 this.$emit("update:rotation", l) 49036 } 49037 } 49038} 49039 , UN = { 49040 width: "24", 49041 height: "24",
49042 viewBox: "-16 -16 32 32" 49043} 49044 , GN = ["rx", "transform"] 49045 , HN = { 49046 ref: "container", 49047 class: "container" 49048} 49049 , $N = { 49050 class: "property" 49051} 49052 , XN = { 49053 class: "property-input" 49054} 49055 , YN = { 49056 class: "property" 49057} 49058 , KN = { 49059 class: "property-input" 49060}; 49061function WN(l, e, t, n, s, o) { 49062 const i = E("hy-tooltip") 49063 , r = E("hy-slider") 49064 , a = E("dim-input") 49065 , d = E("hy-dropdown"); 49066 return N(), 49067 pe(d, { 49068 ref: "openButton", 49069 class: "open-button", 49070 "popover-style": "max-width: 100vw;", 49071 style: { 49072 "padding-left": "4px" 49073 } 49074 }, { 49075 button: O(()=>[(N(), 49076 $("svg", UN, [_("ellipse", { 49077 rx: t.aspectRatio * 15.5, 49078 ry: 15.5, 49079 transform: "rotate(" + t.rotation + ")", 49080 fill: "currentColor", 49081 stroke: "currentColor", 49082 "stroke-width": "1" 49083 }, null, 8, GN)])), w(i, { 49084 getTarget: ()=>l.$refs.openButton, 49085 label: l.$t("tools.paintbrush.brushShape") 49086 }, null, 8, ["getTarget", "label"])]), 49087 default: O(()=>[_("div", HN, [_("div", $N, [_("div", null, se(l.$t("tools.paintbrush.aspectRatio")), 1), _("div", XN, [w(r, { 49088 modelValue: t.aspectRatio, 49089 "onUpdate:modelValue": o.emitAspectRatio, 49090 min: .01, 49091 max: 1, 49092 step: .1 49093 }, null, 8, ["modelValue", "onUpdate:modelValue"]), w(a, { 49094 modelValue: t.aspectRatio, 49095 "onUpdate:modelValue": o.emitAspectRatio, 49096 decimals: 2, 49097 min: .01, 49098 max: 1, 49099 step: .1 49100 }, null, 8, ["modelValue", "onUpdate:modelValue"])])]), _("div", YN, [_("div", null, se(l.$t("tools.paintbrush.rotation")), 1), _("div", KN, [w(r, { 49101 modelValue: t.rotation, 49102 "onUpdate:modelValue": o.emitRotation, 49103 min: 0, 49104 max: 180, 49105 step: 1 49106 }, null, 8, ["modelValue", "onUpdate:modelValue"]), w(a, { 49107 modelValue: t.rotation, 49108 "onUpdate:modelValue": o.emitRotation, 49109 unit: "°", 49110 min: 0, 49111 max: 180 49112 }, null, 8, ["modelValue", "onUpdate:modelValue"])])])], 512)]), 49113 _: 1 49114 }, 512) 49115} 49116const qN = ie(zN, [["render", WN], ["__scopeId", "data-v-643c7b47"]]) 49117 , jN = { 49118 name: "FreehandOptionsComponent", 49119 components: { 49120 PaintButton: mu, 49121 StrokeStyleEditor: gu, 49122 BrushShapeDropdown: qN, 49123 DimInput: ms, 49124 HyLabel: Bn, 49125 HyGroup: Dt, 49126 HySelect: Dl, 49127 HyTooltip: pt, 49128 SvgIcon: gt 49129 }, 49130 data() { 49131 return { 49132 tool: null, 49133 toolOptions: null, 49134 svgs: Oe({ 49135 brushWidthSvg: OC, 49136 modeNormalSvg: AC, 49137 modeAddSvg: IC, 49138 modeEraseSvg: LC 49139 }), 49140 widthControlTypeItems: [{ 49141 value: "constant", 49142 label: "Constant" 49143 }, { 49144 value: "pressure", 49145 label: "Pressure" 49146 }, { 49147 value: "velocity", 49148 label: "Velocity" 49149 }, { 49150 value: "curvature", 49151 label: "Curvature" 49152 }] 49153 } 49154 }, 49155 computed: { 49156 mode: { 49157 get() { 49158 return this.toolOptions.mode 49159 }, 49160 set(l) { 49161 this.tool.setMode(l) 49162 } 49163 } 49164 }, 49165 methods: { 49166 onPaintUpdate(l, e) { 49167 (e === "stroke" ? this.toolOptions.strokePaintGroup : this.toolOptions.fillPaintGroup).setPaint(l) 49168 }, 49169 onStrokeStyleUpdate(l) { 49170 this.toolOptions.strokeStyle.set(l) 49171 } 49172 } 49173}; 49174function JN(l, e, t, n, s, o) { 49175 const i = E("paint-button") 49176 , r = E("stroke-style-editor") 49177 , a = E("hy-group") 49178 , d = E("brush-shape-dropdown") 49179 , u = E("svg-icon") 49180 , h = E("dim-input") 49181 , c = E("hy-label") 49182 , f = E("hy-tooltip") 49183 , p = E("hy-radio") 49184 , g = E("hy-select"); 49185 return N(), 49186 $("div", null, [w(i, { 49187 "paint-target": "fill", 49188 "paint-group": s.toolOptions.fillPaintGroup, 49189 "onUpdate:paint": e[0] || (e[0] = y=>
49189o.onPaintUpdate(y, "fill")) 49190 }, null, 8, ["paint-group"]), w(a, null, { 49191 default: O(()=>[w(i, { 49192 "paint-target": "stroke", 49193 "paint-group": s.toolOptions.strokePaintGroup, 49194 "onUpdate:paint": e[1] || (e[1] = y=>o.onPaintUpdate(y, "stroke")) 49195 }, null, 8, ["paint-group"]), w(r, { 49196 "stroke-style": s.toolOptions.strokeStyle, 49197 compact: "", 49198 "onUpdate:strokeStyle": o.onStrokeStyleUpdate, 49199 disabled: s.toolOptions.strokePaintGroup.isNoPaint 49200 }, null, 8, ["stroke-style", "onUpdate:strokeStyle", "disabled"])]), 49201 _: 1 49202 }), w(d, { 49203 class: "hy-toolbar-element", 49204 aspectRatio: s.toolOptions.aspectRatio, 49205 "onUpdate:aspectRatio": e[2] || (e[2] = y=>s.toolOptions.aspectRatio = y), 49206 rotation: s.toolOptions.rotation, 49207 "onUpdate:rotation": e[3] || (e[3] = y=>s.toolOptions.rotation = y) 49208 }, null, 8, ["aspectRatio", "rotation"]), w(c, { 49209 ref: "brushWidth" 49210 }, { 49211 default: O(()=>[w(u, { 49212 svg: s.svgs.brushWidthSvg 49213 }, null, 8, ["svg"]), w(h, { 49214 size: "3", 49215 modelValue: s.toolOptions.widthControl.width, 49216 "onUpdate:modelValue": e[4] || (e[4] = y=>s.toolOptions.widthControl.width = y), 49217 unit: "px" 49218 }, null, 8, ["modelValue"])]), 49219 _: 1 49220 }, 512), w(f, { 49221 getTarget: ()=>l.$refs.brushWidth, 49222 label: l.$t("tools.paintbrush.brushWidth") 49223 }, null, 8, ["getTarget", "label"]), w(c, { 49224 label: l.$t("tools.paintbrush.mode") + ":" 49225 }, { 49226 default: O(()=>[w(a, null, { 49227 default: O(()=>[w(p, { 49228 type: "button", 49229 ref: "btnAdd", 49230 modelValue: o.mode, 49231 "onUpdate:modelValue": e[5] || (e[5] = y=>o.mode = y), 49232 value: "add", 49233 uncheckedValue: "normal", 49234 name: "brushMode", 49235 class: "hy-toolbar-element" 49236 }, { 49237 default: O(()=>[w(f, { 49238 getTarget: ()=>l.$refs.btnAdd, 49239 label: l.$t("tools.paintbrush.add") 49240 }, null, 8, ["getTarget", "label"]), w(u, { 49241 svg: s.svgs.modeAddSvg 49242 }, null, 8, ["svg"])]), 49243 _: 1 49244 }, 8, ["modelValue"]), w(p, { 49245 type: "button", 49246 ref: "btnRemove", 49247 modelValue: o.mode, 49248 "onUpdate:modelValue": e[6] || (e[6] = y=>o.mode = y), 49249 value: "remove", 49250 uncheckedValue: "normal", 49251 name: "brushMode", 49252 class: "hy-toolbar-element" 49253 }, { 49254 default: O(()=>[w(f, { 49255 getTarget: ()=>l.$refs.btnRemove, 49256 label: l.$t("tools.paintbrush.erase") 49257 }, null, 8, ["getTarget", "label"]), w(u, { 49258 svg: s.svgs.modeEraseSvg 49259 }, null, 8, ["svg"])]), 49260 _: 1 49261 }, 8, ["modelValue"])]), 49262 _: 1 49263 })]), 49264 _: 1 49265 }, 8, ["label"]), l.$isDevelopment ? (N(), 49266 pe(g, { 49267 key: 0, 49268 modelValue: s.toolOptions.widthControl.type, 49269 "onUpdate:modelValue": e[7] || (e[7] = y=>s.toolOptions.widthControl.type = y), 49270 items: s.widthControlTypeItems, 49271 valueField: "value", 49272 labelField: "label" 49273 }, null, 8, ["modelValue", "items"])) : be("", !0)]) 49274} 49275const ZN = ie(jN, [["render", JN]]); 49276function $v(l, e, t) { 49277 if (l == null || e == null) 49278 return null; 49279 let n = hf([l, e]) 49280 , s = null 49281 , o = t == null ? Number.MAX_VALUE : t ** 2 49282 , i = Number.MAX_VALUE 49283 , r = new B(l[6],l[7]) 49284 , a = gl(l); 49285 gl(e, a); 49286 for (let d of n) 49287 if (!oP(d)) { 49288 let u = gl(d) 49289 , h = Ee(ee(u[0] - a[0]), ee(u[1] - a[1]), ee(u[2] - a[2]), ee(u[3] - a[3])) ** 2; 49290 if (h < i && h <= o) { 49291 let c = jr(d, r); 49292 if (h = Ee(h, ze(d, c).distSquared(r)), 49293 h < i && h <= o) { 49294 let f = dn(d, c); 49295 h = Ee(h, Rg(f[0], l, i)), 49296 h < i && h <= o && (h = Ee(h, Rg(f[1], e, i)), 49297 h < i && h <= o && (s = d, 49298 i = h)) 49299 } 49300 } 49301 } 49302 return s 49303} 49304function Rg(l, e, t=Number.MAX_VALUE) { 49305 let n = 0 49306 , s = new hs(l) 49307 , o = new hs(e) 49308 , i = 4; 49309 for (let r = 1; r <= i; r++) { 49310 let a = r / (i + 1) 49311 , d = s.fromLengthParameter(a) 49312 , u = o.fromLengthParameter(a) 49313 , h = ze(l, d) 49314 , c = ze(e, u) 49315 , f = h.distSquared(c); 49316 if (f > n && (n = f, 49317 f > t)) 49318 break 49319 } 49320 return n 49321} 49322class QN extends yl { 49323 prevTimestamp; 49324 isDrawing = !1; 49325 isPointerDown = !1; 49326 currentPoint; 49327 pathModel; 49328 points; 49329 toolOptions = Et({ 49330 widthControl: { 49331 type: "constant", 49332 width: 24 49333 }, 49334 rotation: 0, 49335 aspectRatio: 1, 49336 smoothing: 1, 49337 mode: "normal", 49338 fillPaintGroup: new ql("fill",new et(new ce(0,0,0))), 49339 strokePaintGroup: new ql("stroke"), 49340 strokeStyle: new Qt 49341 }); 49342 isShiftKey = !1; 49343 toolbarOptionsComponent = ZN; 49344 constructor() { 49345 super("paintbrush"), 49346 this.showSelectionFrame = !1 49347 } 49348 getBrushTransform() { 49349 let e = this.toolOptions.rotation * Math.PI / 180 49350 , t = this.toolOptions.aspectRatio; 49351 return new oe().preScale(t, 1).preRotate(e) 49352 } 49353 handlePointerDownEvent(e, t, n) { 49354 this.isPointerDown || (this.currentPoint = new mh(t,n,e.pressure), 49355 this.currentPoint.pressure = e.pressure, 49356 this.points = [this.currentPoint], 49357 this.prevTimestamp = e.timeStamp || performance.now(), 49358 this.setCursor(!0, "brush"), 49359 this.isPointerDown = !0) 49360 } 49361 startPointerDrag(e, t, n, s, o) { 49362 this.isDrawing = !0; 49363 let i = this.toolOptions.widthControl.width 49364 , r = this.toolOptions.mode 49365 , a = r === "remove" ? "#BC0000" : null 49366 , d = r === "remove" ? "#FF7D6F" : null; 49367 j().showFreehandPath(i, a, d, this.getBrushTransform()) 49368 } 49369 handlePointerMoveEvent(e, t, n, s, o) { 49370 let i = new B(t,n); 49371 if (this.isPointerDown) { 49372 let r = e.timeStamp || performance.now() 49373 , d = [this.currentPoint]; 49374 for (let h = 0; h < o.length; h += 2) { 49375 t = o[h], 49376 n = o[h + 1]; 49377 let c = this.currentPoint 49378 , f = i.dist(c) / (r - this.prevTimestamp) 49379 , p = new mh(t,n,e.pressure,f); 49380 d.push(p) 49381 } 49382 if (d = Ec(d, 2), 49383 this.points.push(...d.slice(1)), 49384 this.isDrawing) { 49385 let h = this.getBrushTransform().invert() 49386 , c = ""; 49387 for (let f of this.points) { 49388 let p = h.transformXY(new B(f.x,f.y)); 49389 c += " " + p.x.toFixed(4) + " " + p.y.toFixed(4) 49390 } 49391 j().updateFreehandPath(c) 49392 } 49393 this.currentPoint = i, 49394 this.prevTimestamp = r 49395 } 49396 } 49397 handlePointerClickEvent(e, t, n, s) { 49398 if (!this.isDrawing) { 49399 let o = this.getModelForElement(e.target2) 49400 , i = V() 49401 , r = z(); 49402 if (o != null) { 49403 for (; o.getParentModel().getType() === "group"; ) { 49404 let d = o.getParentModel() 49405 , u = d.getParentModel(); 49406 if (e.ctrlKey && r.isModelSelected(d) && (u.getType() !== "group" || !r.isModelSelected(u))) 49407 break; 49408 if (!e.ctrlKey && r.isModelSelected(o) && !r.isModelSelected(d)) 49409 break; 49410 o = d 49411 } 49412 let a = e.shiftKey; 49413 r.isModelSelected(o) ? a ? r.setModelsSelected(null, [o]) : (super.updateDragInfo(t, n, !0), 49414 super.updateCursor(Fl)) : (a ? r.setModelsSelected([o], null) : r.setModelsSelected([o], i.selectedModels), 49415 super.updateDragInfo(t, n, !0), 49416 super.updateCursor(Fl)) 49417 } else 49418 r.setModelsSelected(null, i.selectedModels) 49419 } 49420 } 49421 async handlePointerUpEvent(e, t, n) { 49422 await this.endDrawing(), 49423 this.isPointerDown = !1 49424 } 49425 cancelPointerDrag() { 49426 this.endDrawing(), 49427 this.isPointerDown = !1 49428 } 49429 async endDrawing() { 49430 let e = V() 49431 , t = z() 49432 , n = j(); 49433 if (this.isDrawing && this.points && this.points.length > 1) { 49434 let s = this.createOffsetPath(this.points) 49435 , o = this.toolOptions.mode; 49436 if (o === "remove") { 49437 let i = e.selectedModels.slice(); 49438 i.length === 0 && i.push(this.getDocumentModel()); 49439 let r = ae(); 49440 r.startCompoundEdit(); 49441 for (let a of i) 49442 await this.pathModelBooleanOp(s, a, "subtract"); 49443 r.endCompoundEdit(); 49444 for (let a of e.selectedModels) 49445 n.updateModelOverlay(a) 49446 } else { 49447 let i = s.getBounds() 49448 , r = this.toolOptions.fillPaintGroup; 49449 r.setPaintBounds(null, i, !0); 49450 let a = r.getPaint(); 49451 s.setFillPaint(a && a.clone()); 49452 let d = this.toolOptions.strokePaintGroup; 49453 d.setPaintBounds(null, i, !0); 49454 let u = d.getPaint(); 49455 s.setStrokePaint(u && u.clone()), 49456 u != null && s.setStrokeStyle(this.toolOptions.strokeStyle); 49457 let h = e.selectedModels; 49458 if (o === "add" && h.length > 0) { 49459 let c = h[0]; 49460 c = await this.pathModelBooleanOp(s, c, "unite"), 49461 t.setModelsSelected([c], h), 49462 n.updateModelOverlay(c) 49463 } else 49464 s.setNodeTypes(), 49465 t.insertModels([s]), 49466 t.setModelsSelected([s], h) 49467 } 49468 } 49469 n.hideFreehandPath(), 49470 this.points = null, 49471 this.currentPoint = null, 49472 this.isDrawing = !1, 49473 this.setCursor(!1, "brush") 49474 } 49475 async pathModelBooleanOp(e, t, n) { 49476 let s = z(); 49477 if (t instanceof Fn) { 49478 let o = t.getAggregateTransform() 49479 , i = e.getPaths(o.invert(!0), -1, !0) 49480 , r = t.getPaths(null, -1, !0) 49481 , a = t.getFillRule() 49482 , d = n === "subtract" ? lu(r, i, a) : jl(r, i, a); 49483 if (d.length === 0) 49484 s.removeModel(t), 49485 s.setModelsSelected([], [t]), 49486 t = null; 49487 else { 49488 let u; 49489 if (t instanceof Jl) { 49490 let h = d.map(c=>new Pi(t,c)); 49491 s.setSinglePathModels(t, h) 49492 } else { 49493 let h = t.getSelfTransform(); 49494 u = await t.toPathModel(), 49495 u.setSelfTransform(h), 49496 s.replaceModel(t, [u]), 49497 s.isModelSelected(t) && s.setModelsSelected([u], [t]), 49498 t = u, 49499 t.setPaths(d), 49500 t.applySelfTransform() 49501 } 49502 } 49503 } else if (t.getChildModelCount() > 0) { 49504 for (let o = t.getChildModelCount() - 1; o >= 0; o--) { 49505 let i = t.getChildModel(o); 49506 await this.pathModelBooleanOp(e, i, n) 49507 } 49508 t.getChildModelCount() === 0 && t.getParentModel() != null && (s.removeModel(t), 49509 s.setModelsSelected([], [t])) 49510 } 49511 return t 49512 } 49513 createOffsetPath(e) { 49514 let t = this.toolOptions.widthControl.width 49515 , s = 4 / (this.getZoom() / 100) 49516 , o = Ec(e, s); 49517 o.length === 2 && e.length > 2 && o.splice(1, 0, e[Math.floor(e.length / 2)]), 49518 e = o; 49519 let i = [0]; 49520 for (let m = 1; m < e.length - 1; m++) { 49521 let b = e[m - 1] 49522 , M = e[m] 49523 , S = e[m + 1] 49524 , x = M.x - b.x 49525 , P = M.y - b.y 49526 , C = S.x - M.x 49527 , T = S.y - M.y; 49528 (x * C + P * T) / Math.sqrt((x * x + P * P) * (C * C + T * T)) < .17365 && i.push(m) 49529 } 49530 i.push(e.length - 1); 49531 let r = []; 49532 for (let m = 1; m < i.length; m++) 49533 r.push(...jw(e.slice(i[m - 1], i[m] + 1))); 49534 let a = this.getBrushTransform() 49535 , d = a.invert(!0); 49536 r.forEach(m=>d.transformArray(m)); 49537 for (let m = r.length - 2; r.length > 2 && m >= 0; m--) { 49538 let b = r[m] 49539 , M = r[m + 1] 49540 , S = $v(b, M, s); 49541 S != null && (r.splice(m, 2, S), 49542 e.splice(m, 2, e[m].mergeWith(e[m + 1]))) 49543 } 49544 let u = new ft(r.map(m=>new Mt(m)),!1) 49545 , h = Date.now() 49546 , c = this.toolOptions.widthControl.type; 49547 if (c === "auto") { 49548 c = "velocity"; 49549 for (let m = Math.max(2, e.length - 1); m >= 0; m--) 49550 if (e[m].pressure !== .5) { 49551 c = "pressure"; 49552 break 49553 } 49554 } 49555 let f = t / 2 49556 , p = []; 49557 for (let m = 0; m < e.length; m++) { 49558 let b = e[m], M; 49559 if (c === "velocity") 49560 M = 1.5 * f / (b.velocity + 1); 49561 else if (c === "pressure") 49562 M = f * b.pressure; 49563 else if (c === "curvature") { 49564 let S = m === e.length - 1 49565 , x = u.getCurve(S ? m - 1 : m) 49566 , P = Math.abs(Nl(x.v, 0)) 49567 , C = .1; 49568 M = f * ((10 - C) / (P + 10) + C) 49569 } else 49570 M = f; 49571 p.push(M) 49572 } 49573 p[0] = p[1]; 49574 let g = new bt; 49575 console.log(u.isClosed()); 49576 let y = Bo([u], 1, p); 49577 return console.log("offset: " + (Date.now() - h) + "ms"),
49578 y.forEach(m=>m.applyTransform(a)), 49579 g.addSinglePathModels(y.map(m=>new Pi(g,m))), 49580 g 49581 } 49582 handleKeyDownEvent(e) { 49583 e.repeat || e.key === Vn && (this.isShiftKey = !0, 49584 this.toolOptions.mode === "normal" && this.setMode("add")) 49585 } 49586 handleKeyUpEvent(e) { 49587 e.key === Vn && (this.isShiftKey = !1, 49588 this.isShiftKey = !0, 49589 this.toolOptions.mode === "add" && this.setMode("normal")) 49590 } 49591 onFocusLost() { 49592 super.onFocusLost(), 49593 this.endDrawing() 49594 } 49595 onModelSelectionChanged(e, t) { 49596 super.onModelSelectionChanged(e, t) 49597 } 49598 setMode(e) { 49599 this.toolOptions.mode = e, 49600 this.updateDrawMode() 49601 } 49602 updateDrawMode() { 49603 let e = this.toolOptions.mode 49604 , n = V().selectedModels; 49605 for (let s of n) { 49606 let o = j(); 49607 e === "normal" ? o.removeModelOverlay(s) : o.showModelOverlay(s), 49608 o.setAddModeOverlay(s, e === "add"), 49609 o.setRemoveModeOverlay(s, e === "remove") 49610 } 49611 } 49612 setActive(e) { 49613 let t = V(); 49614 if (e) { 49615 let n = j() 49616 , s = t.selectedModels[0]; 49617 s != null && n.showModelOverlay(s), 49618 this.updateDrawMode(), 49619 this.setCursor(!1, "brush"); 49620 let o = this.toolOptions; 49621 o.fillPaintGroup.isNoPaint && o.strokePaintGroup.isNoPaint && o.fillPaintGroup.setNoPaint(!1) 49622 } else { 49623 this.endDrawing(); 49624 let n = j() 49625 , s = t.selectedModels[0]; 49626 s != null && n.removeModelOverlay(s) 49627 } 49628 } 49629 pointsToString(e) { 49630 let t = ""; 49631 for (let n of e) 49632 t += n.x + "," + n.y + ",", 49633 t += n.pressure + ",", 49634 t += n.velocity + ","; 49635 return t 49636 } 49637 stringToPoints(e) { 49638 let t = [] 49639 , n = e.split(",").map(s=>parseFloat(s)); 49640 for (let s = 0; s < n.length - 1; ) 49641 t.push(new mh(n[s++],n[s++],n[s++],n[s++] || void 0)); 49642 return t 49643 } 49644} 49645new QN; 49646const eR = { 49647 name: "hy-virtual-list", 49648 components: { 49649 HyScrollview: $o 49650 }, 49651 props: { 49652 items: { 49653 type: Array, 49654 default: ()=>[] 49655 }, 49656 rowHeight: { 49657 type: Number, 49658 default: 32 49659 } 49660 }, 49661 data() { 49662 return { 49663 rootHeight: 0, 49664 paddingItemCount: 20, 49665 startIndex: 0 49666 } 49667 }, 49668 computed: { 49669 containerHeight() { 49670 return this.items.length * this.rowHeight 49671 }, 49672 visibleItems() { 49673 let l = Math.min(this.items.length - this.startIndex, Math.ceil(this.rootHeight / this.rowHeight) + 2 * this.paddingItemCount); 49674 return this.items.slice(this.startIndex, this.startIndex + l) 49675 }, 49676 positionerOffsY() { 49677 return this.startIndex * this.rowHeight 49678 } 49679 }, 49680 methods: { 49681 onScroll() { 49682 this.animationRef == null && (this.animationRef = requestAnimationFrame(()=>{ 49683 let l = this.$refs.root.$el.children[0].scrollTop; 49684 this.startIndex = Math.max(0, Math.floor(l / this.rowHeight) - this.paddingItemCount), 49685 this.animationRef = null 49686 } 49687 )) 49688 }, 49689 scrollToIndex(l) { 49690 if (this.$refs.root == null) 49691 return; 49692 l = Math.min(this.items.length - 1, Math.max(0, l)), 49693 this.startIndex = l; 49694 let e = this.$refs.root.$el.children[0], t = e.scrollTop, n = this.rowHeight, s = Math.ceil(t / n), o = Math.max(0, Math.floor((t + this.rootHeight) / n) - 1), i; 49695 l < s ? i = l * n : l > o && (i = l * n - this.rootHeight), 49696 i != null && e.scrollTo({ 49697 top: i, 49698 behavior: "instant" 49699 }) 49700 }, 49701 scrollToItem(l) { 49702 let e = this.items.indexOf(l); 49703 this.scrollToIndex(e) 49704 }, 49705 scrollToTop() { 49706 this.scrollToIndex(0) 49707 }, 49708 updateRootHeight() { 49709 let l = this.$refs.root; 49710 l != null && (this.rootHeight = l.$el.children[0].offsetHeight) 49711 } 49712 }, 49713 mounted() { 49714 new ResizeObserver(this.updateRootHeight).observe(this.$refs.root.$el), 49715 this.updateRootHeight() 49716 } 49717}; 49718function tR(l, e, t, n, s, o) { 49719 const i = E("hy-scrollview"); 49720 return N(), 49721 pe(i, { 49722 horizontal: !1, 49723 ref: "root", 49724 tabindex: "0", 49725 onScrollPassive: o.onScroll 49726 }, {
49727 default: O(()=>[_("div", { 49728 class: "container", 49729 ref: "container", 49730 style: xe({ 49731 height: o.containerHeight + "px" 49732 }) 49733 }, [_("div", { 49734 class: "positioner", 49735 ref: "positioner", 49736 style: xe({ 49737 transform: "translateY(" + o.positionerOffsY + "px)" 49738 }) 49739 }, [(N(!0), 49740 $(Pe, null, Gt(o.visibleItems, r=>(N(), 49741 $("div", { 49742 key: r 49743 }, [vt(l.$slots, "default", { 49744 item: r 49745 }, void 0, !0)]))), 128))], 4)], 4)]), 49746 _: 3 49747 }, 8, ["onScrollPassive"]) 49748} 49749const lR = ie(eR, [["render", tR], ["__scopeId", "data-v-d9fe9aa5"]]); 49750function nR(l) { 49751 let e = new Map 49752 , t = l.split("") 49753 , n = [] 49754 , s = t[0] 49755 , o = 256; 49756 for (let i = 1; i < t.length; i++) { 49757 let r = t[i]; 49758 e.has(s + r) ? s += r : (n.push(s.length > 1 ? e.get(s) : s.charCodeAt(0)), 49759 e.set(s + r, o), 49760 o++, 49761 s = r) 49762 } 49763 return n.push(s.length > 1 ? e.get(s) : s.charCodeAt(0)), 49764 new Uint16Array(n) 49765} 49766function sR(l) { 49767 let e = new Map 49768 , t = l[0] 49769 , n = String.fromCharCode(t) 49770 , s = n 49771 , o = [n] 49772 , i = 256; 49773 for (let r = 1; r < l.length; r++) { 49774 t = l[r]; 49775 let a; 49776 t < 256 ? a = String.fromCharCode(t) : a = e.has(t) ? e.get(t) : s + n, 49777 o.push(a), 49778 n = a.charAt(0), 49779 e.set(i, s + n), 49780 i++, 49781 s = a 49782 } 49783 return o.join("") 49784} 49785let vo; 49786const oR = { 49787 name: "FontList", 49788 components: { 49789 HyButton: nt, 49790 HyVirtualList: lR, 49791 HyTooltip: pt, 49792 HyInput: Xs 49793 }, 49794 props: { 49795 modelValue: { 49796 type: String, 49797 default: "" 49798 }, 49799 isLoading: Boolean 49800 }, 49801 data() { 49802 return { 49803 fonts: [], 49804 filteredFonts: [], 49805 searchText: "", 49806 recentFontItems: [], 49807 isDevelopment: !1 49808 } 49809 }, 49810 async mounted() { 49811 vo == null && await fetch("fontPaths.json").then(s=>s.json()).then(s=>{ 49812 vo = s.map(o=>({ 49813 family: o[0], 49814 d: nR(o[1]) 49815 })) 49816 } 49817 ); 49818 let l = new Set((await Ly()).map(s=>s.family)); 49819 vo = (vo || []).filter(s=>l.has(s.family)), 49820 this.fonts = ns(vo || []), 49821 this.filteredFonts = ns(vo || []); 49822 let e = this.modelValue 49823 , t = this.fonts.findIndex(s=>s.family === e); 49824 t >= 0 && el(()=>this.$refs.scroller.scrollToIndex(t)); 49825 let n = V().recentFonts; 49826 this.recentFontItems = n.map(s=>vo.find(o=>o.family === s)).filter(s=>s != null) 49827 }, 49828 methods: { 49829 onKeydown(l) {}, 49830 onInputKeydown(l) {}, 49831 onItemClick(l) { 49832 this.$emit("update:modelValue", l) 49833 }, 49834 lzw_decode(l) { 49835 return sR(l) 49836 }, 49837 async importFont() { 49838 if (window.showOpenFilePicker) { 49839 let l; 49840 try { 49841 [l] = await window.showOpenFilePicker({ 49842 multiple: !1, 49843 types: [{ 49844 description: "TrueType Fonts", 49845 accept: { 49846 "application/x-font-ttf": [".ttf"], 49847 "application/x-font-otf": [".otf"] 49848 } 49849 }] 49850 }) 49851 } catch {} 49852 if (l) { 49853 let t = await (await l.getFile()).arrayBuffer() 49854 , n = "LocalFont"; 49855 await ud(n, t), 49856 this.$emit("update:modelValue", n) 49857 } 49858 } else { 49859 let l = document.createElement("input"); 49860 l.type = "file", 49861 l.accept = ".ttf,.otf", 49862 l.onchange = async e=>{ 49863 let n = await e.target.files[0].arrayBuffer() 49864 , s = "LocalFont"; 49865 await ud(s, n), 49866 this.$emit("update:modelValue", s) 49867 } 49868 , 49869 l.click() 49870 } 49871 } 49872 }, 49873 watch: { 49874 searchText(l) { 49875 l = l.trim().toLowerCase(), 49876 this.filteredFonts = this.fonts.filter(e=>e.family.toLowerCase().includes(l)), 49877 this.$refs.scroller.scrollToTop() 49878 } 49879 } 49880} 49881 , iR = { 49882 key: 0, 49883 style: { 49884 display: "flex", 49885 "flex-direction": "column", 49886 "margin-bottom": "16px" 49887 } 49888} 49889 , rR = ["onClick"] 49890 , aR = { 49891 width: "400", 49892 height: "32",
49893 viewBox: "0 -32 600 48" 49894} 49895 , dR = ["d"] 49896 , uR = { 49897 key: 0, 49898 class: "loading-indicator" 49899} 49900 , hR = { 49901 style: { 49902 display: "flex", 49903 "flex-direction": "row", 49904 gap: "8px", 49905 "margin-bottom": "8px", 49906 padding: "8px" 49907 } 49908} 49909 , cR = ["onClick"] 49910 , fR = { 49911 width: "450", 49912 height: "36", 49913 viewBox: "0 -32 600 48" 49914} 49915 , pR = ["d"]; 49916function gR(l, e, t, n, s, o) { 49917 const i = E("hy-input") 49918 , r = E("hy-tooltip") 49919 , a = E("hy-button") 49920 , d = E("hy-virtual-list"); 49921 return N(), 49922 $(Pe, null, [_("div", { 49923 style: { 49924 position: "relative", 49925 width: "300px", 49926 height: "480px", 49927 display: "flex", 49928 "justify-content": "stretch", 49929 "flex-direction": "column" 49930 }, 49931 onKeydown: e[1] || (e[1] = (...u)=>o.onKeydown && o.onKeydown(...u)) 49932 }, [s.recentFontItems.length > 0 ? (N(), 49933 $("div", iR, [e[3] || (e[3] = _("div", null, "Recent Fonts", -1)), (N(!0), 49934 $(Pe, null, Gt(s.recentFontItems, u=>(N(), 49935 $("div", { 49936 key: u 49937 }, [_("div", { 49938 class: Ne(["font-item", { 49939 "font-item-selected": u.family === t.modelValue 49940 }]), 49941 onClick: h=>o.onItemClick(u.family) 49942 }, [(N(), 49943 $("svg", aR, [_("path", { 49944 fill: "currentColor", 49945 d: o.lzw_decode(u.d), 49946 transform: "scale(1)" 49947 }, null, 8, dR)])), _("div", null, se(u.family), 1), t.isLoading && u.family === t.modelValue ? (N(), 49948 $("div", uR, [...e[2] || (e[2] = [_("div", null, null, -1), _("div", null, null, -1), _("div", null, null, -1), _("div", null, null, -1)])])) : be("", !0)], 10, rR)]))), 128))])) : be("", !0), e[6] || (e[6] = _("div", null, "Available Fonts", -1)), _("div", hR, [w(i, { 49949 modelValue: s.searchText, 49950 "onUpdate:modelValue": e[0] || (e[0] = u=>s.searchText = u), 49951 placeholder: l.$t("tools.text.search"), 49952 style: { 49953 "text-align": "start" 49954 }, 49955 onKeydown: o.onInputKeydown 49956 }, { 49957 prefix: O(()=>[...e[4] || (e[4] = [_("svg", { 49958 width: "22", 49959 height: "22",
49960 viewBox: "0 0 22 22" 49961 }, [_("path", { 49962 d: "M2 10.5c0-4.14 3.36-7.5 7.5-7.5 4.14 0 7.5 3.36 7.5 7.5 0 1.46-.42 2.82-1.14 3.98l4.63 4.63c.2 .2 .2 .51 0 .71l-1.53 1.53c-.2 .2-.51 .2-.71 0l-4.6-4.6c-1.19 .79-2.62 1.25-4.15 1.25 -4.14 0-7.5-3.36-7.5-7.5zM9.5 5c-3.04 0-5.5 2.46-5.5 5.5 0 3.04 2.46 5.5 5.5 5.5 3.04 0 5.5-2.46 5.5-5.5 0-3.04-2.46-5.5-5.5-5.5z", 49963 fill: "#666" 49964 })], -1)])]), 49965 _: 1 49966 }, 8, ["modelValue", "placeholder", "onKeydown"]), w(a, { 49967 ref: "btnFilter", 49968 style: { 49969 display: "none", 49970 padding: "8px" 49971 } 49972 }, { 49973 default: O(()=>[w(r, { 49974 getTarget: ()=>l.$refs.btnFilter, 49975 label: l.$t("tools.text.filterFonts") 49976 }, null, 8, ["getTarget", "label"]), e[5] || (e[5] = _("svg", { 49977 width: "22", 49978 height: "22", 49979 viewBox: "0 0 22 22" 49980 }, [_("path", { 49981 d: "M0 2h22v2h-22v-2zM3 7h16v2h-16v-2zM6 12h10v2h-10v-2zM9 17h4v2h-4v-2z", 49982 fill: "666" 49983 })], -1))]), 49984 _: 1 49985 }, 512)]), w(d, { 49986 ref: "scroller", 49987 class: "scroller", 49988 items: s.filteredFonts, 49989 "row-height": 38, 49990 tabIndex: "0", 49991 style: { 49992 width: "100%" 49993 } 49994 }, { 49995 default: O(({item: u})=>[_("div", { 49996 class: Ne(["font-item", { 49997 "font-item-selected": u.family === t.modelValue 49998 }]), 49999 onClick: h=>o.onItemClick(u.family) 50000 }, [(N(), 50001 $("svg", fR, [_("path", { 50002 fill: "currentColor", 50003 d: o.lzw_decode(u.d), 50004 transform: "scale(1)" 50005 }, null, 8, pR)])), _("div", null, se(u.family), 1)], 10, cR)]), 50006 _: 1 50007 }, 8, ["items"])], 32), s.isDevelopment ? (N(), 50008 pe(a, { 50009 key: 0, 50010 style: { 50011 "min-height": "32px" 50012 }, 50013 onClick: o.importFont 50014 }, { 50015 default: O(()=>[...e[7] || (e[7] = [ve("Import Font", -1)])]), 50016 _: 1 50017 }, 8, ["onClick"])) : be("", !0)], 64) 50018} 50019const mR = ie(oR, [["render", gR], ["__scopeId", "data-v-64462e7a"]]); 50020let yh; 50021const yR = { 50022 name: "TextOptionsComponent", 50023 components: { 50024 HyTooltip: pt, 50025 FontList: mR, 50026 HyButton: nt, 50027 HyCheckbox: ml, 50028 HyDropdown: xl, 50029 HyGroup: Dt, 50030 HyInputNumber: Lt, 50031 HyRadio: en, 50032 SvgIcon: gt 50033 }, 50034 props: { 50035 compact: Boolean 50036 }, 50037 data() { 50038 return { 50039 tool: null, 50040 toolOptions: null, 50041 fontList: [], 50042 svgs: me({ 50043 alignLeftSvg: Rx, 50044 alignRightSvg: Fx, 50045 alignCenterSvg: Bx, 50046 boldSvg: mC, 50047 italicSvg: yC, 50048 underlineSvg: vC, 50049 strikethroughSvg: bC, 50050 incrementSvg: ff, 50051 decrementSvg: j2 50052 }) 50053 } 50054 }, 50055 computed: { 50056 fontSize: { 50057 get() { 50058 return this.toolOptions.textStyle.fontSize 50059 }, 50060 set(l) { 50061 this.setTextStyleProperty("fontSize", l) 50062 } 50063 }, 50064 alignment: { 50065 get() { 50066 return this.toolOptions.paragraphStyle.alignment 50067 }, 50068 set(l) { 50069 this.setParagraphStyleProperty("alignment", l) 50070 } 50071 }, 50072 bold: { 50073 get() { 50074 return this.toolOptions.textStyle.bold 50075 }, 50076 set(l) { 50077 this.setTextStyleProperty("bold", l) 50078 } 50079 }, 50080 italic: { 50081 get() { 50082 return this.toolOptions.textStyle.italic 50083 }, 50084 set(l) { 50085 this.setTextStyleProperty("italic", l) 50086 } 50087 }, 50088 underline: { 50089 get() { 50090 return this.toolOptions.textStyle.underline 50091 }, 50092 set(l) { 50093 this.setTextStyleProperty("underline", l) 50094 } 50095 }, 50096 strikethrough: { 50097 get() { 50098 return this.toolOptions.textStyle.strikethrough 50099 }, 50100 set(l) {
50101 this.setTextStyleProperty("strikethrough", l) 50102 } 50103 } 50104 }, 50105 async mounted() { 50106 yh == null && await fetch("fontPaths.json").then(l=>l.json()).then(l=>{ 50107 yh = l.map(e=>({ 50108 family: e[0], 50109 d: e[1] 50110 })) 50111 } 50112 ), 50113 this.fontList = ns(yh || []) 50114 }, 50115 unmounted() { 50116 this.focusTarget = null 50117 }, 50118 methods: { 50119 onPointerdown(l) { 50120 (l.target.tagName !== "INPUT" || l.target.getAttribute("type") !== "text") && l.preventDefault() 50121 }, 50122 onFontSelect(l) { 50123 this.$refs.fontDropdown.close(), 50124 this.setTextStyleProperty("fontFamily", l), 50125 this.setPrevFocus(); 50126 let e = V().recentFonts 50127 , t = e.indexOf(l); 50128 e.splice(t, 1), 50129 e.unshift(l) 50130 }, 50131 async setTextStyleProperty(l, e) { 50132 await this.toolOptions.textStyle.setStyleAttribute(l, e), 50133 await z().setTextSelectionStyleProperty(l, e) 50134 }, 50135 async setParagraphStyleProperty(l, e) { 50136 this.toolOptions.paragraphStyle[l] = e; 50137 let n = V().selectedModels.filter(o=>o instanceof Rn); 50138 z().setTextModelProperty(n, l, n.map(()=>e)) 50139 }, 50140 isEditorElement(l) { 50141 return l?.parentElement?.classList.contains("viewport") || l?.getAttribute("data-textInput") === "true" 50142 }, 50143 onFocus(l) { 50144 let e = V().tool 50145 , t = l.relatedTarget; 50146 this.isEditorElement(t) && e.activeTextModel != null && (t.focus(), 50147 this.focusTarget = null) 50148 }, 50149 setPrevFocus() { 50150 this.focusTarget != null && (this.focusTarget.focus(), 50151 this.focusTarget = null) 50152 }, 50153 storeEditorFocus(l) { 50154 let e = V().tool 50155 , t = l.relatedTarget || document.activeElement; 50156 this.isEditorElement(t) && e.activeTextModel != null ? this.focusTarget = t : this.focusTarget = null 50157 } 50158 }, 50159 directives: { 50160 RepeatButton: kv 50161 } 50162}; 50163function vR(l, e, t, n, s, o) { 50164 const i = E("font-list") 50165 , r = E("hy-dropdown") 50166 , a = E("hy-tooltip") 50167 , d = E("hy-group") 50168 , u = E("svg-icon") 50169 , h = E("hy-button") 50170 , c = E("hy-input-number") 50171 , f = E("hy-checkbox") 50172 , p = E("hy-radio") 50173 , g = Gd("repeat-button"); 50174 return N(), 50175 $("div", { 50176 onPointerdown: e[8] || (e[8] = (...y)=>o.onPointerdown && o.onPointerdown(...y)) 50177 }, [w(d, null, { 50178 default: O(()=>[w(r, { 50179 ref: "fontDropdown", 50180 onPointerdown: o.storeEditorFocus, 50181 label: s.toolOptions.textStyle.fontFamily, 50182 "popup-secondary-pos": "start", 50183 style: xe({ 50184 width: t.compact ? "150px" : "180px" 50185 }), 50186 class: "hy-toolbar-element" 50187 }, { 50188 default: O(()=>[w(i, { 50189 modelValue: this.toolOptions.textStyle.fontFamily, 50190 "onUpdate:modelValue": o.onFontSelect 50191 }, null, 8, ["modelValue", "onUpdate:modelValue"])]), 50192 _: 1 50193 }, 8, ["onPointerdown", "label", "style"]), w(a, { 50194 getTarget: ()=>l.$refs.fontDropdown, 50195 label: l.$t("tools.text.font") 50196 }, null, 8, ["getTarget", "label"])]), 50197 _: 1 50198 }), w(d, null, { 50199 default: O(()=>[wl((N(), 50200 pe(h, { 50201 onFocus: o.storeEditorFocus, 50202 onPointerup: o.setPrevFocus, 50203 disabled: o.fontSize <= 1, 50204 style: { 50205 padding: "2px", 50206 background: "none" 50207 } 50208 }, { 50209 default: O(()=>[w(u, { 50210 svg: s.svgs.decrementSvg 50211 }, null, 8, ["svg"])]), 50212 _: 1 50213 }, 8, ["onFocus", "onPointerup", "disabled"])), [[g, ()=>o.fontSize > 1 ? o.fontSize-- : 1]]), w(c, { 50214 ref: "fontSize", 50215 modelValue: o.fontSize, 50216 "onUpdate:modelValue": e[0] || (e[0] = y=>o.fontSize = y), 50217 "show-buttons": !1, 50218 onFocus: o.storeEditorFocus, 50219 onKeydown: Ia(o.setPrevFocus, ["enter"]), 50220 onBlur: o.setPrevFocus 50221 }, null, 8, ["modelValue", "onFocus", "onKeydown", "onBlur"]), w(a, { 50222 getTarget: ()=>l.$refs.fontSize, 50223 label: l.$t("tools.text.fontSize") 50224 }, null, 8, ["getTarget", "label"]), wl((N(), 50225 pe(h, { 50226 onFocus: o.storeEditorFocus, 50227 onPointerup: o.setPrevFocus, 50228 disabled: o.fontSize >= 256, 50229 style: { 50230 padding: "2px", 50231 background: "none" 50232 } 50233 }, { 50234 default: O(()=>[w(u, { 50235 svg: s.svgs.incrementSvg 50236 }, null, 8, ["svg"])]), 50237 _: 1 50238 }
50238, 8, ["onFocus", "onPointerup", "disabled"])), [[g, ()=>o.fontSize < 256 ? o.fontSize++ : 256]])]), 50239 _: 1 50240 }), w(d, null, { 50241 default: O(()=>[w(f, { 50242 ref: "bold", 50243 type: "button", 50244 onFocus: o.onFocus, 50245 modelValue: o.bold, 50246 "onUpdate:modelValue": e[1] || (e[1] = y=>o.bold = y), 50247 class: "hy-toolbar-element" 50248 }, { 50249 default: O(()=>[w(u, { 50250 svg: s.svgs.boldSvg 50251 }, null, 8, ["svg"]), w(a, { 50252 getTarget: ()=>l.$refs.bold, 50253 label: l.$t("tools.text.bold") 50254 }, null, 8, ["getTarget", "label"])]), 50255 _: 1 50256 }, 8, ["onFocus", "modelValue"]), w(f, { 50257 ref: "italic", 50258 type: "button", 50259 onFocus: o.onFocus, 50260 modelValue: o.italic, 50261 "onUpdate:modelValue": e[2] || (e[2] = y=>o.italic = y), 50262 class: "hy-toolbar-element" 50263 }, { 50264 default: O(()=>[w(u, { 50265 svg: s.svgs.italicSvg 50266 }, null, 8, ["svg"]), w(a, { 50267 getTarget: ()=>l.$refs.italic, 50268 label: l.$t("tools.text.italic") 50269 }, null, 8, ["getTarget", "label"])]), 50270 _: 1 50271 }, 8, ["onFocus", "modelValue"]), w(f, { 50272 ref: "underline", 50273 type: "button", 50274 onFocus: o.onFocus, 50275 modelValue: o.underline, 50276 "onUpdate:modelValue": e[3] || (e[3] = y=>o.underline = y), 50277 class: "hy-toolbar-element" 50278 }, { 50279 default: O(()=>[w(u, { 50280 svg: s.svgs.underlineSvg 50281 }, null, 8, ["svg"]), w(a, { 50282 getTarget: ()=>l.$refs.underline, 50283 label: l.$t("tools.text.underline") 50284 }, null, 8, ["getTarget", "label"])]), 50285 _: 1 50286 }, 8, ["onFocus", "modelValue"]), w(f, { 50287 ref: "strikethrough", 50288 type: "button", 50289 onFocus: o.onFocus, 50290 modelValue: o.strikethrough, 50291 "onUpdate:modelValue": e[4] || (e[4] = y=>o.strikethrough = y), 50292 class: "hy-toolbar-element" 50293 }, { 50294 default: O(()=>[w(u, { 50295 svg: s.svgs.strikethroughSvg 50296 }, null, 8, ["svg"]), w(a, { 50297 getTarget: ()=>l.$refs.strikethrough, 50298 label: l.$t("tools.text.strikethrough") 50299 }, null, 8, ["getTarget", "label"])]), 50300 _: 1 50301 }, 8, ["onFocus", "modelValue"])]), 50302 _: 1 50303 }), w(d, null, { 50304 default: O(()=>[w(p, { 50305 ref: "alignLeft", 50306 type: "button", 50307 onFocus: o.onFocus, 50308 modelValue: o.alignment, 50309 "onUpdate:modelValue": e[5] || (e[5] = y=>o.alignment = y), 50310 value: "left", 50311 name: "textAlignment", 50312 class: "hy-toolbar-element" 50313 }, { 50314 default: O(()=>[w(u, { 50315 svg: s.svgs.alignLeftSvg 50316 }, null, 8, ["svg"]), w(a, { 50317 getTarget: ()=>l.$refs.alignLeft, 50318 label: l.$t("tools.text.alignLeft") 50319 }, null, 8, ["getTarget", "label"])]), 50320 _: 1 50321 }, 8, ["onFocus", "modelValue"]), w(p, { 50322 ref: "alignCenter", 50323 type: "button", 50324 onFocus: o.onFocus, 50325 modelValue: o.alignment, 50326 "onUpdate:modelValue": e[6] || (e[6] = y=>o.alignment = y), 50327 value: "center", 50328 name: "textAlignment", 50329 class: "hy-toolbar-element" 50330 }, { 50331 default: O(()=>[w(u, { 50332 svg: s.svgs.alignCenterSvg 50333 }, null, 8, ["svg"]), w(a, { 50334 getTarget: ()=>l.$refs.alignCenter, 50335 label: l.$t("tools.text.alignCenter") 50336 }, null, 8, ["getTarget", "label"])]), 50337 _: 1 50338 }, 8, ["onFocus", "modelValue"]), w(p, { 50339 ref: "alignRight", 50340 type: "button", 50341 onFocus: o.onFocus, 50342 modelValue: o.alignment, 50343 "onUpdate:modelValue": e[7] || (e[7] = y=>o.alignment = y), 50344 value: "right", 50345 name: "textAlignment", 50346 class: "hy-toolbar-element" 50347 }, { 50348 default: O(()=>[w(u, { 50349 svg: s.svgs.alignRightSvg 50350 }, null, 8, ["svg"]), w(a, { 50351 getTarget: ()=>l.$refs.alignRight, 50352 label: l.$t("tools.text.alignRight") 50353 }, null, 8, ["getTarget", "label"])]), 50354 _: 1 50355 }
50355, 8, ["onFocus", "modelValue"])]), 50356 _: 1 50357 })], 32) 50358} 50359const bR = ie(yR, [["render", vR]]); 50360class MR { 50361 alignment; 50362 constructor() { 50363 this.alignment = "left" 50364 } 50365} 50366class SR { 50367 textArea; 50368 text = ""; 50369 dot = 0; 50370 mark = 0; 50371 textStyle; 50372 inputListener; 50373 constructor(e) { 50374 this.inputListener = e; 50375 let t = Vl("textarea", { 50376 autocomplete: "off", 50377 autocorrect: "off", 50378 autocapitalize: "none", 50379 wrap: "off", 50380 "data-textInput": !0 50381 }, { 50382 position: "absolute", 50383 top: 0, 50384 left: "80px", 50385 background: "red", 50386 "pointer-events": "none", 50387 padding: 0, 50388 maxWidth: "80px", 50389 lineHeight: "0.1px", 50390 outline: "none", 50391 opacity: 0, 50392 caretColor: "transparent" 50393 }); 50394 t.addEventListener("keydown", n=>this.onKeydown(n)), 50395 t.addEventListener("click", ()=>{ 50396 t.focus() 50397 } 50398 ), 50399 t.addEventListener("focus", ()=>{ 50400 t.style.background = "rgb(0 255 0 / 0.5)" 50401 } 50402 ), 50403 t.addEventListener("blur", ()=>{ 50404 t.style.background = "rgb(255 0 0 / 0.5)" 50405 } 50406 ), 50407 t.addEventListener("input", this.handleTextAreaInput), 50408 this.textArea = t 50409 } 50410 handleTextAreaInput = e=>{ 50411 console.log(e.inputType, e.data); 50412 let n = V().textSelection 50413 , s = n.textModel; 50414 if (s == null) 50415 return; 50416 let i = s.getText().length 50417 , r = this.textArea 50418 , a = r.value 50419 , d = z() 50420 , u = n.dot 50421 , h = n.mark 50422 , c = Math.min(u, h) 50423 , f = Math.abs(u - h) 50424 , p = e.inputType 50425 , g = e.data; 50426 if (p === "insertText") 50427 g != null && g !== "" && d.insertTextAtSelection(g, this.textStyle); 50428 else if (p === "insertLineBreak") 50429 d.insertTextAtSelection(` 50430`, this.textStyle); 50431 else if (p === "insertCompositionText") 50432 if (a == null || a.length < i) { 50433 let y = Math.max(0, c - 1) 50434 , m = Math.min(i - y - 1, i - a.length); 50435 d.deleteText(s, y, m) 50436 } else { 50437 let y = a.substring(u, u + a.length - i); 50438 d.insertTextAtSelection(y, this.textStyle) 50439 } 50440 else if (p === "insertReplacementText") { 50441 c = r.selectionStart; 50442 let y = g.length - (a.length - i); 50443 d.deleteText(s, c - g.length, y), 50444 d.insertTextAtSelection(g, this.textStyle) 50445 } else if (p === "deleteContentBackward") 50446 if (f > 0) 50447 d.deleteSelectedText(); 50448 else { 50449 c = r.selectionStart; 50450 let y = i - a.length; 50451 d.deleteText(s, c, y) 50452 } 50453 else if (p === "deleteContentForward") 50454 f > 0 ? d.deleteSelectedText() : c < i - 1 && d.deleteText(s, c, 1); 50455 else if (p === "deleteWordBackward") { 50456 if (f > 0) 50457 d.deleteSelectedText(); 50458 else if (c < i - 1) { 50459 let y = this.getPrevWordOffset(s, c); 50460 d.deleteText(s, y, c - y) 50461 } 50462 }
50462 else if (p === "deleteWordForward") { 50463 if (f > 0) 50464 d.deleteSelectedText(); 50465 else if (c < i - 1) { 50466 let y = this.getNextWordOffset(s, c); 50467 d.deleteText(s, c, y - c) 50468 } 50469 } else 50470 p === "historyUndo" ? this.undo() : p === "historyRedo" ? this.redo() : p === "insertFromPaste" || console.log(` 50471**Unknown InputType: ` + p + ", data: " + g + " ***"); 50472 r.value = s.getText(), 50473 r.setSelectionRange(n.dot, n.dot) 50474 } 50475 ; 50476 startEdit(e, t, n, s) { 50477 this.textStyle = s, 50478 z().setTextSelected(e, t, n); 50479 let i = this.textArea; 50480 i.parentElement == null && document.body.appendChild(i); 50481 let r = e.textElement 50482 , a = e.isEmpty() ? new B(0,0) : r.getStartPositionOfChar(t) 50483 , d = [a.x, a.y] 50484 , h = e.getAggregateTransform().transformArray(d); 50485 ty(d), 50486 i.style.top = h[1] + "px", 50487 i.value = e.getText(), 50488 i.setSelectionRange(t, t), 50489 document.activeElement !== i && i.click() 50490 } 50491 undo() { 50492 ae().canUndo() && ae().undo() 50493 } 50494 redo() { 50495 ae().canRedo() && ae().redo() 50496 } 50497 async onKeydown(e) { 50498 let t = e.keyCode 50499 , n = e.shiftKey 50500 , s = e.ctrlKey || e.metaKey 50501 , o = !0 50502 , r = V().textSelection 50503 , a = r.textModel; 50504 if (t === 90 && s) { 50505 n ? this.redo() : this.undo(); 50506 return 50507 } 50508 if (t === 27 && a) { 50509 this.endEdit(); 50510 return 50511 } 50512 if (a == null) 50513 return; 50514 let d = a.getTextLength() 50515 , u = r.dot 50516 , h = r.mark 50517 , c = Math.min(u, h) 50518 , f = Math.abs(u - h); 50519 if (n) 50520 switch (t) { 50521 case 35: 50522 if (s) 50523 this.setSelection(a, d - 1, h); 50524 else { 50525 let p = a.getLineIndex(u) 50526 , g = a.getLineOffsetRange(p); 50527 this.setSelection(a, g[1], h) 50528 } 50529 break; 50530 case 36: 50531 if (s) 50532 this.setSelection(a, 0, h); 50533 else { 50534 let p = a.getLineIndex(u) 50535 , g = a.getLineOffsetRange(p); 50536 this.setSelection(a, g[0], h) 50537 } 50538 break; 50539 case 37: 50540 { 50541 let p; 50542 s ? p = this.getPrevWordOffset(a, u) : p = Math.max(0, u - 1), 50543 this.setSelection(a, p, h); 50544 break 50545 } 50546 case 38: 50547 { 50548 let p = a.getLineIndex(u); 50549 if (p > 0) { 50550 let g = a.getCaretBounds(u).x 50551 , y = a.getOffsetInLine(p - 1, g); 50552 this.setSelection(a, y, h) 50553 } 50554 break 50555 } 50556 case 39: 50557 { 50558 let p; 50559 s ? p = this.getNextWordOffset(a, u) : p = Math.min(d - 1, u + 1), 50560 this.setSelection(a, p, h); 50561 break 50562 } 50563 case 40: 50564 { 50565 let p = a.getLineIndex(u); 50566 if (p < a.textLines.length - 1) { 50567 let g = a.getCaretBounds(u).x 50568 , y = a.getOffsetInLine(p + 1, g); 50569 this.setSelection(a, y, h) 50570 } 50571 break 50572 } 50573 default: 50574 o = !1 50575 } 50576 else if (s) 50577 switch (t) { 50578 case 35: 50579 this.setSelection(a, d - 1); 50580 break; 50581 case 36: 50582 { 50583 this.setSelection(a, 0); 50584 break 50585 } 50586 case 37: 50587 { 50588 let p = this.getPrevWordOffset(a, u); 50589 this.setSelection(a, p, p); 50590 break 50591 } 50592 case 39: 50593 { 50594 let p = this.getNextWordOffset(a, u); 50595 this.setSelection(a, p, p); 50596 break 50597 } 50598 case 65: 50599 this.setSelection(a, d - 1, 0); 50600 break; 50601 case 67: 50602 { 50603 let p = a.getText(c, f); 50604 kr(p); 50605 break 50606 } 50607 case 86: 50608 { 50609 let p = await Nh(); 50610 p = p.replace("\r", ""), 50611 z().insertTextAtSelection(p, this.textStyle); 50612 break 50613 } 50614 case 88: 50615 { 50616 let p = a.getText(c, f); 50617 a.deleteText(c, f), 50618 this.setSelection(a, c), 50619 kr(p); 50620 break 50621 } 50622 default: 50623 o = !1 50624 } 50625 else 50626 switch (t) { 50627 case 8: 50628 f > 0 ? z().deleteSelectedText() : c > 0 && (this.setSelection(a, c - 1), 50629 z().deleteText(a, c - 1, 1)); 50630 break; 50631 case 35: 50632 { 50633 let p = a.getLineIndex(u) 50634 , g = a.getLineOffsetRange(p); 50635 this.setSelection(a, g[1] - 1); 50636 break 50637 } 50638 case 36: 50639 { 50640 let p = a.getLineIndex(u) 50641 , g = a.getLineOffsetRange(p); 50642 this.setSelection(a, g[0]); 50643 break 50644 } 50645 case 37: 50646 f > 0 ? this.setSelection(a, c) : this.setSelection(a, Math.max(0, u - 1)); 50647 break; 50648 case 38: 50649 { 50650 let p = a.getLineIndex(u); 50651 if (p > 0) { 50652 let g = a.getCaretBounds(u).x 50653 , y = a.getOffsetInLine(p - 1, g); 50654 this.setSelection(a, y) 50655 } 50656 break 50657 } 50658 case 39: 50659 f > 0 ? this.setSelection(a, c + f) : this.setSelection(a, Math.min(d - 1, u + 1)); 50660 break; 50661 case 40: 50662 { 50663 let p = a.getLineIndex(u); 50664 if (p < a.textLines.length - 1) { 50665 let g = a.getCaretBounds(u).x 50666 , y = a.getOffsetInLine(p + 1, g); 50667 this.setSelection(a, y) 50668 } 50669 break 50670 } 50671 case 46: 50672 f > 0 ? z().deleteSelectedText() : c < d - 1 && z().deleteText(a, c, 1); 50673 break; 50674 default: 50675 o = !1 50676 } 50677 o && (this.textArea.value = a.getText(), 50678 this.textArea.setSelectionRange(r.dot, r.dot), 50679 e.preventDefault()), 50680 e.stopPropagation() 50681 } 50682 endEdit() { 50683 this.textArea.parentElement != null && (this.textArea.remove(), 50684 this.notifyListener("endInput")) 50685 } 50686 setSelection(e, t, n) { 50687 n == null && (n = t), 50688 z().setTextSelected(e, t, n) 50689 } 50690 setCaret(e, t) { 50691 this.textArea.setSelectionRange(e, t ?? e) 50692 } 50693 getPrevWordOffset(e, t) { 50694 return this.textArea.value.substring(0, t).search(/\s\S+\s*$/) + 1 50695 } 50696 getNextWordOffset(e, t) { 50697 let n = e.getText().substring(t); 50698 return t + Math.min(n.length - 1, Math.max(0, n.search(/(?<=^\s*\S+)(\s|$)|(?<=^\s*)$/))) 50699 } 50700 notifyListener(e) { 50701 this.inputListener && this.inputListener.onInputEvent(e) 50702 } 50703}
50704class wR extends yl { 50705 activeTextModel; 50706 caretDot = 0; 50707 caretMark = 0; 50708 textInput = new SR(this); 50709 canStartEditOnClick = !0; 50710 toolOptions = Et({ 50711 textAlignment: "left", 50712 paragraphStyle: new MR, 50713 textStyle: new zo 50714 }); 50715 toolbarOptionsComponent = bR; 50716 constructor() { 50717 super("text") 50718 } 50719 setActive(e) { 50720 if (super.setActive(e), 50721 e) { 50722 let t = V().textSelection; 50723 this.setTextSelection(t.textModel, t.dot, t.mark) 50724 } else { 50725 this.endEditing(); 50726 let t = j(); 50727 t.hideCaret(), 50728 t.hideResizeFrame(), 50729 this.textInput.endEdit() 50730 } 50731 } 50732 onInputEvent(e) { 50733 e === "endInput" && this.endEditing() 50734 } 50735 handlePointerDownEvent(e, t, n) { 50736 if (e.defaultPrevented) 50737 return; 50738 let s = !1, o; 50739 if (e.target2.tagName === "text" ? o = e.target2 : e.target2.tagName === "tspan" && (o = e.target2.parentElement), 50740 o != null) { 50741 let r = this.getDocumentModel().getModel(o); 50742 if (this.activeTextModel === r) { 50743 let a = r.getAggregateTransform() 50744 , d = r.getBounds() 50745 , u = a.invTransformXY(new B(t,n)); 50746 u.x >= d.x && u.x <= d.x + d.width && u.y >= d.y && u.y <= d.y + d.height && (s = !0) 50747 } 50748 } 50749 if (s) { 50750 let i = this.caretMark; 50751 (this.updateCaret(this.activeTextModel, t, n, e.shiftKey) || i !== this.caretMark) && this.setTextSelection(this.activeTextModel, this.caretDot, this.caretMark), 50752 this.canStartEditOnClick = !1, 50753 e.preventDefault() 50754 } else 50755 this.activeTextModel == null ? (this.canStartEditOnClick = !0, 50756 super.handlePointerDownEvent(e, t, n)) : (this.canStartEditOnClick = this.activeTextModel.isEmpty(), 50757 this.endEditing()) 50758 } 50759 handlePointerClickEvent(e, t, n) { 50760 { 50761 let s = z(), o; 50762 e.target2.tagName === "text" ? o = e.target2 : e.target2.tagName === "tspan" && (o = e.target2.parentElement); 50763 let i; 50764 o != null && (i = this.getDocumentModel().getModel(o)); 50765 let r; 50766 this.activeTextModel != null ? i === this.activeTextModel ? r = this.activeTextModel : r = i : i != null && (r = i); 50767 let a = !1; 50768 if (r != null && r === this.activeTextModel) { 50769 let d = r.getAggregateTransform() 50770 , u = r.getBounds() 50771 , h = d.invTransformXY(new B(t,n)); 50772 h.x >= u.x && h.x <= u.x + u.width && h.y >= u.y && h.y <= u.y + u.height && (a = !0) 50773 } 50774 if (!a && this.canStartEditOnClick) 50775 if (r != null) { 50776 let d = V(); 50777 s.setModelsSelected([r], d.selectedModels), 50778 this.setActiveTextModel(r), 50779 this.updateCaret(r, t, n, !1), 50780 this.setTextSelection(this.activeTextModel, this.caretDot), 50781 this.updateSelectionFrame() 50782 } else 50783 (this.dragInfo == null || this.dragInfo.handle == null) && this.startEditing(t, n) 50784 } 50785 } 50786 handlePointerMoveEvent(e, t, n) { 50787 let s = this.dragInfo == null ? null : this.dragInfo.handle; 50788 if (e.buttons === 1) { 50789 let o = this.activeTextModel; 50790 o != null && s == null ? this.updateCaret(o, t, n, !0) : super.handlePointerMoveEvent(e, t, n), 50791 this.setTextSelection(this.activeTextModel, this.caretDot, this.caretMark) 50792 } else { 50793 let o; 50794 e.target2.tagName === "text" ? o = e.target2 : e.target2.tagName === "tspan" && (o = e.target2.parentElement); 50795 let i; 50796 o != null && (i = this.getDocumentModel().getModel(o)); 50797 let r = !1; 50798 if (i != null) { 50799 let a = i.getAggregateTransform() 50800 , d = i.getBounds() 50801 , u = a.invTransformXY(new B(t,n)); 50802 u.x >= d.x && u.x <= d.x + d.width && u.y >= d.y && u.y <= d.y + d.height && (r = !0) 50803 } 50804 i != null && z().isModelSelected(i) && r ? this.hoverHandle != null && j().setHoverHandleOverlay(this.hoverHandle, !1) : (super.handlePointerMoveEvent(e, t, n), 50805 this.hoverHandle != null && (r = !1)), 50806 r && this.setCursor(!1, "text") 50807 } 50808 } 50809 onFocusLost() { 50810 super.onFocusLost(), 50811 this.endEditing() 50812 } 50813 async startEditing(e, t) { 50814 this.downPos = new B(e,t); 50815 let n = this.toolOptions.textStyle 50816 , s = this.toolOptions.paragraphStyle; 50817 yc(n.fontFamily); 50818 let o = new Rn(n,e,t); 50819 o.setAlignment(s.alignment); 50820 let i = V() 50821 , r = i.fillPaintGroup.getPaint(); 50822 await o.setPaint(r && r.clone(), "fill"); 50823 let a = i.strokePaintGroup.getPaint(); 50824 await o.setPaint(a && a.clone(), "stroke"); 50825 let d = this.getDocumentModel() 50826 , u = z(); 50827 u.insertModelAt(o, d, d.getChildModelCount()), 50828 u.setModelsSelected([o], i.selectedModels), 50829 this.setActiveTextModel(o), 50830 this.setTextSelection(o, 0, 0), 50831 this.updateSelectionFrame() 50832 } 50833 endEditing() { 50834 let e = this.activeTextModel; 50835 e != null && (this.activeTextModel = null, 50836 this.setTextSelection(null, 0), 50837 e.isEmpty() && !ae().inProgress && z().removeModel(e), 50838 this.textInput.endEdit(), 50839 j().clearTextSelection(e), 50840 this.updateSelectionFrame()) 50841 } 50842 updateCaret(e, t, n, s=!1) { 50843 let o = e.textElement 50844 , i = o.ownerSVGElement.createSVGPoint(); 50845 i.x = t, 50846 i.y = n, 50847 e.getAggregateTransform().invTransformXY(i); 50848 let r = e.getOffsetForPoint(i, !0); 50849 if (r !== -1) { 50850 let d = o.getStartPositionOfChar(r) 50851 , u = o.getEndPositionOfChar(r); 50852 Math.abs(u.x - i.x) < Math.abs(i.x - d.x) && r < e.getTextLength() - 1 && (r += 1) 50853 } 50854 let a = !1;
50855 return s || (a = this.caretMark !== r, 50856 this.caretMark = r), 50857 a = a || this.caretDot !== r, 50858 this.caretDot = r, 50859 a 50860 } 50861 setActiveTextModel(e) { 50862 e !== this.activeTextModel && (e == null && this.textInput.endEdit(), 50863 this.activeTextModel = e, 50864 this.setTextSelection(e, 0, 0)) 50865 } 50866 setCaret(e, t) { 50867 t == null && (t = e); 50868 let n = this.activeTextModel; 50869 this.caretDot = e, 50870 this.caretMark = t; 50871 let s = j(); 50872 if (n != null) { 50873 let o = Math.min(e, t) 50874 , i = Math.abs(e - t); 50875 s.showTextSelection(n, o, i), 50876 s.showCaret(n.textElement, e) 50877 } else 50878 s.hideCaret(); 50879 this.textInput.setCaret(e, t) 50880 } 50881 setTextSelection(e, t, n) { 50882 n == null && (n = t), 50883 z().setTextSelected(e, t, n), 50884 e != null && this.textInput.startEdit(e, t, n, this.toolOptions.textStyle) 50885 } 50886 handleKeyPressEvent(e) { 50887 let t = this.activeTextModel; 50888 if (t == null) 50889 return; 50890 let n = z(); 50891 if (n.insertTextAtSelection("" + e.keyCode, this.toolOptions.textStyle), 50892 e.key === Qr) 50893 n.insertTextAtSelection(` 50894`, this.toolOptions.textStyle); 50895 else if (e.key === $s) 50896 this.textInput.endEdit(); 50897 else { 50898 let s = e.keyCode 50899 , o = String.fromCharCode(s); 50900 n.insertTextAtSelection(o, this.toolOptions.textStyle) 50901 } 50902 e.preventDefault(), 50903 this.updateSelectionFrame(), 50904 j().updateModelOverlay(t) 50905 } 50906 updateSelectionFrame() { 50907 let e = V() 50908 , t = j(); 50909 if (this.activeTextModel != null) 50910 e.selectionTransform.set(1, 0, 0, 1, 0, 0), 50911 e.selectionBounds = null, 50912 t.updateModelOverlay(this.activeTextModel), 50913 t.hideResizeFrame(); 50914 else { 50915 super.updateSelectionFrame(); 50916 for (let n of e.selectedModels) 50917 t.updateModelOverlay(n) 50918 } 50919 } 50920 onTextSelectionChanged(e, t, n, s) { 50921 if (e == null) 50922 this.textInput.endEdit(); 50923 else { 50924 let i = s > n ? 1 : -1 50925 , r = e.getTextSpanModelAt(n, i); 50926 r != null && (this.toolOptions.textStyle.set(r.textStyle), 50927 this.toolOptions.textStyle.matchesSelection = !0) 50928 } 50929 this.activeTextModel = e, 50930 this.setCaret(n, s); 50931 let o = j(); 50932 e !== t ? (t != null && o.removeModelOverlay(t), 50933 e != null && o.showModelOverlay(e)) : o.updateModelOverlay(e), 50934 this.updateSelectionFrame() 50935 } 50936 onSelectionGeometryChanged() { 50937 super.onSelectionGeometryChanged(), 50938 this.setCaret(this.caretDot, this.caretMark) 50939 } 50940 onModelSelectionChanged(e, t) { 50941 super.onModelSelectionChanged(e, t); 50942 let s = V().selectedModels; 50943 s.length === 1 && s[0]instanceof Rn && this.setActiveTextModel(s[0]) 50944 } 50945} 50946new wR; 50947const PR = { 50948 name: "ShapeOptionsComponent", 50949 components: { 50950 HySelect: Dl, 50951 DimInput: ms, 50952 HyCheckbox: ml, 50953 HyLabel: Bn, 50954 HyInputNumber: Lt, 50955 HyGroup: Dt, 50956 HyRadio: en, 50957 HyTooltip: pt, 50958 SvgIcon: gt 50959 }, 50960 data() { 50961 return { 50962 tool: null, 50963 toolOptions: null, 50964 svgs: me({ 50965 rectangleSvg: MC, 50966 rectangleRoundingSvg: SC, 50967 circleSvg: PC, 50968 ellipseSvg: wC, 50969 polygonSvg: xC, 50970 polygonRoundingSvg: CC, 50971 starSvg: _C, 50972 starPointSizeSvg: TC, 50973 starAutoPointSizeSvg: kC, 50974 starOuterRoundingSvg: EC, 50975 starInnerRoundingSvg: DC 50976 }) 50977 } 50978 }, 50979 computed: { 50980 type() { 50981 return this.toolOptions.type 50982 }, 50983 hasStroke() { 50984 let l = this.toolOptions.strokePaintGroup; 50985 return l != null && !l.isNoPaint 50986 } 50987 }, 50988 watch: { 50989 "toolOptions.rectangle.cornerRounding": { 50990 handler(l) { 50991 if (!this.toolOptions.ignoreChanges) { 50992 let e = V() 50993 , t = z() 50994 , n = Ke(e.selectedModels).filter(s=>s.getType() === "rectangle"); 50995 t.setShapesProperty(n, "cornerRounding", n.map(()=>l)) 50996 } 50997 } 50998 }, 50999 "toolOptions.polygon.sides": { 51000 handler(l) { 51001 if (!this.toolOptions.ignoreChanges) { 51002 let e = V() 51003 , t = z() 51004 , n = Ke(e.selectedModels).filter(s=>s.getType() === "polygon"); 51005 t.setShapesProperty(n, "sides", n.map(()=>l)) 51006 } 51007 } 51008 }, 51009 "toolOptions.polygon.cornerRounding": { 51010 handler(l) { 51011 if (!this.toolOptions.ignoreChanges) { 51012 let e = V() 51013 , t = z() 51014 , n = Ke(e.selectedModels).filter(s=>s.getType() === "polygon"); 51015 t.setShapesProperty(n, "cornerRounding", n.map(()=>l)) 51016 } 51017 } 51018 }, 51019 "toolOptions.star.isAutoPointSize": { 51020 handler(l) { 51021 let e = this.toolOptions.star; 51022 if (l) { 51023 let t = e.points; 51024 e.pointSize = Bs.getAutoPointSize(t) 51025 } 51026 } 51027 }, 51028 "toolOptions.star.points": { 51029 handler(l) { 51030 if (!this.toolOptions.ignoreChanges) { 51031 let e = V() 51032 , t = z() 51033 , n = Ke(e.selectedModels).filter(i=>i.getType() === "star") 51034 , s = ae(); 51035 s.startCompoundEdit(), 51036 t.setShapesProperty(n, "points", n.map(()=>l)); 51037 let o = this.toolOptions.star; 51038 o.isAutoPointSize && (o.pointSize = Bs.getAutoPointSize(l)), 51039 s.endCompoundEdit() 51040 } 51041 } 51042 }, 51043 "toolOptions.star.pointSize": { 51044 handler(l) { 51045 if (!this.toolOptions.ignoreChanges) { 51046 let e = V() 51047 , t = z() 51048 , n = Ke(e.selectedModels).filter(s=>s.getType() === "star"); 51049 t.setShapesProperty(n, "pointSize", n.map(()=>l)) 51050 } 51051 } 51052 }, 51053 "toolOptions.star.outerRounding": { 51054 handler(l) { 51055 if (!this.toolOptions.ignoreChanges) { 51056 let e = 1 - this.toolOptions.innerRounding; 51057 if (l > e) 51058 this.toolOptions.outerRounding = e; 51059 else { 51060 let t = V() 51061 , n = z() 51062 , s = Ke(t.selectedModels).filter(o=>o.getType() === "star"); 51063 n.setShapesProperty(s, "outerRounding", s.map(o=>Math.min(l, 1 - o.innerRounding))) 51064 } 51065 } 51066 } 51067 }, 51068 "toolOptions.star.innerRounding": { 51069 handler(l) { 51070 if (!this.toolOptions.ignoreChanges) { 51071 let e = 1 - this.toolOptions.outerRounding; 51072 if (l > e) 51073 this.toolOptions.innerRounding = e; 51074 else { 51075 let t = V() 51076 , n = z() 51077 , s = Ke(t.selectedModels).filter(o=>o.getType() === "star"); 51078 n.setShapesProperty(s, "innerRounding", s.map(o=>Math.min(l, 1 - o.outerRounding))) 51079 } 51080 } 51081 } 51082 } 51083 } 51084} 51085 , xR = { 51086 class: "shape-options-container" 51087} 51088 , CR = { 51089 "data-wrapper": "" 51090} 51091 , _R = { 51092 "data-wrapper": "" 51093} 51094 , TR = { 51095 "data-wrapper": "" 51096} 51097 , kR = { 51098 "data-wrapper": "" 51099} 51100 , ER = { 51101 "data-wrapper": "" 51102} 51103 , DR = { 51104 "data-wrapper": "" 51105}; 51106function OR(l, e, t, n, s, o) { 51107 const i = E("svg-icon") 51108 , r = E("hy-tooltip") 51109 , a = E("hy-radio") 51110 , d = E("hy-group") 51111 , u = E("hy-label") 51112 , h = E("dim-input") 51113 , c = E("hy-input-number") 51114 , f = E("hy-select") 51115 , p = E("hy-checkbox"); 51116 return N(), 51117 $("div", null, [w(u, { 51118 label: l.$t("tools.shape.shape") 51119 }, {
51120 default: O(()=>[w(d, null, { 51121 default: O(()=>[w(a, { 51122 ref: "rect", 51123 type: "button", 51124 modelValue: s.toolOptions.type, 51125 "onUpdate:modelValue": e[0] || (e[0] = g=>s.toolOptions.type = g), 51126 value: "rectangle", 51127 name: "shapeType", 51128 class: "hy-toolbar-element" 51129 }, { 51130 default: O(()=>[w(i, { 51131 svg: s.svgs.rectangleSvg 51132 }, null, 8, ["svg"]), w(r, { 51133 getTarget: ()=>l.$refs.rect, 51134 label: l.$t("tools.shape.rectangle") 51135 }, null, 8, ["getTarget", "label"])]), 51136 _: 1 51137 }, 8, ["modelValue"]), w(a, { 51138 ref: "ellipse", 51139 type: "button", 51140 modelValue: s.toolOptions.type, 51141 "onUpdate:modelValue": e[1] || (e[1] = g=>s.toolOptions.type = g), 51142 value: "ellipse", 51143 name: "shapeType", 51144 class: "hy-toolbar-element" 51145 }, { 51146 default: O(()=>[w(i, { 51147 svg: s.svgs.ellipseSvg 51148 }, null, 8, ["svg"]), w(r, { 51149 getTarget: ()=>l.$refs.ellipse, 51150 label: l.$t("tools.shape.ellipse") 51151 }, null, 8, ["getTarget", "label"])]), 51152 _: 1 51153 }, 8, ["modelValue"]), w(a, { 51154 ref: "polygon", 51155 type: "button", 51156 modelValue: s.toolOptions.type, 51157 "onUpdate:modelValue": e[2] || (e[2] = g=>s.toolOptions.type = g), 51158 value: "polygon", 51159 name: "shapeType", 51160 class: "hy-toolbar-element" 51161 }, { 51162 default: O(()=>[w(i, {
51163 svg: s.svgs.polygonSvg 51164 }, null, 8, ["svg"]), w(r, { 51165 getTarget: ()=>l.$refs.polygon, 51166 label: l.$t("tools.shape.polygon") 51167 }, null, 8, ["getTarget", "label"])]), 51168 _: 1 51169 }, 8, ["modelValue"]), w(a, { 51170 ref: "star", 51171 type: "button", 51172 modelValue: s.toolOptions.type, 51173 "onUpdate:modelValue": e[3] || (e[3] = g=>s.toolOptions.type = g), 51174 value: "star", 51175 name: "shapeType", 51176 class: "hy-toolbar-element" 51177 }, { 51178 default: O(()=>[w(i, { 51179 svg: s.svgs.starSvg 51180 }, null, 8, ["svg"]), w(r, { 51181 getTarget: ()=>l.$refs.star, 51182 label: l.$t("tools.shape.star") 51183 }, null, 8, ["getTarget", "label"])]), 51184 _: 1 51185 }, 8, ["modelValue"])]), 51186 _: 1 51187 })]), 51188 _: 1 51189 }, 8, ["label"]), _("div", xR, [_("div", { 51190 class: Ne(["shape-options", { 51191 hidden: s.toolOptions.type !== "rectangle" 51192 }]) 51193 }, [_("div", CR, [w(u, { 51194 label: " " 51195 }, {
51196 default: O(()=>[w(i, { 51197 ref: "rectangleRoundingSvg", 51198 svg: s.svgs.rectangleRoundingSvg 51199 }, null, 8, ["svg"]), w(r, { 51200 getTarget: ()=>l.$refs.rectangleRoundingSvg, 51201 label: l.$t("tools.shape.rectangleOptions.cornerRounding") 51202 }, null, 8, ["getTarget", "label"]), w(h, { 51203 min: 0, 51204 max: 1, 51205 f: 100, 51206 unit: "%", 51207 step: .01, 51208 modelValue: s.toolOptions.rectangle.cornerRounding, 51209 "onUpdate:modelValue": e[4] || (e[4] = g=>s.toolOptions.rectangle.cornerRounding = g) 51210 }, null, 8, ["modelValue"])]), 51211 _: 1 51212 })])], 2), _("div", { 51213 class: Ne(["shape-options", { 51214 hidden: s.toolOptions.type !== "polygon" 51215 }]) 51216 }, [_("div", _R, [w(u, { 51217 label: l.$t("tools.shape.polygonOptions.sides") 51218 }, { 51219 default: O(()=>[w(c, { 51220 min: 3, 51221 max: 128, 51222 modelValue: s.toolOptions.polygon.sides, 51223 "onUpdate:modelValue": e[5] || (e[5] = g=>s.toolOptions.polygon.sides = g) 51224 }, null, 8, ["modelValue"])]), 51225 _: 1 51226 }, 8, ["label"])]), _("div", TR, [w(u, { 51227 label: " " 51228 }, {
51229 default: O(()=>[w(i, { 51230 ref: "polygonRoundingSvg", 51231 svg: s.svgs.polygonRoundingSvg 51232 }, null, 8, ["svg"]), w(r, { 51233 getTarget: ()=>l.$refs.polygonRoundingSvg, 51234 label: l.$t("tools.shape.polygonOptions.cornerRounding") 51235 }, null, 8, ["getTarget", "label"]), w(h, { 51236 min: 0, 51237 max: 1, 51238 f: 100, 51239 unit: "%", 51240 step: .01, 51241 modelValue: s.toolOptions.polygon.cornerRounding, 51242 "onUpdate:modelValue": e[6] || (e[6] = g=>s.toolOptions.polygon.cornerRounding = g) 51243 }, null, 8, ["modelValue"])]), 51244 _: 1 51245 })])], 2), _("div", { 51246 class: Ne(["shape-options", { 51247 hidden: s.toolOptions.type !== "star" 51248 }]) 51249 }, [_("div", kR, [w(u, { 51250 label: " " 51251 }, { 51252 default: O(()=>[w(f, { 51253 ref: "starPoints", 51254 items: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], 51255 modelValue: s.toolOptions.star.points, 51256 "onUpdate:modelValue": e[7] || (e[7] = g=>s.toolOptions.star.points = g) 51257 }, null, 8, ["modelValue"]), w(r, { 51258 getTarget: ()=>l.$refs.starPoints, 51259 label: l.$t("tools.shape.starOptions.points") 51260 }, null, 8, ["getTarget", "label"])]), 51261 _: 1 51262 })]), _("div", ER, [w(u, { 51263 label: " " 51264 }, {
51265 default: O(()=>[w(i, { 51266 ref: "starPointSizeSvg", 51267 svg: s.svgs.starPointSizeSvg 51268 }, null, 8, ["svg"]), w(r, { 51269 getTarget: ()=>l.$refs.starPointSizeSvg, 51270 label: l.$t("tools.shape.starOptions.pointSize") 51271 }, null, 8, ["getTarget", "label"]), w(d, null, { 51272 default: O(()=>[w(h, { 51273 "is-fixed-decimals": !0, 51274 min: 0, 51275 max: 1, 51276 modelValue: s.toolOptions.star.pointSize, 51277 "onUpdate:modelValue": e[8] || (e[8] = g=>s.toolOptions.star.pointSize = g), 51278 unit: "%", 51279 f: 100, 51280 decimals: 2, 51281 step: .01, 51282 onInput: e[9] || (e[9] = g=>s.toolOptions.star.isAutoPointSize = !1) 51283 }, null, 8, ["modelValue"]), w(p, { 51284 ref: "starAutoPointSize", 51285 type: "button", 51286 modelValue: s.toolOptions.star.isAutoPointSize, 51287 "onUpdate:modelValue": e[10] || (e[10] = g=>s.toolOptions.star.isAutoPointSize = g) 51288 }, { 51289 default: O(()=>[...e[13] || (e[13] = [ve(" Auto ", -1)])]), 51290 _: 1 51291 }, 8, ["modelValue"]), w(r, { 51292 getTarget: ()=>l.$refs.starAutoPointSize, 51293 label: l.$t("tools.shape.starOptions.autoPointSize") 51294 }, null, 8, ["getTarget", "label"])]), 51295 _: 1 51296 })]), 51297 _: 1 51298 })]), _("div", DR, [w(u, { 51299 label: " " 51300 }, {
51301 default: O(()=>[w(i, { 51302 ref: "starOuterRoundingSvg", 51303 svg: s.svgs.starOuterRoundingSvg 51304 }, null, 8, ["svg"]), w(r, { 51305 getTarget: ()=>l.$refs.starOuterRoundingSvg, 51306 label: l.$t("tools.shape.starOptions.outerRounding") 51307 }, null, 8, ["getTarget", "label"]), w(h, { 51308 min: 0, 51309 max: 1 - s.toolOptions.star.innerRounding, 51310 unit: "%", 51311 f: 100, 51312 step: .01, 51313 modelValue: s.toolOptions.star.outerRounding, 51314 "onUpdate:modelValue": e[11] || (e[11] = g=>s.toolOptions.star.outerRounding = g) 51315 }, null, 8, ["max", "modelValue"]), w(i, { 51316 ref: "starInnerRoundingSvg", 51317 svg: s.svgs.starInnerRoundingSvg 51318 }, null, 8, ["svg"]), w(r, { 51319 "get-target": ()=>l.$refs.starInnerRoundingSvg, 51320 label: l.$t("tools.shape.starOptions.innerRounding") 51321 }, null, 8, ["get-target", "label"]), w(h, { 51322 min: 0, 51323 max: 1 - s.toolOptions.star.outerRounding, 51324 unit: "%", 51325 f: 100, 51326 step: .01, 51327 modelValue: s.toolOptions.star.innerRounding, 51328 "onUpdate:modelValue": e[12] || (e[12] = g=>s.toolOptions.star.innerRounding = g) 51329 }, null, 8, ["max", "modelValue"])]), 51330 _: 1 51331 })])], 2)])]) 51332} 51333const AR = ie(PR, [["render", OR]]); 51334class IR extends yl { 51335 isNewShape = !1; 51336 toolOptions = Et({ 51337 type: "rectangle", 51338 commonType: "rectangle", 51339 fillPaintGroup: V().fillPaintGroup, 51340 strokePaintGroup: V().strokePaintGroup, 51341 strokeStyle: V().strokeStyle, 51342 rectangle: { 51343 cornerRounding: 0 51344 }, 51345 polygon: { 51346 sides: 6, 51347 cornerRounding: 0, 51348 circularity: 0 51349 }, 51350 star: { 51351 points: 5, 51352 pointSize: .5279, 51353 isAutoPointSize: !0, 51354 outerRounding: 0, 51355 innerRounding: 0 51356 } 51357 }); 51358 toolbarOptionsComponent = AR; 51359 constructor() { 51360 super("shape") 51361 } 51362 setActive(e) { 51363 if (super.setActive(e), 51364 e) { 51365 let t = this.toolOptions; 51366 t.fillPaintGroup.isNoPaint && t.strokePaintGroup.isNoPaint && t.fillPaintGroup.setNoPaint(!1) 51367 } 51368 } 51369 handlePointerClickEvent(e, t, n) { 51370 let s = this.getDocumentModel() 51371 , o = s.getSvg() 51372 , i = V() 51373 , r = z() 51374 , a = i.selectedModels 51375 , d = e.target2; 51376 if (d !== o && o.contains(d)) { 51377 let h = s.getSelectableModel(d), c, f; 51378 r.isModelSelected(h) ? e.shiftKey || a.length === 1 ? (c = null, 51379 f = [h]) : (c = [h], 51380 f = a) : (c = [h], 51381 e.shiftKey ? f = null : f = a), 51382 r.setModelsSelected(c, f) 51383 } else 51384 r.setModelsSelected(null, a) 51385 } 51386 async startPointerDrag(e, t, n, s, o) { 51387 if (this.dragInfo == null || this.dragInfo.handle == null) { 51388 let i = Vo(s, o, null); 51389 s = i.x, 51390 o = i.y; 51391 let r = z(), a = this.toolOptions, d = a.type, u; 51392 d === "rectangle" ? u = new uu(a.rectangle.cornerRounding) : d === "circle" ? u = new du : d === "ellipse" ? u = new Cf : d === "polygon" ? u = new _f(a.polygon.sides,a.polygon.cornerRounding,a.polygon.circularity) : d === "star" && (u = new Bs(a.star.points,a.star.isAutoPointSize ? null : a.star.pointSize,a.star.outerRounding,a.star.innerRounding)); 51393 let h = u.getBounds() 51394 , c = V() 51395 , f = this.toolOptions.fillPaintGroup 51396 , p = f.getPaint(); 51397 p && (p = p.clone(), 51398 p.mapPaintBounds(f.getPaintBounds(), h)), 51399 u.setPaint(p, "fill"); 51400 let g = this.toolOptions.strokePaintGroup 51401 , y = g.getPaint(); 51402 y && (y = y.clone(), 51403 y.mapPaintBounds(g.getPaintBounds(), h)), 51404 u.setPaint(y, "stroke"); 51405 let m = this.toolOptions.strokeStyle; 51406 u.setStrokeStyle(m); 51407 let b = new oe().translate(s, o); 51408 u.setSelfTransform(b), 51409 this.isNewShape = !0, 51410 ae().startCompoundEdit(), 51411 r.insertModels([u]), 51412 r.setModelsSelected([u], c.selectedModels), 51413 c.selectionTransform.setFromTransform(b), 51414 c.selectionBounds = h, 51415 super.updateDragInfo(s, o, !1), 51416 b = new oe().translate(s, o).scale((t - s) / h.width, (n - o) / h.height), 51417 this.changeSelectionTransform(b, b) 51418 } 51419 } 51420 handlePointerDownEvent(e, t, n) { 51421 super.handlePointerDownEvent(e, t, n), 51422 (this.dragInfo == null || this.dragInfo.handle == null) && j().showAlignLines(0, 0, !1, !1) 51423 } 51424 handlePointerMoveEvent(e, t, n) { 51425 if (e.buttons !== 0 && this.dragInfo == null || e.movementX === 0 && e.movementY === 0) 51426 return; 51427 let s = V() 51428 , o = j(); 51429 if (this.dragInfo != null) 51430 if (this.isNewShape) { 51431 let i = z() 51432 , r = this.toolOptions.type 51433 , a = e.ctrlKey; 51434 r === "star" && (a = !a); 51435 let d = e.altKey, u = this.dragInfo, h = u.selectionStartBounds, c = u.startX, f = u.startY, p; 51436 if (a) { 51437 let P = (Math.sign(t - c) || 1) * h.width 51438 , C = (Math.sign(n - f) || 1) * h.height 51439 , T = Jt(c, f, c + P, f + C, t, n); 51440 p = Vo(T.x, T.y, new B(P,C), this.hitTestContext) 51441 } else 51442 p = Vo(t, n, null, this.hitTestContext); 51443 let g = Math.min(p.x, c) 51444 , y = Math.min(p.y, f) 51445 , m = Math.abs((p.x - c) / h.width) 51446 , b = a ? m : Math.abs((p.y - f) / h.height); 51447 d && (g === c && (g -= p.x - c), 51448 y === f && (y -= p.y - f), 51449 m *= 2, 51450 b *= 2); 51451 let M = s.selectedModels[0] 51452 , x = ((M ? M.getParentModel().getAggregateTransform().invert() : null) || new oe).translate(g, y).scale(m, b); 51453 i.setSelModelsTransforms([x], x, !0), 51454 s.isShowAlignGuides() && j().showAlignLines(p.x, p.y, p.t
51454ypes[0], p.types[1]) 51455 } else { 51456 if (this.hoverHandle == null) { 51457 let i = Kl(t, n, 0, 0, !1); 51458 t = i.x, 51459 n = i.y, 51460 s.isShowAlignGuides() && o.showAlignLines(i.x, i.y, i.types[0], i.types[1]) 51461 } else 51462 o.showAlignLines(0, 0, !1, !1); 51463 super.handlePointerMoveEvent(e, t, n) 51464 } 51465 else if (this.updateHoverHandle(t, n, e.target2, !1), 51466 this.hoverHandle == null) { 51467 if (s.isShowAlignGuides()) { 51468 let i = Kl(t, n, null, null, !1); 51469 j().showAlignLines(i.x, i.y, i.types[0], i.types[1]) 51470 } 51471 } else 51472 o.showAlignLines(0, 0, !1, !1) 51473 } 51474 handlePointerUpEvent(e, t, n) { 51475 super.handlePointerUpEvent(e, t, n), 51476 this.endShapeCreation() 51477 } 51478 handlePointerleaveEvent() { 51479 j().showAlignLines(0, 0, null, null) 51480 } 51481 cancelPointerDrag() { 51482 this.endShapeCreation(), 51483 super.cancelPointerDrag() 51484 } 51485 endShapeCreation() { 51486 this.isNewShape && (this.isNewShape = !1, 51487 ae().endCompoundEdit(), 51488 this.updateSelectionFrame(), 51489 j().showAlignLines(0, 0, !1, !1)) 51490 } 51491 updateSelectionFrame() { 51492 if (this.isNewShape) 51493 j().hideResizeFrame(); 51494 else 51495 return super.updateSelectionFrame() 51496 } 51497 onModelSelectionChanged(e, t) { 51498 super.onModelSelectionChanged(e, t); 51499 let s = V().selectedModels 51500 , o = Ke(s) 51501 , i = null 51502 , r = null; 51503 if (o.forEach(a=>{ 51504 a instanceof qs ? i == null ? (i = a.getType(), 51505 r = i) : a.getType() !== i && (r = "diverse") : r = "diverse" 51506 } 51507 ), 51508 !(r == null || r === "diverse")) { 51509 this.toolOptions.ignoreChanges = !0; 51510 let a = o.at(-1); 51511 this.toolOptions.type = r; 51512 let d = this.toolOptions[r]; 51513 if (d) 51514 for (let u of Object.keys(d)) { 51515 let h = a.getShapePropertyValue(u); 51516 h !== void 0 && (d[u] = h) 51517 } 51518 el(()=>this.toolOptions.ignoreChanges = !1) 51519 } 51520 } 51521} 51522new IR; 51523const LR = { 51524 name: "OpenImageDialog", 51525 components: { 51526 HyButton: nt, 51527 HyDialog: pn 51528 }, 51529 props: { 51530 show: { 51531 type: Boolean, 51532 default: !1 51533 } 51534 }, 51535 data() { 51536 return { 51537 canDrop: !1 51538 } 51539 }, 51540 emits: ["close"], 51541 watch: { 51542 show(l) { 51543 l || (this.canDrop = !1) 51544 } 51545 }, 51546 methods: { 51547 onKeypress(l) { 51548 if (l.ctrlKey && l.keyCode === 86) 51549 try { 51550 navigator.clipboard.read().then(e=>{ 51551 if (e != null) 51552 for (let t of e) { 51553 let n = t.types; 51554 if (n != null) 51555 for (let s of n) 51556 s === "text/plain" && t.getType(s).then(async o=>{ 51557 let i = await o.text() 51558 , r = new Image; 51559 r.setAttribute("crossOrigin", "anonymous"), 51560 r.src = i, 51561 await r.decode(); 51562 let a = document.createElement("canvas"); 51563 a.width = r.width, 51564 a.height = r.height, 51565 a.getContext("2d").drawImage(r, 0, 0); 51566 let u = a.toDataURL("image/png") 51567 , h = new Fo(u,0,0,r.width,r.height) 51568 , c = z(); 51569 c.insertModels([h]), 51570 window.requestIdleCallback(()=>{ 51571 let f = V(); 51572 c.setModelsSelected([h], f.selectedModels) 51573 } 51574 ), 51575 this.close() 51576 } 51577 ), 51578 s === "image/png" && t.getType(s).then(o=>{ 51579 this.openImageFile(o), 51580 this.close() 51581 } 51582 ) 51583 } 51584 } 51585 ).catch(e=>{ 51586 console.error(e) 51587 } 51588 ), 51589 l.preventDefault() 51590 } catch (e) { 51591 console.error(e) 51592 } 51593 }, 51594 onDragEnter(l) { 51595 this.canDrop = !0, 51596 l.dataTransfer.dropEffect = "copy" 51597 }, 51598 onDragleave(l) { 51599 this.$refs.dropTarget.contains(l.relatedTarget) || (this.canDrop = !1) 51600 }, 51601 onDragover(l) { 51602 this.canDrop = !0, 51603 l.dataTransfer.dropEffect = "copy", 51604 l.preventDefault() 51605 }, 51606 onDrop(l) { 51607 if (l.defaultPrevented) 51608 return; 51609 let t = l.dataTransfer.files; 51610 if (l.preventDefault(), 51611 l.type === "drop" && t != null && t.length > 0) 51612 for (let n of t) { 51613 let s = n.name 51614 , o = s.substr(s.lastIndexOf(".") + 1); 51615 if (["png", "jpg", "jpeg", "gif", "bmp", "svg"].includes(o)) { 51616 this.openImageFile(n), 51617 this.close(); 51618 break 51619 } 51620 } 51621 }, 51622 async openLocalFile() { 51623 if (window.showOpenFilePicker) { 51624 let l; 51625 try { 51626 if ([l] = await window.showOpenFilePicker({ 51627 multiple: !1, 51628 types: [{ 51629 description: "Image Files", 51630 accept: { 51631 "image/png": [".png"], 51632 "image/jpeg": [".jpeg", ".jpg"], 51633 "image/bmp": [".bmp"], 51634 "image/svg+xml": [".svg"] 51635 } 51636 }] 51637 }), 51638 l) { 51639 const e = await l.getFile(); 51640 this.openImageFile(e), 51641 this.close() 51642 } 51643 } catch {} 51644 } else { 51645 let l = document.createElement("input"); 51646 l.type = "file", 51647 l.accept = ".png,.jpg,.jpeg", 51648 l.onchange = async e=>{ 51649 let t = e.target.files[0]; 51650 this.openImageFile(t) 51651 } 51652 , 51653 l.click(), 51654 this.close() 51655 } 51656 }, 51657 openImageFile(l) { 51658 let e = new FileReader; 51659 e.addEventListener("load", ()=>{ 51660 let t = z(); 51661 if (l.name.endsWith(".svg")) { 51662 let n = e.result.replace(/^data:.+;base64,/, "") 51663 , s = atob(n); 51664 zs(s).then(o=>{ 51665 let i = t.insertDocumentModel(o); 51666 window.requestAnimationFrame(()=>{ 51667 let r = V(); 51668 t.setModelsSelected(i, r.selectedModels) 51669 } 51670 ) 51671 } 51672 ) 51673 } else { 51674 let n = new Fo(e.result); 51675 t.insertModels([n]), 51676 window.requestIdleCallback(()=>{ 51677 let s = V(); 51678 t.setModelsSelected([n], s.selectedModels) 51679 } 51680 ) 51681 } 51682 } 51683 , !1),
51684 e.readAsDataURL(l) 51685 }, 51686 close() { 51687 this.$emit("close") 51688 } 51689 } 51690}; 51691function VR(l, e, t, n, s, o) { 51692 const i = E("hy-button") 51693 , r = E("hy-dialog"); 51694 return N(), 51695 pe(r, { 51696 show: t.show, 51697 title: l.$t("openImageDialog.title"), 51698 onClose: o.close, 51699 onCancel: o.close 51700 }, { 51701 actions: O(()=>[w(i, { 51702 onClick: o.close 51703 }, { 51704 default: O(()=>[ve(se(l.$t("cancel")), 1)]), 51705 _: 1 51706 }, 8, ["onClick"])]), 51707 default: O(()=>[_("div", { 51708 ref: "dropTarget", 51709 class: Ne(["drop-target", { 51710 "drop-target-active": s.canDrop 51711 }]), 51712 onDragenter: e[0] || (e[0] = (...a)=>o.onDragEnter && o.onDragEnter(...a)), 51713 onDragleave: e[1] || (e[1] = (...a)=>o.onDragleave && o.onDragleave(...a)), 51714 onDragover: e[2] || (e[2] = (...a)=>o.onDragover && o.onDragover(...a)), 51715 onDrop: e[3] || (e[3] = (...a)=>o.onDrop && o.onDrop(...a)), 51716 onKeydown: e[4] || (e[4] = (...a)=>o.onKeypress && o.onKeypress(...a)), 51717 tabindex: "0" 51718 }, [_("div", null, se(l.$t("openImageDialog.dropOrPaste")), 1), w(i, { 51719 primary: "", 51720 onClick: o.openLocalFile 51721 }, { 51722 default: O(()=>[ve(se(l.$t("openImageDialog.browseLocal")), 1)]), 51723 _: 1 51724 }, 8, ["onClick"])], 34)]), 51725 _: 1 51726 }, 8, ["show", "title", "onClose", "onCancel"]) 51727} 51728const NR = ie(LR, [["render", VR], ["__scopeId", "data-v-b060c2f3"]]) 51729 , RR = { 51730 name: "ImageOptionsComponent", 51731 components: { 51732 OpenImageDialog: NR 51733 }, 51734 data() { 51735 return { 51736 tool: null, 51737 toolOptions: null, 51738 isOpenImageDialogOpen: !1, 51739 addImageSvg: BC 51740 } 51741 }, 51742 methods: { 51743 closeImageDialog() { 51744 this.toolOptions.isOpenImageDialogOpen = !1, 51745 this.tool.imageDialogClosed() 51746 } 51747 } 51748}; 51749function FR(l, e, t, n, s, o) { 51750 const i = E("open-image-dialog"); 51751 return N(), 51752 $("div", null, [w(i, { 51753 show: s.toolOptions.isOpenImageDialogOpen, 51754 "onUpdate:show": e[0] || (e[0] = r=>s.toolOptions.isOpenImageDialogOpen = r), 51755 onClose: o.closeImageDialog 51756 }, null, 8, ["show", "onClose"])]) 51757} 51758const BR = ie(RR, [["render", FR]]); 51759class zR extends yl { 51760 toolOptions = { 51761 isOpenImageDialogOpen: !1 51762 }; 51763 toolbarOptionsComponent = BR; 51764 previousTool; 51765 constructor() { 51766 super("image") 51767 } 51768 setActive(e, t) { 51769 super.setActive(e, t), 51770 this.toolOptions.isOpenImageDialogOpen = e, 51771 this.previousTool = e ? t : null 51772 } 51773 imageDialogClosed() { 51774 V().setTool(this.previousTool || "selection") 51775 } 51776} 51777new zR; 51778const UR = { 51779 name: "ContourOptionsComponent", 51780 components: { 51781 HyInputNumber: Lt, 51782 HyCheckbox: ml, 51783 HyField: js, 51784 HySelect: Dl 51785 }, 51786 data() { 51787 return { 51788 tool: null, 51789 toolOptions: null, 51790 joinTypeItems: [{ 51791 value: "round", 51792 label: "Round" 51793 }, { 51794 value: "bevel", 51795 label: "Bevel" 51796 }, { 51797 value: "miter", 51798 label: "Miter" 51799 }], 51800 capTypeItems: [{ 51801 value: "round", 51802 label: "Round" 51803 }, { 51804 value: "butt", 51805 label: "Butt" 51806 }, { 51807 value: "square", 51808 label: "Square" 51809 }] 51810 } 51811 }, 51812 methods: { 51813 setDistance(l) { 51814 this.tool.setOffsetStyle(new Ao(l,null,null,null)) 51815 } 51816 } 51817}; 51818function GR(l, e, t, n, s, o) { 51819 const i = E("hy-input-number") 51820 , r = E("hy-field") 51821 , a = E("hy-select") 51822 , d = E("hy-checkbox"); 51823 return N(), 51824 $("div", null, [w(r, { 51825 label: "Distance" 51826 }, { 51827 default: O(()=>[w(i, { 51828 modelValue: s.toolOptions.offsetStyle.distance, 51829 "onUpdate:modelValue": [e[0] || (e[0] = u=>s.toolOptions.offsetStyle.distance = u), o.setDistance] 51830 }, null, 8, ["modelValue", "onUpdate:modelValue"])]), 51831 _: 1 51832 }), w(r, { 51833 label: "Join Type" 51834 }, {
51835 default: O(()=>[w(a, { 51836 modelValue: s.toolOptions.offsetStyle.linejoin, 51837 "onUpdate:modelValue": e[1] || (e[1] = u=>s.toolOptions.offsetStyle.linejoin = u), 51838 items: s.joinTypeItems, 51839 valueField: "value", 51840 labelField: "label" 51841 }, null, 8, ["modelValue", "items"])]), 51842 _: 1 51843 }), w(r, { 51844 label: "Miter Limit" 51845 }, { 51846 default: O(()=>[w(i, { 51847 modelValue: s.toolOptions.offsetStyle.miterlimit, 51848 "onUpdate:modelValue": e[2] || (e[2] = u=>s.toolOptions.offsetStyle.miterlimit = u) 51849 }, null, 8, ["modelValue"])]), 51850 _: 1 51851 }), w(r, { 51852 label: "Cap Type" 51853 }, { 51854 default: O(()=>[w(a, { 51855 modelValue: s.toolOptions.offsetStyle.linecap, 51856 "onUpdate:modelValue": e[3] || (e[3] = u=>s.toolOptions.offsetStyle.linecap = u), 51857 items: s.capTypeItems, 51858 valueField: "value", 51859 labelField: "label" 51860 }, null, 8, ["modelValue", "items"])]), 51861 _: 1 51862 }), w(d, { 51863 modelValue: s.toolOptions.closeHoles, 51864 "onUpdate:modelValue": e[4] || (e[4] = u=>s.toolOptions.closeHoles = u) 51865 }, { 51866 default: O(()=>[...e[5] || (e[5] = [ve("Close holes", -1)])]), 51867 _: 1 51868 }, 8, ["modelValue"])]) 51869} 51870const HR = ie(UR, [["render", GR]]); 51871class $R extends yl { 51872 downPos; 51873 toolOptions = Et({ 51874 offsetStyle: new Ao 51875 }); 51876 toolbarOptionsComponent = HR; 51877 constructor() { 51878 super("contour") 51879 } 51880 setActive(e) { 51881 e ? this.setCursor(!1, "default") : this.pathModel && (j().removeModelOverlay(this.pathModel), 51882 this.pathModel = null) 51883 } 51884 setOffsetStyle(e) { 51885 let t = this.toolOptions.offsetStyle; 51886 t.setFrom(e); 51887 let n = V() 51888 , s = Ke(n.selectedModels); 51889 e.distance || s.filter(i=>i.getOffsetStyle() != null), 51890 z().setModelsOffsetStyle(s, s.map(i=>i.getOffsetStyle() != null ? e : t)) 51891 } 51892 handlePointerClickEvent(e, t, n, s) { 51893 let o = e.shiftKey 51894 , i = this.getModelForElement(e.target2) 51895 , r = V() 51896 , a = z(); 51897 if (i != null) { 51898 if (!e.ctrlKey) 51899 for (; i.getParentModel().getType() === "group"; ) { 51900 let d = i.getParentModel(); 51901 if (a.isModelSelected(i) && !a.isModelSelected(d)) 51902 break; 51903 i = d 51904 } 51905 if (a.isModelSelected(i) ? o ? a.setModelsSelected(null, [i]) : a.setModelsSelected([i], r.selectedModels) : (o ? a.setModelsSelected([i], null) : a.setModelsSelected([i], r.selectedModels), 51906 super.updateDragInfo(t, n, !0), 51907 super.updateCursor(Fl)), 51908 s) { 51909 let d = V(); 51910 d.setTool("selection"), 51911 d.tool.handlePointerClickEvent(e, t, n, !1) 51912 } 51913 } 51914 } 51915 handlePointerDownEvent(e, t, n) { 51916 this.downPos = new B(t,n), 51917 super.handlePointerDownEvent(e, t, n) 51918 } 51919 async handlePointerMoveEvent(e, t, n) { 51920 if (e.buttons !== 0 && this.downPos != null) { 51921 let s = t - this.downPos.x; 51922 n - this.downPos.y; 51923 let o = s; 51924 this.setOffsetStyle(new Ao(o,null,null,null)) 51925 } 51926 } 51927 endOffset() { 51928 this.downPos = null 51929 } 51930 handlePointerUpEvent(e, t, n) { 51931 super.handlePointerUpEvent(e, t, n), 51932 this.endOffset() 51933 } 51934 updateSelectionFrame() {} 51935} 51936new $R; 51937class XR extends yl { 51938 constructor() { 51939 super("grain") 51940 } 51941 handlePointerClickEvent(e, t, n) { 51942 let s = e.shiftKey 51943 , o = e.target2 51944 , i = this.getDocumentModel(); 51945 if (i.baseElement.contains(o)) { 51946 let r = i.getSelectableModel(o); 51947 this.applyGrain(r) 51948 } else { 51949 let r = V() 51950 , a = z(); 51951 s || a.setModelsSelected(null, r.selectedModels) 51952 } 51953 } 51954 applyGrain(e) { 51955 let t = "filter1" 51956 , n = de("filter", { 51957 id: t, 51958 "color-interpolation-filters": "sRGB" 51959 }, null, [de("feTurbulence", { 51960 type: "fractalNoise", 51961 baseFrequency: "0.2" 51962 }), de("feColorMatrix", { 51963 values: "0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0.3 0.3 0.3 0 0.3", 51964 result: "noise" 51965 }), de("feGaussianBlur", { 51966 stdDeviation: "20", 51967 in: "SourceGraphic" 51968 }), de("feComponentTransfer", null, null, [de("feFuncA", { 51969 type: "linear", 51970 slope: "0.38", 51971 intercept: "0.50" 51972 })]), de("feComposite", { 51973 operator: "arithmetic", 51974 k1: "1", 51975 in2: "noise" 51976 }), de("feComponentTransfer", null, null, [de("feFuncA", { 51977 type: "discrete", 51978 tableValues: "0 1" 51979 })])]); 51980 e.getDocumentModel().defsElement.appendChild(n), 51981 e.baseElement.setAttribute("filter", "url(#" + t + ")") 51982 } 51983} 51984new XR; 51985class Li extends yl { 51986 dragPoint; 51987 wasDragPointSelected; 51988 dragOffsX; 51989 dragOffsY; 51990 dragStartX; 51991 dragStartY; 51992 hoverPoint; 51993 hoverCurveLocation; 51994 selector; 51995 guideOverlay; 51996 constructor(e) { 51997 super(e) 51998 } 51999 onPathChanged(e) { 52000 console.log("onPathChanged() is not implemented") 52001 } 52002 createPathModel(e, t, n=3) { 52003 let s = new bt; 52004 return s.setPaint(new et(new ce(t)), "stroke"), 52005 s.setPaint(e ? new et(new ce(e)) : null, "fill"), 52006 s.baseElement.setAttribute("stroke-width", n), 52007 s.baseElement.setAttribute("vector-effect", "non-scaling-stroke"), 52008 V().activeDocument.insertChildAt(s, 0), 52009 s 52010 } 52011 curveToPathData(e, t=!0) { 52012 if (e) { 52013 let n = t ? "M" + e[0] + "," + e[1] : ""; 52014 return n += "C" + e[2] + "," + e[3] + "," + e[4] + "," + e[5] + "," + e[6] + "," + e[7], 52015 n 52016 } else 52017 return "" 52018 } 52019 getNeighboringNodePoints(e) { 52020 let t = new Set; 52021 if (e && e.length > 0) { 52022 let n = e[0] 52023 , s = e.length; 52024 for (let o = 0; o < s; o++) { 52025 let i = e[o] 52026 , r = e[o === s - 1 ? 0 : o + 1]; 52027 if (i.getNext() !== r) { 52028 if (i.getNext() !== n) { 52029 let a = n.getPrevious(); 52030 a && t.add(a); 52031 let d = i.getNext(); 52032 d && t.add(d) 52033 } 52034 n = r 52035 } 52036 } 52037 } 52038 return t 52039 } 52040 handlePointerClickEvent(e, t, n, s) { 52041 let o = e.shiftKey 52042 , i = this.dragPoint; 52043 if (i != null) { 52044 if (i instanceof ut) { 52045 let r = z(); 52046 o ? this.wasDragPointSelected === !0 && r.setNodePointsSelected(null, [i]) : r.setN
52046odePointsSelected([i], r.sortedSelNodePoints) 52047 } 52048 this.setDragPoint(null) 52049 } else { 52050 let r = V() 52051 , a = z(); 52052 if (s) { 52053 r.setTool("selection"), 52054 r.tool.handlePointerClickEvent(e, t, n, !1); 52055 return 52056 } 52057 let d = e.target2 52058 , u = this.getDocumentModel(); 52059 if (u.baseElement === d || !u.baseElement.contains(d)) 52060 o || a.setModelsSelected(null, r.selectedModels); 52061 else { 52062 let h = u.getSelectableModel(d); 52063 if (h.isPath()) { 52064 let c = a.isModelSelected(h); 52065 o ? c ? a.setModelsSelected(null, [h]) : a.setModelsSelected([h], null) : (c && this.clearPathPointSelection(!0, !0), 52066 a.setModelsSelected([h], r.selectedModels)) 52067 } else 52068 o ? a.isModelSelected(h) ? a.setModelsSelected(null, [h]) : a.setModelsSelected([h], null) : a.setModelsSelected([h], r.selectedModels) 52069 } 52070 } 52071 } 52072 handlePointerDownEvent(e, t, n) { 52073 let s = e.shiftKey 52074 , o = z() 52075 , r = V().appSettings.editor.pointTolerance * 100 / this.getZoom() 52076 , a = o.getPathPointsAt(t, n, r); 52077 if (a.length > 0) { 52078 let d = a[0]; 52079 if (this.setDragPoint(d), 52080 this.wasDragPointSelected = o.isPathPointSelected(d), 52081 this.dragOffsX = t - d.xTransformed, 52082 this.dragOffsY = n - d.yTransformed, 52083 this.dragStartX = d.xTransformed, 52084 this.dragStartY = d.yTransformed, 52085 d instanceof ut) 52086 o.isPathPointSelected(d) || (s || this.clearPathPointSelection(!0, !0), 52087 o.setNodePointsSelected([d], null)), 52088 this.dragStartCoords = o.sortedSelNodePoints.map(u=>[u.x, u.y, u.inX, u.inY, u.outX, u.outY]); 52089 else { 52090 let u = d.nodePoint; 52091 this.dragStartCoords = [[u.x, u.y, u.inX, u.inY, u.outX, u.outY]] 52092 } 52093 } else 52094 this.setDragPoint(null), 52095 super.handlePointerDownEvent(e, t, n) 52096 } 52097 startPointerDrag(e, t, n, s, o) { 52098 if (this.dragPoint == null) { 52099 let i = z() 52100 , r = j() 52101 , a = i.getSelectedModelsNodePoints() 52102 , d = new Set(i.sortedSelNodePoints); 52103 e.ctrlKey ? (this.selector = new _d(s,o,a,d), 52104 this.setCursor(!0, "selectorLasso")) : (this.selector = new vu(s,o,a,d), 52105 this.setCursor(!0, "selectorRect")), 52106 r.showSelectorElement(this.selector), 52107 this.clearPathPointSelection(!1, !0) 52108 } else if (this.dragPoint instanceof ut) { 52109 let i = z() 52110 , r = j() 52111 , a = []; 52112 for (let d of i.selectedControlPoints) 52113 i.isPathPointSelected(d.nodePoint) || a.push(d); 52114 r.initNodePointsDrag(a) 52115 } 52116 } 52117 handlePointerMoveEvent(e, t, n, s) { 52118 let o = V() 52119 , i = z() 52120 , r = j() 52121 , a = e.shiftKey 52122 , d = e.ctrlKey; 52123 if (s) { 52124 let u = this.dragPoint; 52125 if (u != null) { 52126 if (t -= this.dragOffsX, 52127 n -= this.dragOffsY, 52128 d) { 52129 let h, c; 52130 if (u instanceof ut) 52131 h = this.dragStartX, 52132 c = this.dragStartY; 52133 else { 52134 let g = u.nodePoint; 52135 h = g.xTransformed, 52136 c = g.yTransformed 52137 } 52138 let f = Kl(t, n, h, c, !0); 52139 t = f.x, 52140 n = f.y; 52141 let p = f.angle; 52142 this.guideOverlay = r.showGuideLine(h, c, p, this.guideOverlay), 52143 o.isShowAlignGuides() && r.showAlignLines(f.x, f.y, f.types[0], f.types[1]) 52144 } else { 52145 let h = Kl(t, n, null, null, !1); 52146 t = h.x, 52147 n = h.y, 52148 o.isShowAlignGuides() && r.showAlignLines(h.x, h.y, h.types[0], h.t
52148ypes[1]), 52149 r.hideGuide(this.guideOverlay) 52150 } 52151 if (u instanceof Is) 52152 this.moveControlPoint(u, a, t, n); 52153 else { 52154 let h = t - u.xTransformed 52155 , c = n - u.yTransformed; 52156 this.moveNodePoints(i.sortedSelNodePoints, h, c, !0) 52157 } 52158 } else 52159 this.selector != null ? (this.selector.moveTo(t, n), 52160 r.updateSelectorElement(this.selector), 52161 this.updateSelectorSelection(a)) : super.handlePointerMoveEvent(e, t, n) 52162 } else { 52163 let u = o.appSettings.editor.pointTolerance * 100 / this.getZoom() 52164 , h = i.getPathPointsAt(t, n, u)[0]; 52165 h != null ? h !== this.hoverPoint && (this.setHoverPoint(h), 52166 h instanceof ut ? this.setCursor(!1, "nodePoint") : this.setCursor(!1, "controlPoint")) : (this.setCursor(!1, "default"), 52167 this.setHoverPoint(null)) 52168 } 52169 } 52170 handlePointerUpEvent(e, t, n, s) { 52171 if (s) { 52172 let o = z() 52173 , i = j(); 52174 i.hideGuide(this.guideOverlay); 52175 let r = this.dragPoint; 52176 if (r != null) { 52177 let a = ae(); 52178 if (!a.inProgress) { 52179 let d = new ts(r instanceof Is ? [r.nodePoint] : o.sortedSelNodePoints,this.dragStartCoords); 52180 a.addEdit(d) 52181 } 52182 this.setDragPoint(null), 52183 i.showAlignLines(0, 0, !1, !1), 52184 i.endNodePointsDrag(), 52185 i.updatePathPointCoordinates(o.sortedSelNodePoints) 52186 } else { 52187 let a = this.selector; 52188 if (a != null) { 52189 let d = o.sortedSelNodePoints; 52190 d = d.concat(Array.from(this.getNeighboringNodePoints(d))); 52191 for (let u of d) 52192 this.updateControlPointsSelection(u); 52193 i.hideSelectorElement(a), 52194 this.selector = null 52195 } else 52196 super.handlePointerUpEvent(e, t, n) 52197 } 52198 } 52199 } 52200 updateSelectorSelection(e) { 52201 let t = this.selector 52202 , n = t.sortedPoints 52203 , s = t.getPointsInFill() 52204 , o = t.prevSelPoints 52205 , i = t.prevAddOriginalSelPoints 52206 , r = t.originalSelPoints 52207 , a = [] 52208 , d = []; 52209 for (let u of n) { 52210 let h = s.has(u) 52211 , c = o != null && o.has(u); 52212 (e && !c || i && !h) && r.has(u) && (e && (h = !0), 52213 i && (c = !0)), 52214 (!o || h !== c) && (h ? a.push(u) : d.push(u)) 52215 } 52216 (a.length || d.length) && z().setNodePointsSelected(a, d), 52217 t.prevSelPoints = s, 52218 t.prevAddOriginalSelPoints = e 52219 } 52220 handleKeyDownEvent(e) { 52221 let t = e.key 52222 , n = e.repeat 52223 , s = z() 52224 , o = !1; 52225 if (t === Vn && this.selector != null) 52226 n || this.updateSelectorSelection(!0); 52227 else if (t === ou || e.key === su) { 52228 if (!n && s.sortedSelNodePoints.length > 0) { 52229 let i = ae(); 52230 i.startCompoundEdit(); 52231 let r = s.sortedSelNodePoints.slice(); 52232 s.clearControlPointsSelection(), 52233 s.setNodePointsSelected(null, s.sortedSelNodePoints); 52234 let a = new Set, d = new Set, u, h = r[0], c = h.getIndex(), f = 1; 52235 for (let g = 0; g < r.length; g++) 52236 if (u = h, 52237 h = r[g + 1], 52238 h == null || u.getNext() !== h) { 52239 let y = u.getSinglePathModel(); 52240 if (d.add(y.getNodePoints()[c].getPrevious()), 52241 d.add(u.getNext()), 52242 a.add(y.getPathModel()), 52243 f >= y.getNodeCount() - 1) { 52244 let m = y.getPathModel(); 52245 m.getSinglePathModels().length <= 1 ? (s.setModelsSelected(null, [m]), 52246 s.removeModel(m)) : s.removeSinglePathModel(y) 52247 } else 52248 s.removeNodePoints(y, c, f); 52249 h != null && (c = h.getIndex(), 52250 f = 1) 52251 } else 52252 f++; 52253 i.endCompoundEdit(); 52254 let p = j(); 52255 for (let g of d) 52256 g != null && p.updateHandleLineElement(g); 52257 a.forEach(g=>{ 52258 g.pathDataUpdated(), 52259 p.updateModelOverlay(g) 52260 } 52261 ), 52262 this.setHoverPoint(null), 52263 this.setDragPoint(null), 52264 o = !0 52265 } 52266 } else 52267 t === hn ? (this.moveNodePoints(s.sortedSelNodePoints, 0, -1), 52268 o = !0) : t === cs ? (this.moveNodePoints(s.sortedSelNodePoints, 0, 1), 52269 o = !0) : t === Io ? (this.moveNodePoints(s.sortedSelNodePoints, -1, 0), 52270 o = !0) : t === Lo ? (this.moveNodePoints(s.sortedSelNodePoints, 1, 0), 52271 o = !0) : t === $s && (this.clearPathPointSelection(!0, !0), 52272 o = !0); 52273 o && e.preventDefault() 52274 } 52275 handleKeyUpEvent(e) { 52276 e.key === Vn && this.selector != null && this.updateSelectorSelection(!1) 52277 } 52278 setDragPoint(e) { 52279 let t = j(); 52280 this.dragPoint != null && t.setPrimaryPointOverlay(this.dragPoint, !1), 52281 this.dragPoint = e, 52282 e != null ? t.setPrimaryPointOverlay(e, !0) : this.wasDragPointSelected = !1 52283 } 52284 setHoverPoint(e) { 52285 let t = j(); 52286 this.hoverPoint != null && t.setHoverPointOverlay(this.hoverPoint, !1), 52287 this.hoverPoint = e, 52288 e != null && t.setHoverPointOverlay(e, !0) 52289 } 52290 updateControlPointsSelection(e) { 52291 let t = z(), n = j(), s = e.controlPointIn, o = e.controlPointOut, i, r; 52292 if (t.isPathPointSelected(e)) 52293 i = !0, 52294 r = !0; 52295 else { 52296 let d = e.getPrevious(); 52297 i = d != null && t.isPathPointSelected(d); 52298 let u = e.getNext(); 52299 r = u != null && t.isPathPointSelected(u) 52300 } 52301 let a = !1; 52302 t.setControlPointSelected(e.controlPointIn, i) && (a = !0,
52303 n.setPathPointSelected(s, i)), 52304 t.setControlPointSelected(e.controlPointOut, r) && (a = !0, 52305 n.setPathPointSelected(o, r)), 52306 a && n.updateHandleLineElement(e) 52307 } 52308 onNodePointsSelectionChanged(e, t) { 52309 let n = j(), s = z(), o; 52310 if (e) { 52311 e.sort((r,a)=>r.compare(a)); 52312 let i = s.sortedSelNodePoints; 52313 for (let r of e) { 52314 let a = s.getSelectedNodePointIndex(r); 52315 o = i[a - 1], 52316 n.setPathPointSelected(r, !0, o) 52317 } 52318 } 52319 if (t) 52320 for (let i of t) 52321 n.setPathPointSelected(i, !1); 52322 if (this.selector == null) { 52323 for (let i of e) 52324 this.updateControlPointsSelection(i); 52325 for (let i of t) 52326 this.updateControlPointsSelection(i); 52327 for (let i of this.getNeighboringNodePoints(e)) 52328 this.updateControlPointsSelection(i); 52329 for (let i of this.getNeighboringNodePoints(t)) 52330 this.updateControlPointsSelection(i) 52331 } 52332 } 52333 onNodePointsMoved(e, t) { 52334 let n = j(); 52335 n.updatePathPointCoordinates(e); 52336 for (let s of t) 52337 n.updateModelOverlay(s) 52338 } 52339 onNodePointsChanged(e, t, n, s) { 52340 let o = j(); 52341 if (t) { 52342 let i = []; 52343 t.forEach(r=>{ 52344 i.push(r, r.controlPointIn, r.controlPointOut) 52345 } 52346 ), 52347 o.showPathPointsOverlay(i); 52348 for (let r of t) 52349 o.updateHandleLineElement(r) 52350 } 52351 n && n.forEach(i=>{ 52352 o.removePathPointOverlay(i), 52353 o.removePathPointOverlay(i.controlPointIn), 52354 o.removePathPointOverlay(i.controlPointOut) 52355 } 52356 ), 52357 o.updateModelOverlay(e) 52358 } 52359 clearPathPointSelection(e, t) { 52360 let n = z(); 52361 if (t) { 52362 for (let o of n.selectedControlPoints) 52363 j().setPathPointSelected(o, !1); 52364 n.clearControlPointsSelection(); 52365 let s = n.sortedSelNodePoints; 52366 s = s.concat(Array.from(this.getNeighboringNodePoints(s))); 52367 for (let o of s) 52368 j().updateHandleLineElement(o) 52369 } 52370 e && n.setNodePointsSelected(null, n.sortedSelNodePoints) 52371 } 52372 showSelModelOverlay(e) { 52373 let t = j(); 52374 if (t.showModelOverlay(e), 52375 e.isPath()) { 52376 let n = e.getSinglePathModels() 52377 , s = []; 52378 for (let o of n) { 52379 let i = o.isClosed() 52380 , r = o.getNodePoints(); 52381 for (let a = 0; a < r.length; a++) { 52382 let d = r[a] 52383 , u = i || a > 0 52384 , h = i || a < r.length - 1; 52385 u && s.push(d.controlPointIn), 52386 h && s.push(d.controlPointOut), 52387 s.push(d) 52388 } 52389 } 52390 t.showPathPointsOverlay(s) 52391 } 52392 } 52393 hideSelModelOverlay(e) { 52394 let t = z() 52395 , n = j(); 52396 if (e.isPath()) 52397 for (let s of e.getSinglePathModels()) { 52398 let o = s.getNodePoints(); 52399 t.setNodePointsSelected(null, o); 52400 for (let i of o) 52401 n.removePathPointOverlay(i), 52402 n.removePathPointOverlay(i.controlPointIn), 52403 n.removePathPointOverlay(i.controlPointOut) 52404 } 52405 n.removeModelOverlay(e) 52406 } 52407 moveNodePoints(e, t, n, s) { 52408 let o = j(), i, r, a = new Set, d = null; 52409 for (let h of e) { 52410 let c = h.getPathModel(); 52411 if (c !== d) { 52412 a.add(c); 52413 let f = c.getAggregateTransform().invert(); 52414 if (f.isIdentity) 52415 i = t, 52416 r = n, 52417 r = n; 52418 else { 52419 let p = h.xTransformed 52420 , g = h.yTransformed 52421 , y = new B(p,g); 52422 f.transformXY(y); 52423 let m = new B(p + t,g + n); 52424 f.transformXY(m), 52425 i = m.x - y.x, 52426 r = m.y - y.y 52427 } 52428 d = c 52429 } 52430 h.move(i, r, i, r, i, r), 52431 h.moveTransformed(t, n, t, n, t, n) 52432 } 52433 for (let h of a) 52434 h.pathDataUpdated(), 52435 o.updateModelOverlay(h); 52436 z().fireModelsUpdated(a), 52437 s ? o.setSelectedPointsTranslate(t, n) : o.updatePathPointCoordinates(e), 52438 a.size > 0 && this.onPathChanged([...a][0]) 52439 }
52440 moveControlPoint(e, t, n, s) { 52441 let o = j() 52442 , i = e.nodePoint 52443 , r = i.getPathModel() 52444 , a = r.getAggregateTransform() 52445 , d = new B(n,s); 52446 a.invTransformXY(d); 52447 let u = new B(d.x - e.x,d.y - e.y) 52448 , h = i.getNodeType() === yt; 52449 if (h = t ? !h : h, 52450 e.isInControlPoint()) { 52451 if (i.inX += u.x, 52452 i.inY += u.y, 52453 h) { 52454 let c = Se(i.inX - i.x, i.inY - i.y); 52455 if (c > Number.EPSILON) { 52456 let f = Se(i.outX - i.x, i.outY - i.y); 52457 i.outX = i.x + (i.x - i.inX) * f / c, 52458 i.outY = i.y + (i.y - i.inY) * f / c 52459 } 52460 } 52461 } else if (i.outX += u.x, 52462 i.outY += u.y, 52463 h) { 52464 let c = Se(i.outX - i.x, i.outY - i.y); 52465 if (c > Number.EPSILON) { 52466 let f = Se(i.inX - i.x, i.inY - i.y); 52467 i.inX = i.x + (i.x - i.outX) * f / c, 52468 i.inY = i.y + (i.y - i.outY) * f / c 52469 } 52470 } 52471 i.updateTransformedCoords(a), 52472 r.pathDataUpdated(), 52473 o.updateModelOverlay(r), 52474 o.updatePathPointCoordinates([e]), 52475 this.onPathChanged(r) 52476 } 52477 onModelSelectionChanged(e, t) { 52478 let n = t && Ke(t) 52479 , s = e && Ke(e); 52480 if (n != null) 52481 for (let o = n.length - 1; o >= 0; o--) { 52482 let i = n[o]; 52483 (s == null || !s.includes(i)) && this.hideSelModelOverlay(i) 52484 } 52485 if (s != null) 52486 for (let o of s) 52487 this.showSelModelOverlay(o) 52488 } 52489 onSelectionGeometryChanged() { 52490 let e = V() 52491 , t = j() 52492 , n = e.selectedModels 52493 , s = Ke(n); 52494 for (let o of s) 52495 if (o instanceof Jl) 52496 for (let i of o._singlePathModels) 52497 t.updatePathPointCoordinates(i.getNodePoints()); 52498 for (let o of s) 52499 t.updateModelOverlay(o) 52500 } 52501 getContextActions(e, t) { 52502 return [{ 52503 actionName: "toCornerNodes" 52504 }, { 52505 actionName: "toSmoothNodes" 52506 }] 52507 } 52508 setActive(e) { 52509 let t = V() 52510 , n = z() 52511 , s = j(); 52512 if (e) { 52513 let o = t.selectedModels; 52514 for (let i of Ke(o)) 52515 this.showSelModelOverlay(i); 52516 for (let i of n.sortedSelNodePoints) 52517 s.setPathPointSelected(i, !0); 52518 for (let i of n.selectedControlPoints) 52519 s.setPathPointSelected(i, !0); 52520 this.setCursor(!1, "default") 52521 } else { 52522 for (let i of n.sortedSelNodePoints) 52523 s.setPathPointSelected(i, !1); 52524 for (let i of n.selectedControlPoints) 52525 s.setPathPointSelected(i, !1); 52526 let o = t.selectedModels; 52527 for (let i of Ke(o)) 52528 this.hideSelModelOverlay(i); 52529 this.setHoverPoint(null), 52530 this.setDragPoint(null), 52531 this.selector != null && (s.hideSelectorElement(this.selector), 52532 this.selector = null) 52533 } 52534 } 52535} 52536const YR = { 52537 name: "CurveOffsetOptionsComponent", 52538 components: { 52539 HyButton: nt, 52540 HyGroup: Dt, 52541 HyInputNumber: Lt 52542 }, 52543 data() { 52544 return { 52545 tool: null, 52546 toolOptions: null 52547 } 52548 }, 52549 methods: {} 52550}; 52551function KR(l, e, t, n, s, o) { 52552 const i = E("hy-button") 52553 , r = E("hy-input-number") 52554 , a = E("hy-group"); 52555 return N(), 52556 $("div", null, [w(a, null, { 52557 default: O(()=>[w(i, { 52558 onClick: e[0] || (e[0] = d=>s.toolOptions.distance--) 52559 }, { 52560 default: O(()=>[...e[3] || (e[3] = [ve("-", -1)])]), 52561 _: 1 52562 }), w(r, { 52563 size: "24", 52564 modelValue: s.toolOptions.distance, 52565 "onUpdate:modelValue": e[1] || (e[1] = d=>s.toolOptions.distance = d) 52566 }, null, 8, ["modelValue"]), w(i, { 52567 onClick: e[2] || (e[2] = d=>s.toolOptions.distance++) 52568 }, { 52569 default: O(()=>[...e[4] || (e[4] = [ve("+", -1)])]), 52570 _: 1 52571 })]), 52572 _: 1 52573 })]) 52574} 52575const WR = ie(YR, [["render", KR]]); 52576class qR extends Li { 52577 toolbarOptionsComponent = WR; 52578 pathOffset; 52579 pathFallback; 52580 pathLines; 52581 circlesGroup; 52582 toolOptions = { 52583 distance: 100 52584 }; 52585 constructor() { 52586 super("devCurveOffset") 52587 } 52588 setActive(e) { 52589 if (super.setActive(e), 52590 e) { 52591 let t = V() 52592 , n = z(); 52593 n.setModelsSelected(null, t.selectedModels); 52594 let s = t.activeDocument.getChildModels(); 52595 n.removeModels(s); 52596 let o = "M100,100,C150,150 200,200, 300,300"; 52597 o = "M-16.681625779822753 398.0733584164195c-0.0004409866610330937 0.000053120096822567575 879.9982715643273 13.999968359463367 879.9961388259347 13.999745244593953"; 52598 let i = Xl(o); 52599 i[0].getCurve(0).v = [382.82887686670364, 341.61571005922366, 351.462
5259963180005116, 835.7943785916173, 250.56521739130434, 462.9130434782609, 238.56521739130434, 495.9130434782609]; 52600 let r = new bt(i); 52601 r.setPaint(new et(new ce("red")), "stroke"), 52602 r.setPaint(null, "fill"), 52603 t.activeDocument.insertChildAt(r, 0), 52604 n.setModelsSelected([r], null), 52605 this.pathOffset = this.createPathModel(null, "blue"), 52606 this.pathFallback = this.createPathModel(null, "teal"), 52607 this.pathLines = this.createPathModel(null, "rgba(0, 16, 64, 0.1)"), 52608 this.circlesGroup = de("g"), 52609 t.activeDocument.baseElement.appendChild(this.circlesGroup), 52610 this.onPathChanged(r) 52611 } 52612 } 52613 onPathChanged(e) { 52614 let t = this.toolOptions.distance 52615 , n = new un; 52616 n.setStartEndProperties(-t, 0, t, t); 52617 let s = e.getSinglePathModels()[0].getCurve(0).v 52618 , o = new hs(s) 52619 , i = 400 52620 , r = ""; 52621 if (s != null) 52622 for (let b = 0; b <= i; b++) { 52623 let M = b / i 52624 , S = ze(s, M) 52625 , x = Te(s, M, n.d(o.toLengthParameter(M))) 52626 , P = S.addScalar(-x.y, x.x) 52627 , C = S.addScalar(x.y, -x.x); 52628 r += "M" + P.x + " " + P.y + "L" + C.x + " " + C.y 52629 } 52630 this.pathLines.baseElement.setAttribute("d", r); 52631 let a = m2(s, n, o, je(s, 0, n.d(0))); 52632 this.pathFallback.setPathData(this.curveToPathData(a)), 52633 this.removeCircles(); 52634 let[d,u,h,c,f,p] = It(s, 1) 52635 , g = -(f * u - d * p) / (h * u - d * c); 52636 if (g >= 0 && g <= 1) { 52637 let b = ze(s, g); 52638 this.addCircle(b.x, b.y, "red") 52639 } 52640 Or(s, !0, !1).forEach(b=>{ 52641 let M = ze(s, b); 52642 this.addCircle(M.x, M.y, "magenta") 52643 } 52644 ); 52645 let y = Rs(s, n) 52646 , m = ""; 52647 for (let b of y.partOffsets) 52648 for (let M = 0; M < b.vOffsetParts.length; M++) { 52649 let S = b.vOffsetParts[M]; 52650 M === 0 && (m += "M" + +S[0] + " " + S[1]), 52651 m += "C" + S.slice(2).toString(), 52652 M === 0 && this.addCircle(S[0], S[1]), 52653 this.addCircle(S[6], S[7]) 52654 } 52655 this.pathOffset.setPathData(m) 52656 } 52657 addCircle(e, t, n) { 52658 let s = de("circle", { 52659 fill: "none", 52660 "vector-effect": "non-scaling-stroke", 52661 r: "5" 52662 }); 52663 s.setAttribute("cx", e), 52664 s.setAttribute("cy", t), 52665 s.setAttribute("stroke", n ?? "#0048e0"), 52666 this.circlesGroup.appendChild(s) 52667 } 52668 removeCircles() { 52669 this.circlesGroup.replaceChildren() 52670 } 52671} 52672new qR; 52673const jR = { 52674 name: "CurveMergeOptionsComponent", 52675 components: { 52676 HyButton: nt, 52677 HyGroup: Dt, 52678 HyInputNumber: Lt 52679 }, 52680 data() { 52681 return { 52682 tool: null, 52683 toolOptions: null 52684 } 52685 }, 52686 methods: {} 52687}; 52688function JR(l, e, t, n, s, o) { 52689 const i = E("hy-button") 52690 , r = E("hy-input-number") 52691 , a = E("hy-group"); 52692 return N(), 52693 $("div", null, [w(a, null, { 52694 default: O(()=>[e[5] || (e[5] = _("div", null, "tolerance", -1)), w(i, { 52695 onClick: e[0] || (e[0] = d=>s.toolOptions.tolerance--) 52696 }, { 52697 default: O(()=>[...e[3] || (e[3] = [ve("-", -1)])]), 52698 _: 1 52699 }), w(r, { 52700 size: "24", 52701 modelValue: s.toolOptions.tolerance, 52702 "onUpdate:modelValue": e[1] || (e[1] = d=>s.toolOptions.tolerance = d) 52703 }, null, 8, ["modelValue"]), w(i, { 52704 onClick: e[2] || (e[2] = d=>s.toolOptions.tolerance++) 52705 }, { 52706 default: O(()=>[...e[4] || (e[4] = [ve("+", -1)])]), 52707 _: 1 52708 })]), 52709 _: 1 52710 })]) 52711} 52712const ZR = ie(jR, [["render", JR]]); 52713class QR extends Li { 52714 toolbarOptionsComponent = ZR; 52715 paths = []; 52716 toolOptions = { 52717 tolerance: 10 52718 }; 52719 constructor() { 52720 super("devCurveMerge") 52721 } 52722 setActive(e) { 52723 if (super.setActive(e), 52724 e) { 52725 let t = V() 52726 , n = z(); 52727 n.setModelsSelected(null, t.selectedModels); 52728 let s = t.activeDocument.getChildModels(); 52729 n.removeModels(s); 52730 let i = Xl("M100,100,C150,150 200,200, 300,300 C350,250 400,300, 500,200") 52731 , r = new bt(i); 52732 r.setPaint(new et(new ce("red")), "stroke"), 52733 r.setPaint(null, "fill"), 52734 r.getSinglePathModels()[0].getNodePointAt(1).setNodeType(yt), 52735 t.activeDocument.insertChildAt(r, 0), 52736 n.setModelsSelected([r], null), 52737 this.paths[0] = this.createPathModel(null, "#40ff00", 3), 52738 this.paths[1] = this.createPathModel(null, "#f0e000", 3), 52739 this.paths[2] = this.createPathModel(null, "#ffa000", 3), 52740 this.paths[3] = this.createPathModel(null, "#ff0000", 3), 52741 this.paths[4] = this.createPathModel(null, "#0000ff", 6) 52742 } 52743 } 52744 onPathChanged(e) { 52745 let t = e.getSinglePathModels()[0].getPath().getCurves().map(o=>o.v) 52746 , n = this.mergeCurves(t[0], t[1]); 52747 for (let o = 0; o < 4; o++) { 52748 let i = n[o]; 52749 this.paths[o].setPathData(i ? this.curveToPathData(i) : "") 52750 } 52751 let s = $v(t[0], t[1], this.toolOptions.tolerance); 52752 this.paths[4].setPathData(s ? this.curveToPathData(s) : "") 52753 } 52754 mergeCurves(e, t) { 52755 let n = hf([e, t]) 52756 , s = new B(e[6],e[7]);
52757 return n.forEach(o=>{ 52758 let i = gl(o) 52759 , r = gl(e); 52760 gl(t, r); 52761 let a = Math.max(Math.abs(i[0] - r[0]), Math.abs(i[1] - r[1]), Math.abs(i[2] - r[2]), Math.abs(i[3] - r[3])) ** 2 52762 , d = jr(o, s) 52763 , u = ze(o, d).distSquared(s) 52764 , h = dn(o, d) 52765 , c = this.getCurveErrorSq(h[0], e, Number.MAX_VALUE) 52766 , f = this.getCurveErrorSq(h[1], t, Number.MAX_VALUE); 52767 o.err = Math.max(u, c, f, a) 52768 } 52769 ), 52770 n.sort((o,i)=>o.err - i.err), 52771 n 52772 } 52773 getCurveErrorSq(e, t, n) { 52774 let s = 0 52775 , i = new hs(e).getEqualArcLengthTs(5); 52776 for (let r of i) { 52777 let a = ze(e, r) 52778 , d = Lw(t, a) 52779 , u = a.distSquared(d); 52780 if (u > s) { 52781 if (u > n) 52782 return u; 52783 s = u 52784 } 52785 } 52786 return s 52787 } 52788} 52789new QR; 52790const eF = { 52791 name: "CornerRoundingComponent", 52792 components: { 52793 HyButton: nt, 52794 HyGroup: Dt, 52795 HyInputNumber: Lt 52796 }, 52797 data() { 52798 return { 52799 tool: null, 52800 toolOptions: null 52801 } 52802 }, 52803 watch: { 52804 "toolOptions.radius"(l) { 52805 this.tool.updateCornerRounding(l) 52806 } 52807 }, 52808 methods: {} 52809}; 52810function tF(l, e, t, n, s, o) { 52811 const i = E("hy-button") 52812 , r = E("hy-input-number") 52813 , a = E("hy-group"); 52814 return N(), 52815 $("div", null, [w(a, null, { 52816 default: O(()=>[e[5] || (e[5] = _("div", null, "tolerance", -1)), w(i, { 52817 onClick: e[0] || (e[0] = d=>s.toolOptions.radius--) 52818 }, { 52819 default: O(()=>[...e[3] || (e[3] = [ve("-", -1)])]), 52820 _: 1 52821 }), w(r, { 52822 size: "24", 52823 modelValue: s.toolOptions.radius, 52824 "onUpdate:modelValue": e[1] || (e[1] = d=>s.toolOptions.radius = d) 52825 }, null, 8, ["modelValue"]), w(i, { 52826 onClick: e[2] || (e[2] = d=>s.toolOptions.radius++) 52827 }, { 52828 default: O(()=>[...e[4] || (e[4] = [ve("+", -1)])]), 52829 _: 1 52830 })]), 52831 _: 1 52832 })]) 52833} 52834const lF = ie(eF, [["render", tF]]); 52835class nF extends Li { 52836 toolbarOptionsComponent = lF; 52837 pathModel; 52838 roundedPathModel; 52839 circleModel; 52840 toolOptions = { 52841 radius: 80 52842 }; 52843 constructor() { 52844 super("devCornerRounding") 52845 } 52846 setActive(e) { 52847 if (super.setActive(e), 52848 e) { 52849 let t = V() 52850 , n = z(); 52851 n.setModelsSelected(null, t.selectedModels); 52852 let s = t.activeDocument.getChildModels(); 52853 n.removeModels(s); 52854 let i = Xl("M100,100,C150,150 200,200, 300,300 C350,250 400,300, 500,200") 52855 , r = new bt(i); 52856 r.setPaint(new et(new ce("red")), "stroke"), 52857 r.setPaint(null, "fill"), 52858 t.activeDocument.insertChildAt(r, 0), 52859 n.setModelsSelected([r], null), 52860 this.pathModel = r, 52861 this.roundedPathModel = this.createPathModel(null, "blue", 6); 52862 let a = new du; 52863 a.setPaint(new et(new ce("red")), "stroke"), 52864 a.setPaint(null, "fill"), 52865 t.activeDocument.insertChildAt(a, 0), 52866 this.circleModel = a, 52867 this.updateCornerRounding(this.toolOptions.radius) 52868 } 52869 } 52870 onPathChanged() { 52871 this.updateCornerRounding(this.toolOptions.radius) 52872 } 52873 updateCornerRounding(e) { 52874 let t = this.pathModel.getSinglePathModels()[0].getPath().getCurves().map(a=>a.v) 52875 , n = t[0] 52876 , s = t[1] 52877 , o = performance.now() 52878 , i = ss(n, s, e); 52879 console.log(performance.now() - o + "ms"); 52880 let r = ""; 52881 if (i) { 52882 let a = Ln(n, 0, i[0]) 52883 , d = Ln(s, i[1], 1); 52884 r += this.curveToPathData(a); 52885 let u = Te(a, 1).getAngleTo(Te(d, 0)) > 0 ? 1 : 0; 52886 r += "A" + i[2] + " " + i[2] + " 0 0 " + u + " " + d[0] + " " + d[1], 52887 r += this.curveToPathData(d, !1), 52888 this.circleModel.setR(i[2]); 52889 let h = je(a, 1, i[2] * (u ? -1 : 1)); 52890 this.circleModel.setCx(h.x), 52891 this.circleModel.setCy(h.y) 52892 } else 52893 this.circleModel.setR(0), 52894 this.circleModel.setCx(0), 52895 this.circleModel.setCy(0); 52896 this.roundedPathModel.setPathData(r) 52897 } 52898} 52899new nF; 52900const sF = { 52901 name: "CornerOptionsComponent", 52902 data() { 52903 return { 52904 tool: null, 52905 toolOptions: null 52906 } 52907 } 52908}; 52909function oF(l, e, t, n, s, o) { 52910 return N(), 52911 $("div") 52912} 52913const iF = ie(sF, [["render", oF]]); 52914class rF extends yl { 52915 dragPoint; 52916 wasDragPointSelected; 52917 dragOffsX; 52918 dragOffsY; 52919 dragStartX; 52920 dragStartY; 52921 hoverPoint; 52922 hoverCurveLocation; 52923 selector; 52924 guideOverlay; 52925 toolbarOptionsComponent = iF; 52926 constructor() { 52927 super("corner") 52928 } 52929 handlePointerClickEvent(e, t, n, s) { 52930 let o = e.shiftKey 52931 , i = this.dragPoint; 52932 if (i != null) { 52933 if (i instanceof ut) { 52934 let r = z(); 52935 o ? this.wasDragPointSelected === !0 && r.setNodePointsSelected(null, [i]) : r.setN
52935odePointsSelected([i], r.sortedSelNodePoints) 52936 } 52937 this.setDragPoint(null) 52938 } else { 52939 let r = V() 52940 , a = z(); 52941 if (this.hoverCurveLocation != null) { 52942 let h = this.hoverCurveLocation 52943 , c = h.t 52944 , f = h.curveIndex 52945 , p = h.singlePathModel 52946 , g = p.getNodePointAt(f) 52947 , y = p.getNodePointAt(f + 1) 52948 , m = g.toCoords() 52949 , b = y.toCoords() 52950 , M = p.splitCurve(f, c); 52951 M.setNodeType(yt); 52952 let S = new Pd; 52953 S.addEdit(new Kf(p,f + 1,[M])), 52954 S.addEdit(new ts([g, y],[m, b])), 52955 S.close(), 52956 ae().addEdit(S), 52957 this.setHoverPoint(M), 52958 a.setNodePointsSelected([M], a.sortedSelNodePoints), 52959 j().hideCurvePointOverlay(h.p), 52960 this.hoverCurveLocation = null, 52961 e.preventDefault(); 52962 return 52963 } 52964 if (s) { 52965 r.setTool("selection"), 52966 r.tool.handlePointerClickEvent(e, t, n, !1); 52967 return 52968 } 52969 let d = e.target2 52970 , u = this.getDocumentModel(); 52971 if (u.baseElement === d || !u.baseElement.contains(d)) 52972 o || a.setModelsSelected(null, r.selectedModels); 52973 else { 52974 let h = u.getModel(d); 52975 if (h.isPath()) { 52976 let c = a.isModelSelected(h); 52977 o ? c ? a.setModelsSelected(null, [h]) : a.setModelsSelected([h], null) : (c && this.clearPathPointSelection(!0, !0), 52978 a.setModelsSelected([h], r.selectedModels)) 52979 } else 52980 o ? a.isModelSelected(h) ? a.setModelsSelected(null, [h]) : a.setModelsSelected([h], null) : a.setModelsSelected([h], r.selectedModels) 52981 } 52982 } 52983 } 52984 handlePointerDownEvent(e, t, n) { 52985 let s = e.shiftKey 52986 , o = z() 52987 , r = V().appSettings.editor.pointTolerance * 100 / this.getZoom() 52988 , a = o.getPathPointsAt(t, n, r); 52989 if (a.length > 0) { 52990 let d = a[0]; 52991 if (this.setDragPoint(d), 52992 this.wasDragPointSelected = o.isPathPointSelected(d), 52993 this.dragOffsX = t - d.xTransformed, 52994 this.dragOffsY = n - d.yTransformed, 52995 this.dragStartX = d.xTransformed, 52996 this.dragStartY = d.yTransformed, 52997 d instanceof ut) 52998 o.isPathPointSelected(d) || (s || this.clearPathPointSelection(!0, !0), 52999 o.setNodePointsSelected([d], null)), 53000 this.dragStartCoords = o.sortedSelNodePoints.map(u=>[u.x, u.y, u.inX, u.inY, u.outX, u.outY]); 53001 else { 53002 let u = d.nodePoint; 53003 this.dragStartCoords = [[u.x, u.y, u.inX, u.inY, u.outX, u.outY]] 53004 } 53005 } else 53006 this.setDragPoint(null), 53007 super.handlePointerDownEvent(e, t, n) 53008 } 53009 startPointerDrag(e, t, n, s, o) { 53010 if (this.dragPoint == null && this.hoverCurveLocation == null) { 53011 let i = z() 53012 , r = j() 53013 , a = i.getSelectedModelsNodePoints() 53014 , d = new Set(i.sortedSelNodePoints); 53015 e.ctrlKey ? (this.selector = new _d(s,o,a,d), 53016 this.setCursor(!0, "selectorLasso")) : (this.selector = new vu(s,o,a,d), 53017 this.setCursor(!1, "selectorRect")), 53018 r.showSelectorElement(this.selector) 53019 } else if (!(this.dragPoint instanceof ut)) { 53020 if (this.hoverCurveLocation != null) { 53021 let i = this.hoverCurveLocation 53022 , r = i.curveIndex 53023 , a = i.singlePathModel.getNodePoints() 53024 , d = a[r] 53025 , u = a[r < a.length - 1 ? r + 1 : 0]; 53026 this.dragStartCoords = [d.toCoords(), u.toCoords()] 53027 } 53028 } 53029 } 53030 handlePointerMoveEvent(e, t, n, s) { 53031 let o = z() 53032 , i = j() 53033 , r = e.shiftKey; 53034 if (e.ctrlKey, 53035 s) { 53036 let a = this.dragPoint; 53037 if (a != null) { 53038 t -= this.dragOffsX, 53039 n -= this.dragOffsY; 53040 let d = t - a.xTransformed 53041 , u = n - a.yTransformed 53042 , h = Se(d, u);
53043 o.sortedSelNodePoints.forEach(f=>f.radius = h), 53044 o.moveNodePoints([a], [a.toCoords()]) 53045 } else 53046 this.selector != null && (this.selector.moveTo(t, n), 53047 i.updateSelectorElement(this.selector), 53048 this.updateSelectorSelection(r)) 53049 } 53050 } 53051 handlePointerUpEvent(e, t, n, s) { 53052 if (s) { 53053 let o = z() 53054 , i = j() 53055 , r = this.selector; 53056 r != null ? (o.sortedSelNodePoints, 53057 i.hideSelectorElement(r), 53058 this.selector = null) : super.handlePointerUpEvent(e, t, n) 53059 } 53060 } 53061 updateSelectorSelection(e) { 53062 let t = this.selector 53063 , n = t.sortedPoints 53064 , s = t.getPointsInFill() 53065 , o = t.prevSelPoints 53066 , i = t.prevAddOriginalSelPoints 53067 , r = t.originalSelPoints 53068 , a = [] 53069 , d = []; 53070 for (let u of n) { 53071 let h = s.has(u) 53072 , c = o != null && o.has(u); 53073 (e && !c || i && !h) && r.has(u) && (e && (h = !0), 53074 i && (c = !0)), 53075 (!o || h !== c) && (h ? a.push(u) : d.push(u)) 53076 } 53077 (a.length || d.length) && z().setNodePointsSelected(a, d), 53078 t.prevSelPoints = s, 53079 t.prevAddOriginalSelPoints = e 53080 } 53081 handleKeyDownEvent(e) { 53082 e.key, 53083 e.repeat, 53084 z() 53085 } 53086 setDragPoint(e) { 53087 let t = j(); 53088 this.dragPoint != null, 53089 this.dragPoint = e, 53090 e != null ? t.setPrimaryPointOverlay(e, !0) : this.wasDragPointSelected = !1 53091 } 53092 setHoverPoint(e) { 53093 let t = j(); 53094 this.hoverPoint != null && t.setHoverPointOverlay(this.hoverPoint, !1), 53095 this.hoverPoint = e, 53096 e != null && t.setHoverPointOverlay(e, !0) 53097 } 53098 onNodePointsSelectionChanged(e, t) { 53099 let n = j(), s = z(), o; 53100 if (e) { 53101 e.sort((r,a)=>r.compare(a)); 53102 let i = s.sortedSelNodePoints; 53103 for (let r of e) { 53104 let a = s.getSelectedNodePointIndex(r); 53105 o = i[a - 1], 53106 n.setPathPointSelected(r, !0, o) 53107 } 53108 } 53109 if (t) 53110 for (let i of t) 53111 n.setPathPointSelected(i, !1) 53112 } 53113 onNodePointsMoved(e, t) { 53114 j().updatePathPointCoordinates(e); 53115 for (let s of t) 53116 this.updateSelModelOverlay(s) 53117 } 53118 onNodePointsChanged(e, t, n, s) { 53119 let o = j(); 53120 if (t) { 53121 let i = []; 53122 t.forEach(r=>{ 53123 i.push(r, r.controlPointIn, r.controlPointOut) 53124 } 53125 ), 53126 o.showPathPointsOverlay(i); 53127 for (let r of t) 53128 o.updateHandleLineElement(r) 53129 } 53130 n && n.forEach(i=>{ 53131 o.removePathPointOverlay(i), 53132 o.removePathPointOverlay(i.controlPointIn), 53133 o.removePathPointOverlay(i.controlPointOut) 53134 } 53135 ), 53136 this.updateSelModelOverlay(e) 53137 } 53138 clearPathPointSelection(e) { 53139 let t = z(); 53140 t.setNodePointsSelected(null, t.sortedSelNodePoints) 53141 } 53142 showSelModelOverlay(e) { 53143 let t = j(); 53144 if (t.showModelOverlay(e, "cornerTool"), 53145 console.log(e.isPath()), 53146 e.isPath()) { 53147 t.showModelOverlay(e, "cornerTool", "transform"); 53148 let n = e.getSinglePathModels() 53149 , s = []; 53150 for (let o of n) { 53151 let i = o.getNodePoints(); 53152 for (let r = 0; r < i.length; r++) { 53153 let a = i[r]; 53154 s.push(a) 53155 } 53156 } 53157 t.showPathPointsOverlay(s) 53158 } 53159 } 53160 hideSelModelOverlay(e) { 53161 let t = z() 53162 , n = j(); 53163 if (n.removeModelOverlay(e, "cornerTool"), 53164 e.isPath()) { 53165 n.removeModelOverlay(e, "cornerTool", "transform"); 53166 for (let s of e.getSinglePathModels()) { 53167 let o = s.getNodePoints(); 53168 t.setNodePointsSelected(null, o); 53169 for (let i of o) 53170 n.removePathPointOverlay(i) 53171 } 53172 } 53173 } 53174 updateSelModelOverlay(e) { 53175 let t = j(); 53176 t.updateModelOverlay(e, "cornerTool"), 53177 e.isPath() && t.updateModelOverlay(e, "cornerTool", "transform") 53178 } 53179 moveNodePoints(e, t, n, s) { 53180 let o = j(), i, r, a = new Set, d = null; 53181 for (let h of e) { 53182 let c = h.getPathModel(); 53183 if (c !== d) { 53184 a.add(c); 53185 let f = c.getAggregateTransform().invert(); 53186 if (f.isIdentity) 53187 i = t, 53188 r = n, 53189 r = n; 53190 else { 53191 let p = h.xTransformed 53192 , g = h.yTransformed 53193 , y = new B(p,g); 53194 f.transformXY(y); 53195 let m = new B(p + t,g + n); 53196 f.transformXY(m), 53197 i = m.x - y.x, 53198 r = m.y - y.y 53199 } 53200 d = c 53201 } 53202 h.move(i, r, i, r, i, r), 53203 h.moveTransformed(t, n, t, n, t, n) 53204 } 53205 for (let h of a) 53206 h.pathDataUpdated(), 53207 this.updateSelModelOverlay(h); 53208 z().fireModelsUpdated(a), 53209 s ? o.setSelectedPointsTranslate(t, n) : o.updatePathPointCoordinates(e) 53210 } 53211 onModelSelectionChanged(e, t) { 53212 let n = t && Ke(t) 53213 , s = e && Ke(e); 53214 if (n != null) 53215 for (let o = n.length - 1; o >= 0; o--) { 53216 let i = n[o]; 53217 this.hideSelModelOverlay(i) 53218 } 53219 if (s != null) 53220 for (let o of s) 53221 this.showSelModelOverlay(o) 53222 } 53223 onSelectionGeometryChanged() { 53224 let e = V() 53225 , t = j() 53226 , n = e.selectedModels 53227 , s = Ke(n); 53228 for (let o of s) 53229 if (o instanceof Jl) 53230 for (let i of o._singlePathModels) 53231 t.updatePathPointCoordinates(i.getNodePoints()); 53232 for (let o of s) 53233 this.updateSelModelOverlay(o) 53234 } 53235 setActive(e) { 53236 let t = V() 53237 , n = z() 53238 , s = j(); 53239 if (e) { 53240 let o = t.selectedModels; 53241 for (let i of Ke(o)) 53242 this.showSelModelOverlay(i); 53243 for (let i of n.sortedSelNodePoints) 53244 s.setPathPointSelected(i, !0); 53245 this.setCursor(!1, "nodes") 53246 } else { 53247 for (let i of n.sortedSelNodePoints) 53248 s.setPathPointSelected(i, !1); 53249 let o = t.selectedModels; 53250 for (let i of Ke(o)) 53251 this.hideSelModelOverlay(i); 53252 this.setHoverPoint(null), 53253 this.setDragPoint(null), 53254 this.selector != null && (s.hideSelectorElement(this.selector), 53255 this.selector = null) 53256 } 53257 } 53258} 53259new rF; 53260const aF = { 53261 name: "StrokePaintingOptionsComponent", 53262 components: { 53263 HyCheckbox: ml, 53264 HyButton: nt, 53265 HyGroup: Dt, 53266 HyInputNumber: Lt 53267 }, 53268 data() { 53269 return { 53270 tool: null, 53271 toolOptions: null 53272 } 53273 }, 53274 methods: {}, 53275 watch: { 53276 toolOptions: { 53277 handler() { 53278 this.tool.updateRendering() 53279 }, 53280 deep: !0 53281 } 53282 } 53283}; 53284function dF(l, e, t, n, s, o) { 53285 const i = E("hy-button") 53286 , r = E("hy-input-number") 53287 , a = E("hy-group") 53288 , d = E("hy-checkbox"); 53289 return N(), 53290 $("div", null, [w(a, null, { 53291 default: O(()=>[e[8] || (e[8] = _("div", null, "tolerance", -1)), w(i, { 53292 onClick: e[0] || (e[0] = u=>s.toolOptions.tolerance++) 53293 }, { 53294 default: O(()=>[...e[6] || (e[6] = [ve("-", -1)])]), 53295 _: 1 53296 }), w(r, { 53297 size: "24", 53298 modelValue: s.toolOptions.tolerance, 53299 "onUpdate:modelValue": e[1] || (e[1] = u=>s.toolOptions.tolerance = u) 53300 }, null, 8, ["modelValue"]), w(i, { 53301 onClick: e[2] || (e[2] = u=>s.toolOptions.tolerance--) 53302 }, { 53303 default: O(()=>[...e[7] || (e[7] = [ve("+", -1)])]), 53304 _: 1 53305 })]), 53306 _: 1 53307 }), w(d, { 53308 name: "innerOutline", 53309 modelValue: s.toolOptions.showInnerOutline, 53310 "onUpdate:modelValue": e[3] || (e[3] = u=>s.toolOptions.showInnerOutline = u) 53311 }, {
53312 default: O(()=>[...e[9] || (e[9] = [ve("Show inner outline", -1)])]), 53313 _: 1 53314 }, 8, ["modelValue"]), w(d, { 53315 name: "outerOutline", 53316 modelValue: s.toolOptions.showOuterOutline, 53317 "onUpdate:modelValue": e[4] || (e[4] = u=>s.toolOptions.showOuterOutline = u) 53318 }, { 53319 default: O(()=>[...e[10] || (e[10] = [ve("Show outer outline", -1)])]), 53320 _: 1 53321 }, 8, ["modelValue"]), w(d, { 53322 name: "strokeTrace", 53323 modelValue: s.toolOptions.showStrokeTrace, 53324 "onUpdate:modelValue": e[5] || (e[5] = u=>s.toolOptions.showStrokeTrace = u) 53325 }, { 53326 default: O(()=>[...e[11] || (e[11] = [ve("Show stroke trace", -1)])]), 53327 _: 1 53328 }, 8, ["modelValue"])]) 53329} 53330const uF = ie(aF, [["render", dF]]); 53331class hF extends Li { 53332 toolbarOptionsComponent = uF; 53333 pathModel; 53334 pathStroke; 53335 pathEnd; 53336 toolOptions = { 53337 tolerance: 10, 53338 showOuterOutline: !0, 53339 showInnerOutline: !0, 53340 showStrokeTrace: !0 53341 }; 53342 constructor() { 53343 super("devStrokePainting") 53344 } 53345 setActive(e) { 53346 if (super.setActive(e), 53347 e) { 53348 let t = V() 53349 , n = z(); 53350 n.setModelsSelected(null, t.selectedModels); 53351 let s = t.activeDocument.getChildModels(); 53352 n.removeModels(s); 53353 let o = "M100,100,C150,150 200,200, 300,300"; 53354 o = "M660.6373915450133 526.2024638947852C560.0272178715552 526.2024638947852 835.313571934737 450.69785519176116 734.7033982612791 450.69785519176116 "; 53355 let i = Xl(o) 53356 , r = new bt(i) 53357 , a = new Qt; 53358 a.linecap = "butt", 53359 r.setStrokeStyle(a), 53360 r.setPaint(new et(new ce("rgb(255 0 0 / 0.2)")), "stroke"), 53361 r.setPaint(null, "fill"), 53362 r.getSinglePathModels()[0].getNodePointAt(1).setNodeType(yt), 53363 r.baseElement.setAttribute("stroke-width", 400), 53364 t.activeDocument.insertChildAt(r, 0), 53365 n.setModelsSelected([r], null), 53366 this.pathModel = r, 53367 this.pathEnd = this.createPathModel(null, "#ff0000", 3), 53368 this.pathOuterEnd = this.createPathModel(null, "cyan", 3), 53369 this.pathStroke = this.createPathModel(null, "grey", 3), 53370 this.pathStroke.baseElement.setAttribute("opacity", .2), 53371 this.pathOffset = this.createPathModel("rgba(128, 0, 255, 0.3)", "#8000ff", 3), 53372 this.pathOffset.baseElement.setAttribute("opacity", .7), 53373 this.updateRendering() 53374 } 53375 } 53376 onPathChanged(e) { 53377 this.updateRendering() 53378 } 53379 updateRendering() { 53380 let t = this.pathModel.getSinglePathModels()[0].getPath().getCurves()[0].v 53381 , n = 200; 53382 this.updateStrokeLinePath(this.toolOptions.showStrokeTrace ? t : null, n), 53383 this.updateStrokeCrease(t, n), 53384 this.updateOuterCurveEnd(t, n), 53385 this.updateOffsetStroke(t, n) 53386 } 53387 updateOffsetStroke(e, t) { 53388 let n = this.createOffsetPath(e, t) 53389 , s = jl([n]) 53390 , o = on(s); 53391 this.pathOffset.baseElement.setAttribute("d", o) 53392 } 53393 updateStrokeLinePath(e, t) { 53394 let n = 400 53395 , s = ""; 53396 if (e != null) 53397 for (let o = 0; o <= n; o++) { 53398 let i = o / n 53399 , r = ze(e, i) 53400 , a = Te(e, i, t) 53401 , d = r.addScalar(-a.y, a.x) 53402 , u = r.addScalar(a.y, -a.x); 53403 s += "M" + d.x + " " + d.y + "L" + u.x + " " + u.y 53404 } 53405 this.pathStroke.baseElement.setAttribute("d", s) 53406 } 53407 updateStrokeCrease(e, t) { 53408 let n = 300 53409 , s = [] 53410 , o = ""; 53411 for (let i = 0; i <= n; i++) { 53412 let r = i / n 53413 , a = Nl(e, r); 53414 if (Math.abs(a) < Math.abs(t)) { 53415 if (o === "") { 53416 let u = je(e, r, Math.sign(a) * Math.abs(t)); 53417 o += "M" + u.x + " " + u.y 53418 } 53419 let d = je(e, r, a); 53420 o += "L" + d.x + " " + d.y 53421 } 53422 if (o !== "" && (Math.abs(a) >= Math.abs(t) || r === 1)) { 53423 let d = je(e, r, Math.sign(a) * Math.abs(t)); 53424 o += "L" + d.x + " " + d.y, 53425 s.push(o), 53426 o = "" 53427 } 53428 } 53429 this.pathEnd.baseElement.setAttribute("d", s.join(" ")) 53430 } 53431 updateOuterCurveEnd(e, t) { 53432 let n = 800 53433 , s = [] 53434 , o = ""; 53435 for (let i = 0; i <= n; i++) { 53436 let r = i / n 53437 , a = ze(e, r) 53438 , d = Nl(e, r); 53439 if (Math.abs(d) < Math.abs(t)) { 53440 let u = Te(e, r, t * Math.sign(d)) 53441 , h = a.addScalar(u.y, -u.x); 53442 o += (o === "" ? "M" : "L") + h.x + " " + h.y 53443 } else 53444 o !== "" && (s.push(o), 53445 o = "") 53446 } 53447 s.push(o), 53448 this.pathOuterEnd.baseElement.setAttribute("d", s.join(" ")) 53449 } 53450 createOffsetPath(e, t) { 53451 let n = new Ns(t) 53452 , s = Rs(e, n) 53453 , o = Rs(No(e), n) 53454 , i = [] 53455 , r = this.getConnectedCurveOffsParts(s, t) 53456 , a = this.getConnectedCurveOffsParts(o, t); 53457 if (i.push(...r), 53458 r.length > 0 && a.length > 0) { 53459 let d = r.at(-1) 53460 , u = a.at(0); 53461 i.push([d[6], d[7], d[6], d[7], u[0], u[1], u[0], u[1]]) 53462 } 53463 if (i.push(...a), 53464 r.length > 0 && a.length > 0) { 53465 let d = a.at(-1) 53466 , u = r.at(0); 53467 i.push([d[6], d[7], d[6], d[7], u[0], u[1], u[0], u[1]]) 53468 } 53469 return this.fixContinuity(i, !0), 53470 new ft(i.map(d=>new Mt(d))) 53471 } 53472 getConnectedCurveOffsParts(e) { 53473 let t = [] 53474 , n = e.v 53475 , s = e.partOffsets; 53476 for (let o = 0; o < s.length; o++) { 53477 let i = s[o]; 53478 if (o === 0) { 53479 if (i.t0 > 0) { 53480 let r = i.vOffsetParts.at(0); 53481 t.push(...this.getCreaseCurves(n, 0, i.t0, null, new B(r[0],r[1]))) 53482 } 53483 } else { 53484 let r = s[o - 1] 53485 , a = r.vOffsetParts.at(-1) 53486 , d = i.vOffsetParts.at(0); 53487 t.push(...this.getCreaseCurves(n, r.t1, i.t0, new B(a[6],a[7]), new B(d[0],d[1]))) 53488 } 53489 if (t.push(...i.vOffsetParts), 53490 o === s.length - 1 && i.t1 < 1) { 53491 let r = i.vOffsetParts.at(-1); 53492 t.push(...this.getCreaseCurves(n, i.t1, 1, new B(r[6],r[7]), null)) 53493 } 53494 } 53495 return t 53496 } 53497 getConnectedCurveOffsParts_new(e, t) { 53498 let n = [] 53499 , s = e.v 53500 , o = e.partOffsets; 53501 for (let i = 0; i < o.length; i++) { 53502 let r = o[i]; 53503 if (i === 0) { 53504 if (r.t0 > 0) { 53505 let a = je(s, 0, t) 53506 , d = je(s, r.t0 / 2, t * .99) 53507 , u = r.vOffsetParts.at(0); 53508 n.push(...this.getCreaseCurves_new(s, 0, r.t0, a, null, t)), 53509 n.push([a.x, a.y, a.x, a.y, d.x, d.y, d.x, d.y]), 53510 n.push([d.x, d.y, d.x, d.y, u[0], u[1], u[0], u[1]]) 53511 } 53512 } else { 53513 let a = o[i - 1] 53514 , d = a.vOffsetParts.at(-1) 53515 , u = je(s, (a.t1 + r.t0) / 2, t * .99) 53516 , h = r.vOffsetParts.at(0); 53517 n.push(...this.getCreaseCurves_new(s, a.t1, r.t0, new B(d[6],d[7]), null, t)), 53518 n.push([d[6], d[7], d[6], d[7], u.x, u.y, u.x, u.y]), 53519 n.push([u.x, u.y, u.x, u.y, h[0], h[1], h[0], h[1]]) 53520 } 53521 if (n.push(...r.vOffsetParts), 53522 i === o.length - 1 && r.t1 < 1) { 53523 let a = r.vOffsetParts.at(-1) 53524 , d = je(s, (r.t1 + 1) / 2, t * .99) 53525 , u = je(s, 1, t); 53526 n.push(...this.getCreaseCurves_new(s, r.t1, 1, new B(a[6],a[7]), u, t)), 53527 n.push([a[6], a[7], a[6], a[7], d.x, d.y, d.x, d.y]), 53528 n.push([d.x, d.y, d.x, d.y, u.x, u.y, u.x, u.y]) 53529 } 53530 } 53531 return n 53532 } 53533 getCreaseCurves(e, t, n, s, o) { 53534 let i = [] 53535 , r = Or(e).filter(u=>u >= t && u <= n); 53536 r.at(0) !== t && r.unshift(t), 53537 r.at(-1) !== n && r.push(n), 53538 s = s || je(e, t, Nl(e, t)), 53539 o = o || je(e, n, Nl(e, n)); 53540 let a = s 53541 , d = t; 53542 for (let u = 1; u < r.length; u++) { 53543 let h = a 53544 , c = d; 53545 d = r[u], 53546 a = u === r.length - 1 ? o : je(e, d, Nl(e, d)); 53547 let f = (d + c) / 2 53548 , p = je(e, f, Nl(e, f)); 53549 i.push(cp(h, p, a)) 53550 } 53551 return i 53552 } 53553 getCreaseCurves_new(e, t, n, s, o, i) { 53554 let r = [] 53555 , a = Or(e).filter(m=>m >= t && m <= n); 53556 a.at(0) !== t && a.unshift(t), 53557 a.at(-1) !== n && a.push(n); 53558 let d = (t + n) / 2 53559 , u = s || je(e, t, i) 53560 , h = o || je(e, n, i) 53561 , c = je(e, d, i) 53562 , f = Te(e, t).multiplyScalar(-1) 53563 , p = Te(e, n).multiplyScalar(-1); 53564 s = s || je(e, t, Nl(e, t)), 53565 o = o || je(e, n, Nl(e, n)); 53566 let g = s 53567 , y = t; 53568 for (let m = 1; m < a.length; m++) { 53569 let b = g 53570 , M = y; 53571 y = a[m], 53572 g = m === a.length - 1 ? o : je(e, y, Nl(e, y)); 53573 let S = je(e, (y + M) / 2, Nl(e, (y + M) / 2)); 53574 r.push(cp(b, S, g)) 53575 } 53576 return h.equals(o) || r.push([o.x, o.y, o.x, o.y, h.x, h.y, h.x, h.y]),
53577 r.push(cF(h, p, u, f, c, .5)), 53578 u.equals(s) || r.push([u.x, u.y, u.x, u.y, s.x, s.y, s.x, s.y]), 53579 r 53580 } 53581 getOffsetTangent(e, t) { 53582 let[n,s,o,i,r,a] = It(e, 1) 53583 , d = (n * t + o) * t + r 53584 , u = (s * t + i) * t + a 53585 , h = 2 * n * t + o 53586 , c = 2 * s * t + i 53587 , f = 2 * n 53588 , p = 2 * s 53589 , g = d ** 2 + u ** 2 53590 , y = 2 * (d * h + u * c) 53591 , m = d * c - u * h 53592 , b = d * p - u * f 53593 , M = d - (c * g * m + u * (m * y - g * b)) / m ** 2 53594 , S = u + (h * g * m + d * (m * y - g * b)) / m ** 2; 53595 return new B(M,S) 53596 } 53597 fixContinuity(e, t) { 53598 let n = e.at(t ? -1 : 0); 53599 for (let s = t ? 0 : 1; s < e.length; s++) { 53600 let o = n; 53601 if (n = e[s], 53602 o[6] !== n[0] || o[7] !== n[1]) { 53603 console.log("Not continuous", o, n); 53604 let i = n[0] - o[6] 53605 , r = n[1] - o[7]; 53606 o[6] = n[0], 53607 o[7] = n[1], 53608 o[4] += i, 53609 o[5] += r 53610 } 53611 } 53612 } 53613} 53614function cF(l, e, t, n, s, o) { 53615 let i = o * o 53616 , r = i * o 53617 , a = 1 - o 53618 , d = a * a 53619 , u = d * a 53620 , h = s.x 53621 , c = s.y 53622 , f = l.x 53623 , p = l.y 53624 , g = t.x 53625 , y = t.y 53626 , m = e.x / e.y 53627 , b = n.x / n.y; 53628 if (e.y === 0 || n.y === 0 || b === m) 53629 return [l.x, l.y, l.x + e.x, l.y + e.y, t.x - n.x, t.y - n.y, t.x, t.y]; 53630 let M = (h - b * c - (u + 3 * d * o) * f + (3 * d * o * m + b * u) * p - (3 * a * i + r) * g + b * y * (3 * a * i + r)) / (3 * d * o * (m - b)) 53631 , S = f + m * (M - p) 53632 , x = (c - u * p - 3 * d * o * M - r * y) / (3 * a * i) 53633 , P = g + b * (x - y); 53634 return [f, p, S, M, P, x, g, y] 53635} 53636new hF; 53637const fF = { 53638 name: "CurveMergeOptionsComponent", 53639 components: { 53640 HyButton: nt, 53641 HyGroup: Dt, 53642 HyInputNumber: Lt 53643 }, 53644 data() { 53645 return { 53646 tool: null, 53647 toolOptions: null 53648 } 53649 }, 53650 methods: {} 53651}; 53652function pF(l, e, t, n, s, o) { 53653 const i = E("hy-button") 53654 , r = E("hy-input-number") 53655 , a = E("hy-group"); 53656 return N(), 53657 $("div", null, [w(a, null, { 53658 default: O(()=>[e[5] || (e[5] = _("div", null, "tolerance", -1)), w(i, { 53659 onClick: e[0] || (e[0] = d=>s.toolOptions.tolerance--) 53660 }, { 53661 default: O(()=>[...e[3] || (e[3] = [ve("-", -1)])]), 53662 _: 1 53663 }), w(r, { 53664 size: "24", 53665 modelValue: s.toolOptions.tolerance, 53666 "onUpdate:modelValue": e[1] || (e[1] = d=>s.toolOptions.tolerance = d) 53667 }, null, 8, ["modelValue"]), w(i, { 53668 onClick: e[2] || (e[2] = d=>s.toolOptions.tolerance++) 53669 }, { 53670 default: O(()=>[...e[4] || (e[4] = [ve("+", -1)])]), 53671 _: 1 53672 })]), 53673 _: 1 53674 })]) 53675} 53676const gF = ie(fF, [["render", pF]]); 53677function mF(l) { 53678 return l.map(e=>e.slice()) 53679} 53680function yF(l) { 53681 return [...Array(l)].map((e,t)=>new Array(l).fill(0).fill(1, t, t + 1)) 53682} 53683function vF(l) { 53684 let e = l.length 53685 , t = l[0].length 53686 , n = mF(l) 53687 , s = yF(e); 53688 for (let o = 0; o < t; o++) { 53689 let i = -1 53690 , r = -1; 53691 for (let h = o; h < e; h++) { 53692 let c = Math.abs(n[h][o]); 53693 c > r && (i = h, 53694 r = c) 53695 } 53696 let a = n[i]; 53697 n[i] = n[o], 53698 n[o] = a; 53699 let d = s[i]; 53700 s[i] = s[o], 53701 s[o] = d; 53702 let u = a[o]; 53703 for (let h = o; h < t; h++) 53704 a[h] /= u; 53705 for (let h = 0; h < t; h++) 53706 d[h] /= u; 53707 for (let h = 0; h < e; h++) 53708 if (h !== o) { 53709 let c = n[h] 53710 , f = c[o]; 53711 for (let g = o + 1; g < t; g++) 53712 c[g] -= a[g] * f; 53713 let p = s[h]; 53714 for (let g = 0; g < t; g++) 53715 p[g] -= d[g] * f 53716 } 53717 } 53718 return s 53719} 53720function Fg(l, e) { 53721 let t = l.length 53722 , n = e.length 53723 , s = e[0].length 53724 , o = Array(t); 53725 for (let i = 0; i < t; i++) { 53726 let r = l[i] 53727 , a = Array(s); 53728 for (let d = 0; d < s; d++) { 53729 let u = 0; 53730 for (let h = 0; h < n; h++) 53731 u += r[h] * e[h][d]; 53732 a[d] = u 53733 } 53734 o[i] = a 53735 } 53736 return o 53737} 53738function bF(l, e) { 53739 return l.map(t=>MF(t, e)) 53740} 53741function MF(l, e) { 53742 return l.reduce((t,n,s)=>t + n * e[s], 0) 53743} 53744function Bg(l) { 53745 return l.map((e,t)=>l.map(n=>n[t])) 53746} 53747function SF(l) { 53748 return Math.round(l * 1e10) / 1e10 53749} 53750function zg(l, e) { 53751 const [t,n,s,o,i,r,a,d] = l 53752 , [u,h,c,f,p,g,y,m] = e 53753 , b = [[t, n, 1, 0, 0, 0, -t * u, -n * u], [0, 0, 0, t, n, 1, -t * h, -n * h], [s, o, 1, 0, 0, 0, -s * c, -o * c], [0, 0, 0, s, o, 1, -s * f, -o * f], [i, r, 1, 0, 0, 0, -i * p, -r * p], [0, 0, 0, i, r, 1, -i * g, -r * g], [a, d, 1, 0, 0, 0, -a * y, -d * y], [0, 0, 0, a, d, 1, -a * m, -d * m]] 53754 , M = e; 53755 let S; 53756 try { 53757 S = vF(Fg(Bg(b), b)) 53758 } catch (C) { 53759 return console.log(C), 53760 [1, 0, 0, 0, 1, 0, 0, 0] 53761 } 53762 const x = Fg(S, Bg(b)) 53763 , P = bF(x, M); 53764 for (let C = 0; C < P.length; C++) 53765 P[C] = SF(P[C]); 53766 return P[8] = 1, 53767 P 53768} 53769class wF { 53770 coeffs; 53771 coeffsInv; 53772 constructor(e, t) { 53773 this.coeffs = zg(e, t), 53774 this.coeffsInv = zg(t, e) 53775 } 53776 transform(e, t) { 53777 return this._transform(e, t, this.coeffs) 53778 } 53779 transformInverse(e, t) { 53780 return this._transform(e, t, this.coeffsInv) 53781 } 53782 _transform(e, t, n) { 53783 let s = n[6] * e + n[7] * t + 1; 53784 return [(n[0] * e + n[1] * t + n[2]) / s, (n[3] * e + n[4] * t + n[5]) / s] 53785 } 53786} 53787class PF extends Li { 53788 toolbarOptionsComponent = gF; 53789 paths = []; 53790 toolOptions = { 53791 tolerance: 10 53792 }; 53793 constructor() { 53794 super("devPerspective") 53795 } 53796 setActive(e) { 53797 if (super.setActive(e), 53798 e) { 53799 let t = V() 53800 , n = z(); 53801 n.setModelsSelected(null, t.selectedModels); 53802 let s = t.activeDocument.getChildModels(); 53803 n.removeModels(s); 53804 let o = "M768,416c-7.76,31.04 0,64 64,64c53.02,0 96,42.98 96,96c0,53.02 -42.99,96 -96,96c-32,0 -64,-32 -96,-32c-71.55,0 -83.74,93.97 -32,128c37.16,24.44 64,49.75 64,96c0,53.02 -42.98,96 -96,96c-53.02,0 -96,-42.98 -96,-96c0,-128 -160,-192 -192,-128c-16.33,32.67 0,35.05 0,64c0,53.02 -42.98,96 -96,96c-53.02,0 -96,-42.98 -96,-96c0,-128 253.61,-190.84 157.91,-256.03c-93.91,-63.97 -61.91,-95.97 2.09,-159.97c50.59,-50.59 -18.98,-103.55 -64,-103.55c-53.01,0 -96,-35.43 -96,-88.45c0,-53.02 42.98,-96 96,-96c53.02,0 96,42.98 96,96c0,128 160,96 149.34,15.71c-2.31,-17.41 -21.34,-28.75 -21.34,-47.71c0,-35.35 28.66,-64 64,-64c35.35,0 64,28.65 64,64c0,45.93 -77.25,160 -32,160c96,0 192,-32 160,96zM160,384c53.02,0 96,42.98 96,96c0,53.02 -42.98,96 -96,96c-53.02,0 -96,-42.98 -96,-96c0,-53.02 42.98,-96 96,-96zM848,160c44.18,0 80,35.82 80,80c0,44.18 -35.82,80 -80,80c-44.18,0 -80,-35.82 -80,-80c0,-44.18 35.82,-80 80,-80z" 53805 , i = Xl(o); 53806 this.pathsOriginal = Xl(o); 53807 let r = new bt(i); 53808 r.setPaint(new et(new ce("red")), "stroke"), 53809 r.setPaint(new et(new ce("rgb(255 0 0 / 0.3)")), "fill"), 53810 this.pathModel2 = r, 53811 t.activeDocument.insertChildAt(r, 0); 53812 let a = r.getBounds() 53813 , d = "M" + a.x + " " + a.y + "h" + a.width + "v" + a.height + "h-" + a.width + "z" 53814 , u = Xl(d) 53815 , h = new bt(u); 53816 h.setPaint(new et(new ce("blue")), "stroke"), 53817 h.setPaint(null, "fill"), 53818 this.pathModel = h, 53819 this.coords = [a.x, a.y, a.x + a.width, a.y, a.x + a.width, a.y + a.height, a.x, a.y + a.height], 53820 t.activeDocument.insertChildAt(h, 0), 53821 n.setModelsSelected([h], null) 53822 } 53823 } 53824 onPathChanged(e) { 53825 let t = e.getSinglePathModels()[0].getNodePoints() 53826 , n = []; 53827 t.forEach(i=>
53827n.push(i.x, i.y)); 53828 let s = new wF(this.coords,n) 53829 , o = this.pathsOriginal.map(i=>i.clone()); 53830 o.forEach(i=>{ 53831 i.getCurves().forEach(r=>{ 53832 let a = r.v; 53833 for (let d = 0; d < 8; d += 2) { 53834 let u = s.transform(a[d], a[d + 1]); 53835 a.splice(d, 2, ...u) 53836 } 53837 } 53838 ) 53839 } 53840 ), 53841 this.pathModel2.setPaths(o) 53842 } 53843 moveNodePoints(e, t, n, s) { 53844 let i = this.pathModel.getSinglePathModels()[0].getNodePoints() 53845 , r = i.indexOf(e[0]) 53846 , a = i.map(b=>new B(b.x,b.y)) 53847 , d = a[r] 53848 , u = d.addScalar(t, n) 53849 , h = a.at(r - 2) 53850 , c = a.at(r - 1) 53851 , f = a.at(r - 3); 53852 sf(c.x, c.y, f.x, f.y, u.x, u.y) === -1 && (u = Jt(c.x, c.y, f.x, f.y, u.x, u.y, !0)); 53853 let g = Tl(c, c.subtract(h), u, f.subtract(c)) || c 53854 , y = Tl(f, f.subtract(h), u, f.subtract(c)) || f 53855 , m = ds(g.x, g.y, y.x, y.y, u.x, u.y, !0); 53856 m < 0 ? u = g : m > 1 && (u = y), 53857 super.moveNodePoints(e, u.x - d.x, u.y - d.y, s) 53858 } 53859} 53860new PF; 53861const xF = { 53862 name: "CurveToArcsOptionsComponent", 53863 components: {}, 53864 data() { 53865 return { 53866 tool: null, 53867 toolOptions: null 53868 } 53869 }, 53870 methods: {} 53871}; 53872function CF(l, e, t, n, s, o) { 53873 return N(), 53874 $("div", null, [...e[0] || (e[0] = [_("span", null, "Curve To Arcs", -1)])]) 53875} 53876const _F = ie(xF, [["render", CF]]); 53877function TF(l, e=1) { 53878 let t = [], n = [], s = 0, o; 53879 for (let i = 0; i <= n.length; i++) { 53880 let r = i < n.length ? n[i] : 1; 53881 o = r; 53882 do { 53883 let a = s === 0 && o === 1 ? l : Ln(l, s, o); 53884 if (!Pl(a)) { 53885 let d = kF(a) 53886 , u = d[0] 53887 , h = d[1] 53888 , c = dn(a, u.tm); 53889 if (Hg(c[0], u.cx, u.cy, u.r)[0] <= e && Hg(c[1], h.cx, h.cy, h.r)[0] <= e ? (t.push(u, h), 53890 s = o, 53891 o = r) : o = (s + o) / 2, 53892 t.length >= 100) 53893 break 53894 } 53895 } while (s < r) 53896 } 53897 return t 53898} 53899class Ug { 53900 x0; 53901 y0; 53902 x1; 53903 y1; 53904 cx; 53905 cy; 53906 r; 53907 t0; 53908 t1; 53909 constructor(e, t, n, s, o, i, r, a, d) { 53910 this.x0 = e, 53911 this.y0 = t, 53912 this.x1 = n, 53913 this.y1 = s, 53914 this.cx = o, 53915 this.cy = i, 53916 this.r = r, 53917 this.t0 = a, 53918 this.t1 = d 53919 } 53920 toCurveVals() { 53921 let e = this.x0 53922 , t = this.y0 53923 , n = this.x1 53924 , s = this.y1 53925 , o = this.cx 53926 , i = this.cy 53927 , r = sf(e, t, n, s, o, i) 53928 , a = new B(t - i,o - e).setLength(r > 0 ? 1 : -1); 53929 return EF(e, t, n, s, a, o, i) 53930 } 53931 getArcLength() { 53932 let e = this.r 53933 , t = (this.x1 - this.x0) ** 2 + (this.y1 - this.y0) ** 2; 53934 return e === 0 ? 0 : e * Math.acos(1 - Math.min(1, Math.max(-1, t / (2 * e ** 2)))) 53935 } 53936} 53937function kF(l) { 53938 let e = l[0] 53939 , t = l[1] 53940 , n = l[6] 53941 , s = l[7] 53942 , o = new B(e - n,t - s) 53943 , i = Te(l, 0, 1) 53944 , r = Te(l, 1, 1) 53945 , a = 1 53946 , d = 2 * a * (i.dot(r) - 1) 53947 , u = 2 * o.dot(i.multiplyScalar(a).add(r, !0)) 53948 , h = o.dot(o) 53949 , c = []; 53950 if (Hs(d, u, h, c), 53951 c.at(-1) > 0) { 53952 let f = c.at(-1) 53953 , p = a * f 53954 , g = e + i.x * p 53955 , y = t + i.y * p 53956 , m = n - r.x * f 53957 , b = s - r.y * f 53958 , M = f / (p + f) * g + p / (p + f) * m 53959 , S = f / (p + f) * y + p / (p + f) * b 53960 , x = jr(l, new B(M,S)) 53961 , P = Gg(e, t, M, S, i.x, i.y) 53962 , C = Gg(n, s, M, S, r.x, r.y) 53963 , T = Math.hypot(e - P.x, t - P.y) 53964 , k = Math.hypot(n - C.x, s - C.y); 53965 return [new Ug(e,t,M,S,P.x,P.y,T,0,x), new Ug(M,S,n,s,C.x,C.y,k,x,1)] 53966 } else 53967 return null 53968} 53969function EF(l, e, t, n, s, o, i) { 53970 let r = Math.hypot(o - l, i - e), a = sf(l, e, s.x, s.y, o, i, !0) === 1 ? new B(-(i - n) / r,(o - t) / r) : new B((i - n) / r,-(o - t) / r), d = Math.hypot(t - l, n - e), u; 53971 if (d / r < 1e-4) 53972 u = d / 3; 53973 else { 53974 let h = Math.acos(Math.min(1, Math.max(-1, s.dot(a)))); 53975 u = 4 / 3 * r * Math.tan(h / 4) 53976 } 53977 return [l, e, l + s.x * u, e + s.y * u, t - a.x * u, n - a.y * u, t, n] 53978} 53979function Gg(l, e, t, n, s, o) { 53980 let i = t - l 53981 , r = n - e; 53982 if (Math.min(Math.abs(o), Math.abs(i)) > Math.min(Math.abs(s), Math.abs(r))) { 53983 let a = s / o 53984 , d = r / i 53985 , u = (d * (2 * a * l - r) - l - t) / (2 * a * d - 2) 53986 , h = (l - u) * a + e; 53987 return new B(u,h) 53988 } else { 53989 let a = o / s 53990 , d = i / r 53991 , u = (d * (2 * a * e - i) - e - n) / (2 * a * d - 2) 53992 , h = (e - u) * a + l; 53993 return new B(h,u) 53994 } 53995} 53996function Hg(l, e, t, n) { 53997 let s = new B(e,t) 53998 , o = ze(l, 0) 53999 , i = ze(l, 1) 54000 , r = Te(l, 0, 1) 54001 , a = Te(l, 1, 1); 54002 if (Ae(l)) 54003 return [0, .5]; 54004 let d = r.getAngleTo(a, !1, !0); 54005 if (isNaN(d) || Math.abs(d) < 1e-6 || Math.abs(Math.PI / 2 - Math.abs(d)) < 1e-6) 54006 return [0, .5]; 54007 let u = o.distSquared(s), h = i.distSquared(s), c, f, p, g; 54008 u < h ? (c = u, 54009 f = 0, 54010 p = h, 54011 g = 1) : (c = h, 54012 f = 1, 54013 p = u, 54014 g = 0); 54015 let[y,m,b,M,S,x,P,C] = It(l, 0); 54016 P -= e, 54017 C -= t; 54018 let T = [S * P + x * C, 2 * (b * P + M * C) + S ** 2 + x ** 2, 3 * (y * P + b * S + m * C + M * x), 4 * (y * S + m * x) + 2 * (b ** 2 + M ** 2), 5 * (y * b + m * M), 3 * (y ** 2 + m ** 2)] 54019 , k = Jd(T) 54020 , D = qr(k); 54021 for (let Y of D) { 54022 let q = Y[0] 54023 , ne = ze(l, q).distSquared(s); 54024 ne > p ? (p = ne, 54025 g = q) : ne < c && (c = ne, 54026 f = q) 54027 } 54028 let I = Math.abs(n - Math.sqrt(c)) 54029 , F = Math.abs(n - Math.sqrt(p)); 54030 return I > F ? [I, f] : [F, g] 54031} 54032class DF extends Li { 54033 toolbarOptionsComponent = _F; 54034 path2a; 54035 path2b; 54036 toolOptions = {}; 54037 constructor() { 54038 super("devCurveToArcs") 54039 } 54040 setActive(e) { 54041 if (super.setActive(e), 54042 e) { 54043 let t = V() 54044 , n = z(); 54045 n.setModelsSelected(null, t.selectedModels); 54046 let s = t.activeDocument.getChildModels(); 54047 n.removeModels(s); 54048 let i = Xl("M100,100,C150,150 200,200, 300,300") 54049 , r = new bt(i); 54050 r.setPaint(null, "fill"), 54051 t.activeDocument.insertChildAt(r, 0), 54052 n.setModelsSelected([r], null), 54053 this.path2a = this.createPathModel(null, "magenta", 2), 54054 this.path2b = this.createPathModel(null, "cyan", 2) 54055 } 54056 } 54057 onPathChanged(e) { 54058 let t = e.getSinglePathModels()[0].getCurve(0).v 54059 , s = uf(t).slice() 54060 , o = Or(t); 54061 s.push(...o), 54062 s = s.sort((a,d)=>a - d); 54063 let i = 0 54064 , r = s.map(a=>{ 54065 let d = Ln(t, i, a); 54066 return i = a, 54067 d 54068 } 54069 ); 54070 i < 1 && r.push(Ln(t, i, 1)); 54071 for (let a of r) { 54072 let d = TF(a, .1), u; 54073 console.log("------"); 54074 for (let h of d) { 54075 let c = h.r; 54076 u != null && console.log(c > u), 54077 u = c 54078 } 54079 } 54080 } 54081} 54082new DF; 54083const OF = { 54084 name: "LongshadowOptionsComponent", 54085 components: { 54086 HyButton: nt, 54087 HyGroup: Dt, 54088 HyInputNumber: Lt 54089 }, 54090 data() { 54091 return { 54092 tool: null, 54093 toolOptions: null 54094 } 54095 }, 54096 methods: {} 54097}; 54098function AF(l, e, t, n, s, o) { 54099 const i = E("hy-button") 54100 , r = E("hy-input-number") 54101 , a = E("hy-group"); 54102 return N(), 54103 $("div", null, [w(a, null, { 54104 default: O(()=>[w(i, { 54105 onClick: e[0] || (e[0] = d=>s.toolOptions.distance++) 54106 }, { 54107 default: O(()=>[...e[3] || (e[3] = [ve("-", -1)])]), 54108 _: 1 54109 }), w(r, { 54110 size: "24", 54111 modelValue: s.toolOptions.distance, 54112 "onUpdate:modelValue": e[1] || (e[1] = d=>s.toolOptions.distance = d) 54113 }, null, 8, ["modelValue"]), w(i, { 54114 onClick: e[2] || (e[2] = d=>s.toolOptions.distance--) 54115 }, { 54116 default: O(()=>[...e[4] || (e[4] = [ve("+", -1)])]), 54117 _: 1 54118 })]), 54119 _: 1 54120 })]) 54121}
54122const IF = ie(OF, [["render", AF]]); 54123function LF(l, e, t) { 54124 let n; 54125 t.forEach(a=>{ 54126 let d = a.getBoundsCoords() 54127 , u = new Ve(d[0],d[1],d[2] - d[0],d[3] - d[1]); 54128 n = n ? n.addRect(u) : u 54129 } 54130 ); 54131 let s = new oe().rotate(-l, n.getXCenter(), n.getYCenter()); 54132 t.forEach(a=>{ 54133 a.applyTransform(s) 54134 } 54135 ); 54136 let o = []; 54137 t.forEach(a=>o.push(...VF(a, e))); 54138 let i = jl(o, null) 54139 , r = new oe().rotate(l, n.getXCenter(), n.getYCenter()); 54140 return i.forEach(a=>{ 54141 a.applyTransform(r) 54142 } 54143 ), 54144 i 54145} 54146function VF(l, e) { 54147 let t = Math.abs(e) 54148 , n = l.getCurves().map(u=>u.v) 54149 , s = Nw(n, 1); 54150 if ((s ? s.length : 0) === 0) 54151 return null; 54152 e < 0 && (s.forEach(u=>No(u)), 54153 s.reverse(), 54154 e = -e); 54155 let i = -1 54156 , r = -Number.MAX_VALUE; 54157 s.forEach((u,h)=>{ 54158 let c = u[1]; 54159 (c <= r || c === r && u[0] < s[i][0]) && (i = h, 54160 r = c) 54161 } 54162 ), 54163 s.unshift(...s.splice(i)); 54164 let a = [] 54165 , d = []; 54166 for (let u of s) { 54167 let h = 1e-12 54168 , c = u[0] 54169 , f = u[1] 54170 , p = u[6] 54171 , g = u[7]; 54172 if (!(Math.hypot(p - c, g - f) < h)) { 54173 if (f - g < h || f - g <= -h && Math.abs(p - c) < t) 54174 d.push(u); 54175 else if (d.length > 0) { 54176 let y = $g(d, e, 0); 54177 y && a.push(y), 54178 d = [] 54179 } 54180 } 54181 } 54182 if (d.length > 0) { 54183 let u = $g(d, e, 0); 54184 u && a.push(u) 54185 } 54186 return a 54187} 54188function $g(l, e, t=0) { 54189 let n = l.length; 54190 if (Math.abs(l[0][1 - t] - l[n - 1][7 - t]) > .001) { 54191 let s = l.map(u=>(u = No(u), 54192 u[t] += e, 54193 u[t + 2] += e, 54194 u[t + 4] += e, 54195 u[t + 6] += e, 54196 u)).reverse() 54197 , o = l.at(0) 54198 , i = l.at(-1) 54199 , r = s.at(0) 54200 , a = s.at(-1) 54201 , d = []; 54202 return d.push(...l), 54203 d.push([i[6], i[7], i[6], i[7], r[0], r[1], r[0], r[1]]), 54204 d.push(...s), 54205 d.push([a[6], a[7], a[6], a[7], o[0], o[1], o[0], o[1]]), 54206 new ft(d.map(u=>new Mt(u)),!0) 54207 } 54208} 54209class NF extends yl { 54210 downPos; 54211 pathModel; 54212 longshadowPathModel; 54213 relPosition = 0; 54214 curveLocation; 54215 toolOptions = { 54216 distance: 0, 54217 steps: 0, 54218 joinType: "round", 54219 closeHoles: !1 54220 }; 54221 toolbarOptionsComponent = IF; 54222 constructor() { 54223 super("devLongshadow") 54224 } 54225 setActive(e) { 54226 e ? (this.updatePathModel(), 54227 this.setCursor(!1, "default")) : this.pathModel && (j().removeModelOverlay(this.pathModel), 54228 this.pathModel = null) 54229 } 54230 updatePathModel() { 54231 this.pathModel != null && j().removeModelOverlay(this.pathModel); 54232 let t = V().selectedModels.slice(), n = Ke(t.slice().reverse()).reverse(), s; 54233 if (n.length >= 1 || n.length === 1 && (t.length > 1 || t[0].type === "group")) { 54234 let o = n[0] 54235 , i = o.getPaths(o.getAggregateTransform(), -1, !0) 54236 , r = o.isPath() ? o.getFillRule() : "evenodd"; 54237 i = jl(i, null, r); 54238 for (let a = 1; a < n.length; a++) { 54239 o = n[a]; 54240 let d = o.getAggregateTransform() 54241 , u = o.getPaths(d, -1, !0); 54242 r = o.isPath() ? o.getFillRule() : "evenodd", 54243 i = jl(i, u, "evenodd", r) 54244 } 54245 s = new bt(i) 54246 } 54247 this.pathModel = s, 54248 j().showModelOverlay(s) 54249 } 54250 handlePointerClickEvent(e, t, n, s) { 54251 if (this.curveLocation == null) { 54252 let o = e.shiftKey 54253 , i = this.getModelForElement(e.target2) 54254 , r = V() 54255 , a = z(); 54256 if (i != null) { 54257 if (!e.ctrlKey) 54258 for (; i.getParentModel().getType() === "group"; ) { 54259 let d = i.getParentModel(); 54260 if (a.isModelSelected(i) && !a.isModelSelected(d)) 54261 break; 54262 i = d 54263 } 54264 if (a.isModelSelected(i) ? o ? a.setModelsSelected(null, [i]) : a.setModelsSelected([i], r.selectedModels) : (o ? a.setModelsSelected([i], null) : a.setModelsSelected([i], r.selectedModels), 54265 super.updateDragInfo(t, n, !0), 54266 super.updateCursor(Fl)), 54267 s) { 54268 let d = V(); 54269 d.setTool("selection"), 54270 d.tool.handlePointerClickEvent(e, t, n, !1) 54271 } 54272 } 54273 } 54274 } 54275 updateCurveLocation(e, t) { 54276 let n = z()
54277 , o = V().appSettings.editor.pointTolerance * 100 / this.getZoom(); 54278 this.curveLocation = this.pathModel ? n.getCurveLocationAt([this.pathModel], e, t, o) : null 54279 } 54280 handlePointerDownEvent(e, t, n) { 54281 super.handlePointerDownEvent(e, t, n), 54282 this.updateCurveLocation(t, n) 54283 } 54284 async handlePointerMoveEvent(e, t, n) { 54285 if (e.buttons === 0) 54286 this.updateCurveLocation(t, n); 54287 else if (this.curveLocation) { 54288 let s = this.curveLocation.p 54289 , o = this.curveLocation.t 54290 , i = this.curveLocation.singlePathModel.getPath() 54291 , r = this.curveLocation.curveIndex; 54292 Te(i.getCurve(r).v, o); 54293 let a = new B(t,n).dist(s); 54294 this.toolOptions.distance = a; 54295 let d = this.longshadowPathModel; 54296 d == null && (d = new bt, 54297 d.setFillPaint(new et(new ce("green"))), 54298 this.longshadowPathModel = d); 54299 let u = Math.sign(a); 54300 if (u !== this.relPosition) { 54301 let y = V(); 54302 if (z(), 54303 d.remove(), 54304 u < 0) { 54305 let m = y.selectedModels[0] 54306 , b = m.getParentModel(); 54307 b.insertChildAt(d, b.getChildModelIndex(m) + 1) 54308 } else if (u > 0) { 54309 let m = y.selectedModels[y.selectedModels.length - 1] 54310 , b = m.getParentModel(); 54311 b.insertChildAt(d, b.getChildModelIndex(m)) 54312 } 54313 this.relPosition = u 54314 } 54315 let h = this.curveLocation.pathModel 54316 , c = new B(t,n).subtract(this.curveLocation.p).getAngle(); 54317 console.log(c * 180 / Math.PI); 54318 let f = performance.now() 54319 , p = h.getPaths(null, -1, !0) 54320 , g = LF(c, a, p); 54321 console.log(performance.now() - f + "ms"), 54322 d.setPaths(g), 54323 d.setSelfTransform(d.getParentModel().getAggregateTransform().invert()) 54324 } 54325 } 54326 endOffset() { 54327 let e = this.longshadowPathModel; 54328 if (e) { 54329 if (this.toolOptions.distance === 0) 54330 e.remove(); 54331 else { 54332 let t = V() 54333 , n = z() 54334 , s = e.getParentModel() 54335 , o = s.getChildModelIndex(e); 54336 e.remove(), 54337 n.insertModelAt(e, s, o), 54338 n.setModelsSelected([e], t.selectedModels) 54339 } 54340 this.relPosition = 0, 54341 this.longshadowPathModel = null 54342 } 54343 } 54344 handlePointerUpEvent(e, t, n) { 54345 super.handlePointerUpEvent(e, t, n), 54346 this.endOffset() 54347 } 54348 onSelectionGeometryChanged() { 54349 this.updatePathModel() 54350 } 54351 onModelSelectionChanged(e, t) { 54352 this.updatePathModel() 54353 } 54354} 54355new NF; 54356const RF = { 54357 name: "HittestOptionsComponent", 54358 data() { 54359 return { 54360 tool: null, 54361 toolOptions: null 54362 } 54363 } 54364}; 54365function FF(l, e, t, n, s, o) { 54366 return N(), 54367 $("div") 54368} 54369const BF = ie(RF, [["render", FF]]); 54370function zF(l, e) { 54371 if (e.getFillPaint?.() == null) 54372 return !1; 54373 let t = e.getFillRule(); 54374 l = l.clone(), 54375 e.getAggregateTransform().invert().transformXY(l); 54376 let n = e.getPaths(null, 0, !0) 54377 , s = 0; 54378 for (let o of n) 54379 s += UF(o._curves, l.x, l.y); 54380 return t === "nonzero" ? s !== 0 : s % 2 !== 0 54381} 54382function UF(l, e, t) { 54383 let n = 0; 54384 for (let s of l) { 54385 let o = s.v 54386 , [i,r,a,d,u,h,c,f] = o; 54387 if (!(r > t && f > t && d > t && h > t || r < t && f < t && d < t && h < t || i > e && c > e && a > e && u > e)) 54388 if (i < e && a < e && u < e && c < e) 54389 o[1] > o[7] ? o[1] >= t && t > o[7] && (n += 1) : o[1] < o[7] && o[7] >= t && t > o[1] && (n -= 1); 54390 else { 54391 let p = jn(o, 1, t); 54392 for (let g of p) 54393 if (Hl(o, g, 0) <= e) { 54394 let m = Te(o, g, 1).y; 54395 m > 0 ? n -= 1 : m < 0 && (n += 1) 54396 } 54397 } 54398 } 54399 return n 54400} 54401class GF extends yl { 54402 toolbarOptionsComponent = BF; 54403 toolOptions = {}; 54404 hitModel = null; 54405 constructor() { 54406 super("devHittest") 54407 } 54408 setActive(e) { 54409 super.setActive(e) 54410 } 54411 handlePointerMoveEvent(e, t, n) { 54412 let s = performance.now() 54413 , i = V().activeDocument.getModels(!1).filter(a=>a instanceof Nt).reverse() 54414 , r = null; 54415 for (let a of i) { 54416 if (a instanceof zr) 54417 continue; 54418 let d = new B(t,n); 54419 if (zF(a, d)) { 54420 r = a; 54421 break 54422 } 54423 } 54424 console.log(performance.now() - s + "ms"), 54425 r !== this.hitModel && (this.hitModel && this.hideOverlay(this.hitModel), 54426 r && this.showOverlay(r), 54427 this.hitModel = r) 54428 } 54429 showOverlay(e) { 54430 j().showModelOverlay(e, "modelTree", "highlight") 54431 } 54432 hideOverlay(e) { 54433 j().removeModelOverlay(e, "modelTree", "highlight") 54434 } 54435} 54436new GF; 54437let Xg = { 54438 selection: jC, 54439 nodes: JC, 54440 pen: n_, 54441 pencil: t_, 54442 paintbrush: l_, 54443 text: ZC, 54444 shape: QC,
54445 image: e_ 54446}; 54447const HF = { 54448 name: "Toolbar", 54449 components: { 54450 HyTooltip: pt, 54451 SvgIcon: gt 54452 }, 54453 props: { 54454 floating: Boolean 54455 }, 54456 data() { 54457 return { 54458 toolNames: me(Object.keys(Xg)), 54459 iconToolMapping: me(Xg) 54460 } 54461 }, 54462 computed: { 54463 selToolName: { 54464 get() { 54465 let l = this.$store.tool; 54466 return l == null ? null : l.getName() 54467 }, 54468 set(l) { 54469 this.$store.setTool(l) 54470 } 54471 } 54472 }, 54473 methods: { 54474 onTabPointerClick(l, e) { 54475 l.button === 0 && this.selToolName !== e && (this.selToolName = e) 54476 }, 54477 onKeydown(l) { 54478 let e = l.key; 54479 if (!l.repeat) { 54480 let t = this.toolNames; 54481 if (e === hn) { 54482 let n = t.indexOf(this.selToolName); 54483 n > 0 && (this.selToolName = t[n - 1]) 54484 } else if (e === cs) { 54485 let n = t.indexOf(this.selToolName); 54486 n < t.length - 1 && (this.selToolName = t[n + 1]) 54487 } 54488 } 54489 }, 54490 serializationTest() { 54491 let l = V() 54492 , e = l.activeDocument 54493 , t = performance.now() 54494 , n = JSON.stringify(e, null, 2); 54495 console.log(n), 54496 localStorage.setItem("document", n); 54497 let s = localStorage.getItem("document") 54498 , o = JSON.parse(s); 54499 console.log("serialization time", performance.now() - t), 54500 l.setActiveDocument(fi.fromJSON(o)) 54501 } 54502 } 54503} 54504 , $F = { 54505 class: "toolbar-buttons" 54506} 54507 , XF = { 54508 class: "icon-container" 54509} 54510 , YF = { 54511 class: "tool-options" 54512}; 54513function KF(l, e, t, n, s, o) { 54514 const i = E("svg-icon") 54515 , r = E("hy-tooltip") 54516 , a = E("hy-button"); 54517 return N(), 54518 $("div", { 54519 class: Ne(["toolbar", { 54520 floating: t.floating 54521 }]) 54522 }, [_("div", $F, [(N(!0), 54523 $(Pe, null, Gt(s.toolNames, (d,u)=>(N(), 54524 pe(a, { 54525 ref_for: !0, 54526 ref: "toolbutton", 54527 key: d, 54528 class: Ne(["tool-button", { 54529 "hy-selected": d === o.selToolName 54530 }]), 54531 modelValue: o.selToolName, 54532 "onUpdate:modelValue": e[0] || (e[0] = h=>o.selToolName = h), 54533 onClick: h=>o.onTabPointerClick(h, d), 54534 name: "tool", 54535 value: d 54536 }, { 54537 default: O(()=>[_("div", XF, [w(i, { 54538 svg: s.iconToolMapping[d], 54539 attrs: { 54540 height: null, 54541 width: null 54542 } 54543 }, null, 8, ["svg"])]), w(r, { 54544 getTarget: ()=>l.$refs.toolbutton[u], 54545 label: l.$t("tools." + d + ".name") 54546 }, null, 8, ["getTarget", "label"])]), 54547 _: 2 54548 }, 1032, ["class", "modelValue", "onClick", "value"]))), 128))]), _("div", YF, [vt(l.$slots, "default", {}, void 0, !0)])], 2) 54549} 54550const WF = ie(HF, [["render", KF], ["__scopeId", "data-v-a3d67d1c"]]) 54551 , qF = { 54552 name: "ToolOptionsBar", 54553 components: { 54554 SvgIcon: gt, 54555 HyTooltip: pt, 54556 HyDropdown: xl, 54557 HyPopover: Ql 54558 }, 54559 data() { 54560 return { 54561 optionsComp: null, 54562 toolOptions: null, 54563 showDropdown: !1, 54564 svgs: me({ 54565 moreHor: Tx 54566 }), 54567 elementGap: 32, 54568 compact: !1 54569 } 54570 }, 54571 computed: { 54572 tool() { 54573 return this.$store.tool 54574 } 54575 }, 54576 methods: { 54577 updateOptionsComp() { 54578 let l = this.tool; 54579 this.optionsComp = l && ns(l.getToolbarOptionsComponent()) 54580 }, 54581 closeDropdown() { 54582 let l = this.$refs.dropdown; 54583 l && l.close() 54584 }, 54585 updateDropdownVisible() { 54586 let l = this.$refs.optionsBar 54587 , e = this.$refs.optionsContainer; 54588 if (!e?.children[0]) 54589 return; 54590 let t = [...e.children[0].children] 54591 , n = this.$refs.dropdownContent; 54592 n && t.push(...n.children); 54593 const s = l.clientWidth 54594 , o = getComputedStyle(l) 54595 , i = s - parseFloat(o.paddingLeft) - parseFloat(o.paddingRight); 54596 let r = !1 54597 , a = 0; 54598 for (let d = 0; d < t.length; d++) { 54599 let u = t[d].clientWidth; 54600 if (a += u, 54601 d > 0 && (a += this.elementGap), 54602 a >= i) { 54603 r = !0; 54604 break 54605 } 54606 } 54607 this.showDropdown = r 54608 }, 54609 updateLayout() { 54610 let l = this.$refs.optionsBar.clientWidth; 54611 l > 1024 ? this.elementGap = 32 : this.elementGap = Math.round(Math.max(16, 32 * (l - 768) / 256)), 54612 this.compact = l < 768 54613 } 54614 }, 54615 mounted() { 54616 let l = this.$refs.optionsBar 54617 , e = new ResizeObserver(n=>{ 54618 for (let s of n) 54619 s.contentBoxSize && (this.updateLayout(), 54620 this.closeDropdown(), 54621 this.updateDropdownVisible()) 54622 } 54623 ); 54624 e.observe(l), 54625 this.resizeObserver = e; 54626 let t = new MutationObserver(()=>{ 54627 this.updateDropdownVisible() 54628 } 54629 ); 54630 t.observe(l, { 54631 childList: !0, 54632 subtree: !0 54633 }), 54634 this.mutationObserver = t, 54635 this.updateOptionsComp() 54636 }, 54637 beforeUnmount() { 54638 this.mutationObserver?.disconnect(), 54639 this.resizeObserver?.disconnect() 54640 }, 54641 watch: { 54642 tool() { 54643 this.updateOptionsComp() 54644 } 54645 }, 54646 directives: { 54647 swapContent: { 54648 mounted: (l,e,t)=>{ 54649 let s = t.ctx.refs.optionsContainer.children[0] 54650 , o = []; 54651 for (let i of Array.from(s.children)) 54652 i.offsetTop > 20 && (i.hasAttribute("data-wrapper") && (i = i.children[0]), 54653 i._originalParent = i.parentElement, 54654 i._originalChildIndex = Array.from(i.parentElement.children).indexOf(i), 54655 o.push(i)); 54656 l.append(...o) 54657 } 54658 , 54659 unmounted: l=>{
54660 Array.from(l.children).forEach(e=>{ 54661 let t = e._originalParent; 54662 t.insertBefore(e, t.children[e._originalChildIndex]), 54663 delete e._originalParent, 54664 delete e._originalChildIndex 54665 } 54666 ) 54667 } 54668 } 54669 } 54670} 54671 , jF = { 54672 ref: "optionsBar", 54673 class: "options-bar" 54674} 54675 , JF = { 54676 ref: "dropdownContent", 54677 class: "options-dropdown-content" 54678}; 54679function ZF(l, e, t, n, s, o) { 54680 const i = E("svg-icon") 54681 , r = E("hy-dropdown") 54682 , a = E("hy-tooltip") 54683 , d = Gd("swap-content"); 54684 return N(), 54685 $("div", jF, [_("div", { 54686 ref: "optionsContainer", 54687 class: "options-container", 54688 style: xe({ 54689 columnGap: s.elementGap + "px" 54690 }) 54691 }, [(N(), 54692 pe(G1(s.optionsComp), { 54693 compact: s.compact 54694 }, null, 8, ["compact"]))], 4), wl(_("div", null, [w(r, { 54695 ref: "dropdown", 54696 class: "options-dropdown" 54697 }, { 54698 button: O(()=>[w(i, { 54699 svg: s.svgs.moreHor, 54700 style: { 54701 opacity: "0.7" 54702 } 54703 }, null, 8, ["svg"])]), 54704 default: O(()=>[wl(_("div", JF, null, 512), [[d]])]), 54705 arrow: O(()=>[...e[0] || (e[0] = [])]), 54706 _: 1 54707 }, 512), w(a, { 54708 label: l.$t("moreOptions"), 54709 "get-target": ()=>l.$refs.dropdown 54710 }, null, 8, ["label", "get-target"])], 512), [[ef, s.showDropdown]])], 512) 54711} 54712const QF = ie(qF, [["render", ZF], ["__scopeId", "data-v-ce1f017c"]]) 54713 , Yg = "" + new URL("logo.svg",import.meta.url).href 54714 , eB = `<svg viewBox="0 0 32 32" fill="currentColor"> 54715<path d="M4 3.7c0-1.5 1.2-2.7 2.6-2.7h11.4c1 0 1.8 0.7 2.3 1.2l6.7 6.7c0.6 0.6 1 1.3 1 2.1v17.4c0 1.4-1.2 2.6-2.6 2.6h-18.7c-1.5 0-2.7-1.2-2.7-2.6zM6 28.4c-0.1 0.3 0.3 0.6 0.6 0.6h18.8c0.3 0.1 0.6-0.3 0.6-0.6v-16.4h-6.3c-1.5 0-2.7-1.2-2.7-2.6v-6.4h-10.3c-0.4-0.1-0.7 0.3-0.7 0.6zM25.3 10l-6.3-6.3v5.7c0 0.3 0.3 0.7 0.6 0.6z"/> 54716</svg>` 54717 , tB = `<svg viewBox="0 0 32 32" fill="currentColor"> 54718<path d="M2 5.7c0-1.5 1.2-2.7 2.7-2.7h6c1.2 0 2.4 0.7 3.1 1.6l3.1 3.7c0.3 0.4 1 0.7 1.7 0.7h8.8c1.4 0 2.6 1.2 2.6 2.7v12.7c0 1.4-1.2 2.6-2.6 2.6h-22.7c-1.5 0-2.7-1.2-2.7-2.6zM4 10h11.8c-0.2-0.1-0.3-0.3-0.5-0.4l-3.1-3.8c-0.4-0.4-1-0.8-1.5-0.8h-6c-0.4-0.1-0.7 0.3-0.7 0.7zM4 11v13.4c-0.1 0.3 0.3 0.6 0.7 0.6h22.7c0.3 0.1 0.6-0.3 0.6-0.6v-12.7c0.1-0.4-0.3-0.7-0.6-0.7h-8.5-0.3z"/> 54719</svg>` 54720 , lB = { 54721 name: "StartDialog", 54722 components: { 54723 NewDocumentPanel: rv, 54724 SvgIcon: gt, 54725 HyButton: nt, 54726 HyDialog: pn 54727 }, 54728 props: { 54729 show: { 54730 type: Boolean 54731 } 54732 }, 54733 data() { 54734 return { 54735 tab: "new", 54736 svgs: me({ 54737 newSvg: eB, 54738 openSvg: tB 54739 }), 54740 canDrop: !1 54741 } 54742 }, 54743 computed: { 54744 compact() { 54745 return window.innerWidth < 620 54746 } 54747 }, 54748 emits: ["cancel", "close"], 54749 methods: { 54750 close() { 54751 this.$emit("close", {}) 54752 }, 54753 cancel() { 54754 this.$emit("cancel") 54755 }, 54756 createNewDocument() { 54757 this.$refs.documentPanel?.apply() 54758 }, 54759 onKeypress(l) { 54760 l.ctrlKey && l.keyCode 54761 }, 54762 onDragEnter(l) { 54763 this.canDrop = !0, 54764 l.dataTransfer.dropEffect = "copy" 54765 }, 54766 onDragleave(l) { 54767 this.$refs.dropTarget.contains(l.relatedTarget) || (this.canDrop = !1) 54768 }, 54769 onDragover(l) { 54770 this.canDrop = !0, 54771 l.dataTransfer.dropEffect = "copy", 54772 l.preventDefault() 54773 }, 54774 onDrop(l) { 54775 if (this.canDrop = !1, 54776 l.defaultPrevented) 54777 return; 54778 let t = l.dataTransfer.files; 54779 if (l.preventDefault(), 54780 l.type === "drop" && t != null && t.length > 0) 54781 for (let n of t) { 54782 let s = n.name 54783 , o = s.substr(s.lastIndexOf(".") + 1); 54784 if (["svg"].includes(o)) { 54785 this.openImageFile(n); 54786 break 54787 } 54788 } 54789 }, 54790 async openLocalFile() { 54791 if (window.showOpenFilePicker) { 54792 let l; 54793 try { 54794 if ([l] = await window.showOpenFilePicker({ 54795 multiple: !1, 54796 types: [{ 54797 description: "Image Files", 54798 accept: { 54799 "image/svg+xml": [".svg"] 54800 } 54801 }] 54802 }), 54803 l) { 54804 const e = await l.getFile(); 54805 this.openImageFile(e) 54806 } 54807 } catch {} 54808 } else { 54809 let l = document.createElement("input"); 54810 l.type = "file", 54811 l.accept = ".svg", 54812 l.onchange = async e=>{ 54813 let t = e.target.files[0]; 54814 this.openImageFile(t) 54815 } 54816 , 54817 l.click() 54818 } 54819 }, 54820 openImageFile(l) { 54821 let e = new FileReader; 54822 e.addEventListener("load", ()=>{ 54823 if (l.name.endsWith(".svg")) { 54824 let t = e.result.replace(/^data:.+;base64,/, "") 54825 , n = atob(t); 54826 zs(n).then(s=>{ 54827 this.setDocument(s) 54828 } 54829 ) 54830 } 54831 } 54832 , !1),
54833 e.readAsDataURL(l) 54834 }, 54835 setDocument(l) { 54836 let e = this.$store; 54837 z().setModelsSelected([], e.selectedModels), 54838 e.setActiveDocument(l), 54839 e.documentSettings.setSize(l.getWidth(), l.getHeight()); 54840 let n = Kd(l.getWidth(), l.getHeight()) 54841 , s = e.appSettings; 54842 s.editor.grid.gridX = n, 54843 s.editor.grid.gridY = n, 54844 ae().reset(), 54845 e.setTool("selection") 54846 } 54847 }, 54848 watch: { 54849 "$store.activeDocument": function(l) { 54850 l != null && this.close() 54851 } 54852 } 54853} 54854 , nB = { 54855 key: 0, 54856 class: "compact" 54857} 54858 , sB = { 54859 class: "container-compact" 54860} 54861 , oB = { 54862 class: "content-group hy-elevation-2" 54863} 54864 , iB = { 54865 class: "content-group hy-elevation-2" 54866} 54867 , rB = { 54868 key: 1, 54869 class: "container", 54870 style: { 54871 width: "580px" 54872 } 54873} 54874 , aB = { 54875 class: "dialog-body" 54876} 54877 , dB = { 54878 class: "tabs" 54879} 54880 , uB = { 54881 class: "tabs-wrapper" 54882} 54883 , hB = { 54884 for: "newTab", 54885 class: "tab" 54886} 54887 , cB = { 54888 for: "openTab", 54889 class: "tab" 54890}
54891 , fB = { 54892 class: "content" 54893}; 54894function pB(l, e, t, n, s, o) { 54895 const i = E("new-document-panel") 54896 , r = E("hy-button") 54897 , a = E("svg-icon") 54898 , d = E("hy-dialog"); 54899 return N(), 54900 pe(d, { 54901 show: t.show, 54902 modal: "", 54903 "hide-header": "", 54904 onPointerdownOutside: o.createNewDocument, 54905 onClose: o.close, 54906 onCancel: o.cancel, 54907 useBackdrop: "", 54908 "backdrop-style": "backdrop-filter: blur(2px)" 54909 }, { 54910 default: O(()=>[o.compact ? (N(), 54911 $("div", nB, [e[7] || (e[7] = _("div", { 54912 class: "dialog-header" 54913 }, [_("img", { 54914 src: Yg 54915 }), _("div", { 54916 class: "version-badge" 54917 }, "Beta")], -1)), _("div", sB, [_("div", oB, [_("div", null, se(l.$t("dialogs.start.createNewDocument")), 1), w(i, { 54918 ref: "documentPanel", 54919 compact: o.compact, 54920 onDclose: o.close 54921 }, null, 8, ["compact", "onDclose"])]), _("div", iB, [_("div", null, se(l.$t("dialogs.start.openExistingFile")), 1), w(r, { 54922 primary: "", 54923 onClick: o.openLocalFile 54924 }, { 54925 default: O(()=>[ve(se(l.$t("dialogs.start.openFile")), 1)]), 54926 _: 1 54927 }, 8, ["onClick"])])])])) : (N(), 54928 $("div", rB, [e[8] || (e[8] = _("div", { 54929 class: "dialog-header" 54930 }, [_("img", { 54931 src: Yg 54932 }), _("div", { 54933 class: "version-badge" 54934 }, "Beta")], -1)), _("div", aB, [_("div", dB, [_("div", uB, [_("div", { 54935 class: Ne(["tab-indicator", `indicator-${s.tab}`]) 54936 }, null, 2), wl(_("input", { 54937 id: "newTab", 54938 type: "radio", 54939 name: "tab", 54940 "onUpdate:modelValue": e[0] || (e[0] = u=>s.tab = u), 54941 value: "new", 54942 class: "tab-input" 54943 }, null, 512), [[H0, s.tab]]), _("label", hB, [w(a, { 54944 svg: s.svgs.newSvg 54945 }, null, 8, ["svg"]), _("div", null, se(l.$t("dialogs.start.newDocument")), 1)]), wl(_("input", { 54946 id: "openTab", 54947 type: "radio", 54948 name: "tab", 54949 "onUpdate:modelValue": e[1] || (e[1] = u=>s.tab = u), 54950 value: "open", 54951 class: "tab-input" 54952 }, null, 512), [[H0, s.tab]]), _("label", cB, [w(a, { 54953 svg: s.svgs.openSvg 54954 }, null, 8, ["svg"]), _("div", null, se(l.$t("dialogs.start.openFile")), 1)])])]), _("div", fB, [w(Za, { 54955 name: "fade", 54956 mode: "out-in" 54957 }, { 54958 default: O(()=>[(N(), 54959 pe(Jb, null, [(N(), 54960 $("div", { 54961 key: s.tab, 54962 class: "content-panel" 54963 }, [s.tab === "new" ? (N(), 54964 pe(i, { 54965 key: 0, 54966 ref: "documentPanel", 54967 onClose: o.close 54968 }, null, 8, ["onClose"])) : (N(), 54969 $("div", { 54970 key: 1, 54971 ref: "dropTarget", 54972 class: Ne(["drop-target", { 54973 "drop-target-active": s.canDrop 54974 }]), 54975 onDragenter: e[2] || (e[2] = (...u)=>o.onDragEnter && o.onDragEnter(...u)), 54976 onDragleave: e[3] || (e[3] = (...u)=>o.onDragleave && o.onDragleave(...u)), 54977 onDragover: e[4] || (e[4] = (...u)=>o.onDragover && o.onDragover(...u)), 54978 onDrop: e[5] || (e[5] = (...u)=>o.onDrop && o.onDrop(...u)), 54979 onKeydown: e[6] || (e[6] = (...u)=>o.onKeypress && o.onKeypress(...u)), 54980 tabindex: "0" 54981 }, [_("div", null, se(l.$t("openImageDialog.dropOrPaste")), 1), w(r, { 54982 primary: "", 54983 onClick: o.openLocalFile 54984 }, { 54985 default: O(()=>[ve(se(l.$t("openImageDialog.browseLocal")), 1)]), 54986 _: 1 54987 }, 8, ["onClick"])], 34))]))], 1024))]), 54988 _: 1 54989 })])])]))]), 54990 _: 1 54991 }, 8, ["show", "onPointerdownOutside", "onClose", "onCancel"]) 54992} 54993const gB = ie(lB, [["render", pB], ["__scopeId", "data-v-96aed5e7"]]) 54994 , mB = { 54995 name: "App", 54996 components: { 54997 StartDialog: gB, 54998 HyTooltip: pt, 54999 ToolOptionsBar: QF, 55000 Toolbar: WF, 55001 SvgIcon: gt, 55002 TreeSidebar: IV, 55003 PrivacyBanner: iV, 55004 TopBar: eV,
55005 SelectionDetailsSidebar: vI, 55006 Editor: ZD, 55007 StatusBar: w3 55008 }, 55009 data() { 55010 return { 55011 showTree: !0, 55012 showSelection: !0, 55013 editorWidth: 0, 55014 showStartDialog: !1 55015 } 55016 }, 55017 computed: { 55018 accentColor() { 55019 return V().appSettings.ui.accentColor 55020 } 55021 }, 55022 watch: { 55023 "$store.appSettings.ui.darkMode.isDark": { 55024 handler(l) { 55025 this.setDarkModeClass(l) 55026 }, 55027 immediate: !0 55028 }, 55029 accentColor: { 55030 handler(l) { 55031 this.setAccentColor(l) 55032 }, 55033 immediate: !0 55034 } 55035 }, 55036 mounted() { 55037 let l = document.documentElement.clientWidth; 55038 l < 1280 && (this.showTree = !1, 55039 l < 768 && (this.showSelection = !1)), 55040 this.editorWidth = this.$refs.editorContainer.clientWidth, 55041 new ResizeObserver(()=>{ 55042 this.editorWidth = this.$refs.editorContainer.clientWidth 55043 } 55044 ).observe(this.$refs.editorContainer); 55045 let t = V(); 55046 t.overlayManager = me(new SI), 55047 t.undoManager = me(new wI), 55048 Jn("paste", this.handleClipboardEvent), 55049 Jn("cut", this.handleClipboardEvent), 55050 Jn("copy", this.handleClipboardEvent), 55051 Jn("keydown", this.handleKeydown), 55052 window.addEventListener("beforeunload", s=>{ 55053 ae().canUndo(!0) && (s.returnValue = "", 55054 s.preventDefault()) 55055 } 55056 ), 55057 document.addEventListener("visibilitychange", ()=>{} 55058 ), 55059 t.setTool("selection"); 55060 const n = new URLSearchParams(window.location.search); 55061 if (n.has("empty")) { 55062 let s = parseInt(n.get("width")) 55063 , o = parseInt(n.get("height")); 55064 (isNaN(s) || s <= 0) && (s = 512), 55065 (isNaN(o) || o <= 0) && (o = 512); 55066 const i = new fi(s,o); 55067 el(()=>{ 55068 t.setActiveDocument(i) 55069 } 55070 ) 55071 } else 55072 this.showStartDialog = !0; 55073 window.addEventListener("message", async s=>{ 55074 if (s.origin === window.origin && s.data.type === "loadExtensionSvg") { 55075 const o = s.data.payload; 55076 console.log("Successfully received SVG from the extension!"); 55077 let i = await zs(o); 55078 i && V().setActiveDocument(i) 55079 } 55080 } 55081 ), 55082 window.postMessage({ 55083 type: "hyvectorMounted" 55084 }, window.origin) 55085 }, 55086 unmounted() { 55087 Zn("paste", this.handleClipboardEvent), 55088 Zn("cut", this.handleClipboardEvent), 55089 Zn("copy", this.handleClipboardEvent), 55090 Zn("keydown", this.handleKeydown) 55091 }, 55092 methods: { 55093 getEditorComponent() { 55094 return this.$refs.editor 55095 }, 55096 focusEditor() { 55097 let l = this.$refs.editor; 55098 l && l.viewport.focus() 55099 }, 55100 setDarkModeClass(l) { 55101 let e = document.body.classList; 55102 e.add("no-transition"), 55103 l ? e.add("dark-mode") : e.remove("dark-mode"), 55104 window.requestIdleCallback(()=>{ 55105 document.body.classList.remove("no-transition") 55106 } 55107 ) 55108 }, 55109 setAccentColor(l) { 55110 let e = new ce(l || "#2092FC") 55111 , t = e.r 55112 , n = e.g 55113 , s = e.b 55114 , o = document.documentElement.style; 55115 o.setProperty("--accent-color-comp", t + " " + n + " " + s), 55116 o.setProperty("--accent-color", "rgb(" + t + " " + n + " " + s + " / 1)") 55117 }, 55118 onPointerdown(l) { 55119 let e = this.$refs.mainPanel 55120 , t = this.$refs.editor.viewport 55121 , n = !1 55122 , s = l.target; 55123 for (; s != null; ) { 55124 if (s === e) { 55125 n = !0; 55126 break 55127 } else { 55128 if (s === t || Er(s)) 55129 break; 55130 if (s.nodeName === "LABEL" && Er(s.control)) 55131 break 55132 } 55133 s = s.parentElement 55134 } 55135 n && (this.focusEditor(), 55136 l.preventDefault()) 55137 }, 55138 onFocusout(l) { 55139 let e = this.$refs.mainPanel 55140 , t = l.target; 55141 t.disabled && e.contains(t) && (this.focusEditor(), 55142 l.preventDefault()) 55143 }, 55144 async handleKeydown(l) { 55145 let e = l.key; 55146 if (l.defaultPrevented || l.repeat || ["Alt", "Shift", "Control"].includes(e)) 55147 return; 55148 let t = l.target; 55149 if (e === $s && this.$refs.mainPanel?.contains(t)) { 55150 this.focusEditor(); 55151 return 55152 } 55153 let n = ""; 55154 l.metaKey ? (l.shiftKey && (n += "â§"), 55155 l.ctrlKey && (n += "â"), 55156 n += "â") : l.ctrlKey && (n += "Ctrl+"), 55157 l.shiftKey && (n += "Shift+"); 55158 let s = DD(n + e[0].toUpperCase() + e.substring(1)); 55159 s != null && (this.isTextInoutElement(t) && ["copy", "cut", "paste", "undo", "redo", "deleteSelection", "selectAll"].includes(s) || ["copy", "cut", "paste"].includes(s) || _c(s, l) && l.preventDefault()) 55160 }, 55161 handleClipboardEvent(l) { 55162 l.defaultPrevented || this.isTextInoutElement(l.target) || _c(l.type, l) 55163 }, 55164 storeState() { 55165 let e = V().activeDocument; 55166 try { 55167 let t = JSON.stringify(e, null, 2); 55168 localStorage.setItem("document", t) 55169 } catch (t) { 55170 console.error(t) 55171 } 55172 }, 55173 async onDrop(l) { 55174 let t = l.dataTransfer.files; 55175 if (t?.length > 0) { 55176 l.preventDefault(); 55177 let n = t[0] 55178 , s = n.type; 55179 if (s === "image/svg+xml") { 55180 let o = await t[0].text() 55181 , i = await zs(o) 55182 , r = V() 55183 , a = z() 55184 , d = a.insertDocumentModel(i); 55185 a.setModelsSelected(d, r.selectedModels) 55186 } else if (s === "image/png") { 55187 let o = new FileReader; 55188 o.addEventListener("load", async function() { 55189 let i = new Fo; 55190 await i.setImageDataUrl(this.result); 55191 let r = V() 55192 , a = z(); 55193 a.insertModels([i]), 55194 a.setModelsSelected([i], r.selectedModels) 55195 }, !1), 55196 o.readAsDataURL(n) 55197 } 55198 } 55199 }, 55200 onDragover(l) { 55201 l.dataTransfer.types?.includes("Files") && (l.stopPropagation(), 55202 l.preventDefault(), 55203 l.dataTransfer.dropEffect = "copy") 55204 }, 55205 isTextInoutElement(l) { 55206 let e = l.tagName; 55207 if (e === "TEXTAREA") 55208 return !0; 55209 if (e === "INPUT") { 55210 let t = l.getAttribute("type"); 55211 if (["text", "number"].includes(t)) 55212 return !0 55213 } 55214 return !1 55215 } 55216 } 55217} 55218 , yB = { 55219 style: { 55220 display: "flex", 55221 "flex-direction": "row", 55222 "justify-content": "stretch", 55223 overflow: "hidden", 55224 "user-select": "none", 55225 "min-height": "100px", 55226 flex: "1 1 0" 55227 } 55228} 55229 , vB = { 55230 style: { 55231 display: "flex", 55232 "flex-direction": "column", 55233 "justify-content": "stretch", 55234 overflow: "hidden", 55235 "user-select": "none", 55236 "min-height": "100px", 55237 flex: "1 1 0" 55238 } 55239} 55240 , bB = { 55241 style: { 55242 position: "relative", 55243 display: "flex", 55244 "justify-content": "stretch", 55245 gap: "12px", 55246 width: "100%" 55247 } 55248} 55249 , MB = { 55250 style: { 55251 display: "flex", 55252 overflow: "hidden" 55253 } 55254}
55255 , SB = { 55256 ref: "editorContainer", 55257 class: "center-element" 55258} 55259 , wB = { 55260 ref: "editorContainer", 55261 class: "editor-container" 55262}; 55263function PB(l, e, t, n, s, o) { 55264 const i = E("svg-icon") 55265 , r = E("hy-tooltip") 55266 , a = E("hy-button") 55267 , d = E("hy-group") 55268 , u = E("top-bar") 55269 , h = E("tree-sidebar") 55270 , c = E("tool-options-bar") 55271 , f = E("toolbar") 55272 , p = E("editor") 55273 , g = E("status-bar") 55274 , y = E("selection-details-sidebar") 55275 , m = E("start-dialog") 55276 , b = E("privacy-banner"); 55277 return N(), 55278 $(Pe, null, [_("div", { 55279 ref: "mainPanel", 55280 class: "main-panel", 55281 onPointerdown: e[3] || (e[3] = (...M)=>o.onPointerdown && o.onPointerdown(...M)), 55282 onFocusout: e[4] || (e[4] = (...M)=>o.onFocusout && o.onFocusout(...M)), 55283 onDrop: e[5] || (e[5] = (...M)=>o.onDrop && o.onDrop(...M)), 55284 onDragover: e[6] || (e[6] = (...M)=>o.onDragover && o.onDragover(...M)) 55285 }, [w(u, null, { 55286 default: O(()=>[w(d, null, { 55287 default: O(()=>[w(a, { 55288 ref: "selectionDetails", 55289 type: "button", 55290 class: "hy-toolbar-element", 55291 onClick: e[0] || (e[0] = M=>s.showSelection = !s.showSelection) 55292 }, { 55293 default: O(()=>[w(i, { 55294 svg: '<svg width="22" height="22" viewBox="0 0 22 22" fill="currentColor"><path d="M3 3h15c0.6 0 1 0.5 1 1v14c0 0.6-0.4 1-1 1h-15v-2h10v-12h-10v-2zM17 5h-3v12h3v-12z"/></svg>' 55295 }), w(r, { 55296 "get-target": ()=>l.$refs.selectionDetails, 55297 label: l.$t("toggleSelectionDetails") 55298 }, null, 8, ["get-target", "label"])]), 55299 _: 1 55300 }, 512)]), 55301 _: 1 55302 })]), 55303 _: 1 55304 }), _("div", yB, [w(h, { 55305 show: s.showTree, 55306 onClose: e[1] || (e[1] = M=>s.showTree = !1) 55307 }, null, 8, ["show"]), _("div", vB, [_("div", bB, [s.showTree ? be("", !0) : (N(), 55308 pe(a, { 55309 key: 0, 55310 ref: "objectsTree", 55311 type: "button", 55312 class: "hy-toolbar-element show-tree-button", 55313 onClick: e[2] || (e[2] = M=>s.showTree = !s.showTree) 55314 }, { 55315 default: O(()=>[w(i, { 55316 svg: '<svg viewBox="0 0 14 14" width="14" height="14" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3l4 4-4 4" /><path d="M2 3l4 4-4 4" /></svg>' 55317 }), w(r, { 55318 "get-target": ()=>l.$refs.objectsTree, 55319 label: l.$t("showObjectTree") 55320 }, null, 8, ["get-target", "label"])]), 55321 _: 1 55322 }, 512)), w(c)]), _("div", MB, [w(f), _("div", SB, [_("div", wB, [w(p, { 55323 ref: "editor" 55324 }, null, 512)], 512), w(g)], 512), w(y, { 55325 collapsed: !s.showSelection 55326 }, null, 8, ["collapsed"])])])])], 544), w(m, { 55327 show: s.showStartDialog, 55328 onClose: e[7] || (e[7] = M=>s.showStartDialog = !1) 55329 }, null, 8, ["show"]), e[8] || (e[8] = _("div", { 55330 id: "print-content" 55331 }, null, -1)), w(b)], 64) 55332} 55333const xB = ie(mB, [["render", PB], ["__scopeId", "data-v-edcfbbb0"]]); 55334var CB = function() { 55335 return !!(window.location.hostname === "localhost" || window.location.hostname === "[::1]" || window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)) 55336}, Ac; 55337typeof window < "u" && (typeof Promise < "u" ? Ac = new Promise(function(l) { 55338 return window.addEventListener("load", l) 55339} 55340) : Ac = { 55341 then: function(l) { 55342 return window.addEventListener("load", l) 55343 } 55344}); 55345function _B(l, e) { 55346 e === void 0 && (e = {}); 55347 var t = e.registrationOptions; 55348 t === void 0 && (t = {}), 55349 delete e.registrationOptions; 55350 var n = function(s) { 55351 for (var o = [], i = arguments.length - 1; i-- > 0; ) 55352 o[i] = arguments[i + 1]; 55353 e && e[s] && e[s].apply(e, o) 55354 }; 55355 "serviceWorker"in navigator && Ac.then(function() { 55356 CB() ? (TB(l, n, t), 55357 navigator.serviceWorker.ready.then(function(s) { 55358 n("ready", s) 55359 }).catch(function(s) { 55360 return $r(n, s) 55361 })) : (Xv(l, n, t), 55362 navigator.serviceWorker.ready.then(function(s) { 55363 n("ready", s) 55364 }).catch(function(s) { 55365 return $r(n, s) 55366 })) 55367 }) 55368} 55369function $r(l, e) { 55370 navigator.onLine || l("offline"), 55371 l("error", e) 55372} 55373function Xv(l, e, t) { 55374 navigator.serviceWorker.register(l, t).then(function(n) { 55375 if (e("registered", n), 55376 n.waiting) { 55377 e("updated", n); 55378 return 55379 } 55380 n.onupdatefound = function() { 55381 e("updatefound", n); 55382 var s = n.installing; 55383 s.onstatechange = function() { 55384 s.state === "installed" && (navigator.serviceWorker.controller ? e("updated", n) : e("cached", n)) 55385 } 55386 } 55387 }).catch(function(n) { 55388 return $r(e, n) 55389 }) 55390} 55391function TB(l, e, t) { 55392 fetch(l).then(function(n) { 55393 n.status === 404 ? (e("error", new Error("Service worker not found at " + l)), 55394 Kg()) : n.headers.get("content-type").indexOf("javascript") === -1 ? (e("error", new Error("Expected " + l + " to have javascript content-type, but received " + n.headers.get("content-type"))), 55395 Kg()) : Xv(l, e, t) 55396 }).catch(function(n) { 55397 return $r(e, n) 55398 }) 55399} 55400function Kg() {
55401 "serviceWorker"in navigator && navigator.serviceWorker.ready.then(function(l) { 55402 l.unregister() 55403 }).catch(function(l) { 55404 return $r(emit, l) 55405 }) 55406} 55407var kB = {}; 55408_B(`${kB.BASE_URL}service-worker.js`, { 55409 ready() { 55410 console.log(`App is being served from cache by a service worker. 55411For more details, visit https://goo.gl/AFskqB`) 55412 }, 55413 registered() { 55414 console.log("Service worker has been registered.") 55415 }, 55416 cached() { 55417 console.log("Content has been cached for offline use.") 55418 }, 55419 updatefound() { 55420 console.log("New content is downloading.") 55421 }, 55422 updated() { 55423 console.log("New content is available; please refresh.") 55424 }, 55425 offline() { 55426 console.log("No internet connection found. App is running in offline mode.") 55427 }, 55428 error(l) { 55429 console.error("Error during service worker registration:", l) 55430 } 55431}); 55432class Wg extends Ue { 55433 _parentModel; 55434 _removeIndex; 55435 _removedModels; 55436 constructor(e, t, n) { 55437 super(!0), 55438 this._removedModels = n.slice(), 55439 this._parentModel = e, 55440 this._removeIndex = t 55441 } 55442 async undo() { 55443 z().insertModelsAt(this._removedModels, this._parentModel, this._removeIndex) 55444 } 55445 async redo() { 55446 z().removeModelsAt(this._parentModel, this._removeIndex, this._removedModels.length) 55447 } 55448} 55449class EB extends Ue { 55450 _parentModel; 55451 _insertIndex; 55452 _insertedModels; 55453 constructor(e, t, n) { 55454 super(!0), 55455 this._insertedModels = n.slice(), 55456 this._parentModel = e, 55457 this._insertIndex = t 55458 } 55459 async undo() { 55460 z().removeModelsAt(this._parentModel, this._insertIndex, this._insertedModels.length) 55461 } 55462 async redo() { 55463 z().insertModelsAt(this._insertedModels, this._parentModel, this._insertIndex) 55464 } 55465} 55466class DB extends Ue { 55467 _selectedModels; 55468 _unselectedModels; 55469 constructor(e, t) { 55470 super(!1), 55471 this._selectedModels = e?.slice(), 55472 this._unselectedModels = t?.slice() 55473 } 55474 addEdit(e) { 55475 return !1 55476 } 55477 async undo() { 55478 z().setModelsSelected(this._unselectedModels, this._selectedModels?.slice()) 55479 } 55480 async redo() { 55481 z().setModelsSelected(this._selectedModels?.slice(), this._unselectedModels) 55482 } 55483} 55484class Wf extends Ue { 55485 _oldTransforms; 55486 _newTransforms; 55487 _oldSelectionTransform; 55488 _newSelectionTransform; 55489 _oldSelectionBounds; 55490 _newSelectionBounds; 55491 constructor(e, t, n) { 55492 super(!0), 55493 this._oldTransforms = e.map(s=>s.clone()), 55494 this._oldSelectionTransform = t, 55495 this._oldSelectionBounds = n 55496 } 55497 async undo() { 55498 let e = V(); 55499 this._newTransforms = e.selectedModels.map(n=>n.getSelfTransform()), 55500 this._newSelectionTransform = e.selectionTransform.clone(), 55501 this._newSelectionBounds = e.selectionBounds?.clone(), 55502 z().setSelModelsTransforms(this._oldTransforms, this._oldSelectionTransform, !0, this._oldSelectionBounds) 55503 } 55504 async redo() { 55505 z().setSelModelsTransforms(this._newTransforms, this._newSelectionTransform, !0, this._newSelectionBounds) 55506 } 55507 addEdit(e) { 55508 return !(this.isClosed || !(e instanceof Wf)) 55509 } 55510} 55511class qf extends Ue { 55512 _oldSelPathIndicesMap; 55513 _newSelPathIndicesMap; 55514 constructor(e) { 55515 super(!1), 55516 this._oldSelPathIndicesMap = this._pointsToIndices(e) 55517 } 55518 _pointsToIndices(e) { 55519 let t = new Map, n, s; 55520 return e.forEach(o=>{ 55521 let i = o.getSinglePathModel(); 55522 i !== n && (s = t.get(i), 55523 s || (s = [], 55524 t.set(i, s))), 55525 s.push(o.getIndex()) 55526 } 55527 ), 55528 t 55529 } 55530 _indicesToPoints(e) { 55531 let t = []; 55532 return e.forEach((n,s)=>{ 55533 n.forEach(o=>t.push(s.getNodePointAt(o))) 55534 } 55535 ), 55536 t 55537 } 55538 addEdit(e) { 55539 return this.isClosed || !(e instanceof qf) ? !1 : (this._newSelPathIndicesMap = e._newSelPathIndicesMap, 55540 !0) 55541 } 55542 async undo() { 55543 let e = z() 55544 , t = e.sortedSelNodePoints; 55545 this._newSelPathIndicesMap = this._pointsToIndices(t); 55546 let n = this._indicesToPoints(this._oldSelPathIndicesMap); 55547 e.setNodePointsSelected(n, t) 55548 } 55549 async redo() { 55550 let e = z() 55551 , t = this._indicesToPoints(this._newSelPathIndicesMap); 55552 e.setNodePointsSelected(t, e.sortedSelNodePoints) 55553 } 55554} 55555class OB extends Ue { 55556 _singlePathModel; 55557 _removeIndex; 55558 _nodeInfos;
55559 _adjacentControlCoords; 55560 constructor(e, t, n, s) { 55561 super(!0), 55562 this._singlePathModel = e, 55563 this._removeIndex = t, 55564 this._nodeInfos = n, 55565 this._adjacentControlCoords = s 55566 } 55567 async undo() { 55568 z().insertNodePoints(this._singlePathModel, this._removeIndex, this._nodeInfos.slice(), this._adjacentControlCoords) 55569 } 55570 async redo() { 55571 z().removeNodePoints(this._singlePathModel, this._removeIndex, this._nodeInfos.length) 55572 } 55573} 55574class AB extends Ue { 55575 _pathModel; 55576 _removeIndex; 55577 _removedSinglePathModel; 55578 constructor(e, t, n) { 55579 super(!0), 55580 this._pathModel = e, 55581 this._removeIndex = t, 55582 this._removedSinglePathModel = n 55583 } 55584 async undo() { 55585 z().insertSinglePathModel(this._pathModel, this._removeIndex, this._singlePathModel) 55586 } 55587 async redo() { 55588 z().removeSinglePathModel(this._removeIndex) 55589 } 55590} 55591class _s extends Ue { 55592 textModel; 55593 dot; 55594 dotOld; 55595 markOld; 55596 edits = []; 55597 constructor(e, t, n) { 55598 super(!0), 55599 this.textModel = e, 55600 this.dotOld = t, 55601 this.markOld = n 55602 } 55603 async undo() { 55604 for (let e of this.edits.slice().reverse()) 55605 await e.undo(); 55606 this.dot = V().textSelection.dot, 55607 z().setTextSelected(this.textModel, this.dotOld, this.markOld) 55608 } 55609 async redo() { 55610 for (let e of this.edits) 55611 await e.redo(); 55612 z().setTextSelected(this.textModel, this.dot, this.dot) 55613 } 55614 addEdit(e) { 55615 return this.isClosed ? !1 : e instanceof _s ? (this.edits.push(...e.edits), 55616 this.dot = e.dot, 55617 !0) : ((e instanceof Ba || e instanceof Ry || e instanceof By || e instanceof Fy || e instanceof tr || e instanceof ky) && this.edits.push(e), 55618 !1) 55619 } 55620} 55621class jf extends Ue { 55622 _textModel; 55623 _textModelOld; 55624 _dotNew; 55625 _markNew; 55626 _dotOld; 55627 _markOld; 55628 constructor(e, t, n, s, o, i) { 55629 super(!1), 55630 this._textModel = e, 55631 this._textModelOld = t, 55632 this._dotNew = n, 55633 this._markNew = s, 55634 this._dotOld = o, 55635 this._markOld = i 55636 } 55637 async undo() { 55638 V().setTextSelection(this._textModelOld, this._dotOld, this._markOld) 55639 } 55640 async redo() { 55641 V().setTextSelection(this._textModel, this._dotNew, this._markNew) 55642 } 55643 addEdit(e) { 55644 return !this.isClosed && e instanceof jf && e._textModel === this._textModel ? (this._dot = e._dot, 55645 this._mark = e._mark, 55646 !0) : !1 55647 } 55648} 55649class IB extends Ue { 55650 _singlePathModel; 55651 constructor(e) { 55652 super(!0), 55653 this._singlePathModel = e 55654 } 55655 async undo() { 55656 let e = z() 55657 , t = this._singlePathModel; 55658 e.closeSinglePathModel(t) 55659 } 55660 async redo() { 55661 let e = z() 55662 , t = this._singlePathModel; 55663 e.openSinglePathModel(t) 55664 } 55665} 55666class LB extends Ue { 55667 _singlePathModel; 55668 _endPointMerged; 55669 constructor(e, t) { 55670 super(!0), 55671 this._singlePathModel = e, 55672 this._endPointMerged = t 55673 } 55674 async undo() { 55675 let e = z() 55676 , t = this._singlePathModel; 55677 e.openSinglePathModel(t, !this._endPointMerged) 55678 } 55679 async redo() { 55680 let e = z() 55681 , t = this._singlePathModel; 55682 e.closeSinglePathModel(t) 55683 } 55684} 55685class Jf extends Ue { 55686 _models; 55687 _oldStrokeStyles; 55688 _newStrokeStyles; 55689 constructor(e, t) { 55690 super(), 55691 this._models = e, 55692 this._oldStrokeStyles = t 55693 } 55694 async undo() { 55695 this._newStrokeStyles == null && (this._newStrokeStyles = this._models.map(t=>t.getStrokeStyle().clone())), 55696 z().setModelsStrokeStyle(this._models, this._oldStrokeStyles), 55697 V().updateSelectionStyle(!1, !1, !0) 55698 } 55699 async redo() { 55700 z().setModelsStrokeStyle(this._models, this._newStrokeStyles), 55701 V().updateSelectionStyle(!1, !1, !0) 55702 } 55703 addEdit(e) { 55704 if (this.isClosed || !(e instanceof Jf) || e._models.length !== this._models.length) 55705 return !1; 55706 for (let t = 0; t < this._models.length; t++) 55707 if (this._models[t] !== e._models[t]) 55708 return !1; 55709 return !0 55710 } 55711} 55712class VB extends Af { 55713 constructor(e, t) { 55714 super(e, t) 55715 } 55716 getNewNodePointData(e) { 55717 return e.radius 55718 } 55719 setNodePointsDatas(e, t) { 55720 z().setNodePointsRadius(e, t) 55721 } 55722} 55723class NB extends Ue { 55724 _textModels; 55725 _name; 55726 _oldValues; 55727 _newValues; 55728 constructor(e, t, n, s) { 55729 super(!0), 55730 this._textModels = e, 55731 this._name = t, 55732 this._oldValues = n, 55733 this._newValues = s 55734 } 55735 async undo() { 55736 z().setTextModelProperty(this._textModels, this._name, this._oldValues) 55737 } 55738 async redo() { 55739 z().setTextModelProperty(this._textModels, this._name, this._newValues) 55740 } 55741} 55742class Td extends Ue { 55743 _oldSelectionTransform; 55744 _newSelectionTransform; 55745 _oldSelectionBounds; 55746 _newSelectionBounds; 55747 constructor(e, t) { 55748 super(!0), 55749 this._oldSelectionTransform = e, 55750 this._oldSelectionBounds = t 55751 } 55752 async undo() { 55753 let e = z() 55754 , t = V(); 55755 this._newSelectionTransform = t.selectionTransform.clone(), 55756 this._newSelectionBounds = t.selectionBounds?.clone(), 55757 e.setSelectionTransform(this._oldSelectionTransform, this._oldSelectionBounds) 55758 } 55759 async redo() { 55760 z().setSelectionTransform(this._newSelectionTransform, this._newSelectionBounds) 55761 } 55762 addEdit(e) { 55763 return this.isClosed || !(e instanceof Td) ? !1 : (this._newSelectionTransform = e._newSelectionTransform, 55764 this._newSelectionBounds = e._newSelectionBounds, 55765 !0) 55766 } 55767} 55768class RB extends Ue { 55769 _models; 55770 _name; 55771 _oldValues; 55772 _newValues; 55773 constructor(e, t, n, s) { 55774 super(!0), 55775 this._models = e, 55776 this._name = t, 55777 this._oldValues = s.slice(), 55778 this._newValues = n.slice() 55779 } 55780 async undo() { 55781 z().setShapesProperty(this._models, this._name, this._oldValues) 55782 } 55783 async redo() { 55784 z().setShapesProperty(this._models, this._name, this._newValues) 55785 } 55786 addEdit(e) { 55787 if (e._name !== this._name || e._models.length !== this._models.length) 55788 return !1; 55789 for (let t = 0; t < this._models.length; t++) 55790 if (this._models[t] !== e._models[t]) 55791 return !1; 55792 return this._newValues = e._newValues, 55793 !0 55794 } 55795} 55796class FB extends Ue { 55797 _singlePathModels; 55798 constructor(e) { 55799 super(!0), 55800 this._singlePathModels = e 55801 } 55802 async undo() { 55803 z().reversePaths(this._singlePathModels) 55804 } 55805 async redo() { 55806 z().reversePaths(this._singlePathModels) 55807 } 55808} 55809class Zf extends Ue { 55810 _models; 55811 _oldOpacityValues; 55812 _oldSelectionOpacity; 55813 _newOpacity; 55814 constructor(e, t, n, s) { 55815 super(), 55816 this._models = e, 55817 this._oldOpacityValues = t, 55818 this._oldSelectionOpacity = n, 55819 this._newOpacity = s 55820 } 55821 async undo() {
55822 this._models.forEach((e,t)=>{ 55823 e.setOpacity(this._oldOpacityValues[t]) 55824 } 55825 ), 55826 V().updateSelectionOpacity() 55827 } 55828 async redo() { 55829 this._models.forEach(e=>{ 55830 e.setOpacity(this._newOpacity) 55831 } 55832 ), 55833 V().selectionOpacity = this._newOpacity 55834 } 55835 addEdit(e) { 55836 if (this.isClosed || !(e instanceof Zf) || e._models.length !== this._models.length) 55837 return !1; 55838 for (let t = 0; t < this._models.length; t++) 55839 if (this._models[t] !== e._models[t]) 55840 return !1; 55841 return this._newOpacity = e._newOpacity, 55842 !0 55843 } 55844} 55845class BB extends Ue { 55846 _pathModel; 55847 _insertIndex; 55848 _insertedSinglePathModels; 55849 constructor(e, t, n) { 55850 super(!0), 55851 this._pathModel = e, 55852 this._insertIndex = t, 55853 this._insertedSinglePathModels = n 55854 } 55855 async undo() { 55856 let e = z(); 55857 for (let t of this._insertedSinglePathModels) 55858 e.removeSinglePathModel(t) 55859 } 55860 async redo() { 55861 let e = z() 55862 , t = this._insertIndex; 55863 for (let n of this._insertedSinglePathModels) 55864 e.insertSinglePathModel(this._pathModel, n, t), 55865 t++ 55866 } 55867} 55868class zB extends Ue { 55869 _pathModel; 55870 _oldSinglePathModels; 55871 _newSinglePathModels; 55872 constructor(e, t, n) { 55873 super(!0), 55874 this._pathModel = e, 55875 this._oldSinglePathModels = t, 55876 this._newSinglePathModels = n 55877 } 55878 undo() { 55879 z().setSinglePathModels(this._pathModel, this._oldSinglePathModels) 55880 } 55881 redo() { 55882 z().setSinglePathModels(this._pathModel, this._newSinglePathModels) 55883 } 55884} 55885class UB extends Ue { 55886 _singlePathModel; 55887 _nodeCount; 55888 constructor(e, t) { 55889 super(!0), 55890 this._singlePathModel = e, 55891 this._nodeCount = t 55892 } 55893 async undo() { 55894 z().shiftNodePoints(this._singlePathModel, -this._nodeCount) 55895 } 55896 async redo() { 55897 z().shiftNodePoints(this._singlePathModel, this._nodeCount) 55898 } 55899} 55900class Qf extends Ue { 55901 _models; 55902 _oldBlurValues; 55903 _oldSelectionBlur; 55904 _newBlur; 55905 constructor(e, t, n, s) { 55906 super(), 55907 this._models = e, 55908 this._oldBlurValues = t, 55909 this._oldSelectionBlur = n, 55910 this._newBlur = s 55911 } 55912 async undo() { 55913 this._models.forEach((e,t)=>{ 55914 e.setBlur(this._oldBlurValues[t]) 55915 } 55916 ), 55917 V().updateSelectionBlur() 55918 } 55919 async redo() { 55920 this._models.forEach(e=>{ 55921 e.setBlur(this._newBlur) 55922 } 55923 ), 55924 V().selectionBlur = this._newBlur 55925 } 55926 addEdit(e) { 55927 if (this.isClosed || !(e instanceof Qf) || e._models.length !== this._models.length) 55928 return !1; 55929 for (let t = 0; t < this._models.length; t++) 55930 if (this._models[t] !== e._models[t]) 55931 return !1; 55932 return this._newBlur = e._newBlur, 55933 !0 55934 } 55935} 55936class e0 extends Ue { 55937 _models; 55938 _oldBlendModeValues; 55939 _oldSelectionBlendMode; 55940 _newBlendMode; 55941 constructor(e, t, n, s) { 55942 super(), 55943 this._models = e, 55944 this._oldBlendModeValues = t, 55945 this._oldSelectionBlendMode = n, 55946 this._newBlendMode = s 55947 } 55948 async undo() { 55949 this._models.forEach((e,t)=>{ 55950 e.setBlendMode(this._oldBlendModeValues[t]) 55951 } 55952 ), 55953 V().updateSelectionBlendMode() 55954 } 55955 async redo() { 55956 this._models.forEach(e=>{ 55957 e.setBlendMode(this._newBlendMode) 55958 } 55959 ), 55960 V().selectionBlendMode = this._newBlendMode 55961 } 55962 addEdit(e) { 55963 if (this.isClosed || !(e instanceof e0) || e._models.length !== this._models.length) 55964 return !1; 55965 for (let t = 0; t < this._models.length; t++) 55966 if (this._models[t] !== e._models[t]) 55967 return !1; 55968 return this._newBlendMode = e._newBlendMode, 55969 !0 55970 } 55971} 55972class GB extends Ue { 55973 _model; 55974 _oldLabel; 55975 _newLabel; 55976 constructor(e, t, n) { 55977 super(), 55978 this._model = e, 55979 this._oldLabel = t, 55980 this._newLabel = n 55981 } 55982 async undo() { 55983 z().setModelLabel(this._model, this._oldLabel) 55984 } 55985 async redo() { 55986 z().setModelLabel(this._model, this._newLabel) 55987 } 55988 addEdit(e) { 55989 return !1 55990 } 55991} 55992class t0 extends Ue { 55993 _models; 55994 _oldFillRuleValues; 55995 _oldSelectionFillRule; 55996 _newFillRule; 55997 constructor(e, t, n, s) { 55998 super(), 55999 this._models = e, 56000 this._oldFillRuleValues = t, 56001 this._oldSelectionFillRule = n, 56002 this._newFillRule = s 56003 } 56004 async undo() {
56005 this._models.forEach((e,t)=>{ 56006 e.setFillRule(this._oldFillRuleValues[t]) 56007 } 56008 ), 56009 V().updateSelectionFillRule() 56010 } 56011 async redo() { 56012 this._models.forEach(e=>{ 56013 e.setFillRule(this._newFillRule) 56014 } 56015 ), 56016 V().newFSelectionFillRule = this._newFillRule 56017 } 56018 addEdit(e) { 56019 if (this.isClosed || !(e instanceof t0) || e._models.length !== this._models.length) 56020 return !1; 56021 for (let t = 0; t < this._models.length; t++) 56022 if (this._models[t] !== e._models[t]) 56023 return !1; 56024 return this._newFillRule = e._newFillRule, 56025 !0 56026 } 56027} 56028class l0 extends Ue { 56029 _models; 56030 _oldOffsetStyles; 56031 _newOffsetStyles; 56032 constructor(e, t) { 56033 super(), 56034 this._models = e, 56035 this._oldOffsetStyles = t 56036 } 56037 async undo() { 56038 this._newOffsetStyles == null && (this._newOffsetStyles = this._models.map(t=>t.getOffsetStyle().clone())), 56039 z().setModelsOffsetStyle(this._models, this._oldOffsetStyles), 56040 V().updateSelectionStyle(!1, !1, !0) 56041 } 56042 async redo() { 56043 z().setModelsOffsetStyle(this._models, this._newOffsetStyles), 56044 V().updateSelectionStyle(!1, !1, !0) 56045 } 56046 addEdit(e) { 56047 if (this.isClosed || !(e instanceof l0) || e._models.length !== this._models.length) 56048 return !1; 56049 for (let t = 0; t < this._models.length; t++) 56050 if (this._models[t] !== e._models[t]) 56051 return !1; 56052 return !0 56053 } 56054} 56055class HB { 56056 modelsSelectCallbacks = new Set; 56057 modelsUpdateCallbacks = new Set; 56058 modelsInsertCallbacks = new Set; 56059 modelsRemoveCallbacks = new Set; 56060 pointsSelectCallbacks = new Set; 56061 nodePointsChangeCallbacks = new Set; 56062 sortedSelNodePoints = []; 56063 selectedNodePoints = new Set; 56064 selectedControlPoints = new Set; 56065 constructor() {} 56066 get selectedModels() { 56067 throw new Error("Selected models no longer in element manager") 56068 } 56069 getModelSelectionIndex(e) { 56070 return V().selectedModels.indexOf(e) 56071 } 56072 isModelSelected(e, t=!1) { 56073 return this.getModelSelectionIndex(e) >= 0 || t && this.isAncestorModelSelected(e) 56074 } 56075 isAncestorModelSelected(e) { 56076 let t = e && e.getParentModel(); 56077 for (; t; ) { 56078 if (this.isModelSelected(t)) 56079 return !0; 56080 t = t.getParentModel() 56081 } 56082 return !1 56083 } 56084 setModelsSelected(e, t, n=!1) { 56085 let s = V() 56086 , o = s.selectedModels.slice() 56087 , i = [] 56088 , r = []; 56089 if (t != null) { 56090 for (let a of t) 56091 if (!e?.includes(a) && this.isModelSelected(a, !0)) { 56092 let d = o.indexOf(a); 56093 d >= 0 && (o.splice(d, 1), 56094 r.push(a)) 56095 } 56096 if (this.selectedNodePoints.size > 0) { 56097 let a = Ke(r) 56098 , d = []; 56099 for (let u of a) 56100 if (u.isPath()) 56101 for (let h of u.getSinglePathModels()) 56102 d.push(...h.getNodePoints()); 56103 this.setNodePointsSelected(null, d) 56104 } 56105 } 56106 if (e?.length > 0) 56107 for (let a of e) 56108 this.isModelSelected(a, !0) || (i.push(a), 56109 this.getModelSelectionIndex(a) < 0 && (a.getModels(!1).forEach(h=>{ 56110 let c = o.indexOf(h); 56111 c >= 0 && (o.splice(c, 1), 56112 r.push(h)) 56113 } 56114 ), 56115 o.push(a))); 56116 if (i.length || r.length) { 56117 s.setSelectedModels(o); 56118 let a = s.textSelection;
56119 a && a.textModel && this.setTextSelected(null, 0, 0), 56120 s.updateSelectionStyle(), 56121 s.updateSelectionFillRule(), 56122 s.updateSelectionOpacity(), 56123 s.updateSelectionBlur(), 56124 s.updateSelectionBlendMode(), 56125 this.fireModelSelectionChange(i, r, n); 56126 let d = ae(); 56127 if (!d.inProgress) { 56128 let u = new DB(i,r); 56129 d.addEdit(u) 56130 } 56131 } 56132 } 56133 selectModelRange(e, t) { 56134 let n = V() 56135 , s = n.selectedModels[0]; 56136 if (s == null) 56137 this.setModelsSelected([e], !0); 56138 else if (!s.isAncestorOf(e)) { 56139 if (!e.isAncestorOf(s)) { 56140 let o = s.getParentModel(); 56141 for (; o != null && !o.isAncestorOf(e); ) 56142 o = o.getParentModel(); 56143 if (o == null) 56144 return; 56145 let i = s; 56146 for (; i.getParentModel() !== o; ) 56147 i = i.getParentModel(); 56148 let r = o.getChildModelIndex(i) 56149 , a = e; 56150 for (; a.getParentModel() !== o; ) 56151 a = a.getParentModel(); 56152 let d = o.getChildModelIndex(a) 56153 , u = [s, e]; 56154 if (r > d) { 56155 let h = d; 56156 d = r, 56157 r = h, 56158 h = e, 56159 e = s, 56160 s = h 56161 } 56162 for (i = s; i.getParentModel() !== o; ) { 56163 let h = i.getParentModel(); 56164 for (let c = h.getChildModelIndex(i); c < h.getChildModelCount(); c++) 56165 u.push(h.getChildModel(c)); 56166 i = h 56167 } 56168 for (a = e; a.getParentModel() !== o; ) { 56169 let h = a.getParentModel(); 56170 for (let c = 0; c < h.getChildModelIndex(i); c++) 56171 u.push(h.getChildModel(c)); 56172 a = h 56173 } 56174 for (let h = r + 1; h < d; h++) 56175 u.push(o.getChildModel(h)); 56176 this.setModelsSelected(u, n.selectedModels) 56177 } 56178 } 56179 } 56180 addModelSelectionCallback(e) { 56181 this.modelsSelectCallbacks.add(e) 56182 } 56183 removeModelSelectionCallback(e) { 56184 this.modelsSelectCallbacks.delete(e) 56185 } 56186 addPointSelectionCallback(e) { 56187 this.pointsSelectCallbacks.add(e) 56188 } 56189 removePointSelectionCallback(e) { 56190 this.pointsSelectCallbacks.delete(e) 56191 } 56192 addModelsUpdateCallback(e) { 56193 this.modelsUpdateCallbacks.add(e) 56194 } 56195 addModelsInsertCallback(e) { 56196 this.modelsInsertCallbacks.add(e) 56197 } 56198 removeModelsInsertCallback(e) { 56199 this.modelsInsertCallbacks.delete(e) 56200 } 56201 addModelsRemoveCallback(e) { 56202 this.modelsRemoveCallbacks.add(e) 56203 } 56204 removeModelsRemoveCallback(e) { 56205 this.modelsRemoveCallbacks.delete(e) 56206 } 56207 addNodePointsChangeCallback(e) { 56208 this.nodePointsChangeCallbacks.add(e) 56209 } 56210 removeNodePointsChangeCallback(e) { 56211 this.nodePointsChangeCallbacks.delete(e) 56212 } 56213 fireModelSelectionChange(e, t, n=!1) { 56214 V().tool.onModelSelectionChanged(e, t), 56215 this.modelsSelectCallbacks.forEach(o=>o(e, t, n)) 56216 } 56217 fireNodePointSelectionChange(e, t) { 56218 V().tool.onNodePointsSelectionChanged(e, t), 56219 this.pointsSelectCallbacks.forEach(s=>s(e, t)) 56220 } 56221 fireModelsUpdated(e) { 56222 this.modelsUpdateCallbacks.forEach(t=>t(e)) 56223 } 56224 fireModelsInserted(e, t, n) { 56225 this.modelsInsertCallbacks.forEach(s=>s(e, t, n)) 56226 } 56227 fireModelsRemoved(e, t, n) { 56228 this.modelsRemoveCallbacks.forEach(s=>s(e, t, n)) 56229 } 56230 clearSelection() { 56231 let e = V(); 56232 this.setModelsSelected(null, e.selectedModels) 56233 } 56234 getSelectedNodePointIndex(e) { 56235 const t = this.sortedSelNodePoints 56236 , n = e.getIndex() 56237 , s = e.getSinglePathModelId() 56238 , o = e.getPathModelId(); 56239 let i = 0 56240 , r = t.length - 1; 56241 for (; r >= i; ) { 56242 let a = i + r >> 1 56243 , d = t[a]; 56244 if (d === e) 56245 return a; 56246 { 56247 let u = s - d.getSinglePathModelId(), h; 56248 if (u === 0) 56249 h = n - d.getIndex(); 56250 else { 56251 let c = d.getPathModelId(); 56252 o !== c ? h = o - c : h = u 56253 } 56254 if (h > 0) 56255 i = a + 1; 56256 else if (h < 0) 56257 r = a - 1; 56258 else 56259 return a 56260 } 56261 } 56262 return -i - 1 56263 } 56264 _setNodePointSelected(e, t) { 56265 let n = this.selectedNodePoints; 56266 if (n.has(e) !== t) { 56267 let s = this.sortedSelNodePoints
56268 , o = this.getSelectedNodePointIndex(e); 56269 return t ? (n.add(e), 56270 s.splice(-o - 1, 0, e)) : (n.delete(e), 56271 s.splice(o, 1)), 56272 !0 56273 } 56274 return !1 56275 } 56276 setNodePointsSelected(e, t) { 56277 let n = this.sortedSelNodePoints 56278 , s = Array.from(this.selectedNodePoints); 56279 e === n && (e = e.slice()); 56280 let o = []; 56281 if (e && e.length > 0) 56282 for (let r of e) 56283 this._setNodePointSelected(r, !0) && o.push(r); 56284 let i = []; 56285 if (t && t.length > 0) 56286 if (t === n && (e == null || e.length === 0)) 56287 i = t.slice(), 56288 this.selectedNodePoints.clear(), 56289 this.sortedSelNodePoints.splice(0); 56290 else { 56291 let r = e?.length > 0 ? new Set(e) : null; 56292 for (let a of t) 56293 !r?.has(a) && this._setNodePointSelected(a, !1) && i.push(a) 56294 } 56295 if (o.length || i.length) { 56296 let r = ae(); 56297 if (!r.inProgress) { 56298 let a = new qf(s); 56299 r.addEdit(a) 56300 } 56301 return this.fireNodePointSelectionChange(o, i), 56302 !0 56303 } 56304 return !1 56305 } 56306 setControlPointSelected(e, t) { 56307 let n = this.selectedControlPoints 56308 , s = t !== n.has(e); 56309 return s && (t ? n.add(e) : n.delete(e)), 56310 s 56311 } 56312 clearControlPointsSelection() { 56313 this.selectedControlPoints.clear() 56314 } 56315 isPathPointSelected(e) { 56316 return (e instanceof ut ? this.selectedNodePoints : this.selectedControlPoints).has(e) 56317 } 56318 getSelectedModelsNodePoints() { 56319 let e = V() 56320 , t = [] 56321 , n = Ke(e.selectedModels); 56322 for (let s of n) 56323 if (s instanceof Jl) { 56324 let o = s.getSinglePathModels(); 56325 for (let i of o) 56326 t.push(i.getNodePoints()) 56327 } 56328 return t.flat() 56329 } 56330 setNodePointTypes(e, t) { 56331 let n = ae() 56332 , s = [] 56333 , o = [] 56334 , i = [] 56335 , r = new Set 56336 , a = null 56337 , d = null; 56338 for (let u = 0; u < e.length; u++) { 56339 let h = e[u] 56340 , c = t[u] 56341 , f = h.getNodeType(); 56342 if (f !== c) { 56343 let p = h.getPathModel(); 56344 p !== a && (r.add(p), 56345 d = p.getAggregateTransform()), 56346 s.push(h), 56347 o && (o.push(h.toCoords()), 56348 i.push(f)), 56349 h.setNodeType(c), 56350 h.updateTransformedCoords(d) 56351 } 56352 } 56353 if (s.length > 0) { 56354 if (!n.inProgress) { 56355 let u = new Pd; 56356 u.addEdit(new ts(s,o)), 56357 u.addEdit(new av(s,i)), 56358 u.close(), 56359 n.addEdit(u) 56360 } 56361 this.nodePointsMoved(s, r) 56362 } 56363 } 56364 moveNodePoints(e, t) { 56365 let n = ae() 56366 , s = null; 56367 n.inProgress || (s = []); 56368 let o = new Set 56369 , i = null 56370 , r = null; 56371 for (let a = 0; a < e.length; a++) { 56372 let d = e[a] 56373 , u = d.getPathModel(); 56374 u !== i && (o.add(u), 56375 r = u.getAggregateTransform()), 56376 s && s.push(d.toCoords()); 56377 let h = t[a]; 56378 d.set(...h), 56379 d.updateTransformedCoords(r) 56380 } 56381 if (!n.inProgress) { 56382 let a = new ts(e,s); 56383 n.addEdit(a) 56384 } 56385 this.nodePointsMoved(e, o) 56386 } 56387 reversePaths(e) { 56388 let t = ae() 56389 , n = e.map(r=>r.getPathModel()) 56390 , s = [] 56391 , o = [] 56392 , i = []; 56393 e.forEach(r=>{ 56394 r.reverse(); 56395 let a = r.getNodePoints(); 56396 s.push(...a), 56397 a.forEach(h=>{ 56398 this.isPathPointSelected(h) && i.push(h) 56399 } 56400 ); 56401 let d = r.isClosed() 56402 , u = a.length; 56403 i.forEach(h=>{ 56404 let c = u - h.getIndex() - (d ? 0 : 1) 56405 , f = r.getNodePointAt(c); 56406 o.push(f) 56407 } 56408 ) 56409 } 56410 ), 56411 this.setNodePointsSelected(o, i), 56412 t.inProgress || t.addEdit(new FB(e)), 56413 this.nodePointsMoved(s, n) 56414 } 56415 setNodePointsRadius(e, t) { 56416 let n = ae() 56417 , s = null; 56418 n.inProgress || (s = []); 56419 let o = new Set 56420 , i = null; 56421 for (let a = 0; a < e.length; a++) { 56422 let d = e[a] 56423 , u = d.getPathModel(); 56424 u !== i && o.add(u), 56425 s && s.push(d.radius), 56426 d.radius = t[a] 56427 } 56428 for (let a of o) 56429 a.pathDataUpdated(); 56430 if (!n.inProgress) {
56431 let a = new VB(e,s); 56432 n.addEdit(a) 56433 } 56434 V().tool.onNodePointsRadiusChanged(e, o) 56435 } 56436 nodePointsMoved(e, t) { 56437 t.forEach(s=>s.pathDataUpdated()), 56438 V().tool.onNodePointsMoved(e, t), 56439 this.nodePointsChangeCallbacks.forEach(s=>s(e)) 56440 } 56441 nodePointsChanged(e, t, n, s) { 56442 e.pathDataUpdated(), 56443 V().tool.onNodePointsChanged(e, t, n, s), 56444 this.nodePointsChangeCallbacks.forEach(i=>i(t, n, s)) 56445 } 56446 shiftNodePoints(e, t) { 56447 if (t === 0) 56448 return; 56449 e.shiftNodePoints(t), 56450 e.getPathModel().pathDataUpdated(); 56451 let n = ae(); 56452 n.inProgress || n.addEdit(new UB(e,t)), 56453 this.nodePointsMoved(e.getNodePoints(), [e.getPathModel()]) 56454 } 56455 insertNodePoints(e, t, n, s) { 56456 let o = e.insertNodePoints(t, n, s); 56457 this.nodePointsChanged(e.getPathModel(), o, null); 56458 let i = ae(); 56459 i.inProgress || i.addEdit(new Kf(e,t,o,s)) 56460 } 56461 removeNodePoints(e, t, n) { 56462 let s = e.getNodePoints(), o = s.slice(t, t + n), i = o.map(d=>new la(d)), r; 56463 if (!e.isClosed()) { 56464 if (t === 0) { 56465 let d = s[n]; 56466 r = d && [null, [d.inX, d.inY]] 56467 } else if (t + n === s.length) { 56468 let d = s[t - 1]; 56469 r = d && [[d.outX, d.outY], null] 56470 } 56471 } 56472 e.removeNodePoints(t, n), 56473 this.nodePointsChanged(e.getPathModel(), null, o); 56474 let a = ae(); 56475 a.inProgress || a.addEdit(new OB(e,t,i,r)) 56476 } 56477 deleteSelectedNodePoints() { 56478 let e = this.sortedSelNodePoints.slice(); 56479 if (e.length === 0) 56480 return; 56481 let t = ae(); 56482 t.startCompoundEdit(), 56483 this.setNodePointsSelected(null, e); 56484 let n = new Set, s = new Map, o = new Map, i = new Set, r, a; 56485 for (let d of e) 56486 r == null || r !== d.getSinglePathModel() ? (r = d.getSinglePathModel(), 56487 a = [d], 56488 o.set(r, a)) : a.push(d); 56489 for (let d of o.keys()) { 56490 if (a = o.get(d), 56491 a.length >= d.getNodeCount() - (d.isClosed() ? 0 : 1)) { 56492 let u = d.getPathModel(); 56493 s.has(u) ? s.get(u).push(d) : s.set(u, [d]), 56494 o.delete(d) 56495 } 56496 n.add(d.getPathModel()) 56497 } 56498 for (let d of o.keys()) { 56499 if (a = o.get(d), 56500 d.isClosed() && a.at(0).getIndex() === 0 && a.at(-1).getIndex() === d.getNodeCount() - 1) { 56501 let p = a.findIndex((g,y)=>y > 0 && g.getIndex() !== a[y - 1].getIndex() + 1); 56502 a.push(...a.splice(0, p)), 56503 this.shiftNodePoints(d, p) 56504 } 56505 let u, h = a[0], c = h.getIndex(), f = 1; 56506 for (let p = 0; p < a.length; p++) 56507 if (u = h, 56508 h = a[p + 1], 56509 h == null || u.getNext() !== h) { 56510 i.add(d.getNodePoints()[c].getPrevious()), 56511 i.add(u.getNext()); 56512 let g = d.getNodePoints().slice(c, c + f) 56513 , y = []; 56514 g.forEach(k=>y.push(...k.toCoords())); 56515 let m = g.at(0), b = g.at(-1), M = m.getPrevious(), S = b.getNext(), x, P, C = [], T = []; 56516 if (M != null && M !== b && (C.push(M), 56517 x = M.toCoords(), 56518 T.push(x)), 56519 S === M ? P = x : S != null && S !== b && (C.push(S), 56520 P = S.toCoords(), 56521 T.push(P)), 56522 C.length > 0) { 56523 let k = d.getPath().getCurves() 56524 , D = k.slice(c, c + f).map(Y=>Y.v); 56525 D.unshift(k[c === 0 ? k.length - 1 : c - 1].v); 56526 let I = D.at(0) 56527 , F = D.at(-1); 56528 if (D.find(Y=>!Ae(Y)) == null) 56529 x != null && (x[4] = I[0], 56530 x[5] = I[1]), 56531 P != null && (P[2] = F[6], 56532 P[3] = F[7]); 56533 else { 56534 let Y = hf(D) 56535 , q = Ve.fromBoundsCoords(...D.reduce((te,he)=>gl(he, te), null)) 56536 , re = Ee(q.width, q.height) * .3; 56537 q.expand(re); 56538 let ne = Y.find(te=>{ 56539 if (Ir(te) != null) 56540 return !1; 56541 let he = gl(te); 56542 return !(!q.includes(he[0], he[1]) || !q.includes(he[2], he[3])) 56543 } 56544 ); 56545 if (ne == null) { 56546 let te = D.reduce((ye,_e)=>gl(_e, ye), null) 56547 , he = Se(te[3] - te[1], te[2] - te[0]) 56548 , Me = Te(I, 0, he / 3) 56549 , De = Te(F, 1, he / 3); 56550 x != null && (x[4] = I[0] + Me.x, 56551 x[5] = I[1] + Me.y), 56552 P != null && (P[2] = F[6] - De.x, 56553 P[3] = F[7] - De.y) 56554 } else 56555 x != null && (x[4] = ne[2], 56556 x[5] = ne[3]), 56557 P != null && (P[2] = ne[4], 56558 P[3] = ne[5]) 56559 } 56560 this.removeNodePoints(d, c, f), 56561 this.moveNodePoints(C, T) 56562 } 56563 h != null && (c = h.getIndex(), 56564 f = 1) 56565 } else 56566 f++ 56567 } 56568 for (let d of s.keys()) { 56569 let u = s.get(d); 56570 u.length === d.getSinglePathModels().length ? (this.setModelsSelected(null, [d]), 56571 this.removeModel(d)) : u.forEach(h=>this.removeSinglePathModel(h)) 56572 } 56573 t.endCompoundEdit(), 56574 this.fireModelsUpdated(n) 56575 } 56576 removeSinglePathModel(e) { 56577 let t = e.getPathModel() 56578 , n = t.getSinglePathModels().indexOf(e); 56579 t.removeSinglePathModelAt(n); 56580 let s = ae(); 56581 s.inProgress || s.addEdit(new AB(t,e,n)), 56582 this.nodePointsChanged(t, null, e.getNodePoints()) 56583 } 56584 insertSinglePathModel(e, t, n) { 56585 e.insertSinglePathModels(n, [t]), 56586 this.nodePointsChanged(e, t.getNodePoints(), null) 56587 } 56588 setSinglePathModels(e, t) { 56589 let n = e.getSinglePathModels(); 56590 e.setSinglePathModels(t); 56591 let s = ae(); 56592 s.inProgress || s.addEdit(new zB(e,n,t)), 56593 this.nodePointsChanged(e, null, null) 56594 } 56595 subdivideSinglePathModel(e, t) { 56596 let n = ae(); 56597 if (n.inProgress || n.startCompoundEdit(), 56598 t.sort((s,o)=>s - o), 56599 this.setNodePointsSelected(null, t.map(s=>e.getNodePointAt(s))), 56600 e.isClosed()) { 56601 let s = t.shift(); 56602 this.shiftNodePoints(e, s), 56603 this.openSinglePathModel(e, !1), 56604 t.forEach((o,i)=>t[i] -= s) 56605 } 56606 if (t.length > 0) { 56607 let s = t[0] 56608 , o = e.getPath().getCurves(); 56609 this.removeNodePoints(e, s + 1, e.getNodeCount() - (s + 1)); 56610 let i = e.getPathModel() 56611 , r = t.map((d,u)=>{ 56612 let h = u === t.length - 1 ? o.length : t[u + 1] 56613 , c = o.slice(d, h).map(f=>new Mt(f.v)); 56614 return new Pi(i,new ft(c),!1) 56615 } 56616 ) 56617 , a = i.getSinglePathModels().length; 56618 r.forEach(d=>this.insertSinglePathModel(i, d)), 56619 n.inProgress || n.addEdit(new BB(i,a,r)) 56620 } 56621 n.inProgress || n.endCompoundEdit() 56622 } 56623 openSinglePathModel(e, t) { 56624 let n = ae() 56625 , s = e.getPathModel(); 56626 e.setClosed(!1); 56627 let o = e.getNodePointAt(-1); 56628 t ? (e.removeNodePoints(o.getIndex(), 1), 56629 this.nodePointsMoved([e.getNodePointAt(0), e.getNodePointAt(-1)], [s])) : this.nodePointsChanged(s, [o], null), 56630 n.inProgress || n.addEdit(new IB(e)) 56631 } 56632 closeSinglePathModel(e) { 56633 let t = ae() 56634 , n = e.getNodePointAt(0) 56635 , s = e.getNodePointAt(-1) 56636 , o = s.getIndex() 56637 , i = s.toCoords() 56638 , r = this.isPathPointSelected(n) 56639 , a = n !== s && Math.hypot(s.x - n.x, s.y - n.y) < 1e-6; 56640 if (a ? this.setNodePointsSelected(null, r ? [n, s] : [s]) : r && this.setNodePointsSelected(null, [n]), 56641 e.setClosed(!0, !1), 56642 a) { 56643 this.removeNodePoints(e, o, 1); 56644 let d = n.toCoords(); 56645 d.splice(2, 2, i[2], i[3]), 56646 this.moveNodePoints([n], [d]) 56647 } else 56648 this.nodePointsMoved([n], [e.getPathModel()]); 56649 r && this.setNodePointsSelected([n], null), 56650 t.inProgress || t.addEdit(new LB(e,a)) 56651 } 56652 getCurveLocationAt(e, t, n, s) { 56653 let o = s ** 2, i = new B, r = new B(t,n), a, d, u, h = null, c, f = Ke(e); 56654 for (let p of f) 56655 if (p.isPath()) { 56656 let g = p.getSinglePathModels(); 56657 for (let y of g) { 56658 let m = 0; 56659 for (let b of y.getTransformedCurveValues()) { 56660 if (t >= He(b[0], b[2], b[4], b[6]) - s && t <= Ee(b[0], b[2], b[4], b[6]) + s && n >= He(b[1], b[3], b[5], b[7]) - s && n <= Ee(b[1], b[3], b[5], b[7]) + s) { 56661 let M = jr(b, r); 56662 i = ze(b, M, i); 56663 let S = i.distSquared(t, n); 56664 (h == null ? S <= o : S < o) && (d = p, 56665 u = y, 56666 h = m, 56667 c = M, 56668 a = a ? a.set(i.x, i.y) : i.clone(), 56669 s = Math.sqrt(S)) 56670 } 56671 m++ 56672 } 56673 } 56674 } 56675 return h == null ? null : { 56676 pathModel: d, 56677 singlePathModel: u, 56678 curveIndex: h, 56679 t: c, 56680 p: a, 56681 curve: u._path.getCurve(h) 56682 } 56683 } 56684 getPathPointsAt(e, t, n) { 56685 n == null && (n = 6); 56686 const s = e - n 56687 , o = e + n 56688 , i = t - n 56689 , r = t + n; 56690 let a = this.getPathPointsInRect(s, i, o, r); 56691 if (a.length > 1) { 56692 a.sort((d,u)=>(d.xTransformed - e) ** 2 + (d.yTransformed - t) ** 2 - ((u.xTransformed - e) ** 2 + (u.yTransformed - t) ** 2)); 56693 for (let d = 0; d < a.length; d++) { 56694 let u = a[d]; 56695 if (u instanceof ut) { 56696 d > 0 && (a.splice(d, 1), 56697 a.unshift(u)); 56698 break 56699 } 56700 } 56701 } 56702 return a 56703 } 56704 getPathPointsInRect(e, t, n, s) { 56705 let o = V() 56706 , i = [] 56707 , r = Ke(o.selectedModels); 56708 for (let a of r) 56709 if (a instanceof Jl) { 56710 let d = a.getSinglePathModels(); 56711 for (let u of d) { 56712 let h = u.getNodePoints(); 56713 for (let c of h) 56714 c.xTransformed >= e && c.xTransformed <= n && c.yTransformed >= t && c.yTransformed <= s && i.push(c) 56715 } 56716 } 56717 for (let a of this.selectedControlPoints) 56718 a.xTransformed >= e && a.xTransformed <= n && a.yTransformed >= t && a.yTransformed <= s && i.push(a); 56719 return i 56720 } 56721 removeModel(e) { 56722 let t = e.getParentModel() 56723 , n = t.getChildModelIndex(e); 56724 this.removeModelAt(t, n) 56725 } 56726 removeModels(e) { 56727 new Set(e); 56728 let t = new Map; 56729 e.forEach(n=>{ 56730 let s = n.getParentModel() 56731 , o = s.getChildModelIndex(n) 56732 , i = t.get(s); 56733 i == null ? t.set(s, [o]) : i.push(o) 56734 } 56735 ); 56736 for (const [n,s] of t.entries()) { 56737 s.sort((r,a)=>a - r); 56738 let o = 0 56739 , i = s[0]; 56740 for (let r = 1; r <= s.length; r++) { 56741 let a = s[r]; 56742 a !== i - 1 && (this.removeModelsAt(n, s[r - 1], r - o), 56743 o = r), 56744 i = a 56745 } 56746 } 56747 } 56748 removeModelAt(e, t) { 56749 let n = e.getChildModel(t); 56750 e.removeChildFrom(t); 56751 let s = ae(); 56752 if (!s.inProgress) { 56753 let o = new Wg(e,t,[n]); 56754 s.addEdit(o) 56755 } 56756 this.fireModelsRemoved([n], e, t) 56757 } 56758 removeModelsAt(e, t, n) { 56759 let s = e.removeChildrenFrom(t, n) 56760 , o = ae(); 56761 if (!o.inProgress) { 56762 let i = new Wg(e,t,s); 56763 o.addEdit(i) 56764 } 56765 this.fireModelsRemoved(s, e, t) 56766 } 56767 insertModels(e, t=!1) { 56768 let n = V(), s; 56769 if (n.selectedModels.length > 0) { 56770 let r = n.selectedModels[0]; 56771 if (r.getType() === "clipPath") 56772 s = r; 56773 else { 56774 let d = r.getParentModel(); 56775 (d && d.getType()) === "clipPath" ? s = d : s = n.activeDocument 56776 } 56777 } else 56778 s = n.activeDocument; 56779 let o = ae(); 56780 if (o.inProgress || o.startCompoundEdit(), 56781 !t) { 56782 let r = s.getAggregateTransform().invert() 56783 , a = []; 56784 e.forEach(d=>{ 56785 let u = d.getSelfTransform(); 56786 a.push(u), 56787 d.setSelfTransform(u.multiplyWith(r)) 56788 } 56789 ), 56790 o.inProgress || o.addEdit(new Dn(e,a)) 56791 } 56792 let i = s.getChildModelCount(); 56793 this.insertModelsAt(e, s, i), 56794 o.inProgress || o.endCompoundEdit() 56795 } 56796 insertModelAt(e, t, n) { 56797 this.insertModelsAt([e], t, n) 56798 } 56799 insertModelsAt(e, t, n) { 56800 t.insertChildrenAt(e, n); 56801 let s = ae(); 56802 if (!s.inProgress) { 56803 let o = new EB(t,n,e); 56804 s.addEdit(o) 56805 } 56806 this.fireModelsInserted(e, t, n) 56807 } 56808 replaceModel(e, t) { 56809 let n = e.getParentModel() 56810 , s = n.getChildModelIndex(e); 56811 this.removeModelAt(n, s); 56812 for (let o of t) 56813 this.insertModelAt(o, n, s++) 56814 } 56815 insertDocumentModel(e) { 56816 e.applyOffsetToChildren(); 56817 let t = ae(); 56818 t.startCompoundEdit(); 56819 let n = V().activeDocument; 56820 for (let o of e.globalColorGroups[0]?.colors || []) 56821 if (!n.getGlobalColorByName(o.name)) { 56822 let i = n.addGlobalColor(new Ei(o.name,o.color)); 56823 t.addEdit(new zy(n,i)) 56824 }
56825 e.getGlobalColorRefs().forEach(o=>{ 56826 let i = o.getGlobalColor(); 56827 o.globalColorId = n.getGlobalColorByName(i.name).id, 56828 o.documentModel = n 56829 } 56830 ), 56831 e.getGlobalColorUsages().forEach(o=>o.updatePaintStyle(!0, !0)); 56832 let s = e.getChildModels(); 56833 if (e.removeChildrenFrom(0, s.length), 56834 s.length > 1) { 56835 let o = new Uo; 56836 o.insertChildrenAt(s), 56837 s = [o] 56838 } 56839 return s.length > 0 && this.insertModels(s), 56840 t.endCompoundEdit(), 56841 s 56842 } 56843 setSelectionPaint(e, t) { 56844 let n = V(); 56845 if (n.textSelection.textModel != null) 56846 this.setTextSelectionStyleProperty(t, e && e.clone()); 56847 else { 56848 let o = n.selectedModels; 56849 if (o.length > 0) { 56850 let i = [] 56851 , r = d=>{ 56852 if (i.push(d), 56853 d.getType() === "group") 56854 for (let u of d.getChildModels()) 56855 r(u) 56856 } 56857 ; 56858 o.forEach(d=>{ 56859 r(d) 56860 } 56861 ); 56862 let a = i.filter(d=>d instanceof Nt); 56863 this.setModelsPaint(a, a.map(()=>e), t) 56864 } 56865 } 56866 } 56867 setModelLabel(e, t) { 56868 let n = e.getLabel(); 56869 e.setLabel(t); 56870 let s = ae(); 56871 s.inProgress || s.addEdit(new GB(e,n,t)), 56872 this.fireModelsUpdated([e]) 56873 } 56874 setModelsPaint(e, t, n) { 56875 let s = [] 56876 , o = V() 56877 , i = []; 56878 for (let a = 0; a < e.length; a++) { 56879 let d = e[a] 56880 , u = t[a] 56881 , h = d.getPaint(n); 56882 h?.updateViewFromModel(), 56883 s.push(h), 56884 n === "stroke" && h == null && i.push(d), 56885 d.setPaint(u && u.clone(), n, !1) 56886 } 56887 let r = ae(); 56888 if (r.inProgress || r.startCompoundEdit(), 56889 i.length > 0) { 56890 let a = o.strokeStyle; 56891 this.setModelsStrokeStyle(i, i.map(()=>a)) 56892 } 56893 if (!r.inProgress) { 56894 let a = new pi(n,e,s); 56895 r.addEdit(a), 56896 r.endCompoundEdit(!0) 56897 } 56898 this.fireModelsUpdated(e) 56899 } 56900 setSelectionStrokeStyle(e) { 56901 let t = V(); 56902 if (t.textSelection.textModel != null) 56903 this.setTextSelectionStyleProperty("strokeStyle", e); 56904 else { 56905 let s = []; 56906 t.selectedModels.forEach(r=>r.getModels(!0, s)); 56907 let i = s.filter(r=>r instanceof Nt); 56908 this.setModelsStrokeStyle(i, i.map(()=>e)) 56909 } 56910 } 56911 setModelsStrokeStyle(e, t) { 56912 let n = e.filter(i=>i instanceof Nt) 56913 , s = n.map(i=>i.getStrokeStyle().clone()); 56914 e.forEach((i,r)=>i.setStrokeStyle(t[r])); 56915 let o = ae(); 56916 if (!o.inProgress) { 56917 let i = new Jf(n,s); 56918 o.addEdit(i) 56919 } 56920 this.fireModelsUpdated(e) 56921 } 56922 setSelectionFillRule(e) { 56923 let t = V() 56924 , n = t.selectedModels 56925 , s = [] 56926 , o = []; 56927 n.forEach(r=>{ 56928 if (r.getFillRule != null) { 56929 let a = r.getFillRule(); 56930 a !== e && (r.setFillRule(e), 56931 s.push(r), 56932 o.push(a)) 56933 } 56934 } 56935 ); 56936 let i = t.selectionFillRule; 56937 if (t.selectionFillRule = e, 56938 s.length > 0) { 56939 let r = ae(); 56940 if (!r.inProgress) { 56941 let a = new t0(s,o,i,e); 56942 r.addEdit(a), 56943 this.fireModelsUpdated(n) 56944 } 56945 } 56946 } 56947 setModelsOffsetStyle(e, t) { 56948 let n = e.filter(r=>r instanceof Nt) 56949 , s = n.map(r=>r.getOffsetStyle()?.clone()) 56950 , o = performance.now(); 56951 e.forEach((r,a)=>r.setOffsetStyle(t[a])), 56952 e.forEach(r=>r.pathDataUpdated?.()), 56953 console.log(Math.round(performance.now() - o) + "ms"); 56954 let i = ae(); 56955 if (!i.inProgress) { 56956 let r = new l0(n,s); 56957 i.addEdit(r) 56958 } 56959 this.fireModelsUpdated(e) 56960 } 56961 setSelectionOpacity(e) { 56962 let t = V() 56963 , n = t.selectedModels 56964 , s = [] 56965 , o = [];
56966 n.forEach(r=>{ 56967 if (r instanceof Nt) { 56968 let a = r.getOpacity(); 56969 a !== e && (r.setOpacity(e), 56970 s.push(r), 56971 o.push(a)) 56972 } 56973 } 56974 ); 56975 let i = t.selectionOpacity; 56976 if (t.selectionOpacity = e, 56977 s.length > 0) { 56978 let r = ae(); 56979 if (!r.inProgress) { 56980 let a = new Zf(s,o,i,e); 56981 r.addEdit(a), 56982 this.fireModelsUpdated(n) 56983 } 56984 } 56985 } 56986 setSelectionBlur(e) { 56987 let t = V() 56988 , n = t.selectedModels 56989 , s = [] 56990 , o = []; 56991 n.forEach(r=>{ 56992 if (r instanceof Nt) { 56993 let a = r.getBlur(); 56994 a !== e && (r.setBlur(e), 56995 s.push(r), 56996 o.push(a)) 56997 } 56998 } 56999 ); 57000 let i = t.selectionBlur; 57001 if (t.selectionBlur = e, 57002 s.length > 0) { 57003 let r = ae(); 57004 if (!r.inProgress) { 57005 let a = new Qf(s,o,i,e); 57006 r.addEdit(a), 57007 this.fireModelsUpdated(n) 57008 } 57009 } 57010 } 57011 setSelectionBlendMode(e) { 57012 let t = V() 57013 , n = t.selectedModels 57014 , s = [] 57015 , o = []; 57016 n.forEach(r=>{ 57017 if (r instanceof Nt) { 57018 let a = r.getBlendMode(); 57019 a !== e && (r.setBlendMode(e), 57020 s.push(r), 57021 o.push(a)) 57022 } 57023 } 57024 ); 57025 let i = t.selectionBlendMode; 57026 if (t.selectionBlendMode = e, 57027 s.length > 0) { 57028 let r = ae(); 57029 if (!r.inProgress) { 57030 let a = new e0(s,o,i,e); 57031 r.addEdit(a), 57032 this.fireModelsUpdated(n) 57033 } 57034 } 57035 } 57036 setSelModelsTransforms(e, t, n, s) { 57037 let o = V() 57038 , i = o.selectedModels 57039 , r = i.map(h=>h.getSelfTransform()); 57040 i.forEach((h,c)=>h.setSelfTransform(e[c])); 57041 let a = o.selectionTransform.clone(); 57042 o.selectionTransform.setFromTransform(t), 57043 o.updateSelectionStyle(!0, !0, !1); 57044 let d = o.selectionBounds?.clone(); 57045 o.updateSelectionBounds(), 57046 o.updateTransformedSelectionBounds(); 57047 let u = ae(); 57048 if (!u.inProgress) { 57049 let h = new Wf(r,a,d); 57050 u.addEdit(h) 57051 } 57052 o.tool.onSelectionGeometryChanged() 57053 } 57054 setSelectionTransform(e, t) { 57055 let n = V() 57056 , s = n.selectionTransform.clone() 57057 , o = n.selectionBounds?.clone(); 57058 if (t == null) { 57059 let r = n.selectedModels; 57060 r.length === 1 ? t = r[0].getBounds() : t = r.reduce((a,d)=>{ 57061 let u = d.getTransformedBounds(); 57062 return a ? a.addRect(u) : u 57063 } 57064 , null) 57065 } 57066 n.selectionTransform.setFromTransform(e), 57067 n.selectionBounds = t; 57068 let i = ae(); 57069 if (!i.inProgress) { 57070 let r = new Td(s,o); 57071 i.addEdit(r) 57072 } 57073 n.tool.onSelectionGeometryChanged() 57074 } 57075 convertModelToPath(e, t=!0) { 57076 let n; 57077 if (e.isPath() || e.getType() === "group" || e.getType() === "clipPath") { 57078 if (t) 57079 for (let s = 0; s < e.getChildModelCount(); s++) 57080 this.convertModelToPath(e.getChildModel(s), !0); 57081 n = e 57082 } else if (e instanceof Rn) { 57083 let s = e.toPathModels(); 57084 s.length <= 1 ? n = s[0] : (n = new Uo, 57085 s.forEach(o=>n.insertChildAt(o))) 57086 } else 57087 n = e.toPathModel() ?? e; 57088 return n !== e && (n == null || n instanceof bt && n.isEmpty() ? this.removeModel(e) : this.replaceModel(e, [n])), 57089 n 57090 } 57091 convertSelectionToPath() { 57092 let t = V().selectedModels.slice(); 57093 if (t.length > 0) { 57094 let n = ae(); 57095 n.startCompoundEdit(); 57096 let s = []; 57097 for (let o of t) { 57098 let i = this.convertModelToPath(o); 57099 i != null && s.push(i) 57100 } 57101 this.setModelsSelected(s, t), 57102 n.endCompoundEdit() 57103 } 57104 } 57105 applySelectionTransform() { 57106 let e = ae(); 57107 e.startCompoundEdit(), 57108 e.addEdit(new Td(V().selectionTransform.clone(),null)); 57109 let n = V().selectedModels.slice(); 57110 if (n.length > 0) { 57111 let s = []; 57112 for (let o of n) { 57113 if (o.getType() === "group" || o.getType() === "clipPath") { 57114 let i = o.getSelfTransform() 57115 , r = o.getChildModels() 57116 , a = []; 57117 for (let d = 0; d < r.length; d++) { 57118 let u = r[d] 57119 , h = u.getSelfTransform(); 57120 a.push(h), 57121 u.setSelfTransform(h.preMultiplyWith(i, !0)) 57122 } 57123 e.addEdit(new Dn(r,a)) 57124 } 57125 if (o.isPath()) { 57126 let i = o 57127 , r = i.getFillPaint(); 57128 r = r && r.isTransformable() ? r.clone() : r; 57129 let a = i.getStrokePaint(); 57130 a = a && a.isTransformable() ? a.clone() : a; 57131 let d = [] 57132 , u = []; 57133 for (let c of o._singlePathModels) { 57134 let f = c.getNodePoints(); 57135 d.push(...f), 57136 u.push(...f.map(p=>p.toCoords())) 57137 } 57138 let h = i.getSelfTransform(); 57139 o.applySelfTransform(), 57140 r && r.isTransformable() && e.addEdit(new pi("fill",[i],[r])), 57141 a && a.isTransformable() && e.addEdit(new pi("stroke",[i],[a])), 57142 e.addEdit(new Dn([i],[h])), 57143 e.addEdit(new ts(d,u)), 57144 r && r.isTransformable() && r.updateViewFromModel(), 57145 a && a.isTransformable() && a.updateModelFromVie
57145w(), 57146 s.push(i) 57147 } else if (o.getType() === "group") { 57148 let i = o.getSelfTransform(); 57149 o.setSelfTransform(new oe), 57150 e.addEdit(new Dn([o],[i])), 57151 s.push(o) 57152 } else { 57153 let i = this.convertModelToPath(o, !1); 57154 s.push(i) 57155 } 57156 } 57157 this.setModelsSelected(s, n), 57158 e.endCompoundEdit() 57159 } 57160 } 57161 async setTextSelectionStyleProperty(e, t) { 57162 let n = V(), s = n.tool, o = n.textSelection, i = o.textModel, r = ae(), a; 57163 if (!r.inProgress) { 57164 let d = o.dot 57165 , u = o.mark 57166 , h = r.undoStack.at(-1); 57167 h && h instanceof _s ? a = h : (a = new _s(i,d,u), 57168 r.addEdit(a)) 57169 } 57170 if (i == null) 57171 n.selectedModels.filter(u=>u.getType() === "text").forEach(async u=>await u.setStyleAttribute(e, t, 0, u.getTextLength(), a)), 57172 window.setTimeout(()=>s.onSelectionGeometryChanged(), 10); 57173 else { 57174 let d = s.caretDot 57175 , u = s.caretMark 57176 , h = He(d, u) 57177 , c = Math.abs(d - u); 57178 c > 0 && (await i.setStyleAttribute(e, t, h, c, a), 57179 s.onSelectionGeometryChanged()) 57180 } 57181 } 57182 setTextModelProperty(e, t, n) { 57183 if (e.length === 0) 57184 return; 57185 let s = ae(); 57186 if (!s.inProgress) { 57187 let i = e.map(a=>a.getAlignment()) 57188 , r = new NB(e,"alignment",i,n); 57189 s.addEdit(r) 57190 } 57191 e.forEach((i,r)=>i.setParagraphStyleAttribute(t, n[r])); 57192 let o = V().tool; 57193 o != null && o.setCaret && o.setCaret(o.caretDot, o.caretMar
57193k) 57194 } 57195 insertTextAtSelection(e, t) { 57196 let n = V() 57197 , s = n.textSelection 57198 , o = s && s.textModel; 57199 if (o) { 57200 let i = s.dot, r = s.mark, a = ae(), d; 57201 if (!a.inProgress) { 57202 let c = a.undoStack.at(-1); 57203 c && c instanceof _s ? d = c : (d = new _s(o,i,r), 57204 a.addEdit(d)) 57205 } 57206 let u = He(i, r); 57207 if (i !== r) { 57208 let c = He(i, r) 57209 , f = Ee(i, r) - c; 57210 o.deleteText(c, f, d) 57211 } 57212 o.insertText(e, u, t, d); 57213 let h = u + e.length; 57214 n.setTextSelection(o, h, h), 57215 n.tool.onTextSelectionChanged(o, o, h, h) 57216 } 57217 } 57218 deleteSelectedText() { 57219 let t = V().textSelection 57220 , n = t && t.textModel; 57221 if (n) { 57222 let s = t.dot 57223 , o = t.mark; 57224 if (s !== o) { 57225 let i = He(s, o) 57226 , r = Ee(s, o) - i; 57227 this.deleteText(n, i, r) 57228 } 57229 } 57230 } 57231 deleteText(e, t, n) { 57232 let s = ae(), o = V(), i; 57233 if (!s.inProgress) { 57234 let r = s.undoStack.at(-1); 57235 if (r && r instanceof _s) 57236 i = r; 57237 else { 57238 let a = o.textSelection 57239 , d = a.dot 57240 , u = a.mark; 57241 i = new _s(e,d,u), 57242 s.addEdit(i) 57243 } 57244 } 57245 e.deleteText(t, n, i), 57246 o.setTextSelection(e, t, t), 57247 o.tool.onTextSelectionChanged(e, e, t, t) 57248 } 57249 setTextSelected(e, t, n) { 57250 n == null && (n = t); 57251 let s = V() 57252 , o = s.textSelection 57253 , i = o.textModel 57254 , r = o.dot 57255 , a = o.mark; 57256 if (e !== i || e != null && (t !== r || n !== a)) { 57257 s.setTextSelection(e, t, n), 57258 s.updateSelectionStyle(); 57259 let u = ae(); 57260 if (!u.inProgress) { 57261 let h = new jf(e,i,t,n,r,a); 57262 u.addEdit(h) 57263 } 57264 } 57265 this.fireTextSelectionChangeEvent(e, i, t, n, r, a) 57266 } 57267 fireTextSelectionChangeEvent(e, t, n, s, o, i) { 57268 V().tool.onTextSelectionChanged(e, t, n, s, o, i) 57269 } 57270 setShapesProperty(e, t, n) { 57271 let s = [] 57272 , o = []; 57273 if (e.forEach((i,r)=>{ 57274 let a = i.getShapePropertyValue(t) 57275 , d = n[r]; 57276 a !== d && (i.setShapeProperty(t, d), 57277 s.push(i), 57278 o.push(a)) 57279 } 57280 ), 57281 s.length > 0) { 57282 let i = ae(); 57283 if (!i.inProgress) { 57284 let a = new RB(s,t,n,o); 57285 i.addEdit(a) 57286 } 57287 V().tool.onSelectionGeometryChanged() 57288 } 57289 } 57290 booleanOpModels(e, t, n) { 57291 let s = Ke(e); 57292 if (s.length > (t === "unite" ? 0 : 1)) { 57293 let o = n && n.primaryModelType, i = n && n.keepOriginalModels, r, a; 57294 if (o === "front" || o === "back") { 57295 let g = s.slice(); 57296 nu(g), 57297 o === "back" ? (r = g.at(0), 57298 a = g.slice(1)) : (r = g.at(-1), 57299 a = g.slice(0, g.length - 1)) 57300 } else 57301 o === "firstSelected" ? (r = s.at(0), 57302 a = s.slice(1)) : (r = s.at(-1), 57303 a = s.slice(0, s.length - 1)); 57304 let d; 57305 if (t === "unite") 57306 d = jl; 57307 else if (t === "subtract") 57308 d = lu; 57309 else if (t === "intersect") 57310 d = QP; 57311 else if (t === "exclude") 57312 t = ex; 57313 else 57314 throw new Error("Unknown boolean type: " + t); 57315 let u = r.getAggregateTransform() 57316 , h = r.getPaths(u, -1, !0) 57317 , c = r.getFillRule(); 57318 h = jl(h, null, c); 57319 for (let g of a) { 57320 let y = g.getAggregateTransform() 57321 , m = g.getPaths(y, -1, !0) 57322 , b = g.getFillRule(); 57323 h = d(h, m, "nonzero", b) 57324 } 57325 let f = ae(); 57326 f.startCompoundEdit(); 57327 let p; 57328 if (h.length !== 0) { 57329 p = new bt(h); 57330 let g = r; 57331 for (; !e.includes(g); ) 57332 g = g.getParentModel(); 57333 let y = g.getParentModel() 57334 , m = y.getChildModelIndex(g); 57335 this.insertModelAt(p, y, m + 1), 57336 p.setSelfTransform(y.getAggregateTransform().invert()), 57337 r.copyGraphicsAttributes(p) 57338 } 57339 return i || this.removeModels(e), 57340 f.endCompoundEdit(), 57341 p 57342 } 57343 } 57344 booleanUniteModels(e, t) { 57345 return this.booleanOpModels(e, "unite", t) 57346 } 57347 booleanSubtractModels(e, t) { 57348 return this.booleanOpModels(e, "subtract", t) 57349 } 57350 booleanIntersectModels(e, t) { 57351 return this.booleanOpModels(e, "intersect", t) 57352 } 57353} 57354const $B = {
57355 name: "ZoomInput", 57356 components: { 57357 HyButton: nt 57358 }, 57359 data() { 57360 return {} 57361 }, 57362 computed: { 57363 zoom: { 57364 get() { 57365 return Math.round(this.$store.zoom) 57366 }, 57367 set(l) { 57368 l = Math.round(l), 57369 this.$editorComponent.zoomTo(l) 57370 } 57371 } 57372 }, 57373 methods: { 57374 incrementZoom() { 57375 this.$editorComponent.zoomStep(-.5) 57376 }, 57377 decrementZoom() { 57378 this.$editorComponent.zoomStep(.5) 57379 } 57380 } 57381} 57382 , XB = { 57383 class: "zoom-input" 57384} 57385 , YB = { 57386 style: { 57387 flex: "1 1 auto", 57388 "text-align": "start" 57389 } 57390} 57391 , KB = { 57392 class: "label" 57393}; 57394function WB(l, e, t, n, s, o) { 57395 const i = E("hy-button"); 57396 return N(), 57397 $("div", XB, [_("div", YB, se(l.$t("zoom")), 1), w(i, { 57398 class: "button", 57399 onClick: o.decrementZoom, 57400 tabindex: "-1" 57401 }, { 57402 default: O(()=>[...e[0] || (e[0] = [ve("-", -1)])]), 57403 _: 1 57404 }, 8, ["onClick"]), _("div", KB, se(o.zoom + "%"), 1), w(i, { 57405 class: "button", 57406 onClick: o.incrementZoom, 57407 tabindex: "-1" 57408 }, { 57409 default: O(()=>[...e[1] || (e[1] = [ve("+", -1)])]), 57410 _: 1 57411 }, 8, ["onClick"])]) 57412} 57413const qB = ie($B, [["render", WB], ["__scopeId", "data-v-2c997ecc"]]); 57414let Xr = V(); 57415Xr.elementManager = me(new HB); 57416window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", ()=>{ 57417 Xr.appSettings.ui.darkMode.automatic && (Xr.appSettings.ui.darkMode.isDark = window.matchMedia("(prefers-color-scheme: dark)").matches) 57418} 57419); 57420const Ol = bm(xB); 57421self.hyApp = Ol; 57422Ol.config.errorHandler = (l,e,t)=>{ 57423 kc(l) 57424} 57425; 57426const Vi = Ol.config.globalProperties; 57427Ol.use(Gr); 57428Vi.$i18n = Gr; 57429Ol.component("hy-button", nt); 57430Ol.component("hy-checkbox", ml); 57431Ol.component("hy-radio", en); 57432Ol.component("hy-group", Dt); 57433Ol.component("hy-input", Xs); 57434Ol.component("hy-input-number", Lt); 57435Ol.component("zoomInput", qB); 57436Vi.$isDevelopment = !1; 57437Ol.use(cf); 57438Vi.$pinia = me(cf); 57439Vi.$store = me(Xr); 57440let Yv = Ol.mount("#app"); 57441Vi.$editorComponent = me(Yv.getEditorComponent()); 57442Vi.$focusEditor = me(Yv.focusEditor); 57443Ie(()=>Xr.appSettings.general.language, l=>{ 57444 Gr.global.locale.value = l, 57445 document.documentElement.setAttribute("lang", l) 57446} 57447, { 57448 immediate: !0 57449});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.